diff --git a/src/main/java/techreborn/blocks/BlockAlarm.java b/src/main/java/techreborn/blocks/BlockAlarm.java index beaa852bd..8914cace9 100644 --- a/src/main/java/techreborn/blocks/BlockAlarm.java +++ b/src/main/java/techreborn/blocks/BlockAlarm.java @@ -110,8 +110,7 @@ public class BlockAlarm extends BaseTileBlock { } @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, - EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { + public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack stack = playerIn.getHeldItem(EnumHand.MAIN_HAND); TileEntity tileEntity = worldIn.getTileEntity(pos); @@ -132,21 +131,7 @@ public class BlockAlarm extends BaseTileBlock { } - return super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ); - } - - @Override - public int getMetaFromState(IBlockState state) { - int facingInt = state.getValue(FACING).getIndex(); - int activeInt = state.getValue(ACTIVE) ? 8 : 0; - return facingInt + activeInt; - } - - @Override - public IBlockState getStateFromMeta(int meta) { - Boolean active = (meta & 8) == 8; - EnumFacing facing = EnumFacing.byIndex(meta & 7); - return this.getDefaultState().with(FACING, facing).with(ACTIVE, active); + return super.onBlockActivated(state, worldIn, pos, playerIn, hand, side, hitX, hitY, hitZ); } @Nullable diff --git a/src/main/java/techreborn/blocks/BlockComputerCube.java b/src/main/java/techreborn/blocks/BlockComputerCube.java index a2c3977b3..e72fb4b3c 100644 --- a/src/main/java/techreborn/blocks/BlockComputerCube.java +++ b/src/main/java/techreborn/blocks/BlockComputerCube.java @@ -55,8 +55,7 @@ public class BlockComputerCube extends BlockMachineBase { } @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, - EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { + public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack tool = playerIn.getHeldItem(EnumHand.MAIN_HAND); if (!tool.isEmpty() && ToolManager.INSTANCE.canHandleTool(tool)) { diff --git a/src/main/java/techreborn/blocks/BlockNuke.java b/src/main/java/techreborn/blocks/BlockNuke.java index 2d106568f..5375a4a12 100644 --- a/src/main/java/techreborn/blocks/BlockNuke.java +++ b/src/main/java/techreborn/blocks/BlockNuke.java @@ -110,12 +110,6 @@ public class BlockNuke extends BaseBlock { } } - @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, - EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { - return false; - } - @Override public int getMetaFromState(IBlockState state) { return state.getValue(OVERLAY) ? 1 : 0; diff --git a/src/main/java/techreborn/blocks/BlockRubberLog.java b/src/main/java/techreborn/blocks/BlockRubberLog.java index 9df5c1d6a..a89257ce9 100644 --- a/src/main/java/techreborn/blocks/BlockRubberLog.java +++ b/src/main/java/techreborn/blocks/BlockRubberLog.java @@ -161,9 +161,8 @@ public class BlockRubberLog extends Block { } @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, - EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { - super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ); + public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { + super.onBlockActivated(state, worldIn, pos, playerIn, hand, side, hitX, hitY, hitZ); ItemStack stack = playerIn.getHeldItem(EnumHand.MAIN_HAND); if (stack.isEmpty()) { return false; diff --git a/src/main/java/techreborn/blocks/BlockSupercondensator.java b/src/main/java/techreborn/blocks/BlockSupercondensator.java index 33c79c8d6..e2a95fe7b 100644 --- a/src/main/java/techreborn/blocks/BlockSupercondensator.java +++ b/src/main/java/techreborn/blocks/BlockSupercondensator.java @@ -31,7 +31,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.IBlockReader; -import net.minecraft.world.World; import reborncore.api.tile.IMachineGuiHandler; import reborncore.common.blocks.BlockMachineBase; import java.util.List; @@ -41,8 +40,6 @@ import javax.annotation.Nullable; public class BlockSupercondensator extends BlockMachineBase { public BlockSupercondensator(Material material) { super(); - setTranslationKey("techreborn.supercondensator"); -// setCreativeTab(TechRebornCreativeTab.instance); } @Override diff --git a/src/main/java/techreborn/blocks/generator/BlockFusionCoil.java b/src/main/java/techreborn/blocks/generator/BlockFusionCoil.java index 5eb785523..05133b120 100644 --- a/src/main/java/techreborn/blocks/generator/BlockFusionCoil.java +++ b/src/main/java/techreborn/blocks/generator/BlockFusionCoil.java @@ -56,9 +56,9 @@ public class BlockFusionCoil extends Block { super(Block.Properties.create(Material.IRON).hardnessAndResistance(2f).sound(SoundType.METAL)); RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/generators")); } - + @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, + public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack tool = playerIn.getHeldItem(EnumHand.MAIN_HAND); @@ -78,12 +78,13 @@ public class BlockFusionCoil extends Block { } return false; } - + @OnlyIn(Dist.CLIENT) @Override - public void addInformation(ItemStack stack, @Nullable IBlockReader worldIn, List tooltip, ITooltipFlag flagIn) { + public void addInformation(ItemStack stack, @Nullable IBlockReader worldIn, List tooltip, + ITooltipFlag flagIn) { super.addInformation(stack, worldIn, tooltip, flagIn); - //TODO: Translate + // TODO: Translate tooltip.add(new TextComponentString("Right click Fusion Control computer to auto place")); } } \ No newline at end of file diff --git a/src/main/java/techreborn/blocks/generator/BlockFusionControlComputer.java b/src/main/java/techreborn/blocks/generator/BlockFusionControlComputer.java index d29cc83d6..6023deb35 100644 --- a/src/main/java/techreborn/blocks/generator/BlockFusionControlComputer.java +++ b/src/main/java/techreborn/blocks/generator/BlockFusionControlComputer.java @@ -55,21 +55,20 @@ public class BlockFusionControlComputer extends BlockMachineBase { } @Override - public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, - final EntityPlayer player, final EnumHand hand, final EnumFacing side, - final float hitX, final float hitY, final float hitZ) { - final TileFusionControlComputer tileFusionControlComputer = (TileFusionControlComputer) world.getTileEntity(pos); - if(!player.getHeldItem(hand).isEmpty() && player.getHeldItem(hand).getItem() == Item.getItemFromBlock(TRContent.Machine.FUSION_COIL.block)){ + public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer playerIn, + EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { + final TileFusionControlComputer tileFusionControlComputer = (TileFusionControlComputer) worldIn.getTileEntity(pos); + if(!playerIn.getHeldItem(hand).isEmpty() && playerIn.getHeldItem(hand).getItem() == Item.getItemFromBlock(TRContent.Machine.FUSION_COIL.block)){ List coils = Torus.generate(tileFusionControlComputer.getPos(), tileFusionControlComputer.size); boolean placed = false; for(BlockPos coil : coils){ - if(player.getHeldItem(hand).isEmpty()){ + if(playerIn.getHeldItem(hand).isEmpty()){ return true; } - if(world.isAirBlock(coil) && !tileFusionControlComputer.isCoil(coil)){ - world.setBlockState(coil, TRContent.Machine.FUSION_COIL.block.getDefaultState()); - if(!player.isCreative()){ - player.getHeldItem(hand).shrink(1); + if(worldIn.isAirBlock(coil) && !tileFusionControlComputer.isCoil(coil)){ + worldIn.setBlockState(coil, TRContent.Machine.FUSION_COIL.block.getDefaultState()); + if(!playerIn.isCreative()){ + playerIn.getHeldItem(hand).shrink(1); } placed = true; } @@ -80,7 +79,7 @@ public class BlockFusionControlComputer extends BlockMachineBase { } tileFusionControlComputer.checkCoils(); - return super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ); + return super.onBlockActivated(state, worldIn, pos, playerIn, hand, side, hitX, hitY, hitZ); } @Override diff --git a/src/main/java/techreborn/blocks/lighting/BlockLamp.java b/src/main/java/techreborn/blocks/lighting/BlockLamp.java index ee397ea7d..25b3f6da3 100644 --- a/src/main/java/techreborn/blocks/lighting/BlockLamp.java +++ b/src/main/java/techreborn/blocks/lighting/BlockLamp.java @@ -137,16 +137,6 @@ public class BlockLamp extends BaseTileBlock { return BlockRenderLayer.CUTOUT; } - @Override - public boolean isOpaqueCube(IBlockState state) { - return false; - } - - @Override - public boolean isFullBlock(IBlockState state) { - return false; - } - @Override public boolean isFullCube(IBlockState state) { return false; @@ -167,8 +157,7 @@ public class BlockLamp extends BaseTileBlock { } @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, - EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { + public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack stack = playerIn.getHeldItem(EnumHand.MAIN_HAND); TileEntity tileEntity = worldIn.getTileEntity(pos); @@ -183,7 +172,7 @@ public class BlockLamp extends BaseTileBlock { } } - return super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ); + return super.onBlockActivated(state, worldIn, pos, playerIn, hand, side, hitX, hitY, hitZ); } @Override diff --git a/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java b/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java index 5200d8699..ab9678cdb 100644 --- a/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java +++ b/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java @@ -150,8 +150,7 @@ public abstract class BlockEnergyStorage extends BaseTileBlock { } @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, - EnumFacing side, float hitX, float hitY, float hitZ) { + public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack stack = playerIn.getHeldItem(EnumHand.MAIN_HAND); TileEntity tileEntity = worldIn.getTileEntity(pos); @@ -193,18 +192,6 @@ public abstract class BlockEnergyStorage extends BaseTileBlock { setFacing(facing, worldIn, pos); } - @Override - public int getMetaFromState(IBlockState state) { - int facingInt = getSideFromEnum(state.getValue(FACING)); - return facingInt; - } - - @Override - public IBlockState getStateFromMeta(int meta) { - EnumFacing facing = getSideFromint(meta); - return this.getDefaultState().with(FACING, facing); - } - public enum Facings implements Predicate, Iterable { ALL; diff --git a/src/main/java/techreborn/blocks/storage/BlockLSUStorage.java b/src/main/java/techreborn/blocks/storage/BlockLSUStorage.java index c6c1f8dfb..ba8025db8 100644 --- a/src/main/java/techreborn/blocks/storage/BlockLSUStorage.java +++ b/src/main/java/techreborn/blocks/storage/BlockLSUStorage.java @@ -89,8 +89,7 @@ public class BlockLSUStorage extends BaseTileBlock { } @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, - EnumFacing side, float hitX, float hitY, float hitZ) { + public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack stack = playerIn.getHeldItem(EnumHand.MAIN_HAND); TileEntity tileEntity = worldIn.getTileEntity(pos); @@ -105,7 +104,7 @@ public class BlockLSUStorage extends BaseTileBlock { } } - return super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ); + return super.onBlockActivated(state, worldIn, pos, playerIn, hand, side, hitX, hitY, hitZ); } @Override diff --git a/src/main/java/techreborn/blocks/tier1/BlockAutoCraftingTable.java b/src/main/java/techreborn/blocks/tier1/BlockAutoCraftingTable.java index 6f1d5bc4b..b668fa76d 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockAutoCraftingTable.java +++ b/src/main/java/techreborn/blocks/tier1/BlockAutoCraftingTable.java @@ -24,11 +24,8 @@ package techreborn.blocks.tier1; -import net.minecraft.block.state.BlockStateContainer; -import net.minecraft.block.state.IBlockState; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockReader; -import net.minecraft.world.World; import reborncore.api.tile.IMachineGuiHandler; import reborncore.client.models.ModelCompound; import reborncore.client.models.RebornModelRegistry; @@ -40,25 +37,10 @@ import techreborn.tiles.machine.tier1.TileAutoCraftingTable; public class BlockAutoCraftingTable extends BlockMachineBase { public BlockAutoCraftingTable() { - super(true); + super(); RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/tier1_machines")); } - @Override - protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this); - } - - @Override - public int getMetaFromState(IBlockState state) { - return 0; - } - - @Override - public IBlockState getStateFromMeta(int meta) { - return getDefaultState(); - } - @Override public TileEntity createNewTileEntity(IBlockReader worldIn) { return new TileAutoCraftingTable(); diff --git a/src/main/java/techreborn/blocks/tier1/BlockPlayerDetector.java b/src/main/java/techreborn/blocks/tier1/BlockPlayerDetector.java index 1a10dbf87..cdea2c257 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockPlayerDetector.java +++ b/src/main/java/techreborn/blocks/tier1/BlockPlayerDetector.java @@ -94,13 +94,12 @@ public class BlockPlayerDetector extends BlockMachineBase { } @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, - EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { + public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack stack = playerIn.getHeldItem(EnumHand.MAIN_HAND); TileEntity tileEntity = worldIn.getTileEntity(pos); if (tileEntity == null) { - return super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ); + return super.onBlockActivated(state, worldIn, pos, playerIn, hand, side, hitX, hitY, hitZ); } String type = state.getValue(TYPE); @@ -152,19 +151,6 @@ public class BlockPlayerDetector extends BlockMachineBase { return new BlockStateContainer(this, TYPE); } - @Override - public IBlockState getStateFromMeta(int meta) { - if (meta > types.length) { - meta = 0; - } - return getBlockState().getBaseState().with(TYPE, typeNamesList.get(meta)); - } - - @Override - public int getMetaFromState(IBlockState state) { - return typeNamesList.indexOf(state.getValue(TYPE)); - } - @Override public IMachineGuiHandler getGui() { return null; diff --git a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java index a4c91b936..da07140bf 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java @@ -156,8 +156,7 @@ public abstract class BlockTransformer extends BaseTileBlock { } @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, - EnumFacing side, float hitX, float hitY, float hitZ) { + public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { ItemStack stack = playerIn.getHeldItem(EnumHand.MAIN_HAND); TileEntity tileEntity = worldIn.getTileEntity(pos); @@ -172,7 +171,7 @@ public abstract class BlockTransformer extends BaseTileBlock { } } - return super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ); + return super.onBlockActivated(state, worldIn, pos, playerIn, hand, side, hitX, hitY, hitZ); } @Override @@ -193,18 +192,6 @@ public abstract class BlockTransformer extends BaseTileBlock { return false; } - @Override - public int getMetaFromState(IBlockState state) { - int facingInt = getSideFromEnum(state.getValue(FACING)); - return facingInt; - } - - @Override - public IBlockState getStateFromMeta(int meta) { - EnumFacing facing = getSideFromint(meta); - return this.getDefaultState().with(FACING, facing); - } - public enum Facings implements Predicate, Iterable { ALL;