mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 04:55:47 +01:00
976c6d425b
A recent commit has been made that caused patches to be out of order, rebuilding
55 lines
2.9 KiB
Diff
55 lines
2.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Thu, 9 Apr 2020 21:20:33 -0400
|
|
Subject: [PATCH] Don't move existing players to world spawn
|
|
|
|
This can cause a nasty server lag the spawn chunks are not kept loaded
|
|
or they aren't finished loading yet, or if the world spawn radius is
|
|
larger than the keep loaded range.
|
|
|
|
By skipping this, we avoid potential for a large spike on server start.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
index e4647849e2fccb68ff9e88ced92c183204b76960..3cf68af488fdd8492c620e6f3438b35cd4aa7737 100644
|
|
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
|
@@ -253,7 +253,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|
this.serverStatisticManager = minecraftserver.getPlayerList().getStatisticManager(this);
|
|
this.advancementDataPlayer = minecraftserver.getPlayerList().f(this);
|
|
this.G = 1.0F;
|
|
- this.c(worldserver);
|
|
+ //this.c(worldserver); // Paper - don't move to spawn on login, only first join
|
|
this.co = minecraftserver.a(this);
|
|
|
|
this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
|
|
@@ -305,6 +305,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|
}
|
|
// CraftBukkit end
|
|
|
|
+ public final void moveToSpawn(WorldServer worldserver) { c(worldserver); } // Paper - OBFHELPER
|
|
private void c(WorldServer worldserver) {
|
|
BlockPosition blockposition = worldserver.getSpawn();
|
|
|
|
@@ -482,7 +483,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
|
position = Vec3D.a(((WorldServer) world).getSpawn());
|
|
}
|
|
this.world = world;
|
|
- this.setPosition(position.getX(), position.getY(), position.getZ());
|
|
+ this.setPositionRaw(position.getX(), position.getY(), position.getZ()); // Paper - don't register to chunks yet
|
|
}
|
|
this.playerInteractManager.a((WorldServer) world);
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
index 84c2bc0bac4f388094693859ab7b6ced5e315c27..f35825d4a8574ea75b46be36b9929f8e12405217 100644
|
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
|
@@ -208,6 +208,8 @@ public abstract class PlayerList {
|
|
worldserver1 = worldserver;
|
|
}
|
|
|
|
+ if (nbttagcompound == null) entityplayer.moveToSpawn(worldserver1); // Paper - only move to spawn on first login, otherwise, stay where you are....
|
|
+
|
|
entityplayer.spawnIn(worldserver1);
|
|
entityplayer.playerInteractManager.a((WorldServer) entityplayer.world);
|
|
String s1 = "local";
|