Add Server#isGlobalTickThread
This method should be present in Paper, not just in Folia, given that the GlobalRegionScheduler is present. Additonally, add Server#isOwnedByCurrentRegion(World, int, int, int, int) for checking of a rectangle of chunks is owned by the current region.
This commit is contained in:
@@ -1321,9 +1321,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public final boolean isOwnedByCurrentRegion(World world, int minChunkX, int minChunkZ, int maxChunkX, int maxChunkZ) {
|
||||
+ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(
|
||||
+ ((CraftWorld) world).getHandle(), minChunkX, minChunkZ, maxChunkX, maxChunkZ
|
||||
+ );
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public final boolean isOwnedByCurrentRegion(Entity entity) {
|
||||
+ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(((org.bukkit.craftbukkit.entity.CraftEntity) entity).getHandleRaw());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public final boolean isGlobalTickThread() {
|
||||
+ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThread();
|
||||
+ }
|
||||
+ // Paper end - Folia reagion threading API
|
||||
+
|
||||
static {
|
||||
|
||||
Reference in New Issue
Block a user