From 79e047898d1612716a0e04e037c68322f9433005 Mon Sep 17 00:00:00 2001 From: Atsuihsio <842960157@qq.com> Date: Thu, 6 Mar 2025 01:07:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B1=A4=E5=A7=86=E8=B5=B7?= =?UTF-8?q?=E9=A3=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/client/ClickHandler.java | 2 +- .../config/server/VehicleConfig.java | 6 +++--- .../entity/vehicle/Ah6Entity.java | 8 ++++---- .../entity/vehicle/Tom6Entity.java | 19 ++++++++++--------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/client/ClickHandler.java b/src/main/java/com/atsuishio/superbwarfare/client/ClickHandler.java index e2367d577..84ac49c66 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/ClickHandler.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/ClickHandler.java @@ -425,7 +425,7 @@ public class ClickHandler { } private static void handleVehicleMove(int key, int state, Player player) { - if (player.getVehicle() != null && player.getVehicle() instanceof MobileVehicleEntity && player.getVehicle().getFirstPassenger() == player) { + if (player.getVehicle() instanceof MobileVehicleEntity mobileVehicle && mobileVehicle.getNthEntity(0) == player) { var options = Minecraft.getInstance().options; if (key == options.keyLeft.getKey().getValue()) { diff --git a/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java b/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java index 36543a7a2..668afb077 100644 --- a/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java +++ b/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java @@ -190,13 +190,13 @@ public class VehicleConfig { AH_6_MAX_ENERGY = builder.defineInRange("ah_6_max_energy", 4000000, 0, 2147483647); builder.comment("The cannon damage of AH-6"); - AH_6_CANNON_DAMAGE = builder.defineInRange("ah_6_cannon_damage", 25, 1, 10000000); + AH_6_CANNON_DAMAGE = builder.defineInRange("ah_6_cannon_damage", 20, 1, 10000000); builder.comment("The rocket damage of AH-6"); - AH_6_ROCKET_DAMAGE = builder.defineInRange("ah_6_rocket_damage", 120, 1, 10000000); + AH_6_ROCKET_DAMAGE = builder.defineInRange("ah_6_rocket_damage", 80, 1, 10000000); builder.comment("The rocket explosion damage of AH-6"); - AH_6_ROCKET_EXPLOSION_DAMAGE = builder.defineInRange("ah_6_rocket_explosion_damage", 60, 1, 10000000); + AH_6_ROCKET_EXPLOSION_DAMAGE = builder.defineInRange("ah_6_rocket_explosion_damage", 40, 1, 10000000); builder.comment("The rocket explosion radius of AH-6"); AH_6_ROCKET_EXPLOSION_RADIUS = builder.defineInRange("ah_6_rocket_explosion_radius", 5, 1, 10000000); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java index dcf9681ba..cb39eec81 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java @@ -524,8 +524,8 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity .damage(VehicleConfig.AH_6_CANNON_DAMAGE.get()) .headShot(2f) .zoom(false) - .heBullet(2) - .bypassArmorRate(0.2f); + .heBullet(1) + .bypassArmorRate(0.1f); projectileRight.setPos(worldPositionRight.x, worldPositionRight.y, worldPositionRight.z); projectileRight.shoot(player, this.getLookAngle().x, this.getLookAngle().y + 0.018, this.getLookAngle().z, 20, @@ -543,8 +543,8 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity .damage(VehicleConfig.AH_6_CANNON_DAMAGE.get()) .headShot(2f) .zoom(false) - .heBullet(2) - .bypassArmorRate(0.2f); + .heBullet(1) + .bypassArmorRate(0.1f); projectileLeft.setPos(worldPositionLeft.x, worldPositionLeft.y, worldPositionLeft.z); projectileLeft.shoot(player, this.getLookAngle().x, this.getLookAngle().y + 0.018, this.getLookAngle().z, 20, diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java index c422c318f..ca359ac9d 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java @@ -127,8 +127,8 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { this.setDeltaMovement(this.getDeltaMovement().multiply(f, f, f)); if (onGround()) { - setXRot(getXRot() * 0.7f); - setZRot(getRoll() * 0.7f); + setXRot(getXRot() * 0.8f); + setZRot(getRoll() * 0.8f); } if (this.isInWater() && this.tickCount % 4 == 0) { @@ -138,6 +138,7 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { } } + this.setDeltaMovement(this.getDeltaMovement().add(0.0, 0.01, 0.0)); this.refreshDimensions(); } @@ -168,7 +169,7 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { if (forwardInputDown && getEnergy() > 0) { this.consumeEnergy(VehicleConfig.TOM_6_ENERGY_COST.get()); - this.entityData.set(POWER, Math.min(this.entityData.get(POWER) + (entityData.get(MELON) ? 0.003f : 0.0022f), entityData.get(MELON) ? 0.12f : 0.15f)); + this.entityData.set(POWER, Math.min(this.entityData.get(POWER) + 0.03f, 0.15f)); } if (backInputDown || downInputDown) { @@ -188,11 +189,11 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { float roll = Mth.abs(Mth.clamp(getRoll() / 60, -1.5f, 1.5f)); - float addY = Mth.clamp(Math.min((this.onGround() ? 1.5f : 0.9f) * (float) Math.max(getDeltaMovement().length() - 0.06, 0.1), 0.9f) * diffY - 0.5f * this.entityData.get(DELTA_ROT), (entityData.get(MELON) ? -2f : -3f) * (roll + 1), (entityData.get(MELON) ? 2f : 3f) * (roll + 1)); - float addX = Mth.clamp(Math.min((float) Math.max(getDeltaMovement().length() - 0.1, 0.01), 0.9f) * diffX, (entityData.get(MELON) ? -3f : -4f), (entityData.get(MELON) ? 3f : 4f)); + float addY = Mth.clamp(Math.min((this.onGround() ? 1.5f : 0.9f) * (float) Math.max(getDeltaMovement().length() - 0.06, 0.1), 0.9f) * diffY - 0.5f * this.entityData.get(DELTA_ROT), -3 * (roll + 1), 3 * (roll + 1)); + float addX = Mth.clamp(Math.min((float) Math.max(getDeltaMovement().length() - 0.1, 0.01), 0.9f) * diffX, -4, 4); this.setYRot(this.getYRot() + addY); - this.setXRot(Mth.clamp(this.getXRot() + addX, onGround() ? -10 : -120, onGround() ? 2 : 120)); + this.setXRot(Mth.clamp(this.getXRot() + addX, onGround() ? -12 : -120, onGround() ? 3 : 120)); this.setZRot(this.getRoll() - this.entityData.get(DELTA_ROT) + (this.onGround() ? 0 : 0.01f) * diffY * (float) getDeltaMovement().length()); // 空格投掷西瓜炸弹 @@ -217,9 +218,9 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { this.entityData.set(DELTA_ROT, this.entityData.get(DELTA_ROT) * 0.95f); this.setDeltaMovement(this.getDeltaMovement().add( - Mth.sin(-this.getYRot() * 0.017453292F) * (entityData.get(MELON) ? 0.16f : 0.19f) * this.entityData.get(POWER), - Mth.clamp(Math.sin((onGround() ? 45 : -(getXRot() - 30)) * Mth.DEG_TO_RAD) * getDeltaMovement().horizontalDistance() * (entityData.get(MELON) ? 0.047f : 0.067f), -0.04, 0.09), - Mth.cos(this.getYRot() * 0.017453292F) * (entityData.get(MELON) ? 0.16f : 0.19f) * this.entityData.get(POWER) + Mth.sin(-this.getYRot() * 0.017453292F) * 0.19 * this.entityData.get(POWER), + Mth.clamp(Math.sin((onGround() ? 45 : -(getXRot() - 30)) * Mth.DEG_TO_RAD) * getDeltaMovement().horizontalDistance() * 0.067, -0.04, 0.09), + Mth.cos(this.getYRot() * 0.017453292F) * 0.19 * this.entityData.get(POWER) )); }