diff options
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/MetaTileEntity.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index 58e7131f43..7d4cbae063 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -1,5 +1,7 @@ package gregtech.api.metatileentity; +import appeng.api.networking.energy.IEnergyGrid; +import appeng.api.networking.pathing.IPathingGrid; import appeng.api.util.AECableType; import appeng.me.helpers.AENetworkProxy; import cpw.mods.fml.common.Optional; @@ -1028,4 +1030,27 @@ public abstract class MetaTileEntity implements IMetaTileEntity, IMachineCallbac /* Empty */ } + @Optional.Method(modid = "appliedenergistics2") + protected String getAEDiagnostics() { + try { + if (getProxy() == null) + return "(proxy)"; + if (getProxy().getNode() == null) + return "(node)"; + if (getProxy().getNode().getGrid() == null) + return "(grid)"; + if (!getProxy().getNode().meetsChannelRequirements()) + return "(channels)"; + IPathingGrid pg = getProxy().getNode().getGrid().getCache(IPathingGrid.class); + if (!pg.isNetworkBooting()) + return "(booting)"; + IEnergyGrid eg = getProxy().getNode().getGrid().getCache(IEnergyGrid.class); + if (!eg.isNetworkPowered()) + return "(power)"; + } + catch(Throwable ex) { + ex.printStackTrace(); + } + return ""; + } } |