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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields 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_SIZEFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplySpecialUpgrade(@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.ItemStackapplyTierUpgrade(@Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.world.item.ItemStack tomeStack) net.minecraft.world.item.ItemStackapplyUpgrade(@Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack wand, net.minecraft.world.item.ItemStack upgrade) protected booleanapplyUpgradeSlot(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.Slot centre, net.minecraft.world.inventory.Slot upgrade) booleancanBreak(net.minecraft.world.item.ItemStack stack) booleancanCast(net.minecraft.world.item.ItemStack stack, Spell spell, PlayerCastContext ctx) booleancast(net.minecraft.world.item.ItemStack stack, Spell spell, PlayerCastContext ctx) protected voidcheckLevelUp(PlayerCastContext ctx, net.minecraft.world.item.ItemStack stack, int progression) protected PlayerCastContextcreateContext(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 voidexpandSpellSlots(net.minecraft.world.item.ItemStack wand) intgetBarColor(net.minecraft.world.item.ItemStack stack) intgetCurrentCooldown(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level) intgetCurrentMaxCooldown(net.minecraft.world.item.ItemStack stack) @NotNull SpellgetCurrentSpell(net.minecraft.world.item.ItemStack stack) intgetCustomMaxDamage(net.minecraft.world.item.ItemStack stack) intgetMana(net.minecraft.world.item.ItemStack stack) intgetManaCapacity(net.minecraft.world.item.ItemStack stack) @NotNull net.minecraft.network.chat.ComponentgetName(@NotNull net.minecraft.world.item.ItemStack stack) @NotNull SpellgetNextSpell(net.minecraft.world.item.ItemStack stack) @NotNull SpellgetPreviousSpell(net.minecraft.world.item.ItemStack stack) Spell[]getSpells(net.minecraft.world.item.ItemStack stack) intgetSpellSlotCount(net.minecraft.world.item.ItemStack stack) getTier(net.minecraft.world.item.ItemStack stack) intgetUseDuration(@NotNull net.minecraft.world.item.ItemStack stack) protected voidhandleInstantSpellTick(PlayerCastContext ctx, Spell spell, net.minecraft.world.item.ItemStack stack, int useTick, int charge) protected voidhandleProgression(PlayerCastContext ctx, Spell spell, net.minecraft.world.item.ItemStack stack) @NotNull net.minecraft.world.InteractionResultinteractLivingEntity(@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) voidinventoryTick(@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) booleanbooleanisFoil(@NotNull net.minecraft.world.item.ItemStack stack) booleanonApplyButtonPressed(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) voidonClearButtonPressed(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) voidonUseTick(@NotNull net.minecraft.world.level.Level level, @NotNull net.minecraft.world.entity.LivingEntity user, @NotNull net.minecraft.world.item.ItemStack stack, int timeLeft) voidreleaseUsing(@NotNull net.minecraft.world.item.ItemStack stack, @NotNull net.minecraft.world.level.Level level, @NotNull net.minecraft.world.entity.LivingEntity livingEntity, int timeCharged) voidselectNextSpell(net.minecraft.world.item.ItemStack stack) voidselectPreviousSpell(net.minecraft.world.item.ItemStack stack) booleanselectSpell(net.minecraft.world.item.ItemStack stack, int index) voidsetCustomDamage(net.minecraft.world.item.ItemStack stack, int damage) voidsetMana(net.minecraft.world.item.ItemStack stack, int mana) booleanshowSpellHUD(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack) booleanshowTooltip(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) booleanDeprecated, 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, verifyTagAfterLoadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.fabricmc.fabric.api.item.v1.FabricItem
allowContinuingBlockBreaking, allowNbtUpdateAnimation, getAttributeModifiers, getRecipeRemainder, isSuitableForMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabledMethods inherited from interface com.binaris.wizardry.api.content.item.ICastItem
showSpellsInWorkbenchMethods inherited from interface com.binaris.wizardry.api.content.item.IManaItem
consumeMana, getFullness, isManaEmpty, isManaFull, rechargeMana, showManaInWorkbenchMethods inherited from interface com.binaris.wizardry.api.content.item.IWorkbenchItem
canPlace
-
Field Details
-
BASE_SPELL_SLOTS
public static final int BASE_SPELL_SLOTS- See Also:
-
COOLDOWN_FORFEIT_TICKS
public static final int COOLDOWN_FORFEIT_TICKS- See Also:
-
MAX_USE_DURATION
public static final int MAX_USE_DURATION- See Also:
-
-
Constructor Details
-
WandItem
-
-
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:
usein classnet.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:
onUseTickin classnet.minecraft.world.item.Item
-
canCast
public boolean canCast(net.minecraft.world.item.ItemStack stack, Spell spell, PlayerCastContext ctx) -
cast
-
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:
interactLivingEntityin classnet.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:
releaseUsingin classnet.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:
onApplyButtonPressedin interfaceIWorkbenchItem
-
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:
applyUpgradein interfaceIWorkbenchItem
-
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:
inventoryTickin classnet.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:
onClearButtonPressedin interfaceIWorkbenchItem
-
getName
@NotNull public @NotNull net.minecraft.network.chat.Component getName(@NotNull @NotNull net.minecraft.world.item.ItemStack stack) - Overrides:
getNamein classnet.minecraft.world.item.Item
-
selectNextSpell
public void selectNextSpell(net.minecraft.world.item.ItemStack stack) - Specified by:
selectNextSpellin interfaceICastItem
-
selectPreviousSpell
public void selectPreviousSpell(net.minecraft.world.item.ItemStack stack) - Specified by:
selectPreviousSpellin interfaceICastItem
-
getCustomMaxDamage
public int getCustomMaxDamage(net.minecraft.world.item.ItemStack stack) - Specified by:
getCustomMaxDamagein interfaceICustomDamageItem
-
setCustomDamage
public void setCustomDamage(net.minecraft.world.item.ItemStack stack, int damage) - Specified by:
setCustomDamagein interfaceICustomDamageItem
-
isFoil
public boolean isFoil(@NotNull @NotNull net.minecraft.world.item.ItemStack stack) - Overrides:
isFoilin classnet.minecraft.world.item.Item
-
canBreak
public boolean canBreak(net.minecraft.world.item.ItemStack stack) - Specified by:
canBreakin interfaceICustomDamageItem
-
getBarColor
public int getBarColor(net.minecraft.world.item.ItemStack stack) - Overrides:
getBarColorin classnet.minecraft.world.item.Item
-
getUseDuration
public int getUseDuration(@NotNull @NotNull net.minecraft.world.item.ItemStack stack) - Overrides:
getUseDurationin classnet.minecraft.world.item.Item
-
isClearable
public boolean isClearable()- Specified by:
isClearablein interfaceIWorkbenchItem
-
showTooltip
public boolean showTooltip(net.minecraft.world.item.ItemStack stack) - Specified by:
showTooltipin interfaceIWorkbenchItem
-
selectSpell
public boolean selectSpell(net.minecraft.world.item.ItemStack stack, int index) - Specified by:
selectSpellin interfaceICastItem
-
getCurrentCooldown
public int getCurrentCooldown(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level) - Specified by:
getCurrentCooldownin interfaceICastItem
-
getCurrentMaxCooldown
public int getCurrentMaxCooldown(net.minecraft.world.item.ItemStack stack) - Specified by:
getCurrentMaxCooldownin interfaceICastItem
-
showSpellHUD
public boolean showSpellHUD(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack) - Specified by:
showSpellHUDin interfaceICastItem
-
getMana
public int getMana(net.minecraft.world.item.ItemStack stack) -
getManaCapacity
public int getManaCapacity(net.minecraft.world.item.ItemStack stack) - Specified by:
getManaCapacityin interfaceIManaItem
-
setMana
public void setMana(net.minecraft.world.item.ItemStack stack, int mana) -
getSpellSlotCount
public int getSpellSlotCount(net.minecraft.world.item.ItemStack stack) - Specified by:
getSpellSlotCountin interfaceIWorkbenchItem
-
getCurrentSpell
- Specified by:
getCurrentSpellin interfaceICastItem
-
getNextSpell
- Specified by:
getNextSpellin interfaceICastItem
-
getPreviousSpell
- Specified by:
getPreviousSpellin interfaceICastItem
-
getSpells
-
getElement
- Specified by:
getElementin interfaceIElementValue
-
validForReceptacle
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
validForReceptaclein interfaceIElementValue
-
getTier
- Specified by:
getTierin interfaceITierValue
-