提取各载具的通用属性

This commit is contained in:
Light_Quanta 2025-05-20 07:02:58 +08:00
parent 97bab5e46d
commit cf9b0e9205
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
43 changed files with 101 additions and 274 deletions

View file

@ -5,7 +5,7 @@ import com.atsuishio.superbwarfare.compat.clothconfig.ClothConfigHelper;
import com.atsuishio.superbwarfare.config.client.ReloadConfig;
import com.atsuishio.superbwarfare.data.gun.FireMode;
import com.atsuishio.superbwarfare.data.gun.GunData;
import com.atsuishio.superbwarfare.entity.MortarEntity;
import com.atsuishio.superbwarfare.entity.vehicle.MortarEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;

View file

@ -1,7 +1,7 @@
package com.atsuishio.superbwarfare.client.layer.vehicle;
import com.atsuishio.superbwarfare.Mod;
import com.atsuishio.superbwarfare.entity.MortarEntity;
import com.atsuishio.superbwarfare.entity.vehicle.MortarEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.renderer.MultiBufferSource;

View file

@ -1,7 +1,7 @@
package com.atsuishio.superbwarfare.client.model.entity;
import com.atsuishio.superbwarfare.Mod;
import com.atsuishio.superbwarfare.entity.MortarEntity;
import com.atsuishio.superbwarfare.entity.vehicle.MortarEntity;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import software.bernie.geckolib.animation.AnimationState;

View file

@ -1,7 +1,7 @@
package com.atsuishio.superbwarfare.client.overlay;
import com.atsuishio.superbwarfare.Mod;
import com.atsuishio.superbwarfare.entity.MortarEntity;
import com.atsuishio.superbwarfare.entity.vehicle.MortarEntity;
import com.atsuishio.superbwarfare.tools.FormatTool;
import com.atsuishio.superbwarfare.tools.RangeTool;
import com.atsuishio.superbwarfare.tools.TraceTool;

View file

@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.client.renderer.entity;
import com.atsuishio.superbwarfare.client.layer.vehicle.MortarLayer;
import com.atsuishio.superbwarfare.client.model.entity.MortarModel;
import com.atsuishio.superbwarfare.entity.MortarEntity;
import com.atsuishio.superbwarfare.entity.vehicle.MortarEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;

View file

@ -18,7 +18,6 @@ public class VehicleConfig {
public static ModConfigSpec.IntValue REPAIR_COOLDOWN;
public static ModConfigSpec.DoubleValue REPAIR_AMOUNT;
public static ModConfigSpec.IntValue MK42_HP;
public static ModConfigSpec.IntValue MK42_AP_DAMAGE;
public static ModConfigSpec.IntValue MK42_AP_EXPLOSION_DAMAGE;
public static ModConfigSpec.IntValue MK42_AP_EXPLOSION_RADIUS;
@ -26,7 +25,6 @@ public class VehicleConfig {
public static ModConfigSpec.IntValue MK42_HE_EXPLOSION_DAMAGE;
public static ModConfigSpec.IntValue MK42_HE_EXPLOSION_RADIUS;
public static ModConfigSpec.IntValue MLE1934_HP;
public static ModConfigSpec.IntValue MLE1934_AP_DAMAGE;
public static ModConfigSpec.IntValue MLE1934_AP_EXPLOSION_DAMAGE;
public static ModConfigSpec.IntValue MLE1934_AP_EXPLOSION_RADIUS;
@ -36,29 +34,19 @@ public class VehicleConfig {
public static ModConfigSpec.IntValue HEAVY_MACHINE_GUN_DAMAGE;
public static ModConfigSpec.IntValue ANNIHILATOR_HP;
public static ModConfigSpec.IntValue ANNIHILATOR_SHOOT_COST;
public static ModConfigSpec.IntValue ANNIHILATOR_MAX_ENERGY;
public static ModConfigSpec.IntValue LASER_TOWER_HP;
public static ModConfigSpec.IntValue LASER_TOWER_COOLDOWN;
public static ModConfigSpec.IntValue LASER_TOWER_DAMAGE;
public static ModConfigSpec.IntValue LASER_TOWER_SHOOT_COST;
public static ModConfigSpec.IntValue LASER_TOWER_MAX_ENERGY;
public static ModConfigSpec.IntValue SPEEDBOAT_HP;
public static ModConfigSpec.IntValue SPEEDBOAT_ENERGY_COST;
public static ModConfigSpec.IntValue SPEEDBOAT_MAX_ENERGY;
public static ModConfigSpec.IntValue WHEELCHAIR_HP;
public static ModConfigSpec.IntValue WHEELCHAIR_JUMP_ENERGY_COST;
public static ModConfigSpec.IntValue WHEELCHAIR_MOVE_ENERGY_COST;
public static ModConfigSpec.IntValue WHEELCHAIR_MAX_ENERGY;
public static ModConfigSpec.IntValue AH_6_HP;
public static ModConfigSpec.IntValue AH_6_MIN_ENERGY_COST;
public static ModConfigSpec.IntValue AH_6_MAX_ENERGY_COST;
public static ModConfigSpec.IntValue AH_6_MAX_ENERGY;
public static ModConfigSpec.IntValue AH_6_CANNON_DAMAGE;
public static ModConfigSpec.IntValue AH_6_CANNON_EXPLOSION_DAMAGE;
public static ModConfigSpec.DoubleValue AH_6_CANNON_EXPLOSION_RADIUS;
@ -67,31 +55,23 @@ public class VehicleConfig {
public static ModConfigSpec.IntValue AH_6_ROCKET_EXPLOSION_RADIUS;
public static ModConfigSpec.BooleanValue AH_6_CANNON_DESTROY;
public static ModConfigSpec.IntValue LAV_150_HP;
public static ModConfigSpec.IntValue LAV_150_ENERGY_COST;
public static ModConfigSpec.IntValue LAV_150_MAX_ENERGY;
public static ModConfigSpec.IntValue LAV_150_CANNON_DAMAGE;
public static ModConfigSpec.IntValue LAV_150_CANNON_EXPLOSION_DAMAGE;
public static ModConfigSpec.DoubleValue LAV_150_CANNON_EXPLOSION_RADIUS;
public static ModConfigSpec.DoubleValue LAV_150_MACHINE_GUN_DAMAGE;
public static ModConfigSpec.IntValue TOM_6_HP;
public static ModConfigSpec.IntValue TOM_6_MAX_ENERGY;
public static ModConfigSpec.IntValue TOM_6_ENERGY_COST;
public static ModConfigSpec.IntValue TOM_6_BOMB_EXPLOSION_DAMAGE;
public static ModConfigSpec.DoubleValue TOM_6_BOMB_EXPLOSION_RADIUS;
public static ModConfigSpec.IntValue BMP_2_HP;
public static ModConfigSpec.IntValue BMP_2_ENERGY_COST;
public static ModConfigSpec.IntValue BMP_2_MAX_ENERGY;
public static ModConfigSpec.IntValue BMP_2_CANNON_DAMAGE;
public static ModConfigSpec.IntValue BMP_2_CANNON_EXPLOSION_DAMAGE;
public static ModConfigSpec.DoubleValue BMP_2_CANNON_EXPLOSION_RADIUS;
public static ModConfigSpec.IntValue YX_100_HP;
public static ModConfigSpec.IntValue YX_100_SHOOT_COST;
public static ModConfigSpec.IntValue YX_100_ENERGY_COST;
public static ModConfigSpec.IntValue YX_100_MAX_ENERGY;
public static ModConfigSpec.IntValue YX_100_AP_CANNON_DAMAGE;
public static ModConfigSpec.IntValue YX_100_AP_CANNON_EXPLOSION_DAMAGE;
public static ModConfigSpec.DoubleValue YX_100_AP_CANNON_EXPLOSION_RADIUS;
@ -101,8 +81,6 @@ public class VehicleConfig {
public static ModConfigSpec.IntValue YX_100_SWARM_EXPLOSION_DAMAGE;
public static ModConfigSpec.DoubleValue YX_100_SWARM_EXPLOSION_RADIUS;
public static ModConfigSpec.IntValue PRISM_TANK_HP;
public static ModConfigSpec.IntValue PRISM_TANK_MAX_ENERGY;
public static ModConfigSpec.IntValue PRISM_TANK_ENERGY_COST;
public static ModConfigSpec.IntValue PRISM_TANK_DAMAGE_MODE_1;
public static ModConfigSpec.IntValue PRISM_TANK_SHOOT_COST_MODE_1;
@ -111,17 +89,13 @@ public class VehicleConfig {
public static ModConfigSpec.IntValue PRISM_TANK_DAMAGE_MODE_2;
public static ModConfigSpec.IntValue PRISM_TANK_SHOOT_COST_MODE_2;
public static ModConfigSpec.IntValue HPJ11_HP;
public static ModConfigSpec.IntValue HPJ11_MAX_ENERGY;
public static ModConfigSpec.DoubleValue HPJ11_DAMAGE;
public static ModConfigSpec.DoubleValue HPJ11_EXPLOSION_DAMAGE;
public static ModConfigSpec.DoubleValue HPJ11_EXPLOSION_RADIUS;
public static ModConfigSpec.IntValue HPJ11_SHOOT_COST;
public static ModConfigSpec.IntValue HPJ11_SEEK_COST;
public static ModConfigSpec.IntValue A_10_HP;
public static ModConfigSpec.IntValue A_10_MAX_ENERGY_COST;
public static ModConfigSpec.IntValue A_10_MAX_ENERGY;
public static ModConfigSpec.IntValue A_10_CANNON_DAMAGE;
public static ModConfigSpec.IntValue A_10_CANNON_EXPLOSION_DAMAGE;
public static ModConfigSpec.DoubleValue A_10_CANNON_EXPLOSION_RADIUS;
@ -161,8 +135,6 @@ public class VehicleConfig {
builder.push("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");
MK42_AP_DAMAGE = builder.defineInRange("mk_42_ap_damage", 450, 1, 10000000);
@ -186,8 +158,6 @@ public class VehicleConfig {
builder.push("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");
MLE1934_AP_DAMAGE = builder.defineInRange("mle_1934_ap_damage", 500, 1, 10000000);
@ -218,21 +188,15 @@ public class VehicleConfig {
builder.push("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");
ANNIHILATOR_SHOOT_COST = builder.defineInRange("annihilator_shoot_cost", 2000000, 0, 2147483647);
builder.comment("The max energy storage of Annihilator");
ANNIHILATOR_MAX_ENERGY = builder.defineInRange("annihilator_max_energy", 20000000, 0, 2147483647);
builder.pop();
builder.push("Laser Tower");
builder.comment("The health of Laser Tower");
LASER_TOWER_HP = builder.defineInRange("laser_tower_hp", 100, 1, 10000000);
builder.comment("The damage of Laser Tower");
LASER_TOWER_DAMAGE = builder.defineInRange("laser_tower_damage", 15, 1, 10000000);
@ -243,28 +207,20 @@ public class VehicleConfig {
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");
LASER_TOWER_MAX_ENERGY = builder.defineInRange("laser_tower_max_energy", 500000, 0, 2147483647);
builder.pop();
builder.push("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");
SPEEDBOAT_ENERGY_COST = builder.defineInRange("speedboat_energy_cost", 16, 0, 2147483647);
builder.comment("The max energy storage of Speedboat");
SPEEDBOAT_MAX_ENERGY = builder.defineInRange("speedboat_max_energy", 500000, 0, 2147483647);
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);
@ -272,15 +228,11 @@ public class VehicleConfig {
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 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");
AH_6_MIN_ENERGY_COST = builder.defineInRange("ah_6_min_energy_cost", 64, 0, 2147483647);
@ -288,8 +240,6 @@ public class VehicleConfig {
builder.comment("The max energy cost of AH-6 per tick");
AH_6_MAX_ENERGY_COST = builder.defineInRange("ah_6_max_energy_cost", 128, 0, 2147483647);
builder.comment("The max energy storage of AH-6");
AH_6_MAX_ENERGY = builder.defineInRange("ah_6_max_energy", 5000000, 0, 2147483647);
builder.comment("The cannon damage of AH-6");
AH_6_CANNON_DAMAGE = builder.defineInRange("ah_6_cannon_damage", 25, 1, 10000000);
@ -316,14 +266,10 @@ public class VehicleConfig {
builder.push("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");
LAV_150_ENERGY_COST = builder.defineInRange("lav_150_energy_cost", 64, 0, 2147483647);
builder.comment("The max energy storage of LAV-150");
LAV_150_MAX_ENERGY = builder.defineInRange("lav_150_max_energy", 5000000, 0, 2147483647);
builder.comment("The cannon damage of LAV-150");
LAV_150_CANNON_DAMAGE = builder.defineInRange("lav_150_cannon_damage", 45, 1, 10000000);
@ -341,14 +287,10 @@ public class VehicleConfig {
builder.push("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");
TOM_6_ENERGY_COST = builder.defineInRange("tom_6_energy_cost", 16, 0, 2147483647);
builder.comment("The max energy storage of Tom-6");
TOM_6_MAX_ENERGY = builder.defineInRange("tom_6_max_energy", 100000, 0, 2147483647);
builder.comment("The Melon Bomb explosion damage of Tom-6");
TOM_6_BOMB_EXPLOSION_DAMAGE = builder.defineInRange("tom_6_bomb_explosion_damage", 500, 1, 10000000);
@ -360,14 +302,10 @@ public class VehicleConfig {
builder.push("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");
BMP_2_ENERGY_COST = builder.defineInRange("bmp_2_energy_cost", 64, 0, 2147483647);
builder.comment("The max energy storage of BMP-2");
BMP_2_MAX_ENERGY = builder.defineInRange("bmp_2_max_energy", 5000000, 0, 2147483647);
builder.comment("The cannon damage of BMP-2");
BMP_2_CANNON_DAMAGE = builder.defineInRange("bmp_2_cannon_damage", 55, 1, 10000000);
@ -382,8 +320,6 @@ public class VehicleConfig {
builder.push("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");
YX_100_ENERGY_COST = builder.defineInRange("yx_100_energy_cost", 128, 0, 2147483647);
@ -391,8 +327,6 @@ public class VehicleConfig {
builder.comment("The energy cost of YX-100 per shoot");
YX_100_SHOOT_COST = builder.defineInRange("yx_100_shoot_cost", 24000, 0, 2147483647);
builder.comment("The max energy storage of YX-100");
YX_100_MAX_ENERGY = builder.defineInRange("yx_100_max_energy", 20000000, 0, 2147483647);
builder.comment("The cannon damage of YX-100");
YX_100_AP_CANNON_DAMAGE = builder.defineInRange("yx_100_ap_cannon_damage", 500, 1, 10000000);
@ -422,11 +356,7 @@ public class VehicleConfig {
builder.push("Prism Tank");
builder.comment("The health of Prism Tank");
PRISM_TANK_HP = builder.defineInRange("prism_tank_hp", 400, 1, 10000000);
builder.comment("The max energy storage of Prism Tank");
PRISM_TANK_MAX_ENERGY = builder.defineInRange("prism_tank_energy", 20000000, 0, 2147483647);
builder.comment("The energy cost of Prism Tank per tick");
PRISM_TANK_ENERGY_COST = builder.defineInRange("prism_tank_energy_cost", 96, 0, 2147483647);
@ -453,11 +383,7 @@ public class VehicleConfig {
builder.push("HPJ-11");
builder.comment("The health of HPJ-11");
HPJ11_HP = builder.defineInRange("hpj_11_hp", 350, 1, 10000000);
builder.comment("The max energy storage of HPJ-11");
HPJ11_MAX_ENERGY = builder.defineInRange("hpj_11_max_energy", 5000000, 0, 2147483647);
builder.comment("The damage of HPJ-11");
HPJ11_DAMAGE = builder.defineInRange("hpj_11_damage", 20d, 1, 10000000);
@ -478,14 +404,10 @@ public class VehicleConfig {
builder.push("A-10");
builder.comment("The health of A-10");
A_10_HP = builder.defineInRange("A_10_hp", 350, 1, 10000000);
builder.comment("The max energy cost of A-10 per tick");
A_10_MAX_ENERGY_COST = builder.defineInRange("A_10_max_energy_cost", 256, 0, 2147483647);
builder.comment("The max energy storage of A-10");
A_10_MAX_ENERGY = builder.defineInRange("A_10_max_energy", 10000000, 0, 2147483647);
builder.comment("The cannon damage of A-10");
A_10_CANNON_DAMAGE = builder.defineInRange("A_10_cannon_damage", 30, 1, 10000000);

View file

@ -8,7 +8,7 @@ public class DefaultVehicleData {
public String id = "";
@SerializedName("MaxHealth")
public float maxHealth = 50;
public float maxHealth = 5;
@SerializedName("RepairCooldown")
public int repairCooldown = VehicleConfig.REPAIR_COOLDOWN.get();
@ -17,11 +17,14 @@ public class DefaultVehicleData {
public float repairAmount = VehicleConfig.REPAIR_AMOUNT.get().floatValue();
@SerializedName("MaxEnergy")
public int maxEnergy = 100000;
public int maxEnergy = 10;
@SerializedName("UpStep")
public float upStep = 0;
@SerializedName("AllowFreeCam")
public boolean allowFreeCam = false;
// TODO damage modifier
// @SerializedName("DamageModifier")
// private List<DamageModify> damageModifier;

View file

@ -49,4 +49,8 @@ public class VehicleData {
return data.upStep;
}
public boolean allowFreeCam() {
return data.allowFreeCam;
}
}

View file

@ -85,11 +85,6 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
super(type, world);
}
@Override
public float maxUpStep() {
return 0.5f;
}
@Override
public VehicleWeapon[][] initWeapons() {
return new VehicleWeapon[][]{
@ -792,26 +787,11 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
return this.cache;
}
@Override
public float getMaxHealth() {
return VehicleConfig.A_10_HP.get();
}
@Override
public int getMaxEnergy() {
return VehicleConfig.A_10_MAX_ENERGY.get();
}
@Override
public ResourceLocation getVehicleIcon() {
return Mod.loc("textures/vehicle_icon/a10_icon.png");
}
@Override
public boolean allowFreeCam() {
return true;
}
@Override
public Vec3 shootPos(float tickDelta) {
Matrix4f transform = getVehicleTransform(tickDelta);

View file

@ -75,11 +75,6 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
super(pEntityType, pLevel);
}
@Override
public float maxUpStep() {
return 1.1F;
}
@Override
public VehicleWeapon[][] initWeapons() {
return new VehicleWeapon[][]{
@ -526,16 +521,6 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
return this.cache;
}
@Override
public float getMaxHealth() {
return VehicleConfig.AH_6_HP.get();
}
@Override
public int getMaxEnergy() {
return VehicleConfig.AH_6_MAX_ENERGY.get();
}
@Override
public void vehicleShoot(Player player, int type) {
boolean hasCreativeAmmo = false;
@ -698,11 +683,6 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
return Mod.loc("textures/vehicle_icon/ah_6_icon.png");
}
@Override
public boolean allowFreeCam() {
return true;
}
@Override
public double getSensitivity(double original, boolean zoom, int seatIndex, boolean isOnGround) {
return seatIndex == 0 && !isOnGround ? 0.33 : original;

View file

@ -563,16 +563,6 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity,
return this.cache;
}
@Override
public int getMaxEnergy() {
return VehicleConfig.ANNIHILATOR_MAX_ENERGY.get();
}
@Override
public float getMaxHealth() {
return VehicleConfig.ANNIHILATOR_HP.get();
}
@Override
public int mainGunRpm(Player player) {
return 0;

View file

@ -82,11 +82,6 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit
super(type, world);
}
@Override
public float maxUpStep() {
return 2.25F;
}
@Override
public VehicleWeapon[][] initWeapons() {
return new VehicleWeapon[][]{
@ -675,16 +670,6 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit
return this.cache;
}
@Override
public int getMaxEnergy() {
return VehicleConfig.BMP_2_MAX_ENERGY.get();
}
@Override
public float getMaxHealth() {
return VehicleConfig.BMP_2_HP.get();
}
@Override
public int mainGunRpm(Player player) {
if (getWeaponIndex(0) == 0) {

View file

@ -68,7 +68,6 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
public static final EntityDataAccessor<Float> DELTA_X_ROT = SynchedEntityData.defineId(DroneEntity.class, EntityDataSerializers.FLOAT);
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
public static final float MAX_HEALTH = 5;
public boolean fire;
public int collisionCoolDown;
@ -108,12 +107,6 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
public boolean playHitSoundOnHurt() {
return false;
}
@Override
public float getMaxHealth() {
return MAX_HEALTH;
}
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);

View file

@ -552,16 +552,6 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti
return this.cache;
}
@Override
public int getMaxEnergy() {
return VehicleConfig.HPJ11_MAX_ENERGY.get();
}
@Override
public float getMaxHealth() {
return VehicleConfig.HPJ11_HP.get();
}
@Override
public int mainGunRpm(Player player) {
return 0;

View file

@ -380,14 +380,4 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity,
public AnimatableInstanceCache getAnimatableInstanceCache() {
return this.cache;
}
@Override
public int getMaxEnergy() {
return VehicleConfig.LASER_TOWER_MAX_ENERGY.get();
}
@Override
public float getMaxHealth() {
return VehicleConfig.LASER_TOWER_HP.get();
}
}

View file

@ -73,11 +73,6 @@ public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEnt
super(type, world);
}
@Override
public float maxUpStep() {
return 1.5F;
}
@Override
public VehicleWeapon[][] initWeapons() {
return new VehicleWeapon[][]{
@ -547,16 +542,6 @@ public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEnt
return this.cache;
}
@Override
public int getMaxEnergy() {
return VehicleConfig.LAV_150_MAX_ENERGY.get();
}
@Override
public float getMaxHealth() {
return VehicleConfig.LAV_150_HP.get();
}
@Override
public int mainGunRpm(Player player) {
if (getWeaponIndex(0) == 0) {

View file

@ -408,11 +408,6 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity
return this.cache;
}
@Override
public float getMaxHealth() {
return VehicleConfig.MK42_HP.get();
}
@Override
public int mainGunRpm(Player player) {
return 0;

View file

@ -472,11 +472,6 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt
return this.cache;
}
@Override
public float getMaxHealth() {
return VehicleConfig.MLE1934_HP.get();
}
@Override
public int mainGunRpm(Player player) {
return 0;

View file

@ -1,4 +1,4 @@
package com.atsuishio.superbwarfare.entity;
package com.atsuishio.superbwarfare.entity.vehicle;
import com.atsuishio.superbwarfare.Mod;
import com.atsuishio.superbwarfare.component.ModDataComponents;
@ -268,11 +268,6 @@ public class MortarEntity extends VehicleEntity implements GeoEntity {
super.destroy();
}
@Override
public float getMaxHealth() {
return 100;
}
@Override
public void registerControllers(AnimatableManager.ControllerRegistrar data) {
data.add(new AnimationController<>(this, "movement", 0, this::movementPredicate));

View file

@ -84,11 +84,6 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo
this.noCulling = true;
}
@Override
public float maxUpStep() {
return 2.25f;
}
@Override
public VehicleWeapon[][] initWeapons() {
return new VehicleWeapon[][]{
@ -724,16 +719,6 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo
return this.cache;
}
@Override
public int getMaxEnergy() {
return VehicleConfig.PRISM_TANK_MAX_ENERGY.get();
}
@Override
public float getMaxHealth() {
return VehicleConfig.PRISM_TANK_HP.get();
}
@Override
public int mainGunRpm(Player player) {
if (getWeaponIndex(0) == 0) {

View file

@ -532,16 +532,6 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo
return 5;
}
@Override
public int getMaxEnergy() {
return VehicleConfig.SPEEDBOAT_MAX_ENERGY.get();
}
@Override
public float getMaxHealth() {
return VehicleConfig.SPEEDBOAT_HP.get();
}
@Override
public int mainGunRpm(Player player) {
return 500;

View file

@ -353,11 +353,6 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity {
return Mod.loc("textures/vehicle_icon/tom_6_icon.png");
}
@Override
public boolean allowFreeCam() {
return true;
}
@Override
public double getSensitivity(double original, boolean zoom, int seatIndex, boolean isOnGround) {
return 0.3;

View file

@ -3,7 +3,6 @@ package com.atsuishio.superbwarfare.entity.vehicle;
import com.atsuishio.superbwarfare.Mod;
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;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
@ -56,11 +55,6 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity {
super(type, world);
}
@Override
public float maxUpStep() {
return 1.1F;
}
@Override
public void playerTouch(Player pPlayer) {
if (this.position().distanceTo(pPlayer.position()) > 1.4 || pPlayer == this.getFirstPassenger()) return;
@ -307,16 +301,6 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity {
return this.cache;
}
@Override
public float getMaxHealth() {
return VehicleConfig.WHEELCHAIR_HP.get();
}
@Override
public int getMaxEnergy() {
return VehicleConfig.WHEELCHAIR_MAX_ENERGY.get();
}
@Override
public ResourceLocation getVehicleIcon() {
return Mod.loc("textures/vehicle_icon/wheel_chair_icon.png");

View file

@ -89,11 +89,6 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
super(type, world);
}
@Override
public float maxUpStep() {
return 2.25F;
}
@Override
public VehicleWeapon[][] initWeapons() {
return new VehicleWeapon[][]{
@ -1076,16 +1071,6 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti
return this.cache;
}
@Override
public int getMaxEnergy() {
return VehicleConfig.YX_100_MAX_ENERGY.get();
}
@Override
public float getMaxHealth() {
return VehicleConfig.YX_100_HP.get();
}
@Override
public int mainGunRpm(Player player) {
if (player == getNthEntity(0)) {

View file

@ -879,7 +879,7 @@ public abstract class VehicleEntity extends Entity {
}
public boolean allowFreeCam() {
return false;
return data().allowFreeCam();
}
// 本方法留空

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.item;
import com.atsuishio.superbwarfare.entity.MortarEntity;
import com.atsuishio.superbwarfare.entity.vehicle.MortarEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;

View file

@ -1,7 +1,7 @@
package com.atsuishio.superbwarfare.network.message.send;
import com.atsuishio.superbwarfare.Mod;
import com.atsuishio.superbwarfare.entity.MortarEntity;
import com.atsuishio.superbwarfare.entity.vehicle.MortarEntity;
import com.atsuishio.superbwarfare.init.ModSounds;
import com.atsuishio.superbwarfare.tools.SoundTool;
import com.atsuishio.superbwarfare.tools.TraceTool;
@ -15,7 +15,7 @@ import net.minecraft.world.entity.Entity;
import net.neoforged.neoforge.network.handling.IPayloadContext;
import org.jetbrains.annotations.NotNull;
import static com.atsuishio.superbwarfare.entity.MortarEntity.PITCH;
import static com.atsuishio.superbwarfare.entity.vehicle.MortarEntity.PITCH;
public record AdjustMortarAngleMessage(double scroll) implements CustomPacketPayload {
public static final Type<AdjustMortarAngleMessage> TYPE = new Type<>(Mod.loc("adjust_mortar_angle"));

View file

@ -0,0 +1,7 @@
{
"ID": "superbwarfare:a_10a",
"MaxHealth": 350,
"MaxEnergy": 10000000,
"UpStep": 0.5,
"allowFreeCam": true
}

View file

@ -0,0 +1,7 @@
{
"ID": "superbwarfare:ah_6",
"MaxHealth": 250,
"MaxEnergy": 5000000,
"UpStep": 1.1,
"allowFreeCam": true
}

View file

@ -0,0 +1,5 @@
{
"ID": "superbwarfare:annihilator",
"MaxHealth": 1200,
"MaxEnergy": 20000000
}

View file

@ -0,0 +1,6 @@
{
"ID": "superbwarfare:bmp_2",
"MaxHealth": 300,
"MaxEnergy": 5000000,
"UpStep": 2.25
}

View file

@ -0,0 +1,4 @@
{
"ID": "superbwarfare:drone",
"MaxHealth": 5
}

View file

@ -0,0 +1,5 @@
{
"ID": "superbwarfare:hpj_11",
"MaxHealth": 350,
"MaxEnergy": 5000000
}

View file

@ -0,0 +1,5 @@
{
"ID": "superbwarfare:laser_tower",
"MaxHealth": 100,
"MaxEnergy": 500000
}

View file

@ -0,0 +1,6 @@
{
"ID": "superbwarfare:lav_150",
"MaxHealth": 250,
"MaxEnergy": 5000000,
"UpStep": 1.5
}

View file

@ -0,0 +1,4 @@
{
"ID": "superbwarfare:mk_42",
"MaxHealth": 350
}

View file

@ -0,0 +1,4 @@
{
"ID": "superbwarfare:mle_1934",
"MaxHealth": 350
}

View file

@ -0,0 +1,4 @@
{
"ID": "superbwarfare:mortar",
"MaxHealth": 100
}

View file

@ -0,0 +1,6 @@
{
"ID": "superbwarfare:prism_tank",
"MaxHealth": 400,
"MaxEnergy": 20000000,
"UpStep": 2.25
}

View file

@ -0,0 +1,5 @@
{
"ID": "superbwarfare:speedboat",
"MaxHealth": 200,
"MaxEnergy": 500000
}

View file

@ -2,5 +2,6 @@
"ID": "superbwarfare:tom_6",
"MaxHealth": 40,
"MaxEnergy": 100000,
"UpStep": 0.5
"UpStep": 0.5,
"allowFreeCam": true
}

View file

@ -0,0 +1,6 @@
{
"ID": "superbwarfare:wheel_chair",
"MaxHealth": 30,
"MaxEnergy": 24000,
"UpStep": 1.1
}

View file

@ -0,0 +1,6 @@
{
"ID": "superbwarfare:yx_100",
"MaxHealth": 500,
"MaxEnergy": 20000000,
"UpStep": 2.25
}