mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-12-26 17:18:43 +01:00
Fix emptying buckets in plot border (#3192)
* Fix emptying buckets in plot border * Note on 1.13 compatibility for bucket-empty event Co-authored-by: NotMyFault <mc.cache@web.de>
This commit is contained in:
parent
fd4cec39c4
commit
a405611b3a
@ -1167,10 +1167,15 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBucketEmpty(PlayerBucketEmptyEvent event) {
|
||||
BlockFace bf = event.getBlockFace();
|
||||
// Note: a month after Bukkit 1.14.4 released, they added the API method
|
||||
// PlayerBucketEmptyEvent#getBlock(), which returns the block the
|
||||
// bucket contents is going to be placed at. Currently we determine this
|
||||
// block ourselves to retain compatibility with 1.13.
|
||||
final Block block;
|
||||
// if the block can be waterlogged, the event might waterlog the block
|
||||
// sometimes
|
||||
if (event.getBlockClicked().getBlockData() instanceof Waterlogged) {
|
||||
if (event.getBlockClicked().getBlockData() instanceof Waterlogged waterlogged
|
||||
&& !waterlogged.isWaterlogged() && event.getBucket() != Material.LAVA_BUCKET) {
|
||||
block = event.getBlockClicked();
|
||||
} else {
|
||||
block = event.getBlockClicked().getLocation()
|
||||
|
Loading…
Reference in New Issue
Block a user