start working on error handling stuff

This commit is contained in:
dfsek
2025-12-29 22:18:44 -07:00
parent 9a16336f53
commit cb08401536
76 changed files with 212 additions and 165 deletions
@@ -76,7 +76,7 @@ public class BlockFunction implements Function<Void> {
y.apply(implementationArguments, scope).doubleValue(),
FloatingPointFunctions.round(xz.getZ())).mutable().add(arguments.getOrigin().toFloat());
BlockState current = arguments.getWorld().getBlockState(set);
if(overwrite.apply(implementationArguments, scope) || current.isAir()) {
if(overwrite.apply(implementationArguments, scope) || current.air()) {
arguments.getWorld().setBlockState(set, rot, physics.apply(implementationArguments, scope));
}
} catch(RuntimeException e) {
@@ -45,7 +45,7 @@ public class CheckBlockFunction implements Function<String> {
.add(Vector3.of(FloatingPointFunctions.round(xz.getX()),
y.apply(implementationArguments, scope)
.doubleValue(), FloatingPointFunctions.round(xz.getZ()))))
.getAsString();
.asString();
if(data.contains("[")) return data.substring(0, data.indexOf('[')); // Strip properties
else return data;
}
@@ -48,7 +48,7 @@ public class PullFunction implements Function<Void> {
Vector3.Mutable mutable = Vector3.of(FloatingPointFunctions.round(xz.getX()), y.apply(implementationArguments, scope).intValue(),
FloatingPointFunctions.round(xz.getZ())).mutable().add(arguments.getOrigin().toFloat());
while(mutable.getY() > arguments.getWorld().getMinHeight()) {
if(!arguments.getWorld().getBlockState(mutable).isAir()) {
if(!arguments.getWorld().getBlockState(mutable).air()) {
arguments.getWorld().setBlockState(mutable, data);
break;
}