-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
310 additions
and
88 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
craftlib-commons/src/main/kotlin/dev/zerite/craftlib/commons/world/Block.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,40 @@ | ||
package dev.zerite.craftlib.commons.world | ||
|
||
/** | ||
* Stores information about a single block in the world | ||
* | ||
* @author Koding | ||
* @since 0.1.0-SNAPSHOT | ||
*/ | ||
data class Block( | ||
val id: Int, | ||
val metadata: Int, | ||
val blockLight: Int = 0, | ||
val skyLight: Int = 0 | ||
) { | ||
|
||
companion object { | ||
/** | ||
* Constant value for an air block. | ||
*/ | ||
@JvmField | ||
val AIR = Block(0, 0) | ||
} | ||
|
||
/** | ||
* The location of this block. | ||
*/ | ||
lateinit var location: BlockLocation | ||
} | ||
|
||
/** | ||
* Vector for storing a 3D block location. | ||
* | ||
* @author Koding | ||
* @since 0.1.0-SNAPSHOT | ||
*/ | ||
data class BlockLocation( | ||
val x: Int, | ||
val y: Int, | ||
val z: Int | ||
) |
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
2 changes: 2 additions & 0 deletions
2
craftlib-protocol/src/main/kotlin/dev/zerite/craftlib/protocol/data/world/ChunkColumn.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
2 changes: 2 additions & 0 deletions
2
craftlib-protocol/src/main/kotlin/dev/zerite/craftlib/protocol/data/world/World.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
2 changes: 1 addition & 1 deletion
2
...t/kotlin/dev/zerite/craftlib/protocol/packet/play/server/world/ServerPlayChunkDataTest.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
2 changes: 1 addition & 1 deletion
2
...otlin/dev/zerite/craftlib/protocol/packet/play/server/world/ServerPlayMapChunkBulkTest.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
Oops, something went wrong.