2015-05-26 09:16:27 +00:00
From 8eceef159a4bb5b2d8f481611a996f59b05b2cd2 Mon Sep 17 00:00:00 2001
2014-07-21 20:46:54 +00:00
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 09:52:41 +1100
Subject: [PATCH] View Distance
This commit allows the user to select per world view distances, and view distances below 3. Be wary of the issues selecting a view distance of 1 or 2 may cause!
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
2015-02-28 11:36:22 +00:00
index 688d6f0..abb24c8 100644
2014-07-21 20:46:54 +00:00
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
2015-02-28 11:36:22 +00:00
@@ -28,9 +28,9 @@ public class PlayerChunkMap {
2014-07-21 20:46:54 +00:00
private final int[][] i = new int[][] { { 1, 0}, { 0, 1}, { -1, 0}, { 0, -1}};
private boolean wasNotEmpty; // CraftBukkit - add field
- public PlayerChunkMap(WorldServer worldserver) {
+ public PlayerChunkMap(WorldServer worldserver, int viewDistance /* Spigot */) {
this.world = worldserver;
2015-02-28 11:36:22 +00:00
- this.a(worldserver.getMinecraftServer().getPlayerList().s());
2014-07-21 20:46:54 +00:00
+ this.a(viewDistance); // Spigot
}
public WorldServer a() {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
2015-05-09 20:23:26 +00:00
index 03cac6e..b245159 100644
2014-07-21 20:46:54 +00:00
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
2015-04-16 10:19:45 +00:00
@@ -62,7 +62,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
2014-07-21 20:46:54 +00:00
// CraftBukkit end
this.server = minecraftserver;
this.tracker = new EntityTracker(this);
- this.manager = new PlayerChunkMap(this);
+ this.manager = new PlayerChunkMap(this, spigotConfig.viewDistance); // Spigot
2014-11-28 01:17:45 +00:00
this.worldProvider.a(this);
this.chunkProvider = this.k();
this.Q = new org.bukkit.craftbukkit.CraftTravelAgent(this); // CraftBukkit
2014-07-21 20:46:54 +00:00
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
2015-05-26 09:16:27 +00:00
index 7322703..a3255eb 100644
2014-07-21 20:46:54 +00:00
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
2015-05-26 09:16:27 +00:00
@@ -126,4 +126,11 @@ public class SpigotWorldConfig
2014-07-21 20:46:54 +00:00
expMerge = getDouble("merge-radius.exp", 3.0 );
log( "Experience Merge Radius: " + expMerge );
}
+
+ public int viewDistance;
+ private void viewDistance()
+ {
+ viewDistance = getInt( "view-distance", Bukkit.getViewDistance() );
+ log( "View Distance: " + viewDistance );
+ }
}
--
2015-05-09 20:23:26 +00:00
2.1.4
2014-07-21 20:46:54 +00:00