Note: If you're seeing this as a dependency or requirement for another mod, you can simply install it and ignore this documentation.
EverlastingUtils is a utility library for Fabric mod development. It provides implementations for common features that mod developers frequently need to implement:
For mod developers looking to use this library, continue reading below.
data class MyConfig(
override val version: String = "1.0.0",
override val configId: String = "mymod"
// Your config properties here
) : ConfigData
val configManager = ConfigManager(
currentVersion = "1.0.0",
defaultConfig = MyConfig(),
configClass = MyConfig::class
)
commandManager.command("mycommand", permission = "mymod.command") {
executes { context ->
// Command logic
1
}
subcommand("subcommand") {
executes { context ->
// Subcommand logic
1
}
}
}
CustomGui.openGui(
player = player,
title = "My GUI",
layout = listOf(/* GUI items */),
onInteract = { context ->
// Handle interactions
}
)
Add to your build.gradle.kts:
dependencies {
modImplementation "curse.maven:e-utils-1275646:6588136"
}
// Create a config
data class MyConfig(
override val version: String = "1.0.0",
override val configId: String = "mymod",
var debugMode: Boolean = false
) : ConfigData
// Initialize manager
val configManager = ConfigManager(
currentVersion = "1.0.0",
defaultConfig = MyConfig(),
configClass = MyConfig::class,
metadata = ConfigMetadata(
headerComments = listOf("My mod configuration")
)
)
// Access config
val currentConfig = configManager.getCurrentConfig()
val commandManager = CommandManager("mymod")
commandManager.command("hello", permission = "mymod.hello") {
executes { context ->
val source = context.source
CommandManager.sendSuccess(source, "Hello, World!")
1
}
}
CustomGui.openGui(
player = player,
title = "My GUI",
layout = listOf(
CustomGui.createNormalButton(
ItemStack(Items.DIAMOND),
"Click Me!",
listOf("Button Description")
)
),
onInteract = { context ->
// Handle button clicks
}
)
Contributions are welcome! Feel free to submit issues and pull requests.
The complete source code for EverlastingUtils is available on GitHub: EverlastingUtils Repository
Add this to your build.gradle.kts:
dependencies {
modCompileOnly(files("libs/everlastingutils-1.0.0.jar"))
}
Make sure to place the EverlastingUtils JAR file in your project's libs directory.