Archived
0

added packets PlayerPosition & PlayerLook

This commit is contained in:
2018-08-11 11:59:33 +03:00
parent 7b6a213650
commit a3880f49ec
4 changed files with 52 additions and 4 deletions

View File

@@ -7,10 +7,7 @@ package mc.core.network.proto_1_12_2.netty.handlers;
import io.netty.channel.Channel;
import mc.core.chat.ChatProcessor;
import mc.core.network.proto_1_12_2.TeleportManager;
import mc.core.network.proto_1_12_2.packets.ChatMessageClientPacket;
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.network.proto_1_12_2.packets.*;
import mc.core.player.Player;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -63,4 +60,16 @@ public class PlayHandler extends AbstractStateHandler implements PlayStateHandle
packet.getMessage()
);
}
@Handler
public void onPlayerMove(Channel channel, PlayerPositionPacket packet) {
Player player = channel.attr(ATTR_PLAYER).get();
player.getLocation().setXYZ(packet.getX(), packet.getY(), packet.getZ());
}
@Handler
public void onPlayerLook(Channel channel, PlayerLookPacket packet) {
Player player = channel.attr(ATTR_PLAYER).get();
player.getLocation().setYawPitch(packet.getYaw(), packet.getPitch());
}
}