From 690aa4bc17083e258e106f466baa1acb6b31755b Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Sat, 7 Dec 2024 08:27:49 -0600 Subject: [PATCH] Fixed drill dyeing recipes, Closes #1459 --- CHANGELOG.md | 1 + .../mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62a7e2649..f1832a8e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # 1.3.12+mc1.21.1 * Fixed the Drill dye recipes not functioning. * Fixed the name of the first drill speed augment. +* Fixed the farmer not funneling seeds back to the seed slots. # 1.3.11+mc1.21.1 * Fixed Farmer not playing well with non-vanilla farmland. diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java index 72a25118d..4e1f48f84 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/apiimpl/farmer/DefaultFarmerBehavior.java @@ -74,7 +74,7 @@ private static boolean tryPlant(BlockState toPlant, Level world, BlockPos pos) { public FarmerResult tryPlantSeed(ItemStack seed, Level world, BlockPos pos, IFarmer farmer) { int use = 350; if (farmer.getEnergy() >= use * 2) { - var plantable = getPlantableFromStack(seed); //TODO: Should figure out what else to call in here (Farmland stuff etc) + var plantable = getSpecialPlantable(seed); //TODO: Should figure out what else to call in here (Farmland stuff etc) if (plantable != null && plantable.canPlacePlantAtPosition(seed, world, pos, Direction.DOWN)) { plantable.spawnPlantAtPosition(seed, world, pos, Direction.DOWN); farmer.extractEnergy(use); @@ -126,7 +126,7 @@ private FarmerResult doFarmerStuff(BlockState state, ServerLevel serverLevel, Bl if (drops.isEmpty()) return FarmerResult.FAIL; for (ItemStack stack : drops) { - if (this.getPlantableFromStack(stack) != null) { + if (this.getSpecialPlantable(stack) != null || isPlantable(stack)) { seeds.add(stack); } else { other.add(stack); @@ -160,7 +160,7 @@ public int getPriority() { return 0; } - private SpecialPlantable getPlantableFromStack(ItemStack stack) { + private SpecialPlantable getSpecialPlantable(ItemStack stack) { Item item = stack.getItem(); if (item instanceof SpecialPlantable plantable) { return plantable;