diff --git a/src/main/java/com/atsuishio/superbwarfare/block/SuperbItemInterfaceBlock.java b/src/main/java/com/atsuishio/superbwarfare/block/SuperbItemInterfaceBlock.java index 6f019fa34..9360ba676 100644 --- a/src/main/java/com/atsuishio/superbwarfare/block/SuperbItemInterfaceBlock.java +++ b/src/main/java/com/atsuishio/superbwarfare/block/SuperbItemInterfaceBlock.java @@ -3,6 +3,7 @@ package com.atsuishio.superbwarfare.block; import com.atsuishio.superbwarfare.block.entity.SuperbItemInterfaceBlockEntity; import com.atsuishio.superbwarfare.init.ModBlockEntities; import com.atsuishio.superbwarfare.init.ModItems; +import com.atsuishio.superbwarfare.init.ModTags; import com.mojang.serialization.MapCodec; import net.minecraft.ChatFormatting; import net.minecraft.core.BlockPos; @@ -81,7 +82,7 @@ public class SuperbItemInterfaceBlock extends BaseEntityBlock { @Override @ParametersAreNonnullByDefault protected @NotNull ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) { - if (stack.is(ModItems.CROWBAR.get())) { + if (stack.is(ModItems.CROWBAR.get()) || stack.is(ModTags.Items.WRENCHES_TAG) || stack.is(ModTags.Items.WRENCH_TAG)) { var facing = hitResult.getDirection(); level.setBlockAndUpdate(pos, state.setValue(FACING, facing)); return ItemInteractionResult.SUCCESS; diff --git a/src/main/java/com/atsuishio/superbwarfare/init/ModTags.java b/src/main/java/com/atsuishio/superbwarfare/init/ModTags.java index 9c443022d..4c17a6c28 100644 --- a/src/main/java/com/atsuishio/superbwarfare/init/ModTags.java +++ b/src/main/java/com/atsuishio/superbwarfare/init/ModTags.java @@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.init; import com.atsuishio.superbwarfare.Mod; import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; @@ -42,6 +43,9 @@ public class ModTags { public static final TagKey LEGENDARY_BLUEPRINT = tag("blueprint/legendary"); public static final TagKey CANNON_BLUEPRINT = tag("blueprint/cannon"); + public static final TagKey WRENCHES_TAG = ItemTags.create(ResourceLocation.fromNamespaceAndPath("c", "wrenches")); + public static final TagKey WRENCH_TAG = ItemTags.create(ResourceLocation.fromNamespaceAndPath("c", "tools/wrench")); + private static TagKey tag(String name) { return ItemTags.create(Mod.loc(name)); }