public class CircularRegion extends Object implements GsonSerializable
| Modifier and Type | Method and Description |
|---|---|
static CircularRegion |
deserialize(com.google.gson.JsonElement element) |
boolean |
equals(Object o) |
Position |
getCenter()
The center of the region as a
Position |
double |
getCircumference()
The circumference of the region
|
double |
getDiameter()
The diameter of the region
|
Set<BlockPosition> |
getOuterBlockPositions()
Get the circumference
BlockPosition of the region |
double |
getRadius()
The radius of the region
|
int |
hashCode() |
boolean |
inRegion(Block block)
Determines if the specified
Block is within the region |
boolean |
inRegion(Position pos)
Determines if the specified
Position is within the region |
static CircularRegion |
of(Position center,
double radius) |
com.google.gson.JsonObject |
serialize()
Serializes the object to JSON
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitdeserialize, deserializeRaw, getDeserializeMethodpublic static CircularRegion deserialize(com.google.gson.JsonElement element)
public static CircularRegion of(Position center, double radius)
public boolean inRegion(Position pos)
Position is within the regionpos - target positionpublic boolean inRegion(Block block)
Block is within the regionblock - target blockpublic double getRadius()
public double getDiameter()
public double getCircumference()
@Nonnull public Set<BlockPosition> getOuterBlockPositions()
BlockPosition of the regionBlockPositions@Nonnull public com.google.gson.JsonObject serialize()
GsonSerializableserialize in interface GsonSerializableCopyright © 2020. All rights reserved.