3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

Fix update light passthrough

Dieser Commit ist enthalten in:
Nassim Jahnke 2021-11-19 21:35:21 +01:00
Ursprung b14b2b86e8
Commit 3a529d00ce
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
2 geänderte Dateien mit 12 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -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.EntityRewriter;
import com.viaversion.viaversion.rewriter.ItemRewriter; import com.viaversion.viaversion.rewriter.ItemRewriter;
import com.viaversion.viaversion.rewriter.SoundRewriter; import com.viaversion.viaversion.rewriter.SoundRewriter;
import com.viaversion.viaversion.rewriter.StatisticsRewriter;
import com.viaversion.viaversion.rewriter.TagRewriter; import com.viaversion.viaversion.rewriter.TagRewriter;
public final class Protocol1_18To1_17_1 extends AbstractProtocol<ClientboundPackets1_17_1, ClientboundPackets1_18, ServerboundPackets1_17, ServerboundPackets1_17> { 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"); "minecraft:azalea_grows_on", "minecraft:azalea_root_replaceable", "minecraft:replaceable_plants", "minecraft:terracotta");
tagRewriter.addEmptyTags(RegistryType.ITEM, "minecraft:dirt", "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() { registerServerbound(ServerboundPackets1_17.CLIENT_SETTINGS, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {

Datei anzeigen

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