Update PlayerListener

This commit is contained in:
Professor Doom 2026-05-19 17:46:16 -05:00
parent ec4329fcc1
commit 8c9ef4dfe4

View file

@ -37,8 +37,9 @@ public class PlayerListener implements Listener {
// Cancel the original event to handle it ourselves
event.setCancelled(true);
// Find connected crops (limit 32)
List<Block> targets = Utils.findConnectedCrops(clickedBlock, 32);
// Find connected crops (limit 32 or amount in hand)
int maxToUse = Math.min(32, item.getAmount());
List<Block> targets = Utils.findConnectedCrops(clickedBlock, maxToUse);
if (targets.isEmpty()) return;
// Folia-safe execution on the region of the clicked block