Trying to fix "Item not recognised" message

This commit is contained in:
Acrobot 2012-08-10 18:54:49 +02:00
parent a467e405c2
commit 92aeee4a86
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}