Rendering Fixes and Logic Fixes for all Energy Abilities

This commit is contained in:
Kam committed 2026-02-19 19:27:56 -05:00
1 parent 024718e7f4
commit f7d0fbcf33
23 files changed
+276 -109

No files matched your search

@@ -716,7 +716,8 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) {
this.zoneType = ZoneType.values()[nbt.getInteger("ZoneType")];
int zoneTypeOrd = nbt.getInteger("ZoneType");
this.zoneType = (zoneTypeOrd >= 0 && zoneTypeOrd < ZoneType.values().length) ? ZoneType.values()[zoneTypeOrd] : ZoneType.TRAP;
try {
this.shape = ZoneShape.valueOf(nbt.getString("ShapeName"));
} catch (Exception e) {
@@ -724,17 +725,17 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
}
this.ownerEntityId = nbt.getInteger("OwnerId");
this.radius = nbt.getFloat("Radius");
this.durationTicks = nbt.getInteger("Duration");
this.maxTicks = nbt.getInteger("MaxTicks");
this.innerColor = nbt.getInteger("InnerColor");
this.outerColor = nbt.getInteger("OuterColor");
this.outerColorEnabled = nbt.getBoolean("OuterColorEnabled");
this.zoneHeight = nbt.getFloat("ZoneHeight");
this.particleDensity = nbt.getFloat("ParticleDensity");
this.particleScale = nbt.getFloat("ParticleScale");
this.animSpeed = nbt.getFloat("AnimSpeed");
this.lightningDensity = nbt.getFloat("LightningDensity");
this.radius = nbt.hasKey("Radius") ? nbt.getFloat("Radius") : 4.0f;
this.durationTicks = nbt.hasKey("Duration") ? nbt.getInteger("Duration") : 200;
this.maxTicks = nbt.hasKey("MaxTicks") ? nbt.getInteger("MaxTicks") : 200;
this.innerColor = nbt.hasKey("InnerColor") ? nbt.getInteger("InnerColor") : 0xFF6600;
this.outerColor = nbt.hasKey("OuterColor") ? nbt.getInteger("OuterColor") : 0xFF0000;
this.outerColorEnabled = !nbt.hasKey("OuterColorEnabled") || nbt.getBoolean("OuterColorEnabled");
this.zoneHeight = nbt.hasKey("ZoneHeight") ? nbt.getFloat("ZoneHeight") : 2.0f;
this.particleDensity = nbt.hasKey("ParticleDensity") ? nbt.getFloat("ParticleDensity") : 1.0f;
this.particleScale = nbt.hasKey("ParticleScale") ? nbt.getFloat("ParticleScale") : 1.0f;
this.animSpeed = nbt.hasKey("AnimSpeed") ? nbt.getFloat("AnimSpeed") : 1.0f;
this.lightningDensity = nbt.hasKey("LightningDensity") ? nbt.getFloat("LightningDensity") : 1.0f;
this.deathWorldTime = nbt.getLong("DeathWorldTime");
// Visual layer fields
@@ -764,8 +765,9 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
this.visible = nbt.getBoolean("Visible");
// Hazard
this.damagePerSecond = nbt.getFloat("DamagePerSecond");
this.damageInterval = nbt.getInteger("DamageInterval");
this.damagePerSecond = nbt.hasKey("DamagePerSecond") ? nbt.getFloat("DamagePerSecond") : 1.0f;
this.damageInterval = nbt.hasKey("DamageInterval") ? nbt.getInteger("DamageInterval") : 20;
if (damageInterval <= 0) damageInterval = 1;
this.ignoreInvulnFrames = nbt.getBoolean("IgnoreInvuln");
this.affectsCaster = nbt.getBoolean("AffectsCaster");
@@ -893,7 +895,8 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
@Override
public void readSpawnData(ByteBuf buffer) {
this.zoneType = ZoneType.values()[buffer.readInt()];
int zoneTypeOrd = buffer.readInt();
this.zoneType = (zoneTypeOrd >= 0 && zoneTypeOrd < ZoneType.values().length) ? ZoneType.values()[zoneTypeOrd] : ZoneType.TRAP;
String shapeName = ByteBufUtils.readUTF8String(buffer);
try {
this.shape = ZoneShape.valueOf(shapeName);