Class AbstractStorageContainerItem

java.lang.Object
net.minecraft.world.item.Item
com.refinedmods.refinedstorage.common.api.storage.AbstractStorageContainerItem
All Implemented Interfaces:
StorageContainerItem, net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.ItemLike
Direct Known Subclasses:
FluidStorageDiskItem, ItemStorageDiskItem

@API(status=STABLE, since="2.0.0-milestone.1.0") public abstract class AbstractStorageContainerItem extends net.minecraft.world.item.Item implements StorageContainerItem
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.item.Item

    net.minecraft.world.item.Item.Properties, net.minecraft.world.item.Item.TooltipContext
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     

    Fields inherited from class net.minecraft.world.item.Item

    ABSOLUTE_MAX_STACK_SIZE, APPROXIMATELY_INFINITE_USE_DURATION, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, CODEC, CODEC_WITH_BOUND_COMPONENTS, DEFAULT_MAX_STACK_SIZE, descriptionId, MAX_BAR_WIDTH, STREAM_CODEC

    Fields inherited from interface net.minecraft.world.flag.FeatureElement

    FILTERED_REGISTRIES

    Fields inherited from interface StorageContainerItem

    VALIDATOR
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractStorageContainerItem(net.minecraft.world.item.Item.Properties properties, StorageContainerItemHelper helper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    appendHoverText(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item.TooltipContext context, net.minecraft.world.item.component.TooltipDisplay display, Consumer<net.minecraft.network.chat.Component> builder, net.minecraft.world.item.TooltipFlag flag)
     
    protected abstract net.minecraft.world.item.ItemStack
     
    protected abstract @Nullable net.minecraft.world.item.ItemStack
     
    protected abstract SerializableStorage
    createStorage(StorageRepository storageRepository)
     
    protected abstract String
    formatAmount(long amount)
     
    protected abstract @Nullable Long
     
    getInfo(StorageRepository storageRepository, net.minecraft.world.item.ItemStack stack)
     
    void
    inventoryTick(net.minecraft.world.item.ItemStack stack, net.minecraft.server.level.ServerLevel level, net.minecraft.world.entity.Entity entity, @Nullable net.minecraft.world.entity.EquipmentSlot slot)
     
    resolve(StorageRepository storageRepository, net.minecraft.world.item.ItemStack stack)
     
    net.minecraft.world.InteractionResult
    use(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
     

    Methods inherited from class net.minecraft.world.item.Item

    asItem, builtInRegistryHolder, byBlock, byId, canDestroyBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getCraftingRemainder, getDefaultInstance, getDefaultMaxStackSize, getDescriptionId, getDestroySpeed, getId, getItemDamageSource, getName, getPlayerPOVHitResult, getTooltipImage, getUseAnimation, getUseDuration, hurtEnemy, interactLivingEntity, isBarVisible, isCorrectToolForDrops, isFoil, mineBlock, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, releaseUsing, requiredFeatures, shouldPrintOpWarning, toString, useOn, useOnRelease

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.world.flag.FeatureElement

    isEnabled
  • Field Details

  • Constructor Details

    • AbstractStorageContainerItem

      protected AbstractStorageContainerItem(net.minecraft.world.item.Item.Properties properties, StorageContainerItemHelper helper)
  • Method Details

    • resolve

      public Optional<SerializableStorage> resolve(StorageRepository storageRepository, net.minecraft.world.item.ItemStack stack)
      Specified by:
      resolve in interface StorageContainerItem
    • getInfo

      public Optional<StorageInfo> getInfo(StorageRepository storageRepository, net.minecraft.world.item.ItemStack stack)
      Specified by:
      getInfo in interface StorageContainerItem
    • use

      public net.minecraft.world.InteractionResult use(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
      Overrides:
      use in class net.minecraft.world.item.Item
    • inventoryTick

      public void inventoryTick(net.minecraft.world.item.ItemStack stack, net.minecraft.server.level.ServerLevel level, net.minecraft.world.entity.Entity entity, @Nullable net.minecraft.world.entity.EquipmentSlot slot)
      Overrides:
      inventoryTick in class net.minecraft.world.item.Item
    • appendHoverText

      public void appendHoverText(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item.TooltipContext context, net.minecraft.world.item.component.TooltipDisplay display, Consumer<net.minecraft.network.chat.Component> builder, net.minecraft.world.item.TooltipFlag flag)
      Overrides:
      appendHoverText in class net.minecraft.world.item.Item
    • getCapacity

      protected abstract @Nullable Long getCapacity()
    • formatAmount

      protected abstract String formatAmount(long amount)
    • createStorage

      protected abstract SerializableStorage createStorage(StorageRepository storageRepository)
    • createPrimaryDisassemblyByproduct

      protected abstract net.minecraft.world.item.ItemStack createPrimaryDisassemblyByproduct(int count)
    • createSecondaryDisassemblyByproduct

      protected abstract @Nullable net.minecraft.world.item.ItemStack createSecondaryDisassemblyByproduct(int count)