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