mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-29 13:36:16 +01:00
Fix update light passthrough
This commit is contained in:
parent
b14b2b86e8
commit
3a529d00ce
@ -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() {
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user