A library for using neoforge 1.21.1 features and methods on forge 1.20.1
This mod is intended to be used as a library included with other mods. Currently, the only standalone features are blurred 1.21-style gui backgrounds. Manually installing a newer version than is packaged is only useful for fixing bugs
... and a lot of convenience interface extensions
Since this lib uses interface injections, switching from ForgeGradle to ModDevGradle Legacy gradle plugin is required. Documentation here and a working MDK here
In build.gradle:
repositories {
// Some other repositories you might have...
maven {
url = 'https://nikdo53.github.io'
}
}
dependencies {
// Some other dependencies you might have...
jarJar(modImplementation("net.nikdo53:NeoBackports:${neobackports_version}"))
interfaceInjectionData("net.nikdo53:NeoBackports:${neobackports_version}")
}
In gradle.properties:
# Set to whatever is latest
neobackports_version=1.4.1
Features aren't backported 1 to 1 (due to backend differences between versions) but should be similar enough for most mods to just work without major differences
In order to make the difference between original forge/vanilla classes and backported ones, backported classes get the "neo" suffix, for example:
Unlike 1.21.1, these are just clever wrappers for existing features (item nbt and capabilities respectively), meaning that other mods not using this API should be able to access them like normal.
These have been (with permission) ported directly from neoforges code with minimal differences. Note that the login packet which handshaked known datamaps has been removed and non-mandatory are generally not supported. I might return to this in the future, but since this mod is required on both client and server, it's probably not very useful (and 1.20.1 login packets are weird)
The ByteBuf generic has been removed, since everything uses FriendlyByteBuf:
StreamCodec<RegistryFriendlyByteBuf, SomeClass> -> StreamCodec<SomeClass>