From 17dbf74ccfa7f306174d6ec9ab8c31b47aed45a5 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 9 Nov 2024 21:17:42 +0100 Subject: [PATCH] Improve CraftEntity and CraftPlayer equals --- .../0195-Fix-CraftEntity-hashCode.patch | 46 -------- ...ity-and-CraftPlayer-equals-and-hashC.patch | 103 ++++++++++++++++++ .../0207-InventoryCloseEvent-Reason-API.patch | 6 +- ...e-attack-cooldown-methods-for-Player.patch | 4 +- .../server/0241-Improve-death-events.patch | 6 +- ...-Replace-OfflinePlayer-getLastPlayed.patch | 10 +- ...nd-additions-to-the-spawn-reason-API.patch | 6 +- ...-Implement-Player-Client-Options-API.patch | 4 +- .../server/0378-Add-entity-liquid-API.patch | 4 +- patches/server/0389-Brand-support.patch | 4 +- patches/server/0410-Entity-isTicking.patch | 6 +- ...r-spawnParticle-x-y-z-precision-loss.patch | 4 +- patches/server/0466-Add-sendOpLevel-API.patch | 6 +- .../server/0488-Expose-Tracked-Players.patch | 4 +- ...527-Expand-PlayerGameModeChangeEvent.patch | 4 +- .../0539-Add-PlayerKickEvent-causes.patch | 12 +- patches/server/0553-Missing-Entity-API.patch | 4 +- .../server/0566-Add-PlayerSetSpawnEvent.patch | 6 +- ...89-Add-Raw-Byte-Entity-Serialization.patch | 6 +- .../0633-Entity-powdered-snow-API.patch | 4 +- ...ulti-Block-Change-API-Implementation.patch | 4 +- patches/server/0715-More-Teleport-API.patch | 16 +-- ...stom-Chat-Completion-Suggestions-API.patch | 4 +- patches/server/0722-Collision-API.patch | 4 +- .../0745-Elder-Guardian-appearance-API.patch | 4 +- .../0757-Add-Player-Warden-Warning-API.patch | 4 +- patches/server/0769-fix-Instruments.patch | 4 +- .../0772-Add-Sneaking-API-for-Entities.patch | 4 +- patches/server/0778-Flying-Fall-Damage.patch | 4 +- patches/server/0783-Win-Screen-API.patch | 4 +- .../server/0786-Add-Entity-Body-Yaw-API.patch | 4 +- .../0808-Expand-PlayerItemMendEvent.patch | 6 +- patches/server/0827-Fix-BanList-API.patch | 6 +- .../server/0846-Bandaid-fix-for-Effect.patch | 4 +- ...-API-for-an-entity-s-scoreboard-name.patch | 4 +- .../0854-Add-Listing-API-for-Player.patch | 8 +- patches/server/0858-Expand-Pose-API.patch | 6 +- .../0884-Add-player-idle-duration-API.patch | 4 +- ...stack-for-Player-sendEquipmentChange.patch | 4 +- .../0907-Add-experience-points-API.patch | 4 +- .../0992-Properly-resend-entities.patch | 6 +- .../1028-Improve-entity-effect-API.patch | 12 +- .../1038-Moonrise-optimisation-patches.patch | 12 +- .../1039-API-for-checking-sent-chunks.patch | 4 +- 44 files changed, 221 insertions(+), 164 deletions(-) delete mode 100644 patches/server/0195-Fix-CraftEntity-hashCode.patch create mode 100644 patches/server/0195-Improve-CraftEntity-and-CraftPlayer-equals-and-hashC.patch diff --git a/patches/server/0195-Fix-CraftEntity-hashCode.patch b/patches/server/0195-Fix-CraftEntity-hashCode.patch deleted file mode 100644 index aa86c5b036..0000000000 --- a/patches/server/0195-Fix-CraftEntity-hashCode.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sun, 10 Jun 2018 20:20:15 -0400 -Subject: [PATCH] Fix CraftEntity hashCode - -hashCodes are not allowed to change, however bukkit used a value -that does change, the entityId. - -When an entity is teleported dimensions, the entity reference is -replaced with a new one with a new entity ID. - -For hashCode, we can simply use the UUID's hashCode to keep -the hashCode from changing. - -equals() is ok to use getEntityId() because equals() should only -be true if both the left and right are the same reference. - -Since entity ids can not duplicate during runtime, this -check is essentially the same as this.getHandle() == other.getHandle() - -However, replaced it too to make it clearer of intent. - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 0480fbeffd19011d3cd63021225f376c464b480c..0e5cc680ee2418ec2af5fc3e215618ad4e768ed0 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -503,14 +503,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { - return false; - } - final CraftEntity other = (CraftEntity) obj; -- return (this.getEntityId() == other.getEntityId()); -+ return (this.getHandle() == other.getHandle()); // Paper - while logically the same, this is clearer - } - -+ // Paper - Fix hashCode. entity ID's are not static. -+ // A CraftEntity can change reference to a new entity with a new ID, and hash codes should never change - @Override - public int hashCode() { -- int hash = 7; -- hash = 29 * hash + this.getEntityId(); -- return hash; -+ return getUniqueId().hashCode(); -+ // Paper end - } - - @Override diff --git a/patches/server/0195-Improve-CraftEntity-and-CraftPlayer-equals-and-hashC.patch b/patches/server/0195-Improve-CraftEntity-and-CraftPlayer-equals-and-hashC.patch new file mode 100644 index 0000000000..f0cd2a02a2 --- /dev/null +++ b/patches/server/0195-Improve-CraftEntity-and-CraftPlayer-equals-and-hashC.patch @@ -0,0 +1,103 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nassim Jahnke +Date: Sat, 9 Nov 2024 21:10:45 +0100 +Subject: [PATCH] Improve CraftEntity and CraftPlayer equals and hashCode + +Make sure the hash code does not change and also remove outdated +equals logic from CraftPlayer. Long-term, the override there should +be entirely removed, but this is good enough for now. + +Replacing some getHandle method calls with direct field access will +also reduce overhead from casts that the overridden methods come with, +at least until those are changed later on as well. + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +index 0480fbeffd19011d3cd63021225f376c464b480c..d6241e2db362de034ae610694c49c1883ffabd07 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +@@ -437,7 +437,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { + + @Override + public UUID getUniqueId() { +- return this.getHandle().getUUID(); ++ return this.entity.getUUID(); + } + + @Override +@@ -496,21 +496,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { + + @Override + public boolean equals(Object obj) { +- if (obj == null) { +- return false; +- } +- if (this.getClass() != obj.getClass()) { +- return false; +- } ++ if (this == obj) return true; ++ if (obj == null || getClass() != obj.getClass()) return false; ++ + final CraftEntity other = (CraftEntity) obj; +- return (this.getEntityId() == other.getEntityId()); ++ return this.entity == other.entity; // There should never be duplicate entities with differing references + } + + @Override + public int hashCode() { +- int hash = 7; +- hash = 29 * hash + this.getEntityId(); +- return hash; ++ // The UUID and thus hash code should never change (unlike the entity id) ++ return this.getUniqueId().hashCode(); + } + + @Override +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index a4333eae8aa2ae3fefdc8a765a4434c36e123b12..b3f01ea79ecbce0130bbf3315a4076661affd1ae 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -626,22 +626,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + + @Override + public boolean equals(Object obj) { +- if (!(obj instanceof OfflinePlayer)) { +- return false; +- } +- OfflinePlayer other = (OfflinePlayer) obj; +- if ((this.getUniqueId() == null) || (other.getUniqueId() == null)) { +- return false; +- } +- +- boolean uuidEquals = this.getUniqueId().equals(other.getUniqueId()); +- boolean idEquals = true; +- +- if (other instanceof CraftPlayer) { +- idEquals = this.getEntityId() == ((CraftPlayer) other).getEntityId(); +- } +- +- return uuidEquals && idEquals; ++ // Long-term, this should just use the super equals... for now, check the UUID ++ if (obj == this) return true; ++ if (!(obj instanceof OfflinePlayer other)) return false; ++ return this.getUniqueId().equals(other.getUniqueId()); + } + + @Override +@@ -2012,7 +2000,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + + @Override + public boolean canSee(org.bukkit.entity.Entity entity) { +- return this.equals(entity) || entity.isVisibleByDefault() ^ this.invertedVisibilityEntities.containsKey(entity.getUniqueId()); // SPIGOT-7312: Can always see self ++ return this.getUniqueId().equals(entity.getUniqueId()) || entity.isVisibleByDefault() ^ this.invertedVisibilityEntities.containsKey(entity.getUniqueId()); // SPIGOT-7312: Can always see self + } + + public boolean canSeePlayer(UUID uuid) { +@@ -2052,7 +2040,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + @Override + public int hashCode() { + if (this.hash == 0 || this.hash == 485) { +- this.hash = 97 * 5 + (this.getUniqueId() != null ? this.getUniqueId().hashCode() : 0); ++ this.hash = 97 * 5 + this.getUniqueId().hashCode(); + } + return this.hash; + } diff --git a/patches/server/0207-InventoryCloseEvent-Reason-API.patch b/patches/server/0207-InventoryCloseEvent-Reason-API.patch index 8e60427648..aa12e84c6f 100644 --- a/patches/server/0207-InventoryCloseEvent-Reason-API.patch +++ b/patches/server/0207-InventoryCloseEvent-Reason-API.patch @@ -96,7 +96,7 @@ index 79d9a58c66382fd94ab5f6020285e341b0114f6a..f36d72153c1ec0426790ed3033500c3c this.player.doCloseContainer(); } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index a929c809dc1dcb2bdab4db0d2a8ca794189e93d9..c9c3ebcb7239bf01617a89f03cd0ad12dd0b2c34 100644 +index ac5607fb1ac771f16b14d71e08a8d4183a39a002..06338f5fa552a390db05a90b5cc796a70104ada0 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -468,7 +468,7 @@ public abstract class PlayerList { @@ -165,10 +165,10 @@ index 6d4e0a90c70f7a66450cbb18ebec1d7bf9200af2..5ff159be1a6dfb4b1a5b9aa1e435d294 @Override public boolean isBlocking() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a4333eae8aa2ae3fefdc8a765a4434c36e123b12..462877cf6f0dce4f86b6a47564affe9beb2559a8 100644 +index b3f01ea79ecbce0130bbf3315a4076661affd1ae..01d257d1fe33b3d38e155b69436173a8a3c828e2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1290,7 +1290,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1278,7 +1278,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Close any foreign inventory if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) { diff --git a/patches/server/0240-Expose-attack-cooldown-methods-for-Player.patch b/patches/server/0240-Expose-attack-cooldown-methods-for-Player.patch index 348ac73d0c..93104eea2c 100644 --- a/patches/server/0240-Expose-attack-cooldown-methods-for-Player.patch +++ b/patches/server/0240-Expose-attack-cooldown-methods-for-Player.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 462877cf6f0dce4f86b6a47564affe9beb2559a8..e4d840d6335007a6a542240746504bf1f2af332d 100644 +index 01d257d1fe33b3d38e155b69436173a8a3c828e2..ca3e3aa01ee5f1b926478817636e6b94bf3176fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3007,6 +3007,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2995,6 +2995,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.adventure$pointers; } diff --git a/patches/server/0241-Improve-death-events.patch b/patches/server/0241-Improve-death-events.patch index 00939c177d..a1b7400225 100644 --- a/patches/server/0241-Improve-death-events.patch +++ b/patches/server/0241-Improve-death-events.patch @@ -79,7 +79,7 @@ index 29b836a75b835f0d5233db419fc5ca8dde885fdb..2bd97344502a63173de923542f27759d } } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 5b8e0931be2acb1eb4ac6f399ecc0a5ebc5db586..7a89c25fcd1c76e4b176c257600db89788aa0f21 100644 +index 30343efb680edf3dc355498b04c5db9ebecbf270..781568c0aef7556fd4422574d31c0ad790f0afa7 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -295,6 +295,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -420,10 +420,10 @@ index 2caba38a50b7ea535337a3540aa5272d4a9f1878..e20565cf256aacd012a1722c5ebbf901 // CraftBukkit end this.gameEvent(GameEvent.ENTITY_DIE); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e4d840d6335007a6a542240746504bf1f2af332d..159bba49095aec77cce5f53d4388a5dff0afcc60 100644 +index ca3e3aa01ee5f1b926478817636e6b94bf3176fd..66446d549444316ca89051a0da99583dc4ef80fe 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2544,7 +2544,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2532,7 +2532,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void sendHealthUpdate() { FoodData foodData = this.getHandle().getFoodData(); diff --git a/patches/server/0270-Replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0270-Replace-OfflinePlayer-getLastPlayed.patch index ccda773898..cbd68f27b3 100644 --- a/patches/server/0270-Replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/server/0270-Replace-OfflinePlayer-getLastPlayed.patch @@ -28,7 +28,7 @@ index 8d958ac09bd9484d879eee6acb6aaea20f4f8339..3e0ddfe11d74ce47a023837b2ee472f0 public boolean queueHealthUpdatePacket; public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f2c7fba1f474618eb68a804d2dc7fc8d70c8ff6f..f56ef720a74611ffef314553f4f785ea5cf086ac 100644 +index 8bb2749f751839f7dfd8fb62f676bd54ec8b1b09..4b2826f3319dca1f795653106d22fc6948c6a27a 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -182,6 +182,7 @@ public abstract class PlayerList { @@ -106,7 +106,7 @@ index f6b2ca92fd3510a76cbf56d0ea55aa6caaf12ba1..e0d342a0ddd140b342f7af138c71596c public Location getLastDeathLocation() { if (this.getData().contains("LastDeathLocation", 10)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 159bba49095aec77cce5f53d4388a5dff0afcc60..f351250b8e8b66bcf72230bbc76835fcb45817e1 100644 +index 66446d549444316ca89051a0da99583dc4ef80fe..d77a729354448831852a883acfff45ccb151cc0c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -215,6 +215,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -117,7 +117,7 @@ index 159bba49095aec77cce5f53d4388a5dff0afcc60..f351250b8e8b66bcf72230bbc76835fc public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -2076,6 +2077,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2064,6 +2065,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.firstPlayed = firstPlayed; } @@ -136,7 +136,7 @@ index 159bba49095aec77cce5f53d4388a5dff0afcc60..f351250b8e8b66bcf72230bbc76835fc public void readExtraData(CompoundTag nbttagcompound) { this.hasPlayedBefore = true; if (nbttagcompound.contains("bukkit")) { -@@ -2098,6 +2111,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2086,6 +2099,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setExtraData(CompoundTag nbttagcompound) { @@ -145,7 +145,7 @@ index 159bba49095aec77cce5f53d4388a5dff0afcc60..f351250b8e8b66bcf72230bbc76835fc if (!nbttagcompound.contains("bukkit")) { nbttagcompound.put("bukkit", new CompoundTag()); } -@@ -2112,6 +2127,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2100,6 +2115,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { data.putLong("firstPlayed", this.getFirstPlayed()); data.putLong("lastPlayed", System.currentTimeMillis()); data.putString("lastKnownName", handle.getScoreboardName()); diff --git a/patches/server/0278-Fixes-and-additions-to-the-spawn-reason-API.patch b/patches/server/0278-Fixes-and-additions-to-the-spawn-reason-API.patch index 94f0e11703..7a914a84e5 100644 --- a/patches/server/0278-Fixes-and-additions-to-the-spawn-reason-API.patch +++ b/patches/server/0278-Fixes-and-additions-to-the-spawn-reason-API.patch @@ -67,7 +67,7 @@ index 97b48186a48ca037645d4a5ae84e3a95fd413a33..a04cfa09d9f8594a7ad3120855efe164 String s1 = connection.getLoggableAddress(this.server.logIPs()); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2e1628a9b5507ff6b1f00ac83247fc033b2db1c4..e7b4809aa7220597ae92cf8f941f61e874d45d46 100644 +index a430a3e2c3b4ae53cad1fbaf4dd71b9e2f24ccf7..49310b11116259193a93aca37da9c6a6949eb948 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -256,6 +256,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -272,10 +272,10 @@ index f0163b7fa8b27823db9df5b8d2b6adcb63023164..de9d00ec932c8d07b28dd68ac9b8e6d5 if (org.bukkit.craftbukkit.event.CraftEventFactory.callTrialSpawnerSpawnEvent(entity, pos).isCancelled()) { return Optional.empty(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 0e5cc680ee2418ec2af5fc3e215618ad4e768ed0..7fb04535b8c0744d0fa4b0c0a933234134486956 100644 +index d6241e2db362de034ae610694c49c1883ffabd07..73788d702a0a814fe7b1e64b33a3b97ca1777662 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1019,4 +1019,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1014,4 +1014,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return this.getHandle().spawnedViaMobSpawner; } // Paper end - Entity#fromMobSpawner diff --git a/patches/server/0337-Implement-Player-Client-Options-API.patch b/patches/server/0337-Implement-Player-Client-Options-API.patch index da2d0fcb26..05731c9616 100644 --- a/patches/server/0337-Implement-Player-Client-Options-API.patch +++ b/patches/server/0337-Implement-Player-Client-Options-API.patch @@ -136,10 +136,10 @@ index 363175d3325c012f31ba84060bb0bfac694f6ab8..9911e231ad021286f2da90057b06874f this.adventure$locale = java.util.Objects.requireNonNullElse(net.kyori.adventure.translation.Translator.parseLocale(this.language), java.util.Locale.US); // Paper this.requestedViewDistance = clientOptions.viewDistance(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index faab55435a0c4fc6ff9d117f29a2401677b9f828..69108fd869c7c929fd7971abea520d5ab9063f69 100644 +index 341dbff92d15886afe8fe628e06d1c07817241ed..66e5e949c8711103ae9bf73161422f350c217874 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -670,6 +670,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -658,6 +658,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message); } } diff --git a/patches/server/0378-Add-entity-liquid-API.patch b/patches/server/0378-Add-entity-liquid-API.patch index 849eeec01f..e7b8d36eb5 100644 --- a/patches/server/0378-Add-entity-liquid-API.patch +++ b/patches/server/0378-Add-entity-liquid-API.patch @@ -8,10 +8,10 @@ public net.minecraft.world.entity.Entity isInRain()Z public net.minecraft.world.entity.Entity isInBubbleColumn()Z diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 7fb04535b8c0744d0fa4b0c0a933234134486956..b001284e368f64871824c1f961999bb3f726de57 100644 +index 73788d702a0a814fe7b1e64b33a3b97ca1777662..ec122fa4e443290ff973797740172e07f8e736ca 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1026,4 +1026,41 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1021,4 +1021,41 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return getHandle().spawnReason; } // Paper end - entity spawn reason API diff --git a/patches/server/0389-Brand-support.patch b/patches/server/0389-Brand-support.patch index 917f8102d4..445cf6f8a2 100644 --- a/patches/server/0389-Brand-support.patch +++ b/patches/server/0389-Brand-support.patch @@ -57,10 +57,10 @@ index b9fbaddcc8239bf737fdea51790f678306e511eb..9a8b08d4b70b8890961e4af7ce6e870a } catch (Exception ex) { ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 69108fd869c7c929fd7971abea520d5ab9063f69..3191c66c9e5b9c5fcfd07716733aaa51612d507f 100644 +index 66e5e949c8711103ae9bf73161422f350c217874..80e25cc8de5e3714dee5cb5ce22e49695a149258 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3166,6 +3166,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3154,6 +3154,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/patches/server/0410-Entity-isTicking.patch b/patches/server/0410-Entity-isTicking.patch index 069e67c326..8c21802ef0 100644 --- a/patches/server/0410-Entity-isTicking.patch +++ b/patches/server/0410-Entity-isTicking.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity#isTicking diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3f0a44db707176c25e306f55fa63da9314d682a1..fdb56135274b0cdd31e92a81c9fc40be3ad23c37 100644 +index 8f103dc563110f04563487f90fe02de4288a99a7..20289623062acd34afb0ca5fc7daaf032ec1f418 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -4739,5 +4739,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -19,10 +19,10 @@ index 3f0a44db707176c25e306f55fa63da9314d682a1..fdb56135274b0cdd31e92a81c9fc40be // Paper end - Expose entity id counter } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index abecb0235eee3e62a84f15f2ef100efcf3fcbf2a..925626b74005ec9c031c3773171f7684ecc9ccd3 100644 +index 609c768ba4d22e346acbc9422ce41e3b887fadb1..dbb1a52b1e5871bbb1ccbd300b8edb9aa0f56e49 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1063,4 +1063,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1058,4 +1058,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return getHandle().isInLava(); } // Paper end - entity liquid API diff --git a/patches/server/0430-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0430-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index 066a872e12..3ad6fd9e80 100644 --- a/patches/server/0430-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0430-Fix-Player-spawnParticle-x-y-z-precision-loss.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3191c66c9e5b9c5fcfd07716733aaa51612d507f..e7f2d02de2ac58ffa484d8eca5f8b5688e7e02d8 100644 +index 80e25cc8de5e3714dee5cb5ce22e49695a149258..a631d35100b1910b717e359d3f27918a95a7a2cf 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2734,7 +2734,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2722,7 +2722,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { diff --git a/patches/server/0466-Add-sendOpLevel-API.patch b/patches/server/0466-Add-sendOpLevel-API.patch index c938f70a51..dc186c0c59 100644 --- a/patches/server/0466-Add-sendOpLevel-API.patch +++ b/patches/server/0466-Add-sendOpLevel-API.patch @@ -5,7 +5,7 @@ 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 1e5cc810748af34f591d305055fe00a688213617..240a0e487ede08d1dd5050812ca4f68db4cd2dd1 100644 +index fbe10666c4ec6caa95aa38a6f99ccca700e9a4d2..061bba184c8bc2569ce1d413435ec1360fa14007 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1025,6 +1025,11 @@ public abstract class PlayerList { @@ -32,10 +32,10 @@ index 1e5cc810748af34f591d305055fe00a688213617..240a0e487ede08d1dd5050812ca4f68d 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 e7f2d02de2ac58ffa484d8eca5f8b5688e7e02d8..711697d039da58c1b93392f70a70e1ad827b1646 100644 +index a631d35100b1910b717e359d3f27918a95a7a2cf..14adc60ba3e76ce71bc957d0a41383c3f1413b34 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -694,6 +694,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -682,6 +682,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0488-Expose-Tracked-Players.patch b/patches/server/0488-Expose-Tracked-Players.patch index 2835731302..5e7f3c585c 100644 --- a/patches/server/0488-Expose-Tracked-Players.patch +++ b/patches/server/0488-Expose-Tracked-Players.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose Tracked Players diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 925626b74005ec9c031c3773171f7684ecc9ccd3..06fda053874e7ef0c8995b1a55e5f518b28eebc9 100644 +index dbb1a52b1e5871bbb1ccbd300b8edb9aa0f56e49..78afac72265e3f586c0203951b8237832fb7c6fb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1070,4 +1070,21 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1065,4 +1065,21 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return getHandle().isTicking(); } // Paper end - isTicking API diff --git a/patches/server/0527-Expand-PlayerGameModeChangeEvent.patch b/patches/server/0527-Expand-PlayerGameModeChangeEvent.patch index 26fc7358be..e27b0c6d56 100644 --- a/patches/server/0527-Expand-PlayerGameModeChangeEvent.patch +++ b/patches/server/0527-Expand-PlayerGameModeChangeEvent.patch @@ -147,10 +147,10 @@ index 2bd2f1cdf3467cacee55094d43bd3eccf61b9aa7..c3b4b800c5a34afa03ed7c31e14f26ca } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 711697d039da58c1b93392f70a70e1ad827b1646..fc246d30808ad6242f4adfe201adc169a2ddeb90 100644 +index 14adc60ba3e76ce71bc957d0a41383c3f1413b34..394816148e549414bba31c334a13d50f5134c731 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1681,7 +1681,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1669,7 +1669,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Preconditions.checkArgument(mode != null, "GameMode cannot be null"); if (this.getHandle().connection == null) return; diff --git a/patches/server/0539-Add-PlayerKickEvent-causes.patch b/patches/server/0539-Add-PlayerKickEvent-causes.patch index 7c4ea36fb3..1d360b711b 100644 --- a/patches/server/0539-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0539-Add-PlayerKickEvent-causes.patch @@ -43,7 +43,7 @@ index dbcf183483766f39334d7f7e8336033906625f3f..300929a406905f5ff1ede664d5b99fb0 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 67a9bc450f545dd7b05398968a278a14f1e518fe..7ab9a9c04f94a68dccb5ec9bfc8171bfc02927a2 100644 +index c2e535834f6b94f52c835a8d89c98220eb13bce9..8e0bc6559aad75a713e1760ea17e5004686d7e7a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -2325,7 +2325,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop future) { -@@ -652,7 +652,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -640,7 +640,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void kickPlayer(String message) { org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot @@ -516,7 +516,7 @@ index fc246d30808ad6242f4adfe201adc169a2ddeb90..e24d5992cfb89ccc4e727c91918ab1f9 } // Paper start -@@ -664,10 +664,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -652,10 +652,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void kick(final net.kyori.adventure.text.Component message) { @@ -533,7 +533,7 @@ index fc246d30808ad6242f4adfe201adc169a2ddeb90..e24d5992cfb89ccc4e727c91918ab1f9 } } -@@ -726,7 +731,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -714,7 +719,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper start - Improve chat handling if (ServerGamePacketListenerImpl.isChatMessageIllegal(msg)) { diff --git a/patches/server/0553-Missing-Entity-API.patch b/patches/server/0553-Missing-Entity-API.patch index 64f88445fb..5640dce8db 100644 --- a/patches/server/0553-Missing-Entity-API.patch +++ b/patches/server/0553-Missing-Entity-API.patch @@ -706,10 +706,10 @@ index fc0f0e841dc974d080e1abb9bbafb5165801131f..d657fd2c507a5b215aeab0a5f3e9c2ee + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 06fda053874e7ef0c8995b1a55e5f518b28eebc9..0c1c9033646dedcf1d11dee74d6965683adadf0a 100644 +index 78afac72265e3f586c0203951b8237832fb7c6fb..888a75423ac90ca85308eeb6d67bac5348bf31e0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1087,4 +1087,27 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1082,4 +1082,27 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return set; } // Paper end - tracked players API diff --git a/patches/server/0566-Add-PlayerSetSpawnEvent.patch b/patches/server/0566-Add-PlayerSetSpawnEvent.patch index e6b0fc435a..c3c3d162c0 100644 --- a/patches/server/0566-Add-PlayerSetSpawnEvent.patch +++ b/patches/server/0566-Add-PlayerSetSpawnEvent.patch @@ -154,7 +154,7 @@ index 94cc69ed1ccbcfcc8f431762fef641c313b2f634..c680b311760601bb539d685bceddba67 public SectionPos getLastSectionPos() { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 2c810cb5d2fcf1a88423cfe4e063dd810ecaaeb0..a62858d3cd83358f2356c15fc102b99c41969a74 100644 +index 85bd61bd45690c5532f56d8f11b81f7a11f3e284..05d2f3c26d10169f6cf43bcb6c48db5d27b5cbac 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -802,7 +802,7 @@ public abstract class PlayerList { @@ -187,10 +187,10 @@ index db26b5a0464bd6087eeacaf6dd61eba37365df92..9117c035d5a6ff114b028fad3380ceb1 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e24d5992cfb89ccc4e727c91918ab1f94131987e..ca13d317a5e1c7b7ccda3fdec63e2146562649f6 100644 +index c8db7c123d8a7e1063c732780f18fda1f8ae1225..85bbb04aa2f8db860780667994aba90f5b1d4d8a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1430,9 +1430,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1418,9 +1418,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setRespawnLocation(Location location, boolean override) { if (location == null) { diff --git a/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch index bad6f65ffd..6735257894 100644 --- a/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Add Raw Byte Entity Serialization public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3d9bf236eb1535cc2547f1421ee2a09b2c44fc52..9755d8a40a5a5b4863ce057f576f393773cee3e4 100644 +index 736569ea22a8b257fca6e4b9326f73ca8fbc803e..38147960aed55bb60b427d73739d8ec0b5b8b863 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2261,6 +2261,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -27,10 +27,10 @@ index 3d9bf236eb1535cc2547f1421ee2a09b2c44fc52..9755d8a40a5a5b4863ce057f576f3937 return this.isPassenger() ? false : this.saveAsPassenger(nbt); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 0c1c9033646dedcf1d11dee74d6965683adadf0a..1ed01978611cddb2558e441863dadc468bc07c3d 100644 +index 888a75423ac90ca85308eeb6d67bac5348bf31e0..b13c947d2cfe085017b30cb0f8340dd64f338914 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1088,6 +1088,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1083,6 +1083,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } // Paper end - tracked players API diff --git a/patches/server/0633-Entity-powdered-snow-API.patch b/patches/server/0633-Entity-powdered-snow-API.patch index 09c93986c1..acfaef73e3 100644 --- a/patches/server/0633-Entity-powdered-snow-API.patch +++ b/patches/server/0633-Entity-powdered-snow-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Entity powdered snow API public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 1ed01978611cddb2558e441863dadc468bc07c3d..9693656418210957000add9b6670c4bee67f8462 100644 +index b13c947d2cfe085017b30cb0f8340dd64f338914..442b5f13e976dd63bf1dccc12eb8c3f16314c581 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1100,6 +1100,13 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1095,6 +1095,13 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } // Paper end - raw entity serialization API diff --git a/patches/server/0648-Multi-Block-Change-API-Implementation.patch b/patches/server/0648-Multi-Block-Change-API-Implementation.patch index 9edd052d01..7544786e22 100644 --- a/patches/server/0648-Multi-Block-Change-API-Implementation.patch +++ b/patches/server/0648-Multi-Block-Change-API-Implementation.patch @@ -24,10 +24,10 @@ index 926ff9be3d9e3f5d620e4c7ccb22b9f64865ff8c..1a37654aff9a9c86c9f7af10a1cf7213 buf.writeLong(this.sectionPos.asLong()); buf.writeVarInt(this.positions.length); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ca13d317a5e1c7b7ccda3fdec63e2146562649f6..fe0c355f8203c9bfa30d2ec48392a5a1a3d616ae 100644 +index 85bbb04aa2f8db860780667994aba90f5b1d4d8a..ef10695d2c1c3041e5f84bdb6001c08004af9d6b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -947,6 +947,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -935,6 +935,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(packet); } diff --git a/patches/server/0715-More-Teleport-API.patch b/patches/server/0715-More-Teleport-API.patch index 3bb3408bef..59ddaae25c 100644 --- a/patches/server/0715-More-Teleport-API.patch +++ b/patches/server/0715-More-Teleport-API.patch @@ -30,7 +30,7 @@ index bc8f9bd50de3894e6262e13ed55252c98f22ed8a..10f7e45f192ef50b9d9bf5fc83a8090e positionmoverotation = new PositionMoveRotation(CraftLocation.toVec3D(to), Vec3.ZERO, to.getYaw(), to.getPitch()); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 4e6afa243d6108cb946a8a7cf96c4036a3c2ac0c..a314e401ee8a306dc12a2d98a3d400ae611a6e5a 100644 +index 10fb64df10820974d11f142c102a11a5bd0f317c..8d2f6bb43fb69a4a1e2085960eb24f4397072499 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -222,15 +222,36 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -72,7 +72,7 @@ index 4e6afa243d6108cb946a8a7cf96c4036a3c2ac0c..a314e401ee8a306dc12a2d98a3d400ae // Let the server handle cross world teleports if (location.getWorld() != null && !location.getWorld().equals(this.getWorld())) { -@@ -976,6 +997,39 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -971,6 +992,39 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return CraftEntity.perm; } @@ -113,10 +113,10 @@ index 4e6afa243d6108cb946a8a7cf96c4036a3c2ac0c..a314e401ee8a306dc12a2d98a3d400ae private final org.bukkit.entity.Entity.Spigot spigot = new org.bukkit.entity.Entity.Spigot() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index fe0c355f8203c9bfa30d2ec48392a5a1a3d616ae..59a95187d04d3f1578e05a7f9d18f617eac95278 100644 +index ef10695d2c1c3041e5f84bdb6001c08004af9d6b..c87aed470ce2964815cb39f804e95f6c03553aba 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1303,13 +1303,94 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1291,13 +1291,94 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setRotation(float yaw, float pitch) { @@ -212,7 +212,7 @@ index fe0c355f8203c9bfa30d2ec48392a5a1a3d616ae..59a95187d04d3f1578e05a7f9d18f617 location.checkFinite(); ServerPlayer entity = this.getHandle(); -@@ -1322,7 +1403,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1310,7 +1391,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return false; } @@ -221,7 +221,7 @@ index fe0c355f8203c9bfa30d2ec48392a5a1a3d616ae..59a95187d04d3f1578e05a7f9d18f617 return false; } -@@ -1331,7 +1412,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1319,7 +1400,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // To = Players new Location if Teleport is Successful Location to = location; // Create & Call the Teleport Event. @@ -230,7 +230,7 @@ index fe0c355f8203c9bfa30d2ec48392a5a1a3d616ae..59a95187d04d3f1578e05a7f9d18f617 this.server.getPluginManager().callEvent(event); // Return False to inform the Plugin that the Teleport was unsuccessful/cancelled. -@@ -1340,7 +1421,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1328,7 +1409,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // If this player is riding another entity, we must dismount before teleporting. @@ -239,7 +239,7 @@ index fe0c355f8203c9bfa30d2ec48392a5a1a3d616ae..59a95187d04d3f1578e05a7f9d18f617 // SPIGOT-5509: Wakeup, similar to riding if (this.isSleeping()) { -@@ -1356,13 +1437,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1344,13 +1425,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { ServerLevel toWorld = ((CraftWorld) to.getWorld()).getHandle(); // Close any foreign inventory diff --git a/patches/server/0720-Custom-Chat-Completion-Suggestions-API.patch b/patches/server/0720-Custom-Chat-Completion-Suggestions-API.patch index bd507c2078..87e2228947 100644 --- a/patches/server/0720-Custom-Chat-Completion-Suggestions-API.patch +++ b/patches/server/0720-Custom-Chat-Completion-Suggestions-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Custom Chat Completion Suggestions API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 59a95187d04d3f1578e05a7f9d18f617eac95278..bdb4c337265f70d97f8e17f1509c1fee91a7bf6f 100644 +index c87aed470ce2964815cb39f804e95f6c03553aba..ddf28d7fbecc70f4cba5f71d7d1d5908b4ad3c3a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -708,6 +708,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -696,6 +696,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end - Add sendOpLevel API diff --git a/patches/server/0722-Collision-API.patch b/patches/server/0722-Collision-API.patch index 6f4b6366a8..6798d0e429 100644 --- a/patches/server/0722-Collision-API.patch +++ b/patches/server/0722-Collision-API.patch @@ -22,10 +22,10 @@ index a7748f4b7c5a1630937c702b3fd5fded93793d64..a93a879117ee1eb06842242aa03f757a // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index a314e401ee8a306dc12a2d98a3d400ae611a6e5a..01513cd747a0e18e3839e83bf5795aadb7d1e0e9 100644 +index 8d2f6bb43fb69a4a1e2085960eb24f4397072499..fc48a1de886d48da4cb384472f48cdba974034dd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1194,4 +1194,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1189,4 +1189,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return this.getHandle().noPhysics; } // Paper end - missing entity api diff --git a/patches/server/0745-Elder-Guardian-appearance-API.patch b/patches/server/0745-Elder-Guardian-appearance-API.patch index 08949ce478..2e672a8d57 100644 --- a/patches/server/0745-Elder-Guardian-appearance-API.patch +++ b/patches/server/0745-Elder-Guardian-appearance-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index bdb4c337265f70d97f8e17f1509c1fee91a7bf6f..b6c8eb48c78ae40ab8ea5af3339086d1d300cf93 100644 +index ddf28d7fbecc70f4cba5f71d7d1d5908b4ad3c3a..9ebaa374c0a8ceff328f0686fe09b562f5e57008 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3320,6 +3320,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3308,6 +3308,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0757-Add-Player-Warden-Warning-API.patch b/patches/server/0757-Add-Player-Warden-Warning-API.patch index ec7a1713cf..101d6fe52b 100644 --- a/patches/server/0757-Add-Player-Warden-Warning-API.patch +++ b/patches/server/0757-Add-Player-Warden-Warning-API.patch @@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b6c8eb48c78ae40ab8ea5af3339086d1d300cf93..b4191c1a54666b82c4da14f06343dae581f9f7f7 100644 +index 9ebaa374c0a8ceff328f0686fe09b562f5e57008..b4de1600c9e5f5bf00cd4699993bd4a29a37e6cf 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3325,6 +3325,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3313,6 +3313,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void showElderGuardian(boolean silent) { if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F)); } diff --git a/patches/server/0769-fix-Instruments.patch b/patches/server/0769-fix-Instruments.patch index a3ba7ec083..db3dd8a879 100644 --- a/patches/server/0769-fix-Instruments.patch +++ b/patches/server/0769-fix-Instruments.patch @@ -6,10 +6,10 @@ Subject: [PATCH] fix Instruments properly handle Player#playNote diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b4191c1a54666b82c4da14f06343dae581f9f7f7..1cbb5b0b53d9c8f0bee82d4f4ee2cfd5caf835db 100644 +index b4de1600c9e5f5bf00cd4699993bd4a29a37e6cf..f059a2e5fbcdceb1a1e8601c7d1e3a3e438c599e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -785,7 +785,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -773,7 +773,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Sound instrumentSound = instrument.getSound(); if (instrumentSound == null) return; diff --git a/patches/server/0772-Add-Sneaking-API-for-Entities.patch b/patches/server/0772-Add-Sneaking-API-for-Entities.patch index 40141ca398..aaf72ccfd7 100644 --- a/patches/server/0772-Add-Sneaking-API-for-Entities.patch +++ b/patches/server/0772-Add-Sneaking-API-for-Entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Sneaking API for Entities diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 01513cd747a0e18e3839e83bf5795aadb7d1e0e9..8a715159917950091e8efd48eaca6a54488fb896 100644 +index fc48a1de886d48da4cb384472f48cdba974034dd..ca9cda9059a5c1dae1ca9ec09248768274d4e207 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -875,6 +875,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -870,6 +870,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return Pose.values()[this.getHandle().getPose().ordinal()]; } diff --git a/patches/server/0778-Flying-Fall-Damage.patch b/patches/server/0778-Flying-Fall-Damage.patch index a4c7401da1..c13bc2fb48 100644 --- a/patches/server/0778-Flying-Fall-Damage.patch +++ b/patches/server/0778-Flying-Fall-Damage.patch @@ -26,10 +26,10 @@ index 30e0a5fe3f9bd85d2b702c2c877c5682ed35d461..aca888c2f02b09ac6739bdc81b194c45 } else { if (fallDistance >= 2.0F) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1cbb5b0b53d9c8f0bee82d4f4ee2cfd5caf835db..01062856483557c874f54bc610c3d13fca44ef05 100644 +index f059a2e5fbcdceb1a1e8601c7d1e3a3e438c599e..dbc642fd7c953ee8d1756cae079f410c03bb1cbd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2603,6 +2603,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2591,6 +2591,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().onUpdateAbilities(); } diff --git a/patches/server/0783-Win-Screen-API.patch b/patches/server/0783-Win-Screen-API.patch index fa16e65f23..f233f098bf 100644 --- a/patches/server/0783-Win-Screen-API.patch +++ b/patches/server/0783-Win-Screen-API.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Win Screen API public net.minecraft.server.level.ServerPlayer seenCredits diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 01062856483557c874f54bc610c3d13fca44ef05..b6aa646b28aef25e07c6e7fc0dfc2a252671e6c5 100644 +index dbc642fd7c953ee8d1756cae079f410c03bb1cbd..afd68e1f50dc2b2db9b77b3caf7b5d75cf31e8e1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1322,6 +1322,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1310,6 +1310,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(packet); } diff --git a/patches/server/0786-Add-Entity-Body-Yaw-API.patch b/patches/server/0786-Add-Entity-Body-Yaw-API.patch index 2a926f1388..8c8b6b3629 100644 --- a/patches/server/0786-Add-Entity-Body-Yaw-API.patch +++ b/patches/server/0786-Add-Entity-Body-Yaw-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Entity Body Yaw API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 8a715159917950091e8efd48eaca6a54488fb896..4209434ff066670000dadb0c59fea297f03300f4 100644 +index ca9cda9059a5c1dae1ca9ec09248768274d4e207..e65d1ca701d835db0ed45e627c92c1c5ed384887 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1184,6 +1184,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1179,6 +1179,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } // Paper end - entity powdered snow API diff --git a/patches/server/0808-Expand-PlayerItemMendEvent.patch b/patches/server/0808-Expand-PlayerItemMendEvent.patch index 32a8f1a464..60044b0d82 100644 --- a/patches/server/0808-Expand-PlayerItemMendEvent.patch +++ b/patches/server/0808-Expand-PlayerItemMendEvent.patch @@ -30,10 +30,10 @@ index 3a7af27bb1ce0cbe56bd3760cd400083daf98d4c..bf0838f574fa3fb9654e087d602b8d38 if (l > 0) { // this.value = l; // CraftBukkit - update exp value of orb for PlayerItemMendEvent calls // Paper - the value field should not be mutated here because it doesn't take "count" into account diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b6aa646b28aef25e07c6e7fc0dfc2a252671e6c5..d4cf68ad626e6a7d5facaa0a7474a7d4ad7981db 100644 +index afd68e1f50dc2b2db9b77b3caf7b5d75cf31e8e1..f3b06876567719c6f88db63019278dcdc849d0c1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1875,11 +1875,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1863,11 +1863,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { handle.serverLevel(), itemstack, amount ); int i = Math.min(possibleDurabilityFromXp, itemstack.getDamageValue()); @@ -49,7 +49,7 @@ index b6aa646b28aef25e07c6e7fc0dfc2a252671e6c5..d4cf68ad626e6a7d5facaa0a7474a7d4 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index d63b9c666cf6eb1de114c5c89867b8d233267c9e..dd0d19faccbc49b5f9718e2df9f004bb17a9ef7e 100644 +index ec5c16f64d4e797b4c09bd0d3ae6f143d8795612..8fba20a2ff4ef43aa3bda1116f58b696bde2b9b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1284,10 +1284,10 @@ public class CraftEventFactory { diff --git a/patches/server/0827-Fix-BanList-API.patch b/patches/server/0827-Fix-BanList-API.patch index f41fc8afb4..48283aa31e 100644 --- a/patches/server/0827-Fix-BanList-API.patch +++ b/patches/server/0827-Fix-BanList-API.patch @@ -208,10 +208,10 @@ index 172202accf4448a933fcf1ff820316c7910dd7f7..50ee7656580d386db473c054f5c5ec57 return null; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d4cf68ad626e6a7d5facaa0a7474a7d4ad7981db..86af7b3bcefe9201a56868388be8789bfdeaa22b 100644 +index f3b06876567719c6f88db63019278dcdc849d0c1..796a1540239362aec90f0a136bf7c28d282d5274 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1769,23 +1769,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1757,23 +1757,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } @Override @@ -240,7 +240,7 @@ index d4cf68ad626e6a7d5facaa0a7474a7d4ad7981db..86af7b3bcefe9201a56868388be8789b if (kickPlayer) { this.kickPlayer(reason); } -@@ -1793,12 +1793,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1781,12 +1781,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } @Override diff --git a/patches/server/0846-Bandaid-fix-for-Effect.patch b/patches/server/0846-Bandaid-fix-for-Effect.patch index edd5678928..eb9364e705 100644 --- a/patches/server/0846-Bandaid-fix-for-Effect.patch +++ b/patches/server/0846-Bandaid-fix-for-Effect.patch @@ -81,10 +81,10 @@ index c0f5e4497e1ffc93f56fc2b5748bcf76569e8c3a..188bd33f46b6baaa3fc21c9da6fa9a9d // Special case: the axis is optional for ELECTRIC_SPARK Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 86af7b3bcefe9201a56868388be8789bfdeaa22b..c582b8f307e6b8fd4991702d92c2e74c3012763a 100644 +index 796a1540239362aec90f0a136bf7c28d282d5274..d903b9f1d62a826378b6d4b8458e5f675536fef2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -934,7 +934,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -922,7 +922,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Preconditions.checkArgument(effect != null, "Effect cannot be null"); if (data != null) { Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect); diff --git a/patches/server/0848-API-for-an-entity-s-scoreboard-name.patch b/patches/server/0848-API-for-an-entity-s-scoreboard-name.patch index 68f3c7789a..703131ac85 100644 --- a/patches/server/0848-API-for-an-entity-s-scoreboard-name.patch +++ b/patches/server/0848-API-for-an-entity-s-scoreboard-name.patch @@ -7,10 +7,10 @@ Was obtainable through different methods, but you had to use different methods depending on the implementation of Entity you were working with. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index df199c1cffa7795126ab83af67e184238ddb211d..dd84f7d6874a799aa09349fe0a1bd6ebb4cea2dd 100644 +index 211726898275788e593002a279bf007c916de4de..547a485559b40411c2e91fecd3e83075dfc80241 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1264,4 +1264,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1259,4 +1259,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return !this.getHandle().level().noCollision(this.getHandle(), aabb); } // Paper end - Collision API diff --git a/patches/server/0854-Add-Listing-API-for-Player.patch b/patches/server/0854-Add-Listing-API-for-Player.patch index bcdfa3834a..9917a8cbfa 100644 --- a/patches/server/0854-Add-Listing-API-for-Player.patch +++ b/patches/server/0854-Add-Listing-API-for-Player.patch @@ -85,7 +85,7 @@ index 29b465fc1dc50e0e84ddb889c5303e80fe662874..4d67d98257b2cb9045d03c999cfd4ba2 static class EntryBuilder { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d92fb522d88a790d9cea2e6c4edad30bb73298fc..a20e5f896cfbd0a3e60b741562194e30257449c1 100644 +index efc12d629b71ba1da664d9ecfd4575bee9b45dc3..9067100a82a8c405cec0a19e53b3b245daa3bd75 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -362,14 +362,22 @@ public abstract class PlayerList { @@ -122,7 +122,7 @@ index d92fb522d88a790d9cea2e6c4edad30bb73298fc..a20e5f896cfbd0a3e60b741562194e30 // Paper end - Use single player info update packet on join player.sentListPacket = true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c582b8f307e6b8fd4991702d92c2e74c3012763a..334303fbb2cf0086ad133bdc07b27e833162f71a 100644 +index d903b9f1d62a826378b6d4b8458e5f675536fef2..512156b9c31cda88c444ab860ad9f39d73fb512b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -206,6 +206,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -133,7 +133,7 @@ index c582b8f307e6b8fd4991702d92c2e74c3012763a..334303fbb2cf0086ad133bdc07b27e83 private static final WeakHashMap> pluginWeakReferences = new WeakHashMap<>(); private int hash = 0; private double health = 20; -@@ -2114,7 +2115,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2102,7 +2103,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { otherPlayer.setUUID(uuidOverride); } // Paper end @@ -142,7 +142,7 @@ index c582b8f307e6b8fd4991702d92c2e74c3012763a..334303fbb2cf0086ad133bdc07b27e83 if (original != null) otherPlayer.setUUID(original); // Paper - uuid override } -@@ -2218,6 +2219,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2206,6 +2207,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it } diff --git a/patches/server/0858-Expand-Pose-API.patch b/patches/server/0858-Expand-Pose-API.patch index 476fb71f73..2a0272f0fa 100644 --- a/patches/server/0858-Expand-Pose-API.patch +++ b/patches/server/0858-Expand-Pose-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expand Pose API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 638b202519b0cca5ca7ba406e6f92c51a0ef990e..8a0b26533e6bbabe829efbf5afcef1a79cdf0adb 100644 +index 5a2d33b7da60469f27f9782841b0cf879a780c8f..e2ca84fb27cff54eada6ca1c7a96a29d1dbbb4e5 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -428,6 +428,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -25,10 +25,10 @@ index 638b202519b0cca5ca7ba406e6f92c51a0ef990e..8a0b26533e6bbabe829efbf5afcef1a7 if (pose == this.getPose()) { return; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index dd84f7d6874a799aa09349fe0a1bd6ebb4cea2dd..11a08ff211a9a32a825519ddb1736e02cf7f685e 100644 +index 547a485559b40411c2e91fecd3e83075dfc80241..7cd929d4b9ab60a585c2316b949fce2a0e97e467 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -900,6 +900,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -895,6 +895,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public boolean isSneaking() { return this.getHandle().isShiftKeyDown(); } diff --git a/patches/server/0884-Add-player-idle-duration-API.patch b/patches/server/0884-Add-player-idle-duration-API.patch index 0229ed41a7..1f020b6945 100644 --- a/patches/server/0884-Add-player-idle-duration-API.patch +++ b/patches/server/0884-Add-player-idle-duration-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add player idle duration API Implements API for getting and resetting a player's idle duration. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index de97ca0a25d70de50dfcc6b092f5e58facfb5a3a..b4f967c8cc0800d0606e7ad32ff8a350387c6132 100644 +index eccc2d4fce0281307e263e6fe788ce225a7422d1..bfe2ed7a121f5e955edbf42a514e9a3b6ff8eee8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3441,6 +3441,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3429,6 +3429,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/server/0887-Allow-null-itemstack-for-Player-sendEquipmentChange.patch b/patches/server/0887-Allow-null-itemstack-for-Player-sendEquipmentChange.patch index 35c74fffab..c6e0416fd7 100644 --- a/patches/server/0887-Allow-null-itemstack-for-Player-sendEquipmentChange.patch +++ b/patches/server/0887-Allow-null-itemstack-for-Player-sendEquipmentChange.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow null itemstack for Player#sendEquipmentChange diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b4f967c8cc0800d0606e7ad32ff8a350387c6132..ccc65e07d0d1bb6e94e861e7f50977ba61462ca4 100644 +index bfe2ed7a121f5e955edbf42a514e9a3b6ff8eee8..69f2eb774b8aa364760b2e65a02bc547c1d89c9d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1144,7 +1144,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1132,7 +1132,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void sendEquipmentChange(LivingEntity entity, EquipmentSlot slot, ItemStack item) { diff --git a/patches/server/0907-Add-experience-points-API.patch b/patches/server/0907-Add-experience-points-API.patch index 7762f4b05d..c202546913 100644 --- a/patches/server/0907-Add-experience-points-API.patch +++ b/patches/server/0907-Add-experience-points-API.patch @@ -18,10 +18,10 @@ index aca888c2f02b09ac6739bdc81b194c4527dd69f5..a19a795deaa7f46c92b97912e2ade006 // Paper start - send while respecting visibility private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ccc65e07d0d1bb6e94e861e7f50977ba61462ca4..58d12409447903f855baa6beb149aa658bf7b1bb 100644 +index 69f2eb774b8aa364760b2e65a02bc547c1d89c9d..4b56cb08931b81f6ad81bd4e3ed991db7ab7629d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1943,6 +1943,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1931,6 +1931,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { Preconditions.checkArgument(exp >= 0, "Total experience points must not be negative (%s)", exp); this.getHandle().totalExperience = exp; } diff --git a/patches/server/0992-Properly-resend-entities.patch b/patches/server/0992-Properly-resend-entities.patch index 9bb9004b32..cdb20d9bdb 100644 --- a/patches/server/0992-Properly-resend-entities.patch +++ b/patches/server/0992-Properly-resend-entities.patch @@ -134,7 +134,7 @@ index b451842d6848af883cc3abf200f03c9a4680106c..88299abf563a041ade1683b66b43103b } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 430addbb5c3d84f4354a89a9ec8fa15bca4d2a60..7093a7383c93f172fb7674799d7efe4c563fc99c 100644 +index 6a4f52342c5a195206ecf3ac118e8a4df4d2f3d2..20fcfb7d7d2541731452454d78f6967215c4fcd7 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -599,13 +599,45 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -282,10 +282,10 @@ index 04760d8ba7c560bd9d11191c666715ae8c3e4bff..021169d709964b1bb65e49bf3fcf3119 } // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 7536ab5c22d97a074c08a95fff6bc756d61e387d..b0e49ad831f1ebc6b126bf82c5fddaebffb91312 100644 +index 2b1f3e27ce5cecc94297c27debe5e3bd64c08967..d1d9916db7bd4886d30355e6a0ecb69cd21c2364 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1013,7 +1013,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1008,7 +1008,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return; } diff --git a/patches/server/1028-Improve-entity-effect-API.patch b/patches/server/1028-Improve-entity-effect-API.patch index 20be4e8753..cc17e320f6 100644 --- a/patches/server/1028-Improve-entity-effect-API.patch +++ b/patches/server/1028-Improve-entity-effect-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Improve entity effect API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index b0e49ad831f1ebc6b126bf82c5fddaebffb91312..179886dcbda29c5cdb7dbd43e44951ae38d9df96 100644 +index d1d9916db7bd4886d30355e6a0ecb69cd21c2364..ddabaed899c755925ad8618b78c33dacaf2126ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1300,4 +1300,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1295,4 +1295,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return this.getHandle().getScoreboardName(); } // Paper end - entity scoreboard name @@ -25,10 +25,10 @@ index b0e49ad831f1ebc6b126bf82c5fddaebffb91312..179886dcbda29c5cdb7dbd43e44951ae + // Paper end - broadcast hurt animation } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 766c1e80997d1bed99f4ebf9499eec60bf70a536..f668359f2fbe765c68fb575c31444bc0404cba0f 100644 +index bcfbacf408d3bd043c3ecd8c3a43497bcff58343..55fa71403c6fe1fa1ffd00d9cecb6b67bd66e174 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1294,6 +1294,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1282,6 +1282,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void sendHurtAnimation(float yaw) { @@ -40,7 +40,7 @@ index 766c1e80997d1bed99f4ebf9499eec60bf70a536..f668359f2fbe765c68fb575c31444bc0 if (this.getHandle().connection == null) { return; } -@@ -1303,7 +1308,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1291,7 +1296,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { * This makes no sense. We'll add 90 to it so that 0 = front, clockwise from there. */ float actualYaw = yaw + 90; @@ -49,7 +49,7 @@ index 766c1e80997d1bed99f4ebf9499eec60bf70a536..f668359f2fbe765c68fb575c31444bc0 } @Override -@@ -3540,4 +3545,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3528,4 +3533,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void setSendViewDistance(final int viewDistance) { throw new UnsupportedOperationException("Not implemented yet"); } diff --git a/patches/server/1038-Moonrise-optimisation-patches.patch b/patches/server/1038-Moonrise-optimisation-patches.patch index 4baed95c2a..60e09d35a9 100644 --- a/patches/server/1038-Moonrise-optimisation-patches.patch +++ b/patches/server/1038-Moonrise-optimisation-patches.patch @@ -28412,7 +28412,7 @@ index 50040c497a819cd1229042ab3cb057d34a32cacc..1f9c436a632e4f110be61cf76fcfc3b7 + // Paper end - block counting } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 29b2a3ad15f6ce802f1d1d16d519c674f5920b37..7bc32f2e7d8cd8aea6151f73420af91a9413e93a 100644 +index 5949cbccb569ab1d518508d200e69ad9d7d0ba9a..a9e1ae7ad0b81e7488cb07876b32d7ba0a170365 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -176,7 +176,7 @@ import org.bukkit.event.player.PlayerTeleportEvent; @@ -36002,7 +36002,7 @@ index f65cc95ab28e8a3b21eac2b16bd9ebe97e56e571..0074bc0e7147dc3a8c538e796f14ac9b @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4a1fa5b7597a06e57619bbc336d8ca117bc6f5b2..c814b68933155fe7391b325260052d9affb6841c 100644 +index a3c6ad1a53bdfd9bd928951983a503afba9eedc3..34eb7ede1d9f8cbd94660144fc5ef77669ea8afa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1432,7 +1432,7 @@ public final class CraftServer implements Server { @@ -36135,10 +36135,10 @@ index 6dc3fc701d1e16a51d99f934ea3dc192363a6762..2058671a77cac4cfa6494461a5142aba // Paper start - implement pointers diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f668359f2fbe765c68fb575c31444bc0404cba0f..4fe26b5e492b5cc3ee6b99ec6ade4938acfc9ed8 100644 +index 55fa71403c6fe1fa1ffd00d9cecb6b67bd66e174..73ee1ba0b70859cc9c012ab32ad04e8ae2a73e30 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3523,7 +3523,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3511,7 +3511,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setViewDistance(final int viewDistance) { @@ -36149,7 +36149,7 @@ index f668359f2fbe765c68fb575c31444bc0404cba0f..4fe26b5e492b5cc3ee6b99ec6ade4938 } @Override -@@ -3533,7 +3535,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3521,7 +3523,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setSimulationDistance(final int simulationDistance) { @@ -36160,7 +36160,7 @@ index f668359f2fbe765c68fb575c31444bc0404cba0f..4fe26b5e492b5cc3ee6b99ec6ade4938 } @Override -@@ -3543,7 +3547,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3531,7 +3535,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setSendViewDistance(final int viewDistance) { diff --git a/patches/server/1039-API-for-checking-sent-chunks.patch b/patches/server/1039-API-for-checking-sent-chunks.patch index 4f4d68a8d0..822754301b 100644 --- a/patches/server/1039-API-for-checking-sent-chunks.patch +++ b/patches/server/1039-API-for-checking-sent-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] API for checking sent chunks diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 4fe26b5e492b5cc3ee6b99ec6ade4938acfc9ed8..2c7ec674f55b3178b9dcba7f2bc1ff5efccb50ea 100644 +index 73ee1ba0b70859cc9c012ab32ad04e8ae2a73e30..92fb2f976ae1c36b152733c28f223337e7f8632e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3510,6 +3510,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3498,6 +3498,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end