fix: revert spectator tab highlight mixin to restore vanilla spectator gameplay
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,7 @@
|
||||
"package": "org.examp.john.mixin",
|
||||
"compatibilityLevel": "JAVA_25",
|
||||
"mixins": [
|
||||
"CommandLogMixin",
|
||||
"SpectatorTabMixin"
|
||||
"CommandLogMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
Reference in New Issue
Block a user