diff --git a/java/noppes/npcs/api/entity/IEnergyBarrier.java b/java/noppes/npcs/api/entity/IEnergyBarrier.java index 724364d..243ca1c 100644 --- a/java/noppes/npcs/api/entity/IEnergyBarrier.java +++ b/java/noppes/npcs/api/entity/IEnergyBarrier.java @@ -57,10 +57,72 @@ public interface IEnergyBarrier extends IEnergyAbility { void setKnockbackStrength(float strength); + /** + * Returns whether this barrier absorbs damage on behalf of its owner. + * When absorbing is enabled, incoming damage to the barrier's owner is redirected + * to the barrier instead, subject to the absorb radius check. + * + * @return {@code true} if the barrier absorbs the owner's incoming damage + * @see #getAbsorbRadius() + */ boolean isAbsorbing(); + /** + * Sets whether this barrier absorbs damage on behalf of its owner. + * When absorbing is enabled, incoming damage to the barrier's owner is redirected + * to the barrier instead, subject to the absorb radius check. + * + * @param absorbing {@code true} to enable damage absorption for the owner + * @see #setAbsorbRadius(float) + */ void setAbsorbing(boolean absorbing); + /** + * Gets the absorb radius for this barrier. + * The absorb radius determines the maximum distance from the barrier's current + * position at which the owner's incoming damage will still be redirected to the barrier. + * This check uses the barrier entity's live position, so it works correctly with + * moving barriers (following domes, moving walls, shields, etc.). + * + * + * + * @return the absorb radius in blocks, or {@code -1} for unlimited, or {@code 0} for barrier extent + */ + float getAbsorbRadius(); + + /** + * Sets the absorb radius for this barrier. + * The absorb radius determines the maximum distance from the barrier's current + * position at which the owner's incoming damage will still be redirected to the barrier. + * This check uses the barrier entity's live position, so it works correctly with + * moving barriers (following domes, moving walls, shields, etc.). + * + * + * + * @param radius the absorb radius in blocks, or {@code -1} for unlimited, or {@code 0} for barrier extent + */ + void setAbsorbRadius(float radius); + /** * Returns the barrier type: 0=Dome, 1=Panel * @return the barrier type ordinal