Add waterlogging check for buckets (#1156)
Co-authored-by: Adam <[email protected]>
This commit is contained in:
@@ -1461,6 +1461,15 @@ class PlayerEventHandler implements Listener
|
||||
Block block = bucketEvent.getBlockClicked().getRelative(bucketEvent.getBlockFace());
|
||||
int minLavaDistance = 10;
|
||||
|
||||
// Fixes #1155:
|
||||
// Prevents waterlogging blocks placed on a claim's edge.
|
||||
// Waterlogging a block affects the clicked block, and NOT the adjacent location relative to it.
|
||||
if (bucketEvent.getBucket() == Material.WATER_BUCKET
|
||||
&& bucketEvent.getBlockClicked().getBlockData() instanceof Waterlogged)
|
||||
{
|
||||
block = bucketEvent.getBlockClicked();
|
||||
}
|
||||
|
||||
//make sure the player is allowed to build at the location
|
||||
String noBuildReason = instance.allowBuild(player, block.getLocation(), Material.WATER);
|
||||
if (noBuildReason != null)
|
||||
|
||||
Reference in New Issue
Block a user