-
Notifications
You must be signed in to change notification settings - Fork 1
Creating an extension (Legacy)
On this page you can learn how to make an extension.
In your build.gradle
add the following code in the dependencies {...}
section:
compileOnly fg.deobf(group: "com.ultreon.mods", name: "advanced-debug", version: "1.1.0", classifier: "api", changing: true)
runtimeOnly fg.deobf(group: "com.ultreon.mods", name: "advanced-debug", version: "1.1.0", changing: true)
It also needs a repository, so add the following code in the repositories {...}
section:
maven {
name "AdvancedDebugMaven"
url "https://github.com/Ultreon/advanced-debug/raw/main/.maven_repo/"
}
The line with the compileOnly
part is for the API, so you don't have any other classes that isn't needed for the extension.
Then the line with the runtimeOnly
part makes it so you can test your code from the runClient
run config or launch.
We start with a simple class;
@AdvDebugExt(modId = Main.MOD_ID) // We expect that 'Main.MOD_ID' refers to the id of the compatibilty mod.
public class AdvancedDebugExtension implements IAdvDebugExt {
}
Here you have the basic class. The part with @AdvDebugExt(...)
is an annotation, and is used for the Advanced Debug mod to find out it's an extension class.
And it also implements IAdvDebugExt
, this is for the methods it needs to have. These methods are initPages
and initFormatters
.
So now, we implement these methods:
@AdvDebugExt(modId = Main.MOD_ID) // We expect that 'Main.MOD_ID' refers to the id of the compatibilty mod.
public class AdvancedDebugExtension implements IAdvDebugExt {
@Override
public void initPages(IInitPagesEvent evt) {
// Register pages here.
}
@Override
public void initFormatters(IFormatterRegistry registry) {
// Initialize a init class for the formatters.
}
}
For creating a debug page click here.
For creating a formatter click here.
© Copyright 2023 - Ultreon Team, All Rights Reserved
Made for the Advanced Debug mod.
For the mod download go to the curseforge or modrinth page.