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
This commit is contained in:
2021-02-16 21:58:31 +01:00
parent df074b9ff5
commit 5b7f5649b1
18 changed files with 584 additions and 246 deletions

View File

@ -81,4 +81,13 @@ public class BlockLocationTest {
assertEquals("56,87,34", location.toString());
}
@Test
public void modRelativeTest() {
BlockLocation location = new BlockLocation(mockWorld, 5, 5, 5);
BlockLocation relativeLocation = location.modRelative(4, 2, 1, -1, 1, 0);
assertEquals(9, relativeLocation.getBlockX());
assertEquals(3, relativeLocation.getBlockY());
assertEquals(6, relativeLocation.getBlockZ());
}
}

View File

@ -0,0 +1,17 @@
package net.knarcraft.stargate;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class RelativeBlockVectorTest {
@Test
public void getTest() {
RelativeBlockVector relativeBlockVector = new RelativeBlockVector(56, 44, 23);
assertEquals(56, relativeBlockVector.getRight());
assertEquals(44, relativeBlockVector.getDepth());
assertEquals(23, relativeBlockVector.getDistance());
}
}