Class AbstractIndirectEntityDamageSource
- java.lang.Object
-
- org.spongepowered.api.event.cause.entity.damage.source.common.AbstractIndirectEntityDamageSource
-
- All Implemented Interfaces:
DamageSource
,EntityDamageSource
,IndirectEntityDamageSource
public abstract class AbstractIndirectEntityDamageSource extends Object implements IndirectEntityDamageSource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractIndirectEntityDamageSource.AbstractIndirectEntityDamageSourceBuilder<T extends IndirectEntityDamageSource,B extends IndirectEntityDamageSource.AbstractBuilder<T,B>>
-
Nested classes/interfaces inherited from interface org.spongepowered.api.event.cause.entity.damage.source.DamageSource
DamageSource.DamageSourceBuilder<T extends DamageSource,B extends DamageSource.DamageSourceBuilder<T,B>>, DamageSource.Factory
-
Nested classes/interfaces inherited from interface org.spongepowered.api.event.cause.entity.damage.source.EntityDamageSource
EntityDamageSource.EntityDamageSourceBuilder<T extends EntityDamageSource,B extends EntityDamageSource.EntityDamageSourceBuilder<T,B>>
-
Nested classes/interfaces inherited from interface org.spongepowered.api.event.cause.entity.damage.source.IndirectEntityDamageSource
IndirectEntityDamageSource.AbstractBuilder<T extends IndirectEntityDamageSource,B extends IndirectEntityDamageSource.AbstractBuilder<T,B>>, IndirectEntityDamageSource.Builder
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractIndirectEntityDamageSource(AbstractIndirectEntityDamageSource.AbstractIndirectEntityDamageSourceBuilder<?,?> builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
doesAffectCreative()
Gets whether thisDamageSource
is considered to damage creative, or otherwise "normally unharmable" players.double
exhaustion()
Gets the amount of exhaustion thisDamageSource
will add to the entity, generally only to players.Entity
indirectSource()
Gets theEntity
that is indirectly using theEntityDamageSource.source()
to cause damage.boolean
isAbsolute()
Gets whether thisDamageSource
's damage is absolute and will ignore potion effects and enchantments.boolean
isBypassingArmor()
Gets whether thisDamageSource
will deal damage that bypasses any armor.boolean
isExplosive()
Gets whether thisDamageSource
is an explosion.boolean
isMagic()
Gets whether thisDamageSource
is considered to be magical damage, such as potions, or other sources.boolean
isScaledByDifficulty()
Gets whether thisDamageSource
's damage is scaled byDifficulty
.Entity
source()
Gets theEntity
that is the source.DamageType
type()
Gets theDamageType
of this source.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.spongepowered.api.event.cause.entity.damage.source.DamageSource
isFire
-
-
-
-
Constructor Detail
-
AbstractIndirectEntityDamageSource
protected AbstractIndirectEntityDamageSource(AbstractIndirectEntityDamageSource.AbstractIndirectEntityDamageSourceBuilder<?,?> builder)
-
-
Method Detail
-
source
public Entity source()
Description copied from interface:EntityDamageSource
Gets theEntity
that is the source.- Specified by:
source
in interfaceEntityDamageSource
- Returns:
- The entity source
-
type
public DamageType type()
Description copied from interface:DamageSource
Gets theDamageType
of this source.- Specified by:
type
in interfaceDamageSource
- Returns:
- The damage type
-
isAbsolute
public boolean isAbsolute()
Description copied from interface:DamageSource
Gets whether thisDamageSource
's damage is absolute and will ignore potion effects and enchantments.- Specified by:
isAbsolute
in interfaceDamageSource
- Returns:
- If this damage source deals absolute damage
-
isBypassingArmor
public boolean isBypassingArmor()
Description copied from interface:DamageSource
Gets whether thisDamageSource
will deal damage that bypasses any armor.- Specified by:
isBypassingArmor
in interfaceDamageSource
- Returns:
- True if this damage source bypasses armor
-
isScaledByDifficulty
public boolean isScaledByDifficulty()
Description copied from interface:DamageSource
Gets whether thisDamageSource
's damage is scaled byDifficulty
.- Specified by:
isScaledByDifficulty
in interfaceDamageSource
- Returns:
- True if the damage from this source is scaled
-
isExplosive
public boolean isExplosive()
Description copied from interface:DamageSource
Gets whether thisDamageSource
is an explosion.- Specified by:
isExplosive
in interfaceDamageSource
- Returns:
- True if this damage source is an explosion
-
isMagic
public boolean isMagic()
Description copied from interface:DamageSource
Gets whether thisDamageSource
is considered to be magical damage, such as potions, or other sources.- Specified by:
isMagic
in interfaceDamageSource
- Returns:
- If this damage is magic based
-
doesAffectCreative
public boolean doesAffectCreative()
Description copied from interface:DamageSource
Gets whether thisDamageSource
is considered to damage creative, or otherwise "normally unharmable" players. Usually associated withDamageTypes.VOID
.- Specified by:
doesAffectCreative
in interfaceDamageSource
- Returns:
- If this damage should affect creative players
-
indirectSource
public Entity indirectSource()
Description copied from interface:IndirectEntityDamageSource
Gets theEntity
that is indirectly using theEntityDamageSource.source()
to cause damage.- Specified by:
indirectSource
in interfaceIndirectEntityDamageSource
- Returns:
- The indirect source
-
exhaustion
public double exhaustion()
Description copied from interface:DamageSource
Gets the amount of exhaustion thisDamageSource
will add to the entity, generally only to players.In vanilla gameplay this is set to 0.1 by default and overridden to 0 if the source is set to be absolute or as overriding armor.
- Specified by:
exhaustion
in interfaceDamageSource
- Returns:
- The increase in exhaustion
-
-