Add ranged invincibility toggle for NPC projectiles

This commit is contained in:
Kam committed 2025-10-21 17:52:48 -04:00
1 parent aaa07eeec6
commit 58437e0bbf
7 files changed
+51 -6

No files matched your search

+6
View File
@@ -53,6 +53,7 @@ public class DataStats {
public boolean playBurstSound = true; // Internal Only
public byte aimType = 0;
public boolean projectilesKeepTerrain = false;
public boolean projectileInvincibility = true;
public EnumCreatureAttribute creatureType = EnumCreatureAttribute.UNDEFINED;
@@ -116,6 +117,7 @@ public class DataStats {
compound.setBoolean("FiringSoundBegin", onSoundBegin);
compound.setByte("AimType", aimType);
compound.setBoolean("ProjectilesKeepTerrain", projectilesKeepTerrain);
compound.setBoolean("ProjectileInvincibility", projectileInvincibility);
if (pTrail == EnumParticleType.Custom)
compound.setTag("pCustom", pCustom.writeToNBT());
if (pEffect == EnumPotionType.Fire)
@@ -185,6 +187,10 @@ public class DataStats {
onSoundBegin = compound.getBoolean("FiringSoundBegin");
aimType = compound.getByte("AimType");
projectilesKeepTerrain = compound.getBoolean("ProjectilesKeepTerrain");
if (compound.hasKey("ProjectileInvincibility"))
projectileInvincibility = compound.getBoolean("ProjectileInvincibility");
else
projectileInvincibility = true;
if (pTrail == EnumParticleType.Custom)
pCustom = ScriptParticle.fromNBT(compound.getCompoundTag("pCustom"));
if (pEffect == EnumPotionType.Fire)