Serializable
, Comparable<PortalCrystal>
public enum PortalCrystal extends Enum<PortalCrystal>
Enum Constant | Description |
---|---|
EAST_CRYSTAL |
The End Crystal located on the east side of the portal (positive X axis).
|
NORTH_CRYSTAL |
The End Crystal located on the north side of the portal (negative Z axis).
|
SOUTH_CRYSTAL |
The End Crystal located on the south side of the portal (positive Z axis).
|
WEST_CRYSTAL |
The End Crystal located on the west side of the portal (negative X axis).
|
Modifier and Type | Method | Description |
---|---|---|
org.bukkit.entity.EnderCrystal |
get(org.bukkit.World world) |
Get the current crystal relative to the world's portal location.
|
static Set<org.bukkit.entity.EnderCrystal> |
getAllSpawnedCrystals(org.bukkit.World world) |
Get all crystals that have been spawned on the portal in the given world.
|
org.bukkit.Location |
getRelativeTo(org.bukkit.Location location) |
Get a
Location representing the crystal's expected location relative
to a given location. |
org.bukkit.Location |
getRelativeToPortal(org.bukkit.World world) |
Get a
Location representing the crystal's expected location relative
to the provided world's portal. |
int |
getXOffset() |
Get the offset on the x axis to be applied for this crystal
|
int |
getZOffset() |
Get the offset on the z axis to be applied for this crystal
|
boolean |
isPresent(org.bukkit.World world) |
Check whether this crystal is spawned on the portal or not.
|
org.bukkit.entity.EnderCrystal |
spawn(org.bukkit.World world) |
Spawn a crystal on the portal in the given world and set it as invulnerable.
|
org.bukkit.entity.EnderCrystal |
spawn(org.bukkit.World world,
boolean invulnerable) |
Spawn a crystal on the portal in the given world and optionally set its
invulnerability state.
|
static PortalCrystal |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static PortalCrystal[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PortalCrystal NORTH_CRYSTAL
public static final PortalCrystal EAST_CRYSTAL
public static final PortalCrystal SOUTH_CRYSTAL
public static final PortalCrystal WEST_CRYSTAL
public static PortalCrystal[] values()
for (PortalCrystal c : PortalCrystal.values()) System.out.println(c);
public static PortalCrystal valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getXOffset()
public int getZOffset()
public org.bukkit.Location getRelativeTo(org.bukkit.Location location)
Location
representing the crystal's expected location relative
to a given location. The passed location assumes the top of the portal (3 blocks
above the base of the portal). See DragonBattle.getEndPortalLocation()
.location
- the location starting pointpublic org.bukkit.Location getRelativeToPortal(org.bukkit.World world)
Location
representing the crystal's expected location relative
to the provided world's portal.world
- the world containing the portalpublic org.bukkit.entity.EnderCrystal spawn(org.bukkit.World world, boolean invulnerable)
world
- the world to spawn the crystal ininvulnerable
- the crystal's invulnerable statepublic org.bukkit.entity.EnderCrystal spawn(org.bukkit.World world)
world
- the world to spawn the crystal inspawn(World, boolean)
public org.bukkit.entity.EnderCrystal get(org.bukkit.World world)
world
- the world to referencepublic boolean isPresent(org.bukkit.World world)
world
- the world to checkpublic static Set<org.bukkit.entity.EnderCrystal> getAllSpawnedCrystals(org.bukkit.World world)
world
- the world to check