From 92aeee4a8680bce2b48dfe5a0167c3bc9964c197 Mon Sep 17 00:00:00 2001 From: Acrobot Date: Fri, 10 Aug 2012 18:54:49 +0200 Subject: [PATCH] Trying to fix "Item not recognised" message --- com/Acrobot/Breeze/Utils/MaterialUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com/Acrobot/Breeze/Utils/MaterialUtil.java b/com/Acrobot/Breeze/Utils/MaterialUtil.java index 615ab0d..b6284dc 100644 --- a/com/Acrobot/Breeze/Utils/MaterialUtil.java +++ b/com/Acrobot/Breeze/Utils/MaterialUtil.java @@ -63,14 +63,14 @@ public class MaterialUtil { return material; } - name = name.toUpperCase().replace(" ", "_"); + name = name.replace(" ", "").toUpperCase(); short length = Short.MAX_VALUE; for (Material currentMaterial : Material.values()) { String matName = currentMaterial.name(); - if (matName.startsWith(name) && matName.length() < length) { + if (matName.replace("_", "").startsWith(name) && matName.length() < length) { length = (short) matName.length(); material = currentMaterial; }