mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 07:49:03 +00:00
Optimized LoreStreams
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user