From b14979e35280bb4d7f4a3875f5716fb0b8549bc0 Mon Sep 17 00:00:00 2001 From: Owen <23108066+Owen1212055@users.noreply.github.com> Date: Mon, 24 Jul 2023 05:04:40 -0400 Subject: [PATCH] Remove isRemoved skip on .discard() (#9520) --- ...0972-Folia-scheduler-and-owned-region-API.patch | 14 +++----------- ...t-load-chunks-for-supporting-block-checks.patch | 4 ++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/patches/server/0972-Folia-scheduler-and-owned-region-API.patch b/patches/server/0972-Folia-scheduler-and-owned-region-API.patch index 5c25ad2fbd..230a05b965 100644 --- a/patches/server/0972-Folia-scheduler-and-owned-region-API.patch +++ b/patches/server/0972-Folia-scheduler-and-owned-region-API.patch @@ -1158,7 +1158,7 @@ index 8547e7ff2f1f5b7701fb0f3c3010c14601a5f83e..fff7ad7a45f310783ac96b44575ad3db this.players.remove(entityplayer); this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 8218169014a7af183e6b0058fe08af18ca047448..3ffb92a82e17af467afb18c81accc482a93d6a6f 100644 +index 8218169014a7af183e6b0058fe08af18ca047448..131d88eed13741a5438910b9acc7ffa53d56e86a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -246,11 +246,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1186,15 +1186,7 @@ index 8218169014a7af183e6b0058fe08af18ca047448..3ffb92a82e17af467afb18c81accc482 @Override public CommandSender getBukkitSender(CommandSourceStack wrapper) { return this.getBukkitEntity(); -@@ -665,6 +677,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - } - - public final void discard() { -+ if (this.isRemoved()) return; // Paper - this.remove(Entity.RemovalReason.DISCARDED); - } - -@@ -4651,6 +4664,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4651,6 +4663,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return; } // Paper end - rewrite chunk system @@ -1202,7 +1194,7 @@ index 8218169014a7af183e6b0058fe08af18ca047448..3ffb92a82e17af467afb18c81accc482 if (this.removalReason == null) { this.removalReason = reason; } -@@ -4661,12 +4675,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4661,12 +4674,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { if (reason != RemovalReason.UNLOADED_TO_CHUNK) this.getPassengers().forEach(Entity::stopRiding); // Paper - chunk system - don't adjust passenger state when unloading, it's just not safe (and messes with our logic in entity chunk unload) this.levelCallback.onRemove(reason); diff --git a/patches/server/0980-Don-t-load-chunks-for-supporting-block-checks.patch b/patches/server/0980-Don-t-load-chunks-for-supporting-block-checks.patch index 00752189a9..7a9bb63408 100644 --- a/patches/server/0980-Don-t-load-chunks-for-supporting-block-checks.patch +++ b/patches/server/0980-Don-t-load-chunks-for-supporting-block-checks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't load chunks for supporting block checks diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3ffb92a82e17af467afb18c81accc482a93d6a6f..305b43071aa1cf8feee75fae757bb7734ae33771 100644 +index 131d88eed13741a5438910b9acc7ffa53d56e86a..4b2d3b5a0a6f4ef168b1b1c2cf1b2e8510b82712 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1369,7 +1369,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1368,7 +1368,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } protected BlockPos getOnPos(float offset) {