BlueGit

timfa copperfarmer

Add harvest break effects, plant windup, and chest-lid feedback.

Co-authored-by: Cursor <cursoragent@cursor.com>

timfa Tim Falken · pushed by timfa

Authored 2026-08-14 · 3 months ago

Hash
43185b6ff0d6732135354963a4c9cd0e17f6a249
Parent
cf5d29ae
2 files changed +115 −10
src/main/java/nl/timfalken/copperfarmer/FarmerManager.java +107 −9
@@ -3,12 +3,16 @@ package nl.timfalken.copperfarmer;
3 3 import com.destroystokyo.paper.entity.Pathfinder;
4 4 import org.bukkit.Bukkit;
5 5 import org.bukkit.Chunk;
6 import org.bukkit.Effect;
6 7 import org.bukkit.Location;
7 8 import org.bukkit.Material;
9 import org.bukkit.Sound;
10 import org.bukkit.SoundCategory;
8 11 import org.bukkit.World;
9 12 import org.bukkit.block.Block;
10 13 import org.bukkit.block.BlockFace;
11 14 import org.bukkit.block.BlockState;
15 import org.bukkit.block.Lidded;
12 16 import org.bukkit.block.data.Ageable;
13 17 import org.bukkit.block.data.BlockData;
14 18 import org.bukkit.entity.CopperGolem;
@@ -51,6 +55,8 @@ final class FarmerManager {
51 55 private final int maxPathRetries;
52 56 private final long unreachableCooldown;
53 57 private final double actionDistanceSquared;
58 private final long plantWindupTicks;
59 private final long afterDepositScanTicks;
54 60 private final int cargoSlots;
55 61 private final boolean preventOxidation;
56 62
@@ -72,6 +78,8 @@ final class FarmerManager {
72 78 this.unreachableCooldown = Math.max(20, plugin.getConfig().getLong("unreachable-crop-cooldown-ticks", 600));
73 79 double actionDistance = Math.max(1.25, plugin.getConfig().getDouble("action-distance", 2.25));
74 80 this.actionDistanceSquared = actionDistance * actionDistance;
81 this.plantWindupTicks = Math.max(0L, plugin.getConfig().getLong("plant-windup-ticks", 10L));
82 this.afterDepositScanTicks = Math.max(1L, plugin.getConfig().getLong("after-deposit-scan-ticks", 20L));
75 83 this.cargoSlots = Math.max(1, plugin.getConfig().getInt("cargo-slots", 9));
76 84 this.preventOxidation = plugin.getConfig().getBoolean("prevent-oxidation", true);
77 85 }
@@ -100,7 +108,8 @@ final class FarmerManager {
100 108 }
101 109
102 110 void unregister(Entity entity) {
103 brains.remove(entity.getUniqueId());
111 Brain brain = brains.remove(entity.getUniqueId());
112 if (brain != null) brain.closeOpenedLid();
104 113 }
105 114
106 115 boolean isFarmer(Entity entity) {
@@ -128,6 +137,7 @@ final class FarmerManager {
128 137
129 138 List<ItemStack> deathDrops(CopperGolem golem) {
130 139 Brain brain = brains.remove(golem.getUniqueId());
140 if (brain != null) brain.closeOpenedLid();
131 141 FarmerCargo cargo = brain != null ? brain.cargo : new FarmerCargo(golem, keys, cargoSlots);
132 142 ItemStack tool = brain != null ? brain.tool.clone() : itemCodec.readTool(golem);
133 143 List<ItemStack> drops = new ArrayList<>();
@@ -154,6 +164,10 @@ final class FarmerManager {
154 164 private long lastProgressTick;
155 165 private int pathRetries;
156 166 private long nextScanTick;
167 private long plantReadyTick;
168 private long animationHoldUntil;
169 private BlockRef openedLid;
170 private long closeLidAt;
157 171
158 172 Brain(CopperGolem golem) {
159 173 this.golem = golem;
@@ -165,7 +179,10 @@ final class FarmerManager {
165 179
166 180 void tick() {
167 181 CopperGolemVanillaAi.suppress(golem, plugin);
168 CopperGolemVanillaAi.keepIdle(golem);
182 if (clock >= animationHoldUntil) {
183 CopperGolemVanillaAi.keepIdle(golem);
184 }
185 closeLidIfDue();
169 186 if (preventOxidation && golem.getOxidizing() != CopperGolem.Oxidizing.waxed()) {
170 187 golem.setOxidizing(CopperGolem.Oxidizing.waxed());
171 188 }
@@ -179,6 +196,7 @@ final class FarmerManager {
179 196 case IDLE -> tickIdle();
180 197 case MOVING_TO_CROP -> tickMovingToCrop();
181 198 case MOVING_TO_PLANT -> tickMovingToPlant();
199 case WAITING_TO_PLANT -> tickWaitingToPlant();
182 200 case MOVING_TO_CHEST -> tickMovingToChest();
183 201 case WAITING_FOR_CHEST_SPACE -> tickWaitingForChestSpace();
184 202 }
@@ -258,19 +276,43 @@ final class FarmerManager {
258 276
259 277 if (reachedNavigationTarget() && near(target)) {
260 278 stopNavigation();
261 if (cargo.remove(activeCrop.seed(), 1)) {
262 golem.swingMainHand();
263 target.setType(activeCrop.block(), false);
264 }
279 lookAt(target);
280 plantReadyTick = clock + plantWindupTicks;
281 state = State.WAITING_TO_PLANT;
282 return;
283 }
284
285 if (!navigationHealthy() && !retryPath()) {
265 286 plantQueue.pollFirst();
266 287 advancePlantQueue();
288 }
289 }
290
291 private void tickWaitingToPlant() {
292 if (activeCrop == null || cargo.count(activeCrop.seed()) <= 0) {
293 plantQueue.clear();
294 beginReturnToChest();
267 295 return;
268 296 }
269 297
270 if (!navigationHealthy() && !retryPath()) {
298 BlockRef targetRef = plantQueue.peekFirst();
299 Block target = block(targetRef);
300 if (target == null || !canPlantOn(target, activeCrop)) {
271 301 plantQueue.pollFirst();
272 302 advancePlantQueue();
303 return;
304 }
305
306 lookAt(target);
307 if (clock < plantReadyTick) return;
308
309 if (cargo.remove(activeCrop.seed(), 1)) {
310 playWorkAnimation(target);
311 target.setType(activeCrop.block(), false);
312 playPlantSound(target);
273 313 }
314 plantQueue.pollFirst();
315 advancePlantQueue();
274 316 }
275 317
276 318 private void tickMovingToChest() {
@@ -315,7 +357,8 @@ final class FarmerManager {
315 357 }
316 358
317 359 private void harvest(Block cropBlock, CropRegistry.Crop crop) {
318 golem.swingMainHand();
360 playWorkAnimation(cropBlock);
361 playHarvestEffects(cropBlock);
319 362 BlockData oldData = cropBlock.getBlockData().clone();
320 363 List<ItemStack> calculatedDrops = new ArrayList<>(cropBlock.getDrops(tool.clone(), golem));
321 364
@@ -330,6 +373,7 @@ final class FarmerManager {
330 373 if (cargo.remove(crop.seed(), 1)) {
331 374 if (oldData instanceof Ageable ageable) ageable.setAge(0);
332 375 cropBlock.setBlockData(oldData, false);
376 playPlantSound(cropBlock);
333 377 }
334 378 }
335 379
@@ -448,6 +492,11 @@ final class FarmerManager {
448 492 }
449 493
450 494 Inventory inventory = holder.getInventory();
495 lookAt(chestBlock);
496 golem.setGolemState(CopperGolem.State.DROPPING_ITEM);
497 animationHoldUntil = clock + 20;
498 openChestLid(chestBlock);
499
451 500 List<ItemStack> leftovers = new ArrayList<>();
452 501 for (ItemStack item : cargo.snapshot()) {
453 502 Map<Integer, ItemStack> notInserted = inventory.addItem(item.clone());
@@ -457,7 +506,7 @@ final class FarmerManager {
457 506
458 507 if (cargo.isEmpty()) {
459 508 this.state = State.IDLE;
460 nextScanTick = clock + scanInterval;
509 nextScanTick = clock + afterDepositScanTicks;
461 510 } else {
462 511 this.state = State.WAITING_FOR_CHEST_SPACE;
463 512 nextScanTick = clock + scanInterval;
@@ -605,6 +654,54 @@ final class FarmerManager {
605 654 return now.distanceSquared(navigationTarget) <= 1.25 * 1.25;
606 655 }
607 656
657 private void playWorkAnimation(Block target) {
658 lookAt(target);
659 // Copper golems have no melee-attack clip; the arm swing is the same
660 // packet vanilla uses for attacking / using a held tool.
661 golem.swingMainHand();
662 }
663
664 private void lookAt(Block target) {
665 golem.lookAt(target.getLocation().add(0.5, 0.5, 0.5));
666 }
667
668 private void playHarvestEffects(Block cropBlock) {
669 // Level event 2001: the same packet a real player break sends
670 // (break sound + destroy particles for this BlockData).
671 cropBlock.getWorld().playEffect(cropBlock.getLocation(), Effect.STEP_SOUND, cropBlock.getBlockData());
672 }
673
674 private void playPlantSound(Block planted) {
675 Location loc = planted.getLocation().add(0.5, 0.5, 0.5);
676 Sound sound = planted.getType() == Material.NETHER_WART
677 ? Sound.ITEM_NETHER_WART_PLANT
678 : Sound.ITEM_CROP_PLANT;
679 planted.getWorld().playSound(loc, sound, SoundCategory.BLOCKS, 1.0f, 0.9f);
680 }
681
682 private void openChestLid(Block chestBlock) {
683 closeOpenedLid();
684 BlockState state = chestBlock.getState();
685 if (!(state instanceof Lidded lidded)) return;
686 lidded.open();
687 openedLid = BlockRef.of(chestBlock);
688 closeLidAt = clock + 20;
689 }
690
691 private void closeLidIfDue() {
692 if (openedLid == null || clock < closeLidAt) return;
693 closeOpenedLid();
694 }
695
696 private void closeOpenedLid() {
697 Block lidBlock = block(openedLid);
698 openedLid = null;
699 closeLidAt = 0;
700 if (lidBlock == null) return;
701 BlockState state = lidBlock.getState();
702 if (state instanceof Lidded lidded && lidded.isOpen()) lidded.close();
703 }
704
608 705 private boolean isStandable(Block feet) {
609 706 if (!feet.isPassable() || !feet.getRelative(BlockFace.UP).isPassable()) return false;
610 707 Material below = feet.getRelative(BlockFace.DOWN).getType();
@@ -673,6 +770,7 @@ final class FarmerManager {
673 770 IDLE,
674 771 MOVING_TO_CROP,
675 772 MOVING_TO_PLANT,
773 WAITING_TO_PLANT,
676 774 MOVING_TO_CHEST,
677 775 WAITING_FOR_CHEST_SPACE
678 776 }
@@ -3,12 +3,16 @@ package nl.timfalken.copperfarmer;
3import com.destroystokyo.paper.entity.Pathfinder;
3import com.destroystokyo.paper.entity.Pathfinder;
4import org.bukkit.Bukkit;
4import org.bukkit.Bukkit;
5import org.bukkit.Chunk;
5import org.bukkit.Chunk;
6import org.bukkit.Effect;
6import org.bukkit.Location;
7import org.bukkit.Location;
7import org.bukkit.Material;
8import org.bukkit.Material;
9import org.bukkit.Sound;
10import org.bukkit.SoundCategory;
8import org.bukkit.World;
11import org.bukkit.World;
9import org.bukkit.block.Block;
12import org.bukkit.block.Block;
10import org.bukkit.block.BlockFace;
13import org.bukkit.block.BlockFace;
11import org.bukkit.block.BlockState;
14import org.bukkit.block.BlockState;
15import org.bukkit.block.Lidded;
12import org.bukkit.block.data.Ageable;
16import org.bukkit.block.data.Ageable;
13import org.bukkit.block.data.BlockData;
17import org.bukkit.block.data.BlockData;
14import org.bukkit.entity.CopperGolem;
18import org.bukkit.entity.CopperGolem;
@@ -51,6 +55,8 @@ final class FarmerManager {
51 private final int maxPathRetries;
55 private final int maxPathRetries;
52 private final long unreachableCooldown;
56 private final long unreachableCooldown;
53 private final double actionDistanceSquared;
57 private final double actionDistanceSquared;
58 private final long plantWindupTicks;
59 private final long afterDepositScanTicks;
54 private final int cargoSlots;
60 private final int cargoSlots;
55 private final boolean preventOxidation;
61 private final boolean preventOxidation;
56
62
@@ -72,6 +78,8 @@ final class FarmerManager {
72 this.unreachableCooldown = Math.max(20, plugin.getConfig().getLong("unreachable-crop-cooldown-ticks", 600));
78 this.unreachableCooldown = Math.max(20, plugin.getConfig().getLong("unreachable-crop-cooldown-ticks", 600));
73 double actionDistance = Math.max(1.25, plugin.getConfig().getDouble("action-distance", 2.25));
79 double actionDistance = Math.max(1.25, plugin.getConfig().getDouble("action-distance", 2.25));
74 this.actionDistanceSquared = actionDistance * actionDistance;
80 this.actionDistanceSquared = actionDistance * actionDistance;
81 this.plantWindupTicks = Math.max(0L, plugin.getConfig().getLong("plant-windup-ticks", 10L));
82 this.afterDepositScanTicks = Math.max(1L, plugin.getConfig().getLong("after-deposit-scan-ticks", 20L));
75 this.cargoSlots = Math.max(1, plugin.getConfig().getInt("cargo-slots", 9));
83 this.cargoSlots = Math.max(1, plugin.getConfig().getInt("cargo-slots", 9));
76 this.preventOxidation = plugin.getConfig().getBoolean("prevent-oxidation", true);
84 this.preventOxidation = plugin.getConfig().getBoolean("prevent-oxidation", true);
77 }
85 }
@@ -100,7 +108,8 @@ final class FarmerManager {
100 }
108 }
101
109
102 void unregister(Entity entity) {
110 void unregister(Entity entity) {
103 brains.remove(entity.getUniqueId());
111 Brain brain = brains.remove(entity.getUniqueId());
112 if (brain != null) brain.closeOpenedLid();
104 }
113 }
105
114
106 boolean isFarmer(Entity entity) {
115 boolean isFarmer(Entity entity) {
@@ -128,6 +137,7 @@ final class FarmerManager {
128
137
129 List<ItemStack> deathDrops(CopperGolem golem) {
138 List<ItemStack> deathDrops(CopperGolem golem) {
130 Brain brain = brains.remove(golem.getUniqueId());
139 Brain brain = brains.remove(golem.getUniqueId());
140 if (brain != null) brain.closeOpenedLid();
131 FarmerCargo cargo = brain != null ? brain.cargo : new FarmerCargo(golem, keys, cargoSlots);
141 FarmerCargo cargo = brain != null ? brain.cargo : new FarmerCargo(golem, keys, cargoSlots);
132 ItemStack tool = brain != null ? brain.tool.clone() : itemCodec.readTool(golem);
142 ItemStack tool = brain != null ? brain.tool.clone() : itemCodec.readTool(golem);
133 List<ItemStack> drops = new ArrayList<>();
143 List<ItemStack> drops = new ArrayList<>();
@@ -154,6 +164,10 @@ final class FarmerManager {
154 private long lastProgressTick;
164 private long lastProgressTick;
155 private int pathRetries;
165 private int pathRetries;
156 private long nextScanTick;
166 private long nextScanTick;
167 private long plantReadyTick;
168 private long animationHoldUntil;
169 private BlockRef openedLid;
170 private long closeLidAt;
157
171
158 Brain(CopperGolem golem) {
172 Brain(CopperGolem golem) {
159 this.golem = golem;
173 this.golem = golem;
@@ -165,7 +179,10 @@ final class FarmerManager {
165
179
166 void tick() {
180 void tick() {
167 CopperGolemVanillaAi.suppress(golem, plugin);
181 CopperGolemVanillaAi.suppress(golem, plugin);
168 CopperGolemVanillaAi.keepIdle(golem);
182 if (clock >= animationHoldUntil) {
183 CopperGolemVanillaAi.keepIdle(golem);
184 }
185 closeLidIfDue();
169 if (preventOxidation && golem.getOxidizing() != CopperGolem.Oxidizing.waxed()) {
186 if (preventOxidation && golem.getOxidizing() != CopperGolem.Oxidizing.waxed()) {
170 golem.setOxidizing(CopperGolem.Oxidizing.waxed());
187 golem.setOxidizing(CopperGolem.Oxidizing.waxed());
171 }
188 }
@@ -179,6 +196,7 @@ final class FarmerManager {
179 case IDLE -> tickIdle();
196 case IDLE -> tickIdle();
180 case MOVING_TO_CROP -> tickMovingToCrop();
197 case MOVING_TO_CROP -> tickMovingToCrop();
181 case MOVING_TO_PLANT -> tickMovingToPlant();
198 case MOVING_TO_PLANT -> tickMovingToPlant();
199 case WAITING_TO_PLANT -> tickWaitingToPlant();
182 case MOVING_TO_CHEST -> tickMovingToChest();
200 case MOVING_TO_CHEST -> tickMovingToChest();
183 case WAITING_FOR_CHEST_SPACE -> tickWaitingForChestSpace();
201 case WAITING_FOR_CHEST_SPACE -> tickWaitingForChestSpace();
184 }
202 }
@@ -258,19 +276,43 @@ final class FarmerManager {
258
276
259 if (reachedNavigationTarget() && near(target)) {
277 if (reachedNavigationTarget() && near(target)) {
260 stopNavigation();
278 stopNavigation();
261 if (cargo.remove(activeCrop.seed(), 1)) {
279 lookAt(target);
262 golem.swingMainHand();
280 plantReadyTick = clock + plantWindupTicks;
263 target.setType(activeCrop.block(), false);
281 state = State.WAITING_TO_PLANT;
264 }
282 return;
283 }
284
285 if (!navigationHealthy() && !retryPath()) {
265 plantQueue.pollFirst();
286 plantQueue.pollFirst();
266 advancePlantQueue();
287 advancePlantQueue();
288 }
289 }
290
291 private void tickWaitingToPlant() {
292 if (activeCrop == null || cargo.count(activeCrop.seed()) <= 0) {
293 plantQueue.clear();
294 beginReturnToChest();
267 return;
295 return;
268 }
296 }
269
297
270 if (!navigationHealthy() && !retryPath()) {
298 BlockRef targetRef = plantQueue.peekFirst();
299 Block target = block(targetRef);
300 if (target == null || !canPlantOn(target, activeCrop)) {
271 plantQueue.pollFirst();
301 plantQueue.pollFirst();
272 advancePlantQueue();
302 advancePlantQueue();
303 return;
304 }
305
306 lookAt(target);
307 if (clock < plantReadyTick) return;
308
309 if (cargo.remove(activeCrop.seed(), 1)) {
310 playWorkAnimation(target);
311 target.setType(activeCrop.block(), false);
312 playPlantSound(target);
273 }
313 }
314 plantQueue.pollFirst();
315 advancePlantQueue();
274 }
316 }
275
317
276 private void tickMovingToChest() {
318 private void tickMovingToChest() {
@@ -315,7 +357,8 @@ final class FarmerManager {
315 }
357 }
316
358
317 private void harvest(Block cropBlock, CropRegistry.Crop crop) {
359 private void harvest(Block cropBlock, CropRegistry.Crop crop) {
318 golem.swingMainHand();
360 playWorkAnimation(cropBlock);
361 playHarvestEffects(cropBlock);
319 BlockData oldData = cropBlock.getBlockData().clone();
362 BlockData oldData = cropBlock.getBlockData().clone();
320 List<ItemStack> calculatedDrops = new ArrayList<>(cropBlock.getDrops(tool.clone(), golem));
363 List<ItemStack> calculatedDrops = new ArrayList<>(cropBlock.getDrops(tool.clone(), golem));
321
364
@@ -330,6 +373,7 @@ final class FarmerManager {
330 if (cargo.remove(crop.seed(), 1)) {
373 if (cargo.remove(crop.seed(), 1)) {
331 if (oldData instanceof Ageable ageable) ageable.setAge(0);
374 if (oldData instanceof Ageable ageable) ageable.setAge(0);
332 cropBlock.setBlockData(oldData, false);
375 cropBlock.setBlockData(oldData, false);
376 playPlantSound(cropBlock);
333 }
377 }
334 }
378 }
335
379
@@ -448,6 +492,11 @@ final class FarmerManager {
448 }
492 }
449
493
450 Inventory inventory = holder.getInventory();
494 Inventory inventory = holder.getInventory();
495 lookAt(chestBlock);
496 golem.setGolemState(CopperGolem.State.DROPPING_ITEM);
497 animationHoldUntil = clock + 20;
498 openChestLid(chestBlock);
499
451 List<ItemStack> leftovers = new ArrayList<>();
500 List<ItemStack> leftovers = new ArrayList<>();
452 for (ItemStack item : cargo.snapshot()) {
501 for (ItemStack item : cargo.snapshot()) {
453 Map<Integer, ItemStack> notInserted = inventory.addItem(item.clone());
502 Map<Integer, ItemStack> notInserted = inventory.addItem(item.clone());
@@ -457,7 +506,7 @@ final class FarmerManager {
457
506
458 if (cargo.isEmpty()) {
507 if (cargo.isEmpty()) {
459 this.state = State.IDLE;
508 this.state = State.IDLE;
460 nextScanTick = clock + scanInterval;
509 nextScanTick = clock + afterDepositScanTicks;
461 } else {
510 } else {
462 this.state = State.WAITING_FOR_CHEST_SPACE;
511 this.state = State.WAITING_FOR_CHEST_SPACE;
463 nextScanTick = clock + scanInterval;
512 nextScanTick = clock + scanInterval;
@@ -605,6 +654,54 @@ final class FarmerManager {
605 return now.distanceSquared(navigationTarget) <= 1.25 * 1.25;
654 return now.distanceSquared(navigationTarget) <= 1.25 * 1.25;
606 }
655 }
607
656
657 private void playWorkAnimation(Block target) {
658 lookAt(target);
659 // Copper golems have no melee-attack clip; the arm swing is the same
660 // packet vanilla uses for attacking / using a held tool.
661 golem.swingMainHand();
662 }
663
664 private void lookAt(Block target) {
665 golem.lookAt(target.getLocation().add(0.5, 0.5, 0.5));
666 }
667
668 private void playHarvestEffects(Block cropBlock) {
669 // Level event 2001: the same packet a real player break sends
670 // (break sound + destroy particles for this BlockData).
671 cropBlock.getWorld().playEffect(cropBlock.getLocation(), Effect.STEP_SOUND, cropBlock.getBlockData());
672 }
673
674 private void playPlantSound(Block planted) {
675 Location loc = planted.getLocation().add(0.5, 0.5, 0.5);
676 Sound sound = planted.getType() == Material.NETHER_WART
677 ? Sound.ITEM_NETHER_WART_PLANT
678 : Sound.ITEM_CROP_PLANT;
679 planted.getWorld().playSound(loc, sound, SoundCategory.BLOCKS, 1.0f, 0.9f);
680 }
681
682 private void openChestLid(Block chestBlock) {
683 closeOpenedLid();
684 BlockState state = chestBlock.getState();
685 if (!(state instanceof Lidded lidded)) return;
686 lidded.open();
687 openedLid = BlockRef.of(chestBlock);
688 closeLidAt = clock + 20;
689 }
690
691 private void closeLidIfDue() {
692 if (openedLid == null || clock < closeLidAt) return;
693 closeOpenedLid();
694 }
695
696 private void closeOpenedLid() {
697 Block lidBlock = block(openedLid);
698 openedLid = null;
699 closeLidAt = 0;
700 if (lidBlock == null) return;
701 BlockState state = lidBlock.getState();
702 if (state instanceof Lidded lidded && lidded.isOpen()) lidded.close();
703 }
704
608 private boolean isStandable(Block feet) {
705 private boolean isStandable(Block feet) {
609 if (!feet.isPassable() || !feet.getRelative(BlockFace.UP).isPassable()) return false;
706 if (!feet.isPassable() || !feet.getRelative(BlockFace.UP).isPassable()) return false;
610 Material below = feet.getRelative(BlockFace.DOWN).getType();
707 Material below = feet.getRelative(BlockFace.DOWN).getType();
@@ -673,6 +770,7 @@ final class FarmerManager {
673 IDLE,
770 IDLE,
674 MOVING_TO_CROP,
771 MOVING_TO_CROP,
675 MOVING_TO_PLANT,
772 MOVING_TO_PLANT,
773 WAITING_TO_PLANT,
676 MOVING_TO_CHEST,
774 MOVING_TO_CHEST,
677 WAITING_FOR_CHEST_SPACE
775 WAITING_FOR_CHEST_SPACE
678 }
776 }
src/main/resources/config.yml +8 −1
@@ -4,7 +4,8 @@ chest-search-chunk-radius: 2
4 4 # Crops must be within this Euclidean distance of the bound chest.
5 5 crop-radius: 15
6 6
7 # An idle farmer scans for a mature crop this often. 200 ticks = 10 seconds.
7 # An idle farmer retries a crop scan this often when nothing was found. 200 ticks = 10 seconds.
8 # After a successful chest dump the farmer waits 1 second instead (after-deposit-scan-ticks).
8 9 scan-interval-ticks: 200
9 10
10 11 # State-machine update interval. Pathfinding itself remains vanilla.
@@ -25,6 +26,12 @@ unreachable-crop-cooldown-ticks: 600
25 26 # Distance from the target block at which harvesting/planting/depositing is allowed.
26 27 action-distance: 2.25
27 28
29 # After arriving at empty farmland, wait this long before planting. 10 ticks = 0.5 seconds.
30 plant-windup-ticks: 10
31
32 # After a successful cargo dump, wait this long before scanning for the next crop. 20 ticks = 1 second.
33 after-deposit-scan-ticks: 20
34
28 35 # Maximum internal cargo stacks. Partial stacks are combined first.
29 36 cargo-slots: 9
30 37
@@ -4,7 +4,8 @@ chest-search-chunk-radius: 2
4# Crops must be within this Euclidean distance of the bound chest.
4# Crops must be within this Euclidean distance of the bound chest.
5crop-radius: 15
5crop-radius: 15
6
6
7# An idle farmer scans for a mature crop this often. 200 ticks = 10 seconds.
7# An idle farmer retries a crop scan this often when nothing was found. 200 ticks = 10 seconds.
8# After a successful chest dump the farmer waits 1 second instead (after-deposit-scan-ticks).
8scan-interval-ticks: 200
9scan-interval-ticks: 200
9
10
10# State-machine update interval. Pathfinding itself remains vanilla.
11# State-machine update interval. Pathfinding itself remains vanilla.
@@ -25,6 +26,12 @@ unreachable-crop-cooldown-ticks: 600
25# Distance from the target block at which harvesting/planting/depositing is allowed.
26# Distance from the target block at which harvesting/planting/depositing is allowed.
26action-distance: 2.25
27action-distance: 2.25
27
28
29# After arriving at empty farmland, wait this long before planting. 10 ticks = 0.5 seconds.
30plant-windup-ticks: 10
31
32# After a successful cargo dump, wait this long before scanning for the next crop. 20 ticks = 1 second.
33after-deposit-scan-ticks: 20
34
28# Maximum internal cargo stacks. Partial stacks are combined first.
35# Maximum internal cargo stacks. Partial stacks are combined first.
29cargo-slots: 9
36cargo-slots: 9
30
37