1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-26 12:35:28 +01:00

Prevent players from being getting more money from beehives while sneaking

This commit is contained in:
montlikadani 2020-04-21 11:37:59 +02:00
parent c80d12f167
commit afef2dc927

View File

@ -1631,7 +1631,7 @@ public class JobsPaymentListener implements Listener {
}
if (Version.isCurrentEqualOrHigher(Version.v1_15_R1) && !event.useInteractedBlock().equals(org.bukkit.event.Event.Result.DENY)
&& event.getAction() == Action.RIGHT_CLICK_BLOCK) {
&& event.getAction() == Action.RIGHT_CLICK_BLOCK && !p.isSneaking()) {
if (jPlayer != null && cmat.equals(CMIMaterial.BEEHIVE) || cmat.equals(CMIMaterial.BEE_NEST)) {
org.bukkit.block.data.type.Beehive beehive = (org.bukkit.block.data.type.Beehive) block.getBlockData();
if (beehive.getHoneyLevel() == beehive.getMaximumHoneyLevel() && (hand.equals(CMIMaterial.SHEARS.getMaterial())