Skip to content

Commit abac467

Browse files
authored
Fix AOE not working on tools other than Mining Hammer (#3774)
1 parent 65b44d8 commit abac467

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/main/java/com/gregtechceu/gtceu/api/item/tool/ToolHelper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,10 @@ public static List<BlockPos> getHarvestableBlocks(ItemStack stack, Player player
555555
}
556556

557557
BlockHitResult hitResult = getPlayerDefaultRaytrace(player);
558-
var hand = is(player.getItemInHand(InteractionHand.MAIN_HAND), GTToolType.MINING_HAMMER) ?
558+
var toolType = player.getItemInHand(InteractionHand.MAIN_HAND).getItem() instanceof GTToolItem toolItem ?
559+
toolItem.toolType : null;
560+
if (toolType == null) return Collections.emptyList();
561+
var hand = is(player.getItemInHand(InteractionHand.MAIN_HAND), toolType) ?
559562
InteractionHand.MAIN_HAND : null;
560563
if (hand == null) return Collections.emptyList();
561564
UseOnContext context = new UseOnContext(player, hand, hitResult);

0 commit comments

Comments
 (0)