aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/GT_Proxy.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common/GT_Proxy.java')
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java
index d21491adea..26b971a093 100644
--- a/src/main/java/gregtech/common/GT_Proxy.java
+++ b/src/main/java/gregtech/common/GT_Proxy.java
@@ -219,6 +219,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
public boolean gt6Cable = true;
public boolean ic2EnergySourceCompat = true;
public boolean costlyCableConnection = false;
+ public static final int GUI_ID_COVER_SIDE_BASE = 10; // Takes GUI ID 10 - 15
public GT_Proxy() {
GameRegistry.registerFuelHandler(this);
@@ -1529,6 +1530,9 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
}
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof IGregTechTileEntity)) {
+ if (GUI_ID_COVER_SIDE_BASE <= aID && aID < GUI_ID_COVER_SIDE_BASE+6) {
+ return null;
+ }
IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
if (tMetaTileEntity != null) {
return tMetaTileEntity.getServerGUI(aID, aPlayer.inventory, (IGregTechTileEntity) tTileEntity);
@@ -1553,6 +1557,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
}
+ @Override
public Object getClientGuiElement(int aID, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) {
if(aID>=1000){
int ID = aID-1000;
@@ -1585,9 +1590,20 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
}
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity instanceof IGregTechTileEntity)) {
- IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
+ IGregTechTileEntity tile = (IGregTechTileEntity) tTileEntity;
+
+ if (GUI_ID_COVER_SIDE_BASE <= aID && aID < GUI_ID_COVER_SIDE_BASE+6) {
+ byte side = (byte) (aID - GT_Proxy.GUI_ID_COVER_SIDE_BASE);
+ GT_CoverBehavior cover = tile.getCoverBehaviorAtSide(side);
+
+ if (cover.hasCoverGUI()) {
+ return cover.getClientGUI(side, tile.getCoverIDAtSide(side), tile.getCoverDataAtSide(side), tile);
+ }
+ return null;
+ }
+ IMetaTileEntity tMetaTileEntity = tile.getMetaTileEntity();
if (tMetaTileEntity != null) {
- return tMetaTileEntity.getClientGUI(aID, aPlayer.inventory, (IGregTechTileEntity) tTileEntity);
+ return tMetaTileEntity.getClientGUI(aID, aPlayer.inventory, tile);
}
}
return null;