use of buildcraft.api.tiles.IDebuggable in project BuildCraft by BuildCraft.
the class EntityRobot method getDebugInfo.
@Override
public void getDebugInfo(List<String> left, List<String> right, EnumFacing side) {
left.add("Robot:");
if (board != null) {
if (board.getNBTHandler() != null) {
left.add(" " + board.getNBTHandler().getID());
} else {
left.add(" " + board.getClass());
}
} else {
left.add(" Unknown type");
}
if (getBattery() != null) {
left.add(" Battery " + getBattery().getEnergyStored() + "/" + getBattery().getMaxEnergyStored() + " RF");
}
left.add(String.format("Position: %.2f, %.2f, %.2f", posX, posY, posZ));
left.add("AI tree:");
AIRobot aiRobot = mainAI;
while (aiRobot != null) {
left.add("- " + RobotManager.getAIRobotName(aiRobot.getClass()) + " (" + aiRobot.getEnergyCost() + " RF/t)");
if (aiRobot instanceof IDebuggable) {
((IDebuggable) aiRobot).getDebugInfo(left, right, side);
}
aiRobot = aiRobot.getDelegateAI();
}
}
use of buildcraft.api.tiles.IDebuggable in project BuildCraft by BuildCraft.
the class BuildCraftCore method renderOverlay.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void renderOverlay(RenderGameOverlayEvent.Text event) {
Minecraft mc = Minecraft.getMinecraft();
if (!mc.gameSettings.showDebugInfo)
return;
if (mc.thePlayer.hasReducedDebug() || mc.gameSettings.reducedDebugInfo || !mc.thePlayer.capabilities.isCreativeMode) {
return;
}
event.right.add("");
event.right.add("BC PQS|" + PacketHandler.packetQueueSize());
MovingObjectPosition object = mc.objectMouseOver;
if (object == null) {
return;
}
MovingObjectType type = object.typeOfHit;
if (type == MovingObjectType.BLOCK && object.getBlockPos() != null) {
BlockPos pos = object.getBlockPos();
TileEntity tile = mc.theWorld.getTileEntity(pos);
if (tile instanceof IDebuggable) {
((IDebuggable) tile).getDebugInfo(event.left, event.right, object.sideHit);
}
} else if (type == MovingObjectType.ENTITY) {
Entity ent = object.entityHit;
if (ent instanceof IDebuggable) {
((IDebuggable) ent).getDebugInfo(event.left, event.right, object.sideHit);
}
}
}
use of buildcraft.api.tiles.IDebuggable in project BuildCraft by BuildCraft.
the class ClientDebuggables method getDebuggableObject.
@Nullable
public static IDebuggable getDebuggableObject(RayTraceResult mouseOver) {
Minecraft mc = Minecraft.getMinecraft();
if (mc.gameSettings.reducedDebugInfo || mc.player.hasReducedDebug() || !mc.gameSettings.showDebugInfo || !ItemDebugger.isShowDebugInfo(mc.player)) {
return null;
}
if (mouseOver == null) {
return null;
}
RayTraceResult.Type type = mouseOver.typeOfHit;
WorldClient world = mc.world;
if (world == null) {
return null;
}
if (type == RayTraceResult.Type.BLOCK) {
BlockPos pos = mouseOver.getBlockPos();
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof IDebuggable) {
return (IDebuggable) tile;
}
} else if (type == RayTraceResult.Type.ENTITY) {
Entity entity = mouseOver.entityHit;
if (entity instanceof IDebuggable) {
return (IDebuggable) entity;
}
}
return null;
}
use of buildcraft.api.tiles.IDebuggable in project BuildCraft by BuildCraft.
the class RenderTickListener method renderOverlay.
@SubscribeEvent
public static void renderOverlay(RenderGameOverlayEvent.Text event) {
Minecraft mc = Minecraft.getMinecraft();
IDebuggable debuggable = ClientDebuggables.getDebuggableObject(mc.objectMouseOver);
if (debuggable != null) {
List<String> clientLeft = new ArrayList<>();
List<String> clientRight = new ArrayList<>();
debuggable.getDebugInfo(clientLeft, clientRight, mc.objectMouseOver.sideHit);
String headerFirst = DIFF_HEADER_FORMATTING + "SERVER:";
String headerSecond = DIFF_HEADER_FORMATTING + "CLIENT:";
appendDiff(event.getLeft(), ClientDebuggables.SERVER_LEFT, clientLeft, headerFirst, headerSecond);
appendDiff(event.getRight(), ClientDebuggables.SERVER_RIGHT, clientRight, headerFirst, headerSecond);
debuggable.getClientDebugInfo(event.getLeft(), event.getRight(), mc.objectMouseOver.sideHit);
}
}
use of buildcraft.api.tiles.IDebuggable in project BuildCraft by BuildCraft.
the class Pipe method getDebugInfo.
@Override
public void getDebugInfo(List<String> left, List<String> right, EnumFacing side) {
left.add("Colour = " + colour);
left.add("Definition = " + definition.identifier);
if (behaviour instanceof IDebuggable) {
left.add("Behaviour:");
((IDebuggable) behaviour).getDebugInfo(left, right, side);
left.add("");
} else {
left.add("Behaviour = " + behaviour.getClass());
}
if (flow instanceof IDebuggable) {
left.add("Flow:");
((IDebuggable) flow).getDebugInfo(left, right, side);
left.add("");
} else {
left.add("Flow = " + flow.getClass());
}
for (EnumFacing face : EnumFacing.VALUES) {
right.add(face + " = " + types.get(face) + ", " + getConnectedDist(face));
}
}
Aggregations