Making Slot/GUI Procedures easier to code by hand

Started by faielgila on

Topic category: Advanced modding

Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Making Slot/GUI Procedures easier to code by hand

When I was creating a procedure for one of the machines in my mod, I ran into the problem of lag from too many blocks in the same procedure. And, upon running the code in Minecraft, there was significant lag going through the code. The generated code was very redundant and could be easily simplified, in fact enough to be simplified enough to be coded by hand, without MCreator's generated code.

I made the "SlotHelper.java" file to contain all of that complexity and make procedure code more human-readable. To use it, download the file from the GitHub page and place it the net.mcreator.mod folder. Go to the procedure you wish to use it in and import the SlotHelper class. In the "executeProcedure()" method, create an instance of "SlotHelper" and give it the "entity" dependency. Each method has a description attached, which should be helpful.

You can explore "ProcMachSplitterNewProcedure.java" or "ProcMachBasinProcedure.java" as examples on how to use this class.

tl;dr I made a file which makes coding slot/GUI procedures by hand much easier and which makes the procedure run more efficiently.