Fix bouncy items

This reverts EAR diff to be how it is paper proper-- seems like alot of this got dropped.
This commit is contained in:
Owen1212055 2024-12-15 22:27:32 -05:00
parent b21c0686c0
commit 360006bc7f
No known key found for this signature in database
GPG Key ID: 2133292072886A30

View File

@ -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();