优化NBT#CustomVelocity

This commit is contained in:
17146 2024-12-24 17:26:47 +08:00
parent b8f20eb2a0
commit 49789548b8
2 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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);