From 49789548b8f69805807c1c467f33a0dfce5c5bae Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Tue, 24 Dec 2024 17:26:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96NBT#CustomVelocity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/atsuishio/superbwarfare/event/GunEventHandler.java | 2 +- .../atsuishio/superbwarfare/item/gun/handgun/Trachelium.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/event/GunEventHandler.java b/src/main/java/com/atsuishio/superbwarfare/event/GunEventHandler.java index 52a26a3d1..92e923d10 100644 --- a/src/main/java/com/atsuishio/superbwarfare/event/GunEventHandler.java +++ b/src/main/java/com/atsuishio/superbwarfare/event/GunEventHandler.java @@ -187,7 +187,7 @@ public class GunEventHandler { if (!player.level().isClientSide()) { float headshot = (float) GunsTool.getGunDoubleTag(stack, "Headshot", 0); float damage = (float) (GunsTool.getGunDoubleTag(stack, "Damage", 0) + stack.getOrCreateTag().getDouble("sentinelChargeDamage")) * (float) perkDamage(stack); - float velocity = (float) ((GunsTool.getGunDoubleTag(stack, "Velocity", 0) + stack.getOrCreateTag().getDouble("CustomVelocity")) * perkSpeed(stack)); + float velocity = (float) ((GunsTool.getGunDoubleTag(stack, "Velocity", 0) + GunsTool.getGunDoubleTag(stack, "CustomVelocity", 0)) * perkSpeed(stack)); int projectileAmount = GunsTool.getGunIntTag(stack, "ProjectileAmount", 1); float bypassArmorRate = (float) GunsTool.getGunDoubleTag(stack, "BypassesArmor", 0); boolean zoom = player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).zoom; diff --git a/src/main/java/com/atsuishio/superbwarfare/item/gun/handgun/Trachelium.java b/src/main/java/com/atsuishio/superbwarfare/item/gun/handgun/Trachelium.java index c62db5f77..a7f4b2ba7 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/gun/handgun/Trachelium.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/gun/handgun/Trachelium.java @@ -275,12 +275,12 @@ public class Trachelium extends GunItem implements GeoItem, AnimatedItem { } if (scopeType > 0 || gripType > 0) { - tag.putDouble("CustomVelocity", 15); + GunsTool.setGunDoubleTag(stack, "CustomVelocity", 15); GunsTool.setGunDoubleTag(stack, "BypassesArmor", 0.4); GunsTool.setGunDoubleTag(stack, "Damage", 21); GunsTool.setGunDoubleTag(stack, "Headshot", 2.5); } else { - tag.putDouble("CustomVelocity", 0); + GunsTool.setGunDoubleTag(stack, "CustomVelocity", 0); GunsTool.setGunDoubleTag(stack, "BypassesArmor", 0.3); GunsTool.setGunDoubleTag(stack, "Damage", 19); GunsTool.setGunDoubleTag(stack, "Headshot", 2);