Class EntityBoat

All Implemented Interfaces:
EntityInteractable, EntityRideable, Metadatable, Cloneable
Direct Known Subclasses:
EntityChestBoat

public class EntityBoat extends EntityVehicle
Since:
2016/2/13
Author:
yescallop
  • Field Details

  • Constructor Details

  • Method Details

    • initEntity

      protected void initEntity()
      Description copied from class: Entity
      实体初始化顺序,先初始化Entity类字段->Entity构造函数->进入init方法->调用initEntity方法->子类字段初始化->子类构造函数

      用于初始化实体的NBT和实体字段的方法

      Entity initialization order, first initialize the Entity class field->Entity constructor->Enter the init method->Call the init Entity method-> subclass field initialization-> subclass constructor

      The method used to initialize the NBT and entity fields of the entity

      Overrides:
      initEntity in class Entity
    • getHeight

      public float getHeight()
      Description copied from class: Entity
      实体高度

      entity Height

      Overrides:
      getHeight in class Entity
      Returns:
      the height
    • getWidth

      public float getWidth()
      Overrides:
      getWidth in class Entity
    • getDrag

      protected float getDrag()
      Overrides:
      getDrag in class Entity
    • getGravity

      protected float getGravity()
      Overrides:
      getGravity in class Entity
    • getBaseOffset

      public float getBaseOffset()
      Overrides:
      getBaseOffset in class Entity
    • getNetworkId

      public int getNetworkId()
      Description copied from class: Entity
      获得该实体的网络ID

      Get the network ID of the entity

      Specified by:
      getNetworkId in class Entity
      Returns:
      the network id
    • getInteractButtonText

      public String getInteractButtonText(Player player)
      Specified by:
      getInteractButtonText in interface EntityInteractable
      Overrides:
      getInteractButtonText in class EntityVehicle
    • attack

      public boolean attack(EntityDamageEvent source)
      Description copied from class: Entity
      当一个实体被攻击时(即接受一个实体伤害事件 这个事件可以是由其他实体攻击导致,也可能是自然伤害)调用.

      Called when an entity is attacked (i.e. receives an entity damage event. This event can be caused by an attack by another entity, or it can be a natural damage).

      Overrides:
      attack in class EntityVehicle
      Parameters:
      source - 记录伤害源的事件
      Record the event of the source of the attack
      Returns:
      是否攻击成功
      Whether the attack was successful
    • close

      public void close()
      Overrides:
      close in class Entity
    • createAddEntityPacket

      protected DataPacket createAddEntityPacket()
      Overrides:
      createAddEntityPacket in class Entity
    • onUpdate

      public boolean onUpdate(int currentTick)
      Overrides:
      onUpdate in class EntityVehicle
    • canCollideWith

      public boolean canCollideWith(Entity entity)
      Overrides:
      canCollideWith in class Entity
    • canDoInteraction

      public boolean canDoInteraction()
      Specified by:
      canDoInteraction in interface EntityInteractable
      Overrides:
      canDoInteraction in class EntityVehicle
    • updatePassengers

      public void updatePassengers()
      Overrides:
      updatePassengers in class Entity
    • updatePassengers

      public void updatePassengers(boolean sendLinks)
    • getWaterLevel

      public double getWaterLevel()
    • mountEntity

      public boolean mountEntity(Entity entity)
      Description copied from interface: EntityRideable
      Mount or Dismounts an Entity from a rideable entity
      Specified by:
      mountEntity in interface EntityRideable
      Overrides:
      mountEntity in class Entity
      Parameters:
      entity - The target Entity
      Returns:
      true if the mounting successful
    • mountEntity

      public boolean mountEntity(Entity entity, byte mode)
      Description copied from class: Entity
      Mount an Entity from a/into vehicle
      Overrides:
      mountEntity in class Entity
      Parameters:
      entity - The target Entity
      Returns:
      true if the mounting successful
    • updatePassengerPosition

      protected void updatePassengerPosition(Entity passenger)
      Overrides:
      updatePassengerPosition in class Entity
    • dismountEntity

      public boolean dismountEntity(Entity entity, boolean sendLinks)
      Overrides:
      dismountEntity in class Entity
    • isControlling

      public boolean isControlling(Entity entity)
      Overrides:
      isControlling in class Entity
    • onInteract

      public boolean onInteract(Player player, Item item, Vector3 clickedPos)
      Overrides:
      onInteract in class Entity
    • getMountedOffset

      public Vector3f getMountedOffset(Entity entity)
      Overrides:
      getMountedOffset in class Entity
    • onPaddle

      public void onPaddle(AnimatePacket.Action animation, float value)
    • applyEntityCollision

      public void applyEntityCollision(Entity entity)
      Overrides:
      applyEntityCollision in class Entity
    • canPassThrough

      public boolean canPassThrough()
      Overrides:
      canPassThrough in class Entity
    • kill

      @PowerNukkitDifference(info="Fixes a dupe issue when attacking too quickly", since="1.3.1.2-PN") public void kill()
      Overrides:
      kill in class Entity
    • dropItem

      @PowerNukkitXOnly @Since("1.6.0.0-PNX") protected void dropItem()
    • saveNBT

      public void saveNBT()
      Overrides:
      saveNBT in class Entity
    • getVariant

      @PowerNukkitOnly @Since("1.4.0.0-PN") public int getVariant()
    • setVariant

      @PowerNukkitOnly @Since("1.4.0.0-PN") public void setVariant(int variant)
    • getOriginalName

      @PowerNukkitOnly @Since("1.5.1.0-PN") public String getOriginalName()
      Description copied from class: Entity
      The name that English name of the type of this entity.
      Overrides:
      getOriginalName in class Entity
    • onInput

      public void onInput(double x, double y, double z, double yaw)