Interface PortalTeleporter
- All Known Implementing Classes:
FlatPortalFrameTester, PortalFrameTester, VerticalPortalFrameTester
public interface PortalTeleporter
Interface for calculating teleportation destinations and offsets. Responsible for determining where entities should
be teleported within portals.
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.phys.Vec3getEntityOffsetInPortal(net.minecraft.util.BlockUtil.FoundRectangle portalRect, net.minecraft.world.entity.Entity entity) Calculate the entity's offset within the source portal.net.minecraft.world.level.portal.TeleportTransitiongetTeleportTargetInPortal(net.minecraft.server.level.ServerLevel serverLevel, net.minecraft.util.BlockUtil.FoundRectangle portalRect, net.minecraft.core.Direction.Axis portalAxis, net.minecraft.world.phys.Vec3 prevOffset, net.minecraft.world.entity.Entity entity, PortalLink link) Calculate the teleportation target within the destination portal.
-
Method Details
-
getEntityOffsetInPortal
net.minecraft.world.phys.Vec3 getEntityOffsetInPortal(net.minecraft.util.BlockUtil.FoundRectangle portalRect, net.minecraft.world.entity.Entity entity) Calculate the entity's offset within the source portal. This is used to preserve relative position when teleporting.- Parameters:
portalRect- the rectangular bounds of the portalentity- the entity entering the portal- Returns:
- the entity's offset within the portal
-
getTeleportTargetInPortal
net.minecraft.world.level.portal.TeleportTransition getTeleportTargetInPortal(net.minecraft.server.level.ServerLevel serverLevel, net.minecraft.util.BlockUtil.FoundRectangle portalRect, net.minecraft.core.Direction.Axis portalAxis, net.minecraft.world.phys.Vec3 prevOffset, net.minecraft.world.entity.Entity entity, PortalLink link) Calculate the teleportation target within the destination portal.- Parameters:
serverLevel- the destination levelportalRect- the rectangular bounds of the destination portalportalAxis- the axis of the portalprevOffset- the entity's offset from the source portalentity- the entity being teleportedlink- the portal configuration link- Returns:
- the teleport transition describing the destination
-