mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Make init function UNSAFE
This commit is contained in:
parent
4aed6ffa5c
commit
78abfb9657
@ -229,10 +229,11 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
* Init the player and spawn him.
|
||||
* <p>
|
||||
* WARNING: executed in the main update thread
|
||||
* UNSAFE: Only meant to be used when a netty player connects through the server.
|
||||
*
|
||||
* @param spawnInstance the player spawn instance (defined in {@link PlayerLoginEvent})
|
||||
*/
|
||||
public void init(@NotNull Instance spawnInstance) {
|
||||
public void UNSAFE_init(@NotNull Instance spawnInstance) {
|
||||
this.dimensionType = spawnInstance.getDimensionType();
|
||||
|
||||
JoinGamePacket joinGamePacket = new JoinGamePacket();
|
||||
|
@ -503,7 +503,7 @@ public final class ConnectionManager {
|
||||
|
||||
Check.notNull(spawningInstance, "You need to specify a spawning instance in the PlayerLoginEvent");
|
||||
|
||||
waitingPlayer.init(spawningInstance);
|
||||
waitingPlayer.UNSAFE_init(spawningInstance);
|
||||
|
||||
// Spawn the player at Player#getRespawnPoint during the next instance tick
|
||||
spawningInstance.scheduleNextTick(waitingPlayer::setInstance);
|
||||
|
Loading…
Reference in New Issue
Block a user