Package com.minecolonies.core.util
Class TeleportHelper
java.lang.Object
com.minecolonies.core.util.TeleportHelper
Helper class for server-side teleporting.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcolonyTeleport(@NotNull net.minecraft.server.level.ServerPlayer player, @NotNull IColony colony) Teleports the player to the given colony.static voidcolonyTeleport(@NotNull net.minecraft.server.level.ServerPlayer player, @NotNull IColony colony, net.minecraft.core.BlockPos pos) Teleports the player to the given colony.static voidcolonyTeleportByID(@NotNull net.minecraft.server.level.ServerPlayer player, int id, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Teleports the player to his home colony.static voidhomeTeleport(@NotNull net.minecraft.server.level.ServerPlayer player) Teleports the player to his home colony.static voidsurfaceTeleport(@NotNull net.minecraft.server.level.ServerPlayer player) Teleports the player to the nearest safe surface location above their current locationstatic booleanteleportCitizen(AbstractEntityCitizen citizen, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos location)
-
Method Details
-
teleportCitizen
public static boolean teleportCitizen(AbstractEntityCitizen citizen, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos location) -
homeTeleport
public static void homeTeleport(@NotNull @NotNull net.minecraft.server.level.ServerPlayer player) Teleports the player to his home colony.- Parameters:
player- the player to teleport home.
-
surfaceTeleport
public static void surfaceTeleport(@NotNull @NotNull net.minecraft.server.level.ServerPlayer player) Teleports the player to the nearest safe surface location above their current location -
colonyTeleportByID
public static void colonyTeleportByID(@NotNull @NotNull net.minecraft.server.level.ServerPlayer player, int id, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension) Teleports the player to his home colony.- Parameters:
dimension- the dimension the colony is in.player- the player to teleport.id- the colony id.
-
colonyTeleport
public static void colonyTeleport(@NotNull @NotNull net.minecraft.server.level.ServerPlayer player, @NotNull @NotNull IColony colony) Teleports the player to the given colony.- Parameters:
player- the player to teleport.colony- the colony to teleport to.
-
colonyTeleport
public static void colonyTeleport(@NotNull @NotNull net.minecraft.server.level.ServerPlayer player, @NotNull @NotNull IColony colony, net.minecraft.core.BlockPos pos) Teleports the player to the given colony.- Parameters:
player- the player to teleport.colony- the colony to teleport to.pos- the preferred position to teleport to.
-