mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-25 02:27:42 +01:00
Buckets now check the region that the water will end up in, not the block that was clicked
This commit is contained in:
parent
dfbbeeb473
commit
321b3acf0a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user