diff --git a/build.properties b/build.properties index 2ede7cfa3..63b7bd7ca 100644 --- a/build.properties +++ b/build.properties @@ -1,4 +1,4 @@ minecraft_version=1.11 -forge_version=13.19.0.2133 +forge_version=13.19.0.2152 mod_version=6.0.0 -mappings_version=snapshot_nodoc_20161115 +mappings_version=snapshot_nodoc_20161118 diff --git a/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java b/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java index bd4371267..190f95577 100644 --- a/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java +++ b/src/main/java/biomesoplenty/api/generation/BOPGeneratorBase.java @@ -78,7 +78,7 @@ public abstract class BOPGeneratorBase extends WorldGenerator implements IGenera public int getAmountToScatter(Random random) { - int amount = MathHelper.floor_float(this.amountPerChunk); + int amount = MathHelper.floor(this.amountPerChunk); float remainder = this.amountPerChunk - amount; if (random.nextFloat() < remainder) {amount++;} return amount; diff --git a/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java b/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java index 44ef50a1a..6ecfefba2 100644 --- a/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java +++ b/src/main/java/biomesoplenty/client/particle/EntityPixieTrailFX.java @@ -61,7 +61,7 @@ public class EntityPixieTrailFX extends Particle FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particleTexturesLocation); float scaleMultiplier = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F; - scaleMultiplier = MathHelper.clamp_float(scaleMultiplier, 0.0F, 1.0F); + scaleMultiplier = MathHelper.clamp(scaleMultiplier, 0.0F, 1.0F); this.particleScale = this.particleScale * scaleMultiplier; GlStateManager.depthMask(false); @@ -88,7 +88,7 @@ public class EntityPixieTrailFX extends Particle } this.particleTextureIndexX = 7 - particleAge * 8 / particleMaxAge; - this.moveEntity(motionX, motionY, motionZ); + this.move(motionX, motionY, motionZ); if (posY == prevPosY) { diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BOPBiome.java b/src/main/java/biomesoplenty/common/biome/overworld/BOPBiome.java index 31a8a738c..166d31153 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BOPBiome.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BOPBiome.java @@ -51,6 +51,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraftforge.fml.common.registry.ForgeRegistries; public class BOPBiome extends Biome implements IExtendedBiome { @@ -196,7 +197,7 @@ public class BOPBiome extends Biome implements IExtendedBiome // Look for an entity class matching this name // case insensitive, dot used as mod delimiter, no spaces or underscores // eg 'villager', 'Zombie', 'SQUID', 'enderdragon', 'biomesoplenty.wasp' all ok - Class entityClazz = EntityList.field_191308_b.getObject(new ResourceLocation(entityName)); + Class entityClazz = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(entityName)).getEntityClass(); Class livingClazz = null; if (!(entityClazz.isAssignableFrom(EntityLiving.class))) { confEntity.addMessage("Entity " + entityName + " is not of type EntityLiving"); diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java index 3eccea936..0c73bf95b 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java @@ -133,19 +133,12 @@ public class BlockBOPDoubleDecoration extends BlockBOPDecoration { public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { if (world.getBlockState(pos).getBlock().isReplaceable(world, pos) && world.getBlockState(pos.up()).getBlock().isReplaceable(world, pos.up()) && this.canBlockStay(world, pos, this.getStateFromMeta(meta))) { - return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer); + return this.getStateFromMeta(meta).withProperty(HALF, Half.LOWER); } return world.getBlockState(pos); } - // Called by ItemBlock before the block is placed - the placed block must always be Half.LOWER - @Override - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) - { - return this.getStateFromMeta(meta).withProperty(HALF, Half.LOWER); - } - // Called by ItemBlock after the (lower) block has been placed // Use it to add the top half of the block @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java b/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java index e9066d674..caefae43f 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGemOre.java @@ -115,7 +115,7 @@ public class BlockBOPGemOre extends Block implements IBOPBlock public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune) { Random rand = world instanceof World ? ((World)world).rand : new Random(); - return MathHelper.getRandomIntegerInRange(rand, 3, 7); + return MathHelper.getInt(rand, 3, 7); } } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java b/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java index 77076fe9b..856c5ce0c 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGrass.java @@ -168,7 +168,7 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPla } @Override - public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { IBlockState state = this.getStateFromMeta(meta); switch ((BOPGrassType) state.getValue(VARIANT)) diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPHive.java b/src/main/java/biomesoplenty/common/block/BlockBOPHive.java index 2c12c33de..d10cabeeb 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPHive.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPHive.java @@ -164,7 +164,7 @@ public class BlockBOPHive extends Block implements IBOPBlock case EMPTY_HONEYCOMB: EntityWasp wasp = new EntityWasp(worldIn); wasp.setLocationAndAngles((double)pos.getX() + 0.6D, (double)pos.getY(), (double)pos.getZ() + 0.3D, 0.0F, 0.0F); - worldIn.spawnEntityInWorld(wasp); + worldIn.spawnEntity(wasp); break; default: diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java b/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java index a2e01b85a..51a514de7 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java @@ -187,7 +187,7 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock // blocks that are not placed during generation should not decay @Override - public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return this.getStateFromMeta(meta).withProperty(CHECK_DECAY, Boolean.valueOf(false)).withProperty(DECAYABLE, Boolean.valueOf(false)); } @@ -203,11 +203,11 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock // leaves in the inventory should not be decayable //TODO REMOVE @Override - protected ItemStack createStackedBlock(IBlockState state) + protected ItemStack getSilkTouchDrop(IBlockState state) { IBlockState newState = state.withProperty(CHECK_DECAY, Boolean.valueOf(false)).withProperty(DECAYABLE, Boolean.valueOf(false)); - return super.createStackedBlock(newState); + return super.getSilkTouchDrop(newState); } @Override diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java b/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java index c403a0307..98c2edb03 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java @@ -439,7 +439,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo // poison ivy poisons players who walk into it, unless they're wearing boots and pants if (entity instanceof EntityPlayer) { InventoryPlayer inventory = ((EntityPlayer)entity).inventory; - if (inventory.armorInventory.get(0) != ItemStack.field_190927_a && inventory.armorInventory.get(1) != ItemStack.field_190927_a) { + if (inventory.armorInventory.get(0) != ItemStack.EMPTY && inventory.armorInventory.get(1) != ItemStack.EMPTY) { break; } ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.POISON, 100)); @@ -449,7 +449,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo // thorns and tiny cacti damage players who walk into them, unless they're wearing boots and pants if (entity instanceof EntityPlayer) { InventoryPlayer inventory = ((EntityPlayer)entity).inventory; - if (inventory.armorInventory.get(0) != ItemStack.field_190927_a && inventory.armorInventory.get(1) != ItemStack.field_190927_a) { + if (inventory.armorInventory.get(0) != ItemStack.EMPTY && inventory.armorInventory.get(1) != ItemStack.EMPTY) { break; } entity.attackEntityFrom(DamageSource.cactus, 1); @@ -471,7 +471,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo EntityItem berries = new EntityItem(worldIn, (double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), new ItemStack(BOPItems.berries)); if (!worldIn.isRemote) { - worldIn.spawnEntityInWorld(berries); + worldIn.spawnEntity(berries); if (!(playerIn instanceof FakePlayer)) { berries.onCollideWithPlayer(playerIn); diff --git a/src/main/java/biomesoplenty/common/command/BOPCommand.java b/src/main/java/biomesoplenty/common/command/BOPCommand.java index e549f9095..92e850d89 100644 --- a/src/main/java/biomesoplenty/common/command/BOPCommand.java +++ b/src/main/java/biomesoplenty/common/command/BOPCommand.java @@ -40,19 +40,19 @@ public class BOPCommand extends CommandBase public static int biomeCount = 0; @Override - public String getCommandName() + public String getName() { return "biomesoplenty"; } @Override - public List getCommandAliases() + public List getAliases() { return Lists.newArrayList("bop", "biomesop"); } @Override - public String getCommandUsage(ICommandSender sender) + public String getUsage(ICommandSender sender) { return "commands.biomesoplenty.usage"; } @@ -98,7 +98,7 @@ public class BOPCommand extends CommandBase int biomeId = parseInt(args[1], 0, 255); Biome biome = Biome.getBiome(biomeId); - sender.addChatMessage(new TextComponentTranslation("commands.biomesoplenty.biomename.success", biomeId, biome == null ? "Undefined" : biome.getBiomeName())); + sender.sendMessage(new TextComponentTranslation("commands.biomesoplenty.biomename.success", biomeId, biome == null ? "Undefined" : biome.getBiomeName())); } private void teleportFoundBiome(ICommandSender sender, String[] args) throws CommandException @@ -131,11 +131,11 @@ public class BOPCommand extends CommandBase double z = (double)closestBiomePos.getZ(); player.connection.setPlayerLocation(x, y, z, player.rotationYaw, player.rotationPitch); - sender.addChatMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.success", player.getName(), biomeToFind.getBiomeName(), x, y, z)); + sender.sendMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.success", player.getName(), biomeToFind.getBiomeName(), x, y, z)); } else { - sender.addChatMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.error", biomeToFind == null ? "Undefined" : biomeToFind.getBiomeName())); + sender.sendMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.error", biomeToFind == null ? "Undefined" : biomeToFind.getBiomeName())); } } @@ -144,19 +144,19 @@ public class BOPCommand extends CommandBase TextComponentTranslation text = new TextComponentTranslation("commands.biomesoplenty.stats.blocks", blockCount); text.getStyle().setColor(TextFormatting.GREEN); - sender.addChatMessage(text); + sender.sendMessage(text); text = new TextComponentTranslation("commands.biomesoplenty.stats.items", itemCount); text.getStyle().setColor(TextFormatting.GREEN); - sender.addChatMessage(text); + sender.sendMessage(text); text = new TextComponentTranslation("commands.biomesoplenty.stats.entities", entityCount); text.getStyle().setColor(TextFormatting.GREEN); - sender.addChatMessage(text); + sender.sendMessage(text); text = new TextComponentTranslation("commands.biomesoplenty.stats.biomes", biomeCount); text.getStyle().setColor(TextFormatting.GREEN); - sender.addChatMessage(text); + sender.sendMessage(text); } private void stripChunk(ICommandSender sender, String[] args) throws CommandException @@ -230,7 +230,7 @@ public class BOPCommand extends CommandBase } @Override - public List getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos) + public List getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos) { if (args.length == 1) { diff --git a/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java b/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java index 0b649a832..2eb213a34 100644 --- a/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java +++ b/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java @@ -23,13 +23,13 @@ public class BiomeEssenceRecipe implements IRecipe RecipeSorter.register("biomesoplenty:biomeessenceRecipe", BiomeEssenceRecipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless"); } - private ItemStack recipeOutput = ItemStack.field_190927_a; + private ItemStack recipeOutput = ItemStack.EMPTY; @Override public boolean matches(InventoryCrafting inventoryCrafting, World world) { - ItemStack biomeRadar = ItemStack.field_190927_a; - ItemStack biomeEssence = ItemStack.field_190927_a; + ItemStack biomeRadar = ItemStack.EMPTY; + ItemStack biomeEssence = ItemStack.EMPTY; for (int i = 0; i < 3; ++i) { @@ -87,7 +87,7 @@ public class BiomeEssenceRecipe implements IRecipe @Override public NonNullList getRemainingItems(InventoryCrafting inv) { - NonNullList itemList = NonNullList.func_191196_a(); + NonNullList itemList = NonNullList.create(); for (int i = 0; i < inv.getSizeInventory(); ++i) { diff --git a/src/main/java/biomesoplenty/common/entities/EntityButterfly.java b/src/main/java/biomesoplenty/common/entities/EntityButterfly.java index ea6638374..5636740ad 100644 --- a/src/main/java/biomesoplenty/common/entities/EntityButterfly.java +++ b/src/main/java/biomesoplenty/common/entities/EntityButterfly.java @@ -169,7 +169,7 @@ public class EntityButterfly extends EntityFlying implements IMob { this.distY = this.posY - this.butterfly.posY; this.distZ = this.posZ - this.butterfly.posZ; - this.dist = (double)MathHelper.sqrt_double(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ); + this.dist = (double)MathHelper.sqrt(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ); // (aimX,aimY,aimZ) is a unit vector in the direction we want to go if (this.dist == 0.0D) diff --git a/src/main/java/biomesoplenty/common/entities/EntityPixie.java b/src/main/java/biomesoplenty/common/entities/EntityPixie.java index 9784ecec7..594b99b06 100644 --- a/src/main/java/biomesoplenty/common/entities/EntityPixie.java +++ b/src/main/java/biomesoplenty/common/entities/EntityPixie.java @@ -147,7 +147,7 @@ public class EntityPixie extends EntityFlying implements IMob { this.distY = this.posY - this.pixie.posY; this.distZ = this.posZ - this.pixie.posZ; - this.dist = (double)MathHelper.sqrt_double(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ); + this.dist = (double)MathHelper.sqrt(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ); // (aimX,aimY,aimZ) is a unit vector in the direction we want to go if (this.dist == 0.0D) diff --git a/src/main/java/biomesoplenty/common/entities/EntitySnail.java b/src/main/java/biomesoplenty/common/entities/EntitySnail.java index b1291ecee..d36132ab7 100644 --- a/src/main/java/biomesoplenty/common/entities/EntitySnail.java +++ b/src/main/java/biomesoplenty/common/entities/EntitySnail.java @@ -34,9 +34,9 @@ public class EntitySnail extends EntityLiving implements IMob { @Override public boolean getCanSpawnHere() { - int x = MathHelper.floor_double(this.posX); - int y = MathHelper.floor_double(this.getEntityBoundingBox().minY); - int z = MathHelper.floor_double(this.posZ); + int x = MathHelper.floor(this.posX); + int y = MathHelper.floor(this.getEntityBoundingBox().minY); + int z = MathHelper.floor(this.posZ); BlockPos blockpos = new BlockPos(x, y, z); if (this.world.getBlockState(blockpos.down()).getBlock() != Blocks.GRASS && this.world.getBlockState(blockpos.down()).getBlock() != BOPBlocks.grass) { diff --git a/src/main/java/biomesoplenty/common/entities/EntityWasp.java b/src/main/java/biomesoplenty/common/entities/EntityWasp.java index 29972a73e..20d6dc25d 100644 --- a/src/main/java/biomesoplenty/common/entities/EntityWasp.java +++ b/src/main/java/biomesoplenty/common/entities/EntityWasp.java @@ -109,7 +109,7 @@ public class EntityWasp extends EntityFlying implements IMob { this.distY = this.posY - this.wasp.posY; this.distZ = this.posZ - this.wasp.posZ; - this.dist = (double)MathHelper.sqrt_double(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ); + this.dist = (double)MathHelper.sqrt(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ); // (aimX,aimY,aimZ) is a unit vector in the direction we want to go if (this.dist == 0.0D) diff --git a/src/main/java/biomesoplenty/common/handler/AchievementEventHandler.java b/src/main/java/biomesoplenty/common/handler/AchievementEventHandler.java index 7c5fd1976..a0895d5c5 100644 --- a/src/main/java/biomesoplenty/common/handler/AchievementEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/AchievementEventHandler.java @@ -253,7 +253,7 @@ public class AchievementEventHandler private void updateBiomeRadarExplore(EntityPlayerMP player) { - Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ))); + Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor(player.posX), 0, MathHelper.floor(player.posZ))); //Search every item in the player's main inventory for a biome radar for (ItemStack stack : player.inventory.mainInventory) @@ -278,7 +278,7 @@ public class AchievementEventHandler private void updateBiomesExplored(EntityPlayerMP player) { - Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ))); + Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor(player.posX), 0, MathHelper.floor(player.posZ))); String biomeName = currentBiome.getBiomeName(); //Get a list of the current explored biomes JsonSerializableSet exploredBiomeNames = (JsonSerializableSet)player.getStatFile().getProgress(BOPAchievements.explore_all_biomes); diff --git a/src/main/java/biomesoplenty/common/handler/DyeEventHandler.java b/src/main/java/biomesoplenty/common/handler/DyeEventHandler.java index 0201501ee..9622a90e1 100644 --- a/src/main/java/biomesoplenty/common/handler/DyeEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/DyeEventHandler.java @@ -43,7 +43,7 @@ public class DyeEventHandler if (dyeColor != wolf.getCollarColor()) { wolf.setCollarColor(dyeColor); - if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.func_190920_e(stack.func_190916_E() - 1);} + if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.setCount(stack.getCount() - 1);} event.setResult(Result.ALLOW); } } @@ -53,7 +53,7 @@ public class DyeEventHandler if (!sheep.getSheared() && dyeColor != sheep.getFleeceColor()) { sheep.setFleeceColor(dyeColor); - if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.func_190920_e(stack.func_190916_E() - 1);} + if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.setCount(stack.getCount() - 1);} event.setResult(Result.ALLOW); } } diff --git a/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java b/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java index 2682b32ad..1f3006513 100644 --- a/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java @@ -58,7 +58,7 @@ public class ItemEventHandler if (inventory.addItem(stack) == null) { //Set stack size to 0 to cause it to be removed - stack.func_190920_e(0); + stack.setCount(0); //Prevent the stack from being added to the player's inventory event.setResult(Result.ALLOW); } diff --git a/src/main/java/biomesoplenty/common/init/ModEntities.java b/src/main/java/biomesoplenty/common/init/ModEntities.java index 72a68f235..11290b120 100644 --- a/src/main/java/biomesoplenty/common/init/ModEntities.java +++ b/src/main/java/biomesoplenty/common/init/ModEntities.java @@ -24,6 +24,7 @@ import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityList.EntityEggInfo; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.ModContainer; import net.minecraftforge.fml.common.registry.EntityRegistry; @@ -54,7 +55,7 @@ public class ModEntities { int bopEntityId = nextBOPEntityId; nextBOPEntityId++; - EntityRegistry.registerModEntity(entityClass, entityName, bopEntityId, BiomesOPlenty.instance, trackingRange, updateFrequency, sendsVelocityUpdates); + EntityRegistry.registerModEntity(new ResourceLocation(BiomesOPlenty.MOD_ID, entityName), entityClass, entityName, bopEntityId, BiomesOPlenty.instance, trackingRange, updateFrequency, sendsVelocityUpdates); idToBOPEntityName.put(bopEntityId, entityName); BOPCommand.entityCount++; return bopEntityId; diff --git a/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java b/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java index eeb91352c..4fac07f5b 100644 --- a/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java +++ b/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java @@ -99,7 +99,7 @@ public class ContainerFlowerBasket extends Container return null; } - if (mergedStack.func_190916_E() == 0) + if (mergedStack.getCount() == 0) { slot.putStack((ItemStack)null); } diff --git a/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java b/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java index 6bd0eb26a..d581ddb8d 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java +++ b/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java @@ -74,7 +74,7 @@ public class ItemBOPLilypad extends ItemBOPBlock { if (!playerIn.capabilities.isCreativeMode) { - itemStackIn.func_190920_e(itemStackIn.func_190916_E() - 1); + itemStackIn.setCount(itemStackIn.getCount() - 1); } //TODO: playerIn.addStat(StatList.objectUseStats[Item.getIdFromItem(this)]); diff --git a/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java b/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java index 39408c524..543a18283 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java +++ b/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java @@ -82,7 +82,7 @@ public class ItemBOPPlant extends ItemBOPBlock { if (!playerIn.capabilities.isCreativeMode) { - itemStackIn.func_190920_e(itemStackIn.func_190916_E() - 1); + itemStackIn.setCount(itemStackIn.getCount() - 1); } //TODO: 1.9 playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); diff --git a/src/main/java/biomesoplenty/common/item/ItemBOPSpawnEgg.java b/src/main/java/biomesoplenty/common/item/ItemBOPSpawnEgg.java index 28ff8d970..40970fbeb 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBOPSpawnEgg.java +++ b/src/main/java/biomesoplenty/common/item/ItemBOPSpawnEgg.java @@ -25,6 +25,7 @@ import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; +import net.minecraft.item.ItemMonsterPlacer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.MobSpawnerBaseLogic; import net.minecraft.tileentity.TileEntity; @@ -34,6 +35,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +import net.minecraftforge.fml.common.registry.ForgeRegistries; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -68,7 +70,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem entityliving.rotationYawHead = entityliving.rotationYaw; entityliving.renderYawOffset = entityliving.rotationYaw; entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), (IEntityLivingData)null); - worldIn.spawnEntityInWorld(entity); + worldIn.spawnEntity(entity); entityliving.playLivingSound(); } @@ -121,13 +123,13 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem if (tileentity instanceof TileEntityMobSpawner) { MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic(); - mobspawnerbaselogic.func_190894_a(EntityList.field_191308_b.getNameForObject(EntityList.getClassFromID(stack.getMetadata()))); + mobspawnerbaselogic.setEntityId(ItemMonsterPlacer.getNamedIdFrom(stack)); tileentity.markDirty(); worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3); if (!playerIn.capabilities.isCreativeMode) { - stack.func_190920_e(stack.func_190916_E() - 1); + stack.setCount(stack.getCount() - 1); } return EnumActionResult.SUCCESS; @@ -153,7 +155,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem if (!playerIn.capabilities.isCreativeMode) { - stack.func_190920_e(stack.func_190916_E() - 1); + stack.setCount(stack.getCount() - 1); } } @@ -206,7 +208,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem if (!player.capabilities.isCreativeMode) { - stack.func_190920_e(stack.func_190916_E() - 1); + stack.setCount(stack.getCount() - 1); } //TODO: 1.9 playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); diff --git a/src/main/java/biomesoplenty/common/item/ItemBiomeFinder.java b/src/main/java/biomesoplenty/common/item/ItemBiomeFinder.java index e5cd15338..7118ac9d5 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBiomeFinder.java +++ b/src/main/java/biomesoplenty/common/item/ItemBiomeFinder.java @@ -155,7 +155,7 @@ public class ItemBiomeFinder extends Item { TextComponentTranslation chatComponent = new TextComponentTranslation(msg); chatComponent.getStyle().setColor(color); - player.addChatMessage(chatComponent); + player.sendMessage(chatComponent); } public static void writeNBTSearching(NBTTagCompound nbt, World world) diff --git a/src/main/java/biomesoplenty/common/item/ItemEnderporter.java b/src/main/java/biomesoplenty/common/item/ItemEnderporter.java index ca96c84f5..eb1a6a756 100644 --- a/src/main/java/biomesoplenty/common/item/ItemEnderporter.java +++ b/src/main/java/biomesoplenty/common/item/ItemEnderporter.java @@ -54,7 +54,7 @@ public class ItemEnderporter extends Item { { TextComponentTranslation msg = new TextComponentTranslation("enderporter.prevent"); msg.getStyle().setColor(TextFormatting.DARK_PURPLE); - player.addChatMessage(msg); + player.sendMessage(msg); } } return new ActionResult(EnumActionResult.SUCCESS, stack); diff --git a/src/main/java/biomesoplenty/common/item/ItemJarEmpty.java b/src/main/java/biomesoplenty/common/item/ItemJarEmpty.java index 85c7286bf..ed354e695 100644 --- a/src/main/java/biomesoplenty/common/item/ItemJarEmpty.java +++ b/src/main/java/biomesoplenty/common/item/ItemJarEmpty.java @@ -80,11 +80,11 @@ public class ItemJarEmpty extends Item private ItemStack fillJar(ItemStack stack, EntityPlayer player, ItemStack jarStack) { - stack.func_190920_e(stack.func_190916_E() - 1); + stack.setCount(stack.getCount() - 1); player.addStat(StatList.getObjectUseStats(this)); // if there was only one empty jar in the stack, replace it, otherwise add the filledJar elsewhere in the inventory - if (stack.func_190916_E() <= 0) + if (stack.getCount() <= 0) { return jarStack; } else { @@ -106,12 +106,12 @@ public class ItemJarEmpty extends Item { EntityPixie pixie = (EntityPixie)target; pixie.setDead(); - stack.func_190920_e(stack.func_190916_E() - 1); + stack.setCount(stack.getCount() - 1); ItemStack pixieJar = new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.PIXIE.ordinal()); EntityItem pixieJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, pixieJar); if (!player.world.isRemote) { - player.world.spawnEntityInWorld(pixieJarEntity); + player.world.spawnEntity(pixieJarEntity); if (!(player instanceof FakePlayer)) {pixieJarEntity.onCollideWithPlayer(player);} } return true; @@ -120,12 +120,12 @@ public class ItemJarEmpty extends Item { EntityButterfly butterfly = (EntityButterfly)target; butterfly.setDead(); - stack.func_190920_e(stack.func_190916_E() - 1); + stack.setCount(stack.getCount() - 1); ItemStack butterflyJar = new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.BUTTERFLY.ordinal()); EntityItem butterflyJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, butterflyJar); if (!player.world.isRemote) { - player.world.spawnEntityInWorld(butterflyJarEntity); + player.world.spawnEntity(butterflyJarEntity); if (!(player instanceof FakePlayer)) {butterflyJarEntity.onCollideWithPlayer(player);} } return true; diff --git a/src/main/java/biomesoplenty/common/item/ItemJarFilled.java b/src/main/java/biomesoplenty/common/item/ItemJarFilled.java index c4c641de5..6922fb11c 100644 --- a/src/main/java/biomesoplenty/common/item/ItemJarFilled.java +++ b/src/main/java/biomesoplenty/common/item/ItemJarFilled.java @@ -125,12 +125,12 @@ public class ItemJarFilled extends Item { EntityPixie pixie = new EntityPixie(world); pixie.setLocationAndAngles(releasePoint.xCoord, releasePoint.yCoord, releasePoint.zCoord, MathHelper.wrapDegrees(world.rand.nextFloat() * 360.0F), 0.0F); - world.spawnEntityInWorld(pixie); + world.spawnEntity(pixie); pixie.playLivingSound(); if (stack.hasDisplayName()) {pixie.setCustomNameTag(stack.getDisplayName());} return true; } else { - player.addChatComponentMessage(new TextComponentString("\u00a75Pixies cannot survive in this environment!"), false); + player.sendMessage(new TextComponentString("\u00a75Pixies cannot survive in this environment!")); return false; } } @@ -141,12 +141,12 @@ public class ItemJarFilled extends Item { EntityButterfly butterfly = new EntityButterfly(world); butterfly.setLocationAndAngles(releasePoint.xCoord, releasePoint.yCoord, releasePoint.zCoord, MathHelper.wrapDegrees(world.rand.nextFloat() * 360.0F), 0.0F); - world.spawnEntityInWorld(butterfly); + world.spawnEntity(butterfly); butterfly.playLivingSound(); if (stack.hasDisplayName()) {butterfly.setCustomNameTag(stack.getDisplayName());} return true; } else { - player.addChatComponentMessage(new TextComponentString("\u00a75Butterflies cannot survive in this environment!"), false); + player.sendMessage(new TextComponentString("\u00a75Butterflies cannot survive in this environment!")); return false; } } @@ -186,7 +186,7 @@ public class ItemJarFilled extends Item protected ItemStack emptyJar(ItemStack stack, EntityPlayer player, ItemStack emptyJarStack) { - if (!player.capabilities.isCreativeMode) { stack.func_190920_e(stack.func_190916_E() - 1); } + if (!player.capabilities.isCreativeMode) { stack.setCount(stack.getCount() - 1); } player.addStat(StatList.getObjectUseStats(this)); if (!player.inventory.addItemStackToInventory(emptyJarStack)) { diff --git a/src/main/java/biomesoplenty/common/item/ItemMudball.java b/src/main/java/biomesoplenty/common/item/ItemMudball.java index a6a128cff..41150944e 100644 --- a/src/main/java/biomesoplenty/common/item/ItemMudball.java +++ b/src/main/java/biomesoplenty/common/item/ItemMudball.java @@ -34,7 +34,7 @@ public class ItemMudball extends Item ItemStack stack = player.getHeldItem(hand); if (!player.capabilities.isCreativeMode) { - stack.func_190920_e(stack.func_190916_E() - 1); + stack.setCount(stack.getCount() - 1); } world.playSound(player, player.getPosition(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); @@ -43,7 +43,7 @@ public class ItemMudball extends Item { EntityMudball mudball = new EntityMudball(world, player); mudball.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F); - world.spawnEntityInWorld(mudball); + world.spawnEntity(mudball); } player.addStat(StatList.getObjectUseStats(this)); diff --git a/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java b/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java index f6f85343e..acef17569 100644 --- a/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java +++ b/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java @@ -326,7 +326,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator { for (int k = -2; k <= 2; ++k) { - radialFalloff5x5[j + 2 + (k + 2) * 5] = 0.06476162171F / MathHelper.sqrt_float((float)(j * j + k * k) + 0.2F); + radialFalloff5x5[j + 2 + (k + 2) * 5] = 0.06476162171F / MathHelper.sqrt((float)(j * j + k * k) + 0.2F); radialStrongFalloff5x5[j + 2 + (k + 2) * 5] = 0.076160519601F / ((float)(j * j + k * k) + 0.2F); } } @@ -437,7 +437,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator double xyzNoiseA = this.xyzNoiseArrayA[xyzCounter] / lowerLimitScale; double xyzNoiseB = this.xyzNoiseArrayB[xyzCounter] / upperLimitScale; double balance = (this.xyzBalanceNoiseArray[xyzCounter] / 10.0D + 1.0D) / 2.0D; - double xyzNoiseValue = MathHelper.denormalizeClamp(xyzNoiseA, xyzNoiseB, balance) / 50.0D; + double xyzNoiseValue = MathHelper.clamp(xyzNoiseA, xyzNoiseB, balance) / 50.0D; // calculate the depth double depth = baseLevel - y + (xyzAmplitude * xyzNoiseValue); diff --git a/src/main/java/biomesoplenty/common/world/ChunkProviderHellBOP.java b/src/main/java/biomesoplenty/common/world/ChunkProviderHellBOP.java index 70d377600..e1f1eff56 100644 --- a/src/main/java/biomesoplenty/common/world/ChunkProviderHellBOP.java +++ b/src/main/java/biomesoplenty/common/world/ChunkProviderHellBOP.java @@ -367,7 +367,7 @@ public class ChunkProviderHellBOP implements IChunkGenerator if ((double)k < d3) { double d10 = (d3 - (double)k) / 4.0D; - d10 = MathHelper.clamp_double(d10, 0.0D, 1.0D); + d10 = MathHelper.clamp(d10, 0.0D, 1.0D); d4 = d4 * (1.0D - d10) + -10.0D * d10; } diff --git a/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOP.java b/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOP.java index 388282e64..5d2fc6fd9 100644 --- a/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOP.java +++ b/src/main/java/biomesoplenty/common/world/NoiseGeneratorBOP.java @@ -81,7 +81,7 @@ public class NoiseGeneratorBOP extends NoiseGenerator public double wraparound(double d) { - long intD = MathHelper.floor_double_long(d); + long intD = MathHelper.floor(d); return d - intD + (intD % 0x1000000); } diff --git a/src/main/java/biomesoplenty/common/world/TerrainSettings.java b/src/main/java/biomesoplenty/common/world/TerrainSettings.java index 3e244382e..4491c809d 100644 --- a/src/main/java/biomesoplenty/common/world/TerrainSettings.java +++ b/src/main/java/biomesoplenty/common/world/TerrainSettings.java @@ -58,7 +58,7 @@ public class TerrainSettings public TerrainSettings sidewaysNoise(double a) { - this.sidewaysNoiseAmount = MathHelper.clamp_double(a, 0.0F, 1.0F); + this.sidewaysNoiseAmount = MathHelper.clamp(a, 0.0F, 1.0F); return this; } @@ -76,13 +76,13 @@ public class TerrainSettings public TerrainSettings minHeight(double minHeight) { - this.minHeight = MathHelper.clamp_double(minHeight, 0.0D, 255.0D); + this.minHeight = MathHelper.clamp(minHeight, 0.0D, 255.0D); return this; } public TerrainSettings maxHeight(double maxHeight) { - this.maxHeight = MathHelper.clamp_double(maxHeight, 0.0D, 255.0D); + this.maxHeight = MathHelper.clamp(maxHeight, 0.0D, 255.0D); return this; } diff --git a/src/main/java/biomesoplenty/common/world/WorldProviderHellBOP.java b/src/main/java/biomesoplenty/common/world/WorldProviderHellBOP.java index 85c85be5f..6344c8339 100644 --- a/src/main/java/biomesoplenty/common/world/WorldProviderHellBOP.java +++ b/src/main/java/biomesoplenty/common/world/WorldProviderHellBOP.java @@ -15,7 +15,7 @@ public class WorldProviderHellBOP extends WorldProvider public void createBiomeProvider() { this.biomeProvider = new BiomeProviderSingle(Biomes.HELL); - this.isHellWorld = true; + this.doesWaterVaporize = true; this.hasNoSky = true; } @@ -38,7 +38,7 @@ public class WorldProviderHellBOP extends WorldProvider public IChunkGenerator createChunkGenerator() { - return new ChunkProviderHellBOP(this.worldObj, this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.worldObj.getSeed()); + return new ChunkProviderHellBOP(this.world, this.world.getWorldInfo().isMapFeaturesEnabled(), this.world.getSeed()); } public boolean isSurfaceWorld() diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorBlobs.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorBlobs.java index 4d2d3b857..84a6068f8 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorBlobs.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorBlobs.java @@ -116,12 +116,12 @@ public class GeneratorBlobs extends GeneratorReplacing float radiusY = minRadius + radiusRand + (rand.nextFloat() * radiusVariation * 0.5F); float radiusZ = minRadius + radiusRand + (rand.nextFloat() * radiusVariation * 0.5F); - int x0 = MathHelper.floor_float(centerX - radiusX + 0.5F); - int y0 = MathHelper.floor_float(centerY - radiusY + 0.5F); - int z0 = MathHelper.floor_float(centerZ - radiusZ + 0.5F); - int x1 = MathHelper.floor_float(centerX + radiusX + 0.5F); - int y1 = MathHelper.floor_float(centerY + radiusY + 0.5F); - int z1 = MathHelper.floor_float(centerZ + radiusZ + 0.5F); + int x0 = MathHelper.floor(centerX - radiusX + 0.5F); + int y0 = MathHelper.floor(centerY - radiusY + 0.5F); + int z0 = MathHelper.floor(centerZ - radiusZ + 0.5F); + int x1 = MathHelper.floor(centerX + radiusX + 0.5F); + int y1 = MathHelper.floor(centerY + radiusY + 0.5F); + int z1 = MathHelper.floor(centerZ + radiusZ + 0.5F); for (int x = x0; x <= x1; ++x) { diff --git a/src/main/java/biomesoplenty/common/world/generator/GeneratorSplotches.java b/src/main/java/biomesoplenty/common/world/generator/GeneratorSplotches.java index 0d530b05e..024eccd73 100644 --- a/src/main/java/biomesoplenty/common/world/generator/GeneratorSplotches.java +++ b/src/main/java/biomesoplenty/common/world/generator/GeneratorSplotches.java @@ -94,12 +94,12 @@ public class GeneratorSplotches extends GeneratorReplacing public void replaceInEllipsoid(World world, double centerX, double centerY, double centerZ, double radiusX, double radiusY, double radiusZ) { - int x0 = MathHelper.floor_double(centerX - radiusX + 0.5D); - int y0 = MathHelper.floor_double(centerY - radiusY + 0.5D); - int z0 = MathHelper.floor_double(centerZ - radiusZ + 0.5D); - int x1 = MathHelper.floor_double(centerX + radiusX + 0.5D); - int y1 = MathHelper.floor_double(centerY + radiusY + 0.5D); - int z1 = MathHelper.floor_double(centerZ + radiusZ + 0.5D); + int x0 = MathHelper.floor(centerX - radiusX + 0.5D); + int y0 = MathHelper.floor(centerY - radiusY + 0.5D); + int z0 = MathHelper.floor(centerZ - radiusZ + 0.5D); + int x1 = MathHelper.floor(centerX + radiusX + 0.5D); + int y1 = MathHelper.floor(centerY + radiusY + 0.5D); + int z1 = MathHelper.floor(centerZ + radiusZ + 0.5D); for (int x = x0; x <= x1; ++x) { diff --git a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java index 8b13c41f7..9a61487bd 100644 --- a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java +++ b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorBigTree.java @@ -237,7 +237,7 @@ public class GeneratorBigTree extends GeneratorTreeBase final float radius = height / 2.0f; final float adjacent = radius - y; - float distance = MathHelper.sqrt_float(radius * radius - adjacent * adjacent); + float distance = MathHelper.sqrt(radius * radius - adjacent * adjacent); if (adjacent == 0) { distance = radius; @@ -318,9 +318,9 @@ public class GeneratorBigTree extends GeneratorTreeBase private int getSteps(BlockPos pos) { - final int absX = MathHelper.abs_int(pos.getX()); - final int absY = MathHelper.abs_int(pos.getY()); - final int absZ = MathHelper.abs_int(pos.getZ()); + final int absX = MathHelper.abs(pos.getX()); + final int absY = MathHelper.abs(pos.getY()); + final int absZ = MathHelper.abs(pos.getZ()); //Determine which axis has the greatest distance from the origin (0, 0, 0) if (absZ > absX && absZ > absY) { @@ -334,9 +334,9 @@ public class GeneratorBigTree extends GeneratorTreeBase private int getGreatestDistance(BlockPos posIn) { - int i = MathHelper.abs_int(posIn.getX()); - int j = MathHelper.abs_int(posIn.getY()); - int k = MathHelper.abs_int(posIn.getZ()); + int i = MathHelper.abs(posIn.getX()); + int j = MathHelper.abs(posIn.getY()); + int k = MathHelper.abs(posIn.getZ()); return k > i && k > j ? k : (j > i ? j : i); } diff --git a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorTaigaTree.java b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorTaigaTree.java index c9c0c68ef..a9862dba0 100644 --- a/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorTaigaTree.java +++ b/src/main/java/biomesoplenty/common/world/generator/tree/GeneratorTaigaTree.java @@ -69,8 +69,8 @@ public class GeneratorTaigaTree extends GeneratorTreeBase { int trunkWidth = (this.trunkWidth * (height - y) / height) + 1; - int trunkStart = MathHelper.ceiling_double_int(0.25D - trunkWidth / 2.0D); - int trunkEnd = MathHelper.floor_double(0.25D + trunkWidth / 2.0D); + int trunkStart = MathHelper.ceil(0.25D - trunkWidth / 2.0D); + int trunkEnd = MathHelper.floor(0.25D + trunkWidth / 2.0D); // require 3x3 for the leaves, 1x1 for the trunk int start = (y <= baseHeight ? trunkStart : trunkStart - 1); @@ -178,8 +178,8 @@ public class GeneratorTaigaTree extends GeneratorTreeBase { int trunkWidth = (this.trunkWidth * i / height) + 1; - int trunkStart = MathHelper.ceiling_double_int(0.25D - trunkWidth / 2.0D); - int trunkEnd = MathHelper.floor_double(0.25D + trunkWidth / 2.0D); + int trunkStart = MathHelper.ceil(0.25D - trunkWidth / 2.0D); + int trunkEnd = MathHelper.floor(0.25D + trunkWidth / 2.0D); int radius = Math.min(Math.min((i + 2) / 3, 3 + (leavesHeight - i)), 6); @@ -217,8 +217,8 @@ public class GeneratorTaigaTree extends GeneratorTreeBase for (int y = 0; y < height - 1; y++) { int trunkWidth = (this.trunkWidth * (height - y) / height) + 1; - int trunkStart = MathHelper.ceiling_double_int(0.25D - trunkWidth / 2.0D); - int trunkEnd = MathHelper.floor_double(0.25D + trunkWidth / 2.0D); + int trunkStart = MathHelper.ceil(0.25D - trunkWidth / 2.0D); + int trunkEnd = MathHelper.floor(0.25D + trunkWidth / 2.0D); // TODO: Temporary fix for trees generating larger than normal bases when in the sides of hills // Should look into doing this properly but i'm busy :P diff --git a/src/main/java/biomesoplenty/common/world/layer/GenLayerClimate.java b/src/main/java/biomesoplenty/common/world/layer/GenLayerClimate.java index b0bd0c69e..02636b7a2 100644 --- a/src/main/java/biomesoplenty/common/world/layer/GenLayerClimate.java +++ b/src/main/java/biomesoplenty/common/world/layer/GenLayerClimate.java @@ -32,7 +32,7 @@ public class GenLayerClimate extends BOPGenLayer { // temperature values from 0 (cold) to 8 (hot) and rainfall values from 0 (wet) to 11 (dry), index is (temperatureValue * 12) + rainfallValue // index is clamped to account for potential rounding errors due to use of doubles/floats - out[i] = this.climateMapping[MathHelper.clamp_int(index, 0, this.climateMapping.length - 1)]; + out[i] = this.climateMapping[MathHelper.clamp(index, 0, this.climateMapping.length - 1)]; } return out; } diff --git a/src/main/java/biomesoplenty/common/world/layer/GenLayerTemperatureLatitude.java b/src/main/java/biomesoplenty/common/world/layer/GenLayerTemperatureLatitude.java index 19785eef1..81af7d851 100644 --- a/src/main/java/biomesoplenty/common/world/layer/GenLayerTemperatureLatitude.java +++ b/src/main/java/biomesoplenty/common/world/layer/GenLayerTemperatureLatitude.java @@ -51,7 +51,7 @@ public class GenLayerTemperatureLatitude extends BOPGenLayer // set value between 1 and 4 which is periodic in Y (with some random variation) // ocean generally stays as ocean, unless it's ICY when it becomes frozen ocean double Yoffset = Y + this.offset + ((this.nextInt(1001) - 500) * this.offsetVariation / 500.0D); - out[x + y * areaWidth] = MathHelper.floor_double(this.amplitude * Math.abs((Math.abs(Yoffset % period) - halfPeriod))); + out[x + y * areaWidth] = MathHelper.floor(this.amplitude * Math.abs((Math.abs(Yoffset % period) - halfPeriod))); } } diff --git a/src/main/java/biomesoplenty/core/BiomesOPlenty.java b/src/main/java/biomesoplenty/core/BiomesOPlenty.java index 9d0990024..1c730be51 100644 --- a/src/main/java/biomesoplenty/core/BiomesOPlenty.java +++ b/src/main/java/biomesoplenty/core/BiomesOPlenty.java @@ -44,7 +44,7 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; -@Mod(modid = BiomesOPlenty.MOD_ID, version = BiomesOPlenty.MOD_VERSION , name = BiomesOPlenty.MOD_NAME, dependencies = "required-after:forge@[13.19.0.2133,)", guiFactory = BiomesOPlenty.GUI_FACTORY) +@Mod(modid = BiomesOPlenty.MOD_ID, version = BiomesOPlenty.MOD_VERSION , name = BiomesOPlenty.MOD_NAME, dependencies = "required-after:forge@[13.19.0.2152,)", guiFactory = BiomesOPlenty.GUI_FACTORY) public class BiomesOPlenty { public static final String MOD_NAME = "Biomes O' Plenty"; diff --git a/src/main/java/biomesoplenty/core/ClientProxy.java b/src/main/java/biomesoplenty/core/ClientProxy.java index 4d795a48b..3f63021cc 100644 --- a/src/main/java/biomesoplenty/core/ClientProxy.java +++ b/src/main/java/biomesoplenty/core/ClientProxy.java @@ -159,7 +159,7 @@ public class ClientProxy extends CommonProxy // register sub types if there are any if (item.getHasSubtypes()) { - NonNullList subItems = NonNullList.func_191196_a(); + NonNullList subItems = NonNullList.create(); item.getSubItems(item, CreativeTabBOP.instance, subItems); for (ItemStack subItem : subItems) { @@ -206,11 +206,11 @@ public class ClientProxy extends CommonProxy switch (type) { case PIXIETRAIL: - entityFx = new EntityPixieTrailFX(minecraft.world, x, y, z, MathHelper.getRandomDoubleInRange(minecraft.world.rand, -0.03, 0.03), -0.02D, MathHelper.getRandomDoubleInRange(minecraft.world.rand, -0.03, 0.03)); + entityFx = new EntityPixieTrailFX(minecraft.world, x, y, z, MathHelper.nextDouble(minecraft.world.rand, -0.03, 0.03), -0.02D, MathHelper.nextDouble(minecraft.world.rand, -0.03, 0.03)); break; case MUD: int itemId = Item.getIdFromItem(BOPItems.mudball); - minecraft.world.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.getRandomDoubleInRange(minecraft.world.rand, -0.08D, 0.08D), MathHelper.getRandomDoubleInRange(minecraft.world.rand, -0.08D, 0.08D), MathHelper.getRandomDoubleInRange(minecraft.world.rand, -0.08D, 0.08D), new int[] {itemId}); + minecraft.world.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), new int[] {itemId}); return; case PLAYER_TRAIL: if (info.length < 1)