#Successful cross-mapping launch

69 messages Β· Page 1 of 1 (latest)

near dagger
#

pingudance I've finally achieved a successful mod launch on 26.1 Snapshot 6 after compiling the mod on 1.21.11 thinkbro
Notice, 26.1 is already unobfuscated, while 1.21.11 uses obfuscation and usually compiles in intermediary namespace.

Done using ✨ Version't versiont

On the screenshot you can see a GUI implemented by extending the BookViewScreen class, which normally, due to mapping mismatch, would lead to a ClassDefNotFound exception.

-# "Version't" isn't yet production-ready, it's not well documented, tiresome to use and a bit cursed concern

tame jetty
#

neat, is this similar to the backcompat mappings that @modern valley has been working on?

near dagger
#

Nope, this uses Java Reflection and runtime Byte Code generation under the hood to wrap Minecraft classes

#

Technically the mod doesn't need any mappings at all during compilation

tame jetty
#

fascinating... so you really do just produce one mod jar for every version?

near dagger
#

Since you provide your own mappings

near dagger
tame jetty
#

that is REALLY COOL

near dagger
#

Including 26.1 as well, but I am not yet fully migrating, since snapshot stuff might change

tame jetty
#

how do you handle version specific resource loading?

near dagger
#

A facade-like pattern which delegates to version specific implementation

tame jetty
#

wow that is really excellent

near dagger
#

This is used in the init logic of my GUI

tame jetty
#

i'll definitely check it out once you publish it

near dagger
#

A bit tiresome to write and then also check every single version when you create some new feature

near dagger
tame jetty
near dagger
#

Well, yeah, kinda

#

But you also have to make sure, that you save the correct mappings

#

This is my mapping format

tame jetty
#

ohh a custom mapping format

near dagger
#

it's cursed as fk

modern valley
#

I've seen this (your thing) before yeah, it's cursed as fuck

near dagger
#

For any Minecraft class I use I basically create a mapping that exposes the methods that I need, then I generate the code for it and instead of e.g. "import net.minecraft.client.Minecraft" I go with "import dev.gxlg.versiont.get.net.minecraft.client.Minecraft"

tame jetty
#

huh

near dagger
near dagger
# tame jetty huh

Well, since when it compiles in intermediary environment, it's gonna be like "net.minecraft.class_123"

#

And 26.1 has no idea what that is

tame jetty
near dagger
#

So I have a generated class that wraps around that class

near dagger
tame jetty
#

lol

#

maybe worth looking into

near dagger
tame jetty
#

i see

modern valley
#

so it's much faster now?

near dagger
#

Yess

#

Well

#

I didn't really feel a big difference honestly

#

Cuz it wasn't slow before

#

But in theory it is faster

modern valley
#

could you make an example mod using this?

near dagger
#

And it's thread safe now

near dagger
modern valley
#

uhh, maybe like, not that cuz that uses fapi

#

do like uhhh

#

hmmm

#

adding a new screen which in text shows the items in your inventory

near dagger
#

Alright, let me cook. Currently eating, gonna do in like 1 h

near dagger
#

Sorry, gonna take a bit longer, realized that I could improve runtime class creation, because right now it is painfully slow

#

Thx copilot

near dagger
#

Runs in 1.21.11 and 26.1

#

Haven't checked other versions

modern valley
#

upload it to github ?

near dagger
#

Uh, nah, it's just ugly quick template mod

#

Version't Library and the Toolchain are both on GitHub, I am working on imrpovements locally right now

weak sundial
#

@near dagger This looks a lot like the framework I'm working on πŸ‘€

near dagger
#

Does it work regardless of mappings?

#

Ah, as I see, it indeed does

#

This is peak

#

Yours looks better and easier to use when it comes to usage 😭

weak sundial
weak sundial
#

Also sorry, didn't mean to hijack your thread πŸ˜“