diff options
author | moller21 <42100910+moller21@users.noreply.github.com> | 2020-05-06 22:25:10 +0200 |
---|---|---|
committer | moller21 <42100910+moller21@users.noreply.github.com> | 2020-05-06 22:25:10 +0200 |
commit | 4dec88757f64c0bdf4a87eff8f3d5c7ba65b7217 (patch) | |
tree | c89885dc342ba349c08aa02d21c58db6f9c2e0fe /src/main/java/gregtech/api/util | |
parent | b1f29c6c04170c322cc2f7631147a4c8f86160cd (diff) | |
download | GT5-Unofficial-4dec88757f64c0bdf4a87eff8f3d5c7ba65b7217.tar.gz GT5-Unofficial-4dec88757f64c0bdf4a87eff8f3d5c7ba65b7217.tar.bz2 GT5-Unofficial-4dec88757f64c0bdf4a87eff8f3d5c7ba65b7217.zip |
Cover gui: Right click to open instead take.2
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_CoverBehavior.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/gregtech/api/util/GT_CoverBehavior.java b/src/main/java/gregtech/api/util/GT_CoverBehavior.java index 38c01b9d92..c0ad751add 100644 --- a/src/main/java/gregtech/api/util/GT_CoverBehavior.java +++ b/src/main/java/gregtech/api/util/GT_CoverBehavior.java @@ -46,14 +46,18 @@ public abstract class GT_CoverBehavior { * return the new Value of the Cover Variable */ public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (!hasCoverGUI()) - return aCoverVariable; + return aCoverVariable; + } - if(aPlayer instanceof EntityPlayerMP) { + /** + * Called when someone shift-rightclicks this Cover with no tool. Doesn't call @onCoverRightclick in this Case. + */ + public boolean onCoverShiftRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer) { + if(hasCoverGUI() && aPlayer instanceof EntityPlayerMP) { GT_Values.NW.sendToPlayer(new GT_Packet_TileEntityCoverGUI(aSide, aCoverID, aCoverVariable, aTileEntity, (EntityPlayerMP) aPlayer), (EntityPlayerMP) aPlayer); + return true; } - - return aCoverVariable; + return false; } public boolean hasCoverGUI() { |