Class GateStructure
java.lang.Object
org.sgrewritten.stargate.api.gate.structure.GateStructure
- Direct Known Subclasses:
GateControlBlock,GateFrame,GateIris
Represents one of the structures used in a gate
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidgenerateStructure(VectorOperation converter, org.bukkit.Location topLeft) Generate the structure from formatabstract org.bukkit.util.BoundingBoxabstract List<org.bukkit.util.BlockVector> Gets all positions, represented by block vectors, where this structure type is usedprotected abstract booleanisValidBlock(org.bukkit.util.BlockVector blockVector, org.bukkit.Material material) Checks if a block in the built portal matches the block in this structurebooleanisValidState(VectorOperation vectorOperation, org.bukkit.Location topLeft) Checks if all the blocks part of this structure matches a built structure
-
Constructor Details
-
GateStructure
public GateStructure()
-
-
Method Details
-
isValidState
Checks if all the blocks part of this structure matches a built structureGoes through every part of the structure, finds the hypothetical location of this part by doing a vector operation. Checks if that position is allowed to have the material it has.
- Parameters:
vectorOperation-The vector operation to use for rotating the structure
topLeft-The location of the built portal's top-left block
- Returns:
- true if all parts had valid materials
-
getStructureTypePositions
Gets all positions, represented by block vectors, where this structure type is used- Returns:
All positions where this structure type is used
-
isValidBlock
protected abstract boolean isValidBlock(org.bukkit.util.BlockVector blockVector, org.bukkit.Material material) Checks if a block in the built portal matches the block in this structure- Parameters:
blockVector-The position of the block to check
material-The material found in the built portal
- Returns:
True if the material matches
-
generateStructure
Generate the structure from format- Parameters:
converter-Conversion between real space and format space
topLeft-Top left corner in real space
-
getBoundingBox
public abstract org.bukkit.util.BoundingBox getBoundingBox()- Returns:
The smallest box wherein this gate fits
-