类 BucketItem

java.lang.Object
net.minecraft.world.item.Item
net.minecraft.world.item.BucketItem
所有已实现的接口:
FeatureElement, DispensibleContainerItem, ItemLike, IForgeDispensibleContainerItem, IForgeItem
直接已知子类:
MobBucketItem

public class BucketItem extends Item implements DispensibleContainerItem
  • 字段详细资料

    • content

      private final Fluid content
    • fluidSupplier

      private final Supplier<? extends Fluid> fluidSupplier
  • 构造器详细资料

  • 方法详细资料

    • use

      public InteractionResultHolder<ItemStack> use(Level pLevel, Player pPlayer, InteractionHand pHand)
      覆盖:
      use 在类中 Item
    • getEmptySuccessItem

      public static ItemStack getEmptySuccessItem(ItemStack pBucketStack, Player pPlayer)
    • checkExtraContent

      public void checkExtraContent(@Nullable Player pPlayer, Level pLevel, ItemStack pContainerStack, BlockPos pPos)
      指定者:
      checkExtraContent 在接口中 DispensibleContainerItem
    • emptyContents

      @Deprecated public boolean emptyContents(@Nullable Player pPlayer, Level pLevel, BlockPos pPos, @Nullable BlockHitResult pResult)
      已过时。
      指定者:
      emptyContents 在接口中 DispensibleContainerItem
    • emptyContents

      public boolean emptyContents(@Nullable Player pPlayer, Level pLevel, BlockPos pPos, @Nullable BlockHitResult pResult, @Nullable ItemStack container)
      从接口复制的说明: IForgeDispensibleContainerItem
      Empties the contents of the container and returns whether it was successful.
      指定者:
      emptyContents 在接口中 IForgeDispensibleContainerItem
      参数:
      pPlayer - Player who empties the container. May be null for blocks like dispensers.
      pLevel - Level to place the content in
      pPos - The position in the level to empty the content
      pResult - Hit result of the interaction. May be null for blocks like dispensers.
      container - ItemStack of the container. May be null for backwards compatibility.
      返回:
      true if emptying the contents of the container was successful, false otherwise
    • playEmptySound

      protected void playEmptySound(@Nullable Player pPlayer, LevelAccessor pLevel, BlockPos pPos)
    • initCapabilities

      public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable CompoundTag nbt)
      从接口复制的说明: IForgeItem
      Called from ItemStack.setItem, will hold extra data for the life of this ItemStack. Can be retrieved from stack.getCapabilities() The NBT can be null if this is not called from readNBT or if the item the stack is changing FROM is different then this item, or the previous item had no capabilities. This is called BEFORE the stacks item is set so you can use stack.getItem() to see the OLD item. Remember that getItem CAN return null.
      指定者:
      initCapabilities 在接口中 IForgeItem
      参数:
      stack - The ItemStack
      nbt - NBT of this item serialized, or null.
      返回:
      A holder instance associated with this ItemStack where you can hold capabilities for the life of this item.
    • getFluid

      public Fluid getFluid()
    • canBlockContainFluid

      protected boolean canBlockContainFluid(Level worldIn, BlockPos posIn, BlockState blockstate)