Package org.cyclops.cyclopscore.item
Interface IInformationProvider
- All Known Implementing Classes:
DamageIndicatedItemFluidContainer
public interface IInformationProvider
Interface that can be applied to
Block
or Item
so that they can provide information
when the player hovers over the item in their inventory.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final net.minecraft.ChatFormatting
A prefix for blockState information.static final String
A prefix for additional info.static final net.minecraft.ChatFormatting[]
Additional info prefix stylesstatic final net.minecraft.ChatFormatting
A prefix for item information. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.MutableComponent
getInfo
(net.minecraft.world.item.ItemStack itemStack) Get info for a given itemStack.void
provideInformation
(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.Level world, List<net.minecraft.network.chat.Component> list, net.minecraft.world.item.TooltipFlag flag) An extended way to provide additional information.
-
Field Details
-
BLOCK_PREFIX
static final net.minecraft.ChatFormatting BLOCK_PREFIXA prefix for blockState information. -
ITEM_PREFIX
static final net.minecraft.ChatFormatting ITEM_PREFIXA prefix for item information. -
INFO_PREFIX
A prefix for additional info. -
INFO_PREFIX_STYLES
static final net.minecraft.ChatFormatting[] INFO_PREFIX_STYLESAdditional info prefix styles
-
-
Method Details
-
getInfo
net.minecraft.network.chat.MutableComponent getInfo(net.minecraft.world.item.ItemStack itemStack) Get info for a given itemStack.- Parameters:
itemStack
- The itemStack that must be given information.- Returns:
- Information for that itemStack.
-
provideInformation
void provideInformation(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.Level world, List<net.minecraft.network.chat.Component> list, net.minecraft.world.item.TooltipFlag flag) An extended way to provide additional information.- Parameters:
itemStack
- The itemStack that must be given information.world
- The player that asks for information.list
- The list of information.flag
- The tooltip flag type.
-