Workaround for packet order issue in neighbour chunk updates

This commit is contained in:
creeper123123321 2019-04-27 13:03:53 -03:00
parent c3a7abd5f2
commit 4258f52f86
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1
2 changed files with 9 additions and 5 deletions

View File

@ -118,7 +118,7 @@ public class ConnectionData {
wrapper.write(Type.INT, chunkZ + chunkDeltaZ); wrapper.write(Type.INT, chunkZ + chunkDeltaZ);
wrapper.write(Type.BLOCK_CHANGE_RECORD_ARRAY, updates.toArray(new BlockChangeRecord[0])); wrapper.write(Type.BLOCK_CHANGE_RECORD_ARRAY, updates.toArray(new BlockChangeRecord[0]));
try { try {
wrapper.send(Protocol1_13To1_12_2.class); wrapper.send(Protocol1_13To1_12_2.class, true, true);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -25,6 +25,7 @@ import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.BlockEntityP
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.PaintingProvider; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.PaintingProvider;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.types.Chunk1_13Type; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.types.Chunk1_13Type;
import us.myles.ViaVersion.protocols.protocol1_14to1_13_2.Protocol1_14To1_13_2;
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.types.Chunk1_9_3_4Type; import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.types.Chunk1_9_3_4Type;
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
@ -366,10 +367,6 @@ public class WorldPackets {
} }
} }
if (Via.getConfig().isServersideBlockConnections()) {
ConnectionData.connectBlocks(wrapper.user(), chunk);
}
// Rewrite biome id 255 to plains // Rewrite biome id 255 to plains
if (chunk.isBiomeData()) { if (chunk.isBiomeData()) {
int latestBiomeWarn = Integer.MIN_VALUE; int latestBiomeWarn = Integer.MIN_VALUE;
@ -405,6 +402,13 @@ public class WorldPackets {
chunk.getSections()[y >> 4].setFlatBlock(x & 0xF, y & 0xF, z & 0xF, newId); chunk.getSections()[y >> 4].setFlatBlock(x & 0xF, y & 0xF, z & 0xF, newId);
} }
} }
if (Via.getConfig().isServersideBlockConnections()) {
// Workaround for packet order issue
wrapper.send(Protocol1_14To1_13_2.class, true, true);
wrapper.cancel();
ConnectionData.connectBlocks(wrapper.user(), chunk);
}
} }
}); });
} }