aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/covers
diff options
context:
space:
mode:
authorMatt <mtthw8198@gmail.com>2021-06-05 15:27:41 -0700
committerMatt <mtthw8198@gmail.com>2021-06-05 15:27:41 -0700
commit51fcb8af2bd2022d9a9111e2874e508d4059d8d0 (patch)
tree583d6c21da325dc899ef70714dfa6bdd9e7cb53b /src/main/java/gregtech/common/covers
parentaeef5100c0f603e675d17eef5b3bc63b8586ccab (diff)
downloadGT5-Unofficial-51fcb8af2bd2022d9a9111e2874e508d4059d8d0.tar.gz
GT5-Unofficial-51fcb8af2bd2022d9a9111e2874e508d4059d8d0.tar.bz2
GT5-Unofficial-51fcb8af2bd2022d9a9111e2874e508d4059d8d0.zip
Made fixes based on Glease's suggestions
Diffstat (limited to 'src/main/java/gregtech/common/covers')
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_RedstoneWirelessBase.java11
1 files changed, 6 insertions, 5 deletions
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