From 01121dedf34e950efcde8efea288ea0a141a4f62 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Sat, 1 Feb 2020 11:58:02 +0100 Subject: [PATCH] Configurable block/item mappings (1.9-1.12), cleanup Resolves #39 --- .../api/data/MappedLegacyBlockItem.java | 63 ++++++++ .../entities/blockitem/BlockItemSettings.java | 91 ----------- .../rewriters/LegacyBlockItemRewriter.java | 151 ++++++++++-------- .../rewriters/LegacyEnchantmentRewriter.java | 6 +- .../viabackwards/api/rewriters/Rewriter.java | 3 +- .../protocol1_10to1_11/EntityTypeNames.java | 21 ++- .../packets/BlockItemPackets1_11.java | 32 +--- .../packets/BlockItemPackets1_12.java | 39 ----- .../packets/ChangedPacketIds1_12.java | 5 - .../packets/ChatPackets1_12.java | 6 - .../packets/ItemPackets1_11_1.java | 2 - .../packets/PlayerPacket1_13.java | 5 - .../packets/SoundPackets1_13.java | 4 - .../packets/PlayerPackets1_14.java | 5 - .../packets/SoundPackets1_14.java | 4 - .../packets/BlockItemPackets1_15.java | 4 - .../packets/BlockItemPackets1_10.java | 11 -- .../nl/matsv/viabackwards/utils/Block.java | 10 +- ...tem-mappings.json => legacy-mappings.json} | 33 +++- 19 files changed, 213 insertions(+), 282 deletions(-) create mode 100644 core/src/main/java/nl/matsv/viabackwards/api/data/MappedLegacyBlockItem.java delete mode 100644 core/src/main/java/nl/matsv/viabackwards/api/entities/blockitem/BlockItemSettings.java rename core/src/main/resources/assets/viabackwards/data/{legacy-item-mappings.json => legacy-mappings.json} (57%) diff --git a/core/src/main/java/nl/matsv/viabackwards/api/data/MappedLegacyBlockItem.java b/core/src/main/java/nl/matsv/viabackwards/api/data/MappedLegacyBlockItem.java new file mode 100644 index 00000000..b0053dfb --- /dev/null +++ b/core/src/main/java/nl/matsv/viabackwards/api/data/MappedLegacyBlockItem.java @@ -0,0 +1,63 @@ +package nl.matsv.viabackwards.api.data; + +import net.md_5.bungee.api.ChatColor; +import nl.matsv.viabackwards.utils.Block; +import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag; + +public class MappedLegacyBlockItem { + + private final int id; + private final short data; + private final String name; + private Block block; + private BlockEntityHandler blockEntityHandler; + + public MappedLegacyBlockItem(int id, short data, String name) { + this.id = id; + this.data = data; + this.name = name != null ? ChatColor.RESET + name : null; + } + + public int getId() { + return id; + } + + public short getData() { + return data; + } + + public String getName() { + return name; + } + + public boolean isBlock() { + return block != null; + } + + // Mark this as a block item + public void setBlock() { + block = new Block(id, data); + } + + public Block getBlock() { + return block; + } + + public boolean hasBlockEntityHandler() { + return blockEntityHandler != null; + } + + public BlockEntityHandler getBlockEntityHandler() { + return blockEntityHandler; + } + + public void setBlockEntityHandler(BlockEntityHandler blockEntityHandler) { + this.blockEntityHandler = blockEntityHandler; + } + + @FunctionalInterface + public interface BlockEntityHandler { + + CompoundTag handleOrNewCompoundTag(int block, CompoundTag tag); + } +} diff --git a/core/src/main/java/nl/matsv/viabackwards/api/entities/blockitem/BlockItemSettings.java b/core/src/main/java/nl/matsv/viabackwards/api/entities/blockitem/BlockItemSettings.java deleted file mode 100644 index dd0f4a86..00000000 --- a/core/src/main/java/nl/matsv/viabackwards/api/entities/blockitem/BlockItemSettings.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2016 Matsv - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package nl.matsv.viabackwards.api.entities.blockitem; - -import nl.matsv.viabackwards.utils.Block; -import us.myles.ViaVersion.api.minecraft.item.Item; -import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag; - -public class BlockItemSettings { - private final int id; - private Item repItem; - private Block repBlock; - private BlockEntityHandler blockEntityHandler; - private ItemHandler itemHandler; - - public BlockItemSettings(int id) { - this.id = id; - } - - public BlockItemSettings repItem(Item item) { - this.repItem = item; - return this; - } - - public BlockItemSettings repBlock(Block block) { - this.repBlock = block; - return this; - } - - public BlockItemSettings blockEntityHandler(BlockEntityHandler handler) { - this.blockEntityHandler = handler; - return this; - } - - public BlockItemSettings itemHandler(ItemHandler handler) { - this.itemHandler = handler; - return this; - } - - public boolean hasRepItem() { - return repItem != null; - } - - public boolean hasRepBlock() { - return repBlock != null; - } - - public boolean hasEntityHandler() { - return blockEntityHandler != null; - } - - public boolean hasItemTagHandler() { - return itemHandler != null; - } - - public int getId() { - return id; - } - - public Item getRepItem() { - return repItem; - } - - public Block getRepBlock() { - return repBlock; - } - - public BlockEntityHandler getBlockEntityHandler() { - return blockEntityHandler; - } - - public ItemHandler getItemHandler() { - return itemHandler; - } - - public interface BlockEntityHandler { - CompoundTag handleOrNewCompoundTag(int block, CompoundTag tag); - } - - public interface ItemHandler { - Item handle(Item i); - } -} diff --git a/core/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyBlockItemRewriter.java b/core/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyBlockItemRewriter.java index 78cecc59..e343ffc0 100644 --- a/core/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyBlockItemRewriter.java +++ b/core/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyBlockItemRewriter.java @@ -12,99 +12,122 @@ package nl.matsv.viabackwards.api.rewriters; import net.md_5.bungee.api.ChatColor; import nl.matsv.viabackwards.api.BackwardsProtocol; -import nl.matsv.viabackwards.api.entities.blockitem.BlockItemSettings; +import nl.matsv.viabackwards.api.data.MappedLegacyBlockItem; +import nl.matsv.viabackwards.api.data.VBMappingDataLoader; import nl.matsv.viabackwards.protocol.protocol1_11_1to1_12.data.BlockColors; import nl.matsv.viabackwards.utils.Block; -import nl.matsv.viabackwards.utils.ItemUtil; import us.myles.ViaVersion.api.minecraft.chunks.Chunk; import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection; import us.myles.ViaVersion.api.minecraft.item.Item; import us.myles.ViaVersion.api.rewriters.IdRewriteFunction; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.ChatRewriter; +import us.myles.viaversion.libs.gson.JsonElement; +import us.myles.viaversion.libs.gson.JsonObject; +import us.myles.viaversion.libs.gson.JsonPrimitive; import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag; import us.myles.viaversion.libs.opennbt.tag.builtin.IntTag; import us.myles.viaversion.libs.opennbt.tag.builtin.StringTag; -import us.myles.viaversion.libs.opennbt.tag.builtin.Tag; import java.util.HashMap; import java.util.Map; public abstract class LegacyBlockItemRewriter extends ItemRewriterBase { - private final Map replacementData = new HashMap<>(); + private static final Map> LEGACY_MAPPINGS = new HashMap<>(); + protected final Map replacementData; + + static { + JsonObject jsonObject = VBMappingDataLoader.loadData("legacy-mappings.json"); + for (Map.Entry entry : jsonObject.entrySet()) { + Map mappings = new HashMap<>(); + LEGACY_MAPPINGS.put(entry.getKey(), mappings); + for (Map.Entry dataEntry : entry.getValue().getAsJsonObject().entrySet()) { + JsonObject object = dataEntry.getValue().getAsJsonObject(); + int id = object.getAsJsonPrimitive("id").getAsInt(); + JsonPrimitive jsonData = object.getAsJsonPrimitive("data"); + short data = jsonData != null ? jsonData.getAsShort() : 0; + String name = object.getAsJsonPrimitive("name").getAsString(); + + if (dataEntry.getKey().contains("-")) { + // Range of ids + String[] split = dataEntry.getKey().split("-", 2); + int from = Integer.parseInt(split[0]); + int to = Integer.parseInt(split[1]); + + // Special block color handling + if (name.contains("%color%")) { + for (int i = from; i <= to; i++) { + mappings.put(i, new MappedLegacyBlockItem(id, data, name.replace("%color%", BlockColors.get(i - from)))); + } + } else { + MappedLegacyBlockItem mappedBlockItem = new MappedLegacyBlockItem(id, data, name); + for (int i = from; i <= to; i++) { + mappings.put(i, mappedBlockItem); + } + } + } else { + mappings.put(Integer.parseInt(dataEntry.getKey()), new MappedLegacyBlockItem(id, data, name)); + } + } + } + } protected LegacyBlockItemRewriter(T protocol, IdRewriteFunction oldRewriter, IdRewriteFunction newRewriter) { super(protocol, oldRewriter, newRewriter, false); + replacementData = LEGACY_MAPPINGS.get(protocol.getClass().getSimpleName().split("To")[1].replace("_", ".")); } protected LegacyBlockItemRewriter(T protocol) { - super(protocol, false); + this(protocol, null, null); } - protected BlockItemSettings rewrite(int itemId) { - BlockItemSettings settings = new BlockItemSettings(itemId); - replacementData.put(itemId, settings); - return settings; + protected void markAsBlock(int... ids) { + for (int id : ids) { + replacementData.get(id).setBlock(); + } } @Override public Item handleItemToClient(Item item) { if (item == null) return null; - BlockItemSettings data = replacementData.get(item.getIdentifier()); + MappedLegacyBlockItem data = replacementData.get(item.getIdentifier()); if (data == null) { // Just rewrite the id return super.handleItemToClient(item); } - Item original = ItemUtil.copyItem(item); - if (data.hasRepItem()) { - // Also includes the already mapped id - ItemUtil.copyItem(item, data.getRepItem()); + if (item.getTag() == null) { + item.setTag(new CompoundTag("")); + } - if (item.getTag() == null) { - item.setTag(new CompoundTag("")); + // Backup data for toServer + short originalData = item.getData(); + item.getTag().put(createViaNBT(item)); + + item.setIdentifier(data.getId()); + // Keep original data if mapped data is set to -1 + if (data.getData() != -1) { + item.setData(data.getData()); + } + + // Set display name + if (data.getName() != null) { + CompoundTag tag = item.getTag().get("display"); + if (tag == null) { + item.getTag().put(tag = new CompoundTag("display")); } - - // Backup data for toServer - item.getTag().put(createViaNBT(original)); - - // Keep original data (aside from the name) - if (original.getTag() != null) { - for (Tag ai : original.getTag()) { - item.getTag().put(ai); - } + StringTag nameTag = tag.get("Name"); + if (nameTag == null) { + tag.put(nameTag = new StringTag("Name", data.getName())); } // Handle colors - CompoundTag tag = item.getTag().get("display"); - if (tag != null) { - StringTag nameTag = tag.get("Name"); - if (nameTag != null) { - String value = nameTag.getValue(); - if (value.contains("%vb_color%")) { - tag.put(new StringTag("Name", value.replace("%vb_color%", BlockColors.get(original.getData())))); - } - } + String value = nameTag.getValue(); + if (value.contains("%vb_color%")) { + tag.put(new StringTag("Name", value.replace("%vb_color%", BlockColors.get(originalData)))); } - - item.setAmount(original.getAmount()); - // Keep original data when -1 - if (item.getData() == -1) { - item.setData(original.getData()); - } - } else { - // Set the mapped id if no custom item is defined - super.handleItemToClient(item); } - - if (data.hasItemTagHandler()) { - if (!item.getTag().contains(nbtTagName)) { - item.getTag().put(createViaNBT(original)); - } - data.getItemHandler().handle(item); - } - return item; } @@ -119,10 +142,10 @@ public abstract class LegacyBlockItemRewriter exten } public Block handleBlock(int blockId, int data) { - BlockItemSettings settings = replacementData.get(blockId); - if (settings == null || !settings.hasRepBlock()) return null; + MappedLegacyBlockItem settings = replacementData.get(blockId); + if (settings == null || !settings.isBlock()) return null; - Block block = settings.getRepBlock(); + Block block = settings.getBlock(); // For some blocks, the data can still be useful (: if (block.getData() == -1) { return block.withData(data); @@ -148,8 +171,8 @@ public abstract class LegacyBlockItemRewriter exten int block = section.getFlatBlock(pos.getX(), pos.getY() & 0xF, pos.getZ()); int btype = block >> 4; - BlockItemSettings settings = replacementData.get(btype); - if (settings != null && settings.hasEntityHandler()) { + MappedLegacyBlockItem settings = replacementData.get(btype); + if (settings != null && settings.hasBlockEntityHandler()) { settings.getBlockEntityHandler().handleOrNewCompoundTag(block, tag); } } @@ -174,8 +197,8 @@ public abstract class LegacyBlockItemRewriter exten // We already know that is has a handler if (hasBlockEntityHandler) continue; - BlockItemSettings settings = replacementData.get(btype); - if (settings != null && settings.hasEntityHandler()) { + MappedLegacyBlockItem settings = replacementData.get(btype); + if (settings != null && settings.hasBlockEntityHandler()) { hasBlockEntityHandler = true; } } @@ -190,8 +213,8 @@ public abstract class LegacyBlockItemRewriter exten int btype = block >> 4; int meta = block & 15; - BlockItemSettings settings = replacementData.get(btype); - if (settings == null || !settings.hasEntityHandler()) continue; + MappedLegacyBlockItem settings = replacementData.get(btype); + if (settings == null || !settings.hasBlockEntityHandler()) continue; Pos pos = new Pos(x, (y + (i << 4)), z); @@ -221,11 +244,13 @@ public abstract class LegacyBlockItemRewriter exten private static final class Pos { - private final int x, y, z; + private final int x; + private final short y; + private final int z; - private Pos(final int x, final int y, final int z) { + private Pos(int x, int y, int z) { this.x = x; - this.y = y; + this.y = (short) y; this.z = z; } diff --git a/core/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyEnchantmentRewriter.java b/core/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyEnchantmentRewriter.java index ff04ae90..969b89f9 100644 --- a/core/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyEnchantmentRewriter.java +++ b/core/src/main/java/nl/matsv/viabackwards/api/rewriters/LegacyEnchantmentRewriter.java @@ -117,10 +117,10 @@ public class LegacyEnchantmentRewriter { tag.remove(remappedEnchantments.getName()); } - public void setHideLevelForEnchants(Integer... enchants) { + public void setHideLevelForEnchants(int... enchants) { this.hideLevelForEnchants = new HashSet<>(); - for (Integer enchant : enchants) { - hideLevelForEnchants.add(enchant.shortValue()); + for (int enchant : enchants) { + hideLevelForEnchants.add((short) enchant); } } } diff --git a/core/src/main/java/nl/matsv/viabackwards/api/rewriters/Rewriter.java b/core/src/main/java/nl/matsv/viabackwards/api/rewriters/Rewriter.java index 2fec3715..aaf8aaf7 100644 --- a/core/src/main/java/nl/matsv/viabackwards/api/rewriters/Rewriter.java +++ b/core/src/main/java/nl/matsv/viabackwards/api/rewriters/Rewriter.java @@ -35,7 +35,8 @@ public abstract class Rewriter { /** * Register rewrites. */ - protected abstract void registerRewrites(); + protected void registerRewrites() { + } public T getProtocol() { return protocol; diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/EntityTypeNames.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/EntityTypeNames.java index d4cf3dee..02b577e3 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/EntityTypeNames.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/EntityTypeNames.java @@ -15,6 +15,7 @@ import com.google.common.collect.HashBiMap; import us.myles.ViaVersion.api.minecraft.item.Item; import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag; import us.myles.viaversion.libs.opennbt.tag.builtin.StringTag; +import us.myles.viaversion.libs.opennbt.tag.builtin.Tag; /* Copied from ViaVersion @@ -106,8 +107,9 @@ public class EntityTypeNames { } public static void toClient(CompoundTag tag) { - if (tag.get("id") instanceof StringTag) { - StringTag id = tag.get("id"); + Tag idTag = tag.get("id"); + if (idTag instanceof StringTag) { + StringTag id = (StringTag) idTag; if (NEW_TO_OLD_NAMES.containsKey(id.getValue())) { id.setValue(NEW_TO_OLD_NAMES.get(id.getValue())); } @@ -115,10 +117,12 @@ public class EntityTypeNames { } public static void toClientSpawner(CompoundTag tag) { - if (tag != null && tag.contains("SpawnData")) { - CompoundTag spawnData = tag.get("SpawnData"); - if (spawnData != null && spawnData.contains("id")) + Tag spawnDataTag; + if (tag != null && (spawnDataTag = tag.get("SpawnData")) != null) { + CompoundTag spawnData = (CompoundTag) spawnDataTag; + if (spawnData != null && spawnData.contains("id")) { toClient(spawnData); + } } } @@ -132,9 +136,10 @@ public class EntityTypeNames { private static boolean hasEntityTag(Item item) { if (item != null && item.getIdentifier() == 383) { // Monster Egg CompoundTag tag = item.getTag(); - if (tag != null && tag.contains("EntityTag") && tag.get("EntityTag") instanceof CompoundTag) { - if (((CompoundTag) tag.get("EntityTag")).get("id") instanceof StringTag) { - return true; + if (tag != null) { + Tag entityTag = tag.get("EntityTag"); + if (entityTag instanceof CompoundTag) { + return ((CompoundTag) entityTag).get("id") instanceof StringTag; } } } diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java index 39dddeee..d70593c8 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java @@ -11,6 +11,7 @@ package nl.matsv.viabackwards.protocol.protocol1_10to1_11.packets; import net.md_5.bungee.api.ChatColor; +import nl.matsv.viabackwards.api.data.MappedLegacyBlockItem; import nl.matsv.viabackwards.api.entities.storage.EntityTracker; import nl.matsv.viabackwards.api.rewriters.LegacyBlockItemRewriter; import nl.matsv.viabackwards.api.rewriters.LegacyEnchantmentRewriter; @@ -18,8 +19,6 @@ import nl.matsv.viabackwards.protocol.protocol1_10to1_11.EntityTypeNames; import nl.matsv.viabackwards.protocol.protocol1_10to1_11.Protocol1_10To1_11; import nl.matsv.viabackwards.protocol.protocol1_10to1_11.storage.ChestedHorseStorage; import nl.matsv.viabackwards.protocol.protocol1_10to1_11.storage.WindowTracker; -import nl.matsv.viabackwards.protocol.protocol1_11_1to1_12.data.BlockColors; -import nl.matsv.viabackwards.utils.Block; import us.myles.ViaVersion.api.PacketWrapper; import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.entities.Entity1_11Types; @@ -352,32 +351,12 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter { + // Handle spawner block entity (map to itself with custom handler) + replacementData.computeIfAbsent(52, s -> new MappedLegacyBlockItem(52, (short) -1, null)).setBlockEntityHandler((b, tag) -> { EntityTypeNames.toClientSpawner(tag); return tag; }); - // Rewrite spawn eggs - rewrite(383).itemHandler((i) -> { - EntityTypeNames.toClientItem(i); - return i; - }); - - // Totem of Undying to Dead Bush - rewrite(449).repItem(new Item(32, (byte) 1, (short) 0, getNamedTag("1.11 Totem of Undying"))); - - // Shulker shell to Popped Chorus Fruit - rewrite(450).repItem(new Item(433, (byte) 1, (short) 0, getNamedTag("1.11 Shulker Shell"))); - enchantmentRewriter = new LegacyEnchantmentRewriter(nbtTagName); enchantmentRewriter.registerEnchantment(71, "§cCurse of Vanishing"); enchantmentRewriter.registerEnchantment(10, "§cCurse of Binding"); @@ -386,13 +365,16 @@ public class BlockItemPackets1_11 extends LegacyBlockItemRewriter { @@ -263,37 +257,4 @@ public class BlockItemPackets1_12 extends LegacyBlockItemRewriter Stained clay? (Also got a new name Terracota?) - rewrite(251).repItem(new Item(159, (byte) 1, (short) -1, getNamedTag("1.12 %vb_color% Concrete"))) - .repBlock(new Block(159, -1)); - - // Concrete Powder -> Wool - rewrite(252) - .repItem(new Item(35, (byte) 1, (short) -1, getNamedTag("1.12 %vb_color% Concrete Powder"))) - .repBlock(new Block(35, -1)); - - // Knowledge book -> book - rewrite(453) - .repItem(new Item(340, (byte) 1, (short) 0, getNamedTag("1.12 Knowledge Book"))) - .itemHandler(i -> { - CompoundTag tag = i.getTag(); - - if (!tag.contains("ench")) - tag.put(new ListTag("ench", Collections.emptyList())); - - return i; - }); - - // Glazed Terracotta -> Stained Clay - for (int i = 235; i < 251; i++) { - rewrite(i).repItem(new Item(159, (byte) 1, (short) (i - 235), getNamedTag("1.12 " + BlockColors.get(i - 235) + " Glazed Terracotta"))) - .repBlock(new Block(159, (i - 235))); - } - - // Handle beds - rewrite(355).repItem(new Item(355, (byte) 1, (short) 0, getNamedTag("1.12 %vb_color% Bed"))); - } } diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/ChangedPacketIds1_12.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/ChangedPacketIds1_12.java index 55ebd0ca..ab319283 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/ChangedPacketIds1_12.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/ChangedPacketIds1_12.java @@ -96,9 +96,4 @@ public class ChangedPacketIds1_12 extends Rewriter { protocol.registerIncoming(State.PLAY, 0x1F, 0x1C); // Player Block Placement protocol.registerIncoming(State.PLAY, 0x20, 0x1D); // Use Item } - - @Override - protected void registerRewrites() { - - } } diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/ChatPackets1_12.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/ChatPackets1_12.java index 0c69fcb6..79cef96d 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/ChatPackets1_12.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11_1to1_12/packets/ChatPackets1_12.java @@ -103,10 +103,4 @@ public class ChatPackets1_12 extends Rewriter { } return result; } - - @Override - protected void registerRewrites() { - - } - } diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11to1_11_1/packets/ItemPackets1_11_1.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11to1_11_1/packets/ItemPackets1_11_1.java index 4e42bd0e..3924f331 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11to1_11_1/packets/ItemPackets1_11_1.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_11to1_11_1/packets/ItemPackets1_11_1.java @@ -95,8 +95,6 @@ public class ItemPackets1_11_1 extends LegacyBlockItemRewriter { } }); } - - @Override - protected void registerRewrites() { - - } } diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/packets/SoundPackets1_13.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/packets/SoundPackets1_13.java index 44138bb9..b9e92e90 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/packets/SoundPackets1_13.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/packets/SoundPackets1_13.java @@ -86,8 +86,4 @@ public class SoundPackets1_13 extends Rewriter { } }); } - - @Override - protected void registerRewrites() { - } } diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/PlayerPackets1_14.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/PlayerPackets1_14.java index adf5c377..7e8bf127 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/PlayerPackets1_14.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/PlayerPackets1_14.java @@ -145,9 +145,4 @@ public class PlayerPackets1_14 extends Rewriter { } }); } - - @Override - protected void registerRewrites() { - - } } diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/SoundPackets1_14.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/SoundPackets1_14.java index 40c80ce8..398186b0 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/SoundPackets1_14.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/packets/SoundPackets1_14.java @@ -84,8 +84,4 @@ public class SoundPackets1_14 extends Rewriter { } }); } - - @Override - protected void registerRewrites() { - } } diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/packets/BlockItemPackets1_15.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/packets/BlockItemPackets1_15.java index fe4d2682..9b217d44 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/packets/BlockItemPackets1_15.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/packets/BlockItemPackets1_15.java @@ -211,10 +211,6 @@ public class BlockItemPackets1_15 extends nl.matsv.viabackwards.api.rewriters.It }); } - @Override - protected void registerRewrites() { - } - public static int getNewItemId(int id) { Integer newId = MappingData.oldToNewItems.get(id); if (newId == null) { diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/packets/BlockItemPackets1_10.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/packets/BlockItemPackets1_10.java index 8e2f3823..29c9dc01 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/packets/BlockItemPackets1_10.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/packets/BlockItemPackets1_10.java @@ -12,7 +12,6 @@ package nl.matsv.viabackwards.protocol.protocol1_9_4to1_10.packets; import nl.matsv.viabackwards.api.rewriters.LegacyBlockItemRewriter; import nl.matsv.viabackwards.protocol.protocol1_9_4to1_10.Protocol1_9_4To1_10; -import nl.matsv.viabackwards.utils.Block; import us.myles.ViaVersion.api.PacketWrapper; import us.myles.ViaVersion.api.minecraft.BlockChangeRecord; import us.myles.ViaVersion.api.minecraft.chunks.Chunk; @@ -178,14 +177,4 @@ public class BlockItemPackets1_10 extends LegacyBlockItemRewriter