Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1423,9 +1423,12 @@ public void onBucketEmpty(PlayerBucketEmptyEvent event) {
area.getFlag(UseFlag.class) : Collections.emptyList());
BlockType type = BukkitAdapter.asBlockType(block.getType());
for (final BlockTypeWrapper blockTypeWrapper : use) {
if (blockTypeWrapper.accepts(BlockTypes.AIR) || blockTypeWrapper
.accepts(type)) {
return;
if (blockTypeWrapper.accepts(BlockTypes.AIR) || blockTypeWrapper.accepts(type)) {
// Allows this event for blocks that can be interacted with using a bucket without it being considered
// as "building" (= make it waterlogged or drop the block by flooding it)
if (type.getId().equals("minecraft:cauldron") || type.getId().endsWith("_cauldron")) {
return;
}
}
}
if (plot == null) {
Expand Down Expand Up @@ -1490,8 +1493,8 @@ public void onLeave(PlayerQuitEvent event) {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBucketFill(PlayerBucketFillEvent event) {
Block blockClicked = event.getBlockClicked();
Location location = BukkitUtil.adapt(blockClicked.getLocation());
Block block = event.getBlock();
Location location = BukkitUtil.adapt(block.getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
Expand All @@ -1502,11 +1505,14 @@ public void onBucketFill(PlayerBucketFillEvent event) {
final List<BlockTypeWrapper> use =
Optional.ofNullable(plot).map(p -> p.getFlag(UseFlag.class)).orElse(area.isRoadFlags() ?
area.getFlag(UseFlag.class) : Collections.emptyList());
BlockType type = BukkitAdapter.asBlockType(blockClicked.getType());
BlockType type = BukkitAdapter.asBlockType(block.getType());
for (final BlockTypeWrapper blockTypeWrapper : use) {
if (blockTypeWrapper.accepts(BlockTypes.AIR) || blockTypeWrapper
.accepts(type)) {
return;
if (blockTypeWrapper.accepts(BlockTypes.AIR) || blockTypeWrapper.accepts(type)) {
// Allows this event for blocks that can be interacted with using a bucket without it being considered
// as "building" (= make it waterlogged or drop the block by flooding it)
if (type.getId().equals("minecraft:cauldron") || type.getId().endsWith("_cauldron")) {
return;
}
}
}
if (plot == null) {
Expand Down
Loading