-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(JOML): Migrate methods of WorldProvider #3899
Changes from all commits
6e6e8c8
1f51efb
220b894
9292d99
2f4abaa
f8cc3bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ | |
*/ | ||
package org.terasology.world; | ||
|
||
import org.joml.Vector3fc; | ||
import org.joml.Vector3ic; | ||
import org.terasology.math.geom.Vector3f; | ||
import org.terasology.math.geom.Vector3i; | ||
import org.terasology.world.block.Block; | ||
|
@@ -29,19 +31,49 @@ public interface WorldProvider extends WorldProviderCore { | |
/** | ||
* An active block is in a chunk that is available and fully generated. | ||
* | ||
* @param pos | ||
* @param pos The position | ||
* @return Whether the given block is active | ||
* @deprecated This is scheduled for removal in an upcoming version | ||
* method will be replaced with JOML implementation {@link #isBlockRelevant(Vector3ic)}. | ||
*/ | ||
@Deprecated | ||
boolean isBlockRelevant(Vector3i pos); | ||
|
||
/** | ||
* An active block is in a chunk that is available and fully generated. | ||
* @param pos The position | ||
* @return Whether the given block is active | ||
*/ | ||
boolean isBlockRelevant(Vector3ic pos); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we consider (in general) adding default interface implementations when adding new methods like this? That could avoid having to update some things in modulespace. In this case I'm not sure it makes sense as I only see one non-engine usage over in FlexiblePathfinding. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can't hurt at the moment but a lot of this is temporary and all the old methods are going to go away anyways. It can't hurt to implement it even if the use case is limited. |
||
|
||
/** | ||
* An active block is in a chunk that is available and fully generated. | ||
* | ||
* @param pos The position | ||
* @return Whether the given block is active | ||
* @deprecated This is scheduled for removal in an upcoming version | ||
* method will be replaced with JOML implementation {@link #isBlockRelevant(Vector3fc)}. | ||
*/ | ||
@Deprecated | ||
boolean isBlockRelevant(Vector3f pos); | ||
|
||
/** | ||
* An active block is in a chunk that is available and fully generated. | ||
* | ||
* @param pos The position | ||
* @return Whether the given block is active | ||
*/ | ||
boolean isBlockRelevant(Vector3fc pos); | ||
|
||
/** | ||
* Returns the block value at the given position. | ||
* | ||
* @param pos The position | ||
* @return The block value at the given position | ||
* @deprecated This is scheduled for removal in an upcoming version | ||
* method will be replaced with JOML implementation {@link #getBlock(Vector3fc)}. | ||
*/ | ||
@Deprecated | ||
Block getBlock(Vector3f pos); | ||
|
||
/** | ||
|
@@ -50,8 +82,27 @@ public interface WorldProvider extends WorldProviderCore { | |
* @param pos The position | ||
* @return The block value at the given position | ||
*/ | ||
Block getBlock(Vector3fc pos); | ||
|
||
/** | ||
* Returns the block value at the given position. | ||
* | ||
* @param pos The position | ||
* @return The block value at the given position | ||
* @deprecated This is scheduled for removal in an upcoming version | ||
* method will be replaced with JOML implementation {@link #getBlock(Vector3ic)}. | ||
*/ | ||
@Deprecated | ||
Block getBlock(Vector3i pos); | ||
|
||
/** | ||
* Returns the block value at the given position. | ||
* | ||
* @param pos The position | ||
* @return The block value at the given position | ||
*/ | ||
Block getBlock(Vector3ic pos); | ||
|
||
/** | ||
* Returns the light value at the given position. | ||
* | ||
|
@@ -87,7 +138,7 @@ public interface WorldProvider extends WorldProviderCore { | |
byte getSunlight(Vector3i pos); | ||
|
||
byte getTotalLight(Vector3i pos); | ||
|
||
/** | ||
* Gets one of the per-block custom data values at the given position. Returns 0 outside the view. | ||
* | ||
|
@@ -96,7 +147,7 @@ public interface WorldProvider extends WorldProviderCore { | |
* @return The (index)th extra-data value at the given position | ||
*/ | ||
int getExtraData(int index, Vector3i pos); | ||
|
||
/** | ||
* Sets one of the per-block custom data values at the given position, if it is within the view. | ||
* | ||
|
@@ -108,7 +159,7 @@ public interface WorldProvider extends WorldProviderCore { | |
* @return The replaced value | ||
*/ | ||
int setExtraData(int index, int x, int y, int z, int value); | ||
|
||
/** | ||
* Gets one of the per-block custom data values at the given position. Returns 0 outside the view. | ||
* | ||
|
@@ -119,7 +170,7 @@ public interface WorldProvider extends WorldProviderCore { | |
* @return The named extra-data value at the given position | ||
*/ | ||
int getExtraData(String fieldName, int x, int y, int z); | ||
|
||
/** | ||
* Gets one of the per-block custom data values at the given position. Returns 0 outside the view. | ||
* | ||
|
@@ -128,7 +179,7 @@ public interface WorldProvider extends WorldProviderCore { | |
* @return The named extra-data value at the given position | ||
*/ | ||
int getExtraData(String fieldName, Vector3i pos); | ||
|
||
/** | ||
* Sets one of the per-block custom data values at the given position, if it is within the view. | ||
* | ||
|
@@ -140,7 +191,7 @@ public interface WorldProvider extends WorldProviderCore { | |
* @return The replaced value | ||
*/ | ||
int setExtraData(String fieldName, int x, int y, int z, int value); | ||
|
||
/** | ||
* Sets one of the per-block custom data values at the given position, if it is within the view. | ||
* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this test name 👍