Interface GateAPI
- All Known Implementing Classes:
Gate
Portal
this interface has nothing to do with entities and teleportation.-
Method Summary
Modifier and TypeMethodDescriptionaddPortalPosition
(org.bukkit.Location location, PositionType type, String pluginName) Add a position specific for this Gatevoid
addPortalPosition
(PortalPosition portalPosition) Add a position specific to this Gatevoid
assignPortal
(RealPortal realPortal) Assign a real portal to this gatevoid
calculatePortalPositions
(boolean alwaysOn) Calculates all portal positions for this gatevoid
close()
Closes this gatevoid
drawControlMechanisms
(LineData[] lines) Set button and draw signvoid
Modify the world such that the gate follows its gateformatorg.bukkit.Location
getExit()
Gets the exit location of this gateorg.bukkit.block.BlockFace
Gets the block face defining this gate's directionboolean
getFlipZ()
Gets whether this gate has been flipped on the z-axisGets the gate format used by this gateorg.bukkit.Location
getLocation
(@NotNull org.bukkit.util.Vector vector) Gets a location from a relative vectorgetLocations
(GateStructureType structureType) Gets all locations of this gate containing the given structure typeGet the portal assigned to this portal positionGets a copy of this gate's portal positionsorg.bukkit.util.Vector
getRelativeVector
(org.bukkit.Location location) Gets a vector relative to this gate's top-left location using the given locationorg.bukkit.Location
Gets this gate's top-left locationboolean
isOpen()
Gets whether this gate is currently openboolean
isValid()
Check if this gate with the current settings is validvoid
open()
Opens this gatevoid
redrawPosition
(PortalPosition portalPosition, @Nullable LineData[] lines) Update the state on the portal position according to its type@Nullable PortalPosition
removePortalPosition
(org.bukkit.Location location) Remove portal position at specified locationvoid
removePortalPosition
(PortalPosition portalPosition) Remove a portal position from this gate.
-
Method Details
-
drawControlMechanisms
Set button and draw sign -
redrawPosition
Update the state on the portal position according to its type- Parameters:
portalPosition
-The portal position to update
-
getPortalPositions
List<PortalPosition> getPortalPositions()Gets a copy of this gate's portal positions- Returns:
A copy of this gate's portal positions
-
getLocations
Gets all locations of this gate containing the given structure type- Parameters:
structureType
-The structure type to get locations of
- Returns:
All locations containing the given structure type
-
open
void open()Opens this gate -
close
void close()Closes this gate -
getExit
org.bukkit.Location getExit()Gets the exit location of this gate- Returns:
The exit location of this gate
-
isOpen
boolean isOpen()Gets whether this gate is currently open- Returns:
Whether this gate is currently open
-
getFormat
GateFormatAPI getFormat()Gets the gate format used by this gate- Returns:
The gate format used by this gate
-
getFacing
org.bukkit.block.BlockFace getFacing()Gets the block face defining this gate's direction- Returns:
The block face defining this gate's direction
-
getRelativeVector
org.bukkit.util.Vector getRelativeVector(org.bukkit.Location location) Gets a vector relative to this gate's top-left location using the given location- Parameters:
location
-The location to turn into a relative location
- Returns:
A location relative to this gate's top-left location
-
getFlipZ
boolean getFlipZ()Gets whether this gate has been flipped on the z-axis- Returns:
Whether this gate has been flipped on the z-axis
-
getLocation
org.bukkit.Location getLocation(@NotNull @NotNull org.bukkit.util.Vector vector) Gets a location from a relative vector- Parameters:
vector
-The vector defining a location
- Returns:
The location corresponding to the given vector
-
isValid
Check if this gate with the current settings is valid- Returns:
True if this gate is valid
- Throws:
GateConflictException
-If this gate conflicts with another gate
-
calculatePortalPositions
Calculates all portal positions for this gate- Parameters:
alwaysOn
-Whether this gate is always on
- Throws:
InvalidStructureException
-
getTopLeft
org.bukkit.Location getTopLeft()Gets this gate's top-left location- Returns:
This gate's top-left location
-
addPortalPosition
PortalPosition addPortalPosition(org.bukkit.Location location, PositionType type, String pluginName) Add a position specific for this Gate- Parameters:
location
-The location of the position
type
-The type of position
- Returns:
The added portal position
-
addPortalPosition
Add a position specific to this Gate- Parameters:
portalPosition
-The portal position
-
removePortalPosition
Remove portal position at specified location- Parameters:
location
- The location of the portal position to be removed- Returns:
The removed portal position
-
removePortalPosition
Remove a portal position from this gate. Does not remove the portal position in the registry or database. Please useRegistryAPI.removePortalPosition(Location)
with conjunction toStorageAPI.removePortalPosition(RealPortal, StorageType, PortalPosition)
- Parameters:
portalPosition
-The portal position to remove
-
forceGenerateStructure
void forceGenerateStructure()Modify the world such that the gate follows its gateformat -
assignPortal
Assign a real portal to this gate- Parameters:
realPortal
-The portal to assign to this gate
-
getPortal
RealPortal getPortal()Get the portal assigned to this portal position- Returns:
The portal assigned to this portal position
-