aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/world/level/chunk/DataLayer.java.patch
blob: 03b569a1c4beb325c0b823a5848523af635a9ecc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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() {