Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
StringReader fix allowing to use non-English characters (for example,…
Browse files Browse the repository at this point in the history
… it fixes PlayerListEntryArgumentType)

Fix by MeteorDevelopment/meteor-client#4492
  • Loading branch information
Nekiplay committed Apr 5, 2024
1 parent 3528918 commit 720db26
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package nekiplay.meteorplus.mixin.minecraft;

import com.mojang.brigadier.StringReader;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(StringReader.class)
public class StringReaderMixin {
@Inject(method = "isAllowedInUnquotedString", at = @At("RETURN"), remap = false, cancellable = true)
private static void onIsAllowedInUnquotedString(char c, CallbackInfoReturnable<Boolean> cir) {
cir.setReturnValue(
Character.isLetterOrDigit(c)
|| c == '_' || c == '-'
|| c == '.' || c == '+'
);
}
}
69 changes: 35 additions & 34 deletions src/main/resources/meteorplus.mixins.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
{
"required": true,
"package": "nekiplay.meteorplus.mixin",
"compatibilityLevel": "JAVA_17",
"plugin": "nekiplay.meteorplus.MixinPlugin",
"client": [
"meteorclient.LeftRightSettingsScreenMixin",
"meteorclient.ModuleMixin",
"meteorclient.ModulesScreenMixin",
"meteorclient.WMeteorModuleMixin",
"meteorclient.WPressableMixin",
"required": true,
"package": "nekiplay.meteorplus.mixin",
"compatibilityLevel": "JAVA_17",
"plugin": "nekiplay.meteorplus.MixinPlugin",
"client": [
"meteorclient.LeftRightSettingsScreenMixin",
"meteorclient.ModuleMixin",
"meteorclient.ModulesScreenMixin",
"meteorclient.WBlockPosEditMixin",
"meteorclient.WMeteorModuleMixin",
"meteorclient.WPressableMixin",
"meteorclient.modules.AutoToolMixin",
"meteorclient.modules.BlockESPMixin",
"meteorclient.modules.ESPMixin",
"meteorclient.modules.FreecamMixin",
"meteorclient.modules.ItemHighlightMixin",
"meteorclient.modules.KillAuraMixin",
"meteorclient.modules.NoRenderMixin",
"meteorclient.modules.AutoToolMixin",
"meteorclient.modules.BlockESPMixin",
"meteorclient.modules.ESPMixin",
"meteorclient.modules.FreecamMixin",
"meteorclient.modules.ItemHighlightMixin",
"meteorclient.modules.KillAuraMixin",
"meteorclient.modules.TracersMixin",
"meteorclient.modules.WaypointsModuleMixin",
"minecraft.ClientConnectionAccessor",
"minecraft.ClientPlayerInteractionManagerMixin",
"minecraft.CraftingScreenHandlerAccessor",
"minecraft.MinecraftClientMixin",
"minecraft.ShapelessRecipeAccessor",
"minecraft.hud.DebugHudMixin"
],
"injectors": {
"defaultRequire": 1
},
"mixins": [
"meteorclient.DefaultSettingsWidgetFactoryMixin",
"meteorclient.KeybindMixin",
"minecraft.ClientPlayerEntityMixin",
"minecraft.LivingEntityMixin"
]
"meteorclient.modules.TracersMixin",
"meteorclient.modules.WaypointsModuleMixin",
"minecraft.ClientConnectionAccessor",
"minecraft.ClientPlayerInteractionManagerMixin",
"minecraft.CraftingScreenHandlerAccessor",
"minecraft.MinecraftClientMixin",
"minecraft.ShapelessRecipeAccessor",
"minecraft.hud.DebugHudMixin"
],
"injectors": {
"defaultRequire": 1
},
"mixins": [
"meteorclient.DefaultSettingsWidgetFactoryMixin",
"meteorclient.KeybindMixin",
"minecraft.ClientPlayerEntityMixin",
"minecraft.LivingEntityMixin",
"minecraft.StringReaderMixin"
]
}

0 comments on commit 720db26

Please sign in to comment.