mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Provide the proper dimensiontype in the JoinGamePacket
This commit is contained in:
parent
0fa82aff1f
commit
349364e15d
@ -62,7 +62,7 @@ public final class EntityManager {
|
||||
|
||||
Check.notNull(spawningInstance, "You need to specify a spawning instance in the PlayerLoginEvent");
|
||||
|
||||
waitingPlayer.init();
|
||||
waitingPlayer.init(spawningInstance);
|
||||
|
||||
// Spawn the player at Player#getRespawnPoint during the next instance tick
|
||||
spawningInstance.scheduleNextTick(waitingPlayer::setInstance);
|
||||
|
@ -215,7 +215,7 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
refreshAnswerKeepAlive(true);
|
||||
|
||||
this.gameMode = GameMode.SURVIVAL;
|
||||
this.dimensionType = DimensionType.OVERWORLD;
|
||||
this.dimensionType = DimensionType.OVERWORLD; // Default dimension
|
||||
this.levelFlat = true;
|
||||
getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.1f);
|
||||
|
||||
@ -228,8 +228,12 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
* Init the player and spawn him.
|
||||
* <p>
|
||||
* WARNING: executed in the main update thread
|
||||
*
|
||||
* @param spawnInstance the player spawn instance (defined in {@link PlayerLoginEvent})
|
||||
*/
|
||||
protected void init() {
|
||||
protected void init(@NotNull Instance spawnInstance) {
|
||||
this.dimensionType = spawnInstance.getDimensionType();
|
||||
|
||||
JoinGamePacket joinGamePacket = new JoinGamePacket();
|
||||
joinGamePacket.entityId = getEntityId();
|
||||
joinGamePacket.gameMode = gameMode;
|
||||
|
Loading…
Reference in New Issue
Block a user