优化NBT#PrepareTime
This commit is contained in:
parent
02df6e6ab2
commit
9eb8961faf
6 changed files with 9 additions and 7 deletions
|
@ -554,8 +554,9 @@ public class GunEventHandler {
|
|||
player.getCooldowns().addCooldown(stack.getItem(), (int) tag.getDouble("prepare_empty"));
|
||||
} else {
|
||||
playGunPrepareReloadSounds(player);
|
||||
tag.putInt("prepare", (int) tag.getDouble("prepare_time") + 1);
|
||||
player.getCooldowns().addCooldown(stack.getItem(), (int) tag.getDouble("prepare_time"));
|
||||
int prepareTime = GunsTool.getGunIntTag(stack, "PrepareTime", 0);
|
||||
tag.putInt("prepare", prepareTime + 1);
|
||||
player.getCooldowns().addCooldown(stack.getItem(), prepareTime);
|
||||
}
|
||||
|
||||
tag.putBoolean("force_stop", false);
|
||||
|
|
|
@ -56,7 +56,8 @@ public class GunsTool {
|
|||
// TODO 临时使用,移植完毕后删除
|
||||
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",
|
||||
"RPM", "Magazine", "MinZoom", "MaxZoom", "CustomZoom", "ExplosionDamage", "ExplosionRadius", "BoltActionTime", "ClipLoad");
|
||||
"RPM", "Magazine", "MinZoom", "MaxZoom", "CustomZoom", "ExplosionDamage", "ExplosionRadius", "BoltActionTime", "ClipLoad",
|
||||
"PrepareTime");
|
||||
|
||||
public static void initGun(Level level, ItemStack stack, String location) {
|
||||
if (level.getServer() == null) return;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"Semi": 1,
|
||||
"EmptyReloadTime": 59,
|
||||
"ClipLoad": 1,
|
||||
"prepare_time": 29,
|
||||
"PrepareTime": 29,
|
||||
"iterative_time": 11,
|
||||
"finish_time": 18,
|
||||
"BypassesArmor": 0.5,
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"Weight": 4,
|
||||
"FireMode": 0,
|
||||
"Semi": 1,
|
||||
"prepare_time": 7,
|
||||
"PrepareTime": 7,
|
||||
"prepare_load_time": 36,
|
||||
"iterative_time": 16,
|
||||
"finish_time": 12,
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"Weight": 3,
|
||||
"FireMode": 0,
|
||||
"Semi": 1,
|
||||
"prepare_time": 7,
|
||||
"PrepareTime": 7,
|
||||
"iterative_time": 16,
|
||||
"finish_time": 19,
|
||||
"BypassesArmor": 0.3,
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"Weight": 5,
|
||||
"FireMode": 0,
|
||||
"Semi": 1,
|
||||
"prepare_time": 29,
|
||||
"PrepareTime": 29,
|
||||
"prepare_empty": 16,
|
||||
"iterative_time": 11,
|
||||
"finish_time": 18,
|
||||
|
|
Loading…
Add table
Reference in a new issue