Skip to content

Commit 670dba0

Browse files
authored
Merge pull request cabaletta#4952 from ZacSharp/pr/1.19.4/misc/toolset/useSwordTag
Use `minecraft:swords` item tag to detect swords
2 parents 75d8f68 + 9bee04d commit 670dba0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/baritone/utils/ToolSet.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import baritone.Baritone;
2121
import net.minecraft.client.player.LocalPlayer;
22+
import net.minecraft.tags.ItemTags;
2223
import net.minecraft.world.effect.MobEffects;
2324
import net.minecraft.world.item.ItemStack;
2425
import net.minecraft.world.item.SwordItem;
@@ -125,7 +126,7 @@ possible, this lets us make pathing depend on the actual tool to be used (if aut
125126
BlockState blockState = b.defaultBlockState();
126127
for (int i = 0; i < 9; i++) {
127128
ItemStack itemStack = player.getInventory().getItem(i);
128-
if (!Baritone.settings().useSwordToMine.value && itemStack.getItem() instanceof SwordItem) {
129+
if (!Baritone.settings().useSwordToMine.value && itemStack.is(ItemTags.SWORDS)) {
129130
continue;
130131
}
131132

0 commit comments

Comments
 (0)