From c4a77c088cdf8426edbea4588361a52b6bbdd53a Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Wed, 16 Jul 2025 00:38:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=87=8D=E5=8A=9B=E5=86=99?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/client/overlay/Type63InfoOverlay.java | 2 +- .../atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java | 6 +++--- .../superbwarfare/entity/vehicle/Mle1934Entity.java | 6 +++--- .../superbwarfare/entity/vehicle/MortarEntity.java | 2 +- .../java/com/atsuishio/superbwarfare/tools/RangeTool.java | 4 +++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/client/overlay/Type63InfoOverlay.java b/src/main/java/com/atsuishio/superbwarfare/client/overlay/Type63InfoOverlay.java index 8654acc21..4af9cee4f 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/overlay/Type63InfoOverlay.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/overlay/Type63InfoOverlay.java @@ -123,7 +123,7 @@ public class Type63InfoOverlay implements LayeredDraw.Layer { boolean isDepressed = parameters.isDepressed(); Vec3 targetPos = new Vec3(targetX, targetY, targetZ); - Vec3 launchVector = calculateLaunchVector(type63Entity.getShootPos(partialTick), targetPos, 10, -0.05, isDepressed); + Vec3 launchVector = calculateLaunchVector(type63Entity.getShootPos(partialTick), targetPos, 10, 0.05, isDepressed); Vec3 vec3 = EntityAnchorArgument.Anchor.EYES.apply(lookingEntity); double d0 = (targetPos.x - vec3.x) * 0.2; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java index 7558cdb93..e8d5a44db 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java @@ -95,7 +95,7 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity .explosionDamage(VehicleConfig.MK42_AP_EXPLOSION_DAMAGE.get()) .explosionRadius(VehicleConfig.MK42_AP_EXPLOSION_RADIUS.get().floatValue()) .durability(60) - .gravity(-projectileGravity()) + .gravity(projectileGravity()) .sound(ModSounds.CANNON_RELOAD.get()) .icon(Mod.loc("textures/screens/vehicle_weapon/ap_shell.png")), new CannonShellWeapon() @@ -105,7 +105,7 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity .durability(1) .fireProbability(0.18F) .fireTime(2) - .gravity(-projectileGravity()) + .gravity(projectileGravity()) .sound(ModSounds.CANNON_RELOAD.get()) .icon(Mod.loc("textures/screens/vehicle_weapon/he_shell.png")), } @@ -267,7 +267,7 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity @Override public float projectileGravity() { - return -0.1f; + return 0.1f; } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java index 946bdf14e..0889fa724 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java @@ -86,7 +86,7 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt .explosionDamage(VehicleConfig.MLE1934_AP_EXPLOSION_DAMAGE.get()) .explosionRadius(VehicleConfig.MLE1934_AP_EXPLOSION_RADIUS.get().floatValue()) .durability(70) - .gravity(-projectileGravity()) + .gravity(projectileGravity()) .sound(ModSounds.CANNON_RELOAD.get()) .icon(Mod.loc("textures/screens/vehicle_weapon/ap_shell.png")), new CannonShellWeapon() @@ -96,7 +96,7 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt .durability(1) .fireProbability(0.24F) .fireTime(5) - .gravity(-projectileGravity()) + .gravity(projectileGravity()) .sound(ModSounds.CANNON_RELOAD.get()) .icon(Mod.loc("textures/screens/vehicle_weapon/he_shell.png")), } @@ -283,7 +283,7 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt @Override public float projectileGravity() { - return -0.1f; + return 0.1f; } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MortarEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MortarEntity.java index 1a862064e..80d80c1a9 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MortarEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MortarEntity.java @@ -179,7 +179,7 @@ public class MortarEntity extends VehicleEntity implements GeoEntity, RemoteCont @Override public float projectileGravity() { - return -0.13f; + return 0.13f; } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/tools/RangeTool.java b/src/main/java/com/atsuishio/superbwarfare/tools/RangeTool.java index 28dc1873d..382fb3613 100644 --- a/src/main/java/com/atsuishio/superbwarfare/tools/RangeTool.java +++ b/src/main/java/com/atsuishio/superbwarfare/tools/RangeTool.java @@ -24,12 +24,14 @@ public class RangeTool { // 谢谢DeepSeek @Nullable - public static Vec3 calculateLaunchVector(Vec3 pos, Vec3 pos2, double velocity, double g, boolean isDepressed) { + public static Vec3 calculateLaunchVector(Vec3 pos, Vec3 pos2, double velocity, double gravity, boolean isDepressed) { double dx = pos2.x - pos.x; double dy = pos2.y - pos.y; double dz = pos2.z - pos.z; double horizontalDistSq = dx * dx + dz * dz; + double g = -gravity; + double a = 0.25 * g * g; double b = -velocity * velocity - g * dy; double c = horizontalDistSq + dy * dy;