Class ItemBucket

java.lang.Object
cn.nukkit.item.Item
cn.nukkit.item.ItemBucket
All Implemented Interfaces:
BlockID, ItemID, Cloneable

public class ItemBucket extends Item
Author:
MagicDroidX (Nukkit Project)
  • Constructor Details

    • ItemBucket

      public ItemBucket()
    • ItemBucket

      public ItemBucket(Integer meta)
    • ItemBucket

      public ItemBucket(Integer meta, int count)
    • ItemBucket

      @PowerNukkitOnly @Since("1.4.0.0-PN") protected ItemBucket(int id, Integer meta, int count, String name)
  • Method Details

    • getName

      protected static String getName(int meta)
    • getDamageByTarget

      public static int getDamageByTarget(int target)
    • isEmpty

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean isEmpty()
    • isWater

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean isWater()
    • isLava

      @PowerNukkitOnly @Since("1.4.0.0-PN") public boolean isLava()
    • isPowderSnow

      @PowerNukkitOnly public boolean isPowderSnow()
    • getFishEntityId

      @PowerNukkitOnly @Since("1.4.0.0-PN") @Nullable public String getFishEntityId()
    • getMaxStackSize

      public int getMaxStackSize()
      Description copied from class: Item
      定义物品堆叠的最大数量

      Define the maximum number of items to be stacked

      Overrides:
      getMaxStackSize in class Item
    • canBeActivated

      public boolean canBeActivated()
      Overrides:
      canBeActivated in class Item
    • getTargetBlock

      @PowerNukkitOnly @Since("1.4.0.0-PN") public Block getTargetBlock()
    • onActivate

      @PowerNukkitDifference(info="You can\'t use bucket in adventure mode.", since="1.4.0.0-PN") public boolean onActivate(Level level, Player player, Block block, Block target, BlockFace face, double fx, double fy, double fz)
      Description copied from class: Item
      玩家使用一个物品交互时会调用这个方法

      This method is called when the player interacts with an item

      Overrides:
      onActivate in class Item
      Parameters:
      level - 玩家所在地图
      Player location level
      player - 玩家实例对象
      Player instance object
      block - the block
      target - 交互的目标方块
      Interacting target block
      face - 交互的方向
      Direction of Interaction
      fx - the fx
      fy - the fy
      fz - the fz
      Returns:
      boolean
    • canBeUsedOnDimension

      @PowerNukkitOnly @Since("1.4.0.0-PN") protected boolean canBeUsedOnDimension(int dimension)
    • afterUse

      @PowerNukkitOnly @Since("1.4.0.0-PN") protected void afterUse(Level level, Block block)
    • spawnFishEntity

      @PowerNukkitXOnly @Since("1.19.60-r1") public void spawnFishEntity(Position spawnPos)
    • onClickAir

      public boolean onClickAir(Player player, Vector3 directionVector)
      Description copied from class: Item
      当玩家对着空中使用物品时调用,例如投掷物品。返回物品是否已更改,例如数量减少或耐久度更改。

      Called when a player uses the item on air, for example throwing a projectile. Returns whether the item was changed, for example count decrease or durability change.

      Overrides:
      onClickAir in class Item
      Parameters:
      player - player
      directionVector - 点击的方向向量
      The direction vector of the click
      Returns:
      item changed
    • onUse

      @PowerNukkitDifference(info="You can\'t use milk in spectator mode and milk is now \'drinked\' in adventure mode", since="1.4.0.0-PN") public boolean onUse(Player player, int ticksUsed)
      Description copied from class: Item
      Overrides:
      onUse in class Item
      Parameters:
      player - the player
      ticksUsed - 物品被使用了多久(右键持续时间)
      How long the item has been used (right-click duration)
      Returns:
      the boolean