添加bmp2LOD,修复炮弹会被草丛挡住的bug
This commit is contained in:
parent
790c0a93bc
commit
620e92e0a4
6 changed files with 8978 additions and 21 deletions
|
@ -2,7 +2,9 @@ package com.atsuishio.superbwarfare.client.model.entity;
|
|||
|
||||
import com.atsuishio.superbwarfare.Mod;
|
||||
import com.atsuishio.superbwarfare.entity.vehicle.Bmp2Entity;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import software.bernie.geckolib.model.GeoModel;
|
||||
|
||||
public class Bmp2Model extends GeoModel<Bmp2Entity> {
|
||||
|
@ -14,20 +16,21 @@ public class Bmp2Model extends GeoModel<Bmp2Entity> {
|
|||
|
||||
@Override
|
||||
public ResourceLocation getModelResource(Bmp2Entity entity) {
|
||||
return Mod.loc("geo/bmp2.geo.json");
|
||||
// Player player = Minecraft.getInstance().player;
|
||||
//
|
||||
// int distance = 0;
|
||||
//
|
||||
// if (player != null) {
|
||||
// distance = (int) player.position().distanceTo(entity.position());
|
||||
// }
|
||||
//
|
||||
// if (distance < 32) {
|
||||
// return ModUtils.loc("geo/Bmp2.geo.json");
|
||||
// } else {
|
||||
// return ModUtils.loc("geo/speedboat.lod1.geo.json");
|
||||
// }
|
||||
Player player = Minecraft.getInstance().player;
|
||||
|
||||
int distance = 0;
|
||||
|
||||
if (player != null) {
|
||||
distance = (int) player.position().distanceTo(entity.position());
|
||||
}
|
||||
|
||||
if (distance < 32 || player.isScoping()) {
|
||||
return Mod.loc("geo/bmp2.geo.json");
|
||||
} else if (distance < 96) {
|
||||
return Mod.loc("geo/vehicle_lod/bmp2.lod1.geo.json");
|
||||
} else {
|
||||
return Mod.loc("geo/vehicle_lod/bmp2.lod2.geo.json");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -198,11 +198,7 @@ public class Agm65Entity extends FastThrowableProjectile implements GeoEntity, E
|
|||
explosion.explode();
|
||||
EventHooks.onExplosionStart(this.level(), explosion);
|
||||
explosion.finalizeExplosion(false);
|
||||
if (explosionRadius > 9) {
|
||||
ParticleTool.spawnHugeExplosionParticles(this.level(), vec3);
|
||||
} else {
|
||||
ParticleTool.spawnMediumExplosionParticles(this.level(), vec3);
|
||||
}
|
||||
ParticleTool.spawnHugeExplosionParticles(this.level(), vec3);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -93,7 +93,9 @@ public abstract class FastThrowableProjectile extends ThrowableItemProjectile im
|
|||
double resistance = 1 - Mth.clamp(hardness / 100, 0, 0.8);
|
||||
setDeltaMovement(getDeltaMovement().multiply(resistance, resistance, resistance));
|
||||
|
||||
durability -= 10 + (int) (0.5 * hardness);
|
||||
if (blockState.canOcclude()) {
|
||||
durability -= 10 + (int) (0.5 * hardness);
|
||||
}
|
||||
|
||||
if (hardness <= durability && hardness != -1) {
|
||||
this.level().destroyBlock(pos, true);
|
||||
|
|
|
@ -501,7 +501,7 @@ public class A10Entity extends ContainerMobileVehicleEntity implements GeoEntity
|
|||
}
|
||||
|
||||
if (getEnergy() > 0 && !this.level().isClientSide) {
|
||||
this.consumeEnergy((int) (Mth.abs(this.entityData.get(POWER)) * VehicleConfig.A_10_MAX_ENERGY_COST.get()));
|
||||
this.consumeEnergy((int) (Mth.abs(this.entityData.get(POWER)) * 5 * VehicleConfig.A_10_MAX_ENERGY_COST.get()));
|
||||
}
|
||||
|
||||
float rotSpeed = 1.5f + 2 * Mth.abs(VectorTool.calculateY(getRoll()));
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue