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.
|
* Init the player and spawn him.
|
||||||
* <p>
|
* <p>
|
||||||
* WARNING: executed in the main update thread
|
* 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})
|
* @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();
|
this.dimensionType = spawnInstance.getDimensionType();
|
||||||
|
|
||||||
JoinGamePacket joinGamePacket = new JoinGamePacket();
|
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");
|
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
|
// Spawn the player at Player#getRespawnPoint during the next instance tick
|
||||||
spawningInstance.scheduleNextTick(waitingPlayer::setInstance);
|
spawningInstance.scheduleNextTick(waitingPlayer::setInstance);
|
||||||
|
Loading…
Reference in New Issue
Block a user