use of net.moddingplayground.frame.impl.toymaker.ObjectLootTableAccess in project frame-fabric by moddingplayground.
the class AbstractLootTableGenerator method accept.
@SuppressWarnings("ConstantConditions")
@Override
public void accept(BiConsumer<Identifier, LootTable.Builder> biConsumer) {
this.generate();
Set<Identifier> set = Sets.newHashSet();
Registry<T> registry = this.getRegistry();
Iterable<T> objects = registry.stream().filter(obj -> registry.getId(obj).getNamespace().equals(this.modId))::iterator;
for (T obj : objects) {
Identifier id = ((ObjectLootTableAccess) obj).access_getLootTableId();
this.testObject(id, obj);
if (id != LootTables.EMPTY && set.add(id)) {
LootTable.Builder builder = this.map.remove(id);
if (builder == null) {
throw new IllegalStateException(String.format("Missing loottable '%s' for '%s'", id, registry.getId(obj)));
}
biConsumer.accept(id, builder);
}
}
this.map.forEach(biConsumer);
}
Aggregations