2026-02-17 14:32:13 -05:00
|
|
|
package noppes.npcs.scripted.entity;
|
|
|
|
|
|
|
|
|
|
import kamkeel.npcs.entity.EntityEnergyBarrier;
|
|
|
|
|
import kamkeel.npcs.entity.EntityEnergyDome;
|
|
|
|
|
import noppes.npcs.api.entity.IEnergyBarrier;
|
|
|
|
|
import noppes.npcs.scripted.constants.EntityType;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Base script wrapper for energy barrier entities (Dome, Panel).
|
|
|
|
|
* All shared methods delegate directly to EntityEnergyBarrier base.
|
|
|
|
|
*/
|
|
|
|
|
public class ScriptEnergyBarrier<T extends EntityEnergyBarrier> extends ScriptEnergyAbility<T> implements IEnergyBarrier {
|
|
|
|
|
|
|
|
|
|
public ScriptEnergyBarrier(T entity) {
|
|
|
|
|
super(entity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getType() {
|
|
|
|
|
return EntityType.ENERGY_BARRIER;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean typeOf(int type) {
|
|
|
|
|
return type == EntityType.ENERGY_BARRIER || super.typeOf(type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ==================== HEALTH ====================
|
|
|
|
|
|
|
|
|
|
public float getCurrentHealth() {
|
|
|
|
|
return entity.getCurrentHealth();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setCurrentHealth(float health) {
|
|
|
|
|
entity.setCurrentHealth(health);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float getHealthPercent() {
|
|
|
|
|
return entity.getHealthPercent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float getMaxHealth() {
|
|
|
|
|
return entity.getBarrierData().maxHealth;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setMaxHealth(float maxHealth) {
|
|
|
|
|
entity.getBarrierData().setMaxHealth(maxHealth);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isUseHealth() {
|
|
|
|
|
return entity.getBarrierData().useHealth;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setUseHealth(boolean useHealth) {
|
|
|
|
|
entity.getBarrierData().useHealth = useHealth;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ==================== DURATION ====================
|
|
|
|
|
|
|
|
|
|
public int getDuration() {
|
|
|
|
|
return entity.getBarrierData().durationTicks;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setDuration(int ticks) {
|
|
|
|
|
entity.getBarrierData().setDurationTicks(ticks);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isUseDuration() {
|
|
|
|
|
return entity.getBarrierData().useDuration;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setUseDuration(boolean useDuration) {
|
|
|
|
|
entity.getBarrierData().useDuration = useDuration;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ==================== STATE (BARRIER-SPECIFIC) ====================
|
|
|
|
|
|
|
|
|
|
public int getTicksAlive() {
|
|
|
|
|
return entity.getTicksAlive();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ==================== BARRIER ====================
|
|
|
|
|
|
2026-02-18 05:13:51 -05:00
|
|
|
public float getDefaultMultiplier() {
|
|
|
|
|
return entity.getBarrierData().defaultMultiplier;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setDefaultMultiplier(float multiplier) {
|
|
|
|
|
entity.getBarrierData().defaultMultiplier = multiplier;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isKnockbackEnabled() {
|
|
|
|
|
return entity.getBarrierData().knockbackEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setKnockbackEnabled(boolean enabled) {
|
|
|
|
|
entity.getBarrierData().knockbackEnabled = enabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float getKnockbackStrength() {
|
|
|
|
|
return entity.getBarrierData().knockbackStrength;
|
|
|
|
|
}
|
2026-02-17 14:32:13 -05:00
|
|
|
|
2026-02-18 05:13:51 -05:00
|
|
|
public void setKnockbackStrength(float strength) {
|
|
|
|
|
entity.getBarrierData().knockbackStrength = strength;
|
|
|
|
|
}
|
2026-02-17 14:32:13 -05:00
|
|
|
|
2026-02-18 05:13:51 -05:00
|
|
|
public int getKnockbackTarget() {
|
|
|
|
|
return entity.getBarrierData().knockbackTarget;
|
|
|
|
|
}
|
2026-02-17 14:32:13 -05:00
|
|
|
|
2026-02-18 05:13:51 -05:00
|
|
|
public void setKnockbackTarget(int target) {
|
|
|
|
|
entity.getBarrierData().knockbackTarget = target;
|
|
|
|
|
}
|
2026-02-17 14:32:13 -05:00
|
|
|
|
|
|
|
|
public int getBarrierType() {
|
|
|
|
|
return entity instanceof EntityEnergyDome ? 0 : 1;
|
|
|
|
|
}
|
|
|
|
|
}
|