From e8fe60b719775f710914e673c86c995389719d7f Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Wed, 16 Apr 2025 20:12:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DM79=E5=92=8C=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E7=81=BE=E5=8F=98=E5=8F=91=E5=B0=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/item/gun/launcher/JavelinItem.java | 5 ----- .../atsuishio/superbwarfare/item/gun/launcher/M79Item.java | 7 ------- .../atsuishio/superbwarfare/item/gun/launcher/RpgItem.java | 5 ----- .../item/gun/launcher/SecondaryCataclysm.java | 5 ----- .../superbwarfare/item/gun/special/TaserItem.java | 4 ---- .../superbwarfare/network/message/send/ShootMessage.java | 4 ++-- 6 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/JavelinItem.java b/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/JavelinItem.java index 0028489cf..f5c3476f3 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/JavelinItem.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/JavelinItem.java @@ -8,7 +8,6 @@ import com.atsuishio.superbwarfare.entity.projectile.JavelinMissileEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity; import com.atsuishio.superbwarfare.event.ClientEventHandler; import com.atsuishio.superbwarfare.init.ModEnumExtensions; -import com.atsuishio.superbwarfare.init.ModItems; import com.atsuishio.superbwarfare.init.ModPerks; import com.atsuishio.superbwarfare.init.ModSounds; import com.atsuishio.superbwarfare.item.gun.GunItem; @@ -184,10 +183,6 @@ public class JavelinItem extends GunItem implements GeoItem, ReleaseSpecialWeapo data.save(); } - protected static boolean check(ItemStack stack) { - return stack.getItem() == ModItems.JAVELIN_MISSILE.get(); - } - @Override public ResourceLocation getGunIcon() { return Mod.loc("textures/gun_icon/javelin_icon.png"); diff --git a/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/M79Item.java b/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/M79Item.java index b1ed53f77..8fda27644 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/M79Item.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/M79Item.java @@ -5,7 +5,6 @@ import com.atsuishio.superbwarfare.client.renderer.item.M79ItemRenderer; import com.atsuishio.superbwarfare.client.tooltip.component.LauncherImageComponent; import com.atsuishio.superbwarfare.entity.projectile.GunGrenadeEntity; import com.atsuishio.superbwarfare.event.ClientEventHandler; -import com.atsuishio.superbwarfare.init.ModItems; import com.atsuishio.superbwarfare.init.ModPerks; import com.atsuishio.superbwarfare.init.ModSounds; import com.atsuishio.superbwarfare.item.gun.GunItem; @@ -92,10 +91,6 @@ public class M79Item extends GunItem implements GeoItem, PressFireSpecialWeapon data.add(idleController); } - protected static boolean check(ItemStack stack) { - return stack.getItem() == ModItems.GRENADE_40MM.get(); - } - @Override public ResourceLocation getGunIcon() { return Mod.loc("textures/gun_icon/m79_icon.png"); @@ -129,8 +124,6 @@ public class M79Item extends GunItem implements GeoItem, PressFireSpecialWeapon @Override public void fireOnPress(Player player, final GunData data, double spread, boolean zoom) { if (data.reloading()) return; - ItemStack stack = data.stack(); - if (player.getCooldowns().isOnCooldown(stack.getItem()) || data.ammo.get() <= 0) return; if (player.level() instanceof ServerLevel serverLevel) { GunGrenadeEntity gunGrenadeEntity = new GunGrenadeEntity(player, serverLevel, diff --git a/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/RpgItem.java b/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/RpgItem.java index 4f2305353..d89709b73 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/RpgItem.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/RpgItem.java @@ -5,7 +5,6 @@ import com.atsuishio.superbwarfare.client.renderer.item.RpgItemRenderer; import com.atsuishio.superbwarfare.client.tooltip.component.LauncherImageComponent; import com.atsuishio.superbwarfare.entity.projectile.RpgRocketEntity; import com.atsuishio.superbwarfare.event.ClientEventHandler; -import com.atsuishio.superbwarfare.init.ModItems; import com.atsuishio.superbwarfare.init.ModPerks; import com.atsuishio.superbwarfare.init.ModSounds; import com.atsuishio.superbwarfare.item.gun.GunItem; @@ -120,10 +119,6 @@ public class RpgItem extends GunItem implements GeoItem, PressFireSpecialWeapon super.inventoryTick(stack, world, entity, slot, selected); } - protected static boolean check(ItemStack stack) { - return stack.getItem() == ModItems.ROCKET.get(); - } - @Override public ResourceLocation getGunIcon() { return Mod.loc("textures/gun_icon/rpg_icon.png"); diff --git a/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/SecondaryCataclysm.java b/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/SecondaryCataclysm.java index d77dd75e1..8d2fa9222 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/SecondaryCataclysm.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/SecondaryCataclysm.java @@ -176,10 +176,6 @@ public class SecondaryCataclysm extends GunItem implements GeoItem, PressFireSpe } } - protected static boolean check(ItemStack stack) { - return stack.getItem() == ModItems.GRENADE_40MM.get(); - } - @Override public ResourceLocation getGunIcon() { return Mod.loc("textures/gun_icon/secondary_cataclysm_icon.png"); @@ -239,7 +235,6 @@ public class SecondaryCataclysm extends GunItem implements GeoItem, PressFireSpe public void fireOnPress(Player player, final GunData data, double spread, boolean zoom) { if (data.reloading()) return; ItemStack stack = data.stack(); - if (player.getCooldowns().isOnCooldown(stack.getItem()) || data.ammo.get() <= 0) return; var stackCap = stack.getCapability(Capabilities.EnergyStorage.ITEM); var hasEnoughEnergy = stackCap != null && stackCap.getEnergyStored() >= 3000; diff --git a/src/main/java/com/atsuishio/superbwarfare/item/gun/special/TaserItem.java b/src/main/java/com/atsuishio/superbwarfare/item/gun/special/TaserItem.java index a62d3fa41..037a46614 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/gun/special/TaserItem.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/gun/special/TaserItem.java @@ -149,10 +149,6 @@ public class TaserItem extends GunItem implements GeoItem, EnergyStorageItem, Pr } } - protected static boolean check(ItemStack stack) { - return stack.getItem() == ModItems.TASER_ELECTRODE.get(); - } - @Override public ResourceLocation getGunIcon() { return Mod.loc("textures/gun_icon/taser_icon.png"); diff --git a/src/main/java/com/atsuishio/superbwarfare/network/message/send/ShootMessage.java b/src/main/java/com/atsuishio/superbwarfare/network/message/send/ShootMessage.java index 270e7595c..576748a7f 100644 --- a/src/main/java/com/atsuishio/superbwarfare/network/message/send/ShootMessage.java +++ b/src/main/java/com/atsuishio/superbwarfare/network/message/send/ShootMessage.java @@ -97,7 +97,7 @@ public record ShootMessage(double spread, boolean zoom) implements CustomPacketP } else if (stack.is(ModItems.MINIGUN.get())) { var cap = player.getData(ModAttachments.PLAYER_VARIABLE).watch(); - if (data.hasAmmo(player) || InventoryTool.hasCreativeAmmoBox(player)) { + if (data.hasAmmo(player)) { tag.putDouble("heat", (tag.getDouble("heat") + 0.1)); if (tag.getDouble("heat") >= 50.5) { tag.putDouble("overheat", 40); @@ -107,8 +107,8 @@ public record ShootMessage(double spread, boolean zoom) implements CustomPacketP } } - var perk = data.perk.get(Perk.Type.AMMO); float pitch = tag.getDouble("heat") <= 40 ? 1 : (float) (1 - 0.025 * Math.abs(40 - tag.getDouble("heat"))); + var perk = data.perk.get(Perk.Type.AMMO); if (!player.level().isClientSide() && player instanceof ServerPlayer) { float soundRadius = (float) data.soundRadius();