From 10bec3590d644b9005cfe6f724b125268d35a50d Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Tue, 4 Mar 2025 22:23:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=91=BC=E5=90=B8=E5=9B=9E?= =?UTF-8?q?=E8=A1=80config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/config/server/VehicleConfig.java | 13 +++++++++++++ .../superbwarfare/entity/vehicle/VehicleEntity.java | 5 +++-- 2 files changed, 16 insertions(+), 2 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 67b0fe2d5..36543a7a2 100644 --- a/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java +++ b/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java @@ -15,6 +15,9 @@ public class VehicleConfig { public static final List DEFAULT_COLLISION_ENTITY_BLACKLIST = List.of("create:super_glue", "zombieawareness:scent"); + public static ForgeConfigSpec.IntValue REPAIR_COOLDOWN; + public static ForgeConfigSpec.DoubleValue REPAIR_AMOUNT; + public static ForgeConfigSpec.IntValue MK42_HP; public static ForgeConfigSpec.IntValue MK42_AP_DAMAGE; public static ForgeConfigSpec.IntValue MK42_AP_EXPLOSION_DAMAGE; @@ -83,6 +86,16 @@ public class VehicleConfig { DEFAULT_COLLISION_ENTITY_BLACKLIST, e -> e instanceof String); + builder.push("repair"); + + builder.comment("The cooldown of vehicle repair. Set a negative value to disable vehicle repair"); + REPAIR_COOLDOWN = builder.defineInRange("repair_cooldown", 200, -1, 10000000); + + builder.comment("The amount of health restored per tick when a vehicle is self-repairing"); + REPAIR_AMOUNT = builder.defineInRange("repair_amount", 0.05d, 0, 10000000); + + builder.pop(); + builder.push("mk_42"); builder.comment("The HealthPoint of MK-42"); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/VehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/VehicleEntity.java index 3087349b0..d7aab73bc 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/VehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/VehicleEntity.java @@ -1,6 +1,7 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.ModUtils; +import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModItems; @@ -300,14 +301,14 @@ public class VehicleEntity extends Entity { * 呼吸回血冷却时长(单位:tick),设为小于0的值以禁用呼吸回血 */ public int maxRepairCoolDown() { - return 200; + return VehicleConfig.REPAIR_COOLDOWN.get(); } /** * 呼吸回血回血量 */ public float repairAmount() { - return 0.05F; + return VehicleConfig.REPAIR_AMOUNT.get().floatValue(); } @Override