mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-11-24 11:25:52 +01:00
Support for the numerical IDs
This commit is contained in:
parent
d18f92d685
commit
9a3a44d0bf
@ -8,6 +8,8 @@ import java.util.regex.Pattern;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
|
import com.gmail.filoghost.holographicdisplays.commands.CommandValidator;
|
||||||
|
|
||||||
public class ItemUtils {
|
public class ItemUtils {
|
||||||
|
|
||||||
// This is used on hologram icons, to prevent vanilla items from merging with them.
|
// 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("");
|
return stripSpacingSymbolsPattern.matcher(input).replaceAll("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public static Material matchMaterial(String input) {
|
public static Material matchMaterial(String input) {
|
||||||
|
if (CommandValidator.isInteger(input)) {
|
||||||
|
return Material.getMaterial(Integer.parseInt(input));
|
||||||
|
}
|
||||||
return materialMap.get(stripSpacingChars(input).toLowerCase());
|
return materialMap.get(stripSpacingChars(input).toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user