Dome, Panel Settings

This commit is contained in:
Kam committed 2026-02-20 18:16:52 -05:00
1 parent 14545818bd
commit f620e820e8
16 files changed
+752 -146

No files matched your search

@@ -31,6 +31,11 @@ public class EnergyBarrierData {
public boolean meleeEnabled = false;
public float meleeDamageMultiplier = 1.0f;
// Jail settings (dome only - captures entities inside at spawn)
public boolean jailEnabled = false;
public boolean damageProtection = false;
public float jailThreshold = 0.9f;
/**
* Per-projectile-type damage multipliers.
* Key is the ability typeId (e.g., "ability.cnpc.orb", "ability.cnpc.beam").
@@ -144,6 +149,9 @@ public class EnergyBarrierData {
nbt.setInteger("barrierKnockbackTarget", knockbackTarget);
nbt.setBoolean("barrierMelee", meleeEnabled);
nbt.setFloat("barrierMeleeMult", meleeDamageMultiplier);
nbt.setBoolean("barrierJail", jailEnabled);
nbt.setBoolean("barrierDmgProtect", damageProtection);
nbt.setFloat("barrierJailThreshold", jailThreshold);
NBTTagCompound multNbt = new NBTTagCompound();
for (Map.Entry<String, Float> entry : damageMultipliers.entrySet()) {
@@ -163,6 +171,9 @@ public class EnergyBarrierData {
knockbackTarget = nbt.hasKey("barrierKnockbackTarget") ? nbt.getInteger("barrierKnockbackTarget") : 0;
meleeEnabled = nbt.hasKey("barrierMelee") && nbt.getBoolean("barrierMelee");
meleeDamageMultiplier = nbt.hasKey("barrierMeleeMult") ? nbt.getFloat("barrierMeleeMult") : 1.0f;
jailEnabled = nbt.hasKey("barrierJail") && nbt.getBoolean("barrierJail");
damageProtection = nbt.hasKey("barrierDmgProtect") && nbt.getBoolean("barrierDmgProtect");
jailThreshold = nbt.hasKey("barrierJailThreshold") ? nbt.getFloat("barrierJailThreshold") : 0.9f;
damageMultipliers.clear();
if (nbt.hasKey("barrierMultipliers")) {
@@ -183,6 +194,9 @@ public class EnergyBarrierData {
copy.knockbackTarget = knockbackTarget;
copy.meleeEnabled = meleeEnabled;
copy.meleeDamageMultiplier = meleeDamageMultiplier;
copy.jailEnabled = jailEnabled;
copy.damageProtection = damageProtection;
copy.jailThreshold = jailThreshold;
copy.damageMultipliers = new HashMap<>(damageMultipliers);
return copy;
}
@@ -135,5 +135,14 @@ public class AbilityDome extends AbilityEnergyBarrier {
.range(1.0f, 50.0f));
defs.add(FieldDef.boolField("ability.followCaster", this::isFollowCaster, this::setFollowCaster)
.hover("ability.hover.followCaster"));
// Jail & protection section (dome-only: only enclosures can jail)
defs.add(FieldDef.section("ability.section.jail"));
defs.add(FieldDef.boolField("ability.jailEnabled", this::isJailEnabled, this::setJailEnabled)
.hover("ability.hover.jailEnabled"));
defs.add(FieldDef.floatField("ability.jailThreshold", this::getJailThreshold, this::setJailThreshold)
.range(0.1f, 1.0f).visibleWhen(this::isJailEnabled));
defs.add(FieldDef.boolField("ability.damageProtection", this::isDamageProtection, this::setDamageProtection)
.hover("ability.hover.damageProtection"));
}
}
@@ -232,6 +232,31 @@ public abstract class AbilityEnergyBarrier extends AbilityEnergy {
barrierData.meleeDamageMultiplier = mult;
}
// Jail data
public boolean isJailEnabled() {
return barrierData.jailEnabled;
}
public void setJailEnabled(boolean enabled) {
barrierData.jailEnabled = enabled;
}
public boolean isDamageProtection() {
return barrierData.damageProtection;
}
public void setDamageProtection(boolean enabled) {
barrierData.damageProtection = enabled;
}
public float getJailThreshold() {
return barrierData.jailThreshold;
}
public void setJailThreshold(float threshold) {
barrierData.jailThreshold = Math.max(0.1f, Math.min(1.0f, threshold));
}
// ==================== GUI ====================
@SideOnly(Side.CLIENT)