Class PortalPosition
java.lang.Object
org.sgrewritten.stargate.api.network.portal.PortalPosition
- All Implemented Interfaces:
MetadataHolder
A position of a portal's control block
-
Constructor Summary
ConstructorDescriptionPortalPosition
(@NotNull PositionType positionType, @NotNull org.bukkit.util.BlockVector relativePositionLocation, @NotNull String pluginName) Instantiates a new active portal positionPortalPosition
(@NotNull PositionType positionType, @NotNull org.bukkit.util.BlockVector relativePositionLocation, @NotNull String pluginName, boolean active) Instantiates a new active portal position -
Method Summary
Modifier and TypeMethodDescriptionvoid
assignPortal
(RealPortal portal) boolean
@Nullable PortalPositionAttachment
Get metadata for this portal.@NotNull String
@NotNull PositionType
Gets this portal position's type@NotNull org.bukkit.util.BlockVector
Gets this portal position's relative location to that of the gateint
hashCode()
boolean
isActive()
void
setActive
(boolean active) Activate/deactive this portal positionvoid
setAttachment
(@NotNull PortalPositionAttachment attachment) void
setMetadata
(@Nullable String data) Set metadata for this portal.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.sgrewritten.stargate.api.MetadataHolder
getMetadata, setMetadata
-
Constructor Details
-
PortalPosition
public PortalPosition(@NotNull @NotNull PositionType positionType, @NotNull @NotNull org.bukkit.util.BlockVector relativePositionLocation, @NotNull @NotNull String pluginName) Instantiates a new active portal position- Parameters:
positionType
-The type of this portal position
relativePositionLocation
-The relative location of this portal to that of the gate
pluginName
-The name of the plugin this position relates to
-
PortalPosition
public PortalPosition(@NotNull @NotNull PositionType positionType, @NotNull @NotNull org.bukkit.util.BlockVector relativePositionLocation, @NotNull @NotNull String pluginName, boolean active) Instantiates a new active portal position- Parameters:
positionType
-The type of this portal position
relativePositionLocation
-The relative location of this portal to that of the gate
pluginName
-The name of the plugin this position relates to
active
-If the position is active
-
-
Method Details
-
getPositionType
Gets this portal position's type- Returns:
This portal position's type
-
getRelativePositionLocation
@NotNull public @NotNull org.bukkit.util.BlockVector getRelativePositionLocation()Gets this portal position's relative location to that of the gate- Returns:
This portal position's relative location
-
assignPortal
- Parameters:
portal
-The portal to assign to this portal position
-
getPluginName
- Returns:
The name of the plugin that owns this portal position
-
equals
-
hashCode
public int hashCode() -
toString
-
isActive
public boolean isActive()- Returns:
Whether the portal position is currently active
-
setActive
public void setActive(boolean active) Activate/deactive this portal position- Parameters:
active
-Whether to activate or deactivate the portal position
-
setMetadata
Description copied from interface:MetadataHolder
Set metadata for this portal. This sets all metadata for this entity, it's advised to useMetadataHolder.setMetadata(JsonElement, String)
- Specified by:
setMetadata
in interfaceMetadataHolder
- Parameters:
data
-The meta data to set
-
getMetadata
Description copied from interface:MetadataHolder
Get metadata for this portal. This gets all metadata for this entity, it's advised to use theMetadataHolder.getMetadata(String)
method- Specified by:
getMetadata
in interfaceMetadataHolder
- Returns:
The meta data of this portal
-
getPortal
- Returns:
The portal owning this portal position
-
getAttachment
-
setAttachment
-