From dee1a5a8a032ef5496d4e9017a42b0404c7a7f6e Mon Sep 17 00:00:00 2001 From: MicrocontrollersDev Date: Tue, 29 Jul 2025 13:27:07 -0700 Subject: [PATCH] fix MC-171420 --- PATCHED.md | 1 + .../basic/mc171420/MinecraftServerMixin.java | 26 +++++++++++++++++++ src/main/resources/debugify.mixins.json | 1 + 3 files changed, 28 insertions(+) create mode 100644 src/main/java/dev/isxander/debugify/mixins/basic/mc171420/MinecraftServerMixin.java diff --git a/PATCHED.md b/PATCHED.md index 9023064e..35a55944 100644 --- a/PATCHED.md +++ b/PATCHED.md @@ -85,6 +85,7 @@ | Basic | [MC-159283](https://bugs.mojang.com/browse/MC-159283) | The End terrain does not generate in multiple rings centered around the world center | | Basic | [MC-160095](https://bugs.mojang.com/browse/MC-160095) | End Rods only break Cactus when moved by pistons | | Basic | [MC-170462](https://bugs.mojang.com/browse/MC-170462) | Bad Omen is considered a positive effect in potion item tooltips | +| Basic | [MC-171420](https://bugs.mojang.com/browse/MC-171420) | OP players get kicked for not being on the whitelist (enforce = on) | | Basic | [MC-176806](https://bugs.mojang.com/browse/MC-176806) | Scoreboard criteria for using glowstone doesn't increase score when charging a respawn anchor | | Basic | [MC-177381](https://bugs.mojang.com/browse/MC-177381) | Game does not count the distance properly if you locate a structure from more than 46340 blocks away | | Basic | [MC-179072](https://bugs.mojang.com/browse/MC-179072) | Creepers do not defuse when switching from Survival to Creative/Spectator | diff --git a/src/main/java/dev/isxander/debugify/mixins/basic/mc171420/MinecraftServerMixin.java b/src/main/java/dev/isxander/debugify/mixins/basic/mc171420/MinecraftServerMixin.java new file mode 100644 index 00000000..f6d19ca3 --- /dev/null +++ b/src/main/java/dev/isxander/debugify/mixins/basic/mc171420/MinecraftServerMixin.java @@ -0,0 +1,26 @@ +package dev.isxander.debugify.mixins.basic.mc171420; + +import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; +import com.llamalad7.mixinextras.sugar.Local; +import dev.isxander.debugify.fixes.BugFix; +import dev.isxander.debugify.fixes.FixCategory; +import net.minecraft.network.chat.Component; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.server.network.ServerGamePacketListenerImpl; +import net.minecraft.server.players.PlayerList; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; + +@BugFix(id = "MC-171420", category = FixCategory.BASIC, env = BugFix.Env.SERVER, description = "OP players get kicked for not being on the whitelist (enforce = on)") +@Mixin(MinecraftServer.class) +public abstract class MinecraftServerMixin { + @Shadow + public abstract PlayerList getPlayerList(); + + @WrapWithCondition(method = "kickUnlistedPlayers", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerGamePacketListenerImpl;disconnect(Lnet/minecraft/network/chat/Component;)V")) + private boolean isOpCheck(ServerGamePacketListenerImpl instance, Component component, @Local ServerPlayer serverPlayer) { + return !this.getPlayerList().isOp(serverPlayer.getGameProfile()); + } +} diff --git a/src/main/resources/debugify.mixins.json b/src/main/resources/debugify.mixins.json index cf77856d..53bc9670 100644 --- a/src/main/resources/debugify.mixins.json +++ b/src/main/resources/debugify.mixins.json @@ -31,6 +31,7 @@ "basic.mc160095.CactusBlockMixin", "basic.mc168573.BlocksAttacksMixin", "basic.mc170462.MobEffectsMixin", + "basic.mc171420.MinecraftServerMixin", "basic.mc176806.RespawnAnchorBlockMixin", "basic.mc17738.LocateCommandMixin", "basic.mc179072.SwellGoalMixin",