Protect pumpkins from being sheared (#2388)

Requires Paper
This commit is contained in:
tastybento 2024-05-26 17:45:45 -07:00 committed by GitHub
parent ee3b0bfcc2
commit 1fd4a9043f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerShearEntityEvent;
import io.papermc.paper.event.block.PlayerShearBlockEvent;
import world.bentobox.bentobox.api.flags.FlagListener;
import world.bentobox.bentobox.lists.Flags;
@ -20,4 +21,10 @@ public class ShearingListener extends FlagListener {
checkIsland(e, e.getPlayer(), e.getEntity().getLocation(), Flags.SHEARING);
}
// Block shearing - paper only
@EventHandler(priority = EventPriority.LOW)
public void onShearBlock(final PlayerShearBlockEvent e) {
checkIsland(e, e.getPlayer(), e.getBlock().getLocation(), Flags.SHEARING);
}
}