MCPcopy Index your code
hub / github.com/Garten/sourcecraft / init

Method init

src/source/Material.java:954–970  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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)) {

Callers 1

MainMethod · 0.95

Calls 2

getNameMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected