This commit is contained in:
modmuss50 2019-06-04 12:13:15 +01:00
parent d18d1b820e
commit 500ff29dbd
2 changed files with 3 additions and 21 deletions

View file

@ -36,7 +36,7 @@ import net.minecraft.state.property.Property;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.SystemUtil; import net.minecraft.util.SystemUtil;
import net.minecraft.util.registry.Registry;
import reborncore.api.power.IEnergyInterfaceTile; import reborncore.api.power.IEnergyInterfaceTile;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
import techreborn.TechReborn; import techreborn.TechReborn;
@ -66,12 +66,6 @@ public class ItemDebugTool extends Item {
sendMessage(context, new TextComponent(getTileEntityType(tile))); sendMessage(context, new TextComponent(getTileEntityType(tile)));
if (tile instanceof IEnergyInterfaceTile) { if (tile instanceof IEnergyInterfaceTile) {
sendMessage(context, new TextComponent(getRCPower((IEnergyInterfaceTile) tile))); sendMessage(context, new TextComponent(getRCPower((IEnergyInterfaceTile) tile)));
} else {
IEnergyStorage capEnergy = tile
.getCapability(CapabilityEnergy.ENERGY, context.getPlayerHorizontalFacing()).orElseGet(null);
if (capEnergy != null) {
sendMessage(context, new TextComponent(getForgePower(capEnergy)));
}
} }
} }
return ActionResult.SUCCESS; return ActionResult.SUCCESS;
@ -100,7 +94,7 @@ public class ItemDebugTool extends Item {
String s = "" + ChatFormat.GREEN; String s = "" + ChatFormat.GREEN;
s += "Block Registry Name: "; s += "Block Registry Name: ";
s += ChatFormat.BLUE; s += ChatFormat.BLUE;
s += block.getRegistryName().toString(); s += Registry.BLOCK.getId(block);
return s; return s;
} }
@ -124,16 +118,4 @@ public class ItemDebugTool extends Item {
return s; return s;
} }
private String getForgePower(IEnergyStorage cap) {
String s = "" + ChatFormat.GREEN;
s += "Power: ";
s += ChatFormat.RED;
s += cap.getEnergyStored();
s += "/";
s += cap.getMaxEnergyStored();
s += " RF";
return s;
}
} }