mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-10-04 05:27:27 +02:00
Fixed crash when pressing F3 + F4
This commit is contained in:
parent
7520103bae
commit
4feee86511
@ -27,6 +27,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@ -42,7 +43,8 @@ public class MixinGameModeSelectionScreen {
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
public void fixUIWidth(CallbackInfo ci) {
|
||||
if (ProtocolHack.getTargetVersion().isOlderThan(ProtocolVersion.v1_8)) {
|
||||
final List<GameModeSelectionScreen.GameModeSelection> gameModeSelections = Arrays.stream(GameModeSelectionScreen.GameModeSelection.values()).toList();
|
||||
final List<GameModeSelectionScreen.GameModeSelection> gameModeSelections = new ArrayList<>(Arrays.stream(GameModeSelectionScreen.GameModeSelection.values()).toList());
|
||||
|
||||
if (ProtocolHack.getTargetVersion().isOlderThan(LegacyProtocolVersion.r1_3_1tor1_3_2)) gameModeSelections.remove(GameModeSelectionScreen.GameModeSelection.ADVENTURE);
|
||||
if (ProtocolHack.getTargetVersion().isOlderThan(ProtocolVersion.v1_8)) gameModeSelections.remove(GameModeSelectionScreen.GameModeSelection.SPECTATOR);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user