(FINAL 1.16.2) Improve Entity Activation Range passenger behavior

Previously, Entity Activation Range only applied to the root entity of a vehicle chain.
If that vehicle is active, every entity as it's passenger would then tick.

This creates scenarios where EAR does not apply your desired ranges to passengers.
Additionally, any entity that was a passenger never had its inactiveTick method called
when the parent was inactive, creating behavioral desyncs.

This could of been a source of many villager issues when those villagers were in minecarts
as players commonly do.

Now we will process passengers checking their activation state independently of their vehicle
and if they are inactive, call their inactiveTick() method to ensure state remains consistent.

This also helps improve any desync issues with entity position of passengers too.

This also removes immunity for passenger/vehicles, so it should improve performance
of these minecart villagers too for EAR.
This commit is contained in:
Aikar 2020-09-10 18:09:10 -04:00
parent 6fda3fd0ed
commit fa9c5e0f95
No known key found for this signature in database
GPG Key ID: 401ADFC9891FAAFE
18 changed files with 155 additions and 57 deletions

View File

@ -14,10 +14,10 @@ Adds flying monsters to control ghast and phantoms
Adds villagers as separate config
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index fa67a0308d9fc89652a66af35919685fab06553d..884049750af9887cd15d4af9bbcb57265dcd319d 100644
index ca24d27cbc3100e989bf26c0f3f57cad3f97c11f..5263e219ab6c334e55fa4188e7f71594ec764e91 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -165,7 +165,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -163,7 +163,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public boolean Y;
public boolean impulse;
public int portalCooldown;
@ -26,7 +26,7 @@ index fa67a0308d9fc89652a66af35919685fab06553d..884049750af9887cd15d4af9bbcb5726
protected int portalTicks;
protected BlockPosition ac;
private boolean invulnerable;
@@ -189,6 +189,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -186,6 +186,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState;
public long activatedTick = Integer.MIN_VALUE;
@ -34,7 +34,7 @@ index fa67a0308d9fc89652a66af35919685fab06553d..884049750af9887cd15d4af9bbcb5726
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
protected int numCollisions = 0; // Paper
public void inactiveTick() { }
@@ -578,6 +579,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -575,6 +576,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.recalcPosition();
} else {
if (enummovetype == EnumMoveType.PISTON) {
@ -42,7 +42,7 @@ index fa67a0308d9fc89652a66af35919685fab06553d..884049750af9887cd15d4af9bbcb5726
vec3d = this.b(vec3d);
if (vec3d.equals(Vec3D.a)) {
return;
@@ -590,6 +592,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -587,6 +589,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.x = Vec3D.a;
this.setMot(Vec3D.a);
}
@ -56,7 +56,15 @@ index fa67a0308d9fc89652a66af35919685fab06553d..884049750af9887cd15d4af9bbcb5726
vec3d = this.a(vec3d, enummovetype);
Vec3D vec3d1 = this.g(vec3d);
@@ -2712,6 +2721,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1909,6 +1918,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
}
+ public void syncPositionOf(Entity entity) { k(entity); } // Paper - OBFHELPER
public void k(Entity entity) {
this.a(entity, Entity::setPosition);
}
@@ -2709,6 +2719,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return this.ae;
}
@ -342,8 +350,98 @@ index 930e41935e0ef1af37eafca005d4e492c3b72a6f..8afacfb8d5f4efd2ad6f95fbb7b0d62e
public boolean populating;
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a16e64735b7d4c9b65c9d4cb2cdf56cf3e478f5f..49409f15b35f5f42f1f34824b80e0828fd655b56 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -743,17 +743,17 @@ public class WorldServer extends World implements GeneratorAccessSeed {
++TimingHistory.entityTicks; // Paper - timings
// Spigot start
co.aikar.timings.Timing timer; // Paper
- if (!org.spigotmc.ActivationRange.checkIfActive(entity)) {
+ /*if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { // Paper - comment out - EAR 2, reimplement below
entity.ticksLived++;
timer = entity.getEntityType().inactiveTickTimer.startTiming(); try { // Paper - timings
entity.inactiveTick();
} finally { timer.stopTiming(); } // Paper
return;
- }
+ }*/ // Paper - comment out EAR 2
// Spigot end
// Paper start- timings
- TimingHistory.activatedEntityTicks++;
- timer = entity.getVehicle() != null ? entity.getEntityType().passengerTickTimer.startTiming() : entity.getEntityType().tickTimer.startTiming();
+ final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity);
+ timer = isActive ? entity.getEntityType().tickTimer.startTiming() : entity.getEntityType().inactiveTickTimer.startTiming(); // Paper
try {
// Paper end - timings
entity.g(entity.locX(), entity.locY(), entity.locZ());
@@ -767,12 +767,16 @@ public class WorldServer extends World implements GeneratorAccessSeed {
return IRegistry.ENTITY_TYPE.getKey(entity.getEntityType()).toString();
});
gameprofilerfiller.c("tickNonPassenger");
+ if (isActive) { // Paper - EAR 2
+ TimingHistory.activatedEntityTicks++; // Paper
entity.tick();
entity.postTick(); // CraftBukkit
+ } else { entity.inactiveTick(); } // Paper - EAR 2
gameprofilerfiller.exit();
}
this.chunkCheck(entity);
+ } finally { timer.stopTiming(); } // Paper - timings
if (entity.inChunk) {
Iterator iterator = entity.getPassengers().iterator();
@@ -782,7 +786,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.a(entity, entity1);
}
}
- } finally { timer.stopTiming(); } // Paper - timings
+ //} finally { timer.stopTiming(); } // Paper - timings - move up
}
}
@@ -790,6 +794,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
public void a(Entity entity, Entity entity1) {
if (!entity1.dead && entity1.getVehicle() == entity) {
if (entity1 instanceof EntityHuman || this.getChunkProvider().a(entity1)) {
+ // Paper - EAR 2
+ final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(entity1);
+ co.aikar.timings.Timing timer = isActive ? entity1.getEntityType().passengerTickTimer.startTiming() : entity1.getEntityType().passengerInactiveTickTimer.startTiming(); // Paper
+ try {
+ // Paper end
entity1.g(entity1.locX(), entity1.locY(), entity1.locZ());
entity1.lastYaw = entity1.yaw;
entity1.lastPitch = entity1.pitch;
@@ -801,7 +810,16 @@ public class WorldServer extends World implements GeneratorAccessSeed {
return IRegistry.ENTITY_TYPE.getKey(entity1.getEntityType()).toString();
});
gameprofilerfiller.c("tickPassenger");
+ // Paper start - EAR 2
+ if (isActive) {
entity1.passengerTick();
+ } else {
+ entity1.setMot(Vec3D.a);
+ entity1.inactiveTick();
+ // copied from inside of if (isPassenger()) of passengerTick, but that ifPassenger is unnecessary
+ entity.syncPositionOf(entity1);
+ }
+ // Paper end - EAR 2
gameprofilerfiller.exit();
}
@@ -814,7 +832,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.a(entity1, entity2);
}
- }
+ } } finally { timer.stopTiming(); } // Paper - EAR2 timings
}
} else {
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index b73af0a5fb2d08c2f3a52c699ef0d8ed34c83f77..119a9c1e400ada270d0d97bea4170a8238d9c17d 100644
index b73af0a5fb2d08c2f3a52c699ef0d8ed34c83f77..9030284ba06dfdcc17c2710f428e84d70afea8d5 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -2,24 +2,34 @@ package org.spigotmc;
@ -589,7 +687,7 @@ index b73af0a5fb2d08c2f3a52c699ef0d8ed34c83f77..119a9c1e400ada270d0d97bea4170a82
if ( !( entity instanceof EntityArrow ) )
{
- if ( !entity.isOnGround() || !entity.passengers.isEmpty() || entity.isPassenger() )
+ if ( (!entity.isOnGround() && !(entity instanceof EntityFlying)) || !entity.passengers.isEmpty() || entity.isPassenger() )
+ if ( (!entity.isOnGround() && !(entity instanceof EntityFlying)) ) // Paper - remove passengers logic
{
- return true;
+ return 10; // Paper

View File

@ -13,10 +13,10 @@ Quickly loading the exact world spawn chunk before searching the
heightmap resolves the issue without having to load all spawn chunks.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 884049750af9887cd15d4af9bbcb57265dcd319d..260e87eaec644c5b18c22a6638ef7e5d7f7b786b 100644
index 5263e219ab6c334e55fa4188e7f71594ec764e91..8691592c64dc0a93e6de7fbd12ad53402919e6b5 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -2623,6 +2623,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -2621,6 +2621,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
BlockPosition blockposition1;
if (flag1) {

View File

@ -32,10 +32,10 @@ index a224a04ee1bb9705166913ef1c66aa031d87c270..4132cd4c6f13cfa1c0cda43daaa908ff
}
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 260e87eaec644c5b18c22a6638ef7e5d7f7b786b..14b860e6ba4cde37aa0a6d854187be5765acfa91 100644
index dc36365eccdee169a3077f643fc2a11e6f4958cc..116bb4e3a1386516c375a72429d464da1c9a553b 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -191,6 +191,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -188,6 +188,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public long activatedTick = Integer.MIN_VALUE;
public boolean isTemporarilyActive = false; // Paper
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
@ -43,7 +43,7 @@ index 260e87eaec644c5b18c22a6638ef7e5d7f7b786b..14b860e6ba4cde37aa0a6d854187be57
protected int numCollisions = 0; // Paper
public void inactiveTick() { }
// Spigot end
@@ -1602,6 +1603,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1599,6 +1600,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
if (spawnedViaMobSpawner) {
nbttagcompound.setBoolean("Paper.FromMobSpawner", true);
}
@ -53,7 +53,7 @@ index 260e87eaec644c5b18c22a6638ef7e5d7f7b786b..14b860e6ba4cde37aa0a6d854187be57
// Paper end
return nbttagcompound;
} catch (Throwable throwable) {
@@ -1727,6 +1731,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1724,6 +1728,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
spawnedViaMobSpawner = nbttagcompound.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status

View File

@ -11,10 +11,10 @@ Vs behavior of non ticking of just overwriting state.
We will now simply log a warning when this happens instead of crashing the server.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 14b860e6ba4cde37aa0a6d854187be5765acfa91..6eebc30671f419f337b9c872cca7b75d10943c2c 100644
index bb13cf725eaa3eeae63f38576681862382422481..90ffcf8ffedcaa6d67c857b814b582fdb9924a8f 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -61,6 +61,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -59,6 +59,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
// Paper start
@ -23,7 +23,7 @@ index 14b860e6ba4cde37aa0a6d854187be5765acfa91..6eebc30671f419f337b9c872cca7b75d
private boolean locked = false;
@Override
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 4e9bfa66f2ed110c71c865c05d4573d2df84489c..62b2a4d38102b1ffbda4d2fc031350a51fcf180c 100644
index b37fe3fbd4ec15c05701db1f07add903af967be4..1046a6aebfd7a76af4319bc325a9f55be850dd06 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -531,6 +531,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@ -34,7 +34,7 @@ index 4e9bfa66f2ed110c71c865c05d4573d2df84489c..62b2a4d38102b1ffbda4d2fc031350a5
this.registerEntity(entity2);
}
@@ -1265,6 +1266,19 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1286,6 +1287,19 @@ public class WorldServer extends World implements GeneratorAccessSeed {
public void unregisterEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity unregister"); // Spigot
@ -54,7 +54,7 @@ index 4e9bfa66f2ed110c71c865c05d4573d2df84489c..62b2a4d38102b1ffbda4d2fc031350a5
// Spigot start
if ( entity instanceof EntityHuman )
{
@@ -1331,9 +1345,21 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1352,9 +1366,21 @@ public class WorldServer extends World implements GeneratorAccessSeed {
private void registerEntity(Entity entity) {
org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot

View File

@ -15,10 +15,10 @@ Combine that with a buggy detail of the previous implementation of
the Dupe UUID patch, then this was the likely source of the "Ghost entities"
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 62b2a4d38102b1ffbda4d2fc031350a51fcf180c..ab955f3eaada8017116b99840e2519fd3429cf23 100644
index 1046a6aebfd7a76af4319bc325a9f55be850dd06..8909fa8e17f4fab7d212804b0c393181441726d9 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1424,9 +1424,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1445,9 +1445,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
private void removeEntityFromChunk(Entity entity) {

View File

@ -26,10 +26,10 @@ index 512940ef8608d28c83a4a8d0777a99ebf25b4e8b..f839091ae4385e763a19d680585a9363
EntityTypes<?> entitytypes = entity.getEntityType();
int i = entitytypes.getChunkRange() * 16;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index ab955f3eaada8017116b99840e2519fd3429cf23..c479d9ebeb6e98d091b4e68d59bc5fa6980947ca 100644
index 8909fa8e17f4fab7d212804b0c393181441726d9..7dce9eef4075c3e4bdbf9e2eca77ae8752a76461 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1390,7 +1390,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1411,7 +1411,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
}
@ -38,7 +38,7 @@ index ab955f3eaada8017116b99840e2519fd3429cf23..c479d9ebeb6e98d091b4e68d59bc5fa6
// CraftBukkit start - SPIGOT-5278
if (entity instanceof EntityDrowned) {
this.navigators.add(((EntityDrowned) entity).navigationWater);
@@ -1401,6 +1401,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1422,6 +1422,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.navigators.add(((EntityInsentient) entity).getNavigation());
}
entity.valid = true; // CraftBukkit

View File

@ -14,10 +14,10 @@ movement will load only the chunk the player enters anyways and avoids loading
massive amounts of surrounding chunks due to large AABB lookups.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 6eebc30671f419f337b9c872cca7b75d10943c2c..017e8ba5abbb5463357902cc66e46caf639f048e 100644
index da1019d40b6b1dcfdae24be24980ea2b4f2a1aee..19749ae61a3b71f92e64f472bc1575bdcbd1c086 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -82,6 +82,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -80,6 +80,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
private CraftEntity bukkitEntity;
PlayerChunkMap.EntityTracker tracker; // Paper

View File

@ -18,10 +18,10 @@ index 4c4e6e154e0db23662484d6aa03f1d762a48badb..893a835593af2ea95a50607c8c2f2cdb
boolean flag1 = this.playerChunkMap.b();
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 017e8ba5abbb5463357902cc66e46caf639f048e..26c2adb04d995bf5c5ba4c5eee471be067bf8ac4 100644
index 19749ae61a3b71f92e64f472bc1575bdcbd1c086..a1da42cb757cec0114e1c4f435e342291c9143d8 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1284,7 +1284,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1281,7 +1281,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.lastY = d1;
this.lastZ = d4;
this.setPosition(d3, d1, d4);
@ -31,7 +31,7 @@ index 017e8ba5abbb5463357902cc66e46caf639f048e..26c2adb04d995bf5c5ba4c5eee471be0
public void d(Vec3D vec3d) {
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 7f9bd9a35e5164294a0cfedaf540544c70d0df09..824f074740ad063815ca80dce679ceb532c8edc2 100644
index 8b0037594df8d76c98c2285f5a63662aef4e3202..6db4d587c69af406d949c3d1ed73724a5bd2889d 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -44,6 +44,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -73,7 +73,7 @@ index 0cb8f5a4a5cc5e302815af4c1ed325dfbc75235b..456cb9feebc8afef50cefb85b4d4c1da
if (entityplayer != null) {
this.g = LoginListener.EnumProtocolState.DELAY_ACCEPT;
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 71920337361847f677533703229afa97d7067319..dbe1d5f2fa43715e658377a6765e0a53093ede76 100644
index 0a08705bebce75888806ecd35b53de4397ae0bac..c7d88d9c190f0604189e6bfabc0250453b1a68c9 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -70,6 +70,7 @@ public class PlayerConnection implements PacketListenerPlayIn {

View File

@ -7,10 +7,10 @@ The code following this has better support for null worlds to move
them back to the world spawn.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 26c2adb04d995bf5c5ba4c5eee471be067bf8ac4..b21770e8549ed02ff68656584ecec1cf023542c5 100644
index a1da42cb757cec0114e1c4f435e342291c9143d8..24f8252bf449e27ab7d816288a43e9ad6b282e9a 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1717,9 +1717,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1714,9 +1714,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
bworld = server.getWorld(worldName);
}

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.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index b21770e8549ed02ff68656584ecec1cf023542c5..112eb6e2568e535ae83cfb832d3b0fc1e46bef65 100644
index b1e064342aba168c3eb324e97b4b4239a50f19c3..e68102fe55ce6826cd66f8bf7ca42b65ec6932d8 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1873,11 +1873,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1870,11 +1870,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
} else {
// CraftBukkit start - Capture drops for death event
if (this instanceof EntityLiving && !((EntityLiving) this).forceDrops) {
@ -34,7 +34,7 @@ index b21770e8549ed02ff68656584ecec1cf023542c5..112eb6e2568e535ae83cfb832d3b0fc1
entityitem.defaultPickupDelay();
// CraftBukkit start
@@ -2520,6 +2521,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -2518,6 +2519,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@Nullable
public Entity teleportTo(WorldServer worldserver, BlockPosition location) {
// CraftBukkit end
@ -47,7 +47,7 @@ index b21770e8549ed02ff68656584ecec1cf023542c5..112eb6e2568e535ae83cfb832d3b0fc1
if (this.world instanceof WorldServer && !this.dead) {
this.world.getMethodProfiler().enter("changeDimension");
// CraftBukkit start
@@ -2555,7 +2562,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -2553,7 +2560,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
entity.bukkitEntity = this.getBukkitEntity();
if (this instanceof EntityInsentient) {
@ -56,7 +56,7 @@ index b21770e8549ed02ff68656584ecec1cf023542c5..112eb6e2568e535ae83cfb832d3b0fc1
}
// CraftBukkit end
}
@@ -2675,7 +2682,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -2673,7 +2680,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public boolean canPortal() {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Use distance map to optimise entity tracker
Use the distance map to find candidate players for tracking.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 112eb6e2568e535ae83cfb832d3b0fc1e46bef65..105fe1f32270bda3343a75b46b6eb89102174ca6 100644
index aabca4c8480c3960c123d6aee5ab50a2e9af551f..b7f4821476c184cebc6eeb91b5c6169314e3590a 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -208,6 +208,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -205,6 +205,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
// CraftBukkit end

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Ensure Entity AABB's are never invalid
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 105fe1f32270bda3343a75b46b6eb89102174ca6..3190ed02f56587b565fe3f5b151ef44bd60401ff 100644
index e36cb29de4ddc0d82e4b964042fed91cee0ad750..8f72b54d44fc92a8de801e7d83ad8734f08df5d4 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -391,7 +391,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -388,7 +388,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
public void setPosition(double d0, double d1, double d2) {
this.setPositionRaw(d0, d1, d2);
@ -17,7 +17,7 @@ index 105fe1f32270bda3343a75b46b6eb89102174ca6..3190ed02f56587b565fe3f5b151ef44b
if (valid) ((WorldServer) world).chunkCheck(this); // CraftBukkit
}
@@ -2885,6 +2885,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -2883,6 +2883,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return new AxisAlignedBB(vec3d, vec3d1);
}
@ -25,7 +25,7 @@ index 105fe1f32270bda3343a75b46b6eb89102174ca6..3190ed02f56587b565fe3f5b151ef44b
public void a(AxisAlignedBB axisalignedbb) {
// CraftBukkit start - block invalid bounding boxes
double minX = axisalignedbb.minX,
@@ -3323,6 +3324,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -3321,6 +3322,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public void setPositionRaw(double d0, double d1, double d2) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Optimize WorldBorder collision checks and air
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 3190ed02f56587b565fe3f5b151ef44bd60401ff..f3ba97f58b8953e3bafd9f2c9d6541a1b5b13700 100644
index 75fcdc47a29691336c362683519f3cdd397d60c1..e064a1560c9d6438563858c468bf989a53131dab 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -819,7 +819,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -816,7 +816,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
AxisAlignedBB axisalignedbb = this.getBoundingBox();
VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a(this);
VoxelShape voxelshape = this.world.getWorldBorder().c();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add entity liquid API
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index f3ba97f58b8953e3bafd9f2c9d6541a1b5b13700..45e7e30892d031df42ae72de28ba4bbe8e1a6cd5 100644
index e064a1560c9d6438563858c468bf989a53131dab..013ae4264eae85eb967839e005acb0d3c343b7c8 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1076,12 +1076,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1073,12 +1073,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return this.inWater;
}
@ -23,7 +23,7 @@ index f3ba97f58b8953e3bafd9f2c9d6541a1b5b13700..45e7e30892d031df42ae72de28ba4bbe
private boolean k() {
return this.world.getType(this.getChunkCoordinates()).a(Blocks.BUBBLE_COLUMN);
}
@@ -1095,6 +1096,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1092,6 +1093,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return this.isInWater() || this.isInRain() || this.k();
}
@ -31,7 +31,7 @@ index f3ba97f58b8953e3bafd9f2c9d6541a1b5b13700..45e7e30892d031df42ae72de28ba4bbe
public boolean aG() {
return this.isInWater() || this.k();
}
@@ -1237,6 +1239,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1234,6 +1236,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
return this.O == tag;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix incorrect return for WorldServer#addAllEntitiesSafely
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index a21ce4855187b771b1c8a1ca3f914026d7b92e3a..923efc17beb57688c956026c90aa86299331c8f9 100644
index 188e825bee60e441579bd0746246a6c353858991..3a9230577ffd31c4a91fca239684ec01ac2b3874 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1236,7 +1236,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1257,7 +1257,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
if (entity.co().anyMatch(this::isUUIDTaken)) {
return false;
} else {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 923efc17beb57688c956026c90aa86299331c8f9..efe10b7f587810749038b67db14af0bf8b9b4374 100644
index 3a9230577ffd31c4a91fca239684ec01ac2b3874..674e1a61c30257645400ceece1b0aac3816218f8 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1841,12 +1841,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1862,12 +1862,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
// Paper end

View File

@ -18,7 +18,7 @@ index a45ceff9ff970b996b2767379a2ecd4693f52d3a..4b4f14711d483089a5d5478b57539911
if (this.name == null) {
this.name = SystemUtils.a("block", IRegistry.BLOCK.getKey(this));
diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java
index 2767de830bdb9051ae6a6b7c30342175b117e7ed..e23247e0a8b923ff7805f9ec894584818a447827 100644
index 5c03fb3af34e13bc3b8bc1840c5a7e229cf9d1f7..a71ad8418e08dd506fa6b912eaed725567ac4648 100644
--- a/src/main/java/net/minecraft/server/EntityTypes.java
+++ b/src/main/java/net/minecraft/server/EntityTypes.java
@@ -147,6 +147,7 @@ public class EntityTypes<T extends Entity> {
@ -29,7 +29,7 @@ index 2767de830bdb9051ae6a6b7c30342175b117e7ed..e23247e0a8b923ff7805f9ec89458481
public static Optional<EntityTypes<?>> a(String s) {
return IRegistry.ENTITY_TYPE.getOptional(MinecraftKey.a(s));
}
@@ -275,6 +276,7 @@ public class EntityTypes<T extends Entity> {
@@ -285,6 +286,7 @@ public class EntityTypes<T extends Entity> {
return this.bg;
}

View File

@ -9,10 +9,10 @@ as this is how Vanilla teleports entities.
Cancel any pending motion when teleported.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 45e7e30892d031df42ae72de28ba4bbe8e1a6cd5..1ee01486f880992c2694f1dd637e9828b1d40c2d 100644
index 013ae4264eae85eb967839e005acb0d3c343b7c8..50f9df315d91446b78efaa9bb76719213427a563 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1318,6 +1318,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@@ -1315,6 +1315,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public void setPositionRotation(double d0, double d1, double d2, float f, float f1) {