Class PlaceholderMimicItem
java.lang.Object
net.minecraft.item.Item
dev.jaxydog.astral.content.item.AstralItem
dev.jaxydog.astral.content.item.custom.PlaceholderItem
dev.jaxydog.astral.content.item.custom.PlaceholderMimicItem
- All Implemented Interfaces:
Custom,Customized,LoreHolder,Registered,Registered.Common,net.fabricmc.fabric.api.item.v1.FabricItem,net.minecraft.item.Equipment,net.minecraft.item.ItemConvertible,net.minecraft.item.Vanishable,net.minecraft.resource.featuretoggle.ToggleableFeature
Implements a placeholder item, or an item that exists to mimic pre-existing items.
- Since:
- 1.4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA group of mimicking placeholder items.Nested classes/interfaces inherited from class net.minecraft.item.Item
net.minecraft.item.Item.SettingsNested classes/interfaces inherited from interface dev.jaxydog.astral.register.Registered
Registered.All, Registered.Client, Registered.Common, Registered.Generated, Registered.Server -
Field Summary
Fields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, DEFAULT_MAX_COUNT, DEFAULT_MAX_USE_TIME, ITEM_BAR_STEPSFields inherited from interface dev.jaxydog.astral.content.item.Customized
CUSTOM_MODEL_DATA_KEYFields inherited from interface net.minecraft.resource.featuretoggle.ToggleableFeature
FEATURE_ENABLED_REGISTRY_KEYS -
Constructor Summary
ConstructorsConstructorDescriptionPlaceholderMimicItem(String path, net.minecraft.item.Item.Settings settings, @Nullable Supplier<net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>> preferredGroup, Supplier<net.minecraft.item.Item> item) Creates a new item using the given settings.PlaceholderMimicItem(String path, net.minecraft.item.Item.Settings settings, Supplier<net.minecraft.item.Item> item) Creates a new item using the given settings. -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowContinuingBlockBreaking(net.minecraft.entity.player.PlayerEntity player, net.minecraft.item.ItemStack oldStack, net.minecraft.item.ItemStack newStack) booleanallowNbtUpdateAnimation(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Hand hand, net.minecraft.item.ItemStack oldStack, net.minecraft.item.ItemStack newStack) voidappendTooltip(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, List<net.minecraft.text.Text> tooltip, net.minecraft.client.item.TooltipContext context) booleanbooleancanMine(net.minecraft.block.BlockState state, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.entity.player.PlayerEntity miner) booleancanRepair(net.minecraft.item.ItemStack stack, net.minecraft.item.ItemStack ingredient) booleandamage(net.minecraft.entity.damage.DamageSource source) net.minecraft.util.TypedActionResult<net.minecraft.item.ItemStack> equipAndSwap(net.minecraft.item.Item item, net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) net.minecraft.item.ItemStackfinishUsing(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.entity.LivingEntity user) com.google.common.collect.Multimap<net.minecraft.entity.attribute.EntityAttribute, net.minecraft.entity.attribute.EntityAttributeModifier> getAttributeModifiers(net.minecraft.entity.EquipmentSlot slot) com.google.common.collect.Multimap<net.minecraft.entity.attribute.EntityAttribute, net.minecraft.entity.attribute.EntityAttributeModifier> getAttributeModifiers(net.minecraft.item.ItemStack stack, net.minecraft.entity.EquipmentSlot slot) getCustomModelData(net.minecraft.item.ItemStack stack) Returns the given stack's assigned custom model data.net.minecraft.item.ItemStacknet.minecraft.sound.SoundEventnet.minecraft.sound.SoundEventintnet.minecraft.sound.SoundEventnet.minecraft.item.FoodComponentnet.minecraft.item.ItemgetItem()Returns the mimicked item.net.minecraft.item.ItemgetItem(net.minecraft.item.ItemStack stack) Returns the mimicked item depending on the provided stack.intgetItemBarColor(net.minecraft.item.ItemStack stack) intgetItemBarStep(net.minecraft.item.ItemStack stack) intgetMaxUseTime(net.minecraft.item.ItemStack stack) floatgetMiningSpeedMultiplier(net.minecraft.item.ItemStack stack, net.minecraft.block.BlockState state) net.minecraft.util.RaritygetRarity(net.minecraft.item.ItemStack stack) net.minecraft.item.ItemStackgetRecipeRemainder(net.minecraft.item.ItemStack stack) net.minecraft.resource.featuretoggle.FeatureSetnet.minecraft.entity.EquipmentSlotOptional<net.minecraft.client.item.TooltipData> getTooltipData(net.minecraft.item.ItemStack stack) net.minecraft.util.UseActiongetUseAction(net.minecraft.item.ItemStack stack) booleanhasGlint(net.minecraft.item.ItemStack stack) booleanvoidinventoryTick(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.entity.Entity entity, int slot, boolean selected) booleanbooleanisEnabled(net.minecraft.resource.featuretoggle.FeatureSet enabledFeatures) booleanisEnchantable(net.minecraft.item.ItemStack stack) booleanbooleanisFood()booleanisItemBarVisible(net.minecraft.item.ItemStack stack) booleanbooleanisSuitableFor(net.minecraft.block.BlockState state) booleanisSuitableFor(net.minecraft.item.ItemStack stack, net.minecraft.block.BlockState state) booleanisUsedOnRelease(net.minecraft.item.ItemStack stack) booleanonClicked(net.minecraft.item.ItemStack stack, net.minecraft.item.ItemStack held, net.minecraft.screen.slot.Slot slot, net.minecraft.util.ClickType type, net.minecraft.entity.player.PlayerEntity player, net.minecraft.inventory.StackReference cursor) voidonCraft(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity player) voidonItemEntityDestroyed(net.minecraft.entity.ItemEntity entity) booleanonStackClicked(net.minecraft.item.ItemStack stack, net.minecraft.screen.slot.Slot slot, net.minecraft.util.ClickType clickType, net.minecraft.entity.player.PlayerEntity player) voidonStoppedUsing(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.entity.LivingEntity user, int remainingUseTicks) booleanpostHit(net.minecraft.item.ItemStack stack, net.minecraft.entity.LivingEntity target, net.minecraft.entity.LivingEntity attacker) booleanpostMine(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.block.BlockState state, net.minecraft.util.math.BlockPos pos, net.minecraft.entity.LivingEntity miner) voidpostProcessNbt(net.minecraft.nbt.NbtCompound nbt) voidsetCustomModelData(net.minecraft.item.ItemStack stack, int data) Sets the given stack's custom model data.voidusageTick(net.minecraft.world.World world, net.minecraft.entity.LivingEntity user, net.minecraft.item.ItemStack stack, int remainingUseTicks) net.minecraft.util.TypedActionResult<net.minecraft.item.ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) net.minecraft.util.ActionResultuseOnBlock(net.minecraft.item.ItemUsageContext context) net.minecraft.util.ActionResultuseOnEntity(net.minecraft.item.ItemStack stack, net.minecraft.entity.player.PlayerEntity user, net.minecraft.entity.LivingEntity entity, net.minecraft.util.Hand hand) Methods inherited from class dev.jaxydog.astral.content.item.custom.PlaceholderItem
getTranslationKeyMethods inherited from class dev.jaxydog.astral.content.item.AstralItem
getItemGroup, getRegistryPathMethods inherited from class net.minecraft.item.Item
asItem, byRawId, fromBlock, getMaxCount, getMaxDamage, getName, getName, getOrCreateTranslationKey, getRawId, getRecipeRemainder, getRegistryEntry, getTranslationKey, isNetworkSynced, raycast, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.jaxydog.astral.content.item.Custom
registerCommonMethods inherited from interface net.minecraft.item.ItemConvertible
asItemMethods inherited from interface dev.jaxydog.astral.content.item.LoreHolder
formatLoreText, getLoreTooltipsMethods inherited from interface dev.jaxydog.astral.register.Registered
getRegistryId
-
Constructor Details
-
PlaceholderMimicItem
public PlaceholderMimicItem(String path, net.minecraft.item.Item.Settings settings, @Nullable @Nullable Supplier<net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>> preferredGroup, Supplier<net.minecraft.item.Item> item) Creates a new item using the given settings.If the
#preferredGroupsupplier isnull, this item will not be added to any item groups.- Parameters:
path- The item's identifier path.settings- The item's settings.preferredGroup- The item's preferred item group.- Since:
- 2.0.0
-
PlaceholderMimicItem
public PlaceholderMimicItem(String path, net.minecraft.item.Item.Settings settings, Supplier<net.minecraft.item.Item> item) Creates a new item using the given settings.This item will be added to the default item group.
- Parameters:
path- The item's identifier path.settings- The item's settings.- Since:
- 1.4.0
-
-
Method Details
-
getItem
public net.minecraft.item.Item getItem()Returns the mimicked item.- Returns:
- The item.
- Since:
- 1.4.0
-
getItem
public net.minecraft.item.Item getItem(net.minecraft.item.ItemStack stack) Returns the mimicked item depending on the provided stack.The default implementation just calls
getItem().- Parameters:
stack- The item stack.- Returns:
- The item.
- Since:
- 1.4.0
-
getSlotType
public net.minecraft.entity.EquipmentSlot getSlotType()- Specified by:
getSlotTypein interfacenet.minecraft.item.Equipment- Overrides:
getSlotTypein classPlaceholderItem
-
usageTick
public void usageTick(net.minecraft.world.World world, net.minecraft.entity.LivingEntity user, net.minecraft.item.ItemStack stack, int remainingUseTicks) - Overrides:
usageTickin classnet.minecraft.item.Item
-
onItemEntityDestroyed
public void onItemEntityDestroyed(net.minecraft.entity.ItemEntity entity) - Overrides:
onItemEntityDestroyedin classnet.minecraft.item.Item
-
postProcessNbt
public void postProcessNbt(net.minecraft.nbt.NbtCompound nbt) - Overrides:
postProcessNbtin classnet.minecraft.item.Item
-
canMine
public boolean canMine(net.minecraft.block.BlockState state, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.entity.player.PlayerEntity miner) - Overrides:
canMinein classnet.minecraft.item.Item
-
useOnBlock
public net.minecraft.util.ActionResult useOnBlock(net.minecraft.item.ItemUsageContext context) - Overrides:
useOnBlockin classnet.minecraft.item.Item
-
getMiningSpeedMultiplier
public float getMiningSpeedMultiplier(net.minecraft.item.ItemStack stack, net.minecraft.block.BlockState state) - Overrides:
getMiningSpeedMultiplierin classnet.minecraft.item.Item
-
use
public net.minecraft.util.TypedActionResult<net.minecraft.item.ItemStack> use(net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) - Overrides:
usein classnet.minecraft.item.Item
-
finishUsing
public net.minecraft.item.ItemStack finishUsing(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.entity.LivingEntity user) - Overrides:
finishUsingin classnet.minecraft.item.Item
-
isDamageable
public boolean isDamageable()- Overrides:
isDamageablein classnet.minecraft.item.Item
-
isItemBarVisible
public boolean isItemBarVisible(net.minecraft.item.ItemStack stack) - Overrides:
isItemBarVisiblein classnet.minecraft.item.Item
-
getItemBarStep
public int getItemBarStep(net.minecraft.item.ItemStack stack) - Overrides:
getItemBarStepin classnet.minecraft.item.Item
-
getItemBarColor
public int getItemBarColor(net.minecraft.item.ItemStack stack) - Overrides:
getItemBarColorin classnet.minecraft.item.Item
-
onStackClicked
public boolean onStackClicked(net.minecraft.item.ItemStack stack, net.minecraft.screen.slot.Slot slot, net.minecraft.util.ClickType clickType, net.minecraft.entity.player.PlayerEntity player) - Overrides:
onStackClickedin classnet.minecraft.item.Item
-
onClicked
public boolean onClicked(net.minecraft.item.ItemStack stack, net.minecraft.item.ItemStack held, net.minecraft.screen.slot.Slot slot, net.minecraft.util.ClickType type, net.minecraft.entity.player.PlayerEntity player, net.minecraft.inventory.StackReference cursor) - Overrides:
onClickedin classnet.minecraft.item.Item
-
postHit
public boolean postHit(net.minecraft.item.ItemStack stack, net.minecraft.entity.LivingEntity target, net.minecraft.entity.LivingEntity attacker) - Overrides:
postHitin classnet.minecraft.item.Item
-
postMine
public boolean postMine(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.block.BlockState state, net.minecraft.util.math.BlockPos pos, net.minecraft.entity.LivingEntity miner) - Overrides:
postMinein classnet.minecraft.item.Item
-
isSuitableFor
public boolean isSuitableFor(net.minecraft.block.BlockState state) - Overrides:
isSuitableForin classnet.minecraft.item.Item
-
useOnEntity
public net.minecraft.util.ActionResult useOnEntity(net.minecraft.item.ItemStack stack, net.minecraft.entity.player.PlayerEntity user, net.minecraft.entity.LivingEntity entity, net.minecraft.util.Hand hand) - Overrides:
useOnEntityin classnet.minecraft.item.Item
-
isNbtSynced
public boolean isNbtSynced()- Overrides:
isNbtSyncedin classnet.minecraft.item.Item
-
hasRecipeRemainder
public boolean hasRecipeRemainder()- Overrides:
hasRecipeRemainderin classnet.minecraft.item.Item
-
inventoryTick
public void inventoryTick(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.entity.Entity entity, int slot, boolean selected) - Overrides:
inventoryTickin classnet.minecraft.item.Item
-
onCraft
public void onCraft(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity player) - Overrides:
onCraftin classnet.minecraft.item.Item
-
getUseAction
public net.minecraft.util.UseAction getUseAction(net.minecraft.item.ItemStack stack) - Overrides:
getUseActionin classnet.minecraft.item.Item
-
getMaxUseTime
public int getMaxUseTime(net.minecraft.item.ItemStack stack) - Overrides:
getMaxUseTimein classnet.minecraft.item.Item
-
onStoppedUsing
public void onStoppedUsing(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, net.minecraft.entity.LivingEntity user, int remainingUseTicks) - Overrides:
onStoppedUsingin classnet.minecraft.item.Item
-
getTooltipData
public Optional<net.minecraft.client.item.TooltipData> getTooltipData(net.minecraft.item.ItemStack stack) - Overrides:
getTooltipDatain classnet.minecraft.item.Item
-
hasGlint
public boolean hasGlint(net.minecraft.item.ItemStack stack) - Overrides:
hasGlintin classnet.minecraft.item.Item
-
getRarity
public net.minecraft.util.Rarity getRarity(net.minecraft.item.ItemStack stack) - Overrides:
getRarityin classnet.minecraft.item.Item
-
isEnchantable
public boolean isEnchantable(net.minecraft.item.ItemStack stack) - Overrides:
isEnchantablein classnet.minecraft.item.Item
-
getEnchantability
public int getEnchantability()- Overrides:
getEnchantabilityin classnet.minecraft.item.Item
-
canRepair
public boolean canRepair(net.minecraft.item.ItemStack stack, net.minecraft.item.ItemStack ingredient) - Overrides:
canRepairin classnet.minecraft.item.Item
-
getAttributeModifiers
public com.google.common.collect.Multimap<net.minecraft.entity.attribute.EntityAttribute,net.minecraft.entity.attribute.EntityAttributeModifier> getAttributeModifiers(net.minecraft.entity.EquipmentSlot slot) - Overrides:
getAttributeModifiersin classnet.minecraft.item.Item
-
isUsedOnRelease
public boolean isUsedOnRelease(net.minecraft.item.ItemStack stack) - Overrides:
isUsedOnReleasein classnet.minecraft.item.Item
-
getDefaultStack
public net.minecraft.item.ItemStack getDefaultStack()- Overrides:
getDefaultStackin classnet.minecraft.item.Item
-
isFood
public boolean isFood()- Overrides:
isFoodin classnet.minecraft.item.Item
-
getFoodComponent
public net.minecraft.item.FoodComponent getFoodComponent()- Overrides:
getFoodComponentin classnet.minecraft.item.Item
-
getDrinkSound
public net.minecraft.sound.SoundEvent getDrinkSound()- Overrides:
getDrinkSoundin classnet.minecraft.item.Item
-
getEatSound
public net.minecraft.sound.SoundEvent getEatSound()- Overrides:
getEatSoundin classnet.minecraft.item.Item
-
isFireproof
public boolean isFireproof()- Overrides:
isFireproofin classnet.minecraft.item.Item
-
damage
public boolean damage(net.minecraft.entity.damage.DamageSource source) - Overrides:
damagein classnet.minecraft.item.Item
-
canBeNested
public boolean canBeNested()- Overrides:
canBeNestedin classnet.minecraft.item.Item
-
getRequiredFeatures
public net.minecraft.resource.featuretoggle.FeatureSet getRequiredFeatures()- Specified by:
getRequiredFeaturesin interfacenet.minecraft.resource.featuretoggle.ToggleableFeature- Overrides:
getRequiredFeaturesin classnet.minecraft.item.Item
-
appendTooltip
public void appendTooltip(net.minecraft.item.ItemStack stack, net.minecraft.world.World world, List<net.minecraft.text.Text> tooltip, net.minecraft.client.item.TooltipContext context) - Overrides:
appendTooltipin classAstralItem
-
isEnabled
public boolean isEnabled(net.minecraft.resource.featuretoggle.FeatureSet enabledFeatures) -
allowNbtUpdateAnimation
public boolean allowNbtUpdateAnimation(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Hand hand, net.minecraft.item.ItemStack oldStack, net.minecraft.item.ItemStack newStack) -
allowContinuingBlockBreaking
public boolean allowContinuingBlockBreaking(net.minecraft.entity.player.PlayerEntity player, net.minecraft.item.ItemStack oldStack, net.minecraft.item.ItemStack newStack) -
getAttributeModifiers
public com.google.common.collect.Multimap<net.minecraft.entity.attribute.EntityAttribute,net.minecraft.entity.attribute.EntityAttributeModifier> getAttributeModifiers(net.minecraft.item.ItemStack stack, net.minecraft.entity.EquipmentSlot slot) -
isSuitableFor
public boolean isSuitableFor(net.minecraft.item.ItemStack stack, net.minecraft.block.BlockState state) -
getRecipeRemainder
public net.minecraft.item.ItemStack getRecipeRemainder(net.minecraft.item.ItemStack stack) -
getEquipSound
public net.minecraft.sound.SoundEvent getEquipSound() -
equipAndSwap
public net.minecraft.util.TypedActionResult<net.minecraft.item.ItemStack> equipAndSwap(net.minecraft.item.Item item, net.minecraft.world.World world, net.minecraft.entity.player.PlayerEntity user, net.minecraft.util.Hand hand) -
getCustomModelData
Description copied from interface:CustomizedReturns the given stack's assigned custom model data.If the key is present but is not assigned to a valid number,
Optional.of(0)is returned.- Parameters:
stack- The item stack.- Returns:
- The custom model data.
-
setCustomModelData
public void setCustomModelData(net.minecraft.item.ItemStack stack, int data) Description copied from interface:CustomizedSets the given stack's custom model data.- Parameters:
stack- The item stack.data- The custom model data.
-