Package emu.grasscutter.game.entity
Class GameEntity
java.lang.Object
emu.grasscutter.game.entity.GameEntity
- Direct Known Subclasses:
EntityAvatar,EntityBaseGadget,EntityMonster,EntityNPC,EntityRegion
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddFightProperty(FightProperty prop, float value) voiddamage(float amount) voiddamage(float amount, int killerId) intintintabstract it.unimi.dsi.fastutil.ints.Int2FloatMapfloatintintgetId()intintit.unimi.dsi.fastutil.ints.Int2ObjectMap<String>it.unimi.dsi.fastutil.objects.Object2FloatMap<String>protected MotionInfoOuterClass.MotionInfoabstract Positionabstract PositiongetScene()getWorld()booleanfloatheal(float amount) booleanisAlive()booleanisLockHP()voidMove this entity to a new position.voidonCreate()Called when this entity is added to the worldvoidonDeath(int killerId) Called when this entity diesvoidonInteract(Player player, GadgetInteractReqOuterClass.GadgetInteractReq interactReq) Called when a player interacts with this entityvoidvoidsetBlockId(int blockId) voidsetConfigId(int configId) voidsetFightProperty(int id, float value) voidsetFightProperty(FightProperty prop, float value) voidsetGroupId(int groupId) voidsetLastMoveReliableSeq(int lastMoveReliableSeq) voidsetLastMoveSceneTimeMs(int lastMoveSceneTimeMs) voidsetLockHP(boolean lockHP) voidsetMotionState(MotionStateOuterClass.MotionState motionState) voidsetSpawnEntry(SpawnDataEntry spawnEntry) toProto()
-
Field Details
-
id
protected int id
-
-
Constructor Details
-
GameEntity
-
-
Method Details
-
getEntityType
public int getEntityType() -
getWorld
-
isAlive
public boolean isAlive() -
getLifeState
-
getMetaOverrideMap
-
getMetaModifiers
-
getFightProperties
public abstract it.unimi.dsi.fastutil.ints.Int2FloatMap getFightProperties() -
getPosition
-
getRotation
-
setFightProperty
-
setFightProperty
public void setFightProperty(int id, float value) -
addFightProperty
-
getFightProperty
-
hasFightProperty
-
addAllFightPropsToEntityInfo
public void addAllFightPropsToEntityInfo(SceneEntityInfoOuterClass.SceneEntityInfo.Builder entityInfo) -
getMotionInfo
-
heal
public float heal(float amount) -
damage
public void damage(float amount) -
damage
public void damage(float amount, int killerId) -
move
Move this entity to a new position.- Parameters:
position- The new position.rotation- The new rotation.
-
onInteract
Called when a player interacts with this entity- Parameters:
player- Player that is interacting with this entityinteractReq- Interact request protobuf data
-
onCreate
public void onCreate()Called when this entity is added to the world -
onRemoved
public void onRemoved() -
onDeath
public void onDeath(int killerId) Called when this entity dies- Parameters:
killerId- Entity id of the entity that killed this entity
-
toProto
-
getId
public int getId() -
getScene
-
getSpawnEntry
-
setSpawnEntry
-
getBlockId
public int getBlockId() -
setBlockId
public void setBlockId(int blockId) -
getConfigId
public int getConfigId() -
setConfigId
public void setConfigId(int configId) -
getGroupId
public int getGroupId() -
setGroupId
public void setGroupId(int groupId) -
getMotionState
-
setMotionState
-
getLastMoveSceneTimeMs
public int getLastMoveSceneTimeMs() -
setLastMoveSceneTimeMs
public void setLastMoveSceneTimeMs(int lastMoveSceneTimeMs) -
getLastMoveReliableSeq
public int getLastMoveReliableSeq() -
setLastMoveReliableSeq
public void setLastMoveReliableSeq(int lastMoveReliableSeq) -
isLockHP
public boolean isLockHP() -
setLockHP
public void setLockHP(boolean lockHP)
-