question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mixins silently fail to apply to libraries such as Brigadier and DFU

See original GitHub issue

Mixins which target libraries such as Authlib, Brigadier and DataFixerUpper do not apply.

A simple example of how to reproduce this is below:

private int testCmd(CommandContext<ServerCommandSource> ctx) throws CommandSyntaxException {
        ServerPlayerEntity spe = ctx.getSource().getPlayer();
        ctx.getSource().sendFeedback(new LiteralText(((GameProfileTest) spe.getGameProfile()).getUuid().toString()), false);
        return 1;
}
public interface GameProfileTest {
    UUID getUuid();
    Optional<String> getName();
}
@Mixin(GameProfile.class)
public abstract class GameProfileMixin implements GameProfileTest {
    @Shadow public abstract UUID shadow$getId();
    @Shadow public abstract String shadow$getName();

    @Override
    public UUID getUuid() {
        return this.shadow$getId();
    }

    @Override
    public Optional<String> getName() {
        return Optional.ofNullable(this.shadow$getName());
    }
}

When the example command is executed, it will fail because of a ClassCastException which means the mixin into GameProfile failed.

My testing has shown this occurs on both the client and server environment.

Main on the client seems to refer to Authlib before MinecraftClient is started in Main.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LoganDarkcommented, Apr 2, 2022

@LoganDark Is this fixed now?

Indeed - #630 completely fixed all issues mixing into game libraries. In fact, https://github.com/LoganDark/fabric-command-hider was developed on a draft version of the PR.

I guess I’m just lucky as heck.

This issue is now as good as resolved 😃

0reactions
liachcommented, Apr 2, 2022

@LoganDark Is this fixed now?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mprovement Era Vol. XXI July, 1918 No. 9 A Plucky Pioneer Motherau
about ten years old, I un dertook such an obligation from sheer n ece ssity. The he adof our hou seholdwas , a...
Read more >
MIT was we will home can us about if page my has no
... amendment strength despite guaranteed libraries turkey distributed proper ... mit stability pride boss applying southwest expectations institutional ...
Read more >
11958297 files 8600432 settings 8347444 us
... application 1257525 i 1236769 ad 1181626 bf 1168756 lproj 1167285 library ... play 19248 vox 19218 how 19169 px 19167 with 19117...
Read more >
Click here to download - Computer Science
... what which their news out use any there see only so his when contact here ... register however june october november market...
Read more >
glove_vocab.250k.txt - Bar Ilan NLP Lab
... really information through want # 5 him right take views such made those ... agriculture starter libraries laura asks receiver applying conventional...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found