Add energy storage to RebornCore's wrenableBlocks list

This commit is contained in:
modmuss50 2018-05-26 20:38:47 +01:00
parent 24c41f356f
commit 959e318859
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82

View file

@ -51,6 +51,7 @@ import reborncore.api.IToolDrop;
import reborncore.api.ToolManager; import reborncore.api.ToolManager;
import reborncore.api.tile.IUpgradeable; import reborncore.api.tile.IUpgradeable;
import reborncore.common.BaseTileBlock; import reborncore.common.BaseTileBlock;
import reborncore.common.blocks.BlockWrenchEventHandler;
import reborncore.common.util.WorldUtils; import reborncore.common.util.WorldUtils;
import techreborn.Core; import techreborn.Core;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -78,12 +79,13 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
this.name = name; this.name = name;
this.guiID = guiID; this.guiID = guiID;
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy")); ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy"));
BlockWrenchEventHandler.wrenableBlocks.add(this);
} }
@Override @Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand,
EnumFacing side, float hitX, float hitY, float hitZ) { EnumFacing side, float hitX, float hitY, float hitZ) {
ItemStack heldStack = player.getHeldItem(hand); ItemStack heldStack = player.getHeldItem(EnumHand.MAIN_HAND);
if(ToolManager.INSTANCE.canHandleTool(heldStack)){ if(ToolManager.INSTANCE.canHandleTool(heldStack)){
if(ToolManager.INSTANCE.handleTool(heldStack, pos, world, player, side, true)){ if(ToolManager.INSTANCE.handleTool(heldStack, pos, world, player, side, true)){
if (player.isSneaking()) { if (player.isSneaking()) {