diff --git a/bukkit/src/main/java/nl/matsv/viabackwards/BukkitPlugin.java b/bukkit/src/main/java/nl/matsv/viabackwards/BukkitPlugin.java index 9056db2c..4be9bd39 100644 --- a/bukkit/src/main/java/nl/matsv/viabackwards/BukkitPlugin.java +++ b/bukkit/src/main/java/nl/matsv/viabackwards/BukkitPlugin.java @@ -14,9 +14,10 @@ import nl.matsv.viabackwards.api.ViaBackwardsPlatform; import org.bukkit.plugin.java.JavaPlugin; public class BukkitPlugin extends JavaPlugin implements ViaBackwardsPlatform { + @Override public void onEnable() { - this.init(getDataFolder()); + init(getDataFolder()); } @Override diff --git a/core/src/main/java/nl/matsv/viabackwards/api/BackwardsProtocol.java b/core/src/main/java/nl/matsv/viabackwards/api/BackwardsProtocol.java index 8074c8e7..bca22a29 100644 --- a/core/src/main/java/nl/matsv/viabackwards/api/BackwardsProtocol.java +++ b/core/src/main/java/nl/matsv/viabackwards/api/BackwardsProtocol.java @@ -11,11 +11,21 @@ package nl.matsv.viabackwards.api; import us.myles.ViaVersion.api.protocol.Protocol; +import us.myles.ViaVersion.api.protocol.ProtocolRegistry; import us.myles.ViaVersion.api.remapper.PacketRemapper; import us.myles.ViaVersion.packets.State; +import java.util.concurrent.CompletableFuture; + public abstract class BackwardsProtocol extends Protocol { + protected BackwardsProtocol() { + } + + protected BackwardsProtocol(boolean hasMappingDataToLoad) { + super(hasMappingDataToLoad); + } + public void out(State state, int oldPacketID, int newPacketID) { this.registerOutgoing(state, oldPacketID, newPacketID, null); } @@ -31,4 +41,18 @@ public abstract class BackwardsProtocol extends Protocol { public void in(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper) { this.registerIncoming(state, oldPacketID, newPacketID, packetRemapper); } + + /** + * Waits for the given protocol to be loaded to then asynchronously execute the runnable for this protocol. + */ + protected void executeAsyncAfterLoaded(Class protocolClass, Runnable runnable) { + CompletableFuture future = ProtocolRegistry.getMappingLoaderFuture(protocolClass); + if (future == null) { + runnable.run(); + return; + } + + // If the protocol to depend on has been loaded, execute the new runnable async and schedule it for necessary completion + future.whenComplete((v, t) -> ProtocolRegistry.addMappingLoaderFuture(getClass(), runnable)); + } } diff --git a/core/src/main/java/nl/matsv/viabackwards/api/data/VBMappingDataLoader.java b/core/src/main/java/nl/matsv/viabackwards/api/data/VBMappingDataLoader.java index e60314a7..67f8f36d 100644 --- a/core/src/main/java/nl/matsv/viabackwards/api/data/VBMappingDataLoader.java +++ b/core/src/main/java/nl/matsv/viabackwards/api/data/VBMappingDataLoader.java @@ -9,7 +9,6 @@ import us.myles.viaversion.libs.gson.*; import java.io.*; import java.util.Map; -//TODO merge data loading with VV's MappingDataLoader, diff is in data folder and data inputstream public class VBMappingDataLoader { public static JsonObject loadFromDataDir(String name) { diff --git a/core/src/main/java/nl/matsv/viabackwards/api/rewriters/SoundRewriter.java b/core/src/main/java/nl/matsv/viabackwards/api/rewriters/SoundRewriter.java index 7b0c7ae6..19dec460 100644 --- a/core/src/main/java/nl/matsv/viabackwards/api/rewriters/SoundRewriter.java +++ b/core/src/main/java/nl/matsv/viabackwards/api/rewriters/SoundRewriter.java @@ -1,19 +1,28 @@ package nl.matsv.viabackwards.api.rewriters; import nl.matsv.viabackwards.api.BackwardsProtocol; -import nl.matsv.viabackwards.api.data.VBSoundMappings; import us.myles.ViaVersion.api.remapper.PacketRemapper; +import us.myles.ViaVersion.api.rewriters.IdRewriteFunction; import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.packets.State; +import java.util.function.Function; + public class SoundRewriter { private final BackwardsProtocol protocol; - private final VBSoundMappings soundMappings; + // Can't hold the mappings instance here since it's loaded later + private final IdRewriteFunction idRewriter; + private final Function stringIdRewriter; - public SoundRewriter(BackwardsProtocol protocol, VBSoundMappings soundMappings) { + public SoundRewriter(BackwardsProtocol protocol, IdRewriteFunction idRewriter, Function stringIdRewriter) { this.protocol = protocol; - this.soundMappings = soundMappings; + this.idRewriter = idRewriter; + this.stringIdRewriter = stringIdRewriter; + } + + public SoundRewriter(BackwardsProtocol protocol, IdRewriteFunction idRewriter) { + this(protocol, idRewriter, null); } // The same for entity sound effect @@ -24,7 +33,7 @@ public class SoundRewriter { map(Type.VAR_INT); // Sound Id handler(wrapper -> { int soundId = wrapper.get(Type.VAR_INT, 0); - int mappedId = soundMappings.getNewId(soundId); + int mappedId = idRewriter.rewrite(soundId); if (mappedId != -1 && soundId != mappedId) { wrapper.set(Type.VAR_INT, 0, mappedId); } @@ -40,7 +49,7 @@ public class SoundRewriter { map(Type.STRING); // Sound identifier handler(wrapper -> { String soundId = wrapper.get(Type.STRING, 0); - String mappedId = soundMappings.getNewId(soundId); + String mappedId = stringIdRewriter.apply(soundId); if (mappedId == null) return; if (!mappedId.isEmpty()) { wrapper.set(Type.STRING, 0, mappedId); diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/Protocol1_12_2To1_13.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/Protocol1_12_2To1_13.java index ae78e85f..d1e53cf7 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/Protocol1_12_2To1_13.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/Protocol1_12_2To1_13.java @@ -27,23 +27,25 @@ import nl.matsv.viabackwards.protocol.protocol1_12_2to1_13.storage.BackwardsBloc import nl.matsv.viabackwards.protocol.protocol1_12_2to1_13.storage.PlayerPositionStorage1_13; import nl.matsv.viabackwards.protocol.protocol1_12_2to1_13.storage.TabCompleteStorage; import us.myles.ViaVersion.api.PacketWrapper; +import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.data.UserConnection; -import us.myles.ViaVersion.api.platform.providers.ViaProviders; import us.myles.ViaVersion.api.remapper.PacketRemapper; import us.myles.ViaVersion.packets.State; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; public class Protocol1_12_2To1_13 extends BackwardsProtocol { private BlockItemPackets1_13 blockItemPackets; - static { - BackwardsMappings.init(); - PaintingMapping.init(); - } - @Override protected void registerPackets() { + executeAsyncAfterLoaded(Protocol1_13To1_12_2.class, () -> { + BackwardsMappings.init(); + PaintingMapping.init(); + Via.getManager().getProviders().register(BackwardsBlockEntityProvider.class, new BackwardsBlockEntityProvider()); + }); + (blockItemPackets = new BlockItemPackets1_13(this)).register(); new EntityPackets1_13(this).register(); new PlayerPacket1_13(this).register(); @@ -182,11 +184,6 @@ public class Protocol1_12_2To1_13 extends BackwardsProtocol { } } - @Override - protected void register(ViaProviders providers) { - providers.register(BackwardsBlockEntityProvider.class, new BackwardsBlockEntityProvider()); - } - public PacketRemapper cancel() { return new PacketRemapper() { @Override diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/block_entity_handlers/PistonHandler.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/block_entity_handlers/PistonHandler.java index b86360b1..248503ae 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/block_entity_handlers/PistonHandler.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/block_entity_handlers/PistonHandler.java @@ -41,7 +41,7 @@ public class PistonHandler implements BackwardsBlockEntityProvider.BackwardsBloc addEntries(entry.getKey(), entry.getValue()); } } else { - JsonObject mappings = MappingDataLoader.loadData("mapping-1.13.json").getAsJsonObject("blocks"); + JsonObject mappings = MappingDataLoader.getMappingsCache().get("mapping-1.13.json").getAsJsonObject("blocks"); for (Map.Entry blockState : mappings.entrySet()) { String key = blockState.getValue().getAsString(); if (!key.contains("piston")) continue; diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java index a73dce8d..21be0641 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java @@ -37,11 +37,11 @@ public class BackwardsMappings { public static Mappings enchantmentMappings; public static void init() { - JsonObject mapping1_12 = MappingDataLoader.loadData("mapping-1.12.json"); - JsonObject mapping1_13 = MappingDataLoader.loadData("mapping-1.13.json"); + ViaBackwards.getPlatform().getLogger().info("Loading 1.13 -> 1.12.2 mappings..."); + JsonObject mapping1_12 = MappingDataLoader.getMappingsCache().get("mapping-1.12.json"); + JsonObject mapping1_13 = MappingDataLoader.getMappingsCache().get("mapping-1.13.json"); JsonObject mapping1_12_2to1_13 = VBMappingDataLoader.loadFromDataDir("mapping-1.12.2to1.13.json"); - ViaBackwards.getPlatform().getLogger().info("Loading 1.13 -> 1.12.2 mappings..."); blockMappings = new BlockMappingsShortArray(mapping1_13.getAsJsonObject("blocks"), mapping1_12.getAsJsonObject("blocks"), mapping1_12_2to1_13.getAsJsonObject("blockstates")); itemMappings = new VBItemMappings(mapping1_13.getAsJsonObject("items"), mapping1_12.getAsJsonObject("items"), mapping1_12_2to1_13.getAsJsonObject("items")); soundMappings = new VBSoundMappings(mapping1_13.getAsJsonArray("sounds"), mapping1_12.getAsJsonArray("sounds"), mapping1_12_2to1_13.getAsJsonObject("sounds")); diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/Protocol1_13_2To1_14.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/Protocol1_13_2To1_14.java index 331ed0b8..8b653ef1 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/Protocol1_13_2To1_14.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/Protocol1_13_2To1_14.java @@ -16,21 +16,19 @@ import us.myles.ViaVersion.api.remapper.PacketHandler; import us.myles.ViaVersion.api.remapper.PacketRemapper; import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.packets.State; +import us.myles.ViaVersion.protocols.protocol1_14to1_13_2.Protocol1_14To1_13_2; import us.myles.ViaVersion.protocols.protocol1_14to1_13_2.data.MappingData; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; public class Protocol1_13_2To1_14 extends BackwardsProtocol { - private static final Integer[] A = new Integer[0]; private BlockItemPackets1_14 blockItemPackets; private EntityPackets1_14 entityPackets; - static { - BackwardsMappings.init(); - } - @Override protected void registerPackets() { + executeAsyncAfterLoaded(Protocol1_14To1_13_2.class, BackwardsMappings::init); + blockItemPackets = new BlockItemPackets1_14(this); blockItemPackets.register(); entityPackets = new EntityPackets1_14(this); diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/data/BackwardsMappings.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/data/BackwardsMappings.java index e5e54f6c..85e2ac5e 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/data/BackwardsMappings.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_13_2to1_14/data/BackwardsMappings.java @@ -16,11 +16,11 @@ public class BackwardsMappings { public static VBItemMappings itemMappings; public static void init() { - JsonObject mapping1_13_2 = MappingDataLoader.loadData("mapping-1.13.2.json"); - JsonObject mapping1_14 = MappingDataLoader.loadData("mapping-1.14.json"); + ViaBackwards.getPlatform().getLogger().info("Loading 1.14 -> 1.13.2 mappings..."); + JsonObject mapping1_13_2 = MappingDataLoader.getMappingsCache().get("mapping-1.13.2.json"); + JsonObject mapping1_14 = MappingDataLoader.getMappingsCache().get("mapping-1.14.json"); JsonObject mapping1_13_2to1_14 = VBMappingDataLoader.loadFromDataDir("mapping-1.13.2to1.14.json"); - ViaBackwards.getPlatform().getLogger().info("Loading 1.14 -> 1.13.2 mappings..."); blockStateMappings = new VBMappings(mapping1_14.getAsJsonObject("blockstates"), mapping1_13_2.getAsJsonObject("blockstates"), mapping1_13_2to1_14.getAsJsonObject("blockstates")); blockMappings = new VBMappings(mapping1_14.getAsJsonObject("blocks"), mapping1_13_2.getAsJsonObject("blocks"), mapping1_13_2to1_14.getAsJsonObject("blocks"), false); itemMappings = new VBItemMappings(mapping1_14.getAsJsonObject("items"), mapping1_13_2.getAsJsonObject("items"), mapping1_13_2to1_14.getAsJsonObject("items")); 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 4109c2cf..7ac3902c 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 @@ -20,7 +20,8 @@ public class SoundPackets1_14 extends Rewriter { @Override protected void registerPackets() { - SoundRewriter soundRewriter = new SoundRewriter(protocol, BackwardsMappings.soundMappings); + SoundRewriter soundRewriter = new SoundRewriter(protocol, + id -> BackwardsMappings.soundMappings.getNewId(id), stringId -> BackwardsMappings.soundMappings.getNewId(stringId)); soundRewriter.registerSound(0x51, 0x4D); soundRewriter.registerNamedSound(0x19, 0x1A); diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/Protocol1_14_4To1_15.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/Protocol1_14_4To1_15.java index a886a7e7..aac16e70 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/Protocol1_14_4To1_15.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/Protocol1_14_4To1_15.java @@ -16,6 +16,7 @@ import us.myles.ViaVersion.api.remapper.PacketHandler; import us.myles.ViaVersion.api.remapper.PacketRemapper; import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.packets.State; +import us.myles.ViaVersion.protocols.protocol1_15to1_14_4.Protocol1_15To1_14_4; import us.myles.ViaVersion.protocols.protocol1_15to1_14_4.data.MappingData; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; @@ -25,7 +26,8 @@ public class Protocol1_14_4To1_15 extends BackwardsProtocol { @Override protected void registerPackets() { - BackwardsMappings.init(); + executeAsyncAfterLoaded(Protocol1_15To1_14_4.class, BackwardsMappings::init); + (blockItemPackets = new BlockItemPackets1_15(this)).register(); new EntityPackets1_15(this).register(); @@ -39,7 +41,8 @@ public class Protocol1_14_4To1_15 extends BackwardsProtocol { translatableRewriter.registerTitle(0x50, 0x4F); translatableRewriter.registerPing(); - SoundRewriter soundRewriter = new SoundRewriter(this, BackwardsMappings.soundMappings); + SoundRewriter soundRewriter = new SoundRewriter(this, + id -> BackwardsMappings.soundMappings.getNewId(id), stringId -> BackwardsMappings.soundMappings.getNewId(stringId)); soundRewriter.registerSound(0x52, 0x51); soundRewriter.registerSound(0x51, 0x50); soundRewriter.registerNamedSound(0x1A, 0x19); diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/data/BackwardsMappings.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/data/BackwardsMappings.java index a4059999..28715fc5 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/data/BackwardsMappings.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_4to1_15/data/BackwardsMappings.java @@ -16,11 +16,11 @@ public class BackwardsMappings { public static VBItemMappings itemMappings; public static void init() { - JsonObject mapping1_14 = MappingDataLoader.loadData("mapping-1.14.json"); - JsonObject mapping1_15 = MappingDataLoader.loadData("mapping-1.15.json"); + ViaBackwards.getPlatform().getLogger().info("Loading 1.15 -> 1.14.4 mappings..."); + JsonObject mapping1_14 = MappingDataLoader.getMappingsCache().get("mapping-1.14.json"); + JsonObject mapping1_15 = MappingDataLoader.getMappingsCache().get("mapping-1.15.json"); JsonObject mapping1_14to1_15 = VBMappingDataLoader.loadFromDataDir("mapping-1.14.4to1.15.json"); - ViaBackwards.getPlatform().getLogger().info("Loading 1.15 -> 1.14.4 mappings..."); blockStateMappings = new VBMappings(mapping1_15.getAsJsonObject("blockstates"), mapping1_14.getAsJsonObject("blockstates"), mapping1_14to1_15.getAsJsonObject("blockstates")); blockMappings = new VBMappings(mapping1_15.getAsJsonObject("blocks"), mapping1_14.getAsJsonObject("blocks"), mapping1_14to1_15.getAsJsonObject("blocks"), false); itemMappings = new VBItemMappings(mapping1_15.getAsJsonObject("items"), mapping1_14.getAsJsonObject("items"), mapping1_14to1_15.getAsJsonObject("items")); diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/Protocol1_15_2To1_16.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/Protocol1_15_2To1_16.java index d9d70c1d..f9747423 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/Protocol1_15_2To1_16.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/Protocol1_15_2To1_16.java @@ -14,6 +14,7 @@ import us.myles.ViaVersion.api.remapper.PacketRemapper; import us.myles.ViaVersion.api.rewriters.TagRewriter; import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.packets.State; +import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.Protocol1_16To1_15_2; import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.data.MappingData; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; @@ -25,7 +26,8 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol { @Override protected void registerPackets() { - BackwardsMappings.init(); + executeAsyncAfterLoaded(Protocol1_16To1_15_2.class, BackwardsMappings::init); + (blockItemPackets = new BlockItemPackets1_16(this)).register(); new EntityPackets1_16(this).register(); @@ -39,7 +41,8 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol { translatableRewriter.registerTitle(0x50, 0x50); translatableRewriter.registerPing(); - SoundRewriter soundRewriter = new SoundRewriter(this, BackwardsMappings.soundMappings); + SoundRewriter soundRewriter = new SoundRewriter(this, + id -> BackwardsMappings.soundMappings.getNewId(id), stringId -> BackwardsMappings.soundMappings.getNewId(stringId)); soundRewriter.registerSound(0x51, 0x51); soundRewriter.registerSound(0x52, 0x52); soundRewriter.registerNamedSound(0x1A, 0x1A); @@ -94,7 +97,7 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol { }); // Tags - new TagRewriter(this, BackwardsMappings.blockMappings::getNewId, id -> { + new TagRewriter(this, id -> BackwardsMappings.blockMappings.getNewId(id), id -> { Integer oldId = MappingData.oldToNewItems.inverse().get(id); return oldId != null ? oldId : -1; }, Protocol1_15_2To1_16::getNewEntityId).register(0x5C, 0x5C); diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/data/BackwardsMappings.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/data/BackwardsMappings.java index 649260e9..99de15f0 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/data/BackwardsMappings.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/data/BackwardsMappings.java @@ -21,11 +21,11 @@ public class BackwardsMappings { public static Map attributeMappings = new HashMap<>(); public static void init() { - JsonObject mapping1_15 = MappingDataLoader.loadData("mapping-1.15.json"); - JsonObject mapping1_16 = MappingDataLoader.loadData("mapping-1.16.json"); + ViaBackwards.getPlatform().getLogger().info("Loading 1.16 -> 1.15.2 mappings..."); + JsonObject mapping1_15 = MappingDataLoader.getMappingsCache().get("mapping-1.15.json"); + JsonObject mapping1_16 = MappingDataLoader.getMappingsCache().get("mapping-1.16.json"); JsonObject mapping1_15to1_16 = VBMappingDataLoader.loadFromDataDir("mapping-1.15to1.16.json"); - ViaBackwards.getPlatform().getLogger().info("Loading 1.16 -> 1.15.2 mappings..."); blockStateMappings = new VBMappings(mapping1_16.getAsJsonObject("blockstates"), mapping1_15.getAsJsonObject("blockstates"), mapping1_15to1_16.getAsJsonObject("blockstates")); blockMappings = new VBMappings(mapping1_16.getAsJsonObject("blocks"), mapping1_15.getAsJsonObject("blocks"), mapping1_15to1_16.getAsJsonObject("blocks"), false); itemMappings = new VBItemMappings(mapping1_16.getAsJsonObject("items"), mapping1_15.getAsJsonObject("items"), mapping1_15to1_16.getAsJsonObject("items"));