diff options
author | repo-alt <wvk17@yandex.ru> | 2022-08-23 09:19:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 08:19:01 +0200 |
commit | 1f7601e079d6911320a47cd75df7f56968bc101e (patch) | |
tree | 75f461eea9377d43cba0b651691020105389b9c5 /src/main/java/gregtech/api | |
parent | 05ad6f53d7d67f6d2a490de28ca5680c117f0458 (diff) | |
download | GT5-Unofficial-1f7601e079d6911320a47cd75df7f56968bc101e.tar.gz GT5-Unofficial-1f7601e079d6911320a47cd75df7f56968bc101e.tar.bz2 GT5-Unofficial-1f7601e079d6911320a47cd75df7f56968bc101e.zip |
https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11102 (#1289)
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 ""; + } } |