Class ExplicitGateBuilder
java.lang.Object
org.sgrewritten.stargate.api.gate.ExplicitGateBuilder
- All Implemented Interfaces:
GateBuilder
Builder for gate objects based on already known parameters. To build a gate from unknown parameters, use
ImplicitGateBuilder
-
Constructor Summary
ConstructorDescriptionExplicitGateBuilder
(RegistryAPI registryAPI, org.bukkit.Location topLeft, GateFormatAPI gateFormatAPI) Constructor forExplicitGateBuilder
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build a gatesetCalculatePortalPositions
(boolean calculatePortalPositions) setFacing
(org.bukkit.block.BlockFace facing) Set the facing of this gate, this equals the facing of the sign.setFlipGate
(boolean flipGate) Whether the gate should be flipped, this effectively makes the top left position top right (flip z axis in format space)setGenerateButtonPositions
(boolean generateButtonPositions) Whether to generate a button position.
-
Constructor Details
-
ExplicitGateBuilder
public ExplicitGateBuilder(RegistryAPI registryAPI, org.bukkit.Location topLeft, GateFormatAPI gateFormatAPI) Constructor forExplicitGateBuilder
- Parameters:
registryAPI
-The stargate registry for portals and networks
topLeft
-The to be top left position of the gate (or top right if the gate is flipped)
gateFormatAPI
-The format of the gate
-
-
Method Details
-
setCalculatePortalPositions
- Parameters:
calculatePortalPositions
-Whether the gate should calculate its own portal positions
- Returns:
This gate builder
-
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)
-
setFlipGate
Whether the gate should be flipped, this effectively makes the top left position top right (flip z axis in format space)- Parameters:
flipGate
-Whether the gate should be flipped
- Returns:
This gate builder
-
setFacing
Set the facing of this gate, this equals the facing of the sign. You can alternatively see this as setting the gate to different rotations.- Parameters:
facing
-The facing of this gate
- Returns:
This gate builder
-
build
Description copied from interface:GateBuilder
Build a gate- Specified by:
build
in interfaceGateBuilder
- Returns:
A gate
- Throws:
InvalidStructureException
-When the gate to be built does not match the format
-