From 6303a8ec75c203aac7b67a2b3516604315db6894 Mon Sep 17 00:00:00 2001 From: Atsuihsio <842960157@qq.com> Date: Sun, 9 Feb 2025 13:58:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=A4=A7=E8=BF=AB=E5=87=BB=E7=82=AE?= =?UTF-8?q?=E9=87=8D=E5=8A=9B=E5=92=8C=E5=88=9D=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/atsuishio/superbwarfare/client/gui/RangeHelper.java | 4 ++-- .../java/com/atsuishio/superbwarfare/entity/MortarEntity.java | 4 ++-- .../superbwarfare/entity/projectile/MortarShellEntity.java | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/client/gui/RangeHelper.java b/src/main/java/com/atsuishio/superbwarfare/client/gui/RangeHelper.java index efd14aa44..1fae84ef2 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/gui/RangeHelper.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/gui/RangeHelper.java @@ -12,9 +12,9 @@ public class RangeHelper { * @param thetaDegrees 发射角度(以度为单位),需要根据实际情况修改 */ public static double getRange(double thetaDegrees) { - double initialVelocity = 8; // 初始速度 8 m/s + double initialVelocity = 11.4; // 初始速度 11.4 m/s double thetaRadians = Math.toRadians(thetaDegrees); // 将角度转换为弧度 - double gravity = 0.05; // 重力加速度 + double gravity = 0.146; // 重力加速度 double velocityDecay = 0.99; // 速度衰减系数 // 计算射程 diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/MortarEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/MortarEntity.java index a31072e52..32e634730 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/MortarEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/MortarEntity.java @@ -164,7 +164,7 @@ public class MortarEntity extends Entity implements GeoEntity, AnimatedEntity { if (level instanceof ServerLevel server) { MortarShellEntity entityToSpawn = new MortarShellEntity(player, level); entityToSpawn.setPos(this.getX(), this.getEyeY(), this.getZ()); - entityToSpawn.shoot(this.getLookAngle().x, this.getLookAngle().y, this.getLookAngle().z, 8f, (float) 0.3); + entityToSpawn.shoot(this.getLookAngle().x, this.getLookAngle().y, this.getLookAngle().z, 11.4f, (float) 0.1); level.addFreshEntity(entityToSpawn); server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, (this.getX() + 3 * this.getLookAngle().x), (this.getY() + 0.1 + 3 * this.getLookAngle().y), (this.getZ() + 3 * this.getLookAngle().z), 8, 0.4, 0.4, 0.4, 0.007); @@ -212,7 +212,7 @@ public class MortarEntity extends Entity implements GeoEntity, AnimatedEntity { this.look(EntityAnchorArgument.Anchor.EYES, new Vec3(targetX, targetY, targetZ)); double[] angles = new double[2]; - boolean flag = RangeHelper.canReachTarget(8, 0.05, 0.99, + boolean flag = RangeHelper.canReachTarget(11, 0.146, 0.99, new BlockPos((int) this.getX(), (int) this.getEyeY(), (int) this.getZ()), new BlockPos(targetX, targetY, targetZ), angles); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MortarShellEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MortarShellEntity.java index 28f33d93c..a36983290 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MortarShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/MortarShellEntity.java @@ -19,7 +19,6 @@ import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.projectile.ThrowableItemProjectile; import net.minecraft.world.item.Item; -import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.BellBlock; import net.minecraft.world.level.block.state.BlockState; @@ -179,7 +178,7 @@ public class MortarShellEntity extends ThrowableItemProjectile implements GeoEnt @Override protected float getGravity() { - return 0.05F; + return 0.146F; } @Override