Backport fix for MC-296337 (Fixes #12617) (#12619)

This commit is contained in:
Shane Freeder
2025-06-06 19:05:30 +01:00
committed by GitHub
parent 2ba1675c75
commit 4eda045b15
4 changed files with 31 additions and 19 deletions

View File

@@ -28601,7 +28601,7 @@ index 8cc5c0716392ba06501542ff5cbe71ee43979e5d..09fd99c9cbd23b5f3c899bfb00c9b896
+ // Paper end - block counting
}
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 663fb13233afb51f935c30ac2acae808809754c6..81a18b8e605bd4c28b48a32c80be231609182970 100644
index bcac0c25acb8c5176c2ca6bffbae118d83fb63f7..4057431072cd1ca159b25576969908ed30ad0868 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -140,7 +140,7 @@ import net.minecraft.world.scores.ScoreHolder;
@@ -28695,8 +28695,8 @@ index 663fb13233afb51f935c30ac2acae808809754c6..81a18b8e605bd4c28b48a32c80be2316
}
// Paper end - Share random for entities to make them more random
public @Nullable org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason; // Paper - Entity#getEntitySpawnReason
@@ -405,6 +361,156 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return this.dimensions.makeBoundingBox(x, y, z);
@@ -409,6 +365,156 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.movementThisTick.clear();
}
// Paper end
+ // Paper start - rewrite chunk system
@@ -28852,7 +28852,7 @@ index 663fb13233afb51f935c30ac2acae808809754c6..81a18b8e605bd4c28b48a32c80be2316
public Entity(EntityType<?> entityType, Level level) {
this.type = entityType;
@@ -1345,35 +1451,77 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -1349,35 +1455,77 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return distance;
}
@@ -28954,7 +28954,7 @@ index 663fb13233afb51f935c30ac2acae808809754c6..81a18b8e605bd4c28b48a32c80be2316
}
private static float[] collectCandidateStepUpHeights(AABB box, List<VoxelShape> colliders, float deltaY, float maxUpStep) {
@@ -2616,21 +2764,110 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -2620,21 +2768,110 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public boolean isInWall() {
@@ -29076,7 +29076,7 @@ index 663fb13233afb51f935c30ac2acae808809754c6..81a18b8e605bd4c28b48a32c80be2316
}
public InteractionResult interact(Player player, InteractionHand hand) {
@@ -4078,15 +4315,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4082,15 +4319,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public Iterable<Entity> getIndirectPassengers() {
@@ -29102,7 +29102,7 @@ index 663fb13233afb51f935c30ac2acae808809754c6..81a18b8e605bd4c28b48a32c80be2316
}
public int countPlayerPassengers() {
@@ -4229,77 +4468,136 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4233,77 +4472,136 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return Mth.lerp(partialTick, this.yRotO, this.yRot);
}
@@ -29293,7 +29293,7 @@ index 663fb13233afb51f935c30ac2acae808809754c6..81a18b8e605bd4c28b48a32c80be2316
public boolean touchingUnloadedChunk() {
AABB aabb = this.getBoundingBox().inflate(1.0);
@@ -4454,6 +4752,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4458,6 +4756,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) {
@@ -29309,7 +29309,7 @@ index 663fb13233afb51f935c30ac2acae808809754c6..81a18b8e605bd4c28b48a32c80be2316
if (!checkPosition(this, x, y, z)) {
return;
}
@@ -4587,6 +4894,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4591,6 +4898,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@Override
public final void setRemoved(Entity.RemovalReason removalReason, @Nullable org.bukkit.event.entity.EntityRemoveEvent.Cause cause) { // CraftBukkit - add Bukkit remove cause
@@ -29322,7 +29322,7 @@ index 663fb13233afb51f935c30ac2acae808809754c6..81a18b8e605bd4c28b48a32c80be2316
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityRemoveEvent(this, cause); // CraftBukkit
final boolean alreadyRemoved = this.removalReason != null; // Paper - Folia schedulers
if (this.removalReason == null) {
@@ -4597,7 +4910,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4601,7 +4914,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.stopRiding();
}
@@ -29331,7 +29331,7 @@ index 663fb13233afb51f935c30ac2acae808809754c6..81a18b8e605bd4c28b48a32c80be2316
this.levelCallback.onRemove(removalReason);
this.onRemoval(removalReason);
// Paper start - Folia schedulers
@@ -4631,7 +4944,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4635,7 +4948,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public boolean shouldBeSaved() {
return (this.removalReason == null || this.removalReason.shouldSave())
&& !this.isPassenger()