Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f152ecb74 |
No files matched your search
@@ -71,6 +71,10 @@
|
||||
<id>spigotmc-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>placeholderapi</id>
|
||||
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype</id>
|
||||
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||
@@ -120,6 +124,12 @@
|
||||
<version>23.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.11.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.CraptiCraft-Development</groupId>
|
||||
<artifactId>ClansLite-API</artifactId>
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.tcoded.folialib.FoliaLib;
|
||||
import com.tcoded.playerbountiesplus.command.BountyCommand;
|
||||
import com.tcoded.playerbountiesplus.command.PlayerBountiesPlusAdminCmd;
|
||||
import com.tcoded.playerbountiesplus.hook.PAPIExpansion;
|
||||
import com.tcoded.playerbountiesplus.hook.currency.AbstractEconomyHook;
|
||||
import com.tcoded.playerbountiesplus.hook.currency.DummyEcoHook;
|
||||
import com.tcoded.playerbountiesplus.hook.currency.VaultHook;
|
||||
@@ -14,6 +15,7 @@ import com.tcoded.playerbountiesplus.util.LangUtil;
|
||||
import com.tcoded.updatechecker.SimpleUpdateChecker;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
@@ -46,6 +48,8 @@ public final class PlayerBountiesPlus extends JavaPlugin {
|
||||
private AbstractEconomyHook ecoHook;
|
||||
private AbstractTeamHook teamHook;
|
||||
|
||||
private PAPIExpansion papiExpansion;
|
||||
|
||||
public PlayerBountiesPlus() {
|
||||
instance = this;
|
||||
}
|
||||
@@ -110,6 +114,11 @@ public final class PlayerBountiesPlus extends JavaPlugin {
|
||||
findPluginWithQuery(plugins, metrics, "parties");
|
||||
findPluginWithQuery(plugins, metrics, "guild");
|
||||
findPluginWithQuery(plugins, metrics, "guilds");
|
||||
|
||||
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
|
||||
papiExpansion = new PAPIExpansion(this);
|
||||
papiExpansion.register();
|
||||
}
|
||||
}
|
||||
|
||||
public void reloadLang() {
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tcoded.playerbountiesplus.hook;
|
||||
|
||||
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.UUID;
|
||||
|
||||
public class PAPIExpansion extends PlaceholderExpansion {
|
||||
|
||||
private static final String IDENTIFIER = "playerbountiesplus";
|
||||
|
||||
private final PlayerBountiesPlus plugin;
|
||||
|
||||
public PAPIExpansion(PlayerBountiesPlus plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public @NotNull String getIdentifier() {
|
||||
return IDENTIFIER;
|
||||
}
|
||||
|
||||
public @NotNull String getAuthor() {
|
||||
return plugin.getDescription().getAuthors().toString();
|
||||
}
|
||||
|
||||
public @NotNull String getVersion() {
|
||||
return plugin.getDescription().getVersion();
|
||||
}
|
||||
|
||||
public @Nullable String onRequest(OfflinePlayer player, @NotNull String params) {
|
||||
if (params.equals("bounty")) {
|
||||
UUID uuid = player.getUniqueId();
|
||||
return String.valueOf(plugin.getBountyDataManager().getBounties().getOrDefault(uuid, 0));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ softdepend:
|
||||
- BetterTeams
|
||||
- SimpleClans
|
||||
- Towny
|
||||
- PlaceholderAPI
|
||||
|
||||
commands:
|
||||
bounty:
|
||||
|
||||
Reference in new issue
Block a user