Making Slot/GUI Procedures easier to code by hand

Started by faielgila on Tue, 09/08/2020 - 08:48

Topic category: Advanced modding

Last seen on 05:32, 15. Sep 2020
Joined Nov 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Making Slot/GUI Procedures easier to code by hand
Tue, 09/08/2020 - 08:48

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 02:45, 28. Oct 2020
Joined Jul 2020
User points:

User statistics:

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

Thanks! Great!