diff options
| author | Aizistral | 2026-11-18 20:21:08 +0100 |
|---|---|---|
| committer | Aizistral | 2026-11-18 20:21:08 +0100 |
| commit | 0465b164417e911ac86d6ca7fb60930f066c0f24 (patch) | |
| tree | 58b9d3276194b691be8e2367e5d23d3db5fa3daa /Forge/src/main/java/com | |
| parent | 83002e237792b28cb4101eff021483e966864588 (diff) | |
Wrap user properties on read
Diffstat (limited to 'Forge/src/main/java/com')
| -rw-r--r-- | Forge/src/main/java/com/aizistral/nochatrestrictions/mixins/MixinMinecraft.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Forge/src/main/java/com/aizistral/nochatrestrictions/mixins/MixinMinecraft.java b/Forge/src/main/java/com/aizistral/nochatrestrictions/mixins/MixinMinecraft.java index e470410..c74f907 100644 --- a/Forge/src/main/java/com/aizistral/nochatrestrictions/mixins/MixinMinecraft.java +++ b/Forge/src/main/java/com/aizistral/nochatrestrictions/mixins/MixinMinecraft.java @@ -7,7 +7,9 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.aizistral.nochatrestrictions.core.NCRCore; import com.aizistral.nochatrestrictions.core.WrappedUserApiService; +import com.aizistral.nochatrestrictions.core.WrappedUserProperties; import com.mojang.authlib.minecraft.UserApiService; +import com.mojang.authlib.minecraft.UserApiService.UserProperties; import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; import net.minecraft.client.Minecraft; @@ -26,6 +28,15 @@ public class MixinMinecraft { NCRCore.LOGGER.info("Successfully supplanted UserApiService with a wrapped version."); } + @Inject(method = { "m_307512_", "userProperties" }, at = @At("RETURN"), cancellable = true) + public void onGetUserProperties(CallbackInfoReturnable<UserProperties> info) { + UserProperties properties = info.getReturnValue(); + + if (properties != null) { + info.setReturnValue(WrappedUserProperties.of(properties)); + } + } + @Inject(method = { "m_294837_", "isNameBanned" }, at = @At("HEAD"), cancellable = true) public void onCheckNameBan(CallbackInfoReturnable<Boolean> info) { info.setReturnValue(Boolean.FALSE); |
