mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-24 05:21:16 +00:00
start working on error handling stuff
This commit is contained in:
+1
-1
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user