Class CodingBlockPlacer
java.lang.Object
ua.mcchickenstudio.opencreative.coding.CodingBlockPlacer
CodingBlockPlacer
This class represents a coding block placer, that builds coding blocks fromCodeConfiguration config file in
developers worlds.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCodePlacementResult -
Constructor Summary
ConstructorsConstructorDescriptionCodingBlockPlacer(@NotNull org.bukkit.Material wallSign, @NotNull org.bukkit.Material container, int maximumBlocks) CodingBlockPlacer(@NotNull DevPlanet devPlanet) -
Method Summary
Modifier and TypeMethodDescriptionplaceCodingLines(@NotNull List<org.bukkit.Location> freeColumns, @NotNull org.bukkit.configuration.ConfigurationSection blocks) Places all coding from specified configuration section into free columns.placeCodingLines(@NotNull DevPlanet devPlanet, @NotNull org.bukkit.configuration.ConfigurationSection blocks) Places all coding blocks from specified configuration section and returns result.placeCodingLines(@NotNull DevPlanet devPlanet, @NotNull org.bukkit.configuration.ConfigurationSection blocks, @NotNull org.bukkit.Location columnLocation) Places all coding blocks from specified configuration section and returns result.booleanplaceExecutor(@NotNull org.bukkit.Location location, @NotNull org.bukkit.configuration.ConfigurationSection data) Places executor and its actions through coding line.
-
Constructor Details
-
CodingBlockPlacer
public CodingBlockPlacer(@NotNull @NotNull org.bukkit.Material wallSign, @NotNull @NotNull org.bukkit.Material container, int maximumBlocks) -
CodingBlockPlacer
-
-
Method Details
-
placeCodingLines
@NotNull public @NotNull CodingBlockPlacer.CodePlacementResult placeCodingLines(@NotNull @NotNull DevPlanet devPlanet, @NotNull @NotNull org.bukkit.configuration.ConfigurationSection blocks) Places all coding blocks from specified configuration section and returns result. Section must contain executor blocks with actions inside them.- Parameters:
devPlanet- developers planet where coding blocks will be built.blocks- configuration section containing coding blocks.- Returns:
- result of placing blocks.
-
placeCodingLines
@NotNull public @NotNull CodingBlockPlacer.CodePlacementResult placeCodingLines(@NotNull @NotNull DevPlanet devPlanet, @NotNull @NotNull org.bukkit.configuration.ConfigurationSection blocks, @NotNull @NotNull org.bukkit.Location columnLocation) Places all coding blocks from specified configuration section and returns result. Section must contain executor blocks with actions inside them.- Parameters:
devPlanet- developers planet where coding blocks will be built.blocks- configuration section containing coding blocks.columnLocation- location of column, where first coding line will be placed.- Returns:
- result of placing blocks.
-
placeCodingLines
@NotNull public @NotNull CodingBlockPlacer.CodePlacementResult placeCodingLines(@NotNull @NotNull List<org.bukkit.Location> freeColumns, @NotNull @NotNull org.bukkit.configuration.ConfigurationSection blocks) Places all coding from specified configuration section into free columns. Locations of free columns are locations of executor glass rows.- Parameters:
freeColumns- locations of executor glass rows with free space through coding line.blocks- configuration section containing coding blocks.- Returns:
- result of placing blocks.
-
placeExecutor
public boolean placeExecutor(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull org.bukkit.configuration.ConfigurationSection data) Places executor and its actions through coding line.- Parameters:
location- location of executor block, begin of coding line.data- configuration section of executor.- Returns:
- true - if successfully placed executor, false - an error has occurred.
-