diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/level/chunk/DataLayer.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/level/chunk/DataLayer.java.patch | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/level/chunk/DataLayer.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/level/chunk/DataLayer.java.patch new file mode 100644 index 0000000000..03b569a1c4 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/level/chunk/DataLayer.java.patch @@ -0,0 +1,133 @@ +--- 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; +@@ -19,69 +20,69 @@ + this(0); + } + +- public DataLayer(int i) { +- this.defaultValue = i; ++ public DataLayer(int size) { ++ this.defaultValue = size; + } + +- public DataLayer(byte[] abyte) { +- this.data = abyte; ++ public DataLayer(byte[] data) { ++ this.data = data; + this.defaultValue = 0; +- if (abyte.length != 2048) { +- throw (IllegalArgumentException) Util.pauseInIde(new IllegalArgumentException("DataLayer should be 2048 bytes not: " + abyte.length)); ++ if (data.length != 2048) { ++ throw (IllegalArgumentException) Util.pauseInIde(new IllegalArgumentException("DataLayer should be 2048 bytes not: " + data.length)); + } + } + +- public int get(int i, int j, int k) { +- return this.get(getIndex(i, j, k)); ++ public int get(int x, int y, int z) { ++ return this.get(getIndex(x, y, z)); + } + +- public void set(int i, int j, int k, int l) { +- this.set(getIndex(i, j, k), l); ++ public void set(int x, int y, int z, int value) { ++ this.set(getIndex(x, y, z), value); + } + +- private static int getIndex(int i, int j, int k) { +- return j << 8 | k << 4 | i; ++ private static int getIndex(int x, int y, int z) { ++ return y << 8 | z << 4 | x; + } + +- private int get(int i) { ++ private int get(int index) { + if (this.data == null) { + return this.defaultValue; + } else { +- int j = getByteIndex(i); +- int k = getNibbleIndex(i); ++ int j = getByteIndex(index); ++ int k = getNibbleIndex(index); + + return this.data[j] >> 4 * k & 15; + } + } + +- private void set(int i, int j) { ++ private void set(int index, int value) { + byte[] abyte = this.getData(); +- int k = getByteIndex(i); +- int l = getNibbleIndex(i); ++ int k = getByteIndex(index); ++ int l = getNibbleIndex(index); + int i1 = ~(15 << 4 * l); +- int j1 = (j & 15) << 4 * l; ++ int j1 = (value & 15) << 4 * l; + + abyte[k] = (byte) (abyte[k] & i1 | j1); + } + +- private static int getNibbleIndex(int i) { +- return i & 1; ++ private static int getNibbleIndex(int index) { ++ return index & 1; + } + +- private static int getByteIndex(int i) { +- return i >> 1; ++ private static int getByteIndex(int index) { ++ return index >> 1; + } + +- public void fill(int i) { +- this.defaultValue = i; ++ public void fill(int defaultValue) { ++ this.defaultValue = defaultValue; + this.data = null; + } + +- private static byte packFilled(int i) { +- byte b0 = (byte) i; ++ private static byte packFilled(int value) { ++ byte b0 = (byte) value; + + for (int j = 4; j < 8; j += 4) { +- b0 = (byte) (b0 | i << j); ++ b0 = (byte) (b0 | value << j); + } + + return b0; +@@ -102,7 +103,6 @@ + return this.data == null ? new DataLayer(this.defaultValue) : new DataLayer((byte[]) this.data.clone()); + } + +- @Override + public String toString() { + StringBuilder stringbuilder = new StringBuilder(); + +@@ -121,7 +121,7 @@ + } + + @VisibleForDebug +- public String layerToString(int i) { ++ public String layerToString(int unused) { + StringBuilder stringbuilder = new StringBuilder(); + + for (int j = 0; j < 256; ++j) { +@@ -138,8 +138,8 @@ + return this.data == null; + } + +- public boolean isDefinitelyFilledWith(int i) { +- return this.data == null && this.defaultValue == i; ++ public boolean isDefinitelyFilledWith(int value) { ++ return this.data == null && this.defaultValue == value; + } + + public boolean isEmpty() { |