From 51fcb8af2bd2022d9a9111e2874e508d4059d8d0 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 5 Jun 2021 15:27:41 -0700 Subject: Made fixes based on Glease's suggestions --- .../gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/gregtech/common/covers') diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java index c0244b1dbc..e71461a817 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java @@ -63,14 +63,15 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { tAdjustVal = 1024; } - aCoverVariable += tAdjustVal; + int tCoverVariable = (aCoverVariable & PUBLIC_MASK) + tAdjustVal; - if ((aCoverVariable & PUBLIC_MASK) < 0) - { + if (tCoverVariable < 0) { aCoverVariable = aCoverVariable & (PRIVATE_MASK | CHECKBOX_MASK); } - //aCoverVariable = aCoverVariable | (aCoverVariable & PUBLIC_MASK); + if (tCoverVariable > MAX_CHANNEL) { + aCoverVariable = (aCoverVariable & (PRIVATE_MASK | CHECKBOX_MASK)) | MAX_CHANNEL; + } } GT_Utility.sendChatToPlayer(aPlayer, trans("081", "Frequency: ") + aCoverVariable); return aCoverVariable; @@ -236,7 +237,7 @@ public abstract class GT_Cover_RedstoneWirelessBase extends GT_CoverBehavior { if ((coverVariable & CHECKBOX_MASK) > 0) { //clear out upper 15 bits and replace them with the upper 15 bits of the hashed player name - coverVariable = (coverVariable & (PUBLIC_MASK | CHECKBOX_MASK)) | (lastPlayer.getDisplayName().hashCode() & PRIVATE_MASK); + coverVariable = (coverVariable & (PUBLIC_MASK | CHECKBOX_MASK)) | (lastPlayer.getUniqueID().hashCode() & PRIVATE_MASK); } else { //clear out upper 16 bits -- cgit