Skip to content

Commit

Permalink
Added option to enable/disable internal papi expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed May 28, 2024
1 parent 40eb9b0 commit bbb2df5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions VotingPlugin/Resources/Config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ UseJavascriptPlaceholders: false
# 'false': 'User does not have enough points'
CustomPlaceholderReturns: {}

# Load votingplugin internal expansion
LoadInteralExpansion: true

###########################################
# Login options
###########################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1059,8 +1059,10 @@ public void onPostLoad() {
}

if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
new VotingPluginExpansion(this).register();
getLogger().info("Loading PlaceholderAPI expansion");
if (getConfigFile().isLoadInteralExpansion()) {
new VotingPluginExpansion(this).register();
getLogger().info("Loading PlaceholderAPI expansion");
}
}

registerCommands();
Expand Down Expand Up @@ -1178,8 +1180,7 @@ public String onRewardRequested(Reward arg0, com.bencodez.advancedcore.api.user.
ConfigurationSection section, HashMap<String, String> placeholders) {
if (section.getBoolean("Enabled")) {
user.sendBossBar(
PlaceholderUtils.replacePlaceHolder(section.getString("Message", ""),
placeholders),
PlaceholderUtils.replacePlaceHolder(section.getString("Message", ""), placeholders),
section.getString("Color", "BLUE"), section.getString("Style", "SOLID"),
(double) getVotingPluginUserManager().getVotingPluginUser(user).getSitesVotedOn()
/ plugin.getVoteSites().size(),
Expand Down
4 changes: 4 additions & 0 deletions VotingPlugin/src/com/bencodez/votingplugin/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public class Config extends YMLFile {
@ConfigDataBoolean(path = "AddTotalsOffline")
@Getter
private boolean addTotalsOffline = true;

@ConfigDataBoolean(path = "LoadInteralExpansion")
@Getter
private boolean loadInteralExpansion = true;

@ConfigDataBoolean(path = "PerSiteCoolDownEvents")
@Getter
Expand Down

0 comments on commit bbb2df5

Please sign in to comment.