mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-31 21:48:08 +01:00
Wait for client settings
This commit is contained in:
parent
bea622db0b
commit
7881cea36c
@ -2346,17 +2346,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
||||
* based on which one is the lowest
|
||||
*/
|
||||
public int getChunkRange() {
|
||||
final int playerRange = getSettings().viewDistance;
|
||||
if (playerRange < 1) {
|
||||
// Didn't receive settings packet yet (is the case on login)
|
||||
// In this case we send an arbitrary number of chunks
|
||||
// Will be updated in PlayerSettings#refresh.
|
||||
// Non-compliant clients might also be stuck with this view
|
||||
return 7;
|
||||
} else {
|
||||
final int serverRange = MinecraftServer.getChunkViewDistance();
|
||||
return Math.min(playerRange, serverRange);
|
||||
}
|
||||
return Math.min(getSettings().viewDistance, MinecraftServer.getChunkViewDistance());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2588,6 +2578,10 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
||||
private byte displayedSkinParts;
|
||||
private MainHand mainHand;
|
||||
|
||||
public PlayerSettings() {
|
||||
viewDistance = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* The player game language.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user