MCPcopy Create free account
hub / github.com/Garten/sourcecraft / get

Method get

src/source/Material.java:986–997  ·  view source on GitHub ↗
(String name)

Source from the content-addressed store, hash-verified

984 }
985
986 public static int get(String name) {
987 name = removePrefix(name, "minecraft:");
988 if (__nameToId == null) {
989 return _UNKOWN;
990 }
991 Integer result = __nameToId.get(name);
992 if (result == null) {
993 Loggger.log("cannot find material " + name);
994 return _UNKOWN;
995 }
996 return result;
997 }
998
999 public static String getName(int id) {
1000 if (id >= Material.__LENGTH || id < 0) {

Callers 1

getMappingMethod · 0.95

Calls 2

removePrefixMethod · 0.95
logMethod · 0.95

Tested by

no test coverage detected