From 9e65c243e400eabb5d0c1024487b1a3000574e65 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 15 Jan 2011 21:10:24 -0800 Subject: [PATCH] Fixed an issue where the block cache became out of date and events were giving erroneous block information. --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 2 ++ src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java | 1 + 2 files changed, 3 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index b90930e3e0..99e6f11f94 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -35,6 +35,8 @@ public class CraftWorld implements World { if (block == null) { block = new CraftBlock(this, x, y, z, world.a(x, y, z), (byte)world.b(x, y, z)); blockCache.put(loc, block); + } else { + block.update(); } return block; diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 2be9f62e28..1c7ba3c690 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -319,5 +319,6 @@ public class CraftBlock implements Block { public void update() { type = world.getHandle().a(x, y, z); data = (byte)world.getHandle().b(x, y, z); + light = (byte)world.getHandle().j(x, y, z); } }