Skip to content

Commit

Permalink
update for settings
Browse files Browse the repository at this point in the history
  • Loading branch information
CreaxxOG committed Jun 24, 2024
1 parent 4b8695a commit 3f5a46b
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.bukkit.Material;
import org.bukkit.plugin.IllegalPluginAccessException;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
Expand All @@ -29,6 +30,10 @@ public final class BooleanSettingsBuilder {
private boolean defaultValue = true;
private String overrideValue;
private Runnable afterAction = null;
private boolean useOverrideLore = false;
private List<String> overrideEnabledLore = new ArrayList<>();
private List<String> overrideDisabledLore = new ArrayList<>();
private List<String> overrideNoPermissionLore = new ArrayList<>();

public BooleanSettingsBuilder titleOf(String title) {
this.title = title;
Expand Down Expand Up @@ -75,6 +80,26 @@ public BooleanSettingsBuilder overrideValueOf(String overrideValue) {
return this;
}

public BooleanSettingsBuilder overrideEnabledLoreOf(List<String> overrideEnabledLore) {
this.overrideEnabledLore = overrideEnabledLore;
return this;
}

public BooleanSettingsBuilder overrideDisabledLoreOf(List<String> overrideDisabledLore) {
this.overrideDisabledLore = overrideDisabledLore;
return this;
}

public BooleanSettingsBuilder overrideNoPermissionLoreOf(List<String> overrideNoPermissionLore) {
this.overrideNoPermissionLore = overrideNoPermissionLore;
return this;
}

public BooleanSettingsBuilder useOverrideLoreOf(boolean useOverrideLore) {
this.useOverrideLore = useOverrideLore;
return this;
}

public Button asButton() {
throw new IllegalPluginAccessException("You need to install the plugin.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.bukkit.Material;
import org.bukkit.plugin.IllegalPluginAccessException;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
Expand All @@ -30,6 +31,9 @@ public final class IntegerSettingsBuilder {
private int defaultValue = 0;
private String overrideValue;
private Runnable afterAction = null;
private boolean useOverrideLore = false;
private List<String> overrideLore = new ArrayList<>();
private List<String> overrideNoPermissionLore = new ArrayList<>();

public IntegerSettingsBuilder titleOf(String title) {
this.title = title;
Expand Down Expand Up @@ -81,6 +85,22 @@ public IntegerSettingsBuilder overrideValueOf(String overrideValue) {
return this;
}

public IntegerSettingsBuilder overrideLoreOf(List<String> overrideLore) {
this.overrideLore = overrideLore;
return this;
}

public IntegerSettingsBuilder overrideNoPermissionLoreOf(List<String> overrideNoPermissionLore) {
this.overrideNoPermissionLore = overrideNoPermissionLore;
return this;
}

public IntegerSettingsBuilder useOverrideLoreOf(boolean useOverrideLore) {
this.useOverrideLore = useOverrideLore;
return this;
}


public Button asButton() {
throw new IllegalPluginAccessException("You need to install the plugin.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.bukkit.Material;
import org.bukkit.plugin.IllegalPluginAccessException;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
Expand All @@ -27,6 +28,9 @@ public class MultiOptionsSettingsBuilder {
private String permission = "";
private String overrideValue;
private Runnable afterAction = null;
private boolean useOverrideLore = false;
private List<String> overrideLore = new ArrayList<>();
private List<String> overrideNoPermissionLore = new ArrayList<>();

public MultiOptionsSettingsBuilder titleOf(String title) {
this.title = title;
Expand Down Expand Up @@ -78,6 +82,21 @@ public MultiOptionsSettingsBuilder overrideValueOf(String overrideValue) {
return this;
}

public MultiOptionsSettingsBuilder overrideLoreOf(List<String> overrideLore) {
this.overrideLore = overrideLore;
return this;
}

public MultiOptionsSettingsBuilder overrideNoPermissionLoreOf(List<String> overrideNoPermissionLore) {
this.overrideNoPermissionLore = overrideNoPermissionLore;
return this;
}

public MultiOptionsSettingsBuilder useOverrideLoreOf(boolean useOverrideLore) {
this.useOverrideLore = useOverrideLore;
return this;
}

public Button asButton() {
throw new IllegalPluginAccessException("You need to install the plugin.");
}
Expand Down

0 comments on commit 3f5a46b

Please sign in to comment.