Class GameEntity

java.lang.Object
emu.grasscutter.game.entity.GameEntity
Direct Known Subclasses:
EntityAvatar, EntityBaseGadget, EntityMonster, EntityNPC, EntityRegion

public abstract class GameEntity extends Object
  • Field Details

    • id

      protected int id
  • Constructor Details

    • GameEntity

      public GameEntity(Scene scene)
  • Method Details

    • getEntityType

      public int getEntityType()
    • getWorld

      public World getWorld()
    • isAlive

      public boolean isAlive()
    • getLifeState

      public LifeState getLifeState()
    • getMetaOverrideMap

      public it.unimi.dsi.fastutil.objects.Object2FloatMap<String> getMetaOverrideMap()
    • getMetaModifiers

      public it.unimi.dsi.fastutil.ints.Int2ObjectMap<String> getMetaModifiers()
    • getFightProperties

      public abstract it.unimi.dsi.fastutil.ints.Int2FloatMap getFightProperties()
    • getPosition

      public abstract Position getPosition()
    • getRotation

      public abstract Position getRotation()
    • setFightProperty

      public void setFightProperty(FightProperty prop, float value)
    • setFightProperty

      public void setFightProperty(int id, float value)
    • addFightProperty

      public void addFightProperty(FightProperty prop, float value)
    • getFightProperty

      public float getFightProperty(FightProperty prop)
    • hasFightProperty

      public boolean hasFightProperty(FightProperty prop)
    • addAllFightPropsToEntityInfo

      public void addAllFightPropsToEntityInfo(SceneEntityInfoOuterClass.SceneEntityInfo.Builder entityInfo)
    • getMotionInfo

      protected MotionInfoOuterClass.MotionInfo getMotionInfo()
    • heal

      public float heal(float amount)
    • damage

      public void damage(float amount)
    • damage

      public void damage(float amount, int killerId)
    • move

      public void move(Position position, Position rotation)
      Move this entity to a new position.
      Parameters:
      position - The new position.
      rotation - The new rotation.
    • onInteract

      public void onInteract(Player player, GadgetInteractReqOuterClass.GadgetInteractReq interactReq)
      Called when a player interacts with this entity
      Parameters:
      player - Player that is interacting with this entity
      interactReq - 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

      public abstract SceneEntityInfoOuterClass.SceneEntityInfo toProto()
    • getId

      public int getId()
    • getScene

      public Scene getScene()
    • getSpawnEntry

      public SpawnDataEntry getSpawnEntry()
    • setSpawnEntry

      public void setSpawnEntry(SpawnDataEntry spawnEntry)
    • 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

      public MotionStateOuterClass.MotionState getMotionState()
    • setMotionState

      public void setMotionState(MotionStateOuterClass.MotionState motionState)
    • 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)