Add waterlogging check for buckets (#1156)
Co-authored-by: Adam <Jikoo.Games@gmail.com>
This commit is contained in:
parent
c235bb0a00
commit
329bfb54de
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user