Class SpawnUtil
java.lang.Object
com.palmergames.bukkit.towny.utils.SpawnUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
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.static void
initialize
(Towny plugin) static void
jailAwayTeleport
(Resident jailed) Used to teleport a jailed resident away from jail, upon gaining freedom.static void
jailTeleport
(Resident jailed) Used to teleport a newly jailed resident to jail.static void
outlawTeleport
(Town town, Resident outlaw) Handles moving outlaws from outside of towns they are outlawed in.static void
sendToTownySpawn
(org.bukkit.entity.Player player, String[] split, TownyObject townyObject, String notAffordMSG, boolean outpost, boolean ignoreWarn, SpawnType spawnType) Central method used for /res, /t, /n, /ta spawn commands.
-
Constructor Details
-
SpawnUtil
public SpawnUtil()
-
-
Method Details
-
initialize
-
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
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
Used to teleport a jailed resident away from jail, upon gaining freedom.- Parameters:
jailed
- Resident which is being moved from jail.
-
jailTeleport
Used to teleport a newly jailed resident to jail.- Parameters:
jailed
- Resident going off to the slammer.
-
addAndRemoveChunkTicket
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.
-