Class BlockEntityBrewingStand

All Implemented Interfaces:
BlockEntityContainer, BlockEntityNameable, InventoryHolder, RecipeInventoryHolder, Cloneable

public class BlockEntityBrewingStand extends BlockEntitySpawnable implements RecipeInventoryHolder, BlockEntityContainer, BlockEntityNameable
  • Field Details

  • Constructor Details

  • Method Details

    • initBlockEntity

      protected void initBlockEntity()
      Overrides:
      initBlockEntity in class BlockEntitySpawnable
    • loadNBT

      @Since("1.19.60-r1") public void loadNBT()
      Description copied from class: BlockEntity
      从方块实体的namedtag中读取数据
      Overrides:
      loadNBT in class BlockEntity
    • getName

      public String getName()
      Description copied from interface: BlockEntityNameable
      返回这个事物的名字。
      Gets the name of this object.
      Specified by:
      getName in interface BlockEntityNameable
      Overrides:
      getName in class BlockEntity
      Returns:
      这个事物的名字。
      The name of this object.
    • hasName

      public boolean hasName()
      Description copied from interface: BlockEntityNameable
      返回这个事物是否有名字。
      Whether this object has a name.
      Specified by:
      hasName in interface BlockEntityNameable
      Returns:
      如果有名字,返回 true
      true for this object has a name.
    • setName

      public void setName(String name)
      Description copied from interface: BlockEntityNameable
      设置或更改这个事物的名字。
      Changes the name of this object, or names it.
      Specified by:
      setName in interface BlockEntityNameable
      Parameters:
      name - 这个事物的新名字。
      The new name of this object.
    • close

      public void close()
      Overrides:
      close in class BlockEntity
    • onBreak

      public void onBreak()
      Overrides:
      onBreak in class BlockEntity
    • saveNBT

      public void saveNBT()
      Description copied from class: BlockEntity
      存储方块实体数据到namedtag
      Overrides:
      saveNBT in class BlockEntity
    • isBlockEntityValid

      public boolean isBlockEntityValid()
      Specified by:
      isBlockEntityValid in class BlockEntity
    • getSize

      public int getSize()
      Description copied from interface: BlockEntityContainer
      返回这个容器最多能包含的物品数量。
      Returns the max number of items that this container can contain.
      Specified by:
      getSize in interface BlockEntityContainer
      Returns:
      最多能包含的物品数量。
      The max number.
    • getSlotIndex

      protected int getSlotIndex(int index)
    • getItem

      public Item getItem(int index)
      Description copied from interface: BlockEntityContainer
      返回一个存储在容器里的物品的Item对象。
      Returns an item that stores in this container, as an Item object.
      Specified by:
      getItem in interface BlockEntityContainer
      Parameters:
      index - 这个物品的索引序号。
      The index number of this item.
      Returns:
      这个物品的 Item对象。
      An Item object for this item.
    • setItem

      public void setItem(int index, Item item)
      Description copied from interface: BlockEntityContainer
      把一个物品存储进容器。
      Sets or stores this item into this container.

      注意:如果这个容器相应的索引序号已经有了物品,那么新存储的物品将会替换原有的物品。
      Notice: If there is already an item for this index number, the new item being stored will REPLACE the old one.

      Specified by:
      setItem in interface BlockEntityContainer
      Parameters:
      index - 这个物品的索引序号。
      The index number of this item.
      item - 描述这个物品的 Item对象。
      The Item object that describes this item.
    • getInventory

      public BrewingInventory getInventory()
      Specified by:
      getInventory in interface InventoryHolder
    • checkIngredient

      @Deprecated @DeprecationDetails(since="1.3.1.2-PN", reason="Checks the wrong location") protected boolean checkIngredient(Item ingredient)
      Deprecated.
    • onUpdate

      @PowerNukkitDifference(info="Fixed a lot of issues involving the brewing processes",since="1.3.1.2-PN") @PowerNukkitDifference(info="Using new method to play sounds",since="1.4.0.0-PN") public boolean onUpdate()
      Overrides:
      onUpdate in class BlockEntity
    • sendFuel

      protected void sendFuel()
    • sendBrewTime

      protected void sendBrewTime()
    • updateBlock

      @PowerNukkitDifference(info="Will stop the processing if there are no other matching recipe", since="1.3.1.2-PN") public void updateBlock()
    • getFuel

      public int getFuel()
    • setFuel

      public void setFuel(int fuel)
    • getSpawnCompound

      public CompoundTag getSpawnCompound()
      Overrides:
      getSpawnCompound in class BlockEntitySpawnable
    • getIngredientView

      @PowerNukkitXOnly @Since("1.20.10-r2") public Inventory getIngredientView()
      Description copied from interface: RecipeInventoryHolder
      获取该物品栏拥有者的物品栏的原料视图,这个视图通常是以InventorySlice指向的原始物品栏用于存储原料的一部分。
      Get the ingredients view of the inventory holder's inventory, which is usually a part of the raw inventory.
      Specified by:
      getIngredientView in interface RecipeInventoryHolder
      Returns:
      原料视图 the ingredients view of the inventory holder's inventory
    • getProductView

      @PowerNukkitXOnly @Since("1.20.10-r2") public Inventory getProductView()
      Description copied from interface: RecipeInventoryHolder
      获取该物品栏拥有者的物品栏的产物视图,这个视图通常是以InventorySlice指向的原始物品栏用于存储结果的一部分。
      Get the result view of the inventory holder's inventory, which is usually a part of the raw inventory.
      Specified by:
      getProductView in interface RecipeInventoryHolder
      Returns:
      产物视图 the result view of the inventory holder's inventory