优化NBT#ClipLoad
This commit is contained in:
parent
e798d66182
commit
02df6e6ab2
3 changed files with 5 additions and 4 deletions
|
@ -64,8 +64,9 @@ public class ReloadMessage {
|
|||
CompoundTag tag = stack.getOrCreateTag();
|
||||
|
||||
boolean canSingleReload = tag.getDouble("iterative_time") != 0;
|
||||
boolean canReload = (GunsTool.getGunIntTag(stack, "NormalReloadTime") != 0 || GunsTool.getGunIntTag(stack, "EmptyReloadTime") != 0) && tag.getDouble("clipLoad") != 1;
|
||||
boolean clipLoad = tag.getInt("ammo") == 0 && tag.getDouble("clipLoad") == 1;
|
||||
boolean canReload = (GunsTool.getGunIntTag(stack, "NormalReloadTime") != 0 || GunsTool.getGunIntTag(stack, "EmptyReloadTime") != 0)
|
||||
&& GunsTool.getGunIntTag(stack, "ClipLoad", 0) != 1;
|
||||
boolean clipLoad = tag.getInt("ammo") == 0 && GunsTool.getGunIntTag(stack, "ClipLoad", 0) == 1;
|
||||
|
||||
// 检查备弹
|
||||
int count = 0;
|
||||
|
|
|
@ -56,7 +56,7 @@ 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");
|
||||
"RPM", "Magazine", "MinZoom", "MaxZoom", "CustomZoom", "ExplosionDamage", "ExplosionRadius", "BoltActionTime", "ClipLoad");
|
||||
|
||||
public static void initGun(Level level, ItemStack stack, String location) {
|
||||
if (level.getServer() == null) return;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"FireMode": 0,
|
||||
"Semi": 1,
|
||||
"EmptyReloadTime": 59,
|
||||
"clipLoad": 1,
|
||||
"ClipLoad": 1,
|
||||
"prepare_time": 29,
|
||||
"iterative_time": 11,
|
||||
"finish_time": 18,
|
||||
|
|
Loading…
Add table
Reference in a new issue