From 520e11d10b9794329ba7eaa66683686f727ad9b6 Mon Sep 17 00:00:00 2001 From: PeytonPlayz595 <106421860+PeytonPlayz595@users.noreply.github.com> Date: Wed, 27 Mar 2024 22:40:31 -0400 Subject: [PATCH] Do some things --- src/main/java/net/minecraft/src/Chunk.java | 2 +- src/main/java/net/minecraft/src/NibbleArray.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/minecraft/src/Chunk.java b/src/main/java/net/minecraft/src/Chunk.java index 188aa6c..a587f96 100644 --- a/src/main/java/net/minecraft/src/Chunk.java +++ b/src/main/java/net/minecraft/src/Chunk.java @@ -59,7 +59,7 @@ public class Chunk { } public int getHeightValue(int var1, int var2) { - return this.heightMap[var2 << 4 | var1] & 255; + return this.heightMap[var2 << 4 | var1] & 0xff; } public void func_1014_a() { diff --git a/src/main/java/net/minecraft/src/NibbleArray.java b/src/main/java/net/minecraft/src/NibbleArray.java index 28a1f67..296940d 100644 --- a/src/main/java/net/minecraft/src/NibbleArray.java +++ b/src/main/java/net/minecraft/src/NibbleArray.java @@ -15,17 +15,21 @@ public class NibbleArray { int var4 = var1 << 11 | var3 << 7 | var2; int var5 = var4 >> 1; int var6 = var4 & 1; - return var6 == 0 ? this.data[var5] & 15 : this.data[var5] >> 4 & 15; + if (var6 == 0) { + return data[var5] & 0xf; + } else { + return data[var5] >> 4 & 0xf; + } } public void setNibble(int var1, int var2, int var3, int var4) { int var5 = var1 << 11 | var3 << 7 | var2; int var6 = var5 >> 1; int var7 = var5 & 1; - if(var7 == 0) { - this.data[var6] = (byte)(this.data[var6] & 240 | var4 & 15); + if (var7 == 0) { + data[var6] = (byte) (data[var6] & 0xf0 | var4 & 0xf); } else { - this.data[var6] = (byte)(this.data[var6] & 15 | (var4 & 15) << 4); + data[var6] = (byte) (data[var6] & 0xf | (var4 & 0xf) << 4); } }