Contents
Class BreathingComponent
java.lang.Object
com.hypixel.hytale.server.core.modules.entity.component.BreathingComponent
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
A component that tracks the breathing state of an entity, including the block material
and fluid at the entity's breathing height.
Utilised by the damage systems to apply damage if an entity is suffocating.
-
Field Summary
Fields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()static ComponentType<EntityStore, BreathingComponent> Gets the last block material recorded at the entity's breathing height.intbooleanvoidsetLastBreathingMaterial(BlockMaterial lastBreathingMaterial) Sets the last block material recorded at the entity's breathing height.voidsetLastFluidId(int lastFluidId) Sets the last fluid ID recorded at the entity's breathing height.voidsetSuffocating(boolean suffocating) Sets whether the entity is currently suffocating.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Constructor Details
-
BreathingComponent
public BreathingComponent()
-
-
Method Details
-
getComponentType
-
getLastBreathingMaterial
Gets the last block material recorded at the entity's breathing height.- Returns:
- The last block material at the entity's breathing height, or
nullif not yet recorded.
-
setLastBreathingMaterial
Sets the last block material recorded at the entity's breathing height.- Parameters:
lastBreathingMaterial- The block material at the entity's breathing height.
-
getLastFluidId
public int getLastFluidId()- Returns:
- the last fluid ID at the entity's breathing height.
-
setLastFluidId
public void setLastFluidId(int lastFluidId) Sets the last fluid ID recorded at the entity's breathing height.- Parameters:
lastFluidId- The fluid ID at the entity's breathing height.
-
isSuffocating
public boolean isSuffocating()- Returns:
trueif the entity is suffocating,falseotherwise.
-
setSuffocating
public void setSuffocating(boolean suffocating) Sets whether the entity is currently suffocating.- Parameters:
suffocating- Whether the entity is suffocating.
-
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-