Notify all adjacent blocks, thanks Aikar

This commit is contained in:
md_5 2013-01-21 17:51:34 +11:00
parent c22ab4c897
commit 7dcc1ceac4

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,7 +237,9 @@ 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);
+ }
+ +
+ // Check other blocks for updates
+ if (radius != 0) { + if (radius != 0) {
+ updateNearbyBlocks(world, x + 1, y, z, radius - 1); + updateNearbyBlocks(world, x + 1, y, z, radius - 1);
+ 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) { + private static boolean areAjacentBlocksTransparent(World world, int x, int y, int z, int radius) {
+ return y > 0 && y <= world.getHeight() + return y > 0 && y <= world.getHeight()