mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 21:17:53 +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
|
||||
*/
|
||||
public void updateViewPosition(int chunkX, int chunkZ) {
|
||||
UpdateViewPositionPacket updateViewPositionPacket = new UpdateViewPositionPacket();
|
||||
updateViewPositionPacket.chunkX = chunkX;
|
||||
updateViewPositionPacket.chunkZ = chunkZ;
|
||||
playerConnection.sendPacket(updateViewPositionPacket);
|
||||
playerConnection.sendPacket(new UpdateViewPositionPacket(chunkX, chunkZ));
|
||||
}
|
||||
|
||||
public int getNextTeleportId() {
|
||||
|
@ -10,10 +10,14 @@ public class UpdateViewPositionPacket implements ServerPacket {
|
||||
|
||||
public int chunkX, chunkZ;
|
||||
|
||||
/**
|
||||
* Default constructor, required for reflection operations.
|
||||
*/
|
||||
public UpdateViewPositionPacket() {}
|
||||
public UpdateViewPositionPacket(int chunkX, int chunkZ) {
|
||||
this.chunkX = chunkX;
|
||||
this.chunkZ = chunkZ;
|
||||
}
|
||||
|
||||
public UpdateViewPositionPacket() {
|
||||
this(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull BinaryWriter writer) {
|
||||
|
Loading…
Reference in New Issue
Block a user