优化部分代码

This commit is contained in:
Light_Quanta 2025-04-13 21:33:36 +08:00
parent 94983fea3a
commit 961ad668fa
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
3 changed files with 2 additions and 6 deletions

View file

@ -60,9 +60,7 @@ public class GunEventHandler {
var stack = data.stack();
if (stack.is(ModTags.Items.NORMAL_GUN)) {
if (data.bolt.actionTimer.get() > 0) {
data.bolt.actionTimer.reduce();
}
data.bolt.actionTimer.reduce();
if (stack.getItem() == ModItems.MARLIN.get() && data.bolt.actionTimer.get() == 9) {
data.isEmpty.set(false);

View file

@ -257,7 +257,6 @@ public class TaserItem extends GunItem implements GeoItem, SpecialFireWeapon, En
}
data.ammo.set(data.ammo.get() - 1);
data.tag().putBoolean("shoot", true);
energyStorage.extractEnergy(400 + 100 * perkLevel, false);
}

View file

@ -85,8 +85,7 @@ public record FireMessage(int msgType, double power, boolean zoom) implements Cu
if (data.defaultActionTime() > 0
&& data.ammo.get() > (stack.is(ModTags.Items.REVOLVER) ? -1 : 0)
&& data.bolt.actionTimer.get() == 0
&& !(data.reload.normal()
|| data.reload.empty())
&& !(data.reload.normal() || data.reload.empty())
&& !data.reloading()
&& !data.charging()
) {