Package org.cyclops.cyclopscore.item
Class InformationProviderComponent
java.lang.Object
org.cyclops.cyclopscore.item.InformationProviderComponent
A component that can be used for
IInformationProvider implementations.-
Constructor Summary
ConstructorsConstructorDescriptionInformationProviderComponent(net.minecraft.world.level.block.Block block) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInformation(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) Add information to the given list for the given item.net.minecraft.world.level.block.BlockgetBlock()Get the blockState that uses this component.booleanIf the blockState that uses this component implementsIInformationProvider.voidsetBlock(net.minecraft.world.level.block.Block block) Set the blockState that uses this component.
-
Constructor Details
-
InformationProviderComponent
public InformationProviderComponent(net.minecraft.world.level.block.Block block) Make a new instance.- Parameters:
block- The blockState for which the component is used.
-
-
Method Details
-
addInformation
public void addInformation(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) Add information to the given list for the given item.- Parameters:
itemStack- TheItemStackto add info for.world- The player that will see the info.list- The info list where the info will be added.flag- No idea...
-
isHasInfo
public boolean isHasInfo()If the blockState that uses this component implementsIInformationProvider.- Returns:
- If the blockState provides info.
-
getBlock
public net.minecraft.world.level.block.Block getBlock()Get the blockState that uses this component.- Returns:
- The blockState.
-
setBlock
public void setBlock(net.minecraft.world.level.block.Block block) Set the blockState that uses this component.- Parameters:
block- The blockState.
-