Interface IEnergyBarrier<T extends net.minecraft.entity.Entity>

  • All Superinterfaces:
    IEnergyAbility<T>, IEntity<T>
    All Known Subinterfaces:
    IEnergyDome<T>, IEnergyPanel<T>

    public interface IEnergyBarrier<T extends net.minecraft.entity.Entity>
    extends IEnergyAbility<T>
    Base interface for energy barrier entities (Dome, Panel). Barriers are defensive structures that block incoming energy projectiles. Extends IEnergyAbility for shared display/lightning/owner/charging methods.
    • Method Detail

      • getCurrentHealth

        float getCurrentHealth()
      • setCurrentHealth

        void setCurrentHealth​(float health)
      • getHealthPercent

        float getHealthPercent()
      • getMaxHealth

        float getMaxHealth()
      • setMaxHealth

        void setMaxHealth​(float maxHealth)
      • isUseHealth

        boolean isUseHealth()
      • setUseHealth

        void setUseHealth​(boolean useHealth)
      • getDuration

        int getDuration()
      • setDuration

        void setDuration​(int ticks)
      • isUseDuration

        boolean isUseDuration()
      • setUseDuration

        void setUseDuration​(boolean useDuration)
      • getTicksAlive

        int getTicksAlive()
      • getDefaultMultiplier

        float getDefaultMultiplier()
      • setDefaultMultiplier

        void setDefaultMultiplier​(float multiplier)
      • isSolid

        boolean isSolid()
      • setSolid

        void setSolid​(boolean solid)
      • isKnockbackEnabled

        boolean isKnockbackEnabled()
      • setKnockbackEnabled

        void setKnockbackEnabled​(boolean enabled)
      • getKnockbackStrength

        float getKnockbackStrength()
      • setKnockbackStrength

        void setKnockbackStrength​(float strength)
      • isAbsorbing

        boolean isAbsorbing()
        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.
        Returns:
        true if the barrier absorbs the owner's incoming damage
        See Also:
        getAbsorbRadius()
      • setAbsorbing

        void setAbsorbing​(boolean absorbing)
        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.
        Parameters:
        absorbing - true to enable damage absorption for the owner
        See Also:
        setAbsorbRadius(float)
      • getAbsorbRadius

        float getAbsorbRadius()
        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.).
        • -1 = No distance limit. Damage is always absorbed regardless of distance.
        • 0 = Uses the barrier's own geometric extent as the effective radius.
          • Domes: the dome radius (sphere radius in blocks).
          • Panels: (max(width, height) * 0.5 + 1.0) * 3 (i.e. max(width, height) * 1.5 + 3.0 blocks).
        • Positive values = The owner must be within this many blocks of the barrier entity.
        Returns:
        the absorb radius in blocks, or -1 for unlimited, or 0 for barrier extent
      • setAbsorbRadius

        void setAbsorbRadius​(float radius)
        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.).
        • -1 = No distance limit. Damage is always absorbed regardless of distance.
        • 0 = Uses the barrier's own geometric extent as the effective radius.
          • Domes: the dome radius (sphere radius in blocks).
          • Panels: (max(width, height) * 0.5 + 1.0) * 3 (i.e. max(width, height) * 1.5 + 3.0 blocks).
        • Positive values = The owner must be within this many blocks of the barrier entity.
        Parameters:
        radius - the absorb radius in blocks, or -1 for unlimited, or 0 for barrier extent
      • getBarrierType

        int getBarrierType()
        Returns the barrier type: 0=Dome, 1=Panel
        Returns:
        the barrier type ordinal
      • syncClient

        void syncClient()
        Sends all current visual and barrier-specific data to tracking clients.

        Call this after making batch changes to properties like colors, alpha, lightning, dome radius, panel dimensions, etc. This sends a single packet instead of one per setter call.

        Example:

         dome.setInnerColor(0xFF0000);
         dome.setDomeRadius(5.0);
         dome.syncClient(); // one packet for all changes