com.amoebaman.kitmaster.utilities
Class S_Location

java.lang.Object
  extended by com.amoebaman.kitmaster.utilities.S_Location

public class S_Location
extends java.lang.Object

Contains methods for converting Locations to and from saveable forms.

Author:
Dennison

Constructor Summary
S_Location()
           
 
Method Summary
static org.bukkit.Location configLoad(org.bukkit.configuration.ConfigurationSection config)
          Loads a Location from a ConfigurationSection, taking its values from fields in the section.
static void configSave(org.bukkit.Location loc, org.bukkit.configuration.ConfigurationSection config)
          Saves a Location to a ConfigurationSection.
static org.bukkit.Location stringLoad(java.lang.String str)
          Loads a Location from a String.
static java.lang.String stringSave(org.bukkit.Location loc)
          Saves a Location to a String.
static java.lang.String toString(org.bukkit.Location loc)
          Gets a more user-friendly String version of a Location;
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

S_Location

public S_Location()
Method Detail

configSave

public static void configSave(org.bukkit.Location loc,
                              org.bukkit.configuration.ConfigurationSection config)
Saves a Location to a ConfigurationSection. This method will define fields within the section that describe its values.

Parameters:
loc - The location to save.
config - The section to save to.

configLoad

public static org.bukkit.Location configLoad(org.bukkit.configuration.ConfigurationSection config)
Loads a Location from a ConfigurationSection, taking its values from fields in the section. Values not defined will be set to their corresponding values from the origin location (0, 64, 0).

Parameters:
config - The section to load from.
Returns:
The loaded location.

stringSave

public static java.lang.String stringSave(org.bukkit.Location loc)
Saves a Location to a String.

Parameters:
loc - The Location to save.
Returns:
The string.

stringLoad

public static org.bukkit.Location stringLoad(java.lang.String str)
Loads a Location from a String. If an error occurs while parsing the string, the origin location (0, 64, 0) will be returned.

Parameters:
str - The string to load from.
Returns:
The loaded location, or the origin location if an error occurs.

toString

public static java.lang.String toString(org.bukkit.Location loc)
Gets a more user-friendly String version of a Location;

Parameters:
loc - The location.
Returns:
The string.