Package vazkii.botania.common.item.lens
Class LensItem
java.lang.Object
net.minecraft.world.item.Item
vazkii.botania.common.item.lens.LensItem
- All Implemented Interfaces:
net.minecraft.world.flag.FeatureElement,net.minecraft.world.level.ItemLike,BasicLensItem,CompositableLensItem,ControlLensItem,LensEffectItem,TinyPlanetExcempt
public class LensItem
extends net.minecraft.world.item.Item
implements ControlLensItem, CompositableLensItem, TinyPlanetExcempt
-
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 intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class net.minecraft.world.item.Item
ABSOLUTE_MAX_STACK_SIZE, BASE_ATTACK_DAMAGE_ID, BASE_ATTACK_SPEED_ID, BY_BLOCK, DEFAULT_MAX_STACK_SIZE, MAX_BAR_WIDTHFields inherited from interface net.minecraft.world.flag.FeatureElement
FILTERED_REGISTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowBurstShooting(net.minecraft.world.item.ItemStack stack, ManaSpreader spreader, boolean redstone) voidappendHoverText(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item.TooltipContext context, List<net.minecraft.network.chat.Component> stacks, net.minecraft.world.item.TooltipFlag flags) voidapply(net.minecraft.world.item.ItemStack stack, BurstProperties props, net.minecraft.world.level.Level level) Called when a mana spreader that has this focus shoots a burst.booleancanCombineLenses(net.minecraft.world.item.ItemStack sourceLens, net.minecraft.world.item.ItemStack compositeLens) Can the source lens be combined with the composite lens? This is called for both the BasicLensItem instance of ItemStack.getItem() of sourceLens and compositeLens.booleancollideBurst(ManaBurst burst, net.minecraft.world.phys.HitResult pos, boolean isManaBlock, boolean shouldKill, net.minecraft.world.item.ItemStack stack) Called when a mana burst fired from a mana spreader with this focus collides against any block or entity.booleandoParticles(ManaBurst burst, net.minecraft.world.item.ItemStack stack) Called when the mana burst should do it's particles.net.minecraft.world.item.ItemStackgetCompositeLens(net.minecraft.world.item.ItemStack stack) Gets the composite lens in the stack passed in, return empty for none.static LensgetLens(net.minecraft.world.item.ItemStack stack) intgetLensColor(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level) intgetManaToTransfer(ManaBurst burst, net.minecraft.world.item.ItemStack stack, ManaReceiver receiver) Gets the amount of mana to transfer to the passed in mana receiver block.@NotNull net.minecraft.network.chat.ComponentgetName(@NotNull net.minecraft.world.item.ItemStack stack) intgetProps(net.minecraft.world.item.ItemStack stack) Returns the properties of the itemstack, used to check if two lenses can combine.static intgetStoredColor(net.minecraft.world.item.ItemStack stack) static booleanisBlacklisted(net.minecraft.world.item.ItemStack lens1, net.minecraft.world.item.ItemStack lens2) booleanisCombinable(net.minecraft.world.item.ItemStack stack) Checks if the lens is combinable.booleanisControlLens(net.minecraft.world.item.ItemStack stack) voidonControlledSpreaderPulse(net.minecraft.world.item.ItemStack stack, ManaSpreader spreader) Used for when a redstone spreader gets a pulse.voidonControlledSpreaderTick(net.minecraft.world.item.ItemStack stack, ManaSpreader spreader, boolean redstone) Used for the tick of a non-redstone spreader.net.minecraft.world.item.ItemStacksetCompositeLens(net.minecraft.world.item.ItemStack sourceLens, net.minecraft.world.item.ItemStack compositeLens) Sets the composite lens for the sourceLens as the compositeLens, returns the ItemStack with the combination.static voidsetLensColor(net.minecraft.world.item.ItemStack stack, int color) booleanshouldPull(net.minecraft.world.item.ItemStack stack) voidupdateBurst(ManaBurst burst, net.minecraft.world.item.ItemStack stack) Called when a mana burst fired from a mana spreader with this focus is updated.Methods inherited from class net.minecraft.world.item.Item
asItem, builtInRegistryHolder, byBlock, byId, canAttackBlock, canFitInsideContainerItems, components, finishUsingItem, getAttackDamageBonus, getBarColor, getBarWidth, getBreakingSound, getCraftingRemainingItem, getDefaultAttributeModifiers, getDefaultInstance, getDefaultMaxStackSize, getDescription, getDescriptionId, getDescriptionId, getDestroySpeed, getDrinkingSound, getEatingSound, getEnchantmentValue, getId, getOrCreateDescriptionId, getPlayerPOVHitResult, getTooltipImage, getUseAnimation, getUseDuration, hasCraftingRemainingItem, hurtEnemy, interactLivingEntity, inventoryTick, isBarVisible, isComplex, isCorrectToolForDrops, isEnchantable, isFoil, isValidRepairItem, mineBlock, onCraftedBy, onCraftedPostProcess, onDestroyed, onUseTick, overrideOtherStackedOnMe, overrideStackedOnOther, postHurtEnemy, releaseUsing, requiredFeatures, toString, use, useOn, useOnRelease, verifyComponentsAfterLoadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.flag.FeatureElement
isEnabled
-
Field Details
-
PROP_NONE
public static final int PROP_NONE- See Also:
-
PROP_POWER
public static final int PROP_POWER- See Also:
-
PROP_ORIENTATION
public static final int PROP_ORIENTATION- See Also:
-
PROP_TOUCH
public static final int PROP_TOUCH- See Also:
-
PROP_INTERACTION
public static final int PROP_INTERACTION- See Also:
-
PROP_DAMAGE
public static final int PROP_DAMAGE- See Also:
-
PROP_CONTROL
public static final int PROP_CONTROL- See Also:
-
-
Constructor Details
-
LensItem
-
-
Method Details
-
appendHoverText
public void appendHoverText(net.minecraft.world.item.ItemStack stack, net.minecraft.world.item.Item.TooltipContext context, List<net.minecraft.network.chat.Component> stacks, net.minecraft.world.item.TooltipFlag flags) - Overrides:
appendHoverTextin classnet.minecraft.world.item.Item
-
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
-
apply
public void apply(net.minecraft.world.item.ItemStack stack, BurstProperties props, net.minecraft.world.level.Level level) Description copied from interface:LensEffectItemCalled when a mana spreader that has this focus shoots a burst. This is where you change the properties of the burst.- Specified by:
applyin interfaceLensEffectItem
-
collideBurst
public boolean collideBurst(ManaBurst burst, net.minecraft.world.phys.HitResult pos, boolean isManaBlock, boolean shouldKill, net.minecraft.world.item.ItemStack stack) Description copied from interface:LensEffectItemCalled when a mana burst fired from a mana spreader with this focus collides against any block or entity. This is called after the collision is handled.- Specified by:
collideBurstin interfaceLensEffectItem- Returns:
- True to kill the burst. False to keep it alive.
-
updateBurst
Description copied from interface:LensEffectItemCalled when a mana burst fired from a mana spreader with this focus is updated. This is called before the update is handled.- Specified by:
updateBurstin interfaceLensEffectItem
-
getLensColor
public int getLensColor(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level) - Specified by:
getLensColorin interfaceBasicLensItem
-
getStoredColor
public static int getStoredColor(net.minecraft.world.item.ItemStack stack) -
setLensColor
public static void setLensColor(net.minecraft.world.item.ItemStack stack, int color) -
doParticles
Description copied from interface:LensEffectItemCalled when the mana burst should do it's particles. Return false to not do any particles.- Specified by:
doParticlesin interfaceLensEffectItem
-
isBlacklisted
public static boolean isBlacklisted(net.minecraft.world.item.ItemStack lens1, net.minecraft.world.item.ItemStack lens2) -
getLens
-
canCombineLenses
public boolean canCombineLenses(net.minecraft.world.item.ItemStack sourceLens, net.minecraft.world.item.ItemStack compositeLens) Description copied from interface:BasicLensItemCan the source lens be combined with the composite lens? This is called for both the BasicLensItem instance of ItemStack.getItem() of sourceLens and compositeLens.- Specified by:
canCombineLensesin interfaceBasicLensItem
-
getCompositeLens
public net.minecraft.world.item.ItemStack getCompositeLens(net.minecraft.world.item.ItemStack stack) Description copied from interface:BasicLensItemGets the composite lens in the stack passed in, return empty for none.- Specified by:
getCompositeLensin interfaceBasicLensItem
-
setCompositeLens
public net.minecraft.world.item.ItemStack setCompositeLens(net.minecraft.world.item.ItemStack sourceLens, net.minecraft.world.item.ItemStack compositeLens) Description copied from interface:BasicLensItemSets the composite lens for the sourceLens as the compositeLens, returns the ItemStack with the combination. If compositeLens is empty, this removes the composite.- Specified by:
setCompositeLensin interfaceBasicLensItem
-
getManaToTransfer
public int getManaToTransfer(ManaBurst burst, net.minecraft.world.item.ItemStack stack, ManaReceiver receiver) Description copied from interface:LensEffectItemGets the amount of mana to transfer to the passed in mana receiver block.- Specified by:
getManaToTransferin interfaceLensEffectItem
-
shouldPull
public boolean shouldPull(net.minecraft.world.item.ItemStack stack) - Specified by:
shouldPullin interfaceTinyPlanetExcempt
-
isControlLens
public boolean isControlLens(net.minecraft.world.item.ItemStack stack) - Specified by:
isControlLensin interfaceControlLensItem
-
allowBurstShooting
public boolean allowBurstShooting(net.minecraft.world.item.ItemStack stack, ManaSpreader spreader, boolean redstone) - Specified by:
allowBurstShootingin interfaceControlLensItem
-
onControlledSpreaderTick
public void onControlledSpreaderTick(net.minecraft.world.item.ItemStack stack, ManaSpreader spreader, boolean redstone) Description copied from interface:ControlLensItemUsed for the tick of a non-redstone spreader.- Specified by:
onControlledSpreaderTickin interfaceControlLensItem
-
onControlledSpreaderPulse
public void onControlledSpreaderPulse(net.minecraft.world.item.ItemStack stack, ManaSpreader spreader) Description copied from interface:ControlLensItemUsed for when a redstone spreader gets a pulse.- Specified by:
onControlledSpreaderPulsein interfaceControlLensItem
-
getProps
public int getProps(net.minecraft.world.item.ItemStack stack) Description copied from interface:CompositableLensItemReturns the properties of the itemstack, used to check if two lenses can combine.- Specified by:
getPropsin interfaceCompositableLensItem
-
isCombinable
public boolean isCombinable(net.minecraft.world.item.ItemStack stack) Description copied from interface:CompositableLensItemChecks if the lens is combinable.- Specified by:
isCombinablein interfaceCompositableLensItem
-