-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for splitting sections into multiple regions of length-y (#86)
* support for splitting sections into multiple regions of length-y * Updates * remove volume add length * remove length func Co-authored-by: Scyu_ <[email protected]>
- Loading branch information
Showing
46 changed files
with
61 additions
and
60 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
18 changes: 0 additions & 18 deletions
18
src/main/java/com/derongan/minecraft/deeperworld/world/Point.kt
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion
1
...ft/deeperworld/config/FallDamageConfig.kt → ...ft/deeperworld/config/FallDamageConfig.kt
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/com/derongan/minecraft/deeperworld/world/Point.kt
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.derongan.minecraft.deeperworld.world | ||
|
||
/** | ||
* Represents a single X/Y/Z cube in a minecraft world. | ||
*/ | ||
data class CubePoint(val x: Int, val y: Int, val z: Int) { | ||
operator fun plus(other: CubePoint) = CubePoint(x + other.x, y + other.y, z + other.z) | ||
|
||
operator fun minus(other: CubePoint) = CubePoint(x - other.x, y - other.y, z - other.z) | ||
|
||
operator fun div(o: Float) = CubePoint((x / o).toInt(), (y / o).toInt(), (z / o).toInt()) | ||
|
||
operator fun div(o: Int) = CubePoint(x / o, y / o, z / o) | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 0 additions & 19 deletions
19
src/test/java/com/derongan/minecraft/deeperworld/world/RegionTestU.kt
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
src/test/kotlin/com/derongan/minecraft/deeperworld/world/RegionTestU.kt
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.derongan.minecraft.deeperworld.world | ||
|
||
import org.junit.jupiter.api.Assertions.assertFalse | ||
import org.junit.jupiter.api.Assertions.assertTrue | ||
import org.junit.jupiter.api.Test | ||
|
||
class RegionTestU { | ||
@Test | ||
fun contains() { | ||
val region = Region(-1, 0, -1, 10, 10, 10) | ||
assertTrue(region.contains(-1, 0, -1)) | ||
assertTrue(region.contains(10, 0, 10)) | ||
assertTrue(region.contains(8, 2, 5)) | ||
assertFalse(region.contains(-2, 5, 5)) | ||
assertFalse(region.contains(11, -3, 5)) | ||
assertFalse(region.contains(5, 5, -2)) | ||
assertFalse(region.contains(5, -7, 11)) | ||
} | ||
} |