Support for the numerical IDs

This commit is contained in:
filoghost 2014-12-23 11:13:42 +01:00
parent d18f92d685
commit 9a3a44d0bf

View File

@ -8,6 +8,8 @@ import java.util.regex.Pattern;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import com.gmail.filoghost.holographicdisplays.commands.CommandValidator;
public class ItemUtils {
// This is used on hologram icons, to prevent vanilla items from merging with them.
@ -82,7 +84,11 @@ public class ItemUtils {
return stripSpacingSymbolsPattern.matcher(input).replaceAll("");
}
@SuppressWarnings("deprecation")
public static Material matchMaterial(String input) {
if (CommandValidator.isInteger(input)) {
return Material.getMaterial(Integer.parseInt(input));
}
return materialMap.get(stripSpacingChars(input).toLowerCase());
}