Skip to content

Debugging BlockOut

Marc Hermans edited this page Jul 7, 2018 · 3 revisions

Debugging BlockOut

Debugging BlockOut can technically be done with any Mod that depends on BlockOut that open a UI. Testing BlockOut when you are developing a new Control directly in BlockOut itself can be a bigger problem: BlockOut does not provide any UIs by it self.

May I direct your Attention to: The test Mod!

To circumvent this problem, BlockOuts repo contains actually two Mods. First and foremost BlockOut it self. However secondly it contains the BlockOut_Test mod that is used to test BlockOut during Development.

This guide will describe how to test BlockOut using this Mod for IntelliJ IDEA only, however any IDE can be used.

So let's get started:

When you import the BlockOut build.gradle file, like any other Minecraft Mod, you will notice that next to the usual _api, _main and _test, their is another sourceset (or IDEA module) available: BlockOut_testmod.

This sourceset contains all the sources and resources for the testmod. To start and load this test mod, we need to make some small changes. Inparticularly we need to add GradleStart to its Dependencies since Gradle does not do that automatically for us.

Open the Module settings for the BlockOut_testmod module: Select the module in the project View and hit F4 on you keyboard:

On the right select, on the dependencies tab, the plus (add a dependency), and select Jar or Directory:

Now select the GradleStart directory. If you do not know were this directory is located, look at the BlockOut_main module and its directories, it will be in there already, just copy the exact same path:

Keep in mind that this directory might not be visible when you have 'Show hidden directories' disabled.

Now click Apply and close the Module Settings dialog.

In the top right corner of IDEA, as usual, you will find the Run Configuration selection. Hit the drop down button and select: Edit Run Configuration.

Select the Minecraft Client run configuration and change the Option: Classpath of Module: BlockOut_Main (or simply BlockOut depending on the Gradle and IDEA version) to Classpath Of Module: BlockOut_testmod. Save the configuration and run it.

Your game should load the BlockOut_testmod, you can verify this by checking the mod list in game.

Create a world and run: /bo_test as a command. It opens the BlockOut test UI. Checkout the Testmods source code for more commands that open a test UI. And add your own.

Happy bug hunting.