diff --git a/gradle.properties b/gradle.properties index a1797ea..1c1ba38 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,15 @@ # Done to increase the memory available to gradle. -org.gradle.jvmargs=-Xmx1G +org.gradle.jvmargs=-Xmx4G org.gradle.parallel=true # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.21 -yarn_mappings=1.21+build.7 -loader_version=0.15.11 +minecraft_version=1.21.3 +yarn_mappings=1.21.3+build.2 +loader_version=0.16.7 # Mod Properties -mod_version=1.2.2 +mod_version=1.2.3 maven_group=cmods archives_base_name=cmods # Dependencies # check this on https://modmuss50.me/fabric.html -fabric_version=0.100.4+1.21 +fabric_version=0.107.0+1.21.3 diff --git a/src/client/java/cmods/cmods/ModMenuConfig.java b/src/client/java/cmods/cmods/ModMenuConfig.java index 850b19f..e4c4f76 100644 --- a/src/client/java/cmods/cmods/ModMenuConfig.java +++ b/src/client/java/cmods/cmods/ModMenuConfig.java @@ -5,6 +5,7 @@ import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; import net.minecraft.client.gui.screen.Screen; +@SuppressWarnings("unused") public class ModMenuConfig implements ModMenuApi { @Override public ConfigScreenFactory getModConfigScreenFactory() { diff --git a/src/client/java/cmods/cmods/api/PropertyUtils.java b/src/client/java/cmods/cmods/api/PropertyUtils.java index c74466b..00140f0 100644 --- a/src/client/java/cmods/cmods/api/PropertyUtils.java +++ b/src/client/java/cmods/cmods/api/PropertyUtils.java @@ -9,6 +9,7 @@ public class PropertyUtils { return Boolean.parseBoolean(properties.getProperty(key, default_value.toString())); } + @SuppressWarnings("unused") public static int getIntegerProperty(@Nullable java.util.Properties properties, String key, Integer default_value) { if (properties == null) return default_value; diff --git a/src/client/java/cmods/cmods/mixin/OptionsMixin.java b/src/client/java/cmods/cmods/mixin/OptionsMixin.java index 188318c..1e8273e 100644 --- a/src/client/java/cmods/cmods/mixin/OptionsMixin.java +++ b/src/client/java/cmods/cmods/mixin/OptionsMixin.java @@ -1,5 +1,6 @@ package cmods.cmods.mixin; +import cmods.cmods.options.CmodsOptions; import cmods.cmods.ui.CmodsOptionsScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.option.OptionsScreen; @@ -19,7 +20,7 @@ public class OptionsMixin extends Screen { @Inject(at = @At("TAIL"), method = "init") private void init(CallbackInfo ci) { - if (client == null) + if (client == null || !CmodsOptions.getInstance().uiOptions.show_in_options.get()) return; addDrawableChild(ButtonWidget.builder(Text.translatable("cmods.options"), diff --git a/src/client/java/cmods/cmods/mixin/PauseMixin.java b/src/client/java/cmods/cmods/mixin/PauseMixin.java index 45d001b..51ae6af 100644 --- a/src/client/java/cmods/cmods/mixin/PauseMixin.java +++ b/src/client/java/cmods/cmods/mixin/PauseMixin.java @@ -1,6 +1,7 @@ package cmods.cmods.mixin; +import cmods.cmods.options.CmodsOptions; import cmods.cmods.ui.CmodsOptionsScreen; import net.minecraft.client.gui.screen.GameMenuScreen; import net.minecraft.client.gui.screen.Screen; @@ -20,7 +21,7 @@ public class PauseMixin extends Screen { @Inject(at = @At("TAIL"), method = "init") public void init(CallbackInfo ci) { - if (client == null) + if (client == null || !CmodsOptions.getInstance().uiOptions.show_in_pause.get()) return; addDrawableChild(ButtonWidget.builder(Text.translatable("cmods.options"), diff --git a/src/client/java/cmods/cmods/options/BooleanOption.java b/src/client/java/cmods/cmods/options/BooleanOption.java index 9764a64..ad3d05d 100644 --- a/src/client/java/cmods/cmods/options/BooleanOption.java +++ b/src/client/java/cmods/cmods/options/BooleanOption.java @@ -5,6 +5,7 @@ public class BooleanOption extends Option { super(default_value); } + @SuppressWarnings("UnusedReturnValue") public boolean toggle() { return value = !value; } diff --git a/src/client/java/cmods/cmods/options/CmodsOptions.java b/src/client/java/cmods/cmods/options/CmodsOptions.java index b4769a7..7712270 100644 --- a/src/client/java/cmods/cmods/options/CmodsOptions.java +++ b/src/client/java/cmods/cmods/options/CmodsOptions.java @@ -91,6 +91,8 @@ public final class CmodsOptions { public BooleanOption enabled = new BooleanOption(true); public BooleanOption show_coordinates = new BooleanOption(true); public BooleanOption show_fps = new BooleanOption(true); + public BooleanOption show_in_pause = new BooleanOption(true); + public BooleanOption show_in_options = new BooleanOption(true); UIOptions() { } @@ -100,12 +102,16 @@ public final class CmodsOptions { enabled.value = getBooleanProperty(properties, PREFIX + "enabled", enabled.value); show_coordinates.value = getBooleanProperty(properties, PREFIX + "show_coordinates", show_coordinates.value); show_fps.value = getBooleanProperty(properties, PREFIX + "show_fps", show_coordinates.value); + show_in_pause.value = getBooleanProperty(properties, PREFIX + "show_in_pause", show_in_pause.value); + show_in_options.value = getBooleanProperty(properties, PREFIX + "show_in_options", show_in_options.value); } void save(Properties properties) { properties.setProperty(PREFIX + "enabled", enabled.value.toString()); properties.setProperty(PREFIX + "show_coordinates", show_coordinates.value.toString()); properties.setProperty(PREFIX + "show_fps", show_fps.value.toString()); + properties.setProperty(PREFIX + "show_in_pause", show_in_pause.value.toString()); + properties.setProperty(PREFIX + "show_in_options", show_in_options.value.toString()); } } } diff --git a/src/client/java/cmods/cmods/options/IntegerOption.java b/src/client/java/cmods/cmods/options/IntegerOption.java index 792d5b2..9125fdf 100644 --- a/src/client/java/cmods/cmods/options/IntegerOption.java +++ b/src/client/java/cmods/cmods/options/IntegerOption.java @@ -1,5 +1,6 @@ package cmods.cmods.options; +@SuppressWarnings("unused") public class IntegerOption extends Option { public IntegerOption(Integer default_value) { super(default_value); diff --git a/src/client/java/cmods/cmods/options/Option.java b/src/client/java/cmods/cmods/options/Option.java index 8e1ff02..fb12bb5 100644 --- a/src/client/java/cmods/cmods/options/Option.java +++ b/src/client/java/cmods/cmods/options/Option.java @@ -1,5 +1,6 @@ package cmods.cmods.options; +@SuppressWarnings("unused") public class Option { public T value; diff --git a/src/client/java/cmods/cmods/ui/Constants.java b/src/client/java/cmods/cmods/ui/Constants.java index d90cd21..94a9f9c 100644 --- a/src/client/java/cmods/cmods/ui/Constants.java +++ b/src/client/java/cmods/cmods/ui/Constants.java @@ -1,5 +1,6 @@ package cmods.cmods.ui; +@SuppressWarnings("unused") public class Constants { public static final int buttonWidth = 150; public static final int buttonHeight = 20; diff --git a/src/client/java/cmods/cmods/ui/IntegerAdjustWidget.java b/src/client/java/cmods/cmods/ui/IntegerAdjustWidget.java index 05170cb..1399ee1 100644 --- a/src/client/java/cmods/cmods/ui/IntegerAdjustWidget.java +++ b/src/client/java/cmods/cmods/ui/IntegerAdjustWidget.java @@ -9,6 +9,7 @@ import net.minecraft.text.Text; import java.util.ArrayList; import java.util.function.Consumer; +@SuppressWarnings("unused") public class IntegerAdjustWidget extends WrapperWidget { private final ArrayList elements; private final IntegerOption option; diff --git a/src/client/java/cmods/cmods/ui/UIOptionsScreen.java b/src/client/java/cmods/cmods/ui/UIOptionsScreen.java index 6e29f12..83e6a03 100644 --- a/src/client/java/cmods/cmods/ui/UIOptionsScreen.java +++ b/src/client/java/cmods/cmods/ui/UIOptionsScreen.java @@ -45,6 +45,12 @@ public class UIOptionsScreen extends Screen { adder.add(new ToggleButton(0, 0, buttonWidth, buttonHeight, Text.translatable("cmods.options.ui.show_fps"), options.uiOptions.show_fps)); + adder.add(new ToggleButton(0, 0, buttonWidth, buttonHeight, + Text.translatable("cmods.options.ui.show_in_pause"), options.uiOptions.show_in_pause)); + + adder.add(new ToggleButton(0, 0, buttonWidth, buttonHeight, + Text.translatable("cmods.options.ui.show_in_options"), options.uiOptions.show_in_options)); + for (Pair, Integer> buttonArray : extraButtons) { for (ButtonBuilder buttonBuilder : buttonArray.getLeft()) { adder.add(buttonBuilder.build(this, client)); diff --git a/src/main/resources/assets/cmods/lang/en_us.json b/src/main/resources/assets/cmods/lang/en_us.json index a294725..35f3150 100644 --- a/src/main/resources/assets/cmods/lang/en_us.json +++ b/src/main/resources/assets/cmods/lang/en_us.json @@ -11,5 +11,7 @@ "cmods.options.ui.title": "UI Options", "cmods.options.ui.hud_enabled": "Show HUD", "cmods.options.ui.show_coordinates": "Show Coordinates", - "cmods.options.ui.show_fps": "Show FPS" + "cmods.options.ui.show_fps": "Show FPS", + "cmods.options.ui.show_in_pause": "Show In Pause", + "cmods.options.ui.show_in_options": "Show In Options" } \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 4d933ff..7322945 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -29,7 +29,7 @@ ], "depends": { "fabricloader": ">=0.14.10", - "minecraft": "1.21.0", + "minecraft": "1.21.3", "java": ">=21", "fabric-api": "*" }