Interface PortalTrackProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A provider for portal track connections.
Takes a track inbound through a portal and finds the exit location for the outbound track.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SimpleRegistry<net.minecraft.world.level.block.Block, PortalTrackProvider> -
Method Summary
Modifier and TypeMethodDescriptionfindExit(net.minecraft.server.level.ServerLevel level, net.createmod.catnip.math.BlockFace face) Find the exit location for a track going through a portal.static PortalTrackProvider.ExitfromPortal(net.minecraft.server.level.ServerLevel level, net.createmod.catnip.math.BlockFace face, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> firstDimension, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> secondDimension, net.minecraft.world.level.block.Portal portal) Find an exit location by using anPortalinstance.static @Nullable PortalTrackProvider.ExitgetOtherSide(net.minecraft.server.level.ServerLevel level, net.createmod.catnip.math.BlockFace inboundTrack) Retrieves the corresponding outbound track on the other side of a portal.static booleanisSupportedPortal(net.minecraft.world.level.block.state.BlockState state) Checks if a givenBlockStaterepresents a supported portal block.
-
Field Details
-
REGISTRY
-
-
Method Details
-
findExit
PortalTrackProvider.Exit findExit(net.minecraft.server.level.ServerLevel level, net.createmod.catnip.math.BlockFace face) Find the exit location for a track going through a portal.- Parameters:
level- the level of the inbound trackface- the face of the inbound track
-
isSupportedPortal
static boolean isSupportedPortal(net.minecraft.world.level.block.state.BlockState state) Checks if a givenBlockStaterepresents a supported portal block.- Parameters:
state- The block state to check.- Returns:
trueif the block state represents a supported portal;falseotherwise.
-
getOtherSide
@Nullable static @Nullable PortalTrackProvider.Exit getOtherSide(net.minecraft.server.level.ServerLevel level, net.createmod.catnip.math.BlockFace inboundTrack) Retrieves the corresponding outbound track on the other side of a portal.- Parameters:
level- The currentServerLevel.inboundTrack- The inbound trackBlockFace.- Returns:
- the found outbound track, or null if one wasn't found.
-
fromPortal
static PortalTrackProvider.Exit fromPortal(net.minecraft.server.level.ServerLevel level, net.createmod.catnip.math.BlockFace face, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> firstDimension, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> secondDimension, net.minecraft.world.level.block.Portal portal) Find an exit location by using anPortalinstance.- Parameters:
level- The level of the inbound trackface- The face of the inbound trackfirstDimension- The first dimension (typically the Overworld)secondDimension- The second dimension (e.g., Nether, Aether)portal- The portal- Returns:
- A found exit, or null if one wasn't found
-