diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen.java index 5fe4c71e..ee1de77a 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen.java @@ -47,15 +47,13 @@ public class MixinGameModeSelectionScreen extends Screen { @Inject(method = "", at = @At("RETURN")) public void fixUIWidth(CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_7_6tor1_7_10)) { final List gameModeSelections = new ArrayList<>(Arrays.stream(GameModeSelectionScreen.GameModeSelection.values()).toList()); - if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_3_1tor1_3_2)) { + gameModeSelections.remove(GameModeSelectionScreen.GameModeSelection.SPECTATOR); + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_2_4tor1_2_5)) { gameModeSelections.remove(GameModeSelectionScreen.GameModeSelection.ADVENTURE); } - if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_8)) { - gameModeSelections.remove(GameModeSelectionScreen.GameModeSelection.SPECTATOR); - } viafabricplus_unwrappedGameModes = gameModeSelections.toArray(GameModeSelectionScreen.GameModeSelection[]::new); UI_WIDTH = viafabricplus_unwrappedGameModes.length * 31 - 5; @@ -71,7 +69,7 @@ public class MixinGameModeSelectionScreen extends Screen { @Redirect(method = "init", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/screen/GameModeSelectionScreen$GameModeSelection;VALUES:[Lnet/minecraft/client/gui/screen/GameModeSelectionScreen$GameModeSelection;")) public GameModeSelectionScreen.GameModeSelection[] removeNewerGameModes() { - if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_7_6tor1_7_10)) { return viafabricplus_unwrappedGameModes; } return GameModeSelectionScreen.GameModeSelection.values(); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen_GameModeSelection.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen_GameModeSelection.java index 55201022..3e8b160d 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen_GameModeSelection.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen_GameModeSelection.java @@ -53,7 +53,7 @@ public class MixinGameModeSelectionScreen_GameModeSelection { @Inject(method = "next", at = @At("HEAD"), cancellable = true) private void unwrapGameModes(CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_7_6tor1_7_10)) { switch ((GameModeSelectionScreen.GameModeSelection) (Object) this) { case CREATIVE -> cir.setReturnValue(SURVIVAL); case SURVIVAL -> {