From 45669e8aa92adf94d66de0f383c2d0d3f80f307e Mon Sep 17 00:00:00 2001 From: drcrazy Date: Sat, 28 Apr 2018 13:16:50 +0300 Subject: [PATCH] Formatting + set proper frame drop for advanced machines --- .../techreborn/blocks/BlockComputerCube.java | 2 +- .../blocks/BlockFusionControlComputer.java | 7 +- .../generator/BlockDieselGenerator.java | 5 +- .../generator/BlockDragonEggSyphon.java | 3 +- .../blocks/generator/BlockGasTurbine.java | 3 +- .../blocks/generator/BlockLightningRod.java | 1 - .../generator/BlockMagicEnergyAbsorber.java | 1 - .../generator/BlockPlasmaGenerator.java | 3 - .../generator/BlockSemiFluidGenerator.java | 2 +- .../generator/BlockSolidFuelGenerator.java | 2 +- .../generator/BlockThermalGenerator.java | 2 +- .../blocks/generator/BlockWaterMill.java | 1 - .../blocks/storage/BlockAdjustableSU.java | 1 + .../blocks/storage/BlockHighVoltageSU.java | 2 +- .../storage/BlockInterdimensionalSU.java | 1 + .../blocks/storage/BlockLapotronicSU.java | 1 + .../blocks/storage/BlockLowVoltageSU.java | 1 + .../blocks/storage/BlockMediumVoltageSU.java | 1 + .../blocks/tier0/BlockIronAlloyFurnace.java | 2 +- .../blocks/tier0/BlockIronFurnace.java | 2 +- .../blocks/tier1/BlockAlloySmelter.java | 2 +- .../blocks/tier1/BlockCompressor.java | 2 +- .../blocks/tier1/BlockElectricFurnace.java | 2 +- .../blocks/tier1/BlockExtractor.java | 2 +- .../techreborn/blocks/tier1/BlockGrinder.java | 2 +- .../blocks/tier1/BlockPlayerDetector.java | 101 +++++++++--------- .../blocks/tier1/BlockRecycler.java | 5 +- .../blocks/tier1/BlockRollingMachine.java | 2 +- .../blocks/tier1/BlockScrapboxinator.java | 3 +- .../blocks/tier2/BlockChargeOMat.java | 7 +- .../blocks/tier2/BlockChemicalReactor.java | 7 +- .../blocks/tier2/BlockDigitalChest.java | 7 +- .../tier2/BlockImplosionCompressor.java | 7 +- .../tier2/BlockIndustrialBlastFurnace.java | 2 +- .../tier2/BlockIndustrialCentrifuge.java | 7 +- .../tier2/BlockIndustrialElectrolyzer.java | 7 +- .../blocks/tier2/BlockIndustrialGrinder.java | 7 +- .../blocks/tier2/BlockIndustrialSawmill.java | 7 +- .../blocks/tier2/BlockVacuumFreezer.java | 5 + .../blocks/tier3/BlockChunkLoader.java | 7 +- .../blocks/tier3/BlockMatterFabricator.java | 2 +- .../blocks/tier3/BlockQuantumChest.java | 3 +- .../blocks/tier3/BlockQuantumTank.java | 8 +- 43 files changed, 149 insertions(+), 98 deletions(-) diff --git a/src/main/java/techreborn/blocks/BlockComputerCube.java b/src/main/java/techreborn/blocks/BlockComputerCube.java index 4aa0c7331..58dc9e2f9 100644 --- a/src/main/java/techreborn/blocks/BlockComputerCube.java +++ b/src/main/java/techreborn/blocks/BlockComputerCube.java @@ -48,7 +48,7 @@ public class BlockComputerCube extends BlockMachineBase { public BlockComputerCube() { super(); this.setUnlocalizedName("techreborn.computercube"); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines")); } diff --git a/src/main/java/techreborn/blocks/BlockFusionControlComputer.java b/src/main/java/techreborn/blocks/BlockFusionControlComputer.java index 7a229cdf6..8c4993738 100644 --- a/src/main/java/techreborn/blocks/BlockFusionControlComputer.java +++ b/src/main/java/techreborn/blocks/BlockFusionControlComputer.java @@ -51,7 +51,7 @@ public class BlockFusionControlComputer extends BlockMachineBase { public BlockFusionControlComputer() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators")); } @@ -104,4 +104,9 @@ public class BlockFusionControlComputer extends BlockMachineBase { public TileEntity createNewTileEntity(final World world, final int meta) { return new TileFusionControlComputer(); } + + @Override + public boolean isAdvanced() { + return true; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockDieselGenerator.java b/src/main/java/techreborn/blocks/generator/BlockDieselGenerator.java index 582051fe4..226539319 100644 --- a/src/main/java/techreborn/blocks/generator/BlockDieselGenerator.java +++ b/src/main/java/techreborn/blocks/generator/BlockDieselGenerator.java @@ -40,12 +40,9 @@ import techreborn.tiles.generator.TileDieselGenerator; */ public class BlockDieselGenerator extends BlockMachineBase { - /** - * - */ public BlockDieselGenerator() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators")); } diff --git a/src/main/java/techreborn/blocks/generator/BlockDragonEggSyphon.java b/src/main/java/techreborn/blocks/generator/BlockDragonEggSyphon.java index 45e56673c..29b6ec89e 100644 --- a/src/main/java/techreborn/blocks/generator/BlockDragonEggSyphon.java +++ b/src/main/java/techreborn/blocks/generator/BlockDragonEggSyphon.java @@ -38,7 +38,7 @@ public class BlockDragonEggSyphon extends BlockMachineBase { public BlockDragonEggSyphon() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators")); } @@ -51,5 +51,4 @@ public class BlockDragonEggSyphon extends BlockMachineBase { public IMachineGuiHandler getGui() { return null; } - } diff --git a/src/main/java/techreborn/blocks/generator/BlockGasTurbine.java b/src/main/java/techreborn/blocks/generator/BlockGasTurbine.java index 8d8454872..d05fefc26 100644 --- a/src/main/java/techreborn/blocks/generator/BlockGasTurbine.java +++ b/src/main/java/techreborn/blocks/generator/BlockGasTurbine.java @@ -39,7 +39,7 @@ public class BlockGasTurbine extends BlockMachineBase { public BlockGasTurbine() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators")); } @@ -52,5 +52,4 @@ public class BlockGasTurbine extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.GAS_TURBINE; } - } diff --git a/src/main/java/techreborn/blocks/generator/BlockLightningRod.java b/src/main/java/techreborn/blocks/generator/BlockLightningRod.java index baf752a53..f5741b89a 100644 --- a/src/main/java/techreborn/blocks/generator/BlockLightningRod.java +++ b/src/main/java/techreborn/blocks/generator/BlockLightningRod.java @@ -47,7 +47,6 @@ public class BlockLightningRod extends BlockMachineBase { return new TileLightningRod(); } - @Override public IMachineGuiHandler getGui() { return null; diff --git a/src/main/java/techreborn/blocks/generator/BlockMagicEnergyAbsorber.java b/src/main/java/techreborn/blocks/generator/BlockMagicEnergyAbsorber.java index d44f3fa51..0caabd783 100644 --- a/src/main/java/techreborn/blocks/generator/BlockMagicEnergyAbsorber.java +++ b/src/main/java/techreborn/blocks/generator/BlockMagicEnergyAbsorber.java @@ -56,5 +56,4 @@ public class BlockMagicEnergyAbsorber extends BlockMachineBase { public IMachineGuiHandler getGui() { return null; } - } diff --git a/src/main/java/techreborn/blocks/generator/BlockPlasmaGenerator.java b/src/main/java/techreborn/blocks/generator/BlockPlasmaGenerator.java index c96a831cf..29d2404af 100644 --- a/src/main/java/techreborn/blocks/generator/BlockPlasmaGenerator.java +++ b/src/main/java/techreborn/blocks/generator/BlockPlasmaGenerator.java @@ -40,9 +40,6 @@ import techreborn.tiles.generator.TilePlasmaGenerator; */ public class BlockPlasmaGenerator extends BlockMachineBase { - /** - * - */ public BlockPlasmaGenerator() { super(); setCreativeTab(TechRebornCreativeTab.instance); diff --git a/src/main/java/techreborn/blocks/generator/BlockSemiFluidGenerator.java b/src/main/java/techreborn/blocks/generator/BlockSemiFluidGenerator.java index c9b9866b5..a65db793d 100644 --- a/src/main/java/techreborn/blocks/generator/BlockSemiFluidGenerator.java +++ b/src/main/java/techreborn/blocks/generator/BlockSemiFluidGenerator.java @@ -39,7 +39,7 @@ public class BlockSemiFluidGenerator extends BlockMachineBase { public BlockSemiFluidGenerator() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators")); } diff --git a/src/main/java/techreborn/blocks/generator/BlockSolidFuelGenerator.java b/src/main/java/techreborn/blocks/generator/BlockSolidFuelGenerator.java index 8822d8278..beeff0722 100644 --- a/src/main/java/techreborn/blocks/generator/BlockSolidFuelGenerator.java +++ b/src/main/java/techreborn/blocks/generator/BlockSolidFuelGenerator.java @@ -39,7 +39,7 @@ public class BlockSolidFuelGenerator extends BlockMachineBase { public BlockSolidFuelGenerator() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators")); } diff --git a/src/main/java/techreborn/blocks/generator/BlockThermalGenerator.java b/src/main/java/techreborn/blocks/generator/BlockThermalGenerator.java index c242987d9..842baf476 100644 --- a/src/main/java/techreborn/blocks/generator/BlockThermalGenerator.java +++ b/src/main/java/techreborn/blocks/generator/BlockThermalGenerator.java @@ -39,7 +39,7 @@ public class BlockThermalGenerator extends BlockMachineBase { public BlockThermalGenerator() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators")); } diff --git a/src/main/java/techreborn/blocks/generator/BlockWaterMill.java b/src/main/java/techreborn/blocks/generator/BlockWaterMill.java index 503fdaa05..8ae0790bc 100644 --- a/src/main/java/techreborn/blocks/generator/BlockWaterMill.java +++ b/src/main/java/techreborn/blocks/generator/BlockWaterMill.java @@ -50,5 +50,4 @@ public class BlockWaterMill extends BaseTileBlock { public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileWaterMill(); } - } \ No newline at end of file diff --git a/src/main/java/techreborn/blocks/storage/BlockAdjustableSU.java b/src/main/java/techreborn/blocks/storage/BlockAdjustableSU.java index 193b02350..8b068966b 100644 --- a/src/main/java/techreborn/blocks/storage/BlockAdjustableSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockAdjustableSU.java @@ -39,6 +39,7 @@ import java.util.ArrayList; import java.util.List; public class BlockAdjustableSU extends BlockEnergyStorage { + public BlockAdjustableSU() { super("AESU", EGui.AESU.ordinal()); } diff --git a/src/main/java/techreborn/blocks/storage/BlockHighVoltageSU.java b/src/main/java/techreborn/blocks/storage/BlockHighVoltageSU.java index 69c98cd5f..14449d4e3 100644 --- a/src/main/java/techreborn/blocks/storage/BlockHighVoltageSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockHighVoltageSU.java @@ -42,9 +42,9 @@ import java.util.List; * Created by modmuss50 on 14/03/2016. */ public class BlockHighVoltageSU extends BlockEnergyStorage { + public BlockHighVoltageSU() { super("high_voltage_su", EGui.HIGH_VOLTAGE_SU.ordinal()); - this.setHardness(2f); } @Override diff --git a/src/main/java/techreborn/blocks/storage/BlockInterdimensionalSU.java b/src/main/java/techreborn/blocks/storage/BlockInterdimensionalSU.java index dc1ff82f9..d841ce067 100644 --- a/src/main/java/techreborn/blocks/storage/BlockInterdimensionalSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockInterdimensionalSU.java @@ -35,6 +35,7 @@ import techreborn.client.EGui; import techreborn.tiles.idsu.TileInterdimensionalSU; public class BlockInterdimensionalSU extends BlockEnergyStorage { + public BlockInterdimensionalSU() { super("IDSU", EGui.IDSU.ordinal()); } diff --git a/src/main/java/techreborn/blocks/storage/BlockLapotronicSU.java b/src/main/java/techreborn/blocks/storage/BlockLapotronicSU.java index 25e1da82e..224f54b35 100644 --- a/src/main/java/techreborn/blocks/storage/BlockLapotronicSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockLapotronicSU.java @@ -30,6 +30,7 @@ import techreborn.client.EGui; import techreborn.tiles.lesu.TileLapotronicSU; public class BlockLapotronicSU extends BlockEnergyStorage { + public BlockLapotronicSU() { super("LESU", EGui.LESU.ordinal()); } diff --git a/src/main/java/techreborn/blocks/storage/BlockLowVoltageSU.java b/src/main/java/techreborn/blocks/storage/BlockLowVoltageSU.java index a6d3bd1eb..953cac26d 100644 --- a/src/main/java/techreborn/blocks/storage/BlockLowVoltageSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockLowVoltageSU.java @@ -33,6 +33,7 @@ import techreborn.tiles.storage.TileLowVoltageSU; * Created by modmuss50 on 14/03/2016. */ public class BlockLowVoltageSU extends BlockEnergyStorage { + public BlockLowVoltageSU() { super("low_voltage_su", EGui.LOW_VOLTAGE_SU.ordinal()); } diff --git a/src/main/java/techreborn/blocks/storage/BlockMediumVoltageSU.java b/src/main/java/techreborn/blocks/storage/BlockMediumVoltageSU.java index c53ed16c2..6f7399712 100644 --- a/src/main/java/techreborn/blocks/storage/BlockMediumVoltageSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockMediumVoltageSU.java @@ -42,6 +42,7 @@ import java.util.List; * Created by modmuss50 on 14/03/2016. */ public class BlockMediumVoltageSU extends BlockEnergyStorage { + public BlockMediumVoltageSU() { super("medium_voltage_su", EGui.MEDIUM_VOLTAGE_SU.ordinal()); } diff --git a/src/main/java/techreborn/blocks/tier0/BlockIronAlloyFurnace.java b/src/main/java/techreborn/blocks/tier0/BlockIronAlloyFurnace.java index dfc892fb7..7d92568ba 100644 --- a/src/main/java/techreborn/blocks/tier0/BlockIronAlloyFurnace.java +++ b/src/main/java/techreborn/blocks/tier0/BlockIronAlloyFurnace.java @@ -46,7 +46,7 @@ public class BlockIronAlloyFurnace extends BlockMachineBase { public BlockIronAlloyFurnace() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier0_machines")); } diff --git a/src/main/java/techreborn/blocks/tier0/BlockIronFurnace.java b/src/main/java/techreborn/blocks/tier0/BlockIronFurnace.java index 282f1db83..8aae22c45 100644 --- a/src/main/java/techreborn/blocks/tier0/BlockIronFurnace.java +++ b/src/main/java/techreborn/blocks/tier0/BlockIronFurnace.java @@ -51,7 +51,7 @@ public class BlockIronFurnace extends BlockMachineBase { public BlockIronFurnace() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier0_machines")); } diff --git a/src/main/java/techreborn/blocks/tier1/BlockAlloySmelter.java b/src/main/java/techreborn/blocks/tier1/BlockAlloySmelter.java index 69a1992d2..0a0b139b6 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockAlloySmelter.java +++ b/src/main/java/techreborn/blocks/tier1/BlockAlloySmelter.java @@ -39,7 +39,7 @@ public class BlockAlloySmelter extends BlockMachineBase { public BlockAlloySmelter() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines")); } diff --git a/src/main/java/techreborn/blocks/tier1/BlockCompressor.java b/src/main/java/techreborn/blocks/tier1/BlockCompressor.java index b1e6a54b0..d65ed3791 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockCompressor.java +++ b/src/main/java/techreborn/blocks/tier1/BlockCompressor.java @@ -39,7 +39,7 @@ public class BlockCompressor extends BlockMachineBase { public BlockCompressor() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines")); } diff --git a/src/main/java/techreborn/blocks/tier1/BlockElectricFurnace.java b/src/main/java/techreborn/blocks/tier1/BlockElectricFurnace.java index 0a3f14ad4..ef99c894b 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockElectricFurnace.java +++ b/src/main/java/techreborn/blocks/tier1/BlockElectricFurnace.java @@ -39,7 +39,7 @@ public class BlockElectricFurnace extends BlockMachineBase { public BlockElectricFurnace() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines")); } diff --git a/src/main/java/techreborn/blocks/tier1/BlockExtractor.java b/src/main/java/techreborn/blocks/tier1/BlockExtractor.java index a74bf6f84..14943dbb2 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockExtractor.java +++ b/src/main/java/techreborn/blocks/tier1/BlockExtractor.java @@ -39,7 +39,7 @@ public class BlockExtractor extends BlockMachineBase { public BlockExtractor() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines")); } diff --git a/src/main/java/techreborn/blocks/tier1/BlockGrinder.java b/src/main/java/techreborn/blocks/tier1/BlockGrinder.java index 8e4460e30..243c46643 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockGrinder.java +++ b/src/main/java/techreborn/blocks/tier1/BlockGrinder.java @@ -39,7 +39,7 @@ public class BlockGrinder extends BlockMachineBase { public BlockGrinder() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines")); } diff --git a/src/main/java/techreborn/blocks/tier1/BlockPlayerDetector.java b/src/main/java/techreborn/blocks/tier1/BlockPlayerDetector.java index 10e0ee676..725ac2b17 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockPlayerDetector.java +++ b/src/main/java/techreborn/blocks/tier1/BlockPlayerDetector.java @@ -74,64 +74,18 @@ public class BlockPlayerDetector extends BlockMachineBase { public BlockPlayerDetector() { super(true); setCreativeTab(TechRebornCreativeTab.instance); - setHardness(2f); this.setDefaultState(this.getDefaultState().withProperty(TYPE, "all")); for (int i = 0; i < types.length; i++) { ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "machines/tier1_machines").setInvVariant("type=" + types[i])); } } - @Override - public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { - return new ItemStack(ModBlocks.PLAYER_DETECTOR, 1, typeNamesList.indexOf(state.getValue(TYPE))); - } - - @Override - public Item getItemDropped(IBlockState state, Random rand, int fortune) { - return Item.getItemFromBlock(this); - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(CreativeTabs creativeTabs, NonNullList list) { - for (int meta = 0; meta < types.length; meta++) { - list.add(new ItemStack(this, 1, meta)); - } - } - + // BlockMachineBase @Override public TileEntity createNewTileEntity(final World world, final int meta) { return new TilePlayerDectector(); } - - @Override - public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { - return true; - } - - @Override - public boolean canProvidePower(IBlockState state) { - return true; - } - - @Override - public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { - TileEntity entity = blockAccess.getTileEntity(pos); - if (entity instanceof TilePlayerDectector) { - return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0; - } - return 0; - } - - @Override - public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { - TileEntity entity = blockAccess.getTileEntity(pos); - if (entity instanceof TilePlayerDectector) { - return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0; - } - return 0; - } - + @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { @@ -141,7 +95,7 @@ public class BlockPlayerDetector extends BlockMachineBase { ((TilePlayerDectector) tile).owenerUdid = placer.getUniqueID().toString(); } } - + @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { @@ -194,7 +148,7 @@ public class BlockPlayerDetector extends BlockMachineBase { } return true; } - + @Override protected BlockStateContainer createBlockState() { TYPE = new PropertyString("type", types); @@ -218,4 +172,51 @@ public class BlockPlayerDetector extends BlockMachineBase { public IMachineGuiHandler getGui() { return null; } + + // Block + @Override + public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { + return new ItemStack(ModBlocks.PLAYER_DETECTOR, 1, typeNamesList.indexOf(state.getValue(TYPE))); + } + + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + return Item.getItemFromBlock(this); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(CreativeTabs creativeTabs, NonNullList list) { + for (int meta = 0; meta < types.length; meta++) { + list.add(new ItemStack(this, 1, meta)); + } + } + + @Override + public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { + return true; + } + + @Override + public boolean canProvidePower(IBlockState state) { + return true; + } + + @Override + public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { + TileEntity entity = blockAccess.getTileEntity(pos); + if (entity instanceof TilePlayerDectector) { + return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0; + } + return 0; + } + + @Override + public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { + TileEntity entity = blockAccess.getTileEntity(pos); + if (entity instanceof TilePlayerDectector) { + return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0; + } + return 0; + } } diff --git a/src/main/java/techreborn/blocks/tier1/BlockRecycler.java b/src/main/java/techreborn/blocks/tier1/BlockRecycler.java index bf701b2aa..fca22667d 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockRecycler.java +++ b/src/main/java/techreborn/blocks/tier1/BlockRecycler.java @@ -39,7 +39,7 @@ public class BlockRecycler extends BlockMachineBase { public BlockRecycler() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines")); } @@ -51,6 +51,5 @@ public class BlockRecycler extends BlockMachineBase { @Override public IMachineGuiHandler getGui() { return EGui.RECYCLER; - } - + } } diff --git a/src/main/java/techreborn/blocks/tier1/BlockRollingMachine.java b/src/main/java/techreborn/blocks/tier1/BlockRollingMachine.java index 9bb43573c..3401abe2f 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockRollingMachine.java +++ b/src/main/java/techreborn/blocks/tier1/BlockRollingMachine.java @@ -39,7 +39,7 @@ public class BlockRollingMachine extends BlockMachineBase { public BlockRollingMachine() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines")); } diff --git a/src/main/java/techreborn/blocks/tier1/BlockScrapboxinator.java b/src/main/java/techreborn/blocks/tier1/BlockScrapboxinator.java index 2ba08cd6c..95823b08d 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockScrapboxinator.java +++ b/src/main/java/techreborn/blocks/tier1/BlockScrapboxinator.java @@ -39,7 +39,7 @@ public class BlockScrapboxinator extends BlockMachineBase { public BlockScrapboxinator() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines")); } @@ -52,5 +52,4 @@ public class BlockScrapboxinator extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.SCRAPBOXINATOR; } - } diff --git a/src/main/java/techreborn/blocks/tier2/BlockChargeOMat.java b/src/main/java/techreborn/blocks/tier2/BlockChargeOMat.java index be82b1d70..1e1f18ed2 100644 --- a/src/main/java/techreborn/blocks/tier2/BlockChargeOMat.java +++ b/src/main/java/techreborn/blocks/tier2/BlockChargeOMat.java @@ -39,7 +39,7 @@ public class BlockChargeOMat extends BlockMachineBase { public BlockChargeOMat() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines")); } @@ -52,4 +52,9 @@ public class BlockChargeOMat extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.CHARGEBENCH; } + + @Override + public boolean isAdvanced() { + return true; + } } diff --git a/src/main/java/techreborn/blocks/tier2/BlockChemicalReactor.java b/src/main/java/techreborn/blocks/tier2/BlockChemicalReactor.java index eee18af5f..6012fd18e 100644 --- a/src/main/java/techreborn/blocks/tier2/BlockChemicalReactor.java +++ b/src/main/java/techreborn/blocks/tier2/BlockChemicalReactor.java @@ -39,7 +39,7 @@ public class BlockChemicalReactor extends BlockMachineBase { public BlockChemicalReactor() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines")); } @@ -52,4 +52,9 @@ public class BlockChemicalReactor extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.CHEMICAL_REACTOR; } + + @Override + public boolean isAdvanced() { + return true; + } } diff --git a/src/main/java/techreborn/blocks/tier2/BlockDigitalChest.java b/src/main/java/techreborn/blocks/tier2/BlockDigitalChest.java index 92446ad98..b3b8dbee0 100644 --- a/src/main/java/techreborn/blocks/tier2/BlockDigitalChest.java +++ b/src/main/java/techreborn/blocks/tier2/BlockDigitalChest.java @@ -50,7 +50,7 @@ public class BlockDigitalChest extends BlockMachineBase { public BlockDigitalChest() { super(); this.setUnlocalizedName("techreborn.digitalChest"); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines")); } @@ -80,4 +80,9 @@ public class BlockDigitalChest extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.DIGITAL_CHEST; } + + @Override + public boolean isAdvanced() { + return true; + } } diff --git a/src/main/java/techreborn/blocks/tier2/BlockImplosionCompressor.java b/src/main/java/techreborn/blocks/tier2/BlockImplosionCompressor.java index 95d73c0f2..660db7845 100644 --- a/src/main/java/techreborn/blocks/tier2/BlockImplosionCompressor.java +++ b/src/main/java/techreborn/blocks/tier2/BlockImplosionCompressor.java @@ -39,7 +39,7 @@ public class BlockImplosionCompressor extends BlockMachineBase { public BlockImplosionCompressor() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines")); } @@ -52,4 +52,9 @@ public class BlockImplosionCompressor extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.IMPLOSION_COMPRESSOR; } + + @Override + public boolean isAdvanced() { + return true; + } } diff --git a/src/main/java/techreborn/blocks/tier2/BlockIndustrialBlastFurnace.java b/src/main/java/techreborn/blocks/tier2/BlockIndustrialBlastFurnace.java index 8a5b8512a..62f885fcf 100644 --- a/src/main/java/techreborn/blocks/tier2/BlockIndustrialBlastFurnace.java +++ b/src/main/java/techreborn/blocks/tier2/BlockIndustrialBlastFurnace.java @@ -39,7 +39,7 @@ public class BlockIndustrialBlastFurnace extends BlockMachineBase { public BlockIndustrialBlastFurnace() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines")); } diff --git a/src/main/java/techreborn/blocks/tier2/BlockIndustrialCentrifuge.java b/src/main/java/techreborn/blocks/tier2/BlockIndustrialCentrifuge.java index 4f017ecb0..0e85b106b 100644 --- a/src/main/java/techreborn/blocks/tier2/BlockIndustrialCentrifuge.java +++ b/src/main/java/techreborn/blocks/tier2/BlockIndustrialCentrifuge.java @@ -39,7 +39,7 @@ public class BlockIndustrialCentrifuge extends BlockMachineBase { public BlockIndustrialCentrifuge() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines")); } @@ -52,4 +52,9 @@ public class BlockIndustrialCentrifuge extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.CENTRIFUGE; } + + @Override + public boolean isAdvanced() { + return true; + } } diff --git a/src/main/java/techreborn/blocks/tier2/BlockIndustrialElectrolyzer.java b/src/main/java/techreborn/blocks/tier2/BlockIndustrialElectrolyzer.java index 1fc6f1c3a..61be1becc 100644 --- a/src/main/java/techreborn/blocks/tier2/BlockIndustrialElectrolyzer.java +++ b/src/main/java/techreborn/blocks/tier2/BlockIndustrialElectrolyzer.java @@ -39,7 +39,7 @@ public class BlockIndustrialElectrolyzer extends BlockMachineBase { public BlockIndustrialElectrolyzer() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines")); } @@ -52,4 +52,9 @@ public class BlockIndustrialElectrolyzer extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.INDUSTRIAL_ELECTROLYZER; } + + @Override + public boolean isAdvanced() { + return true; + } } diff --git a/src/main/java/techreborn/blocks/tier2/BlockIndustrialGrinder.java b/src/main/java/techreborn/blocks/tier2/BlockIndustrialGrinder.java index 374a10107..d016743f3 100644 --- a/src/main/java/techreborn/blocks/tier2/BlockIndustrialGrinder.java +++ b/src/main/java/techreborn/blocks/tier2/BlockIndustrialGrinder.java @@ -39,7 +39,7 @@ public class BlockIndustrialGrinder extends BlockMachineBase { public BlockIndustrialGrinder() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines")); } @@ -52,4 +52,9 @@ public class BlockIndustrialGrinder extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.INDUSTRIAL_GRINDER; } + + @Override + public boolean isAdvanced() { + return true; + } } diff --git a/src/main/java/techreborn/blocks/tier2/BlockIndustrialSawmill.java b/src/main/java/techreborn/blocks/tier2/BlockIndustrialSawmill.java index 2afa4d932..1ca208d20 100644 --- a/src/main/java/techreborn/blocks/tier2/BlockIndustrialSawmill.java +++ b/src/main/java/techreborn/blocks/tier2/BlockIndustrialSawmill.java @@ -39,7 +39,7 @@ public class BlockIndustrialSawmill extends BlockMachineBase { public BlockIndustrialSawmill() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines")); } @@ -52,4 +52,9 @@ public class BlockIndustrialSawmill extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.SAWMILL; } + + @Override + public boolean isAdvanced() { + return true; + } } diff --git a/src/main/java/techreborn/blocks/tier2/BlockVacuumFreezer.java b/src/main/java/techreborn/blocks/tier2/BlockVacuumFreezer.java index 08d604c36..e9ebeb3e0 100644 --- a/src/main/java/techreborn/blocks/tier2/BlockVacuumFreezer.java +++ b/src/main/java/techreborn/blocks/tier2/BlockVacuumFreezer.java @@ -52,4 +52,9 @@ public class BlockVacuumFreezer extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.VACUUM_FREEZER; } + + @Override + public boolean isAdvanced() { + return true; + } } diff --git a/src/main/java/techreborn/blocks/tier3/BlockChunkLoader.java b/src/main/java/techreborn/blocks/tier3/BlockChunkLoader.java index b498b15e1..60fb63f18 100644 --- a/src/main/java/techreborn/blocks/tier3/BlockChunkLoader.java +++ b/src/main/java/techreborn/blocks/tier3/BlockChunkLoader.java @@ -39,7 +39,7 @@ public class BlockChunkLoader extends BlockMachineBase { public BlockChunkLoader() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier3_machines")); } @@ -52,4 +52,9 @@ public class BlockChunkLoader extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.CHUNK_LOADER; } + + @Override + public boolean isAdvanced() { + return true; + } } diff --git a/src/main/java/techreborn/blocks/tier3/BlockMatterFabricator.java b/src/main/java/techreborn/blocks/tier3/BlockMatterFabricator.java index a97a3b519..9a9b54760 100644 --- a/src/main/java/techreborn/blocks/tier3/BlockMatterFabricator.java +++ b/src/main/java/techreborn/blocks/tier3/BlockMatterFabricator.java @@ -39,7 +39,7 @@ public class BlockMatterFabricator extends BlockMachineBase { public BlockMatterFabricator() { super(); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier3_machines")); } diff --git a/src/main/java/techreborn/blocks/tier3/BlockQuantumChest.java b/src/main/java/techreborn/blocks/tier3/BlockQuantumChest.java index d093b6ac0..89bdb2bf7 100644 --- a/src/main/java/techreborn/blocks/tier3/BlockQuantumChest.java +++ b/src/main/java/techreborn/blocks/tier3/BlockQuantumChest.java @@ -50,8 +50,7 @@ public class BlockQuantumChest extends BlockMachineBase { public BlockQuantumChest() { super(); this.setUnlocalizedName("techreborn.quantumChest"); - this.setCreativeTab(TechRebornCreativeTab.instance); - this.setHardness(2.0F); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier3_machines")); } diff --git a/src/main/java/techreborn/blocks/tier3/BlockQuantumTank.java b/src/main/java/techreborn/blocks/tier3/BlockQuantumTank.java index c00b03b66..d9b4357d0 100644 --- a/src/main/java/techreborn/blocks/tier3/BlockQuantumTank.java +++ b/src/main/java/techreborn/blocks/tier3/BlockQuantumTank.java @@ -39,8 +39,7 @@ public class BlockQuantumTank extends BlockMachineBase { public BlockQuantumTank() { super(); - this.setHardness(2.0F); - this.setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier3_machines")); } @@ -53,4 +52,9 @@ public class BlockQuantumTank extends BlockMachineBase { public IMachineGuiHandler getGui() { return EGui.QUANTUM_TANK; } + + @Override + public boolean isAdvanced() { + return true; + } }