mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-24 09:01:54 +01:00
Fix connection loop
This commit is contained in:
parent
77ed13abd9
commit
7da3a16978
@ -843,11 +843,9 @@ public class Entity implements Viewable, EventHandler, DataContainer, Permission
|
||||
* Changes the entity instance.
|
||||
*
|
||||
* @param instance the new instance of the entity
|
||||
* @deprecated Use {@link Entity#setInstance(Instance, Position)} instead.
|
||||
* @throws NullPointerException if {@code instance} is null
|
||||
* @throws IllegalStateException if {@code instance} has not been registered in {@link InstanceManager}
|
||||
*/
|
||||
@Deprecated
|
||||
public void setInstance(@NotNull Instance instance) {
|
||||
setInstance(instance, this.position);
|
||||
}
|
||||
|
@ -733,7 +733,7 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
* @param spawnPosition the position to teleport the player
|
||||
* @param firstSpawn true if this is the player first spawn
|
||||
*/
|
||||
private void spawnPlayer(@NotNull Instance instance, @Nullable Position spawnPosition,
|
||||
private void spawnPlayer(@NotNull Instance instance, @NotNull Position spawnPosition,
|
||||
boolean firstSpawn, boolean updateChunks) {
|
||||
// Clear previous instance elements
|
||||
if (!firstSpawn) {
|
||||
@ -741,9 +741,9 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
this.viewableEntities.forEach(entity -> entity.removeViewer(this));
|
||||
}
|
||||
|
||||
super.setInstance(instance);
|
||||
super.setInstance(instance, spawnPosition);
|
||||
|
||||
if (spawnPosition != null && !position.isSimilar(spawnPosition)) {
|
||||
if (!position.isSimilar(spawnPosition)) {
|
||||
teleport(spawnPosition);
|
||||
} else if (updateChunks) {
|
||||
// Send newly visible chunks to player once spawned in the instance
|
||||
|
Loading…
Reference in New Issue
Block a user