Class TeleportHelper

java.lang.Object
com.minecolonies.core.util.TeleportHelper

public final class TeleportHelper extends Object
Helper class for server-side teleporting.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    colonyTeleport(@NotNull net.minecraft.server.level.ServerPlayer player, @NotNull IColony colony)
    Teleports the player to the given colony.
    static void
    colonyTeleport(@NotNull net.minecraft.server.level.ServerPlayer player, @NotNull IColony colony, net.minecraft.core.BlockPos pos)
    Teleports the player to the given colony.
    static void
    colonyTeleportByID(@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 void
    homeTeleport(@NotNull net.minecraft.server.level.ServerPlayer player)
    Teleports the player to his home colony.
    static void
    surfaceTeleport(@NotNull net.minecraft.server.level.ServerPlayer player)
    Teleports the player to the nearest safe surface location above their current location
    static boolean
    teleportCitizen(AbstractEntityCitizen citizen, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos location)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.