Class PortalBuilder
-
Constructor Summary
ConstructorDescriptionPortalBuilder
(StargateAPI stargateAPI, org.bukkit.OfflinePlayer owner, String portalName) Construct an instance of a PortalBuilder -
Method Summary
Modifier and TypeMethodDescriptionaddEventHandling
(@Nullable org.bukkit.OfflinePlayer eventTarget) Make the builder throw anStargateCreatePortalEvent
addMessageReceiver
(@Nullable org.bukkit.entity.Entity messageTarget) addPermissionCheck
(@NotNull org.bukkit.entity.Player permissionTarget) Check for all stargate related permissions for targetbuild()
Build an instance of a portalsetAdaptiveGatePositionGeneration
(boolean adaptiveGatePositionGeneration) Requires the constructorPortalBuilder(StargateAPI, OfflinePlayer, String)
to mattersetCost
(double cost, @NotNull org.bukkit.entity.Player economyTarget) Set a cost for this portalsetDestination
(@Nullable String destinationName) setDestinationServerName
(String serverName) Set the name of the server this portal should point to (only relevant for bungee portals)Set the flags of the portalsetFlags
(@NotNull Set<StargateFlag> flags) Set the flags of the portalsetGateBuilder
(@NotNull org.bukkit.Location topLeft, @NotNull String gateFormatName) Set the way the gate should be constructed, seeExplicitGateBuilder
for more informationsetGateBuilder
(@NotNull org.bukkit.Location topLeft, @NotNull GateFormatAPI gateFormatAPI) Set the way the gate should be constructed, seeExplicitGateBuilder
for more informationsetGateBuilder
(@NotNull GateBuilder gateBuilder) setMetaData
(String metaData) setNetwork
(@NotNull String networkName) setNetwork
(@NotNull Network network)
-
Constructor Details
-
PortalBuilder
Construct an instance of a PortalBuilder- Parameters:
stargateAPI
-The stargate api
owner
-The owner of the portal
portalName
-The name of the portal
-
-
Method Details
-
addPermissionCheck
public PortalBuilder addPermissionCheck(@NotNull @NotNull org.bukkit.entity.Player permissionTarget) Check for all stargate related permissions for target- Parameters:
permissionTarget
-The target of the permissions
- Returns:
This portal builder
-
setCost
Set a cost for this portal- Parameters:
cost
-A cost
economyTarget
-The payee
- Returns:
This portal builder
-
addEventHandling
Make the builder throw anStargateCreatePortalEvent
- Parameters:
eventTarget
-The target of the event
- Returns:
This portal builder
-
addMessageReceiver
- Parameters:
messageTarget
-The entity that receives any messages related to the attempt of the portal creation
- Returns:
This portal builder
-
setDestination
- Parameters:
destinationName
-Set a fixed destination portal
- Returns:
This portal builder
-
setAdaptiveGatePositionGeneration
Requires the constructorPortalBuilder(StargateAPI, OfflinePlayer, String)
to matter- Parameters:
adaptiveGatePositionGeneration
-Whether to generate portal positions for the gate
- Returns:
This portal builder
-
setMetaData
- Parameters:
metaData
-The metadata for the portal
- Returns:
This portal builder
-
setDestinationServerName
Set the name of the server this portal should point to (only relevant for bungee portals)- Parameters:
serverName
-The name of the server this portal points to
- Returns:
This portal builder
-
setNetwork
- Parameters:
network
-the network this portal points to
- Returns:
This portal builder
-
setNetwork
- Parameters:
networkName
-The network argument to select networks from
- Returns:
This portal builder
-
setGate
- Parameters:
gateAPI
-The gate to be used by this portal builder
- Returns:
This portal builder
-
setGateBuilder
public PortalBuilder setGateBuilder(@NotNull @NotNull org.bukkit.Location topLeft, @NotNull @NotNull GateFormatAPI gateFormatAPI) Set the way the gate should be constructed, seeExplicitGateBuilder
for more information- Parameters:
topLeft
-Top left location
gateFormatAPI
-The gate format to be used when making this gate
- Returns:
This portal builder
-
setGateBuilder
public PortalBuilder setGateBuilder(@NotNull @NotNull org.bukkit.Location topLeft, @NotNull @NotNull String gateFormatName) Set the way the gate should be constructed, seeExplicitGateBuilder
for more information- Parameters:
topLeft
-Top left location
gateFormatName
-The name of the gate format
- Returns:
This portal builder
- Throws:
IllegalArgumentException
-If the gate format has not been registered
-
setGateBuilder
-
setFlags
Set the flags of the portal- Parameters:
flagsString
-A string of characters representing flags or flag arguments
- Returns:
This portal builder
-
setFlags
Set the flags of the portal- Parameters:
flags
-The flags of the portal
- Returns:
This portal builder
-
build
public RealPortal build() throws TranslatableException, GateConflictException, NoFormatFoundException, InvalidStructureExceptionBuild an instance of a portal- Returns:
An instance of a portal
- Throws:
TranslatableException
GateConflictException
NoFormatFoundException
InvalidStructureException
-