Update PlayerListener
This commit is contained in:
parent
ec4329fcc1
commit
8c9ef4dfe4
1 changed files with 3 additions and 2 deletions
|
|
@ -37,8 +37,9 @@ public class PlayerListener implements Listener {
|
||||||
// Cancel the original event to handle it ourselves
|
// Cancel the original event to handle it ourselves
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
// Find connected crops (limit 32)
|
// Find connected crops (limit 32 or amount in hand)
|
||||||
List<Block> targets = Utils.findConnectedCrops(clickedBlock, 32);
|
int maxToUse = Math.min(32, item.getAmount());
|
||||||
|
List<Block> targets = Utils.findConnectedCrops(clickedBlock, maxToUse);
|
||||||
if (targets.isEmpty()) return;
|
if (targets.isEmpty()) return;
|
||||||
|
|
||||||
// Folia-safe execution on the region of the clicked block
|
// Folia-safe execution on the region of the clicked block
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue