diff options
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/level/chunk/DataLayer.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower/net/minecraft/world/level/chunk/DataLayer.java.patch | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/level/chunk/DataLayer.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/level/chunk/DataLayer.java.patch new file mode 100644 index 0000000000..e1b9273e2e --- /dev/null +++ b/patch-remap/mache-vineflower/net/minecraft/world/level/chunk/DataLayer.java.patch @@ -0,0 +1,127 @@ +--- a/net/minecraft/world/level/chunk/DataLayer.java ++++ b/net/minecraft/world/level/chunk/DataLayer.java +@@ -1,3 +1,4 @@ ++// mc-dev import + package net.minecraft.world.level.chunk; + + import java.util.Arrays; +@@ -6,6 +7,7 @@ + import net.minecraft.util.VisibleForDebug; + + public class DataLayer { ++ + public static final int LAYER_COUNT = 16; + public static final int LAYER_SIZE = 128; + public static final int SIZE = 2048; +@@ -26,7 +28,7 @@ + this.data = data; + this.defaultValue = 0; + if (data.length != 2048) { +- throw (IllegalArgumentException)Util.pauseInIde(new IllegalArgumentException("DataLayer should be 2048 bytes not: " + data.length)); ++ throw (IllegalArgumentException) Util.pauseInIde(new IllegalArgumentException("DataLayer should be 2048 bytes not: " + data.length)); + } + } + +@@ -46,19 +48,21 @@ + if (this.data == null) { + return this.defaultValue; + } else { +- int byteIndex = getByteIndex(index); +- int nibbleIndex = getNibbleIndex(index); +- return this.data[byteIndex] >> 4 * nibbleIndex & 15; ++ int j = getByteIndex(index); ++ int k = getNibbleIndex(index); ++ ++ return this.data[j] >> 4 * k & 15; + } + } + + private void set(int index, int value) { +- byte[] data = this.getData(); +- int byteIndex = getByteIndex(index); +- int nibbleIndex = getNibbleIndex(index); +- int i = ~(15 << 4 * nibbleIndex); +- int i1 = (value & 15) << 4 * nibbleIndex; +- data[byteIndex] = (byte)(data[byteIndex] & i | i1); ++ byte[] abyte = this.getData(); ++ int k = getByteIndex(index); ++ int l = getNibbleIndex(index); ++ int i1 = ~(15 << 4 * l); ++ int j1 = (value & 15) << 4 * l; ++ ++ abyte[k] = (byte) (abyte[k] & i1 | j1); + } + + private static int getNibbleIndex(int index) { +@@ -75,13 +79,13 @@ + } + + private static byte packFilled(int value) { +- byte b = (byte)value; ++ byte b0 = (byte) value; + +- for (int i = 4; i < 8; i += 4) { +- b = (byte)(b | value << i); ++ for (int j = 4; j < 8; j += 4) { ++ b0 = (byte) (b0 | value << j); + } + +- return b; ++ return b0; + } + + public byte[] getData() { +@@ -96,39 +100,38 @@ + } + + public DataLayer copy() { +- return this.data == null ? new DataLayer(this.defaultValue) : new DataLayer((byte[])this.data.clone()); ++ return this.data == null ? new DataLayer(this.defaultValue) : new DataLayer((byte[]) this.data.clone()); + } + +- @Override + public String toString() { +- StringBuilder stringBuilder = new StringBuilder(); ++ StringBuilder stringbuilder = new StringBuilder(); + +- for (int i = 0; i < 4096; i++) { +- stringBuilder.append(Integer.toHexString(this.get(i))); ++ for (int i = 0; i < 4096; ++i) { ++ stringbuilder.append(Integer.toHexString(this.get(i))); + if ((i & 15) == 15) { +- stringBuilder.append("\n"); ++ stringbuilder.append("\n"); + } + +- if ((i & 0xFF) == 255) { +- stringBuilder.append("\n"); ++ if ((i & 255) == 255) { ++ stringbuilder.append("\n"); + } + } + +- return stringBuilder.toString(); ++ return stringbuilder.toString(); + } + + @VisibleForDebug + public String layerToString(int unused) { +- StringBuilder stringBuilder = new StringBuilder(); ++ StringBuilder stringbuilder = new StringBuilder(); + +- for (int i = 0; i < 256; i++) { +- stringBuilder.append(Integer.toHexString(this.get(i))); +- if ((i & 15) == 15) { +- stringBuilder.append("\n"); ++ for (int j = 0; j < 256; ++j) { ++ stringbuilder.append(Integer.toHexString(this.get(j))); ++ if ((j & 15) == 15) { ++ stringbuilder.append("\n"); + } + } + +- return stringBuilder.toString(); ++ return stringbuilder.toString(); + } + + public boolean isDefinitelyHomogenous() { |