mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 08:58:02 -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();
|
||||
Log.info("Assets checking done");
|
||||
Log.info("Loading versions.json...");
|
||||
long mappingStartLoadingTime = System.currentTimeMillis();
|
||||
try {
|
||||
Versions.load(Util.readJsonFromFile(Config.homeDir + "assets/mapping/versions.json"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
Log.info(String.format("Loaded versions mapping in %dms", (System.currentTimeMillis() - mappingStartLoadingTime)));
|
||||
|
||||
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
|
||||
buffer.setPosition(size + lastPos);
|
||||
}
|
||||
int blockEntitiesCount = buffer.readVarInt();
|
||||
for (int i = 0; i < blockEntitiesCount; i++) {
|
||||
CompoundTag tag = (CompoundTag) buffer.readNBT();
|
||||
blockEntities.put(new BlockPosition(tag.getIntTag("x").getValue(), (short) tag.getIntTag("y").getValue(), tag.getIntTag("z").getValue()), tag);
|
||||
if (buffer.getProtocolId() >= 110) {
|
||||
int blockEntitiesCount = buffer.readVarInt();
|
||||
for (int i = 0; i < blockEntitiesCount; i++) {
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user