use of net.modificationstation.stationapi.api.client.model.item.ModelPredicateProvider in project StationAPI by ModificationStation.
the class ModelOverride method matches.
boolean matches(ItemInstance stack, @Nullable ClientLevel world, @Nullable Living entity) {
ItemBase item = stack.getType();
Iterator<Entry<Identifier, Float>> var5 = this.predicateToThresholds.entrySet().iterator();
Entry<Identifier, Float> entry;
ModelPredicateProvider modelPredicateProvider;
if (!var5.hasNext()) {
return true;
}
entry = var5.next();
modelPredicateProvider = ModelPredicateProviderRegistry.INSTANCE.get(item, entry.getKey());
while (modelPredicateProvider != null && modelPredicateProvider.call(stack, world, entity) >= entry.getValue()) {
if (!var5.hasNext()) {
return true;
}
entry = var5.next();
modelPredicateProvider = ModelPredicateProviderRegistry.INSTANCE.get(item, entry.getKey());
}
return false;
}
Aggregations