Class WandItem

java.lang.Object
net.minecraft.world.item.Item
com.binaris.wizardry.content.item.WandItem
All Implemented Interfaces:
ICastItem, ICustomDamageItem, IElementValue, IManaItem, ITierValue, IWorkbenchItem, net.fabricmc.fabric.api.item.v1.FabricItem, net.minecraft.world.flag.FeatureElement, net.minecraft.world.level.ItemLike

public class WandItem extends net.minecraft.world.item.Item implements ICastItem, IManaItem, IWorkbenchItem, ICustomDamageItem, ITierValue, IElementValue
  • Nested Class Summary

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

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

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     

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

    BASE_ATTACK_DAMAGE_UUID, BASE_ATTACK_SPEED_UUID, BY_BLOCK, EAT_DURATION, MAX_BAR_WIDTH, MAX_STACK_SIZE

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

    FILTERED_REGISTRIES
  • Constructor Summary

    Constructors
    Constructor
    Description
    WandItem(SpellTier tier, Element element)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    applySpecialUpgrade(@Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.world.item.ItemStack upgrade)
     
    protected net.minecraft.world.item.ItemStack
    applyTierUpgrade(@Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.world.item.ItemStack tomeStack)
     
    net.minecraft.world.item.ItemStack
    applyUpgrade(@Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.world.item.ItemStack upgrade)
     
    protected boolean
    applyUpgradeSlot(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.Slot centre, net.minecraft.world.inventory.Slot upgrade)
     
    boolean
    canBreak(net.minecraft.world.item.ItemStack stack)
     
    boolean
    canCast(net.minecraft.world.item.ItemStack stack, Spell spell, PlayerCastContext ctx)
     
    boolean
    cast(net.minecraft.world.item.ItemStack stack, Spell spell, PlayerCastContext ctx)
     
    protected void
    checkLevelUp(PlayerCastContext ctx, net.minecraft.world.item.ItemStack stack, int progression)
     
    createContext(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, int tick, net.minecraft.world.item.ItemStack stack, Spell spell)
     
    protected void
    expandSpellSlots(net.minecraft.world.item.ItemStack wand)
     
    int
    getBarColor(net.minecraft.world.item.ItemStack stack)
     
    int
    getCurrentCooldown(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level)
     
    int
    getCurrentMaxCooldown(net.minecraft.world.item.ItemStack stack)
     
    @NotNull Spell
    getCurrentSpell(net.minecraft.world.item.ItemStack stack)
     
    int
    getCustomMaxDamage(net.minecraft.world.item.ItemStack stack)
     
     
    int
    getMana(net.minecraft.world.item.ItemStack stack)
     
    int
    getManaCapacity(net.minecraft.world.item.ItemStack stack)
     
    @NotNull net.minecraft.network.chat.Component
    getName(@NotNull net.minecraft.world.item.ItemStack stack)
     
    @NotNull Spell
    getNextSpell(net.minecraft.world.item.ItemStack stack)
     
    @NotNull Spell
    getPreviousSpell(net.minecraft.world.item.ItemStack stack)
     
    getSpells(net.minecraft.world.item.ItemStack stack)
     
    int
    getSpellSlotCount(net.minecraft.world.item.ItemStack stack)
     
    getTier(net.minecraft.world.item.ItemStack stack)
     
    int
    getUseDuration(@NotNull net.minecraft.world.item.ItemStack stack)
     
    protected void
    handleInstantSpellTick(PlayerCastContext ctx, Spell spell, net.minecraft.world.item.ItemStack stack, int useTick, int charge)
     
    protected void
    handleProgression(PlayerCastContext ctx, Spell spell, net.minecraft.world.item.ItemStack stack)
     
    @NotNull net.minecraft.world.InteractionResult
    interactLivingEntity(@NotNull net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.entity.LivingEntity interactionTarget, @NotNull net.minecraft.world.InteractionHand usedHand)
     
    void
    inventoryTick(@NotNull net.minecraft.world.item.ItemStack stack, @NotNull net.minecraft.world.level.Level world, @NotNull net.minecraft.world.entity.Entity entity, int slot, boolean isHeldInMainHand)
     
    boolean
     
    boolean
    isFoil(@NotNull net.minecraft.world.item.ItemStack stack)
     
    boolean
    onApplyButtonPressed(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.Slot centre, net.minecraft.world.inventory.Slot crystals, net.minecraft.world.inventory.Slot upgrade, net.minecraft.world.inventory.Slot[] spellBooks)
     
    void
    onClearButtonPressed(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.Slot centre, net.minecraft.world.inventory.Slot crystals, net.minecraft.world.inventory.Slot upgrade, net.minecraft.world.inventory.Slot[] spellBooks)
     
    void
    onUseTick(@NotNull net.minecraft.world.level.Level level, @NotNull net.minecraft.world.entity.LivingEntity user, @NotNull net.minecraft.world.item.ItemStack stack, int timeLeft)
     
    void
    releaseUsing(@NotNull net.minecraft.world.item.ItemStack stack, @NotNull net.minecraft.world.level.Level level, @NotNull net.minecraft.world.entity.LivingEntity livingEntity, int timeCharged)
     
    void
    selectNextSpell(net.minecraft.world.item.ItemStack stack)
     
    void
    selectPreviousSpell(net.minecraft.world.item.ItemStack stack)
     
    boolean
    selectSpell(net.minecraft.world.item.ItemStack stack, int index)
     
    void
    setCustomDamage(net.minecraft.world.item.ItemStack stack, int damage)
     
    void
    setMana(net.minecraft.world.item.ItemStack stack, int mana)
     
    boolean
    showSpellHUD(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack)
     
    boolean
    showTooltip(net.minecraft.world.item.ItemStack stack)
     
    @NotNull net.minecraft.world.InteractionResultHolder<net.minecraft.world.item.ItemStack>
    use(@NotNull net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.InteractionHand hand)
     
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.

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

    appendHoverText, asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canBeDepleted, canBeHurtBy, canFitInsideContainerItems, finishUsingItem, getBarWidth, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getFoodProperties, getId, getMaxDamage, getMaxStackSize, getOrCreateDescriptionId, getPlayerPOVHitResult, getRarity, getTooltipImage, getUseAnimation, hasCraftingRemainingItem, hurtEnemy, isBarVisible, isComplex, isCorrectToolForDrops, isEdible, isEnchantable, isFireResistant, isValidRepairItem, mineBlock, onCraftedBy, onDestroyed, overrideOtherStackedOnMe, overrideStackedOnOther, requiredFeatures, shouldOverrideMultiplayerNbt, toString, useOn, useOnRelease, verifyTagAfterLoad

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.fabricmc.fabric.api.item.v1.FabricItem

    allowContinuingBlockBreaking, allowNbtUpdateAnimation, getAttributeModifiers, getRecipeRemainder, isSuitableFor

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

    isEnabled

    Methods inherited from interface com.binaris.wizardry.api.content.item.ICastItem

    showSpellsInWorkbench

    Methods inherited from interface com.binaris.wizardry.api.content.item.IManaItem

    consumeMana, getFullness, isManaEmpty, isManaFull, rechargeMana, showManaInWorkbench

    Methods inherited from interface com.binaris.wizardry.api.content.item.IWorkbenchItem

    canPlace
  • Field Details

  • Constructor Details

  • Method Details

    • use

      @NotNull public @NotNull net.minecraft.world.InteractionResultHolder<net.minecraft.world.item.ItemStack> use(@NotNull @NotNull net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.world.InteractionHand hand)
      Overrides:
      use in class net.minecraft.world.item.Item
    • onUseTick

      public void onUseTick(@NotNull @NotNull net.minecraft.world.level.Level level, @NotNull @NotNull net.minecraft.world.entity.LivingEntity user, @NotNull @NotNull net.minecraft.world.item.ItemStack stack, int timeLeft)
      Overrides:
      onUseTick in class net.minecraft.world.item.Item
    • canCast

      public boolean canCast(net.minecraft.world.item.ItemStack stack, Spell spell, PlayerCastContext ctx)
      Specified by:
      canCast in interface ICastItem
    • cast

      public boolean cast(net.minecraft.world.item.ItemStack stack, Spell spell, PlayerCastContext ctx)
      Specified by:
      cast in interface ICastItem
    • interactLivingEntity

      @NotNull public @NotNull net.minecraft.world.InteractionResult interactLivingEntity(@NotNull @NotNull net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.world.entity.LivingEntity interactionTarget, @NotNull @NotNull net.minecraft.world.InteractionHand usedHand)
      Overrides:
      interactLivingEntity in class net.minecraft.world.item.Item
    • releaseUsing

      public void releaseUsing(@NotNull @NotNull net.minecraft.world.item.ItemStack stack, @NotNull @NotNull net.minecraft.world.level.Level level, @NotNull @NotNull net.minecraft.world.entity.LivingEntity livingEntity, int timeCharged)
      Overrides:
      releaseUsing in class net.minecraft.world.item.Item
    • onApplyButtonPressed

      public boolean onApplyButtonPressed(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.Slot centre, net.minecraft.world.inventory.Slot crystals, net.minecraft.world.inventory.Slot upgrade, net.minecraft.world.inventory.Slot[] spellBooks)
      Specified by:
      onApplyButtonPressed in interface IWorkbenchItem
    • applyUpgrade

      public net.minecraft.world.item.ItemStack applyUpgrade(@Nullable @Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.world.item.ItemStack upgrade)
      Specified by:
      applyUpgrade in interface IWorkbenchItem
    • inventoryTick

      public void inventoryTick(@NotNull @NotNull net.minecraft.world.item.ItemStack stack, @NotNull @NotNull net.minecraft.world.level.Level world, @NotNull @NotNull net.minecraft.world.entity.Entity entity, int slot, boolean isHeldInMainHand)
      Overrides:
      inventoryTick in class net.minecraft.world.item.Item
    • handleInstantSpellTick

      protected void handleInstantSpellTick(PlayerCastContext ctx, Spell spell, net.minecraft.world.item.ItemStack stack, int useTick, int charge)
    • createContext

      protected PlayerCastContext createContext(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, int tick, net.minecraft.world.item.ItemStack stack, Spell spell)
    • applyUpgradeSlot

      protected boolean applyUpgradeSlot(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.Slot centre, net.minecraft.world.inventory.Slot upgrade)
    • applyTierUpgrade

      protected net.minecraft.world.item.ItemStack applyTierUpgrade(@Nullable @Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.world.item.ItemStack tomeStack)
    • applySpecialUpgrade

      protected void applySpecialUpgrade(@Nullable @Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.world.item.ItemStack upgrade)
    • expandSpellSlots

      protected void expandSpellSlots(net.minecraft.world.item.ItemStack wand)
    • handleProgression

      protected void handleProgression(PlayerCastContext ctx, Spell spell, net.minecraft.world.item.ItemStack stack)
    • checkLevelUp

      protected void checkLevelUp(PlayerCastContext ctx, net.minecraft.world.item.ItemStack stack, int progression)
    • onClearButtonPressed

      public void onClearButtonPressed(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.Slot centre, net.minecraft.world.inventory.Slot crystals, net.minecraft.world.inventory.Slot upgrade, net.minecraft.world.inventory.Slot[] spellBooks)
      Specified by:
      onClearButtonPressed in interface IWorkbenchItem
    • getName

      @NotNull public @NotNull net.minecraft.network.chat.Component getName(@NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Overrides:
      getName in class net.minecraft.world.item.Item
    • selectNextSpell

      public void selectNextSpell(net.minecraft.world.item.ItemStack stack)
      Specified by:
      selectNextSpell in interface ICastItem
    • selectPreviousSpell

      public void selectPreviousSpell(net.minecraft.world.item.ItemStack stack)
      Specified by:
      selectPreviousSpell in interface ICastItem
    • getCustomMaxDamage

      public int getCustomMaxDamage(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getCustomMaxDamage in interface ICustomDamageItem
    • setCustomDamage

      public void setCustomDamage(net.minecraft.world.item.ItemStack stack, int damage)
      Specified by:
      setCustomDamage in interface ICustomDamageItem
    • isFoil

      public boolean isFoil(@NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Overrides:
      isFoil in class net.minecraft.world.item.Item
    • canBreak

      public boolean canBreak(net.minecraft.world.item.ItemStack stack)
      Specified by:
      canBreak in interface ICustomDamageItem
    • getBarColor

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

      public int getUseDuration(@NotNull @NotNull net.minecraft.world.item.ItemStack stack)
      Overrides:
      getUseDuration in class net.minecraft.world.item.Item
    • isClearable

      public boolean isClearable()
      Specified by:
      isClearable in interface IWorkbenchItem
    • showTooltip

      public boolean showTooltip(net.minecraft.world.item.ItemStack stack)
      Specified by:
      showTooltip in interface IWorkbenchItem
    • selectSpell

      public boolean selectSpell(net.minecraft.world.item.ItemStack stack, int index)
      Specified by:
      selectSpell in interface ICastItem
    • getCurrentCooldown

      public int getCurrentCooldown(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level)
      Specified by:
      getCurrentCooldown in interface ICastItem
    • getCurrentMaxCooldown

      public int getCurrentMaxCooldown(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getCurrentMaxCooldown in interface ICastItem
    • showSpellHUD

      public boolean showSpellHUD(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack)
      Specified by:
      showSpellHUD in interface ICastItem
    • getMana

      public int getMana(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getMana in interface IManaItem
    • getManaCapacity

      public int getManaCapacity(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getManaCapacity in interface IManaItem
    • setMana

      public void setMana(net.minecraft.world.item.ItemStack stack, int mana)
      Specified by:
      setMana in interface IManaItem
    • getSpellSlotCount

      public int getSpellSlotCount(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getSpellSlotCount in interface IWorkbenchItem
    • getCurrentSpell

      @NotNull public @NotNull Spell getCurrentSpell(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getCurrentSpell in interface ICastItem
    • getNextSpell

      @NotNull public @NotNull Spell getNextSpell(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getNextSpell in interface ICastItem
    • getPreviousSpell

      @NotNull public @NotNull Spell getPreviousSpell(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getPreviousSpell in interface ICastItem
    • getSpells

      public Spell[] getSpells(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getSpells in interface ICastItem
    • getElement

      public Element getElement()
      Specified by:
      getElement in interface IElementValue
    • validForReceptacle

      @Deprecated(forRemoval=true) public boolean validForReceptacle()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      validForReceptacle in interface IElementValue
    • getTier

      public SpellTier getTier(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getTier in interface ITierValue