Make sure IsModded returns false everywhere

This commit is contained in:
Charlotte Som 2022-03-07 23:56:50 +00:00
parent f96a4fc83d
commit a1ea8ca51e
3 changed files with 17 additions and 17 deletions

View file

@ -1,15 +0,0 @@
package site.hackery.unknit.mixin;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.ModStatus;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(MinecraftClient.class)
public abstract class MixinMinecraftClient {
@Redirect(method = "getWindowTitle", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/ModStatus;isModded()Z"))
private boolean onGetIsModded(ModStatus instance) {
return false;
}
}

View file

@ -0,0 +1,15 @@
package site.hackery.unknit.mixin;
import net.minecraft.util.ModStatus;
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(ModStatus.class)
public abstract class MixinModStatus {
@Inject(method = "isModded", at = @At(value = "RETURN"), cancellable = true)
private void onGetIsModded(CallbackInfoReturnable<Boolean> cir) {
cir.setReturnValue(false);
}
}

View file

@ -10,7 +10,7 @@
"client": [
"MixinClientBrandRetriever",
"MixinFabricAbstractChanneledNetworkAddon",
"MixinMinecraftClient",
"MixinMinecraftMain"
"MixinMinecraftMain",
"MixinModStatus"
]
}