-
Notifications
You must be signed in to change notification settings - Fork 12
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
Expand all runAtLocation methods to support chunk coordinate arguments #20
Changes from all commits
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
import com.tcoded.folialib.enums.EntityTaskResult; | ||
import com.tcoded.folialib.wrapper.task.WrappedTask; | ||
import org.bukkit.Location; | ||
import org.bukkit.World; | ||
import org.bukkit.entity.Entity; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
|
@@ -222,6 +223,18 @@ public interface ServerImplementation { | |
*/ | ||
CompletableFuture<Void> runAtLocation(Location location, @NotNull Consumer<WrappedTask> consumer); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
* Spigot: Synced with the server main thread | ||
* @param world The world to run the task at | ||
* @param chunkX The x coordinate of the chunk to run the task at | ||
* @param chunkZ The z coordinate of the chunk to run the task at | ||
* @param consumer Task to run | ||
* @return Future when the task is completed | ||
*/ | ||
CompletableFuture<Void> runAtLocation(World world, int chunkX, int chunkZ, @NotNull Consumer<WrappedTask> consumer); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
|
@@ -233,6 +246,19 @@ public interface ServerImplementation { | |
*/ | ||
WrappedTask runAtLocationLater(Location location, @NotNull Runnable runnable, long delay); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
* Spigot: Synced with the server main thread | ||
* @param world The world to run the task at | ||
* @param chunkX The x coordinate of the chunk to run the task at | ||
* @param chunkZ The z coordinate of the chunk to run the task at | ||
* @param runnable Task to run | ||
* @param delay Delay before execution in ticks | ||
* @return WrappedTask instance | ||
*/ | ||
WrappedTask runAtLocationLater(World world, int chunkX, int chunkZ, @NotNull Runnable runnable, long delay); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
|
@@ -243,6 +269,18 @@ public interface ServerImplementation { | |
*/ | ||
void runAtLocationLater(Location location, @NotNull Consumer<WrappedTask> consumer, long delay); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
* Spigot: Synced with the server main thread | ||
* @param world The world to run the task at | ||
* @param chunkX The x coordinate of the chunk to run the task at | ||
* @param chunkZ The z coordinate of the chunk to run the task at | ||
* @param consumer Task to run | ||
* @param delay Delay before execution in ticks | ||
*/ | ||
void runAtLocationLater(World world, int chunkX, int chunkZ, @NotNull Consumer<WrappedTask> consumer, long delay); | ||
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. This should return a 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. Yep |
||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
|
@@ -255,6 +293,20 @@ public interface ServerImplementation { | |
*/ | ||
WrappedTask runAtLocationLater(Location location, @NotNull Runnable runnable, long delay, TimeUnit unit); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
* Spigot: Synced with the server main thread | ||
* @param world The world to run the task at | ||
* @param chunkX The x coordinate of the chunk to run the task at | ||
* @param chunkZ The z coordinate of the chunk to run the task at | ||
* @param runnable Task to run | ||
* @param delay Delay before execution | ||
* @param unit Time unit | ||
* @return WrappedTask instance | ||
*/ | ||
WrappedTask runAtLocationLater(World world, int chunkX, int chunkZ, @NotNull Runnable runnable, long delay, TimeUnit unit); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
|
@@ -266,6 +318,19 @@ public interface ServerImplementation { | |
*/ | ||
void runAtLocationLater(Location location, @NotNull Consumer<WrappedTask> consumer, long delay, TimeUnit unit); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
* Spigot: Synced with the server main thread | ||
* @param world The world to run the task at | ||
* @param chunkX The x coordinate of the chunk to run the task at | ||
* @param chunkZ The z coordinate of the chunk to run the task at | ||
* @param consumer Task to run | ||
* @param delay Delay before execution | ||
* @param unit Time unit | ||
*/ | ||
void runAtLocationLater(World world, int chunkX, int chunkZ, @NotNull Consumer<WrappedTask> consumer, long delay, TimeUnit unit); | ||
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. This should return a |
||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
|
@@ -278,6 +343,20 @@ public interface ServerImplementation { | |
*/ | ||
WrappedTask runAtLocationTimer(Location location, @NotNull Runnable runnable, long delay, long period); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
* Spigot: Synced with the server main thread | ||
* @param world The world to run the task at | ||
* @param chunkX The x coordinate of the chunk to run the task at | ||
* @param chunkZ The z coordinate of the chunk to run the task at | ||
* @param runnable Task to run | ||
* @param delay Delay before first execution in ticks | ||
* @param period Delay between executions in ticks | ||
* @return WrappedTask instance | ||
*/ | ||
WrappedTask runAtLocationTimer(World world, int chunkX, int chunkZ, @NotNull Runnable runnable, long delay, long period); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
|
@@ -289,6 +368,19 @@ public interface ServerImplementation { | |
*/ | ||
void runAtLocationTimer(Location location, @NotNull Consumer<WrappedTask> consumer, long delay, long period); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
* Spigot: Synced with the server main thread | ||
* @param world The world to run the task at | ||
* @param chunkX The x coordinate of the chunk to run the task at | ||
* @param chunkZ The z coordinate of the chunk to run the task at | ||
* @param consumer Task to run | ||
* @param delay Delay before first execution in ticks | ||
* @param period Delay between executions in ticks | ||
*/ | ||
void runAtLocationTimer(World world, int chunkX, int chunkZ, @NotNull Consumer<WrappedTask> consumer, long delay, long period); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
|
@@ -302,6 +394,21 @@ public interface ServerImplementation { | |
*/ | ||
WrappedTask runAtLocationTimer(Location location, @NotNull Runnable runnable, long delay, long period, TimeUnit unit); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
* Spigot: Synced with the server main thread | ||
* @param world The world to run the task at | ||
* @param chunkX The x coordinate of the chunk to run the task at | ||
* @param chunkZ The z coordinate of the chunk to run the task at | ||
* @param runnable Task to run | ||
* @param delay Delay before first execution | ||
* @param period Delay between executions | ||
* @param unit Time unit | ||
* @return WrappedTask instance | ||
*/ | ||
WrappedTask runAtLocationTimer(World world, int chunkX, int chunkZ, @NotNull Runnable runnable, long delay, long period, TimeUnit unit); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
|
@@ -314,6 +421,19 @@ public interface ServerImplementation { | |
*/ | ||
void runAtLocationTimer(Location location, @NotNull Consumer<WrappedTask> consumer, long delay, long period, TimeUnit unit); | ||
|
||
/** | ||
* Folia: Synced with the tick of the region of the chunk of the location | ||
* Paper: Synced with the server main thread | ||
* Spigot: Synced with the server main thread | ||
* @param world The world to run the task at | ||
* @param chunkX The x coordinate of the chunk to run the task at | ||
* @param chunkZ The z coordinate of the chunk to run the task at | ||
* @param consumer Task to run | ||
* @param delay Delay before first execution | ||
* @param period Delay between executions | ||
* @param unit Time unit | ||
*/ | ||
void runAtLocationTimer(World world, int chunkX, int chunkZ, @NotNull Consumer<WrappedTask> consumer, long delay, long period, TimeUnit unit); | ||
|
||
// ----- Entity based ----- | ||
|
||
|
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.
Could we possibly do runAtChunk please? It makes it a little more obvious what int & int parameters will be. (Same for all other runAtChunk changes)