Class ImplicitGateBuilder
java.lang.Object
org.sgrewritten.stargate.api.gate.ImplicitGateBuilder
- All Implemented Interfaces:
GateBuilder
Scans through available gate formats, given a sign position. Finds all parameters for a valid gate format, or throws
an exception if no format matched. If one already knows these parameters, look into
ExplicitGateBuilder
-
Constructor Summary
ConstructorDescriptionImplicitGateBuilder
(org.bukkit.Location signLocation, RegistryAPI registryAPI) Construct an instance ofImplicitGateBuilder
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates a new gate from the given signsetGenerateButtonPositions
(boolean generateButtonPositions) Whether to generate a button position.
-
Constructor Details
-
ImplicitGateBuilder
Construct an instance ofImplicitGateBuilder
- Parameters:
signLocation
-The location of the sign to figure out gate format
registryAPI
-The stargate registry containing portal and network data
-
-
Method Details
-
setGenerateButtonPositions
Description copied from interface:GateBuilder
Whether to generate a button position. This might not be necessary for gates such as always on gates- Specified by:
setGenerateButtonPositions
in interfaceGateBuilder
- Parameters:
generateButtonPositions
-Whether to generate a button position.
- Returns:
This gate builder (convenience)
-
build
Creates a new gate from the given sign- Specified by:
build
in interfaceGateBuilder
- Returns:
A new Gate
- Throws:
NoFormatFoundException
-If no gate format is found that matches the physical gate
GateConflictException
-If a registered gate conflicts with the new gate
-