feat: Add rotation packet handling after player spawn.
This commit is contained in:
parent
8478e87a38
commit
8bc8bfb76a
1 changed files with 11 additions and 0 deletions
|
@ -7,6 +7,8 @@ import com.github.retrooper.packetevents.protocol.player.TextureProperty;
|
|||
import com.github.retrooper.packetevents.protocol.player.UserProfile;
|
||||
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerDestroyEntities;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityHeadLook;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityRotation;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerPlayerInfoRemove;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerPlayerInfoUpdate;
|
||||
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSpawnPlayer;
|
||||
|
@ -16,6 +18,7 @@ import java.util.EnumSet;
|
|||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class WrapperPlayer extends WrapperLivingEntity {
|
||||
|
||||
|
@ -43,6 +46,14 @@ public class WrapperPlayer extends WrapperLivingEntity {
|
|||
return super.createSpawnPacket();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<PacketWrapper<?>> createSpawnPackets() {
|
||||
final List<PacketWrapper<?>> packets = super.createSpawnPackets();
|
||||
packets.add(new WrapperPlayServerEntityRotation(getEntityId(), getYaw(), getPitch(), isOnGround()));
|
||||
packets.add(new WrapperPlayServerEntityHeadLook(getEntityId(), getYaw()));
|
||||
return packets;
|
||||
}
|
||||
|
||||
public WrapperPlayServerPlayerInfoUpdate tabListPacket() {
|
||||
EnumSet<WrapperPlayServerPlayerInfoUpdate.Action> actions = EnumSet.of(
|
||||
WrapperPlayServerPlayerInfoUpdate.Action.ADD_PLAYER,
|
||||
|
|
Loading…
Reference in a new issue