Skip to content

Commit

Permalink
Support enchantment tags
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytv committed Jun 12, 2024
1 parent ebe3e95 commit 18a04e5
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
46 changes: 46 additions & 0 deletions mappings/diff/mapping-1.20.3to1.20.5.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions output_hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,13 @@ public void tags() {
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);

Expand Down

0 comments on commit 18a04e5

Please sign in to comment.