Buckets now check the region that the water will end up in, not the block that was clicked

This commit is contained in:
Wizjany 2011-08-08 09:12:10 -04:00
parent dfbbeeb473
commit 321b3acf0a

View File

@ -38,6 +38,7 @@
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerBedEnterEvent;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
import org.bukkit.event.player.PlayerBucketEvent;
import org.bukkit.event.player.PlayerBucketFillEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
@ -128,6 +129,7 @@ private void registerEvent(String typeName, Priority priority) {
/**
* Called when a player attempts to log in to the server.
*/
/*
@Override
public void onPlayerLogin(PlayerLoginEvent event) {
Player player = event.getPlayer();
@ -145,6 +147,7 @@ public void onPlayerLogin(PlayerLoginEvent event) {
}
}
}
*/
/**
* Called when a player joins a server.
@ -858,7 +861,8 @@ public void onPlayerBucketFill(PlayerBucketFillEvent event) {
ConfigurationManager cfg = plugin.getGlobalStateManager();
WorldConfiguration wcfg = cfg.get(world);
if (!plugin.getGlobalRegionManager().canBuild(player, event.getBlockClicked())) {
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);
return;
@ -885,7 +889,8 @@ public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event) {
ConfigurationManager cfg = plugin.getGlobalStateManager();
WorldConfiguration wcfg = cfg.get(world);
if (!plugin.getGlobalRegionManager().canBuild(player, event.getBlockClicked())) {
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);
return;