Class LocationData
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.bukkit.Location> parseCompactLocations(String dataString) Parses a list of locations from a compact data stringstatic org.bukkit.LocationparseLocation(String dataString) Parses a location from a data stringstatic List<org.bukkit.Location> parseLocations(List<String> dataStrings) Parses a list of locations from a list of data stringsstatic StringserializeCompactDetailedLocations(List<org.bukkit.Location> locations) Serializes a list of locations into a single string, keeping only the exact coordinates without yaw or pitchstatic StringserializeCompactLocations(List<org.bukkit.Location> locations) Serializes a list of locations into a single string, keeping only the exact coordinates without yaw or pitchstatic StringserializeCompactSimpleLocations(List<org.bukkit.Location> locations) Serializes a list of locations into a single string, keeping only the block coordinatesstatic StringserializeDetailedLocation(org.bukkit.Location loc) Serializes all data for a location including exact coordinates, yaw, and pitchserializeDetailedLocations(List<org.bukkit.Location> locations) Serializes a list of locations, preserving the exact coordinates, yaw, and pitchstatic StringserializeLocation(org.bukkit.Location loc) Serializes a location with the exact coordinates but without keeping the yaw and pitchserializeLocations(List<org.bukkit.Location> locations) Serializes a list of locations, preserving the exact coordinates but not the yaw and pitchstatic StringserializeSimpleLocation(org.bukkit.Location loc) Serializes a location using as little space as possibleserializeSimpleLocations(List<org.bukkit.Location> locations) Serializes a list of locations, preserving the block coordinates only
-
Constructor Details
-
LocationData
public LocationData()
-
-
Method Details
-
serializeSimpleLocation
Serializes a location using as little space as possible
This only keeps the block coordinates instead of the precise coordinates
Yaw and pitch are not preserved either
Returns null for a null location
- Parameters:
loc- location to serialize- Returns:
- data string
-
serializeLocation
Serializes a location with the exact coordinates but without keeping the yaw and pitch
Returns null for a null location
- Parameters:
loc- location to serialize- Returns:
- data string
-
serializeDetailedLocation
Serializes all data for a location including exact coordinates, yaw, and pitch
Returns null for a null location
- Parameters:
loc- location to serialize- Returns:
- data string
-
parseLocation
Parses a location from a data string
This accepts simple, normal, and detailed locations
Returns null for invalid formats or a null data string
- Parameters:
dataString- data string to parse- Returns:
- parsed location
-
serializeSimpleLocations
Serializes a list of locations, preserving the block coordinates only
If the provided list is null or empty, this method returns null
- Parameters:
locations- locations to serialize- Returns:
- list of data strings
-
serializeLocations
Serializes a list of locations, preserving the exact coordinates but not the yaw and pitch
If the provided list is null or empty, this method returns null
- Parameters:
locations- locations to serialize- Returns:
- list of data strings
-
serializeDetailedLocations
Serializes a list of locations, preserving the exact coordinates, yaw, and pitch
If the provided list is null or empty, this method returns null
- Parameters:
locations- locations to serialize- Returns:
- list of data strings
-
parseLocations
Parses a list of locations from a list of data strings
This method accepts simple, normal, and detailed data string lists
If the provided list is null or empty, this method returns null
- Parameters:
dataStrings- data strings to parse- Returns:
- list of parsed locations
-
serializeCompactSimpleLocations
Serializes a list of locations into a single string, keeping only the block coordinates
Returns null if the provided list is null or empty
- Parameters:
locations- locations to serialize- Returns:
- data string
-
serializeCompactLocations
Serializes a list of locations into a single string, keeping only the exact coordinates without yaw or pitch
Returns null if the provided list is null or empty
- Parameters:
locations- locations to serialize- Returns:
- data string
-
serializeCompactDetailedLocations
Serializes a list of locations into a single string, keeping only the exact coordinates without yaw or pitch
Returns null if the provided list is null or empty
- Parameters:
locations- locations to serialize- Returns:
- data string
-
parseCompactLocations
Parses a list of locations from a compact data string
Compact data strings are the results from the serializeCompactLocation methods
Returns null if the data string is null or empty
- Parameters:
dataString- compact data string to parse- Returns:
- parsed list of locations
-