diff --git a/src/main/java/techreborn/blocks/storage/BlockAdjustableSU.java b/src/main/java/techreborn/blocks/storage/BlockAdjustableSU.java index 07851acc8..e66cdad3f 100644 --- a/src/main/java/techreborn/blocks/storage/BlockAdjustableSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockAdjustableSU.java @@ -24,19 +24,20 @@ package techreborn.blocks.storage; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import reborncore.common.RebornCoreConfig; import techreborn.client.EGui; import techreborn.init.ModBlocks; import techreborn.tiles.storage.TileAdjustableSU; -import java.util.ArrayList; -import java.util.List; - public class BlockAdjustableSU extends BlockEnergyStorage { public BlockAdjustableSU() { super("AESU", EGui.AESU.ordinal()); @@ -46,11 +47,18 @@ public class BlockAdjustableSU extends BlockEnergyStorage { public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { return new TileAdjustableSU(); } - + @Override public List getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) { - final ArrayList list = new ArrayList<>(); - list.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 2)); - return list; + List items = new ArrayList(); + + if (RebornCoreConfig.wrenchRequired){ + items.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 2)); + } + else { + items.add(new ItemStack(this)); + } + + return items; } } diff --git a/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java b/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java index 14072ce8f..efca592cc 100644 --- a/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java +++ b/src/main/java/techreborn/blocks/storage/BlockEnergyStorage.java @@ -32,17 +32,22 @@ 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.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import prospector.shootingstar.ShootingStar; import prospector.shootingstar.model.ModelCompound; +import reborncore.api.IToolDrop; import reborncore.api.IToolHandler; import reborncore.common.BaseTileBlock; import techreborn.Core; import techreborn.client.TechRebornCreativeTab; +import techreborn.init.ModSounds; import techreborn.lib.ModInfo; import java.util.Iterator; @@ -69,10 +74,28 @@ public abstract class BlockEnergyStorage extends BaseTileBlock { @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { - ItemStack heldStack = player.getHeldItem(hand); - if(heldStack.getItem() instanceof IToolHandler){ - if(((IToolHandler) heldStack.getItem()).handleTool(heldStack, pos, world, player, side, true)){ - if (state.getBlock() instanceof BlockEnergyStorage) { + ItemStack stack = player.getHeldItem(EnumHand.MAIN_HAND); + if(!stack.isEmpty() && stack.getItem() instanceof IToolHandler){ + IToolHandler toolHandler = (IToolHandler) stack.getItem(); + if(toolHandler.handleTool(stack, pos, world, player, side, true) && state.getBlock() instanceof BlockEnergyStorage){ + if (player.isSneaking()) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity instanceof IToolDrop) { + ItemStack drop = ((IToolDrop) tileEntity).getToolDrop(player); + if (drop == null) { + return false; + } + if (!drop.isEmpty()) { + spawnAsEntity(world, pos, drop); + } + world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.BLOCK_DISMANTLE, + SoundCategory.BLOCKS, 0.6F, 1F); + if (!world.isRemote) { + world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2); + } + return true; + } + } else { EnumFacing facing2 = state.getValue(BlockEnergyStorage.FACING); if (facing2.getOpposite() == side) { facing2 = side; @@ -83,11 +106,11 @@ public abstract class BlockEnergyStorage extends BaseTileBlock { return true; } } - } - - if (!player.isSneaking()) + } else if (!player.isSneaking()){ player.openGui(Core.INSTANCE, guiID, world, pos.getX(), pos.getY(), pos.getZ()); - return true; + } + + return super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ); } protected BlockStateContainer createBlockState() { diff --git a/src/main/java/techreborn/blocks/storage/BlockHighVoltageSU.java b/src/main/java/techreborn/blocks/storage/BlockHighVoltageSU.java index 7047988c7..c7f2f05ed 100644 --- a/src/main/java/techreborn/blocks/storage/BlockHighVoltageSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockHighVoltageSU.java @@ -24,19 +24,20 @@ package techreborn.blocks.storage; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import reborncore.common.RebornCoreConfig; import techreborn.client.EGui; import techreborn.init.ModBlocks; import techreborn.tiles.storage.TileHighVoltageSU; -import java.util.ArrayList; -import java.util.List; - /** * Created by modmuss50 on 14/03/2016. */ @@ -50,11 +51,18 @@ public class BlockHighVoltageSU extends BlockEnergyStorage { public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { return new TileHighVoltageSU(); } - + @Override public List getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) { - final ArrayList list = new ArrayList<>(); - list.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 1)); - return list; + List items = new ArrayList(); + + if (RebornCoreConfig.wrenchRequired){ + items.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 1)); + } + else { + items.add(new ItemStack(this)); + } + + return items; } } diff --git a/src/main/java/techreborn/blocks/storage/BlockInterdimensionalSU.java b/src/main/java/techreborn/blocks/storage/BlockInterdimensionalSU.java index e56c3799d..ce028e62e 100644 --- a/src/main/java/techreborn/blocks/storage/BlockInterdimensionalSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockInterdimensionalSU.java @@ -30,14 +30,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import techreborn.client.EGui; import techreborn.tiles.idsu.TileInterdimensionalSU; -import java.util.ArrayList; -import java.util.List; - public class BlockInterdimensionalSU extends BlockEnergyStorage { public BlockInterdimensionalSU() { super("IDSU", EGui.IDSU.ordinal()); @@ -58,13 +54,6 @@ public class BlockInterdimensionalSU extends BlockEnergyStorage { return this.getDefaultState(); } - @Override - public List getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) { - final ArrayList list = new ArrayList<>(); - list.add(new ItemStack(this, 1, 2)); - return list; - } - @Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { super.onBlockPlacedBy(world, pos, state, placer, stack); diff --git a/src/main/java/techreborn/blocks/storage/BlockLSUStorage.java b/src/main/java/techreborn/blocks/storage/BlockLSUStorage.java index a61ffb841..8fae6c76f 100644 --- a/src/main/java/techreborn/blocks/storage/BlockLSUStorage.java +++ b/src/main/java/techreborn/blocks/storage/BlockLSUStorage.java @@ -45,7 +45,6 @@ import java.util.ArrayList; import java.util.List; public class BlockLSUStorage extends BaseTileBlock { - ; public BlockLSUStorage() { super(Material.IRON); diff --git a/src/main/java/techreborn/blocks/storage/BlockLapotronicSU.java b/src/main/java/techreborn/blocks/storage/BlockLapotronicSU.java index 140d28ced..ca79d0917 100644 --- a/src/main/java/techreborn/blocks/storage/BlockLapotronicSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockLapotronicSU.java @@ -24,18 +24,11 @@ package techreborn.blocks.storage; -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import techreborn.client.EGui; import techreborn.tiles.lesu.TileLapotronicSU; -import java.util.ArrayList; -import java.util.List; - public class BlockLapotronicSU extends BlockEnergyStorage { public BlockLapotronicSU() { super("LESU", EGui.LESU.ordinal()); @@ -45,11 +38,4 @@ public class BlockLapotronicSU extends BlockEnergyStorage { public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { return new TileLapotronicSU(); } - - @Override - public List getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) { - final ArrayList list = new ArrayList<>(); - list.add(new ItemStack(this, 1, 2)); - return list; - } } diff --git a/src/main/java/techreborn/blocks/storage/BlockLowVoltageSU.java b/src/main/java/techreborn/blocks/storage/BlockLowVoltageSU.java index 08333ff77..2af7b0c5b 100644 --- a/src/main/java/techreborn/blocks/storage/BlockLowVoltageSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockLowVoltageSU.java @@ -24,18 +24,11 @@ package techreborn.blocks.storage; -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import techreborn.client.EGui; import techreborn.tiles.storage.TileLowVoltageSU; -import java.util.ArrayList; -import java.util.List; - /** * Created by modmuss50 on 14/03/2016. */ @@ -48,11 +41,4 @@ public class BlockLowVoltageSU extends BlockEnergyStorage { public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { return new TileLowVoltageSU(); } - - @Override - public List getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) { - final ArrayList list = new ArrayList<>(); - list.add(new ItemStack(this)); - return list; - } } diff --git a/src/main/java/techreborn/blocks/storage/BlockMediumVoltageSU.java b/src/main/java/techreborn/blocks/storage/BlockMediumVoltageSU.java index 1add69ba7..2cafc9316 100644 --- a/src/main/java/techreborn/blocks/storage/BlockMediumVoltageSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockMediumVoltageSU.java @@ -24,19 +24,20 @@ package techreborn.blocks.storage; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import reborncore.common.RebornCoreConfig; import techreborn.client.EGui; import techreborn.init.ModBlocks; import techreborn.tiles.storage.TileMediumVoltageSU; -import java.util.ArrayList; -import java.util.List; - /** * Created by modmuss50 on 14/03/2016. */ @@ -49,11 +50,18 @@ public class BlockMediumVoltageSU extends BlockEnergyStorage { public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { return new TileMediumVoltageSU(); } - + @Override public List getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) { - final ArrayList list = new ArrayList<>(); - list.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 0, 1)); - return list; + List items = new ArrayList(); + + if (RebornCoreConfig.wrenchRequired){ + items.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 0)); + } + else { + items.add(new ItemStack(this)); + } + + return items; } } diff --git a/src/main/java/techreborn/blocks/transformers/BlockHVTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockHVTransformer.java index 33d39b3bb..ba04e006c 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockHVTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockHVTransformer.java @@ -24,18 +24,19 @@ package techreborn.blocks.transformers; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import reborncore.common.RebornCoreConfig; import techreborn.init.ModBlocks; import techreborn.tiles.transformers.TileHVTransformer; -import java.util.ArrayList; -import java.util.List; - /** * Created by modmuss50 on 16/03/2016. */ @@ -49,12 +50,17 @@ public class BlockHVTransformer extends BlockTransformer { public TileEntity createNewTileEntity(World world, int p_149915_2_) { return new TileHVTransformer(); } - @Override - public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - ArrayList list = new ArrayList<>(); - list.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 1)); - return list; + public List getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) { + List items = new ArrayList(); + + if (RebornCoreConfig.wrenchRequired){ + items.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 1)); + } + else { + items.add(new ItemStack(this)); + } + + return items; } - } diff --git a/src/main/java/techreborn/blocks/transformers/BlockLVTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockLVTransformer.java index 61bb84322..53a3b0300 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockLVTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockLVTransformer.java @@ -24,17 +24,10 @@ package techreborn.blocks.transformers; -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import techreborn.tiles.transformers.TileLVTransformer; -import java.util.ArrayList; -import java.util.List; - /** * Created by modmuss50 on 16/03/2016. */ @@ -48,11 +41,4 @@ public class BlockLVTransformer extends BlockTransformer { public TileEntity createNewTileEntity(World world, int p_149915_2_) { return new TileLVTransformer(); } - - @Override - public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - ArrayList list = new ArrayList<>(); - list.add(new ItemStack(this, 1, 0)); - return list; - } } diff --git a/src/main/java/techreborn/blocks/transformers/BlockMVTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockMVTransformer.java index 4edfd09b1..694d60a3a 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockMVTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockMVTransformer.java @@ -24,18 +24,19 @@ package techreborn.blocks.transformers; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import reborncore.common.RebornCoreConfig; import techreborn.init.ModBlocks; import techreborn.tiles.transformers.TileMVTransformer; -import java.util.ArrayList; -import java.util.List; - /** * Created by modmuss50 on 16/03/2016. */ @@ -49,11 +50,18 @@ public class BlockMVTransformer extends BlockTransformer { public TileEntity createNewTileEntity(World world, int p_149915_2_) { return new TileMVTransformer(); } - + @Override - public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - ArrayList list = new ArrayList<>(); - list.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 0)); - return list; - } + public List getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) { + List items = new ArrayList(); + + if (RebornCoreConfig.wrenchRequired){ + items.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 0)); + } + else { + items.add(new ItemStack(this)); + } + + return items; + } } diff --git a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java index 90799f016..71063a27d 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java @@ -33,19 +33,26 @@ import net.minecraft.block.properties.PropertyDirection; 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.init.Blocks; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidBase; import prospector.shootingstar.ShootingStar; import prospector.shootingstar.model.ModelCompound; +import reborncore.api.IToolDrop; +import reborncore.api.IToolHandler; import reborncore.common.BaseTileBlock; import techreborn.client.TechRebornCreativeTab; +import techreborn.init.ModSounds; import techreborn.lib.ModInfo; import java.util.ArrayList; @@ -114,7 +121,47 @@ public abstract class BlockTransformer extends BaseTileBlock { } setFacing(facing, worldIn, pos); } + + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, + EnumFacing side, float hitX, float hitY, float hitZ) { + ItemStack stack = player.getHeldItem(EnumHand.MAIN_HAND); + if(!stack.isEmpty() && stack.getItem() instanceof IToolHandler){ + IToolHandler toolHandler = (IToolHandler) stack.getItem(); + if(toolHandler.handleTool(stack, pos, world, player, side, true) && state.getBlock() instanceof BlockTransformer){ + if (player.isSneaking()) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity instanceof IToolDrop) { + ItemStack drop = ((IToolDrop) tileEntity).getToolDrop(player); + if (drop == null) { + return false; + } + if (!drop.isEmpty()) { + spawnAsEntity(world, pos, drop); + } + world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.BLOCK_DISMANTLE, + SoundCategory.BLOCKS, 0.6F, 1F); + if (!world.isRemote) { + world.setBlockState(pos, Blocks.AIR.getDefaultState(), 2); + } + return true; + } + } else { + EnumFacing facing2 = state.getValue(BlockTransformer.FACING); + if (facing2.getOpposite() == side) { + facing2 = side; + } else { + facing2 = side.getOpposite(); + } + world.setBlockState(pos, state.withProperty(BlockTransformer.FACING, facing2)); + return true; + } + } + } + return super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ); + } + protected List dropInventory(IBlockAccess world, BlockPos pos, ItemStack itemToDrop) { TileEntity tileEntity = world.getTileEntity(pos); diff --git a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeCategory.java b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeCategory.java index 52fc36fe1..aff011fce 100644 --- a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeCategory.java @@ -40,7 +40,6 @@ import techreborn.tiles.multiblock.TileIndustrialSawmill; import javax.annotation.Nonnull; -@SuppressWarnings("deprecation") public class IndustrialSawmillRecipeCategory implements IRecipeCategory { private final String title; diff --git a/src/main/java/techreborn/tiles/TileAssemblingMachine.java b/src/main/java/techreborn/tiles/TileAssemblingMachine.java index e81d6821a..6b8443af0 100644 --- a/src/main/java/techreborn/tiles/TileAssemblingMachine.java +++ b/src/main/java/techreborn/tiles/TileAssemblingMachine.java @@ -70,8 +70,8 @@ public class TileAssemblingMachine extends TilePowerAcceptor } @Override - public void updateEntity() { - super.updateEntity(); + public void update() { + super.update(); this.charge(3); } diff --git a/src/main/java/techreborn/tiles/TilePump.java b/src/main/java/techreborn/tiles/TilePump.java index 93532fe24..f7a237254 100644 --- a/src/main/java/techreborn/tiles/TilePump.java +++ b/src/main/java/techreborn/tiles/TilePump.java @@ -63,8 +63,8 @@ public class TilePump extends TilePowerAcceptor { } @Override - public void updateEntity() { - super.updateEntity(); + public void update() { + super.update(); if (!world.isRemote && world.getTotalWorldTime() % 10 == 0 && !tank.isFull() && tank.getCapacity() - tank.getFluidAmount() >= 1000 && canUseEnergy(pumpExtractEU)) { FluidStack fluidStack = drainBlock(world, pos.down(), false); if (fluidStack != null) { @@ -167,6 +167,7 @@ public class TilePump extends TilePowerAcceptor { return super.hasCapability(capability, facing); } + @SuppressWarnings("unchecked") @Override public T getCapability(Capability capability, EnumFacing facing) { if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) { diff --git a/src/main/java/techreborn/tiles/TileQuantumTank.java b/src/main/java/techreborn/tiles/TileQuantumTank.java index a6488fafd..01ed0102c 100644 --- a/src/main/java/techreborn/tiles/TileQuantumTank.java +++ b/src/main/java/techreborn/tiles/TileQuantumTank.java @@ -91,8 +91,8 @@ public class TileQuantumTank extends TileLegacyMachineBase } @Override - public void updateEntity() { - super.updateEntity(); + public void update() { + super.update(); if (!this.world.isRemote) { if (FluidUtils.drainContainers(this.tank, this.inventory, 0, 1) || FluidUtils.fillContainers(this.tank, this.inventory, 0, 1, this.tank.getFluidType())) @@ -114,6 +114,7 @@ public class TileQuantumTank extends TileLegacyMachineBase return super.hasCapability(capability, facing); } + @SuppressWarnings("unchecked") @Override public T getCapability(final Capability capability, final EnumFacing facing) { if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) { diff --git a/src/main/java/techreborn/tiles/generator/TileBaseFluidGenerator.java b/src/main/java/techreborn/tiles/generator/TileBaseFluidGenerator.java index 7bebfbf75..4986dabda 100644 --- a/src/main/java/techreborn/tiles/generator/TileBaseFluidGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileBaseFluidGenerator.java @@ -174,6 +174,7 @@ public abstract class TileBaseFluidGenerator extends TilePowerAcceptor implement return super.hasCapability(capability, facing); } + @SuppressWarnings("unchecked") @Override public T getCapability(Capability capability, EnumFacing facing) { if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) { diff --git a/src/main/java/techreborn/tiles/generator/TileDragonEggSyphon.java b/src/main/java/techreborn/tiles/generator/TileDragonEggSyphon.java index c3268dc60..f43c33715 100644 --- a/src/main/java/techreborn/tiles/generator/TileDragonEggSyphon.java +++ b/src/main/java/techreborn/tiles/generator/TileDragonEggSyphon.java @@ -57,8 +57,8 @@ public class TileDragonEggSyphon extends TilePowerAcceptor implements IToolDrop, } @Override - public void updateEntity() { - super.updateEntity(); + public void update() { + super.update(); if (!world.isRemote) { if (world.getBlockState(new BlockPos(getPos().getX(), getPos().getY() + 1, getPos().getZ())) diff --git a/src/main/java/techreborn/tiles/generator/TileSolarPanel.java b/src/main/java/techreborn/tiles/generator/TileSolarPanel.java index 6a1ae1866..86254d2a5 100644 --- a/src/main/java/techreborn/tiles/generator/TileSolarPanel.java +++ b/src/main/java/techreborn/tiles/generator/TileSolarPanel.java @@ -61,8 +61,8 @@ public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop { } @Override - public void updateEntity() { - super.updateEntity(); + public void update() { + super.update(); if (!this.world.isRemote) { if (this.world.getTotalWorldTime() % 60 == 0) { this.shouldMakePower = this.isSunOut(); diff --git a/src/main/java/techreborn/tiles/generator/TileSolidFuelGenerator.java b/src/main/java/techreborn/tiles/generator/TileSolidFuelGenerator.java index 24dc449f9..f18b3d8b2 100644 --- a/src/main/java/techreborn/tiles/generator/TileSolidFuelGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileSolidFuelGenerator.java @@ -73,8 +73,8 @@ public class TileSolidFuelGenerator extends TilePowerAcceptor implements IToolDr } @Override - public void updateEntity() { - super.updateEntity(); + public void update() { + super.update(); if (this.world.isRemote) { return; } diff --git a/src/main/java/techreborn/tiles/generator/TileWindMill.java b/src/main/java/techreborn/tiles/generator/TileWindMill.java index 1e8c7066b..51cbca32b 100644 --- a/src/main/java/techreborn/tiles/generator/TileWindMill.java +++ b/src/main/java/techreborn/tiles/generator/TileWindMill.java @@ -57,8 +57,8 @@ public class TileWindMill extends TilePowerAcceptor implements IToolDrop { } @Override - public void updateEntity() { - super.updateEntity(); + public void update() { + super.update(); if (this.pos.getY() > 64) { int actualPower = this.basePower; if (this.world.isThundering()) { diff --git a/src/main/java/techreborn/tiles/lesu/TileLSUStorage.java b/src/main/java/techreborn/tiles/lesu/TileLSUStorage.java index ca15c3345..70342ab36 100644 --- a/src/main/java/techreborn/tiles/lesu/TileLSUStorage.java +++ b/src/main/java/techreborn/tiles/lesu/TileLSUStorage.java @@ -34,8 +34,8 @@ public class TileLSUStorage extends TileLegacyMachineBase { public LesuNetwork network; @Override - public void updateEntity() { - super.updateEntity(); + public void update() { + super.update(); if (network == null) { findAndJoinNetwork(world, getPos().getX(), getPos().getY(), getPos().getZ()); } else { diff --git a/src/main/java/techreborn/tiles/lesu/TileLapotronicSU.java b/src/main/java/techreborn/tiles/lesu/TileLapotronicSU.java index 251590fa9..10d1e16b7 100644 --- a/src/main/java/techreborn/tiles/lesu/TileLapotronicSU.java +++ b/src/main/java/techreborn/tiles/lesu/TileLapotronicSU.java @@ -25,19 +25,23 @@ package techreborn.tiles.lesu; import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; +import reborncore.api.IToolDrop; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.registration.RebornRegistry; import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.util.Inventory; import techreborn.blocks.storage.BlockLapotronicSU; +import techreborn.init.ModBlocks; import techreborn.lib.ModInfo; import java.util.ArrayList; @RebornRegistry(modID = ModInfo.MOD_ID) -public class TileLapotronicSU extends TilePowerAcceptor {// TODO wrench +public class TileLapotronicSU extends TilePowerAcceptor implements IToolDrop{// TODO wrench @ConfigRegistry(config = "machines", category = "lesu", key = "LesuMaxInput", comment = "LESU Max Input (Value in EU)") public static int maxInput = 8192; @@ -62,8 +66,8 @@ public class TileLapotronicSU extends TilePowerAcceptor {// TODO wrench } @Override - public void updateEntity() { - super.updateEntity(); + public void update() { + super.update(); if (world.isRemote) { return; } @@ -150,4 +154,9 @@ public class TileLapotronicSU extends TilePowerAcceptor {// TODO wrench } return null; } + + @Override + public ItemStack getToolDrop(EntityPlayer p0) { + return new ItemStack(ModBlocks.LAPOTRONIC_SU, 1); + } } diff --git a/src/main/java/techreborn/tiles/multiblock/TileIndustrialGrinder.java b/src/main/java/techreborn/tiles/multiblock/TileIndustrialGrinder.java index 0e785578b..712d3ab72 100644 --- a/src/main/java/techreborn/tiles/multiblock/TileIndustrialGrinder.java +++ b/src/main/java/techreborn/tiles/multiblock/TileIndustrialGrinder.java @@ -156,6 +156,7 @@ public class TileIndustrialGrinder extends TilePowerAcceptor implements IToolDro return super.hasCapability(capability, facing); } + @SuppressWarnings("unchecked") @Override public T getCapability(final Capability capability, final EnumFacing facing) { if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) { diff --git a/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java b/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java index fce4971b7..8caf998db 100644 --- a/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java +++ b/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java @@ -195,6 +195,7 @@ public class TileIndustrialSawmill extends TilePowerAcceptor return super.hasCapability(capability, facing); } + @SuppressWarnings("unchecked") @Override public T getCapability(final Capability capability, final EnumFacing facing) { if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {