Archived
0

Обработка PlayerPositionAndLook

This commit is contained in:
2018-06-23 16:18:35 +03:00
parent bdfa420830
commit d3d4ef85c3
2 changed files with 10 additions and 0 deletions

View File

@@ -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());
}
}