Example #1
0
  /** 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;
  }
Example #2
0
 /** Do not use this function directly stats. Use TinkerRegistry.addMaterialStats instead. */
 public Material addStats(IMaterialStats materialStats) {
   this.stats.put(materialStats.getIdentifier(), materialStats);
   return this;
 }