-
Notifications
You must be signed in to change notification settings - Fork 4
Getting Started
MORIMORI0317 edited this page Sep 23, 2024
·
6 revisions
In your your mod's build.gradle
file, declare the following statements to your repositories{} and dependencies{}.
repositories {
maven {
name = "FelNull Maven"
url = "https://maven.felnull.dev"
}
}
dependencies {
modApi "dev.felnull:special-model-loader:1.3.0"
//Required if you want this mod to be embedded by jar-in-jar
include "dev.felnull:special-model-loader:1.3.0"
}
The version specified in dependencies should be rewritten to match the version to be used.
Gradle should download the required JavaDocs for your project. If not, you can find them here.
Scopes for loading should be specified to prevent unnecessary loading or conflicts with other mods.
Register a dedicated event during client initialization.
SpecialModelLoaderEvents.LOAD_SCOPE.register(event);
This event checks if a special model loading should be applied to the target model location.
Example of applying only to a specific namespace:
public class ExampleModClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
SpecialModelLoaderEvents.LOAD_SCOPE.register(location -> ExampleMod.MODID.equals(location.getNamespace()));
}
}
public class ExampleModClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
SpecialModelLoaderEvents.LOAD_SCOPE.register(() -> {
return (resourceManager, location) -> ExampleMod.MODID.equals(location.getNamespace());
});
}
}
Next: How To Use
Original documentation written by, @MORIMORI0317_jp rewritten by @starboyceleste.
Thank you starboyceleste!