From 017297cdbabe9df5a5ad3affdac84580f993ba66 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 2 Apr 2020 00:43:11 -0400 Subject: [PATCH] Improve entity.getCurrentChunk() and use it for entity.isChunkLoaded() --- ...to-current-Chunk-for-Entity-and-Bloc.patch | 35 +++++++++++++------ ...ck-and-tnt-entities-at-the-specified.patch | 8 ++--- .../0025-Entity-Origin-API.patch | 8 ++--- ...dd-configurable-portal-search-radius.patch | 8 ++--- ...oreboards-for-non-players-by-default.patch | 8 ++--- ...3-Optional-TNT-doesn-t-move-in-water.patch | 8 ++--- ...llow-entities-to-ride-themselves-572.patch | 8 ++--- ...-more-information-to-Entity.toString.patch | 6 ++-- .../0292-Improve-death-events.patch | 24 ++++++------- ...21-Reset-players-airTicks-on-respawn.patch | 8 ++--- ...entity-dismount-during-teleportation.patch | 18 +++++----- ...354-Add-LivingEntity-getTargetEntity.patch | 14 ++++---- .../0372-Duplicate-UUID-Resolve-Option.patch | 6 ++-- ...etChunkIfLoadedImmediately-in-places.patch | 21 +++-------- ...x-items-vanishing-through-end-portal.patch | 6 ++-- ...low-bees-to-load-chunks-for-beehives.patch | 4 +-- 16 files changed, 95 insertions(+), 95 deletions(-) diff --git a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch index 14cc10b320..97fd43a57b 100644 --- a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch +++ b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch @@ -1,4 +1,4 @@ -From dae2dd0f30fa7917420fe3ee0d590b1ce1efc551 Mon Sep 17 00:00:00 2001 +From 883a5600646deb5a98c33313a92d02625f07d30c Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 02:10:36 -0400 Subject: [PATCH] Store reference to current Chunk for Entity and Block @@ -89,7 +89,7 @@ index af10c18d44..02b142fe8b 100644 } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 7899fd6d88..d2cfc65513 100644 +index 7899fd6d88..2890e8121d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -134,7 +134,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -101,7 +101,16 @@ index 7899fd6d88..d2cfc65513 100644 public int chunkX; public int getChunkX() { return chunkX; } // Paper - OBFHELPER public int chunkY; public int getChunkY() { return chunkY; } // Paper - OBFHELPER public int chunkZ; public int getChunkZ() { return chunkZ; } // Paper - OBFHELPER -@@ -1708,6 +1708,39 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -178,7 +178,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public boolean isChunkLoaded() { +- return world.isChunkLoaded((int) Math.floor(this.locX) >> 4, (int) Math.floor(this.locZ) >> 4); ++ return getCurrentChunk() != null; + } + // CraftBukkit end + +@@ -1708,6 +1708,43 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // Paper start @@ -115,23 +124,27 @@ index 7899fd6d88..d2cfc65513 100644 + */ + public Chunk getCurrentChunk() { + final Chunk chunk = currentChunk != null ? currentChunk.get() : null; -+ return chunk != null && chunk.isLoaded() ? chunk : (isAddedToChunk() ? world.getChunkIfLoaded(getChunkX(), getChunkZ()) : null); ++ if (chunk != null && chunk.isLoaded()) { ++ return chunk; ++ } ++ ++ return !isAddedToChunk() ? null : ((ChunkProviderServer) world.chunkProvider).getChunkAtIfLoadedMainThreadNoCache(getChunkX(), getChunkZ()); + } ++ + /** + * Returns the chunk at the location, using the entities local cache if avail + * Will only return null if the location specified is not loaded + */ + public Chunk getCurrentChunkAt(int x, int z) { -+ if (getChunkX() == x && getChunkZ() == z) { -+ Chunk chunk = getCurrentChunk(); -+ if (chunk != null) { -+ return chunk; -+ } ++ Chunk chunk = getCurrentChunk(); ++ if (chunk != null && getChunkX() == chunk.getPos().x && getChunkZ() == chunk.getPos().z) { ++ return chunk; + } -+ return world.getChunkIfLoaded(x, z); ++ return ((ChunkProviderServer) world.chunkProvider).getChunkAtIfLoadedMainThreadNoCache(getChunkX(), getChunkZ()); + } + /** + * Returns the chunk at the entities current location, using the entities local cache if avail ++ * Ideally this is always the same as getCurrentChunk, but only becomes different in registration issues. + * Will only return null if the location specified is not loaded + */ + public Chunk getChunkAtLocation() { @@ -187,5 +200,5 @@ index 63ecbcd47a..c82c213260 100644 /** * Order is *EXTREMELY* important -- keep it right! =D -- -2.25.0 +2.25.1 diff --git a/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch b/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch index 55fae60e8a..2cc674a809 100644 --- a/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -1,4 +1,4 @@ -From 29bf2090d4841235a60c315f94a35c3fe2172998 Mon Sep 17 00:00:00 2001 +From 0b5aede220e3c3085be9adb8ea747714ea5bbbcd Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 1 Mar 2016 14:14:15 -0600 Subject: [PATCH] Drop falling block and tnt entities at the specified height @@ -24,10 +24,10 @@ index 8ee2b9bb1b..d59b82b7bb 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b109f5ae2c..b8792bb6f1 100644 +index 957330b673..7d4badd974 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1814,6 +1814,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1818,6 +1818,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.a(itemstack, 0.0F); } @@ -86,5 +86,5 @@ index 1094190fd9..35dbed40df 100644 Validate.isTrue(newValue >= 0, "Value must be greater than or equal to 0"); Validate.isTrue(statistic.getType() == Type.ENTITY, "This statistic does not take an EntityType parameter"); -- -2.25.0 +2.25.1 diff --git a/Spigot-Server-Patches/0025-Entity-Origin-API.patch b/Spigot-Server-Patches/0025-Entity-Origin-API.patch index e409b7433b..134283f3e3 100644 --- a/Spigot-Server-Patches/0025-Entity-Origin-API.patch +++ b/Spigot-Server-Patches/0025-Entity-Origin-API.patch @@ -1,11 +1,11 @@ -From eb19fb35a1fda6531c127beafb36cb5098174202 Mon Sep 17 00:00:00 2001 +From 3e658fa51f422bcca75d0aef058fc6c3e96899a3 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 1 Mar 2016 23:45:08 -0600 Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b8792bb6f1..1b2edca722 100644 +index 7d4badd974..18236504e4 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -167,6 +167,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -42,7 +42,7 @@ index b8792bb6f1..1b2edca722 100644 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded"); -@@ -1771,6 +1784,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1775,6 +1788,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke protected abstract void b(NBTTagCompound nbttagcompound); @@ -134,5 +134,5 @@ index c82c213260..a296936748 100644 + // Paper end } -- -2.25.2 +2.25.1 diff --git a/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch b/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch index 921494a597..3f994dbb31 100644 --- a/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch +++ b/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch @@ -1,4 +1,4 @@ -From 686cdb916272e2534b102708935d7e1e4133b89d Mon Sep 17 00:00:00 2001 +From b113387904be5b1c2908e34c86851c78f00d5caa Mon Sep 17 00:00:00 2001 From: Joseph Hirschfeld Date: Thu, 3 Mar 2016 02:46:17 -0600 Subject: [PATCH] Add configurable portal search radius @@ -21,10 +21,10 @@ index 62e793b71b..cd47a4ca06 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 251087ec20..514315604e 100644 +index 826202f437..fd708f2f6c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2574,7 +2574,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2578,7 +2578,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke blockposition = new BlockPosition(d0, this.locY(), d1); // CraftBukkit start @@ -71,5 +71,5 @@ index 19c54f1dde..f84dd6d9be 100644 return villageplacetype == VillagePlaceType.u; }, blockposition, searchRadius, VillagePlace.Occupancy.ANY).collect(Collectors.toList()); // CraftBukkit - searchRadius -- -2.25.0 +2.25.1 diff --git a/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch b/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch index 39a17e2814..4c7accda24 100644 --- a/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch +++ b/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch @@ -1,4 +1,4 @@ -From 6d41fcca29dcbe9747892fe9fe63f149cf38a238 Mon Sep 17 00:00:00 2001 +From 5a208c0c6591b2176760aede2ac3c3a22b0f1276 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 8 Mar 2016 23:25:45 -0500 Subject: [PATCH] Disable Scoreboards for non players by default @@ -25,10 +25,10 @@ index abbf59bb91..04430aae52 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 514315604e..d95d9c7203 100644 +index fd708f2f6c..46c227b7f0 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2265,6 +2265,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2269,6 +2269,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @Nullable public ScoreboardTeamBase getScoreboardTeam() { @@ -49,5 +49,5 @@ index 9bd6737007..cd9c49747d 100644 if (!flag) { -- -2.25.0 +2.25.1 diff --git a/Spigot-Server-Patches/0103-Optional-TNT-doesn-t-move-in-water.patch b/Spigot-Server-Patches/0103-Optional-TNT-doesn-t-move-in-water.patch index 538a069064..fa6e960738 100644 --- a/Spigot-Server-Patches/0103-Optional-TNT-doesn-t-move-in-water.patch +++ b/Spigot-Server-Patches/0103-Optional-TNT-doesn-t-move-in-water.patch @@ -1,4 +1,4 @@ -From 857bcd25e8fefef7ed6d333e6150bdaa47c6b2e9 Mon Sep 17 00:00:00 2001 +From 93f7f9414406e2d8224158f030941cf06e413433 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 22 May 2016 20:20:55 -0500 Subject: [PATCH] Optional TNT doesn't move in water @@ -32,10 +32,10 @@ index 6db1312035..8cf3076f4e 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index fffb3c0bba..5bbd2c98a5 100644 +index 4fd0e54de7..7e552f985a 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2713,6 +2713,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2717,6 +2717,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public boolean bM() { @@ -107,5 +107,5 @@ index a13fd9b340..3ff7a7b4a8 100644 private java.util.Map trackedPlayerMap = null; -- -2.25.0 +2.25.1 diff --git a/Spigot-Server-Patches/0140-Don-t-allow-entities-to-ride-themselves-572.patch b/Spigot-Server-Patches/0140-Don-t-allow-entities-to-ride-themselves-572.patch index ca6c405100..56e54fa3a0 100644 --- a/Spigot-Server-Patches/0140-Don-t-allow-entities-to-ride-themselves-572.patch +++ b/Spigot-Server-Patches/0140-Don-t-allow-entities-to-ride-themselves-572.patch @@ -1,14 +1,14 @@ -From 47db2f72df0c321d5a3fba2afb32d74739421a1e Mon Sep 17 00:00:00 2001 +From 7b05afa5b801b6e5a69ac0017d8c829f3e2c27ae Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Sun, 8 Jan 2017 04:31:36 +0000 Subject: [PATCH] Don't allow entities to ride themselves - #572 diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index cfa7bc59f2..59cf0d1017 100644 +index 2ab877c87b..1c8958d15d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2025,6 +2025,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2029,6 +2029,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } protected boolean addPassenger(Entity entity) { // CraftBukkit @@ -17,5 +17,5 @@ index cfa7bc59f2..59cf0d1017 100644 throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)"); } else { -- -2.25.0 +2.25.1 diff --git a/Spigot-Server-Patches/0249-add-more-information-to-Entity.toString.patch b/Spigot-Server-Patches/0249-add-more-information-to-Entity.toString.patch index cc8372bc07..6e6246a1a1 100644 --- a/Spigot-Server-Patches/0249-add-more-information-to-Entity.toString.patch +++ b/Spigot-Server-Patches/0249-add-more-information-to-Entity.toString.patch @@ -1,4 +1,4 @@ -From 82dec6a475fc31b39a9a1934131e02c1dde08dfa Mon Sep 17 00:00:00 2001 +From 57d3e523f39ce4e5e2481c56340dcb707c4b23fe Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 19 Jul 2018 01:13:28 -0400 Subject: [PATCH] add more information to Entity.toString() @@ -6,10 +6,10 @@ Subject: [PATCH] add more information to Entity.toString() UUID, ticks lived, valid, dead diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 64dc37c70..ec59ffc2e 100644 +index 1de1a10cf0..dce1e2af62 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2499,7 +2499,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2503,7 +2503,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public String toString() { diff --git a/Spigot-Server-Patches/0292-Improve-death-events.patch b/Spigot-Server-Patches/0292-Improve-death-events.patch index 82457407de..789baae3b4 100644 --- a/Spigot-Server-Patches/0292-Improve-death-events.patch +++ b/Spigot-Server-Patches/0292-Improve-death-events.patch @@ -1,4 +1,4 @@ -From 0926eb667c99b565347b26b71f797d2b2eadeadc Mon Sep 17 00:00:00 2001 +From 622f34981a35d0d5b89d14afd0289cc6e50ecb00 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Tue, 21 Aug 2018 01:39:35 +0100 Subject: [PATCH] Improve death events @@ -15,7 +15,7 @@ items and experience which is otherwise only properly possible by using internal code. diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java -index 6daa400d2..38fe29f8a 100644 +index 6daa400d27..38fe29f8a2 100644 --- a/src/main/java/net/minecraft/server/CombatTracker.java +++ b/src/main/java/net/minecraft/server/CombatTracker.java @@ -175,6 +175,7 @@ public class CombatTracker { @@ -27,7 +27,7 @@ index 6daa400d2..38fe29f8a 100644 int i = this.f ? 300 : 100; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 02aa493f1..e8b70a5ca 100644 +index f54fc61aa5..fd78f647eb 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1503,6 +1503,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -38,7 +38,7 @@ index 02aa493f1..e8b70a5ca 100644 public void a(Entity entity, int i, DamageSource damagesource) { if (entity instanceof EntityPlayer) { CriterionTriggers.c.a((EntityPlayer) entity, this, damagesource); -@@ -2413,6 +2414,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2417,6 +2418,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.fallDistance = 0.0F; } @@ -47,7 +47,7 @@ index 02aa493f1..e8b70a5ca 100644 protected void k(double d0, double d1, double d2) { diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 42b9a339e..8ad131e4f 100644 +index 42b9a339e9..8ad131e4fc 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -701,7 +701,8 @@ public class EntityArmorStand extends EntityLiving { @@ -61,7 +61,7 @@ index 42b9a339e..8ad131e4f 100644 } diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java -index 2be6c7bde..82a32d5db 100644 +index 2be6c7bde9..82a32d5dbf 100644 --- a/src/main/java/net/minecraft/server/EntityFox.java +++ b/src/main/java/net/minecraft/server/EntityFox.java @@ -571,15 +571,25 @@ public class EntityFox extends EntityAnimal { @@ -94,7 +94,7 @@ index 2be6c7bde..82a32d5db 100644 public static boolean a(EntityFox entityfox, EntityLiving entityliving) { diff --git a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java -index 80717ad9a..53aac5bcc 100644 +index 80717ad9ac..53aac5bccd 100644 --- a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java +++ b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java @@ -55,11 +55,19 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract { @@ -119,7 +119,7 @@ index 80717ad9a..53aac5bcc 100644 public void b(NBTTagCompound nbttagcompound) { super.b(nbttagcompound); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index fa097e055..eed3e7c58 100644 +index fa097e0551..eed3e7c58e 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -89,7 +89,7 @@ public abstract class EntityLiving extends Entity { @@ -279,7 +279,7 @@ index fa097e055..eed3e7c58 100644 return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index f849dba21..4b40ffa97 100644 +index f849dba215..4b40ffa978 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -76,6 +76,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -330,7 +330,7 @@ index f849dba21..4b40ffa97 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java -index 90fdf89c8..b761a41dc 100644 +index 90fdf89c81..b761a41dcd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java @@ -821,6 +821,22 @@ public enum CraftSound { @@ -357,7 +357,7 @@ index 90fdf89c8..b761a41dc 100644 this.minecraftKey = minecraftKey; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d584c76ec..878287cf0 100644 +index d584c76ecd..878287cf0d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1733,7 +1733,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -378,7 +378,7 @@ index d584c76ec..878287cf0 100644 public void injectScaledMaxHealth(Collection collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index f006b441a..39ce40bd5 100644 +index f006b441ad..39ce40bd58 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -749,9 +749,16 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/0321-Reset-players-airTicks-on-respawn.patch b/Spigot-Server-Patches/0321-Reset-players-airTicks-on-respawn.patch index c1c7708ead..d3a6296546 100644 --- a/Spigot-Server-Patches/0321-Reset-players-airTicks-on-respawn.patch +++ b/Spigot-Server-Patches/0321-Reset-players-airTicks-on-respawn.patch @@ -1,14 +1,14 @@ -From 7b22e6668240d850db0689d1e7f525260f776d80 Mon Sep 17 00:00:00 2001 +From 814b9be864728d180bfab9b681c5695eeb1c9dd8 Mon Sep 17 00:00:00 2001 From: GreenMeanie Date: Sat, 20 Oct 2018 22:34:02 -0400 Subject: [PATCH] Reset players airTicks on respawn diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 9a2338060..ecd038762 100644 +index 1e3e541c8b..641492c7ca 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2326,6 +2326,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2330,6 +2330,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } @@ -17,7 +17,7 @@ index 9a2338060..ecd038762 100644 return 300; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index bf21fb69a..e91938b54 100644 +index bf21fb69a5..e91938b54c 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1867,6 +1867,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/Spigot-Server-Patches/0330-force-entity-dismount-during-teleportation.patch b/Spigot-Server-Patches/0330-force-entity-dismount-during-teleportation.patch index b980f3d5a2..1e90b416e1 100644 --- a/Spigot-Server-Patches/0330-force-entity-dismount-during-teleportation.patch +++ b/Spigot-Server-Patches/0330-force-entity-dismount-during-teleportation.patch @@ -1,4 +1,4 @@ -From 663b60042f1326b9b598dc64ba18123066086c8a Mon Sep 17 00:00:00 2001 +From 1bef7be72cadbd264426f8d9da06bbe630741efb Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 15 Nov 2018 13:38:37 +0000 Subject: [PATCH] force entity dismount during teleportation @@ -20,10 +20,10 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index ecd038762..f900c1a2a 100644 +index 641492c7ca..ffeee60a86 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2027,12 +2027,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2031,12 +2031,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } @@ -41,7 +41,7 @@ index ecd038762..f900c1a2a 100644 } } -@@ -2083,7 +2086,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2087,7 +2090,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return true; // CraftBukkit } @@ -53,7 +53,7 @@ index ecd038762..f900c1a2a 100644 if (entity.getVehicle() == this) { throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); } else { -@@ -2093,7 +2099,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2097,7 +2103,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { VehicleExitEvent event = new VehicleExitEvent( (Vehicle) getBukkitEntity(), @@ -62,7 +62,7 @@ index ecd038762..f900c1a2a 100644 ); Bukkit.getPluginManager().callEvent(event); CraftEntity craftn = (CraftEntity) entity.getBukkitEntity().getVehicle(); -@@ -2104,7 +2110,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2108,7 +2114,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // CraftBukkit end // Spigot start @@ -72,7 +72,7 @@ index ecd038762..f900c1a2a 100644 if (event.isCancelled()) { return false; diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 308ac18f7..584166f22 100644 +index 308ac18f7e..584166f225 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -968,9 +968,11 @@ public abstract class EntityHuman extends EntityLiving { @@ -91,7 +91,7 @@ index 308ac18f7..584166f22 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index eed3e7c58..4e64a80a8 100644 +index eed3e7c58e..4e64a80a8a 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -2735,11 +2735,13 @@ public abstract class EntityLiving extends Entity { @@ -112,7 +112,7 @@ index eed3e7c58..4e64a80a8 100644 this.a(entity); } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index e91938b54..35ea47601 100644 +index e91938b54c..35ea476014 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1021,11 +1021,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/Spigot-Server-Patches/0354-Add-LivingEntity-getTargetEntity.patch b/Spigot-Server-Patches/0354-Add-LivingEntity-getTargetEntity.patch index 76461850f1..9a6e38b0af 100644 --- a/Spigot-Server-Patches/0354-Add-LivingEntity-getTargetEntity.patch +++ b/Spigot-Server-Patches/0354-Add-LivingEntity-getTargetEntity.patch @@ -1,11 +1,11 @@ -From 2b4e9b58255aad87d79212eda12aa1087efcf570 Mon Sep 17 00:00:00 2001 +From 939338ec61ac52ca1724350d9cc7b59a1b3cbd84 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 22 Sep 2018 00:33:08 -0500 Subject: [PATCH] Add LivingEntity#getTargetEntity diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java -index 4f60b931a..c950139c0 100644 +index 4f60b931a1..c950139c0f 100644 --- a/src/main/java/net/minecraft/server/AxisAlignedBB.java +++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java @@ -108,6 +108,7 @@ public class AxisAlignedBB { @@ -46,7 +46,7 @@ index 4f60b931a..c950139c0 100644 double[] adouble = new double[]{1.0D}; double d0 = vec3d1.x - vec3d.x; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index f900c1a2a..5b7cdd66e 100644 +index ffeee60a86..69bc9dae0d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1475,6 +1475,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -57,7 +57,7 @@ index f900c1a2a..5b7cdd66e 100644 public final Vec3D j(float f) { if (f == 1.0F) { return new Vec3D(this.locX(), this.getHeadY(), this.locZ()); -@@ -2126,6 +2127,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2130,6 +2131,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.getPassengers().size() < 1; } @@ -66,7 +66,7 @@ index f900c1a2a..5b7cdd66e 100644 return 0.0F; } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 4e64a80a8..af79b6e37 100644 +index 4e64a80a8a..af79b6e378 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -3307,6 +3307,37 @@ public abstract class EntityLiving extends Entity { @@ -108,7 +108,7 @@ index 4e64a80a8..af79b6e37 100644 public int getShieldBlockingDelay() { diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index c1f462d9d..498f38109 100644 +index c1f462d9d3..498f381099 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -18,6 +18,7 @@ public final class IEntitySelector { @@ -120,7 +120,7 @@ index c1f462d9d..498f38109 100644 return !entity.isSpectator(); }; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index d197094f5..6de01e4f0 100644 +index d197094f54..6de01e4f0e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -216,6 +216,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/Spigot-Server-Patches/0372-Duplicate-UUID-Resolve-Option.patch b/Spigot-Server-Patches/0372-Duplicate-UUID-Resolve-Option.patch index 7097fd3e1d..7eeb6009e2 100644 --- a/Spigot-Server-Patches/0372-Duplicate-UUID-Resolve-Option.patch +++ b/Spigot-Server-Patches/0372-Duplicate-UUID-Resolve-Option.patch @@ -1,4 +1,4 @@ -From 5c5e8a509be83b9cfa96f7bf7c17729a34ae2093 Mon Sep 17 00:00:00 2001 +From eb61a8fb753ca85c13d9082018a8581b00bcbc2f Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 21 Jul 2018 14:27:34 -0400 Subject: [PATCH] Duplicate UUID Resolve Option @@ -93,10 +93,10 @@ index c464d69623..3882e5b2a6 100644 int k = MathHelper.floor(entity.locY() / 16.0D); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b45afbcde2..4021bb5b88 100644 +index 1a20f105b5..d522d7238d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2743,6 +2743,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2747,6 +2747,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke }); } diff --git a/Spigot-Server-Patches/0393-Use-getChunkIfLoadedImmediately-in-places.patch b/Spigot-Server-Patches/0393-Use-getChunkIfLoadedImmediately-in-places.patch index 7c01c1bfba..dc18f41900 100644 --- a/Spigot-Server-Patches/0393-Use-getChunkIfLoadedImmediately-in-places.patch +++ b/Spigot-Server-Patches/0393-Use-getChunkIfLoadedImmediately-in-places.patch @@ -1,4 +1,4 @@ -From e853c9a81e2edbb4750c52f7121b71fa7d1d1862 Mon Sep 17 00:00:00 2001 +From 29199995fd17dcc6ce4757218ccbf95ad9f0478d Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Mon, 8 Jul 2019 00:13:36 -0700 Subject: [PATCH] Use getChunkIfLoadedImmediately in places @@ -7,21 +7,8 @@ This prevents us from hitting chunk loads for chunks at or less-than ticket level 33 (yes getChunkIfLoaded will actually perform a chunk load in that case). -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4021bb5b8..2c8603e2f 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -203,7 +203,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - } - - public boolean isChunkLoaded() { -- return world.isChunkLoaded((int) Math.floor(this.locX) >> 4, (int) Math.floor(this.locZ) >> 4); -+ return world.getChunkIfLoadedImmediately((int) Math.floor(this.locX) >> 4, (int) Math.floor(this.locZ) >> 4) != null; // Paper - } - // CraftBukkit end - diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 691331217..f88bcb29d 100644 +index 691331217b..f88bcb29db 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -989,7 +989,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -34,7 +21,7 @@ index 691331217..f88bcb29d 100644 return; } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 75829b4de..61829b3bf 100644 +index 75829b4de5..61829b3bf9 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -116,8 +116,16 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -73,7 +60,7 @@ index 75829b4de..61829b3bf 100644 return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).a((IBlockAccess) this, blockposition, entity); } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index f86404f83..92601c581 100644 +index f86404f83a..92601c581c 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -143,9 +143,10 @@ public class ActivationRange diff --git a/Spigot-Server-Patches/0430-Fix-items-vanishing-through-end-portal.patch b/Spigot-Server-Patches/0430-Fix-items-vanishing-through-end-portal.patch index 7dbf41f27b..664269e9c1 100644 --- a/Spigot-Server-Patches/0430-Fix-items-vanishing-through-end-portal.patch +++ b/Spigot-Server-Patches/0430-Fix-items-vanishing-through-end-portal.patch @@ -1,4 +1,4 @@ -From 1a7d91f6e4660e9769d17df8db4da4c6652318e0 Mon Sep 17 00:00:00 2001 +From 8a8e8f20be1b35c67eba16a82ea42c05c450ac4e Mon Sep 17 00:00:00 2001 From: AJMFactsheets Date: Wed, 22 Jan 2020 19:52:28 -0600 Subject: [PATCH] Fix items vanishing through end portal @@ -13,10 +13,10 @@ Quickly loading the exact world spawn chunk before searching the heightmap resolves the issue without having to load all spawn chunks. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index e10740a65c..c4e85b86d9 100644 +index 2648acb8bf..d8b9dbf24e 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2600,6 +2600,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2604,6 +2604,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (blockposition == null) { // CraftBukkit if (dimensionmanager1.getType() == DimensionManager.THE_END && dimensionmanager == DimensionManager.OVERWORLD) { // CraftBukkit diff --git a/Spigot-Server-Patches/0455-Do-not-allow-bees-to-load-chunks-for-beehives.patch b/Spigot-Server-Patches/0455-Do-not-allow-bees-to-load-chunks-for-beehives.patch index 7e1dbd071b..30539b90df 100644 --- a/Spigot-Server-Patches/0455-Do-not-allow-bees-to-load-chunks-for-beehives.patch +++ b/Spigot-Server-Patches/0455-Do-not-allow-bees-to-load-chunks-for-beehives.patch @@ -1,5 +1,5 @@ -From 880f989fa0cdb7071024ab894fe6964ac5ce5a6a Mon Sep 17 00:00:00 2001 -From: chickeneer +From c7e8b30ec94f125f4b652d386717063c3d99e6bd Mon Sep 17 00:00:00 2001 +From: chickeneer Date: Tue, 17 Mar 2020 14:18:50 -0500 Subject: [PATCH] Do not allow bees to load chunks for beehives