From 52ecd60e61905482918495e66646b3018731c5cb Mon Sep 17 00:00:00 2001 From: feildmaster Date: Thu, 22 Mar 2012 19:56:59 -0500 Subject: [PATCH] [Bleeding] Add a check for illegal blocks. Addresses BUKKIT-1278. Needs more investigation. --- .../java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 394e52ab76..f4b2cb94ee 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