2013-01-25 04:00:07 +01:00
|
|
|
From f303848293ac86066ccea4f00947253af6e9c8f0 Mon Sep 17 00:00:00 2001
|
2013-01-15 02:18:40 +01:00
|
|
|
From: md_5 <md_5@bigpond.com>
|
|
|
|
Date: Sat, 12 Jan 2013 19:57:45 +1100
|
2013-01-19 09:22:25 +01:00
|
|
|
Subject: [PATCH] Per world view distance.
|
2013-01-15 02:18:40 +01:00
|
|
|
|
|
|
|
---
|
|
|
|
src/main/java/net/minecraft/server/WorldServer.java | 2 +-
|
|
|
|
src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 5 +++++
|
|
|
|
src/main/resources/configurations/bukkit.yml | 1 +
|
|
|
|
3 files changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
2013-01-25 04:00:07 +01:00
|
|
|
index a42aa1e..842d722 100644
|
2013-01-15 02:18:40 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
|
|
|
@@ -49,7 +49,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
|
|
|
// CraftBukkit end
|
|
|
|
this.server = minecraftserver;
|
|
|
|
this.tracker = new EntityTracker(this);
|
|
|
|
- this.manager = new PlayerChunkMap(this, minecraftserver.getPlayerList().o());
|
|
|
|
+ this.manager = new PlayerChunkMap(this, getWorld().viewDistance); // Spigot
|
|
|
|
if (this.entitiesById == null) {
|
|
|
|
this.entitiesById = new IntHashMap();
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2013-01-25 04:00:07 +01:00
|
|
|
index 45217cd..94e07fe 100644
|
2013-01-15 02:18:40 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2013-01-25 04:00:07 +01:00
|
|
|
@@ -116,6 +116,9 @@ public class CraftWorld implements World {
|
2013-01-15 02:18:40 +01:00
|
|
|
treeGrowthModifier = configuration.getInt("world-settings." + name + ".tree-growth-modifier", treeGrowthModifier);
|
|
|
|
mushroomGrowthModifier = configuration.getInt("world-settings." + name + ".mushroom-growth-modifier", mushroomGrowthModifier);
|
|
|
|
|
|
|
|
+ viewDistance = Bukkit.getServer().getViewDistance();
|
|
|
|
+ viewDistance = configuration.getInt("world-settings." + name + ".view-distance", viewDistance);
|
|
|
|
+
|
|
|
|
server.getLogger().info("-------------- Spigot ----------------");
|
|
|
|
server.getLogger().info("-------- World Settings For [" + name + "] --------");
|
|
|
|
server.getLogger().info("Growth Per Chunk: " + growthPerTick);
|
2013-01-25 04:00:07 +01:00
|
|
|
@@ -131,6 +134,7 @@ public class CraftWorld implements World {
|
2013-01-15 02:18:40 +01:00
|
|
|
server.getLogger().info("Sugar Growth Modifier: " + sugarGrowthModifier);
|
|
|
|
server.getLogger().info("Tree Growth Modifier: " + treeGrowthModifier);
|
|
|
|
server.getLogger().info("Mushroom Growth Modifier: " + mushroomGrowthModifier);
|
|
|
|
+ server.getLogger().info("View distance: " + viewDistance);
|
|
|
|
server.getLogger().info("-------------------------------------------------");
|
|
|
|
// Spigot end
|
|
|
|
}
|
2013-01-25 04:00:07 +01:00
|
|
|
@@ -141,6 +145,7 @@ public class CraftWorld implements World {
|
2013-01-15 02:18:40 +01:00
|
|
|
public boolean randomLightingUpdates = false;
|
|
|
|
public int mobSpawnRange = 4;
|
|
|
|
public int aggregateTicks = 4;
|
|
|
|
+ public int viewDistance;
|
|
|
|
//Crop growth rates:
|
|
|
|
public int wheatGrowthModifier = 100;
|
|
|
|
public int cactusGrowthModifier = 100;
|
|
|
|
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
|
2013-01-25 04:00:07 +01:00
|
|
|
index 55bfb77..9d6d613 100644
|
2013-01-15 02:18:40 +01:00
|
|
|
--- a/src/main/resources/configurations/bukkit.yml
|
|
|
|
+++ b/src/main/resources/configurations/bukkit.yml
|
|
|
|
@@ -52,6 +52,7 @@ world-settings:
|
|
|
|
world:
|
|
|
|
growth-chunks-per-tick: 1000
|
|
|
|
world_nether:
|
|
|
|
+ view-distance: 5
|
|
|
|
growth-chunks-per-tick: 0
|
|
|
|
random-light-updates: true
|
|
|
|
water-creatures-per-chunk: 0
|
|
|
|
--
|
|
|
|
1.8.1-rc2
|
|
|
|
|