fix: crash with sodium

This commit is contained in:
deechael 2024-10-12 12:12:41 +08:00
parent 01758809b8
commit f868af2020
4 changed files with 10 additions and 7 deletions

View File

@ -48,8 +48,9 @@ public class SodiumVideoOptionsScreenMixin {
.setName(Component.translatable("concentration.option.fullscreen_mode"))
.setTooltip(Component.translatable("concentration.option.fullscreen_mode.tooltip"))
.setControl((opt) -> new CyclingControl<>(opt, FullscreenMode.class, new Component[]{
Component.translatable("concentration.option.fullscreen_mode.borderless"),
Component.translatable("concentration.option.fullscreen_mode.native")
Component.translatable("concentration.option.fullscreen_mode.exclusive"),
Component.translatable("concentration.option.fullscreen_mode.native"),
Component.translatable("concentration.option.fullscreen_mode.borderless")
}))
.setBinding((options, value) -> {
ConcentrationConfigFabric.getInstance().fullscreen = value;

View File

@ -1,4 +1,4 @@
version=2.2.0
version=2.2.1
group=net.deechael.concentration
java_version=21

View File

@ -31,8 +31,9 @@ public class EmbeddiumCompat {
.setName(Component.translatable("concentration.option.fullscreen_mode"))
.setTooltip(Component.translatable("concentration.option.fullscreen_mode.tooltip"))
.setControl((opt) -> new CyclingControl<>(opt, FullscreenMode.class, new Component[]{
Component.translatable("concentration.option.fullscreen_mode.borderless"),
Component.translatable("concentration.option.fullscreen_mode.native")
Component.translatable("concentration.option.fullscreen_mode.exclusive"),
Component.translatable("concentration.option.fullscreen_mode.native"),
Component.translatable("concentration.option.fullscreen_mode.borderless")
}))
.setBinding((vanillaOpts, value) -> {
ConcentrationConfigNeoForge.ensureLoaded().setFullscreenMode(value);

View File

@ -48,8 +48,9 @@ public class SodiumVideoOptionsScreenMixin {
.setName(Component.translatable("concentration.option.fullscreen_mode"))
.setTooltip(Component.translatable("concentration.option.fullscreen_mode.tooltip"))
.setControl((opt) -> new CyclingControl<>(opt, FullscreenMode.class, new Component[]{
Component.translatable("concentration.option.fullscreen_mode.borderless"),
Component.translatable("concentration.option.fullscreen_mode.native")
Component.translatable("concentration.option.fullscreen_mode.exclusive"),
Component.translatable("concentration.option.fullscreen_mode.native"),
Component.translatable("concentration.option.fullscreen_mode.borderless")
}))
.setBinding((options, value) -> {
ConcentrationConfigNeoForge.FULLSCREEN.set(value);