MCPcopy Create free account
hub / github.com/Teneted/Tenet / addMaterial

Method addMaterial

src/main/java/org/bukkit/Material.java:8639–8655  ·  view source on GitHub ↗
(String materialName, int id, boolean isBlock)

Source from the content-addressed store, hash-verified

8637 }
8638
8639 public static Material addMaterial(String materialName, int id, boolean isBlock) {
8640 // Forge Blocks
8641 if (isBlock) {
8642 Material material = BY_NAME.get(materialName);
8643 if (material != null){
8644 material.isForgeBlock = true;
8645 }else {
8646 material = (Material) MohistEnumHelper.addEnum(Material.class, materialName, new Class[]{Integer.TYPE, Boolean.TYPE}, new Object[]{Integer.valueOf(id), true});
8647 }
8648 BY_NAME.put(materialName, material);
8649 return material;
8650 } else { // Forge Items
8651 Material material = (Material) MohistEnumHelper.addEnum(Material.class, materialName, new Class[]{Integer.TYPE, Boolean.TYPE}, new Object[]{Integer.valueOf(id), false});
8652 BY_NAME.put(materialName, material);
8653 return material;
8654 }
8655 }
8656}

Callers 2

Calls 4

addEnumMethod · 0.95
getMethod · 0.65
putMethod · 0.65
valueOfMethod · 0.45

Tested by

no test coverage detected