Skip to content

Commit

Permalink
Removed PlaceholderAPI dependency (#96)
Browse files Browse the repository at this point in the history
* Made plugin softdepend to PlaceholderAPI and MiniPlaceholders

* Added separate checks for PlaceholderAPI and Miniplaceholders plugins
  • Loading branch information
Fulminazzo authored Mar 9, 2024
1 parent fb98f15 commit 8cb32dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.Nullable;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -148,11 +150,14 @@ public void onEnable() {
e.printStackTrace();
}

if (this.getServer().getPluginManager().getPlugin("PlaceholderAPI") != null) {
@Nullable Plugin plugin = this.getServer().getPluginManager().getPlugin("PlaceholderAPI");
if (plugin != null && plugin.isEnabled()) {
new SimplyRankPlaceholderExpansion().register();
new ScoreboardTeamsPlaceholderExtension().register();
new MiniPlaceholderRegister(this).register();
}
plugin = this.getServer().getPluginManager().getPlugin("MiniPlaceholders");
if (plugin != null && plugin.isEnabled())
new MiniPlaceholderRegister(this).register();
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ author: Simply Vanilla
website: https://github.com/SimplyVanilla/SimplyRank
folia-supported: true

depend: [PlaceholderAPI, MiniPlaceholders]
softdepend: [PlaceholderAPI, MiniPlaceholders]

commands:
simplyrank:
Expand Down

0 comments on commit 8cb32dd

Please sign in to comment.