use of net.silentchaos512.gear.api.material.modifier.IMaterialModifier in project Silent-Gear by SilentChaos512.
the class MaterialInstance method getStatModifiers.
@Override
public Collection<StatInstance> getStatModifiers(PartType partType, StatGearKey key, ItemStack gear) {
List<StatInstance> mods = new ArrayList<>(material.getStatModifiers(this, partType, key, gear));
ItemStat stat = ItemStats.get(key.getStat());
if (stat == null) {
SilentGear.LOGGER.warn("Unknown item stat: {}", key.getStat().getStatId());
SilentGear.LOGGER.catching(new NullPointerException());
return mods;
}
// Material modifiers (grades, starcharged, etc.)
for (IMaterialModifier materialModifier : getModifiers()) {
mods = materialModifier.modifyStats(partType, key, mods);
}
GetMaterialStatsEvent event = new GetMaterialStatsEvent(this, stat, partType, mods);
MinecraftForge.EVENT_BUS.post(event);
return event.getModifiers();
}
Aggregations