Class CodingBlockParser
java.lang.Object
ua.mcchickenstudio.opencreative.coding.CodingBlockParser
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 Summary
ConstructorsConstructorDescriptionCodingBlockParser(int scriptSizeLimit) CodingBlockParser(int scriptSizeLimit, boolean saveEmptyArguments) CodingBlockParser(@NotNull DevPlanet devPlanet) CodingBlockParser(@NotNull DevPlanet devPlanet, boolean saveEmptyArguments) -
Method Summary
Modifier and TypeMethodDescriptionintgetBlockNumber(org.bukkit.block.Block block) voidparseAllExecutors(DevPlanet devPlanet, CodeStorage config) Adds all code lines from developer planet to configuration.Saves all code lines in developer planet and launches new code.booleanparseExecutors(DevPlanet devPlanet, CodeStorage config, Set<org.bukkit.Location> executorsLocations) Adds specified code lines from developer planet to configuration.static ObjectparseItemValue(org.bukkit.inventory.ItemStack item) recompileCode(@NotNull DevPlanet devPlanet) Saves all code lines in developer planet and launches new code.
-
Constructor Details
-
CodingBlockParser
-
CodingBlockParser
-
CodingBlockParser
public CodingBlockParser(int scriptSizeLimit, boolean saveEmptyArguments) -
CodingBlockParser
public CodingBlockParser(int scriptSizeLimit)
-
-
Method Details
-
parseItemValue
-
parseCode
Saves all code lines in developer planet and launches new code.- Parameters:
devPlanet- developer planet to parse code.
-
recompileCode
Saves all code lines in developer planet and launches new code.- Parameters:
devPlanet- developer planet to parse code.
-
parseAllExecutors
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)
-