Package com.plotsquared.core.plot
Class PlotId
java.lang.Object
com.plotsquared.core.plot.PlotId
Plot (X,Y) tuples for plot locations
within a plot area
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Deprecated, for removal: This API element is subject to removal in a future version.PlotId is immutable, copy is not required.boolean
fromString
(@NonNull String string) Get a Plot Id based on a stringfromStringOrNull
(@NonNull String string) Attempt to parse a plot ID from a stringGet the next plot ID for claiming purposesgetRelative
(@NonNull Direction direction) Get the PlotId in a relative directionint
getX()
Get the ID X componentint
getY()
Get the ID Y componentint
hashCode()
of
(int x, int y) Create a new plot ID instanceGet a String representation of the plot ID where the components are separated by ","Get a String representation of the plot ID where the components are separated by "-"toSeparatedString
(String separator) Get a String representation of the plot ID where the components are separated by a specified stringtoString()
Get a String representation of the plot ID where the components are separated by ";"Get a String representation of the plot ID where the components are separated by "_"unpair
(int hash) Gets the PlotId from the HashCode
Note: Only accurate for small x,z values (short)
-
Method Details
-
of
Create a new plot ID instance- Parameters:
x
- The plot x coordinatey
- The plot y coordinate- Returns:
- a new PlotId at x,y
-
fromString
Get a Plot Id based on a string- Parameters:
string
- to create id from- Returns:
- the PlotId representation of the argument
- Throws:
IllegalArgumentException
- if the string does not contain a valid PlotId
-
fromStringOrNull
Attempt to parse a plot ID from a string- Parameters:
string
- ID string- Returns:
- Plot ID, or
null
if none could be parsed
-
unpair
Gets the PlotId from the HashCode
Note: Only accurate for small x,z values (short)- Parameters:
hash
- ID hash- Returns:
- Plot ID
-
copy
Deprecated, for removal: This API element is subject to removal in a future version.PlotId is immutable, copy is not required.Get a copy of the plot ID- Returns:
- Plot ID copy
-
getX
Get the ID X component- Returns:
- X component
-
getY
Get the ID Y component- Returns:
- Y component
-
getNextId
Get the next plot ID for claiming purposes- Returns:
- Next plot ID
-
getRelative
Get the PlotId in a relative direction- Parameters:
direction
- Direction- Returns:
- Relative plot ID
-
equals
-
toString
Get a String representation of the plot ID where the components are separated by ";" -
toSeparatedString
Get a String representation of the plot ID where the components are separated by a specified string- Parameters:
separator
- Separator- Returns:
x + separator + y
-
toCommaSeparatedString
Get a String representation of the plot ID where the components are separated by ","- Returns:
x + "," + y
-
toUnderscoreSeparatedString
Get a String representation of the plot ID where the components are separated by "_"- Returns:
x + "_" + y
-
toDashSeparatedString
Get a String representation of the plot ID where the components are separated by "-"- Returns:
x + "-" + y
-
hashCode
-