本文整理汇总了Java中thaumcraft.common.config.Config.hardNode方法的典型用法代码示例。如果您正苦于以下问题:Java Config.hardNode方法的具体用法?Java Config.hardNode怎么用?Java Config.hardNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thaumcraft.common.config.Config
的用法示例。
在下文中一共展示了Config.hardNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEntityUpdate
import thaumcraft.common.config.Config; //导入方法依赖的package包/类
@Override
public void onEntityUpdate() {
//Spread taint just like tainted nodes, but twice as fast
//TODO add a config option for speed, and a toggle?
tickCounter++;
if (this.dimension == 0 && tickCounter % 25 == 0) {
int y = 0;
int x = MathHelper.floor_double(this.posX - .5D) + worldObj.rand.nextInt(8) - worldObj.rand.nextInt(8);
int z = MathHelper.floor_double(this.posZ) + worldObj.rand.nextInt(8) - worldObj.rand.nextInt(8);
BiomeGenBase bg = worldObj.getBiomeGenForCoords(x, z);
if (bg.biomeID != ThaumcraftWorldGenerator.biomeTaint.biomeID) {
Utils.setBiomeAt(worldObj, x, z, ThaumcraftWorldGenerator.biomeTaint);
}
if ((Config.hardNode) && (worldObj.rand.nextBoolean())) {
x = MathHelper.floor_double(this.posX - .5D) + worldObj.rand.nextInt(5) - worldObj.rand.nextInt(5);
y = MathHelper.floor_double(this.posY) + worldObj.rand.nextInt(5) - worldObj.rand.nextInt(5);
z = MathHelper.floor_double(this.posZ) + worldObj.rand.nextInt(5) - worldObj.rand.nextInt(5);
BlockTaintFibres.spreadFibres(worldObj, x, y, z);
}
}
//Spawn a random aberration
int spawnChance = 4000; //nether portals spawn chance is 2000, though entities seem to update more often than blocks
if (!worldObj.isRemote && worldObj.provider.isSurfaceWorld() &&
worldObj.getGameRules().getGameRuleBooleanValue("doMobSpawning") &&
worldObj.rand.nextInt(spawnChance) < worldObj.difficultySetting.getDifficultyId()) {
//TODO change getTrackingRange to getModEntityId when the issue is fixed
int entityId = EntityRegistry.instance().lookupModSpawn(
FMLCommonHandler.instance().findContainerFor(Xthuoth.instance),
worldObj.rand.nextInt(ModEntities.maxAberrationId)).getTrackingRange();
Block blockBelow = worldObj.getBlock(MathHelper.floor_double(this.posX - .5D),
MathHelper.floor_double(this.posY) - 1, MathHelper.floor_double(this.posZ));
if (posY > 0 && blockBelow.isNormalCube()) {
Entity entity = ItemSpawnEgg.spawnCreature(worldObj, entityId, posX + 0.5D, posY + .5D, posZ + 0.5D);
if (entity != null) {
entity.timeUntilPortal = entity.getPortalCooldown();
}
}
}
}