Skip to content

Commit

Permalink
Revert "re-add distance map patch"
Browse files Browse the repository at this point in the history
This reverts commit 81c5901.
  • Loading branch information
kennytv committed Sep 22, 2023
1 parent 81c5901 commit b3ec8bd
Show file tree
Hide file tree
Showing 611 changed files with 158 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Ensure Entity AABB's are never invalid


diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b80e8f05a8f99cc912904470c31092faad0717da..f2faddf78b5ea591f66d92d9e0f2b7984a3c2124 100644
index 1d2dd9b8ae43f22d875cb530130118df247b87dc..d4d151fd8b500e32ca5c0f866bd28d3b5cf68633 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -721,8 +721,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -688,8 +688,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}

public void setPos(double x, double y, double z) {
Expand All @@ -19,7 +19,7 @@ index b80e8f05a8f99cc912904470c31092faad0717da..f2faddf78b5ea591f66d92d9e0f2b798
}

protected AABB makeBoundingBox() {
@@ -4223,6 +4223,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4190,6 +4190,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}

public final void setPosRaw(double x, double y, double z) {
Expand All @@ -31,7 +31,7 @@ index b80e8f05a8f99cc912904470c31092faad0717da..f2faddf78b5ea591f66d92d9e0f2b798
// Paper start - rewrite chunk system
if (this.updatingSectionStatus) {
LOGGER.error("Refusing to update position for entity " + this + " to position " + new Vec3(x, y, z) + " since it is processing a section status update", new Throwable());
@@ -4246,6 +4251,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4213,6 +4218,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.levelCallback.onMove();
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ index 1cf17df6cad66c4b27e1636f365024c9e1e080f1..e7d584a4a5618c8d70ed7b74bc94b6c2
}

diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f2faddf78b5ea591f66d92d9e0f2b7984a3c2124..2d416d0d657667d857794bafa315c720dee9762a 100644
index d4d151fd8b500e32ca5c0f866bd28d3b5cf68633..b0a73ddd7438b9ecd4462638f9f784d796c62c6c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -159,6 +159,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -158,6 +158,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {

// CraftBukkit start
private static final int CURRENT_LEVEL = 2;
+ public boolean preserveMotion = true; // Paper - keep initial motion on first setPositionRotation
static boolean isLevelAtLeast(CompoundTag tag, int level) {
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
}
@@ -1864,6 +1865,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -1831,6 +1832,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}

public void moveTo(double x, double y, double z, float yaw, float pitch) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
index 2d416d0d657667d857794bafa315c720dee9762a..c78df4fc62a347455f8d7b3aa186344863915ab3 100644
index b0a73ddd7438b9ecd4462638f9f784d796c62c6c..71dc4112cb932c6b1305f0f22e99f069517cac08 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4472,4 +4472,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4439,4 +4439,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {

void accept(Entity entity, double x, double y, double z);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
index c78df4fc62a347455f8d7b3aa186344863915ab3..658e47bf5aff1e56462cc3f0a87eeb7349654176 100644
index 71dc4112cb932c6b1305f0f22e99f069517cac08..cfdc8c37d41473300ca9a8c251e27cb2a07ca4c7 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4477,5 +4477,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4444,5 +4444,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public static int nextEntityId() {
return ENTITY_COUNTER.incrementAndGet();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
index 658e47bf5aff1e56462cc3f0a87eeb7349654176..c35d22e4d54abcb16b7ec932729d2f177fd4a14b 100644
index cfdc8c37d41473300ca9a8c251e27cb2a07ca4c7..5705dd4c89c2e57540a2eaec0568e45e1947d8c6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2057,6 +2057,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2024,6 +2024,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}

public boolean isPushable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ index 05ac41e136da43284fb24a6b698ebd36318278fb..33d9131e9c75ef23cd637f5d6c39a270

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
index c35d22e4d54abcb16b7ec932729d2f177fd4a14b..3acaa05743373b818ba70a0229c6afe63bfd1a97 100644
index 5705dd4c89c2e57540a2eaec0568e45e1947d8c6..0d96f40ca4d08197f101a31cca7e334525542565 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4248,6 +4248,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4215,6 +4215,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return;
}
// Paper end - rewrite chunk system
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
index 3acaa05743373b818ba70a0229c6afe63bfd1a97..6277b3a553a6fe65a11d678701cb4615ec3e3cc6 100644
index 0d96f40ca4d08197f101a31cca7e334525542565..027e4f9f9f3464af8f21cf1f67019aec15666c47 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1927,6 +1927,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -1894,6 +1894,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public void push(Entity entity) {
if (!this.isPassengerOfSameVehicle(entity)) {
if (!entity.noPhysics && !this.noPhysics) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Move the tick logic into the post tick, where portaling was
designed to happen in the first place.

diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 6277b3a553a6fe65a11d678701cb4615ec3e3cc6..e18bb85e7035917f49f8cba20ad362a994e2336c 100644
index 027e4f9f9f3464af8f21cf1f67019aec15666c47..e2f96c7259df87687cd1f560e46c4fb34d78e126 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -515,6 +515,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this));
}
// Paper end - optimise entity tracking
@@ -482,6 +482,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {

public boolean updatingSectionStatus = false;
// Paper end
+ // Paper start - make end portalling safe
+ public BlockPos portalBlock;
+ public ServerLevel portalWorld;
Expand Down Expand Up @@ -51,7 +51,7 @@ index 6277b3a553a6fe65a11d678701cb4615ec3e3cc6..e18bb85e7035917f49f8cba20ad362a9

public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
@@ -2871,6 +2901,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2838,6 +2868,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}

this.processPortalCooldown();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
index e18bb85e7035917f49f8cba20ad362a994e2336c..5c9af4e6278df2299383946c10fad5e54e7f7262 100644
index e2f96c7259df87687cd1f560e46c4fb34d78e126..5dc20ea46909eac7bb02bc6594a614621b11cf63 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3909,20 +3909,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3876,20 +3876,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}

private Stream<Entity> getIndirectPassengersStream() {
Expand Down Expand Up @@ -43,7 +43,7 @@ index e18bb85e7035917f49f8cba20ad362a994e2336c..5c9af4e6278df2299383946c10fad5e5
return () -> {
return this.getIndirectPassengersStream().iterator();
};
@@ -3939,6 +3953,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3906,6 +3920,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
// Paper end - rewrite chunk system

public boolean hasExactlyOnePlayerPassenger() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
index 5c9af4e6278df2299383946c10fad5e54e7f7262..02b4736bc9f6f5ffb01ddc9db18c5efb9f67647e 100644
index 5dc20ea46909eac7bb02bc6594a614621b11cf63..3b7e54b4348f0486e43b4f7930ada0a16e989650 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3365,6 +3365,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3332,6 +3332,28 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} else {
// CraftBukkit start
worldserver = shapedetectorshape.world;
Expand Down Expand Up @@ -37,7 +37,7 @@ index 5c9af4e6278df2299383946c10fad5e54e7f7262..02b4736bc9f6f5ffb01ddc9db18c5efb
if (worldserver == this.level) {
// SPIGOT-6782: Just move the entity if a plugin changed the world to the one the entity is already in
this.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, shapedetectorshape.xRot);
@@ -3384,8 +3406,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3351,8 +3373,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {

if (entity != null) {
entity.restoreFrom(this);
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Subject: [PATCH] Add Raw Byte Entity Serialization
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
index 02b4736bc9f6f5ffb01ddc9db18c5efb9f67647e..30d0bd2590cd6f091076d3bb826e20c9ca710a1c 100644
index 3b7e54b4348f0486e43b4f7930ada0a16e989650..6512c3ca611233f7541c1d0119521e05f524615a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2146,6 +2146,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2113,6 +2113,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Reference2BooleanOpenHashMap is going to have
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
index e2b4567a8abc5a6217f4926733c6749edd83029d..6d89e10b33591bc09832064cfac7090cbabc4a8c 100644
index 463a82f08b7848a4b8a4eb89b201a6e8424c6831..93a2dfca4484d1bdfa00dfb2cf8d94314123aeb8 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1310,7 +1310,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1210,7 +1210,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
final Entity entity;
private final int range;
SectionPos lastSectionPos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ index 7074c1e7d7d33dafc0e69f5ab2630e47b7ad1795..cbebd94026be140f4d0d913596e5a6d4

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
index 30d0bd2590cd6f091076d3bb826e20c9ca710a1c..e8dd1f8b4f399624f134a814f4bd513db954021a 100644
index 6512c3ca611233f7541c1d0119521e05f524615a..c02d5e6efcc8d8403b02acb37acb4071f0f33267 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1024,7 +1024,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -991,7 +991,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return this.onGround;
}

Expand Down Expand Up @@ -168,7 +168,7 @@ index 30d0bd2590cd6f091076d3bb826e20c9ca710a1c..e8dd1f8b4f399624f134a814f4bd513d
if (this.noPhysics) {
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
} else {
@@ -1194,6 +1229,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -1161,6 +1196,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.level().getProfiler().pop();
}
}
Expand All @@ -182,7 +182,7 @@ index 30d0bd2590cd6f091076d3bb826e20c9ca710a1c..e8dd1f8b4f399624f134a814f4bd513d
}

private boolean isStateClimbable(BlockState state) {
@@ -4251,7 +4293,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4218,7 +4260,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}

public void setDeltaMovement(Vec3 velocity) {
Expand All @@ -192,7 +192,7 @@ index 30d0bd2590cd6f091076d3bb826e20c9ca710a1c..e8dd1f8b4f399624f134a814f4bd513d
}

public void addDeltaMovement(Vec3 velocity) {
@@ -4337,7 +4381,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4304,7 +4348,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
// Paper end - fix MC-4
if (this.position.x != x || this.position.y != y || this.position.z != z) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ This is because bukkit uses a separate head rotation field for yaw.
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
index e8dd1f8b4f399624f134a814f4bd513db954021a..95039581fe8ed6787d262c330ab524683c464184 100644
index c02d5e6efcc8d8403b02acb37acb4071f0f33267..51d4870a563ab978b46c07a8e51e2b6849992269 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1911,6 +1911,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -1878,6 +1878,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F);
this.yRotO = this.getYRot();
this.xRotO = this.getXRot();
+ this.setYHeadRot(yaw); // Paper - Update head rotation
}

public void absMoveTo(double x, double y, double z) {
@@ -1949,6 +1950,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -1916,6 +1917,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.setXRot(pitch);
this.setOldPosAndRot();
this.reapplyPosition();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
index 95039581fe8ed6787d262c330ab524683c464184..0312b0c46b941b7bbfd0bf13355f8bd2cf7bc7e3 100644
index 51d4870a563ab978b46c07a8e51e2b6849992269..4b135772f8346103c2e6e1473af95f0bfa9754ef 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -787,7 +787,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -754,7 +754,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
// CraftBukkit start
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
Expand Down
Loading

0 comments on commit b3ec8bd

Please sign in to comment.