Optimized LoreStreams

This commit is contained in:
Sn0wStorm
2019-10-11 17:51:50 +02:00
parent ca2c49ea08
commit cdd50f8504
6 changed files with 90 additions and 54 deletions
+6 -5
View File
@@ -653,8 +653,8 @@ public class Brew {
}
public void testStore(DataOutputStream out) throws IOException {
out.writeByte(1); // Version
out.writeByte(86); // Parity
out.writeByte(1); // Version
out.writeInt(quality);
int bools = 0;
bools += (distillRuns != 0 ? 1 : 0);
@@ -681,14 +681,14 @@ public class Brew {
}
public void testLoad(DataInputStream in) throws IOException {
if (in.readByte() != 1) {
P.p.log("unknown version");
return;
}
if (in.readByte() != 86) {
P.p.log("parity check failed");
return;
}
if (in.readByte() != 1) {
P.p.log("unknown version");
return;
}
if (in.readInt() != quality) {
P.p.log("quality wrong");
}
@@ -723,6 +723,7 @@ public class Brew {
P.p.log("stat wrong");
}
ingredients.testLoad(in);
P.p.log("load successful");
}
// Saves all data