1.20: Fix a bunch of compile issues (#9273)

This commit is contained in:
Noah van der Aa 2023-06-08 01:21:20 +02:00 committed by GitHub
parent f0889559f3
commit b1a2378144
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 588 additions and 655 deletions

View file

@ -7,7 +7,7 @@ Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 3ab66eb22561971392616c083bae5339e6ddc493..f27e9dd8185892b3948814937380140c45d7fd33 100644
index 3ab66eb22561971392616c083bae5339e6ddc493..b9ba0504590f754366ce9302ae6a267e0a2e84e2 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1565,6 +1565,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -15,7 +15,7 @@ index 3ab66eb22561971392616c083bae5339e6ddc493..f27e9dd8185892b3948814937380140c
public void addEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
+ // Paper start - ignore and warn about illegal addEntity calls instead of crashing server
+ if (!entity.valid || entity.level != this.level || this.entityMap.containsKey(entity.getId())) {
+ if (!entity.valid || entity.level() != this.level || this.entityMap.containsKey(entity.getId())) {
+ LOGGER.error("Illegal ChunkMap::addEntity for world " + this.level.getWorld().getName()
+ + ": " + entity + (this.entityMap.containsKey(entity.getId()) ? " ALREADY CONTAINED (This would have crashed your server)" : ""), new Throwable());
+ return;