Making Slot/GUI Procedures easier to code by hand

Started by faielgila on

Topic category: Advanced modding

Last seen on 19:51, 26. Sep 2023
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.

Last seen on 00:31, 10. Dec 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks! Great!  
Fri, 09/25/2020 - 02:13

Thanks! Great!