/** Returns the given type of stats if the material has them. Returns null Otherwise. */ private IMaterialStats getStatsSafe(String identifier) { if (identifier == null || identifier.isEmpty()) { return null; } for (IMaterialStats stat : stats.values()) { if (identifier.equals(stat.getIdentifier())) { return stat; } } return null; }
/** Do not use this function directly stats. Use TinkerRegistry.addMaterialStats instead. */ public Material addStats(IMaterialStats materialStats) { this.stats.put(materialStats.getIdentifier(), materialStats); return this; }