summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit
diff options
context:
space:
mode:
authorfeildmaster <admin@feildmaster.com>2012-03-22 19:56:59 -0500
committerEvilSeph <evilseph@gmail.com>2012-03-22 21:04:06 -0400
commit52ecd60e61905482918495e66646b3018731c5cb (patch)
tree1925bdd9067756afd9559e129593a6f2a0780dc3 /src/main/java/org/bukkit
parent724b82626a031229c70df8fecc4c365f21ab17f0 (diff)
downloadcraftbukkit-52ecd60e61905482918495e66646b3018731c5cb.tar
craftbukkit-52ecd60e61905482918495e66646b3018731c5cb.tar.gz
craftbukkit-52ecd60e61905482918495e66646b3018731c5cb.tar.lz
craftbukkit-52ecd60e61905482918495e66646b3018731c5cb.tar.xz
craftbukkit-52ecd60e61905482918495e66646b3018731c5cb.zip
[Bleeding] Add a check for illegal blocks. Addresses BUKKIT-1278. Needs more investigation.
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 394e52ab..f4b2cb94 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -514,6 +514,9 @@ public class CraftEventFactory {
public static boolean callBlockBreakEvent(World world, int x, int y, int z, int id, int data, boolean creative, EntityHuman player) {
net.minecraft.server.Block blockType = net.minecraft.server.Block.byId[id];
+ if (blockType == null) { // Illegal block ID
+ return true;
+ }
Block block = world.getWorld().getBlockAt(x, y, z);
// Tell client the block is gone immediately then process events