From c3f64b1a3323db2f8601d1dd845c5086c4e50556 Mon Sep 17 00:00:00 2001 From: Robin Kupper Date: Tue, 1 Nov 2011 11:56:05 +0100 Subject: [PATCH] Fixed material names. Show dye color instead of ink for all. --- src/de/diddiz/util/BukkitUtils.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/de/diddiz/util/BukkitUtils.java b/src/de/diddiz/util/BukkitUtils.java index 8e524e6..4ba4dc8 100644 --- a/src/de/diddiz/util/BukkitUtils.java +++ b/src/de/diddiz/util/BukkitUtils.java @@ -39,11 +39,8 @@ public class BukkitUtils blockEquivalents.add(new HashSet(Arrays.asList(75, 76))); blockEquivalents.add(new HashSet(Arrays.asList(93, 94))); materialNames = new HashMap(256); - for (int i = 0; i < 256; i++) { - final Material mat = Material.getMaterial(i); - if (mat != null) - materialNames.put(i, mat.toString().replace('_', ' ').toLowerCase()); - } + for (final Material mat : Material.values()) + materialNames.put(mat.getId(), mat.toString().replace('_', ' ').toLowerCase()); } public static ItemStack[] compareInventories(ItemStack[] items1, ItemStack[] items2) { @@ -135,7 +132,7 @@ public class BukkitUtils } public static String materialName(int type, byte rawData) { - if ((type == 6 || type == 17 || type == 18) && rawData > 0 || type == 35 || type == 43 || type == 44) { + if ((type == 6 || type == 17 || type == 18) && rawData > 0 || type == 35 || type == 43 || type == 44 || type == 351) { final MaterialData data = Material.getMaterial(type).getNewData(rawData); if (data != null) return data.toString().toLowerCase().replace('_', ' ').replaceAll("[^a-z ]", "");