From 82b26ffdcbc6c06cc7bfb1bcb7bed64942e921bb Mon Sep 17 00:00:00 2001 From: Atsuishio <842960157@qq.com> Date: Sat, 24 May 2025 17:05:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=B7=E6=9C=88=E6=9D=83?= =?UTF-8?q?=E6=9D=96=E5=B0=84=E5=87=BB=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../item/gun/handgun/AureliaSceptre.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/item/gun/handgun/AureliaSceptre.java b/src/main/java/com/atsuishio/superbwarfare/item/gun/handgun/AureliaSceptre.java index 44bc600ea..57c622796 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/gun/handgun/AureliaSceptre.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/gun/handgun/AureliaSceptre.java @@ -63,9 +63,6 @@ public class AureliaSceptre extends GunItem implements GeoItem { ItemStack stack = player.getMainHandItem(); if (!(stack.getItem() instanceof GunItem)) return PlayState.STOP; - if (ClientEventHandler.firePosTimer > 0) { - return event.setAndContinue(RawAnimation.begin().thenLoop("animation.aurelia_sceptre.fire")); - } if (player.isSprinting() && player.onGround() && ClientEventHandler.cantSprint == 0 @@ -76,6 +73,21 @@ public class AureliaSceptre extends GunItem implements GeoItem { return event.setAndContinue(RawAnimation.begin().thenLoop("animation.aurelia_sceptre.idle")); } + private PlayState firePredicate(AnimationState event) { + LocalPlayer player = Minecraft.getInstance().player; + if (player == null) return PlayState.STOP; + ItemStack stack = player.getMainHandItem(); + if (!(stack.getItem() instanceof GunItem gunItem)) return PlayState.STOP; + var data = GunData.from(stack); + + if (ClientEventHandler.holdFire && gunItem.canShoot(data) && !data.overHeat.get()) { + return event.setAndContinue(RawAnimation.begin().thenLoop("animation.aurelia_sceptre.fire")); + } + + + return event.setAndContinue(RawAnimation.begin().thenLoop("animation.aurelia_sceptre.idle")); + } + private PlayState meleePredicate(AnimationState event) { if (ClientEventHandler.gunMelee > 0) { return event.setAndContinue(RawAnimation.begin().thenPlay("animation.aurelia_sceptre.hit")); @@ -100,6 +112,8 @@ public class AureliaSceptre extends GunItem implements GeoItem { public void registerControllers(AnimatableManager.ControllerRegistrar data) { var idleController = new AnimationController<>(this, "idleController", 6, this::idlePredicate); data.add(idleController); + var fireController = new AnimationController<>(this, "fireController", 3, this::firePredicate); + data.add(fireController); var meleeController = new AnimationController<>(this, "meleeController", 0, this::meleePredicate); data.add(meleeController); }