/** * Returns the material stats of the given type of this material. * * @param identifier Identifier of the material. * @param <T> Type of the Stats are determined by return value. Use the correct * @return The stats found or null if none present. */ @SuppressWarnings("unchecked") public <T extends IMaterialStats> T getStats(String identifier) { return (T) getStatsSafe(identifier); }
@SuppressWarnings("unchecked") public <T extends IMaterialStats> T getStatsOrUnknown(String identifier) { T stats = (T) getStatsSafe(identifier); if(stats == null && this != UNKNOWN) { return UNKNOWN.getStats(identifier); } return stats; }