mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-09 01:47:54 +01:00
Fix position yaw/pitch not being copied
This commit is contained in:
parent
a927938677
commit
25c2dc661f
@ -13,13 +13,10 @@ import net.minestom.server.event.Event;
|
||||
import net.minestom.server.event.EventCallback;
|
||||
import net.minestom.server.event.entity.*;
|
||||
import net.minestom.server.event.handler.EventHandler;
|
||||
import net.minestom.server.event.item.ArmorEquipEvent;
|
||||
import net.minestom.server.instance.Chunk;
|
||||
import net.minestom.server.instance.Instance;
|
||||
import net.minestom.server.instance.InstanceManager;
|
||||
import net.minestom.server.instance.block.CustomBlock;
|
||||
import net.minestom.server.inventory.EquipmentHandler;
|
||||
import net.minestom.server.item.ItemStack;
|
||||
import net.minestom.server.network.packet.server.play.*;
|
||||
import net.minestom.server.network.player.PlayerConnection;
|
||||
import net.minestom.server.permission.Permission;
|
||||
@ -43,7 +40,6 @@ import net.minestom.server.utils.validate.Check;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.time.Year;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
@ -838,6 +834,8 @@ public class Entity implements Viewable, EventHandler, DataContainer, Permission
|
||||
this.lastX = this.position.getX();
|
||||
this.lastY = this.position.getY();
|
||||
this.lastZ = this.position.getZ();
|
||||
this.lastYaw = this.position.getYaw();
|
||||
this.lastPitch = this.position.getPitch();
|
||||
|
||||
this.isActive = true;
|
||||
this.instance = instance;
|
||||
|
@ -743,7 +743,8 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
|
||||
super.setInstance(instance, spawnPosition);
|
||||
|
||||
if (!position.isSimilar(spawnPosition)) {
|
||||
if (!position.isSimilar(spawnPosition) && !firstSpawn) {
|
||||
// Player changed instance at a different position
|
||||
teleport(spawnPosition);
|
||||
} else if (updateChunks) {
|
||||
// Send newly visible chunks to player once spawned in the instance
|
||||
|
@ -345,6 +345,8 @@ public class Position implements PublicCloneable<Position> {
|
||||
this.x = position.x;
|
||||
this.y = position.y;
|
||||
this.z = position.z;
|
||||
this.yaw = position.yaw;
|
||||
this.pitch = position.pitch;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user