Package net.mcreator.blockly.java
Class BlocklyToJava
java.lang.Object
net.mcreator.blockly.BlocklyToCode
net.mcreator.blockly.java.BlocklyToJava
- All Implemented Interfaces:
IGeneratorProvider
,IWorkspaceProvider
- Direct Known Subclasses:
BlocklyToFeature
,BlocklyToProcedure
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.apache.logging.log4j.Logger
protected final BlocklyVariables
Fields inherited from class net.mcreator.blockly.BlocklyToCode
blockGenerators, editorType, lastProceduralBlockType
-
Constructor Summary
ConstructorDescriptionBlocklyToJava
(Workspace workspace, ModElement parent, BlocklyEditorType blocklyEditorType, String sourceXML, TemplateGenerator templateGenerator, IBlockGenerator... externalGenerators) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
postBlocksPlacement
(Document doc, Element startBlock, List<Element> baseBlocks) This method contains the code needing to be executed after blocks are placed.protected void
preBlocksPlacement
(Document doc, Element startBlock) This method contains the code needing to be executed before blocks are placed.protected void
This method is executed after the constructor is called, before the code is executed.Methods inherited from class net.mcreator.blockly.BlocklyToCode
addCompileNote, addDependency, append, checkIfDepProviderInputsProvide, clearCodeGeneratorBuffer, directProcessOutputBlock, directProcessOutputBlockWithoutParentheses, directProcessStatementBlock, getCompileNotes, getDependencies, getEditorType, getGeneratedCode, getParent, getStatementInputsMatching, getTemplateGenerator, getUsedBlocks, getWorkspace, popDepProviderInputStack, processBlockProcedure, processOutputBlock, processOutputBlockToInt, processOutputBlockWithoutParentheses, processOutputBlockWithoutParentheses, pushDepProviderInputStack
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.mcreator.generator.IGeneratorProvider
getGenerator, getGeneratorConfiguration, getGeneratorStats
Methods inherited from interface net.mcreator.workspace.IWorkspaceProvider
getFileManager, getFolderManager, getModElementManager, getWorkspaceFolder, getWorkspaceSettings
-
Field Details
-
LOG
protected final org.apache.logging.log4j.Logger LOG -
variableGenerator
-
-
Constructor Details
-
BlocklyToJava
public BlocklyToJava(Workspace workspace, ModElement parent, BlocklyEditorType blocklyEditorType, String sourceXML, TemplateGenerator templateGenerator, IBlockGenerator... externalGenerators) throws TemplateGeneratorException - Parameters:
workspace
-The
Workspace
executing the codeblocklyEditorType
-Blockly editor type
sourceXML
-The XML code used by Blockly
templateGenerator
-The folder location in each
Generator
containing the code template files- Throws:
TemplateGeneratorException
-
-
Method Details
-
preBlocksPlacement
protected void preBlocksPlacement(Document doc, Element startBlock) throws TemplateGeneratorException This method contains the code needing to be executed before blocks are placed.
- Parameters:
doc
- Blockly XML documentstartBlock
- The basic block of the editor used to get other blocks.- Throws:
TemplateGeneratorException
-
postBlocksPlacement
This method contains the code needing to be executed after blocks are placed.
- Parameters:
doc
- Blockly XML documentstartBlock
- The basic block of the editor used to get other blocks.baseBlocks
- A list of all blocks placed under start block.
-
preInitialization
protected void preInitialization()This method is executed after the constructor is called, before the code is executed.
-