This commit is contained in:
CrazyPants committed 2014-10-19 19:55:05 +08:00
commit f2936973ad
2 files changed
+5 -3

No files matched your search

@@ -105,7 +105,7 @@ public class ItemYetaWrench extends Item implements IYetaWrench, IResourceToolti
@Override
public void toolUsed(ItemStack item, EntityLivingBase user, int x, int y, int z) {
Block block = user.worldObj.getBlock(x, y, z);
if (block instanceof IDismantleable && user instanceof EntityPlayer) {
if (user.isSneaking() && block instanceof IDismantleable && user instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) user;
IDismantleable machine = (IDismantleable) block;
if (machine.canDismantle(player, player.worldObj, x, y, z) && !player.worldObj.isRemote) {
@@ -32,7 +32,7 @@ import crazypants.enderio.gui.TooltipAddera;
import crazypants.enderio.machine.AbstractMachineBlock;
import crazypants.enderio.machine.AbstractMachineEntity;
import crazypants.enderio.machine.IoMode;
import crazypants.enderio.machine.solar.TileEntitySolarPanel;
import crazypants.enderio.machine.power.TileCapacitorBank;
import crazypants.enderio.power.IInternalPowerReceptor;
import crazypants.util.Lang;
@@ -46,6 +46,8 @@ public class WailaCompat implements IWailaDataProvider {
registrar.registerBodyProvider(INSTANCE, Block.class);
registrar.registerTailProvider(INSTANCE, Block.class);
registrar.registerSyncedNBTKey("controllerStoredEnergyRF", TileCapacitorBank.class);
// registrar.registerHeadProvider(INSTANCE, IInternalPowerReceptor.class);
// registrar.registerSyncedNBTKey("*", IInternalPowerReceptor.class);
@@ -143,7 +145,7 @@ public class WailaCompat implements IWailaDataProvider {
IInternalPowerReceptor power = (IInternalPowerReceptor) te;
int stored = accessor.getNBTData().getInteger("storedEnergyRF");
int stored = accessor.getTileEntity() instanceof TileCapacitorBank ? power.getEnergyStored() : accessor.getNBTData().getInteger("storedEnergyRF");
int max = power.getMaxEnergyStored();
currenttip.add(String.format("%s%d%s / %s%d%s RF", EnumChatFormatting.WHITE, stored, EnumChatFormatting.RESET, EnumChatFormatting.WHITE, max, EnumChatFormatting.RESET));