diff --git a/api/src/main/java/com/viaversion/viaversion/api/data/MappingDataBase.java b/api/src/main/java/com/viaversion/viaversion/api/data/MappingDataBase.java index 03de76d00..e3061df7f 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/data/MappingDataBase.java +++ b/api/src/main/java/com/viaversion/viaversion/api/data/MappingDataBase.java @@ -107,6 +107,7 @@ public class MappingDataBase implements MappingData { this.tags = new EnumMap<>(RegistryType.class); loadTags(RegistryType.ITEM, tagsTag); loadTags(RegistryType.BLOCK, tagsTag); + loadTags(RegistryType.ENTITY, tagsTag); } loadExtras(data); @@ -309,4 +310,4 @@ public class MappingDataBase implements MappingData { protected void loadExtras(final CompoundTag data) { } -} +} \ No newline at end of file diff --git a/api/src/main/java/com/viaversion/viaversion/api/rewriter/TagRewriter.java b/api/src/main/java/com/viaversion/viaversion/api/rewriter/TagRewriter.java index 9ea232f69..edba7249f 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/rewriter/TagRewriter.java +++ b/api/src/main/java/com/viaversion/viaversion/api/rewriter/TagRewriter.java @@ -32,7 +32,9 @@ public interface TagRewriter extends MappingDataListener { void removeTags(String registryKey); - void renameTag(RegistryType type, String registryKey, String renameTo); + void removeTag(RegistryType type, String tagId); + + void renameTag(RegistryType type, String tagId, String renameTo); /** * Adds an empty tag (since the client crashes if a checked tag is not registered). @@ -74,4 +76,4 @@ public interface TagRewriter extends MappingDataListener { List getNewTags(RegistryType tagType); List getOrComputeNewTags(RegistryType tagType); -} +} \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/Protocol1_12_2To1_13.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/Protocol1_12_2To1_13.java index 452fb8fc6..c22f5c5be 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/Protocol1_12_2To1_13.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_12_2to1_13/Protocol1_12_2To1_13.java @@ -151,19 +151,19 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol tag : MAPPINGS.getBlockTags().entrySet()) { wrapper.write(Types.STRING, tag.getKey()); // Needs copy as other protocols may modify it - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, tag.getValue()); + wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, tag.getValue().clone()); } wrapper.write(Types.VAR_INT, MAPPINGS.getItemTags().size()); // item tags for (Map.Entry tag : MAPPINGS.getItemTags().entrySet()) { wrapper.write(Types.STRING, tag.getKey()); // Needs copy as other protocols may modify it - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, tag.getValue()); + wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, tag.getValue().clone()); } wrapper.write(Types.VAR_INT, MAPPINGS.getFluidTags().size()); // fluid tags for (Map.Entry tag : MAPPINGS.getFluidTags().entrySet()) { wrapper.write(Types.STRING, tag.getKey()); // Needs copy as other protocols may modify it - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, tag.getValue()); + wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, tag.getValue().clone()); } }).scheduleSend(Protocol1_12_2To1_13.class); }; @@ -920,4 +920,4 @@ public class Protocol1_12_2To1_13 extends AbstractProtocol { @@ -47,6 +49,7 @@ public class Protocol1_13_2To1_14 extends AbstractProtocol tagRewriter = new TagRewriter<>(this); public Protocol1_13_2To1_14() { super(ClientboundPackets1_13.class, ClientboundPackets1_14.class, ServerboundPackets1_13.class, ServerboundPackets1_14.class); @@ -76,59 +79,12 @@ public class Protocol1_13_2To1_14 extends AbstractProtocol { - int blockTagsSize = wrapper.read(Types.VAR_INT); - wrapper.write(Types.VAR_INT, blockTagsSize + 6); // block tags - for (int i = 0; i < blockTagsSize; i++) { - wrapper.passthrough(Types.STRING); - int[] blockIds = wrapper.passthrough(Types.VAR_INT_ARRAY_PRIMITIVE); - for (int j = 0; j < blockIds.length; j++) { - blockIds[j] = MAPPINGS.getNewBlockId(blockIds[j]); - } + registerClientbound(ClientboundPackets1_13.UPDATE_TAGS, new PacketHandlers() { + @Override + protected void register() { + handler(tagRewriter.getHandler(RegistryType.FLUID)); + handler(wrapper -> tagRewriter.appendNewTags(wrapper, RegistryType.ENTITY)); } - // Minecraft crashes if we not send signs tags - wrapper.write(Types.STRING, "minecraft:signs"); - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, new int[]{ - MAPPINGS.getNewBlockId(150), MAPPINGS.getNewBlockId(155) - }); - wrapper.write(Types.STRING, "minecraft:wall_signs"); - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, new int[]{ - MAPPINGS.getNewBlockId(155) - }); - wrapper.write(Types.STRING, "minecraft:standing_signs"); - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, new int[]{ - MAPPINGS.getNewBlockId(150) - }); - // Fences and walls tags - used for block connections - wrapper.write(Types.STRING, "minecraft:fences"); - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, new int[]{189, 248, 472, 473, 474, 475}); - wrapper.write(Types.STRING, "minecraft:walls"); - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, new int[]{271, 272}); - wrapper.write(Types.STRING, "minecraft:wooden_fences"); - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, new int[]{189, 472, 473, 474, 475}); - int itemTagsSize = wrapper.read(Types.VAR_INT); - wrapper.write(Types.VAR_INT, itemTagsSize + 2); // item tags - for (int i = 0; i < itemTagsSize; i++) { - wrapper.passthrough(Types.STRING); - int[] itemIds = wrapper.passthrough(Types.VAR_INT_ARRAY_PRIMITIVE); - for (int j = 0; j < itemIds.length; j++) { - itemIds[j] = MAPPINGS.getNewItemId(itemIds[j]); - } - } - // Should fix fuel shift clicking - wrapper.write(Types.STRING, "minecraft:signs"); - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, new int[]{ - MAPPINGS.getNewItemId(541) - }); - // Arrows tag (used by bow) - wrapper.write(Types.STRING, "minecraft:arrows"); - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, new int[]{526, 825, 826}); - int fluidTagsSize = wrapper.passthrough(Types.VAR_INT); // fluid tags - for (int i = 0; i < fluidTagsSize; i++) { - wrapper.passthrough(Types.STRING); - wrapper.passthrough(Types.VAR_INT_ARRAY_PRIMITIVE); - } - wrapper.write(Types.VAR_INT, 0); // new entity tags - do we need to send this? }); // Set Difficulty packet added in 19w11a @@ -157,6 +113,8 @@ public class Protocol1_13_2To1_14 extends AbstractProtocol getTagRewriter() { + return tagRewriter; + } +} \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/Protocol1_14_4To1_15.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/Protocol1_14_4To1_15.java index 281e2918d..a852fca13 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/Protocol1_14_4To1_15.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_14_4to1_15/Protocol1_14_4To1_15.java @@ -67,12 +67,10 @@ public class Protocol1_14_4To1_15 extends AbstractProtocol getTagRewriter() { return tagRewriter; } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/Protocol1_15_2To1_16.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/Protocol1_15_2To1_16.java index 93ddbea78..2a17b3f49 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/Protocol1_15_2To1_16.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_15_2to1_16/Protocol1_15_2To1_16.java @@ -213,49 +213,6 @@ public class Protocol1_15_2To1_16 extends AbstractProtocol getTagRewriter() { return tagRewriter; } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/Protocol1_16_1To1_16_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/Protocol1_16_1To1_16_2.java index 20917c4d3..0e62e1cc6 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/Protocol1_16_1To1_16_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_1to1_16_2/Protocol1_16_1To1_16_2.java @@ -26,9 +26,9 @@ import com.viaversion.viaversion.data.entity.EntityTrackerBase; import com.viaversion.viaversion.protocols.v1_15_2to1_16.packet.ClientboundPackets1_16; import com.viaversion.viaversion.protocols.v1_15_2to1_16.packet.ServerboundPackets1_16; import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.data.MappingData1_16_2; -import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.rewriter.EntityPacketRewriter1_16_2; import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.packet.ClientboundPackets1_16_2; import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.packet.ServerboundPackets1_16_2; +import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.rewriter.EntityPacketRewriter1_16_2; import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.rewriter.ItemPacketRewriter1_16_2; import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.rewriter.WorldPacketRewriter1_16_2; import com.viaversion.viaversion.rewriter.SoundRewriter; @@ -86,19 +86,7 @@ public class Protocol1_16_1To1_16_2 extends AbstractProtocol - tagRewriter.addEmptyTags(RegistryType.ITEM, "minecraft:soul_fire_base_blocks", "minecraft:furnace_materials", "minecraft:crimson_stems", - "minecraft:gold_ores", "minecraft:piglin_loved", "minecraft:piglin_repellents", "minecraft:creeper_drop_music_discs", - "minecraft:logs_that_burn", "minecraft:stone_tool_materials", "minecraft:warped_stems"); - tagRewriter.addEmptyTags(RegistryType.BLOCK, "minecraft:infiniburn_nether", "minecraft:crimson_stems", - "minecraft:wither_summon_base_blocks", "minecraft:infiniburn_overworld", "minecraft:piglin_repellents", - "minecraft:hoglin_repellents", "minecraft:prevent_mob_spawning_inside", "minecraft:wart_blocks", - "minecraft:stone_pressure_plates", "minecraft:nylium", "minecraft:gold_ores", "minecraft:pressure_plates", - "minecraft:logs_that_burn", "minecraft:strider_warm_blocks", "minecraft:warped_stems", "minecraft:infiniburn_end", - "minecraft:base_stone_nether", "minecraft:base_stone_overworld"); + tagRewriter.removeTag(RegistryType.ITEM, "minecraft:furnace_materials"); super.onMappingDataLoaded(); } @@ -127,4 +115,4 @@ public class Protocol1_16_1To1_16_2 extends AbstractProtocol getTagRewriter() { return tagRewriter; } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java index 78b8d9cd0..4d976e120 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_16_4to1_17/Protocol1_16_4To1_17.java @@ -45,8 +45,6 @@ import com.viaversion.viaversion.rewriter.TagRewriter; public final class Protocol1_16_4To1_17 extends AbstractProtocol { public static final MappingData MAPPINGS = new MappingDataBase("1.16.2", "1.17"); - private static final String[] NEW_GAME_EVENT_TAGS = {"minecraft:ignore_vibrations_sneaking", "minecraft:vibrations"}; - private static final int[] EMPTY_ARRAY = new int[0]; private final EntityPacketRewriter1_17 entityRewriter = new EntityPacketRewriter1_17(this); private final ItemPacketRewriter1_17 itemRewriter = new ItemPacketRewriter1_17(this); private final TagRewriter tagRewriter = new TagRewriter<>(this); @@ -80,11 +78,7 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol(this).register(ClientboundPackets1_16_2.AWARD_STATS); @@ -174,19 +168,6 @@ public final class Protocol1_16_4To1_17 extends AbstractProtocol getTagRewriter() { return tagRewriter; } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/Protocol1_17_1To1_18.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/Protocol1_17_1To1_18.java index d401a7e73..9fa698ee4 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/Protocol1_17_1To1_18.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_17_1to1_18/Protocol1_17_1To1_18.java @@ -63,11 +63,6 @@ public final class Protocol1_17_1To1_18 extends AbstractProtocol(this).register(ClientboundPackets1_17_1.AWARD_STATS); @@ -97,6 +92,8 @@ public final class Protocol1_17_1To1_18 extends AbstractProtocol getTagRewriter() { + return tagRewriter; + } +} \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/Protocol1_18_2To1_19.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/Protocol1_18_2To1_19.java index f1d010ccf..0ca01ebfe 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/Protocol1_18_2To1_19.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_18_2to1_19/Protocol1_18_2To1_19.java @@ -19,6 +19,7 @@ package com.viaversion.viaversion.protocols.v1_18_2to1_19; import com.google.gson.JsonElement; import com.viaversion.viaversion.api.connection.UserConnection; +import com.viaversion.viaversion.api.minecraft.RegistryType; import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19; import com.viaversion.viaversion.api.platform.providers.ViaProviders; import com.viaversion.viaversion.api.protocol.AbstractProtocol; @@ -302,6 +303,18 @@ public final class Protocol1_18_2To1_19 extends AbstractProtocol getTagRewriter() { return tagRewriter; } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_18to1_18_2/Protocol1_18To1_18_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_18to1_18_2/Protocol1_18To1_18_2.java index cb2cd952d..2ff2d377d 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_18to1_18_2/Protocol1_18To1_18_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_18to1_18_2/Protocol1_18To1_18_2.java @@ -39,7 +39,7 @@ public final class Protocol1_18To1_18_2 extends AbstractProtocol tagRewriter = new TagRewriter<>(this); - tagRewriter.addEmptyTag(RegistryType.BLOCK, "minecraft:fall_damage_resetting"); + tagRewriter.addTagRaw(RegistryType.BLOCK, "minecraft:fall_damage_resetting", 169, 257, 680, 713, 714, 715, 716, 859, 860, 696, 100); tagRewriter.registerGeneric(ClientboundPackets1_18.UPDATE_TAGS); registerClientbound(ClientboundPackets1_18.UPDATE_MOB_EFFECT, new PacketHandlers() { @@ -89,4 +89,4 @@ public final class Protocol1_18To1_18_2 extends AbstractProtocol getTagRewriter() { return tagRewriter; } -} +} \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/Protocol1_19_4To1_20.java b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/Protocol1_19_4To1_20.java index 8494ae7e6..ef1dd980e 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/Protocol1_19_4To1_20.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/v1_19_4to1_20/Protocol1_19_4To1_20.java @@ -20,6 +20,7 @@ package com.viaversion.viaversion.protocols.v1_19_4to1_20; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.data.MappingData; import com.viaversion.viaversion.api.data.MappingDataBase; +import com.viaversion.viaversion.api.minecraft.RegistryType; import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19_4; import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.type.Types; @@ -80,6 +81,10 @@ public final class Protocol1_19_4To1_20 extends AbstractProtocol implements com.viavers private final Protocol protocol; private final Map> newTags = new EnumMap<>(RegistryType.class); private final Map> toRename = new EnumMap<>(RegistryType.class); - private final Set toRemove = new HashSet<>(); + private final Map> toRemove = new EnumMap<>(RegistryType.class); + private final Set toRemoveRegistries = new HashSet<>(); public TagRewriter(final Protocol protocol) { this.protocol = protocol; @@ -65,12 +66,17 @@ public class TagRewriter implements com.viavers @Override public void removeTags(final String registryKey) { - toRemove.add(registryKey); + toRemoveRegistries.add(Key.stripMinecraftNamespace(registryKey)); } @Override - public void renameTag(final RegistryType type, final String registryKey, final String renameTo) { - toRename.computeIfAbsent(type, t -> new HashMap<>()).put(registryKey, renameTo); + public void removeTag(final RegistryType type, final String tagId) { + toRemove.computeIfAbsent(type, t -> new HashSet<>()).add(Key.stripMinecraftNamespace(tagId)); + } + + @Override + public void renameTag(final RegistryType type, final String tagId, final String renameTo) { + toRename.computeIfAbsent(type, t -> new HashMap<>()).put(Key.stripMinecraftNamespace(tagId), renameTo); } @Override @@ -124,7 +130,7 @@ public class TagRewriter implements com.viavers public PacketHandler getHandler(@Nullable RegistryType readUntilType) { return wrapper -> { for (RegistryType type : RegistryType.getValues()) { - handle(wrapper, getRewriter(type), getNewTags(type), toRename.get(type)); + handle(wrapper, getRewriter(type), getNewTags(type), toRename.get(type), toRemove.get(type)); // Stop iterating if (type == readUntilType) { @@ -140,7 +146,7 @@ public class TagRewriter implements com.viavers int editedLength = length; for (int i = 0; i < length; i++) { String registryKey = wrapper.read(Types.STRING); - if (toRemove.contains(registryKey)) { + if (toRemoveRegistries.contains(Key.stripMinecraftNamespace(registryKey))) { wrapper.set(Types.VAR_INT, 0, --editedLength); int tagsSize = wrapper.read(Types.VAR_INT); for (int j = 0; j < tagsSize; j++) { @@ -155,31 +161,30 @@ public class TagRewriter implements com.viavers RegistryType type = RegistryType.getByKey(registryKey); if (type != null) { - handle(wrapper, getRewriter(type), getNewTags(type), toRename.get(type)); + handle(wrapper, getRewriter(type), getNewTags(type), toRename.get(type), toRemove.get(type)); } else { - handle(wrapper, null, null, null); + handle(wrapper, null, null, null, null); } } }; } public void handle(PacketWrapper wrapper, @Nullable IdRewriteFunction rewriteFunction, @Nullable List newTags) { - handle(wrapper, rewriteFunction, newTags, null); + handle(wrapper, rewriteFunction, newTags, null, null); } - public void handle(PacketWrapper wrapper, @Nullable IdRewriteFunction rewriteFunction, @Nullable List newTags, @Nullable Map tagsToRename) { + public void handle(PacketWrapper wrapper, @Nullable IdRewriteFunction rewriteFunction, @Nullable List newTags, @Nullable Map tagsToRename, @Nullable Set tagsToRemove) { int tagsSize = wrapper.read(Types.VAR_INT); - wrapper.write(Types.VAR_INT, newTags != null ? tagsSize + newTags.size() : tagsSize); // add new tags count + final List tags = new ArrayList<>(newTags != null ? tagsSize + newTags.size() : tagsSize); for (int i = 0; i < tagsSize; i++) { String key = wrapper.read(Types.STRING); if (tagsToRename != null) { - String renamedKey = tagsToRename.get(key); + String renamedKey = tagsToRename.get(Key.stripMinecraftNamespace(key)); if (renamedKey != null) { key = renamedKey; } } - wrapper.write(Types.STRING, key); int[] ids = wrapper.read(Types.VAR_INT_ARRAY_PRIMITIVE); if (rewriteFunction != null) { @@ -192,19 +197,39 @@ public class TagRewriter implements com.viavers } } - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, idList.toArray(EMPTY_ARRAY)); - } else { - // Write the original array - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, ids); + ids = idList.toArray(EMPTY_ARRAY); } + + tags.add(new TagData(key, ids)); } - // Send new tags if present + if (tagsToRemove != null) { + tags.removeIf(tag -> tagsToRemove.contains(Key.stripMinecraftNamespace(tag.identifier()))); + } + + // Add new tags if present if (newTags != null) { + tags.addAll(newTags); + } + + // Write the tags + wrapper.write(Types.VAR_INT, tags.size()); + for (TagData tag : tags) { + wrapper.write(Types.STRING, tag.identifier()); + wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, tag.entries()); + } + } + + public void appendNewTags(PacketWrapper wrapper, RegistryType type) { + List newTags = getNewTags(type); + if (newTags != null) { + wrapper.write(Types.VAR_INT, newTags.size()); for (TagData tag : newTags) { wrapper.write(Types.STRING, tag.identifier()); - wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, tag.entries()); + wrapper.write(Types.VAR_INT_ARRAY_PRIMITIVE, tag.entries().clone()); } + } else { + wrapper.write(Types.VAR_INT, 0); } } @@ -221,13 +246,10 @@ public class TagRewriter implements com.viavers public @Nullable IdRewriteFunction getRewriter(RegistryType tagType) { MappingData mappingData = protocol.getMappingData(); return switch (tagType) { - case BLOCK -> - mappingData != null && mappingData.getBlockMappings() != null ? mappingData::getNewBlockId : null; - case ITEM -> - mappingData != null && mappingData.getItemMappings() != null ? mappingData::getNewItemId : null; - case ENTITY -> - protocol.getEntityRewriter() != null ? id -> protocol.getEntityRewriter().newEntityId(id) : null; + case BLOCK -> mappingData != null && mappingData.getBlockMappings() != null ? mappingData::getNewBlockId : null; + case ITEM -> mappingData != null && mappingData.getItemMappings() != null ? mappingData::getNewItemId : null; + case ENTITY -> protocol.getEntityRewriter() != null ? id -> protocol.getEntityRewriter().newEntityId(id) : null; case FLUID, GAME_EVENT -> null; }; } -} +} \ No newline at end of file diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.12to1.13.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.12to1.13.nbt index 050e32146..3d0cf4fea 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.12to1.13.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.12to1.13.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.13.2to1.14.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.13.2to1.14.nbt index def3738b2..ebc33d457 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.13.2to1.14.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.13.2to1.14.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.14to1.15.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.14to1.15.nbt index 3c6b81188..492941aae 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.14to1.15.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.14to1.15.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.15to1.16.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.15to1.16.nbt index ce1925932..842fcf02c 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.15to1.16.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.15to1.16.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.16.2to1.17.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.16.2to1.17.nbt index 28de22977..1fcc9b7dc 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.16.2to1.17.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.16.2to1.17.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.16to1.16.2.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.16to1.16.2.nbt index 31a994e84..2df2db3d8 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.16to1.16.2.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.16to1.16.2.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.17to1.18.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.17to1.18.nbt index e516b004a..04cb086fc 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.17to1.18.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.17to1.18.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.18to1.19.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.18to1.19.nbt index 17c09d306..1bf5ab69f 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.18to1.19.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.18to1.19.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.19.3to1.19.4.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.19.3to1.19.4.nbt index 21c7158db..08e653709 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.19.3to1.19.4.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.19.3to1.19.4.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.19.4to1.20.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.19.4to1.20.nbt index a44466b0a..26434acbc 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.19.4to1.20.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.19.4to1.20.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.19to1.19.3.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.19to1.19.3.nbt index 838a529fe..0dee2b6d0 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.19to1.19.3.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.19to1.19.3.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.20.2to1.20.3.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.20.2to1.20.3.nbt index 682b709a4..171a63dd0 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.20.2to1.20.3.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.20.2to1.20.3.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.20.3to1.20.5.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.20.3to1.20.5.nbt index 95f929e47..38ed842b8 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.20.3to1.20.5.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.20.3to1.20.5.nbt differ diff --git a/common/src/main/resources/assets/viaversion/data/mappings-1.20to1.20.2.nbt b/common/src/main/resources/assets/viaversion/data/mappings-1.20to1.20.2.nbt index e5b33d7a3..1a2a590c2 100644 Binary files a/common/src/main/resources/assets/viaversion/data/mappings-1.20to1.20.2.nbt and b/common/src/main/resources/assets/viaversion/data/mappings-1.20to1.20.2.nbt differ