Stargate/src/main/java/net/knarcraft/stargate/RelativeBlockVector.java
EpicKnarvik97 5b7f5649b1 Makes a whole lot of changes
Adds some new tests
Improves plugin command handling by using one class for each command
Makes some changes to vehicle teleportation to support horses and pigs, but vehicle teleportation is still buggy and messy
Adds some more missing comments
Adds a wildcard permission and uses built-in permissions some places to avoid checking for three different permissions
2021-02-16 21:58:31 +01:00

54 lines
1.6 KiB
Java

package net.knarcraft.stargate;
/**
* This stores a block location as a vector relative to a position
*
* <p>A relative block vector stores a vector relative to some origin. The origin in this plugin is usually the
* top-left block of a gate. The right is therefore the distance from the top-left corner towards the top-right corner.
* Depth is the distance from the top-left corner to the bottom-left corner. Distance is the distance outward from the
* gate.</p>
*/
public class RelativeBlockVector {
private int right;
private int depth;
private int distance;
/**
* Instantiates a new relative block vector
* @param right <p>The distance to the right relative to the origin</p>
* @param depth <p>The distance downward relative to the origin</p>
* @param distance <p>The distance outward relative to the origin</p>
*/
public RelativeBlockVector(int right, int depth, int distance) {
this.right = right;
this.depth = depth;
this.distance = distance;
}
/**
* Gets the distance to the right relative to the origin
* @return The distance to the right relative to the origin
*/
public int getRight() {
return right;
}
/**
* Gets the distance downward relative to the origin
* @return The distance downward relative to the origin
*/
public int getDepth() {
return depth;
}
/**
* Gets the distance outward relative to the origin
* @return The distance outward relative to the origin
*/
public int getDistance() {
return distance;
}
}