修复二次灾变动画缺失,添加在子弹击中载具精确位置的特效
This commit is contained in:
parent
d6619f3295
commit
5ac84a8938
3 changed files with 9 additions and 2 deletions
|
@ -65,7 +65,9 @@ import java.util.function.BiFunction;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
@SuppressWarnings({"unused", "UnusedReturnValue"})
|
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
|
||||||
|
|
||||||
|
@SuppressWarnings({"unused", "UnusedReturnValue", "SuspiciousNameCombination"})
|
||||||
public class ProjectileEntity extends Projectile implements IEntityWithComplexSpawn, GeoEntity, CustomSyncMotionEntity {
|
public class ProjectileEntity extends Projectile implements IEntityWithComplexSpawn, GeoEntity, CustomSyncMotionEntity {
|
||||||
|
|
||||||
public static final EntityDataAccessor<Float> COLOR_R = SynchedEntityData.defineId(ProjectileEntity.class, EntityDataSerializers.FLOAT);
|
public static final EntityDataAccessor<Float> COLOR_R = SynchedEntityData.defineId(ProjectileEntity.class, EntityDataSerializers.FLOAT);
|
||||||
|
@ -187,6 +189,10 @@ public class ProjectileEntity extends Projectile implements IEntityWithComplexSp
|
||||||
var obbVec = obb.clip(startVec.toVector3f(), endVec.toVector3f()).orElse(null);
|
var obbVec = obb.clip(startVec.toVector3f(), endVec.toVector3f()).orElse(null);
|
||||||
if (obbVec != null) {
|
if (obbVec != null) {
|
||||||
hitPos = new Vec3(obbVec);
|
hitPos = new Vec3(obbVec);
|
||||||
|
if (this.level() instanceof ServerLevel serverLevel) {
|
||||||
|
sendParticle(serverLevel, ModParticleTypes.FIRE_STAR.get(), hitPos.x, hitPos.y, hitPos.z, 2, 0, 0, 0, 0.2, false);
|
||||||
|
sendParticle(serverLevel, ParticleTypes.SMOKE, hitPos.x, hitPos.y, hitPos.z, 3, 0, 0, 0, 0.01, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -229,7 +229,7 @@ public class GunEventHandler {
|
||||||
if (reload.singleReloadStarter.start()) {
|
if (reload.singleReloadStarter.start()) {
|
||||||
NeoForge.EVENT_BUS.post(new ReloadEvent.Pre(player, data));
|
NeoForge.EVENT_BUS.post(new ReloadEvent.Pre(player, data));
|
||||||
|
|
||||||
if (data.defaultPrepareLoadTime() != 0 && data.ammo.get() == 0) {
|
if (data.defaultPrepareLoadTime() != 0 && (data.ammo.get() == 0 || stack.is(ModItems.SECONDARY_CATACLYSM.get()))) {
|
||||||
// 此处判断空仓换弹的时候,是否在准备阶段就需要装填一发,如M870
|
// 此处判断空仓换弹的时候,是否在准备阶段就需要装填一发,如M870
|
||||||
playGunPrepareLoadReloadSounds(player);
|
playGunPrepareLoadReloadSounds(player);
|
||||||
int prepareLoadTime = data.defaultPrepareLoadTime();
|
int prepareLoadTime = data.defaultPrepareLoadTime();
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
"ReloadTypes": [
|
"ReloadTypes": [
|
||||||
"Iterative"
|
"Iterative"
|
||||||
],
|
],
|
||||||
|
"PrepareTime": 31,
|
||||||
"PrepareLoadTime": 31,
|
"PrepareLoadTime": 31,
|
||||||
"PrepareAmmoLoadTime": 3,
|
"PrepareAmmoLoadTime": 3,
|
||||||
"IterativeTime": 20,
|
"IterativeTime": 20,
|
||||||
|
|
Loading…
Add table
Reference in a new issue