Add bamboo to `FarmProcess` targets

This commit is contained in:
ZacSharp 2024-07-14 10:37:31 +02:00
parent 92bc067633
commit 52aa609ac7
No known key found for this signature in database
GPG Key ID: 9453647B005083A3
1 changed files with 11 additions and 0 deletions

View File

@ -42,6 +42,7 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.AirBlock;
import net.minecraft.world.level.block.BambooStalkBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.BonemealableBlock;
@ -95,6 +96,7 @@ public final class FarmProcess extends BaritoneProcessHelper implements IFarmPro
Items.NETHER_WART,
Items.COCOA_BEANS,
Blocks.SUGAR_CANE.asItem(),
Blocks.BAMBOO.asItem(),
Blocks.CACTUS.asItem()
);
@ -137,6 +139,15 @@ public final class FarmProcess extends BaritoneProcessHelper implements IFarmPro
return true;
}
},
BAMBOO(Blocks.BAMBOO, null) {
@Override
public boolean readyToHarvest(Level world, BlockPos pos, BlockState state) {
if (Baritone.settings().replantCrops.value) {
return world.getBlockState(pos.below()).getBlock() instanceof BambooStalkBlock;
}
return true;
}
},
CACTUS(Blocks.CACTUS, null) {
@Override
public boolean readyToHarvest(Level world, BlockPos pos, BlockState state) {