优化NBT#ClipLoad

This commit is contained in:
17146 2024-12-24 16:42:44 +08:00
parent e798d66182
commit 02df6e6ab2
3 changed files with 5 additions and 4 deletions

View file

@ -64,8 +64,9 @@ public class ReloadMessage {
CompoundTag tag = stack.getOrCreateTag(); CompoundTag tag = stack.getOrCreateTag();
boolean canSingleReload = tag.getDouble("iterative_time") != 0; boolean canSingleReload = tag.getDouble("iterative_time") != 0;
boolean canReload = (GunsTool.getGunIntTag(stack, "NormalReloadTime") != 0 || GunsTool.getGunIntTag(stack, "EmptyReloadTime") != 0) && tag.getDouble("clipLoad") != 1; boolean canReload = (GunsTool.getGunIntTag(stack, "NormalReloadTime") != 0 || GunsTool.getGunIntTag(stack, "EmptyReloadTime") != 0)
boolean clipLoad = tag.getInt("ammo") == 0 && tag.getDouble("clipLoad") == 1; && GunsTool.getGunIntTag(stack, "ClipLoad", 0) != 1;
boolean clipLoad = tag.getInt("ammo") == 0 && GunsTool.getGunIntTag(stack, "ClipLoad", 0) == 1;
// 检查备弹 // 检查备弹
int count = 0; int count = 0;

View file

@ -56,7 +56,7 @@ public class GunsTool {
// TODO 临时使用移植完毕后删除 // TODO 临时使用移植完毕后删除
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"); "RPM", "Magazine", "MinZoom", "MaxZoom", "CustomZoom", "ExplosionDamage", "ExplosionRadius", "BoltActionTime", "ClipLoad");
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

@ -11,7 +11,7 @@
"FireMode": 0, "FireMode": 0,
"Semi": 1, "Semi": 1,
"EmptyReloadTime": 59, "EmptyReloadTime": 59,
"clipLoad": 1, "ClipLoad": 1,
"prepare_time": 29, "prepare_time": 29,
"iterative_time": 11, "iterative_time": 11,
"finish_time": 18, "finish_time": 18,