Remove Entity tracker field

Now the only tracker field is from the entity tracker
optimisations.
This commit is contained in:
Spottedleaf 2024-07-28 15:28:28 -07:00
parent f82bea6940
commit 694b120d0b
53 changed files with 171 additions and 204 deletions

View File

@ -4,27 +4,6 @@ Date: Sat, 21 Jul 2018 08:25:40 -0400
Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 63bcd7698fdb86366441dacedbb616771f6b1a3d..a58a68220e077ce23c20cf61d63f51183df1dfc9 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1254,6 +1254,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} else {
ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas());
+ entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
playerchunkmap_entitytracker.updatePlayers(this.level.players());
if (entity instanceof ServerPlayer) {
@@ -1294,7 +1295,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (playerchunkmap_entitytracker1 != null) {
playerchunkmap_entitytracker1.broadcastRemoved();
}
-
+ entity.tracker = null; // Paper - We're no longer tracked
}
protected void tick() {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 4f777c9d8c3052f68bc0465c8a7386b8fb486c83..e9d08662c065d04a67918f0aa2cd4fde5798f2a6 100644 index 4f777c9d8c3052f68bc0465c8a7386b8fb486c83..e9d08662c065d04a67918f0aa2cd4fde5798f2a6 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
@ -42,18 +21,6 @@ index 4f777c9d8c3052f68bc0465c8a7386b8fb486c83..e9d08662c065d04a67918f0aa2cd4fde
if (entity.isRemoved()) { if (entity.isRemoved()) {
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false; return false;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f431c5a17bfc3bdf2a464470af4ec5e226b0d13e..131eda47e7a9f90a4057607870acbcb8fecfbf0b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -250,6 +250,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
private CraftEntity bukkitEntity;
+ public @org.jetbrains.annotations.Nullable net.minecraft.server.level.ChunkMap.TrackedEntity tracker; // Paper
public CraftEntity getBukkitEntity() {
if (this.bukkitEntity == null) {
this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this);
diff --git a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java diff --git a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java
index 38df704dca30ef08f4d0831dc1cc48c6d6f71a4d..ed6aea7a38ef6e80c300ff9b012dcdbc390ad2c7 100644 index 38df704dca30ef08f4d0831dc1cc48c6d6f71a4d..ed6aea7a38ef6e80c300ff9b012dcdbc390ad2c7 100644
--- a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java --- a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java

View File

@ -41,10 +41,10 @@ index 1108fa6c7ac28304d104d4e5df2bdf4e9a6bd929..b4947ee9615b1b2108046b9ab87b65b5
Iterator iterator = entityliving.getActiveEffects().iterator(); Iterator iterator = entityliving.getActiveEffects().iterator();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d4b1122fcf9c35f492764d0a7b8b4c41e46aa90a..026af10f7de0267c7335385fea53a823f3898e8b 100644 index 7fd1a75ba0068ee3ca6c29a550a9a1b33c5cacc5..f330ddca00ed11bf76ae825820423b94920013b9 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2705,17 +2705,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2704,17 +2704,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public void removeVehicle() { public void removeVehicle() {
@ -75,7 +75,7 @@ index d4b1122fcf9c35f492764d0a7b8b4c41e46aa90a..026af10f7de0267c7335385fea53a823
} }
protected void addPassenger(Entity passenger) { protected void addPassenger(Entity passenger) {
@@ -2740,7 +2751,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2739,7 +2750,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
} }
@ -87,7 +87,7 @@ index d4b1122fcf9c35f492764d0a7b8b4c41e46aa90a..026af10f7de0267c7335385fea53a823
if (entity.getVehicle() == this) { if (entity.getVehicle() == this) {
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
} else { } else {
@@ -2750,7 +2764,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2749,7 +2763,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
VehicleExitEvent event = new VehicleExitEvent( VehicleExitEvent event = new VehicleExitEvent(
(Vehicle) this.getBukkitEntity(), (Vehicle) this.getBukkitEntity(),
@ -96,7 +96,7 @@ index d4b1122fcf9c35f492764d0a7b8b4c41e46aa90a..026af10f7de0267c7335385fea53a823
); );
// Suppress during worldgen // Suppress during worldgen
if (this.valid) { if (this.valid) {
@@ -2763,7 +2777,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2762,7 +2776,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
} }

View File

@ -38,7 +38,7 @@ index e9d08662c065d04a67918f0aa2cd4fde5798f2a6..a6a21def1ae0d35fa106da6242c49a09
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getKey(entity.getType())); // CraftBukkit
return false; return false;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 00c43d7b846e97e2cc2105c93be5ce918fafd775..8f90e8cd36348089799097807ead774e186c2604 100644 index 2f1d075b8dbcf173c51f3e6396ccbc61b64f75df..79203d0e5cdb86d9e2fb22cdaeb8cf3a93e43dcc 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -223,6 +223,11 @@ public abstract class PlayerList { @@ -223,6 +223,11 @@ public abstract class PlayerList {
@ -63,7 +63,7 @@ index 00c43d7b846e97e2cc2105c93be5ce918fafd775..8f90e8cd36348089799097807ead774e
if (entity != null) { if (entity != null) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2e376b0b2bf2d49ad0669b6e6fd287628a72ea64..869cd3723c6704e7512f4637682476b8af9f0264 100644 index f330ddca00ed11bf76ae825820423b94920013b9..9d56aff2766b684f0fb20e93d504de1a7a564b11 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -247,6 +247,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -247,6 +247,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@ -74,7 +74,7 @@ index 2e376b0b2bf2d49ad0669b6e6fd287628a72ea64..869cd3723c6704e7512f4637682476b8
private CraftEntity bukkitEntity; private CraftEntity bukkitEntity;
@@ -2275,6 +2276,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2274,6 +2275,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
nbttagcompound.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ())); nbttagcompound.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
} }
@ -84,7 +84,7 @@ index 2e376b0b2bf2d49ad0669b6e6fd287628a72ea64..869cd3723c6704e7512f4637682476b8
// Save entity's from mob spawner status // Save entity's from mob spawner status
if (spawnedViaMobSpawner) { if (spawnedViaMobSpawner) {
nbttagcompound.putBoolean("Paper.FromMobSpawner", true); nbttagcompound.putBoolean("Paper.FromMobSpawner", true);
@@ -2421,6 +2425,26 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2420,6 +2424,26 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status

View File

@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code
Also ignores Enderdragon, defaulting it to Mojang's setting Also ignores Enderdragon, defaulting it to Mojang's setting
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index a58a68220e077ce23c20cf61d63f51183df1dfc9..6159ab8831a233c21aad48c64ef76b06c1955bb0 100644 index 5573a5d0d0e10e3c584e821d3e8e7ba64a41a627..ee54706b36bd227edacea2a1b6099009bd652039 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1546,6 +1546,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1545,6 +1545,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
int j = entity.getType().clientTrackingRange() * 16; int j = entity.getType().clientTrackingRange() * 16;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add option to nerf pigmen from nether portals
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 869cd3723c6704e7512f4637682476b8af9f0264..981b4d28f5f8c614b623f1482551d0f9281807f6 100644 index 9d56aff2766b684f0fb20e93d504de1a7a564b11..94242c19740ae6ab2c86e3949bab6cee631b938f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -404,6 +404,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -403,6 +403,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void inactiveTick() { } public void inactiveTick() { }
// Spigot end // Spigot end
protected int numCollisions = 0; // Paper - Cap entity collisions protected int numCollisions = 0; // Paper - Cap entity collisions
@ -16,7 +16,7 @@ index 869cd3723c6704e7512f4637682476b8af9f0264..981b4d28f5f8c614b623f1482551d0f9
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
// Paper start - Entity origin API // Paper start - Entity origin API
@javax.annotation.Nullable @javax.annotation.Nullable
@@ -2283,6 +2284,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2282,6 +2283,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (spawnedViaMobSpawner) { if (spawnedViaMobSpawner) {
nbttagcompound.putBoolean("Paper.FromMobSpawner", true); nbttagcompound.putBoolean("Paper.FromMobSpawner", true);
} }
@ -26,7 +26,7 @@ index 869cd3723c6704e7512f4637682476b8af9f0264..981b4d28f5f8c614b623f1482551d0f9
// Paper end // Paper end
return nbttagcompound; return nbttagcompound;
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -2425,6 +2429,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2424,6 +2428,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status

View File

@ -10,7 +10,7 @@ Co-authored-by: Wyatt Childers <wchilders@nearce.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index ed0ffff1cfc25f66e1947e40008c6c7259b17019..51426da5f3e7b9f8631880a04cef0a58b00233df 100644 index 01362d092a5b170ce5c334422d7797f190666e25..c322d8284b4d17d6b9a949d85849892d7c88817e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -197,6 +197,7 @@ public abstract class PlayerList { @@ -197,6 +197,7 @@ public abstract class PlayerList {
@ -84,10 +84,10 @@ index ed0ffff1cfc25f66e1947e40008c6c7259b17019..51426da5f3e7b9f8631880a04cef0a58
} }
// Paper end - Entity#getEntitySpawnReason // Paper end - Entity#getEntitySpawnReason
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 981b4d28f5f8c614b623f1482551d0f9281807f6..61ae5553a22adc84acbe2962632b8f564ed80d88 100644 index 94242c19740ae6ab2c86e3949bab6cee631b938f..d80fd4e2f41583f83c9527ccf4ce80afe851276a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2386,27 +2386,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2385,27 +2385,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
// CraftBukkit end // CraftBukkit end

View File

@ -16,10 +16,10 @@ So even if something NEW comes up, it would be impossible to drop the
same item twice because the source was destroyed. same item twice because the source was destroyed.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e61c92d4d510eeb93ad0d72f779f6ac9c3a722f1..4134c858dcca7192ad21d325d67e64bba90bb8b8 100644 index d80fd4e2f41583f83c9527ccf4ce80afe851276a..bd5291ca4680572d2c5f3cec1231b1a3dcf72fa8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2516,11 +2516,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2515,11 +2515,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} else { } else {
// CraftBukkit start - Capture drops for death event // CraftBukkit start - Capture drops for death event
if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) { if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) {
@ -34,7 +34,7 @@ index e61c92d4d510eeb93ad0d72f779f6ac9c3a722f1..4134c858dcca7192ad21d325d67e64bb
entityitem.setDefaultPickUpDelay(); entityitem.setDefaultPickUpDelay();
// CraftBukkit start // CraftBukkit start
@@ -3336,6 +3337,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3335,6 +3336,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public Entity changeDimension(DimensionTransition teleportTarget) { public Entity changeDimension(DimensionTransition teleportTarget) {
Level world = this.level(); Level world = this.level();
@ -47,7 +47,7 @@ index e61c92d4d510eeb93ad0d72f779f6ac9c3a722f1..4134c858dcca7192ad21d325d67e64bb
if (world instanceof ServerLevel worldserver) { if (world instanceof ServerLevel worldserver) {
if (!this.isRemoved()) { if (!this.isRemoved()) {
// CraftBukkit start // CraftBukkit start
@@ -3378,6 +3385,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3377,6 +3384,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (entity2 != null) { if (entity2 != null) {
if (this != entity2) { if (this != entity2) {
@ -59,7 +59,7 @@ index e61c92d4d510eeb93ad0d72f779f6ac9c3a722f1..4134c858dcca7192ad21d325d67e64bb
entity2.restoreFrom(this); entity2.restoreFrom(this);
this.removeAfterChangingDimensions(); this.removeAfterChangingDimensions();
// CraftBukkit start - Forward the CraftEntity to the new entity // CraftBukkit start - Forward the CraftEntity to the new entity
@@ -3453,7 +3465,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3452,7 +3464,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public boolean canChangeDimensions(Level from, Level to) { public boolean canChangeDimensions(Level from, Level to) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Ensure Entity position and AABB are never invalid
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2c21ef3f9096d1282091a7ec34e57fd74d815353..be990f12c61a6079fafbfd3d05ae1ae352d6229d 100644 index bd5291ca4680572d2c5f3cec1231b1a3dcf72fa8..284d0f88968d386559be94d1e1e7af361658da3f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -670,8 +670,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -669,8 +669,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public void setPos(double x, double y, double z) { public void setPos(double x, double y, double z) {
@ -20,7 +20,7 @@ index 2c21ef3f9096d1282091a7ec34e57fd74d815353..be990f12c61a6079fafbfd3d05ae1ae3
} }
protected AABB makeBoundingBox() { protected AABB makeBoundingBox() {
@@ -4224,7 +4224,29 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4223,7 +4223,29 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale); return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale);
} }
@ -50,7 +50,7 @@ index 2c21ef3f9096d1282091a7ec34e57fd74d815353..be990f12c61a6079fafbfd3d05ae1ae3
if (this.position.x != x || this.position.y != y || this.position.z != z) { if (this.position.x != x || this.position.y != y || this.position.z != z) {
this.position = new Vec3(x, y, z); this.position = new Vec3(x, y, z);
int i = Mth.floor(x); int i = Mth.floor(x);
@@ -4242,6 +4264,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4241,6 +4263,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.levelCallback.onMove(); this.levelCallback.onMove();
} }

View File

@ -31,7 +31,7 @@ index 762998180eb7b10151f390ee79690c68d66622f2..d97b1040ecec1d30fdd1bf309a821595
} }
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index be990f12c61a6079fafbfd3d05ae1ae352d6229d..335962dfe50d8d691a2a1fc6224950641e2b5a2b 100644 index 284d0f88968d386559be94d1e1e7af361658da3f..8a1014d7181b493a24692271aa9c561c159801d3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -171,6 +171,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -171,6 +171,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@ -42,7 +42,7 @@ index be990f12c61a6079fafbfd3d05ae1ae352d6229d..335962dfe50d8d691a2a1fc622495064
static boolean isLevelAtLeast(CompoundTag tag, int level) { static boolean isLevelAtLeast(CompoundTag tag, int level) {
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
} }
@@ -1874,6 +1875,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1873,6 +1874,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public void moveTo(double x, double y, double z, float yaw, float pitch) { public void moveTo(double x, double y, double z, float yaw, float pitch) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 08dd2b77df5162a3b4b6941663efaa1eb0e42746..f7cfce209dde71e61009f3678c667062475cf1d4 100644 index 8a1014d7181b493a24692271aa9c561c159801d3..14ef888ef46a873046a286e25e923d980e2035e8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4509,4 +4509,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4508,4 +4508,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
void accept(Entity entity, double x, double y, double z); void accept(Entity entity, double x, double y, double z);
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Entity#isTicking
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 203aacc9e116c1335bde1cff4d59674bfa7a622a..0764f5eaaa5a13e1e9b98a83bfb32e8eb1278f23 100644 index 14ef888ef46a873046a286e25e923d980e2035e8..62441eeee9064e982e7e87676e87935a3adc7c2b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4514,5 +4514,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4513,5 +4513,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public static int nextEntityId() { public static int nextEntityId() {
return ENTITY_COUNTER.incrementAndGet(); return ENTITY_COUNTER.incrementAndGet();
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Climbing should not bypass cramming gamerule
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0764f5eaaa5a13e1e9b98a83bfb32e8eb1278f23..7b4c877d6c613e1c40618bc95a65672ec7a31deb 100644 index 62441eeee9064e982e7e87676e87935a3adc7c2b..b093de4b2bfdca0817b496e1b0a436b3f6be9c2f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2080,6 +2080,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2079,6 +2079,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public boolean isPushable() { public boolean isPushable() {

View File

@ -28,10 +28,10 @@ index 488ebd443903af812913437f1ade3002093f2470..a043ac10834562d357ef0b5aded2e916
public Vec3 decode(long x, long y, long z) { public Vec3 decode(long x, long y, long z) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 7b4c877d6c613e1c40618bc95a65672ec7a31deb..a99bd882a9fbf4a54a82dbde7086c715ff3e46ea 100644 index b093de4b2bfdca0817b496e1b0a436b3f6be9c2f..e997c009821c3e7645a6acff163ece8c98f6db36 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4261,6 +4261,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4260,6 +4260,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return; return;
} }
// Paper end - Block invalid positions and bounding box // Paper end - Block invalid positions and bounding box

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Collision option for requiring a player participant
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index a99bd882a9fbf4a54a82dbde7086c715ff3e46ea..eafd838e2d87103b7c8d9a04144639c3d13381fa 100644 index e997c009821c3e7645a6acff163ece8c98f6db36..44efb857aa839bbc0eca608661f22750bb059f4f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1937,6 +1937,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1936,6 +1936,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void push(Entity entity) { public void push(Entity entity) {
if (!this.isPassengerOfSameVehicle(entity)) { if (!this.isPassengerOfSameVehicle(entity)) {
if (!entity.noPhysics && !this.noPhysics) { if (!entity.noPhysics && !this.noPhysics) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expand EntityUnleashEvent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index a46b7e09809937b6e09bc3e08760d34f6eb00c4d..e884f37137799c85e5acc410ae5896364884fd4b 100644 index 44efb857aa839bbc0eca608661f22750bb059f4f..1ca18b0c4af08c998636bb3938a3dfdfb1d80cf0 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2575,12 +2575,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2574,12 +2574,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (leashable.getLeashHolder() == player) { if (leashable.getLeashHolder() == player) {
if (!this.level().isClientSide()) { if (!this.level().isClientSide()) {
// CraftBukkit start - fire PlayerUnleashEntityEvent // CraftBukkit start - fire PlayerUnleashEntityEvent
@ -26,7 +26,7 @@ index a46b7e09809937b6e09bc3e08760d34f6eb00c4d..e884f37137799c85e5acc410ae589636
this.gameEvent(GameEvent.ENTITY_INTERACT, player); this.gameEvent(GameEvent.ENTITY_INTERACT, player);
} }
@@ -3451,8 +3454,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3450,8 +3453,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
protected void removeAfterChangingDimensions() { protected void removeAfterChangingDimensions() {
this.setRemoved(Entity.RemovalReason.CHANGED_DIMENSION, null); // CraftBukkit - add Bukkit remove cause this.setRemoved(Entity.RemovalReason.CHANGED_DIMENSION, null); // CraftBukkit - add Bukkit remove cause
if (this instanceof Leashable leashable) { if (this instanceof Leashable leashable) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expose Tracked Players
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 98e8ad81b8c9c0636abe59f70ce891fe926a37fe..4134bfb3579e91367644df517c161c1b40cdbe66 100644 index 98e8ad81b8c9c0636abe59f70ce891fe926a37fe..96201ea45f8b53dcadb1a8732b1d49b1e8d1d7df 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1069,4 +1069,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1069,4 +1069,21 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return getHandle().isTicking(); return getHandle().isTicking();
} }
// Paper end - isTicking API // Paper end - isTicking API
@ -16,12 +16,14 @@ index 98e8ad81b8c9c0636abe59f70ce891fe926a37fe..4134bfb3579e91367644df517c161c1b
+ // Paper start - tracked players API + // Paper start - tracked players API
+ @Override + @Override
+ public Set<org.bukkit.entity.Player> getTrackedPlayers() { + public Set<org.bukkit.entity.Player> getTrackedPlayers() {
+ if (this.entity.tracker == null) { + ServerLevel world = (net.minecraft.server.level.ServerLevel)this.entity.level();
+ ChunkMap.TrackedEntity tracker = world == null ? null : world.getChunkSource().chunkMap.entityMap.get(this.entity.getId());
+ if (tracker == null) {
+ return java.util.Collections.emptySet(); + return java.util.Collections.emptySet();
+ } + }
+ +
+ Set<org.bukkit.entity.Player> set = new java.util.HashSet<>(this.entity.tracker.seenBy.size()); + Set<org.bukkit.entity.Player> set = new java.util.HashSet<>(tracker.seenBy.size());
+ for (net.minecraft.server.network.ServerPlayerConnection connection : this.entity.tracker.seenBy) { + for (net.minecraft.server.network.ServerPlayerConnection connection : tracker.seenBy) {
+ set.add(connection.getPlayer().getBukkitEntity().getPlayer()); + set.add(connection.getPlayer().getBukkitEntity().getPlayer());
+ } + }
+ return set; + return set;

View File

@ -705,10 +705,10 @@ index fc0f0e841dc974d080e1abb9bbafb5165801131f..d657fd2c507a5b215aeab0a5f3e9c2ee
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 4134bfb3579e91367644df517c161c1b40cdbe66..7310f53747e68b918f132ee0f0a142e36537902e 100644 index 96201ea45f8b53dcadb1a8732b1d49b1e8d1d7df..7c04eb9e7eb5ff728465b46e3739eb2598ef1204 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1084,4 +1084,27 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1086,4 +1086,27 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return set; return set;
} }
// Paper end - tracked players API // Paper end - tracked players API

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Optimize indirect passenger iteration
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 317115dd54252e882575aa04dbfb3f977ba3df60..567c1d741628fcafca02fc06922ad6d77fa823ff 100644 index 1ca18b0c4af08c998636bb3938a3dfdfb1d80cf0..e09b5be9bf40e4df1f58c40d5a39f5d667145903 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3890,20 +3890,34 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3889,20 +3889,34 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
private Stream<Entity> getIndirectPassengersStream() { private Stream<Entity> getIndirectPassengersStream() {
@ -43,7 +43,7 @@ index 317115dd54252e882575aa04dbfb3f977ba3df60..567c1d741628fcafca02fc06922ad6d7
return () -> { return () -> {
return this.getIndirectPassengersStream().iterator(); return this.getIndirectPassengersStream().iterator();
}; };
@@ -3916,6 +3930,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3915,6 +3929,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public boolean hasExactlyOnePlayerPassenger() { public boolean hasExactlyOnePlayerPassenger() {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add back EntityPortalExitEvent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 567c1d741628fcafca02fc06922ad6d77fa823ff..28c20c14fa36470a96fad88787fc01c77592d19f 100644 index e09b5be9bf40e4df1f58c40d5a39f5d667145903..e8098a2f8f8bfe9260290cab11b2045c9f4098dd 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3364,7 +3364,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3363,7 +3363,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (world instanceof ServerLevel worldserver) { if (world instanceof ServerLevel worldserver) {
if (!this.isRemoved()) { if (!this.isRemoved()) {
// CraftBukkit start // CraftBukkit start
@ -17,7 +17,7 @@ index 567c1d741628fcafca02fc06922ad6d77fa823ff..28c20c14fa36470a96fad88787fc01c7
// Paper start - gateway-specific teleport event // Paper start - gateway-specific teleport event
final EntityTeleportEvent teleEvent; final EntityTeleportEvent teleEvent;
if (this.portalProcess != null && this.portalProcess.isSamePortal(((net.minecraft.world.level.block.EndGatewayBlock) net.minecraft.world.level.block.Blocks.END_GATEWAY)) && this.level.getBlockEntity(this.portalProcess.getEntryPosition()) instanceof net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity theEndGatewayBlockEntity) { if (this.portalProcess != null && this.portalProcess.isSamePortal(((net.minecraft.world.level.block.EndGatewayBlock) net.minecraft.world.level.block.Blocks.END_GATEWAY)) && this.level.getBlockEntity(this.portalProcess.getEntryPosition()) instanceof net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity theEndGatewayBlockEntity) {
@@ -3378,7 +3378,25 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3377,7 +3377,25 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return null; return null;
} }
to = teleEvent.getTo(); to = teleEvent.getTo();

View File

@ -7,10 +7,10 @@ Subject: [PATCH] Add Raw Byte Entity Serialization
public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0ab29f96a50ae490117cf83053bc3803870f794b..67c0dd9677dae97104830b816e5e0ca24e7db946 100644 index e8098a2f8f8bfe9260290cab11b2045c9f4098dd..5928117dbec4d4cce4a85444658947d4596b5bc0 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2145,6 +2145,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2144,6 +2144,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
} }
@ -27,10 +27,10 @@ index 0ab29f96a50ae490117cf83053bc3803870f794b..67c0dd9677dae97104830b816e5e0ca2
return this.isPassenger() ? false : this.saveAsPassenger(nbt); return this.isPassenger() ? false : this.saveAsPassenger(nbt);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 7310f53747e68b918f132ee0f0a142e36537902e..6f9286e65f7ac730b808ddf9b52c344f03b4d778 100644 index 7c04eb9e7eb5ff728465b46e3739eb2598ef1204..6fab713531665298d3b03e7960a17ecb1471a6d7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1085,6 +1085,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1087,6 +1087,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
} }
// Paper end - tracked players API // Paper end - tracked players API

View File

@ -7,10 +7,10 @@ Reference2BooleanOpenHashMap is going to have
better lookups than HashMap. better lookups than HashMap.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index bac8e53cab360142f224965e68d8f9e6ae0c15f6..b953def299faf1a13e1893d17a476f36e2d6337a 100644 index d91279f3bd009e1542e73354aadd6a16c80965e2..071e9ef3680c5dc492c6142ccd05f6788ebc3035 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1462,7 +1462,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1461,7 +1461,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final Entity entity; final Entity entity;
private final int range; private final int range;
SectionPos lastSectionPos; SectionPos lastSectionPos;

View File

@ -8,10 +8,10 @@ This is because bukkit uses a separate head rotation field for yaw.
This issue only applies to players. This issue only applies to players.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 13e1b47873f0a4a974bb0763679fee6e37932b5c..2dc2f8ff7add3573a66ab12e12b8625e87669fa4 100644 index 5928117dbec4d4cce4a85444658947d4596b5bc0..f199bd164867ce592fbd7dd0f4a94f95b82c21e9 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1845,6 +1845,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1844,6 +1844,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F); this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F);
this.yRotO = this.getYRot(); this.yRotO = this.getYRot();
this.xRotO = this.getXRot(); this.xRotO = this.getXRot();
@ -19,7 +19,7 @@ index 13e1b47873f0a4a974bb0763679fee6e37932b5c..2dc2f8ff7add3573a66ab12e12b8625e
} }
public void absMoveTo(double x, double y, double z) { public void absMoveTo(double x, double y, double z) {
@@ -1887,6 +1888,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1886,6 +1887,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.setXRot(pitch); this.setXRot(pitch);
this.setOldPosAndRot(); this.setOldPosAndRot();
this.reapplyPosition(); this.reapplyPosition();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] don't attempt to teleport dead entities
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2dc2f8ff7add3573a66ab12e12b8625e87669fa4..b969b0a1c3768e43bda8b2fb297f022ebc8bc4ce 100644 index f199bd164867ce592fbd7dd0f4a94f95b82c21e9..909fa8d8f8ca6eddf6d01e0b8dd4384fc381e579 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -706,7 +706,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -705,7 +705,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit start // CraftBukkit start
public void postTick() { public void postTick() {
// No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle // No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Forward CraftEntity in teleport command
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b969b0a1c3768e43bda8b2fb297f022ebc8bc4ce..6d011de57725aec5ffffc35b3b94ec1b7c178861 100644 index 909fa8d8f8ca6eddf6d01e0b8dd4384fc381e579..d72573022ea2881df43aa37e647168036f7fc4d6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3354,6 +3354,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3353,6 +3353,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public void restoreFrom(Entity original) { public void restoreFrom(Entity original) {
@ -22,7 +22,7 @@ index b969b0a1c3768e43bda8b2fb297f022ebc8bc4ce..6d011de57725aec5ffffc35b3b94ec1b
CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag()); CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag());
nbttagcompound.remove("Dimension"); nbttagcompound.remove("Dimension");
@@ -3440,8 +3447,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3439,8 +3446,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
entity2.restoreFrom(this); entity2.restoreFrom(this);
this.removeAfterChangingDimensions(); this.removeAfterChangingDimensions();
// CraftBukkit start - Forward the CraftEntity to the new entity // CraftBukkit start - Forward the CraftEntity to the new entity

View File

@ -7,10 +7,10 @@ Subject: [PATCH] Entity powdered snow API
public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 6f9286e65f7ac730b808ddf9b52c344f03b4d778..d2648218d41439c4048901f2dbd59fe5eef57495 100644 index 6fab713531665298d3b03e7960a17ecb1471a6d7..4ed5647101bbace0005b1ebfb824e4aed48e43cb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1097,6 +1097,13 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1099,6 +1099,13 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
} }
// Paper end - raw entity serialization API // Paper end - raw entity serialization API

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Freeze Tick Lock API
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 6d011de57725aec5ffffc35b3b94ec1b7c178861..c16f179e4cb45f5a312255692cf8606884606ba2 100644 index d72573022ea2881df43aa37e647168036f7fc4d6..d3971bc8a1cedaaffa89bb6eedb45742aa7c1d34 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -412,6 +412,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -411,6 +411,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
private org.bukkit.util.Vector origin; private org.bukkit.util.Vector origin;
@javax.annotation.Nullable @javax.annotation.Nullable
private UUID originWorld; private UUID originWorld;
@ -16,7 +16,7 @@ index 6d011de57725aec5ffffc35b3b94ec1b7c178861..c16f179e4cb45f5a312255692cf86068
public void setOrigin(@javax.annotation.Nonnull Location location) { public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector(); this.origin = location.toVector();
@@ -752,7 +753,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -751,7 +752,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.setRemainingFireTicks(this.remainingFireTicks - 1); this.setRemainingFireTicks(this.remainingFireTicks - 1);
} }
@ -25,7 +25,7 @@ index 6d011de57725aec5ffffc35b3b94ec1b7c178861..c16f179e4cb45f5a312255692cf86068
this.setTicksFrozen(0); this.setTicksFrozen(0);
this.level().levelEvent((Player) null, 1009, this.blockPosition, 1); this.level().levelEvent((Player) null, 1009, this.blockPosition, 1);
} }
@@ -2313,6 +2314,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2312,6 +2313,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (fromNetherPortal) { if (fromNetherPortal) {
nbttagcompound.putBoolean("Paper.FromNetherPortal", true); nbttagcompound.putBoolean("Paper.FromNetherPortal", true);
} }
@ -35,7 +35,7 @@ index 6d011de57725aec5ffffc35b3b94ec1b7c178861..c16f179e4cb45f5a312255692cf86068
// Paper end // Paper end
return nbttagcompound; return nbttagcompound;
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -2457,6 +2461,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2456,6 +2460,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (spawnReason == null) { if (spawnReason == null) {
spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT; spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT;
} }
@ -59,7 +59,7 @@ index 45493e09843e5a3c4511f7f1b36cfec9468a0391..a02df3b6fd908b16dbe5a3be77174bfb
if (this.isInPowderSnow && this.canFreeze()) { if (this.isInPowderSnow && this.canFreeze()) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index d2648218d41439c4048901f2dbd59fe5eef57495..47f24e390efd8eb4cb7f62b5203825f4160772b7 100644 index 4ed5647101bbace0005b1ebfb824e4aed48e43cb..4c09f2529dd8eb7ac7d260d177f5292ff2339442 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -323,6 +323,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -323,6 +323,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Ensure entity passenger world matches ridden entity
Bad plugins doing this would cause some obvious problems... Bad plugins doing this would cause some obvious problems...
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index c16f179e4cb45f5a312255692cf8606884606ba2..b0c9c22c983344119925d76ee3180df9f411d8f5 100644 index d3971bc8a1cedaaffa89bb6eedb45742aa7c1d34..76182523c12f885cb42af1efa82f8e251e901195 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2688,7 +2688,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2687,7 +2687,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public boolean startRiding(Entity entity, boolean force) { public boolean startRiding(Entity entity, boolean force) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent entity loading causing async lookups
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b0c9c22c983344119925d76ee3180df9f411d8f5..0b273d6249c212994b23aeaac382e532edfd563f 100644 index 76182523c12f885cb42af1efa82f8e251e901195..c95cb2a05f0520a9e1f7be31f9b08f06a6e8f2ae 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -715,6 +715,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -714,6 +714,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void baseTick() { public void baseTick() {
this.level().getProfiler().push("entityBaseTick"); this.level().getProfiler().push("entityBaseTick");

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add various missing EntityDropItemEvent calls
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0b273d6249c212994b23aeaac382e532edfd563f..75c80072800fb1fdc3cf362f242fd8ee440e600e 100644 index c95cb2a05f0520a9e1f7be31f9b08f06a6e8f2ae..43a2570196619bd239170de586626a7112066430 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2558,6 +2558,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2557,6 +2557,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe
entityitem.setDefaultPickUpDelay(); entityitem.setDefaultPickUpDelay();

View File

@ -22,10 +22,10 @@ index f6dd8665b9f6e2a8ff396deba8a021e695bedf7e..3c1937b43b6834ae0ffdd8d22ac32a77
// Paper end // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 243ac4253a1541dba52126bad96682e43c6f48a1..7c223042595c7cd5ccc554211657d9375833122b 100644 index 94051ae8ea93ab144f3767345b1cda0438d2afc6..f950102a324d07aeba260bfa82fe88728f2362e5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1191,4 +1191,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1193,4 +1193,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return this.getHandle().noPhysics; return this.getHandle().noPhysics;
} }
// Paper end - missing entity api // Paper end - missing entity api

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Fix EntityCombustEvent cancellation cant fully prevent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 75c80072800fb1fdc3cf362f242fd8ee440e600e..82531bd4ada8373d3c255758382d5850309913e2 100644 index 43a2570196619bd239170de586626a7112066430..655a0f2328b641ce41c64e9bb1456e05a4342197 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3194,6 +3194,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3193,6 +3193,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
pluginManager.callEvent(entityCombustEvent); pluginManager.callEvent(entityCombustEvent);
if (!entityCombustEvent.isCancelled()) { if (!entityCombustEvent.isCancelled()) {
this.igniteForSeconds(entityCombustEvent.getDuration(), false); this.igniteForSeconds(entityCombustEvent.getDuration(), false);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Player Entity Tracking Events
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index d409791325771909faaef0dffb0f7f02d1bf71af..ca98b4c405afc2d86085759ba50d02eba75784a7 100644 index 61fda6927f060cdf8bcfddaaa08bbbe2c514c630..dca6087dc4e1c177c3dfdae01f140cf80c179803 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1534,7 +1534,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1533,7 +1533,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// CraftBukkit end // CraftBukkit end
if (flag) { if (flag) {
if (this.seenBy.add(player.connection)) { if (this.seenBy.add(player.connection)) {
@ -21,10 +21,10 @@ index d409791325771909faaef0dffb0f7f02d1bf71af..ca98b4c405afc2d86085759ba50d02eb
} else if (this.seenBy.remove(player.connection)) { } else if (this.seenBy.remove(player.connection)) {
this.serverEntity.removePairing(player); this.serverEntity.removePairing(player);
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 82531bd4ada8373d3c255758382d5850309913e2..f52d394c90bc326c2a58c4f623df632235e0c599 100644 index 655a0f2328b641ce41c64e9bb1456e05a4342197..3c410f22c92a64b50d77b22c4b3027d51bcd7e05 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3869,7 +3869,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3868,7 +3868,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void startSeenByPlayer(ServerPlayer player) {} public void startSeenByPlayer(ServerPlayer player) {}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Improve PortalEvents
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index fe70fec5d2d422ea9be18e6d5af377f13090ff73..76028662f54175fa95db581a06c04a140e0247b2 100644 index 3c410f22c92a64b50d77b22c4b3027d51bcd7e05..1c4ec9049d84adbeb26b7abda82836f8ce0ff0ba 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3528,7 +3528,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3527,7 +3527,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity(); org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity();
Location enter = bukkitEntity.getLocation(); Location enter = bukkitEntity.getLocation();

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Expose pre-collision moving velocity to
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index ec386450f9808c724c1b2b97c6e14fc5292caafc..011a869c2eac551fe15fca34eee11ff928af52e2 100644 index 1c4ec9049d84adbeb26b7abda82836f8ce0ff0ba..015004598010b272474169a019d39476949a3a33 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -943,6 +943,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -942,6 +942,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public void move(MoverType movementType, Vec3 movement) { public void move(MoverType movementType, Vec3 movement) {
@ -17,7 +17,7 @@ index ec386450f9808c724c1b2b97c6e14fc5292caafc..011a869c2eac551fe15fca34eee11ff9
if (this.noPhysics) { if (this.noPhysics) {
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
} else { } else {
@@ -1027,7 +1028,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1026,7 +1027,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
if (!bl.getType().isAir()) { if (!bl.getType().isAir()) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add Entity Body Yaw API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 3c1e199316ae283210529d4d27b4f9d70b4d9404..d8b1cdc78eb234023a42d740599009737201e70e 100644 index ac513d3162a0794f226abc80bff21c799fe5802c..7c7501b4b21530d0641774f64e87d7d1ca71a33c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1181,6 +1181,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1183,6 +1183,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
} }
// Paper end - entity powdered snow API // Paper end - entity powdered snow API

View File

@ -14,10 +14,10 @@ clearing the owner.
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 011a869c2eac551fe15fca34eee11ff928af52e2..fa32b32fb5e6b546cb73b43e59db408404797cb5 100644 index 015004598010b272474169a019d39476949a3a33..435185dafb833b484f252965302e329cde444c2f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -391,6 +391,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -390,6 +390,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public boolean inWorld = false; public boolean inWorld = false;
public boolean generation; public boolean generation;
public int maxAirTicks = this.getDefaultMaxAirSupply(); // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir() public int maxAirTicks = this.getDefaultMaxAirSupply(); // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir()

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't load chunks for supporting block checks
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index fa32b32fb5e6b546cb73b43e59db408404797cb5..1d5d477b0b689167742c2f2edff263be40a991c8 100644 index 435185dafb833b484f252965302e329cde444c2f..3dd70063ab5434e5f57da6ae084316aa6570b7d5 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1186,7 +1186,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1185,7 +1185,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
protected BlockPos getOnPos(float offset) { protected BlockPos getOnPos(float offset) {

View File

@ -1173,7 +1173,7 @@ index a72b278826be1d0da79ca619ea9a9a437fa9c54b..2dfa9c4c0c2ef489649944eed89d8c77
this.profiler.push("commandFunctions"); this.profiler.push("commandFunctions");
MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 2ea29c9491186d7a25ed3eed99ee4a488bcaa272..de96d7df65713f2fa7b8f2dd068856bb5fa45a45 100644 index 944c727fd7770fe4c06af67304005664a7ab9e8a..f9dcbf7d51680e8dfdda1350e0632dec675f3d44 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -640,6 +640,7 @@ public abstract class PlayerList { @@ -640,6 +640,7 @@ public abstract class PlayerList {
@ -1185,11 +1185,11 @@ index 2ea29c9491186d7a25ed3eed99ee4a488bcaa272..de96d7df65713f2fa7b8f2dd068856bb
this.players.remove(entityplayer); this.players.remove(entityplayer);
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 1d5d477b0b689167742c2f2edff263be40a991c8..aebe9cb97776bb833221a0f11285696c266b752b 100644 index 3dd70063ab5434e5f57da6ae084316aa6570b7d5..0c145c6c53e486bc44cf83579b18add60777f47d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -255,11 +255,23 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -254,11 +254,23 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public @org.jetbrains.annotations.Nullable net.minecraft.server.level.ChunkMap.TrackedEntity tracker; // Paper
public CraftEntity getBukkitEntity() { public CraftEntity getBukkitEntity() {
if (this.bukkitEntity == null) { if (this.bukkitEntity == null) {
- this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this); - this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this);
@ -1213,7 +1213,7 @@ index 1d5d477b0b689167742c2f2edff263be40a991c8..aebe9cb97776bb833221a0f11285696c
@Override @Override
public CommandSender getBukkitSender(CommandSourceStack wrapper) { public CommandSender getBukkitSender(CommandSourceStack wrapper) {
return this.getBukkitEntity(); return this.getBukkitEntity();
@@ -4485,6 +4497,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4484,6 +4496,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public final void setRemoved(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) { public final void setRemoved(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) {
CraftEventFactory.callEntityRemoveEvent(this, cause); CraftEventFactory.callEntityRemoveEvent(this, cause);
// CraftBukkit end // CraftBukkit end
@ -1221,7 +1221,7 @@ index 1d5d477b0b689167742c2f2edff263be40a991c8..aebe9cb97776bb833221a0f11285696c
if (this.removalReason == null) { if (this.removalReason == null) {
this.removalReason = entity_removalreason; this.removalReason = entity_removalreason;
} }
@@ -4495,12 +4508,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4494,12 +4507,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.getPassengers().forEach(Entity::stopRiding); this.getPassengers().forEach(Entity::stopRiding);
this.levelCallback.onRemove(entity_removalreason); this.levelCallback.onRemove(entity_removalreason);
@ -1251,7 +1251,7 @@ index 1d5d477b0b689167742c2f2edff263be40a991c8..aebe9cb97776bb833221a0f11285696c
public void setLevelCallback(EntityInLevelCallback changeListener) { public void setLevelCallback(EntityInLevelCallback changeListener) {
this.levelCallback = changeListener; this.levelCallback = changeListener;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 7197cbf15ff9382cbc59c4a58e2f189c8cacbaaa..6d373fb254225aa92a10181d8dd21e2dd7fb063a 100644 index ed6210d2490f8584c21537eaa380d990fb73e03d..3e78a420ea183f4044873bb1fd89e9b9749032b8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -310,6 +310,76 @@ public final class CraftServer implements Server { @@ -310,6 +310,76 @@ public final class CraftServer implements Server {
@ -1332,7 +1332,7 @@ index 7197cbf15ff9382cbc59c4a58e2f189c8cacbaaa..6d373fb254225aa92a10181d8dd21e2d
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
ConfigurationSerialization.registerClass(CraftPlayerProfile.class); ConfigurationSerialization.registerClass(CraftPlayerProfile.class);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index d8b1cdc78eb234023a42d740599009737201e70e..bc37a3fc38e1966af3722ed16b3f940c2a8387a9 100644 index 7c7501b4b21530d0641774f64e87d7d1ca71a33c..d3ff8015b2f713451b0aeb50e1b4cf81f2bcb7bc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -70,6 +70,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -70,6 +70,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View File

@ -7,10 +7,10 @@ Was obtainable through different methods, but you had to use different
methods depending on the implementation of Entity you were working with. methods depending on the implementation of Entity you were working with.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index bc37a3fc38e1966af3722ed16b3f940c2a8387a9..b5622c5bcc97ff9241d236a35018918db5b2103a 100644 index d3ff8015b2f713451b0aeb50e1b4cf81f2bcb7bc..3626fea17527da69e6fbee26f018f52ef036cf90 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1261,4 +1261,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1263,4 +1263,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return !this.getHandle().level().noCollision(this.getHandle(), aabb); return !this.getHandle().level().noCollision(this.getHandle(), aabb);
} }
// Paper end - Collision API // Paper end - Collision API

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Configurable entity tracking range by Y coordinate
Options to configure entity tracking by Y coordinate, also for each entity category. Options to configure entity tracking by Y coordinate, also for each entity category.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index ca98b4c405afc2d86085759ba50d02eba75784a7..51c6f20a7402ff3809c8b7690fa4651eee0304cd 100644 index dca6087dc4e1c177c3dfdae01f140cf80c179803..11397b845d5a2dab5d134be8daddc8942d1a63a0 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1526,6 +1526,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1525,6 +1525,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z; double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z;
double d2 = d0 * d0; double d2 = d0 * d0;
boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player) && ChunkMap.this.isChunkTracked(player, this.entity.chunkPosition().x, this.entity.chunkPosition().z); boolean flag = d1 <= d2 && this.entity.broadcastToPlayer(player) && ChunkMap.this.isChunkTracked(player, this.entity.chunkPosition().x, this.entity.chunkPosition().z);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expand Pose API
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index aebe9cb97776bb833221a0f11285696c266b752b..80a29f4818cda4255c82fcd47f0da2235a02da23 100644 index 0c145c6c53e486bc44cf83579b18add60777f47d..e6e9fc2a91bdc2f4fdf4ffe723b85b9b61daf273 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -426,6 +426,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -425,6 +425,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@javax.annotation.Nullable @javax.annotation.Nullable
private UUID originWorld; private UUID originWorld;
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
@ -16,7 +16,7 @@ index aebe9cb97776bb833221a0f11285696c266b752b..80a29f4818cda4255c82fcd47f0da223
public void setOrigin(@javax.annotation.Nonnull Location location) { public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector(); this.origin = location.toVector();
@@ -619,6 +620,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -618,6 +619,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void onClientRemoval() {} public void onClientRemoval() {}
public void setPose(net.minecraft.world.entity.Pose pose) { public void setPose(net.minecraft.world.entity.Pose pose) {
@ -25,7 +25,7 @@ index aebe9cb97776bb833221a0f11285696c266b752b..80a29f4818cda4255c82fcd47f0da223
if (pose == this.getPose()) { if (pose == this.getPose()) {
return; return;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index b5622c5bcc97ff9241d236a35018918db5b2103a..a8b9b50991361160880b9fc0a94cad30c319e62e 100644 index 3626fea17527da69e6fbee26f018f52ef036cf90..580427bf1521ac9fef37f7464e12a7bfe4fbfb10 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -899,6 +899,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -899,6 +899,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View File

@ -17,10 +17,10 @@ index 7604aef2e03e7d688e7b6504283ed631488ec2d6..dc4a01f433bab7e8ecf6a156b748a0db
this.containerMenu.findSlot(this.getInventory(), this.getInventory().selected).ifPresent(s -> { this.containerMenu.findSlot(this.getInventory(), this.getInventory().selected).ifPresent(s -> {
this.containerSynchronizer.sendSlotChange(this.containerMenu, s, this.getMainHandItem()); this.containerSynchronizer.sendSlotChange(this.containerMenu, s, this.getMainHandItem());
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index ea251819e2563b4350d363d23dc7a8674440bf8a..94b2844adeeca9694dafe7ae79d6c751ac06e794 100644 index e6e9fc2a91bdc2f4fdf4ffe723b85b9b61daf273..2e80d503d92f0b4f3d15e2bdd39ed55277d0c460 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2639,8 +2639,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2638,8 +2638,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (!this.level().isClientSide()) { if (!this.level().isClientSide()) {
// CraftBukkit start - fire PlayerLeashEntityEvent // CraftBukkit start - fire PlayerLeashEntityEvent
if (CraftEventFactory.callPlayerLeashEntityEvent(this, player, player, hand).isCancelled()) { if (CraftEventFactory.callPlayerLeashEntityEvent(this, player, player, hand).isCancelled()) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't check if we can see non-visible entities
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 51c6f20a7402ff3809c8b7690fa4651eee0304cd..d4cc6d189cda03ea8e5d44af0608f914078f7e6e 100644 index 11397b845d5a2dab5d134be8daddc8942d1a63a0..babe11e3c76ebb725ff62d1c77744101ba9b4dec 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1537,7 +1537,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1536,7 +1536,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end - Configurable entity tracking range by Y // Paper end - Configurable entity tracking range by Y
// CraftBukkit start - respect vanish API // CraftBukkit start - respect vanish API

View File

@ -31,10 +31,10 @@ index c5e404dcdab14dc0b972aa3286b05e21d9ea67e0..aaaf5b91402a1562311dfdc287193a1a
if (entity.valid) { if (entity.valid) {
MinecraftServer.LOGGER.error("Attempted Double World add on {}", entity, new Throwable()); MinecraftServer.LOGGER.error("Attempted Double World add on {}", entity, new Throwable());
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 23442e0f887cec3c3a65b3dd3d0f4f40db0e54b1..24aacf9997c9ea0bd68ef3803f4a3ee4a920ab44 100644 index 2e80d503d92f0b4f3d15e2bdd39ed55277d0c460..25890e244d8909fdd6f48e148209107a30e3382e 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -625,7 +625,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -624,7 +624,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (pose == this.getPose()) { if (pose == this.getPose()) {
return; return;
} }

View File

@ -37,10 +37,10 @@ index f56fc6bc4da573cd73c72e3c61a96c4f1eebeb94..e45567e8112483d947e2ff12c01219b8
loot.addAll(this.drops); loot.addAll(this.drops);
this.drops.clear(); // SPIGOT-5188: make sure to clear this.drops.clear(); // SPIGOT-5188: make sure to clear
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index c199de89f5a3a54684800a3aa9043c0f2a511c8f..f19522287c55c2439789e37a03a68daaa3b6901f 100644 index 25890e244d8909fdd6f48e148209107a30e3382e..33274654dd7faed3642770fc1d94718f0c28bd26 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2563,6 +2563,25 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2562,6 +2562,25 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@Nullable @Nullable
public ItemEntity spawnAtLocation(ItemStack stack, float yOffset) { public ItemEntity spawnAtLocation(ItemStack stack, float yOffset) {
@ -66,7 +66,7 @@ index c199de89f5a3a54684800a3aa9043c0f2a511c8f..f19522287c55c2439789e37a03a68daa
if (stack.isEmpty()) { if (stack.isEmpty()) {
return null; return null;
} else if (this.level().isClientSide) { } else if (this.level().isClientSide) {
@@ -2570,14 +2589,21 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2569,14 +2588,21 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} else { } else {
// CraftBukkit start - Capture drops for death event // CraftBukkit start - Capture drops for death event
if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) { if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) {

View File

@ -18,10 +18,10 @@ index a043ac10834562d357ef0b5aded2e916e2a0d056..74276c368016fcc4dbf9579b2ecbadc9
@VisibleForTesting @VisibleForTesting
static long encode(double value) { static long encode(double value) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index d4cc6d189cda03ea8e5d44af0608f914078f7e6e..7f287127faf1d3a6b4b0f77800964b327ca9123f 100644 index babe11e3c76ebb725ff62d1c77744101ba9b4dec..6e084fd84c76c32319c6a321650ca2bb8332c704 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1520,10 +1520,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1519,10 +1519,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
public void updatePlayer(ServerPlayer player) { public void updatePlayer(ServerPlayer player) {
org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
if (player != this.entity) { if (player != this.entity) {

View File

@ -84,10 +84,10 @@ index caf1d79e2bbdd257a5439e2973653747e678805f..e34584e4780f343d6c946af5377088d5
public DamageSource sonicBoom(Entity attacker) { public DamageSource sonicBoom(Entity attacker) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f19522287c55c2439789e37a03a68daaa3b6901f..550434981bc395a8fba2c5bd6c4359d1dfb4d147 100644 index 33274654dd7faed3642770fc1d94718f0c28bd26..cf43f02aa705fdd71ebcdc9d028bacae73a11f42 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3263,7 +3263,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -3262,7 +3262,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return; return;
} }

View File

@ -23191,7 +23191,7 @@ index d9ad32acdf46a43a649334a3b736aeb7b3af21d1..fae17a075d7efaf24d916877dd5968eb
public static final int RADIUS_AROUND_FULL_CHUNK = FULL_CHUNK_STEP.accumulatedDependencies().getRadius(); public static final int RADIUS_AROUND_FULL_CHUNK = FULL_CHUNK_STEP.accumulatedDependencies().getRadius();
public static final int MAX_LEVEL = 33 + RADIUS_AROUND_FULL_CHUNK; public static final int MAX_LEVEL = 33 + RADIUS_AROUND_FULL_CHUNK;
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index ee597f2393c88473a72da941169e0f99c13da6ea..f6c090513f9dcc75e04e8e5b347c27f8d4d713cc 100644 index 6e084fd84c76c32319c6a321650ca2bb8332c704..f69a769b45be94e990976bb2b3d51ea0cd26a052 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -122,10 +122,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -122,10 +122,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@ -24104,9 +24104,9 @@ index ee597f2393c88473a72da941169e0f99c13da6ea..f6c090513f9dcc75e04e8e5b347c27f8
} }
public void addEntity(Entity entity) { public void addEntity(Entity entity) {
@@ -1264,6 +831,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1263,6 +830,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas());
entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker); this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
+ // Paper start - optimise entity tracker + // Paper start - optimise entity tracker
+ if (((ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity)entity).moonrise$getTrackedEntity() != null) { + if (((ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity)entity).moonrise$getTrackedEntity() != null) {
@ -24117,10 +24117,10 @@ index ee597f2393c88473a72da941169e0f99c13da6ea..f6c090513f9dcc75e04e8e5b347c27f8
playerchunkmap_entitytracker.updatePlayers(this.level.players()); playerchunkmap_entitytracker.updatePlayers(this.level.players());
if (entity instanceof ServerPlayer) { if (entity instanceof ServerPlayer) {
ServerPlayer entityplayer = (ServerPlayer) entity; ServerPlayer entityplayer = (ServerPlayer) entity;
@@ -1304,16 +877,49 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1303,16 +876,49 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker1.broadcastRemoved(); playerchunkmap_entitytracker1.broadcastRemoved();
} }
entity.tracker = null; // Paper - We're no longer tracked
+ ((ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity)entity).moonrise$setTrackedEntity(null); // Paper - optimise entity tracker + ((ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity)entity).moonrise$setTrackedEntity(null); // Paper - optimise entity tracker
} }
@ -24172,7 +24172,7 @@ index ee597f2393c88473a72da941169e0f99c13da6ea..f6c090513f9dcc75e04e8e5b347c27f8
List<ServerPlayer> list = Lists.newArrayList(); List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players(); List<ServerPlayer> list1 = this.level.players();
@@ -1420,27 +1026,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1419,27 +1025,25 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
public void waitForLightBeforeSending(ChunkPos centerPos, int radius) { public void waitForLightBeforeSending(ChunkPos centerPos, int radius) {
@ -24210,7 +24210,7 @@ index ee597f2393c88473a72da941169e0f99c13da6ea..f6c090513f9dcc75e04e8e5b347c27f8
} }
@Nullable @Nullable
@@ -1456,7 +1060,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1455,7 +1059,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
} }
@ -24219,7 +24219,7 @@ index ee597f2393c88473a72da941169e0f99c13da6ea..f6c090513f9dcc75e04e8e5b347c27f8
public final ServerEntity serverEntity; public final ServerEntity serverEntity;
final Entity entity; final Entity entity;
@@ -1464,6 +1068,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1463,6 +1067,84 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
SectionPos lastSectionPos; SectionPos lastSectionPos;
public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl public final Set<ServerPlayerConnection> seenBy = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<>(); // Paper - Perf: optimise map impl
@ -26887,7 +26887,7 @@ index 50040c497a819cd1229042ab3cb057d34a32cacc..15c5164d0ef41a978c16ee317fa73e97
+ // Paper end - block counting + // Paper end - block counting
} }
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 550434981bc395a8fba2c5bd6c4359d1dfb4d147..9f07343401a03735234b0298b92663b5b94608a8 100644 index cf43f02aa705fdd71ebcdc9d028bacae73a11f42..9928c5f0814aa2206dfe7540a3fe2465b4446359 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -167,7 +167,7 @@ import org.bukkit.event.player.PlayerTeleportEvent; @@ -167,7 +167,7 @@ import org.bukkit.event.player.PlayerTeleportEvent;
@ -26899,7 +26899,7 @@ index 550434981bc395a8fba2c5bd6c4359d1dfb4d147..9f07343401a03735234b0298b92663b5
// CraftBukkit start // CraftBukkit start
private static final int CURRENT_LEVEL = 2; private static final int CURRENT_LEVEL = 2;
@@ -456,6 +456,97 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -455,6 +455,97 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return this.dimensions.makeBoundingBox(x, y, z); return this.dimensions.makeBoundingBox(x, y, z);
} }
// Paper end // Paper end
@ -26997,7 +26997,7 @@ index 550434981bc395a8fba2c5bd6c4359d1dfb4d147..9f07343401a03735234b0298b92663b5
public Entity(EntityType<?> type, Level world) { public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet(); this.id = Entity.ENTITY_COUNTER.incrementAndGet();
@@ -1279,41 +1370,82 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1278,41 +1369,82 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
private Vec3 collide(Vec3 movement) { private Vec3 collide(Vec3 movement) {
@ -27107,7 +27107,7 @@ index 550434981bc395a8fba2c5bd6c4359d1dfb4d147..9f07343401a03735234b0298b92663b5
} }
private static float[] collectCandidateStepUpHeights(AABB collisionBox, List<VoxelShape> collisions, float f, float stepHeight) { private static float[] collectCandidateStepUpHeights(AABB collisionBox, List<VoxelShape> collisions, float f, float stepHeight) {
@@ -2629,18 +2761,75 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -2628,18 +2760,75 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public boolean isInWall() { public boolean isInWall() {
@ -27190,7 +27190,7 @@ index 550434981bc395a8fba2c5bd6c4359d1dfb4d147..9f07343401a03735234b0298b92663b5
} }
public InteractionResult interact(Player player, InteractionHand hand) { public InteractionResult interact(Player player, InteractionHand hand) {
@@ -4025,14 +4214,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4024,14 +4213,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public Iterable<Entity> getIndirectPassengers() { public Iterable<Entity> getIndirectPassengers() {
@ -27215,7 +27215,7 @@ index 550434981bc395a8fba2c5bd6c4359d1dfb4d147..9f07343401a03735234b0298b92663b5
} }
private Iterable<Entity> getIndirectPassengers_old() { private Iterable<Entity> getIndirectPassengers_old() {
// Paper end - Optimize indirect passenger iteration // Paper end - Optimize indirect passenger iteration
@@ -4397,6 +4589,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4396,6 +4588,15 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.setPosRaw(x, y, z, false); this.setPosRaw(x, y, z, false);
} }
public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) { public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) {
@ -27231,7 +27231,7 @@ index 550434981bc395a8fba2c5bd6c4359d1dfb4d147..9f07343401a03735234b0298b92663b5
if (!checkPosition(this, x, y, z)) { if (!checkPosition(this, x, y, z)) {
return; return;
} }
@@ -4528,6 +4729,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4527,6 +4728,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@Override @Override
public final void setRemoved(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) { public final void setRemoved(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) {
@ -27244,7 +27244,7 @@ index 550434981bc395a8fba2c5bd6c4359d1dfb4d147..9f07343401a03735234b0298b92663b5
CraftEventFactory.callEntityRemoveEvent(this, cause); CraftEventFactory.callEntityRemoveEvent(this, cause);
// CraftBukkit end // CraftBukkit end
final boolean alreadyRemoved = this.removalReason != null; // Paper - Folia schedulers final boolean alreadyRemoved = this.removalReason != null; // Paper - Folia schedulers
@@ -4539,7 +4746,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4538,7 +4745,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.stopRiding(); this.stopRiding();
} }
@ -27253,7 +27253,7 @@ index 550434981bc395a8fba2c5bd6c4359d1dfb4d147..9f07343401a03735234b0298b92663b5
this.levelCallback.onRemove(entity_removalreason); this.levelCallback.onRemove(entity_removalreason);
// Paper start - Folia schedulers // Paper start - Folia schedulers
if (!(this instanceof ServerPlayer) && entity_removalreason != RemovalReason.CHANGED_DIMENSION && !alreadyRemoved) { if (!(this instanceof ServerPlayer) && entity_removalreason != RemovalReason.CHANGED_DIMENSION && !alreadyRemoved) {
@@ -4570,7 +4777,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4569,7 +4776,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@Override @Override
public boolean shouldBeSaved() { public boolean shouldBeSaved() {

View File

@ -111,10 +111,10 @@ index 978208f74b6f1d3f859165e951d41013a5f00256..1196eb573317ad01b6df0ae2d38aa17a
} else { } else {
passenger.stopRiding(); passenger.stopRiding();
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 9f07343401a03735234b0298b92663b5b94608a8..b3e0c8c63eda497fc868f5691b585d5092eb169d 100644 index 9928c5f0814aa2206dfe7540a3fe2465b4446359..32502664a82dda6220f8d9fa554105740e9bc99a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -419,6 +419,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -418,6 +418,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Spigot end // Spigot end
protected int numCollisions = 0; // Paper - Cap entity collisions protected int numCollisions = 0; // Paper - Cap entity collisions
public boolean fromNetherPortal; // Paper - Add option to nerf pigmen from nether portals public boolean fromNetherPortal; // Paper - Add option to nerf pigmen from nether portals
@ -123,7 +123,7 @@ index 9f07343401a03735234b0298b92663b5b94608a8..b3e0c8c63eda497fc868f5691b585d50
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
// Paper start - Entity origin API // Paper start - Entity origin API
@javax.annotation.Nullable @javax.annotation.Nullable
@@ -1059,6 +1061,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1058,6 +1060,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} else { } else {
this.wasOnFire = this.isOnFire(); this.wasOnFire = this.isOnFire();
if (movementType == MoverType.PISTON) { if (movementType == MoverType.PISTON) {
@ -132,7 +132,7 @@ index 9f07343401a03735234b0298b92663b5b94608a8..b3e0c8c63eda497fc868f5691b585d50
movement = this.limitPistonMovement(movement); movement = this.limitPistonMovement(movement);
if (movement.equals(Vec3.ZERO)) { if (movement.equals(Vec3.ZERO)) {
return; return;
@@ -1071,6 +1075,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1070,6 +1074,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.stuckSpeedMultiplier = Vec3.ZERO; this.stuckSpeedMultiplier = Vec3.ZERO;
this.setDeltaMovement(Vec3.ZERO); this.setDeltaMovement(Vec3.ZERO);
} }

View File

@ -14,7 +14,7 @@ movement will load only the chunk the player enters anyways and avoids loading
massive amounts of surrounding chunks due to large AABB lookups. massive amounts of surrounding chunks due to large AABB lookups.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0d0b07c9199be9ca0d5ac3feb1d44f149ba69283..1aa8b914e79c0d48094cc22df60ee9750ec3ccd6 100644 index 0a97d45f96b3b3cd12fa99373fcb5999c3fba96b..e597a7ef6e702c7e3703e1ba29a7b919d1c20877 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -865,6 +865,7 @@ public abstract class PlayerList { @@ -865,6 +865,7 @@ public abstract class PlayerList {
@ -26,7 +26,7 @@ index 0d0b07c9199be9ca0d5ac3feb1d44f149ba69283..1aa8b914e79c0d48094cc22df60ee975
if (dimensiontransition.missingRespawnBlock()) { if (dimensiontransition.missingRespawnBlock()) {
entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F)); entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F));
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index abc217e9166bce12590f37aa0e21d6202596e786..1a3932aad22be42997c52ac91e19aad06a868526 100644 index 32502664a82dda6220f8d9fa554105740e9bc99a..6b4a7930efabd29f00690a79e8080faaa9767190 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -250,6 +250,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -250,6 +250,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@ -36,7 +36,7 @@ index abc217e9166bce12590f37aa0e21d6202596e786..1a3932aad22be42997c52ac91e19aad0
+ public boolean collisionLoadChunks = false; // Paper + public boolean collisionLoadChunks = false; // Paper
private CraftEntity bukkitEntity; private CraftEntity bukkitEntity;
public @org.jetbrains.annotations.Nullable net.minecraft.server.level.ChunkMap.TrackedEntity tracker; // Paper public CraftEntity getBukkitEntity() {
diff --git a/src/main/java/net/minecraft/world/level/BlockCollisions.java b/src/main/java/net/minecraft/world/level/BlockCollisions.java diff --git a/src/main/java/net/minecraft/world/level/BlockCollisions.java b/src/main/java/net/minecraft/world/level/BlockCollisions.java
index 1c10835b59aaefa3a65ff64f784620bdc54ddcdc..cd89623a44f02d7db77f0d0f87545cf80841f403 100644 index 1c10835b59aaefa3a65ff64f784620bdc54ddcdc..cd89623a44f02d7db77f0d0f87545cf80841f403 100644
--- a/src/main/java/net/minecraft/world/level/BlockCollisions.java --- a/src/main/java/net/minecraft/world/level/BlockCollisions.java

View File

@ -102,7 +102,7 @@ index a8debfad8c8e66099f8a9aedc6f1971a8576dade..7796e191747be545e744564a2b0b6579
} }
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 1aa8b914e79c0d48094cc22df60ee9750ec3ccd6..369b3485f452ac157b3ebf88b4f1970605d302d2 100644 index e597a7ef6e702c7e3703e1ba29a7b919d1c20877..ca9b909a783733f2af1e36f4ac2fd463362b9685 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -393,7 +393,7 @@ public abstract class PlayerList { @@ -393,7 +393,7 @@ public abstract class PlayerList {
@ -115,10 +115,10 @@ index 1aa8b914e79c0d48094cc22df60ee9750ec3ccd6..369b3485f452ac157b3ebf88b4f19706
this.sendLevelInfo(player, worldserver1); this.sendLevelInfo(player, worldserver1);
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 1a3932aad22be42997c52ac91e19aad06a868526..5608576f461ce9dec9827f9f581adc5d5757baf1 100644 index 6b4a7930efabd29f00690a79e8080faaa9767190..914335088ac997e3f81f1365df95d5cc2ec004b6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -685,13 +685,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -684,13 +684,42 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit start // CraftBukkit start
public void refreshEntityData(ServerPlayer to) { public void refreshEntityData(ServerPlayer to) {
@ -135,12 +135,10 @@ index 1a3932aad22be42997c52ac91e19aad06a868526..5608576f461ce9dec9827f9f581adc5d
+ // This method should only be used if the data of an entity could have become desynced + // This method should only be used if the data of an entity could have become desynced
+ // due to interactions on the client. + // due to interactions on the client.
+ public void resendPossiblyDesyncedEntityData(net.minecraft.server.level.ServerPlayer player) { + public void resendPossiblyDesyncedEntityData(net.minecraft.server.level.ServerPlayer player) {
+ if (this.tracker == null) {
+ return;
+ }
+
+ if (player.getBukkitEntity().canSee(this.getBukkitEntity())) { + if (player.getBukkitEntity().canSee(this.getBukkitEntity())) {
+ final net.minecraft.server.level.ServerEntity serverEntity = this.tracker.serverEntity; + ServerLevel world = (net.minecraft.server.level.ServerLevel)this.level();
+ net.minecraft.server.level.ChunkMap.TrackedEntity tracker = world == null ? null : world.getChunkSource().chunkMap.entityMap.get(this.getId());
+ final net.minecraft.server.level.ServerEntity serverEntity = tracker.serverEntity;
+ final List<net.minecraft.network.protocol.Packet<? super net.minecraft.network.protocol.game.ClientGamePacketListener>> list = new java.util.ArrayList<>(); + final List<net.minecraft.network.protocol.Packet<? super net.minecraft.network.protocol.game.ClientGamePacketListener>> list = new java.util.ArrayList<>();
+ serverEntity.sendPairingData(player, list::add); + serverEntity.sendPairingData(player, list::add);
+ player.connection.send(new net.minecraft.network.protocol.game.ClientboundBundlePacket(list)); + player.connection.send(new net.minecraft.network.protocol.game.ClientboundBundlePacket(list));
@ -196,7 +194,7 @@ index b586116d8cca1585f9c9e618ed4d0cb2ef2747be..acf38ef6d8de8b15cf2b09eb7bda390c
} }
entity.playSound(((Bucketable) entity).getPickupSound(), 1.0F, 1.0F); entity.playSound(((Bucketable) entity).getPickupSound(), 1.0F, 1.0F);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index b8eb9166e44da8745a056bf68f2f9316ce25d7a7..2cde808bfa797256409879505ba205a71f381981 100644 index 9ca1fee03bfa557f1df7388c6043c9ec6d02a79a..cd789c235acf740ec29c30b180e7fbe1a140caa9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1012,7 +1012,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -1012,7 +1012,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View File

@ -48,10 +48,10 @@ index 1a5e73fd97781f3903e5ef13aa0352c64fbc2cc1..4126d82e83810126eb4a41b4587dc993
entityTrackerEntry.getLastSentYRot(), entityTrackerEntry.getLastSentYRot(),
entity.getType(), entity.getType(),
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index dc64227e3b0d7855ef8870935aa437b78eea2407..4799af2ce8f44e8f99365323d57f099c551a5eb7 100644 index a183414631a2e640f68370772fe59110c30be98c..1e0a6e5a3c907ab55ee6f2780a7d43bd455f2b7b 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1269,6 +1269,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1268,6 +1268,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.serverEntity.addPairing(player); this.serverEntity.addPairing(player);
} }
// Paper end - entity tracking events // Paper end - entity tracking events

View File

@ -122,10 +122,10 @@ index 86288143a54e1d786672a81c05698b37fa5d8de2..1d74a728c03e2c6ffe0e795a5f24eac4
private void tickPassenger(Entity vehicle, Entity passenger) { private void tickPassenger(Entity vehicle, Entity passenger) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 5608576f461ce9dec9827f9f581adc5d5757baf1..f0eb2fcbaadb5796cb48050d2f9f88a6100bdb4a 100644 index 914335088ac997e3f81f1365df95d5cc2ec004b6..c0ae4b7bbeddc3e5870c73f518ef5477a3af0c35 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1086,8 +1086,43 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1083,8 +1083,43 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return this.onGround; return this.onGround;
} }
@ -169,7 +169,7 @@ index 5608576f461ce9dec9827f9f581adc5d5757baf1..f0eb2fcbaadb5796cb48050d2f9f88a6
if (this.noPhysics) { if (this.noPhysics) {
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
} else { } else {
@@ -1257,6 +1292,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -1254,6 +1289,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.level().getProfiler().pop(); this.level().getProfiler().pop();
} }
} }
@ -183,7 +183,7 @@ index 5608576f461ce9dec9827f9f581adc5d5757baf1..f0eb2fcbaadb5796cb48050d2f9f88a6
} }
private boolean isStateClimbable(BlockState state) { private boolean isStateClimbable(BlockState state) {
@@ -4550,7 +4592,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4547,7 +4589,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
public void setDeltaMovement(Vec3 velocity) { public void setDeltaMovement(Vec3 velocity) {
@ -193,7 +193,7 @@ index 5608576f461ce9dec9827f9f581adc5d5757baf1..f0eb2fcbaadb5796cb48050d2f9f88a6
} }
public void addDeltaMovement(Vec3 velocity) { public void addDeltaMovement(Vec3 velocity) {
@@ -4656,7 +4700,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -4653,7 +4697,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
} }
// Paper end - Fix MC-4 // Paper end - Fix MC-4
if (this.position.x != x || this.position.y != y || this.position.z != z) { if (this.position.x != x || this.position.y != y || this.position.z != z) {