Skip to content

Commit 873afea

Browse files
committed
Update Paper
1 parent b05f1ef commit 873afea

File tree

3 files changed

+68
-68
lines changed

3 files changed

+68
-68
lines changed

folia-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch

+24-24
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
private EntityDimensions dimensions;
2828
private float eyeHeight;
2929
public boolean isInPowderSnow;
30-
@@ -525,6 +_,23 @@
30+
@@ -521,6 +_,23 @@
3131
}
3232
}
3333
// Paper end - optimise entity tracker
@@ -51,7 +51,7 @@
5151

5252
public Entity(EntityType<?> entityType, Level level) {
5353
this.type = entityType;
54-
@@ -655,8 +_,7 @@
54+
@@ -651,8 +_,7 @@
5555
// due to interactions on the client.
5656
public void resendPossiblyDesyncedEntityData(net.minecraft.server.level.ServerPlayer player) {
5757
if (player.getBukkitEntity().canSee(this.getBukkitEntity())) {
@@ -61,7 +61,7 @@
6161
if (tracker == null) {
6262
return;
6363
}
64-
@@ -823,7 +_,7 @@
64+
@@ -819,7 +_,7 @@
6565
public void postTick() {
6666
// 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
6767
if (!(this instanceof ServerPlayer) && this.isAlive()) { // Paper - don't attempt to teleport dead entities
@@ -70,7 +70,7 @@
7070
}
7171
}
7272
// CraftBukkit end
73-
@@ -841,7 +_,7 @@
73+
@@ -837,7 +_,7 @@
7474
this.boardingCooldown--;
7575
}
7676

@@ -79,7 +79,7 @@
7979
if (this.canSpawnSprintParticle()) {
8080
this.spawnSprintParticle();
8181
}
82-
@@ -1104,8 +_,8 @@
82+
@@ -1100,8 +_,8 @@
8383
} else {
8484
this.wasOnFire = this.isOnFire();
8585
if (type == MoverType.PISTON) {
@@ -90,7 +90,7 @@
9090
movement = this.limitPistonMovement(movement);
9191
if (movement.equals(Vec3.ZERO)) {
9292
return;
93-
@@ -1404,7 +_,7 @@
93+
@@ -1400,7 +_,7 @@
9494
if (pos.lengthSqr() <= 1.0E-7) {
9595
return pos;
9696
} else {
@@ -99,23 +99,23 @@
9999
if (gameTime != this.pistonDeltasGameTime) {
100100
Arrays.fill(this.pistonDeltas, 0.0);
101101
this.pistonDeltasGameTime = gameTime;
102-
@@ -3038,6 +_,7 @@
102+
@@ -3034,6 +_,7 @@
103103
}
104104

105105
if (force || this.canRide(vehicle) && vehicle.canAddPassenger(this)) {
106106
+ if (this.valid) { // Folia - region threading - suppress entire event logic during worldgen
107107
// CraftBukkit start
108108
if (vehicle.getBukkitEntity() instanceof org.bukkit.entity.Vehicle && this.getBukkitEntity() instanceof org.bukkit.entity.LivingEntity) {
109109
org.bukkit.event.vehicle.VehicleEnterEvent event = new org.bukkit.event.vehicle.VehicleEnterEvent((org.bukkit.entity.Vehicle) vehicle.getBukkitEntity(), this.getBukkitEntity());
110-
@@ -3059,6 +_,7 @@
110+
@@ -3055,6 +_,7 @@
111111
return false;
112112
}
113113
// CraftBukkit end
114114
+ } // Folia - region threading - suppress entire event logic during worldgen
115115
if (this.isPassenger()) {
116116
this.stopRiding();
117117
}
118-
@@ -3126,7 +_,7 @@
118+
@@ -3122,7 +_,7 @@
119119
this.passengers = ImmutableList.copyOf(list);
120120
}
121121

@@ -124,23 +124,23 @@
124124
}
125125
}
126126

127-
@@ -3140,6 +_,7 @@
127+
@@ -3136,6 +_,7 @@
128128
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
129129
} else {
130130
// CraftBukkit start
131131
+ if (this.valid) { // Folia - region threading - suppress entire event logic during worldgen
132132
org.bukkit.craftbukkit.entity.CraftEntity craft = (org.bukkit.craftbukkit.entity.CraftEntity) passenger.getBukkitEntity().getVehicle();
133133
Entity orig = craft == null ? null : craft.getHandle();
134134
if (this.getBukkitEntity() instanceof org.bukkit.entity.Vehicle && passenger.getBukkitEntity() instanceof org.bukkit.entity.LivingEntity) {
135-
@@ -3167,6 +_,7 @@
135+
@@ -3163,6 +_,7 @@
136136
return false;
137137
}
138138
// CraftBukkit end
139139
+ } // Folia - region threading - suppress entire event logic during worldgen
140140
if (this.passengers.size() == 1 && this.passengers.get(0) == passenger) {
141141
this.passengers = ImmutableList.of();
142142
} else {
143-
@@ -3174,7 +_,7 @@
143+
@@ -3170,7 +_,7 @@
144144
}
145145

146146
passenger.boardingCooldown = 60;
@@ -149,7 +149,7 @@
149149
}
150150
return true; // CraftBukkit
151151
}
152-
@@ -3258,7 +_,7 @@
152+
@@ -3254,7 +_,7 @@
153153
}
154154
}
155155

@@ -158,7 +158,7 @@
158158
if (this.level() instanceof ServerLevel serverLevel) {
159159
this.processPortalCooldown();
160160
if (this.portalProcess != null) {
161-
@@ -3266,21 +_,20 @@
161+
@@ -3262,21 +_,20 @@
162162
ProfilerFiller profilerFiller = Profiler.get();
163163
profilerFiller.push("portal");
164164
this.setPortalCooldown();
@@ -188,7 +188,7 @@
188188
}
189189

190190
public int getDimensionChangingDelay() {
191-
@@ -3420,6 +_,11 @@
191+
@@ -3416,6 +_,11 @@
192192

193193
@Nullable
194194
public PlayerTeam getTeam() {
@@ -200,7 +200,7 @@
200200
if (!this.level().paperConfig().scoreboards.allowNonPlayerEntitiesOnScoreboards && !(this instanceof Player)) { return null; } // Paper - Perf: Disable Scoreboards for non players by default
201201
return this.level().getScoreboard().getPlayersTeam(this.getScoreboardName());
202202
}
203-
@@ -3726,8 +_,789 @@
203+
@@ -3722,8 +_,789 @@
204204
this.portalProcess = entity.portalProcess;
205205
}
206206

@@ -990,7 +990,7 @@
990990
// Paper start - Fix item duplication and teleport issues
991991
if ((!this.isAlive() || !this.valid) && (teleportTransition.newLevel() != this.level)) {
992992
LOGGER.warn("Illegal Entity Teleport " + this + " to " + teleportTransition.newLevel() + ":" + teleportTransition.position(), new Throwable());
993-
@@ -3911,6 +_,12 @@
993+
@@ -3907,6 +_,12 @@
994994
}
995995
}
996996

@@ -1003,7 +1003,7 @@
10031003
protected void removeAfterChangingDimensions() {
10041004
this.setRemoved(Entity.RemovalReason.CHANGED_DIMENSION, null); // CraftBukkit - add Bukkit remove cause
10051005
if (this instanceof Leashable leashable && leashable.isLeashed()) { // Paper - only call if it is leashed
1006-
@@ -4246,6 +_,12 @@
1006+
@@ -4242,6 +_,12 @@
10071007
}
10081008

10091009
public void startSeenByPlayer(ServerPlayer serverPlayer) {
@@ -1016,7 +1016,7 @@
10161016
}
10171017

10181018
public void stopSeenByPlayer(ServerPlayer serverPlayer) {
1019-
@@ -4255,6 +_,12 @@
1019+
@@ -4251,6 +_,12 @@
10201020
new io.papermc.paper.event.player.PlayerUntrackEntityEvent(serverPlayer.getBukkitEntity(), this.getBukkitEntity()).callEvent();
10211021
}
10221022
// Paper end - entity tracking events
@@ -1029,7 +1029,7 @@
10291029
}
10301030

10311031
public float rotate(Rotation transformRotation) {
1032-
@@ -4790,7 +_,8 @@
1032+
@@ -4786,7 +_,8 @@
10331033
}
10341034
}
10351035
// Paper end - Fix MC-4
@@ -1039,7 +1039,7 @@
10391039
synchronized (this.posLock) { // Paper - detailed watchdog information
10401040
this.position = new Vec3(x, y, z);
10411041
} // Paper - detailed watchdog information
1042-
@@ -4809,7 +_,7 @@
1042+
@@ -4805,7 +_,7 @@
10431043
}
10441044
// Paper start - Block invalid positions and bounding box; don't allow desync of pos and AABB
10451045
// hanging has its own special logic
@@ -1048,7 +1048,7 @@
10481048
this.setBoundingBox(this.makeBoundingBox());
10491049
}
10501050
// Paper end - Block invalid positions and bounding box
1051-
@@ -4893,6 +_,12 @@
1051+
@@ -4889,6 +_,12 @@
10521052
return this.removalReason != null;
10531053
}
10541054

@@ -1061,7 +1061,7 @@
10611061
@Nullable
10621062
public Entity.RemovalReason getRemovalReason() {
10631063
return this.removalReason;
1064-
@@ -4915,6 +_,9 @@
1064+
@@ -4911,6 +_,9 @@
10651065
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityRemoveEvent(this, cause);
10661066
// CraftBukkit end
10671067
final boolean alreadyRemoved = this.removalReason != null; // Paper - Folia schedulers
@@ -1071,7 +1071,7 @@
10711071
if (this.removalReason == null) {
10721072
this.removalReason = removalReason;
10731073
}
1074-
@@ -4937,6 +_,10 @@
1074+
@@ -4933,6 +_,10 @@
10751075
public void unsetRemoved() {
10761076
this.removalReason = null;
10771077
}

0 commit comments

Comments
 (0)