fix: revert spectator tab highlight mixin to restore vanilla spectator gameplay

This commit is contained in:
2026-10-04 19:28:30 +02:00
parent f0b5d603ad
commit ae102817b6
2 changed files with 1 additions and 26 deletions
@@ -1,24 +0,0 @@
package org.examp.john.mixin;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.level.GameType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ClientboundPlayerInfoUpdatePacket.Entry.class)
public class SpectatorTabMixin {
@Redirect(
method = "<init>(Lnet/minecraft/server/level/ServerPlayer;)V",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/level/ServerPlayer;gameMode()Lnet/minecraft/world/level/GameType;"
)
)
private static GameType msnexus$highlightSpectatorsInTab(ServerPlayer player) {
GameType gameMode = player.gameMode();
return gameMode == GameType.SPECTATOR ? GameType.SURVIVAL : gameMode;
}
}
+1 -2
View File
@@ -4,8 +4,7 @@
"package": "org.examp.john.mixin",
"compatibilityLevel": "JAVA_25",
"mixins": [
"CommandLogMixin",
"SpectatorTabMixin"
"CommandLogMixin"
],
"injectors": {
"defaultRequire": 1