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 47d9fb043..e61ed38ec 100644 --- a/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java +++ b/src/main/java/com/atsuishio/superbwarfare/config/server/VehicleConfig.java @@ -12,8 +12,7 @@ public class VehicleConfig { public static ForgeConfigSpec.ConfigValue> COLLISION_ENTITY_WHITELIST; - public static final List DEFAULT_COLLISION_ENTITY_WHITELIST = - List.of(); + public static final List DEFAULT_COLLISION_ENTITY_WHITELIST = List.of(); public static ForgeConfigSpec.IntValue REPAIR_COOLDOWN; public static ForgeConfigSpec.DoubleValue REPAIR_AMOUNT; @@ -41,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_DAMAGE; public static ForgeConfigSpec.IntValue LASER_TOWER_SHOOT_COST; public static ForgeConfigSpec.IntValue LASER_TOWER_MAX_ENERGY; @@ -48,6 +48,11 @@ public class VehicleConfig { public static ForgeConfigSpec.IntValue SPEEDBOAT_ENERGY_COST; public static ForgeConfigSpec.IntValue SPEEDBOAT_MAX_ENERGY; + public static ForgeConfigSpec.IntValue WHEELCHAIR_HP; + public static ForgeConfigSpec.IntValue WHEELCHAIR_JUMP_ENERGY_COST; + public static ForgeConfigSpec.IntValue WHEELCHAIR_MOVE_ENERGY_COST; + public static ForgeConfigSpec.IntValue WHEELCHAIR_MAX_ENERGY; + public static ForgeConfigSpec.IntValue AH_6_HP; public static ForgeConfigSpec.IntValue AH_6_MIN_ENERGY_COST; public static ForgeConfigSpec.IntValue AH_6_MAX_ENERGY_COST; @@ -117,7 +122,7 @@ public class VehicleConfig { builder.push("mk_42"); - builder.comment("The HealthPoint of MK-42"); + builder.comment("The health of MK-42"); MK42_HP = builder.defineInRange("mk_42_hp", 350, 1, 10000000); builder.comment("The AP shell damage of MK-42"); @@ -142,7 +147,7 @@ public class VehicleConfig { builder.push("mle_1934"); - builder.comment("The HealthPoint of MLE-1934"); + builder.comment("The health of MLE-1934"); MLE1934_HP = builder.defineInRange("mle_1934_hp", 350, 1, 10000000); builder.comment("The AP shell damage of MLE-1934"); @@ -174,7 +179,7 @@ public class VehicleConfig { builder.push("annihilator"); - builder.comment("The HealthPoint of Annihilator"); + builder.comment("The health of Annihilator"); ANNIHILATOR_HP = builder.defineInRange("annihilator_hp", 1200, 1, 10000000); builder.comment("The energy cost of Annihilator per shoot"); @@ -187,20 +192,23 @@ public class VehicleConfig { builder.push("laser_tower"); - builder.comment("The HealthPoint of Laser_Tower"); + builder.comment("The health of Laser Tower"); LASER_TOWER_HP = builder.defineInRange("laser_tower_hp", 100, 1, 10000000); - builder.comment("The energy cost of Laser_Tower per shoot"); + builder.comment("The damage of Laser Tower"); + LASER_TOWER_DAMAGE = builder.defineInRange("laser_tower_damage", 15, 1, 10000000); + + builder.comment("The energy cost of Laser Tower per shoot"); LASER_TOWER_SHOOT_COST = builder.defineInRange("laser_tower_shoot_cost", 5000, 0, 2147483647); - builder.comment("The max energy storage of Laser_Tower"); + builder.comment("The max energy storage of Laser Tower"); LASER_TOWER_MAX_ENERGY = builder.defineInRange("laser_tower_max_energy", 500000, 0, 2147483647); builder.pop(); builder.push("speedboat"); - builder.comment("The HealthPoint of Speedboat"); + builder.comment("The health of Speedboat"); SPEEDBOAT_HP = builder.defineInRange("speedboat_hp", 200, 1, 10000000); builder.comment("The energy cost of Speedboat per tick"); @@ -211,9 +219,25 @@ public class VehicleConfig { builder.pop(); + builder.push("wheelchair"); + + builder.comment("The health of the wheelchair"); + WHEELCHAIR_HP = builder.defineInRange("wheelchair_hp", 30, 1, 10000000); + + builder.comment("The jump energy cost of the wheelchair"); + WHEELCHAIR_JUMP_ENERGY_COST = builder.defineInRange("wheelchair_jump_energy_cost", 400, 0, 2147483647); + + builder.comment("The move energy cost of the wheelchair"); + WHEELCHAIR_MOVE_ENERGY_COST = builder.defineInRange("wheelchair_move_energy_cost", 1, 0, 2147483647); + + builder.comment("The max energy storage of the wheelchair"); + WHEELCHAIR_MAX_ENERGY = builder.defineInRange("wheelchair_max_energy", 24000, 0, 2147483647); + + builder.pop(); + builder.push("ah_6"); - builder.comment("The HealthPoint of AH-6"); + builder.comment("The health of AH-6"); AH_6_HP = builder.defineInRange("ah_6_hp", 250, 1, 10000000); builder.comment("The min energy cost of AH-6 per tick"); @@ -241,7 +265,7 @@ public class VehicleConfig { builder.push("lav_150"); - builder.comment("The HealthPoint of Lav_150"); + builder.comment("The health of Lav_150"); LAV_150_HP = builder.defineInRange("lav_150_hp", 250, 1, 10000000); builder.comment("The energy cost of Lav_150 per tick"); @@ -263,7 +287,7 @@ public class VehicleConfig { builder.push("tom_6"); - builder.comment("The HealthPoint of Tom_6"); + builder.comment("The health of Tom_6"); TOM_6_HP = builder.defineInRange("tom_6_hp", 40, 1, 10000000); builder.comment("The energy cost of Tom_6 per tick"); @@ -282,7 +306,7 @@ public class VehicleConfig { builder.push("bmp_2"); - builder.comment("The HealthPoint of Bmp_2"); + builder.comment("The health of Bmp_2"); BMP_2_HP = builder.defineInRange("bmp_2_hp", 300, 1, 10000000); builder.comment("The energy cost of Bmp_2 per tick"); @@ -304,7 +328,7 @@ public class VehicleConfig { builder.push("yx_100"); - builder.comment("The HealthPoint of Yx_100"); + builder.comment("The health of Yx_100"); YX_100_HP = builder.defineInRange("yx_100_hp", 500, 1, 10000000); builder.comment("The energy cost of Yx_100 per tick"); 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 51fa97bbd..41569737f 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java @@ -68,8 +68,6 @@ import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle; public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity, HelicopterEntity, WeaponVehicleEntity { private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); - public static final float MAX_HEALTH = VehicleConfig.AH_6_HP.get(); - public static final int MAX_ENERGY = VehicleConfig.AH_6_MAX_ENERGY.get(); public static final EntityDataAccessor PROPELLER_ROT = SynchedEntityData.defineId(Ah6Entity.class, EntityDataSerializers.FLOAT); public static final EntityDataAccessor DECOY_COUNT = SynchedEntityData.defineId(Ah6Entity.class, EntityDataSerializers.INT); public static final EntityDataAccessor LOADED_ROCKET = SynchedEntityData.defineId(Ah6Entity.class, EntityDataSerializers.INT); @@ -518,12 +516,12 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity @Override public float getMaxHealth() { - return MAX_HEALTH; + return VehicleConfig.AH_6_HP.get(); } @Override public int getMaxEnergy() { - return MAX_ENERGY; + return VehicleConfig.AH_6_MAX_ENERGY.get(); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java index f54a302f5..871a97854 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java @@ -73,9 +73,6 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, public static final EntityDataAccessor SHOOTER_UUID = SynchedEntityData.defineId(AnnihilatorEntity.class, EntityDataSerializers.STRING); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); - public static final float MAX_HEALTH = VehicleConfig.ANNIHILATOR_HP.get(); - public static final int MAX_ENERGY = VehicleConfig.ANNIHILATOR_MAX_ENERGY.get(); - public static final int SHOOT_COST = VehicleConfig.ANNIHILATOR_SHOOT_COST.get(); public Vec3 barrelLookAt; public AnnihilatorEntity(PlayMessages.SpawnEntity packet, Level world) { @@ -448,7 +445,7 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, return; } - if (!this.canConsume(SHOOT_COST)) { + if (!this.canConsume(VehicleConfig.ANNIHILATOR_SHOOT_COST.get())) { player.displayClientMessage(Component.translatable("tips.superbwarfare.annihilator.energy_not_enough").withStyle(ChatFormatting.RED), true); return; } @@ -463,7 +460,7 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, } this.entityData.set(COOL_DOWN, 100); - this.consumeEnergy(SHOOT_COST); + this.consumeEnergy(VehicleConfig.ANNIHILATOR_SHOOT_COST.get()); final Vec3 center = new Vec3(this.getX(), this.getEyeY(), this.getZ()); for (Entity target : level.getEntitiesOfClass(Entity.class, new AABB(center, center).inflate(20), e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(center))).toList()) { if (target instanceof ServerPlayer serverPlayer) { @@ -581,12 +578,12 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, @Override public int getMaxEnergy() { - return MAX_ENERGY; + return VehicleConfig.ANNIHILATOR_MAX_ENERGY.get(); } @Override public float getMaxHealth() { - return MAX_HEALTH; + return VehicleConfig.ANNIHILATOR_HP.get(); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java index 76053ca15..276140a01 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java @@ -66,9 +66,6 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit public static final EntityDataAccessor CANNON_FIRE_TIME = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.INT); public static final EntityDataAccessor LOADED_MISSILE = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.INT); public static final EntityDataAccessor MISSILE_COUNT = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.INT); - - public static final float MAX_HEALTH = VehicleConfig.BMP_2_HP.get(); - public static final int MAX_ENERGY = VehicleConfig.BMP_2_MAX_ENERGY.get(); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); public int reloadCoolDown; @@ -572,12 +569,12 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit @Override public int getMaxEnergy() { - return MAX_ENERGY; + return VehicleConfig.BMP_2_MAX_ENERGY.get(); } @Override public float getMaxHealth() { - return MAX_HEALTH; + return VehicleConfig.BMP_2_HP.get(); } @Override 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 c0928b755..96f439977 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/LaserTowerEntity.java @@ -65,10 +65,7 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity, public static final EntityDataAccessor LASER_LENGTH = SynchedEntityData.defineId(LaserTowerEntity.class, EntityDataSerializers.FLOAT); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); - public static final float MAX_HEALTH = VehicleConfig.LASER_TOWER_HP.get(); - public static final int MAX_ENERGY = VehicleConfig.LASER_TOWER_MAX_ENERGY.get(); - public static final int SHOOT_COST = VehicleConfig.LASER_TOWER_SHOOT_COST.get(); - public int changeTargetTimer = 5000; + public int changeTargetTimer = 60; public LaserTowerEntity(PlayMessages.SpawnEntity packet, Level world) { this(ModEntities.LASER_TOWER.get(), world); @@ -308,7 +305,7 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity, sendParticle(serverLevel, ParticleTypes.LAVA, target.getX(), target.getEyeY(), target.getZ(), 4, 0, 0, 0, 0.15, true); } - target.hurt(ModDamageTypes.causeLaserStaticDamage(this.level().registryAccess(), this, this.getOwner()), (float) 15); + target.hurt(ModDamageTypes.causeLaserStaticDamage(this.level().registryAccess(), this, this.getOwner()), VehicleConfig.LASER_TOWER_DAMAGE.get()); target.invulnerableTime = 0; entityData.set(LASER_LENGTH, distanceTo(target)); if (Math.random() < 0.25 && target instanceof LivingEntity living) { @@ -317,7 +314,7 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity, if (!target.isAlive()) { entityData.set(TARGET_UUID, "none"); } - this.consumeEnergy(SHOOT_COST); + this.consumeEnergy(VehicleConfig.LASER_TOWER_SHOOT_COST.get()); } } else { @@ -366,11 +363,11 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity, @Override public int getMaxEnergy() { - return MAX_ENERGY; + return VehicleConfig.LASER_TOWER_MAX_ENERGY.get(); } @Override public float getMaxHealth() { - return MAX_HEALTH; + return VehicleConfig.LASER_TOWER_HP.get(); } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java index f9abba8ce..5aab6b546 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java @@ -62,8 +62,6 @@ import java.util.Comparator; import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle; public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEntity, LandArmorEntity, WeaponVehicleEntity { - public static final float MAX_HEALTH = VehicleConfig.LAV_150_HP.get(); - public static final int MAX_ENERGY = VehicleConfig.LAV_150_MAX_ENERGY.get(); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); public Lav150Entity(PlayMessages.SpawnEntity packet, Level world) { @@ -502,12 +500,12 @@ public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEnt @Override public int getMaxEnergy() { - return MAX_ENERGY; + return VehicleConfig.LAV_150_MAX_ENERGY.get(); } @Override public float getMaxHealth() { - return MAX_HEALTH; + return VehicleConfig.LAV_150_HP.get(); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java index da14ee514..e7e9213e0 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java @@ -58,7 +58,6 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity public static final EntityDataAccessor COOL_DOWN = SynchedEntityData.defineId(Mk42Entity.class, EntityDataSerializers.INT); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); - public static final float MAX_HEALTH = VehicleConfig.MK42_HP.get(); public static final EntityDataAccessor PITCH = SynchedEntityData.defineId(Mk42Entity.class, EntityDataSerializers.FLOAT); public static final EntityDataAccessor YAW = SynchedEntityData.defineId(Mk42Entity.class, EntityDataSerializers.FLOAT); @@ -381,7 +380,7 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity @Override public float getMaxHealth() { - return MAX_HEALTH; + return VehicleConfig.MK42_HP.get(); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java index 076aa4d7d..0a3c56362 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java @@ -62,7 +62,6 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt public static final EntityDataAccessor PITCH = SynchedEntityData.defineId(Mle1934Entity.class, EntityDataSerializers.FLOAT); public static final EntityDataAccessor YAW = SynchedEntityData.defineId(Mle1934Entity.class, EntityDataSerializers.FLOAT); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); - public static final float MAX_HEALTH = VehicleConfig.MLE1934_HP.get(); public Mle1934Entity(PlayMessages.SpawnEntity packet, Level world) { this(ModEntities.MLE_1934.get(), world); @@ -300,32 +299,8 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt consumed = InventoryTool.consumeItem(player.getInventory().items, ammo, 2); } - float hitDamage; - float explosionRadius; - float explosionDamage; - float fireProbability; - int fireTime; - int durability; boolean salvoShoot = consumed == 2; - if (getWeaponIndex(0) == 1) { - // HE - hitDamage = VehicleConfig.MLE1934_HE_DAMAGE.get(); - explosionRadius = VehicleConfig.MLE1934_HE_EXPLOSION_RADIUS.get(); - explosionDamage = VehicleConfig.MLE1934_HE_EXPLOSION_DAMAGE.get(); - fireProbability = 0.24F; - fireTime = 5; - durability = 1; - } else { - // AP - hitDamage = VehicleConfig.MLE1934_AP_DAMAGE.get(); - explosionRadius = VehicleConfig.MLE1934_AP_EXPLOSION_RADIUS.get(); - explosionDamage = VehicleConfig.MLE1934_AP_EXPLOSION_DAMAGE.get(); - fireProbability = 0; - fireTime = 0; - durability = 70; - } - float yRot = this.getYRot(); if (yRot < 0) { yRot += 360; @@ -503,7 +478,7 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt @Override public float getMaxHealth() { - return MAX_HEALTH; + return VehicleConfig.MLE1934_HP.get(); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java index 3ae7d7575..ad016a92b 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java @@ -53,8 +53,6 @@ import java.util.Comparator; import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle; public class SpeedboatEntity extends ContainerMobileVehicleEntity implements GeoEntity, ArmedVehicleEntity, WeaponVehicleEntity, LandArmorEntity { - public static final float MAX_HEALTH = VehicleConfig.SPEEDBOAT_HP.get(); - public static final int MAX_ENERGY = VehicleConfig.SPEEDBOAT_MAX_ENERGY.get(); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); public SpeedboatEntity(PlayMessages.SpawnEntity packet, Level world) { @@ -437,12 +435,12 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo @Override public int getMaxEnergy() { - return MAX_ENERGY; + return VehicleConfig.SPEEDBOAT_MAX_ENERGY.get(); } @Override public float getMaxHealth() { - return MAX_HEALTH; + return VehicleConfig.SPEEDBOAT_HP.get(); } @Override 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 300e7ab79..dbbedc0ef 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java @@ -50,8 +50,6 @@ import software.bernie.geckolib.util.GeckoLibUtil; public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { public static final EntityDataAccessor MELON = SynchedEntityData.defineId(Tom6Entity.class, EntityDataSerializers.BOOLEAN); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); - public static final float MAX_HEALTH = VehicleConfig.TOM_6_HP.get(); - public static final int MAX_ENERGY = VehicleConfig.TOM_6_MAX_ENERGY.get(); public Tom6Entity(PlayMessages.SpawnEntity packet, Level world) { this(ModEntities.TOM_6.get(), world); @@ -342,12 +340,12 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { @Override public float getMaxHealth() { - return MAX_HEALTH; + return VehicleConfig.TOM_6_HP.get(); } @Override public int getMaxEnergy() { - return MAX_ENERGY; + return VehicleConfig.TOM_6_MAX_ENERGY.get(); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java index b651d7dc1..3c6a66be2 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java @@ -2,6 +2,7 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; +import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.entity.MortarEntity; import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity; import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier; @@ -42,8 +43,7 @@ import java.util.List; public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity { private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); - public static final float MAX_HEALTH = 30; - public static final int MAX_ENERGY = 24000; + public int jumpCoolDown; public int handBusyTime; @@ -185,13 +185,13 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity { if (passenger instanceof ServerPlayer serverPlayer) { serverPlayer.level().playSound(null, serverPlayer.getOnPos(), ModSounds.WHEEL_CHAIR_JUMP.get(), SoundSource.PLAYERS, 1, 1); } - this.consumeEnergy(400); + this.consumeEnergy(VehicleConfig.WHEELCHAIR_JUMP_ENERGY_COST.get()); this.setDeltaMovement(this.getDeltaMovement().add(0, 0.6, 0)); jumpCoolDown = 3; } if (this.forwardInputDown || this.backInputDown) { - this.consumeEnergy(1); + this.consumeEnergy(VehicleConfig.WHEELCHAIR_MOVE_ENERGY_COST.get()); } if (passenger instanceof Player player && player.level().isClientSide && this.handBusyTime > 0) { @@ -275,12 +275,12 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity { @Override public float getMaxHealth() { - return MAX_HEALTH; + return VehicleConfig.WHEELCHAIR_HP.get(); } @Override public int getMaxEnergy() { - return MAX_ENERGY; + return VehicleConfig.WHEELCHAIR_MAX_ENERGY.get(); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java index c85c4b762..897686c12 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java @@ -71,9 +71,6 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti public static final EntityDataAccessor LOADED_AMMO = SynchedEntityData.defineId(Yx100Entity.class, EntityDataSerializers.INT); public static final EntityDataAccessor GUN_FIRE_TIME = SynchedEntityData.defineId(Yx100Entity.class, EntityDataSerializers.INT); - public static final float MAX_HEALTH = VehicleConfig.YX_100_HP.get(); - public static final int MAX_ENERGY = VehicleConfig.YX_100_MAX_ENERGY.get(); - public static final int SHOOT_COST = VehicleConfig.YX_100_SHOOT_COST.get(); private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this); public Yx100Entity(PlayMessages.SpawnEntity packet, Level world) { @@ -307,7 +304,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti } if (reloadCoolDown == 0 && type == 0) { - if (!this.canConsume(SHOOT_COST)) { + if (!this.canConsume(VehicleConfig.YX_100_SHOOT_COST.get())) { player.displayClientMessage(Component.translatable("tips.superbwarfare.annihilator.energy_not_enough").withStyle(ChatFormatting.RED), true); return; } @@ -477,7 +474,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti } if (this.forwardInputDown || this.backInputDown) { - this.consumeEnergy(VehicleConfig.BMP_2_ENERGY_COST.get()); + this.consumeEnergy(VehicleConfig.YX_100_ENERGY_COST.get()); } this.entityData.set(POWER, this.entityData.get(POWER) * (upInputDown ? 0.5f : (rightInputDown || leftInputDown) ? 0.947f : 0.96f)); @@ -672,12 +669,12 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti @Override public int getMaxEnergy() { - return MAX_ENERGY; + return VehicleConfig.YX_100_MAX_ENERGY.get(); } @Override public float getMaxHealth() { - return MAX_HEALTH; + return VehicleConfig.YX_100_HP.get(); } @Override @@ -695,7 +692,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti @Override public boolean canShoot(Player player) { return switch (getSeatIndex(player)) { - case 0 -> this.entityData.get(LOADED_AMMO) > 0 && getEnergy() > SHOOT_COST; + case 0 -> this.entityData.get(LOADED_AMMO) > 0 && getEnergy() > VehicleConfig.YX_100_SHOOT_COST.get(); case 1 -> (this.entityData.get(MG_AMMO) > 0 || InventoryTool.hasCreativeAmmoBox(player)) && !cannotFire; default -> false; };