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>
Date: Mon, 21 Jan 2013 16:59:04 +1100
Subject: [PATCH] Add oreobfuscator for Spigot.
@ -10,9 +10,9 @@ Subject: [PATCH] Add oreobfuscator for Spigot.
.../minecraft/server/PlayerInteractManager.java | 5 ++
.../java/org/bukkit/craftbukkit/CraftServer.java | 9 +++
.../java/org/bukkit/craftbukkit/CraftWorld.java | 4 +
.../bukkit/craftbukkit/OrebfuscatorManager.java | 91 ++++++++++++++++++++++
.../bukkit/craftbukkit/OrebfuscatorManager.java | 92 ++++++++++++++++++++++
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
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;
diff --git a/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java b/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
new file mode 100644
index 0000000..175d04f
index 0000000..8d4d4d3
--- /dev/null
+++ b/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
@@ -0,0 +1,91 @@
@@ -0,0 +1,92 @@
+package org.bukkit.craftbukkit;
+
+import net.minecraft.server.Block;
@ -237,7 +237,9 @@ index 0000000..175d04f
+ if (obfuscateBlocks[id]) {
+ // Send the update
+ world.notify(x, y, z);
+ }
+
+ // Check other blocks for updates
+ if (radius != 0) {
+ updateNearbyBlocks(world, x + 1, y, z, radius - 1);
+ updateNearbyBlocks(world, x - 1, y, z, radius - 1);
@ -248,7 +250,6 @@ index 0000000..175d04f
+ }
+ }
+ }
+ }
+
+ private static boolean areAjacentBlocksTransparent(World world, int x, int y, int z, int radius) {
+ return y > 0 && y <= world.getHeight()