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)) {