mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
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:
parent
b21c0686c0
commit
360006bc7f
1 changed files with 31 additions and 14 deletions
|
@ -464,35 +464,52 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetEmptyTime() {
|
public void resetEmptyTime() {
|
||||||
@@ -747,12 +_,20 @@
|
@@ -752,15 +_,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();
|
|
||||||
entity.tickCount++;
|
entity.tickCount++;
|
||||||
profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString());
|
profilerFiller.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(entity.getType()).toString());
|
||||||
profilerFiller.incrementCounter("tickNonPassenger");
|
profilerFiller.incrementCounter("tickNonPassenger");
|
||||||
|
+ // Spigot start
|
||||||
|
+ final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity); // Paper - EAR 2
|
||||||
|
+ if (isActive) {
|
||||||
entity.tick();
|
entity.tick();
|
||||||
+ entity.postTick(); // CraftBukkit
|
+ entity.postTick(); // CraftBukkit
|
||||||
|
+ } else {entity.inactiveTick();} // Spigot end
|
||||||
profilerFiller.pop();
|
profilerFiller.pop();
|
||||||
|
|
||||||
for (Entity entity1 : entity.getPassengers()) {
|
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.push(() -> BuiltInRegistries.ENTITY_TYPE.getKey(passengerEntity.getType()).toString());
|
||||||
profilerFiller.incrementCounter("tickPassenger");
|
profilerFiller.incrementCounter("tickPassenger");
|
||||||
|
+ // Paper start - EAR 2
|
||||||
|
+ if (isActive) {
|
||||||
passengerEntity.rideTick();
|
passengerEntity.rideTick();
|
||||||
+ passengerEntity.postTick(); // CraftBukkit
|
+ 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();
|
profilerFiller.pop();
|
||||||
|
|
||||||
for (Entity entity : passengerEntity.getPassengers()) {
|
for (Entity entity : passengerEntity.getPassengers()) {
|
||||||
|
- this.tickPassenger(passengerEntity, entity);
|
||||||
|
+ this.tickPassenger(passengerEntity, entity, isActive); // Paper - EAR 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -786,6 +_,7 @@
|
@@ -786,6 +_,7 @@
|
||||||
public void save(@Nullable ProgressListener progress, boolean flush, boolean skipSave) {
|
public void save(@Nullable ProgressListener progress, boolean flush, boolean skipSave) {
|
||||||
ServerChunkCache chunkSource = this.getChunkSource();
|
ServerChunkCache chunkSource = this.getChunkSource();
|
||||||
|
|
Loading…
Reference in a new issue