From ee27cbdd22e21282278ac01ce5cf995b8a7a41af Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 9 Feb 2022 19:12:28 +0100 Subject: [PATCH] 22w06a --- .../api/protocol/version/ProtocolVersion.java | 2 +- .../Protocol1_18_2To1_18.java | 38 +++++++++++++++++++ gradle.properties | 2 +- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java index 99d00f389..fddd7df92 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java +++ b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java @@ -79,7 +79,7 @@ public class ProtocolVersion { public static final ProtocolVersion v1_17 = register(755, "1.17"); public static final ProtocolVersion v1_17_1 = register(756, "1.17.1"); public static final ProtocolVersion v1_18 = register(757, "1.18/1.18.1", new VersionRange("1.18", 0, 1)); - public static final ProtocolVersion v1_18_2 = register(758, 66, "1.18.2"); + public static final ProtocolVersion v1_18_2 = register(758, 67, "1.18.2"); public static final ProtocolVersion unknown = register(-1, "UNKNOWN"); public static ProtocolVersion register(int version, String name) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18_2to1_18/Protocol1_18_2To1_18.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18_2to1_18/Protocol1_18_2To1_18.java index 583951b69..d60cebcb6 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18_2to1_18/Protocol1_18_2To1_18.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18_2to1_18/Protocol1_18_2To1_18.java @@ -17,8 +17,14 @@ */ package com.viaversion.viaversion.protocols.protocol1_18_2to1_18; +import com.github.steveice10.opennbt.tag.builtin.CompoundTag; +import com.github.steveice10.opennbt.tag.builtin.ListTag; +import com.github.steveice10.opennbt.tag.builtin.StringTag; +import com.github.steveice10.opennbt.tag.builtin.Tag; import com.viaversion.viaversion.api.minecraft.RegistryType; import com.viaversion.viaversion.api.protocol.AbstractProtocol; +import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper; +import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.protocols.protocol1_17to1_16_4.ServerboundPackets1_17; import com.viaversion.viaversion.protocols.protocol1_18to1_17_1.ClientboundPackets1_18; import com.viaversion.viaversion.rewriter.TagRewriter; @@ -34,5 +40,37 @@ public final class Protocol1_18_2To1_18 extends AbstractProtocol { + final CompoundTag registry = wrapper.get(Type.NBT, 0); + final CompoundTag dimensionsHolder = registry.get("minecraft:dimension_type"); + final ListTag dimensions = dimensionsHolder.get("value"); + for (final Tag dimension : dimensions) { + addTagPrefix(((CompoundTag) dimension).get("element")); + } + + addTagPrefix(wrapper.get(Type.NBT, 1)); + }); + } + }); + + } + + private void addTagPrefix(CompoundTag tag) { + final Tag infiniburnTag = tag.get("infiniburn"); + if (infiniburnTag instanceof StringTag) { + final StringTag infiniburn = (StringTag) infiniburnTag; + infiniburn.setValue("#" + infiniburn.getValue()); + } } } diff --git a/gradle.properties b/gradle.properties index 0369970b2..435c50cf4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project properties - we put these here so they can be modified without causing a recompile of the build scripts -projectVersion=4.2.0-22w05a-SNAPSHOT +projectVersion=4.2.0-22w06a-SNAPSHOT # Gradle properties org.gradle.daemon=true