Connector icon indicating copy to clipboard operation
Connector copied to clipboard

The connector failed to transform the mixins for mojang's brigadier classes.

Open sakurawald opened this issue 1 year ago • 6 comments

Minecraft version

1.21

Describe the bug

The connector failed to transform the mixins for mojang's brigadier classes.

Steps to reproduce

  1. Write a mixin like this:
@Mixin(value = CommandNode.class, remap = false)
public interface CommandNodeAccessor<S> {

    @Accessor
    @Mutable
    void setRequirement(Predicate<S> predicate);

}
  1. Launch the server, and you will get the error:
[13:19:12] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
java.lang.ClassCastException: class com.mojang.brigadier.tree.ArgumentCommandNode cannot be cast to class io.github.sakurawald.module.mixin.command_permission.CommandNodeAccessor (com.mojang.brigadier.tree.ArgumentCommandNode is in module [email protected] of loader 'MC-BOOTSTRAP' @25bbf683; io.github.sakurawald.module.mixin.command_permission.CommandNodeAccessor is in module [email protected] of loader 'TRANSFORMER' @5b48f0f4)

Logs

see above

Additional context

That's all. The environment is

  Minecraft 1.21
  NeoForge Loader: 21.0.167

  Mods:
  [✔] connector-2.0.0-beta.1+1.21-full
  [✔] forgified-fabric-api-0.101.2+2.0.10+1.21
  [✔] example-mod

sakurawald avatar Sep 28 '24 05:09 sakurawald

Minecraft version

1.20.1

pls change mc version to 1.21.1

kakashi1464 avatar Sep 28 '24 06:09 kakashi1464

Which mc version is this for?

Su5eD avatar Sep 28 '24 08:09 Su5eD

Which mc version is this for?

The environment is 1.21, and i and using the connector for minecraft 1.21

sakurawald avatar Sep 28 '24 08:09 sakurawald

This exact issue is also causing one of my mods to fail on connector: DrexHD/VanillaPermissions#17

DrexHD avatar Sep 29 '24 15:09 DrexHD

This exact issue is also causing one of my mods to fail on connector: DrexHD/VanillaPermissions#17

Yes, it is about the loading mechanism of jvm. Currently i am using a workaround: put the related method inside the mixin itself, and mark these methods with @Unique annotation.

sakurawald avatar Sep 30 '24 06:09 sakurawald

Looks to be the same case as #214, where authlib was not transformable. Brigadier is also a boot cp library, so that checks out.

If it's not used in boot code (which it likely isn't) I can hack ML to move it to the game layer just like we do with authlib, but eventually I'd like to fix this in Neo properly.

Su5eD avatar Oct 02 '24 12:10 Su5eD