From 99d37d33f9133e45a6eb0f864041a3e95e9e9428 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 25 Jun 2023 09:23:40 +0700 Subject: [PATCH] patch namespace exploit !! --- .../chipmunkmod/mixin/IdentifierMixin.java | 17 +++++++++++++++++ src/main/resources/chipmunkmod.mixins.json | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/main/java/land/chipmunk/chipmunkmod/mixin/IdentifierMixin.java diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/IdentifierMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/IdentifierMixin.java new file mode 100644 index 0000000..8b51f03 --- /dev/null +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/IdentifierMixin.java @@ -0,0 +1,17 @@ +package land.chipmunk.chipmunkmod.mixin; + +import net.minecraft.util.Identifier; +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(Identifier.class) +public class IdentifierMixin { + @Inject(method = "isNamespaceCharacterValid", at = @At("HEAD"), cancellable = true) + private static void isNamespaceCharacterValid(char character, CallbackInfoReturnable cir) { + cir.setReturnValue(true); + + cir.cancel(); + } +} diff --git a/src/main/resources/chipmunkmod.mixins.json b/src/main/resources/chipmunkmod.mixins.json index 4561937..330c33b 100644 --- a/src/main/resources/chipmunkmod.mixins.json +++ b/src/main/resources/chipmunkmod.mixins.json @@ -18,7 +18,8 @@ "StringHelperMixin", "NbtIoMixin", "KeyboardInputMixin", - "ElderGuardianAppearanceParticleMixin" + "ElderGuardianAppearanceParticleMixin", + "IdentifierMixin" ], "injectors": { "defaultRequire": 1