Обработка PlayerPositionAndLook
This commit is contained in:
@@ -7,6 +7,7 @@ package mc.core.network.proto_1_12_2.netty.handlers;
|
||||
import io.netty.channel.Channel;
|
||||
import mc.core.network.proto_1_12_2.TeleportManager;
|
||||
import mc.core.network.proto_1_12_2.packets.ClientSettingsPacket;
|
||||
import mc.core.network.proto_1_12_2.packets.PlayerPositionAndLookPacket;
|
||||
import mc.core.network.proto_1_12_2.packets.TeleportConfirmPacket;
|
||||
import mc.core.player.Player;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -41,4 +42,11 @@ public class PlayHandler extends AbstractStateHandler implements PlayStateHandle
|
||||
public void onTeleportConfirm(Channel channel, TeleportConfirmPacket packet) {
|
||||
this.teleport.apply(packet.getTeleportId());
|
||||
}
|
||||
|
||||
@Handler
|
||||
public void onPositionAndLook(Channel channel, PlayerPositionAndLookPacket packet) {
|
||||
Player player = channel.attr(ATTR_PLAYER).get();
|
||||
player.getLocation().set(packet.getLocation());
|
||||
player.getLook().set(packet.getLook());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user