diff --git a/build.gradle b/build.gradle index 2a27a664a..ce166e58a 100644 --- a/build.gradle +++ b/build.gradle @@ -23,10 +23,10 @@ if(hasProperty('buildnumber')){ } minecraft { - version = "1.11-13.19.0.2154" + version = "1.11-13.19.0.2160" runDir = "idea" - mappings = "snapshot_20161111" + mappings = "snapshot_20161126" makeObfSourceJar = false //useDepAts = true @@ -45,7 +45,7 @@ repositories { dependencies { compile "net.darkhax.tesla:Tesla:1.11-1.3.0.51" - deobfCompile "mezz.jei:jei_1.11:4.0.2.194" + deobfCompile "mezz.jei:jei_1.11:4.0.4.198" } processResources { diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/OilGenRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/OilGenRecipe.java index 137e99537..e9691e869 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/OilGenRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/OilGenRecipe.java @@ -10,8 +10,6 @@ package de.ellpeck.actuallyadditions.api.recipe; -import net.minecraftforge.fluids.FluidStack; - public class OilGenRecipe{ public final String fluidName; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java index be69b5d1a..54d5b292b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java @@ -21,8 +21,8 @@ import de.ellpeck.actuallyadditions.mod.crafting.ItemCrafting; import de.ellpeck.actuallyadditions.mod.entity.InitEntities; import de.ellpeck.actuallyadditions.mod.event.CommonEvents; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; -import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager; import de.ellpeck.actuallyadditions.mod.gen.OreGen; +import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.ItemCoffee; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java index 550d72d52..2fe108d12 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java @@ -18,9 +18,10 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import net.minecraft.block.*; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirectional; +import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; @@ -113,7 +114,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud @Override @SideOnly(Side.CLIENT) public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){ - TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); + TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if(tile instanceof TileEntityAtomicReconstructor){ ItemStack slot = ((TileEntityAtomicReconstructor)tile).getStackInSlot(0); String strg; @@ -141,7 +142,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = EnumFacing.func_190914_a(pos, player).ordinal(); + int rotation = EnumFacing.getDirectionFromEntityLiving(pos, player).ordinal(); world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); @@ -201,8 +202,8 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud if(this.lastSysTime+3000 < sysTime){ this.lastSysTime = sysTime; - this.toPick1 = player.worldObj.rand.nextInt(NAME_FLAVOR_AMOUNTS_1)+1; - this.toPick2 = player.worldObj.rand.nextInt(NAME_FLAVOR_AMOUNTS_2)+1; + this.toPick1 = player.world.rand.nextInt(NAME_FLAVOR_AMOUNTS_1)+1; + this.toPick2 = player.world.rand.nextInt(NAME_FLAVOR_AMOUNTS_2)+1; } String base = "tile."+ModUtil.MOD_ID+"."+((BlockAtomicReconstructor)this.block).getBaseName()+".info."; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java index 77d94e126..c19f83d53 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBreaker.java @@ -17,10 +17,8 @@ import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBreaker; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPlacer; import net.minecraft.block.BlockDirectional; -import net.minecraft.block.BlockPistonBase; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -76,7 +74,7 @@ public class BlockBreaker extends BlockContainerBase{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = EnumFacing.func_190914_a(pos, player).ordinal(); + int rotation = EnumFacing.getDirectionFromEntityLiving(pos, player).ordinal(); world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java index 21a67d190..ade374d80 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java @@ -15,11 +15,9 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator; -import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockHorizontal; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -29,7 +27,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.*; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java index 9f2628ae3..ae4e28541 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoffeeMachine.java @@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine; import net.minecraft.block.BlockHorizontal; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -95,7 +94,7 @@ public class BlockCoffeeMachine extends BlockContainerBase{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; + int rotation = MathHelper.floor((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; if(rotation == 0){ world.setBlockState(pos, this.getStateFromMeta(0), 2); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java index 71a62f69b..f537d057d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java @@ -15,14 +15,12 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheColoredLampColors; -import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; @@ -40,7 +38,6 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; -import java.util.List; import java.util.Random; public class BlockColoredLamp extends BlockBase{ @@ -103,11 +100,6 @@ public class BlockColoredLamp extends BlockBase{ return false; } - @Override - public ItemStack createStackedBlock(IBlockState state){ - return new ItemStack(InitBlocks.blockColoredLamp, 1, this.getMetaFromState(state)); - } - @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, NonNullList list){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java index 4808ce4d6..88e61fe0a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java @@ -160,7 +160,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay{ @Override @SideOnly(Side.CLIENT) public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){ - TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); + TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if(tile instanceof TileEntityCompost){ ItemStack slot = ((TileEntityCompost)tile).getStackInSlot(0); String strg; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java index 34f936a56..c214aee84 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java @@ -16,25 +16,18 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; -import net.minecraft.block.BlockHorizontal; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.Mirror; import net.minecraft.util.NonNullList; -import net.minecraft.util.Rotation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; - public class BlockCrystal extends BlockBase{ public static final TheCrystals[] ALL_CRYSTALS = TheCrystals.values(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java index 7b49083ad..d0686c357 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDirectionalBreaker.java @@ -16,10 +16,8 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker; import net.minecraft.block.BlockDirectional; -import net.minecraft.block.BlockPistonBase; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -72,7 +70,7 @@ public class BlockDirectionalBreaker extends BlockContainerBase{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = EnumFacing.func_190914_a(pos, player).ordinal(); + int rotation = EnumFacing.getDirectionFromEntityLiving(pos, player).ordinal(); world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDisplayStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDisplayStand.java index 4a2149474..a82d4a9fc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDisplayStand.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDisplayStand.java @@ -50,7 +50,7 @@ public class BlockDisplayStand extends BlockContainerBase{ } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand,EnumFacing par6, float par7, float par8, float par9){ + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){ ItemStack heldItem = player.getHeldItem(hand); if(!world.isRemote){ TileEntityDisplayStand stand = (TileEntityDisplayStand)world.getTileEntity(pos); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDistributorItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDistributorItem.java index 37bd609a5..4d80ee16c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDistributorItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDistributorItem.java @@ -54,7 +54,7 @@ public class BlockDistributorItem extends BlockContainerBase implements IHudDisp @Override public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){ - TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); + TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if(tile instanceof TileEntityDistributorItem){ TileEntityDistributorItem distributor = (TileEntityDistributorItem)tile; ItemStack slot = distributor.getStackInSlot(0); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java index 2efc55d56..168ecb20c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDropper.java @@ -15,11 +15,8 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper; import net.minecraft.block.BlockDirectional; -import net.minecraft.block.BlockHorizontal; -import net.minecraft.block.BlockPistonBase; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -72,7 +69,7 @@ public class BlockDropper extends BlockContainerBase{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = EnumFacing.func_190914_a(pos, player).ordinal(); + int rotation = EnumFacing.getDirectionFromEntityLiving(pos, player).ordinal(); world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFarmer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFarmer.java index 27aa87bd9..50a186547 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFarmer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFarmer.java @@ -17,8 +17,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityFarmer; import net.minecraft.block.BlockHorizontal; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -31,7 +29,6 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; public class BlockFarmer extends BlockContainerBase{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java index 590799da7..a40956ff0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockFluidCollector.java @@ -17,10 +17,8 @@ import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidCollector; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidPlacer; import net.minecraft.block.BlockDirectional; -import net.minecraft.block.BlockPistonBase; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -78,7 +76,7 @@ public class BlockFluidCollector extends BlockContainerBase{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = EnumFacing.func_190914_a(pos, player).ordinal(); + int rotation = EnumFacing.getDirectionFromEntityLiving(pos, player).ordinal(); world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java index 771d7fc92..5cc1601e2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLampPowerer.java @@ -15,10 +15,8 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockDirectional; -import net.minecraft.block.BlockPistonBase; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -55,7 +53,7 @@ public class BlockLampPowerer extends BlockBase{ @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ - int rotation = EnumFacing.func_190914_a(pos, player).ordinal(); + int rotation = EnumFacing.getDirectionFromEntityLiving(pos, player).ordinal(); world.setBlockState(pos, this.getStateFromMeta(rotation), 2); super.onBlockPlacedBy(world, pos, state, player, stack); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java index 26843e5f3..6d0039d5b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java @@ -19,10 +19,8 @@ import de.ellpeck.actuallyadditions.mod.tile.*; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.BlockDirectional; -import net.minecraft.block.BlockHorizontal; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; @@ -122,9 +120,8 @@ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay{ return false; } - @Override - public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, int meta, EntityLivingBase base){ + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, int meta, EntityLivingBase base){ return this.getStateFromMeta(side.ordinal()); } @@ -214,8 +211,8 @@ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay{ @Override @SideOnly(Side.CLIENT) public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){ - if(posHit != null && posHit.getBlockPos() != null && minecraft.theWorld != null){ - TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); + if(posHit != null && posHit.getBlockPos() != null && minecraft.world != null){ + TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if(tile instanceof TileEntityLaserRelayItem){ TileEntityLaserRelayItem relay = (TileEntityLaserRelayItem)tile; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java index 982982e92..88baaa046 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java @@ -51,7 +51,7 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IH @Override @SideOnly(Side.CLIENT) public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){ - TileEntityLavaFactoryController factory = (TileEntityLavaFactoryController)minecraft.theWorld.getTileEntity(posHit.getBlockPos()); + TileEntityLavaFactoryController factory = (TileEntityLavaFactoryController)minecraft.world.getTileEntity(posHit.getBlockPos()); if(factory != null){ int state = factory.isMultiblock(); if(state == TileEntityLavaFactoryController.NOT_MULTI){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java index 6d1b6c233..da60671e5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java @@ -79,7 +79,7 @@ public class BlockMiner extends BlockContainerBase implements IHudDisplay{ @Override @SideOnly(Side.CLIENT) public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){ - TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); + TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if(tile instanceof TileEntityMiner){ String info = ((TileEntityMiner)tile).layerAt <= 0 ? "Done Mining!" : "Mining at Y = "+((TileEntityMiner)tile).layerAt+"."; minecraft.fontRendererObj.drawStringWithShadow(info, resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-20, StringUtil.DECIMAL_COLOR_WHITE); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java index 78377db61..b485b9e9f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMisc.java @@ -14,12 +14,10 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheWildPlants; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; @@ -30,8 +28,6 @@ import net.minecraft.util.NonNullList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; - public class BlockMisc extends BlockBase{ public static final TheMiscBlocks[] ALL_MISC_BLOCKS = TheMiscBlocks.values(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java index 328a0e6e6..369265f03 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java @@ -28,7 +28,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.*; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -77,7 +76,8 @@ public class BlockOilGenerator extends BlockContainerBase{ } @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){ItemStack stack = player.getHeldItem(hand); + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing par6, float par7, float par8, float par9){ + ItemStack stack = player.getHeldItem(hand); if(!world.isRemote){ TileEntityOilGenerator generator = (TileEntityOilGenerator)world.getTileEntity(pos); if(generator != null){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java index b20bb67cc..bf711aee5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java @@ -127,14 +127,14 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay{ @Override @SideOnly(Side.CLIENT) public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){ - TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); + TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if(tile != null){ if(tile instanceof IPhantomTile){ IPhantomTile phantom = (IPhantomTile)tile; minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.GOLD+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".blockPhantomRange.desc")+": "+phantom.getRange(), resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-40, StringUtil.DECIMAL_COLOR_WHITE); if(phantom.hasBoundPosition()){ int distance = (int)new Vec3d(posHit.getBlockPos()).distanceTo(new Vec3d(phantom.getBoundPosition())); - IBlockState state = minecraft.theWorld.getBlockState(phantom.getBoundPosition()); + IBlockState state = minecraft.world.getBlockState(phantom.getBoundPosition()); Block block = state.getBlock(); Item item = Item.getItemFromBlock(block); String name = item == null ? "Something Unrecognizable" : item.getItemStackDisplayName(new ItemStack(block, 1, block.getMetaFromState(state))); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java index 3fe01d866..3074afa26 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java @@ -69,7 +69,7 @@ public class BlockPlayerInterface extends BlockContainerBase implements IHudDisp @Override @SideOnly(Side.CLIENT) public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){ - TileEntity tile = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); + TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if(tile != null){ if(tile instanceof TileEntityPlayerInterface){ TileEntityPlayerInterface face = (TileEntityPlayerInterface)tile; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java index 9ba7b7428..fca0fd80e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSlabs.java @@ -14,17 +14,18 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.block.Block; -import net.minecraft.block.BlockHorizontal; import net.minecraft.block.BlockSlab; import net.minecraft.block.SoundType; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -import net.minecraft.util.*; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; @@ -78,7 +79,7 @@ public class BlockSlabs extends BlockBase{ @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){ if(facing.ordinal() == 1){ return this.getStateFromMeta(meta); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java index 8afa2c3f1..febd1d212 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockSmileyCloud.java @@ -19,7 +19,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud; import net.minecraft.block.BlockHorizontal; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -29,7 +28,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.*; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTinyTorch.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTinyTorch.java index 61f69cc26..72bae18a0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTinyTorch.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTinyTorch.java @@ -106,7 +106,7 @@ public class BlockTinyTorch extends BlockBase{ } @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){ if(this.canPlaceAt(worldIn, pos, facing)){ return this.getDefaultState().withProperty(BlockTorch.FACING, facing); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java index cc1c11c92..f5c5415c2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockTreasureChest.java @@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.block.BlockHorizontal; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -90,10 +89,10 @@ public class BlockTreasureChest extends BlockBase{ } private void dropItems(World world, BlockPos pos){ - for(int i = 0; i < MathHelper.getRandomIntegerInRange(world.rand, 3, 6); i++){ + for(int i = 0; i < MathHelper.getInt(world.rand, 3, 6); i++){ TreasureChestLoot theReturn = WeightedRandom.getRandomItem(world.rand, ActuallyAdditionsAPI.TREASURE_CHEST_LOOT); ItemStack itemStack = theReturn.returnItem.copy(); - itemStack = StackUtil.setStackSize(itemStack, MathHelper.getRandomIntegerInRange(world.rand, theReturn.minAmount, theReturn.maxAmount)); + itemStack = StackUtil.setStackSize(itemStack, MathHelper.getInt(world.rand, theReturn.minAmount, theReturn.maxAmount)); float dX = world.rand.nextFloat()*0.8F+0.1F; float dY = world.rand.nextFloat()*0.8F+0.1F; @@ -103,7 +102,7 @@ public class BlockTreasureChest extends BlockBase{ entityItem.motionX = world.rand.nextGaussian()*factor; entityItem.motionY = world.rand.nextGaussian()*factor+0.2F; entityItem.motionZ = world.rand.nextGaussian()*factor; - world.spawnEntityInWorld(entityItem); + world.spawnEntity(entityItem); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWallAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWallAA.java index 0ca706722..6226c601f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWallAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWallAA.java @@ -26,12 +26,9 @@ import net.minecraft.util.NonNullList; 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; -import java.util.List; - public class BlockWallAA extends BlockBase{ protected static final AxisAlignedBB[] AABB_BY_INDEX = new AxisAlignedBB[]{new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 0.75D, 1.0D, 1.0D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.3125D, 0.0D, 0.0D, 0.6875D, 0.875D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D), new AxisAlignedBB(0.25D, 0.0D, 0.25D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.3125D, 1.0D, 0.875D, 0.6875D), new AxisAlignedBB(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D), new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D)}; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java index c0b217f90..ad609485c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java @@ -16,13 +16,11 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBushBase; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheWildPlants; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java index 64e9e9752..21efecd06 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockXPSolidifier.java @@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier; import net.minecraft.block.BlockHorizontal; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -31,7 +30,6 @@ import net.minecraft.util.EnumHand; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; public class BlockXPSolidifier extends BlockContainerBase{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java index 1694f743e..1915efbad 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBase.java @@ -14,9 +14,6 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; -import net.minecraft.block.state.BlockStateContainer; -import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java index 841109173..e7bd50147 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockBushBase.java @@ -14,9 +14,6 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import net.minecraft.block.BlockBush; import net.minecraft.block.SoundType; -import net.minecraft.block.properties.PropertyInteger; -import net.minecraft.block.state.BlockStateContainer; -import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java index 2dcd523c1..5761dbe9d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java @@ -19,8 +19,6 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockRedstoneTorch; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; -import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; @@ -34,7 +32,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagInt; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumBlockRenderType; -import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; @@ -110,7 +107,7 @@ public abstract class BlockContainerBase extends BlockContainer implements ItemB entityItem.motionX = world.rand.nextGaussian()*factor; entityItem.motionY = world.rand.nextGaussian()*factor+0.2F; entityItem.motionZ = world.rand.nextGaussian()*factor; - world.spawnEntityInWorld(entityItem); + world.spawnEntity(entityItem); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java index b4473429d..ad00c5ba1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockPlant.java @@ -105,7 +105,7 @@ public class BlockPlant extends BlockCrops implements ItemBlockBase.ICustomRarit if(StackUtil.isValid(drop)){ EntityItem entity = new EntityItem(world, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, drop); - world.spawnEntityInWorld(entity); + world.spawnEntity(entity); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheColoredLampColors.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheColoredLampColors.java index f13ea16ec..6733a8e01 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheColoredLampColors.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheColoredLampColors.java @@ -39,11 +39,6 @@ public enum TheColoredLampColors implements IStringSerializable{ this.regName = regName; } - @Override - public String getName(){ - return this.regName; - } - public static TheColoredLampColors getColorFromDyeName(String color){ if(color.substring(0, 3).equals("dye")){ String actualName = color.substring(3); @@ -58,4 +53,9 @@ public enum TheColoredLampColors implements IStringSerializable{ } return null; } + + @Override + public String getName(){ + return this.regName; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderCompost.java index 59aa9a365..be024753c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderCompost.java @@ -50,7 +50,7 @@ public class RenderCompost extends TileEntitySpecialRenderer{ GlStateManager.pushMatrix(); GlStateManager.translate((float)x+0.5F, (float)y+(i/3F)+0.01F, (float)z+0.5F); //Hehe - if("ShadowfactsDev".equals(Minecraft.getMinecraft().thePlayer.getName())){ + if("ShadowfactsDev".equals(Minecraft.getMinecraft().player.getName())){ GlStateManager.translate(0F, 1F, 0F); } GlStateManager.scale(1.5F, i, 1.5F); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java index 68a3e9e29..c859dee61 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/entry/BookletEntry.java @@ -56,7 +56,7 @@ public class BookletEntry implements IBookletEntry{ if(!items.isEmpty()){ for(ItemStack stack : items){ if(StackUtil.isValid(stack)){ - List tooltip = stack.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips); + List tooltip = stack.getTooltip(mc.player, mc.gameSettings.advancedItemTooltips); for(String strg : tooltip){ if(strg != null && strg.toLowerCase(Locale.ROOT).contains(searchBarText)){ return true; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiBooklet.java index 991aecae1..fbe9c73d6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiBooklet.java @@ -93,7 +93,7 @@ public abstract class GuiBooklet extends GuiBookletBase{ } if(this.hasBookmarkButtons()){ - PlayerSave data = PlayerData.getDataFromPlayer(this.mc.thePlayer); + PlayerSave data = PlayerData.getDataFromPlayer(this.mc.player); int xStart = this.guiLeft+this.xSize/2-16*this.bookmarkButtons.length/2; for(int i = 0; i < this.bookmarkButtons.length; i++){ @@ -114,7 +114,7 @@ public abstract class GuiBooklet extends GuiBookletBase{ //Don't cache the parent GUI, otherwise it opens again when you close the cached book! this.previousScreen = null; - PlayerSave data = PlayerData.getDataFromPlayer(this.mc.thePlayer); + PlayerSave data = PlayerData.getDataFromPlayer(this.mc.player); boolean change = false; for(int i = 0; i < this.bookmarkButtons.length; i++){ @@ -126,7 +126,7 @@ public abstract class GuiBooklet extends GuiBookletBase{ data.lastOpenBooklet = this; if(change){ - PacketHandlerHelper.sendPlayerDataPacket(this.mc.thePlayer, true, false); + PacketHandlerHelper.sendPlayerDataPacket(this.mc.player, true, false); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiMainPage.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiMainPage.java index 9c023c888..9643b5522 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiMainPage.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/gui/GuiMainPage.java @@ -77,12 +77,12 @@ public class GuiMainPage extends GuiBooklet{ super.initGui(); int flavor = 1; - if(this.mc.theWorld.rand.nextFloat() <= 0.1){ - flavor = MathHelper.getRandomIntegerInRange(this.mc.theWorld.rand, 2, 7); + if(this.mc.world.rand.nextFloat() <= 0.1){ + flavor = MathHelper.getInt(this.mc.world.rand, 2, 7); } this.bookletName = "info."+ModUtil.MOD_ID+".booklet.manualName.1."+flavor; - String usedQuote = QUOTES[this.mc.theWorld.rand.nextInt(QUOTES.length)]; + String usedQuote = QUOTES[this.mc.world.rand.nextInt(QUOTES.length)]; String[] quoteSplit = usedQuote.split("@"); if(quoteSplit.length == 2){ this.quote = this.fontRendererObj.listFormattedStringToWidth(quoteSplit[0], 120); @@ -101,7 +101,7 @@ public class GuiMainPage extends GuiBooklet{ this.achievementButton = new TexturedButton(RES_LOC_GADGETS, -389, this.guiLeft+36, this.guiTop+this.ySize-30, 204, 14, 16, 16, achievementText); this.buttonList.add(this.achievementButton); - PlayerSave data = PlayerData.getDataFromPlayer(this.mc.thePlayer); + PlayerSave data = PlayerData.getDataFromPlayer(this.mc.player); if(!data.didBookTutorial){ this.showTutorial = true; @@ -134,7 +134,7 @@ public class GuiMainPage extends GuiBooklet{ } } else if(button == this.achievementButton){ - GuiScreen achievements = new GuiAAAchievements(this, this.mc.thePlayer.getStatFileWriter()); + GuiScreen achievements = new GuiAAAchievements(this, this.mc.player.getStatFileWriter()); this.mc.displayGuiScreen(achievements); } else if(button == this.configButton){ @@ -154,9 +154,9 @@ public class GuiMainPage extends GuiBooklet{ this.configButton.visible = true; this.achievementButton.visible = true; - PlayerSave data = PlayerData.getDataFromPlayer(this.mc.thePlayer); + PlayerSave data = PlayerData.getDataFromPlayer(this.mc.player); data.didBookTutorial = true; - PacketHandlerHelper.sendPlayerDataPacket(this.mc.thePlayer, true, false); + PacketHandlerHelper.sendPlayerDataPacket(this.mc.player, true, false); } } else{ @@ -174,7 +174,7 @@ public class GuiMainPage extends GuiBooklet{ this.fontRendererObj.drawString(strg, this.guiLeft+72-this.fontRendererObj.getStringWidth(strg)/2-3, this.guiTop+19+this.fontRendererObj.FONT_HEIGHT, 0); String versionStrg; - String playerName = Minecraft.getMinecraft().thePlayer.getName(); + String playerName = Minecraft.getMinecraft().player.getName(); if(Util.isDevVersion()){ versionStrg = "Dev's Edition"; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/misc/GuiAAAchievements.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/misc/GuiAAAchievements.java index 03ed10850..d6d7b10ff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/misc/GuiAAAchievements.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/misc/GuiAAAchievements.java @@ -55,6 +55,8 @@ public class GuiAAAchievements extends GuiAchievements{ if(key == Keyboard.KEY_ESCAPE || key == this.mc.gameSettings.keyBindInventory.getKeyCode()){ this.mc.displayGuiScreen(this.parentScreen); } - else super.keyTyped(typedChar, key); + else{ + super.keyTyped(typedChar, key); + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/ItemDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/ItemDisplay.java index d2b1d1e24..bda2eea8a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/ItemDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/ItemDisplay.java @@ -58,7 +58,7 @@ public class ItemDisplay{ boolean flagBefore = mc.fontRendererObj.getUnicodeFlag(); mc.fontRendererObj.setUnicodeFlag(false); - List list = this.stack.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips); + List list = this.stack.getTooltip(mc.player, mc.gameSettings.advancedItemTooltips); for(int k = 0; k < list.size(); ++k){ if(k == 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java index addbdc7e1..0985c6af6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java @@ -30,7 +30,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; -import net.minecraft.potion.PotionHelper; import net.minecraft.potion.PotionUtils; import net.minecraftforge.common.IPlantable; import net.minecraftforge.fml.common.registry.GameRegistry; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java index b0bf568b4..dbcc741cc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java @@ -24,8 +24,6 @@ import net.minecraftforge.fluids.UniversalBucket; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; - public class CreativeTab extends CreativeTabs{ public static final CreativeTab INSTANCE = new CreativeTab(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java b/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java index ba91e625c..a01b9e36d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java @@ -15,7 +15,6 @@ import de.ellpeck.actuallyadditions.mod.data.PlayerData.PlayerSave; import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import io.netty.util.internal.ConcurrentSet; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -28,7 +27,6 @@ import net.minecraftforge.common.WorldSpecificSaveHandler; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; -import java.util.ArrayList; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/entity/EntityWorm.java b/src/main/java/de/ellpeck/actuallyadditions/mod/entity/EntityWorm.java index b6dc668dd..c8deb09ec 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/entity/EntityWorm.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/entity/EntityWorm.java @@ -65,43 +65,43 @@ public class EntityWorm extends Entity{ @Override public void onEntityUpdate(){ - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ this.timer++; if(this.timer%50 == 0){ for(int x = -1; x <= 1; x++){ for(int z = -1; z <= 1; z++){ BlockPos pos = new BlockPos(this.posX+x, this.posY, this.posZ+z); - IBlockState state = this.worldObj.getBlockState(pos); + IBlockState state = this.world.getBlockState(pos); Block block = state.getBlock(); boolean isMiddlePose = x == 0 && z == 0; - if(canWormify(this.worldObj, pos, state)){ + if(canWormify(this.world, pos, state)){ boolean isFarmland = block instanceof BlockFarmland; if(!isFarmland || state.getValue(BlockFarmland.MOISTURE) < 7){ - if(isMiddlePose || this.worldObj.rand.nextFloat() >= 0.45F){ + if(isMiddlePose || this.world.rand.nextFloat() >= 0.45F){ IBlockState stateToModify = isFarmland ? state : Blocks.FARMLAND.getDefaultState(); - this.worldObj.setBlockState(pos, stateToModify.withProperty(BlockFarmland.MOISTURE, 7), 2); + this.world.setBlockState(pos, stateToModify.withProperty(BlockFarmland.MOISTURE, 7), 2); if(!isFarmland){ - this.worldObj.setBlockToAir(pos.up()); + this.world.setBlockToAir(pos.up()); } } } - if(isFarmland && this.worldObj.rand.nextFloat() >= 0.95F){ + if(isFarmland && this.world.rand.nextFloat() >= 0.95F){ BlockPos plant = pos.up(); - if(!this.worldObj.isAirBlock(plant)){ - IBlockState plantState = this.worldObj.getBlockState(plant); + if(!this.world.isAirBlock(plant)){ + IBlockState plantState = this.world.getBlockState(plant); Block plantBlock = plantState.getBlock(); if((plantBlock instanceof IGrowable || plantBlock instanceof IPlantable) && !(plantBlock instanceof BlockGrass)){ - plantBlock.updateTick(this.worldObj, plant, plantState, this.worldObj.rand); + plantBlock.updateTick(this.world, plant, plantState, this.world.rand); - IBlockState newState = this.worldObj.getBlockState(plant); + IBlockState newState = this.world.getBlockState(plant); if(newState.getBlock().getMetaFromState(newState) != plantBlock.getMetaFromState(plantState)){ - this.worldObj.playEvent(2005, plant, 0); + this.world.playEvent(2005, plant, 0); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java index 813bcdca1..b615700b2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java @@ -136,7 +136,7 @@ public class ClientEvents{ public void onGameOverlay(RenderGameOverlayEvent.Post event){ if(event.getType() == RenderGameOverlayEvent.ElementType.ALL && Minecraft.getMinecraft().currentScreen == null){ Minecraft minecraft = Minecraft.getMinecraft(); - EntityPlayer player = minecraft.thePlayer; + EntityPlayer player = minecraft.player; RayTraceResult posHit = minecraft.objectMouseOver; FontRenderer font = minecraft.fontRendererObj; ItemStack stack = player.getHeldItemMainhand(); @@ -148,8 +148,8 @@ public class ClientEvents{ } if(posHit != null && posHit.getBlockPos() != null){ - Block blockHit = minecraft.theWorld.getBlockState(posHit.getBlockPos()).getBlock(); - TileEntity tileHit = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); + Block blockHit = minecraft.world.getBlockState(posHit.getBlockPos()).getBlock(); + TileEntity tileHit = minecraft.world.getTileEntity(posHit.getBlockPos()); if(blockHit instanceof IHudDisplay){ ((IHudDisplay)blockHit).displayHud(minecraft, player, stack, posHit, event.getResolution()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java index bc51ad523..fa217810d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/CommonEvents.java @@ -56,11 +56,11 @@ public class CommonEvents{ @SubscribeEvent public void onEntityDropEvent(LivingDropsEvent event){ - if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote && event.getSource().getEntity() instanceof EntityPlayer){ + if(event.getEntityLiving().world != null && !event.getEntityLiving().world.isRemote && event.getSource().getEntity() instanceof EntityPlayer){ //Drop Cobwebs from Spiders if(ConfigBoolValues.DO_SPIDER_DROPS.isEnabled() && event.getEntityLiving() instanceof EntitySpider){ - if(event.getEntityLiving().worldObj.rand.nextInt(20) <= event.getLootingLevel()*2){ - event.getEntityLiving().entityDropItem(new ItemStack(Blocks.WEB, event.getEntityLiving().worldObj.rand.nextInt(2+event.getLootingLevel())+1), 0); + if(event.getEntityLiving().world.rand.nextInt(20) <= event.getLootingLevel()*2){ + event.getEntityLiving().entityDropItem(new ItemStack(Blocks.WEB, event.getEntityLiving().world.rand.nextInt(2+event.getLootingLevel())+1), 0); } } } @@ -68,7 +68,7 @@ public class CommonEvents{ @SubscribeEvent public void onLogInEvent(PlayerEvent.PlayerLoggedInEvent event){ - if(!event.player.worldObj.isRemote && event.player instanceof EntityPlayerMP){ + if(!event.player.world.isRemote && event.player instanceof EntityPlayerMP){ EntityPlayerMP player = (EntityPlayerMP)event.player; PacketHandlerHelper.sendPlayerDataPacket(player, true, true); ModUtil.LOGGER.info("Sending Player Data to player "+player.getName()+" with UUID "+player.getUniqueID()+"."); @@ -80,7 +80,7 @@ public class CommonEvents{ checkAchievements(event.crafting, event.player, InitAchievements.Type.CRAFTING); if(ConfigBoolValues.GIVE_BOOKLET_ON_FIRST_CRAFT.isEnabled()){ - if(!event.player.worldObj.isRemote && StackUtil.isValid(event.crafting) && event.crafting.getItem() != InitItems.itemBooklet){ + if(!event.player.world.isRemote && StackUtil.isValid(event.crafting) && event.crafting.getItem() != InitItems.itemBooklet){ String name = event.crafting.getItem().getRegistryName().toString(); if(name != null && name.toLowerCase(Locale.ROOT).contains(ModUtil.MOD_ID)){ @@ -88,9 +88,9 @@ public class CommonEvents{ if(save != null && !save.bookGottenAlready){ save.bookGottenAlready = true; - EntityItem entityItem = new EntityItem(event.player.worldObj, event.player.posX, event.player.posY, event.player.posZ, new ItemStack(InitItems.itemBooklet)); + EntityItem entityItem = new EntityItem(event.player.world, event.player.posX, event.player.posY, event.player.posZ, new ItemStack(InitItems.itemBooklet)); entityItem.setPickupDelay(0); - event.player.worldObj.spawnEntityInWorld(entityItem); + event.player.world.spawnEntity(entityItem); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/OreGen.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/OreGen.java index bcb3519d7..d937aad8e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/OreGen.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/OreGen.java @@ -67,7 +67,7 @@ public class OreGen implements IWorldGenerator{ private void generateDefault(World world, Random random, int x, int z){ if(ConfigBoolValues.GENERATE_QUARTZ.isEnabled()){ - this.addOreSpawn(InitBlocks.blockMisc, TheMiscBlocks.ORE_QUARTZ.ordinal(), Blocks.STONE, world, random, x*16, z*16, MathHelper.getRandomIntegerInRange(random, 5, 8), 10, QUARTZ_MIN, QUARTZ_MAX); + this.addOreSpawn(InitBlocks.blockMisc, TheMiscBlocks.ORE_QUARTZ.ordinal(), Blocks.STONE, world, random, x*16, z*16, MathHelper.getInt(random, 5, 8), 10, QUARTZ_MIN, QUARTZ_MAX); } if(ConfigBoolValues.GEN_LUSH_CAVES.isEnabled()){ @@ -81,7 +81,7 @@ public class OreGen implements IWorldGenerator{ Random chunkRand = new Random(randConst ^ world.getSeed() ^ (chunkX*29+chunkZ*31)); if(chunkRand.nextInt(ConfigIntValues.LUSH_CAVE_CHANCE.getValue()) <= 0){ BlockPos randPos = world.getTopSolidOrLiquidBlock(new BlockPos(chunkX*16+chunkRand.nextInt(16)+8, 0, chunkZ*16+chunkRand.nextInt(16)+8)); - BlockPos pos = randPos.down(MathHelper.getRandomIntegerInRange(chunkRand, 15, randPos.getY()-15)); + BlockPos pos = randPos.down(MathHelper.getInt(chunkRand, 15, randPos.getY()-15)); this.caveGen.generate(world, chunkRand, pos, box); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/WorldGenLushCaves.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/WorldGenLushCaves.java index 3e7aa92fe..e922404f1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/WorldGenLushCaves.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/WorldGenLushCaves.java @@ -18,7 +18,6 @@ import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; @@ -97,7 +96,7 @@ public class WorldGenLushCaves{ trees.generate(world, rand, pos.up()); if(ConfigBoolValues.DUNGEON_LOOT.isEnabled() && !crateGenDone && genCrate){ - BlockPos cratePos = pos.add(MathHelper.getRandomIntegerInRange(rand, -2, 2), MathHelper.getRandomIntegerInRange(rand, 3, 8), MathHelper.getRandomIntegerInRange(rand, -2, 2)); + BlockPos cratePos = pos.add(MathHelper.getInt(rand, -2, 2), MathHelper.getInt(rand, 3, 8), MathHelper.getInt(rand, -2, 2)); IBlockState state = world.getBlockState(cratePos); if(state != null && state.getBlock().isLeaves(state, world, cratePos)){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/BasicTradeList.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/BasicTradeList.java index 333550624..0533e9c12 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/BasicTradeList.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/BasicTradeList.java @@ -44,7 +44,7 @@ public class BasicTradeList implements ITradeList{ } @Override - public void func_190888_a(IMerchant merchant, MerchantRecipeList recipeList, Random random){ + public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random){ ItemStack in = this.input.copy(); in = StackUtil.setStackSize(in, this.inputAmount.getPrice(random)); ItemStack out = this.output.copy(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/JamVillagerTradeList.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/JamVillagerTradeList.java index 6cae13611..facd1cb9c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/JamVillagerTradeList.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/JamVillagerTradeList.java @@ -25,7 +25,7 @@ import java.util.Random; public class JamVillagerTradeList implements ITradeList{ @Override - public void func_190888_a(IMerchant merchant, MerchantRecipeList recipeList, Random random){ + public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random){ for(int i = 0; i < random.nextInt(3)+3; i++){ ItemStack jam = new ItemStack(InitItems.itemJams, 1, random.nextInt(TheJams.values().length)); ItemStack emerald = new ItemStack(Items.EMERALD); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/component/VillageComponentCustomCropField.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/component/VillageComponentCustomCropField.java index fbac4cf9d..c8a5c6ee4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/component/VillageComponentCustomCropField.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/component/VillageComponentCustomCropField.java @@ -99,7 +99,7 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous } private IBlockState getRandomCropType(Random rand){ - int randomMeta = MathHelper.getRandomIntegerInRange(rand, 1, 7); + int randomMeta = MathHelper.getInt(rand, 1, 7); switch(rand.nextInt(4)){ case 0: return InitBlocks.blockFlax.getStateFromMeta(randomMeta); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/component/VillageComponentJamHouse.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/component/VillageComponentJamHouse.java index 786d7fb7e..31d60ca07 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/component/VillageComponentJamHouse.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/village/component/VillageComponentJamHouse.java @@ -53,6 +53,24 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{ return canVillageGoDeeper(boundingBox) && StructureComponent.findIntersecting(pieces, boundingBox) == null ? new VillageComponentJamHouse(boundingBox, p4) : null; } + public static boolean generateCrate(World world, StructureBoundingBox box, int x, int y, int z, ResourceLocation loot){ + BlockPos pos = new BlockPos(x, y, z); + + if(box.isVecInside(pos)){ + world.setBlockState(pos, InitBlocks.blockGiantChest.getDefaultState(), 2); + + TileEntity tile = world.getTileEntity(pos); + if(tile instanceof TileEntityGiantChest){ + ((TileEntityGiantChest)tile).lootTable = loot; + } + + return true; + } + else{ + return false; + } + } + @Override public boolean addComponentParts(World world, Random rand, StructureBoundingBox sbb){ if(this.averageGroundLevel < 0){ @@ -210,22 +228,4 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{ protected VillagerProfession chooseForgeProfession(int count, VillagerProfession prof){ return InitVillager.jamProfession; } - - public static boolean generateCrate(World world, StructureBoundingBox box, int x, int y, int z, ResourceLocation loot){ - BlockPos pos = new BlockPos(x, y, z); - - if(box.isVecInside(pos)){ - world.setBlockState(pos, InitBlocks.blockGiantChest.getDefaultState(), 2); - - TileEntity tile = world.getTileEntity(pos); - if(tile instanceof TileEntityGiantChest){ - ((TileEntityGiantChest)tile).lootTable = loot; - } - - return true; - } - else{ - return false; - } - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java index a4546aef5..6e95bfc8e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java @@ -29,8 +29,6 @@ import net.minecraft.util.text.TextComponentTranslation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.Arrays; - public class ContainerBag extends Container implements IButtonReactor{ @@ -184,7 +182,7 @@ public class ContainerBag extends Container implements IButtonReactor{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -219,7 +217,7 @@ public class ContainerBag extends Container implements IButtonReactor{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.bagInventory.isUseableByPlayer(player); + return this.bagInventory.isUsableByPlayer(player); } @Override @@ -256,7 +254,7 @@ public class ContainerBag extends Container implements IButtonReactor{ } @Override - public boolean isUseableByPlayer(EntityPlayer player){ + public boolean isUsableByPlayer(EntityPlayer player){ return true; } @@ -307,7 +305,7 @@ public class ContainerBag extends Container implements IButtonReactor{ } @Override - public boolean func_191420_l(){ + public boolean isEmpty(){ return StackUtil.isIInvEmpty(this.slots); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBioReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBioReactor.java index 15556024c..038bf7ee3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBioReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBioReactor.java @@ -88,7 +88,7 @@ public class ContainerBioReactor extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -97,6 +97,6 @@ public class ContainerBioReactor extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.tile.isUseableByPlayer(player); + return this.tile.isUsableByPlayer(player); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java index 643abff1c..d0949b524 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java @@ -85,7 +85,7 @@ public class ContainerBreaker extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -94,6 +94,6 @@ public class ContainerBreaker extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.breaker.isUseableByPlayer(player); + return this.breaker.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java index c8b06e942..a023fb4cf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java @@ -87,7 +87,7 @@ public class ContainerCanolaPress extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -96,6 +96,6 @@ public class ContainerCanolaPress extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.press.isUseableByPlayer(player); + return this.press.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java index 4b30c075f..07f5ff873 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java @@ -86,7 +86,7 @@ public class ContainerCoalGenerator extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -95,6 +95,6 @@ public class ContainerCoalGenerator extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.generator.isUseableByPlayer(player); + return this.generator.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java index 8f7d66d70..121026730 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java @@ -114,7 +114,7 @@ public class ContainerCoffeeMachine extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -123,6 +123,6 @@ public class ContainerCoffeeMachine extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.machine.isUseableByPlayer(player); + return this.machine.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java index 70bf54148..fbebc9f90 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCrafter.java @@ -29,7 +29,7 @@ public class ContainerCrafter extends Container{ public ContainerCrafter(EntityPlayer player){ InventoryPlayer inventory = player.inventory; - this.world = player.worldObj; + this.world = player.world; this.addSlotToContainer(new SlotCrafting(inventory.player, this.craftMatrix, this.craftResult, 0, 124, 35)); for(int i = 0; i < 3; i++){ @@ -91,7 +91,7 @@ public class ContainerCrafter extends Container{ return StackUtil.getNull(); } - slot.func_190901_a(player, itemstack1); + slot.onTake(player, itemstack1); } return itemstack; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java index 7f4ef45bf..1aed72e54 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java @@ -85,7 +85,7 @@ public class ContainerDirectionalBreaker extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -94,6 +94,6 @@ public class ContainerDirectionalBreaker extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.breaker.isUseableByPlayer(player); + return this.breaker.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java index 8a18246ad..73f6e433a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java @@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.inventory.slot.SlotImmovable; import de.ellpeck.actuallyadditions.mod.items.ItemDrill; import de.ellpeck.actuallyadditions.mod.items.ItemDrillUpgrade; import de.ellpeck.actuallyadditions.mod.util.StackUtil; -import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ClickType; @@ -26,8 +25,6 @@ import net.minecraft.util.NonNullList; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentTranslation; -import java.util.Arrays; - public class ContainerDrill extends Container{ @@ -114,7 +111,7 @@ public class ContainerDrill extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -142,7 +139,7 @@ public class ContainerDrill extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.drillInventory.isUseableByPlayer(player); + return this.drillInventory.isUsableByPlayer(player); } public static class InventoryDrill implements IInventory{ @@ -165,7 +162,7 @@ public class ContainerDrill extends Container{ } @Override - public boolean isUseableByPlayer(EntityPlayer player){ + public boolean isUsableByPlayer(EntityPlayer player){ return true; } @@ -216,7 +213,7 @@ public class ContainerDrill extends Container{ } @Override - public boolean func_191420_l(){ + public boolean isEmpty(){ return StackUtil.isIInvEmpty(this.slots); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java index e5a073104..d1850442c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java @@ -85,7 +85,7 @@ public class ContainerDropper extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -94,6 +94,6 @@ public class ContainerDropper extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.dropper.isUseableByPlayer(player); + return this.dropper.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java index b24f9e781..ac9600dce 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java @@ -124,7 +124,7 @@ public class ContainerEnergizer extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -133,6 +133,6 @@ public class ContainerEnergizer extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.energizer.isUseableByPlayer(player); + return this.energizer.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java index 7052e235d..27b5de8e9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java @@ -123,7 +123,7 @@ public class ContainerEnervator extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -132,6 +132,6 @@ public class ContainerEnervator extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.enervator.isUseableByPlayer(player); + return this.enervator.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFarmer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFarmer.java index 045b7faea..adec060ce 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFarmer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFarmer.java @@ -18,7 +18,6 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import net.minecraftforge.common.IPlantable; public class ContainerFarmer extends Container{ @@ -95,7 +94,7 @@ public class ContainerFarmer extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -104,6 +103,6 @@ public class ContainerFarmer extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.farmer.isUseableByPlayer(player); + return this.farmer.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java index 7e5fd925f..ad6e89bc5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java @@ -80,7 +80,7 @@ public class ContainerFeeder extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -89,6 +89,6 @@ public class ContainerFeeder extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.tileFeeder.isUseableByPlayer(player); + return this.tileFeeder.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java index 1600f83b7..05ab2638d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java @@ -75,7 +75,7 @@ public class ContainerFermentingBarrel extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java index 59012c7b5..82b6905d7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java @@ -26,8 +26,6 @@ import net.minecraft.util.NonNullList; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentTranslation; -import java.util.Arrays; - public class ContainerFilter extends Container{ @@ -105,7 +103,7 @@ public class ContainerFilter extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -137,7 +135,7 @@ public class ContainerFilter extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.filterInventory.isUseableByPlayer(player); + return this.filterInventory.isUsableByPlayer(player); } public static class InventoryFilter implements IInventory{ @@ -160,7 +158,7 @@ public class ContainerFilter extends Container{ } @Override - public boolean isUseableByPlayer(EntityPlayer player){ + public boolean isUsableByPlayer(EntityPlayer player){ return true; } @@ -211,7 +209,7 @@ public class ContainerFilter extends Container{ } @Override - public boolean func_191420_l(){ + public boolean isEmpty(){ return StackUtil.isIInvEmpty(this.slots); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java index 314c093d2..af41a3ab5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java @@ -82,7 +82,7 @@ public class ContainerFluidCollector extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java index 7e259f21c..4f111feda 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java @@ -99,7 +99,7 @@ public class ContainerFurnaceDouble extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -108,6 +108,6 @@ public class ContainerFurnaceDouble extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.tileFurnace.isUseableByPlayer(player); + return this.tileFurnace.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java index e949a75d2..d572183a1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java @@ -86,7 +86,7 @@ public class ContainerGiantChest extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -95,6 +95,6 @@ public class ContainerGiantChest extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.tileChest.isUseableByPlayer(player); + return this.tileChest.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java index b633e5717..b1a4686c2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java @@ -110,7 +110,7 @@ public class ContainerGrinder extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -119,6 +119,6 @@ public class ContainerGrinder extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.tileGrinder.isUseableByPlayer(player); + return this.tileGrinder.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java index b382adef8..2a41e2291 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java @@ -97,7 +97,7 @@ public class ContainerInputter extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -117,6 +117,6 @@ public class ContainerInputter extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.tileInputter.isUseableByPlayer(player); + return this.tileInputter.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java index 1bc10e0ea..a842f51d0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java @@ -85,7 +85,7 @@ public class ContainerLaserRelayItemWhitelist extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java index a8f8c8d30..b5d84bcf5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java @@ -85,7 +85,7 @@ public class ContainerMiner extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -94,6 +94,6 @@ public class ContainerMiner extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.miner.isUseableByPlayer(player); + return this.miner.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java index b9c011e20..425612093 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java @@ -74,7 +74,7 @@ public class ContainerOilGenerator extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java index dd39b6c70..cb17af032 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java @@ -85,7 +85,7 @@ public class ContainerPhantomPlacer extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -94,6 +94,6 @@ public class ContainerPhantomPlacer extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.placer.isUseableByPlayer(player); + return this.placer.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java index 7da1f7039..931fea385 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java @@ -92,7 +92,7 @@ public class ContainerRangedCollector extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -112,6 +112,6 @@ public class ContainerRangedCollector extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.collector.isUseableByPlayer(player); + return this.collector.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java index e339b52fc..0a773d85e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java @@ -87,7 +87,7 @@ public class ContainerRepairer extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -96,6 +96,6 @@ public class ContainerRepairer extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.tileRepairer.isUseableByPlayer(player); + return this.tileRepairer.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java index 3deab6620..f6191e897 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java @@ -85,7 +85,7 @@ public class ContainerXPSolidifier extends Container{ if(StackUtil.getStackSize(newStack) == StackUtil.getStackSize(currentStack)){ return StackUtil.getNull(); } - theSlot.func_190901_a(player, newStack); + theSlot.onTake(player, newStack); return currentStack; } @@ -94,6 +94,6 @@ public class ContainerXPSolidifier extends Container{ @Override public boolean canInteractWith(EntityPlayer player){ - return this.solidifier.isUseableByPlayer(player); + return this.solidifier.isUsableByPlayer(player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java index 5211eec5f..9ab8cb03a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/EnergyDisplay.java @@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.RenderHelper; import net.minecraftforge.fml.client.config.GuiUtils; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -68,7 +67,7 @@ public class EnergyDisplay extends Gui{ if(this.rfReference.getEnergyStored() > 0){ int i = this.rfReference.getEnergyStored()*83/this.rfReference.getMaxEnergyStored(); - float[] color = AssetUtil.getWheelColor(mc.theWorld.getTotalWorldTime()%256); + float[] color = AssetUtil.getWheelColor(mc.world.getTotalWorldTime()%256); GlStateManager.color(color[0]/255F, color[1]/255F, color[2]/255F); this.drawTexturedModalRect(barX+1, barY+84-i, 36, 172, 16, i); GlStateManager.color(1F, 1F, 1F); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java index f628f2275..1acf9f5c5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java @@ -42,16 +42,16 @@ public class FilterSettingsGui extends Gui{ this.whitelistButton = new SmallerButton(this.theSettings.whitelistButtonId, x, y, "", true); buttonList.add(this.whitelistButton); - y+=14; + y += 14; this.metaButton = new SmallerButton(this.theSettings.metaButtonId, x, y, "", true); buttonList.add(this.metaButton); - y+=14; + y += 14; this.nbtButton = new SmallerButton(this.theSettings.nbtButtonId, x, y, "", true); buttonList.add(this.nbtButton); - y+=14; + y += 14; this.oredictButton = new SmallerButton(this.theSettings.oredictButtonId, x, y, "", true); buttonList.add(this.oredictButton); - y+=15; + y += 15; this.modButton = new SmallerButton(this.theSettings.modButtonId, x, y, "", true); buttonList.add(this.modButton); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java index 85dec9d7c..12a390466 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBag.java @@ -68,8 +68,8 @@ public class GuiBag extends GuiContainer{ protected void actionPerformed(GuiButton button) throws IOException{ NBTTagCompound data = new NBTTagCompound(); data.setInteger("ButtonID", button.id); - data.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); - data.setInteger("WorldID", Minecraft.getMinecraft().theWorld.provider.getDimension()); + data.setInteger("PlayerID", Minecraft.getMinecraft().player.getEntityId()); + data.setInteger("WorldID", Minecraft.getMinecraft().world.provider.getDimension()); PacketHandler.theNetwork.sendToServer(new PacketClientToServer(data, PacketHandler.GUI_BUTTON_TO_CONTAINER_HANDLER)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java index cc147fa5d..aaadc5b11 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBioReactor.java @@ -19,8 +19,6 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -import java.io.IOException; - public class GuiBioReactor extends GuiContainer{ private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_bio_reactor"); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java index 2f88efe74..95a0568c7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java @@ -21,8 +21,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.io.IOException; - @SideOnly(Side.CLIENT) public class GuiCanolaPress extends GuiContainer{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java index d8c770e43..039c37962 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java @@ -21,8 +21,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.io.IOException; - @SideOnly(Side.CLIENT) public class GuiCoalGenerator extends GuiContainer{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java index ff3418f36..28ec65804 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java @@ -25,7 +25,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.io.IOException; import java.util.Collections; @SideOnly(Side.CLIENT) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java index ec9135169..24239330d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java @@ -21,8 +21,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.io.IOException; - @SideOnly(Side.CLIENT) public class GuiDirectionalBreaker extends GuiContainer{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java index 4e786deed..93a1ee96f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java @@ -21,8 +21,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.io.IOException; - @SideOnly(Side.CLIENT) public class GuiEnergizer extends GuiContainer{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java index b4584f53b..ee99dea1a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java @@ -21,8 +21,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.io.IOException; - @SideOnly(Side.CLIENT) public class GuiEnervator extends GuiContainer{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java index c2af18e16..c7eb5dc0c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFarmer.java @@ -21,8 +21,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.io.IOException; - @SideOnly(Side.CLIENT) public class GuiFarmer extends GuiContainer{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java index 722a4ff30..c9df9c5f7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java @@ -233,7 +233,7 @@ public class GuiInputter extends GuiContainer{ compound.setInteger("Y", this.y); compound.setInteger("Z", this.z); compound.setInteger("WorldID", this.world.provider.getDimension()); - compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().player.getEntityId()); compound.setInteger("NumberID", textID); compound.setInteger("Number", text); PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_NUMBER_TO_TILE_HANDLER)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java index 15b4f022a..1808c16de 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java @@ -21,8 +21,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.io.IOException; - @SideOnly(Side.CLIENT) public class GuiOilGenerator extends GuiContainer{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java index c89ab07f8..ff7856ed1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java @@ -21,8 +21,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.io.IOException; - @SideOnly(Side.CLIENT) public class GuiRepairer extends GuiContainer{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java index 609145272..77d459e5f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java @@ -120,7 +120,7 @@ public class GuiSmileyCloud extends GuiContainer{ compound.setInteger("Y", this.y); compound.setInteger("Z", this.z); compound.setInteger("WorldID", this.world.provider.getDimension()); - compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().player.getEntityId()); compound.setInteger("TextID", textID); compound.setString("Text", text); PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_STRING_TO_TILE_HANDLER)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java index 9daf8351c..1a8853ecd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java @@ -85,6 +85,6 @@ public class GuiXPSolidifier extends GuiContainer{ public void actionPerformed(GuiButton button){ PacketHandlerHelper.sendButtonPacket(this.solidifier, button.id); - this.solidifier.onButtonPressed(button.id, Minecraft.getMinecraft().thePlayer); + this.solidifier.onButtonPressed(button.id, Minecraft.getMinecraft().player); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBag.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBag.java index 4efd37cff..f2b2bcf25 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBag.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBag.java @@ -16,9 +16,7 @@ import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler.GuiTypes; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.tile.FilterSettings; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; -import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java index 7a3eda3cf..90e229729 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBattery.java @@ -20,7 +20,6 @@ import net.darkhax.tesla.api.ITeslaConsumer; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ActionResult; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java index ec541c8fd..4ec69580a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java @@ -102,9 +102,9 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{ @Override public void displayHud(Minecraft minecraft, EntityPlayer player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution){ if(posHit != null && posHit.getBlockPos() != null){ - IBlockState state = minecraft.theWorld.getBlockState(posHit.getBlockPos()); + IBlockState state = minecraft.world.getBlockState(posHit.getBlockPos()); Block block = state.getBlock(); - if(block != null && !block.isAir(minecraft.theWorld.getBlockState(posHit.getBlockPos()), minecraft.theWorld, posHit.getBlockPos())){ + if(block != null && !block.isAir(minecraft.world.getBlockState(posHit.getBlockPos()), minecraft.world, posHit.getBlockPos())){ ItemStack blockStack = new ItemStack(block, 1, block.getMetaFromState(state)); int height = resolution.getScaledHeight()/5*3; if(player.isSneaking()){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java index 9c502acbe..722ee0f63 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java @@ -23,8 +23,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; - public class ItemCrystal extends ItemBase{ private final boolean isEmpowered; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java index b19f5dd97..398dbf643 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java @@ -22,13 +22,10 @@ import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; -import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil; -import net.darkhax.tesla.api.ITeslaProducer; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; @@ -49,6 +46,7 @@ import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import javax.annotation.Nullable; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -197,8 +195,8 @@ public class ItemDrill extends ItemEnergy{ Multimap map = super.getAttributeModifiers(slot, stack); if(slot == EntityEquipmentSlot.MAINHAND){ - map.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Drill Modifier", this.getEnergyStored(stack) >= ENERGY_USE ? 8.0F : 0.1F, 0)); - map.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool Modifier", -2.5F, 0)); + map.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Drill Modifier", this.getEnergyStored(stack) >= ENERGY_USE ? 8.0F : 0.1F, 0)); + map.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool Modifier", -2.5F, 0)); } return map; @@ -225,21 +223,21 @@ public class ItemDrill extends ItemEnergy{ } //Block hit - RayTraceResult ray = WorldUtil.getNearestBlockWithDefaultReachDistance(player.worldObj, player); + RayTraceResult ray = WorldUtil.getNearestBlockWithDefaultReachDistance(player.world, player); if(ray != null){ int side = ray.sideHit.ordinal(); //Breaks the Blocks if(!player.isSneaking() && this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){ if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)){ - toReturn = this.breakBlocks(stack, 2, player.worldObj, side != 0 && side != 1 ? pos.up() : pos, side, player); + toReturn = this.breakBlocks(stack, 2, player.world, side != 0 && side != 1 ? pos.up() : pos, side, player); } else{ - toReturn = this.breakBlocks(stack, 1, player.worldObj, pos, side, player); + toReturn = this.breakBlocks(stack, 1, player.world, pos, side, player); } } else{ - toReturn = this.breakBlocks(stack, 0, player.worldObj, pos, side, player); + toReturn = this.breakBlocks(stack, 0, player.world, pos, side, player); } //Removes Enchantments added above @@ -265,7 +263,7 @@ public class ItemDrill extends ItemEnergy{ } @Override - public int getHarvestLevel(ItemStack stack, String toolClass){ + public int getHarvestLevel(ItemStack stack, String toolClass, EntityPlayer player, IBlockState blockState){ return HARVEST_LEVEL; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java index 543cfddf2..7d5288e2c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java @@ -24,8 +24,6 @@ import net.minecraft.util.NonNullList; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; - public class ItemDust extends ItemBase implements IColorProvidingItem{ public static final TheDusts[] ALL_DUSTS = TheDusts.values(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java index 7219d37c2..d582f03db 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java @@ -29,8 +29,6 @@ import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; - public class ItemFoods extends ItemFoodBase{ public static final TheFoods[] ALL_FOODS = TheFoods.values(); @@ -49,9 +47,9 @@ public class ItemFoods extends ItemFoodBase{ if(StackUtil.isValid(returnItem) && player instanceof EntityPlayer){ if(!((EntityPlayer)player).inventory.addItemStackToInventory(returnItem.copy())){ if(!world.isRemote){ - EntityItem entityItem = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, returnItem.copy()); + EntityItem entityItem = new EntityItem(player.world, player.posX, player.posY, player.posZ, returnItem.copy()); entityItem.setPickupDelay(0); - player.worldObj.spawnEntityInWorld(entityItem); + player.world.spawnEntity(entityItem); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java index 835ce1b22..fd841a0cb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemGrowthRing.java @@ -48,14 +48,14 @@ public class ItemGrowthRing extends ItemEnergy{ List blocks = new ArrayList(); //Adding all possible Blocks - if(player.worldObj.getTotalWorldTime()%30 == 0){ + if(player.world.getTotalWorldTime()%30 == 0){ int range = 3; for(int x = -range; x < range+1; x++){ for(int z = -range; z < range+1; z++){ for(int y = -range; y < range+1; y++){ - int theX = MathHelper.floor_double(player.posX+x); - int theY = MathHelper.floor_double(player.posY+y); - int theZ = MathHelper.floor_double(player.posZ+z); + int theX = MathHelper.floor(player.posX+x); + int theY = MathHelper.floor(player.posY+y); + int theZ = MathHelper.floor(player.posZ+z); BlockPos posInQuestion = new BlockPos(theX, theY, theZ); Block theBlock = world.getBlockState(posInQuestion).getBlock(); if((theBlock instanceof IGrowable || theBlock instanceof IPlantable) && !(theBlock instanceof BlockGrass)){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java index d136f3823..75501280a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java @@ -41,12 +41,12 @@ public class ItemHairyBall extends ItemBase{ public void livingUpdateEvent(LivingEvent.LivingUpdateEvent event){ //Ocelots dropping Hair Balls if(event.getEntityLiving() != null){ - if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote){ + if(event.getEntityLiving().world != null && !event.getEntityLiving().world.isRemote){ if((event.getEntityLiving() instanceof EntityOcelot && ((EntityOcelot)event.getEntityLiving()).isTamed()) || (event.getEntityLiving() instanceof EntityPlayer && event.getEntityLiving().getUniqueID().equals(/*KittyVanCat*/ UUID.fromString("681d4e20-10ef-40c9-a0a5-ba2f1995ef44")))){ if(ConfigBoolValues.DO_CAT_DROPS.isEnabled()){ - if(event.getEntityLiving().worldObj.rand.nextInt(5000)+1 == 1){ - EntityItem item = new EntityItem(event.getEntityLiving().worldObj, event.getEntityLiving().posX+0.5, event.getEntityLiving().posY+0.5, event.getEntityLiving().posZ+0.5, new ItemStack(InitItems.itemHairyBall)); - event.getEntityLiving().worldObj.spawnEntityInWorld(item); + if(event.getEntityLiving().world.rand.nextInt(5000)+1 == 1){ + EntityItem item = new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX+0.5, event.getEntityLiving().posY+0.5, event.getEntityLiving().posZ+0.5, new ItemStack(InitItems.itemHairyBall)); + event.getEntityLiving().world.spawnEntity(item); } } } @@ -60,9 +60,9 @@ public class ItemHairyBall extends ItemBase{ if(!world.isRemote){ ItemStack returnItem = this.getRandomReturnItem(world.rand); if(!player.inventory.addItemStackToInventory(returnItem)){ - EntityItem entityItem = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, returnItem); + EntityItem entityItem = new EntityItem(player.world, player.posX, player.posY, player.posZ, returnItem); entityItem.setPickupDelay(0); - player.worldObj.spawnEntityInWorld(entityItem); + player.world.spawnEntity(entityItem); } stack = StackUtil.addStackSize(stack, -1); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java index 08ce16f33..a7f9e4a44 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java @@ -31,8 +31,6 @@ import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; - public class ItemJams extends ItemFoodBase implements IColorProvidingItem{ public static final TheJams[] ALL_JAMS = TheJams.values(); @@ -82,9 +80,9 @@ public class ItemJams extends ItemFoodBase implements IColorProvidingItem{ ItemStack returnItem = new ItemStack(Items.GLASS_BOTTLE); if(!((EntityPlayer)player).inventory.addItemStackToInventory(returnItem.copy())){ - EntityItem entityItem = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, returnItem.copy()); + EntityItem entityItem = new EntityItem(player.world, player.posX, player.posY, player.posZ, returnItem.copy()); entityItem.setPickupDelay(0); - player.worldObj.spawnEntityInWorld(entityItem); + player.world.spawnEntity(entityItem); } } return stackToReturn; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java index 528e2ef14..0de76e87f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemKnife.java @@ -45,7 +45,7 @@ public class ItemKnife extends ItemBase{ public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack){ Multimap map = super.getAttributeModifiers(slot, stack); if(slot == EntityEquipmentSlot.MAINHAND){ - map.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Knife Modifier", 3, 0)); + map.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Knife Modifier", 3, 0)); } return map; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java index ca6ab43d1..0bde74dee 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java @@ -46,7 +46,7 @@ public class ItemLaserWrench extends ItemBase{ if(!world.isRemote){ if(ItemPhantomConnector.getStoredPosition(stack) == null){ ItemPhantomConnector.storeConnection(stack, pos.getX(), pos.getY(), pos.getZ(), world); - player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.stored.desc")); + player.sendMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.stored.desc")); } else{ BlockPos savedPos = ItemPhantomConnector.getStoredPosition(stack); @@ -60,10 +60,10 @@ public class ItemLaserWrench extends ItemBase{ ((TileEntityLaserRelay)savedTile).sendUpdate(); relay.sendUpdate(); - player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.connected.desc")); + player.sendMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.connected.desc")); } else{ - player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.cantConnect.desc")); + player.sendMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".laser.cantConnect.desc")); ItemPhantomConnector.clearStorage(stack, "XCoordOfTileStored", "YCoordOfTileStored", "ZCoordOfTileStored", "WorldOfTileStored"); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java index 824b032b0..9b486c689 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLeafBlower.java @@ -70,7 +70,7 @@ public class ItemLeafBlower extends ItemBase implements IDisplayStandItem{ @Override public void onUsingTick(ItemStack stack, EntityLivingBase player, int time){ - this.doUpdate(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ), time, stack); + this.doUpdate(player.world, MathHelper.floor(player.posX), MathHelper.floor(player.posY), MathHelper.floor(player.posZ), time, stack); } private boolean doUpdate(World world, int x, int y, int z, int time, ItemStack stack){ @@ -130,7 +130,7 @@ public class ItemLeafBlower extends ItemBase implements IDisplayStandItem{ for(ItemStack theDrop : drops){ //Drops the Items into the World - world.spawnEntityInWorld(new EntityItem(world, theCoord.getX()+0.5, theCoord.getY()+0.5, theCoord.getZ()+0.5, theDrop)); + world.spawnEntity(new EntityItem(world, theCoord.getX()+0.5, theCoord.getY()+0.5, theCoord.getZ()+0.5, theDrop)); } return true; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java index 6e153e9e4..ec9e1a9ae 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java @@ -30,8 +30,6 @@ import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; - public class ItemMisc extends ItemBase{ public static final TheMiscItems[] ALL_MISC_ITEMS = TheMiscItems.values(); @@ -77,20 +75,20 @@ public class ItemMisc extends ItemBase{ @Override public boolean onEntityItemUpdate(EntityItem entity){ - if(!entity.worldObj.isRemote){ + if(!entity.world.isRemote){ ItemStack stack = entity.getEntityItem(); if(stack != null){ boolean isEmpowered = stack.getItemDamage() == TheMiscItems.EMPOWERED_CANOLA_SEED.ordinal(); if(stack.getItemDamage() == TheMiscItems.CRYSTALLIZED_CANOLA_SEED.ordinal() || isEmpowered){ BlockPos pos = entity.getPosition(); - IBlockState state = entity.worldObj.getBlockState(pos); + IBlockState state = entity.world.getBlockState(pos); Block block = state.getBlock(); if(block instanceof IFluidBlock && block.getMetaFromState(state) == 0){ Fluid fluid = ((IFluidBlock)block).getFluid(); if(fluid != null && fluid == (isEmpowered ? InitFluids.fluidCrystalOil : InitFluids.fluidOil)){ entity.setDead(); - entity.worldObj.setBlockState(pos, (isEmpowered ? InitFluids.blockEmpoweredOil : InitFluids.blockCrystalOil).getDefaultState()); + entity.world.setBlockState(pos, (isEmpowered ? InitFluids.blockEmpoweredOil : InitFluids.blockCrystalOil).getDefaultState()); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java index b1617cf69..1b27e1f99 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPhantomConnector.java @@ -101,7 +101,7 @@ public class ItemPhantomConnector extends ItemBase{ ((TileEntityBase)tile).sendUpdate(); } clearStorage(stack, "XCoordOfTileStored", "YCoordOfTileStored", "ZCoordOfTileStored", "WorldOfTileStored"); - player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.connected.desc")); + player.sendMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.connected.desc")); return EnumActionResult.SUCCESS; } return EnumActionResult.FAIL; @@ -109,7 +109,7 @@ public class ItemPhantomConnector extends ItemBase{ } //Storing Connections storeConnection(stack, pos.getX(), pos.getY(), pos.getZ(), world); - player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.stored.desc")); + player.sendMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".phantom.stored.desc")); } return EnumActionResult.SUCCESS; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java index d9ffd3e9e..cba8a84d2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPlayerProbe.java @@ -52,14 +52,14 @@ public class ItemPlayerProbe extends ItemBase{ if(player != null){ if(player.isSneaking()){ ItemPhantomConnector.clearStorage(stack, "UUIDLeast", "UUIDMost", "Name"); - entity.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".playerProbe.disconnect.1")); - player.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".playerProbe.notice")); + entity.sendMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".playerProbe.disconnect.1")); + player.sendMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".playerProbe.notice")); TheAchievements.GET_UNPROBED.get(player); } } else{ ItemPhantomConnector.clearStorage(stack, "UUID", "Name"); - entity.addChatMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".playerProbe.disconnect.2")); + entity.sendMessage(new TextComponentTranslation("tooltip."+ModUtil.MOD_ID+".playerProbe.disconnect.2")); } } } @@ -92,7 +92,7 @@ public class ItemPlayerProbe extends ItemBase{ @Override public boolean itemInteractionForEntity(ItemStack aStack, EntityPlayer player, EntityLivingBase entity, EnumHand hand){ - if(!player.worldObj.isRemote){ + if(!player.world.isRemote){ ItemStack stack = player.getHeldItemMainhand(); if(StackUtil.isValid(stack) && stack.getItem() == this){ if(entity instanceof EntityPlayer){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java index 56f5adea8..06c1dbd5a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java @@ -53,6 +53,24 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi this.isAdvanced = isAdvanced; } + public static int getStoredBlaze(ItemStack stack){ + if(!StackUtil.isValid(stack) || !stack.hasTagCompound()){ + return 0; + } + else{ + return stack.getTagCompound().getInteger("Blaze"); + } + } + + public static void setStoredBlaze(ItemStack stack, int amount){ + if(StackUtil.isValid(stack)){ + if(!stack.hasTagCompound()){ + stack.setTagCompound(new NBTTagCompound()); + } + stack.getTagCompound().setInteger("Blaze", amount); + } + } + @Override public int getMetadata(int damage){ return damage; @@ -118,7 +136,6 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi return standardName; } - @Override public EnumRarity getRarity(ItemStack stack){ return stack.getItemDamage() >= ALL_RINGS.length ? EnumRarity.COMMON : ALL_RINGS[stack.getItemDamage()].rarity; @@ -154,24 +171,6 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi }; } - public static int getStoredBlaze(ItemStack stack){ - if(!StackUtil.isValid(stack) || !stack.hasTagCompound()){ - return 0; - } - else{ - return stack.getTagCompound().getInteger("Blaze"); - } - } - - public static void setStoredBlaze(ItemStack stack, int amount){ - if(StackUtil.isValid(stack)){ - if(!stack.hasTagCompound()){ - stack.setTagCompound(new NBTTagCompound()); - } - stack.getTagCompound().setInteger("Blaze", amount); - } - } - @Override public boolean update(ItemStack stack, TileEntity tile, int elapsedTicks){ boolean advanced = ((ItemPotionRing)stack.getItem()).isAdvanced; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java index 9a1ad39cd..d431f32d9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSolidifiedExperience.java @@ -40,11 +40,11 @@ public class ItemSolidifiedExperience extends ItemBase{ @SubscribeEvent public void onEntityDropEvent(LivingDropsEvent event){ if(ConfigBoolValues.DO_XP_DROPS.isEnabled()){ - if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote && event.getSource().getEntity() instanceof EntityPlayer){ + if(event.getEntityLiving().world != null && !event.getEntityLiving().world.isRemote && event.getSource().getEntity() instanceof EntityPlayer){ //Drop Solidified XP if(event.getEntityLiving() instanceof EntityCreature){ - if(event.getEntityLiving().worldObj.rand.nextInt(10) <= event.getLootingLevel()*2){ - event.getEntityLiving().entityDropItem(new ItemStack(InitItems.itemSolidifiedExperience, event.getEntityLiving().worldObj.rand.nextInt(2+event.getLootingLevel())+1), 0); + if(event.getEntityLiving().world.rand.nextInt(10) <= event.getLootingLevel()*2){ + event.getEntityLiving().entityDropItem(new ItemStack(InitItems.itemSolidifiedExperience, event.getEntityLiving().world.rand.nextInt(2+event.getLootingLevel())+1), 0); } } } @@ -71,7 +71,7 @@ public class ItemSolidifiedExperience extends ItemBase{ EntityXPOrb orb = new EntityXPOrb(world, player.posX+0.5, player.posY+0.5, player.posZ+0.5, amount); orb.getEntityData().setBoolean(ModUtil.MOD_ID+"FromSolidified", true); - world.spawnEntityInWorld(orb); + world.spawnEntity(orb); } return new ActionResult(EnumActionResult.SUCCESS, stack); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java index faba35ed0..ca92de781 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemSpawnerChanger.java @@ -77,7 +77,7 @@ public class ItemSpawnerChanger extends ItemBase{ compound.removeTag("SpawnData"); logic.readFromNBT(compound); - logic.func_190894_a(new ResourceLocation(entity)); + logic.setEntityId(new ResourceLocation(entity)); tile.markDirty(); @@ -100,7 +100,7 @@ public class ItemSpawnerChanger extends ItemBase{ @Override public boolean itemInteractionForEntity(ItemStack aStack, EntityPlayer player, EntityLivingBase entity, EnumHand hand){ - if(!player.worldObj.isRemote){ + if(!player.world.isRemote){ ItemStack stack = player.getHeldItemMainhand(); if(this.getStoredEntity(stack) == null){ if(this.storeClickedEntity(stack, entity)){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java index 6a7562a94..74ca72903 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterBowl.java @@ -67,7 +67,7 @@ public class ItemWaterBowl extends ItemBase{ else if(!event.getEntityPlayer().inventory.addItemStackToInventory(bowl.copy())){ EntityItem entityItem = new EntityItem(event.getWorld(), event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ, bowl.copy()); entityItem.setPickupDelay(0); - event.getWorld().spawnEntityInWorld(entityItem); + event.getWorld().spawnEntity(entityItem); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterRemovalRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterRemovalRing.java index 45f766c3c..3835c1241 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterRemovalRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWaterRemovalRing.java @@ -46,9 +46,9 @@ public class ItemWaterRemovalRing extends ItemEnergy{ for(int x = -range; x < range+1; x++){ for(int z = -range; z < range+1; z++){ for(int y = -range; y < range+1; y++){ - int theX = MathHelper.floor_double(player.posX+x); - int theY = MathHelper.floor_double(player.posY+y); - int theZ = MathHelper.floor_double(player.posZ+z); + int theX = MathHelper.floor(player.posX+x); + int theY = MathHelper.floor(player.posY+y); + int theZ = MathHelper.floor(player.posZ+z); //Remove Water BlockPos pos = new BlockPos(theX, theY, theZ); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java index ea4750e9d..211fff4f6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java @@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper; import de.ellpeck.actuallyadditions.mod.util.StackUtil; -import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.entity.passive.EntityBat; @@ -44,37 +43,6 @@ public class ItemWingsOfTheBats extends ItemBase{ MinecraftForge.EVENT_BUS.register(this); } - @Override - public boolean showDurabilityBar(ItemStack stack){ - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public double getDurabilityForDisplay(ItemStack stack){ - PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(Minecraft.getMinecraft().thePlayer); - if(data != null){ - double diff = MAX_FLY_TIME-data.batWingsFlyTime; - return 1-(diff/MAX_FLY_TIME); - } - else{ - return super.getDurabilityForDisplay(stack); - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getRGBDurabilityForDisplay(ItemStack stack){ - PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(Minecraft.getMinecraft().thePlayer); - if(data != null){ - int curr = data.batWingsFlyTime; - return MathHelper.hsvToRGB(Math.max(0.0F, 1-(float)curr/MAX_FLY_TIME)/3.0F, 1.0F, 1.0F); - } - else{ - return super.getRGBDurabilityForDisplay(stack); - } - } - /** * Checks if the Player has Wings in its Inventory * @@ -90,13 +58,44 @@ public class ItemWingsOfTheBats extends ItemBase{ return StackUtil.getNull(); } + @Override + public boolean showDurabilityBar(ItemStack stack){ + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public double getDurabilityForDisplay(ItemStack stack){ + PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(Minecraft.getMinecraft().player); + if(data != null){ + double diff = MAX_FLY_TIME-data.batWingsFlyTime; + return 1-(diff/MAX_FLY_TIME); + } + else{ + return super.getDurabilityForDisplay(stack); + } + } + + @Override + @SideOnly(Side.CLIENT) + public int getRGBDurabilityForDisplay(ItemStack stack){ + PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(Minecraft.getMinecraft().player); + if(data != null){ + int curr = data.batWingsFlyTime; + return MathHelper.hsvToRGB(Math.max(0.0F, 1-(float)curr/MAX_FLY_TIME)/3.0F, 1.0F, 1.0F); + } + else{ + return super.getRGBDurabilityForDisplay(stack); + } + } + @SubscribeEvent public void onEntityDropEvent(LivingDropsEvent event){ - if(event.getEntityLiving().worldObj != null && !event.getEntityLiving().worldObj.isRemote && event.getSource().getEntity() instanceof EntityPlayer){ + if(event.getEntityLiving().world != null && !event.getEntityLiving().world.isRemote && event.getSource().getEntity() instanceof EntityPlayer){ //Drop Wings from Bats if(ConfigBoolValues.DO_BAT_DROPS.isEnabled() && event.getEntityLiving() instanceof EntityBat){ - if(event.getEntityLiving().worldObj.rand.nextInt(15) <= event.getLootingLevel()*2){ - event.getEntityLiving().entityDropItem(new ItemStack(InitItems.itemMisc, event.getEntityLiving().worldObj.rand.nextInt(2+event.getLootingLevel())+1, TheMiscItems.BAT_WING.ordinal()), 0); + if(event.getEntityLiving().world.rand.nextInt(15) <= event.getLootingLevel()*2){ + event.getEntityLiving().entityDropItem(new ItemStack(InitItems.itemMisc, event.getEntityLiving().world.rand.nextInt(2+event.getLootingLevel())+1, TheMiscItems.BAT_WING.ordinal()), 0); } } } @@ -110,7 +109,7 @@ public class ItemWingsOfTheBats extends ItemBase{ if(!player.capabilities.isCreativeMode){ PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); - if(!player.worldObj.isRemote){ + if(!player.world.isRemote){ boolean tryDeduct = false; boolean shouldSend = false; @@ -133,7 +132,7 @@ public class ItemWingsOfTheBats extends ItemBase{ if(player.capabilities.isFlying){ data.batWingsFlyTime++; - if(player.worldObj.getTotalWorldTime()%10 == 0){ + if(player.world.getTotalWorldTime()%10 == 0){ shouldSend = true; } } @@ -159,8 +158,8 @@ public class ItemWingsOfTheBats extends ItemBase{ } else{ BlockPos pos = new BlockPos(player.posX, player.posY+player.height, player.posZ); - IBlockState state = player.worldObj.getBlockState(pos); - if(state != null && state.isSideSolid(player.worldObj, pos, EnumFacing.DOWN)){ + IBlockState state = player.world.getBlockState(pos); + if(state != null && state.isSideSolid(player.world, pos, EnumFacing.DOWN)){ deductTime = 10; } } @@ -168,7 +167,7 @@ public class ItemWingsOfTheBats extends ItemBase{ if(deductTime > 0){ data.batWingsFlyTime = Math.max(0, data.batWingsFlyTime-deductTime); - if(player.worldObj.getTotalWorldTime()%10 == 0){ + if(player.world.getTotalWorldTime()%10 == 0){ shouldSend = true; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java index 448ebe4c7..b72781418 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWorm.java @@ -50,7 +50,7 @@ public class ItemWorm extends ItemBase{ if(!world.isRemote){ EntityWorm worm = new EntityWorm(world); worm.setPosition(pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5); - world.spawnEntityInWorld(worm); + world.spawnEntity(worm); player.setHeldItem(hand, StackUtil.addStackSize(stack, -1)); } @@ -71,7 +71,7 @@ public class ItemWorm extends ItemBase{ if(state.getBlock() instanceof BlockGrass && world.rand.nextFloat() >= 0.95F){ ItemStack stack = new ItemStack(InitItems.itemWorm, world.rand.nextInt(2)+1); EntityItem item = new EntityItem(event.getWorld(), pos.getX()+0.5, pos.getY()+1, pos.getZ()+0.5, stack); - world.spawnEntityInWorld(item); + world.spawnEntity(item); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensColor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensColor.java index 398f90a50..f593d18fb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensColor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensColor.java @@ -73,7 +73,7 @@ public class LensColor extends Lens{ item.setDead(); EntityItem newItem = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, newStack); - tile.getWorldObject().spawnEntityInWorld(newItem); + tile.getWorldObject().spawnEntity(newItem); tile.extractEnergy(ENERGY_USE); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDisenchanting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDisenchanting.java index 4381c1472..2d802a109 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDisenchanting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDisenchanting.java @@ -93,8 +93,8 @@ public class LensDisenchanting extends Lens{ EntityItem newBook = new EntityItem(book.getEntityWorld(), book.posX, book.posY, book.posZ, newBookStack); toDisenchant.setDead(); book.setDead(); - tile.getWorldObject().spawnEntityInWorld(newBook); - tile.getWorldObject().spawnEntityInWorld(disenchanted); + tile.getWorldObject().spawnEntity(newBook); + tile.getWorldObject().spawnEntity(disenchanted); tile.extractEnergy(ENERGY_USE); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDisruption.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDisruption.java index ea82126cc..b0421dd5f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDisruption.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensDisruption.java @@ -61,7 +61,7 @@ public class LensDisruption extends Lens{ item.setDead(); EntityItem newItem = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, newStack); - tile.getWorldObject().spawnEntityInWorld(newItem); + tile.getWorldObject().spawnEntity(newItem); tile.extractEnergy(ENERGY_USE); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java index 6583c4ca0..4d55a9133 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java @@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils; import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton; import mezz.jei.api.ingredients.IIngredients; -import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import java.util.Arrays; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java index e12625a6d..b73db2b0b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java @@ -30,7 +30,7 @@ public class DamageSources extends DamageSource{ @Override public ITextComponent getDeathMessage(EntityLivingBase entity){ - String locTag = "death."+ModUtil.MOD_ID+"."+this.damageType+"."+(entity.worldObj.rand.nextInt(this.messageCount)+1); + String locTag = "death."+ModUtil.MOD_ID+"."+this.damageType+"."+(entity.world.rand.nextInt(this.messageCount)+1); return new TextComponentTranslation(locTag, entity.getName()); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java index 9a07405bf..141fed6a4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java @@ -96,7 +96,7 @@ public class DungeonLoot{ addDrillCore = true; addQuartz = true; } - else if(LootTableList.field_191192_o.equals(event.getName())){ //Woodland Mansion + else if(LootTableList.CHESTS_WOODLAND_MANSION.equals(event.getName())){ addBatWings = true; addCrystals = true; addDrillCore = true; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/MethodHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/MethodHandler.java index d5e2aad01..07ff5a0c7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/MethodHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/MethodHandler.java @@ -156,7 +156,7 @@ public class MethodHandler implements IMethodHandler{ } else{ EntityItem item = new EntityItem(tile.getWorldObject(), pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, output.copy()); - tile.getWorldObject().spawnEntityInWorld(item); + tile.getWorldObject().spawnEntity(item); tile.getWorldObject().setBlockToAir(pos); } @@ -193,14 +193,14 @@ public class MethodHandler implements IMethodHandler{ stackCopy = StackUtil.addStackSize(stackCopy, -itemsPossible); EntityItem inputLeft = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, stackCopy); - tile.getWorldObject().spawnEntityInWorld(inputLeft); + tile.getWorldObject().spawnEntity(inputLeft); } ItemStack outputCopy = recipe.outputStack.copy(); outputCopy = StackUtil.setStackSize(outputCopy, itemsPossible); EntityItem newItem = new EntityItem(tile.getWorldObject(), item.posX, item.posY, item.posZ, outputCopy); - tile.getWorldObject().spawnEntityInWorld(newItem); + tile.getWorldObject().spawnEntity(newItem); tile.extractEnergy(recipe.energyUse*itemsPossible); break; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java index 74dfc5722..92cac75c6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java @@ -14,8 +14,6 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; -import java.util.Locale; - public final class SoundHandler{ public static SoundEvent duhDuhDuhDuuuh; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java index 96a927030..018c06703 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java @@ -37,7 +37,7 @@ public class RenderSpecial{ GlStateManager.pushMatrix(); - Vec3d currentPos = Minecraft.getMinecraft().thePlayer.getPositionEyes(partialTicks); + Vec3d currentPos = Minecraft.getMinecraft().player.getPositionEyes(partialTicks); Vec3d playerPos = player.getPositionEyes(partialTicks); GlStateManager.translate(playerPos.xCoord-currentPos.xCoord, playerPos.yCoord-currentPos.yCoord, playerPos.zCoord-currentPos.zCoord); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketClientToServer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketClientToServer.java index 135280b04..89ed4e35e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketClientToServer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketClientToServer.java @@ -37,7 +37,7 @@ public class PacketClientToServer implements IMessage{ public void fromBytes(ByteBuf buf){ PacketBuffer buffer = new PacketBuffer(buf); try{ - this.data = buffer.readNBTTagCompoundFromBuffer(); + this.data = buffer.readCompoundTag(); int handlerId = buffer.readInt(); if(handlerId >= 0 && handlerId < PacketHandler.DATA_HANDLERS.size()){ @@ -53,7 +53,7 @@ public class PacketClientToServer implements IMessage{ public void toBytes(ByteBuf buf){ PacketBuffer buffer = new PacketBuffer(buf); - buffer.writeNBTTagCompoundToBuffer(this.data); + buffer.writeCompoundTag(this.data); buffer.writeInt(PacketHandler.DATA_HANDLERS.indexOf(this.handler)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java index 32838dce3..6c581e611 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java @@ -49,7 +49,7 @@ public final class PacketHandler{ @Override @SideOnly(Side.CLIENT) public void handleData(NBTTagCompound compound){ - World world = Minecraft.getMinecraft().theWorld; + World world = Minecraft.getMinecraft().world; if(world != null){ TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); if(tile instanceof TileEntityBase){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandlerHelper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandlerHelper.java index 9930a53d1..351d78e17 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandlerHelper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandlerHelper.java @@ -27,7 +27,7 @@ public final class PacketHandlerHelper{ compound.setInteger("Y", pos.getY()); compound.setInteger("Z", pos.getZ()); compound.setInteger("WorldID", tile.getWorld().provider.getDimension()); - compound.setInteger("PlayerID", Minecraft.getMinecraft().thePlayer.getEntityId()); + compound.setInteger("PlayerID", Minecraft.getMinecraft().player.getEntityId()); compound.setInteger("ButtonID", buttonId); PacketHandler.theNetwork.sendToServer(new PacketClientToServer(compound, PacketHandler.GUI_BUTTON_TO_TILE_HANDLER)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketServerToClient.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketServerToClient.java index 2e9687d4c..b8b2a0778 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketServerToClient.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketServerToClient.java @@ -39,7 +39,7 @@ public class PacketServerToClient implements IMessage{ public void fromBytes(ByteBuf buf){ PacketBuffer buffer = new PacketBuffer(buf); try{ - this.data = buffer.readNBTTagCompoundFromBuffer(); + this.data = buffer.readCompoundTag(); int handlerId = buffer.readInt(); if(handlerId >= 0 && handlerId < PacketHandler.DATA_HANDLERS.size()){ @@ -55,7 +55,7 @@ public class PacketServerToClient implements IMessage{ public void toBytes(ByteBuf buf){ PacketBuffer buffer = new PacketBuffer(buf); - buffer.writeNBTTagCompoundToBuffer(this.data); + buffer.writeCompoundTag(this.data); buffer.writeInt(PacketHandler.DATA_HANDLERS.indexOf(this.handler)); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java index e9ae0a897..518a077d9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -34,7 +34,10 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class ClientProxy implements IProxy{ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java index 6b407de15..79e7b3b3e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java @@ -72,7 +72,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(!this.isRedstonePowered && !this.isPulseMode){ if(this.currentTime > 0){ this.currentTime--; @@ -94,7 +94,7 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple private void doWork(){ if(this.storage.getEnergyStored() >= ENERGY_USE){ - IBlockState state = this.worldObj.getBlockState(this.pos); + IBlockState state = this.world.getBlockState(this.pos); EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state)); //The Lens the Reconstructor currently has installed Lens currentLens = this.getLens(); @@ -106,8 +106,8 @@ public class TileEntityAtomicReconstructor extends TileEntityInventoryBase imple for(int i = 0; i < distance; i++){ BlockPos hitBlock = this.pos.offset(sideToManipulate, i+1); - if(currentLens.invoke(this.worldObj.getBlockState(hitBlock), hitBlock, this) || i >= distance-1){ - shootLaser(this.worldObj, this.getX(), this.getY(), this.getZ(), hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), currentLens); + if(currentLens.invoke(this.world.getBlockState(hitBlock), hitBlock, this) || i >= distance-1){ + shootLaser(this.world, this.getX(), this.getY(), this.getZ(), hitBlock.getX(), hitBlock.getY(), hitBlock.getZ(), currentLens); break; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java index c31cf0f8b..919eedefc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java @@ -164,7 +164,7 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ } public final void sendUpdate(){ - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ NBTTagCompound compound = new NBTTagCompound(); this.writeSyncableNBT(compound, NBTType.SYNC); @@ -173,7 +173,7 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ data.setInteger("X", this.pos.getX()); data.setInteger("Y", this.pos.getY()); data.setInteger("Z", this.pos.getZ()); - PacketHandler.theNetwork.sendToAllAround(new PacketServerToClient(data, PacketHandler.TILE_ENTITY_HANDLER), new NetworkRegistry.TargetPoint(this.worldObj.provider.getDimension(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 128)); + PacketHandler.theNetwork.sendToAllAround(new PacketServerToClient(data, PacketHandler.TILE_ENTITY_HANDLER), new NetworkRegistry.TargetPoint(this.world.provider.getDimension(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 128)); } } @@ -227,7 +227,7 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ public void updateEntity(){ this.ticksElapsed++; - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(this instanceof ISharingEnergyProvider){ ISharingEnergyProvider provider = (ISharingEnergyProvider)this; if(provider.doesShareEnergy()){ @@ -284,7 +284,7 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ public void saveDataOnChangeOrWorldStart(){ for(EnumFacing side : EnumFacing.values()){ - this.tilesAround[side.ordinal()] = this.worldObj.getTileEntity(this.pos.offset(side)); + this.tilesAround[side.ordinal()] = this.world.getTileEntity(this.pos.offset(side)); } } @@ -298,7 +298,7 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ } public boolean canPlayerUse(EntityPlayer player){ - return player.getDistanceSq(this.getPos().getX()+0.5D, this.pos.getY()+0.5D, this.pos.getZ()+0.5D) <= 64 && !this.isInvalid() && this.worldObj.getTileEntity(this.pos) == this; + return player.getDistanceSq(this.getPos().getX()+0.5D, this.pos.getY()+0.5D, this.pos.getZ()+0.5D) <= 64 && !this.isInvalid() && this.world.getTileEntity(this.pos) == this; } protected boolean sendUpdateWithInterval(){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java index 2c9debe27..5aeafaf39 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBreaker.java @@ -58,7 +58,7 @@ public class TileEntityBreaker extends TileEntityInventoryBase{ @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(!this.isRedstonePowered && !this.isPulseMode){ if(this.currentTime > 0){ this.currentTime--; @@ -79,20 +79,20 @@ public class TileEntityBreaker extends TileEntityInventoryBase{ } private void doWork(){ - IBlockState state = this.worldObj.getBlockState(this.pos); + IBlockState state = this.world.getBlockState(this.pos); EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state)); BlockPos coordsBlock = this.pos.offset(sideToManipulate); - IBlockState stateToBreak = this.worldObj.getBlockState(coordsBlock); + IBlockState stateToBreak = this.world.getBlockState(coordsBlock); Block blockToBreak = stateToBreak.getBlock(); - if(!this.isPlacer && blockToBreak != null && !this.worldObj.isAirBlock(coordsBlock) && !(blockToBreak instanceof BlockLiquid) && !(blockToBreak instanceof IFluidBlock) && blockToBreak.getBlockHardness(stateToBreak, this.worldObj, coordsBlock) >= 0.0F){ - List drops = blockToBreak.getDrops(this.worldObj, coordsBlock, stateToBreak, 0); - float chance = ForgeEventFactory.fireBlockHarvesting(drops, this.worldObj, coordsBlock, this.worldObj.getBlockState(coordsBlock), 0, 1, false, null); + if(!this.isPlacer && blockToBreak != null && !this.world.isAirBlock(coordsBlock) && !(blockToBreak instanceof BlockLiquid) && !(blockToBreak instanceof IFluidBlock) && blockToBreak.getBlockHardness(stateToBreak, this.world, coordsBlock) >= 0.0F){ + List drops = blockToBreak.getDrops(this.world, coordsBlock, stateToBreak, 0); + float chance = ForgeEventFactory.fireBlockHarvesting(drops, this.world, coordsBlock, this.world.getBlockState(coordsBlock), 0, 1, false, null); - if(this.worldObj.rand.nextFloat() <= chance){ + if(this.world.rand.nextFloat() <= chance){ if(WorldUtil.addToInventory(this, drops, false, true)){ - this.worldObj.playEvent(2001, coordsBlock, Block.getStateId(stateToBreak)); - this.worldObj.setBlockToAir(coordsBlock); + this.world.playEvent(2001, coordsBlock, Block.getStateId(stateToBreak)); + this.world.setBlockToAir(coordsBlock); WorldUtil.addToInventory(this, drops, true, true); this.markDirty(); } @@ -100,7 +100,7 @@ public class TileEntityBreaker extends TileEntityInventoryBase{ } else if(this.isPlacer){ int theSlot = WorldUtil.findFirstFilledSlot(this.slots); - this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(sideToManipulate, this.worldObj, this.pos, this.slots.get(theSlot))); + this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(sideToManipulate, this.world, this.pos, this.slots.get(theSlot))); if(!StackUtil.isValid(this.slots.get(theSlot))){ this.slots.set(theSlot, StackUtil.getNull()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java index 33af98b10..c428c2fca 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java @@ -19,9 +19,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.fluids.*; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.IFluidTankProperties; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -84,7 +83,7 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IS @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(this.isCanola(0) && PRODUCE <= this.tank.getCapacity()-this.tank.getFluidAmount()){ if(this.storage.getEnergyStored() >= ENERGY_USE){ this.currentProcessTime++; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java index c226c36f2..90f02dadb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java @@ -66,7 +66,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ boolean flag = this.currentBurnTime > 0; if(this.currentBurnTime > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java index 90ec66b15..1b560ff30 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoffeeMachine.java @@ -24,9 +24,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.SoundCategory; import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.fluids.*; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.IFluidTankProperties; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -108,7 +108,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ this.storeCoffee(); if(this.brewTime > 0 || this.isRedstonePowered){ @@ -140,11 +140,11 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements } public void brew(){ - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(StackUtil.isValid(this.slots.get(SLOT_INPUT)) && this.slots.get(SLOT_INPUT).getItem() == InitItems.itemMisc && this.slots.get(SLOT_INPUT).getItemDamage() == TheMiscItems.CUP.ordinal() && !StackUtil.isValid(this.slots.get(SLOT_OUTPUT)) && this.coffeeCacheAmount >= CACHE_USE && this.tank.getFluid() != null && this.tank.getFluid().getFluid() == FluidRegistry.WATER && this.tank.getFluidAmount() >= WATER_USE){ if(this.storage.getEnergyStored() >= ENERGY_USED){ if(this.brewTime%30 == 0){ - this.worldObj.playSound(null, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), SoundHandler.coffeeMachine, SoundCategory.BLOCKS, 0.35F, 1.0F); + this.world.playSound(null, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), SoundHandler.coffeeMachine, SoundCategory.BLOCKS, 0.35F, 1.0F); } this.brewTime++; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java index 4c79f63bc..bf49a03d0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCompost.java @@ -60,7 +60,7 @@ public class TileEntityCompost extends TileEntityInventoryBase{ @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ boolean theFlag = this.conversionTime > 0; if(StackUtil.isValid(this.slots.get(0))){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java index 157a7ff76..1fcc9bc70 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDirectionalBreaker.java @@ -57,7 +57,7 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase{ @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(!this.isRedstonePowered && !this.isPulseMode){ if(this.currentTime > 0){ this.currentTime--; @@ -78,20 +78,20 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase{ private void doWork(){ if(this.storage.getEnergyStored() >= ENERGY_USE*RANGE){ - IBlockState state = this.worldObj.getBlockState(this.pos); + IBlockState state = this.world.getBlockState(this.pos); EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state)); for(int i = 0; i < RANGE; i++){ BlockPos coordsBlock = this.pos.offset(sideToManipulate, i+1); - Block blockToBreak = this.worldObj.getBlockState(coordsBlock).getBlock(); - if(blockToBreak != null && !this.worldObj.isAirBlock(coordsBlock) && blockToBreak.getBlockHardness(this.worldObj.getBlockState(coordsBlock), this.worldObj, this.pos) > -1.0F){ - List drops = blockToBreak.getDrops(this.worldObj, coordsBlock, this.worldObj.getBlockState(coordsBlock), 0); - float chance = ForgeEventFactory.fireBlockHarvesting(drops, this.worldObj, coordsBlock, this.worldObj.getBlockState(coordsBlock), 0, 1, false, null); + Block blockToBreak = this.world.getBlockState(coordsBlock).getBlock(); + if(blockToBreak != null && !this.world.isAirBlock(coordsBlock) && blockToBreak.getBlockHardness(this.world.getBlockState(coordsBlock), this.world, this.pos) > -1.0F){ + List drops = blockToBreak.getDrops(this.world, coordsBlock, this.world.getBlockState(coordsBlock), 0); + float chance = ForgeEventFactory.fireBlockHarvesting(drops, this.world, coordsBlock, this.world.getBlockState(coordsBlock), 0, 1, false, null); - if(this.worldObj.rand.nextFloat() <= chance){ + if(this.world.rand.nextFloat() <= chance){ if(WorldUtil.addToInventory(this, drops, false, true)){ - this.worldObj.playEvent(2001, coordsBlock, Block.getStateId(this.worldObj.getBlockState(coordsBlock))); - this.worldObj.setBlockToAir(coordsBlock); + this.world.playEvent(2001, coordsBlock, Block.getStateId(this.world.getBlockState(coordsBlock))); + this.world.setBlockToAir(coordsBlock); WorldUtil.addToInventory(this, drops, true, true); this.storage.extractEnergyInternal(ENERGY_USE, false); this.markDirty(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java index f0c045ee0..383138da7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java @@ -33,7 +33,7 @@ public class TileEntityDisplayStand extends TileEntityInventoryBase implements I public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(StackUtil.isValid(this.slots.get(0)) && !this.isRedstonePowered){ IDisplayStandItem item = this.convertToDisplayStandItem(this.slots.get(0).getItem()); if(item != null){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDistributorItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDistributorItem.java index fc886e7c2..89a66c655 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDistributorItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDistributorItem.java @@ -34,7 +34,7 @@ public class TileEntityDistributorItem extends TileEntityInventoryBase{ public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ boolean shouldMarkDirty = false; IItemHandler handlerUp = this.handlersAround.get(EnumFacing.UP); @@ -120,7 +120,7 @@ public class TileEntityDistributorItem extends TileEntityInventoryBase{ this.handlersAround.clear(); for(EnumFacing side : EnumFacing.values()){ - TileEntity tile = this.worldObj.getTileEntity(this.pos.offset(side)); + TileEntity tile = this.world.getTileEntity(this.pos.offset(side)); if(tile != null && tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite())){ IItemHandler cap = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite()); if(cap != null){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java index 430d5cdb3..ec6617242 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDropper.java @@ -44,7 +44,7 @@ public class TileEntityDropper extends TileEntityInventoryBase{ @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(!this.isRedstonePowered && !this.isPulseMode){ if(this.currentTime > 0){ this.currentTime--; @@ -68,8 +68,8 @@ public class TileEntityDropper extends TileEntityInventoryBase{ if(StackUtil.isValid(this.removeFromInventory(false))){ ItemStack stack = this.removeFromInventory(true); stack = StackUtil.setStackSize(stack, 1); - IBlockState state = this.worldObj.getBlockState(this.pos); - WorldUtil.dropItemAtSide(WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state)), this.worldObj, this.pos, stack); + IBlockState state = this.world.getBlockState(this.pos); + WorldUtil.dropItemAtSide(WorldUtil.getDirectionByPistonRotation(state.getBlock().getMetaFromState(state)), this.world, this.pos, stack); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEmpowerer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEmpowerer.java index 25825a74d..f1326efe7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEmpowerer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEmpowerer.java @@ -51,7 +51,7 @@ public class TileEntityEmpowerer extends TileEntityInventoryBase{ public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ List recipes = getRecipesForInput(this.slots.get(0)); if(!recipes.isEmpty()){ for(EmpowererRecipe recipe : recipes){ @@ -68,15 +68,15 @@ public class TileEntityEmpowerer extends TileEntityInventoryBase{ stand.decrStackSize(0, 1); } - AssetUtil.shootParticles(this.worldObj, stand.getPos().getX(), stand.getPos().getY()+0.45F, stand.getPos().getZ(), this.pos.getX(), this.pos.getY(), this.pos.getZ(), recipe.particleColor, 8, 0.5F, 1F); + AssetUtil.shootParticles(this.world, stand.getPos().getX(), stand.getPos().getY()+0.45F, stand.getPos().getZ(), this.pos.getX(), this.pos.getY(), this.pos.getZ(), recipe.particleColor, 8, 0.5F, 1F); } - if(this.processTime%5 == 0 && this.worldObj instanceof WorldServer){ - ((WorldServer)this.worldObj).spawnParticle(EnumParticleTypes.FIREWORKS_SPARK, false, this.pos.getX()+0.5, this.pos.getY()+1.1, this.pos.getZ()+0.5, 3, 0, 0, 0, 0.1D); + if(this.processTime%5 == 0 && this.world instanceof WorldServer){ + ((WorldServer)this.world).spawnParticle(EnumParticleTypes.FIREWORKS_SPARK, false, this.pos.getX()+0.5, this.pos.getY()+1.1, this.pos.getZ()+0.5, 3, 0, 0, 0, 0.1D); } if(done){ - ((WorldServer)this.worldObj).spawnParticle(EnumParticleTypes.END_ROD, false, this.pos.getX()+0.5, this.pos.getY()+1.1, this.pos.getZ()+0.5, 300, 0, 0, 0, 0.25D); + ((WorldServer)this.world).spawnParticle(EnumParticleTypes.END_ROD, false, this.pos.getX()+0.5, this.pos.getY()+1.1, this.pos.getZ()+0.5, 300, 0, 0, 0, 0.25D); this.slots.set(0, recipe.output.copy()); this.markDirty(); @@ -99,7 +99,7 @@ public class TileEntityEmpowerer extends TileEntityInventoryBase{ for(int i = 0; i < EnumFacing.HORIZONTALS.length; i++){ EnumFacing facing = EnumFacing.HORIZONTALS[i]; BlockPos offset = this.pos.offset(facing, 3); - TileEntity tile = this.worldObj.getTileEntity(offset); + TileEntity tile = this.world.getTileEntity(offset); if(tile instanceof TileEntityDisplayStand){ TileEntityDisplayStand stand = (TileEntityDisplayStand)tile; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java index b6eb5f589..1e8c5af83 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnergizer.java @@ -47,7 +47,7 @@ public class TileEntityEnergizer extends TileEntityInventoryBase{ @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(StackUtil.isValid(this.slots.get(0)) && !StackUtil.isValid(this.slots.get(1))){ if(this.storage.getEnergyStored() > 0){ int received = 0; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java index 2fec331b2..679245a40 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java @@ -47,7 +47,7 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements ISha @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(StackUtil.isValid(this.slots.get(0)) && !StackUtil.isValid(this.slots.get(1))){ if(this.storage.getEnergyStored() < this.storage.getMaxEnergyStored()){ int extracted = 0; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java index da703ccf4..1138c9f60 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java @@ -47,6 +47,20 @@ public class TileEntityFarmer extends TileEntityInventoryBase{ super(12, "farmer"); } + public static IPlantable getPlantableFromStack(ItemStack stack){ + Item item = stack.getItem(); + if(item instanceof IPlantable){ + return (IPlantable)item; + } + else if(item instanceof ItemBlock){ + Block block = Block.getBlockFromItem(item); + if(block instanceof IPlantable){ + return (IPlantable)block; + } + } + return null; + } + @Override public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ super.writeSyncableNBT(compound, type); @@ -72,7 +86,7 @@ public class TileEntityFarmer extends TileEntityInventoryBase{ @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(!this.isRedstonePowered){ if(this.waitTime > 0){ this.waitTime--; @@ -83,13 +97,13 @@ public class TileEntityFarmer extends TileEntityInventoryBase{ int radiusAroundCenter = 4; - IBlockState state = this.worldObj.getBlockState(this.pos); + IBlockState state = this.world.getBlockState(this.pos); int meta = state.getBlock().getMetaFromState(state); EnumFacing side = meta == 0 ? EnumFacing.NORTH : (meta == 1 ? EnumFacing.SOUTH : (meta == 2 ? EnumFacing.WEST : EnumFacing.EAST)); BlockPos center = this.pos.offset(side, radiusAroundCenter+1); BlockPos plant = center.add(this.checkX, 0, this.checkY); - IBlockState plantState = this.worldObj.getBlockState(plant); + IBlockState plantState = this.world.getBlockState(plant); Block plantBlock = plantState.getBlock(); if(plantBlock instanceof BlockCrops){ @@ -97,7 +111,7 @@ public class TileEntityFarmer extends TileEntityInventoryBase{ List seeds = new ArrayList(); List other = new ArrayList(); - List drops = plantBlock.getDrops(this.worldObj, plant, plantState, 0); + List drops = plantBlock.getDrops(this.world, plant, plantState, 0); for(ItemStack stack : drops){ if(getPlantableFromStack(stack) != null){ seeds.add(stack); @@ -120,26 +134,26 @@ public class TileEntityFarmer extends TileEntityInventoryBase{ WorldUtil.addToInventory(this, 0, 6, seeds, EnumFacing.UP, true, true); } - this.worldObj.playEvent(2001, plant, Block.getStateId(plantState)); - this.worldObj.setBlockToAir(plant); + this.world.playEvent(2001, plant, Block.getStateId(plantState)); + this.world.setBlockToAir(plant); didSomething = true; } } } - else if(plantBlock.isReplaceable(this.worldObj, plant)){ + else if(plantBlock.isReplaceable(this.world, plant)){ BlockPos farmland = plant.down(); - IBlockState farmlandState = this.worldObj.getBlockState(farmland); + IBlockState farmlandState = this.world.getBlockState(farmland); Block farmlandBlock = farmlandState.getBlock(); IBlockState toPlant = this.getFirstPlantablePlantFromSlots(plant); if(toPlant != null){ - this.worldObj.setBlockState(plant, toPlant, 3); + this.world.setBlockState(plant, toPlant, 3); didSomething = true; } else if(farmlandBlock instanceof BlockDirt || farmlandBlock instanceof BlockGrass){ - this.worldObj.setBlockState(farmland, Blocks.FARMLAND.getDefaultState(), 2); - this.worldObj.setBlockToAir(plant); - this.worldObj.playSound(null, farmland, SoundEvents.ITEM_HOE_TILL, SoundCategory.BLOCKS, 1.0F, 1.0F); + this.world.setBlockState(farmland, Blocks.FARMLAND.getDefaultState(), 2); + this.world.setBlockToAir(plant); + this.world.playSound(null, farmland, SoundEvents.ITEM_HOE_TILL, SoundCategory.BLOCKS, 1.0F, 1.0F); didSomething = true; } } @@ -176,8 +190,8 @@ public class TileEntityFarmer extends TileEntityInventoryBase{ if(StackUtil.isValid(stack)){ IPlantable plantable = getPlantableFromStack(stack); if(plantable != null){ - IBlockState state = plantable.getPlant(this.worldObj, pos); - if(state != null && state.getBlock() instanceof BlockCrops && state.getBlock().canPlaceBlockAt(this.worldObj, pos)){ + IBlockState state = plantable.getPlant(this.world, pos); + if(state != null && state.getBlock() instanceof BlockCrops && state.getBlock().canPlaceBlockAt(this.world, pos)){ this.decrStackSize(i, 1); return state; } @@ -187,20 +201,6 @@ public class TileEntityFarmer extends TileEntityInventoryBase{ return null; } - public static IPlantable getPlantableFromStack(ItemStack stack){ - Item item = stack.getItem(); - if(item instanceof IPlantable){ - return (IPlantable)item; - } - else if(item instanceof ItemBlock){ - Block block = Block.getBlockFromItem(item); - if(block instanceof IPlantable){ - return (IPlantable)block; - } - } - return null; - } - @Override public boolean isItemValidForSlot(int i, ItemStack stack){ return i < 6 && StackUtil.isValid(stack) && stack.getItem() instanceof IPlantable; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java index 0e54eba3a..3425e0b45 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFeeder.java @@ -64,10 +64,10 @@ public class TileEntityFeeder extends TileEntityInventoryBase{ @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ boolean theFlag = this.currentTimer > 0; int range = 5; - List animals = this.worldObj.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(this.pos.getX()-range, this.pos.getY()-range, this.pos.getZ()-range, this.pos.getX()+range, this.pos.getY()+range, this.pos.getZ()+range)); + List animals = this.world.getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(this.pos.getX()-range, this.pos.getY()-range, this.pos.getZ()-range, this.pos.getX()+range, this.pos.getY()+range, this.pos.getZ()+range)); if(animals != null){ this.currentAnimalAmount = animals.size(); if(this.currentAnimalAmount >= 2){ @@ -75,7 +75,7 @@ public class TileEntityFeeder extends TileEntityInventoryBase{ if(this.currentTimer >= TIME){ this.currentTimer = 0; if(StackUtil.isValid(this.slots.get(0))){ - EntityAnimal randomAnimal = animals.get(this.worldObj.rand.nextInt(this.currentAnimalAmount)); + EntityAnimal randomAnimal = animals.get(this.world.rand.nextInt(this.currentAnimalAmount)); if(!randomAnimal.isInLove() && randomAnimal.getGrowingAge() == 0 && (randomAnimal.isBreedingItem(this.slots.get(0)) || this.canHorseBeFed(randomAnimal))){ this.feedAnimal(randomAnimal); @@ -127,10 +127,10 @@ public class TileEntityFeeder extends TileEntityInventoryBase{ public void feedAnimal(EntityAnimal animal){ animal.setInLove(null); for(int i = 0; i < 7; i++){ - double d = animal.worldObj.rand.nextGaussian()*0.02D; - double d1 = animal.worldObj.rand.nextGaussian()*0.02D; - double d2 = animal.worldObj.rand.nextGaussian()*0.02D; - this.worldObj.spawnParticle(EnumParticleTypes.HEART, (animal.posX+(double)(animal.worldObj.rand.nextFloat()*animal.width*2.0F))-animal.width, animal.posY+0.5D+(double)(animal.worldObj.rand.nextFloat()*animal.height), (animal.posZ+(double)(animal.worldObj.rand.nextFloat()*animal.width*2.0F))-animal.width, d, d1, d2); + double d = animal.world.rand.nextGaussian()*0.02D; + double d1 = animal.world.rand.nextGaussian()*0.02D; + double d2 = animal.world.rand.nextGaussian()*0.02D; + this.world.spawnParticle(EnumParticleTypes.HEART, (animal.posX+(double)(animal.world.rand.nextFloat()*animal.width*2.0F))-animal.width, animal.posY+0.5D+(double)(animal.world.rand.nextFloat()*animal.height), (animal.posZ+(double)(animal.world.rand.nextFloat()*animal.width*2.0F))-animal.width, d, d1, d2); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java index 6090d5a26..ebbb76dba 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java @@ -14,9 +14,9 @@ import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; -import net.minecraftforge.fluids.*; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.IFluidTankProperties; import net.minecraftforge.fluids.capability.templates.FluidHandlerFluidMap; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -71,7 +71,7 @@ public class TileEntityFermentingBarrel extends TileEntityBase implements IShari @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ int produce = 80; if(this.canolaTank.getFluidAmount() >= produce && produce <= this.oilTank.getCapacity()-this.oilTank.getFluidAmount()){ this.currentProcessTime++; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java index b09a3ec93..6b929d627 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFireworkBox.java @@ -38,23 +38,23 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisp for(int i = 0; i < amount; i++){ ItemStack firework = this.makeFirework(); - double newX = x+MathHelper.getRandomDoubleInRange(this.worldObj.rand, 0, range*2)-range; - double newZ = z+MathHelper.getRandomDoubleInRange(this.worldObj.rand, 0, range*2)-range; + double newX = x+MathHelper.nextDouble(this.world.rand, 0, range*2)-range; + double newZ = z+MathHelper.nextDouble(this.world.rand, 0, range*2)-range; EntityFireworkRocket rocket = new EntityFireworkRocket(world, newX, y+0.5, newZ, firework); - world.spawnEntityInWorld(rocket); + world.spawnEntity(rocket); } } private ItemStack makeFirework(){ NBTTagList list = new NBTTagList(); - int chargesAmount = this.worldObj.rand.nextInt(2)+1; + int chargesAmount = this.world.rand.nextInt(2)+1; for(int i = 0; i < chargesAmount; i++){ list.appendTag(this.makeFireworkCharge()); } NBTTagCompound compound1 = new NBTTagCompound(); compound1.setTag("Explosions", list); - compound1.setByte("Flight", (byte)(this.worldObj.rand.nextInt(3)+1)); + compound1.setByte("Flight", (byte)(this.world.rand.nextInt(3)+1)); NBTTagCompound compound = new NBTTagCompound(); compound.setTag("Fireworks", compound1); @@ -68,8 +68,8 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisp private NBTTagCompound makeFireworkCharge(){ NBTTagCompound compound = new NBTTagCompound(); - if(this.worldObj.rand.nextFloat() >= 0.65F){ - if(this.worldObj.rand.nextFloat() >= 0.5F){ + if(this.world.rand.nextFloat() >= 0.65F){ + if(this.world.rand.nextFloat() >= 0.5F){ compound.setBoolean("Flicker", true); } else{ @@ -77,13 +77,13 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisp } } - int[] colors = new int[MathHelper.getRandomIntegerInRange(this.worldObj.rand, 1, 6)]; + int[] colors = new int[MathHelper.getInt(this.world.rand, 1, 6)]; for(int i = 0; i < colors.length; i++){ - colors[i] = ItemDye.DYE_COLORS[this.worldObj.rand.nextInt(ItemDye.DYE_COLORS.length)]; + colors[i] = ItemDye.DYE_COLORS[this.world.rand.nextInt(ItemDye.DYE_COLORS.length)]; } compound.setIntArray("Colors", colors); - compound.setByte("Type", (byte)this.worldObj.rand.nextInt(5)); + compound.setByte("Type", (byte)this.world.rand.nextInt(5)); return compound; } @@ -104,7 +104,7 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisp public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(!this.isRedstonePowered && !this.isPulseMode){ if(this.timeUntilNextFirework > 0){ this.timeUntilNextFirework--; @@ -125,7 +125,7 @@ public class TileEntityFireworkBox extends TileEntityBase implements IEnergyDisp private void doWork(){ if(this.storage.getEnergyStored() >= USE_PER_SHOT){ - this.spawnFireworks(this.worldObj, this.pos.getX(), this.pos.getY(), this.pos.getZ()); + this.spawnFireworks(this.world, this.pos.getX(), this.pos.getY(), this.pos.getZ()); this.storage.extractEnergyInternal(USE_PER_SHOT, false); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java index fad7e5c1a..ec8661dba 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFishingNet.java @@ -52,27 +52,27 @@ public class TileEntityFishingNet extends TileEntityBase{ @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(!this.isRedstonePowered){ - if(this.worldObj.getBlockState(this.pos.down()).getMaterial() == Material.WATER){ + if(this.world.getBlockState(this.pos.down()).getMaterial() == Material.WATER){ if(this.timeUntilNextDrop > 0){ this.timeUntilNextDrop--; if(this.timeUntilNextDrop <= 0){ - LootContext.Builder builder = new LootContext.Builder((WorldServer)this.worldObj); - List fishables = this.worldObj.getLootTableManager().getLootTableFromLocation(LootTableList.GAMEPLAY_FISHING).generateLootForPools(this.worldObj.rand, builder.build()); + LootContext.Builder builder = new LootContext.Builder((WorldServer)this.world); + List fishables = this.world.getLootTableManager().getLootTableFromLocation(LootTableList.GAMEPLAY_FISHING).generateLootForPools(this.world.rand, builder.build()); for(ItemStack fishable : fishables){ ItemStack leftover = this.storeInContainer(fishable); if(StackUtil.isValid(leftover)){ - EntityItem item = new EntityItem(this.worldObj, this.pos.getX()+0.5, this.pos.getY()+0.5, this.pos.getZ()+0.5, leftover.copy()); + EntityItem item = new EntityItem(this.world, this.pos.getX()+0.5, this.pos.getY()+0.5, this.pos.getZ()+0.5, leftover.copy()); item.lifespan = 2000; - this.worldObj.spawnEntityInWorld(item); + this.world.spawnEntity(item); } } } } else{ int time = 15000; - this.timeUntilNextDrop = time+this.worldObj.rand.nextInt(time/2); + this.timeUntilNextDrop = time+this.world.rand.nextInt(time/2); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java index 95040645b..b5d664de7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java @@ -23,11 +23,11 @@ import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.world.WorldServer; -import net.minecraftforge.fluids.*; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.IFluidTankProperties; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; public class TileEntityFluidCollector extends TileEntityBase implements ISharingFluidHandler{ @@ -66,54 +66,54 @@ public class TileEntityFluidCollector extends TileEntityBase implements ISharing } private void doWork(){ - IBlockState state = this.worldObj.getBlockState(this.pos); + IBlockState state = this.world.getBlockState(this.pos); Block block = state.getBlock(); EnumFacing sideToManipulate = WorldUtil.getDirectionByPistonRotation(block.getMetaFromState(state)); BlockPos coordsBlock = this.pos.offset(sideToManipulate); - IBlockState stateToBreak = this.worldObj.getBlockState(coordsBlock); + IBlockState stateToBreak = this.world.getBlockState(coordsBlock); Block blockToBreak = stateToBreak.getBlock(); if(!this.isPlacer && blockToBreak != null && blockToBreak.getMetaFromState(stateToBreak) == 0 && Util.BUCKET <= this.tank.getCapacity()-this.tank.getFluidAmount()){ if(blockToBreak instanceof IFluidBlock && ((IFluidBlock)blockToBreak).getFluid() != null){ if(this.tank.fillInternal(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), Util.BUCKET), false) >= Util.BUCKET){ this.tank.fillInternal(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), Util.BUCKET), true); - this.worldObj.setBlockToAir(coordsBlock); + this.world.setBlockToAir(coordsBlock); } } else if(blockToBreak == Blocks.LAVA || blockToBreak == Blocks.FLOWING_LAVA){ if(this.tank.fillInternal(new FluidStack(FluidRegistry.LAVA, Util.BUCKET), false) >= Util.BUCKET){ this.tank.fillInternal(new FluidStack(FluidRegistry.LAVA, Util.BUCKET), true); - this.worldObj.setBlockToAir(coordsBlock); + this.world.setBlockToAir(coordsBlock); } } else if(blockToBreak == Blocks.WATER || blockToBreak == Blocks.FLOWING_WATER){ if(this.tank.fillInternal(new FluidStack(FluidRegistry.WATER, Util.BUCKET), false) >= Util.BUCKET){ this.tank.fillInternal(new FluidStack(FluidRegistry.WATER, Util.BUCKET), true); - this.worldObj.setBlockToAir(coordsBlock); + this.world.setBlockToAir(coordsBlock); } } } - else if(this.isPlacer && blockToBreak.isReplaceable(this.worldObj, coordsBlock)){ + else if(this.isPlacer && blockToBreak.isReplaceable(this.world, coordsBlock)){ if(this.tank.getFluidAmount() >= Util.BUCKET){ FluidStack stack = this.tank.getFluid(); Block fluid = stack.getFluid().getBlock(); if(fluid != null){ BlockPos offsetPos = this.pos.offset(sideToManipulate); - boolean placeable = !(blockToBreak instanceof BlockLiquid) && !(blockToBreak instanceof IFluidBlock) && blockToBreak.isReplaceable(this.worldObj, offsetPos); + boolean placeable = !(blockToBreak instanceof BlockLiquid) && !(blockToBreak instanceof IFluidBlock) && blockToBreak.isReplaceable(this.world, offsetPos); if(placeable){ this.tank.drainInternal(Util.BUCKET, true); - if(this.worldObj.provider.doesWaterVaporize() && stack.getFluid().doesVaporize(stack)){ - this.worldObj.playSound(null, offsetPos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F+(this.worldObj.rand.nextFloat()-this.worldObj.rand.nextFloat())*0.8F); + if(this.world.provider.doesWaterVaporize() && stack.getFluid().doesVaporize(stack)){ + this.world.playSound(null, offsetPos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F+(this.world.rand.nextFloat()-this.world.rand.nextFloat())*0.8F); - if(this.worldObj instanceof WorldServer){ + if(this.world instanceof WorldServer){ for(int l = 0; l < 8; ++l){ - ((WorldServer)this.worldObj).spawnParticle(EnumParticleTypes.SMOKE_LARGE, false, (double)offsetPos.getX()+Math.random(), (double)offsetPos.getY()+Math.random(), (double)offsetPos.getZ()+Math.random(), 1, 0.0D, 0.0D, 0.0D, 0); + ((WorldServer)this.world).spawnParticle(EnumParticleTypes.SMOKE_LARGE, false, (double)offsetPos.getX()+Math.random(), (double)offsetPos.getY()+Math.random(), (double)offsetPos.getZ()+Math.random(), 1, 0.0D, 0.0D, 0.0D, 0); } } } else{ - this.worldObj.setBlockState(offsetPos, fluid.getDefaultState(), 3); + this.world.setBlockState(offsetPos, fluid.getDefaultState(), 3); } } } @@ -147,7 +147,7 @@ public class TileEntityFluidCollector extends TileEntityBase implements ISharing @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(!this.isRedstonePowered && !this.isPulseMode){ if(this.currentTime > 0){ this.currentTime--; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java index d080e9fea..7e90c01d1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceDouble.java @@ -13,8 +13,6 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; @@ -101,7 +99,7 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(this.isAutoSplit){ autoSplit(this.slots, SLOT_INPUT_1, SLOT_INPUT_2); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java index ba7bcaab1..9babcacd4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java @@ -41,9 +41,9 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements ISharingEn @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ int power = this.getPowerToGenerate(PRODUCE); - if(this.worldObj.isDaytime() && power > 0){ + if(this.world.isDaytime() && power > 0){ if(power <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){ this.storage.receiveEnergyInternal(power, false); this.markDirty(); @@ -57,15 +57,15 @@ public class TileEntityFurnaceSolar extends TileEntityBase implements ISharingEn } public int getPowerToGenerate(int power){ - for(int y = 1; y <= this.worldObj.getHeight()-this.pos.getY(); y++){ + for(int y = 1; y <= this.world.getHeight()-this.pos.getY(); y++){ if(power > 0){ BlockPos pos = this.pos.up(y); - IBlockState state = this.worldObj.getBlockState(pos); + IBlockState state = this.world.getBlockState(pos); if(state.getMaterial().isOpaque()){ power = 0; } - else if(!state.getBlock().isAir(state, this.worldObj, pos)){ + else if(!state.getBlock().isAir(state, this.world, pos)){ power--; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChest.java index 0059bb127..b182115a6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGiantChest.java @@ -86,7 +86,7 @@ public class TileEntityGiantChest extends TileEntityInventoryBase implements IBu type = GuiHandler.GuiTypes.GIANT_CHEST_PAGE_3; } - player.openGui(ActuallyAdditions.instance, type.ordinal(), this.worldObj, this.pos.getX(), this.pos.getY(), this.pos.getZ()); + player.openGui(ActuallyAdditions.instance, type.ordinal(), this.world, this.pos.getX(), this.pos.getY(), this.pos.getZ()); } } @@ -96,11 +96,11 @@ public class TileEntityGiantChest extends TileEntityInventoryBase implements IBu } public void fillWithLoot(EntityPlayer player){ - if(this.lootTable != null && !this.worldObj.isRemote && this.worldObj instanceof WorldServer){ - LootTable table = this.worldObj.getLootTableManager().getLootTableFromLocation(this.lootTable); + if(this.lootTable != null && !this.world.isRemote && this.world instanceof WorldServer){ + LootTable table = this.world.getLootTableManager().getLootTableFromLocation(this.lootTable); this.lootTable = null; - LootContext.Builder builder = new LootContext.Builder((WorldServer)this.worldObj); + LootContext.Builder builder = new LootContext.Builder((WorldServer)this.world); if(player != null){ builder.withLuck(player.getLuck()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java index 0d190f033..f0f570e2b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGreenhouseGlass.java @@ -45,28 +45,28 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{ @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ - if(this.worldObj.canBlockSeeSky(this.getPos()) && this.worldObj.isDaytime()){ + if(!this.world.isRemote){ + if(this.world.canBlockSeeSky(this.getPos()) && this.world.isDaytime()){ if(this.timeUntilNextFert > 0){ this.timeUntilNextFert--; if(this.timeUntilNextFert <= 0){ BlockPos blockToFert = this.blockToFertilize(); if(blockToFert != null){ - IBlockState state = this.worldObj.getBlockState(blockToFert); + IBlockState state = this.world.getBlockState(blockToFert); Block block = state.getBlock(); int metaBefore = block.getMetaFromState(state); - block.updateTick(this.worldObj, blockToFert, this.worldObj.getBlockState(blockToFert), this.worldObj.rand); + block.updateTick(this.world, blockToFert, this.world.getBlockState(blockToFert), this.world.rand); - IBlockState newState = this.worldObj.getBlockState(blockToFert); + IBlockState newState = this.world.getBlockState(blockToFert); if(newState.getBlock().getMetaFromState(newState) != metaBefore){ - this.worldObj.playEvent(2005, blockToFert, 0); + this.world.playEvent(2005, blockToFert, 0); } } } } else{ int time = 100; - this.timeUntilNextFert = time+this.worldObj.rand.nextInt(time); + this.timeUntilNextFert = time+this.world.rand.nextInt(time); } } } @@ -75,8 +75,8 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{ public BlockPos blockToFertilize(){ for(int i = this.pos.getY()-1; i > 0; i--){ BlockPos offset = new BlockPos(this.pos.getX(), i, this.pos.getZ()); - Block block = this.worldObj.getBlockState(offset).getBlock(); - if(block != null && !this.worldObj.isAirBlock(offset)){ + Block block = this.world.getBlockState(offset).getBlock(); + if(block != null && !this.world.isAirBlock(offset)){ if((block instanceof IGrowable || block instanceof IPlantable) && !(block instanceof BlockGrass)){ return offset; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java index ba7a6c287..d8af63ad7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityGrinder.java @@ -16,8 +16,6 @@ import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; import de.ellpeck.actuallyadditions.mod.recipe.CrusherRecipeRegistry; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.Util; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -80,7 +78,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(this.isDouble && this.isAutoSplit){ TileEntityFurnaceDouble.autoSplit(this.slots, SLOT_INPUT_1, SLOT_INPUT_2); } @@ -139,7 +137,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto } if(shouldPlaySound){ - this.worldObj.playSound(null, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), SoundHandler.crusher, SoundCategory.BLOCKS, 0.15F, 1.0F); + this.world.playSound(null, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), SoundHandler.crusher, SoundCategory.BLOCKS, 0.15F, 1.0F); } } } @@ -191,7 +189,7 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IButto if(outputTwo.getItemDamage() == Util.WILDCARD){ outputTwo.setItemDamage(0); } - int rand = this.worldObj.rand.nextInt(100)+1; + int rand = this.world.rand.nextInt(100)+1; if(rand <= CrusherRecipeRegistry.getOutputTwoChance(this.slots.get(theInput))){ if(!StackUtil.isValid(this.slots.get(theSecondOutput))){ this.slots.set(theSecondOutput, outputTwo.copy()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java index a0a196f54..75ebd2d27 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityHeatCollector.java @@ -47,14 +47,14 @@ public class TileEntityHeatCollector extends TileEntityBase implements ISharingE @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ ArrayList blocksAround = new ArrayList(); if(ENERGY_PRODUCE <= this.storage.getMaxEnergyStored()-this.storage.getEnergyStored()){ for(int i = 1; i <= 5; i++){ BlockPos coords = this.pos.offset(WorldUtil.getDirectionBySidesInOrder(i)); - IBlockState state = this.worldObj.getBlockState(coords); + IBlockState state = this.world.getBlockState(coords); Block block = state.getBlock(); - if(block != null && block.getMaterial(this.worldObj.getBlockState(coords)) == Material.LAVA && block.getMetaFromState(state) == 0){ + if(block != null && block.getMaterial(this.world.getBlockState(coords)) == Material.LAVA && block.getMetaFromState(state) == 0){ blocksAround.add(i); } } @@ -63,9 +63,9 @@ public class TileEntityHeatCollector extends TileEntityBase implements ISharingE this.storage.receiveEnergyInternal(ENERGY_PRODUCE, false); this.markDirty(); - if(this.worldObj.rand.nextInt(10000) == 0){ - int randomSide = blocksAround.get(this.worldObj.rand.nextInt(blocksAround.size())); - this.worldObj.setBlockToAir(this.pos.offset(WorldUtil.getDirectionBySidesInOrder(randomSide))); + if(this.world.rand.nextInt(10000) == 0){ + int randomSide = blocksAround.get(this.world.rand.nextInt(blocksAround.size())); + this.world.setBlockToAir(this.pos.offset(WorldUtil.getDirectionBySidesInOrder(randomSide))); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java index 03c9557a0..24e2cb3c7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java @@ -142,7 +142,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt public void saveDataOnChangeOrWorldStart(){ if(this.sideToPull != -1){ EnumFacing side = WorldUtil.getDirectionBySidesInOrder(this.sideToPull); - this.placeToPull = this.worldObj.getTileEntity(this.pos.offset(side)); + this.placeToPull = this.world.getTileEntity(this.pos.offset(side)); if(this.slotToPullEnd <= 0 && this.placeToPull != null){ if(this.placeToPull instanceof IInventory){ @@ -161,7 +161,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt if(this.sideToPut != -1){ EnumFacing side = WorldUtil.getDirectionBySidesInOrder(this.sideToPut); - this.placeToPut = this.worldObj.getTileEntity(this.pos.offset(side)); + this.placeToPut = this.world.getTileEntity(this.pos.offset(side)); if(this.slotToPutEnd <= 0 && this.placeToPut != null){ if(this.placeToPut instanceof IInventory){ @@ -260,7 +260,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ //Is Block not powered by Redstone? if(!this.isRedstonePowered){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index 8a73ae278..373942dab 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -21,7 +21,6 @@ import net.minecraft.util.NonNullList; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.wrapper.SidedInvWrapper; -import java.util.List; public abstract class TileEntityInventoryBase extends TileEntityBase implements ISidedInventory{ @@ -110,7 +109,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } @Override - public boolean isUseableByPlayer(EntityPlayer player){ + public boolean isUsableByPlayer(EntityPlayer player){ return this.canPlayerUse(player); } @@ -217,7 +216,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } @Override - public boolean func_191420_l(){ + public boolean isEmpty(){ return StackUtil.isIInvEmpty(this.slots); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java index 948edfd19..44a6888d9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemRepairer.java @@ -76,7 +76,7 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase{ @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ ItemStack input = this.slots.get(SLOT_INPUT); if(!StackUtil.isValid(this.slots.get(SLOT_OUTPUT)) && canBeRepaired(input)){ if(input.getItemDamage() <= 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java index 80eba5e2e..40e40b5ec 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java @@ -84,7 +84,7 @@ public class TileEntityItemViewer extends TileEntityInventoryBase{ private void queryAndSaveData(){ if(this.connectedRelay != null){ - Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.connectedRelay.getPos(), this.worldObj); + Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.connectedRelay.getPos(), this.world); if(network != null){ if(this.oldNetwork != network || this.lastNetworkChangeAmount != network.changeAmount){ this.clearInfos(); @@ -139,11 +139,11 @@ public class TileEntityItemViewer extends TileEntityInventoryBase{ @Override public void saveDataOnChangeOrWorldStart(){ TileEntityLaserRelayItem tileFound = null; - if(this.worldObj != null){ //Why is that even possible..? + if(this.world != null){ //Why is that even possible..? for(int i = 0; i <= 5; i++){ EnumFacing side = WorldUtil.getDirectionBySidesInOrder(i); BlockPos pos = this.getPos().offset(side); - TileEntity tile = this.worldObj.getTileEntity(pos); + TileEntity tile = this.world.getTileEntity(pos); if(tile instanceof TileEntityLaserRelayItem){ if(tileFound != null){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java index 5334abded..2a7e1ab01 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java @@ -39,14 +39,14 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{ super.readSyncableNBT(compound, type); if(type == NBTType.SYNC){ - ActuallyAdditionsAPI.connectionHandler.removeRelayFromNetwork(this.pos, this.worldObj); + ActuallyAdditionsAPI.connectionHandler.removeRelayFromNetwork(this.pos, this.world); NBTTagList list = compound.getTagList("Connections", 10); if(!list.hasNoTags()){ for(int i = 0; i < list.tagCount(); i++){ ConnectionPair pair = new ConnectionPair(); pair.readFromNBT(list.getCompoundTagAt(i)); - ActuallyAdditionsAPI.connectionHandler.addConnection(pair.getPositions()[0], pair.getPositions()[1], this.type, this.worldObj, pair.doesSuppressRender()); + ActuallyAdditionsAPI.connectionHandler.addConnection(pair.getPositions()[0], pair.getPositions()[1], this.type, this.world, pair.doesSuppressRender()); } } } @@ -59,7 +59,7 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{ if(type == NBTType.SYNC){ NBTTagList list = new NBTTagList(); - ConcurrentSet connections = ActuallyAdditionsAPI.connectionHandler.getConnectionsFor(this.pos, this.worldObj); + ConcurrentSet connections = ActuallyAdditionsAPI.connectionHandler.getConnectionsFor(this.pos, this.world); if(connections != null && !connections.isEmpty()){ for(IConnectionPair pair : connections){ NBTTagCompound tag = new NBTTagCompound(); @@ -75,26 +75,26 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{ /*@Override public void updateEntity(){ super.updateEntity(); - if(this.worldObj.isRemote){ + if(this.world.isRemote){ this.renderParticles(); } } @SideOnly(Side.CLIENT) public void renderParticles(){ - if(this.worldObj.rand.nextInt(8) == 0){ - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if(this.world.rand.nextInt(8) == 0){ + EntityPlayer player = Minecraft.getMinecraft().player; if(player != null){ PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); WrenchMode mode = WrenchMode.values()[data.theCompound.getInteger("LaserWrenchMode")]; if(mode != WrenchMode.NO_PARTICLES){ ItemStack stack = player.getHeldItemMainhand(); if(mode == WrenchMode.ALWAYS_PARTICLES || (StackUtil.isValid(stack) && stack.getItem() instanceof ItemLaserWrench)){ - Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.pos, this.worldObj); + Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.pos, this.world); if(network != null){ for(IConnectionPair aPair : network.connections){ if(!aPair.doesSuppressRender() && aPair.contains(this.pos) && this.pos.equals(aPair.getPositions()[0])){ - AssetUtil.renderParticlesFromAToB(aPair.getPositions()[0].getX(), aPair.getPositions()[0].getY(), aPair.getPositions()[0].getZ(), aPair.getPositions()[1].getX(), aPair.getPositions()[1].getY(), aPair.getPositions()[1].getZ(), this.worldObj.rand.nextInt(3)+1, 0.8F, this.type == LaserType.ITEM ? COLOR_ITEM : (this.type == LaserType.FLUID ? COLOR_FLUIDS : COLOR), 1F); + AssetUtil.renderParticlesFromAToB(aPair.getPositions()[0].getX(), aPair.getPositions()[0].getY(), aPair.getPositions()[0].getZ(), aPair.getPositions()[1].getX(), aPair.getPositions()[1].getY(), aPair.getPositions()[1].getZ(), this.world.rand.nextInt(3)+1, 0.8F, this.type == LaserType.ITEM ? COLOR_ITEM : (this.type == LaserType.FLUID ? COLOR_FLUIDS : COLOR), 1F); } } } @@ -109,16 +109,16 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{ super.invalidate(); //This is because Minecraft randomly invalidates tiles on world join and then validates them again //We need to compensate for this so that connections don't get broken randomly - this.tempConnectionStorage = ActuallyAdditionsAPI.connectionHandler.getConnectionsFor(this.pos, this.worldObj); + this.tempConnectionStorage = ActuallyAdditionsAPI.connectionHandler.getConnectionsFor(this.pos, this.world); - ActuallyAdditionsAPI.connectionHandler.removeRelayFromNetwork(this.pos, this.worldObj); + ActuallyAdditionsAPI.connectionHandler.removeRelayFromNetwork(this.pos, this.world); } @Override public void validate(){ if(this.tempConnectionStorage != null){ for(IConnectionPair pair : this.tempConnectionStorage){ - ActuallyAdditionsAPI.connectionHandler.addConnection(pair.getPositions()[0], pair.getPositions()[1], pair.getType(), this.worldObj, pair.doesSuppressRender()); + ActuallyAdditionsAPI.connectionHandler.addConnection(pair.getPositions()[0], pair.getPositions()[1], pair.getType(), this.world, pair.doesSuppressRender()); } this.tempConnectionStorage = null; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java index 6ff8fc587..a2bc9230d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java @@ -24,6 +24,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraftforge.energy.CapabilityEnergy; import net.minecraftforge.energy.IEnergyStorage; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -84,7 +85,7 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay{ private int transmitEnergy(EnumFacing from, int maxTransmit, boolean simulate){ int transmitted = 0; if(maxTransmit > 0){ - Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.pos, this.worldObj); + Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.pos, this.world); if(network != null){ transmitted = this.transferEnergyToReceiverInNeed(from, network, maxTransmit, simulate); } @@ -110,7 +111,7 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay{ this.receiversAround.clear(); for(EnumFacing side : EnumFacing.values()){ BlockPos pos = this.getPos().offset(side); - TileEntity tile = this.worldObj.getTileEntity(pos); + TileEntity tile = this.world.getTileEntity(pos); if(tile != null && !(tile instanceof TileEntityLaserRelay)){ if((ActuallyAdditions.teslaLoaded && tile.hasCapability(TeslaUtil.teslaConsumer, side.getOpposite())) || tile.hasCapability(CapabilityEnergy.ENERGY, side.getOpposite())){ this.receiversAround.put(side, tile); @@ -143,7 +144,7 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay{ for(BlockPos relay : pair.getPositions()){ if(relay != null && !alreadyChecked.contains(relay)){ alreadyChecked.add(relay); - TileEntity relayTile = this.worldObj.getTileEntity(relay); + TileEntity relayTile = this.world.getTileEntity(relay); if(relayTile instanceof TileEntityLaserRelayEnergy){ TileEntityLaserRelayEnergy theRelay = (TileEntityLaserRelayEnergy)relayTile; int amount = theRelay.receiversAround.size(); @@ -219,7 +220,7 @@ public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay{ } private int calcDeduction(int theoreticalReceived, double highestLoss){ - return ConfigBoolValues.LASER_RELAY_LOSS.isEnabled() ? MathHelper.ceiling_double_int(theoreticalReceived*(highestLoss/100)) : 0; + return ConfigBoolValues.LASER_RELAY_LOSS.isEnabled() ? MathHelper.ceil(theoreticalReceived*(highestLoss/100)) : 0; } public int getEnergyCap(){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java index 8cf8f8f9f..dabda09b8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayFluids.java @@ -17,14 +17,11 @@ import de.ellpeck.actuallyadditions.api.laser.Network; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.fluids.capability.IFluidTankProperties; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -79,7 +76,7 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay implements this.receiversAround.clear(); for(EnumFacing side : EnumFacing.values()){ BlockPos pos = this.getPos().offset(side); - TileEntity tile = this.worldObj.getTileEntity(pos); + TileEntity tile = this.world.getTileEntity(pos); if(tile != null && !(tile instanceof TileEntityLaserRelay)){ if(tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side.getOpposite())){ this.receiversAround.put(side, tile); @@ -123,7 +120,7 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay implements private int transmitFluid(EnumFacing from, FluidStack stack, boolean doFill){ int transmitted = 0; if(stack != null){ - Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.pos, this.worldObj); + Network network = ActuallyAdditionsAPI.connectionHandler.getNetworkFor(this.pos, this.world); if(network != null){ transmitted = this.transferFluidToReceiverInNeed(from, network, stack, doFill); } @@ -143,7 +140,7 @@ public class TileEntityLaserRelayFluids extends TileEntityLaserRelay implements for(BlockPos relay : pair.getPositions()){ if(relay != null && !alreadyChecked.contains(relay)){ alreadyChecked.add(relay); - TileEntity relayTile = this.worldObj.getTileEntity(relay); + TileEntity relayTile = this.world.getTileEntity(relay); if(relayTile instanceof TileEntityLaserRelayFluids){ TileEntityLaserRelayFluids theRelay = (TileEntityLaserRelayFluids)relayTile; int amount = theRelay.receiversAround.size(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java index 386f37970..23fb70453 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java @@ -65,7 +65,7 @@ public class TileEntityLaserRelayItem extends TileEntityLaserRelay{ for(int i = 0; i <= 5; i++){ EnumFacing side = WorldUtil.getDirectionBySidesInOrder(i); BlockPos pos = this.getPos().offset(side); - TileEntity tile = this.worldObj.getTileEntity(pos); + TileEntity tile = this.world.getTileEntity(pos); if(tile != null && !(tile instanceof TileEntityItemViewer) && !(tile instanceof TileEntityLaserRelay)){ IItemHandler handler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite()); if(handler != null){ @@ -95,7 +95,7 @@ public class TileEntityLaserRelayItem extends TileEntityLaserRelay{ for(BlockPos relay : pair.getPositions()){ if(relay != null && !alreadyChecked.contains(relay)){ alreadyChecked.add(relay); - TileEntity aRelayTile = this.worldObj.getTileEntity(relay); + TileEntity aRelayTile = this.world.getTileEntity(relay); if(aRelayTile instanceof TileEntityLaserRelayItem){ TileEntityLaserRelayItem relayTile = (TileEntityLaserRelayItem)aRelayTile; GenericItemHandlerInfo info = new GenericItemHandlerInfo(relayTile); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java index 15b9efebd..aecaca6c3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java @@ -24,8 +24,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentTranslation; import net.minecraftforge.items.IItemHandler; -import java.util.Arrays; - public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem implements IButtonReactor{ public final IInventory filterInventory; @@ -62,7 +60,7 @@ public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem } @Override - public boolean isUseableByPlayer(EntityPlayer player){ + public boolean isUsableByPlayer(EntityPlayer player){ return this.tile.canPlayerUse(player); } @@ -108,7 +106,7 @@ public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem } @Override - public boolean func_191420_l(){ + public boolean isEmpty(){ return StackUtil.isIInvEmpty(this.tile.slots); } @@ -261,7 +259,7 @@ public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if((this.leftFilter.needsUpdateSend() || this.rightFilter.needsUpdateSend()) && this.sendUpdateWithInterval()){ this.leftFilter.updateLasts(); this.rightFilter.updateLasts(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java index 70c8061e1..9d5ca6ff3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLavaFactoryController.java @@ -56,12 +56,12 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(this.storage.getEnergyStored() >= ENERGY_USE && this.isMultiblock() == HAS_AIR){ this.currentWorkTime++; if(this.currentWorkTime >= 200){ this.currentWorkTime = 0; - this.worldObj.setBlockState(this.pos.up(), Blocks.LAVA.getDefaultState(), 2); + this.world.setBlockState(this.pos.up(), Blocks.LAVA.getDefaultState(), 2); this.storage.extractEnergyInternal(ENERGY_USE, false); } } @@ -84,14 +84,14 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I thisPos.add(0, 1, -1) }; - if(WorldUtil.hasBlocksInPlacesGiven(positions, InitBlocks.blockMisc, TheMiscBlocks.LAVA_FACTORY_CASE.ordinal(), this.worldObj)){ + if(WorldUtil.hasBlocksInPlacesGiven(positions, InitBlocks.blockMisc, TheMiscBlocks.LAVA_FACTORY_CASE.ordinal(), this.world)){ BlockPos pos = thisPos.up(); - IBlockState state = this.worldObj.getBlockState(pos); + IBlockState state = this.world.getBlockState(pos); Block block = state.getBlock(); if(block == Blocks.LAVA || block == Blocks.FLOWING_LAVA){ return HAS_LAVA; } - if(block == null || this.worldObj.isAirBlock(pos)){ + if(block == null || this.world.isAirBlock(pos)){ return HAS_AIR; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java index 4969a9f98..bc789992c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java @@ -48,7 +48,7 @@ public class TileEntityLeafGenerator extends TileEntityBase implements ISharingE @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(!this.isRedstonePowered){ if(this.nextUseCounter >= 5){ @@ -61,8 +61,8 @@ public class TileEntityLeafGenerator extends TileEntityBase implements ISharingE for(int reachZ = -RANGE; reachZ < RANGE+1; reachZ++){ for(int reachY = -RANGE; reachY < RANGE+1; reachY++){ BlockPos pos = this.pos.add(reachX, reachY, reachZ); - Block block = this.worldObj.getBlockState(pos).getBlock(); - if(block != null && block.isLeaves(this.worldObj.getBlockState(pos), this.worldObj, pos)){ + Block block = this.world.getBlockState(pos).getBlock(); + if(block != null && block.isLeaves(this.world.getBlockState(pos), this.world, pos)){ breakPositions.add(pos); } } @@ -73,13 +73,13 @@ public class TileEntityLeafGenerator extends TileEntityBase implements ISharingE Collections.shuffle(breakPositions); BlockPos theCoord = breakPositions.get(0); - this.worldObj.playEvent(2001, theCoord, Block.getStateId(this.worldObj.getBlockState(theCoord))); + this.world.playEvent(2001, theCoord, Block.getStateId(this.world.getBlockState(theCoord))); - this.worldObj.setBlockToAir(theCoord); + this.world.setBlockToAir(theCoord); this.storage.receiveEnergyInternal(ENERGY_PRODUCED, false); - AssetUtil.shootParticles(this.worldObj, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), theCoord.getX(), theCoord.getY(), theCoord.getZ(), new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F, 1F); + AssetUtil.shootParticles(this.world, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), theCoord.getX(), theCoord.getY(), theCoord.getZ(), new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F, 1F); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java index 2ea9fbea0..718cd9b5f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java @@ -69,7 +69,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(this.layerAt == -1){ this.layerAt = this.getPos().getY()-1; } @@ -77,7 +77,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR if(!this.isRedstonePowered && this.ticksElapsed%5 == 0){ if(this.layerAt > 0){ - if(this.mine(TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.worldObj, this.pos))){ + if(this.mine(TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.world, this.pos))){ this.layerAt--; } } @@ -97,18 +97,18 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR if(this.storage.getEnergyStored() >= actualUse){ BlockPos pos = new BlockPos(this.pos.getX()+anX, this.layerAt, this.pos.getZ()+aZ); - IBlockState state = this.worldObj.getBlockState(pos); + IBlockState state = this.world.getBlockState(pos); Block block = state.getBlock(); int meta = block.getMetaFromState(state); - if(!block.isAir(this.worldObj.getBlockState(pos), this.worldObj, pos)){ - if(block.getHarvestLevel(this.worldObj.getBlockState(pos)) <= ItemDrill.HARVEST_LEVEL && state.getBlockHardness(this.worldObj, pos) >= 0F && !(block instanceof BlockLiquid) && !(block instanceof IFluidBlock) && this.isMinable(block, meta)){ - List drops = block.getDrops(this.worldObj, pos, this.worldObj.getBlockState(pos), 0); - float chance = ForgeEventFactory.fireBlockHarvesting(drops, this.worldObj, pos, this.worldObj.getBlockState(pos), 0, 1, false, null); + if(!block.isAir(this.world.getBlockState(pos), this.world, pos)){ + if(block.getHarvestLevel(this.world.getBlockState(pos)) <= ItemDrill.HARVEST_LEVEL && state.getBlockHardness(this.world, pos) >= 0F && !(block instanceof BlockLiquid) && !(block instanceof IFluidBlock) && this.isMinable(block, meta)){ + List drops = block.getDrops(this.world, pos, this.world.getBlockState(pos), 0); + float chance = ForgeEventFactory.fireBlockHarvesting(drops, this.world, pos, this.world.getBlockState(pos), 0, 1, false, null); - if(this.worldObj.rand.nextFloat() <= chance){ + if(this.world.rand.nextFloat() <= chance){ if(WorldUtil.addToInventory(this, drops, false, true)){ - this.worldObj.playEvent(2001, pos, Block.getStateId(this.worldObj.getBlockState(pos))); - this.worldObj.setBlockToAir(pos); + this.world.playEvent(2001, pos, Block.getStateId(this.world.getBlockState(pos))); + this.world.setBlockToAir(pos); WorldUtil.addToInventory(this, drops, true, true); this.markDirty(); @@ -163,7 +163,7 @@ public class TileEntityMiner extends TileEntityInventoryBase implements IButtonR } private void shootParticles(int endX, int endY, int endZ){ - AssetUtil.shootParticles(this.worldObj, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F, 1F); + AssetUtil.shootParticles(this.world, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), endX, endY, endZ, new float[]{62F/255F, 163F/255F, 74F/255F}, 5, 1.0F, 1F); } private boolean isBlacklisted(Block block){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java index 33e52594d..7c29dd264 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java @@ -51,6 +51,17 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn super("oilGenerator"); } + private static OilGenRecipe getRecipeForFluid(String fluidName){ + if(fluidName != null){ + for(OilGenRecipe recipe : ActuallyAdditionsAPI.OIL_GENERATOR_RECIPES){ + if(recipe != null && fluidName.equals(recipe.fluidName)){ + return recipe; + } + } + } + return null; + } + @SideOnly(Side.CLIENT) public int getBurningScaled(int i){ return this.currentBurnTime*i/this.maxBurnTime; @@ -67,17 +78,6 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn return null; } - private static OilGenRecipe getRecipeForFluid(String fluidName){ - if(fluidName != null){ - for(OilGenRecipe recipe : ActuallyAdditionsAPI.OIL_GENERATOR_RECIPES){ - if(recipe != null && fluidName.equals(recipe.fluidName)){ - return recipe; - } - } - } - return null; - } - @Override public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ if(type != NBTType.SAVE_BLOCK){ @@ -105,7 +105,7 @@ public class TileEntityOilGenerator extends TileEntityBase implements ISharingEn @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ boolean flag = this.currentBurnTime > 0; if(this.currentBurnTime > 0 && this.currentEnergyProduce > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java index e50e53174..9cdabf2e8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java @@ -27,7 +27,7 @@ public class TileEntityPhantomEnergyface extends TileEntityPhantomface implement @Override public boolean isBoundThingInRange(){ if(super.isBoundThingInRange()){ - TileEntity tile = this.worldObj.getTileEntity(this.boundPosition); + TileEntity tile = this.world.getTileEntity(this.boundPosition); if(tile != null){ for(EnumFacing facing : EnumFacing.values()){ if(tile.hasCapability(CapabilityEnergy.ENERGY, facing)){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java index fb1bc05d3..c1f95f733 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java @@ -92,7 +92,7 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ public IInventory getInventory(){ if(this.boundPosition != null){ - TileEntity tile = this.worldObj.getTileEntity(this.boundPosition); + TileEntity tile = this.world.getTileEntity(this.boundPosition); if(tile instanceof IInventory){ return (IInventory)tile; } @@ -112,7 +112,7 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ return true; } else{ - TileEntity tile = this.worldObj.getTileEntity(this.getBoundPosition()); + TileEntity tile = this.world.getTileEntity(this.getBoundPosition()); if(tile != null){ for(EnumFacing facing : EnumFacing.values()){ if(tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, facing)){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java index 08537052e..96539efad 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java @@ -25,7 +25,7 @@ public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements @Override public boolean isBoundThingInRange(){ if(super.isBoundThingInRange()){ - TileEntity tile = this.worldObj.getTileEntity(this.boundPosition); + TileEntity tile = this.world.getTileEntity(this.boundPosition); if(tile != null){ for(EnumFacing facing : EnumFacing.values()){ if(tile.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, facing)){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java index d389bdb4c..0de696a4b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java @@ -84,8 +84,8 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ - this.range = TileEntityPhantomface.upgradeRange(RANGE, this.worldObj, this.pos); + if(!this.world.isRemote){ + this.range = TileEntityPhantomface.upgradeRange(RANGE, this.world, this.pos); if(!this.hasBoundPosition()){ this.boundPosition = null; @@ -121,11 +121,11 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements @Override public boolean hasBoundPosition(){ if(this.boundPosition != null){ - if(this.worldObj.getTileEntity(this.boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ() && this.worldObj.provider.getDimension() == this.worldObj.provider.getDimension())){ + if(this.world.getTileEntity(this.boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ() && this.world.provider.getDimension() == this.world.provider.getDimension())){ this.boundPosition = null; return false; } - return this.worldObj.provider.getDimension() == this.worldObj.provider.getDimension(); + return this.world.provider.getDimension() == this.world.provider.getDimension(); } return false; } @@ -133,14 +133,14 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements private void doWork(){ if(this.isBoundThingInRange()){ if(this.isBreaker){ - Block blockToBreak = this.worldObj.getBlockState(this.boundPosition).getBlock(); - if(blockToBreak != null && blockToBreak.getBlockHardness(this.worldObj.getBlockState(this.boundPosition), this.worldObj, this.boundPosition) > -1.0F){ + Block blockToBreak = this.world.getBlockState(this.boundPosition).getBlock(); + if(blockToBreak != null && blockToBreak.getBlockHardness(this.world.getBlockState(this.boundPosition), this.world, this.boundPosition) > -1.0F){ ArrayList drops = new ArrayList(); - drops.addAll(blockToBreak.getDrops(this.worldObj, this.boundPosition, this.worldObj.getBlockState(this.boundPosition), 0)); + drops.addAll(blockToBreak.getDrops(this.world, this.boundPosition, this.world.getBlockState(this.boundPosition), 0)); if(WorldUtil.addToInventory(this, drops, false, true)){ - this.worldObj.playEvent(2001, this.boundPosition, Block.getStateId(this.worldObj.getBlockState(this.boundPosition))); - this.worldObj.setBlockToAir(this.boundPosition); + this.world.playEvent(2001, this.boundPosition, Block.getStateId(this.world.getBlockState(this.boundPosition))); + this.world.setBlockToAir(this.boundPosition); WorldUtil.addToInventory(this, drops, true, true); this.markDirty(); } @@ -148,7 +148,7 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements } else{ int theSlot = WorldUtil.findFirstFilledSlot(this.slots); - this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(WorldUtil.getDirectionBySidesInOrder(this.side), this.worldObj, this.boundPosition, this.slots.get(theSlot))); + this.setInventorySlotContents(theSlot, WorldUtil.useItemAtSide(WorldUtil.getDirectionBySidesInOrder(this.side), this.world, this.boundPosition, this.slots.get(theSlot))); if(!StackUtil.isValid(this.slots.get(theSlot))){ this.slots.set(theSlot, StackUtil.getNull()); } @@ -158,16 +158,16 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements @SideOnly(Side.CLIENT) public void renderParticles(){ - if(this.worldObj.rand.nextInt(2) == 0){ - double d1 = (double)((float)this.boundPosition.getY()+this.worldObj.rand.nextFloat()); - int i1 = this.worldObj.rand.nextInt(2)*2-1; - int j1 = this.worldObj.rand.nextInt(2)*2-1; - double d4 = ((double)this.worldObj.rand.nextFloat()-0.5D)*0.125D; + if(this.world.rand.nextInt(2) == 0){ + double d1 = (double)((float)this.boundPosition.getY()+this.world.rand.nextFloat()); + int i1 = this.world.rand.nextInt(2)*2-1; + int j1 = this.world.rand.nextInt(2)*2-1; + double d4 = ((double)this.world.rand.nextFloat()-0.5D)*0.125D; double d2 = (double)this.boundPosition.getZ()+0.5D+0.25D*(double)j1; - double d5 = (double)(this.worldObj.rand.nextFloat()*1.0F*(float)j1); + double d5 = (double)(this.world.rand.nextFloat()*1.0F*(float)j1); double d0 = (double)this.boundPosition.getX()+0.5D+0.25D*(double)i1; - double d3 = (double)(this.worldObj.rand.nextFloat()*1.0F*(float)i1); - this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5); + double d3 = (double)(this.world.rand.nextFloat()*1.0F*(float)i1); + this.world.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5); } if(this.ticksElapsed%80 == 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java index 1bc3f50cb..a9756a7e4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomRedstoneface.java @@ -30,16 +30,16 @@ public class TileEntityPhantomRedstoneface extends TileEntityPhantomface{ @Override public void updateEntity(){ - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(this.isBoundThingInRange()){ - IBlockState boundState = this.worldObj.getBlockState(this.boundPosition); + IBlockState boundState = this.world.getBlockState(this.boundPosition); if(boundState != null){ Block boundBlock = boundState.getBlock(); if(boundBlock != null){ for(int i = 0; i < EnumFacing.values().length; i++){ EnumFacing facing = EnumFacing.values()[i]; - this.providesWeak[i] = boundBlock.getWeakPower(boundState, this.worldObj, this.boundPosition, facing); - this.providesStrong[i] = boundBlock.getStrongPower(boundState, this.worldObj, this.boundPosition, facing); + this.providesWeak[i] = boundBlock.getWeakPower(boundState, this.world, this.boundPosition, facing); + this.providesStrong[i] = boundBlock.getStrongPower(boundState, this.world, this.boundPosition, facing); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java index f18ca54cb..74ef59022 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomface.java @@ -86,8 +86,8 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ - this.range = upgradeRange(RANGE, this.worldObj, this.getPos()); + if(!this.world.isRemote){ + this.range = upgradeRange(RANGE, this.world, this.getPos()); if(!this.hasBoundPosition()){ this.boundPosition = null; @@ -105,16 +105,16 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP } protected boolean doesNeedUpdateSend(){ - return this.boundPosition != this.boundPosBefore || (this.boundPosition != null && this.worldObj.getBlockState(this.boundPosition).getBlock() != this.boundBlockBefore) || this.rangeBefore != this.range; + return this.boundPosition != this.boundPosBefore || (this.boundPosition != null && this.world.getBlockState(this.boundPosition).getBlock() != this.boundBlockBefore) || this.rangeBefore != this.range; } protected void onUpdateSent(){ this.rangeBefore = this.range; this.boundPosBefore = this.boundPosition; - this.boundBlockBefore = this.boundPosition == null ? null : this.worldObj.getBlockState(this.boundPosition).getBlock(); + this.boundBlockBefore = this.boundPosition == null ? null : this.world.getBlockState(this.boundPosition).getBlock(); if(this.boundPosition != null){ - this.worldObj.notifyNeighborsOfStateChange(this.pos, this.worldObj.getBlockState(this.boundPosition).getBlock(), false); + this.world.notifyNeighborsOfStateChange(this.pos, this.world.getBlockState(this.boundPosition).getBlock(), false); } this.sendUpdate(); @@ -129,7 +129,7 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP @Override public boolean hasBoundPosition(){ if(this.boundPosition != null){ - if(this.worldObj.getTileEntity(this.boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ())){ + if(this.world.getTileEntity(this.boundPosition) instanceof IPhantomTile || (this.getPos().getX() == this.boundPosition.getX() && this.getPos().getY() == this.boundPosition.getY() && this.getPos().getZ() == this.boundPosition.getZ())){ this.boundPosition = null; return false; } @@ -140,16 +140,16 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP @SideOnly(Side.CLIENT) public void renderParticles(){ - if(this.worldObj.rand.nextInt(2) == 0){ - double d1 = (double)((float)this.boundPosition.getY()+this.worldObj.rand.nextFloat()); - int i1 = this.worldObj.rand.nextInt(2)*2-1; - int j1 = this.worldObj.rand.nextInt(2)*2-1; - double d4 = ((double)this.worldObj.rand.nextFloat()-0.5D)*0.125D; + if(this.world.rand.nextInt(2) == 0){ + double d1 = (double)((float)this.boundPosition.getY()+this.world.rand.nextFloat()); + int i1 = this.world.rand.nextInt(2)*2-1; + int j1 = this.world.rand.nextInt(2)*2-1; + double d4 = ((double)this.world.rand.nextFloat()-0.5D)*0.125D; double d2 = (double)this.boundPosition.getZ()+0.5D+0.25D*(double)j1; - double d5 = (double)(this.worldObj.rand.nextFloat()*1.0F*(float)j1); + double d5 = (double)(this.world.rand.nextFloat()*1.0F*(float)j1); double d0 = (double)this.boundPosition.getX()+0.5D+0.25D*(double)i1; - double d3 = (double)(this.worldObj.rand.nextFloat()*1.0F*(float)i1); - this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5); + double d3 = (double)(this.world.rand.nextFloat()*1.0F*(float)i1); + this.world.spawnParticle(EnumParticleTypes.PORTAL, d0, d1, d2, d3, d4, d5); } if(this.ticksElapsed%80 == 0){ @@ -200,7 +200,7 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP @Override public boolean hasCapability(Capability capability, EnumFacing facing){ if(this.isBoundThingInRange()){ - TileEntity tile = this.worldObj.getTileEntity(this.getBoundPosition()); + TileEntity tile = this.world.getTileEntity(this.getBoundPosition()); if(tile != null){ return tile.hasCapability(capability, facing); } @@ -211,7 +211,7 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP @Override public T getCapability(Capability capability, EnumFacing facing){ if(this.isBoundThingInRange()){ - TileEntity tile = this.worldObj.getTileEntity(this.getBoundPosition()); + TileEntity tile = this.world.getTileEntity(this.getBoundPosition()); if(tile != null){ return tile.getCapability(capability, facing); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java index 5db8a2350..68b8ad30b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java @@ -38,7 +38,7 @@ public class TileEntityPlayerInterface extends TileEntityInventoryBase implement private EntityPlayer getPlayer(){ if(this.connectedPlayer != null){ - EntityPlayer player = this.worldObj.getPlayerEntityByUUID(this.connectedPlayer); + EntityPlayer player = this.world.getPlayerEntityByUUID(this.connectedPlayer); if(player != null){ if(player.getDistance(this.pos.getX(), this.pos.getY(), this.pos.getZ()) <= this.range){ return player; @@ -51,10 +51,10 @@ public class TileEntityPlayerInterface extends TileEntityInventoryBase implement @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ boolean changed = false; - this.range = TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.worldObj, this.pos); + this.range = TileEntityPhantomface.upgradeRange(DEFAULT_RANGE, this.world, this.pos); EntityPlayer player = this.getPlayer(); if(player != null){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java index 659ad2fd7..fb20fe319 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityRangedCollector.java @@ -53,9 +53,9 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(!this.isRedstonePowered){ - ArrayList items = (ArrayList)this.worldObj.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(this.pos.getX()-RANGE, this.pos.getY()-RANGE, this.pos.getZ()-RANGE, this.pos.getX()+RANGE, this.pos.getY()+RANGE, this.pos.getZ()+RANGE)); + ArrayList items = (ArrayList)this.world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(this.pos.getX()-RANGE, this.pos.getY()-RANGE, this.pos.getZ()-RANGE, this.pos.getX()+RANGE, this.pos.getY()+RANGE, this.pos.getZ()+RANGE)); if(!items.isEmpty()){ for(EntityItem item : items){ if(!item.isDead && !item.cannotPickup() && StackUtil.isValid(item.getEntityItem())){ @@ -66,7 +66,7 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement if(WorldUtil.addToInventory(this, 0, WHITELIST_START, checkList, EnumFacing.UP, false, true)){ WorldUtil.addToInventory(this, 0, WHITELIST_START, checkList, EnumFacing.UP, true, true); - ((WorldServer)this.worldObj).spawnParticle(EnumParticleTypes.CLOUD, false, item.posX, item.posY+0.45F, item.posZ, 5, 0, 0, 0, 0.03D); + ((WorldServer)this.world).spawnParticle(EnumParticleTypes.CLOUD, false, item.posX, item.posY+0.45F, item.posZ, 5, 0, 0, 0, 0.03D); item.setDead(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java index 2b1168ec9..2567ea182 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityShockSuppressor.java @@ -35,7 +35,7 @@ public class TileEntityShockSuppressor extends TileEntityBase implements IEnergy public void onChunkUnload(){ super.onChunkUnload(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ SUPPRESSORS.remove(this); } } @@ -44,7 +44,7 @@ public class TileEntityShockSuppressor extends TileEntityBase implements IEnergy public void invalidate(){ super.invalidate(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ SUPPRESSORS.remove(this); } } @@ -53,7 +53,7 @@ public class TileEntityShockSuppressor extends TileEntityBase implements IEnergy public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(!this.isInvalid() && !SUPPRESSORS.contains(this)){ SUPPRESSORS.add(this); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java index cf4fdd7bc..2931d2846 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntitySmileyCloud.java @@ -11,8 +11,6 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.network.gui.IStringReactor; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -44,7 +42,7 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IStringReac @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ boolean nameChanged = this.name != null ? !this.name.equals(this.nameBefore) : this.nameBefore != null; if(nameChanged && this.sendUpdateWithInterval()){ this.nameBefore = this.name; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java index f27843e31..1787fba73 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java @@ -121,7 +121,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I @Override public void updateEntity(){ super.updateEntity(); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ if(this.amount > 0){ if(!StackUtil.isValid(this.slots.get(0))){ int toSet = this.amount > 64 ? 64 : this.amount; @@ -140,7 +140,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I if(!this.isRedstonePowered){ int range = 5; - List orbs = this.worldObj.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(this.pos.getX()-range, this.pos.getY()-range, this.pos.getZ()-range, this.pos.getX()+1+range, this.pos.getY()+1+range, this.pos.getZ()+1+range)); + List orbs = this.world.getEntitiesWithinAABB(EntityXPOrb.class, new AxisAlignedBB(this.pos.getX()-range, this.pos.getY()-range, this.pos.getZ()-range, this.pos.getX()+1+range, this.pos.getY()+1+range, this.pos.getZ()+1+range)); if(orbs != null && !orbs.isEmpty()){ for(EntityXPOrb orb : orbs){ if(orb != null && !orb.isDead && !orb.getEntityData().getBoolean(ModUtil.MOD_ID+"FromSolidified")){ @@ -192,7 +192,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I int xp = this.buttonAmounts[buttonID] == -999 ? playerXP/ItemSolidifiedExperience.SOLID_XP_AMOUNT : this.buttonAmounts[buttonID]; if(this.amount < Integer.MAX_VALUE-xp && playerXP >= ItemSolidifiedExperience.SOLID_XP_AMOUNT*xp){ addPlayerXP(player, -(ItemSolidifiedExperience.SOLID_XP_AMOUNT*xp)); - if(!this.worldObj.isRemote){ + if(!this.world.isRemote){ this.amount += xp; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java index 3f9c2b0d7..608d24c27 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java @@ -48,18 +48,18 @@ public class UpdateChecker{ @SubscribeEvent(receiveCanceled = true) public void onTick(TickEvent.ClientTickEvent event){ //Don't notify directly to prevent the Message getting lost in Spam on World Joining - if(!notified && Minecraft.getMinecraft().thePlayer != null){ + if(!notified && Minecraft.getMinecraft().player != null){ ticksElapsedBeforeInfo++; if(ticksElapsedBeforeInfo >= 800){ - EntityPlayer player = Minecraft.getMinecraft().thePlayer; + EntityPlayer player = Minecraft.getMinecraft().player; if(UpdateChecker.checkFailed){ - player.addChatMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID+".update.failed"))); + player.sendMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID+".update.failed"))); notified = true; } else if(UpdateChecker.needsUpdateNotify){ - player.addChatMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID+".update.generic"))); - player.addChatMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".update.versionCompare", ModUtil.VERSION, UpdateChecker.updateVersionString))); - player.addChatMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".update.buttons", UpdateChecker.CHANGELOG_LINK, UpdateChecker.DOWNLOAD_LINK))); + player.sendMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localize("info."+ModUtil.MOD_ID+".update.generic"))); + player.sendMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".update.versionCompare", ModUtil.VERSION, UpdateChecker.updateVersionString))); + player.sendMessage(ITextComponent.Serializer.jsonToComponent(StringUtil.localizeFormatted("info."+ModUtil.MOD_ID+".update.buttons", UpdateChecker.CHANGELOG_LINK, UpdateChecker.DOWNLOAD_LINK))); notified = true; } ticksElapsedBeforeInfo = 0; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java index 32177c639..c28cf6223 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java @@ -190,7 +190,7 @@ public final class AssetUtil{ Minecraft mc = Minecraft.getMinecraft(); int particleSetting = mc.gameSettings.particleSetting; - if(mc.thePlayer.getDistance(startX, startY, startZ) <= 64 || mc.thePlayer.getDistance(endX, endY, endZ) <= 64){ + if(mc.player.getDistance(startX, startY, startZ) <= 64 || mc.player.getDistance(endX, endY, endZ) <= 64){ double difX = startX-endX; double difY = startY-endY; double difZ = startZ-endZ; @@ -198,8 +198,8 @@ public final class AssetUtil{ for(int times = 0; times < Math.max(particleAmount/2, 1); times++){ for(double i = 0; i <= 1; i += 1/(distance*particleAmount)){ - if(particleSetting == 0 || (particleSetting == 1 && mc.theWorld.rand.nextFloat() >= 0.8F) || (particleSetting > 1 && mc.theWorld.rand.nextFloat() >= 0.98F)){ - ParticleColored fx = new ParticleColored(mc.theWorld, (difX*i)+endX+0.5, (difY*i)+endY+0.5, (difZ*i)+endZ+0.5, particleSize, color[0], color[1], color[2], ageMultiplier); + if(particleSetting == 0 || (particleSetting == 1 && mc.world.rand.nextFloat() >= 0.8F) || (particleSetting > 1 && mc.world.rand.nextFloat() >= 0.98F)){ + ParticleColored fx = new ParticleColored(mc.world, (difX*i)+endX+0.5, (difY*i)+endY+0.5, (difZ*i)+endZ+0.5, particleSize, color[0], color[1], color[2], ageMultiplier); mc.effectRenderer.addEffect(fx); } } @@ -213,7 +213,7 @@ public final class AssetUtil{ public static void renderLaser(double firstX, double firstY, double firstZ, double secondX, double secondY, double secondZ, double rotationTime, float alpha, double beamWidth, float[] color){ Tessellator tessy = Tessellator.getInstance(); VertexBuffer render = tessy.getBuffer(); - World world = Minecraft.getMinecraft().theWorld; + World world = Minecraft.getMinecraft().world; GlStateManager.disableFog(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java index ce2cf331a..2e3d43183 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java @@ -22,7 +22,10 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; import net.minecraftforge.fml.common.registry.GameRegistry; -import java.util.*; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; //TODO Remove the whole registry name mapping thing once the 1.11 fading phase is over diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StackUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StackUtil.java index bf7be8a15..4747d6965 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StackUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StackUtil.java @@ -34,11 +34,11 @@ public final class StackUtil{ } public static boolean isValid(ItemStack stack){ - return stack != null && !stack.func_190926_b(); + return stack != null && !stack.isEmpty(); } public static ItemStack getNull(){ - return ItemStack.field_190927_a; + return ItemStack.EMPTY; } public static int getStackSize(ItemStack stack){ @@ -46,7 +46,7 @@ public final class StackUtil{ return 0; } else{ - return stack.func_190916_E(); + return stack.getCount(); } } @@ -59,7 +59,7 @@ public final class StackUtil{ return getNull(); } } - stack.func_190920_e(size); + stack.setCount(size); return stack; } @@ -78,7 +78,7 @@ public final class StackUtil{ } public static NonNullList createSlots(int size){ - return NonNullList.func_191197_a(size, getNull()); + return NonNullList.withSize(size, getNull()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java index 9d923fa7b..d7ba787fa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -183,7 +183,7 @@ public final class WorldUtil{ item.motionX = 0; item.motionY = 0; item.motionZ = 0; - world.spawnEntityInWorld(item); + world.spawnEntity(item); } public static EnumFacing getDirectionBySidesInOrder(int side){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaForgeUnitsWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaForgeUnitsWrapper.java index f229d4e10..d53f51d9f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaForgeUnitsWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaForgeUnitsWrapper.java @@ -10,11 +10,9 @@ package de.ellpeck.actuallyadditions.mod.util.compat; -import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy; import net.darkhax.tesla.api.ITeslaConsumer; import net.darkhax.tesla.api.ITeslaHolder; import net.darkhax.tesla.api.ITeslaProducer; -import net.minecraft.item.ItemStack; import net.minecraftforge.energy.IEnergyStorage; public class TeslaForgeUnitsWrapper implements ITeslaProducer, ITeslaHolder, ITeslaConsumer{