Contents
Class DamageCause
java.lang.Object
com.hypixel.hytale.server.core.modules.entity.damage.DamageCause
- All Implemented Interfaces:
JsonAsset<String>, JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, DamageCause>>
public class DamageCause
extends Object
implements JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, DamageCause>>
Represents a cause of damage in the game.
-
Field Summary
FieldsModifier and TypeFieldDescriptionCodec for child assets of type DamageCause.static final AssetBuilderCodec<String, DamageCause> The codec used to parseDamageCauseinstances.static DamageCauseDeprecated.static DamageCauseDeprecated.static DamageCauseDeprecated.static DamageCauseDeprecated.static DamageCauseDeprecated.static DamageCauseDeprecated.static DamageCauseDeprecated.static DamageCauseDeprecated.static final ValidatorCache<String> Validator cache for damage cause assets. -
Constructor Summary
ConstructorsConstructorDescriptionEmpty Constructor for aDamageCauseinstance.DamageCause(String id) Constructor for aDamageCauseinstance.DamageCause(String id, String inherits, boolean durabilityLoss, boolean staminaLoss, boolean bypassResistances) Default Constructor for aDamageCauseinstance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic IndexedLookupTableAssetMap<String, DamageCause> getId()booleanbooleanisOrInherits(DamageCause ancestor) booleantoPacket()
-
Field Details
-
CODEC
The codec used to parseDamageCauseinstances. -
VALIDATOR_CACHE
Validator cache for damage cause assets. -
CHILD_ASSET_CODEC
-
PHYSICAL
Deprecated. -
PROJECTILE
Deprecated. -
COMMAND
Deprecated. -
DROWNING
Deprecated. -
ENVIRONMENT
Deprecated. -
FALL
Deprecated. -
OUT_OF_WORLD
Deprecated. -
SUFFOCATION
Deprecated.
-
-
Constructor Details
-
DamageCause
public DamageCause()Empty Constructor for aDamageCauseinstance.Used by the codec to instantiate
DamageCauseinstances. -
DamageCause
Constructor for aDamageCauseinstance.- Parameters:
id- The asset ID for this damage cause.
-
DamageCause
public DamageCause(@Nonnull String id, @Nonnull String inherits, boolean durabilityLoss, boolean staminaLoss, boolean bypassResistances) Default Constructor for aDamageCauseinstance.- Parameters:
id- The asset ID for this damage cause.inherits- The id of the damage cause this one inherits from.durabilityLoss- Whether this damage cause causes durability loss.staminaLoss- Whether this damage cause causes stamina loss.bypassResistances- Whether this damage cause bypasses resistances.
-
-
Method Details
-
getAssetStore
@Nonnull public static AssetStore<String, DamageCause, IndexedLookupTableAssetMap<String, DamageCause>> getAssetStore()- Returns:
- the asset store for damage causes.
-
getAssetMap
- Returns:
- the asset map for damage causes.
-
getId
-
isDurabilityLoss
public boolean isDurabilityLoss()- Returns:
trueif this damage cause causes durability loss,falseotherwise.
-
isStaminaLoss
public boolean isStaminaLoss()- Returns:
trueif this damage cause causes stamina loss,falseotherwise.
-
doesBypassResistances
public boolean doesBypassResistances()- Returns:
trueif this damage cause bypasses resistances,falseotherwise.
-
getInherits
- Returns:
- the color of the damage text.
-
getAnimationId
- Returns:
- the color of the damage text.
-
getDeathAnimationId
- Returns:
- the color of the damage text.
-
getDeathMessageKey
- Returns:
- the localization key used on the death screen when this damage cause kills a player.
-
resolveDamageTextColor
- Returns:
- the parsed damage text color of this cause, falling back through the
Inheritschain, ornullwhen no cause in the chain declares one.
-
isOrInherits
- Returns:
trueif this damage cause isancestoror inherits from it,falseotherwise.
-
toPacket
-