Prevent unloading worlds with pending player logins

Logging into an unloaded world isn't going to end well.
This may fix the cases of people seeing errors about regionfiles
being closed, as loading chunks in an unloaded world will cause this
as the regionfile cache is closed but not cleared.
This commit is contained in:
Spottedleaf 2022-08-26 21:56:55 -07:00
parent 0bf8790c9c
commit aabf676721
40 changed files with 164 additions and 128 deletions

View File

@ -4,6 +4,26 @@ Date: Sun, 19 Apr 2020 04:28:29 -0400
Subject: [PATCH] Load Chunks for Login Asynchronously
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 67f1a8490d48f55d58268d7e34a27170792b5559..a7db54a94a5017e737ce9682a52eed7405af8cc1 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -170,6 +170,7 @@ import org.bukkit.event.world.GenericGameEvent;
import org.bukkit.event.world.TimeSkipEvent;
// CraftBukkit end
import it.unimi.dsi.fastutil.ints.IntArrayList; // Paper
+import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; // Paper
public class ServerLevel extends Level implements WorldGenLevel {
@@ -404,6 +405,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
return this.getServer().getPlayerList().getPlayer(uuid);
}
// Paper end
+ public final ReferenceOpenHashSet<ServerPlayer> pendingLogin = new ReferenceOpenHashSet<>(); // Paper
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 084521ed853fc2b15be355a17da8421c54716815..acc64abd9420b81ed4c8c17cf6a9f5bc5d35f116 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
@ -96,7 +116,7 @@ index c83395364edb4f2ba8515326b19c4f1a436a0502..c99266d4782c5d58339e63f7564c28b4
try {
ServerPlayer entityplayer1 = this.server.getPlayerList().getPlayerForLogin(this.gameProfile, s); // CraftBukkit - add player reference
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index b48641bbe371ffacbbd659a0ee1783437267a4dc..0d86536696657ba6eee5f12d3d3afa8e5a167060 100644
index b48641bbe371ffacbbd659a0ee1783437267a4dc..9bfa4ff2eefa47e7468eeb4f912873b07ad17ac1 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -139,6 +139,7 @@ public abstract class PlayerList {
@ -145,12 +165,13 @@ index b48641bbe371ffacbbd659a0ee1783437267a4dc..0d86536696657ba6eee5f12d3d3afa8e
// Spigot start - spawn location event
Player spawnPlayer = player.getBukkitEntity();
@@ -264,6 +274,52 @@ public abstract class PlayerList {
@@ -264,6 +274,54 @@ public abstract class PlayerList {
player.getRecipeBook().sendInitialRecipeBook(player);
this.updateEntireScoreboard(worldserver1.getScoreboard(), player);
this.server.invalidateStatus();
+ // Paper start - async load spawn in chunk
+ ServerLevel finalWorldserver = worldserver1;
+ finalWorldserver.pendingLogin.add(player);
+ int chunkX = loc.getBlockX() >> 4;
+ int chunkZ = loc.getBlockZ() >> 4;
+ final net.minecraft.world.level.ChunkPos pos = new net.minecraft.world.level.ChunkPos(chunkX, chunkZ);
@ -171,6 +192,7 @@ index b48641bbe371ffacbbd659a0ee1783437267a4dc..0d86536696657ba6eee5f12d3d3afa8e
+ player, finalWorldserver, connection, playerconnection,
+ nbttagcompound, s1, lastKnownName
+ );
+ finalWorldserver.pendingLogin.remove(player);
+ };
+ });
+ }
@ -198,7 +220,7 @@ index b48641bbe371ffacbbd659a0ee1783437267a4dc..0d86536696657ba6eee5f12d3d3afa8e
MutableComponent ichatmutablecomponent;
if (player.getGameProfile().getName().equalsIgnoreCase(s)) {
@@ -505,6 +561,7 @@ public abstract class PlayerList {
@@ -505,6 +563,7 @@ public abstract class PlayerList {
protected void save(ServerPlayer player) {
if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit
@ -206,7 +228,7 @@ index b48641bbe371ffacbbd659a0ee1783437267a4dc..0d86536696657ba6eee5f12d3d3afa8e
this.playerIo.save(player);
ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit
@@ -532,7 +589,7 @@ public abstract class PlayerList {
@@ -532,7 +591,7 @@ public abstract class PlayerList {
}
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(entityplayer.getScoreboardName())));
@ -215,7 +237,7 @@ index b48641bbe371ffacbbd659a0ee1783437267a4dc..0d86536696657ba6eee5f12d3d3afa8e
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
if (server.isSameThread()) entityplayer.doTick(); // SPIGOT-924 // Paper - don't tick during emergency shutdowns (Watchdog)
@@ -577,6 +634,13 @@ public abstract class PlayerList {
@@ -577,6 +636,13 @@ public abstract class PlayerList {
// this.advancements.remove(uuid);
// CraftBukkit end
}
@ -229,7 +251,7 @@ index b48641bbe371ffacbbd659a0ee1783437267a4dc..0d86536696657ba6eee5f12d3d3afa8e
// CraftBukkit start
// this.broadcastAll(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, new EntityPlayer[]{entityplayer}));
@@ -594,7 +658,7 @@ public abstract class PlayerList {
@@ -594,7 +660,7 @@ public abstract class PlayerList {
this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity());
// CraftBukkit end
@ -238,7 +260,7 @@ index b48641bbe371ffacbbd659a0ee1783437267a4dc..0d86536696657ba6eee5f12d3d3afa8e
}
// CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer
@@ -613,6 +677,13 @@ public abstract class PlayerList {
@@ -613,6 +679,13 @@ public abstract class PlayerList {
list.add(entityplayer);
}
}
@ -252,3 +274,16 @@ index b48641bbe371ffacbbd659a0ee1783437267a4dc..0d86536696657ba6eee5f12d3d3afa8e
Iterator iterator = list.iterator();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 4016b31bd020e00c0e79328646f9b5411b312e88..c8c11ec3c5c4c4d1ed09163aa6d3a4275e497e11 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1219,7 +1219,7 @@ public final class CraftServer implements Server {
return false;
}
- if (handle.players().size() > 0) {
+ if (handle.players().size() > 0 || handle.pendingLogin.size() > 0) { // Paper
return false;
}

View File

@ -8,10 +8,10 @@ so inline where possible, and avoid the abstraction of the
Either class.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index e531c2ed2432b0184878cc3fcfe0bc91a551977c..c3db29bc1b24a976617068a4ddae062857d61097 100644
index a7db54a94a5017e737ce9682a52eed7405af8cc1..22a0ca38ae03b8064db7f77dd17335ed4abc72bc 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2251,19 +2251,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2253,19 +2253,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
private boolean isPositionTickingWithEntitiesLoaded(long chunkPos) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] incremental chunk and player saving
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index f2e6c5ed099a94be3aefca55cffd8e2447e39ac2..36e0a9771705f02e67dd507f2c0c9a030f77c02a 100644
index 7d2fee97f4d08eae245475c4b60c1a7ba46c840d..48650bc1c09b18f1b57d9828dfe27f51c74c4a75 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -854,7 +854,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -256,10 +256,10 @@ index 1d9a0f6effa1654609f4d0752ec69eed6ab7134b..585892f19bc0aea89889a358c0407f29
public void close() throws IOException {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c3db29bc1b24a976617068a4ddae062857d61097..c7221d169badfae6653d64cb39e1435372ea179a 100644
index 22a0ca38ae03b8064db7f77dd17335ed4abc72bc..92603bc69e7782f252b2ad7b8c8a4546c9b23e12 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1083,6 +1083,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1085,6 +1085,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos);
}
@ -310,10 +310,10 @@ index 28944fc50ea43a3ea40bd1e69c560c8fe022337e..0720b748ed42bbd2a12cc5de79224f60
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
public ServerGamePacketListenerImpl connection;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0d86536696657ba6eee5f12d3d3afa8e5a167060..20bedb5ce597b8e3e96af910d88137e0a0b10066 100644
index 9bfa4ff2eefa47e7468eeb4f912873b07ad17ac1..98ddbc2d9dd2e63e9bdbb2f454d565270200962e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -562,6 +562,7 @@ public abstract class PlayerList {
@@ -564,6 +564,7 @@ public abstract class PlayerList {
protected void save(ServerPlayer player) {
if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit
if (!player.didPlayerJoinEvent) return; // Paper - If we never fired PJE, we disconnected during login. Data has not changed, and additionally, our saved vehicle is not loaded! If we save now, we will lose our vehicle (CraftBukkit bug)
@ -321,7 +321,7 @@ index 0d86536696657ba6eee5f12d3d3afa8e5a167060..20bedb5ce597b8e3e96af910d88137e0
this.playerIo.save(player);
ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit
@@ -1164,10 +1165,22 @@ public abstract class PlayerList {
@@ -1166,10 +1167,22 @@ public abstract class PlayerList {
}
public void saveAll() {

View File

@ -1112,7 +1112,7 @@ index 8770fe0db46b01e8b608637df4f1a669a3f4cdde..3c1698ba0d3bc412ab957777d9b5211d
private final String name;
private final Comparator<T> comparator;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 559db90e1ba3d636ea080f47cdf274d11a1bcb89..de84400b0565843a7314a7c8032d14cdadccdb73 100644
index 9819bb3c36e314103236832a133906957255ee7a..3ca3275f7f66410217b86ba8ca09d85ef64f3f83 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -179,6 +179,7 @@ public abstract class PlayerList {
@ -1123,7 +1123,7 @@ index 559db90e1ba3d636ea080f47cdf274d11a1bcb89..de84400b0565843a7314a7c8032d14cd
ServerPlayer prev = pendingPlayers.put(player.getUUID(), player);// Paper
if (prev != null) {
disconnectPendingPlayer(prev);
@@ -293,8 +294,8 @@ public abstract class PlayerList {
@@ -294,8 +295,8 @@ public abstract class PlayerList {
net.minecraft.server.level.ChunkMap playerChunkMap = worldserver1.getChunkSource().chunkMap;
net.minecraft.server.level.DistanceManager distanceManager = playerChunkMap.distanceManager;
distanceManager.addTicket(net.minecraft.server.level.TicketType.LOGIN, pos, 31, pos.toLong());
@ -1194,7 +1194,7 @@ index b234ba968e82ddf1e8f7c84d3a17659e3beda2b3..af22fa8aa8ddef4d592564b14d0114cc
net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk) either.left().orElse(null);
if (chunk != null) addTicket(x, z); // Paper
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 71b96630dd6543d8a4d8df5165d7182fb0f35067..ac232efad56fd69577de8fa4ed47cb852c9a429e 100644
index 0fda8c27c717bd030b826c5c7267b880f9d1f6b9..8db930d54ad97435e367aa670466d8a072ca0b23 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1047,6 +1047,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -10,10 +10,10 @@ This fixes that by checking if the modified spawn location is
still at a respawn anchor.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index de84400b0565843a7314a7c8032d14cdadccdb73..8c1b6aa3957a988656eeb2ad6323fdbd2f67cd19 100644
index 3ca3275f7f66410217b86ba8ca09d85ef64f3f83..8f5dcd77b3a6ccce9b4ff8139e6b3a9700502ebf 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -836,6 +836,7 @@ public abstract class PlayerList {
@@ -838,6 +838,7 @@ public abstract class PlayerList {
// Paper start
boolean isBedSpawn = false;
boolean isRespawn = false;
@ -21,7 +21,7 @@ index de84400b0565843a7314a7c8032d14cdadccdb73..8c1b6aa3957a988656eeb2ad6323fdbd
// Paper end
// CraftBukkit start - fire PlayerRespawnEvent
@@ -846,7 +847,7 @@ public abstract class PlayerList {
@@ -848,7 +849,7 @@ public abstract class PlayerList {
Optional optional;
if (blockposition != null) {
@ -30,7 +30,7 @@ index de84400b0565843a7314a7c8032d14cdadccdb73..8c1b6aa3957a988656eeb2ad6323fdbd
} else {
optional = Optional.empty();
}
@@ -890,7 +891,12 @@ public abstract class PlayerList {
@@ -892,7 +893,12 @@ public abstract class PlayerList {
}
// Spigot End
@ -44,7 +44,7 @@ index de84400b0565843a7314a7c8032d14cdadccdb73..8c1b6aa3957a988656eeb2ad6323fdbd
if (!flag) entityplayer.reset(); // SPIGOT-4785
isRespawn = true; // Paper
} else {
@@ -928,8 +934,12 @@ public abstract class PlayerList {
@@ -930,8 +936,12 @@ public abstract class PlayerList {
}
// entityplayer1.initInventoryMenu();
entityplayer1.setHealth(entityplayer1.getHealth());

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c7221d169badfae6653d64cb39e1435372ea179a..f4ec0487051b0d61a79bef3067cb4fc19d64a544 100644
index 92603bc69e7782f252b2ad7b8c8a4546c9b23e12..0d51a518fa8b5d3ef5f6332c2b8f8796d62da658 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1851,6 +1851,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1853,6 +1853,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
//ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c()));
this.levelData.setSpawn(pos, angle);

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index f4ec0487051b0d61a79bef3067cb4fc19d64a544..f1506529687e47150a3134b3d5acac8021abe956 100644
index 0d51a518fa8b5d3ef5f6332c2b8f8796d62da658..d78b75d00ff95eb0c9619420c2921881724d8561 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1288,6 +1288,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1290,6 +1290,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false;
} else {

View File

@ -49,10 +49,10 @@ index a33334b45493c714b48439986b484256c03bdf8e..cf490d9f622e7300c36aa4776987e328
this.connection.disconnect(ichatbasecomponent);
}));
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 67c50a329e7bdf4056a1217963e29e8ceb99b20f..1979e8634829f949b7ed80b231b36d5a5e29c717 100644
index f41a8510e1bdfbc5b9c0a599fc17fadd74280be9..0259c8fe65e723a8d2dcde2971a10ca50fb685c1 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -601,7 +601,7 @@ public abstract class PlayerList {
@@ -603,7 +603,7 @@ public abstract class PlayerList {
entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expose world spawn angle
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 1979e8634829f949b7ed80b231b36d5a5e29c717..1b188bdf5597b81661ca1cc7acef1a9e93a54967 100644
index 0259c8fe65e723a8d2dcde2971a10ca50fb685c1..30b98d4ee39990b98e6c15b23a598eb472ebea45 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -879,7 +879,7 @@ public abstract class PlayerList {
@@ -881,7 +881,7 @@ public abstract class PlayerList {
if (location == null) {
worldserver1 = this.server.getLevel(Level.OVERWORLD);
blockposition = entityplayer1.getSpawnPoint(worldserver1);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Remove stale POIs
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index f1506529687e47150a3134b3d5acac8021abe956..bfabed84ef3bb61274ed60f54ae93b41eae8d228 100644
index d78b75d00ff95eb0c9619420c2921881724d8561..3016947fb05211ffa72eef027db92d02e2486150 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1916,6 +1916,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1918,6 +1918,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
});
optional1.ifPresent((holder) -> {
this.getServer().execute(() -> {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix villager boat exploit
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 1b188bdf5597b81661ca1cc7acef1a9e93a54967..fa90f805e87985fae1875ded3b295c4736cc7aee 100644
index 30b98d4ee39990b98e6c15b23a598eb472ebea45..6c561f3259074fa1320dd812fe9f514aea34d2b6 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -626,6 +626,14 @@ public abstract class PlayerList {
@@ -628,6 +628,14 @@ public abstract class PlayerList {
PlayerList.LOGGER.debug("Removing player mount");
entityplayer.stopRiding();
entity.getPassengersAndSelf().forEach((entity1) -> {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add sendOpLevel API
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index fa90f805e87985fae1875ded3b295c4736cc7aee..39ddb080e9a296fa499ea2959e22172500db6235 100644
index 6c561f3259074fa1320dd812fe9f514aea34d2b6..6cc4711123976cfbc2131732e78abf86c8e5b104 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1124,6 +1124,11 @@ public abstract class PlayerList {
@@ -1126,6 +1126,11 @@ public abstract class PlayerList {
}
private void sendPlayerPermissionLevel(ServerPlayer player, int permissionLevel) {
@ -20,7 +20,7 @@ index fa90f805e87985fae1875ded3b295c4736cc7aee..39ddb080e9a296fa499ea2959e221725
if (player.connection != null) {
byte b0;
@@ -1138,8 +1143,10 @@ public abstract class PlayerList {
@@ -1140,8 +1145,10 @@ public abstract class PlayerList {
player.connection.send(new ClientboundEntityEventPacket(player, b0));
}
@ -32,7 +32,7 @@ index fa90f805e87985fae1875ded3b295c4736cc7aee..39ddb080e9a296fa499ea2959e221725
public boolean isWhiteListed(GameProfile profile) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4c7d84a8f0f186dba18dba528ed324a0808605e3..8024b7bcc18a9b2298864d53230d54c23b9d1166 100644
index 99d6e2fcfb6605a712c48831a5b7bd22d123dee2..8608fbd5484498f0e478d857ea1dd548ad6a93e0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -606,6 +606,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] EntityMoveEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9484e447959a9c25ac6ef318be1569d236b5915d..75cd5667eb0f047cdec56b4131dcd1c4f22d4067 100644
index d60439d49de781b12af6fbe4ff89b7270f57cbeb..abd1935ebc12f963b563023eb5279ad16ed1d8df 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1495,6 +1495,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -17,10 +17,10 @@ index 9484e447959a9c25ac6ef318be1569d236b5915d..75cd5667eb0f047cdec56b4131dcd1c4
this.profiler.push(() -> {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index bfabed84ef3bb61274ed60f54ae93b41eae8d228..b4d3bff060874871e3aebba1ba3570c8418a52bd 100644
index 3016947fb05211ffa72eef027db92d02e2486150..675c8f6d856c6fa333887fd4079504713f3e861e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -216,6 +216,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -217,6 +217,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper

View File

@ -5,10 +5,10 @@ Subject: [PATCH] added option to disable pathfinding updates on block changes
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index b4d3bff060874871e3aebba1ba3570c8418a52bd..3bb1fe9e6f5e8f7dc6dc07f83c5b0793760882e8 100644
index 675c8f6d856c6fa333887fd4079504713f3e861e..221612cddc9dd839c96d03325ee243721f7f5a9c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1490,6 +1490,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1492,6 +1492,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
this.getChunkSource().blockChanged(pos);
@ -16,7 +16,7 @@ index b4d3bff060874871e3aebba1ba3570c8418a52bd..3bb1fe9e6f5e8f7dc6dc07f83c5b0793
VoxelShape voxelshape = oldState.getCollisionShape(this, pos);
VoxelShape voxelshape1 = newState.getCollisionShape(this, pos);
@@ -1531,6 +1532,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1533,6 +1534,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}

View File

@ -7,10 +7,10 @@ Fixes disappearance of held items, when a player gets disconnected and PlayerDro
Closes #5036
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index f7f0d7556d130197b8cb75841f1e326274eb59cd..304fb7b7255379d1be31ccf86ce04c377ef1d247 100644
index e11595885bd48036b141d1d449281dceadae5598..c4d83bd96b060342c5a03a684e5eb3403ab708a8 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -619,6 +619,14 @@ public abstract class PlayerList {
@@ -621,6 +621,14 @@ public abstract class PlayerList {
}
// Paper end

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Fix anchor respawn acting as a bed respawn from the end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 304fb7b7255379d1be31ccf86ce04c377ef1d247..10b615ad0a038c7237f4664431996774b4e55e2f 100644
index c4d83bd96b060342c5a03a684e5eb3403ab708a8..b927d5b60e2571f4a7a56237d0da46e5162d6588 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -852,6 +852,7 @@ public abstract class PlayerList {
@@ -854,6 +854,7 @@ public abstract class PlayerList {
// Paper start
boolean isBedSpawn = false;
@ -17,7 +17,7 @@ index 304fb7b7255379d1be31ccf86ce04c377ef1d247..10b615ad0a038c7237f4664431996774
boolean isRespawn = false;
boolean isLocAltered = false; // Paper - Fix SPIGOT-5989
// Paper end
@@ -872,6 +873,7 @@ public abstract class PlayerList {
@@ -874,6 +875,7 @@ public abstract class PlayerList {
if (optional.isPresent()) {
BlockState iblockdata = worldserver1.getBlockState(blockposition);
boolean flag3 = iblockdata.is(Blocks.RESPAWN_ANCHOR);
@ -25,7 +25,7 @@ index 304fb7b7255379d1be31ccf86ce04c377ef1d247..10b615ad0a038c7237f4664431996774
Vec3 vec3d = (Vec3) optional.get();
float f1;
@@ -900,7 +902,7 @@ public abstract class PlayerList {
@@ -902,7 +904,7 @@ public abstract class PlayerList {
}
Player respawnPlayer = entityplayer1.getBukkitEntity();

View File

@ -18,10 +18,10 @@ index 2723bb42f3618fa57f3996b7880484d88afb552d..8dc4eac46bb7f127cb23d3994308d6ce
} else {
if (this.player.getHealth() > 0.0F) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 10b615ad0a038c7237f4664431996774b4e55e2f..63f92d68b91f1049802a1541c7ec4efaa324ac11 100644
index b927d5b60e2571f4a7a56237d0da46e5162d6588..cffc11789ac3db3b5b674feac47785d693ae064a 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -811,6 +811,12 @@ public abstract class PlayerList {
@@ -813,6 +813,12 @@ public abstract class PlayerList {
}
public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation) {
@ -34,7 +34,7 @@ index 10b615ad0a038c7237f4664431996774b4e55e2f..63f92d68b91f1049802a1541c7ec4efa
entityplayer.stopRiding(); // CraftBukkit
this.players.remove(entityplayer);
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
@@ -902,7 +908,7 @@ public abstract class PlayerList {
@@ -904,7 +910,7 @@ public abstract class PlayerList {
}
Player respawnPlayer = entityplayer1.getBukkitEntity();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 3bb1fe9e6f5e8f7dc6dc07f83c5b0793760882e8..428272c1cace3a87fbcade90b5f9ee9236532418 100644
index 221612cddc9dd839c96d03325ee243721f7f5a9c..cfdf7d844390310f792cee93d6a149aa65bb7055 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -494,8 +494,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -496,8 +496,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setClearWeatherTime(clearDuration);
this.serverLevelData.setRainTime(rainDuration);
this.serverLevelData.setThunderTime(rainDuration);
@ -19,7 +19,7 @@ index 3bb1fe9e6f5e8f7dc6dc07f83c5b0793760882e8..428272c1cace3a87fbcade90b5f9ee92
}
@Override
@@ -887,8 +887,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -889,8 +889,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setThunderTime(j);
this.serverLevelData.setRainTime(k);
this.serverLevelData.setClearWeatherTime(i);
@ -30,7 +30,7 @@ index 3bb1fe9e6f5e8f7dc6dc07f83c5b0793760882e8..428272c1cace3a87fbcade90b5f9ee92
}
this.oThunderLevel = this.thunderLevel;
@@ -954,14 +954,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -956,14 +956,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
private void resetWeatherCycle() {
// CraftBukkit start

View File

@ -367,10 +367,10 @@ index 2da9dd2b5cc0f9e74976e4c927ebf3130aaa1b26..32262185c3997c17f1b5b1847f768789
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 63f92d68b91f1049802a1541c7ec4efaa324ac11..c332750833cccee1264a3399ed0539f6fee6af44 100644
index cffc11789ac3db3b5b674feac47785d693ae064a..dfc7eb831bc97535385f2471187e0c0a088aa023 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -720,7 +720,7 @@ public abstract class PlayerList {
@@ -722,7 +722,7 @@ public abstract class PlayerList {
while (iterator.hasNext()) {
entityplayer = (ServerPlayer) iterator.next();
this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved
@ -379,7 +379,7 @@ index 63f92d68b91f1049802a1541c7ec4efaa324ac11..c332750833cccee1264a3399ed0539f6
}
// Instead of kicking then returning, we need to store the kick reason
@@ -1351,8 +1351,8 @@ public abstract class PlayerList {
@@ -1353,8 +1353,8 @@ public abstract class PlayerList {
// Paper end
// CraftBukkit start - disconnect safely
for (ServerPlayer player : this.players) {

View File

@ -8,10 +8,10 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk
load in that case).
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 428272c1cace3a87fbcade90b5f9ee9236532418..4bebe9bc9dea53d57543e65d7300f50b0f907017 100644
index cfdf7d844390310f792cee93d6a149aa65bb7055..388958c9cdd366f8a5cdf7653abdcc6cdf5433ce 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -222,7 +222,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -223,7 +223,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
@ -20,7 +20,7 @@ index 428272c1cace3a87fbcade90b5f9ee9236532418..4bebe9bc9dea53d57543e65d7300f50b
}
@Override
@@ -1437,7 +1437,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1439,7 +1439,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
for (int l1 = j; l1 <= i1; ++l1) {
for (int i2 = l; i2 <= k1; ++i2) {

View File

@ -59,10 +59,10 @@ index 93dc44365bb3140a4b6989f1d520091c4b35e76e..e1b3045d4fa6f69e9d70279980ab7ef4
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false);
// Paper end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index c332750833cccee1264a3399ed0539f6fee6af44..0e20ebf895e7ebe4201a8596519929ea65f653af 100644
index dfc7eb831bc97535385f2471187e0c0a088aa023..0e70a431219c8c0a13cb3c9059d8a77ee2f1ca55 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -592,6 +592,11 @@ public abstract class PlayerList {
@@ -594,6 +594,11 @@ public abstract class PlayerList {
}
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // Paper - return Component
@ -74,7 +74,7 @@ index c332750833cccee1264a3399ed0539f6fee6af44..0e20ebf895e7ebe4201a8596519929ea
ServerLevel worldserver = entityplayer.getLevel();
entityplayer.awardStat(Stats.LEAVE_GAME);
@@ -602,7 +607,7 @@ public abstract class PlayerList {
@@ -604,7 +609,7 @@ public abstract class PlayerList {
entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper
}

View File

@ -89,10 +89,10 @@ index 56ac440465813a7dab8d166e882e18143a50729f..80e1970f568a74a43e624188a77cfbd2
public void trackChunk(ChunkPos chunkPos, Packet<?> chunkDataPacket) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0e20ebf895e7ebe4201a8596519929ea65f653af..03c413dfd16f415377749baa4fdd41949c6a12b9 100644
index 0e70a431219c8c0a13cb3c9059d8a77ee2f1ca55..18772fd8a4b90ef39f208ed45355e5c3ccf06657 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -896,13 +896,13 @@ public abstract class PlayerList {
@@ -898,13 +898,13 @@ public abstract class PlayerList {
f1 = (float) Mth.wrapDegrees(Mth.atan2(vec3d1.z, vec3d1.x) * 57.2957763671875D - 90.0D);
}
@ -129,7 +129,7 @@ index c3e49a781f838e6a46cb89744f3f1846de182275..c2f3d3a09327e7cb7d3167609eb3ce68
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index bf5931cbcfbfdc6e68706b7e86b24b2478e4bbef..55f4a09bc27c30936e29fa2a2fe2ef0a67b8876d 100644
index 4750ac09f2abfb712b042028a95d23121ffc049f..d309c994ffd72952cf9a8f2f4cc21231417bb9ed 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1216,9 +1216,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add methods to find targets for lightning strikes
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 4bebe9bc9dea53d57543e65d7300f50b0f907017..8c95d537c7bf5cc9b63f0e412c9ad67f5e6fe51e 100644
index 388958c9cdd366f8a5cdf7653abdcc6cdf5433ce..290f7253e78bfd3acdffd2ca6368d80c8620eba5 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -776,6 +776,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -778,6 +778,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
protected BlockPos findLightningTargetAround(BlockPos pos) {
@ -20,7 +20,7 @@ index 4bebe9bc9dea53d57543e65d7300f50b0f907017..8c95d537c7bf5cc9b63f0e412c9ad67f
BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos);
Optional<BlockPos> optional = this.findLightningRod(blockposition1);
@@ -790,6 +795,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -792,6 +797,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (!list.isEmpty()) {
return ((LivingEntity) list.get(this.random.nextInt(list.size()))).blockPosition();
} else {

View File

@ -9,10 +9,10 @@ chunk through it. This should also be OK from a leak prevention/
state desync POV because the TE is getting unloaded anyways.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 8c95d537c7bf5cc9b63f0e412c9ad67f5e6fe51e..2634eba0537648c0e013455e813e25897ea71ff0 100644
index 290f7253e78bfd3acdffd2ca6368d80c8620eba5..8234f7edb7668c9e9e742d703a3db315aa523fb4 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1334,9 +1334,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1336,9 +1336,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start
for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) {
if (tileentity instanceof net.minecraft.world.Container) {

View File

@ -914,10 +914,10 @@ index 0000000000000000000000000000000000000000..3ba094e640d7fe7803e2bbdab8ff3beb
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 2634eba0537648c0e013455e813e25897ea71ff0..306e40f7fa6435cfb3c2da7382daf71a51b58e18 100644
index 8234f7edb7668c9e9e742d703a3db315aa523fb4..f3aa1276f0689996ce7827c9300c141dd95582cc 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -450,7 +450,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -452,7 +452,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
DataFixer datafixer = minecraftserver.getFixerUpper();
EntityPersistentStorage<Entity> entitypersistentstorage = new EntityStorage(this, convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), datafixer, flag2, minecraftserver);

View File

@ -126,10 +126,10 @@ index 438406936633b9c67d21b26527c3d1654118c744..2de322ffc2eedae9efe39f9b771c447d
}
// Paper start - optimise chunk tick iteration
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 0753b792f3cfc1d0b53b767be4c5f728f467dca0..8a1efe19d7b0c31a306bea28b9cbab112702895a 100644
index f3aa1276f0689996ce7827c9300c141dd95582cc..6eca2940cedc5c4fd73906cc4f5657c78d646a10 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -211,6 +211,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -212,6 +212,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
private final StructureManager structureManager;
private final StructureCheck structureCheck;
private final boolean tickTime;
@ -137,7 +137,7 @@ index 0753b792f3cfc1d0b53b767be4c5f728f467dca0..8a1efe19d7b0c31a306bea28b9cbab11
// CraftBukkit start
public final LevelStorageSource.LevelStorageAccess convertable;
@@ -987,6 +988,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -989,6 +990,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (fluid1.is(fluid)) {
fluid1.tick(this, pos);
}
@ -145,7 +145,7 @@ index 0753b792f3cfc1d0b53b767be4c5f728f467dca0..8a1efe19d7b0c31a306bea28b9cbab11
}
@@ -996,6 +998,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -998,6 +1000,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (iblockdata.is(block)) {
iblockdata.tick(this, pos, this.random);
}

View File

@ -78,10 +78,10 @@ index acfa1907bfc9c29d261cfccc00d65bad9ad1a002..d6f3869f5725c7f081efb7f486f74dbb
});
throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 53105ca96f5056adbba6a97ac428587e7c3b683a..a9b23308c89aef277394821cb883540a0c9e7056 100644
index 6eca2940cedc5c4fd73906cc4f5657c78d646a10..673da1feb2960a6d247265237eae480d34f58056 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1002,7 +1002,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1004,7 +1004,26 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
@ -108,7 +108,7 @@ index 53105ca96f5056adbba6a97ac428587e7c3b683a..a9b23308c89aef277394821cb883540a
++TimingHistory.entityTicks; // Paper - timings
// Spigot start
co.aikar.timings.Timing timer; // Paper
@@ -1042,7 +1061,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1044,7 +1063,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(entity, entity1);
}
// } finally { timer.stopTiming(); } // Paper - timings - move up

View File

@ -90,10 +90,10 @@ index 0000000000000000000000000000000000000000..7d93652c1abbb6aee6eb7c26cf35d4d0
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index a9b23308c89aef277394821cb883540a0c9e7056..b779656482325416ef37d6909b01a136e7f97656 100644
index 673da1feb2960a6d247265237eae480d34f58056..82e6a535ff86df7c5fa076d64f09aba4a9231fe6 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -666,6 +666,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -668,6 +668,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
entityplayer.stopSleepInBed(false, false);
});
}
@ -104,7 +104,7 @@ index a9b23308c89aef277394821cb883540a0c9e7056..b779656482325416ef37d6909b01a136
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
ChunkPos chunkcoordintpair = chunk.getPos();
@@ -675,10 +679,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -677,10 +681,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
ProfilerFiller gameprofilerfiller = this.getProfiler();
gameprofilerfiller.push("thunder");
@ -117,7 +117,7 @@ index a9b23308c89aef277394821cb883540a0c9e7056..b779656482325416ef37d6909b01a136
if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper
@@ -702,64 +706,75 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -704,64 +708,75 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.popPush("iceandsnow");
if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow

View File

@ -105,13 +105,13 @@ index 5507f6982bfc02f648a7aa4e4860378fc442cf34..97ec72dc383a2637c60cfc988bca2a8a
protected ChunkGenerator generator() {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index b779656482325416ef37d6909b01a136e7f97656..091e678a736f291b546ce1e684d4e03055734e02 100644
index 82e6a535ff86df7c5fa076d64f09aba4a9231fe6..b0c95b0af6d24b9566b82b2df54eae5108b9b48b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -406,6 +406,83 @@ public class ServerLevel extends Level implements WorldGenLevel {
return this.getServer().getPlayerList().getPlayer(uuid);
}
@@ -409,6 +409,84 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Paper end
public final ReferenceOpenHashSet<ServerPlayer> pendingLogin = new ReferenceOpenHashSet<>(); // Paper
+ // Paper start - optimise checkDespawn
+ public final List<ServerPlayer> playersAffectingSpawning = new java.util.ArrayList<>();
+ // Paper end - optimise checkDespawn
@ -189,10 +189,11 @@ index b779656482325416ef37d6909b01a136e7f97656..091e678a736f291b546ce1e684d4e030
+ return ret;
+ }
+ // Paper end - optimise get nearest players for entity AI
+
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
@@ -509,6 +586,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Holder holder = worlddimension.typeHolder(); // CraftBukkit - decompile error
@@ -511,6 +589,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public void tick(BooleanSupplier shouldKeepTicking) {

View File

@ -110,10 +110,10 @@ index 97ec72dc383a2637c60cfc988bca2a8a86954ffb..236ba4c1950a3cced590f520b5349eed
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 091e678a736f291b546ce1e684d4e03055734e02..1d0273a9ec5afc9287b9153a3746299a2ec9adfa 100644
index b0c95b0af6d24b9566b82b2df54eae5108b9b48b..bd64c6d0930565785deb999f43cfaa4eaea53195 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1117,6 +1117,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1120,6 +1120,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void tickNonPassenger(Entity entity) {
// Paper start - log detailed entity tick information
io.papermc.paper.util.TickThread.ensureTickThread("Cannot tick an entity off-main");
@ -121,7 +121,7 @@ index 091e678a736f291b546ce1e684d4e03055734e02..1d0273a9ec5afc9287b9153a3746299a
try {
if (currentlyTickingEntity.get() == null) {
currentlyTickingEntity.lazySet(entity);
@@ -1634,9 +1635,18 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1637,9 +1638,18 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (Shapes.joinIsNotEmpty(voxelshape, voxelshape1, BooleanOp.NOT_SAME)) {
List<PathNavigation> list = new ObjectArrayList();
@ -142,7 +142,7 @@ index 091e678a736f291b546ce1e684d4e03055734e02..1d0273a9ec5afc9287b9153a3746299a
// CraftBukkit start - fix SPIGOT-6362
Mob entityinsentient;
try {
@@ -1658,16 +1668,23 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1661,16 +1671,23 @@ public class ServerLevel extends Level implements WorldGenLevel {
try {
this.isUpdatingNavigations = true;
@ -169,7 +169,7 @@ index 091e678a736f291b546ce1e684d4e03055734e02..1d0273a9ec5afc9287b9153a3746299a
}
} // Paper
@@ -2465,10 +2482,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2468,10 +2485,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void onTickingStart(Entity entity) {
ServerLevel.this.entityTickList.add(entity);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix merchant inventory not closing on entity removal
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 1d0273a9ec5afc9287b9153a3746299a2ec9adfa..856ef0c487af8e8c5689d58decc9acf8d52971c9 100644
index bd64c6d0930565785deb999f43cfaa4eaea53195..502a11fbef542891358589f00cf4a267dca9bc9a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2573,6 +2573,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2576,6 +2576,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot end
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message

View File

@ -1202,10 +1202,10 @@ index 97de35c614e1e9b0e825f9914173a3e1e0e53221..b35b36527294dd697d146d2ad817d791
}
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index d3c6c1b9ac00df265507db61301cae397214dca7..8f89c694e08db71a8e1509a102ad96defe788828 100644
index eea9ff2418324de3d5158cce8fbe1257e2fa4e4f..bbaabf47ff303353660042609c045f2e5f4391fb 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -937,7 +937,7 @@ public abstract class PlayerList {
@@ -939,7 +939,7 @@ public abstract class PlayerList {
// CraftBukkit end
worldserver1.getChunkSource().addRegionTicket(net.minecraft.server.level.TicketType.POST_TELEPORT, new net.minecraft.world.level.ChunkPos(location.getBlockX() >> 4, location.getBlockZ() >> 4), 1, entityplayer.getId()); // Paper

View File

@ -56,10 +56,10 @@ index acd581d14e0ef1fe5a6545ee67be00deff589879..553eb8e437b07376dbfc54b0018bcc3f
GameProfile gameprofile = this.server.getSingleplayerProfile();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 8f89c694e08db71a8e1509a102ad96defe788828..dd06ed2a72df27a6f2bd4014ec9055729e7f2773 100644
index bbaabf47ff303353660042609c045f2e5f4391fb..774b6058553683e0e13989212b4ff8cd46239d2b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -708,7 +708,7 @@ public abstract class PlayerList {
@@ -710,7 +710,7 @@ public abstract class PlayerList {
for (int i = 0; i < this.players.size(); ++i) {
entityplayer = (ServerPlayer) this.players.get(i);

View File

@ -1855,10 +1855,10 @@ index 96a232f22b1c270b91635ce9c7c6cacc63b026cc..59acbf6249f8f5285504c0ddea448a34
return true;
} else {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 856ef0c487af8e8c5689d58decc9acf8d52971c9..836841987ff5dd4901f75f47028a60d8d1b6e04a 100644
index 502a11fbef542891358589f00cf4a267dca9bc9a..9dc4a1d9082a0cb3ab6848698c3fc41a5f57e380 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -677,7 +677,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -680,7 +680,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.push("checkDespawn");
entity.checkDespawn();
gameprofilerfiller.pop();
@ -1867,7 +1867,7 @@ index 856ef0c487af8e8c5689d58decc9acf8d52971c9..836841987ff5dd4901f75f47028a60d8
Entity entity1 = entity.getVehicle();
if (entity1 != null) {
@@ -710,7 +710,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -713,7 +713,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public boolean shouldTickBlocksAt(long chunkPos) {
@ -1879,7 +1879,7 @@ index 856ef0c487af8e8c5689d58decc9acf8d52971c9..836841987ff5dd4901f75f47028a60d8
}
protected void tickTime() {
@@ -2454,7 +2457,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2457,7 +2460,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
private boolean isPositionTickingWithEntitiesLoaded(long chunkPos) {
// Paper start - optimize is ticking ready type functions
ChunkHolder chunkHolder = this.chunkSource.chunkMap.getVisibleChunkIfPresent(chunkPos);
@ -1900,7 +1900,7 @@ index b35b36527294dd697d146d2ad817d7911145ae8c..18c3d4aecf498f78040c27336d2ea56f
+ public final int getViewDistance() { throw new UnsupportedOperationException("Use PlayerChunkLoader"); } // Paper - placeholder
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index dd06ed2a72df27a6f2bd4014ec9055729e7f2773..a01858ee7a4419fb5b85df8863ab0052180079e3 100644
index 774b6058553683e0e13989212b4ff8cd46239d2b..5783f5000b02a2af708ceb3dc11cd1e697c5e9d4 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -274,7 +274,7 @@ public abstract class PlayerList {
@ -1912,7 +1912,7 @@ index dd06ed2a72df27a6f2bd4014ec9055729e7f2773..a01858ee7a4419fb5b85df8863ab0052
player.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
playerconnection.send(new ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.BRAND, (new FriendlyByteBuf(Unpooled.buffer())).writeUtf(this.getServer().getServerModName())));
playerconnection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
@@ -943,8 +943,8 @@ public abstract class PlayerList {
@@ -945,8 +945,8 @@ public abstract class PlayerList {
// CraftBukkit start
LevelData worlddata = worldserver1.getLevelData();
entityplayer1.connection.send(new ClientboundRespawnPacket(worldserver1.dimensionTypeId(), worldserver1.dimension(), BiomeManager.obfuscateSeed(worldserver1.getSeed()), entityplayer1.gameMode.getGameModeForPlayer(), entityplayer1.gameMode.getPreviousGameModeForPlayer(), worldserver1.isDebug(), worldserver1.isFlat(), flag, entityplayer1.getLastDeathLocation()));
@ -1923,7 +1923,7 @@ index dd06ed2a72df27a6f2bd4014ec9055729e7f2773..a01858ee7a4419fb5b85df8863ab0052
entityplayer1.spawnIn(worldserver1);
entityplayer1.unsetRemoved();
entityplayer1.connection.teleport(new Location(worldserver1.getWorld(), entityplayer1.getX(), entityplayer1.getY(), entityplayer1.getZ(), entityplayer1.getYRot(), entityplayer1.getXRot()));
@@ -1513,7 +1513,7 @@ public abstract class PlayerList {
@@ -1515,7 +1515,7 @@ public abstract class PlayerList {
public void setViewDistance(int viewDistance) {
this.viewDistance = viewDistance;
@ -1932,7 +1932,7 @@ index dd06ed2a72df27a6f2bd4014ec9055729e7f2773..a01858ee7a4419fb5b85df8863ab0052
Iterator iterator = this.server.getAllLevels().iterator();
while (iterator.hasNext()) {
@@ -1528,7 +1528,7 @@ public abstract class PlayerList {
@@ -1530,7 +1530,7 @@ public abstract class PlayerList {
public void setSimulationDistance(int simulationDistance) {
this.simulationDistance = simulationDistance;
@ -2148,7 +2148,7 @@ index 1bbc73dcdf890a9383795ffeb0d368293f7146a5..c4f7aa9ffb72d2bc555ace64bb8cedc5
// Paper end - view distance api
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c569bf167addfedcb0d8c55b2d2cfcb52e05d0a6..2cf84abadc7fd7806566948d4c6e2212bdf2aeb7 100644
index dc5ef870e23ba9497fcb9c2961334d928213f4c2..77339926519057b1c878761780ff2d6621f5ccb7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -541,45 +541,80 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -10,10 +10,10 @@ so we do not need that. The client only needs the chunk it is currently in to
be loaded to close the loading screen, so we just send an empty one.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index a01858ee7a4419fb5b85df8863ab0052180079e3..e1a5bd0ce00926078a0d2235b05e5972093044ab 100644
index 5783f5000b02a2af708ceb3dc11cd1e697c5e9d4..569c67206ad97d198311f780e7469016366e34b5 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -423,6 +423,16 @@ public abstract class PlayerList {
@@ -425,6 +425,16 @@ public abstract class PlayerList {
// Paper start - move vehicle into method so it can be called above - short circuit around that code
onPlayerJoinFinish(player, worldserver1, s1);

View File

@ -12,7 +12,7 @@ Subject: [PATCH] Fix save problems on shutdown
processed so that the main process queue can be drained
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index dca520534feac302b8e0f389ee9286bd719e31a6..33cf037bf8ed5ea88f52ee3731cde63c70e813ef 100644
index df08b7afcf19ce694a87c25e8589c0c72521c5db..4d920031300a9801debc2eb39a4d3cb9d8fbb330 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -957,6 +957,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -55,10 +55,10 @@ index dca520534feac302b8e0f389ee9286bd719e31a6..33cf037bf8ed5ea88f52ee3731cde63c
if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken
return this.forceTicks || this.runningTask() || Util.getMillis() < (this.mayHaveDelayedTasks ? this.delayedTasksMaxNextTickTime : this.nextTickTime);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 836841987ff5dd4901f75f47028a60d8d1b6e04a..802b929a16b6a8aeee608caeb524e268f8df53bd 100644
index 9dc4a1d9082a0cb3ab6848698c3fc41a5f57e380..95c2f8d70eff220dd53a6779e105a9bb67e47b6a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1279,7 +1279,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1282,7 +1282,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Use username instead of display name in
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index e1a5bd0ce00926078a0d2235b05e5972093044ab..71623c84a5b15023189c14a6bf36e1b08f935fc1 100644
index 569c67206ad97d198311f780e7469016366e34b5..8326775a4005b03468fba1ec556f951dc740c302 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1477,7 +1477,7 @@ public abstract class PlayerList {
@@ -1479,7 +1479,7 @@ public abstract class PlayerList {
// CraftBukkit start
public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) {
ServerStatsCounter serverstatisticmanager = entityhuman.getStats();

View File

@ -22,10 +22,10 @@ index 68f99e93ed3e843b4001a7a27620f88a48b85e67..0dc96c39151ec4dbeec3947cb17606f5
}
});
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 802b929a16b6a8aeee608caeb524e268f8df53bd..5b3a7626579ff6bcf3ad32f7193bf905aa1b70bc 100644
index 95c2f8d70eff220dd53a6779e105a9bb67e47b6a..43df2ed0f464a0e7be188b7efea723215dbaf527 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2490,6 +2490,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2493,6 +2493,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public void onTickingStart(Entity entity) {

View File

@ -2008,10 +2008,10 @@ index 0000000000000000000000000000000000000000..33cd90c30c22200a4e1ae64f40a0bf78
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5b3a7626579ff6bcf3ad32f7193bf905aa1b70bc..c09cdc4b717bcd7b3096a068d6abc90efc486529 100644
index 43df2ed0f464a0e7be188b7efea723215dbaf527..43aa4eee00502d1f05acc5f7e4e92db98063accd 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -218,6 +218,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -219,6 +219,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper
public boolean hasEntityMoveEvent = false; // Paper
@ -2019,7 +2019,7 @@ index 5b3a7626579ff6bcf3ad32f7193bf905aa1b70bc..c09cdc4b717bcd7b3096a068d6abc90e
public static Throwable getAddToWorldStackTrace(Entity entity) {
return new Throwable(entity + " Added to world at " + new java.util.Date());
}
@@ -2479,6 +2480,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2482,6 +2483,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
return this.entityManager.canPositionTick(pos.toLong()); // Paper
}

View File

@ -7,10 +7,10 @@ The previous solution caused a bunch of bandaid fixes inorder to resolve edge ca
Just simply prevent them from being added to the world instead.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c09cdc4b717bcd7b3096a068d6abc90efc486529..083349794d5ceb50322c5a645dd33fbfcc1c8155 100644
index 43aa4eee00502d1f05acc5f7e4e92db98063accd..3d986805c89d22330d6ad1e09760940b2f399214 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1434,6 +1434,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1437,6 +1437,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false;
} else {