add more api helpers

This commit is contained in:
dfsek
2025-12-30 01:27:41 -07:00
parent efa4bf5bb4
commit 998b6478f3
6 changed files with 45 additions and 19 deletions

View File

@@ -62,9 +62,10 @@ public class LootFunction implements Function<Void> {
String id = data.apply(implementationArguments, scope);
registry.get(RegistryKey.parse(id))
.consume(table -> {
RegistryKey.parse(id)
.bind(registry::getEither)
.consume(left -> LOGGER.error("No such loot table {}", id),
table -> {
Vector3 apply = Vector3.of(FloatingPointFunctions.round(xz.getX()),
y.apply(implementationArguments, scope)
.intValue(),
@@ -92,7 +93,7 @@ public class LootFunction implements Function<Void> {
e.printStackTrace();
}
}
).ifNothing(() -> LOGGER.error("No such loot table {}", id));
);
return null;
}