Support enchantment tags

This commit is contained in:
Nassim Jahnke 2024-06-12 23:23:43 +02:00
parent ebe3e95153
commit 18a04e5695
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
3 changed files with 53 additions and 2 deletions

View File

@ -25,6 +25,52 @@
"trial_spawner[trial_spawner_state=cooldown]": "trial_spawner[ominous=false,trial_spawner_state=cooldown]"
},
"tags": {
"enchantment": {
"tooltip_order": [
"binding_curse",
"vanishing_curse",
"riptide",
"channeling",
"wind_burst",
"frost_walker",
"sharpness",
"smite",
"bane_of_arthropods",
"impaling",
"power",
"density",
"breach",
"piercing",
"sweeping_edge",
"multishot",
"fire_aspect",
"flame",
"knockback",
"punch",
"protection",
"blast_protection",
"fire_protection",
"projectile_protection",
"feather_falling",
"fortune",
"looting",
"silk_touch",
"luck_of_the_sea",
"efficiency",
"quick_charge",
"lure",
"respiration",
"aqua_affinity",
"soul_speed",
"swift_sneak",
"depth_strider",
"thorns",
"loyalty",
"unbreaking",
"infinity",
"mending"
]
},
"item": {
"armadillo_food": [
"spider_eye"

View File

@ -184,8 +184,8 @@
"size": 7630
},
"1.20.3:1.20.5": {
"object-hash": -455395339,
"size": 5406
"object-hash": 1487323654,
"size": 5609
},
"1.20.5:1.20.3": {
"object-hash": 1855931855,

View File

@ -469,8 +469,13 @@ public final class MappingsOptimizer {
case "block" -> "blocks";
case "item" -> "items";
case "entity_type" -> "entities";
case "enchantment" -> "enchantments";
default -> throw new IllegalArgumentException("Registry type not supported: " + type);
};
if (!mappedObject.has(typeKey)) {
throw new IllegalArgumentException("Could not find mapped object for " + typeKey);
}
final JsonArray typeElements = mappedObject.get(typeKey).getAsJsonArray();
final Object2IntMap<String> typeMap = MappingsLoader.arrayToMap(typeElements);