From 47ea1b967a5591353d5a9aff26514e4ceca16c41 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Tue, 22 Apr 2025 00:57:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E7=A6=81=E7=94=A8bocek?= =?UTF-8?q?=E7=9A=84=E9=83=A8=E5=88=86=E5=8A=A8=E7=94=BB=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/item/gun/special/BocekItem.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/item/gun/special/BocekItem.java b/src/main/java/com/atsuishio/superbwarfare/item/gun/special/BocekItem.java index d954e76dc..bdc8df824 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/gun/special/BocekItem.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/gun/special/BocekItem.java @@ -13,7 +13,6 @@ import com.atsuishio.superbwarfare.network.message.receive.ShootClientMessage; import com.atsuishio.superbwarfare.perk.AmmoPerk; import com.atsuishio.superbwarfare.perk.Perk; import com.atsuishio.superbwarfare.tools.GunsTool; -import com.atsuishio.superbwarfare.tools.InventoryTool; import com.atsuishio.superbwarfare.tools.SoundTool; import net.minecraft.client.Minecraft; import net.minecraft.client.player.LocalPlayer; @@ -104,7 +103,10 @@ public class BocekItem extends GunItem implements GeoItem { var data = GunData.from(stack); - if (GunsTool.getGunIntTag(GunData.from(stack).tag, "ArrowEmpty") > 0 && data.ammo.get() == 0 && (data.countBackupAmmo(player) > 0 || InventoryTool.hasCreativeAmmoBox(player))) { + // TODO 调整成正常的判断逻辑 + if (GunsTool.getGunIntTag(GunData.from(stack).tag, "ArrowEmpty") > 0 && data.ammo.get() == 0 +// && (data.countBackupAmmo(player) > 0 || InventoryTool.hasCreativeAmmoBox(player)) + ) { return event.setAndContinue(RawAnimation.begin().thenPlay("animation.bocek.reload")); } @@ -131,11 +133,12 @@ public class BocekItem extends GunItem implements GeoItem { @ParametersAreNonnullByDefault public void inventoryTick(ItemStack stack, Level world, Entity entity, int slot, boolean selected) { super.inventoryTick(stack, world, entity, slot, selected); - var data = GunData.from(stack); if (entity instanceof Player player) { - if (GunsTool.getGunIntTag(data.tag, "ArrowEmpty") > 0) { - GunsTool.setGunIntTag(data.tag, "ArrowEmpty", GunsTool.getGunIntTag(data.tag, "ArrowEmpty") - 1); + var data = GunData.from(stack); + + if (GunsTool.getGunIntTag(GunData.from(stack).tag, "ArrowEmpty") > 0) { + GunsTool.setGunIntTag(data.tag, "ArrowEmpty", GunsTool.getGunIntTag(GunData.from(stack).tag, "ArrowEmpty") - 1); } if (GunsTool.getGunIntTag(data.tag, "ArrowEmpty") == 0 && data.ammo.get() == 0 && data.hasBackupAmmo(player)) {