Class BlocklyHelper

java.lang.Object
net.mcreator.util.BlocklyHelper

public class BlocklyHelper extends Object
  • Constructor Details

    • BlocklyHelper

      public BlocklyHelper(Document doc)
  • Method Details

    • createBlock

      public Element createBlock(String blockType, Element... children)
      Creates a block of the given block type and with the given children
      Parameters:
      blockType - The type of this block
      children - The children (fields, values...) that should be appended to this block
      Returns:
      An Element representing this block
    • createField

      public Element createField(String fieldName, String fieldValue)
      Creates a field with the given name and the given value
      Parameters:
      fieldName - The name of this field
      fieldValue - If not null, the value of this field
      Returns:
      An Element representing this field
    • createValue

      public Element createValue(String valueName, Element inputBlock)
      Creates a value input with the given name and the given block
      Parameters:
      valueName - The name of this value input
      inputBlock - If present, the block attached to this input
      Returns:
      An Element representing this value input