Notify all adjacent blocks, thanks Aikar

By: md_5 <md_5@live.com.au>
This commit is contained in:
Spigot 2013-01-21 17:51:34 +11:00
parent fff6e2d3fd
commit d14bfbaa67

View file

@ -1,4 +1,4 @@
From c78d4989be8b714b9e28ec16ff4569f165824da4 Mon Sep 17 00:00:00 2001 From e54edb89cff47a39424a7c2407dd5b401457bef6 Mon Sep 17 00:00:00 2001
From: lishid <lishid@gmail.com> From: lishid <lishid@gmail.com>
Date: Mon, 21 Jan 2013 16:59:04 +1100 Date: Mon, 21 Jan 2013 16:59:04 +1100
Subject: [PATCH] Add oreobfuscator for Spigot. Subject: [PATCH] Add oreobfuscator for Spigot.
@ -10,9 +10,9 @@ Subject: [PATCH] Add oreobfuscator for Spigot.
.../minecraft/server/PlayerInteractManager.java | 5 ++ .../minecraft/server/PlayerInteractManager.java | 5 ++
.../java/org/bukkit/craftbukkit/CraftServer.java | 9 +++ .../java/org/bukkit/craftbukkit/CraftServer.java | 9 +++
.../java/org/bukkit/craftbukkit/CraftWorld.java | 4 + .../java/org/bukkit/craftbukkit/CraftWorld.java | 4 +
.../bukkit/craftbukkit/OrebfuscatorManager.java | 91 ++++++++++++++++++++++ .../bukkit/craftbukkit/OrebfuscatorManager.java | 92 ++++++++++++++++++++++
src/main/resources/configurations/bukkit.yml | 5 ++ src/main/resources/configurations/bukkit.yml | 5 ++
8 files changed, 136 insertions(+), 1 deletion(-) 8 files changed, 137 insertions(+), 1 deletion(-)
create mode 100644 src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java create mode 100644 src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
@ -166,10 +166,10 @@ index 856307f..4861609 100644
public int cactusGrowthModifier = 100; public int cactusGrowthModifier = 100;
diff --git a/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java b/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java diff --git a/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java b/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
new file mode 100644 new file mode 100644
index 0000000..175d04f index 0000000..8d4d4d3
--- /dev/null --- /dev/null
+++ b/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java +++ b/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
@@ -0,0 +1,91 @@ @@ -0,0 +1,92 @@
+package org.bukkit.craftbukkit; +package org.bukkit.craftbukkit;
+ +
+import net.minecraft.server.Block; +import net.minecraft.server.Block;
@ -237,15 +237,16 @@ index 0000000..175d04f
+ if (obfuscateBlocks[id]) { + if (obfuscateBlocks[id]) {
+ // Send the update + // Send the update
+ world.notify(x, y, z); + world.notify(x, y, z);
+ }
+ +
+ if (radius != 0) { + // Check other blocks for updates
+ updateNearbyBlocks(world, x + 1, y, z, radius - 1); + if (radius != 0) {
+ updateNearbyBlocks(world, x - 1, y, z, radius - 1); + updateNearbyBlocks(world, x + 1, y, z, radius - 1);
+ updateNearbyBlocks(world, x, y + 1, z, radius - 1); + updateNearbyBlocks(world, x - 1, y, z, radius - 1);
+ updateNearbyBlocks(world, x, y - 1, z, radius - 1); + updateNearbyBlocks(world, x, y + 1, z, radius - 1);
+ updateNearbyBlocks(world, x, y, z + 1, radius - 1); + updateNearbyBlocks(world, x, y - 1, z, radius - 1);
+ updateNearbyBlocks(world, x, y, z - 1, radius - 1); + updateNearbyBlocks(world, x, y, z + 1, radius - 1);
+ } + updateNearbyBlocks(world, x, y, z - 1, radius - 1);
+ } + }
+ } + }
+ } + }