mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-31 04:21:25 +01:00
Check waterlogged blocks when emptying buckets.
Fixes WORLDGUARD-4119.
(cherry picked from commit 3272759f25
)
This commit is contained in:
parent
de2b673902
commit
6cf3c23b47
@ -64,6 +64,7 @@
|
||||
import org.bukkit.block.Dropper;
|
||||
import org.bukkit.block.Hopper;
|
||||
import org.bukkit.block.PistonMoveReaction;
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
import org.bukkit.block.data.type.Dispenser;
|
||||
import org.bukkit.entity.AreaEffectCloud;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -530,7 +531,15 @@ public void onBedEnter(PlayerBedEnterEvent event) {
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
Block blockAffected = event.getBlockClicked().getRelative(event.getBlockFace());
|
||||
Block blockClicked = event.getBlockClicked();
|
||||
Block blockAffected;
|
||||
|
||||
if (blockClicked.getBlockData() instanceof Waterlogged) {
|
||||
blockAffected = blockClicked;
|
||||
} else {
|
||||
blockAffected = blockClicked.getRelative(event.getBlockFace());
|
||||
}
|
||||
|
||||
boolean allowed = false;
|
||||
|
||||
// Milk buckets can't be emptied as of writing
|
||||
|
Loading…
Reference in New Issue
Block a user