优化NBT#FinishTime

This commit is contained in:
17146 2024-12-24 17:05:43 +08:00
parent 3b51f00bcc
commit 1862382211
6 changed files with 8 additions and 7 deletions

View file

@ -678,8 +678,9 @@ public class GunEventHandler {
// 三阶段 // 三阶段
if ((tag.getInt("iterative") == 1 && tag.getInt("reload_stage") == 3) || tag.getBoolean("force_stage3_start")) { if ((tag.getInt("iterative") == 1 && tag.getInt("reload_stage") == 3) || tag.getBoolean("force_stage3_start")) {
tag.putBoolean("force_stage3_start", false); tag.putBoolean("force_stage3_start", false);
tag.putInt("finish", (int) tag.getDouble("finish_time") + 2); int finishTime = GunsTool.getGunIntTag(stack, "FinishTime", 0);
player.getCooldowns().addCooldown(stack.getItem(), (int) tag.getDouble("finish_time") + 2); tag.putInt("finish", finishTime + 2);
player.getCooldowns().addCooldown(stack.getItem(), finishTime + 2);
playGunEndReloadSounds(player); playGunEndReloadSounds(player);
} }

View file

@ -57,7 +57,7 @@ public class GunsTool {
private static final Set<String> STRING_SET = Set.of("EmptyReloadTime", "FireMode", "Weight", "SoundRadius", "BurstSize", "ProjectileAmount", private static final Set<String> STRING_SET = Set.of("EmptyReloadTime", "FireMode", "Weight", "SoundRadius", "BurstSize", "ProjectileAmount",
"Spread", "NormalReloadTime", "Headshot", "Semi", "Burst", "Auto", "RecoilX", "RecoilY", "Velocity", "Damage", "BypassesArmor", "Spread", "NormalReloadTime", "Headshot", "Semi", "Burst", "Auto", "RecoilX", "RecoilY", "Velocity", "Damage", "BypassesArmor",
"RPM", "Magazine", "MinZoom", "MaxZoom", "CustomZoom", "ExplosionDamage", "ExplosionRadius", "BoltActionTime", "ClipLoad", "RPM", "Magazine", "MinZoom", "MaxZoom", "CustomZoom", "ExplosionDamage", "ExplosionRadius", "BoltActionTime", "ClipLoad",
"PrepareTime", "IterativeTime", "PrepareLoadTime"); "PrepareTime", "IterativeTime", "PrepareLoadTime", "FinishTime");
public static void initGun(Level level, ItemStack stack, String location) { public static void initGun(Level level, ItemStack stack, String location) {
if (level.getServer() == null) return; if (level.getServer() == null) return;

View file

@ -14,7 +14,7 @@
"ClipLoad": 1, "ClipLoad": 1,
"PrepareTime": 29, "PrepareTime": 29,
"IterativeTime": 11, "IterativeTime": 11,
"finish_time": 18, "FinishTime": 18,
"BypassesArmor": 0.5, "BypassesArmor": 0.5,
"SoundRadius": 18 "SoundRadius": 18
} }

View file

@ -13,7 +13,7 @@
"PrepareTime": 7, "PrepareTime": 7,
"PrepareLoadTime": 36, "PrepareLoadTime": 36,
"IterativeTime": 16, "IterativeTime": 16,
"finish_time": 12, "FinishTime": 12,
"BypassesArmor": 0.05, "BypassesArmor": 0.05,
"SoundRadius": 16, "SoundRadius": 16,
"BoltActionTime": 11 "BoltActionTime": 11

View file

@ -11,7 +11,7 @@
"Semi": 1, "Semi": 1,
"PrepareTime": 7, "PrepareTime": 7,
"IterativeTime": 16, "IterativeTime": 16,
"finish_time": 19, "FinishTime": 19,
"BypassesArmor": 0.3, "BypassesArmor": 0.3,
"SoundRadius": 15, "SoundRadius": 15,
"BoltActionTime": 12 "BoltActionTime": 12

View file

@ -14,7 +14,7 @@
"PrepareTime": 29, "PrepareTime": 29,
"prepare_empty": 16, "prepare_empty": 16,
"IterativeTime": 11, "IterativeTime": 11,
"finish_time": 18, "FinishTime": 18,
"BypassesArmor": 0.54, "BypassesArmor": 0.54,
"SoundRadius": 18 "SoundRadius": 18
} }