aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/nbt/NbtIo.java.patch
blob: 7cd362d049f0105aae0c250853cf1ec6ecb20e60 (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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
--- a/net/minecraft/nbt/NbtIo.java
+++ b/net/minecraft/nbt/NbtIo.java
@@ -1,3 +1,4 @@
+// mc-dev import
 package net.minecraft.nbt;
 
 import java.io.BufferedOutputStream;
@@ -29,13 +30,13 @@
 
     public NbtIo() {}
 
-    public static CompoundTag readCompressed(Path path, NbtAccounter nbtaccounter) throws IOException {
+    public static CompoundTag readCompressed(Path path, NbtAccounter nbtreadlimiter) throws IOException {
         InputStream inputstream = Files.newInputStream(path);
 
-        CompoundTag compoundtag;
+        CompoundTag nbttagcompound;
 
         try {
-            compoundtag = readCompressed(inputstream, nbtaccounter);
+            nbttagcompound = readCompressed(inputstream, nbtreadlimiter);
         } catch (Throwable throwable) {
             if (inputstream != null) {
                 try {
@@ -52,24 +53,24 @@
             inputstream.close();
         }
 
-        return compoundtag;
+        return nbttagcompound;
     }
 
-    private static DataInputStream createDecompressorStream(InputStream inputstream) throws IOException {
-        return new DataInputStream(new FastBufferedInputStream(new GZIPInputStream(inputstream)));
+    private static DataInputStream createDecompressorStream(InputStream zippedStream) throws IOException {
+        return new DataInputStream(new FastBufferedInputStream(new GZIPInputStream(zippedStream)));
     }
 
     private static DataOutputStream createCompressorStream(OutputStream outputstream) throws IOException {
         return new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(outputstream)));
     }
 
-    public static CompoundTag readCompressed(InputStream inputstream, NbtAccounter nbtaccounter) throws IOException {
+    public static CompoundTag readCompressed(InputStream inputstream, NbtAccounter nbtreadlimiter) throws IOException {
         DataInputStream datainputstream = createDecompressorStream(inputstream);
 
-        CompoundTag compoundtag;
+        CompoundTag nbttagcompound;
 
         try {
-            compoundtag = read(datainputstream, nbtaccounter);
+            nbttagcompound = read(datainputstream, nbtreadlimiter);
         } catch (Throwable throwable) {
             if (datainputstream != null) {
                 try {
@@ -86,14 +87,14 @@
             datainputstream.close();
         }
 
-        return compoundtag;
+        return nbttagcompound;
     }
 
-    public static void parseCompressed(Path path, StreamTagVisitor streamtagvisitor, NbtAccounter nbtaccounter) throws IOException {
+    public static void parseCompressed(Path path, StreamTagVisitor streamtagvisitor, NbtAccounter nbtreadlimiter) throws IOException {
         InputStream inputstream = Files.newInputStream(path);
 
         try {
-            parseCompressed(inputstream, streamtagvisitor, nbtaccounter);
+            parseCompressed(inputstream, streamtagvisitor, nbtreadlimiter);
         } catch (Throwable throwable) {
             if (inputstream != null) {
                 try {
@@ -112,11 +113,11 @@
 
     }
 
-    public static void parseCompressed(InputStream inputstream, StreamTagVisitor streamtagvisitor, NbtAccounter nbtaccounter) throws IOException {
+    public static void parseCompressed(InputStream inputstream, StreamTagVisitor streamtagvisitor, NbtAccounter nbtreadlimiter) throws IOException {
         DataInputStream datainputstream = createDecompressorStream(inputstream);
 
         try {
-            parse(datainputstream, streamtagvisitor, nbtaccounter);
+            parse(datainputstream, streamtagvisitor, nbtreadlimiter);
         } catch (Throwable throwable) {
             if (datainputstream != null) {
                 try {
@@ -135,14 +136,14 @@
 
     }
 
-    public static void writeCompressed(CompoundTag compoundtag, Path path) throws IOException {
+    public static void writeCompressed(CompoundTag nbttagcompound, Path path) throws IOException {
         OutputStream outputstream = Files.newOutputStream(path, NbtIo.SYNC_OUTPUT_OPTIONS);
 
         try {
             BufferedOutputStream bufferedoutputstream = new BufferedOutputStream(outputstream);
 
             try {
-                writeCompressed(compoundtag, (OutputStream) bufferedoutputstream);
+                writeCompressed(nbttagcompound, (OutputStream) bufferedoutputstream);
             } catch (Throwable throwable) {
                 try {
                     bufferedoutputstream.close();
@@ -172,11 +173,11 @@
 
     }
 
-    public static void writeCompressed(CompoundTag compoundtag, OutputStream outputstream) throws IOException {
-        DataOutputStream dataoutputstream = createCompressorStream(outputstream);
+    public static void writeCompressed(CompoundTag compoundTag, OutputStream outputStream) throws IOException {
+        DataOutputStream dataoutputstream = createCompressorStream(outputStream);
 
         try {
-            write(compoundtag, (DataOutput) dataoutputstream);
+            write(compoundTag, (DataOutput) dataoutputstream);
         } catch (Throwable throwable) {
             if (dataoutputstream != null) {
                 try {
@@ -195,7 +196,7 @@
 
     }
 
-    public static void write(CompoundTag compoundtag, Path path) throws IOException {
+    public static void write(CompoundTag nbttagcompound, Path path) throws IOException {
         OutputStream outputstream = Files.newOutputStream(path, NbtIo.SYNC_OUTPUT_OPTIONS);
 
         try {
@@ -205,7 +206,7 @@
                 DataOutputStream dataoutputstream = new DataOutputStream(bufferedoutputstream);
 
                 try {
-                    write(compoundtag, (DataOutput) dataoutputstream);
+                    write(nbttagcompound, (DataOutput) dataoutputstream);
                 } catch (Throwable throwable) {
                     try {
                         dataoutputstream.close();
@@ -253,13 +254,13 @@
         } else {
             InputStream inputstream = Files.newInputStream(path);
 
-            CompoundTag compoundtag;
+            CompoundTag nbttagcompound;
 
             try {
                 DataInputStream datainputstream = new DataInputStream(inputstream);
 
                 try {
-                    compoundtag = read(datainputstream, NbtAccounter.unlimitedHeap());
+                    nbttagcompound = read(datainputstream, NbtAccounter.unlimitedHeap());
                 } catch (Throwable throwable) {
                     try {
                         datainputstream.close();
@@ -287,109 +288,108 @@
                 inputstream.close();
             }
 
-            return compoundtag;
+            return nbttagcompound;
         }
     }
 
-    public static CompoundTag read(DataInput datainput) throws IOException {
-        return read(datainput, NbtAccounter.unlimitedHeap());
+    public static CompoundTag read(DataInput input) throws IOException {
+        return read(input, NbtAccounter.unlimitedHeap());
     }
 
-    public static CompoundTag read(DataInput datainput, NbtAccounter nbtaccounter) throws IOException {
-        Tag tag = readUnnamedTag(datainput, nbtaccounter);
+    public static CompoundTag read(DataInput input, NbtAccounter accounter) throws IOException {
+        Tag nbtbase = readUnnamedTag(input, accounter);
 
-        if (tag instanceof CompoundTag) {
-            return (CompoundTag) tag;
+        if (nbtbase instanceof CompoundTag) {
+            return (CompoundTag) nbtbase;
         } else {
             throw new IOException("Root tag must be a named compound tag");
         }
     }
 
-    public static void write(CompoundTag compoundtag, DataOutput dataoutput) throws IOException {
-        writeUnnamedTagWithFallback(compoundtag, dataoutput);
+    public static void write(CompoundTag compoundTag, DataOutput output) throws IOException {
+        writeUnnamedTagWithFallback(compoundTag, output);
     }
 
-    public static void parse(DataInput datainput, StreamTagVisitor streamtagvisitor, NbtAccounter nbtaccounter) throws IOException {
-        TagType<?> tagtype = TagTypes.getType(datainput.readByte());
+    public static void parse(DataInput datainput, StreamTagVisitor streamtagvisitor, NbtAccounter nbtreadlimiter) throws IOException {
+        TagType<?> nbttagtype = TagTypes.getType(datainput.readByte());
 
-        if (tagtype == EndTag.TYPE) {
-            if (streamtagvisitor.visitRootEntry(EndTag.TYPE) == StreamTagVisitor.ValueResult.CONTINUE) {
+        if (nbttagtype == EndTag.TYPE) {
+            if (streamtagvisitor.visitRootEntry(EndTag.TYPE) == StreamTagVisitor.b.CONTINUE) {
                 streamtagvisitor.visitEnd();
             }
 
         } else {
-            switch (streamtagvisitor.visitRootEntry(tagtype)) {
+            switch (streamtagvisitor.visitRootEntry(nbttagtype)) {
                 case HALT:
                 default:
                     break;
                 case BREAK:
                     StringTag.skipString(datainput);
-                    tagtype.skip(datainput, nbtaccounter);
+                    nbttagtype.skip(datainput, nbtreadlimiter);
                     break;
                 case CONTINUE:
                     StringTag.skipString(datainput);
-                    tagtype.parse(datainput, streamtagvisitor, nbtaccounter);
+                    nbttagtype.parse(datainput, streamtagvisitor, nbtreadlimiter);
             }
 
         }
     }
 
-    public static Tag readAnyTag(DataInput datainput, NbtAccounter nbtaccounter) throws IOException {
+    public static Tag readAnyTag(DataInput datainput, NbtAccounter nbtreadlimiter) throws IOException {
         byte b0 = datainput.readByte();
 
-        return (Tag) (b0 == 0 ? EndTag.INSTANCE : readTagSafe(datainput, nbtaccounter, b0));
+        return (Tag) (b0 == 0 ? EndTag.INSTANCE : readTagSafe(datainput, nbtreadlimiter, b0));
     }
 
-    public static void writeAnyTag(Tag tag, DataOutput dataoutput) throws IOException {
-        dataoutput.writeByte(tag.getId());
-        if (tag.getId() != 0) {
-            tag.write(dataoutput);
+    public static void writeAnyTag(Tag nbtbase, DataOutput dataoutput) throws IOException {
+        dataoutput.writeByte(nbtbase.getId());
+        if (nbtbase.getId() != 0) {
+            nbtbase.write(dataoutput);
         }
     }
 
-    public static void writeUnnamedTag(Tag tag, DataOutput dataoutput) throws IOException {
-        dataoutput.writeByte(tag.getId());
+    public static void writeUnnamedTag(Tag tag, DataOutput output) throws IOException {
+        output.writeByte(tag.getId());
         if (tag.getId() != 0) {
-            dataoutput.writeUTF("");
-            tag.write(dataoutput);
+            output.writeUTF("");
+            tag.write(output);
         }
     }
 
-    public static void writeUnnamedTagWithFallback(Tag tag, DataOutput dataoutput) throws IOException {
-        writeUnnamedTag(tag, new NbtIo.StringFallbackDataOutput(dataoutput));
+    public static void writeUnnamedTagWithFallback(Tag nbtbase, DataOutput dataoutput) throws IOException {
+        writeUnnamedTag(nbtbase, new NbtIo.a(dataoutput));
     }
 
-    private static Tag readUnnamedTag(DataInput datainput, NbtAccounter nbtaccounter) throws IOException {
+    private static Tag readUnnamedTag(DataInput datainput, NbtAccounter nbtreadlimiter) throws IOException {
         byte b0 = datainput.readByte();
 
         if (b0 == 0) {
             return EndTag.INSTANCE;
         } else {
             StringTag.skipString(datainput);
-            return readTagSafe(datainput, nbtaccounter, b0);
+            return readTagSafe(datainput, nbtreadlimiter, b0);
         }
     }
 
-    private static Tag readTagSafe(DataInput datainput, NbtAccounter nbtaccounter, byte b0) {
+    private static Tag readTagSafe(DataInput datainput, NbtAccounter nbtreadlimiter, byte b0) {
         try {
-            return TagTypes.getType(b0).load(datainput, nbtaccounter);
+            return TagTypes.getType(b0).load(datainput, nbtreadlimiter);
         } catch (IOException ioexception) {
             CrashReport crashreport = CrashReport.forThrowable(ioexception, "Loading NBT data");
-            CrashReportCategory crashreportcategory = crashreport.addCategory("NBT Tag");
+            CrashReportCategory crashreportsystemdetails = crashreport.addCategory("NBT Tag");
 
-            crashreportcategory.setDetail("Tag type", (Object) b0);
+            crashreportsystemdetails.setDetail("Tag type", (Object) b0);
             throw new ReportedNbtException(crashreport);
         }
     }
 
-    public static class StringFallbackDataOutput extends DelegateDataOutput {
+    public static class a extends DelegateDataOutput {
 
-        public StringFallbackDataOutput(DataOutput dataoutput) {
+        public a(DataOutput dataoutput) {
             super(dataoutput);
         }
 
         @Override
-        @Override
         public void writeUTF(String s) throws IOException {
             try {
                 super.writeUTF(s);