mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 17:07:55 -04:00
fix chunk reading < 1.10. Print (version) mappings loading time
This commit is contained in:
parent
deb700d33d
commit
00d38eb955
@ -56,12 +56,14 @@ public class Minosoft {
|
|||||||
checkAssets();
|
checkAssets();
|
||||||
Log.info("Assets checking done");
|
Log.info("Assets checking done");
|
||||||
Log.info("Loading versions.json...");
|
Log.info("Loading versions.json...");
|
||||||
|
long mappingStartLoadingTime = System.currentTimeMillis();
|
||||||
try {
|
try {
|
||||||
Versions.load(Util.readJsonFromFile(Config.homeDir + "assets/mapping/versions.json"));
|
Versions.load(Util.readJsonFromFile(Config.homeDir + "assets/mapping/versions.json"));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
|
Log.info(String.format("Loaded versions mapping in %dms", (System.currentTimeMillis() - mappingStartLoadingTime)));
|
||||||
|
|
||||||
checkClientToken();
|
checkClientToken();
|
||||||
|
|
||||||
|
@ -99,10 +99,12 @@ public class PacketChunkData implements ClientboundPacket {
|
|||||||
// set position of the byte buffer, because of some reasons HyPixel makes some weired stuff and sends way to much 0 bytes. (~ 190k), thanks @pokechu22
|
// set position of the byte buffer, because of some reasons HyPixel makes some weired stuff and sends way to much 0 bytes. (~ 190k), thanks @pokechu22
|
||||||
buffer.setPosition(size + lastPos);
|
buffer.setPosition(size + lastPos);
|
||||||
}
|
}
|
||||||
int blockEntitiesCount = buffer.readVarInt();
|
if (buffer.getProtocolId() >= 110) {
|
||||||
for (int i = 0; i < blockEntitiesCount; i++) {
|
int blockEntitiesCount = buffer.readVarInt();
|
||||||
CompoundTag tag = (CompoundTag) buffer.readNBT();
|
for (int i = 0; i < blockEntitiesCount; i++) {
|
||||||
blockEntities.put(new BlockPosition(tag.getIntTag("x").getValue(), (short) tag.getIntTag("y").getValue(), tag.getIntTag("z").getValue()), tag);
|
CompoundTag tag = (CompoundTag) buffer.readNBT();
|
||||||
|
blockEntities.put(new BlockPosition(tag.getIntTag("x").getValue(), (short) tag.getIntTag("y").getValue(), tag.getIntTag("z").getValue()), tag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user