diff --git a/patches/server/0025-Entity-Origin-API.patch b/patches/server/0025-Entity-Origin-API.patch index 0a7694168a..13e04d7f3a 100644 --- a/patches/server/0025-Entity-Origin-API.patch +++ b/patches/server/0025-Entity-Origin-API.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 5c5cfc31ced6695af7b1dd06cb867274fa38d85f..d5a12238317f1c85b9ad8cb63b936e501a4326ba 100644 +index 5c5cfc31ced6695af7b1dd06cb867274fa38d85f..a127467fdd25b7513c727e1a0634f85087ec542e 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1110,6 +1110,11 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl - entityplayer.connection.send(new ClientboundBlockDestructionPacket(entityId, pos, progress)); - } +@@ -1894,6 +1894,11 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl } + + entity.valid = true; // CraftBukkit + // Paper start - Set origin location when the entity is being added to the world + if (entity.getOriginVector() == null) { + entity.setOrigin(entity.getBukkitEntity().getLocation()); @@ -19,7 +19,7 @@ index 5c5cfc31ced6695af7b1dd06cb867274fa38d85f..d5a12238317f1c85b9ad8cb63b936e50 + // Paper end } - } + public void onTrackingEnd(Entity entity) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java index 018792503e5d18470ad17b9f4b4524d5dfba31e9..5d4d5628e5c0d82301f988691eac363758af6a4b 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/patches/server/0071-Entity-AddTo-RemoveFrom-World-Events.patch b/patches/server/0071-Entity-AddTo-RemoveFrom-World-Events.patch index f40531fa06..39ebc6b133 100644 --- a/patches/server/0071-Entity-AddTo-RemoveFrom-World-Events.patch +++ b/patches/server/0071-Entity-AddTo-RemoveFrom-World-Events.patch @@ -5,17 +5,17 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index dd7ad5ec09d88722b683acd5921ad3711cececcf..f69b1edf90ee7e368927293d0b039025222d5d40 100644 +index d0e92ed344cb5f7b673b4a1c777828dae1393fb8..e847abaac06d22337f2764021ab32feea4894332 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1116,6 +1116,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl +@@ -1900,6 +1900,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl entity.setOrigin(entity.getBukkitEntity().getLocation()); } // Paper end + new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid } - } + public void onTrackingEnd(Entity entity) { @@ -1964,6 +1965,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl } diff --git a/patches/server/0198-Expand-World.spawnParticle-API-and-add-Builder.patch b/patches/server/0198-Expand-World.spawnParticle-API-and-add-Builder.patch index 41046d1bae..041a895296 100644 --- a/patches/server/0198-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/patches/server/0198-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -10,10 +10,10 @@ Adds an option to control the force mode of the particle. This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 960471d86a599ca20aaede2e0ae07f7428b7ec4f..894e828280d6ccc175cffd8813602b3406c8e95a 100644 +index 766edb072a38a4b5613e0f26f5070d3fcab835f4..c98c7dabc2274fe758cafb334ec4c4d3952b85e7 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1287,12 +1287,17 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl +@@ -1281,12 +1281,17 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl } public int sendParticles(ServerPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { diff --git a/patches/server/0239-Add-hand-to-bucket-events.patch b/patches/server/0239-Add-hand-to-bucket-events.patch index 6c2a14e077..5dfb7deb05 100644 --- a/patches/server/0239-Add-hand-to-bucket-events.patch +++ b/patches/server/0239-Add-hand-to-bucket-events.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add hand to bucket events diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 0f45f6022a4dc9638032278cce0f8d6fc431bd56..4df153a3b2cc4b6be499107a997a054abe3569d8 100644 +index d1c1cf5061f9294d67086b5361166e940536a8a0..e9b1d967f5e97ec9a85465e8cfbcac98020d5ecc 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1419,15 +1419,17 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl +@@ -1413,15 +1413,17 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl this.getServer().getPlayerList().broadcastAll(new ClientboundSetDefaultSpawnPositionPacket(pos, angle)); } @@ -117,7 +117,7 @@ index 24272b384b96bb98a8231fe8583f404ad0c96de5..7c3e94c6bf8337ef660473d8ed451606 int i = blockposition.getX(); int j = blockposition.getY(); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index f820232e037fa05f7d666fddac6ad1b8b18b04e0..f354fe35c7fb4b869c9229b14a2cb6b00c7f0973 100644 +index a74895271378571583e33c8d3992f2eb863b5a40..c9e6dd18193c7dc2ae76f688e6bbf9463a1149c7 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -291,6 +291,17 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/0330-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/patches/server/0330-Configurable-Keep-Spawn-Loaded-range-per-world.patch index b52c3e5ae7..bee5a7ac6b 100644 --- a/patches/server/0330-Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/patches/server/0330-Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -23,7 +23,7 @@ index 13e730b18c346934c061fb570048623ad66e7344..090958a30ce20ff01ae77d4cd821a167 config.addDefault("world-settings.default." + path, def); return config.getBoolean("world-settings." + worldName + "." + path, config.getBoolean("world-settings.default." + path)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f24ce5a2543513650a3efb73e2bb5f8cd992ef88..29c1b3a43dd369419e8c93b571679a2ba024e4f6 100644 +index 15928916ec8001ec57068b945300517d60dec0b0..49c87dfc50033b22f67f45ad1d67003864ce5ecb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -775,35 +775,36 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop entitytypes = entity.getType(); int i = entitytypes.clientTrackingRange() * 16; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index cb1efab5c5cfd47cfbdab609009cc6a5cd6f1dc4..fca0453ee83f7592e7ad7c572e238202247a93a1 100644 +index cafd2299ccc0a803f6c7e131c49644b6bdf508a6..a3b7bcdda3465e4ae8a9cdb8169673f2c7dbce5d 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2106,7 +2106,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl +@@ -2100,7 +2100,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl public void onTrackingStart(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot @@ -38,11 +38,11 @@ index cb1efab5c5cfd47cfbdab609009cc6a5cd6f1dc4..fca0453ee83f7592e7ad7c572e238202 if (entity instanceof ServerPlayer) { ServerLevel.this.players.add((ServerPlayer) entity); ServerLevel.this.updateSleepingPlayerList(); -@@ -2128,6 +2128,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl +@@ -2122,6 +2122,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl } entity.valid = true; // CraftBukkit + ServerLevel.this.getChunkSource().addEntity(entity); - } - - public void onTrackingEnd(Entity entity) { + // Paper start - Set origin location when the entity is being added to the world + if (entity.getOriginVector() == null) { + entity.setOrigin(entity.getBukkitEntity().getLocation()); diff --git a/patches/server/0508-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/0508-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch index 9f1e0260b7..1350fdd053 100644 --- a/patches/server/0508-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch +++ b/patches/server/0508-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch @@ -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 070bc5f072163b35868ef234e5f34c3eede4c934..9790d6f7f451233e5abcaad24befb8b638ad8df3 100644 +index aeaefd8c2a58344d6298e044c060689062b7233d..c72a0158b702fe0ad97bef2a0660cc7d83db11c8 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1666,6 +1666,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl +@@ -1660,6 +1660,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl //ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c())); this.levelData.setSpawn(pos, angle); diff --git a/patches/server/0597-Remove-stale-POIs.patch b/patches/server/0597-Remove-stale-POIs.patch index 5f24fda05c..021d7baa66 100644 --- a/patches/server/0597-Remove-stale-POIs.patch +++ b/patches/server/0597-Remove-stale-POIs.patch @@ -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 8621141c4000001a6c52434dc81994251afc1a5b..e0f478f234f53d9bfb600ce69463ae6d8bfc100c 100644 +index 6585bcc9dd0ae52d0e3565f546c625c1b0e100ed..550013408a212d1213d6651b71f80698d85290c6 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1748,6 +1748,11 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl +@@ -1742,6 +1742,11 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl }); optional1.ifPresent((villageplacetype) -> { this.getServer().execute(() -> { diff --git a/patches/server/0618-added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/0618-added-option-to-disable-pathfinding-updates-on-block.patch index 9711e9646f..02c877b768 100644 --- a/patches/server/0618-added-option-to-disable-pathfinding-updates-on-block.patch +++ b/patches/server/0618-added-option-to-disable-pathfinding-updates-on-block.patch @@ -20,10 +20,10 @@ index 7fc5bf095afa6d5881285b89091d2ff48ffb69f0..0eba516110b82d917c3374a9fe5bbf33 } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index a678cab496bbeb757a3b60267e4cc3c0e54dfa2f..1e2139e7f82009e3f9a8b89b10a1fc031602d430 100644 +index f690f20d8dc7c3957aa5287c74e5366db57a5bd4..26024b122c4a7c4339114191a544230a223fd5f7 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1345,6 +1345,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl +@@ -1339,6 +1339,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl @Override public void sendBlockUpdated(BlockPos pos, BlockState oldState, BlockState newState, int flags) { this.getChunkSource().blockChanged(pos); @@ -31,7 +31,7 @@ index a678cab496bbeb757a3b60267e4cc3c0e54dfa2f..1e2139e7f82009e3f9a8b89b10a1fc03 VoxelShape voxelshape = oldState.getCollisionShape(this, pos); VoxelShape voxelshape1 = newState.getCollisionShape(this, pos); -@@ -1372,6 +1373,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl +@@ -1366,6 +1367,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl } }