You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+ final boolean didCollide = toX != this.player.getX() || toY != this.player.getY() || toZ != this.player.getZ(); // Paper - needed here as the difference in Y can be reset - also note: this is only a guess at whether collisions took place, floating point errors can make this true when it shouldn't be...
95
95
// Paper start - prevent position desync
96
96
if (this.awaitingPositionFromClient != null) {
97
97
return; // ... thanks Mojang for letting move calls teleport across dimensions.
98
-
@@ -1581,7 +1615,17 @@ public class ServerGamePacketListenerImpl
98
+
@@ -1574,7 +1608,17 @@ public class ServerGamePacketListenerImpl
99
99
}
100
100
101
101
// Paper start - Add fail move event
@@ -114,7 +114,7 @@ index 1c5750c258bfb4b551048670a5e73a19a813ec47..ad4d20dda67ffb37e15a1623104a6e23
+ final io.papermc.paper.event.player.PlayerClientLoadedWorldEvent event = new io.papermc.paper.event.player.PlayerClientLoadedWorldEvent(this.player.getBukkitEntity(), false);
393
-
+ event.callEvent();
394
-
+ // Paper end - PlayerLoadedWorldEvent
395
-
this.markClientLoaded();
396
-
}
397
-
398
385
@@ -563,6 +_,7 @@
399
386
@Override
400
387
public void handleRecipeBookChangeSettingsPacket(ServerboundRecipeBookChangeSettingsPacket packet) {
+ return !this.waitingForRespawn; // Paper - Add PlayerLoadedWorldEvent
2571
+
@@ -2134,12 +_,18 @@
2590
2572
}
2591
2573
2592
2574
public void tickClientLoadTimeout() {
2593
-
if (this.clientLoadedTimeoutTimer > 0) {
2575
+
- if (this.clientLoadedTimeoutTimer > 0) {
2576
+
+ if (this.clientLoadedTimeoutTimer > 1) { // Paper - Add PlayerLoadedWorldEvent - only reduce till 1, let the below else-if call #markClientLoaded to trigger event and reduce to 0
2594
2577
this.clientLoadedTimeoutTimer--;
2595
-
}
2578
+
- }
2579
+
+ } else if (this.clientLoadedTimeoutTimer == 1) markClientLoaded(); // Paper - Add PlayerLoadedWorldEvent - decrement by calling #markClientLoaded which will set the value to 0 *and* call the event.
2580
+
}
2581
+
2582
+
private void markClientLoaded() {
2596
2583
+ // Paper start - Add PlayerLoadedWorldEvent
2597
-
+ if (this.clientLoadedTimeoutTimer <= 0) {
2598
-
+ this.waitingForRespawn = false;
2599
-
+
2584
+
+ if (!hasClientLoaded()) {
2600
2585
+ final io.papermc.paper.event.player.PlayerClientLoadedWorldEvent event = new io.papermc.paper.event.player.PlayerClientLoadedWorldEvent(this.player.getBukkitEntity(), true);
0 commit comments