完善BMP2,改版本号

This commit is contained in:
Atsuihsio 2025-01-28 21:55:02 +08:00
parent 1a895338e8
commit ce72300d70
32 changed files with 208 additions and 24 deletions

View file

@ -13,5 +13,5 @@ mod_description=A Warfare Mod
minecraft_version=1.20.1
jei_version=15.2.0.27
cloth_config_version=11.1.106
mod_version=0.4.6
mod_version=0.5.0
mod_authors=Atsuishio, Roki27, Light_Quanta

View file

@ -1,4 +1,4 @@
// 1.20.1 2025-01-27T23:57:54.4907094 Item Models: superbwarfare
// 1.20.1 2025-01-28T15:44:32.1906572 Item Models: superbwarfare
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/aa_12_blueprint.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/ak_12_blueprint.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/ak_47_blueprint.json
@ -54,6 +54,7 @@ f66c351b4843ad4d4e086ccfb7d4d0221227d196 assets/superbwarfare/models/item/legend
ec76dc1a79f4c0e502fee53be8aa8e04420845fc assets/superbwarfare/models/item/light_armament_module.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/m2hb_blueprint.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/marlin_blueprint.json
0033cd03b0203cd3fa071fb5354c74d33bc1afa8 assets/superbwarfare/models/item/medium_armament_module.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/minigun_blueprint.json
c206cd345f459733399e0be4692586849ef0aac2 assets/superbwarfare/models/item/missile_engine.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/mk_14_blueprint.json
@ -106,6 +107,7 @@ b4e009177af3af6ad6dda54e3e2fed43dc243ff2 assets/superbwarfare/models/item/steel_
dbba3ca532b6aa949c84ea8b3f10fe3a0bf472e7 assets/superbwarfare/models/item/target_deployer.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/taser_blueprint.json
13ca8d5676888ff51f3308d88e4bf67691fa34f8 assets/superbwarfare/models/item/trachelium_blueprint.json
a6d50c9f0c57dc33828a35f45f3f9ca59725c1a1 assets/superbwarfare/models/item/track.json
cae31335c134b57962bd7b318d02c71655ef5479 assets/superbwarfare/models/item/transcript.json
f391a7df36c738dfaeb2ab82ac077e3442a59b98 assets/superbwarfare/models/item/tungsten_ingot.json
b4e6c184478f8dc764fb7071ac5e30939cd01d9d assets/superbwarfare/models/item/tungsten_powder.json

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "superbwarfare:item/medium_armament_module"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "superbwarfare:item/track"
}
}

View file

@ -32,8 +32,10 @@ public class ModItemModelProvider extends ItemModelProvider {
simpleItem(ModItems.MOTOR);
simpleItem(ModItems.LARGE_MOTOR);
simpleItem(ModItems.WHEEL);
simpleItem(ModItems.TRACK);
simpleItem(ModItems.DRONE);
simpleItem(ModItems.LIGHT_ARMAMENT_MODULE);
simpleItem(ModItems.MEDIUM_ARMAMENT_MODULE);
simpleItem(ModItems.TARGET_DEPLOYER);
simpleItem(ModItems.MORTAR_DEPLOYER);

View file

@ -109,8 +109,6 @@ public class WgMissileEntity extends ThrowableItemProjectile implements GeoEntit
entity, this.explosion_damage, this.explosion_radius);
}
}
this.discard();
}
@Override
@ -121,7 +119,6 @@ public class WgMissileEntity extends ThrowableItemProjectile implements GeoEntit
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), this, this.getOwner()),
this, this.explosion_damage, this.explosion_radius);
}
this.discard();
}
@Override
@ -148,15 +145,15 @@ public class WgMissileEntity extends ThrowableItemProjectile implements GeoEntit
Vec3 toVec = shooter.getEyePosition().vectorTo(this.getEyePosition()).normalize();
Vec3 addVec = lookVec.add(toVec.scale(-0.85)).normalize();
double angle = Mth.abs((float) VectorTool.calculateAngle(lookVec, toVec));
setDeltaMovement(getDeltaMovement().add(addVec.scale(Math.min(0.1 + 0.15 * angle, tickCount < 15 ? 0.04 : 0.2))));
setDeltaMovement(getDeltaMovement().add(addVec.scale(Math.min(0.1 + 0.15 * angle + distanceTo(getOwner()) * 0.003, tickCount < 15 ? 0.04 : 0.4))));
// 控制速度
if (this.getDeltaMovement().length() < 2.1) {
if (this.getDeltaMovement().length() < 2.8) {
this.setDeltaMovement(this.getDeltaMovement().multiply(1.06, 1.06, 1.06));
}
if (this.getDeltaMovement().length() > 2.4) {
if (this.getDeltaMovement().length() > 3) {
this.setDeltaMovement(this.getDeltaMovement().multiply(0.9, 0.9, 0.9));
}

View file

@ -201,6 +201,11 @@ public class Bmp2Entity extends ContainerMobileEntity implements GeoEntity, ICha
return true;
}
@Override
protected void playStepSound(BlockPos pPos, BlockState pState) {
this.playSound(ModSounds.BMP_STEP.get(), Mth.abs(this.entityData.get(POWER)) * 8, random.nextFloat() * 0.15f + 1f);
}
public double getSubmergedHeight(Entity entity) {
for (FluidType fluidType : ForgeRegistries.FLUID_TYPES.get().getValues()) {
if (entity.level().getFluidState(entity.blockPosition()).getFluidType() == fluidType)
@ -319,7 +324,7 @@ public class Bmp2Entity extends ContainerMobileEntity implements GeoEntity, ICha
this.setDeltaMovement(this.getDeltaMovement().multiply(f0, 0.85, f0));
} else if (this.isInWater()) {
float f1 = 0.74f + 0.09f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90;
float f1 = 0.61f + 0.08f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90;
this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.04 * this.getDeltaMovement().horizontalDistance())));
this.setDeltaMovement(this.getDeltaMovement().multiply(f1, 0.85, f1));
} else {

View file

@ -123,6 +123,11 @@ public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, IC
this.entityData.set(LOADED_COAX_AMMO, compound.getInt("LoadedCoaxAmmo"));
}
@Override
protected void playStepSound(BlockPos pPos, BlockState pState) {
this.playSound(ModSounds.BMP_STEP.get(), Mth.abs(this.entityData.get(POWER)) * 3, random.nextFloat() * 0.15f + 1.05f);
}
@Override
public Packet<ClientGamePacketListener> getAddEntityPacket() {
return NetworkHooks.getEntitySpawningPacket(this);

View file

@ -565,6 +565,6 @@ public class SpeedboatEntity extends ContainerMobileEntity implements GeoEntity,
@Override
public int zoomFov() {
return 3;
return 1;
}
}

View file

@ -9,6 +9,7 @@ import com.atsuishio.superbwarfare.init.ModSounds;
import com.atsuishio.superbwarfare.tools.CustomExplosion;
import com.atsuishio.superbwarfare.tools.EntityFindUtil;
import com.atsuishio.superbwarfare.tools.ParticleTool;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientGamePacketListener;
@ -30,6 +31,7 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PlayMessages;
@ -80,6 +82,11 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity {
this.entityData.set(MELON, compound.getBoolean("Melon"));
}
@Override
protected void playStepSound(BlockPos pPos, BlockState pState) {
this.playSound(ModSounds.WHEEL_STEP.get(), (float) (getDeltaMovement().length() * 0.5), random.nextFloat() * 0.1f + 1f);
}
@Override
public Packet<ClientGamePacketListener> getAddEntityPacket() {
return NetworkHooks.getEntitySpawningPacket(this);
@ -312,7 +319,7 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity {
if (entityData.get(MELON)) {
CustomExplosion explosion = new CustomExplosion(this.level(), this,
ModDamageTypes.causeCustomExplosionDamage(this.level().registryAccess(), this, attacker), VehicleConfig.TOM_6_BOMB_EXPLOSION_DAMAGE.get(),
this.getX(), this.getY(), this.getZ(), VehicleConfig.TOM_6_BOMB_EXPLOSION_DAMAGE.get(), ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1);
this.getX(), this.getY(), this.getZ(), VehicleConfig.TOM_6_BOMB_EXPLOSION_RADIUS.get().floatValue(), ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1);
explosion.explode();
ForgeEventFactory.onExplosionStart(this.level(), explosion);
explosion.finalizeExplosion(false);

View file

@ -9,6 +9,7 @@ import com.atsuishio.superbwarfare.tools.CustomExplosion;
import com.atsuishio.superbwarfare.tools.EntityFindUtil;
import com.atsuishio.superbwarfare.tools.ParticleTool;
import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientGamePacketListener;
@ -24,6 +25,7 @@ import net.minecraft.world.entity.animal.WaterAnimal;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PlayMessages;
@ -83,6 +85,11 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity {
super.readAdditionalSaveData(compound);
}
@Override
protected void playStepSound(BlockPos pPos, BlockState pState) {
this.playSound(ModSounds.WHEEL_STEP.get(), (float) (getDeltaMovement().length() * 0.5), random.nextFloat() * 0.15f + 1);
}
@Override
protected float getEyeHeight(Pose pPose, EntityDimensions pSize) {
return 0.75F;

View file

@ -60,7 +60,7 @@ public class ClientSoundHandler {
if (e instanceof Lav150Entity lav150) {
distanceReduce = (float) Math.max((1 - distance / 64), 0);
if (player.getVehicle() == lav150) {
player.playSound(ModSounds.LAV_ENGINE_1P.get(), 2 * (Mth.abs(mobileVehicle.getEntityData().get(POWER)) - 0.006f), (float) ((2 * Math.random() - 1) * 0.1f + 0.95f));
player.playSound(ModSounds.LAV_ENGINE_1P.get(), 1 * (Mth.abs(mobileVehicle.getEntityData().get(POWER)) - 0.006f), (float) ((2 * Math.random() - 1) * 0.1f + 0.95f));
} else {
player.level().playLocalSound(BlockPos.containing(engineSoundPos), engineSound, mobileVehicle.getSoundSource(), 5 * (Mth.abs(mobileVehicle.getEntityData().get(POWER)) - 0.006f) * distanceReduce * distanceReduce, (float) ((2 * Math.random() - 1) * 0.1f + 1), false);
}
@ -68,7 +68,7 @@ public class ClientSoundHandler {
if (e instanceof Bmp2Entity bmp2) {
distanceReduce = (float) Math.max((1 - distance / 64), 0);
if (player.getVehicle() == bmp2) {
player.playSound(ModSounds.BMP_ENGINE_1P.get(), 2 * (Mth.abs(mobileVehicle.getEntityData().get(POWER)) + Mth.abs(0.08f * mobileVehicle.getEntityData().get(DELTA_ROT)) - 0.004f), (float) ((2 * Math.random() - 1) * 0.1f + 0.95f));
player.playSound(ModSounds.BMP_ENGINE_1P.get(), 1 * (Mth.abs(mobileVehicle.getEntityData().get(POWER)) + Mth.abs(0.08f * mobileVehicle.getEntityData().get(DELTA_ROT)) - 0.004f), (float) ((2 * Math.random() - 1) * 0.1f + 0.95f));
} else {
player.level().playLocalSound(BlockPos.containing(engineSoundPos), engineSound, mobileVehicle.getSoundSource(), 5 * (Mth.abs(mobileVehicle.getEntityData().get(POWER)) + Mth.abs(0.08f * mobileVehicle.getEntityData().get(DELTA_ROT)) - 0.004f) * distanceReduce * distanceReduce, (float) ((2 * Math.random() - 1) * 0.1f + 1), false);
}

View file

@ -57,7 +57,13 @@ public class LivingEventHandler {
public static void onEntityAttacked(LivingAttackEvent event) {
if (!event.getSource().is(ModDamageTypes.VEHICLE_EXPLOSION) && event.getEntity().getVehicle() instanceof VehicleEntity vehicle) {
if (event.getEntity().getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.hidePassenger()) {
vehicle.hurt(event.getSource(),event.getAmount());
if (!(event.getSource().is(DamageTypes.EXPLOSION)
|| event.getSource().is(DamageTypes.PLAYER_EXPLOSION)
|| event.getSource().is(ModDamageTypes.CUSTOM_EXPLOSION)
|| event.getSource().is(ModDamageTypes.MINE)
|| event.getSource().is(ModDamageTypes.PROJECTILE_BOOM))) {
vehicle.hurt(event.getSource(),event.getAmount());
}
event.setCanceled(true);
}
}
@ -103,7 +109,14 @@ public class LivingEventHandler {
event.setCanceled(true);
}
} else {
vehicle.hurt(event.getSource(),0.7f * event.getAmount());
if (!(event.getSource().is(DamageTypes.EXPLOSION)
|| event.getSource().is(DamageTypes.PLAYER_EXPLOSION)
|| event.getSource().is(ModDamageTypes.CUSTOM_EXPLOSION)
|| event.getSource().is(ModDamageTypes.MINE)
|| event.getSource().is(ModDamageTypes.PROJECTILE_BOOM))) {
vehicle.hurt(event.getSource(),0.7f * event.getAmount());
}
event.setAmount(0.3f * event.getAmount());
}
}

View file

@ -126,6 +126,7 @@ public class ModItems {
public static final RegistryObject<Item> MOTOR = ITEMS.register("motor", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> LARGE_MOTOR = ITEMS.register("large_motor", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> WHEEL = ITEMS.register("wheel", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> TRACK = ITEMS.register("track", () -> new Item(new Item.Properties()));
public static final RegistryObject<Item> DRONE = ITEMS.register("drone", Drone::new);
public static final RegistryObject<Item> MONITOR = ITEMS.register("monitor", Monitor::new);
@ -233,6 +234,7 @@ public class ModItems {
public static final RegistryObject<Item> MLE_1934_BLUEPRINT = ITEMS.register("mle_1934_blueprint", () -> new BlueprintItem(RarityTool.LEGENDARY));
public static final RegistryObject<Item> ANNIHILATOR_BLUEPRINT = ITEMS.register("annihilator_blueprint", () -> new BlueprintItem(RarityTool.LEGENDARY));
public static final RegistryObject<Item> LIGHT_ARMAMENT_MODULE = ITEMS.register("light_armament_module", () -> new BlueprintItem(Rarity.RARE));
public static final RegistryObject<Item> MEDIUM_ARMAMENT_MODULE = ITEMS.register("medium_armament_module", () -> new BlueprintItem(Rarity.EPIC));
/**
* Block

View file

@ -410,6 +410,7 @@ public class ModSounds {
public static final RegistryObject<SoundEvent> BMP_MISSILE_FIRE_1P = REGISTRY.register("bmp_missile_fire_1p", () -> SoundEvent.createVariableRangeEvent(ModUtils.loc("bmp_missile_fire_1p")));
public static final RegistryObject<SoundEvent> BMP_MISSILE_FIRE_3P = REGISTRY.register("bmp_missile_fire_3p", () -> SoundEvent.createVariableRangeEvent(ModUtils.loc("bmp_missile_fire_3p")));
public static final RegistryObject<SoundEvent> BMP_MISSILE_RELOAD = REGISTRY.register("bmp_missile_reload", () -> SoundEvent.createVariableRangeEvent(ModUtils.loc("bmp_missile_reload")));
public static final RegistryObject<SoundEvent> BMP_STEP = REGISTRY.register("bmp_step", () -> SoundEvent.createVariableRangeEvent(ModUtils.loc("bmp_step")));
public static final RegistryObject<SoundEvent> WHEEL_STEP = REGISTRY.register("wheel_step", () -> SoundEvent.createVariableRangeEvent(ModUtils.loc("wheel_step")));
}

View file

@ -194,6 +194,7 @@
"item.superbwarfare.motor": "Motor",
"item.superbwarfare.large_motor": "Large Motor",
"item.superbwarfare.wheel": "Wheel",
"item.superbwarfare.track": "Track",
"item.superbwarfare.hand_grenade": "Hand Grenade",
"item.superbwarfare.rgo_grenade": "RGO Grenade",
"item.superbwarfare.transcript": "Transcript",
@ -203,6 +204,7 @@
"des.superbwarfare.transcript.total": "Total: ",
"item.superbwarfare.beam_test": "[ZzzzBoom!]",
"item.superbwarfare.light_armament_module": "Light Armament Module",
"item.superbwarfare.medium_armament_module": "Medium Armament Module",
"attribute.superbwarfare.bullet_resistance": "Bullet Resistance",

View file

@ -194,6 +194,7 @@
"item.superbwarfare.motor": "马达",
"item.superbwarfare.large_motor": "大型电动机",
"item.superbwarfare.wheel": "车轮",
"item.superbwarfare.track": "履带",
"item.superbwarfare.hand_grenade": "M67手榴弹",
"item.superbwarfare.rgo_grenade": "RGO手榴弹",
"item.superbwarfare.transcript": "成绩单",
@ -203,6 +204,7 @@
"des.superbwarfare.transcript.total": "总环数:",
"item.superbwarfare.beam_test": "[滋崩]",
"item.superbwarfare.light_armament_module": "轻型武装模块",
"item.superbwarfare.medium_armament_module": "中型武装模块",
"attribute.superbwarfare.bullet_resistance": "子弹防护",

View file

@ -2811,5 +2811,21 @@
"stream": false
}
]
},
"bmp_step": {
"sounds": [
{
"name": "superbwarfare:bmp/bmp_step",
"stream": false
}
]
},
"wheel_step": {
"sounds": [
{
"name": "superbwarfare:wheel_step",
"stream": false
}
]
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

View file

@ -20,7 +20,7 @@
"item": "minecraft:compass"
},
"e": {
"item":"superbwarfare:steel_block"
"tag": "forge:storage_blocks/steel"
},
"f": {
"item": "minecraft:chest"

View file

@ -0,0 +1,37 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
"dbf",
"eee",
"hgh"
],
"key": {
"b": {
"item": "superbwarfare:light_armament_module"
},
"d": {
"item": "superbwarfare:cell"
},
"e": {
"tag": "forge:storage_blocks/steel"
},
"f": {
"item": "superbwarfare:medium_armament_module"
},
"g": {
"item": "superbwarfare:large_motor"
},
"h": {
"item": "superbwarfare:track"
}
},
"result": {
"item": "superbwarfare:container",
"nbt": {
"BlockEntityTag": {
"EntityType": "superbwarfare:bmp_2"
}
}
}
}

View file

@ -0,0 +1,13 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"item": "superbwarfare:javelin_missile"
}
],
"result": {
"item": "superbwarfare:wire_guide_missile",
"count": 1
}
}

View file

@ -14,7 +14,7 @@
"item": "superbwarfare:cell"
},
"e": {
"item":"superbwarfare:steel_block"
"tag": "forge:storage_blocks/steel"
},
"f": {
"item": "minecraft:chest"

View file

@ -0,0 +1,27 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
"ddd",
"abc",
"ddd"
],
"key": {
"a": {
"item": "superbwarfare:cemented_carbide_barrel"
},
"b": {
"item": "superbwarfare:epic_material_pack"
},
"c": {
"item": "superbwarfare:light_armament_module"
},
"d": {
"item":"superbwarfare:cemented_carbide_ingot"
}
},
"result": {
"item": "superbwarfare:medium_armament_module",
"count": 1
}
}

View file

@ -11,7 +11,7 @@
"item": "minecraft:copper_ingot"
},
"b": {
"item": "minecraft:blast_furnace"
"item": "minecraft:hopper"
},
"c": {
"item": "minecraft:iron_ingot"

View file

@ -4,7 +4,7 @@
"pattern": [
"aaa",
"aba",
"cdc"
" c "
],
"key": {
"a": {
@ -14,10 +14,7 @@
"item": "superbwarfare:cell"
},
"c": {
"item": "superbwarfare:wheel"
},
"d": {
"item": "minecraft:dropper"
"item": "minecraft:minecart"
}
},
"result": {

View file

@ -0,0 +1,24 @@
{
"type": "minecraft:crafting_shaped",
"category": "equipment",
"pattern": [
"aaa",
"bcb",
"aaa"
],
"key": {
"a": {
"tag":"forge:ingots/steel"
},
"b": {
"item": "superbwarfare:wheel"
},
"c": {
"tag": "forge:storage_blocks/steel"
}
},
"result": {
"item": "superbwarfare:track",
"count": 1
}
}

View file

@ -0,0 +1,13 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"item": "superbwarfare:wire_guide_missile"
}
],
"result": {
"item": "superbwarfare:javelin_missile",
"count": 1
}
}