Class BundleLikeItem<T extends StackHolder<T>>

java.lang.Object
net.minecraft.world.item.Item
net.ntrdeal.realapi.item.stack_holder.BundleLikeItem<T>
All Implemented Interfaces:
net.fabricmc.fabric.api.item.v1.FabricItem, net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.ItemLike, WeightHolder

public class BundleLikeItem<T extends StackHolder<T>> extends net.minecraft.world.item.Item implements WeightHolder
  • 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
    static final int
     
    static final org.apache.commons.lang3.math.Fraction
     
    final T
     
    static final int
     
    final net.minecraft.core.component.DataComponentType<T>
     

    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
  • Constructor Summary

    Constructors
    Constructor
    Description
    BundleLikeItem(net.minecraft.world.item.Item.Properties properties, net.minecraft.core.component.DataComponentType<T> type, T empty)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    broadcastChanges(net.minecraft.world.entity.player.Player player)
     
    void
    dropItem(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack)
     
    int
    getBarColor(net.minecraft.world.item.ItemStack stack)
     
    int
    getBarWidth(net.minecraft.world.item.ItemStack stack)
     
    Optional<net.minecraft.world.inventory.tooltip.TooltipComponent>
    getTooltipImage(net.minecraft.world.item.ItemStack stack)
     
    net.minecraft.world.item.ItemUseAnimation
    getUseAnimation(net.minecraft.world.item.ItemStack stack)
     
    int
    getUseDuration(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.LivingEntity user)
     
    @Nullable com.mojang.serialization.DataResult<org.apache.commons.lang3.math.Fraction>
    getWeight(net.minecraft.world.item.ItemInstance instance, org.apache.commons.lang3.math.Fraction multiplier)
     
    org.apache.commons.lang3.math.Fraction
    getWeight(T holder)
     
    boolean
    isBarVisible(net.minecraft.world.item.ItemStack stack)
     
    void
    onDestroyed(net.minecraft.world.entity.item.ItemEntity entity)
     
    void
    onUseTick(net.minecraft.world.level.Level level, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, int ticksRemaining)
     
    boolean
    overrideOtherStackedOnMe(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.ItemStack slotStack, net.minecraft.world.inventory.Slot slot, net.minecraft.world.inventory.ClickAction action, net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.SlotAccess access)
     
    boolean
    overrideStackedOnOther(net.minecraft.world.item.ItemStack stack, net.minecraft.world.inventory.Slot slot, net.minecraft.world.inventory.ClickAction action, net.minecraft.world.entity.player.Player player)
     
    void
    playDropContentsSound(net.minecraft.world.level.Level level, net.minecraft.world.entity.Entity entity)
     
    void
    playInsertFailSound(net.minecraft.world.entity.Entity entity)
     
    void
    playInsertSound(net.minecraft.world.entity.Entity entity)
     
    void
    playRemoveSound(net.minecraft.world.entity.Entity entity)
     
    void
    setBundle(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack, T bundle)
     
    void
    setIndex(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack, int index)
     
    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

    appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canDestroyBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getCraftingRemainder, getDefaultInstance, getDefaultMaxStackSize, getDescriptionId, getDestroySpeed, getId, getItemDamageSource, getName, getPlayerPOVHitResult, hurtEnemy, interactLivingEntity, inventoryTick, isCorrectToolForDrops, isFoil, mineBlock, onCraftedBy, onCraftedPostProcess, 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.fabricmc.fabric.api.item.v1.FabricItem

    allowComponentsUpdateAnimation, allowContinuingBlockBreaking, canBeEnchantedWith, getCraftingRemainder, getCreatorNamespace

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

    isEnabled
  • Field Details

    • FULL_BAR_COLOR

      public static final int FULL_BAR_COLOR
    • BAR_COLOR

      public static final int BAR_COLOR
    • BUNDLE_SIZE

      public static final org.apache.commons.lang3.math.Fraction BUNDLE_SIZE
    • type

      public final net.minecraft.core.component.DataComponentType<T extends StackHolder<T>> type
    • empty

      public final T extends StackHolder<T> empty
  • Constructor Details

    • BundleLikeItem

      public BundleLikeItem(net.minecraft.world.item.Item.Properties properties, net.minecraft.core.component.DataComponentType<T> type, T empty)
  • Method Details

    • overrideStackedOnOther

      public boolean overrideStackedOnOther(net.minecraft.world.item.ItemStack stack, net.minecraft.world.inventory.Slot slot, net.minecraft.world.inventory.ClickAction action, net.minecraft.world.entity.player.Player player)
      Overrides:
      overrideStackedOnOther in class net.minecraft.world.item.Item
    • overrideOtherStackedOnMe

      public boolean overrideOtherStackedOnMe(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.ItemStack slotStack, net.minecraft.world.inventory.Slot slot, net.minecraft.world.inventory.ClickAction action, net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.SlotAccess access)
      Overrides:
      overrideOtherStackedOnMe in class net.minecraft.world.item.Item
    • isBarVisible

      public boolean isBarVisible(net.minecraft.world.item.ItemStack stack)
      Overrides:
      isBarVisible in class net.minecraft.world.item.Item
    • getBarWidth

      public int getBarWidth(net.minecraft.world.item.ItemStack stack)
      Overrides:
      getBarWidth in class net.minecraft.world.item.Item
    • getBarColor

      public int getBarColor(net.minecraft.world.item.ItemStack stack)
      Overrides:
      getBarColor in class net.minecraft.world.item.Item
    • 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
    • onUseTick

      public void onUseTick(net.minecraft.world.level.Level level, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, int ticksRemaining)
      Overrides:
      onUseTick in class net.minecraft.world.item.Item
    • getUseDuration

      public int getUseDuration(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.LivingEntity user)
      Overrides:
      getUseDuration in class net.minecraft.world.item.Item
    • getUseAnimation

      public net.minecraft.world.item.ItemUseAnimation getUseAnimation(net.minecraft.world.item.ItemStack stack)
      Overrides:
      getUseAnimation in class net.minecraft.world.item.Item
    • getTooltipImage

      public Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> getTooltipImage(net.minecraft.world.item.ItemStack stack)
      Overrides:
      getTooltipImage in class net.minecraft.world.item.Item
    • onDestroyed

      public void onDestroyed(net.minecraft.world.entity.item.ItemEntity entity)
      Overrides:
      onDestroyed in class net.minecraft.world.item.Item
    • getWeight

      public org.apache.commons.lang3.math.Fraction getWeight(T holder)
    • setIndex

      public void setIndex(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack, int index)
    • dropItem

      public void dropItem(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack)
    • setBundle

      public void setBundle(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack, T bundle)
    • broadcastChanges

      public void broadcastChanges(net.minecraft.world.entity.player.Player player)
    • playRemoveSound

      public void playRemoveSound(net.minecraft.world.entity.Entity entity)
    • playInsertSound

      public void playInsertSound(net.minecraft.world.entity.Entity entity)
    • playInsertFailSound

      public void playInsertFailSound(net.minecraft.world.entity.Entity entity)
    • playDropContentsSound

      public void playDropContentsSound(net.minecraft.world.level.Level level, net.minecraft.world.entity.Entity entity)
    • getWeight

      public @Nullable com.mojang.serialization.DataResult<org.apache.commons.lang3.math.Fraction> getWeight(net.minecraft.world.item.ItemInstance instance, org.apache.commons.lang3.math.Fraction multiplier)
      Specified by:
      getWeight in interface WeightHolder