优化NBT#RecoilX & RecoilY

This commit is contained in:
17146 2024-12-24 15:26:36 +08:00
parent dc20318309
commit 207368b9bb
32 changed files with 63 additions and 63 deletions

View file

@ -870,7 +870,7 @@ public class ClientEventHandler {
float pitch = event.getPitch();
float roll = event.getRoll();
ItemStack stack = entity.getMainHandItem();
double amplitude = 15000 * stack.getOrCreateTag().getDouble("recoil_y") * stack.getOrCreateTag().getDouble("recoil_x");
double amplitude = 15000 * GunsTool.getGunDoubleTag(stack, "RecoilY", 0) * GunsTool.getGunDoubleTag(stack, "RecoilX", 0);
if (fireRecoilTime > 0) {
firePosTimer = 0.001;
@ -994,7 +994,7 @@ public class ClientEventHandler {
rpm = (double) stack.getOrCreateTag().getInt("rpm") / 1800;
}
float gunRecoilX = (float) tag.getDouble("recoil_x") * 60;
float gunRecoilX = (float) GunsTool.getGunDoubleTag(stack, "RecoilX", 0) * 60;
recoilHorizon = Mth.lerp(0.2 * times, recoilHorizon, 0) + recoilY;
recoilY = 0;

View file

@ -55,7 +55,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");
"Spread", "NormalReloadTime", "Headshot", "Semi", "Burst", "Auto", "RecoilX", "RecoilY");
public static void initGun(Level level, ItemStack stack, String location) {
if (level.getServer() == null) return;

View file

@ -1,7 +1,7 @@
{
"Spread": 3.5,
"recoil_x": 0.006,
"recoil_y": 0.018,
"RecoilX": 0.006,
"RecoilY": 0.018,
"damage": 2.5,
"Headshot": 1.5,
"velocity": 17,

View file

@ -1,7 +1,7 @@
{
"Spread": 4,
"recoil_x": 0.005,
"recoil_y": 0.026,
"RecoilX": 0.005,
"RecoilY": 0.026,
"damage": 5,
"Headshot": 1.5,
"velocity": 15,

View file

@ -2,8 +2,8 @@
"MinZoom": 1.25,
"MaxZoom": 6,
"Spread": 3.5,
"recoil_x": 0.0015,
"recoil_y": 0.01,
"RecoilX": 0.0015,
"RecoilY": 0.01,
"damage": 7.7,
"Headshot": 2,
"velocity": 44.5,

View file

@ -2,8 +2,8 @@
"MinZoom": 1.25,
"MaxZoom": 6,
"Spread": 4,
"recoil_x": 0.002,
"recoil_y": 0.012,
"RecoilX": 0.002,
"RecoilY": 0.012,
"damage": 8.5,
"Headshot": 2,
"velocity": 36,

View file

@ -1,8 +1,8 @@
{
"CustomZoom": 0.75,
"Spread": 5,
"recoil_x": 0.0018,
"recoil_y": 0.01,
"RecoilX": 0.0018,
"RecoilY": 0.01,
"damage": 9.5,
"Headshot": 2,
"velocity": 40,

View file

@ -1,7 +1,7 @@
{
"Spread": 2.5,
"recoil_x": 0.004,
"recoil_y": 0.013,
"RecoilX": 0.004,
"RecoilY": 0.013,
"damage": 5.5,
"Headshot": 1.5,
"velocity": 17,

View file

@ -1,7 +1,7 @@
{
"Spread": 2.5,
"recoil_x": 0.004,
"recoil_y": 0.013,
"RecoilX": 0.004,
"RecoilY": 0.013,
"damage": 5.5,
"Headshot": 1.5,
"velocity": 17,

View file

@ -2,8 +2,8 @@
"MinZoom": 1.25,
"MaxZoom": 6,
"Spread": 3.5,
"recoil_x": 0.0016,
"recoil_y": 0.009,
"RecoilX": 0.0016,
"RecoilY": 0.009,
"damage": 7.5,
"Headshot": 2,
"velocity": 44,

View file

@ -1,7 +1,7 @@
{
"Spread": 7,
"recoil_x": 0.004,
"recoil_y": 0.04,
"RecoilX": 0.004,
"RecoilY": 0.04,
"damage": 65,
"Headshot": 3,
"velocity": 38,

View file

@ -1,7 +1,7 @@
{
"Spread": 5,
"recoil_x": 0.002,
"recoil_y": 0.063,
"RecoilX": 0.002,
"RecoilY": 0.063,
"damage": 35,
"Headshot": 3,
"velocity": 37.75,

View file

@ -1,7 +1,7 @@
{
"Spread": 2.5,
"recoil_x": 0.006,
"recoil_y": 0.018,
"RecoilX": 0.006,
"RecoilY": 0.018,
"damage": 9.5,
"Headshot": 1.5,
"velocity": 15,

View file

@ -2,8 +2,8 @@
"MinZoom": 4,
"MaxZoom": 8,
"Spread": 4,
"recoil_x": 0.0015,
"recoil_y": 0.011,
"RecoilX": 0.0015,
"RecoilY": 0.011,
"damage": 7,
"Headshot": 2,
"velocity": 44,

View file

@ -1,7 +1,7 @@
{
"Spread": 5,
"recoil_x": 0.004,
"recoil_y": 0.014,
"RecoilX": 0.004,
"RecoilY": 0.014,
"damage": 9,
"Headshot": 2,
"velocity": 43,

View file

@ -1,7 +1,7 @@
{
"Spread": 1.5,
"recoil_x": 0.004,
"recoil_y": 0.023,
"RecoilX": 0.004,
"RecoilY": 0.023,
"damage": 40,
"ExplosionDamage": 80,
"ExplosionRadius": 5,

View file

@ -1,7 +1,7 @@
{
"Spread": 3,
"recoil_x": 0.009,
"recoil_y": 0.04,
"RecoilX": 0.009,
"RecoilY": 0.04,
"damage": 3,
"Headshot": 1.5,
"velocity": 17,

View file

@ -3,8 +3,8 @@
"min_zoom": 4,
"max_zoom": 8,
"Spread": 6,
"recoil_x": 0.007,
"recoil_y": 0.013,
"RecoilX": 0.007,
"RecoilY": 0.013,
"damage": 38,
"Headshot": 3,
"velocity": 47.2,

View file

@ -1,7 +1,7 @@
{
"Spread": 2,
"recoil_x": 0.004,
"recoil_y": 0.031,
"RecoilX": 0.004,
"RecoilY": 0.031,
"damage": 16,
"Headshot": 2.5,
"velocity": 38,

View file

@ -1,7 +1,7 @@
{
"Spread": 1.5,
"recoil_x": 0.003,
"recoil_y": 0.02,
"RecoilX": 0.003,
"RecoilY": 0.02,
"damage": 8,
"Headshot": 2,
"velocity": 46,

View file

@ -2,8 +2,8 @@
"MinZoom": 1.25,
"MaxZoom": 6,
"Spread": 5,
"recoil_x": 0.006,
"recoil_y": 0.014,
"RecoilX": 0.006,
"RecoilY": 0.014,
"damage": 12,
"Headshot": 2.5,
"velocity": 42.5,

View file

@ -1,8 +1,8 @@
{
"CustomZoom": 2.25,
"Spread": 4.8,
"recoil_x": 0.002,
"recoil_y": 0.063,
"RecoilX": 0.002,
"RecoilY": 0.063,
"damage": 33,
"Headshot": 3,
"velocity": 42,

View file

@ -1,8 +1,8 @@
{
"CustomZoom": 3.75,
"Spread": 8,
"recoil_x": 0.01,
"recoil_y": 0.038,
"RecoilX": 0.01,
"RecoilY": 0.038,
"damage": 140,
"Headshot": 3,
"velocity": 36,

View file

@ -2,8 +2,8 @@
"MinZoom": 4,
"MaxZoom": 8,
"Spread": 3.7,
"recoil_x": 0.0013,
"recoil_y": 0.009,
"RecoilX": 0.0013,
"RecoilY": 0.009,
"damage": 8.25,
"Headshot": 2,
"velocity": 46,

View file

@ -1,7 +1,7 @@
{
"Spread": 5,
"recoil_x": 0.008,
"recoil_y": 0.018,
"RecoilX": 0.008,
"RecoilY": 0.018,
"damage": 200,
"ExplosionDamage": 150,
"ExplosionRadius": 10,

View file

@ -1,7 +1,7 @@
{
"Spread": 5.5,
"recoil_x": 0.0018,
"recoil_y": 0.012,
"RecoilX": 0.0018,
"RecoilY": 0.012,
"damage": 8.75,
"Headshot": 2,
"velocity": 38,

View file

@ -1,8 +1,8 @@
{
"CustomZoom": 1.75,
"Spread": 6,
"recoil_x": 0.007,
"recoil_y": 0.018,
"RecoilX": 0.007,
"RecoilY": 0.018,
"damage": 35,
"mag": 5,
"Headshot": 3,

View file

@ -1,7 +1,7 @@
{
"Spread": 4.5,
"recoil_x": 0.004,
"recoil_y": 0.015,
"RecoilX": 0.004,
"RecoilY": 0.015,
"damage": 9.5,
"Headshot": 2,
"velocity": 36,

View file

@ -1,8 +1,8 @@
{
"CustomZoom": 2.75,
"Spread": 5.5,
"recoil_x": 0.004,
"recoil_y": 0.009,
"RecoilX": 0.004,
"RecoilY": 0.009,
"damage": 18,
"Headshot": 2,
"velocity": 42,

View file

@ -1,7 +1,7 @@
{
"Spread": 2,
"recoil_x": 0.0001,
"recoil_y": 0.002,
"RecoilX": 0.0001,
"RecoilY": 0.002,
"damage": 5,
"velocity": 3,
"mag": 1,

View file

@ -1,7 +1,7 @@
{
"Spread": 3,
"recoil_x": 0.005,
"recoil_y": 0.032,
"RecoilX": 0.005,
"RecoilY": 0.032,
"damage": 19,
"Headshot": 2,
"velocity": 24,

View file

@ -1,7 +1,7 @@
{
"Spread": 2.3,
"recoil_x": 0.002,
"recoil_y": 0.007,
"RecoilX": 0.002,
"RecoilY": 0.007,
"damage": 6,
"Headshot": 1.5,
"velocity": 16,