Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instance Default settings option for helper mods #1207

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core/@types/javaApi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ export interface InstanceSettings {
memory: number;
fullscreen: boolean;
updateChannel: string;
preventMetaModInjection: boolean;
javaArgs: string;
shellArgs: string;
programArgs: string;
Expand Down
9 changes: 9 additions & 0 deletions src/views/Settings/InstanceSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@
</div>

<p class="block text-white-700 text-lg font-bold mb-4">Java</p>

<ui-toggle
label="Disable helper mod injection"
desc="The FTB App will inject helper mods into your instance to help the app and your instance work together. Sometimes this can cause issues with Minecraft, Mods, Etc. You can disable this behaviour here."
v-model="localSettings.instanceDefaults.preventMetaModInjection"
class="mb-4" @input="() => {
saveMutated()
}" />

<ram-slider class="mb-6" v-model="localSettings.instanceDefaults.memory" @change="saveMutated" />

<div class="flex gap-4 items-end">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class InstanceJson {
* When enabled, the app will not inject mods from the meta.modpacks.ch system. Sometimes these can
* cause issues, so it's good to let the user have the option to turn them off
*/
public boolean preventMetaModInjection = false;
public boolean preventMetaModInjection = Settings.getSettings().instanceDefaults().preventMetaModInjection();

public byte packType;
// TODO migrate this to `isPrivate`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ private SettingsData migrate() {
getOrDefault("memory", Integer::parseInt, DEFAULT_SETTINGS.instanceDefaults().memory()),
getOrDefault("fullscreen", Boolean::parseBoolean, DEFAULT_SETTINGS.instanceDefaults().fullscreen()),
getOrDefault("updateChannel", DEFAULT_SETTINGS.instanceDefaults().updateChannel()),
getOrDefault("preventMetaModInjection", Boolean::parseBoolean, DEFAULT_SETTINGS.instanceDefaults().preventMetaModInjection()),
getOrDefault("jvmargs", DEFAULT_SETTINGS.instanceDefaults().javaArgs()),
getOrDefault("shellArgs", DEFAULT_SETTINGS.instanceDefaults().shellArgs()),
"" // There is no existing setting for this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public static SettingsData createDefault() {
computeRecommendedInstanceRam(),
false,
"release",
false,
String.join(" ", MOJANG_DEFAULT_ARGS),
"",
""
Expand Down Expand Up @@ -200,16 +201,18 @@ public static final class InstanceSettings {
private int memory;
private boolean fullscreen;
private String updateChannel;
private boolean preventMetaModInjection;
private String javaArgs;
private String shellArgs;
private String programArgs;

public InstanceSettings(int width, int height, int memory, boolean fullscreen, String updateChannel, String javaArgs, String shellArgs, String programArgs) {
public InstanceSettings(int width, int height, int memory, boolean fullscreen, String updateChannel, boolean preventMetaModInjection, String javaArgs, String shellArgs, String programArgs) {
this.width = width;
this.height = height;
this.memory = memory;
this.fullscreen = fullscreen;
this.updateChannel = updateChannel;
this.preventMetaModInjection = preventMetaModInjection;
this.javaArgs = javaArgs;
this.shellArgs = shellArgs;
this.programArgs = programArgs;
Expand All @@ -234,6 +237,10 @@ public boolean fullscreen() {
public String updateChannel() {
return updateChannel;
}

public boolean preventMetaModInjection() {
return preventMetaModInjection;
}

public String javaArgs() {
return javaArgs;
Expand Down