Fixed not being able to fill milk buckets in build deny regions

Though added a check for use flag here
This commit is contained in:
DerFlash 2011-10-24 12:13:52 +02:00 committed by zml2008
parent 4895a3313b
commit b918b29014

View File

@ -943,7 +943,14 @@ public void onPlayerBucketFill(PlayerBucketFillEvent event) {
ConfigurationManager cfg = plugin.getGlobalStateManager();
WorldConfiguration wcfg = cfg.get(world);
if (!plugin.getGlobalRegionManager().canBuild(
if (event.getItemStack().getType() == Material.MILK_BUCKET) {
if (!plugin.getGlobalRegionManager().allows(DefaultFlag.USE, player.getLocation().add(0, 1, 0))) {
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to use this in this area.");
event.setCancelled(true);
return;
}
} else if (!plugin.getGlobalRegionManager().canBuild(
player, event.getBlockClicked().getRelative(event.getBlockFace()))) {
player.sendMessage(ChatColor.DARK_RED + "You don't have permission for this area.");
event.setCancelled(true);