Folia scheduler and owned region API
Pulling Folia API to Paper is primarily intended for plugins that want to target both Paper and Folia without unnecessary compatibility layers. Add both a location based scheduler, an entity based scheduler, and a global region scheduler. Owned region API may be useful for plugins which want to perform operations over large areas outside of the buffer zone provided by the regionaliser, as it is not guaranteed that anything outside of the buffer zone is owned. Then, the plugins may use the schedulers depending on the result of the ownership check.
This commit is contained in:
@@ -397,7 +397,7 @@
|
||||
|
||||
if (advancementdataplayer != null) {
|
||||
advancementdataplayer.save();
|
||||
@@ -334,95 +525,209 @@
|
||||
@@ -334,95 +525,210 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -489,6 +489,7 @@
|
||||
- this.server.getCustomBossEvents().onPlayerDisconnect(player);
|
||||
- UUID uuid = player.getUUID();
|
||||
+ worldserver.removePlayerImmediately(entityplayer, Entity.RemovalReason.UNLOADED_WITH_PLAYER);
|
||||
+ entityplayer.retireScheduler(); // Paper - Folia schedulers
|
||||
+ entityplayer.getAdvancements().stopListening();
|
||||
+ this.players.remove(entityplayer);
|
||||
+ this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
|
||||
@@ -645,7 +646,7 @@
|
||||
|
||||
if (entityplayer1 != null) {
|
||||
set.add(entityplayer1);
|
||||
@@ -431,72 +736,160 @@
|
||||
@@ -431,72 +737,160 @@
|
||||
Iterator iterator1 = set.iterator();
|
||||
|
||||
while (iterator1.hasNext()) {
|
||||
@@ -827,7 +828,7 @@
|
||||
return entityplayer1;
|
||||
}
|
||||
|
||||
@@ -516,15 +909,32 @@
|
||||
@@ -516,15 +910,32 @@
|
||||
}
|
||||
|
||||
public void sendPlayerPermissionLevel(ServerPlayer player) {
|
||||
@@ -862,7 +863,7 @@
|
||||
this.sendAllPlayerInfoIn = 0;
|
||||
}
|
||||
|
||||
@@ -541,6 +951,25 @@
|
||||
@@ -541,6 +952,25 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -888,7 +889,7 @@
|
||||
public void broadcastAll(Packet<?> packet, ResourceKey<Level> dimension) {
|
||||
Iterator iterator = this.players.iterator();
|
||||
|
||||
@@ -554,7 +983,7 @@
|
||||
@@ -554,7 +984,7 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -897,7 +898,7 @@
|
||||
PlayerTeam scoreboardteam = source.getTeam();
|
||||
|
||||
if (scoreboardteam != null) {
|
||||
@@ -573,7 +1002,7 @@
|
||||
@@ -573,7 +1003,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -906,7 +907,7 @@
|
||||
PlayerTeam scoreboardteam = source.getTeam();
|
||||
|
||||
if (scoreboardteam == null) {
|
||||
@@ -619,7 +1048,7 @@
|
||||
@@ -619,7 +1049,7 @@
|
||||
}
|
||||
|
||||
public void deop(GameProfile profile) {
|
||||
@@ -915,7 +916,7 @@
|
||||
ServerPlayer entityplayer = this.getPlayer(profile.getId());
|
||||
|
||||
if (entityplayer != null) {
|
||||
@@ -629,6 +1058,11 @@
|
||||
@@ -629,6 +1059,11 @@
|
||||
}
|
||||
|
||||
private void sendPlayerPermissionLevel(ServerPlayer player, int permissionLevel) {
|
||||
@@ -927,7 +928,7 @@
|
||||
if (player.connection != null) {
|
||||
byte b0;
|
||||
|
||||
@@ -643,36 +1077,53 @@
|
||||
@@ -643,36 +1078,53 @@
|
||||
player.connection.send(new ClientboundEntityEventPacket(player, b0));
|
||||
}
|
||||
|
||||
@@ -994,7 +995,7 @@
|
||||
if (entityplayer != player && entityplayer.level().dimension() == worldKey) {
|
||||
double d4 = x - entityplayer.getX();
|
||||
double d5 = y - entityplayer.getY();
|
||||
@@ -687,10 +1138,12 @@
|
||||
@@ -687,10 +1139,12 @@
|
||||
}
|
||||
|
||||
public void saveAll() {
|
||||
@@ -1007,7 +1008,7 @@
|
||||
}
|
||||
|
||||
public UserWhiteList getWhiteList() {
|
||||
@@ -712,15 +1165,19 @@
|
||||
@@ -712,15 +1166,19 @@
|
||||
public void reloadWhiteList() {}
|
||||
|
||||
public void sendLevelInfo(ServerPlayer player, ServerLevel world) {
|
||||
@@ -1031,7 +1032,7 @@
|
||||
}
|
||||
|
||||
player.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.LEVEL_CHUNKS_LOAD_START, 0.0F));
|
||||
@@ -729,8 +1186,16 @@
|
||||
@@ -729,8 +1187,16 @@
|
||||
|
||||
public void sendAllPlayerInfo(ServerPlayer player) {
|
||||
player.inventoryMenu.sendAllDataToRemote();
|
||||
@@ -1049,7 +1050,7 @@
|
||||
}
|
||||
|
||||
public int getPlayerCount() {
|
||||
@@ -746,6 +1211,7 @@
|
||||
@@ -746,6 +1212,7 @@
|
||||
}
|
||||
|
||||
public void setUsingWhiteList(boolean whitelistEnabled) {
|
||||
@@ -1057,7 +1058,7 @@
|
||||
this.doWhiteList = whitelistEnabled;
|
||||
}
|
||||
|
||||
@@ -786,12 +1252,36 @@
|
||||
@@ -786,12 +1253,36 @@
|
||||
}
|
||||
|
||||
public void removeAll() {
|
||||
@@ -1096,7 +1097,7 @@
|
||||
public void broadcastSystemMessage(Component message, boolean overlay) {
|
||||
this.broadcastSystemMessage(message, (entityplayer) -> {
|
||||
return message;
|
||||
@@ -819,24 +1309,43 @@
|
||||
@@ -819,24 +1310,43 @@
|
||||
}
|
||||
|
||||
public void broadcastChatMessage(PlayerChatMessage message, ServerPlayer sender, ChatType.Bound params) {
|
||||
@@ -1143,7 +1144,7 @@
|
||||
}
|
||||
|
||||
if (flag1 && sender != null) {
|
||||
@@ -845,20 +1354,27 @@
|
||||
@@ -845,20 +1355,27 @@
|
||||
|
||||
}
|
||||
|
||||
@@ -1176,7 +1177,7 @@
|
||||
Path path = file2.toPath();
|
||||
|
||||
if (FileUtil.isPathNormalized(path) && FileUtil.isPathPortable(path) && path.startsWith(file.getPath()) && file2.isFile()) {
|
||||
@@ -867,7 +1383,7 @@
|
||||
@@ -867,7 +1384,7 @@
|
||||
}
|
||||
|
||||
serverstatisticmanager = new ServerStatsCounter(this.server, file1);
|
||||
@@ -1185,7 +1186,7 @@
|
||||
}
|
||||
|
||||
return serverstatisticmanager;
|
||||
@@ -875,13 +1391,13 @@
|
||||
@@ -875,13 +1392,13 @@
|
||||
|
||||
public PlayerAdvancements getPlayerAdvancements(ServerPlayer player) {
|
||||
UUID uuid = player.getUUID();
|
||||
@@ -1201,7 +1202,7 @@
|
||||
}
|
||||
|
||||
advancementdataplayer.setPlayer(player);
|
||||
@@ -932,15 +1448,28 @@
|
||||
@@ -932,15 +1449,28 @@
|
||||
}
|
||||
|
||||
public void reloadResources() {
|
||||
|
||||
Reference in New Issue
Block a user