Skip to content

Commit

Permalink
Fix wrong flower models in item list
Browse files Browse the repository at this point in the history
  • Loading branch information
KonaeAkira committed Jun 17, 2022
1 parent 6c268d4 commit 8409786
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class ItemFixerUpper {
Map.entry("minecraft:netherbrick", "minecraft:nether_brick"),
Map.entry("minecraft:stained_hardened_clay", "minecraft:terracotta"),
Map.entry("minecraft:quartz_ore", "minecraft:nether_quartz_ore"),
Map.entry("minecraft:red_flower", "minecraft:poppy"),
Map.entry("minecraft:tallgrass", "minecraft:grass"),
Map.entry("minecraft:stone_slab2", "minecraft:red_sandstone_slab"),
Map.entry("minecraft:waterlily", "minecraft:lily_pad"),
Expand Down Expand Up @@ -88,6 +87,18 @@ public class ItemFixerUpper {
"minecraft:chiseled_stone_bricks"
};

private final static String[] RED_FLOWER_VARIANTS = {
"minecraft:poppy",
"minecraft:blue_orchid",
"minecraft:allium",
"minecraft:azure_bluet",
"minecraft:red_tulip",
"minecraft:orange_tulip",
"minecraft:white_tulip",
"minecraft:pink_tulip",
"minecraft:oxeye_daisy"
};

private final static String[] DOUBLE_PLANT_VARIANTS = {
"minecraft:sunflower",
"minecraft:lilac",
Expand Down Expand Up @@ -197,6 +208,7 @@ public static String convertItemId(String id, int damage) {
if (id.equals("minecraft:log2")) return "minecraft:" + TREE_VARIANTS[damage + 4] + "log";
if (id.equals("minecraft:leaves2")) return "minecraft:" + TREE_VARIANTS[damage + 4] + "leaves";
if (id.equals("minecraft:stonebrick")) return STONE_BRICK_VARIANTS[damage];
if (id.equals("minecraft:red_flower")) return RED_FLOWER_VARIANTS[damage];
if (id.equals("minecraft:double_plant")) return DOUBLE_PLANT_VARIANTS[damage];
if (id.equals("minecraft:spawn_egg")) return SPAWN_EGG_VARIANTS.getOrDefault(damage, "minecraft:ghast_spawn_egg");
if (id.equals("minecraft:banner")) return "minecraft:" + BLOCK_COLORS[15 - damage] + "banner";
Expand Down

0 comments on commit 8409786

Please sign in to comment.