-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from Efnilite/dev/5.1.3
v5.1.3
- Loading branch information
Showing
11 changed files
with
83 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,36 @@ | ||
package dev.efnilite.ip; | ||
|
||
import dev.efnilite.ip.generator.JumpDirector; | ||
import org.bukkit.util.BoundingBox; | ||
import org.bukkit.util.Vector; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class JumpDirectorTest { | ||
|
||
private BoundingBox bb; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
var corner1 = new Vector(0, 0, 0); | ||
var corner2 = new Vector(100, 100, 100); | ||
|
||
bb = BoundingBox.of(corner1, corner2); | ||
} | ||
|
||
@Test | ||
void testProgress() { | ||
var point = new Vector(50, 50, 50); | ||
var director = new JumpDirector(bb, point); | ||
var progress = director.getProgress(); | ||
|
||
assertEquals(progress[0][0], 0.5); | ||
assertEquals(progress[1][0], 0.5); | ||
assertEquals(progress[2][0], 0.5); | ||
} | ||
|
||
@Test | ||
void testRecommendedHeading() { | ||
var point = new Vector(95, 50, 50); | ||
var director = new JumpDirector(bb, point); | ||
var heading = director.getRecommendedHeading(); | ||
|
||
assertEquals(heading.getX(), -1); | ||
assertEquals(heading.getY(), 0); | ||
assertEquals(heading.getZ(), 0); | ||
} | ||
// private BoundingBox bb; | ||
// | ||
// @BeforeEach | ||
// void setUp() { | ||
// var corner1 = new Vector(0, 0, 0); | ||
// var corner2 = new Vector(100, 100, 100); | ||
// | ||
// bb = BoundingBox.of(corner1, corner2); | ||
// } | ||
// | ||
// @Test | ||
// void testProgress() { | ||
// var point = new Vector(50, 50, 50); | ||
// var director = new JumpDirector(bb, point); | ||
// var progress = director.getProgress(); | ||
// | ||
// assertEquals(progress[0][0], 0.5); | ||
// assertEquals(progress[1][0], 0.5); | ||
// assertEquals(progress[2][0], 0.5); | ||
// } | ||
// | ||
// @Test | ||
// void testRecommendedHeading() { | ||
// var point = new Vector(95, 50, 50); | ||
// var director = new JumpDirector(bb, point); | ||
// var heading = director.getRecommendedHeading(); | ||
// | ||
// assertEquals(heading.getX(), -1); | ||
// assertEquals(heading.getY(), 0); | ||
// assertEquals(heading.getZ(), 0); | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters