mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 18:15:39 +01:00
Fix biome and chunk size preconditions
This commit is contained in:
parent
215cbc6310
commit
b4720c723a
@ -37,7 +37,7 @@ public class EntityTrackerBase implements EntityTracker, ClientEntityIdChangeLis
|
||||
private final UserConnection connection;
|
||||
private final EntityType playerType;
|
||||
private int clientEntityId = -1;
|
||||
private int currentWorldSectionHeight = 16;
|
||||
private int currentWorldSectionHeight = -1;
|
||||
private int currentMinY;
|
||||
private String currentWorld;
|
||||
private int biomesSent = -1;
|
||||
|
@ -44,8 +44,8 @@ public final class WorldPackets {
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_18.CHUNK_DATA, wrapper -> {
|
||||
final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user());
|
||||
Preconditions.checkArgument(tracker.biomesSent() != 0, "Biome count not set");
|
||||
Preconditions.checkArgument(tracker.currentWorldSectionHeight() != 0, "Section height not set");
|
||||
Preconditions.checkArgument(tracker.biomesSent() != -1, "Biome count not set");
|
||||
Preconditions.checkArgument(tracker.currentWorldSectionHeight() != -1, "Section height not set");
|
||||
final Chunk1_18Type chunkType = new Chunk1_18Type(tracker.currentWorldSectionHeight(),
|
||||
MathUtil.ceilLog2(protocol.getMappingData().getBlockStateMappings().mappedSize()),
|
||||
MathUtil.ceilLog2(tracker.biomesSent()));
|
||||
|
@ -172,8 +172,8 @@ public class BlockRewriter<C extends ClientboundPacketType> {
|
||||
public PacketHandler chunkDataHandler1_19(ChunkTypeSupplier chunkTypeSupplier, @Nullable Consumer<BlockEntity> blockEntityHandler) {
|
||||
return wrapper -> {
|
||||
final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user());
|
||||
Preconditions.checkArgument(tracker.biomesSent() != 0, "Biome count not set");
|
||||
Preconditions.checkArgument(tracker.currentWorldSectionHeight() != 0, "Section height not set");
|
||||
Preconditions.checkArgument(tracker.biomesSent() != -1, "Biome count not set");
|
||||
Preconditions.checkArgument(tracker.currentWorldSectionHeight() != -1, "Section height not set");
|
||||
final Type<Chunk> chunkType = chunkTypeSupplier.supply(tracker.currentWorldSectionHeight(),
|
||||
MathUtil.ceilLog2(protocol.getMappingData().getBlockStateMappings().mappedSize()),
|
||||
MathUtil.ceilLog2(tracker.biomesSent()));
|
||||
|
Loading…
Reference in New Issue
Block a user