Class SpawnUtil

java.lang.Object
com.palmergames.bukkit.towny.utils.SpawnUtil

public class SpawnUtil extends Object
  • Constructor Details

    • SpawnUtil

      public SpawnUtil()
  • Method Details

    • initialize

      public static void initialize(Towny plugin)
    • sendToTownySpawn

      public static void sendToTownySpawn(org.bukkit.entity.Player player, String[] split, TownyObject townyObject, String notAffordMSG, boolean outpost, boolean ignoreWarn, SpawnType spawnType) throws TownyException
      Central method used for /res, /t, /n, /ta spawn commands.
      Parameters:
      player - Player using spawn command.
      split - Remaining command arguments, used primarily for outposts.
      townyObject - Either a town or nation depending on source command.
      notAffordMSG - Message shown when a player cannot afford their teleport.
      outpost - Whether this is an outpost or not.
      ignoreWarn - Whether to show confirmation for payment or just pay without confirmation.
      spawnType - SpawnType.RESIDENT/TOWN/NATION
      Throws:
      TownyException - Thrown if any of the vital conditions are not met.
    • outlawTeleport

      public static void outlawTeleport(Town town, Resident outlaw)
      Handles moving outlaws from outside of towns they are outlawed in.
      Parameters:
      town - Town which they are outlawed in.
      outlaw - Resident which is outlawed and being moved.
    • jailAwayTeleport

      public static void jailAwayTeleport(Resident jailed)
      Used to teleport a jailed resident away from jail, upon gaining freedom.
      Parameters:
      jailed - Resident which is being moved from jail.
    • jailTeleport

      public static void jailTeleport(Resident jailed)
      Used to teleport a newly jailed resident to jail.
      Parameters:
      jailed - Resident going off to the slammer.
    • addAndRemoveChunkTicket

      public static void addAndRemoveChunkTicket(WorldCoord wc)
      On some servers, when the player is teleported the chunk they left will unload before the server ticks, causing any pets they have following them to be abandoned. This method will cause a chunk to remain loaded long enough for the pets to be teleported to the player naturally.
      Parameters:
      wc - WorldCoord from which the player is leaving.