SPIGOT-6934: Bring plugin chunk tickets back in line with forceload tickets

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-02-20 08:55:27 +11:00
parent 7fe2a47414
commit c48241fce5
2 changed files with 38 additions and 27 deletions

View File

@@ -365,7 +365,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
ChunkMapDistance chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager;
if (chunkDistanceManager.addTicketAtLevel(TicketType.PLUGIN_TICKET, new ChunkCoordIntPair(x, z), 31, plugin)) { // keep in-line with force loading, add at level 31
if (chunkDistanceManager.addRegionTicketAtDistance(TicketType.PLUGIN_TICKET, new ChunkCoordIntPair(x, z), 2, plugin)) { // keep in-line with force loading, add at level 31
this.getChunkAt(x, z); // ensure loaded
return true;
}
@@ -378,7 +378,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
Preconditions.checkNotNull(plugin, "null plugin");
ChunkMapDistance chunkDistanceManager = this.world.getChunkSource().chunkMap.distanceManager;
return chunkDistanceManager.removeTicketAtLevel(TicketType.PLUGIN_TICKET, new ChunkCoordIntPair(x, z), 31, plugin); // keep in-line with force loading, remove at level 31
return chunkDistanceManager.removeRegionTicketAtDistance(TicketType.PLUGIN_TICKET, new ChunkCoordIntPair(x, z), 2, plugin); // keep in-line with force loading, remove at level 31
}
@Override