From c86dc2341a8f37ce705f90ad2dd38f86d6da8caf Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Thu, 10 Jul 2025 14:39:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=93=E8=B6=8A=E7=89=A9?= =?UTF-8?q?=E5=93=81=E6=8E=A5=E5=8F=A3=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/block/SuperbItemInterfaceBlock.java | 3 ++- src/main/java/com/atsuishio/superbwarfare/init/ModTags.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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)); }