Class CodingBlockPlacer

java.lang.Object
ua.mcchickenstudio.opencreative.coding.CodingBlockPlacer

public class CodingBlockPlacer extends Object

CodingBlockPlacer

This class represents a coding block placer, that builds coding blocks from CodeConfiguration config file in developers worlds.
  • Constructor Details

    • CodingBlockPlacer

      public CodingBlockPlacer(@NotNull @NotNull org.bukkit.Material wallSign, @NotNull @NotNull org.bukkit.Material container, int maximumBlocks)
    • CodingBlockPlacer

      public CodingBlockPlacer(@NotNull @NotNull DevPlanet devPlanet)
  • 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.