diff --git a/src/main/java/cr0s/warpdrive/api/ITransformation.java b/src/main/java/cr0s/warpdrive/api/ITransformation.java index e6478942..43543da3 100644 --- a/src/main/java/cr0s/warpdrive/api/ITransformation.java +++ b/src/main/java/cr0s/warpdrive/api/ITransformation.java @@ -7,21 +7,40 @@ import net.minecraft.world.World; public interface ITransformation { + // Return the World where the block or entity will be deployed. World getTargetWorld(); + // Return the number of 90 deg rotations to the right. + // Possible values are 0 (forward), 1 (turn right), 2 (turn back) and 3 (turning left). byte getRotationSteps(); + // reserved float getRotationYaw(); + // Return true if the provided coordinates are strictly inside the ship. + // Use this to keep connections with a remote location, or break the related links. boolean isInside(final double x, final double y, final double z); + // Return true if the provided coordinates are strictly inside the ship. + // Use this to keep connections with a remote location, or break the related links. boolean isInside(final int x, final int y, final int z); + // Translate then rotate the provided world coordinates. + // Rotation is always relative to the Ship core. + // Use this to transform floating coordinates, notably sub-components of a block. Vec3d apply(final double sourceX, final double sourceY, final double sourceZ); + // Translate then rotate the provided world coordinates. + // Rotation is always relative to the Ship core. + // Use this to transform a block aligned coordinate. BlockPos apply(final int sourceX, final int sourceY, final int sourceZ); + // Return the new coordinates for the provided TileEntity. + // Deprecated: use apply(tileEntity.getPos()) instead. + @Deprecated BlockPos apply(final TileEntity tileEntity); + // Translate then rotate the provided world coordinates. + // Rotation is always relative to the Ship core. BlockPos apply(final BlockPos blockPos); } \ No newline at end of file diff --git a/src/main/java/cr0s/warpdrive/compat/CompatArsMagica2.java b/src/main/java/cr0s/warpdrive/compat/CompatArsMagica2.java index 7b3222c5..33312ec9 100644 --- a/src/main/java/cr0s/warpdrive/compat/CompatArsMagica2.java +++ b/src/main/java/cr0s/warpdrive/compat/CompatArsMagica2.java @@ -178,7 +178,7 @@ public class CompatArsMagica2 implements IBlockTransformer { } final World targetWorld = transformation.getTargetWorld(); - final BlockPos target = transformation.apply(tileEntity); + final BlockPos target = transformation.apply(tileEntity.getPos()); final TileEntity tileEntityTarget = targetWorld.getTileEntity(target); if (tileEntityTarget == null) { WarpDrive.logger.error(String.format("ArsMagica2 compat: No tile entity found at target location %s. We might loose mana network %s.", target, nbtBase));