| 952 | private static String[] __idToName = new String[__LENGTH]; |
| 953 | |
| 954 | public static void init() { |
| 955 | try { |
| 956 | for (Field field : Material.class.getDeclaredFields()) { |
| 957 | String name = field.getName(); |
| 958 | name = name.toLowerCase(); |
| 959 | if (!name.startsWith("__") && !name.startsWith("$")) { |
| 960 | Integer id = field.getInt(null); |
| 961 | __nameToId.put(name, id); |
| 962 | __idToName[id] = name; |
| 963 | } |
| 964 | } |
| 965 | } catch (IllegalArgumentException e) { |
| 966 | e.printStackTrace(); |
| 967 | } catch (IllegalAccessException e) { |
| 968 | e.printStackTrace(); |
| 969 | } |
| 970 | } |
| 971 | |
| 972 | private static final String removeSuffix(String s, String suffix) { |
| 973 | if (s.endsWith(suffix)) { |