Class CodingBlockParser

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

public class CodingBlockParser extends Object

CodingBlockParser

This class represents parser of coding blocks. It has methods to read coding block information and save it into planet's code script.getConfig().
See Also:
  • Constructor Details

    • CodingBlockParser

      public CodingBlockParser(@NotNull @NotNull DevPlanet devPlanet)
    • CodingBlockParser

      public CodingBlockParser(@NotNull @NotNull DevPlanet devPlanet, boolean saveEmptyArguments)
    • CodingBlockParser

      public CodingBlockParser(int scriptSizeLimit, boolean saveEmptyArguments)
    • CodingBlockParser

      public CodingBlockParser(int scriptSizeLimit)
  • Method Details

    • parseItemValue

      public static Object parseItemValue(org.bukkit.inventory.ItemStack item)
    • parseCode

      public CompletableFuture<Boolean> parseCode(@NotNull @NotNull DevPlanet devPlanet)
      Saves all code lines in developer planet and launches new code.
      Parameters:
      devPlanet - developer planet to parse code.
    • recompileCode

      public CompletableFuture<Boolean> recompileCode(@NotNull @NotNull DevPlanet devPlanet)
      Saves all code lines in developer planet and launches new code.
      Parameters:
      devPlanet - developer planet to parse code.
    • parseAllExecutors

      public void parseAllExecutors(DevPlanet devPlanet, CodeStorage config)
      Adds all code lines from developer planet to configuration. Don't forget to save it.
      Parameters:
      devPlanet - developer planet to parse code.
      config - config to add executors.
    • parseExecutors

      public boolean parseExecutors(DevPlanet devPlanet, CodeStorage config, Set<org.bukkit.Location> executorsLocations)
      Adds specified code lines from developer planet to configuration. Locations represent locations of executors cells (blue glass). Don't forget to save it.
      Parameters:
      devPlanet - developer planet to parse code.
      config - config to add executors.
      Returns:
      true - code is fine, false - troubles while parsing.
    • getBlockNumber

      public int getBlockNumber(org.bukkit.block.Block block)