diff --git a/.gitignore b/.gitignore index a136a699c..a76913f8a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,12 +4,11 @@ /Mixin/ /repo/ /run/ +.idea/* /.gradle/ /.settings/ /.classpath /.project # OS generated files *.DS_Store -BiomesOPlenty.iml -BiomesOPlenty.ipr -BiomesOPlenty.iws +*.iml diff --git a/build.properties b/build.properties index af70b510b..6cc035b87 100644 --- a/build.properties +++ b/build.properties @@ -1,4 +1,4 @@ -minecraft_version=1.10.2 -forge_version=12.18.1.2073 -mod_version=5.0.0 -mappings_version=snapshot_nodoc_20160808 +minecraft_version=1.11 +forge_version=13.19.0.2127-1.11.x +mod_version=6.0.0 +mappings_version=snapshot_nodoc_20161115 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f52cb9890..de8a48d25 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Tue Dec 15 20:33:12 AEDT 2015 +#Wed Nov 16 15:40:47 AEDT 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 91a7e269e..9d82f7891 100755 --- a/gradlew +++ b/gradlew @@ -42,11 +42,6 @@ case "`uname`" in ;; esac -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" @@ -61,9 +56,9 @@ while [ -h "$PRG" ] ; do fi done SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- +cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" -cd "$SAVED" >&- +cd "$SAVED" >/dev/null CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -114,6 +109,7 @@ fi if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` diff --git a/src/main/java/biomesoplenty/client/model/ModelBiomeFinder.java b/src/main/java/biomesoplenty/client/model/ModelBiomeFinder.java index d02ce348b..6471503eb 100644 --- a/src/main/java/biomesoplenty/client/model/ModelBiomeFinder.java +++ b/src/main/java/biomesoplenty/client/model/ModelBiomeFinder.java @@ -38,7 +38,7 @@ public class ModelBiomeFinder extends ItemOverrideList @Override public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) { - EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + EntityPlayerSP player = Minecraft.getMinecraft().player; if (player == null) {return this.frames[0];} NBTTagCompound nbt = stack.getTagCompound(); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BOPBiome.java b/src/main/java/biomesoplenty/common/biome/overworld/BOPBiome.java index ac8a2a8d8..31a8a738c 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BOPBiome.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BOPBiome.java @@ -41,6 +41,7 @@ import biomesoplenty.core.BiomesOPlenty; import net.minecraft.block.BlockSand; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EnumCreatureType; @@ -195,26 +196,27 @@ 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 = null; - for (Object entry : EntityList.NAME_TO_CLASS.entrySet()) - { - String entryEntityName = (String)((Entry)entry).getKey(); - if (entryEntityName.equalsIgnoreCase(entityName)) - { - entityClazz = (Class )((Entry)entry).getValue(); - } + Class entityClazz = EntityList.field_191308_b.getObject(new ResourceLocation(entityName)); + Class livingClazz = null; + if (!(entityClazz.isAssignableFrom(EntityLiving.class))) { + confEntity.addMessage("Entity " + entityName + " is not of type EntityLiving"); + continue; } - if (entityClazz == null) + else { + livingClazz = (Class )entityClazz; + } + + if (livingClazz == null) { confEntity.addMessage("No entity registered called " + entityName); continue; } - if (!creatureType.getCreatureClass().isAssignableFrom(entityClazz)) + if (!creatureType.getCreatureClass().isAssignableFrom(livingClazz)) { confEntity.addMessage("Entity " + entityName + " is not of type " + creatureType); continue; } - + List spawns = this.getSpawnableList(creatureType); Integer weight = confEntity.getInt("weight"); if (weight != null && weight < 1) @@ -224,7 +226,7 @@ public class BOPBiome extends Biome implements IExtendedBiome while (spawnIterator.hasNext()) { SpawnListEntry entry = spawnIterator.next(); - if (entry.entityClass == entityClazz) + if (entry.entityClass == livingClazz) { spawnIterator.remove(); } @@ -248,7 +250,7 @@ public class BOPBiome extends Biome implements IExtendedBiome if (!foundIt) { // the entry does not exist - add it - SpawnListEntry entry = new SpawnListEntry(entityClazz, confEntity.getInt("weight", 10), confEntity.getInt("minGroupCount", 4), confEntity.getInt("maxGroupCount", 4)); + SpawnListEntry entry = new SpawnListEntry(livingClazz, confEntity.getInt("weight", 10), confEntity.getInt("minGroupCount", 4), confEntity.getInt("maxGroupCount", 4)); spawns.add(entry); } } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java b/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java index b524af74b..10fd47962 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPAsh.java @@ -22,6 +22,7 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -41,7 +42,7 @@ public class BlockBOPAsh extends BlockBOPGeneric // ash blocks are slightly lower @Override - public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { return COLLISION_BOX; } @@ -51,7 +52,7 @@ public class BlockBOPAsh extends BlockBOPGeneric { if (entity instanceof EntityPlayer) { InventoryPlayer inventory = ((EntityPlayer)entity).inventory; - if (inventory.armorInventory[0] != null && inventory.armorInventory[0].getItem() == BOPItems.wading_boots) { + if (inventory.armorInventory.get(0).getItem() == BOPItems.wading_boots) { return; } } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java b/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java index 8699325f8..0ca08e9e8 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPBamboo.java @@ -61,7 +61,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration } @Override - public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { return BOUNDING_BOX; } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDecoration.java b/src/main/java/biomesoplenty/common/block/BlockBOPDecoration.java index abfb25781..c78751178 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDecoration.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDecoration.java @@ -18,6 +18,7 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.color.IBlockColor; import net.minecraft.client.renderer.color.IItemColor; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -25,6 +26,7 @@ import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -66,51 +68,25 @@ public class BlockBOPDecoration extends Block implements IBOPBlock // no collision box - you can walk straight through them @Override - public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { return NULL_AABB; } - -/* // utility function for setting the block bounds - typically decoration blocks are smaller than full block size - public void setBlockBoundsByRadiusAndHeight(float radius, float height) - { - this.setBlockBoundsByRadiusAndHeight(radius, height, false); - } - public void setBlockBoundsByRadiusAndHeight(float radius, float height, boolean fromTop) - { - this.setBlockBounds(0.5F - radius, (fromTop ? 1.0F - height : 0.0F), 0.5F - radius, 0.5F + radius, (fromTop ? 1.0F : height), 0.5F + radius); - } - // some decoration blocks have a random XZ offset applied - if we set block bounds based on state, we may need these functions to correct for the offset - public void setBlockBoundsByRadiusAndHeightWithXZOffset(float radius, float height, BlockPos pos) - { - this.setBlockBoundsByRadiusAndHeightWithXZOffset(radius, height, false, pos); - } - public void setBlockBoundsByRadiusAndHeightWithXZOffset(float radius, float height, boolean fromTop, BlockPos pos) - { - // some Minecraft weirdness to get over here: in BlockModelRenderer there are 2 alternative quad drawers - // renderModelAmbientOcclusionQuads and renderModelStandardQuads, and they use very nearly but not quite the same functions for the XZ offset - // both versions rely on getting an unpredictable long 'hash' of the BlockPos coordinates - // the ambient one uses long i = MathHelper.getPositionRandom(pos) (which equates to long i = (long)(x * 3129871) ^ (long)z * 116129781L ^ (long)y; ) - // the standard one uses long i = (long)(x * 3129871) ^ (long)z * 116129781L; (no dependence on y) - // we use the standard one here, because that's the one being used to draw the plants - // it looks like a mistake to me. I think they probably intended to use MathHelper.getPositionRandom for both, but maybe there is some reason behind it - long i = (long)(pos.getX() * 3129871) ^ (long)pos.getZ() * 116129781L; - i = i * i * 42317861L + i * 11L; - float dx = (((float)(i >> 16 & 15L) / 15.0F) - 0.5F) * 0.5F; - float dz = (((float)(i >> 24 & 15L) / 15.0F) - 0.5F) * 0.5F; - this.setBlockBounds(0.5F - radius + dx, (fromTop ? 1.0F - height : 0.0F), 0.5F - radius + dz, 0.5F + radius + dx, (fromTop ? 1.0F : height), 0.5F + radius + dz); - } - */ + // add a canBlockStay() check before placing this block @Override - public boolean canReplace(World world, BlockPos pos, EnumFacing side, ItemStack stack) - { - return world.getBlockState(pos).getBlock().isReplaceable(world, pos) && this.canBlockStay(world, pos, this.getStateFromMeta(stack.getMetadata())); + 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) && this.canBlockStay(world, pos, this.getStateFromMeta(meta))) { + return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer); + } + + return world.getBlockState(pos); } // check this block is still able to remain after neighbor change @Override - public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock) + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock, BlockPos neighborPos) { this.checkAndDropBlock(world, pos, state); } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java index 24d2edc31..3eccea936 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleDecoration.java @@ -130,9 +130,13 @@ public class BlockBOPDoubleDecoration extends BlockBOPDecoration { // This DoubleDecoration can replace the block at pos if both the block and the one above it are replaceable and the environment is suitable (canBlockStay) @Override - public boolean canReplace(World world, BlockPos pos, EnumFacing side, ItemStack stack) + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { - return world.getBlockState(pos).getBlock().isReplaceable(world, pos) && world.getBlockState(pos.up()).getBlock().isReplaceable(world, pos.up()) && this.canBlockStay(world, pos, this.getStateFromMeta(stack.getMetadata())); + 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 world.getBlockState(pos); } // Called by ItemBlock before the block is placed - the placed block must always be Half.LOWER diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java index 57da4650d..f807443aa 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoublePlant.java @@ -28,6 +28,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.IStringSerializable; +import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.ColorizerFoliage; @@ -244,7 +245,7 @@ public class BlockBOPDoublePlant extends BlockBOPDoubleDecoration implements ISh @SideOnly(Side.CLIENT) @Override - public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList list) { // get the preset blocks variants ImmutableSet presets = BlockStateUtils.getBlockPresets(this); diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java index 2b32d01e1..5d9b207b7 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPDoubleWoodSlab.java @@ -30,6 +30,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; +import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraftforge.fml.relauncher.Side; @@ -154,7 +155,7 @@ public class BlockBOPDoubleWoodSlab extends BlockSlab implements IBOPBlock @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList list) { // get the preset blocks variants ImmutableSet presets = BlockStateUtils.getBlockPresets(this); diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java b/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java index 6b36c83d8..3471de89c 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPFarmland.java @@ -156,7 +156,7 @@ public class BlockBOPFarmland extends BlockFarmland implements IBOPBlock } @Override - public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock) + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock, BlockPos neighborPos) { if (world.getBlockState(pos.up()).getMaterial().isSolid()) { diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPFlesh.java b/src/main/java/biomesoplenty/common/block/BlockBOPFlesh.java index cbf24e427..6a453d42c 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPFlesh.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPFlesh.java @@ -84,7 +84,7 @@ public class BlockBOPFlesh extends Block implements IBOPBlock if (entity instanceof EntityPlayer) { InventoryPlayer inventory = ((EntityPlayer)entity).inventory; - if (inventory.armorInventory[0] != null && inventory.armorInventory[0].getItem() == BOPItems.wading_boots) { + if (inventory.armorInventory.get(0).getItem() == BOPItems.wading_boots) { return; } } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java b/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java index 677e8b3fe..1e7aef68c 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPGrassPath.java @@ -108,7 +108,7 @@ public class BlockBOPGrassPath extends BlockGrassPath implements IBOPBlock } @Override - public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn) + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos neighborPos) { if (world.getBlockState(pos.up()).getMaterial().isSolid()) { diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java b/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java index 1e3e43e52..92fadd604 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPHalfOtherSlab.java @@ -28,6 +28,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.IStringSerializable; +import net.minecraft.util.NonNullList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -185,7 +186,7 @@ public class BlockBOPHalfOtherSlab extends BlockSlab implements IBOPBlock @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList list) { // get the preset blocks variants ImmutableSet presets = BlockStateUtils.getBlockPresets(this); diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java b/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java index 652947830..96968532e 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPHalfWoodSlab.java @@ -29,6 +29,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; +import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraftforge.fml.relauncher.Side; @@ -146,7 +147,7 @@ public class BlockBOPHalfWoodSlab extends BlockSlab implements IBOPBlock @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList list) { // get the preset blocks variants ImmutableSet presets = BlockStateUtils.getBlockPresets(this); diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java b/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java index f4bc2ba4f..a2e01b85a 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPLeaves.java @@ -32,6 +32,7 @@ import net.minecraft.stats.StatList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; +import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.ColorizerFoliage; @@ -157,9 +158,7 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tab, List list) - { - } + public void getSubBlocks(Item item, CreativeTabs tab, NonNullList list) {} // map from meta to state and vice verca. Use the same scheme as for the vanilla leaf blocks // highest bit is for CHECK_DECAY true=>1 false=>0 diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPLog.java b/src/main/java/biomesoplenty/common/block/BlockBOPLog.java index db74964cc..c7d61c472 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPLog.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPLog.java @@ -23,6 +23,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; +import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraftforge.fml.relauncher.Side; @@ -101,7 +102,7 @@ public class BlockBOPLog extends BlockLog implements IBOPBlock @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tab, List list) + public void getSubBlocks(Item item, CreativeTabs tab, NonNullList list) { } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPMud.java b/src/main/java/biomesoplenty/common/block/BlockBOPMud.java index 57828b1de..f64b4f282 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPMud.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPMud.java @@ -120,7 +120,7 @@ public class BlockBOPMud extends Block implements IBOPBlock, ISustainsPlantType case MUD: if (entity instanceof EntityPlayer) { InventoryPlayer inventory = ((EntityPlayer)entity).inventory; - if (inventory.armorInventory[0] != null && inventory.armorInventory[0].getItem() == BOPItems.wading_boots) { + if (inventory.armorInventory.get(0).getItem() == BOPItems.wading_boots) { break; } } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java b/src/main/java/biomesoplenty/common/block/BlockBOPPlant.java index 717bd74e2..c403a0307 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[0] != null && inventory.armorInventory[1] != null) { + if (inventory.armorInventory.get(0) != ItemStack.field_190927_a && inventory.armorInventory.get(1) != ItemStack.field_190927_a) { 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[0] != null && inventory.armorInventory[1] != null) { + if (inventory.armorInventory.get(0) != ItemStack.field_190927_a && inventory.armorInventory.get(1) != ItemStack.field_190927_a) { break; } entity.attackEntityFrom(DamageSource.cactus, 1); @@ -461,7 +461,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo } @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { switch ((BOPPlants) state.getValue(this.variantProperty)) { @@ -479,7 +479,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo } return true; } - return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); + return super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ); } diff --git a/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java b/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java index b71928d7c..e05305915 100644 --- a/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java +++ b/src/main/java/biomesoplenty/common/block/BlockBOPTerrarium.java @@ -90,7 +90,7 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock } @Override - public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos) + public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) { return BOUNDING_BOX; } diff --git a/src/main/java/biomesoplenty/common/command/BOPCommand.java b/src/main/java/biomesoplenty/common/command/BOPCommand.java index c03b063ee..e549f9095 100644 --- a/src/main/java/biomesoplenty/common/command/BOPCommand.java +++ b/src/main/java/biomesoplenty/common/command/BOPCommand.java @@ -121,7 +121,7 @@ public class BOPCommand extends CommandBase } EntityPlayerMP player = getCommandSenderAsPlayer(sender); - World world = player.worldObj; + World world = player.world; BlockPos closestBiomePos = biomeToFind == null ? null : BiomeUtils.spiralOutwardsLookingForBiome(world, biomeToFind, player.posX, player.posZ); if (closestBiomePos != null) @@ -216,7 +216,7 @@ public class BOPCommand extends CommandBase { blockStorage.set(x, y, z, Blocks.AIR.getDefaultState()); world.notifyBlockUpdate(pos, state, Blocks.AIR.getDefaultState(), 3); - world.notifyNeighborsRespectDebug(pos, Blocks.AIR); + world.notifyNeighborsRespectDebug(pos, Blocks.AIR, false); } } } diff --git a/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java b/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java index 25953252d..41e4f7eae 100644 --- a/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java +++ b/src/main/java/biomesoplenty/common/crafting/BiomeEssenceRecipe.java @@ -13,6 +13,7 @@ import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.NonNullList; import net.minecraft.world.World; import net.minecraftforge.oredict.RecipeSorter; @@ -84,16 +85,16 @@ public class BiomeEssenceRecipe implements IRecipe } @Override - public ItemStack[] getRemainingItems(InventoryCrafting inv) + public NonNullList getRemainingItems(InventoryCrafting inv) { - ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + NonNullList itemList = NonNullList.func_191196_a(); - for (int i = 0; i < aitemstack.length; ++i) + for (int i = 0; i < inv.getSizeInventory(); ++i) { ItemStack itemstack = inv.getStackInSlot(i); - aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack); + itemList.add(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack)); } - return aitemstack; + return itemList; } } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/entities/EntityButterfly.java b/src/main/java/biomesoplenty/common/entities/EntityButterfly.java index f66b2d4fe..ea6638374 100644 --- a/src/main/java/biomesoplenty/common/entities/EntityButterfly.java +++ b/src/main/java/biomesoplenty/common/entities/EntityButterfly.java @@ -110,7 +110,7 @@ public class EntityButterfly extends EntityFlying implements IMob { { BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ); - if (blockpos.getY() <= this.worldObj.getSeaLevel()) + if (blockpos.getY() <= this.world.getSeaLevel()) { return false; } @@ -122,7 +122,7 @@ public class EntityButterfly extends EntityFlying implements IMob { } else { - int light = this.worldObj.getLightFromNeighbors(blockpos); + int light = this.world.getLightFromNeighbors(blockpos); return light > 8 && super.getCanSpawnHere(); } @@ -188,7 +188,7 @@ public class EntityButterfly extends EntityFlying implements IMob { public boolean isBoxBlocked(AxisAlignedBB box) { - return !this.butterfly.worldObj.getCollisionBoxes(this.butterfly, box).isEmpty(); + return !this.butterfly.world.getCollisionBoxes(this.butterfly, box).isEmpty(); } // check nothing will collide with the butterfly in the direction of aim, for howFar units (or until the destination - whichever is closer) diff --git a/src/main/java/biomesoplenty/common/entities/EntityPixie.java b/src/main/java/biomesoplenty/common/entities/EntityPixie.java index d81f01de5..9784ecec7 100644 --- a/src/main/java/biomesoplenty/common/entities/EntityPixie.java +++ b/src/main/java/biomesoplenty/common/entities/EntityPixie.java @@ -55,7 +55,7 @@ public class EntityPixie extends EntityFlying implements IMob { public void onLivingUpdate() { super.onLivingUpdate(); - if (this.worldObj.isRemote) + if (this.world.isRemote) { for (int i = 0; i < 7; i++) { @@ -74,22 +74,22 @@ public class EntityPixie extends EntityFlying implements IMob { { BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ); - if (this.worldObj.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32)) + if (this.world.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32)) { // TODO: not sure what's going on here... return false; } else { - int light = this.worldObj.getLightFromNeighbors(blockpos); + int light = this.world.getLightFromNeighbors(blockpos); // if it's thundering, force getSkylightSubtracted to 10 before calculating getLightFromNeighbors, then restore it - if (this.worldObj.isThundering()) + if (this.world.isThundering()) { - int oldSkyLightSubtracted = this.worldObj.getSkylightSubtracted(); - this.worldObj.setSkylightSubtracted(10); - light = this.worldObj.getLightFromNeighbors(blockpos); - this.worldObj.setSkylightSubtracted(oldSkyLightSubtracted); + int oldSkyLightSubtracted = this.world.getSkylightSubtracted(); + this.world.setSkylightSubtracted(10); + light = this.world.getLightFromNeighbors(blockpos); + this.world.setSkylightSubtracted(oldSkyLightSubtracted); } return light <= this.rand.nextInt(8); @@ -166,7 +166,7 @@ public class EntityPixie extends EntityFlying implements IMob { public boolean isBoxBlocked(AxisAlignedBB box) { - return !this.pixie.worldObj.getCollisionBoxes(this.pixie, box).isEmpty(); + return !this.pixie.world.getCollisionBoxes(this.pixie, box).isEmpty(); } // check nothing will collide with the pixie in the direction of aim, for howFar units (or until the destination - whichever is closer) diff --git a/src/main/java/biomesoplenty/common/entities/EntitySnail.java b/src/main/java/biomesoplenty/common/entities/EntitySnail.java index 812b057d5..b1291ecee 100644 --- a/src/main/java/biomesoplenty/common/entities/EntitySnail.java +++ b/src/main/java/biomesoplenty/common/entities/EntitySnail.java @@ -38,19 +38,19 @@ public class EntitySnail extends EntityLiving implements IMob { int y = MathHelper.floor_double(this.getEntityBoundingBox().minY); int z = MathHelper.floor_double(this.posZ); BlockPos blockpos = new BlockPos(x, y, z); - if (this.worldObj.getBlockState(blockpos.down()).getBlock() != Blocks.GRASS && this.worldObj.getBlockState(blockpos.down()).getBlock() != BOPBlocks.grass) + if (this.world.getBlockState(blockpos.down()).getBlock() != Blocks.GRASS && this.world.getBlockState(blockpos.down()).getBlock() != BOPBlocks.grass) { return false; } else { - if (blockpos.getY() <= this.worldObj.getSeaLevel()) + if (blockpos.getY() <= this.world.getSeaLevel()) { return false; } else { - return this.worldObj.getLight(blockpos) > 6 && super.getCanSpawnHere(); + return this.world.getLight(blockpos) > 6 && super.getCanSpawnHere(); } } } diff --git a/src/main/java/biomesoplenty/common/entities/EntityWasp.java b/src/main/java/biomesoplenty/common/entities/EntityWasp.java index 120fafc23..29972a73e 100644 --- a/src/main/java/biomesoplenty/common/entities/EntityWasp.java +++ b/src/main/java/biomesoplenty/common/entities/EntityWasp.java @@ -129,7 +129,7 @@ public class EntityWasp extends EntityFlying implements IMob { public boolean isBoxBlocked(AxisAlignedBB box) { //Im assuming this does what getCubes did. If not, im terribly sorry - Topisani - return !this.wasp.worldObj.getCollisionBoxes(this.wasp, box).isEmpty(); + return !this.wasp.world.getCollisionBoxes(this.wasp, box).isEmpty(); } // check nothing will collide with the wasp in the direction of aim, for howFar units (or until the destination - whichever is closer) diff --git a/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java b/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java index a47633117..917610286 100644 --- a/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java +++ b/src/main/java/biomesoplenty/common/entities/ai/EntityAIEatBOPGrass.java @@ -33,7 +33,7 @@ public class EntityAIEatBOPGrass extends EntityAIEatGrass { super(entityLiving); this.sheep = entityLiving; - this.world = entityLiving.worldObj; + this.world = entityLiving.world; this.setMutexBits(7); } diff --git a/src/main/java/biomesoplenty/common/entities/projectiles/EntityMudball.java b/src/main/java/biomesoplenty/common/entities/projectiles/EntityMudball.java index 6fcb9b5a4..e3875c4d5 100644 --- a/src/main/java/biomesoplenty/common/entities/projectiles/EntityMudball.java +++ b/src/main/java/biomesoplenty/common/entities/projectiles/EntityMudball.java @@ -53,7 +53,7 @@ public class EntityMudball extends EntityThrowable BiomesOPlenty.proxy.spawnParticle(BOPParticleTypes.MUD, this.posX, this.posY, this.posZ); } - if (!this.worldObj.isRemote) + if (!this.world.isRemote) { this.setDead(); } diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java index 333e53cdc..0aedd7104 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockBloodFluid.java @@ -34,7 +34,7 @@ public class BlockBloodFluid extends BlockFluidClassic } @Override - public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) + public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return NULL_AABB; } @@ -47,9 +47,9 @@ public class BlockBloodFluid extends BlockFluidClassic } @Override - public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos neighborPos) { - super.neighborChanged(state, worldIn, pos, blockIn); + super.neighborChanged(state, worldIn, pos, blockIn, neighborPos); this.checkForMixing(worldIn, pos, state); } diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java index f70ec9e78..b0d2c8d9a 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHoneyFluid.java @@ -50,7 +50,7 @@ public class BlockHoneyFluid extends BlockFluidFinite } @Override - public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) + public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return NULL_AABB; } @@ -63,9 +63,9 @@ public class BlockHoneyFluid extends BlockFluidFinite } @Override - public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos neighborPos) { - super.neighborChanged(state, worldIn, pos, blockIn); + super.neighborChanged(state, worldIn, pos, blockIn, neighborPos); this.checkForMixing(worldIn, pos, state); } diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java index 16157f327..a706c4422 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java @@ -64,7 +64,7 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic } @Override - public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) + public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return NULL_AABB; } @@ -77,9 +77,9 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic } @Override - public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos neighborPos) { - super.neighborChanged(state, worldIn, pos, blockIn); + super.neighborChanged(state, worldIn, pos, blockIn, neighborPos); this.checkForMixing(worldIn, pos, state); } diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java index a75a20187..114741d83 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockPoisonFluid.java @@ -50,7 +50,7 @@ public class BlockPoisonFluid extends BlockFluidClassic } @Override - public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos) + public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return NULL_AABB; } @@ -63,9 +63,9 @@ public class BlockPoisonFluid extends BlockFluidClassic } @Override - public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos neighborPos) { - super.neighborChanged(state, worldIn, pos, blockIn); + super.neighborChanged(state, worldIn, pos, blockIn, neighborPos); this.checkForMixing(worldIn, pos, state); } diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java index 0b3ca2e94..8b43cc2cd 100644 --- a/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockQuicksandFluid.java @@ -52,9 +52,9 @@ public class BlockQuicksandFluid extends BlockFluidClassic } @Override - public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) + public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos neighborPos) { - super.neighborChanged(state, worldIn, pos, blockIn); + super.neighborChanged(state, worldIn, pos, blockIn, neighborPos); this.checkForMixing(worldIn, pos, state); } diff --git a/src/main/java/biomesoplenty/common/handler/AchievementEventHandler.java b/src/main/java/biomesoplenty/common/handler/AchievementEventHandler.java index c1accc142..7c2cf444a 100644 --- a/src/main/java/biomesoplenty/common/handler/AchievementEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/AchievementEventHandler.java @@ -252,7 +252,7 @@ public class AchievementEventHandler private void updateBiomeRadarExplore(EntityPlayerMP player) { - Biome currentBiome = player.worldObj.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ))); + Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ))); //Search every item in the player's main inventory for a biome radar for (ItemStack stack : player.inventory.mainInventory) @@ -277,7 +277,7 @@ public class AchievementEventHandler private void updateBiomesExplored(EntityPlayerMP player) { - Biome currentBiome = player.worldObj.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ))); + Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(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 f304e4538..0201501ee 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.stackSize;} + if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.func_190920_e(stack.func_190916_E() - 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.stackSize;} + if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.func_190920_e(stack.func_190916_E() - 1);} event.setResult(Result.ALLOW); } } diff --git a/src/main/java/biomesoplenty/common/handler/FlippersEventHandler.java b/src/main/java/biomesoplenty/common/handler/FlippersEventHandler.java index e04b98581..e2a4f13a2 100644 --- a/src/main/java/biomesoplenty/common/handler/FlippersEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/FlippersEventHandler.java @@ -19,7 +19,7 @@ public class FlippersEventHandler if (player.isInWater() && !player.capabilities.isFlying) { - if (inventory.armorInventory[0] != null && inventory.armorInventory[0].getItem() == BOPItems.flippers) + if (inventory.armorInventory.get(0).getItem() == BOPItems.flippers) { player.motionX *= 1.125D; player.motionY *= 1.1D; diff --git a/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java b/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java index edd0e319b..2682b32ad 100644 --- a/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/ItemEventHandler.java @@ -46,7 +46,7 @@ public class ItemEventHandler ItemStack stack = event.getItem().getEntityItem(); ItemStack basketStack = ItemFlowerBasket.findBasketStack(player); - if (!player.worldObj.isRemote) + if (!player.world.isRemote) { //Check if the player has a basket in their inventory, and if the stack is suitable for adding //to the basket @@ -58,7 +58,7 @@ public class ItemEventHandler if (inventory.addItem(stack) == null) { //Set stack size to 0 to cause it to be removed - stack.stackSize = 0; + stack.func_190920_e(0); //Prevent the stack from being added to the player's inventory event.setResult(Result.ALLOW); } diff --git a/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java b/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java index 76f30625f..02da62be1 100644 --- a/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/TrailsEventHandler.java @@ -37,17 +37,17 @@ public class TrailsEventHandler EntityPlayer player = (EntityPlayer)event.player; //Check if the player has a trail - if (minecraft.thePlayer != null && TrailManager.trailsMap.containsKey(player.getUniqueID())) + if (minecraft.player != null && TrailManager.trailsMap.containsKey(player.getUniqueID())) { //Don't display if the local player's trail if they have the visibility set to others - if (MiscConfigurationHandler.trailVisbilityMode == TrailVisibilityMode.OTHERS && minecraft.thePlayer.getUniqueID() == player.getUniqueID()) + if (MiscConfigurationHandler.trailVisbilityMode == TrailVisibilityMode.OTHERS && minecraft.player.getUniqueID() == player.getUniqueID()) { return; } String trailName = TrailManager.trailsMap.get(player.getUniqueID()); - World world = player.worldObj; + World world = player.world; float groundYOffset = 0.015625F; //Prevents particles from z-fighting with the ground BlockPos playerPos = player.getPosition(); @@ -73,7 +73,7 @@ public class TrailsEventHandler public void onPlayerLoggedIn(PlayerLoggedInEvent event) { EntityPlayer player = event.player; - World world = player.worldObj; + World world = player.world; if (world.isRemote) { diff --git a/src/main/java/biomesoplenty/common/handler/potion/PotionPossessionEventHandler.java b/src/main/java/biomesoplenty/common/handler/potion/PotionPossessionEventHandler.java index 1102afb4d..0b993ae1a 100644 --- a/src/main/java/biomesoplenty/common/handler/potion/PotionPossessionEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/potion/PotionPossessionEventHandler.java @@ -24,7 +24,7 @@ public class PotionPossessionEventHandler { EntityLivingBase entity = event.getEntityLiving(); - Random rand = entity.worldObj.rand; + Random rand = entity.world.rand; double posX = entity.posX; double posY = entity.posY; @@ -40,7 +40,7 @@ public class PotionPossessionEventHandler if (rand.nextInt(5) == 0) { - if (!entity.worldObj.checkBlockCollision(entity.getEntityBoundingBox().offset(randX, randY, randZ))) + if (!entity.world.checkBlockCollision(entity.getEntityBoundingBox().offset(randX, randY, randZ))) entity.setPosition(posX + randX, posY + randY, posZ + randZ); } diff --git a/src/main/java/biomesoplenty/common/init/ModEntities.java b/src/main/java/biomesoplenty/common/init/ModEntities.java index 53d3312a8..72a68f235 100644 --- a/src/main/java/biomesoplenty/common/init/ModEntities.java +++ b/src/main/java/biomesoplenty/common/init/ModEntities.java @@ -22,6 +22,7 @@ import biomesoplenty.core.BiomesOPlenty; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityList.EntityEggInfo; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.ModContainer; @@ -63,7 +64,7 @@ public class ModEntities public static int registerBOPEntityWithSpawnEgg(Class entityClass, String entityName, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates, int eggBackgroundColor, int eggForegroundColor) { int bopEntityId = registerBOPEntity(entityClass, entityName, trackingRange, updateFrequency, sendsVelocityUpdates); - entityEggs.put(Integer.valueOf(bopEntityId), new EntityList.EntityEggInfo(entityName, eggBackgroundColor, eggForegroundColor)); + entityEggs.put(Integer.valueOf(bopEntityId), new EntityList.EntityEggInfo(new ResourceLocation(BiomesOPlenty.MOD_ID, entityName), eggBackgroundColor, eggForegroundColor)); return bopEntityId; } diff --git a/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java b/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java index 37ee1833d..eeb91352c 100644 --- a/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java +++ b/src/main/java/biomesoplenty/common/inventory/ContainerFlowerBasket.java @@ -68,7 +68,7 @@ public class ContainerFlowerBasket extends Container { super.onContainerClosed(player); - if (!player.worldObj.isRemote) + if (!player.world.isRemote) { //Ensure all baskets are closed once the inventory is ItemFlowerBasket.clearOpenBaskets(player); @@ -99,7 +99,7 @@ public class ContainerFlowerBasket extends Container return null; } - if (mergedStack.stackSize == 0) + if (mergedStack.func_190916_E() == 0) { slot.putStack((ItemStack)null); } diff --git a/src/main/java/biomesoplenty/common/inventory/InventoryFlowerBasket.java b/src/main/java/biomesoplenty/common/inventory/InventoryFlowerBasket.java index b795e0a6c..f1642ca7a 100644 --- a/src/main/java/biomesoplenty/common/inventory/InventoryFlowerBasket.java +++ b/src/main/java/biomesoplenty/common/inventory/InventoryFlowerBasket.java @@ -81,7 +81,7 @@ public class InventoryFlowerBasket extends InventoryBasic //Ensure the slot index is valid if (slotIndex >= 0 && slotIndex < this.getSizeInventory()) { - this.setInventorySlotContents(slotIndex, ItemStack.loadItemStackFromNBT(itemTag)); + this.setInventorySlotContents(slotIndex, new ItemStack(itemTag)); } } diff --git a/src/main/java/biomesoplenty/common/item/ItemBOPBlock.java b/src/main/java/biomesoplenty/common/item/ItemBOPBlock.java index d7680564e..2ea084a1e 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBOPBlock.java +++ b/src/main/java/biomesoplenty/common/item/ItemBOPBlock.java @@ -20,6 +20,7 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import net.minecraft.util.NonNullList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -45,7 +46,7 @@ public class ItemBOPBlock extends ItemBlock // define the items which will appear in the creative tab (called by ItemBlock class) @Override @SideOnly(Side.CLIENT) - public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList subItems) { ImmutableSet presets = BlockStateUtils.getBlockPresets(this.block); if (presets.isEmpty()) diff --git a/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java b/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java index a7059a54c..6bd0eb26a 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java +++ b/src/main/java/biomesoplenty/common/item/ItemBOPLilypad.java @@ -32,8 +32,9 @@ public class ItemBOPLilypad extends ItemBOPBlock { // (usually when you point the cursor at water the picked block is whatever is underneath the water - when placing lilies the water itself has to be picked) // The below is copied from vanille BlockLilyPad @Override - public ActionResult onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) + public ActionResult onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand) { + ItemStack itemStackIn = playerIn.getHeldItem(hand); RayTraceResult movingobjectposition = this.rayTrace(worldIn, playerIn, true); if (movingobjectposition == null) @@ -73,7 +74,7 @@ public class ItemBOPLilypad extends ItemBOPBlock { if (!playerIn.capabilities.isCreativeMode) { - --itemStackIn.stackSize; + itemStackIn.func_190920_e(itemStackIn.func_190916_E() - 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 bb4fe5cd4..39408c524 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java +++ b/src/main/java/biomesoplenty/common/item/ItemBOPPlant.java @@ -32,8 +32,9 @@ public class ItemBOPPlant extends ItemBOPBlock { // The code for right clicking needs to be overridden to handle the unique way reeds are placed - on top of the water // (usually when you point the cursor at water the picked block is whatever is underneath the water - when placing reeds the water itself has to be picked) @Override - public ActionResult onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) + public ActionResult onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand) { + ItemStack itemStackIn = playerIn.getHeldItem(hand); if (this.block instanceof BlockBOPPlant) { BlockBOPPlant block = (BlockBOPPlant)this.block; @@ -81,7 +82,7 @@ public class ItemBOPPlant extends ItemBOPBlock { if (!playerIn.capabilities.isCreativeMode) { - --itemStackIn.stackSize; + itemStackIn.func_190920_e(itemStackIn.func_190916_E() - 1); } //TODO: 1.9 playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]); @@ -96,7 +97,7 @@ public class ItemBOPPlant extends ItemBOPBlock { } // in all other cases take the default action - return super.onItemRightClick(itemStackIn, worldIn, playerIn, hand); + return super.onItemRightClick(worldIn, playerIn, hand); } diff --git a/src/main/java/biomesoplenty/common/item/ItemBOPSpawnEgg.java b/src/main/java/biomesoplenty/common/item/ItemBOPSpawnEgg.java index 82bb7765a..28ff8d970 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBOPSpawnEgg.java +++ b/src/main/java/biomesoplenty/common/item/ItemBOPSpawnEgg.java @@ -29,10 +29,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.MobSpawnerBaseLogic; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityMobSpawner; -import net.minecraft.util.ActionResult; -import net.minecraft.util.EnumActionResult; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; +import net.minecraft.util.*; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; @@ -51,7 +48,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem @Override @SideOnly(Side.CLIENT) - public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList subItems) { for (Entry entry : ModEntities.entityEggs.entrySet()) { @@ -102,8 +99,9 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem } @Override - public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) + public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + ItemStack stack = playerIn.getHeldItem(hand); if (worldIn.isRemote) { return EnumActionResult.SUCCESS; @@ -123,13 +121,13 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem if (tileentity instanceof TileEntityMobSpawner) { MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic(); - mobspawnerbaselogic.setEntityName(EntityList.CLASS_TO_NAME.get(EntityList.getClassFromID(stack.getMetadata()))); + mobspawnerbaselogic.func_190894_a(EntityList.field_191308_b.getNameForObject(EntityList.getClassFromID(stack.getMetadata()))); tileentity.markDirty(); worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3); if (!playerIn.capabilities.isCreativeMode) { - --stack.stackSize; + stack.func_190920_e(stack.func_190916_E() - 1); } return EnumActionResult.SUCCESS; @@ -155,7 +153,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem if (!playerIn.capabilities.isCreativeMode) { - --stack.stackSize; + stack.func_190920_e(stack.func_190916_E() - 1); } } @@ -164,8 +162,9 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem } @Override - public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) + public ActionResult onItemRightClick(World world, EntityPlayer player, EnumHand hand) { + ItemStack stack = player.getHeldItem(hand); if (world.isRemote) { return new ActionResult(EnumActionResult.FAIL, stack); @@ -207,7 +206,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem if (!player.capabilities.isCreativeMode) { - --stack.stackSize; + stack.func_190920_e(stack.func_190916_E() - 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 2214960ed..e5cd15338 100644 --- a/src/main/java/biomesoplenty/common/item/ItemBiomeFinder.java +++ b/src/main/java/biomesoplenty/common/item/ItemBiomeFinder.java @@ -93,9 +93,9 @@ public class ItemBiomeFinder extends Item @Override - public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) + public ActionResult onItemRightClick(World world, EntityPlayer player, EnumHand hand) { - + ItemStack stack = player.getHeldItem(hand); if (!stack.hasTagCompound()) {stack.setTagCompound(new NBTTagCompound());} NBTTagCompound nbt = stack.getTagCompound(); diff --git a/src/main/java/biomesoplenty/common/item/ItemEnderporter.java b/src/main/java/biomesoplenty/common/item/ItemEnderporter.java index d95f3876f..ca96c84f5 100644 --- a/src/main/java/biomesoplenty/common/item/ItemEnderporter.java +++ b/src/main/java/biomesoplenty/common/item/ItemEnderporter.java @@ -31,8 +31,9 @@ public class ItemEnderporter extends Item { } @Override - public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) + public ActionResult onItemRightClick( World world, EntityPlayer player, EnumHand hand) { + ItemStack stack = player.getHeldItem(hand); if (player.getRidingEntity() != null) {return new ActionResult(EnumActionResult.FAIL, stack);} // can only use the enderporter on the surface world if (world.provider.isSurfaceWorld()) diff --git a/src/main/java/biomesoplenty/common/item/ItemFlowerBasket.java b/src/main/java/biomesoplenty/common/item/ItemFlowerBasket.java index 7e7d9d206..6daad9aca 100644 --- a/src/main/java/biomesoplenty/common/item/ItemFlowerBasket.java +++ b/src/main/java/biomesoplenty/common/item/ItemFlowerBasket.java @@ -60,8 +60,9 @@ public class ItemFlowerBasket extends Item } @Override - public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) + public ActionResult onItemRightClick(World world, EntityPlayer player, EnumHand hand) { + ItemStack stack = player.getHeldItem(hand); if (!world.isRemote) { NBTTagCompound compound = NBTUtil.getOrCreateStackNBT(stack); diff --git a/src/main/java/biomesoplenty/common/item/ItemGem.java b/src/main/java/biomesoplenty/common/item/ItemGem.java index 0b01e9444..4b4f525bd 100644 --- a/src/main/java/biomesoplenty/common/item/ItemGem.java +++ b/src/main/java/biomesoplenty/common/item/ItemGem.java @@ -14,6 +14,7 @@ import biomesoplenty.api.enums.BOPGems; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.NonNullList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -29,7 +30,7 @@ public class ItemGem extends Item // add all the gem types as separate items in the creative tab @Override @SideOnly(Side.CLIENT) - public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList subItems) { for (BOPGems gemType : BOPGems.values()) { diff --git a/src/main/java/biomesoplenty/common/item/ItemJarEmpty.java b/src/main/java/biomesoplenty/common/item/ItemJarEmpty.java index d0f18c450..85c7286bf 100644 --- a/src/main/java/biomesoplenty/common/item/ItemJarEmpty.java +++ b/src/main/java/biomesoplenty/common/item/ItemJarEmpty.java @@ -38,8 +38,9 @@ public class ItemJarEmpty extends Item @Override - public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) + public ActionResult onItemRightClick(World world, EntityPlayer player, EnumHand hand) { + ItemStack stack = player.getHeldItem(hand); RayTraceResult hit = this.rayTrace(world, player, true); if (hit == null) { @@ -79,11 +80,11 @@ public class ItemJarEmpty extends Item private ItemStack fillJar(ItemStack stack, EntityPlayer player, ItemStack jarStack) { - --stack.stackSize; + stack.func_190920_e(stack.func_190916_E() - 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.stackSize <= 0) + if (stack.func_190916_E() <= 0) { return jarStack; } else { @@ -105,12 +106,12 @@ public class ItemJarEmpty extends Item { EntityPixie pixie = (EntityPixie)target; pixie.setDead(); - --stack.stackSize; + stack.func_190920_e(stack.func_190916_E() - 1); ItemStack pixieJar = new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.PIXIE.ordinal()); - EntityItem pixieJarEntity = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, pixieJar); - if (!player.worldObj.isRemote) + EntityItem pixieJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, pixieJar); + if (!player.world.isRemote) { - player.worldObj.spawnEntityInWorld(pixieJarEntity); + player.world.spawnEntityInWorld(pixieJarEntity); if (!(player instanceof FakePlayer)) {pixieJarEntity.onCollideWithPlayer(player);} } return true; @@ -119,12 +120,12 @@ public class ItemJarEmpty extends Item { EntityButterfly butterfly = (EntityButterfly)target; butterfly.setDead(); - --stack.stackSize; + stack.func_190920_e(stack.func_190916_E() - 1); ItemStack butterflyJar = new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.BUTTERFLY.ordinal()); - EntityItem butterflyJarEntity = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, butterflyJar); - if (!player.worldObj.isRemote) + EntityItem butterflyJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, butterflyJar); + if (!player.world.isRemote) { - player.worldObj.spawnEntityInWorld(butterflyJarEntity); + player.world.spawnEntityInWorld(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 3da50ed02..c4c641de5 100644 --- a/src/main/java/biomesoplenty/common/item/ItemJarFilled.java +++ b/src/main/java/biomesoplenty/common/item/ItemJarFilled.java @@ -57,7 +57,7 @@ public class ItemJarFilled extends Item // add all the contents types as separate items in the creative tab @Override @SideOnly(Side.CLIENT) - public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) + public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList subItems) { for (JarContents contents : JarContents.values()) { @@ -130,7 +130,7 @@ public class ItemJarFilled extends Item if (stack.hasDisplayName()) {pixie.setCustomNameTag(stack.getDisplayName());} return true; } else { - player.addChatComponentMessage(new TextComponentString("\u00a75Pixies cannot survive in this environment!")); + player.addChatComponentMessage(new TextComponentString("\u00a75Pixies cannot survive in this environment!"), false); return false; } } @@ -146,14 +146,15 @@ public class ItemJarFilled extends Item if (stack.hasDisplayName()) {butterfly.setCustomNameTag(stack.getDisplayName());} return true; } else { - player.addChatComponentMessage(new TextComponentString("\u00a75Butterflies cannot survive in this environment!")); + player.addChatComponentMessage(new TextComponentString("\u00a75Butterflies cannot survive in this environment!"), false); return false; } } @Override - public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) + public ActionResult onItemRightClick(World world, EntityPlayer player, EnumHand hand) { + ItemStack stack = player.getHeldItem(hand); if (world.isRemote) {return new ActionResult(EnumActionResult.FAIL, stack);} switch (this.getContentsType(stack)) { @@ -185,7 +186,7 @@ public class ItemJarFilled extends Item protected ItemStack emptyJar(ItemStack stack, EntityPlayer player, ItemStack emptyJarStack) { - if (!player.capabilities.isCreativeMode) { --stack.stackSize; } + if (!player.capabilities.isCreativeMode) { stack.func_190920_e(stack.func_190916_E() - 1); } player.addStat(StatList.getObjectUseStats(this)); if (!player.inventory.addItemStackToInventory(emptyJarStack)) { @@ -196,8 +197,9 @@ public class ItemJarFilled extends Item @Override - public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) + public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + ItemStack stack = player.getHeldItem(hand); if (world.isRemote) {return EnumActionResult.FAIL;} switch (this.getContentsType(stack)) { diff --git a/src/main/java/biomesoplenty/common/item/ItemMudball.java b/src/main/java/biomesoplenty/common/item/ItemMudball.java index e0771832b..a6a128cff 100644 --- a/src/main/java/biomesoplenty/common/item/ItemMudball.java +++ b/src/main/java/biomesoplenty/common/item/ItemMudball.java @@ -29,11 +29,12 @@ public class ItemMudball extends Item // throw a mudball on right click @Override - public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) + public ActionResult onItemRightClick(World world, EntityPlayer player, EnumHand hand) { + ItemStack stack = player.getHeldItem(hand); if (!player.capabilities.isCreativeMode) { - --stack.stackSize; + stack.func_190920_e(stack.func_190916_E() - 1); } world.playSound(player, player.getPosition(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); diff --git a/src/main/java/biomesoplenty/common/util/inventory/CreativeTabBOP.java b/src/main/java/biomesoplenty/common/util/inventory/CreativeTabBOP.java index e462e6ceb..c73cfc6b9 100644 --- a/src/main/java/biomesoplenty/common/util/inventory/CreativeTabBOP.java +++ b/src/main/java/biomesoplenty/common/util/inventory/CreativeTabBOP.java @@ -11,6 +11,7 @@ package biomesoplenty.common.util.inventory; import biomesoplenty.api.item.BOPItems; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; public class CreativeTabBOP extends CreativeTabs { @@ -22,8 +23,8 @@ public class CreativeTabBOP extends CreativeTabs } @Override - public Item getTabIconItem() + public ItemStack getTabIconItem() { - return BOPItems.earth; + return new ItemStack(BOPItems.earth); } } diff --git a/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java b/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java index 53383feb3..f6f85343e 100644 --- a/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java +++ b/src/main/java/biomesoplenty/common/world/ChunkProviderGenerateBOP.java @@ -89,7 +89,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator public ChunkProviderGenerateBOP(World worldIn, long seed, boolean mapFeaturesEnabled, String chunkProviderSettingsString) { System.out.println("ChunkProviderGenerateBOP json: "+chunkProviderSettingsString); - + this.worldObj = worldIn; this.mapFeaturesEnabled = mapFeaturesEnabled; this.rand = new Random(seed); @@ -605,9 +605,9 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator } @Override - public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position) + public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position, boolean p_180513_4_) { - return "Stronghold".equals(structureName) && this.strongholdGenerator != null ? this.strongholdGenerator.getClosestStrongholdPos(worldIn, position) : null; + return "Stronghold".equals(structureName) && this.strongholdGenerator != null ? this.strongholdGenerator.getClosestStrongholdPos(worldIn, position, p_180513_4_) : null; } @Override diff --git a/src/main/java/biomesoplenty/common/world/ChunkProviderHellBOP.java b/src/main/java/biomesoplenty/common/world/ChunkProviderHellBOP.java index 6323d1fc3..70d377600 100644 --- a/src/main/java/biomesoplenty/common/world/ChunkProviderHellBOP.java +++ b/src/main/java/biomesoplenty/common/world/ChunkProviderHellBOP.java @@ -471,7 +471,7 @@ public class ChunkProviderHellBOP implements IChunkGenerator } @Nullable - public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position) + public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position, boolean p_180513_4_) { return null; } diff --git a/src/main/java/biomesoplenty/core/BiomesOPlenty.java b/src/main/java/biomesoplenty/core/BiomesOPlenty.java index 5535956a9..c353aa1dc 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@[12.18.1.2039,)", guiFactory = BiomesOPlenty.GUI_FACTORY) +@Mod(modid = BiomesOPlenty.MOD_ID, version = BiomesOPlenty.MOD_VERSION , name = BiomesOPlenty.MOD_NAME, dependencies = "required-after:forge@[12.18.1.2039,)", 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 8134d073b..d2c8c0c2e 100644 --- a/src/main/java/biomesoplenty/core/ClientProxy.java +++ b/src/main/java/biomesoplenty/core/ClientProxy.java @@ -59,6 +59,7 @@ import net.minecraft.entity.Entity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; import net.minecraftforge.client.model.ModelDynBucket; @@ -157,7 +158,7 @@ public class ClientProxy extends CommonProxy // register sub types if there are any if (item.getHasSubtypes()) { - List subItems = new ArrayList(); + NonNullList subItems = NonNullList.func_191196_a(); item.getSubItems(item, CreativeTabBOP.instance, subItems); for (ItemStack subItem : subItems) { @@ -204,17 +205,17 @@ public class ClientProxy extends CommonProxy switch (type) { case PIXIETRAIL: - entityFx = new EntityPixieTrailFX(minecraft.theWorld, x, y, z, MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.03, 0.03), -0.02D, MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.03, 0.03)); + 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)); break; case MUD: int itemId = Item.getIdFromItem(BOPItems.mudball); - minecraft.theWorld.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.08D, 0.08D), MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.08D, 0.08D), MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.08D, 0.08D), new int[] {itemId}); + 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}); return; case PLAYER_TRAIL: if (info.length < 1) throw new RuntimeException("Missing argument for trail name!"); - entityFx = new EntityTrailFX(minecraft.theWorld, x, y, z, (String)info[0]); + entityFx = new EntityTrailFX(minecraft.world, x, y, z, (String)info[0]); break; default: break;