2013-07-02 03:03:56 +00:00
From 70bf4a9446eddbe4a3dad0be25ecfdefe1f0af39 Mon Sep 17 00:00:00 2001
2013-03-22 22:55:21 +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
2013-07-02 03:03:56 +00:00
index 4e0398c..ae4ca63 100644
2013-03-22 22:55:21 +00:00
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
2013-07-02 03:03:56 +00:00
@@ -24,7 +24,7 @@ public class PlayerChunkMap {
2013-03-22 22:55:21 +00:00
public PlayerChunkMap(WorldServer worldserver, int i) {
if (i > 15) {
throw new IllegalArgumentException("Too big view radius!");
- } else if (i < 3) {
+ } else if (i < 1) {
throw new IllegalArgumentException("Too small view radius!");
} else {
2013-07-02 03:03:56 +00:00
this.f = i;
2013-03-22 22:55:21 +00:00
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
2013-07-02 03:03:56 +00:00
index 09d076e..c4248d0 100644
2013-03-22 22:55:21 +00:00
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
2013-07-02 03:03:56 +00:00
@@ -49,7 +49,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
2013-03-22 22:55:21 +00:00
// CraftBukkit end
this.server = minecraftserver;
this.tracker = new EntityTracker(this);
- this.manager = new PlayerChunkMap(this, minecraftserver.getPlayerList().o());
2013-06-20 08:52:23 +00:00
+ this.manager = new PlayerChunkMap(this, spigotConfig.viewDistance); // Spigot
2013-03-22 22:55:21 +00:00
if (this.entitiesById == null) {
this.entitiesById = new IntHashMap();
}
2013-06-20 08:52:23 +00:00
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
2013-07-02 03:03:56 +00:00
index 8a6d656..c2da03b 100644
2013-06-20 08:52:23 +00:00
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
2013-06-22 04:07:01 +00:00
@@ -116,4 +116,11 @@ public class SpigotWorldConfig
2013-06-21 07:30:13 +00:00
expMerge = getDouble("merge-radius.exp", 3.0 );
2013-06-20 08:52:23 +00:00
log( "Experience Merge Radius: " + expMerge );
}
2013-03-22 22:55:21 +00:00
+
2013-06-20 08:52:23 +00:00
+ public int viewDistance;
+ private void viewDistance()
+ {
+ viewDistance = getInt( "view-distance", Bukkit.getViewDistance() );
+ log( "View Distance: " + viewDistance );
+ }
}
2013-03-22 22:55:21 +00:00
--
2013-06-02 05:15:15 +00:00
1.8.1.2
2013-03-22 22:55:21 +00:00