Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ public static double getScore(ItemStack itemStack, BlockState state, boolean for
// for ender chest, only pickaxes are valid tool (silk touch axes will drop ec but extremely slow, so we pass it)
if (state.getBlock() == Blocks.ENDER_CHEST && !itemStack.isIn(ItemTags.PICKAXES)) return -1;
boolean bypassSuitability = isSilkTarget && allowSilkBypass(state);

// When fortuneForOresCrops is enabled, allow crops to bypass suitability so fortune tools can be considered for crops
if (!bypassSuitability && fortuneOre && (state.getBlock() instanceof CropBlock || state.getBlock() instanceof NetherWartBlock)) bypassSuitability = true;

if (!itemStack.isSuitableFor(state) &&
!bypassSuitability &&
!(itemStack.isIn(ItemTags.SWORDS) && (state.getBlock() instanceof BambooBlock || state.getBlock() instanceof BambooShootBlock)) &&
Expand Down Expand Up @@ -260,6 +264,9 @@ && isFortunable(state.getBlock())
if (itemStack.isIn(ItemTags.SWORDS) && (state.getBlock() instanceof BambooBlock || state.getBlock() instanceof BambooShootBlock))
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;

return score;
}

Expand Down