Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/main/java/world/bentobox/level/panels/DetailsPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,10 @@ private Material convertItem(Material m) {
Material.getMaterial(m.name().substring(0, m.name().length() - 10) + "_SIGN"), Material.OAK_SIGN);
}
if (Tag.WALL_HANGING_SIGNS.isTagged(m)) {
// Wall signs end in _HANGING_WALL_SIGN
// Wall hanging signs end in _WALL_HANGING_SIGN
return Objects.requireNonNullElse(
Material.getMaterial(m.name().substring(0, m.name().length() - 18) + "_SIGN"), Material.OAK_SIGN);
Material.getMaterial(m.name().substring(0, m.name().length() - 18) + "_HANGING_SIGN"),
Material.OAK_HANGING_SIGN);
}

return switch (m) {
Expand All @@ -790,7 +791,8 @@ private Material convertItem(Material m) {
DRAGON_WALL_HEAD, PIGLIN_WALL_HEAD ->
Material.SKELETON_SKULL;
case SWEET_BERRY_BUSH -> Material.SWEET_BERRIES;
case WEEPING_VINES_PLANT, TWISTING_VINES_PLANT -> Material.VINE;
case WEEPING_VINES_PLANT -> Material.WEEPING_VINES;
case TWISTING_VINES_PLANT -> Material.TWISTING_VINES;
case CAVE_VINES, CAVE_VINES_PLANT -> Material.GLOW_BERRIES;
case BIG_DRIPLEAF_STEM -> Material.BIG_DRIPLEAF;
case BAMBOO_SAPLING, POTTED_BAMBOO -> Material.BAMBOO;
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/world/bentobox/level/panels/ValuePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,6 @@ private PanelItem createMaterialButton(ItemTemplateRecord template, TemplatedPan
private Material getIcon(String key) {
// Filter out some names
key = key.replaceAll("wall_", "");
key = key.replaceAll("_hanging", "");
Material icon = Registry.MATERIAL.get(NamespacedKey.fromString(key));
if (icon == null && key.endsWith("_spawner")) {
icon = Registry.MATERIAL.get(NamespacedKey.fromString(key.substring(0, key.length() - 2) + "_egg"));
Expand All @@ -691,8 +690,8 @@ private Material getIcon(String key) {
case END_PORTAL: return Material.BLACK_STAINED_GLASS_PANE;
case SOUL_FIRE: return Material.SOUL_TORCH;
case WALL_TORCH: return Material.TORCH;
case TWISTING_VINES_PLANT: return Material.VINE;
case CAVE_VINES_PLANT: return Material.VINE;
case TWISTING_VINES_PLANT: return Material.TWISTING_VINES;
case CAVE_VINES, CAVE_VINES_PLANT: return Material.GLOW_BERRIES;
case BAMBOO_SAPLING: return Material.BAMBOO;
case KELP_PLANT: return Material.KELP;
case SWEET_BERRY_BUSH: return Material.SWEET_BERRIES;
Expand All @@ -715,9 +714,12 @@ private Material getIcon(String key) {
if (Tag.FLOWER_POTS.isTagged(icon)) {
return Material.FLOWER_POT;
}
if (Tag.WALL_SIGNS.isTagged(icon) || Tag.ALL_HANGING_SIGNS.isTagged(icon)) {
if (Tag.WALL_SIGNS.isTagged(icon)) {
return Material.OAK_SIGN;
}
if (Tag.ALL_HANGING_SIGNS.isTagged(icon)) {
return Material.OAK_HANGING_SIGN;
}
if (Tag.CANDLE_CAKES.isTagged(icon)) {
return Material.CAKE;
}
Expand Down
Loading