Set view distance before loading UHC worlds

This commit is contained in:
cnr 2016-11-24 04:50:23 -06:00
parent f6bf316afb
commit 5e218d019c
2 changed files with 2 additions and 10 deletions

View File

@ -479,8 +479,6 @@ public abstract class UHC extends Game
Location spawn = GetRandomSpawn(WorldData.World.getSpawnLocation(), true);
WorldData.World.setSpawnLocation(spawn.getBlockX(), spawn.getBlockY(), spawn.getBlockZ());
setViewDistance(VIEW_DISTANCE);
SetState(GameState.Recruit);
}
@ -1677,14 +1675,6 @@ public abstract class UHC extends Game
return 200;
}
public void setViewDistance(int chunks)
{
WorldServer worldServer = ((CraftWorld) WorldData.World).getHandle();
worldServer.spigotConfig.viewDistance = VIEW_DISTANCE;
worldServer.getPlayerChunkMap().a(VIEW_DISTANCE);
}
public UHCBorder getBorder()
{

View File

@ -18,6 +18,7 @@ import org.bukkit.Difficulty;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.spigotmc.SpigotConfig;
import java.io.BufferedReader;
import java.io.BufferedWriter;
@ -139,6 +140,7 @@ public class WorldData
try
{
worldLoader.loadMap("uhc", GetFolder());
SpigotConfig.config.set("world-settings." + GetFolder() + ".view-distance", UHC.VIEW_DISTANCE);
success = true;
} catch (Exception e)
{