Skip to content

Commit

Permalink
improve(category): rename the category horse -> mob-equipment
Browse files Browse the repository at this point in the history
  • Loading branch information
Siroshun09 committed Apr 18, 2024
1 parent f0ae6fb commit 7effd39
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static List<DefaultCategory> collectCurrentDefaultCategories(@NotNull ItemVersio
DefaultCategory.builder().key("armors").icon(Material.LEATHER_HELMET).items(categorizedItemMap.get("armors")).addDefaultDisplayName("Armors").addDisplayName(JAPANESE, "防具").build(),
DefaultCategory.builder().key("enchanted-books").icon(Material.ENCHANTED_BOOK).items(categorizedItemMap.get("enchanted-books")).addDefaultDisplayName("Enchanted Books").addDisplayName(JAPANESE, "エンチャント本").build(),
DefaultCategory.builder().key("potions").icon(Material.POTION).items(categorizedItemMap.get("potions")).addDefaultDisplayName("Potions").addDisplayName(JAPANESE, "ポーション").build(),
DefaultCategory.builder().key("horse").icon(Material.SADDLE).items(categorizedItemMap.get("horse")).addDefaultDisplayName("Horse").addDisplayName(JAPANESE, "").build(),
DefaultCategory.builder().key("mob-equipment").icon(Material.SADDLE).items(categorizedItemMap.get("horse")).addDefaultDisplayName("Mob Equipment").addDisplayName(JAPANESE, "モブ用装備").build(),
DefaultCategory.builder().key("music-discs").icon(Material.MUSIC_DISC_CAT).items(categorizedItemMap.get("music-discs")).addDefaultDisplayName("Music Discs").addDisplayName(JAPANESE, "ディスク").build(),
DefaultCategory.builder().key("spawn-eggs").icon(Material.COW_SPAWN_EGG).items(categorizedItemMap.get("spawn-eggs")).addDefaultDisplayName("Spawn Eggs").addDisplayName(JAPANESE, "スポーンエッグ").build(),
DefaultCategory.builder().key("unavailable").icon(Material.BEDROCK).items(categorizedItemMap.get("unavailable")).addDefaultDisplayName("Unavailable").addDisplayName(JAPANESE, "入手不可").build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,11 @@ private void loadAndRegisterCategory(@NotNull String key, @NotNull MapNode sourc
}

private static Object renameKey(@NotNull Object key) {
if (key.equals("woods")) {
return "woods-1";
}
return key;
return switch (String.valueOf(key)) {
case "woods" -> "woods-1";
case "horse" -> "mob-equipment";
default -> key;
};
}

private static void addDefaultDisplayName(@NotNull String key, @NotNull MapNode target) {
Expand All @@ -233,7 +234,7 @@ private static void addDefaultDisplayName(@NotNull String key, @NotNull MapNode
case "farms" -> Map.of(LOCALE_DEFAULT, "Farms", "ja", "農業・食料");
case "flowers" -> Map.of(LOCALE_DEFAULT, "Flowers", "ja", "草花");
case "glasses" -> Map.of(LOCALE_DEFAULT, "Glasses", "ja", "ガラス");
case "horse" -> Map.of(LOCALE_DEFAULT, "Horse", "ja", "");
case "horse" -> Map.of(LOCALE_DEFAULT, "Mob Equipment", "ja", "モブ用装備");
case "misc" -> Map.of(LOCALE_DEFAULT, "Misc", "ja", "その他");
case "mob-drops" -> Map.of(LOCALE_DEFAULT, "Mob Drops", "ja", "モブドロップ品");
case "mushrooms" -> Map.of(LOCALE_DEFAULT, "Mushrooms", "ja", "きのこ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ potions:
- LINGERING_POTION_LONG_WATER_BREATHING
- LINGERING_POTION_WEAKNESS
- LINGERING_POTION_LONG_WEAKNESS
horse:
mob-equipment:
- SADDLE
- LEATHER_HORSE_ARMOR
- IRON_HORSE_ARMOR
Expand Down

0 comments on commit 7effd39

Please sign in to comment.