优化NBT#MinZoom & MaxZoom
This commit is contained in:
parent
8d2e5f7ed6
commit
cb78664676
2 changed files with 5 additions and 5 deletions
|
@ -65,10 +65,10 @@ public class AdjustZoomFovMessage {
|
||||||
SoundTool.playLocalSound(player, ModSounds.ADJUST_FOV.get(), 1f, 0.7f);
|
SoundTool.playLocalSound(player, ModSounds.ADJUST_FOV.get(), 1f, 0.7f);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
double min_zoom = tag.getDouble("MinZoom") - 1.25;
|
double minZoom = GunsTool.getGunDoubleTag(stack, "MinZoom", 0) - 1.25;
|
||||||
double max_zoom = tag.getDouble("MaxZoom") - 1.25;
|
double maxZoom = GunsTool.getGunDoubleTag(stack, "MaxZoom", 0) - 1.25;
|
||||||
tag.putDouble("CustomZoom", Mth.clamp(tag.getDouble("CustomZoom") + 0.5 * message.scroll, min_zoom, max_zoom));
|
tag.putDouble("CustomZoom", Mth.clamp(tag.getDouble("CustomZoom") + 0.5 * message.scroll, minZoom, maxZoom));
|
||||||
if (tag.getDouble("CustomZoom") > min_zoom && tag.getDouble("CustomZoom") < max_zoom) {
|
if (tag.getDouble("CustomZoom") > minZoom && tag.getDouble("CustomZoom") < maxZoom) {
|
||||||
SoundTool.playLocalSound(player, ModSounds.ADJUST_FOV.get(), 1f, 0.7f);
|
SoundTool.playLocalSound(player, ModSounds.ADJUST_FOV.get(), 1f, 0.7f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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");
|
"RPM", "Magazine", "MinZoom", "MaxZoom");
|
||||||
|
|
||||||
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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue