Fix update light passthrough

This commit is contained in:
Nassim Jahnke 2021-11-19 21:35:21 +01:00
parent b14b2b86e8
commit 3a529d00ce
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 12 additions and 9 deletions

View File

@ -36,6 +36,7 @@ import com.viaversion.viaversion.protocols.protocol1_18to1_17_1.storage.ChunkLig
import com.viaversion.viaversion.rewriter.EntityRewriter;
import com.viaversion.viaversion.rewriter.ItemRewriter;
import com.viaversion.viaversion.rewriter.SoundRewriter;
import com.viaversion.viaversion.rewriter.StatisticsRewriter;
import com.viaversion.viaversion.rewriter.TagRewriter;
public final class Protocol1_18To1_17_1 extends AbstractProtocol<ClientboundPackets1_17_1, ClientboundPackets1_18, ServerboundPackets1_17, ServerboundPackets1_17> {
@ -66,6 +67,8 @@ public final class Protocol1_18To1_17_1 extends AbstractProtocol<ClientboundPack
"minecraft:azalea_grows_on", "minecraft:azalea_root_replaceable", "minecraft:replaceable_plants", "minecraft:terracotta");
tagRewriter.addEmptyTags(RegistryType.ITEM, "minecraft:dirt", "minecraft:terracotta");
new StatisticsRewriter(this).register(ClientboundPackets1_17_1.STATISTICS);
registerServerbound(ServerboundPackets1_17.CLIENT_SETTINGS, new PacketRemapper() {
@Override
public void registerMap() {

View File

@ -79,22 +79,22 @@ public final class WorldPackets {
wrapper.cancel();
}
final boolean trustEdges = wrapper.read(Type.BOOLEAN);
final long[] skyLightMask = wrapper.read(Type.LONG_ARRAY_PRIMITIVE);
final long[] blockLightMask = wrapper.read(Type.LONG_ARRAY_PRIMITIVE);
final long[] emptySkyLightMask = wrapper.read(Type.LONG_ARRAY_PRIMITIVE);
final long[] emptyBlockLightMask = wrapper.read(Type.LONG_ARRAY_PRIMITIVE);
final boolean trustEdges = wrapper.passthrough(Type.BOOLEAN);
final long[] skyLightMask = wrapper.passthrough(Type.LONG_ARRAY_PRIMITIVE);
final long[] blockLightMask = wrapper.passthrough(Type.LONG_ARRAY_PRIMITIVE);
final long[] emptySkyLightMask = wrapper.passthrough(Type.LONG_ARRAY_PRIMITIVE);
final long[] emptyBlockLightMask = wrapper.passthrough(Type.LONG_ARRAY_PRIMITIVE);
final int skyLightLenght = wrapper.read(Type.VAR_INT);
final int skyLightLenght = wrapper.passthrough(Type.VAR_INT);
final byte[][] skyLight = new byte[skyLightLenght][];
for (int i = 0; i < skyLightLenght; i++) {
skyLight[i] = wrapper.read(Type.BYTE_ARRAY_PRIMITIVE);
skyLight[i] = wrapper.passthrough(Type.BYTE_ARRAY_PRIMITIVE);
}
final int blockLightLength = wrapper.read(Type.VAR_INT);
final int blockLightLength = wrapper.passthrough(Type.VAR_INT);
final byte[][] blockLight = new byte[blockLightLength][];
for (int i = 0; i < blockLightLength; i++) {
blockLight[i] = wrapper.read(Type.BYTE_ARRAY_PRIMITIVE);
blockLight[i] = wrapper.passthrough(Type.BYTE_ARRAY_PRIMITIVE);
}
final ChunkLightStorage lightStorage = wrapper.user().get(ChunkLightStorage.class);