Package noppes.npcs.api.entity
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description floatgetAbsorbRadius()Gets the absorb radius for this barrier.intgetBarrierType()Returns the barrier type: 0=Dome, 1=PanelfloatgetCurrentHealth()floatgetDefaultMultiplier()intgetDuration()floatgetHealthPercent()floatgetKnockbackStrength()floatgetMaxHealth()intgetTicksAlive()booleanisAbsorbing()Returns whether this barrier absorbs damage on behalf of its owner.booleanisKnockbackEnabled()booleanisSolid()booleanisUseDuration()booleanisUseHealth()voidsetAbsorbing(boolean absorbing)Sets whether this barrier absorbs damage on behalf of its owner.voidsetAbsorbRadius(float radius)Sets the absorb radius for this barrier.voidsetCurrentHealth(float health)voidsetDefaultMultiplier(float multiplier)voidsetDuration(int ticks)voidsetKnockbackEnabled(boolean enabled)voidsetKnockbackStrength(float strength)voidsetMaxHealth(float maxHealth)voidsetSolid(boolean solid)voidsetUseDuration(boolean useDuration)voidsetUseHealth(boolean useHealth)voidsyncClient()Sends all current visual and barrier-specific data to tracking clients.-
Methods inherited from interface noppes.npcs.api.entity.IEnergyAbility
getChargeProgress, getDamageData, getInnerAlpha, getInnerColor, getLightningDensity, getLightningFadeTime, getLightningRadius, getMagicData, getOuterColor, getOuterColorAlpha, getOuterColorWidth, getOwner, getOwnerEntityId, hasLightningEffect, isCharging, isIgnoreIFrames, isOuterColorEnabled, setDamageData, setIgnoreIFrames, setInnerAlpha, setInnerColor, setLightningDensity, setLightningEffect, setLightningFadeTime, setLightningRadius, setMagicData, setOuterColor, setOuterColorAlpha, setOuterColorEnabled, setOuterColorWidth
-
Methods inherited from interface noppes.npcs.api.entity.IEntity
capturesDrops, clearStoredData, clearTempData, despawn, dropItem, extinguish, getAge, getAllNbt, getBlockX, getBlockY, getBlockZ, getCapturedDrops, getCollidingEntities, getDimension, getEntityId, getHeight, getMCEntity, getMotion, getMotionX, getMotionY, getMotionZ, getMount, getNbt, getNbtOptional, getPitch, getPosition, getRider, getRotation, getStoredData, getStoredDataKeys, getSurroundingEntities, getSurroundingEntities, getTempData, getTempDataKeys, getType, getTypeName, getUniqueID, getWidth, getWorld, getX, getY, getYOffset, getZ, hasCollided, hasCollidedHorizontally, hasCollidedVertically, hasStoredData, hasTempData, inFire, inLava, inWater, isAirborne, isAlive, isBurning, isSneaking, isSprinting, knockback, knockback, knockback, removeStoredData, removeTempData, setBurning, setCapturedDrops, setCapturesDrops, setDimension, setImmune, setInvisible, setMotion, setMotion, setMotionX, setMotionY, setMotionZ, setMount, setNbt, setPitch, setPosition, setPosition, setRider, setRotation, setRotation, setSneaking, setSprinting, setStoredData, setTempData, setX, setY, setZ, spawnParticle, storeAsClone, typeOf, updateEntity
-
-
-
-
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:
trueif 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-trueto 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.0blocks).
- Positive values = The owner must be within this many blocks of the barrier entity.
- Returns:
- the absorb radius in blocks, or
-1for unlimited, or0for 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.0blocks).
- Positive values = The owner must be within this many blocks of the barrier entity.
- Parameters:
radius- the absorb radius in blocks, or-1for unlimited, or0for 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
-
-