diff --git a/CHANGELOG.md b/CHANGELOG.md index 34e2c23d9..96787a9c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ * Fix Black Quartz wall recipe conflicts * Fix output of Wall, Stair and Slab recipes * Add stonecutter recipes for the walls/stairs and slabs +* Fixed Farmer being unable to plant potatoes / carrots. +* Possible fix for very rare stack overflow. +* Reinforced fix for drills breaking in certain circumstances. +* Fix for drill not dropping block contents for certain mods. # 1.3.10+mc1.21.1 * Fixed Fluid placer not being harvestable. 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 6d02407ba..061da6acb 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 @@ -78,8 +78,8 @@ public class DefaultFarmerBehavior implements IFarmerBehavior { farmer.extractEnergy(use); return FarmerResult.SUCCESS; } else { - if (seed.is(Tags.Items.SEEDS) && seed.getItem() instanceof BlockItem blockItem) { - if (defaultPlant(world, pos, blockItem.getBlock().defaultBlockState(), farmer, use)) { + if (isPlantable(seed)) { + if (defaultPlant(world, pos, ((BlockItem)seed.getItem()).getBlock().defaultBlockState(), farmer, use)) { return FarmerResult.SUCCESS; } } @@ -88,6 +88,12 @@ public class DefaultFarmerBehavior implements IFarmerBehavior { return FarmerResult.FAIL; } + private boolean isPlantable(ItemStack seed) { + if (seed.is(Tags.Items.SEEDS) && seed.getItem() instanceof BlockItem) { + return true; + } else return seed.getItem() instanceof BlockItem blockItem && blockItem.getBlock() instanceof CropBlock; + } + @Override public FarmerResult tryHarvestPlant(ServerLevel world, BlockPos pos, IFarmer farmer) { int use = 250; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java index df1f3e113..dc380e461 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFarmer.java @@ -60,6 +60,7 @@ public class TileEntityFarmer extends TileEntityInventoryBase implements IFarmer public TileEntityFarmer(BlockPos pos, BlockState state) { super(ActuallyBlocks.FARMER.getTileEntityType(), pos, state, 12); + area = CommonConfig.Machines.FARMER_AREA.get(); } @Override