Fix: Milking cows requires only /ct, not /trust.
Oddly, BOTH the block bucket event and the animal interact event fire, and cancelling the block event also cancels the animal event. Added a workaround.
This commit is contained in:
parent
935fc53bed
commit
978f7a5ad1
|
|
@ -1037,6 +1037,10 @@ class PlayerEventHandler implements Listener
|
||||||
String noBuildReason = GriefPrevention.instance.allowBuild(player, block.getLocation(), Material.AIR);
|
String noBuildReason = GriefPrevention.instance.allowBuild(player, block.getLocation(), Material.AIR);
|
||||||
if(noBuildReason != null)
|
if(noBuildReason != null)
|
||||||
{
|
{
|
||||||
|
//exemption for cow milking (permissions will be handled by player interact with entity event instead)
|
||||||
|
Material blockType = block.getType();
|
||||||
|
if(blockType == Material.AIR || blockType.isSolid()) return;
|
||||||
|
|
||||||
GriefPrevention.sendMessage(player, TextMode.Err, noBuildReason);
|
GriefPrevention.sendMessage(player, TextMode.Err, noBuildReason);
|
||||||
bucketEvent.setCancelled(true);
|
bucketEvent.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user