• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IEffectData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中forestry.api.genetics.IEffectData的典型用法代码示例。如果您正苦于以下问题:Java IEffectData类的具体用法?Java IEffectData怎么用?Java IEffectData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IEffectData类属于forestry.api.genetics包,在下文中一共展示了IEffectData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doEffectThrottled

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
	List<EntityLivingBase> entityList = this.getEntitiesWithinRange(genome, housing, EntityLivingBase.class);

	for (EntityLivingBase e : entityList) {
		if (this.isMalicious) {
			int armorPieces = BeeManager.armorApiaristHelper.wearsItems(e, getUID(), true);
			int finalDuration = this.duration / 4 * (4 - armorPieces);
			if (finalDuration > 0) {
				e.addPotionEffect(new PotionEffect(this.potionId, finalDuration, 0));
			}
		} else {
			if (e instanceof EntityPlayer) {
				e.addPotionEffect(new PotionEffect(this.potionId, this.duration, 0));
			}
		}
	}
	storedData.setInteger(0, 0);

	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:22,代码来源:AlleleEffectPotion.java


示例2: doEffectThrottled

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
	World world = housing.getWorld();
	ChunkCoordinates coords = housing.getCoordinates();
	IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);

	// Get random coords within territory
	int xRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
	int yRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
	int zRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);

	int xCoord = coords.posX + world.rand.nextInt(xRange) - xRange / 2;
	int yCoord = coords.posY + world.rand.nextInt(yRange) - yRange / 2;
	int zCoord = coords.posZ + world.rand.nextInt(zRange) - zRange / 2;

	BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
	transmutationController.attemptTransmutations(world, biome, 
			new ItemStack(world.getBlock(xCoord, yCoord, zCoord), 1, world.getBlockMetadata(xCoord, yCoord, zCoord)), xCoord, yCoord, zCoord);

	storedData.setInteger(0, 0);

	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:24,代码来源:AlleleEffectTransmuting.java


示例3: doEffect

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {

	if (isThrottled(storedData))
		return storedData;

	AxisAlignedBB beatifyBox = getBounding(genome, housing, 1.0f);
	List list = housing.getWorld().getEntitiesWithinAABB(EntityPlayer.class, beatifyBox);

	for (Object obj : list) {
		EntityPlayer player = (EntityPlayer) obj;
		player.addPotionEffect(new PotionEffect(potionId, duration, 0));
	}

	return storedData;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:17,代码来源:AlleleEffectPotion.java


示例4: doEffect

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {

	if (isThrottled(storedData))
		return storedData;

	AxisAlignedBB hurtBox = getBounding(genome, housing, 1.0f);
	List list = housing.getWorld().getEntitiesWithinAABB(EntityMob.class, hurtBox);

	for (Object obj : list) {
		EntityMob mob = (EntityMob) obj;
		mob.attackEntityFrom(DamageSource.generic, 2);
	}

	return storedData;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:17,代码来源:AlleleEffectHeroic.java


示例5: doEffect

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData[] doEffect(IEffectData[] storedData, IBeeHousing housing) {
	IAlleleBeeEffect effect = genome.getEffect();

	if (effect == null)
		return null;

	storedData[0] = doEffect(effect, storedData[0], housing);

	// Return here if the primary can already not be combined
	if (!effect.isCombinable())
		return storedData;

	IAlleleBeeEffect secondary = (IAlleleBeeEffect) genome.getInactiveAllele(EnumBeeChromosome.EFFECT.ordinal());
	if (!secondary.isCombinable())
		return storedData;

	storedData[1] = doEffect(secondary, storedData[1], housing);

	return storedData;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:22,代码来源:Bee.java


示例6: doFX

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData[] doFX(IEffectData[] storedData, IBeeHousing housing) {
	IAlleleBeeEffect effect = genome.getEffect();

	if (effect == null)
		return null;

	storedData[0] = doFX(effect, storedData[0], housing);

	// Return here if the primary can already not be combined
	if (!effect.isCombinable())
		return storedData;

	IAlleleBeeEffect secondary = (IAlleleBeeEffect) genome.getInactiveAllele(EnumBeeChromosome.EFFECT.ordinal());
	if (!secondary.isCombinable())
		return storedData;

	storedData[1] = doFX(secondary, storedData[1], housing);

	return storedData;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:22,代码来源:Bee.java


示例7: doEffect

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {

	if (isThrottled(storedData))
		return storedData;

	AxisAlignedBB beatifyBox = getBounding(genome, housing, 1.0f);
	List list = housing.getWorld().getEntitiesWithinAABB(EntityPlayer.class, beatifyBox);

	for (Object obj : list) {
		EntityPlayer player = (EntityPlayer) obj;
		player.addExperience(2);
	}

	return storedData;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:17,代码来源:AlleleEffectExploration.java


示例8: doFX

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {

	int[] area = genome.getTerritory();
	area[0] *= housing.getTerritoryModifier(genome);
	area[1] *= housing.getTerritoryModifier(genome);
	area[2] *= housing.getTerritoryModifier(genome);

	if (area[0] < 1) {
		area[0] = 1;
	}
	if (area[1] < 1) {
		area[1] = 1;
	}
	if (area[2] < 1) {
		area[2] = 1;
	}

	PluginForestryApiculture.proxy.addBeeHiveFX(Defaults.TEXTURE_PARTICLES_BEE, housing.getWorld(), housing.getXCoord(), housing.getYCoord(),
			housing.getZCoord(), genome.getPrimaryAsBee().getPrimaryColor(), area[0], area[1], area[2]);
	return storedData;
}
 
开发者ID:ForestryMC,项目名称:ForestryLegacy,代码行数:23,代码来源:AlleleEffectNone.java


示例9: validateStorage

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData validateStorage(IEffectData storedData) {
	if (storedData == null) {
		storedData = new EffectData(1, 0, 0);
	}
	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:8,代码来源:AlleleEffectPotion.java


示例10: validateStorage

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData validateStorage(IEffectData storedData) {
	if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
		storedData = new magicbees.bees.allele.effect.EffectData(1, 0, 0);
	}
	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:8,代码来源:AlleleEffectTransmuting.java


示例11: validateStorage

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData validateStorage(IEffectData storedData) {
	if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
		storedData = new EffectData(1, 0, 0);
	}
	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:8,代码来源:AlleleEffectSpawnMobWeighted.java


示例12: doEffectThrottled

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
	if (this.spawnMob(genome, housing)) {
		storedData.setInteger(0, 0);
	}

	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:9,代码来源:AlleleEffectSpawnMobWeighted.java


示例13: doEffectThrottled

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
	World world = housing.getWorld();
	ChunkCoordinates coords = housing.getCoordinates();
	IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);

	// Get random coords within territory
	int xRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
	int yRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
	int zRange = (int) (beeModifier.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);

	int xCoord = coords.posX + world.rand.nextInt(xRange) - xRange / 2;
	int yCoord = coords.posY + world.rand.nextInt(yRange) - yRange / 2;
	int zCoord = coords.posZ + world.rand.nextInt(zRange) - zRange / 2;

	Block block = world.getBlock(xCoord, yCoord, zCoord);
	if (block != null) {
		ItemStack source = new ItemStack(block, 1, world.getBlockMetadata(xCoord, yCoord, zCoord));
		for (ItemStack key : crumbleMap.keySet()) {
			if (OreDictionary.itemMatches(source, key, false)) {
				ItemStack target = crumbleMap.get(key);
				world.setBlock(xCoord, yCoord, zCoord, Block.getBlockFromItem(target.getItem()), target.getItemDamage(), 2);

				break;
			}
		}
	}

	storedData.setInteger(0, 0);

	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:33,代码来源:AlleleEffectCrumbling.java


示例14: validateStorage

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData validateStorage(IEffectData storedData) {
	if (storedData == null || !(storedData instanceof magicbees.bees.allele.effect.EffectData)) {
		// Throttle; Ready to spawn
		storedData = new EffectData(1, 1, 0);
	}
	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:9,代码来源:AlleleEffectSpawnMob.java


示例15: doEffectThrottled

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
	// Check if we're ready to spawn the mob.
	boolean didSpawn = false;
	if (storedData.getBoolean(0)) {
		World w = housing.getWorld();

		int roll = w.rand.nextInt(100);

		if (roll <= chanceToSpawn) {
			if (spawnsWhilePlayerNear) {
				EntityPlayer target = findPlayerTarget(genome, housing);

				// Let's spawn a mob. =D
				if (target != null) {
					didSpawn = spawnMob(genome, target, w, housing, false);
				} else if (alternateMob != null) {
					didSpawn = spawnMob(genome, null, w, housing, true);
				}
			} else {
				storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true));
			}
		} else {
			playMobLiveSound(genome, housing, w);
			didSpawn = true;
		}
	
		if (didSpawn) {
			storedData.setBoolean(0, !didSpawn);
			storedData.setInteger(0, storedData.getInteger(0) - throttle);
		}
	}
	else {
		storedData.setBoolean(0, true);
	}

	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:39,代码来源:AlleleEffectSpawnMob.java


示例16: doEffectThrottled

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
	List<EntityPlayer> entityList = this.getEntitiesWithinRange(genome, housing, EntityPlayer.class);

	for (EntityPlayer player : entityList) {
		player.curePotionEffects(new ItemStack(Items.milk_bucket));
	}
	storedData.setInteger(0, 0);

	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:12,代码来源:AlleleEffectCure.java


示例17: doEffectThrottled

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
	World world = housing.getWorld();
	ChunkCoordinates coords = housing.getCoordinates();
	IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
	int range = Math.max((int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f)), 1);
	List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
	
       if (NodeHelper.growNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) {
       	storedData.setInteger(0, storedData.getInteger(0) - throttle);
       }

	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:15,代码来源:AlleleEffectEmpowering.java


示例18: doEffectThrottled

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
	World world = housing.getWorld();
	ChunkCoordinates coords = housing.getCoordinates();
	IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
	int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f));
	List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
	
    if (NodeHelper.repairNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) {
    	storedData.setInteger(0, storedData.getInteger(0) - throttle);
    }
   
	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:15,代码来源:AlleleEffectNodeRepair.java


示例19: doEffectThrottled

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
	World world = housing.getWorld();
	ChunkCoordinates coords = housing.getCoordinates();
	IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
	int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f));
	List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
	
       if (NodeHelper.rechargeNodeInRange(chunks, world, coords.posX, coords.posY, coords.posZ, range)) {
       	storedData.setInteger(0, storedData.getInteger(0) - throttle);
       }

	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:15,代码来源:AlleleEffectRecharge.java


示例20: doEffectThrottled

import forestry.api.genetics.IEffectData; //导入依赖的package包/类
@Override
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
	World world = housing.getWorld();
	ChunkCoordinates coords = housing.getCoordinates();
	IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
	int range = (int)Math.ceil(genome.getTerritory()[0] * beeModifier.getTerritoryModifier(genome, 1f));
	List<Chunk> chunks = BlockUtil.getChunksInSearchRange(world, coords.posX, coords.posZ, range);
	
    if (NodeHelper.convertNodeInRangeToType(chunks, world, coords.posX, coords.posY, coords.posZ, range, targetType)) {
    	storedData.setInteger(0, storedData.getInteger(0) - throttle);
    }
   
	return storedData;
}
 
开发者ID:MagicBees,项目名称:MagicBees,代码行数:15,代码来源:AlleleEffectNodeConversion.java



注:本文中的forestry.api.genetics.IEffectData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JSONArray类代码示例发布时间:2022-05-22
下一篇:
Java IntComparisonFormula类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap