Fix world info showing world as always obfuscated

This commit is contained in:
md_5 2013-04-21 20:02:08 +10:00
parent 83ded01371
commit 699a27f6bc
2 changed files with 9 additions and 9 deletions

View file

@ -1,4 +1,4 @@
From 437f0288d071cd51f0c7903b13440ceb676c295e Mon Sep 17 00:00:00 2001
From 46308289f49df1c88bda07ee40adbefef3451a03 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 10:58:17 +1100
Subject: [PATCH] Add oreobfuscator for Spigot.
@ -168,14 +168,14 @@ index e7c3a0c..9f2be37 100644
private boolean value = true;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 7c48dad..d30219d 100644
index 7c48dad..77078a1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -123,6 +123,8 @@ public class CraftWorld implements World {
viewDistance = Bukkit.getServer().getViewDistance();
viewDistance = configuration.getInt("world-settings." + name + ".view-distance", viewDistance);
+ obfuscated = !world.getServer().orebfuscatorDisabledWorlds.contains(name);
+ obfuscated = world.getServer().orebfuscatorEnabled && !world.getServer().orebfuscatorDisabledWorlds.contains(name);
+
if (!info) return;
server.getLogger().info("-------------- Spigot ----------------");
@ -218,7 +218,7 @@ index db46037..4097568 100644
}
diff --git a/src/main/java/org/spigotmc/OrebfuscatorManager.java b/src/main/java/org/spigotmc/OrebfuscatorManager.java
new file mode 100644
index 0000000..d168c55
index 0000000..be9233c
--- /dev/null
+++ b/src/main/java/org/spigotmc/OrebfuscatorManager.java
@@ -0,0 +1,146 @@
@ -278,7 +278,7 @@ index 0000000..d168c55
+ }
+
+ public static void obfuscate(int chunkX, int chunkY, int bitmask, byte[] buffer, World world, int initialRadius) {
+ if (world.getServer().orebfuscatorEnabled && world.getWorld().obfuscated) {
+ if (world.getWorld().obfuscated) {
+ int index = 0;
+ int startX = chunkX << 4;
+ int startZ = chunkY << 4;
@ -321,7 +321,7 @@ index 0000000..d168c55
+ }
+
+ private static void updateNearbyBlocks(World world, int x, int y, int z, int radius) {
+ if (world.getServer().orebfuscatorEnabled && world.getWorld().obfuscated && world.isLoaded(x, y, z)) {
+ if (world.getWorld().obfuscated && world.isLoaded(x, y, z)) {
+ // Get block id
+ int id = world.getTypeId(x, y, z);
+

View file

@ -1,4 +1,4 @@
From 4b5c0b2f0ce3983de116c92bdaa42c3e0002b7d6 Mon Sep 17 00:00:00 2001
From d7aa3a0abf7b11f6036f6df089f2ca23cf65b8ee Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 3 Feb 2013 05:10:21 -0500
Subject: [PATCH] Entity Activation Range
@ -98,7 +98,7 @@ index 51816e4..7e10318 100644
entity.V = entity.locY;
entity.W = entity.locZ;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index d30219d..8dd1275 100644
index 77078a1..6a0f02c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -103,9 +103,15 @@ public class CraftWorld implements World {
@ -119,7 +119,7 @@ index d30219d..8dd1275 100644
aggregateTicks = Math.max(1, configuration.getInt("world-settings." + name + ".aggregate-chunkticks", aggregateTicks));
@@ -125,6 +131,10 @@ public class CraftWorld implements World {
obfuscated = !world.getServer().orebfuscatorDisabledWorlds.contains(name);
obfuscated = world.getServer().orebfuscatorEnabled && !world.getServer().orebfuscatorDisabledWorlds.contains(name);
+ miscEntityActivationRange = configuration.getInt("world-settings." + name + ".entity-activation-range-misc", miscEntityActivationRange);
+ animalEntityActivationRange = configuration.getInt("world-settings." + name + ".entity-activation-range-animals", animalEntityActivationRange);