From 360006bc7f2b893a4371f0cc0b57fca770ff344d Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Sun, 15 Dec 2024 22:27:32 -0500 Subject: [PATCH] Fix bouncy items This reverts EAR diff to be how it is paper proper-- seems like alot of this got dropped. --- .../server/level/ServerLevel.java.patch | 45 +++++++++++++------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/server/level/ServerLevel.java.patch b/paper-server/patches/sources/net/minecraft/server/level/ServerLevel.java.patch index 181ca0c6e9..30adc7ef05 100644 --- a/paper-server/patches/sources/net/minecraft/server/level/ServerLevel.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/level/ServerLevel.java.patch @@ -464,35 +464,52 @@ } public void resetEmptyTime() { -@@ -747,12 +_,20 @@ - } - - public void tickNonPassenger(Entity entity) { -+ // Spigot start -+ if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { -+ entity.tickCount++; -+ entity.inactiveTick(); -+ return; -+ } -+ // Spigot end - entity.setOldPosAndRot(); - ProfilerFiller profilerFiller = Profiler.get(); +@@ -752,15 +_,20 @@ entity.tickCount++; profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString()); profilerFiller.incrementCounter("tickNonPassenger"); ++ // Spigot start ++ final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity); // Paper - EAR 2 ++ if (isActive) { entity.tick(); + entity.postTick(); // CraftBukkit ++ } else {entity.inactiveTick();} // Spigot end profilerFiller.pop(); for (Entity entity1 : entity.getPassengers()) { -@@ -770,6 +_,7 @@ +- this.tickPassenger(entity, entity1); ++ this.tickPassenger(entity, entity1, isActive); // Paper - EAR 2 + } + } + +- private void tickPassenger(Entity ridingEntity, Entity passengerEntity) { ++ private void tickPassenger(Entity ridingEntity, Entity passengerEntity, boolean isActive) { // Paper - EAR 2 + if (passengerEntity.isRemoved() || passengerEntity.getVehicle() != ridingEntity) { + passengerEntity.stopRiding(); + } else if (passengerEntity instanceof Player || this.entityTickList.contains(passengerEntity)) { +@@ -769,11 +_,21 @@ + ProfilerFiller profilerFiller = Profiler.get(); profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(passengerEntity.getType()).toString()); profilerFiller.incrementCounter("tickPassenger"); ++ // Paper start - EAR 2 ++ if (isActive) { passengerEntity.rideTick(); + passengerEntity.postTick(); // CraftBukkit ++ } else { ++ passengerEntity.setDeltaMovement(Vec3.ZERO); ++ passengerEntity.inactiveTick(); ++ // copied from inside of if (isPassenger()) of passengerTick, but that ifPassenger is unnecessary ++ ridingEntity.positionRider(passengerEntity); ++ // Paper end - EAR 2 ++ } profilerFiller.pop(); for (Entity entity : passengerEntity.getPassengers()) { +- this.tickPassenger(passengerEntity, entity); ++ this.tickPassenger(passengerEntity, entity, isActive); // Paper - EAR 2 + } + } + } @@ -786,6 +_,7 @@ public void save(@Nullable ProgressListener progress, boolean flush, boolean skipSave) { ServerChunkCache chunkSource = this.getChunkSource();