Interface, then pass it to Button’s constructor. Put whatever code to be executed in an implementation of this This interface is used to define the callback function when a button is Import .screen.Screen import .TranslationTextComponent public final class ConfigScreen extends Screen The class for the configuration GUI, ConfigScreen, can thus be created as public void onClose(): closes the screen and performs teardown tasks.public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks): renders the screen.protected void init(): performs initialization tasks of the screen.protected Screen(ITextComponent title): the only constructor.The Screen class contains the following important members that its subclasses There is an abstract class .screen.Screen designatedĪs the base class for every screen in Minecraft, so the mod configuration GUI Minecraft 1.14.4 and 1.15.x but differs in details. The general procedure is identical with those for The steps to create a configuration GUI for a Forge mod for Minecraft 1.16.xĪre creating a class for the GUI, registering a factory of the GUI, addingĮlements to be shown on the GUI, and connecting the GUI with the mod’sĬonfiguration back-end. Forgeģ6.1.0 is also the first recommended build that uses the official mappings byĭefault, which is the mappings this post focuses on. Helper, built with Forge 36.1.0 can work on Minecraft 1.16.2-1.16.4 too. Minecraft 1.16.5, but mods built with it should be compatible with some of the Minecraft Forge 36.1.0 or later is needed. To follow this post to create a configuration GUI like the one presented below, Therefore, this is a good time for me to produce a new version of that blog As a result, the code examples need major modifications. Provided by Microsoft (as stated in the linked file’s header) by default, whichĬaused many fields and methods in the decompiled Minecraft source code to haveĭifferent names. Minecraft Forge has migrated to the official mappings More details about mappings can beįound here in Sponge documentation. Series, I briefly mentioned the concept of mappings in theĭiscussion pertaining to deobfuscation. However, startingįrom Minecraft 1.16.5, a significant change in Minecraft Forge has made those The requiredĬhanges could be summarized in a few succinct sentences, so instead of startingĪ new standalone article for 1.16, I just added some notes like “if you areĭeveloping a mod on 1.16, make sure to check out this link”. The original method for adding a configuration GUI works on Minecraft 1.14.4Īnd 1.15.x, but on Minecraft 1.16.x, some changes are necessary. Knowledge about Minecraft Forge mod as before to the greatest possible extent. Posts about a platform with extremely incomplete documentation can be very Minecraft mod developer who followed me on GitHub after reading my blogs and aĬurrent student of the high school I graduated from, I learned that my blog Obligation to maintain an up-to-date method for creating a mod configuration This not only meansĪnother dissatisfaction of mine with the Minecraft Forge project but also my Request, with a willy-nilly closure of the pull request. Work of the developer who started that linked pull LexManos, the leader of Forge, harshly rejecting more than one year of hard The very first blog post for this series covered how I createdĪ configuration GUI screen for a Minecraft Forge mod targeting Minecraft 1.14.4Īnd above, despite the fact that the related framework and library classes haveīeen removed from Forge, and the core developers have decided that it should
0 Comments
Leave a Reply. |