Interface for changing the view distance.

Can be changed server wide, per world and per player.
Only server wide changes are kept between server restarts.

Setting the server or world view distance should fail if the
view distance is not between 3 and 15

By: Andrew Ardill <andrew.ardill@gmail.com>
This commit is contained in:
Bukkit/Spigot
2011-08-12 00:19:52 +10:00
parent cd7da9630a
commit 741f5e69ae
3 changed files with 83 additions and 15 deletions

View File

@@ -300,4 +300,25 @@ public interface Player extends HumanEntity, CommandSender {
*/
public void resetPlayerTime();
/**
* Set the view distance for this player.
* View distance will remain constant, even between worlds, until it is changed or reset to default.
* @param viewDistance the number of chunks this player can see.
*/
void setViewDistance(int viewDistance);
/**
* @return the number of chunks this player can see
*/
int getViewDistance();
/**
* Set this players view distance back to the same as whichever world they are on.
*/
void resetViewDistance();
/**
* @return if the view distance has been set for this player specifically.
*/
boolean isViewDistanceSet();
}