implement BlockState with mixin on Fabric

This commit is contained in:
dfsek
2021-12-21 13:09:40 -07:00
parent 1a1016bdf8
commit 5dbc2c2895
25 changed files with 204 additions and 253 deletions

View File

@@ -54,7 +54,7 @@ public class BlockFunction implements Function<Void> {
@Override
public Void apply(ImplementationArguments implementationArguments, Map<String, Variable<?>> variableMap) {
TerraImplementationArguments arguments = (TerraImplementationArguments) implementationArguments;
BlockState rot = getBlockState(implementationArguments, variableMap).clone();
BlockState rot = getBlockState(implementationArguments, variableMap);
setBlock(implementationArguments, variableMap, arguments, rot);
return null;
}
@@ -75,7 +75,7 @@ public class BlockFunction implements Function<Void> {
z.apply(implementationArguments, variableMap).doubleValue()), arguments.getRotation());
RotationUtil.rotateBlockData(rot, arguments.getRotation().inverse());
rot = RotationUtil.rotateBlockData(rot, arguments.getRotation().inverse());
try {
Vector3.Mutable set = Vector3.of(FastMath.roundToInt(xz.getX()),
y.apply(implementationArguments, variableMap).doubleValue(),

View File

@@ -48,8 +48,7 @@ public class PullFunction implements Function<Void> {
Vector2 xz = RotationUtil.rotateVector(Vector2.of(x.apply(implementationArguments, variableMap).doubleValue(),
z.apply(implementationArguments, variableMap).doubleValue()), arguments.getRotation());
BlockState rot = data.clone();
RotationUtil.rotateBlockData(rot, arguments.getRotation().inverse());
BlockState rot = RotationUtil.rotateBlockData(data, arguments.getRotation().inverse());
Vector3.Mutable mutable = Vector3.of(FastMath.roundToInt(xz.getX()), y.apply(implementationArguments, variableMap).intValue(),
FastMath.roundToInt(xz.getZ())).mutable().add(arguments.getOrigin());