added packets PlayerPosition & PlayerLook
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user