Package net.mcreator.blockly
Class BlocklyBlockUtil
java.lang.Object
net.mcreator.blockly.BlocklyBlockUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Color
getBlockColorFromHUE
(int hue) Calculates block's full color out of its hue value.getBlockProcedureStartingWithBlock
(Element start_block) getBlockProcedureStartingWithNext
(Element start_block) Returns the list of blocks that are directly arranged in the procedural order for the given start block under which to look for next elementsstatic String
getInputBlockType
(Element input) Returns the type of the block attached to an input elementstatic Element
getStartBlock
(Document document, String typeBlockName) Returns the start block (trigger block) for the given XML document
-
Constructor Details
-
BlocklyBlockUtil
public BlocklyBlockUtil()
-
-
Method Details
-
getStartBlock
Returns the start block (trigger block) for the given XML document- Parameters:
document
- XML document to look in- Returns:
- Start block XML element or null if not found
-
getBlockProcedureStartingWithBlock
-
getBlockProcedureStartingWithNext
Returns the list of blocks that are directly arranged in the procedural order for the given start block under which to look for next elementsNOTE: The first element under given start_block must be "next" in order for this method to work.
- Parameters:
start_block
- The block under which to look for elements- Returns:
- List of blocks under given block in execute order
-
getBlockColorFromHUE
Calculates block's full color out of its hue value.- Parameters:
hue
- The block's hue number- Returns:
- Block's render number
-
getInputBlockType
Returns the type of the block attached to an input element- Parameters:
input
- The input node of the block- Returns:
- The type of the block attached to the input, or null if no block is attached
-