Skip to content

Conversation

noramibu
Copy link
Contributor

@noramibu noramibu commented Oct 1, 2025

Type of change

  • Bug fix
  • New feature

Description

removed silk touch for ender chest option and implemented a whitelist for silk touch. If a suitable tool exists and block is in whitelist, it will always prefer silk touch (unless user doesn't have a silk touch tool, in that case it will choose most suitable tool (or fortune tool if fortuneForOresCrops enabled))

also fixed fortuneForOresCrops wasn't working for crops because there was no suitable tool for it (now they simply bypass tool check if fortuneForOresCrops is on)

Related issues

#5729 #5243

How Has This Been Tested?

https://youtu.be/ECl49wCImMs

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

@noramibu noramibu changed the title implement -prefer silk touch- to Auto Tool implement prefer silk touch to Auto Tool Oct 1, 2025
@noramibu noramibu requested a review from machiecodes October 1, 2025 18:19
@noramibu
Copy link
Contributor Author

noramibu commented Oct 1, 2025

turns out fortune for ores and crops option doesn't work on crops bcs there's simply no suitable tool for it. a simple bypass would do the trick for #5243

@noramibu
Copy link
Contributor Author

noramibu commented Oct 1, 2025

this would do the trick

score += 9000 + (itemStack.get(DataComponentTypes.TOOL).getSpeed(state) * 1000);

// Prefer hoes slightly for crops when fortune is enabled and the block is a crop.
if (fortuneOre && (state.getBlock() instanceof CropBlock || state.getBlock() instanceof NetherWartBlock) && itemStack.isIn(ItemTags.HOES)) score += 10;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no point to prefer hoes as default when we don't consider using fortune for crops, thats why its req fortuneore option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants