diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-03-20 13:41:05 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-03-20 13:41:05 +1000 |
commit | 19894ecb9d0a8bcb5fec9117ec705b4c93ccdcb3 (patch) | |
tree | 2cffa17d80f5f479c782e26a09f4162909636bee /src/Java/miscutil/gregtech/gui | |
parent | 7a41bde88f8c2164d1bc5b23bc695ea7bb5e9cda (diff) | |
download | GT5-Unofficial-19894ecb9d0a8bcb5fec9117ec705b4c93ccdcb3.tar.gz GT5-Unofficial-19894ecb9d0a8bcb5fec9117ec705b4c93ccdcb3.tar.bz2 GT5-Unofficial-19894ecb9d0a8bcb5fec9117ec705b4c93ccdcb3.zip |
Added an extra instanceof check in the XEventHandler class just incase the meta tile entity is actually a pipe. (Oversight at my behalf)
Cleaned up some of te Player Caching code, so it's not loaded twice every time it's needed (6am logic loops are the cause)
Will add a new build when I've finalised everything.
Diffstat (limited to 'src/Java/miscutil/gregtech/gui')
-rw-r--r-- | src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java | 12 | ||||
-rw-r--r-- | src/Java/miscutil/gregtech/gui/GUI_SafeBlock.java | 20 |
2 files changed, 26 insertions, 6 deletions
diff --git a/src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java b/src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java index 09162fcda0..62985e6988 100644 --- a/src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java +++ b/src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java @@ -3,8 +3,9 @@ package miscutil.gregtech.gui; import gregtech.api.gui.GT_ContainerMetaTile_Machine; import gregtech.api.gui.GT_Slot_Holo; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.util.GT_Utility; -import miscutil.core.util.PlayerCache; +import miscutil.core.util.Utils; import miscutil.gregtech.metatileentity.implementations.GregtechMetaSafeBlock; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -17,8 +18,9 @@ public class CONTAINER_SafeBlock super(aInventoryPlayer, aTileEntity); } - public String UUID = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).ownerUUID; + public String UUID = ((BaseMetaTileEntity)mTileEntity).getMetaTileEntity().getBaseMetaTileEntity().getOwnerName(); public String ownerUUID = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).ownerUUID; + public boolean blockStatus = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable; @Override public void addSlots(InventoryPlayer aInventoryPlayer) { @@ -64,9 +66,13 @@ public class CONTAINER_SafeBlock ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable); if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable) { GT_Utility.sendChatToPlayer(aPlayer, "Block is now unbreakable."); - PlayerCache.appendParamChanges(aPlayer.getDisplayName(), aPlayer.getUniqueID().toString()); + // World world; + //world.markBlockForUpdate(x, y, z); + //this.updateProgressBar(par1, par2); + //PlayerCache.appendParamChanges(aPlayer.getDisplayName(), aPlayer.getUniqueID().toString()); } else { GT_Utility.sendChatToPlayer(aPlayer, "Block is now breakable."); + Utils.LOG_WARNING("Owner Name - From GT Values: "+UUID); } return null; } diff --git a/src/Java/miscutil/gregtech/gui/GUI_SafeBlock.java b/src/Java/miscutil/gregtech/gui/GUI_SafeBlock.java index c4b2d540ba..94219dae0e 100644 --- a/src/Java/miscutil/gregtech/gui/GUI_SafeBlock.java +++ b/src/Java/miscutil/gregtech/gui/GUI_SafeBlock.java @@ -12,15 +12,29 @@ public class GUI_SafeBlock super(new CONTAINER_SafeBlock(aInventoryPlayer, aTileEntity), CORE.MODID + ":" + "textures/gui/" + "SafeBlock.png"); } - String UUID = ((CONTAINER_SafeBlock)this.mContainer).UUID; + String UUID = ((CONTAINER_SafeBlock)this.mContainer).ownerUUID; + boolean blockStatus = ((CONTAINER_SafeBlock)this.mContainer).blockStatus; private String tempPlayer = PlayerCache.lookupPlayerByUUID(UUID); @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { - this.fontRendererObj.drawString("Safe", 64, 64, 4210752); + + UUID = ((CONTAINER_SafeBlock)this.mContainer).ownerUUID; + blockStatus = ((CONTAINER_SafeBlock)this.mContainer).blockStatus; + tempPlayer = PlayerCache.lookupPlayerByUUID(UUID); + + if (blockStatus){ + this.fontRendererObj.drawString("Safe Status: Locked", 64, 62, 4210752); + } + else { + this.fontRendererObj.drawString("Safe Status: Unlocked", 64, 62, 4210752); + } + + this.fontRendererObj.drawString("Owner: "+ tempPlayer, 64, 72, 4210752); + if (!CORE.DEBUG){ - this.fontRendererObj.drawString("Owner: "+ tempPlayer, 120, 80, 4210752); + } } |