Moves SimpleVectorOperation to its own class
All checks were successful
EpicKnarvik97/Stargate/pipeline/head This commit looks good

This commit is contained in:
2025-09-14 01:45:03 +02:00
parent 061430dfe4
commit d080644364
2 changed files with 8 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
package net.knarcraft.stargate.portal;
import net.knarcraft.stargate.SimpleVectorOperation;
import net.knarcraft.stargate.transformation.SimpleVectorOperation;
import net.knarcraft.stargate.container.BlockLocation;
import net.knarcraft.stargate.container.RelativeBlockVector;
import net.knarcraft.stargate.portal.property.PortalLocation;

View File

@@ -1,4 +1,4 @@
package net.knarcraft.stargate;
package net.knarcraft.stargate.transformation;
import org.bukkit.Axis;
import org.bukkit.block.BlockFace;
@@ -32,7 +32,7 @@ public class SimpleVectorOperation {
*
* @param signFace <p>The sign face of a gate's sign</p>
*/
public SimpleVectorOperation(BlockFace signFace) {
public SimpleVectorOperation(@NotNull BlockFace signFace) {
if (normalAxes.isEmpty()) {
initializeIrisNormalAxes();
initializeOperations();
@@ -47,6 +47,7 @@ public class SimpleVectorOperation {
*
* @return <p>The block face of a sign given upon instantiation</p>
*/
@NotNull
public BlockFace getFacing() {
return facing;
}
@@ -58,6 +59,7 @@ public class SimpleVectorOperation {
*
* @return <p>The normal axis orthogonal to the opening plane</p>
*/
@NotNull
public Axis getNormalAxis() {
return normalAxis;
}
@@ -77,6 +79,7 @@ public class SimpleVectorOperation {
* @param vector <p>The vector to perform the operation on</p>
* @return vector <p>A new vector with the operation applied</p>
*/
@NotNull
public Vector performToAbstractSpaceOperation(@NotNull Vector vector) {
Vector clone = vector.clone();
clone.rotateAroundAxis(rotationAxes.get(facing), rotationAngles.get(facing));
@@ -92,6 +95,7 @@ public class SimpleVectorOperation {
* @param vector <p>The vector to perform the inverse operation on</p>
* @return vector <p>A new vector with the operation applied</p>
*/
@NotNull
public Vector performToRealSpaceOperation(@NotNull Vector vector) {
Vector clone = vector.clone();
if (flipZAxis) {
@@ -106,6 +110,7 @@ public class SimpleVectorOperation {
* @param vector <p>The vector to perform the inverse operation on</p>
* @return vector <p>A new vector with the operation applied</p>
*/
@NotNull
public BlockVector performToRealSpaceOperation(@NotNull BlockVector vector) {
return performToRealSpaceOperation((Vector) vector).toBlockVector();
}