Package at.petrak.hexcasting.api.client
Class ScryingLensOverlayRegistry
java.lang.Object
at.petrak.hexcasting.api.client.ScryingLensOverlayRegistry
Use this to make things display when the player looks at things with a Scrying Lens.
Client-side only.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceReturn the lines displayed by the cursor: an item and some text.static interfacePredicate for matching on a block state. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddDisplayer(net.minecraft.resources.ResourceLocation blockID, ScryingLensOverlayRegistry.OverlayBuilder displayer) Add the block to display things when the player is holding a lens and looking at it.static voidaddDisplayer(net.minecraft.world.level.block.Block block, ScryingLensOverlayRegistry.OverlayBuilder displayer) Add the block to display things when the player is holding a lens and looking at it.static voidaddPredicateDisplayer(ScryingLensOverlayRegistry.OverlayPredicate predicate, ScryingLensOverlayRegistry.OverlayBuilder displayer) Display things when the player is holding a lens and looking at some block via a predicate.static @NotNull List<com.mojang.datafixers.util.Pair<net.minecraft.world.item.ItemStack,net.minecraft.network.chat.Component>> getLines(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player observer, net.minecraft.world.level.Level world, net.minecraft.core.Direction hitFace) Internal use only.
-
Constructor Details
-
ScryingLensOverlayRegistry
public ScryingLensOverlayRegistry()
-
-
Method Details
-
addDisplayer
public static void addDisplayer(net.minecraft.world.level.block.Block block, ScryingLensOverlayRegistry.OverlayBuilder displayer) Add the block to display things when the player is holding a lens and looking at it.- Throws:
IllegalArgumentException- if the block is already registered.
-
addDisplayer
public static void addDisplayer(net.minecraft.resources.ResourceLocation blockID, ScryingLensOverlayRegistry.OverlayBuilder displayer) Add the block to display things when the player is holding a lens and looking at it.- Throws:
IllegalArgumentException- if the block ID is already registered.
-
addPredicateDisplayer
public static void addPredicateDisplayer(ScryingLensOverlayRegistry.OverlayPredicate predicate, ScryingLensOverlayRegistry.OverlayBuilder displayer) Display things when the player is holding a lens and looking at some block via a predicate.These have a lower priority than the standard ID-based displays, so if an ID and predicate both match, this won't be displayed.
-
getLines
@NotNull public static @NotNull List<com.mojang.datafixers.util.Pair<net.minecraft.world.item.ItemStack,net.minecraft.network.chat.Component>> getLines(net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player observer, net.minecraft.world.level.Level world, net.minecraft.core.Direction hitFace) Internal use only.
-