Correct event handling for dispensing filled buckets. Fixes BUKKIT-4046

We only go through event creation and calling when dispensing filled buckets
if the bucket is able to place its liquid. However, the check for this is
incorrect so the event is not called when a block liquids can destroy is
in front of the dispenser. This commit fixes the check to match the checks
vanilla does when actually using the bucket.
This commit is contained in:
Travis Watkins 2013-05-03 06:36:12 -05:00
parent 28fb514a4d
commit d9eb586568

View file

@ -23,7 +23,7 @@ final class DispenseBehaviorFilledBucket extends DispenseBehaviorItem {
int x = i + enumfacing.c();
int y = j + enumfacing.d();
int z = k + enumfacing.e();
if (world.isEmpty(x, y, z) || world.getMaterial(x, y, z).isBuildable()) {
if (world.isEmpty(x, y, z) || !world.getMaterial(x, y, z).isBuildable()) {
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack);