Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-09-08 13:52:50 +02:00
Fix biome and chunk size preconditions
Dieser Commit ist enthalten in:
Ursprung
215cbc6310
Commit
b4720c723a
@ -37,7 +37,7 @@ public class EntityTrackerBase implements EntityTracker, ClientEntityIdChangeLis
|
|||||||
private final UserConnection connection;
|
private final UserConnection connection;
|
||||||
private final EntityType playerType;
|
private final EntityType playerType;
|
||||||
private int clientEntityId = -1;
|
private int clientEntityId = -1;
|
||||||
private int currentWorldSectionHeight = 16;
|
private int currentWorldSectionHeight = -1;
|
||||||
private int currentMinY;
|
private int currentMinY;
|
||||||
private String currentWorld;
|
private String currentWorld;
|
||||||
private int biomesSent = -1;
|
private int biomesSent = -1;
|
||||||
|
@ -44,8 +44,8 @@ public final class WorldPackets {
|
|||||||
|
|
||||||
protocol.registerClientbound(ClientboundPackets1_18.CHUNK_DATA, wrapper -> {
|
protocol.registerClientbound(ClientboundPackets1_18.CHUNK_DATA, wrapper -> {
|
||||||
final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user());
|
final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user());
|
||||||
Preconditions.checkArgument(tracker.biomesSent() != 0, "Biome count not set");
|
Preconditions.checkArgument(tracker.biomesSent() != -1, "Biome count not set");
|
||||||
Preconditions.checkArgument(tracker.currentWorldSectionHeight() != 0, "Section height not set");
|
Preconditions.checkArgument(tracker.currentWorldSectionHeight() != -1, "Section height not set");
|
||||||
final Chunk1_18Type chunkType = new Chunk1_18Type(tracker.currentWorldSectionHeight(),
|
final Chunk1_18Type chunkType = new Chunk1_18Type(tracker.currentWorldSectionHeight(),
|
||||||
MathUtil.ceilLog2(protocol.getMappingData().getBlockStateMappings().mappedSize()),
|
MathUtil.ceilLog2(protocol.getMappingData().getBlockStateMappings().mappedSize()),
|
||||||
MathUtil.ceilLog2(tracker.biomesSent()));
|
MathUtil.ceilLog2(tracker.biomesSent()));
|
||||||
|
@ -172,8 +172,8 @@ public class BlockRewriter<C extends ClientboundPacketType> {
|
|||||||
public PacketHandler chunkDataHandler1_19(ChunkTypeSupplier chunkTypeSupplier, @Nullable Consumer<BlockEntity> blockEntityHandler) {
|
public PacketHandler chunkDataHandler1_19(ChunkTypeSupplier chunkTypeSupplier, @Nullable Consumer<BlockEntity> blockEntityHandler) {
|
||||||
return wrapper -> {
|
return wrapper -> {
|
||||||
final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user());
|
final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user());
|
||||||
Preconditions.checkArgument(tracker.biomesSent() != 0, "Biome count not set");
|
Preconditions.checkArgument(tracker.biomesSent() != -1, "Biome count not set");
|
||||||
Preconditions.checkArgument(tracker.currentWorldSectionHeight() != 0, "Section height not set");
|
Preconditions.checkArgument(tracker.currentWorldSectionHeight() != -1, "Section height not set");
|
||||||
final Type<Chunk> chunkType = chunkTypeSupplier.supply(tracker.currentWorldSectionHeight(),
|
final Type<Chunk> chunkType = chunkTypeSupplier.supply(tracker.currentWorldSectionHeight(),
|
||||||
MathUtil.ceilLog2(protocol.getMappingData().getBlockStateMappings().mappedSize()),
|
MathUtil.ceilLog2(protocol.getMappingData().getBlockStateMappings().mappedSize()),
|
||||||
MathUtil.ceilLog2(tracker.biomesSent()));
|
MathUtil.ceilLog2(tracker.biomesSent()));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren