2013-03-20 22:54:12 +01:00
|
|
|
From 3c5dece19abe1d7cdc329f0520507cdc228ac9a6 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-03-19 06:51:45 +01:00
|
|
|
index 05b2d6d..9902506 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
|
2013-03-19 06:51:45 +01:00
|
|
|
@@ -51,7 +51,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
2013-01-15 02:18:40 +01:00
|
|
|
// 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-03-16 23:14:16 +01:00
|
|
|
index 3dc6f0e..0261647 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-03-16 23:14:16 +01:00
|
|
|
@@ -118,6 +118,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-03-16 23:14:16 +01:00
|
|
|
@@ -133,6 +136,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-03-16 23:14:16 +01:00
|
|
|
@@ -143,6 +147,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-02-23 01:50:29 +01:00
|
|
|
index f44d5d0..0c92b66 100644
|
2013-01-15 02:18:40 +01:00
|
|
|
--- a/src/main/resources/configurations/bukkit.yml
|
|
|
|
+++ b/src/main/resources/configurations/bukkit.yml
|
2013-02-23 01:50:29 +01:00
|
|
|
@@ -49,6 +49,7 @@ world-settings:
|
2013-01-15 02:18:40 +01:00
|
|
|
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
|
|
|
|
--
|
2013-03-20 22:54:12 +01:00
|
|
|
1.8.2
|
2013-01-15 02:18:40 +01:00
|
|
|
|