Closed Cam396 closed 3 months ago
1.21 is still displaying as a release candidate on my end, so I'm gonna wait a little.
1.21 was released and both fabric (https://fabricmc.net/2024/05/31/121.html) and Minecraft (https://feedback.minecraft.net/hc/en-us/articles/27547857163917-Minecraft-Java-Edition-1-21-Tricky-Trials) have confirmed that enchants have changed and easier to use with a datapack
There appears to be some problems with the datapack method:
Datapacks seem to be unsuitable for the "change arbitrary enchantment's maximum level to arbitrary values" use case, which is what this mod needs.
hmm ig make a test branch to test stuff to see if it can be used as a mod. just update dependencies and gradle and the simply change the version.
There's a separate issue that somehow no mixins work when trying to update to 1.21.
ok so what do we do then. do we code a mod that just links the mixins to a datapack or something?
I need to debug that mixin issue before I can create any 1.21 update.
ok is that minecraft wide for all mixins, even things other then enchants, or is it just the mod?
It affects only my mod, but everything in it. Wondering if it's something with gradle.
hmm maybe try updating gradle and dependencies to the latest versions?
oh also they removed basically all of the classes your mod relies on. 1.20.6 https://maven.fabricmc.net/docs/yarn-1.20.6+build.1/net/minecraft/enchantment/Enchantment.html 1.21 https://maven.fabricmc.net/docs/yarn-1.21+build.1/net/minecraft/enchantment/Enchantment.html look at the changes between the two, as that is probably why your mod isn't working.
I already figured out why my mixins weren't working (it was what you mentioned, and I additionally got unlucky with the Fabric Example Mixin which is why I thought the whole mod wasn't working).
Good news is that I found the method that would need to be mixined. Bad news is that the method is RegistryLoader.parseAndAdd
. [Datapack method would be even harder to pull off, so that's not an option]
oh no, i might be able to help but I don't code too much java and js, so you'll have to make a example and then ill be able to do the rest basing it on thee example.
i know enough for what you're doing, but I need to see one example of it first is what I mean
I need to put a mixin in the middle of the parseAndAdd
function. You're probably going to need to know how to read bytecode to figure this out.
[deleted example just in case I accidentally infringed on copyright]
k i will look at it if i have time
I'll probably just look at Fabric Mixin Examples to figure it out.
Well, there's a fourth issue: I get a Critical Injection Failure whenever I try to use a value="INVOKE"
, and only that specific type of mixin. The error message I get in the logs provides no relevant info.
maybe start from scratch with the fabric example project in a new fork? use gradle 8.8, java 22 GraalVM (if possible, otherwise use java 21) and all latest versions of everything. sometimes when I'm debugging it is something you wouldn't think of at all, like a old file from a previous version that is somehow affecting it. make a new branch and Ill try to help but I'm going to be somewhere next week.
I had already restarted from fabric example project, so it can't possibly be that.
I did some crazy hack to get the mixin working correctly. I'm creating a github branch right now.
ok got it i will test it on my server
have you pushed the hack yet?
I pushed 1.21 as a new branch.
alright nice now it just needs to be cleaned up a bit and the readme and stuff needs to be fixed
A lot of stuff needs to be fixed.
Problem #1
at the moment is getting rid of the hack I just did with RegistryLoader.mixin.java
what is the hack
wait before you tell me will my braincells pack their bags and leave when they see it because of how dumb it is
It's not that dumb lol, but it definitely adds a ton of problems
alright what is it though
like which file?
src/main/java/mastery3/sharpness6/mixin/RegistryLoader.mixin.java
I'm trying to get it to a @Inject(at = @At(value = "INVOKE"), ...)
that only adds the code between // Start of injection
and // End of injection
without overwriting the entire function, but attempting that somehow causes a Critical Injection Error
hmm will test but i have to go to bed
The problems that the hack imposes is that it denies compatibility with any other mods that need to change that function
yeah so thats a interesting method of doing it but whatever works works ig
See if you can figure out why the Critical Injection Errors occur
ok
ima sleep now
see you tomorrow
Looking forward to the update - thank you! 😄
Update is almost done. Last problem is figuring out how to conditionally edit minecraft:unbreaking
without getting the original minecraft:unbreaking
deleted when the condition is not satisfied. (Yes, fabric:load_conditions
is that dumb.)
Update is done
https://fabricmc.net/2024/05/31/121.html 1.21 Changes many things on the backend and also changes how enchants are structured. Please read the link on the top of this issue to see all of the changes. There are a few fabric api changes that are also mentioned there.