mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Add UpdateViewPositionPacket constructor
This commit is contained in:
parent
d61b1d48b7
commit
de76ac5aad
@ -1570,10 +1570,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
* @param chunkZ the chunk Z
|
* @param chunkZ the chunk Z
|
||||||
*/
|
*/
|
||||||
public void updateViewPosition(int chunkX, int chunkZ) {
|
public void updateViewPosition(int chunkX, int chunkZ) {
|
||||||
UpdateViewPositionPacket updateViewPositionPacket = new UpdateViewPositionPacket();
|
playerConnection.sendPacket(new UpdateViewPositionPacket(chunkX, chunkZ));
|
||||||
updateViewPositionPacket.chunkX = chunkX;
|
|
||||||
updateViewPositionPacket.chunkZ = chunkZ;
|
|
||||||
playerConnection.sendPacket(updateViewPositionPacket);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNextTeleportId() {
|
public int getNextTeleportId() {
|
||||||
|
@ -10,10 +10,14 @@ public class UpdateViewPositionPacket implements ServerPacket {
|
|||||||
|
|
||||||
public int chunkX, chunkZ;
|
public int chunkX, chunkZ;
|
||||||
|
|
||||||
/**
|
public UpdateViewPositionPacket(int chunkX, int chunkZ) {
|
||||||
* Default constructor, required for reflection operations.
|
this.chunkX = chunkX;
|
||||||
*/
|
this.chunkZ = chunkZ;
|
||||||
public UpdateViewPositionPacket() {}
|
}
|
||||||
|
|
||||||
|
public UpdateViewPositionPacket() {
|
||||||
|
this(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(@NotNull BinaryWriter writer) {
|
public void write(@NotNull BinaryWriter writer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user