-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): more tests for light system
- Loading branch information
Showing
9 changed files
with
110 additions
and
22 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
50 changes: 40 additions & 10 deletions
50
api/src/main/java/org/allaymc/api/world/service/LightService.java
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,26 +1,56 @@ | ||
package org.allaymc.api.world.service; | ||
|
||
import org.allaymc.api.world.chunk.Chunk; | ||
|
||
/** | ||
* LightService is responsible for storing and calculating the light of a dimension. | ||
* | ||
* @author daoge_cmd | ||
* @see <a href="https://minecraft.wiki/w/Light">Light</a> | ||
*/ | ||
public interface LightService { | ||
/** | ||
* Get the skylight level at the specified position. | ||
* | ||
* @param x the x coordinate of the pos. | ||
* @param y the y coordinate of the pos. | ||
* @param z the z coordinate of the pos. | ||
* @return the skylight level at the specified position. | ||
*/ | ||
int getSkyLight(int x, int y, int z); | ||
|
||
/** | ||
* Get the internal light level at the specified position. | ||
* | ||
* @param x the x coordinate of the pos. | ||
* @param y the y coordinate of the pos. | ||
* @param z the z coordinate of the pos. | ||
* @return the internal light level at the specified position. | ||
*/ | ||
int getInternalLight(int x, int y, int z); | ||
|
||
/** | ||
* Get the internal skylight level at the specified position. | ||
* | ||
* @param x the x coordinate of the pos. | ||
* @param y the y coordinate of the pos. | ||
* @param z the z coordinate of the pos. | ||
* @return the internal skylight level at the specified position. | ||
*/ | ||
int getInternalSkyLight(int x, int y, int z); | ||
|
||
/** | ||
* Get the block light level at the specified position. | ||
* | ||
* @param x the x coordinate of the pos. | ||
* @param y the y coordinate of the pos. | ||
* @param z the z coordinate of the pos. | ||
* @return the block light level at the specified position. | ||
*/ | ||
int getBlockLight(int x, int y, int z); | ||
|
||
void onBlockChange(int x, int y, int z, int lightEmission, int lightDampening); | ||
|
||
void onChunkLoad(Chunk chunk); | ||
|
||
void onChunkUnload(Chunk chunk); | ||
|
||
/** | ||
* Get the queued update count. | ||
* | ||
* @return the queued update count. | ||
*/ | ||
int getQueuedUpdateCount(); | ||
|
||
int getLightDampening(int x, int y, int z); | ||
} |
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