Debug tool supports FU

This commit is contained in:
modmuss50 2017-06-29 16:44:49 +01:00
parent 81aee77869
commit 5203ad5b01
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA

View file

@ -33,6 +33,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.energy.CapabilityEnergy;
import reborncore.api.power.IEnergyInterfaceTile;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.TechRebornCreativeTabMisc;
@ -59,6 +60,13 @@ public class ItemDebugTool extends ItemTR {
+ PowerSystem.getLocaliszedPower(((IEnergyInterfaceTile) tile).getEnergy())));
}
return EnumActionResult.SUCCESS;
} else if (tile != null && tile.hasCapability(CapabilityEnergy.ENERGY, facing)) {
if (!tile.getWorld().isRemote) {
playerIn.sendMessage(
new TextComponentString(TextFormatting.GREEN + "Power " + TextFormatting.RED
+ tile.getCapability(CapabilityEnergy.ENERGY, facing).getEnergyStored() + "FU"));
}
return EnumActionResult.SUCCESS;
}
return EnumActionResult.FAIL;
}