mirror of
https://github.com/PaperMC/Paper
synced 2026-08-20 18:26:12 -04:00
Always load totalEntityAge (#13918)
This commit is contained in:
parent
782a076f0e
commit
4ba9bed2f6
3 changed files with 15 additions and 19 deletions
|
|
@ -23832,7 +23832,7 @@ index 9d9fa99ff7694a3356421df711c7b1443047b057..c79206e0eb455081f63cf4de2c974136
|
|||
}
|
||||
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index 23e51ce53e9b1b4f52d49749c13ccaae539c4f0e..afe68487585e5fc2766a10bf69e085f51d498990 100644
|
||||
index 196f47bb89a49e4d053cabad62059836823e6c21..82eb863da02d58b7643cd1ebd6b2f642b3474c5d 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -189,7 +189,7 @@ import net.minecraft.world.scores.ScoreboardSaveData;
|
||||
|
|
@ -26975,7 +26975,7 @@ index f11c5ea1ee9381e7bf65305b959bd7da67423ece..26822e1211194b411dd8ea75ce523133
|
|||
List<Entity> passengers = this.entity.getPassengers();
|
||||
if (!passengers.equals(this.lastPassengers)) {
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index ce5bd957dbfe52cd81e571359c6de1028dc11cde..5bb8ddc9490ce6c7bc4544ef0ea05484e67ddbe3 100644
|
||||
index 473feb1aa6ccf0f03ce0bc895de367b3e554e1bc..e5328f08d6a323aa1307ed791a88916b4588939c 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -182,7 +182,7 @@ import net.minecraft.world.waypoints.WaypointTransmitter;
|
||||
|
|
@ -28432,7 +28432,7 @@ index a46b89895a9ce86b6f5fabd373a4e91919d88033..22b10500ef74694243a4fec40822bb54
|
|||
// Paper start - PlayerChunkLoadEvent
|
||||
if (io.papermc.paper.event.packet.PlayerChunkLoadEvent.getHandlerList().getRegisteredListeners().length > 0) {
|
||||
diff --git a/net/minecraft/server/network/config/PrepareSpawnTask.java b/net/minecraft/server/network/config/PrepareSpawnTask.java
|
||||
index af2509ed6ca1b9ed68c67bd682de3823ccb09088..d91d7d438dd79c64827de7cdfbaeb8c8b0896a48 100644
|
||||
index 3271c83bd103bea9b9ffcd6882b52896ea4da770..f6601bc30fa37a309923ea9883b04233f83b2c0b 100644
|
||||
--- a/net/minecraft/server/network/config/PrepareSpawnTask.java
|
||||
+++ b/net/minecraft/server/network/config/PrepareSpawnTask.java
|
||||
@@ -165,7 +165,7 @@ public class PrepareSpawnTask implements ConfigurationTask {
|
||||
|
|
@ -28864,7 +28864,7 @@ index 09b6da207530987b483444cebeadc2f1c9a15247..3666c3efd188508153b6482db425648e
|
|||
+ // Paper end - block counting
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index d8e2adefabb1de2506faa0e6789801b3d1f0203a..0682b5a6d828141f50c62ff5ea56d5bbb25e1004 100644
|
||||
index a9302dcc5614595bffd377eb4f77b7af3798e2ba..00d1ba3e42076f0de52455d66c4e056fdc48cd7a 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -164,7 +164,7 @@ public abstract class Entity
|
||||
|
|
@ -29215,7 +29215,7 @@ index d8e2adefabb1de2506faa0e6789801b3d1f0203a..0682b5a6d828141f50c62ff5ea56d5bb
|
|||
}
|
||||
|
||||
private static float[] collectCandidateStepUpHeights(
|
||||
@@ -2830,17 +2978,106 @@ public abstract class Entity
|
||||
@@ -2826,17 +2974,106 @@ public abstract class Entity
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -29332,7 +29332,7 @@ index d8e2adefabb1de2506faa0e6789801b3d1f0203a..0682b5a6d828141f50c62ff5ea56d5bb
|
|||
}
|
||||
|
||||
public InteractionResult interact(final Player player, final InteractionHand hand, final Vec3 location) {
|
||||
@@ -4447,15 +4684,17 @@ public abstract class Entity
|
||||
@@ -4443,15 +4680,17 @@ public abstract class Entity
|
||||
}
|
||||
|
||||
public Iterable<Entity> getIndirectPassengers() {
|
||||
|
|
@ -29358,7 +29358,7 @@ index d8e2adefabb1de2506faa0e6789801b3d1f0203a..0682b5a6d828141f50c62ff5ea56d5bb
|
|||
}
|
||||
|
||||
public int countPlayerPassengers() {
|
||||
@@ -4766,6 +5005,15 @@ public abstract class Entity
|
||||
@@ -4762,6 +5001,15 @@ public abstract class Entity
|
||||
}
|
||||
|
||||
public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) {
|
||||
|
|
@ -29374,7 +29374,7 @@ index d8e2adefabb1de2506faa0e6789801b3d1f0203a..0682b5a6d828141f50c62ff5ea56d5bb
|
|||
if (!checkPosition(this, x, y, z)) {
|
||||
return;
|
||||
}
|
||||
@@ -4915,6 +5163,12 @@ public abstract class Entity
|
||||
@@ -4911,6 +5159,12 @@ public abstract class Entity
|
||||
|
||||
@Override
|
||||
public final void setRemoved(final Entity.RemovalReason reason, org.bukkit.event.entity.EntityRemoveEvent.@Nullable Cause cause) { // CraftBukkit - add Bukkit remove cause
|
||||
|
|
@ -29387,7 +29387,7 @@ index d8e2adefabb1de2506faa0e6789801b3d1f0203a..0682b5a6d828141f50c62ff5ea56d5bb
|
|||
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityRemoveEvent(this, cause); // CraftBukkit
|
||||
final boolean alreadyRemoved = this.removalReason != null; // Paper - Folia schedulers
|
||||
if (this.removalReason == null) {
|
||||
@@ -4925,7 +5179,7 @@ public abstract class Entity
|
||||
@@ -4921,7 +5175,7 @@ public abstract class Entity
|
||||
this.stopRiding();
|
||||
}
|
||||
|
||||
|
|
@ -29396,7 +29396,7 @@ index d8e2adefabb1de2506faa0e6789801b3d1f0203a..0682b5a6d828141f50c62ff5ea56d5bb
|
|||
this.levelCallback.onRemove(reason);
|
||||
this.onRemoval(reason);
|
||||
// Paper start - Folia schedulers
|
||||
@@ -4959,7 +5213,7 @@ public abstract class Entity
|
||||
@@ -4955,7 +5209,7 @@ public abstract class Entity
|
||||
public boolean shouldBeSaved() {
|
||||
return (this.removalReason == null || this.removalReason.shouldSave())
|
||||
&& !this.isPassenger()
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ index 2bc436cdf5180a7943c45fabb9fbbedae6f7db56..f312a7f5b1b2a777ab36b94ce7cbf387
|
|||
|
||||
@Override
|
||||
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||
index b1f5741d5d714f57795c53605db87d86ebb07051..b71f2e181334ad8646afb48c704c30b6f4a33ffd 100644
|
||||
index 0ea7ca24a557ed1fe8d5b043430d7a89ef80bfa2..3f7ea010df940daba07e4739f3498b379a0a6116 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1760,32 +1760,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
|
@ -66,10 +66,10 @@ index b1f5741d5d714f57795c53605db87d86ebb07051..b71f2e181334ad8646afb48c704c30b6
|
|||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.ADVENTURE_CLICK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.DIALOG_CLICK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index abd46a9bdfa6d387e866e192230aa1f07e5c8936..0fa6006a7c344f9f12972008e586b4c1f03c470e 100644
|
||||
index 700b5740229b5a97b8755c7d4205e8a99f229f9e..56dc9019708d74f92d43d8a9ed37fba7d82b1877 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -5230,6 +5230,11 @@ public abstract class Entity
|
||||
@@ -5226,6 +5226,11 @@ public abstract class Entity
|
||||
this.getBukkitEntity().taskScheduler.retire();
|
||||
}
|
||||
// Paper end - Folia schedulers
|
||||
|
|
|
|||
|
|
@ -853,16 +853,12 @@
|
|||
this.customData = input.read("data", CustomData.CODEC).orElse(CustomData.EMPTY);
|
||||
this.tags.clear();
|
||||
input.read("Tags", TAG_LIST_CODEC).ifPresent(this.tags::addAll);
|
||||
@@ -2194,6 +_,58 @@
|
||||
@@ -2194,6 +_,54 @@
|
||||
} else {
|
||||
throw new IllegalStateException("Entity has invalid rotation");
|
||||
}
|
||||
+ // CraftBukkit start
|
||||
+ // Spigot start
|
||||
+ if (this instanceof net.minecraft.world.entity.LivingEntity) {
|
||||
+ this.totalEntityAge = input.getIntOr("Spigot.ticksLived", 0); // Paper
|
||||
+ }
|
||||
+ // Spigot end
|
||||
+ this.totalEntityAge = input.getIntOr("Spigot.ticksLived", 0); // Paper
|
||||
+ this.persist = input.getBooleanOr("Bukkit.persist", true);
|
||||
+ this.visibleByDefault = input.getBooleanOr("Bukkit.visibleByDefault", true);
|
||||
+ // SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue