Releases: ocpu/Boxlin
Quality of Life Updates
Implied mod id
If you are using the functional mod loading method you can now name the function like your mod id and remove the mod id from the annotation.
// Before
@FunctionalMod("boxlin")
fun main() {}
// After
@FunctionalMod
fun boxlin() {}Function argument injections
You are now able to get the boxlin context injected into your functional mod function.
// Before
@FunctionalMod
fun boxlin() {
val context = BoxlinContext.get()
context.addListener<...> { ... }
}
@FunctionalMod
fun boxlin() {
with (BoxlinContext.get()) {
addListener<...> { ... }
}
}
// After
@FunctionalMod
fun boxlin(context: BoxlinContext) {
context.addListener<...> { ... }
}
@FunctionalMod
fun BoxlinContext.boxlin() {
addListener<...> { ... }
}Operator overloads
These methods have become available as operator overloads
BlockPos::addBlockPos::subBlockPos::mulBlockPos::divVec3i::addVec3i::subVec3i::mulVec3i::div- + Int operations with
BlockPosandVec3i CompoundNBT::putCompoundNBT::putBooleanCompoundNBT::putByteCompoundNBT::putByteArrayCompoundNBT::putDoubleCompoundNBT::putFloatCompoundNBT::putIntCompoundNBT::putIntArrayCompoundNBT::putLongCompoundNBT::putLongArrayCompoundNBT::putShortCompoundNBT::putStringCompoundNBT::putUniqueIdCompoundNBT::mergenewNBTTag = nbtTag + otherNBTTagnbtTag += otherNBTTag
Commits
- 5ea5f31 Added automatic version publishing + version bump
- 32c3df6 Removed unused code
- c2708b9 Added a function that only takes a function
- 7fdaa40 Added since information
- 015a490 Ported behaviour from methods to kotlin operations
- 781d7a4 Made the injections be from a map instead of inline
- aa7dfc6 Able to imply the mod id from the function name
- 2c0ef52 Extracted function signature parsing into a class
- 00fd5d0 Bumped the loader version
- ec35c3a Added logo to readme
- 1b0c3de Changed logging texts to have more info
- 609203e Added better function querying + functionality
Hey Listen
This release is mostly for fixing event listeners, but also to mark the beginning of the new version numbers. The version numbers from here on out has the actual version of the library suffixed with the Minecraft version it was build for with a hyphen (-) between. So if you are building for 1.14 you put 3.1.0-1.14.4 or for 1.15 3.1.0-1.15.2.
The fixes for the event listeners are for when the event type is of GenericEvent or for the most frequent of them RegistryEvent.Register. As of the a little weird way of generics the "sub" generic was not respected when registering the event listener. Other improvements are that you can add a little more configuration to when you are registering the event listener, like event priority and if the listener should receive canceled events.
Commits
MC 1.15
EventBusSubscriber for objects and working release
As the title says EventBusSubscriber annotations now work for objects. As for the working release part; since the manifest in the META-INF was empty forge thought that it was just a regular mod.
Commits
Version 3.0.0 and Minecraft 1.14 mods
Initial 3.0 version
Kotlin Corutines
This release provides the latest Kotlin corutines to the library for making asynchronous calls.
Proxy injector
You can now delegate your proxies to a property. Like this:
@Mod(...)
object ModClass {
val proxy by useProxy(CLIENT_PROXY::class, SERVER_PROXY::class)
@EventHandler
fun preInit(e: FMLPreInitializationEvent) {
proxy.preInit(e)
}
}Changes:
getGuiConfig -> getGuiConfigScreenget(category, key, defaultValue, comment, values) -> get(category, key, defaultValue, comment)ConfigurationHandler.guiConfig -> ConfigurationHandler.guiConfigScreen
Added:
- Javadoc
- Kotlin Reflect is now bundled with the jar
ProxyInjectordelegate to create proxiesuseProxyto createProxyInjectorinstances
Refactoring and utilities
This version brings utilities to Boxlin. The utilities are documented here.
First version of Boxlin
v1.0.0.0 Readme and license