From 8e728df3d5d681ce506d8c517fb7e02480f7bea5 Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Thu, 20 Mar 2025 18:15:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=BF=80=E5=85=89=E9=98=B2?= =?UTF-8?q?=E5=BE=A1=E5=A1=94=E5=86=B7=E5=8D=B4=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atsuishio/superbwarfare/config/server/VehicleConfig.java | 4 ++++ .../superbwarfare/entity/vehicle/LaserTowerEntity.java | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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 e61ed38ec..d25fe2ce6 100644 --- a/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java +++ b/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java @@ -40,6 +40,7 @@ public class VehicleConfig { public static ForgeConfigSpec.IntValue ANNIHILATOR_MAX_ENERGY; public static ForgeConfigSpec.IntValue LASER_TOWER_HP; + public static ForgeConfigSpec.IntValue LASER_TOWER_COOLDOWN; public static ForgeConfigSpec.IntValue LASER_TOWER_DAMAGE; public static ForgeConfigSpec.IntValue LASER_TOWER_SHOOT_COST; public static ForgeConfigSpec.IntValue LASER_TOWER_MAX_ENERGY; @@ -198,6 +199,9 @@ public class VehicleConfig { builder.comment("The damage of Laser Tower"); LASER_TOWER_DAMAGE = builder.defineInRange("laser_tower_damage", 15, 1, 10000000); + builder.comment("The cooldown time(ticks) of Laser Tower"); + LASER_TOWER_COOLDOWN = builder.defineInRange("laser_tower_cooldown", 40, 15, 10000000); + builder.comment("The energy cost of Laser Tower per shoot"); LASER_TOWER_SHOOT_COST = builder.defineInRange("laser_tower_shoot_cost", 5000, 0, 2147483647); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java index 96f439977..75b9e3b77 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java @@ -251,7 +251,7 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity, } public void autoAim() { - if (this.getEnergy() <= 0 || !entityData.get(ACTIVE) || this.entityData.get(COOL_DOWN) > 30) { + if (this.getEnergy() <= 0 || !entityData.get(ACTIVE)) { return; } @@ -296,8 +296,7 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity, } if (this.entityData.get(COOL_DOWN) == 0 && VectorTool.calculateAngle(getViewVector(1), targetVec) < 1 && checkNoClip(target)) { - - this.entityData.set(COOL_DOWN, 40); + this.entityData.set(COOL_DOWN, VehicleConfig.LASER_TOWER_COOLDOWN.get()); if (level() instanceof ServerLevel serverLevel) { this.level().playSound(this, getOnPos(), ModSounds.LASER_TOWER_SHOOT.get(), SoundSource.PLAYERS, 2, random.nextFloat() * 0.1f + 1);