Update VV usage

This commit is contained in:
Nassim Jahnke 2023-03-02 13:22:16 +01:00
parent 565944c317
commit 5d0d6f603b
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
32 changed files with 14748 additions and 14717 deletions

View File

@ -26,6 +26,7 @@ import com.viaversion.viaversion.api.data.Mappings;
import com.viaversion.viaversion.api.protocol.Protocol; import com.viaversion.viaversion.api.protocol.Protocol;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap; import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
import com.viaversion.viaversion.libs.gson.JsonObject; import com.viaversion.viaversion.libs.gson.JsonObject;
import com.viaversion.viaversion.util.Key;
import java.util.Map; import java.util.Map;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
@ -33,7 +34,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
public class BackwardsMappings extends MappingDataBase { public class BackwardsMappings extends MappingDataBase {
private final Class<? extends Protocol<?, ?, ?, ?>> vvProtocolClass; private final Class<? extends Protocol<?, ?, ?, ?>> vvProtocolClass;
private Int2ObjectMap<MappedItem> backwardsItemMappings; protected Int2ObjectMap<MappedItem> backwardsItemMappings;
private Map<String, String> backwardsSoundMappings; private Map<String, String> backwardsSoundMappings;
private Map<String, String> entityNames; private Map<String, String> entityNames;
@ -46,21 +47,20 @@ public class BackwardsMappings extends MappingDataBase {
Preconditions.checkArgument(vvProtocolClass == null || !vvProtocolClass.isAssignableFrom(BackwardsProtocol.class)); Preconditions.checkArgument(vvProtocolClass == null || !vvProtocolClass.isAssignableFrom(BackwardsProtocol.class));
this.vvProtocolClass = vvProtocolClass; this.vvProtocolClass = vvProtocolClass;
// Just re-use ViaVersion's item id map // Just re-use ViaVersion's item id map
loadItems = false;
} }
@Override @Override
protected final void loadExtras(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings) { protected final void loadExtras(JsonObject unmappedIdentifiers, JsonObject mappedIdentifiers, @Nullable JsonObject diffMappings) {
if (diffMappings != null) { if (diffMappings != null) {
JsonObject diffItems = diffMappings.getAsJsonObject("items"); JsonObject diffItems = diffMappings.getAsJsonObject("items");
if (diffItems != null) { if (diffItems != null && mappedIdentifiers.get("items").isJsonArray() && unmappedIdentifiers.get("items").isJsonArray()) {
backwardsItemMappings = VBMappingDataLoader.loadItemMappings(oldMappings.getAsJsonObject("items"), backwardsItemMappings = VBMappingDataLoader.loadItemMappings(unmappedIdentifiers.getAsJsonArray("items"),
newMappings.getAsJsonObject("items"), diffItems, shouldWarnOnMissing("items")); mappedIdentifiers.getAsJsonArray("items"), diffItems, shouldWarnOnMissing("items"));
} }
JsonObject diffSounds = diffMappings.getAsJsonObject("sounds"); JsonObject diffSounds = diffMappings.getAsJsonObject("sounds");
if (diffSounds != null) { if (diffSounds != null) {
backwardsSoundMappings = VBMappingDataLoader.objectToNamespacedMap(diffSounds); backwardsSoundMappings = VBMappingDataLoader.objectToMap(diffSounds);
} }
JsonObject diffEntityNames = diffMappings.getAsJsonObject("entitynames"); JsonObject diffEntityNames = diffMappings.getAsJsonObject("entitynames");
@ -74,24 +74,28 @@ public class BackwardsMappings extends MappingDataBase {
itemMappings = Via.getManager().getProtocolManager().getProtocol(vvProtocolClass).getMappingData().getItemMappings().inverse(); itemMappings = Via.getManager().getProtocolManager().getProtocol(vvProtocolClass).getMappingData().getItemMappings().inverse();
} }
loadVBExtras(oldMappings, newMappings); loadVBExtras(unmappedIdentifiers, mappedIdentifiers, diffMappings);
} }
@Override @Override
protected @Nullable Mappings loadFromArray(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) { protected @Nullable Mappings loadFromArray(JsonObject unmappedIdentifiers, JsonObject mappedIdentifiers, @Nullable JsonObject diffMappings, String key) {
if (!oldMappings.has(key) || !newMappings.has(key)) return null; if (!unmappedIdentifiers.has(key) || !mappedIdentifiers.has(key) || !shouldLoad(key)) {
return null;
}
JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null; JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null;
return VBMappings.vbBuilder().unmapped(oldMappings.getAsJsonArray(key)).mapped(newMappings.getAsJsonArray(key)) return VBMappings.vbBuilder().unmapped(unmappedIdentifiers.getAsJsonArray(key)).mapped(mappedIdentifiers.getAsJsonArray(key))
.diffMappings(diff).warnOnMissing(shouldWarnOnMissing(key)).build(); .diffMappings(diff).warnOnMissing(shouldWarnOnMissing(key)).build();
} }
@Override @Override
protected @Nullable Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) { protected @Nullable Mappings loadFromObject(JsonObject unmappedIdentifiers, JsonObject mappedIdentifiers, @Nullable JsonObject diffMappings, String key) {
if (!oldMappings.has(key) || !newMappings.has(key)) return null; if (!unmappedIdentifiers.has(key) || !mappedIdentifiers.has(key) || !shouldLoad(key)) {
return null;
}
JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null; JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null;
return VBMappings.vbBuilder().unmapped(oldMappings.getAsJsonObject(key)).mapped(newMappings.getAsJsonObject(key)) return VBMappings.vbBuilder().unmapped(unmappedIdentifiers.getAsJsonObject(key)).mapped(mappedIdentifiers.getAsJsonObject(key))
.diffMappings(diff).warnOnMissing(shouldWarnOnMissing(key)).build(); .diffMappings(diff).warnOnMissing(shouldWarnOnMissing(key)).build();
} }
@ -103,13 +107,18 @@ public class BackwardsMappings extends MappingDataBase {
/** /**
* To be overridden. * To be overridden.
*/ */
protected void loadVBExtras(JsonObject unmapped, JsonObject mapped) { protected void loadVBExtras(JsonObject unmappedIdentifiers, JsonObject mappedIdentifiers, JsonObject diffMappings) {
} }
protected boolean shouldWarnOnMissing(String key) { protected boolean shouldWarnOnMissing(String key) {
return !key.equals("blocks") && !key.equals("statistics") && !key.equals("entities"); return !key.equals("blocks") && !key.equals("statistics") && !key.equals("entities");
} }
@Override
protected boolean shouldLoad(final String key) {
return !key.equals("items");
}
@Override @Override
protected Logger getLogger() { protected Logger getLogger() {
return ViaBackwards.getPlatform().getLogger(); return ViaBackwards.getPlatform().getLogger();
@ -121,7 +130,7 @@ public class BackwardsMappings extends MappingDataBase {
@Override @Override
public int getNewItemId(int id) { public int getNewItemId(int id) {
// Don't warn on missing here // Don't warn on missing here
return this.itemMappings.get(id); return this.itemMappings.getNewId(id);
} }
@Override @Override
@ -133,7 +142,7 @@ public class BackwardsMappings extends MappingDataBase {
@Override @Override
public int getOldItemId(final int id) { public int getOldItemId(final int id) {
// Warn on missing // Warn on missing
return checkValidity(id, this.itemMappings.inverse().get(id), "item"); return checkValidity(id, this.itemMappings.inverse().getNewId(id), "item");
} }
public @Nullable MappedItem getMappedItem(int id) { public @Nullable MappedItem getMappedItem(int id) {
@ -144,12 +153,7 @@ public class BackwardsMappings extends MappingDataBase {
if (backwardsSoundMappings == null) { if (backwardsSoundMappings == null) {
return null; return null;
} }
return backwardsSoundMappings.get(Key.stripMinecraftNamespace(id));
if (id.indexOf(':') == -1) {
id = "minecraft:" + id;
}
return backwardsSoundMappings.get(id);
} }
public @Nullable String mappedEntityName(String entityName) { public @Nullable String mappedEntityName(String entityName) {

View File

@ -23,6 +23,7 @@ import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap; import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap; import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;
import com.viaversion.viaversion.libs.fastutil.objects.Object2IntMap; import com.viaversion.viaversion.libs.fastutil.objects.Object2IntMap;
import com.viaversion.viaversion.libs.gson.JsonArray;
import com.viaversion.viaversion.libs.gson.JsonElement; import com.viaversion.viaversion.libs.gson.JsonElement;
import com.viaversion.viaversion.libs.gson.JsonIOException; import com.viaversion.viaversion.libs.gson.JsonIOException;
import com.viaversion.viaversion.libs.gson.JsonObject; import com.viaversion.viaversion.libs.gson.JsonObject;
@ -42,7 +43,9 @@ public final class VBMappingDataLoader {
public static JsonObject loadFromDataDir(String name) { public static JsonObject loadFromDataDir(String name) {
File file = new File(ViaBackwards.getPlatform().getDataFolder(), name); File file = new File(ViaBackwards.getPlatform().getDataFolder(), name);
if (!file.exists()) return loadData(name); if (!file.exists()) {
return loadData(name);
}
// Load the file from the platform's directory if present // Load the file from the platform's directory if present
try (FileReader reader = new FileReader(file)) { try (FileReader reader = new FileReader(file)) {
@ -72,61 +75,66 @@ public final class VBMappingDataLoader {
} }
} }
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers, JsonObject diffIdentifiers, boolean warnOnMissing) { public static void mapIdentifiers(int[] output, JsonObject unmappedIdentifiers, JsonObject mappedIdentifiers, JsonObject diffIdentifiers, boolean warnOnMissing) {
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(newIdentifiers); Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(mappedIdentifiers);
for (Map.Entry<String, JsonElement> entry : oldIdentifiers.entrySet()) { for (Map.Entry<String, JsonElement> entry : unmappedIdentifiers.entrySet()) {
String key = entry.getValue().getAsString(); int mappedId = mapIdentifierEntry(entry.getValue().getAsString(), newIdentifierMap, diffIdentifiers, warnOnMissing);
int mappedId = newIdentifierMap.getInt(key); if (mappedId != -1) {
if (mappedId == -1) { output[Integer.parseInt(entry.getKey())] = mappedId;
if (diffIdentifiers != null) {
// Search in diff mappings
JsonPrimitive diffValueJson = diffIdentifiers.getAsJsonPrimitive(key);
String diffValue = diffValueJson != null ? diffValueJson.getAsString() : null;
int dataIndex;
if (diffValue == null && (dataIndex = key.indexOf('[')) != -1
&& (diffValueJson = diffIdentifiers.getAsJsonPrimitive(key.substring(0, dataIndex))) != null) {
// Check for wildcard mappings
diffValue = diffValueJson.getAsString();
// Keep original properties if value ends with [
if (diffValue.endsWith("[")) {
diffValue += key.substring(dataIndex + 1);
}
}
if (diffValue != null) {
mappedId = newIdentifierMap.getInt(diffValue);
}
}
if (mappedId == -1) {
// Nothing found :(
if (warnOnMissing && !Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
ViaBackwards.getPlatform().getLogger().warning("No key for " + entry.getValue() + " :( ");
}
continue;
}
} }
output[Integer.parseInt(entry.getKey())] = mappedId;
} }
} }
public static Map<String, String> objectToNamespacedMap(JsonObject object) { public static void mapIdentifiers(int[] output, JsonArray unmappedIdentifiers, JsonArray mappedIdentifiers, JsonObject diffIdentifiers, boolean warnOnMissing) {
Map<String, String> mappings = new HashMap<>(object.size()); Object2IntMap<String> newIdentifierMap = MappingDataLoader.arrayToMap(mappedIdentifiers);
for (Map.Entry<String, JsonElement> entry : object.entrySet()) { for (int id = 0; id < unmappedIdentifiers.size(); id++) {
String key = entry.getKey(); JsonElement unmappedIdentifier = unmappedIdentifiers.get(id);
if (key.indexOf(':') == -1) { int mappedId = mapIdentifierEntry(unmappedIdentifier.getAsString(), newIdentifierMap, diffIdentifiers, warnOnMissing);
key = "minecraft:" + key; if (mappedId != -1) {
output[id] = mappedId;
} }
String value = entry.getValue().getAsString();
if (value.indexOf(':') == -1) {
value = "minecraft:" + value;
}
mappings.put(key, value);
} }
return mappings; }
private static int mapIdentifierEntry(String key, Object2IntMap<String> mappedIdentifiers, @Nullable JsonObject diffIdentifiers, boolean warnOnMissing) {
int mappedId = mappedIdentifiers.getInt(key);
if (mappedId == -1) {
if (diffIdentifiers != null) {
// Search in diff mappings
JsonPrimitive diffValueJson = diffIdentifiers.getAsJsonPrimitive(key);
String diffValue = diffValueJson != null ? diffValueJson.getAsString() : null;
if (diffValue != null && diffValue.isEmpty()) {
return -1;
}
int dataIndex;
if (diffValue == null && (dataIndex = key.indexOf('[')) != -1
&& (diffValueJson = diffIdentifiers.getAsJsonPrimitive(key.substring(0, dataIndex))) != null) {
// Check for wildcard mappings
diffValue = diffValueJson.getAsString();
if (diffValue != null && diffValue.isEmpty()) {
return -1;
}
// Keep original properties if value ends with [
if (diffValue.endsWith("[")) {
diffValue += key.substring(dataIndex + 1);
}
}
if (diffValue != null) {
mappedId = mappedIdentifiers.getInt(diffValue);
}
}
if (mappedId == -1) {
if (warnOnMissing && !Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
ViaBackwards.getPlatform().getLogger().warning("No key for " + key + " :( ");
}
return -1;
}
}
return mappedId;
} }
public static Map<String, String> objectToMap(JsonObject object) { public static Map<String, String> objectToMap(JsonObject object) {
@ -137,38 +145,40 @@ public final class VBMappingDataLoader {
return mappings; return mappings;
} }
public static Int2ObjectMap<MappedItem> loadItemMappings(JsonObject oldMapping, JsonObject newMapping, JsonObject diffMapping, boolean warnOnMissing) { public static Int2ObjectMap<MappedItem> loadItemMappings(JsonArray unmappedIdentifiers, JsonArray mappedIdentifiers, JsonObject diffMapping, boolean warnOnMissing) {
return loadItemMappings(MappingDataLoader.arrayToMap(unmappedIdentifiers), MappingDataLoader.arrayToMap(mappedIdentifiers), diffMapping, warnOnMissing);
}
public static Int2ObjectMap<MappedItem> loadItemMappings(Object2IntMap<String> unmappedIdentifiers, Object2IntMap<String> mappedIdentifiers, JsonObject diffMapping, boolean warnOnMissing) {
Int2ObjectMap<MappedItem> itemMapping = new Int2ObjectOpenHashMap<>(diffMapping.size(), 0.99F); Int2ObjectMap<MappedItem> itemMapping = new Int2ObjectOpenHashMap<>(diffMapping.size(), 0.99F);
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(newMapping);
Object2IntMap<String> oldIdentifierMap = MappingDataLoader.indexedObjectToMap(oldMapping);
for (Map.Entry<String, JsonElement> entry : diffMapping.entrySet()) { for (Map.Entry<String, JsonElement> entry : diffMapping.entrySet()) {
JsonObject object = entry.getValue().getAsJsonObject(); JsonObject object = entry.getValue().getAsJsonObject();
String mappedIdName = object.getAsJsonPrimitive("id").getAsString(); String mappedIdentifier = object.getAsJsonPrimitive("id").getAsString();
int mappedId = newIdentifierMap.getInt(mappedIdName); int mappedId = mappedIdentifiers.getInt(mappedIdentifier);
if (mappedId == -1) { if (mappedId == -1) {
if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
ViaBackwards.getPlatform().getLogger().warning("No key for " + mappedIdName + " :( "); ViaBackwards.getPlatform().getLogger().warning("Mapped item " + mappedIdentifier + " does not exist :( ");
} }
continue; continue;
} }
int oldId = oldIdentifierMap.getInt(entry.getKey()); int unmappedId = unmappedIdentifiers.getInt(entry.getKey());
if (oldId == -1) { if (unmappedId == -1) {
if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
ViaBackwards.getPlatform().getLogger().warning("No old entry for " + mappedIdName + " :( "); ViaBackwards.getPlatform().getLogger().warning("Unmapped item " + entry.getKey() + " doesn't exist :( ");
} }
continue; continue;
} }
String name = object.getAsJsonPrimitive("name").getAsString(); String name = object.getAsJsonPrimitive("name").getAsString();
JsonPrimitive customModelData = object.getAsJsonPrimitive("custom_model_data"); JsonPrimitive customModelData = object.getAsJsonPrimitive("custom_model_data");
itemMapping.put(oldId, new MappedItem(mappedId, name, customModelData != null ? customModelData.getAsInt() : null)); itemMapping.put(unmappedId, new MappedItem(mappedId, name, customModelData != null ? customModelData.getAsInt() : null));
} }
// Look for missing keys // Look for missing keys
if (warnOnMissing && !Via.getConfig().isSuppressConversionWarnings()) { if (warnOnMissing && !Via.getConfig().isSuppressConversionWarnings()) {
for (Object2IntMap.Entry<String> entry : oldIdentifierMap.object2IntEntrySet()) { for (Object2IntMap.Entry<String> entry : unmappedIdentifiers.object2IntEntrySet()) {
if (!newIdentifierMap.containsKey(entry.getKey()) && !itemMapping.containsKey(entry.getIntValue())) { if (!mappedIdentifiers.containsKey(entry.getKey()) && !itemMapping.containsKey(entry.getIntValue())) {
ViaBackwards.getPlatform().getLogger().warning("No item mapping for " + entry.getKey() + " :( "); ViaBackwards.getPlatform().getLogger().warning("No item mapping for " + entry.getKey() + " :( ");
} }
} }

View File

@ -49,15 +49,14 @@ public final class VBMappings extends IntArrayMappings {
if (mapped.isJsonObject()) { if (mapped.isJsonObject()) {
VBMappingDataLoader.mapIdentifiers(mappings, toJsonObject(unmapped.getAsJsonArray()), mapped.getAsJsonObject(), diffMappings, warnOnMissing); VBMappingDataLoader.mapIdentifiers(mappings, toJsonObject(unmapped.getAsJsonArray()), mapped.getAsJsonObject(), diffMappings, warnOnMissing);
} else { } else {
// Use the normal loader VBMappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonArray(), mapped.getAsJsonArray(), diffMappings, warnOnMissing);
MappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonArray(), mapped.getAsJsonArray(), diffMappings, warnOnMissing);
} }
} else if (mapped.isJsonArray()) { } else if (mapped.isJsonArray()) {
VBMappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), toJsonObject(mapped.getAsJsonArray()), diffMappings, warnOnMissing); VBMappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), toJsonObject(mapped.getAsJsonArray()), diffMappings, warnOnMissing);
} else { } else {
VBMappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), mapped.getAsJsonObject(), diffMappings, warnOnMissing); VBMappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), mapped.getAsJsonObject(), diffMappings, warnOnMissing);
} }
return supplier.supply(mappings, mappedSize); return new VBMappings(mappings, mappedSize);
} }
} }
} }

View File

@ -22,14 +22,13 @@ import com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.providers.Backw
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.data.MappingDataLoader; import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.libs.gson.JsonElement; import com.viaversion.viaversion.libs.gson.JsonArray;
import com.viaversion.viaversion.libs.gson.JsonObject; import com.viaversion.viaversion.libs.gson.JsonPrimitive;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.IntTag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.IntTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.StringTag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.StringTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.blockconnections.ConnectionData; import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.blockconnections.ConnectionData;
import java.lang.reflect.Field;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.StringJoiner; import java.util.StringJoiner;
@ -40,28 +39,24 @@ public class PistonHandler implements BackwardsBlockEntityProvider.BackwardsBloc
public PistonHandler() { public PistonHandler() {
if (Via.getConfig().isServersideBlockConnections()) { if (Via.getConfig().isServersideBlockConnections()) {
Map<String, Integer> keyToId; Map<String, Integer> keyToId = ConnectionData.getKeyToId();
try {
Field field = ConnectionData.class.getDeclaredField("keyToId");
field.setAccessible(true);
keyToId = (Map<String, Integer>) field.get(null);
} catch (IllegalAccessException | NoSuchFieldException e) {
e.printStackTrace();
return;
}
for (Map.Entry<String, Integer> entry : keyToId.entrySet()) { for (Map.Entry<String, Integer> entry : keyToId.entrySet()) {
if (!entry.getKey().contains("piston")) continue; if (!entry.getKey().contains("piston")) {
continue;
}
addEntries(entry.getKey(), entry.getValue()); addEntries(entry.getKey(), entry.getValue());
} }
} else { } else {
JsonObject mappings = MappingDataLoader.getMappingsCache().get("mapping-1.13.json").getAsJsonObject("blockstates"); JsonArray mappings = MappingDataLoader.getMappingsCache().get("mapping-1.13.json").getAsJsonArray("blockstates");
for (Map.Entry<String, JsonElement> blockState : mappings.entrySet()) { for (int id = 0; id < mappings.size(); id++) {
String key = blockState.getValue().getAsString(); JsonPrimitive state = mappings.get(id).getAsJsonPrimitive();
if (!key.contains("piston")) continue; String key = state.getAsString();
if (!key.contains("piston")) {
continue;
}
addEntries(key, Integer.parseInt(blockState.getKey())); addEntries(key, id);
} }
} }
} }

View File

@ -19,6 +19,7 @@
package com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.data; package com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.data;
import com.viaversion.viabackwards.ViaBackwards; import com.viaversion.viabackwards.ViaBackwards;
import com.viaversion.viabackwards.api.data.VBMappingDataLoader;
import com.viaversion.viabackwards.api.data.VBMappings; import com.viaversion.viabackwards.api.data.VBMappings;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.IntArrayMappings; import com.viaversion.viaversion.api.data.IntArrayMappings;
@ -27,6 +28,7 @@ import com.viaversion.viaversion.api.data.Mappings;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap; import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap; import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;
import com.viaversion.viaversion.libs.fastutil.objects.Object2IntMap; import com.viaversion.viaversion.libs.fastutil.objects.Object2IntMap;
import com.viaversion.viaversion.libs.gson.JsonArray;
import com.viaversion.viaversion.libs.gson.JsonElement; import com.viaversion.viaversion.libs.gson.JsonElement;
import com.viaversion.viaversion.libs.gson.JsonObject; import com.viaversion.viaversion.libs.gson.JsonObject;
import com.viaversion.viaversion.libs.gson.JsonPrimitive; import com.viaversion.viaversion.libs.gson.JsonPrimitive;
@ -46,9 +48,14 @@ public class BackwardsMappings extends com.viaversion.viabackwards.api.data.Back
} }
@Override @Override
public void loadVBExtras(JsonObject unmapped, JsonObject mapped) { public void loadVBExtras(JsonObject unmappedIdentifiers, JsonObject mappedIdentifiers, JsonObject diffMappings) {
JsonObject diffItems = diffMappings.getAsJsonObject("items");
JsonArray unmappedItems = unmappedIdentifiers.getAsJsonArray("items");
JsonObject mappedItems = mappedIdentifiers.getAsJsonObject("items");
backwardsItemMappings = VBMappingDataLoader.loadItemMappings(MappingDataLoader.arrayToMap(unmappedItems), MappingDataLoader.indexedObjectToMap(mappedItems), diffItems, false);
enchantmentMappings = VBMappings.vbBuilder().warnOnMissing(false) enchantmentMappings = VBMappings.vbBuilder().warnOnMissing(false)
.unmapped(unmapped.getAsJsonArray("enchantments")).mapped(mapped.getAsJsonObject("legacy_enchantments")).build(); .unmapped(unmappedIdentifiers.getAsJsonArray("enchantments")).mapped(mappedIdentifiers.getAsJsonObject("legacy_enchantments")).build();
for (Map.Entry<String, Integer> entry : StatisticMappings.CUSTOM_STATS.entrySet()) { for (Map.Entry<String, Integer> entry : StatisticMappings.CUSTOM_STATS.entrySet()) {
statisticMappings.put(entry.getValue().intValue(), entry.getKey()); statisticMappings.put(entry.getValue().intValue(), entry.getKey());
} }
@ -95,17 +102,26 @@ public class BackwardsMappings extends com.viaversion.viabackwards.api.data.Back
} }
@Override @Override
protected @Nullable Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) { protected @Nullable Mappings loadFromArray(JsonObject unmappedIdentifiers, JsonObject mappedIdentifiers, @Nullable JsonObject diffMappings, String key) {
if (key.equals("blockstates")) { if (key.equals("blockstates")) {
int[] oldToNew = new int[8582]; int[] oldToNew = new int[8582];
Arrays.fill(oldToNew, -1); Arrays.fill(oldToNew, -1);
mapIdentifiers(oldToNew, oldMappings.getAsJsonObject("blockstates"), newMappings.getAsJsonObject("blocks"), diffMappings.getAsJsonObject("blockstates")); mapIdentifiers(oldToNew, toJsonObject(unmappedIdentifiers.getAsJsonArray("blockstates")), mappedIdentifiers.getAsJsonObject("blocks"), diffMappings.getAsJsonObject("blockstates"));
return IntArrayMappings.of(oldToNew, -1); return IntArrayMappings.of(oldToNew, -1);
} else { } else {
return super.loadFromObject(oldMappings, newMappings, diffMappings, key); return super.loadFromArray(unmappedIdentifiers, mappedIdentifiers, diffMappings, key);
} }
} }
private JsonObject toJsonObject(final JsonArray array) {
final JsonObject object = new JsonObject();
for (int i = 0; i < array.size(); i++) {
final JsonElement element = array.get(i);
object.add(Integer.toString(i), element);
}
return object;
}
@Override @Override
public int getNewBlockStateId(int id) { public int getNewBlockStateId(int id) {
// Comparator funkyness: https://github.com/ViaVersion/ViaBackwards/issues/524 // Comparator funkyness: https://github.com/ViaVersion/ViaBackwards/issues/524
@ -156,4 +172,9 @@ public class BackwardsMappings extends com.viaversion.viabackwards.api.data.Back
public Map<String, String> getTranslateMappings() { public Map<String, String> getTranslateMappings() {
return translateMappings; return translateMappings;
} }
@Override
protected boolean shouldLoad(final String key) {
return super.shouldLoad(key) && !key.equals("blocks");
}
} }

View File

@ -91,7 +91,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
protected void registerPackets() { protected void registerPackets() {
protocol.registerClientbound(ClientboundPackets1_13.COOLDOWN, wrapper -> { protocol.registerClientbound(ClientboundPackets1_13.COOLDOWN, wrapper -> {
int itemId = wrapper.read(Type.VAR_INT); int itemId = wrapper.read(Type.VAR_INT);
int oldId = protocol.getMappingData().getItemMappings().get(itemId); int oldId = protocol.getMappingData().getItemMappings().getNewId(itemId);
if (oldId == -1) { if (oldId == -1) {
wrapper.cancel(); wrapper.cancel();
return; return;
@ -376,7 +376,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
int id = wrapper.get(Type.INT, 0); int id = wrapper.get(Type.INT, 0);
int data = wrapper.get(Type.INT, 1); int data = wrapper.get(Type.INT, 1);
if (id == 1010) { // Play record if (id == 1010) { // Play record
wrapper.set(Type.INT, 1, protocol.getMappingData().getItemMappings().get(data) >> 4); wrapper.set(Type.INT, 1, protocol.getMappingData().getItemMappings().getNewId(data) >> 4);
} else if (id == 2001) { // Block break + block break sound } else if (id == 2001) { // Block break + block break sound
data = protocol.getMappingData().getNewBlockStateId(data); data = protocol.getMappingData().getNewBlockStateId(data);
int blockId = data >> 4; int blockId = data >> 4;
@ -804,7 +804,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
item.setIdentifier(identifier); item.setIdentifier(identifier);
int newId = -1; int newId = -1;
if (!protocol.getMappingData().getItemMappings().inverse().containsKey(rawId)) { if (protocol.getMappingData().getItemMappings().inverse().getNewId(rawId) == -1) {
if (!isDamageable(item.identifier()) && item.identifier() != 358) { // Map if (!isDamageable(item.identifier()) && item.identifier() != 358) { // Map
if (tag == null) item.setTag(tag = new CompoundTag()); if (tag == null) item.setTag(tag = new CompoundTag());
tag.put(extraNbtTag, new IntTag(originalId)); // Data will be lost, saving original id tag.put(extraNbtTag, new IntTag(originalId)); // Data will be lost, saving original id
@ -814,7 +814,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
newId = 362; // directly set the new id -> base/colorless shulker box newId = 362; // directly set the new id -> base/colorless shulker box
} else if (item.identifier() == 31 && item.data() == 0) { // Shrub was removed } else if (item.identifier() == 31 && item.data() == 0) { // Shrub was removed
rawId = 32 << 4; // Dead Bush rawId = 32 << 4; // Dead Bush
} else if (protocol.getMappingData().getItemMappings().inverse().containsKey(rawId & ~0xF)) { } else if (protocol.getMappingData().getItemMappings().inverse().getNewId(rawId & ~0xF) != -1) {
rawId &= ~0xF; // Remove data rawId &= ~0xF; // Remove data
} else { } else {
if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) { if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
@ -825,7 +825,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
} }
if (newId == -1) { if (newId == -1) {
newId = protocol.getMappingData().getItemMappings().inverse().get(rawId); newId = protocol.getMappingData().getItemMappings().inverse().getNewId(rawId);
} }
item.setIdentifier(newId); item.setIdentifier(newId);

View File

@ -80,7 +80,7 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
for (int j = 0; j < blockIds.length; j++) { for (int j = 0; j < blockIds.length; j++) {
int id = blockIds[j]; int id = blockIds[j];
// Ignore new blocktags // Ignore new blocktags
int blockId = getMappingData().getNewBlockId(id); int blockId = MAPPINGS.getNewBlockId(id);
blockIds[j] = blockId; blockIds[j] = blockId;
} }
} }
@ -92,7 +92,7 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
for (int j = 0; j < itemIds.length; j++) { for (int j = 0; j < itemIds.length; j++) {
int itemId = itemIds[j]; int itemId = itemIds[j];
// Ignore new itemtags // Ignore new itemtags
int oldId = getMappingData().getItemMappings().get(itemId); int oldId = MAPPINGS.getItemMappings().getNewId(itemId);
itemIds[j] = oldId; itemIds[j] = oldId;
} }
} }

View File

@ -30,7 +30,7 @@ public class BackwardsMappings extends com.viaversion.viabackwards.api.data.Back
} }
@Override @Override
protected void loadVBExtras(JsonObject unmapped, JsonObject mapped) { protected void loadVBExtras(JsonObject unmappedIdentifiers, JsonObject mappedIdentifiers, JsonObject diffMappings) {
for (Map.Entry<String, String> entry : Protocol1_16To1_15_2.MAPPINGS.getAttributeMappings().entrySet()) { for (Map.Entry<String, String> entry : Protocol1_16To1_15_2.MAPPINGS.getAttributeMappings().entrySet()) {
attributeMappings.put(entry.getValue(), entry.getKey()); attributeMappings.put(entry.getValue(), entry.getKey());
} }

View File

@ -47,6 +47,7 @@ import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.types.Chunk1_16T
import com.viaversion.viaversion.rewriter.BlockRewriter; import com.viaversion.viaversion.rewriter.BlockRewriter;
import com.viaversion.viaversion.rewriter.RecipeRewriter; import com.viaversion.viaversion.rewriter.RecipeRewriter;
import com.viaversion.viaversion.util.CompactArrayUtil; import com.viaversion.viaversion.util.CompactArrayUtil;
import com.viaversion.viaversion.util.Key;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -71,7 +72,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit
int newSize = size; int newSize = size;
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
String originalType = wrapper.read(Type.STRING); String originalType = wrapper.read(Type.STRING);
String type = originalType.replace("minecraft:", ""); String type = Key.stripMinecraftNamespace(originalType);
if (type.equals("smithing")) { if (type.equals("smithing")) {
newSize--; newSize--;

View File

@ -41,6 +41,7 @@ import com.viaversion.viaversion.libs.gson.JsonElement;
import com.viaversion.viaversion.protocols.protocol1_15to1_14_4.ClientboundPackets1_15; import com.viaversion.viaversion.protocols.protocol1_15to1_14_4.ClientboundPackets1_15;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16; import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16;
import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
import com.viaversion.viaversion.util.Key;
public class EntityPackets1_16 extends EntityRewriter<ClientboundPackets1_16, Protocol1_15_2To1_16> { public class EntityPackets1_16 extends EntityRewriter<ClientboundPackets1_16, Protocol1_15_2To1_16> {
@ -190,7 +191,7 @@ public class EntityPackets1_16 extends EntityRewriter<ClientboundPackets1_16, Pr
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
String attributeIdentifier = wrapper.read(Type.STRING); String attributeIdentifier = wrapper.read(Type.STRING);
String oldKey = protocol.getMappingData().getAttributeMappings().get(attributeIdentifier); String oldKey = protocol.getMappingData().getAttributeMappings().get(attributeIdentifier);
wrapper.write(Type.STRING, oldKey != null ? oldKey : attributeIdentifier.replace("minecraft:", "")); wrapper.write(Type.STRING, oldKey != null ? oldKey : Key.stripMinecraftNamespace(attributeIdentifier));
wrapper.passthrough(Type.DOUBLE); wrapper.passthrough(Type.DOUBLE);
int modifierSize = wrapper.passthrough(Type.VAR_INT); int modifierSize = wrapper.passthrough(Type.VAR_INT);

View File

@ -24,6 +24,7 @@ import com.viaversion.viaversion.libs.fastutil.objects.Object2IntMap;
import com.viaversion.viaversion.libs.fastutil.objects.Object2IntOpenHashMap; import com.viaversion.viaversion.libs.fastutil.objects.Object2IntOpenHashMap;
import com.viaversion.viaversion.libs.gson.JsonElement; import com.viaversion.viaversion.libs.gson.JsonElement;
import com.viaversion.viaversion.libs.gson.JsonObject; import com.viaversion.viaversion.libs.gson.JsonObject;
import com.viaversion.viaversion.util.Key;
import java.util.Map; import java.util.Map;
public final class BiomeMappings { public final class BiomeMappings {
@ -113,7 +114,7 @@ public final class BiomeMappings {
// Include the legacy biomes themselves // Include the legacy biomes themselves
for (final Object2IntMap.Entry<String> entry : LEGACY_BIOMES.object2IntEntrySet()) { for (final Object2IntMap.Entry<String> entry : LEGACY_BIOMES.object2IntEntrySet()) {
MODERN_TO_LEGACY_ID.put("minecraft:" + entry.getKey(), entry.getIntValue()); MODERN_TO_LEGACY_ID.put(entry.getKey(), entry.getIntValue());
} }
final JsonObject mappings = VBMappingDataLoader.loadFromDataDir("biome-mappings.json"); final JsonObject mappings = VBMappingDataLoader.loadFromDataDir("biome-mappings.json");
@ -133,10 +134,7 @@ public final class BiomeMappings {
} }
public static int toLegacyBiome(String biome) { public static int toLegacyBiome(String biome) {
if (biome.indexOf(':') == -1) { final int legacyBiome = MODERN_TO_LEGACY_ID.getInt(Key.stripMinecraftNamespace(biome));
biome = "minecraft:" + biome;
}
final int legacyBiome = MODERN_TO_LEGACY_ID.getInt(biome);
if (legacyBiome == -1) { if (legacyBiome == -1) {
if (!Via.getConfig().isSuppressConversionWarnings()) { if (!Via.getConfig().isSuppressConversionWarnings()) {
ViaBackwards.getPlatform().getLogger().warning("Biome with id " + biome + " has no legacy biome mapping (custom datapack?)"); ViaBackwards.getPlatform().getLogger().warning("Biome with id " + biome + " has no legacy biome mapping (custom datapack?)");

View File

@ -44,6 +44,7 @@ import com.viaversion.viaversion.protocols.protocol1_17to1_16_4.ServerboundPacke
import com.viaversion.viaversion.rewriter.IdRewriteFunction; import com.viaversion.viaversion.rewriter.IdRewriteFunction;
import com.viaversion.viaversion.rewriter.StatisticsRewriter; import com.viaversion.viaversion.rewriter.StatisticsRewriter;
import com.viaversion.viaversion.rewriter.TagRewriter; import com.viaversion.viaversion.rewriter.TagRewriter;
import com.viaversion.viaversion.util.Key;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -84,11 +85,7 @@ public final class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPac
int length = wrapper.read(Type.VAR_INT); int length = wrapper.read(Type.VAR_INT);
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
String resourceKey = wrapper.read(Type.STRING); String resourceKey = Key.stripMinecraftNamespace(wrapper.read(Type.STRING));
if (resourceKey.startsWith("minecraft:")) {
resourceKey = resourceKey.substring(10);
}
List<TagData> tagList = new ArrayList<>(); List<TagData> tagList = new ArrayList<>();
tags.put(resourceKey, tagList); tags.put(resourceKey, tagList);

View File

@ -32,7 +32,7 @@ public final class BackwardsMappings extends com.viaversion.viabackwards.api.dat
} }
@Override @Override
protected void loadVBExtras(final JsonObject unmapped, final JsonObject mapped) { protected void loadVBExtras(final JsonObject unmappedIdentifiers, final JsonObject mappedIdentifiers, JsonObject diffMappings) {
for (final Object2IntMap.Entry<String> entry : Protocol1_18To1_17_1.MAPPINGS.blockEntityIds().object2IntEntrySet()) { for (final Object2IntMap.Entry<String> entry : Protocol1_18To1_17_1.MAPPINGS.blockEntityIds().object2IntEntrySet()) {
blockEntities.put(entry.getIntValue(), entry.getKey()); blockEntities.put(entry.getIntValue(), entry.getKey());
} }

View File

@ -41,6 +41,7 @@ import com.viaversion.viaversion.protocols.protocol1_17to1_16_4.types.Chunk1_17T
import com.viaversion.viaversion.protocols.protocol1_18to1_17_1.ClientboundPackets1_18; import com.viaversion.viaversion.protocols.protocol1_18to1_17_1.ClientboundPackets1_18;
import com.viaversion.viaversion.protocols.protocol1_18to1_17_1.types.Chunk1_18Type; import com.viaversion.viaversion.protocols.protocol1_18to1_17_1.types.Chunk1_18Type;
import com.viaversion.viaversion.rewriter.RecipeRewriter; import com.viaversion.viaversion.rewriter.RecipeRewriter;
import com.viaversion.viaversion.util.Key;
import com.viaversion.viaversion.util.MathUtil; import com.viaversion.viaversion.util.MathUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.BitSet; import java.util.BitSet;
@ -151,7 +152,7 @@ public final class BlockItemPackets1_18 extends ItemRewriter<ClientboundPackets1
final Position pos = wrapper.get(Type.POSITION1_14, 0); final Position pos = wrapper.get(Type.POSITION1_14, 0);
// The protocol converters downstream rely on this field, let's add it back // The protocol converters downstream rely on this field, let's add it back
newTag.put("id", new StringTag("minecraft:" + identifier)); newTag.put("id", new StringTag(Key.namespaced(identifier)));
// Weird glitches happen with the 1.17 client and below if these fields are missing // Weird glitches happen with the 1.17 client and below if these fields are missing
// Some examples are block entity models becoming invisible (e.g.: signs, banners) // Some examples are block entity models becoming invisible (e.g.: signs, banners)
@ -212,7 +213,7 @@ public final class BlockItemPackets1_18 extends ItemRewriter<ClientboundPackets1
tag.put("x", new IntTag((oldChunk.getX() << 4) + blockEntity.sectionX())); tag.put("x", new IntTag((oldChunk.getX() << 4) + blockEntity.sectionX()));
tag.put("y", new IntTag(blockEntity.y())); tag.put("y", new IntTag(blockEntity.y()));
tag.put("z", new IntTag((oldChunk.getZ() << 4) + blockEntity.sectionZ())); tag.put("z", new IntTag((oldChunk.getZ() << 4) + blockEntity.sectionZ()));
tag.put("id", new StringTag("minecraft:" + id)); tag.put("id", new StringTag(Key.namespaced(id)));
} }
final Chunk chunk = new BaseChunk(oldChunk.getX(), oldChunk.getZ(), true, false, mask, final Chunk chunk = new BaseChunk(oldChunk.getX(), oldChunk.getZ(), true, false, mask,

View File

@ -29,6 +29,7 @@ import com.viaversion.viaversion.libs.opennbt.tag.builtin.ListTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.NumberTag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.NumberTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag;
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.Protocol1_19To1_18_2; import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.Protocol1_19To1_18_2;
import com.viaversion.viaversion.util.Key;
import java.io.IOException; import java.io.IOException;
import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.checker.nullness.qual.Nullable;
@ -42,13 +43,13 @@ public final class BackwardsMappings extends com.viaversion.viabackwards.api.dat
} }
@Override @Override
protected void loadVBExtras(final JsonObject unmapped, final JsonObject mapped) { protected void loadVBExtras(final JsonObject unmappedIdentifiers, final JsonObject mappedIdentifiers, JsonObject diffMappings) {
int i = 0; int i = 0;
final JsonArray types = unmapped.getAsJsonArray("argumenttypes"); final JsonArray types = unmappedIdentifiers.getAsJsonArray("argumenttypes");
this.argumentTypes = new String[types.size()]; this.argumentTypes = new String[types.size()];
for (final JsonElement element : types) { for (final JsonElement element : types) {
final String id = element.getAsString(); final String id = element.getAsString();
this.argumentTypes[i++] = id; this.argumentTypes[i++] = Key.namespaced(id);
} }
try { try {

View File

@ -22,6 +22,7 @@ import com.viaversion.viaversion.libs.fastutil.objects.Object2IntOpenHashMap;
import com.viaversion.viaversion.libs.gson.JsonElement; import com.viaversion.viaversion.libs.gson.JsonElement;
import com.viaversion.viaversion.libs.gson.JsonObject; import com.viaversion.viaversion.libs.gson.JsonObject;
import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.Protocol1_19_3To1_19_1; import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.Protocol1_19_3To1_19_1;
import com.viaversion.viaversion.util.Key;
public final class BackwardsMappings extends com.viaversion.viabackwards.api.data.BackwardsMappings { public final class BackwardsMappings extends com.viaversion.viabackwards.api.data.BackwardsMappings {
@ -33,14 +34,14 @@ public final class BackwardsMappings extends com.viaversion.viabackwards.api.dat
} }
@Override @Override
protected void loadVBExtras(final JsonObject unmapped, final JsonObject mapped) { protected void loadVBExtras(final JsonObject unmappedIdentifiers, final JsonObject mappedIdentifiers, JsonObject diffMappings) {
int i = 0; int i = 0;
for (final JsonElement sound : mapped.getAsJsonArray("sounds")) { for (final JsonElement sound : mappedIdentifiers.getAsJsonArray("sounds")) {
mappedSounds.put(sound.getAsString(), i++); mappedSounds.put(sound.getAsString(), i++);
} }
} }
public int mappedSound(final String sound) { public int mappedSound(final String sound) {
return mappedSounds.getInt(sound.replace("minecraft:", "")); return mappedSounds.getInt(Key.stripMinecraftNamespace(sound));
} }
} }

View File

@ -27,6 +27,7 @@ import com.viaversion.viaversion.protocols.protocol1_19_1to1_19.ServerboundPacke
import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.ClientboundPackets1_19_3; import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.ClientboundPackets1_19_3;
import com.viaversion.viaversion.rewriter.BlockRewriter; import com.viaversion.viaversion.rewriter.BlockRewriter;
import com.viaversion.viaversion.rewriter.RecipeRewriter; import com.viaversion.viaversion.rewriter.RecipeRewriter;
import com.viaversion.viaversion.util.Key;
public final class BlockItemPackets1_19_3 extends ItemRewriter<ClientboundPackets1_19_3, ServerboundPackets1_19_1, Protocol1_19_1To1_19_3> { public final class BlockItemPackets1_19_3 extends ItemRewriter<ClientboundPackets1_19_3, ServerboundPackets1_19_1, Protocol1_19_1To1_19_3> {
@ -68,7 +69,7 @@ public final class BlockItemPackets1_19_3 extends ItemRewriter<ClientboundPacket
protocol.registerClientbound(ClientboundPackets1_19_3.DECLARE_RECIPES, wrapper -> { protocol.registerClientbound(ClientboundPackets1_19_3.DECLARE_RECIPES, wrapper -> {
final int size = wrapper.passthrough(Type.VAR_INT); final int size = wrapper.passthrough(Type.VAR_INT);
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
final String type = wrapper.passthrough(Type.STRING).replace("minecraft:", ""); final String type = Key.stripMinecraftNamespace(wrapper.passthrough(Type.STRING));
wrapper.passthrough(Type.STRING); // Recipe Identifier wrapper.passthrough(Type.STRING); // Recipe Identifier
switch (type) { switch (type) {
case "crafting_shapeless": { case "crafting_shapeless": {

View File

@ -27,6 +27,7 @@ import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.ServerboundPac
import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.rewriter.RecipeRewriter1_19_3; import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.rewriter.RecipeRewriter1_19_3;
import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.ClientboundPackets1_19_4; import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.ClientboundPackets1_19_4;
import com.viaversion.viaversion.rewriter.BlockRewriter; import com.viaversion.viaversion.rewriter.BlockRewriter;
import com.viaversion.viaversion.util.Key;
public final class BlockItemPackets1_19_4 extends ItemRewriter<ClientboundPackets1_19_4, ServerboundPackets1_19_3, Protocol1_19_3To1_19_4> { public final class BlockItemPackets1_19_4 extends ItemRewriter<ClientboundPackets1_19_4, ServerboundPackets1_19_3, Protocol1_19_3To1_19_4> {
@ -94,7 +95,7 @@ public final class BlockItemPackets1_19_4 extends ItemRewriter<ClientboundPacket
int newSize = size; int newSize = size;
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
final String type = wrapper.read(Type.STRING); final String type = wrapper.read(Type.STRING);
final String cutType = type.replace("minecraft:", ""); final String cutType = Key.stripMinecraftNamespace(type);
if (cutType.equals("smithing_transform") || cutType.equals("smithing_trim")) { if (cutType.equals("smithing_transform") || cutType.equals("smithing_trim")) {
newSize--; newSize--;
wrapper.read(Type.STRING); // Recipe identifier wrapper.read(Type.STRING); // Recipe identifier

View File

@ -1,28 +1,28 @@
{ {
"minecraft:nether_wastes": "nether", "nether_wastes": "nether",
"minecraft:soul_sand_valley": "nether", "soul_sand_valley": "nether",
"minecraft:crimson_forest": "nether", "crimson_forest": "nether",
"minecraft:warped_forest": "nether", "warped_forest": "nether",
"minecraft:basalt_deltas": "nether", "basalt_deltas": "nether",
"minecraft:dripstone_caves": "mountains", "dripstone_caves": "mountains",
"minecraft:lush_caves": "mountains", "lush_caves": "mountains",
"minecraft:meadow": "plains", "meadow": "plains",
"minecraft:grove": "snowy_mountains", "grove": "snowy_mountains",
"minecraft:snowy_slopes": "snowy_mountains", "snowy_slopes": "snowy_mountains",
"minecraft:frozen_peaks": "snowy_mountains", "frozen_peaks": "snowy_mountains",
"minecraft:jagged_peaks": "mountains", "jagged_peaks": "mountains",
"minecraft:stony_peaks": "mountains", "stony_peaks": "mountains",
"minecraft:windswept_hills": "mountains", "windswept_hills": "mountains",
"minecraft:snowy_plains": "snowy_tundra", "snowy_plains": "snowy_tundra",
"minecraft:sparse_jungle": "jungle_edge", "sparse_jungle": "jungle_edge",
"minecraft:stony_shore": "stone_shore", "stony_shore": "stone_shore",
"minecraft:old_growth_pine_taiga": "giant_spruce_taiga", "old_growth_pine_taiga": "giant_spruce_taiga",
"minecraft:windswept_forest": "wooded_mountains", "windswept_forest": "wooded_mountains",
"minecraft:wooded_badlands": "wooded_badlands_plateau", "wooded_badlands": "wooded_badlands_plateau",
"minecraft:windswept_gravelly_hills": "gravelly_mountains", "windswept_gravelly_hills": "gravelly_mountains",
"minecraft:old_growth_birch_forest": "tall_birch_forest", "old_growth_birch_forest": "tall_birch_forest",
"minecraft:old_growth_spruce_taiga": "giant_spruce_taiga", "old_growth_spruce_taiga": "giant_spruce_taiga",
"minecraft:windswept_savanna": "shattered_savanna", "windswept_savanna": "shattered_savanna",
"minecraft:mangrove_swamp": "swamp", "mangrove_swamp": "swamp",
"minecraft:deep_dark": "mountains" "deep_dark": "mountains"
} }

View File

@ -1,20 +1,20 @@
{ {
"blockstates": { "blockstates": {
"minecraft:tnt[unstable=false]": "minecraft:tnt", "tnt[unstable=false]": "tnt",
"minecraft:tnt[unstable=true]": "minecraft:tnt", "tnt[unstable=true]": "tnt",
"minecraft:oak_sign": "minecraft:sign[", "oak_sign": "sign[",
"minecraft:oak_wall_sign": "minecraft:wall_sign[", "oak_wall_sign": "wall_sign[",
"minecraft:smooth_stone_slab": "minecraft:stone_slab[", "smooth_stone_slab": "stone_slab[",
"minecraft:dead_tube_coral": "minecraft:tube_coral", "dead_tube_coral": "tube_coral",
"minecraft:dead_brain_coral": "minecraft:brain_coral", "dead_brain_coral": "brain_coral",
"minecraft:dead_bubble_coral": "minecraft:bubble_coral", "dead_bubble_coral": "bubble_coral",
"minecraft:dead_fire_coral": "minecraft:fire_coral", "dead_fire_coral": "fire_coral",
"minecraft:dead_horn_coral": "minecraft:horn_coral", "dead_horn_coral": "horn_coral",
"minecraft:tube_coral": "minecraft:tube_coral", "tube_coral": "tube_coral",
"minecraft:brain_coral": "minecraft:brain_coral", "brain_coral": "brain_coral",
"minecraft:bubble_coral": "minecraft:bubble_coral", "bubble_coral": "bubble_coral",
"minecraft:fire_coral": "minecraft:fire_coral", "fire_coral": "fire_coral",
"minecraft:horn_coral": "minecraft:horn_coral", "horn_coral": "horn_coral",
"minecraft:conduit": "minecraft:conduit" "conduit": "conduit"
} }
} }

View File

@ -1,69 +1,69 @@
{ {
"blockstates": { "blockstates": {
"minecraft:bell[attachment=floor,facing=north,powered=true]": "minecraft:bell[attachment=floor,facing=north]", "bell[attachment=floor,facing=north,powered=true]": "bell[attachment=floor,facing=north]",
"minecraft:bell[attachment=floor,facing=north,powered=false]": "minecraft:bell[attachment=floor,facing=north]", "bell[attachment=floor,facing=north,powered=false]": "bell[attachment=floor,facing=north]",
"minecraft:bell[attachment=floor,facing=south,powered=true]": "minecraft:bell[attachment=floor,facing=south]", "bell[attachment=floor,facing=south,powered=true]": "bell[attachment=floor,facing=south]",
"minecraft:bell[attachment=floor,facing=south,powered=false]": "minecraft:bell[attachment=floor,facing=south]", "bell[attachment=floor,facing=south,powered=false]": "bell[attachment=floor,facing=south]",
"minecraft:bell[attachment=floor,facing=west,powered=true]": "minecraft:bell[attachment=floor,facing=west]", "bell[attachment=floor,facing=west,powered=true]": "bell[attachment=floor,facing=west]",
"minecraft:bell[attachment=floor,facing=west,powered=false]": "minecraft:bell[attachment=floor,facing=west]", "bell[attachment=floor,facing=west,powered=false]": "bell[attachment=floor,facing=west]",
"minecraft:bell[attachment=floor,facing=east,powered=true]": "minecraft:bell[attachment=floor,facing=east]", "bell[attachment=floor,facing=east,powered=true]": "bell[attachment=floor,facing=east]",
"minecraft:bell[attachment=floor,facing=east,powered=false]": "minecraft:bell[attachment=floor,facing=east]", "bell[attachment=floor,facing=east,powered=false]": "bell[attachment=floor,facing=east]",
"minecraft:bell[attachment=ceiling,facing=north,powered=true]": "minecraft:bell[attachment=ceiling,facing=north]", "bell[attachment=ceiling,facing=north,powered=true]": "bell[attachment=ceiling,facing=north]",
"minecraft:bell[attachment=ceiling,facing=north,powered=false]": "minecraft:bell[attachment=ceiling,facing=north]", "bell[attachment=ceiling,facing=north,powered=false]": "bell[attachment=ceiling,facing=north]",
"minecraft:bell[attachment=ceiling,facing=south,powered=true]": "minecraft:bell[attachment=ceiling,facing=south]", "bell[attachment=ceiling,facing=south,powered=true]": "bell[attachment=ceiling,facing=south]",
"minecraft:bell[attachment=ceiling,facing=south,powered=false]": "minecraft:bell[attachment=ceiling,facing=south]", "bell[attachment=ceiling,facing=south,powered=false]": "bell[attachment=ceiling,facing=south]",
"minecraft:bell[attachment=ceiling,facing=west,powered=true]": "minecraft:bell[attachment=ceiling,facing=west]", "bell[attachment=ceiling,facing=west,powered=true]": "bell[attachment=ceiling,facing=west]",
"minecraft:bell[attachment=ceiling,facing=west,powered=false]": "minecraft:bell[attachment=ceiling,facing=west]", "bell[attachment=ceiling,facing=west,powered=false]": "bell[attachment=ceiling,facing=west]",
"minecraft:bell[attachment=ceiling,facing=east,powered=true]": "minecraft:bell[attachment=ceiling,facing=east]", "bell[attachment=ceiling,facing=east,powered=true]": "bell[attachment=ceiling,facing=east]",
"minecraft:bell[attachment=ceiling,facing=east,powered=false]": "minecraft:bell[attachment=ceiling,facing=east]", "bell[attachment=ceiling,facing=east,powered=false]": "bell[attachment=ceiling,facing=east]",
"minecraft:bell[attachment=single_wall,facing=north,powered=true]": "minecraft:bell[attachment=single_wall,facing=north]", "bell[attachment=single_wall,facing=north,powered=true]": "bell[attachment=single_wall,facing=north]",
"minecraft:bell[attachment=single_wall,facing=north,powered=false]": "minecraft:bell[attachment=single_wall,facing=north]", "bell[attachment=single_wall,facing=north,powered=false]": "bell[attachment=single_wall,facing=north]",
"minecraft:bell[attachment=single_wall,facing=south,powered=true]": "minecraft:bell[attachment=single_wall,facing=south]", "bell[attachment=single_wall,facing=south,powered=true]": "bell[attachment=single_wall,facing=south]",
"minecraft:bell[attachment=single_wall,facing=south,powered=false]": "minecraft:bell[attachment=single_wall,facing=south]", "bell[attachment=single_wall,facing=south,powered=false]": "bell[attachment=single_wall,facing=south]",
"minecraft:bell[attachment=single_wall,facing=west,powered=true]": "minecraft:bell[attachment=single_wall,facing=west]", "bell[attachment=single_wall,facing=west,powered=true]": "bell[attachment=single_wall,facing=west]",
"minecraft:bell[attachment=single_wall,facing=west,powered=false]": "minecraft:bell[attachment=single_wall,facing=west]", "bell[attachment=single_wall,facing=west,powered=false]": "bell[attachment=single_wall,facing=west]",
"minecraft:bell[attachment=single_wall,facing=east,powered=true]": "minecraft:bell[attachment=single_wall,facing=east]", "bell[attachment=single_wall,facing=east,powered=true]": "bell[attachment=single_wall,facing=east]",
"minecraft:bell[attachment=single_wall,facing=east,powered=false]": "minecraft:bell[attachment=single_wall,facing=east]", "bell[attachment=single_wall,facing=east,powered=false]": "bell[attachment=single_wall,facing=east]",
"minecraft:bell[attachment=double_wall,facing=north,powered=true]": "minecraft:bell[attachment=double_wall,facing=north]", "bell[attachment=double_wall,facing=north,powered=true]": "bell[attachment=double_wall,facing=north]",
"minecraft:bell[attachment=double_wall,facing=north,powered=false]": "minecraft:bell[attachment=double_wall,facing=north]", "bell[attachment=double_wall,facing=north,powered=false]": "bell[attachment=double_wall,facing=north]",
"minecraft:bell[attachment=double_wall,facing=south,powered=true]": "minecraft:bell[attachment=double_wall,facing=south]", "bell[attachment=double_wall,facing=south,powered=true]": "bell[attachment=double_wall,facing=south]",
"minecraft:bell[attachment=double_wall,facing=south,powered=false]": "minecraft:bell[attachment=double_wall,facing=south]", "bell[attachment=double_wall,facing=south,powered=false]": "bell[attachment=double_wall,facing=south]",
"minecraft:bell[attachment=double_wall,facing=west,powered=true]": "minecraft:bell[attachment=double_wall,facing=west]", "bell[attachment=double_wall,facing=west,powered=true]": "bell[attachment=double_wall,facing=west]",
"minecraft:bell[attachment=double_wall,facing=west,powered=false]": "minecraft:bell[attachment=double_wall,facing=west]", "bell[attachment=double_wall,facing=west,powered=false]": "bell[attachment=double_wall,facing=west]",
"minecraft:bell[attachment=double_wall,facing=east,powered=true]": "minecraft:bell[attachment=double_wall,facing=east]", "bell[attachment=double_wall,facing=east,powered=true]": "bell[attachment=double_wall,facing=east]",
"minecraft:bell[attachment=double_wall,facing=east,powered=false]": "minecraft:bell[attachment=double_wall,facing=east]", "bell[attachment=double_wall,facing=east,powered=false]": "bell[attachment=double_wall,facing=east]",
"minecraft:honey_block": "minecraft:slime_block", "honey_block": "slime_block",
"minecraft:honeycomb_block": "minecraft:horn_coral_block", "honeycomb_block": "horn_coral_block",
"minecraft:beehive": "minecraft:barrel[facing=up,open=false]", "beehive": "barrel[facing=up,open=false]",
"minecraft:bee_nest": "minecraft:yellow_shulker_box[facing=up]" "bee_nest": "yellow_shulker_box[facing=up]"
}, },
"items": { "items": {
"minecraft:honey_bottle": { "honey_bottle": {
"id": "minecraft:dragon_breath", "id": "dragon_breath",
"name": "1.15 Honey Bottle" "name": "1.15 Honey Bottle"
}, },
"minecraft:honeycomb": { "honeycomb": {
"id": "minecraft:sunflower", "id": "sunflower",
"name": "1.15 Honeycomb" "name": "1.15 Honeycomb"
}, },
"minecraft:honeycomb_block": { "honeycomb_block": {
"id": "minecraft:horn_coral_block", "id": "horn_coral_block",
"name": "1.15 Honeycomb Block" "name": "1.15 Honeycomb Block"
}, },
"minecraft:bee_nest": { "bee_nest": {
"id": "minecraft:yellow_shulker_box", "id": "yellow_shulker_box",
"name": "1.15 Bee Nest" "name": "1.15 Bee Nest"
}, },
"minecraft:beehive": { "beehive": {
"id": "minecraft:barrel", "id": "barrel",
"name": "1.15 Beehive" "name": "1.15 Beehive"
}, },
"minecraft:honey_block": { "honey_block": {
"id": "minecraft:slime_block", "id": "slime_block",
"name": "1.15 Honey Block" "name": "1.15 Honey Block"
}, },
"minecraft:bee_spawn_egg": { "bee_spawn_egg": {
"id": "minecraft:ocelot_spawn_egg", "id": "ocelot_spawn_egg",
"name": "1.15 Bee Spawn Egg" "name": "1.15 Bee Spawn Egg"
} }
}, },

View File

@ -1,23 +1,23 @@
{ {
"blockstates": { "blockstates": {
"minecraft:lantern[hanging=true,waterlogged=true]": "minecraft:lantern[hanging=true]", "lantern[hanging=true,waterlogged=true]": "lantern[hanging=true]",
"minecraft:lantern[hanging=true,waterlogged=false]": "minecraft:lantern[hanging=true]", "lantern[hanging=true,waterlogged=false]": "lantern[hanging=true]",
"minecraft:lantern[hanging=false,waterlogged=true]": "minecraft:lantern[hanging=false]", "lantern[hanging=false,waterlogged=true]": "lantern[hanging=false]",
"minecraft:lantern[hanging=false,waterlogged=false]": "minecraft:lantern[hanging=false]", "lantern[hanging=false,waterlogged=false]": "lantern[hanging=false]",
"minecraft:soul_lantern[hanging=true,waterlogged=true]": "minecraft:soul_lantern[hanging=true]", "soul_lantern[hanging=true,waterlogged=true]": "soul_lantern[hanging=true]",
"minecraft:soul_lantern[hanging=true,waterlogged=false]": "minecraft:soul_lantern[hanging=true]", "soul_lantern[hanging=true,waterlogged=false]": "soul_lantern[hanging=true]",
"minecraft:soul_lantern[hanging=false,waterlogged=true]": "minecraft:soul_lantern[hanging=false]", "soul_lantern[hanging=false,waterlogged=true]": "soul_lantern[hanging=false]",
"minecraft:soul_lantern[hanging=false,waterlogged=false]": "minecraft:soul_lantern[hanging=false]", "soul_lantern[hanging=false,waterlogged=false]": "soul_lantern[hanging=false]",
"minecraft:chain[axis=x,waterlogged=true]": "minecraft:chain[waterlogged=true]", "chain[axis=x,waterlogged=true]": "chain[waterlogged=true]",
"minecraft:chain[axis=x,waterlogged=false]": "minecraft:chain[waterlogged=false]", "chain[axis=x,waterlogged=false]": "chain[waterlogged=false]",
"minecraft:chain[axis=y,waterlogged=true]": "minecraft:chain[waterlogged=true]", "chain[axis=y,waterlogged=true]": "chain[waterlogged=true]",
"minecraft:chain[axis=y,waterlogged=false]": "minecraft:chain[waterlogged=false]", "chain[axis=y,waterlogged=false]": "chain[waterlogged=false]",
"minecraft:chain[axis=z,waterlogged=true]": "minecraft:chain[waterlogged=true]", "chain[axis=z,waterlogged=true]": "chain[waterlogged=true]",
"minecraft:chain[axis=z,waterlogged=false]": "minecraft:chain[waterlogged=false]" "chain[axis=z,waterlogged=false]": "chain[waterlogged=false]"
}, },
"items": { "items": {
"minecraft:piglin_brute_spawn_egg": { "piglin_brute_spawn_egg": {
"id": "minecraft:piglin_spawn_egg", "id": "piglin_spawn_egg",
"name": "1.16.2 Piglin Brute Spawn Egg" "name": "1.16.2 Piglin Brute Spawn Egg"
} }
}, },

View File

@ -15,8 +15,8 @@
"music.overworld.stony_peaks": "" "music.overworld.stony_peaks": ""
}, },
"items": { "items": {
"minecraft:music_disc_otherside": { "music_disc_otherside": {
"id": "minecraft:music_disc_ward", "id": "music_disc_ward",
"name": "1.18 Otherside Music Disc" "name": "1.18 Otherside Music Disc"
} }
}, },

View File

@ -1,203 +1,203 @@
{ {
"blockstates": { "blockstates": {
"minecraft:cherry_planks": "minecraft:acacia_planks", "cherry_planks": "acacia_planks",
"minecraft:cherry_sapling": "minecraft:acacia_sapling[", "cherry_sapling": "acacia_sapling[",
"minecraft:suspicious_sand": "minecraft:sand", "suspicious_sand": "sand",
"minecraft:cherry_log": "minecraft:acacia_log[", "cherry_log": "acacia_log[",
"minecraft:stripped_cherry_log": "minecraft:stripped_acacia_log[", "stripped_cherry_log": "stripped_acacia_log[",
"minecraft:cherry_wood": "minecraft:acacia_wood[", "cherry_wood": "acacia_wood[",
"minecraft:stripped_cherry_wood": "minecraft:stripped_acacia_wood[", "stripped_cherry_wood": "stripped_acacia_wood[",
"minecraft:cherry_leaves": "minecraft:acacia_leaves[", "cherry_leaves": "acacia_leaves[",
"minecraft:torchflower": "minecraft:red_tulip", "torchflower": "red_tulip",
"minecraft:cherry_sign": "minecraft:acacia_sign[", "cherry_sign": "acacia_sign[",
"minecraft:cherry_wall_sign": "minecraft:acacia_wall_sign[", "cherry_wall_sign": "acacia_wall_sign[",
"minecraft:cherry_hanging_sign": "minecraft:acacia_hanging_sign[", "cherry_hanging_sign": "acacia_hanging_sign[",
"minecraft:cherry_wall_hanging_sign": "minecraft:acacia_wall_hanging_sign[", "cherry_wall_hanging_sign": "acacia_wall_hanging_sign[",
"minecraft:cherry_pressure_plate": "minecraft:acacia_pressure_plate[", "cherry_pressure_plate": "acacia_pressure_plate[",
"minecraft:cherry_trapdoor": "minecraft:acacia_trapdoor[", "cherry_trapdoor": "acacia_trapdoor[",
"minecraft:potted_torchflower": "minecraft:potted_red_tulip", "potted_torchflower": "potted_red_tulip",
"minecraft:potted_cherry_sapling": "minecraft:potted_pink_tulip", "potted_cherry_sapling": "potted_pink_tulip",
"minecraft:cherry_button": "minecraft:acacia_button[", "cherry_button": "acacia_button[",
"minecraft:cherry_stairs": "minecraft:acacia_stairs[", "cherry_stairs": "acacia_stairs[",
"minecraft:cherry_slab": "minecraft:acacia_slab[", "cherry_slab": "acacia_slab[",
"minecraft:cherry_fence": "minecraft:acacia_fence[", "cherry_fence": "acacia_fence[",
"minecraft:cherry_fence_gate": "minecraft:acacia_fence_gate[", "cherry_fence_gate": "acacia_fence_gate[",
"minecraft:cherry_door": "minecraft:acacia_door[", "cherry_door": "acacia_door[",
"minecraft:torchflower_crop": "minecraft:melon_stem[", "torchflower_crop": "melon_stem[",
"minecraft:pink_petals": "minecraft:air", "pink_petals": "air",
"minecraft:decorated_pot": "minecraft:bricks" "decorated_pot": "bricks"
}, },
"blockentities": { "blockentities": {
"suspicious_sand": "", "suspicious_sand": "",
"decorated_pot": "" "decorated_pot": ""
}, },
"items": { "items": {
"minecraft:cherry_planks": { "cherry_planks": {
"id": "minecraft:acacia_planks", "id": "acacia_planks",
"name": "1.19.4 Cherry Planks" "name": "1.19.4 Cherry Planks"
}, },
"minecraft:cherry_sapling": { "cherry_sapling": {
"id": "minecraft:peony", "id": "peony",
"name": "1.19.4 Cherry Sapling" "name": "1.19.4 Cherry Sapling"
}, },
"minecraft:suspicious_sand": { "suspicious_sand": {
"id": "minecraft:sand", "id": "sand",
"name": "1.19.4 Suspicious Sand" "name": "1.19.4 Suspicious Sand"
}, },
"minecraft:cherry_log": { "cherry_log": {
"id": "minecraft:acacia_log", "id": "acacia_log",
"name": "1.19.4 Cherry Log" "name": "1.19.4 Cherry Log"
}, },
"minecraft:stripped_cherry_log": { "stripped_cherry_log": {
"id": "minecraft:stripped_acacia_log", "id": "stripped_acacia_log",
"name": "1.19.4 Stripped Cherry Log" "name": "1.19.4 Stripped Cherry Log"
}, },
"minecraft:stripped_cherry_wood": { "stripped_cherry_wood": {
"id": "minecraft:stripped_acacia_wood", "id": "stripped_acacia_wood",
"name": "1.19.4 Stripped Cherry Wood" "name": "1.19.4 Stripped Cherry Wood"
}, },
"minecraft:cherry_wood": { "cherry_wood": {
"id": "minecraft:acacia_wood", "id": "acacia_wood",
"name": "1.19.4 Cherry Wood" "name": "1.19.4 Cherry Wood"
}, },
"minecraft:cherry_leaves": { "cherry_leaves": {
"id": "minecraft:acacia_leaves", "id": "acacia_leaves",
"name": "1.19.4 Cherry Leaves" "name": "1.19.4 Cherry Leaves"
}, },
"minecraft:torchflower": { "torchflower": {
"id": "minecraft:red_tulip", "id": "red_tulip",
"name": "1.19.4 Torchflower" "name": "1.19.4 Torchflower"
}, },
"minecraft:pink_petals": { "pink_petals": {
"id": "minecraft:brain_coral_fan", "id": "brain_coral_fan",
"name": "1.19.4 Pink Petals" "name": "1.19.4 Pink Petals"
}, },
"minecraft:cherry_slab": { "cherry_slab": {
"id": "minecraft:acacia_slab", "id": "acacia_slab",
"name": "1.19.4 Cherry Slab" "name": "1.19.4 Cherry Slab"
}, },
"minecraft:decorated_pot": { "decorated_pot": {
"id": "minecraft:flower_pot", "id": "flower_pot",
"name": "1.19.4 Decorated Pot" "name": "1.19.4 Decorated Pot"
}, },
"minecraft:cherry_fence": { "cherry_fence": {
"id": "minecraft:acacia_fence", "id": "acacia_fence",
"name": "1.19.4 Cherry Fence" "name": "1.19.4 Cherry Fence"
}, },
"minecraft:cherry_stairs": { "cherry_stairs": {
"id": "minecraft:acacia_stairs", "id": "acacia_stairs",
"name": "1.19.4 Cherry Stairs" "name": "1.19.4 Cherry Stairs"
}, },
"minecraft:cherry_button": { "cherry_button": {
"id": "minecraft:acacia_button", "id": "acacia_button",
"name": "1.19.4 Cherry Button" "name": "1.19.4 Cherry Button"
}, },
"minecraft:cherry_pressure_plate": { "cherry_pressure_plate": {
"id": "minecraft:acacia_pressure_plate", "id": "acacia_pressure_plate",
"name": "1.19.4 Cherry Pressure Plate" "name": "1.19.4 Cherry Pressure Plate"
}, },
"minecraft:cherry_door": { "cherry_door": {
"id": "minecraft:acacia_door", "id": "acacia_door",
"name": "1.19.4 Cherry Door" "name": "1.19.4 Cherry Door"
}, },
"minecraft:cherry_trapdoor": { "cherry_trapdoor": {
"id": "minecraft:acacia_trapdoor", "id": "acacia_trapdoor",
"name": "1.19.4 Cherry Trapdoor" "name": "1.19.4 Cherry Trapdoor"
}, },
"minecraft:cherry_fence_gate": { "cherry_fence_gate": {
"id": "minecraft:acacia_fence_gate", "id": "acacia_fence_gate",
"name": "1.19.4 Cherry Fence Gate" "name": "1.19.4 Cherry Fence Gate"
}, },
"minecraft:cherry_boat": { "cherry_boat": {
"id": "minecraft:acacia_boat", "id": "acacia_boat",
"name": "1.19.4 Cherry Boat" "name": "1.19.4 Cherry Boat"
}, },
"minecraft:cherry_chest_boat": { "cherry_chest_boat": {
"id": "minecraft:acacia_chest_boat", "id": "acacia_chest_boat",
"name": "1.19.4 Cherry Chest Boat" "name": "1.19.4 Cherry Chest Boat"
}, },
"minecraft:cherry_sign": { "cherry_sign": {
"id": "minecraft:acacia_sign", "id": "acacia_sign",
"name": "1.19.4 Cherry Sign" "name": "1.19.4 Cherry Sign"
}, },
"minecraft:cherry_hanging_sign": { "cherry_hanging_sign": {
"id": "minecraft:acacia_hanging_sign", "id": "acacia_hanging_sign",
"name": "1.19.4 Cherry Hanging Sign" "name": "1.19.4 Cherry Hanging Sign"
}, },
"minecraft:sniffer_spawn_egg": { "sniffer_spawn_egg": {
"id": "minecraft:strider_spawn_egg", "id": "strider_spawn_egg",
"name": "1.19.4 Sniffer Spawn Egg" "name": "1.19.4 Sniffer Spawn Egg"
}, },
"minecraft:torchflower_seeds": { "torchflower_seeds": {
"id": "minecraft:beetroot_seeds", "id": "beetroot_seeds",
"name": "1.19.4 Torchflower Seeds" "name": "1.19.4 Torchflower Seeds"
}, },
"minecraft:brush": { "brush": {
"id": "minecraft:shears", "id": "shears",
"name": "1.19.4 Brush" "name": "1.19.4 Brush"
}, },
"minecraft:netherite_upgrade_smithing_template": { "netherite_upgrade_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Netherite Upgrade Smithing Template" "name": "1.19.4 Netherite Upgrade Smithing Template"
}, },
"minecraft:sentry_armor_trim_smithing_template": { "sentry_armor_trim_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Sentry Armor Trim Smithing Template" "name": "1.19.4 Sentry Armor Trim Smithing Template"
}, },
"minecraft:dune_armor_trim_smithing_template": { "dune_armor_trim_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Dune Armor Trim Smithing Template" "name": "1.19.4 Dune Armor Trim Smithing Template"
}, },
"minecraft:coast_armor_trim_smithing_template": { "coast_armor_trim_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Coast Armor Trim Smithing Template" "name": "1.19.4 Coast Armor Trim Smithing Template"
}, },
"minecraft:wild_armor_trim_smithing_template": { "wild_armor_trim_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Wild Armor Trim Smithing Template" "name": "1.19.4 Wild Armor Trim Smithing Template"
}, },
"minecraft:ward_armor_trim_smithing_template": { "ward_armor_trim_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Ward Armor Trim Smithing Template" "name": "1.19.4 Ward Armor Trim Smithing Template"
}, },
"minecraft:eye_armor_trim_smithing_template": { "eye_armor_trim_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Eye Armor Trim Smithing Template" "name": "1.19.4 Eye Armor Trim Smithing Template"
}, },
"minecraft:vex_armor_trim_smithing_template": { "vex_armor_trim_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Vex Armor Trim Smithing Template" "name": "1.19.4 Vex Armor Trim Smithing Template"
}, },
"minecraft:tide_armor_trim_smithing_template": { "tide_armor_trim_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Tide Armor Trim Smithing Template" "name": "1.19.4 Tide Armor Trim Smithing Template"
}, },
"minecraft:snout_armor_trim_smithing_template": { "snout_armor_trim_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Snout Armor Trim Smithing Template" "name": "1.19.4 Snout Armor Trim Smithing Template"
}, },
"minecraft:rib_armor_trim_smithing_template": { "rib_armor_trim_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Rib Armor Trim Smithing Template" "name": "1.19.4 Rib Armor Trim Smithing Template"
}, },
"minecraft:spire_armor_trim_smithing_template": { "spire_armor_trim_smithing_template": {
"id": "minecraft:book", "id": "book",
"name": "1.19.4 Spire Armor Trim Smithing Template" "name": "1.19.4 Spire Armor Trim Smithing Template"
}, },
"minecraft:pottery_shard_archer": { "pottery_shard_archer": {
"id": "minecraft:brick", "id": "brick",
"name": "1.19.4 Pottery Shard Archer" "name": "1.19.4 Pottery Shard Archer"
}, },
"minecraft:pottery_shard_prize": { "pottery_shard_prize": {
"id": "minecraft:brick", "id": "brick",
"name": "1.19.4 Pottery Shard Prize" "name": "1.19.4 Pottery Shard Prize"
}, },
"minecraft:pottery_shard_arms_up": { "pottery_shard_arms_up": {
"id": "minecraft:brick", "id": "brick",
"name": "1.19.4 Pottery Shard Arms Up" "name": "1.19.4 Pottery Shard Arms Up"
}, },
"minecraft:pottery_shard_skull": { "pottery_shard_skull": {
"id": "minecraft:brick", "id": "brick",
"name": "1.19.4 Pottery Shard Skull" "name": "1.19.4 Pottery Shard Skull"
} }
}, },
@ -274,6 +274,6 @@
"sniffer": "Sniffer" "sniffer": "Sniffer"
}, },
"argumenttypes": { "argumenttypes": {
"minecraft:heightmap": "brigadier:string" "heightmap": "brigadier:string"
} }
} }

View File

@ -3,7 +3,7 @@ metadata.format.version = "1.1"
[versions] [versions]
# ViaVersion # ViaVersion
viaver = "4.6.0-23w08a-SNAPSHOT" viaver = "4.6.0-1.19.4-pre3-SNAPSHOT"
# Common provided # Common provided
netty = "4.0.20.Final" netty = "4.0.20.Final"

View File

@ -5,7 +5,7 @@ rootProject.name = "viabackwards-parent"
dependencyResolutionManagement { dependencyResolutionManagement {
repositories { repositories {
maven("https://repo.viaversion.com") maven("https://repo.viaversion.com")
maven("https://papermc.io/repo/repository/maven-public/") maven("https://repo.papermc.io/repository/maven-public/")
maven("https://oss.sonatype.org/content/repositories/snapshots/") maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.spongepowered.org/maven") maven("https://repo.spongepowered.org/maven")
mavenCentral() mavenCentral()