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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final org.apache.commons.lang3.math.Fractionfinal Tstatic final intfinal 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_CODECFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
ConstructorsConstructorDescriptionBundleLikeItem(net.minecraft.world.item.Item.Properties properties, net.minecraft.core.component.DataComponentType<T> type, T empty) -
Method Summary
Modifier and TypeMethodDescriptionvoidbroadcastChanges(net.minecraft.world.entity.player.Player player) voiddropItem(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack) intgetBarColor(net.minecraft.world.item.ItemStack stack) intgetBarWidth(net.minecraft.world.item.ItemStack stack) Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> getTooltipImage(net.minecraft.world.item.ItemStack stack) net.minecraft.world.item.ItemUseAnimationgetUseAnimation(net.minecraft.world.item.ItemStack stack) intgetUseDuration(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.FractionbooleanisBarVisible(net.minecraft.world.item.ItemStack stack) voidonDestroyed(net.minecraft.world.entity.item.ItemEntity entity) voidonUseTick(net.minecraft.world.level.Level level, net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, int ticksRemaining) booleanoverrideOtherStackedOnMe(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) booleanoverrideStackedOnOther(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) voidplayDropContentsSound(net.minecraft.world.level.Level level, net.minecraft.world.entity.Entity entity) voidplayInsertFailSound(net.minecraft.world.entity.Entity entity) voidplayInsertSound(net.minecraft.world.entity.Entity entity) voidplayRemoveSound(net.minecraft.world.entity.Entity entity) voidsetBundle(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack, T bundle) voidsetIndex(net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack, int index) net.minecraft.world.InteractionResultuse(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, useOnReleaseMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.fabricmc.fabric.api.item.v1.FabricItem
allowComponentsUpdateAnimation, allowContinuingBlockBreaking, canBeEnchantedWith, getCraftingRemainder, getCreatorNamespaceMethods 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
-
empty
-
-
Constructor Details
-
BundleLikeItem
-
-
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:
overrideStackedOnOtherin classnet.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:
overrideOtherStackedOnMein classnet.minecraft.world.item.Item
-
isBarVisible
public boolean isBarVisible(net.minecraft.world.item.ItemStack stack) - Overrides:
isBarVisiblein classnet.minecraft.world.item.Item
-
getBarWidth
public int getBarWidth(net.minecraft.world.item.ItemStack stack) - Overrides:
getBarWidthin classnet.minecraft.world.item.Item
-
getBarColor
public int getBarColor(net.minecraft.world.item.ItemStack stack) - Overrides:
getBarColorin classnet.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:
usein classnet.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:
onUseTickin classnet.minecraft.world.item.Item
-
getUseDuration
public int getUseDuration(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.entity.LivingEntity user) - Overrides:
getUseDurationin classnet.minecraft.world.item.Item
-
getUseAnimation
public net.minecraft.world.item.ItemUseAnimation getUseAnimation(net.minecraft.world.item.ItemStack stack) - Overrides:
getUseAnimationin classnet.minecraft.world.item.Item
-
getTooltipImage
public Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> getTooltipImage(net.minecraft.world.item.ItemStack stack) - Overrides:
getTooltipImagein classnet.minecraft.world.item.Item
-
onDestroyed
public void onDestroyed(net.minecraft.world.entity.item.ItemEntity entity) - Overrides:
onDestroyedin classnet.minecraft.world.item.Item
-
getWeight
-
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:
getWeightin interfaceWeightHolder
-