Compare commits

...
Author SHA1 Message Date
TechnicallyCoded 6286d15a32 Update README.md 2025-08-08 22:46:18 +02:00
TechnicallyCoded 3221637a21 Add comprehensive README 2025-08-08 22:37:29 +02:00
TechnicallyCoded 4b739a0561 Add start of GUI framework (#20) 2025-08-08 18:45:35 +02:00
TechnicallyCoded 908f04ce30 Add %playerbountiesplus_hasbounty% placeholder (#19)
Part of #9
2025-08-08 18:00:52 +02:00
TechnicallyCoded 13b6ac5724 Add permissions for setting and claiming bounties (#18)
Fixes #4
2025-08-08 17:57:09 +02:00
TechnicallyCoded 118c78959b 1.4.17 release 2025-06-18 01:20:28 +02:00
TechnicallyCoded 5d9d070a72 Fix tab completions 2025-06-18 01:02:05 +02:00
TechnicallyCoded f57883745c Update lang files 2025-06-18 00:43:14 +02:00
TechnicallyCoded 2471003e38 Fix get lang missing 2025-06-18 00:19:53 +02:00
TechnicallyCoded a798586951 1.4.16 - Release 2025-06-17 23:46:08 +02:00
TechnicallyCoded 62891307cd Fix tab-completions 2025-06-17 23:45:53 +02:00
TechnicallyCoded 1beb8de05d Add "get" admin subcommand 2025-06-12 18:30:17 +02:00
TechnicallyCoded 8f4b0294f8 Fix permissions (part 2) 2025-06-12 18:30:00 +02:00
TechnicallyCoded e263a872b0 1.4.15 - Fix permissions 2025-06-12 18:19:04 +02:00
TechnicallyCoded 3f18f57bbf Fix friendly player team checks 2025-06-05 19:14:13 +02:00
TechnicallyCoded f947450fbe Merge pull request #16 from TechnicallyCoded/codex/add-admin-commands-for-bounties
Add admin bounty editing commands
2025-06-05 14:09:56 +02:00
TechnicallyCoded b9255ab4e9 Update sub-command name 2025-06-05 13:53:42 +02:00
TechnicallyCoded 1d8c25368a v1.4.14 - Add admin commands 2025-06-05 13:44:31 +02:00
TechnicallyCoded b07acb7f68 Merge branch 'main' into codex/add-admin-commands-for-bounties 2025-06-05 13:44:14 +02:00
TechnicallyCoded 563953088c Fix permissions indentation 2025-06-05 13:20:41 +02:00
TechnicallyCoded cf2c447c40 v1.4.13 - Add bounty events 2025-05-30 17:44:42 +02:00
TechnicallyCoded cd3e2bc2f9 v1.4.12 - Fix bounties claim check 2025-05-30 17:34:30 +02:00
TechnicallyCoded db23661546 v1.4.11 - Fix versioning 2025-03-05 22:40:32 +01:00
TechnicallyCoded 8bf198090a v1.4.11 - Update Saber-Factions 2025-01-24 23:19:13 +01:00
TechnicallyCoded 8382c46b5f v1.4.10 - Fix compilation errors 2025-01-24 22:57:25 +01:00
TechnicallyCoded a8ef396f14 Merge pull request #14 from TechnicallyCoded/dev
v1.4.9 - Merge Dev
2025-01-24 22:46:14 +01:00
TechnicallyCoded 4241b07ee1 Set saberfactions as provided 2025-01-19 18:33:07 +01:00
TechnicallyCoded 44325dc2dd Merge branch 'dev' into new-dev 2024-12-04 14:23:29 +01:00
TechnicallyCoded d398ca2d04 v1.4.9 - Add placeholder support (PAPI) 2024-12-04 14:19:53 +01:00
51 changed files with 1449 additions and 178 deletions

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
# PlayerBountiesPlus
## Overview
PlayerBountiesPlus lets players set and claim bounties while blocking teammates from claiming rewards. Hooks into Vault for economy handling and supports many team plugins.
## Features
- Clan-aware bounty system that prevents teammates from claiming each other's bounties
- Integrates with Vault and supports ClansLite, Parties, BetterTeams, SimpleClans and Towny for team detection
- Inventory GUI for viewing bounties
- PlaceholderAPI support for custom placeholders
- Localized messages in multiple languages
## Commands
- `/bounty set <player> <amount>` – set a bounty on a player
- `/bounty top` – list the top bounties
- `/bounty check <player>` – check a player's bounty
- `/pbp reload` – reload configuration and messages
- `/pbp version` – display plugin version
- `/pbp bounty set <player> <amount>` – admin set a bounty
- `/pbp bounty add <player> <amount>` – add to a bounty
- `/pbp bounty remove <player> <amount>` – remove from a bounty
- `/pbp bounty delete <player>` – delete a bounty
- `/pbp bounty get <player>` – view a bounty
## Permissions
| Permission | Default |
| --- | --- |
| `playerbountiesplus.command.bounty` | all |
| `playerbountiesplus.command.bounty.set` | all |
| `playerbountiesplus.event.claim` | all |
| `playerbountiesplus.command.admin` | op |
| `playerbountiesplus.command.admin.version` | op |
| `playerbountiesplus.command.admin.reload` | op |
| `playerbountiesplus.command.admin.bounty.set` | op |
| `playerbountiesplus.command.admin.bounty.add` | op |
| `playerbountiesplus.command.admin.bounty.remove` | op |
| `playerbountiesplus.command.admin.bounty.delete` | op |
| `playerbountiesplus.command.admin.bounty.get` | op |
## Developer Notes
- Commands reside in `com.tcoded.playerbountiesplus.command` with subpackages for bounty and admin actions
- Event listeners like `DeathListener` handle bounty claim logic
- Hooks under `com.tcoded.playerbountiesplus.hook` integrate with Vault, PlaceholderAPI and team plugins
- Inventory GUIs in `com.tcoded.playerbountiesplus.gui` present bounty data
- `BountyDataManager` manages persistence of bounties
+17 -18
View File
@@ -6,7 +6,7 @@
<groupId>com.tcoded</groupId>
<artifactId>PlayerBountiesPlus</artifactId>
<version>1.4.8</version>
<version>1.4.17</version>
<packaging>jar</packaging>
<name>PlayerBountiesPlus</name>
@@ -79,18 +79,6 @@
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>devmart-other</id>
<url>https://nexuslite.gcnt.net/repos/other/</url>
</repository>
<repository>
<id>devmart-public</id>
<url>https://nexuslite.gcnt.net/repos/public/</url>
</repository>
<repository>
<id>devmart-tcoded</id>
<url>https://nexuslite.gcnt.net/repos/tcoded/</url>
</repository>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public</url>
@@ -99,6 +87,10 @@
<id>glaremasters repo</id>
<url>https://repo.glaremasters.me/repository/towny/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/releases/</url>
</repository>
</repositories>
<dependencies>
@@ -127,9 +119,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.tcoded</groupId>
<groupId>com.github.TechnicallyCoded</groupId>
<artifactId>FoliaLib</artifactId>
<version>0.2.6</version>
<version>0.4.3</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -146,9 +138,9 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.tcoded.lightlibs</groupId>
<groupId>com.github.LightLibs</groupId>
<artifactId>SpigotUpdateChecker</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -172,7 +164,8 @@
<dependency>
<groupId>com.github.SaberLLC</groupId>
<artifactId>Saber-Factions</artifactId>
<version>4.1.2-STABLE</version>
<version>4.1.4-STABLE</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.palmergames.bukkit.towny</groupId>
@@ -180,5 +173,11 @@
<version>0.100.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
@@ -2,16 +2,19 @@ package com.tcoded.playerbountiesplus;
import com.google.common.collect.ImmutableList;
import com.tcoded.folialib.FoliaLib;
import com.tcoded.lightlibs.updatechecker.SimpleUpdateChecker;
import com.tcoded.playerbountiesplus.command.BountyCommand;
import com.tcoded.playerbountiesplus.command.PlayerBountiesPlusAdminCmd;
import com.tcoded.playerbountiesplus.hook.currency.AbstractEconomyHook;
import com.tcoded.playerbountiesplus.hook.currency.EconomyHook;
import com.tcoded.playerbountiesplus.hook.currency.DummyEcoHook;
import com.tcoded.playerbountiesplus.hook.currency.VaultHook;
import com.tcoded.playerbountiesplus.hook.placeholder.PlaceholderHook;
import com.tcoded.playerbountiesplus.hook.team.AbstractTeamHook;
import com.tcoded.playerbountiesplus.hook.team.TeamHook;
import com.tcoded.playerbountiesplus.listener.DeathListener;
import com.tcoded.playerbountiesplus.listener.GuiListener;
import com.tcoded.playerbountiesplus.manager.BountyDataManager;
import com.tcoded.playerbountiesplus.util.LangUtil;
import com.tcoded.updatechecker.SimpleUpdateChecker;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.SimplePie;
import org.bukkit.ChatColor;
@@ -43,8 +46,9 @@ public final class PlayerBountiesPlus extends JavaPlugin {
private BountyDataManager bountyDataManager;
// Hooks
private AbstractEconomyHook ecoHook;
private AbstractTeamHook teamHook;
private EconomyHook ecoHook;
private TeamHook teamHook;
private PlaceholderHook placeholderHook;
public PlayerBountiesPlus() {
instance = this;
@@ -69,11 +73,15 @@ public final class PlayerBountiesPlus extends JavaPlugin {
if (!applyEcoHookRegistration()) return;
// Team Hooks
this.teamHook = AbstractTeamHook.findTeamHook(this);
this.teamHook = TeamHook.findTeamHook(this);
if (this.teamHook == null) {
getLogger().warning("There is no supported team/clan/party plugin on the server! Feel free to request support for the plugin you use on GitHub or Discord!");
}
// Placeholder Hooks
this.placeholderHook = PlaceholderHook.findPlaceholderHook(this);
this.placeholderHook.enable();
// Commands
PluginCommand bountyCmd = this.getCommand("bounty");
if (bountyCmd != null) {
@@ -88,8 +96,9 @@ public final class PlayerBountiesPlus extends JavaPlugin {
adminCmd.setTabCompleter(adminExec);
}
// Listener
// Listeners
this.getServer().getPluginManager().registerEvents(new DeathListener(this), this);
this.getServer().getPluginManager().registerEvents(new GuiListener(), this);
// Update checker
checkUpdate();
@@ -121,23 +130,28 @@ public final class PlayerBountiesPlus extends JavaPlugin {
this,
ChatColor.translateAlternateColorCodes('&', "&f[&bPlayerBountiesPlus&f] "),
108637,
runnable -> this.getFoliaLib().getImpl().runAsync(runnable)
runnable -> this.getFoliaLib().getScheduler().runAsync(wt -> runnable.run())
);
}
@Override
public void onDisable() {
HandlerList.unregisterAll(this);
this.placeholderHook.disable();
}
public AbstractEconomyHook getEcoHook() {
public EconomyHook getEcoHook() {
return this.ecoHook;
}
public AbstractTeamHook getTeamHook() {
public TeamHook getTeamHook() {
return teamHook;
}
public PlaceholderHook getPlaceholderHook() {
return placeholderHook;
}
public BountyDataManager getBountyDataManager() {
return bountyDataManager;
}
@@ -186,14 +200,14 @@ public final class PlayerBountiesPlus extends JavaPlugin {
boolean ecoPresent = vaultEcoHook.init();
// Register or fallback
if (ecoPresent) servicesManager.register(AbstractEconomyHook.class, vaultEcoHook, this, ServicePriority.Low);
else servicesManager.register(AbstractEconomyHook.class, new DummyEcoHook(), this, ServicePriority.Lowest);
if (ecoPresent) servicesManager.register(EconomyHook.class, vaultEcoHook, this, ServicePriority.Low);
else servicesManager.register(EconomyHook.class, new DummyEcoHook(), this, ServicePriority.Lowest);
}
public boolean applyEcoHookRegistration() {
// Get economy hook
ServicesManager servicesManager = getServer().getServicesManager();
RegisteredServiceProvider<AbstractEconomyHook> ecoHookProvider = servicesManager.getRegistration(AbstractEconomyHook.class);
RegisteredServiceProvider<EconomyHook> ecoHookProvider = servicesManager.getRegistration(EconomyHook.class);
if (ecoHookProvider == null) {
getLogger().severe("No economy hook is present! Aborting startup!");
return false;
@@ -1,5 +1,6 @@
package com.tcoded.playerbountiesplus.command;
import com.google.common.collect.Lists;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import com.tcoded.playerbountiesplus.command.bounty.BountyCheckCmd;
import com.tcoded.playerbountiesplus.command.bounty.BountySetCmd;
@@ -8,12 +9,12 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
public class BountyCommand implements CommandExecutor, TabCompleter {
@@ -51,35 +52,27 @@ public class BountyCommand implements CommandExecutor, TabCompleter {
@Nullable
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
@Nullable List<String> options = new ArrayList<>();
if (args.length < 2) {
String arg0 = args[0].toLowerCase();
String[] actions = {"set", "top", "check"};
for (String action : actions) {
if (action.startsWith(arg0)) {
options.add(action);
}
if (args.length == 1) {
return Lists.newArrayList("set", "top", "check").stream()
.filter(action -> action.startsWith(args[0].toLowerCase()))
.collect(Collectors.toList());
} else if (args.length > 1) {
String subCommand = args[0].toLowerCase();
switch (subCommand) {
case "set":
return BountySetCmd.onTabComplete(sender, args).stream()
.filter(suggestion -> suggestion.toLowerCase().startsWith(args[1].toLowerCase()))
.collect(Collectors.toList());
case "check":
return BountyCheckCmd.onTabComplete(sender, args).stream()
.filter(suggestion -> suggestion.toLowerCase().startsWith(args[1].toLowerCase()))
.collect(Collectors.toList());
case "top":
return Collections.emptyList(); // No additional arguments for top
default:
return Collections.emptyList();
}
}
else if (args.length == 2) {
String arg0 = args[0].toLowerCase();
String arg1 = args[1].toLowerCase();
if (arg0.equals("set") || arg0.equals("check")) {
this.plugin.getServer().getOnlinePlayers().stream()
.map(Player::getName)
.filter(name -> name.toLowerCase().startsWith(arg1))
.forEach(options::add);
}
}
else if (args.length == 3) {
String arg0 = args[0].toLowerCase();
String arg2 = args[2].toLowerCase();
if (arg0.equals("set")) {
if (arg2.equals("")) options.add("<amount>");
}
}
return options;
return Collections.emptyList();
}
}
@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import com.tcoded.playerbountiesplus.command.admin.PlayerBountiesPlusReloadCmd;
import com.tcoded.playerbountiesplus.command.admin.PlayerBountiesPlusVersionCmd;
import com.tcoded.playerbountiesplus.command.admin.bounty.AdminBountyCmd;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@@ -13,11 +14,12 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
public class PlayerBountiesPlusAdminCmd implements CommandExecutor, TabCompleter {
private static final ArrayList<String> completions = Lists.newArrayList("reload", "version", "help");
private static final ArrayList<String> completions = Lists.newArrayList("reload", "version", "bounty", "help");
private final PlayerBountiesPlus plugin;
@@ -40,6 +42,8 @@ public class PlayerBountiesPlusAdminCmd implements CommandExecutor, TabCompleter
return PlayerBountiesPlusReloadCmd.handleCmd(plugin, sender, command, label, args);
case "version":
return PlayerBountiesPlusVersionCmd.handleCmd(plugin, sender, command, label, args);
case "bounty":
return AdminBountyCmd.handleCmd(plugin, sender, command, label, args);
default:
sendHelpMsg(sender);
return true;
@@ -52,6 +56,10 @@ public class PlayerBountiesPlusAdminCmd implements CommandExecutor, TabCompleter
"&fAdmin Commands:\n" +
"&f/pbp reload &7- Reload the configuration file and the messages.\n" +
"&f/pbp version &7- Check the version of the plugin.\n" +
"&f/pbp bounty set <player> <amount> &7- Set a player's bounty.\n" +
"&f/pbp bounty add <player> <amount> &7- Add to a player's bounty.\n" +
"&f/pbp bounty remove <player> <amount> &7- Remove from a player's bounty.\n" +
"&f/pbp bounty delete <player> &7- Delete a player's bounty.\n" +
"&f/pbp help &7- Get this message."
));
}
@@ -59,8 +67,24 @@ public class PlayerBountiesPlusAdminCmd implements CommandExecutor, TabCompleter
@Nullable
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
return completions.stream()
.filter(s -> s.startsWith(args[0].toLowerCase()))
.collect(Collectors.toList());
if (args.length == 1) {
return completions.stream()
.filter(s -> s.toLowerCase().startsWith(args[0].toLowerCase()))
.collect(Collectors.toList());
} else if (args.length > 1) {
String subCommand = args[0].toLowerCase();
switch (subCommand) {
case "bounty":
return AdminBountyCmd.onTabComplete(sender, args);
case "version":
return PlayerBountiesPlusVersionCmd.onTabComplete(sender, args);
case "reload":
case "help":
return Collections.emptyList(); // No additional arguments for reload or help
default:
return Collections.emptyList();
}
}
return Collections.emptyList();
}
}
@@ -3,8 +3,14 @@ package com.tcoded.playerbountiesplus.command.admin;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class PlayerBountiesPlusReloadCmd {
import java.util.Collections;
import java.util.List;
public class PlayerBountiesPlusReloadCmd implements TabCompleter {
private static final String RELOAD_PERMISSION = "playerbountiesplus.command.playerbountiesplus.reload";
@@ -28,4 +34,10 @@ public class PlayerBountiesPlusReloadCmd {
return true;
}
@Nullable
@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
// No additional arguments for reload command
return Collections.emptyList();
}
}
@@ -6,6 +6,9 @@ import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import java.util.Collections;
import java.util.List;
public class PlayerBountiesPlusVersionCmd {
private static final String VERSION_PERMISSION = "playerbountiesplus.command.playerbountiesplus.version";
@@ -31,4 +34,8 @@ public class PlayerBountiesPlusVersionCmd {
return true;
}
public static List<String> onTabComplete(CommandSender sender, String[] args) {
// No sub-commands for version, return empty list
return Collections.emptyList();
}
}
@@ -0,0 +1,77 @@
package com.tcoded.playerbountiesplus.command.admin.bounty;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import com.tcoded.playerbountiesplus.manager.BountyDataManager;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
public class AdminBountyAddCmd {
private static final String PERMISSION = "playerbountiesplus.command.admin.bounty.add";
public static boolean handleCmd(PlayerBountiesPlus plugin, CommandSender sender, Command cmd, String label, String[] args) {
if (!sender.hasPermission(PERMISSION)) {
String noPerm = plugin.getLang().getColored("command.no-permission");
String noPermDetailed = plugin.getLang().getColored("command.no-permission-detailed")
.replace("{no-permission-msg}", noPerm)
.replace("{permission}", PERMISSION);
sender.sendMessage(noPermDetailed);
return true;
}
if (args.length < 4) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.add.missing-args"));
return true;
}
String playerName = args[2];
int amount;
try {
amount = Integer.parseInt(args[3]);
} catch (NumberFormatException ex) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.add.amount-nan"));
return true;
}
OfflinePlayer target = plugin.getServer().getOfflinePlayer(playerName);
if (target == null || (!target.hasPlayedBefore() && !target.isOnline())) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.add.player-not-found"));
return true;
}
UUID uuid = target.getUniqueId();
BountyDataManager m = plugin.getBountyDataManager();
int current = m.getBounty(uuid);
int total = current + amount;
m.setBounty(uuid, total);
m.saveBountiesAsync();
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.add.success")
.replace("{target}", target.getName())
.replace("{amount}", String.valueOf(amount))
.replace("{total}", String.valueOf(total)));
return true;
}
@Nullable
public static List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (args.length == 3) {
// Suggest all online player names for the username
return sender.getServer().getOnlinePlayers().stream()
.map(player -> player.getName())
.collect(Collectors.toList());
} else if (args.length == 4) {
// Suggest a placeholder for the amount
return Collections.singletonList("<amount>");
}
return Collections.emptyList();
}
}
@@ -0,0 +1,69 @@
package com.tcoded.playerbountiesplus.command.admin.bounty;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
public class AdminBountyCmd {
public static boolean handleCmd(PlayerBountiesPlus plugin, CommandSender sender, Command cmd, String label, String[] args) {
if (args.length < 2) {
sender.sendMessage(plugin.getLang().getColored("command.bounty.no-action"));
return true;
}
String action = args[1].toLowerCase();
switch (action) {
case "set":
return AdminBountySetCmd.handleCmd(plugin, sender, cmd, label, args);
case "add":
return AdminBountyAddCmd.handleCmd(plugin, sender, cmd, label, args);
case "remove":
return AdminBountyRemoveCmd.handleCmd(plugin, sender, cmd, label, args);
case "delete":
return AdminBountyDeleteCmd.handleCmd(plugin, sender, cmd, label, args);
case "get":
return AdminBountyGetCmd.handleCmd(plugin, sender, cmd, label, args);
default:
sender.sendMessage(plugin.getLang().getColored("command.bounty.invalid-action"));
return true;
}
}
public static List<String> onTabComplete(CommandSender sender, String[] args) {
List<String> suggestions = Collections.emptyList();
if (args.length == 2) {
suggestions = Arrays.asList("set", "add", "remove", "delete", "get");
} else if (args.length > 2) {
String sub = args[1].toLowerCase();
switch (sub) {
case "add":
suggestions = AdminBountyAddCmd.onTabComplete(sender, null, null, args);
break;
case "remove":
suggestions = AdminBountyRemoveCmd.onTabComplete(sender, null, null, args);
break;
case "delete":
suggestions = AdminBountyDeleteCmd.onTabComplete(sender, null, null, args);
break;
case "get":
suggestions = AdminBountyGetCmd.onTabComplete(sender, null, null, args);
break;
case "set":
suggestions = AdminBountySetCmd.onTabComplete(sender, null, null, args);
break;
}
}
String input = args[args.length - 1].toLowerCase();
return suggestions.stream()
.filter(opt -> opt.toLowerCase().startsWith(input))
.collect(Collectors.toList());
}
}
@@ -0,0 +1,63 @@
package com.tcoded.playerbountiesplus.command.admin.bounty;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import com.tcoded.playerbountiesplus.manager.BountyDataManager;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
public class AdminBountyDeleteCmd {
private static final String PERMISSION = "playerbountiesplus.command.admin.bounty.delete";
public static boolean handleCmd(PlayerBountiesPlus plugin, CommandSender sender, Command cmd, String label, String[] args) {
if (!sender.hasPermission(PERMISSION)) {
String noPerm = plugin.getLang().getColored("command.no-permission");
String noPermDetailed = plugin.getLang().getColored("command.no-permission-detailed")
.replace("{no-permission-msg}", noPerm)
.replace("{permission}", PERMISSION);
sender.sendMessage(noPermDetailed);
return true;
}
if (args.length < 3) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.delete.missing-args"));
return true;
}
String playerName = args[2];
OfflinePlayer target = plugin.getServer().getOfflinePlayer(playerName);
if (target == null || (!target.hasPlayedBefore() && !target.isOnline())) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.delete.player-not-found"));
return true;
}
UUID uuid = target.getUniqueId();
BountyDataManager m = plugin.getBountyDataManager();
m.removeBounty(uuid);
m.saveBountiesAsync();
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.delete.success")
.replace("{target}", target.getName()));
return true;
}
@Nullable
public static List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (args.length == 3) {
// Suggest all online player names for the username
return sender.getServer().getOnlinePlayers().stream()
.map(Player::getName)
.collect(Collectors.toList());
}
return Collections.emptyList();
}
}
@@ -0,0 +1,63 @@
package com.tcoded.playerbountiesplus.command.admin.bounty;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import com.tcoded.playerbountiesplus.manager.BountyDataManager;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
public class AdminBountyGetCmd {
private static final String PERMISSION = "playerbountiesplus.command.admin.bounty.get";
public static boolean handleCmd(PlayerBountiesPlus plugin, CommandSender sender, Command cmd, String label, String[] args) {
if (!sender.hasPermission(PERMISSION)) {
String noPerm = plugin.getLang().getColored("command.no-permission");
String noPermDetailed = plugin.getLang().getColored("command.no-permission-detailed")
.replace("{no-permission-msg}", noPerm)
.replace("{permission}", PERMISSION);
sender.sendMessage(noPermDetailed);
return true;
}
if (args.length < 3) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.get.missing-args"));
return true;
}
String playerName = args[2];
OfflinePlayer target = plugin.getServer().getOfflinePlayer(playerName);
if (target == null || (!target.hasPlayedBefore() && !target.isOnline())) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.get.player-not-found"));
return true;
}
UUID uuid = target.getUniqueId();
BountyDataManager m = plugin.getBountyDataManager();
int current = m.getBounty(uuid);
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.get.success")
.replace("{target}", target.getName())
.replace("{bounty}", String.valueOf(current)));
return true;
}
@Nullable
public static List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (args.length == 3) {
// Suggest all online player names for the username
return sender.getServer().getOnlinePlayers().stream()
.map(player -> player.getName())
.collect(Collectors.toList());
}
return Collections.emptyList();
}
}
@@ -0,0 +1,82 @@
package com.tcoded.playerbountiesplus.command.admin.bounty;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import com.tcoded.playerbountiesplus.manager.BountyDataManager;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
public class AdminBountyRemoveCmd {
private static final String PERMISSION = "playerbountiesplus.command.admin.bounty.remove";
public static boolean handleCmd(PlayerBountiesPlus plugin, CommandSender sender, Command cmd, String label, String[] args) {
if (!sender.hasPermission(PERMISSION)) {
String noPerm = plugin.getLang().getColored("command.no-permission");
String noPermDetailed = plugin.getLang().getColored("command.no-permission-detailed")
.replace("{no-permission-msg}", noPerm)
.replace("{permission}", PERMISSION);
sender.sendMessage(noPermDetailed);
return true;
}
if (args.length < 4) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.remove.missing-args"));
return true;
}
String playerName = args[2];
int amount;
try {
amount = Integer.parseInt(args[3]);
} catch (NumberFormatException ex) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.remove.amount-nan"));
return true;
}
OfflinePlayer target = plugin.getServer().getOfflinePlayer(playerName);
if (target == null || (!target.hasPlayedBefore() && !target.isOnline())) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.remove.player-not-found"));
return true;
}
UUID uuid = target.getUniqueId();
BountyDataManager m = plugin.getBountyDataManager();
int current = m.getBounty(uuid);
int total = current - amount;
if (total <= 0) {
m.removeBounty(uuid);
total = 0;
} else {
m.setBounty(uuid, total);
}
m.saveBountiesAsync();
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.remove.success")
.replace("{target}", target.getName())
.replace("{amount}", String.valueOf(amount))
.replace("{total}", String.valueOf(total)));
return true;
}
@Nullable
public static List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (args.length == 3) {
// Suggest all online player names for the username
return sender.getServer().getOnlinePlayers().stream()
.map(player -> player.getName())
.collect(Collectors.toList());
} else if (args.length == 4) {
// Suggest a placeholder for the amount
return Collections.singletonList("<amount>");
}
return Collections.emptyList();
}
}
@@ -0,0 +1,74 @@
package com.tcoded.playerbountiesplus.command.admin.bounty;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import com.tcoded.playerbountiesplus.manager.BountyDataManager;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
public class AdminBountySetCmd {
private static final String PERMISSION = "playerbountiesplus.command.admin.bounty.set";
public static boolean handleCmd(PlayerBountiesPlus plugin, CommandSender sender, Command cmd, String label, String[] args) {
if (!sender.hasPermission(PERMISSION)) {
String noPerm = plugin.getLang().getColored("command.no-permission");
String noPermDetailed = plugin.getLang().getColored("command.no-permission-detailed")
.replace("{no-permission-msg}", noPerm)
.replace("{permission}", PERMISSION);
sender.sendMessage(noPermDetailed);
return true;
}
if (args.length < 4) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.set.missing-args"));
return true;
}
String playerName = args[2];
int amount;
try {
amount = Integer.parseInt(args[3]);
} catch (NumberFormatException ex) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.set.amount-nan"));
return true;
}
OfflinePlayer target = plugin.getServer().getOfflinePlayer(playerName);
if (target == null || (!target.hasPlayedBefore() && !target.isOnline())) {
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.set.player-not-found"));
return true;
}
UUID uuid = target.getUniqueId();
BountyDataManager m = plugin.getBountyDataManager();
m.setBounty(uuid, amount);
m.saveBountiesAsync();
sender.sendMessage(plugin.getLang().getColored("command.admin.bounty.set.success")
.replace("{target}", target.getName())
.replace("{bounty}", String.valueOf(amount)));
return true;
}
@Nullable
public static List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (args.length == 3) {
// Suggest all online player names for the username
return sender.getServer().getOnlinePlayers().stream()
.map(player -> player.getName())
.collect(Collectors.toList());
} else if (args.length == 4) {
// Suggest a placeholder for the amount
return Collections.singletonList("<amount>");
}
return Collections.emptyList();
}
}
@@ -1,11 +1,18 @@
package com.tcoded.playerbountiesplus.command.bounty;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import com.tcoded.playerbountiesplus.manager.BountyDataManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
public class BountyCheckCmd {
@@ -26,14 +33,16 @@ public class BountyCheckCmd {
UUID playerUUID = target.getUniqueId();
Integer amount = plugin.getBountyDataManager().getBounties().get(playerUUID);
BountyDataManager bountyDataManager = plugin.getBountyDataManager();
boolean hasBounty = bountyDataManager.hasBounty(playerUUID);
if (amount != null && amount > 0) {
if (hasBounty) {
// Confirmation
int bounty = bountyDataManager.getBounty(playerUUID);
sender.sendMessage(
plugin.getLang().getColored("command.bounty.check.bounty-found")
.replace("{target}", target.getName())
.replace("{bounty}", amount.toString())
.replace("{bounty}", Integer.toString(bounty))
);
} else {
sender.sendMessage(
@@ -44,4 +53,16 @@ public class BountyCheckCmd {
return true;
}
@Nullable
public static List<String> onTabComplete(@NotNull CommandSender sender, @NotNull String[] args) {
if (args.length == 2) {
// Suggest online player names for the username
return sender.getServer().getOnlinePlayers().stream()
.map(Player::getName)
.filter(name -> name.toLowerCase().startsWith(args[1].toLowerCase()))
.collect(Collectors.toList());
}
return Collections.emptyList();
}
}
@@ -1,12 +1,18 @@
package com.tcoded.playerbountiesplus.command.bounty;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import com.tcoded.playerbountiesplus.event.BountySetEvent;
import com.tcoded.playerbountiesplus.manager.BountyDataManager;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
public class BountySetCmd {
@@ -16,8 +22,17 @@ public class BountySetCmd {
return true;
}
if (sender instanceof Player && !sender.hasPermission("playerbountiesplus.command.bounty.set")) {
String noPerm = plugin.getLang().getColored("command.no-permission");
String noPermDetailed = plugin.getLang().getColored("command.no-permission-detailed")
.replace("{no-permission-msg}", noPerm)
.replace("{permission}", "playerbountiesplus.command.bounty.set");
sender.sendMessage(noPermDetailed);
return true;
}
String playerNameArg = args[1];
int amount;
float amount;
try {
amount = Integer.parseInt(args[2]);
} catch (NumberFormatException ex) {
@@ -61,7 +76,18 @@ public class BountySetCmd {
}
// Apply bounty multiplier
amount *= plugin.getConfig().getDouble("bounty-multiplier", 1.0);
amount *= (float) plugin.getConfig().getDouble("bounty-multiplier", 1.0);
// Trigger bounty set event
BountySetEvent event = new BountySetEvent(sender instanceof Player ? (Player) sender : null, target, amount);
plugin.getServer().getPluginManager().callEvent(event);
amount = event.getAmount();
// Check if event was cancelled
if (event.isCancelled()) {
sender.sendMessage(plugin.getLang().getColored("command.bounty.set.cancelled"));
return true;
}
// Sanity check final amount
if (amount <= 0) {
@@ -72,10 +98,10 @@ public class BountySetCmd {
UUID playerUUID = target.getUniqueId();
// Calculate total bounty including previous bounties
ConcurrentHashMap<UUID, Integer> bounties = plugin.getBountyDataManager().getBounties();
Integer bountyAlreadyPresent = bounties.getOrDefault(playerUUID, 0);
int totalBounty = amount + bountyAlreadyPresent;
bounties.put(playerUUID, totalBounty);
BountyDataManager bountyDataManager = plugin.getBountyDataManager();
int bountyAlreadyPresent = bountyDataManager.getBounty(playerUUID);
int totalBounty = ((int) amount) + bountyAlreadyPresent;
bountyDataManager.setBounty(playerUUID, totalBounty);
// Confirmation
sender.sendMessage(
@@ -104,8 +130,23 @@ public class BountySetCmd {
);
}
plugin.getBountyDataManager().saveBountiesAsync();
bountyDataManager.saveBountiesAsync();
return true;
}
@Nullable
public static List<String> onTabComplete(@NotNull CommandSender sender, @NotNull String[] args) {
if (args.length == 2) {
// Suggest online player names for the username
return sender.getServer().getOnlinePlayers().stream()
.map(Player::getName)
.filter(name -> name.toLowerCase().startsWith(args[1].toLowerCase()))
.collect(Collectors.toList());
} else if (args.length == 3) {
// Suggest a placeholder for the amount
return Collections.singletonList("<amount>");
}
return Collections.emptyList();
}
}
@@ -0,0 +1,57 @@
package com.tcoded.playerbountiesplus.event;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class BountyClaimEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final Player claimant;
private final Player victim;
private final double amount;
private boolean cancelled;
public BountyClaimEvent(@NotNull Player claimant, @NotNull Player victim, double amount) {
this.claimant = claimant;
this.victim = victim;
this.amount = amount;
this.cancelled = false;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
public Player getClaimant() {
return claimant;
}
public Player getVictim() {
return victim;
}
public double getAmount() {
return amount;
}
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -0,0 +1,64 @@
package com.tcoded.playerbountiesplus.event;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class BountySetEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private final Player setter;
private final Player target;
private float amount;
private boolean cancelled;
public BountySetEvent(Player setter, @NotNull Player target, float amount) {
this.setter = setter;
this.target = target;
this.amount = amount;
this.cancelled = false;
}
/**
* @return The player who set the bounty or null if it's set by console/command block.
*/
public Player getSetter() {
return setter;
}
public Player getTarget() {
return target;
}
public float getAmount() {
return amount;
}
public void setAmount(float amount) {
this.amount = amount;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
@Override
public @NotNull HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -0,0 +1,14 @@
package com.tcoded.playerbountiesplus.gui;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.InventoryHolder;
public interface IPbpGui extends InventoryHolder {
void open();
void setContents();
void handleClick(InventoryClickEvent event);
}
@@ -0,0 +1,50 @@
package com.tcoded.playerbountiesplus.gui;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
public class MainBountyGui implements IPbpGui {
private final PlayerBountiesPlus plugin;
private final Player viewer;
private final Inventory inventory;
public MainBountyGui(PlayerBountiesPlus plugin, Player viewer) {
this.plugin = plugin;
this.viewer = viewer;
// Create inventory
this.inventory = Bukkit.createInventory(
this,
9 * 3,
plugin.getLang().getColored("gui.main.title")
);
}
@Override
public Inventory getInventory() {
return this.inventory;
}
@Override
public void open() {
setContents();
// Open the inventory for the viewer
viewer.openInventory(this.inventory);
}
@Override
public void setContents() {
// TODO: Populate the inventory
}
@Override
public void handleClick(InventoryClickEvent event) {
// TODO: Handle inventory clicks
}
}
@@ -1,15 +0,0 @@
package com.tcoded.playerbountiesplus.hook.currency;
import org.bukkit.entity.Player;
public abstract class AbstractEconomyHook {
public abstract boolean isValid();
public abstract void giveEco(Player player, double amount);
public abstract boolean takeEco(Player player, double amount);
public abstract boolean takeEco(Player player, double amount, boolean force);
}
@@ -2,7 +2,7 @@ package com.tcoded.playerbountiesplus.hook.currency;
import org.bukkit.entity.Player;
public class DummyEcoHook extends AbstractEconomyHook {
public class DummyEcoHook implements EconomyHook {
@Override
public boolean isValid() {
@@ -0,0 +1,15 @@
package com.tcoded.playerbountiesplus.hook.currency;
import org.bukkit.entity.Player;
public interface EconomyHook {
boolean isValid();
void giveEco(Player player, double amount);
boolean takeEco(Player player, double amount);
boolean takeEco(Player player, double amount, boolean force);
}
@@ -6,7 +6,7 @@ import net.milkbowl.vault.economy.EconomyResponse;
import org.bukkit.entity.Player;
import org.bukkit.plugin.RegisteredServiceProvider;
public class VaultHook extends AbstractEconomyHook {
public class VaultHook implements EconomyHook {
private final PlayerBountiesPlus plugin;
@@ -0,0 +1,15 @@
package com.tcoded.playerbountiesplus.hook.placeholder;
public class DummyPlaceholderHook implements PlaceholderHook {
@Override
public void enable() {
}
@Override
public void disable() {
}
}
@@ -0,0 +1,63 @@
package com.tcoded.playerbountiesplus.hook.placeholder;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import me.clip.placeholderapi.PlaceholderAPIPlugin;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.OfflinePlayer;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class PlaceholderAPIHook extends PlaceholderExpansion implements PlaceholderHook {
private final PlayerBountiesPlus pbpPlugin;
public PlaceholderAPIHook(PlayerBountiesPlus pbpPlugin, Plugin papiPlugin) {
this.pbpPlugin = pbpPlugin;
if (!(papiPlugin instanceof PlaceholderAPIPlugin)) {
throw new IllegalArgumentException("Plugin is not PlaceholderAPI");
}
}
@Override
public @NotNull String getIdentifier() {
return pbpPlugin.getName().toLowerCase();
}
@Override
public @NotNull String getAuthor() {
return pbpPlugin.getDescription().getAuthors().get(0);
}
@Override
public @NotNull String getVersion() {
return pbpPlugin.getDescription().getVersion();
}
@Override
public boolean persist() {
return true;
}
@Override
public void enable() {
this.register();
}
@Override
public void disable() {
this.unregister();
}
@Override
public @Nullable String onRequest(OfflinePlayer player, @NotNull String params) {
if (params.equals("bounty")) {
return String.valueOf(pbpPlugin.getBountyDataManager().getBounty(player.getUniqueId()));
} else if (params.equals("hasbounty")) {
return String.valueOf(pbpPlugin.getBountyDataManager().hasBounty(player.getUniqueId()));
}
return "INVALID-OPTION";
}
}
@@ -0,0 +1,27 @@
package com.tcoded.playerbountiesplus.hook.placeholder;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.jetbrains.annotations.NotNull;
public interface PlaceholderHook {
@NotNull
static PlaceholderHook findPlaceholderHook(PlayerBountiesPlus plugin) {
PluginManager pluginManager = plugin.getServer().getPluginManager();
Plugin papiPlugin = pluginManager.getPlugin("PlaceholderAPI");
if (papiPlugin != null) {
return new PlaceholderAPIHook(plugin, papiPlugin);
}
plugin.getLogger().warning("PlaceholderAPI not found, placeholders will be unavailable.");
return new DummyPlaceholderHook();
}
void enable();
void disable();
}
@@ -1,14 +1,12 @@
package com.tcoded.playerbountiesplus.hook.team;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.List;
public abstract class AbstractTeamHook {
public abstract class AbstractTeamHook implements TeamHook {
protected PlayerBountiesPlus plugin;
protected JavaPlugin teamPlugin;
@@ -18,66 +16,23 @@ public abstract class AbstractTeamHook {
this.teamPlugin = (JavaPlugin) teamPlugin;
}
public static AbstractTeamHook findTeamHook(PlayerBountiesPlus plugin) {
PluginManager pluginManager = plugin.getServer().getPluginManager();
// loving11ish - ClansLite - https://www.spigotmc.org/resources/clanslite-1-19-4-support.97163/
Plugin clansLitePlugin = pluginManager.getPlugin("ClansLite");
if (clansLitePlugin != null && clansLitePlugin.isEnabled()) {
return new ClansLiteHook(plugin, clansLitePlugin);
}
// AlessioDP - Parties - https://www.spigotmc.org/resources/parties-an-advanced-parties-manager.3709/
Plugin partiesPlugin = pluginManager.getPlugin("Parties");
if (partiesPlugin != null && partiesPlugin.isEnabled()) {
return new AlessioPartiesHook(plugin, partiesPlugin);
}
// booksaw - BetterTeams - https://www.spigotmc.org/resources/better-teams.17129/
Plugin betterTeamsPlugin = pluginManager.getPlugin("BetterTeams");
if (betterTeamsPlugin != null && betterTeamsPlugin.isEnabled()) {
return new BetterTeamsHook(plugin, betterTeamsPlugin);
}
// RoinujNosde - SimpleClans - https://www.spigotmc.org/resources/simpleclans.71242/
Plugin simpleClansPlugin = pluginManager.getPlugin("SimpleClans");
if (simpleClansPlugin != null && simpleClansPlugin.isEnabled()) {
return new SimpleClansHook(plugin, simpleClansPlugin);
}
// SaberLLC - Factions (SaberFactions) - https://www.spigotmc.org/resources/simpleclans.71242/
Plugin saberFactionsPlugin = pluginManager.getPlugin("Factions");
if (saberFactionsPlugin != null &&
saberFactionsPlugin.getDescription().getMain().equals("com.massivecraft.factions.FactionsPlugin") &&
saberFactionsPlugin.isEnabled()) {
return new SaberFactionsHook(plugin, saberFactionsPlugin);
}
// LlmDl - Towny - https://www.spigotmc.org/resources/towny-advanced.72694/
Plugin townyPlugin = pluginManager.getPlugin("Towny");
if (townyPlugin != null && townyPlugin.isEnabled()) {
return new TownyHook(plugin, simpleClansPlugin);
}
return null;
}
@Override
public String getPluginName() {
return this.teamPlugin.getName();
}
@Override
public String getAuthor() {
List<String> authors = this.teamPlugin.getDescription().getAuthors();
if (authors.isEmpty()) return "N/A";
return authors.get(0);
}
@Override
public String[] getAuthors() {
List<String> authors = this.teamPlugin.getDescription().getAuthors();
if (authors.isEmpty()) return new String[0];
return authors.toArray(new String[0]);
}
public abstract boolean isFriendly(Player player1, Player player2);
}
@@ -5,6 +5,8 @@ import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import java.util.UUID;
public class AlessioPartiesHook extends AbstractTeamHook {
public AlessioPartiesHook(PlayerBountiesPlus plugin, Plugin partiesPlugin) {
@@ -13,6 +15,12 @@ public class AlessioPartiesHook extends AbstractTeamHook {
@Override
public boolean isFriendly(Player player1, Player player2) {
return Parties.getApi().areInTheSameParty(player1.getUniqueId(), player2.getUniqueId());
UUID uuid1 = player1.getUniqueId();
UUID uuid2 = player2.getUniqueId();
if (!Parties.getApi().isPlayerInParty(uuid1)) return false;
if (!Parties.getApi().isPlayerInParty(uuid2)) return false;
return Parties.getApi().areInTheSameParty(uuid1, uuid2);
}
}
@@ -13,6 +13,9 @@ public class BetterTeamsHook extends AbstractTeamHook {
@Override
public boolean isFriendly(Player player1, Player player2) {
if (Team.getTeam(player1) == null) return false;
if (Team.getTeam(player2) == null) return false;
return Team.getTeam(player1) == Team.getTeam(player2);
}
@@ -23,7 +23,12 @@ public class ClansLiteHook extends AbstractTeamHook {
@Override
public boolean isFriendly(Player player1, Player player2) {
String clanIdVictim = this.getClanId(player1);
return clanIdVictim != null && clanIdVictim.equals(this.getClanId(player2));
String clanId1 = this.getClanId(player1);
String clanId2 = this.getClanId(player2);
if (clanId1 == null) return false;
if (clanId2 == null) return false;
return clanId1.equals(this.getClanId(player2));
}
}
@@ -14,8 +14,13 @@ public class SaberFactionsHook extends AbstractTeamHook {
@Override
public boolean isFriendly(Player player1, Player player2) {
FPlayers fPlayers = FPlayers.getInstance();
String factionId1 = fPlayers.getByPlayer(player1).getFactionId();
String factionId2 = fPlayers.getByPlayer(player2).getFactionId();
if (factionId1 == null) return false;
if (factionId2 == null) return false;
return factionId1.equals(factionId2);
}
@@ -1,11 +1,14 @@
package com.tcoded.playerbountiesplus.hook.team;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import net.sacredlabyrinth.phaed.simpleclans.managers.ClanManager;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import java.util.UUID;
public class SimpleClansHook extends AbstractTeamHook {
public SimpleClansHook(PlayerBountiesPlus plugin, Plugin teamPlugin) {
@@ -15,7 +18,17 @@ public class SimpleClansHook extends AbstractTeamHook {
@Override
public boolean isFriendly(Player player1, Player player2) {
ClanManager clanManager = SimpleClans.getInstance().getClanManager();
return clanManager.getClanByPlayerUniqueId(player1.getUniqueId()) == clanManager.getClanByPlayerUniqueId(player2.getUniqueId());
UUID uuid1 = player1.getUniqueId();
UUID uuid2 = player2.getUniqueId();
Clan clan1 = clanManager.getClanByPlayerUniqueId(uuid1);
Clan clan2 = clanManager.getClanByPlayerUniqueId(uuid2);
if (clan1 == null) return false;
if (clan2 == null) return false;
return clan1 == clan2;
}
}
@@ -0,0 +1,62 @@
package com.tcoded.playerbountiesplus.hook.team;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
public interface TeamHook {
static AbstractTeamHook findTeamHook(PlayerBountiesPlus plugin) {
PluginManager pluginManager = plugin.getServer().getPluginManager();
// loving11ish - ClansLite - https://www.spigotmc.org/resources/clanslite-1-19-4-support.97163/
Plugin clansLitePlugin = pluginManager.getPlugin("ClansLite");
if (clansLitePlugin != null && clansLitePlugin.isEnabled()) {
return new ClansLiteHook(plugin, clansLitePlugin);
}
// AlessioDP - Parties - https://www.spigotmc.org/resources/parties-an-advanced-parties-manager.3709/
Plugin partiesPlugin = pluginManager.getPlugin("Parties");
if (partiesPlugin != null && partiesPlugin.isEnabled()) {
return new AlessioPartiesHook(plugin, partiesPlugin);
}
// booksaw - BetterTeams - https://www.spigotmc.org/resources/better-teams.17129/
Plugin betterTeamsPlugin = pluginManager.getPlugin("BetterTeams");
if (betterTeamsPlugin != null && betterTeamsPlugin.isEnabled()) {
return new BetterTeamsHook(plugin, betterTeamsPlugin);
}
// RoinujNosde - SimpleClans - https://www.spigotmc.org/resources/simpleclans.71242/
Plugin simpleClansPlugin = pluginManager.getPlugin("SimpleClans");
if (simpleClansPlugin != null && simpleClansPlugin.isEnabled()) {
return new SimpleClansHook(plugin, simpleClansPlugin);
}
// SaberLLC - Factions (SaberFactions) - https://www.spigotmc.org/resources/simpleclans.71242/
Plugin saberFactionsPlugin = pluginManager.getPlugin("Factions");
if (saberFactionsPlugin != null &&
saberFactionsPlugin.getDescription().getMain().equals("com.massivecraft.factions.FactionsPlugin") &&
saberFactionsPlugin.isEnabled()) {
return new SaberFactionsHook(plugin, saberFactionsPlugin);
}
// LlmDl - Towny - https://www.spigotmc.org/resources/towny-advanced.72694/
Plugin townyPlugin = pluginManager.getPlugin("Towny");
if (townyPlugin != null && townyPlugin.isEnabled()) {
return new TownyHook(plugin, simpleClansPlugin);
}
return null;
}
String getPluginName();
String getAuthor();
String[] getAuthors();
boolean isFriendly(Player player1, Player player2);
}
@@ -23,11 +23,14 @@ public class TownyHook extends AbstractTeamHook {
@Override
public boolean isFriendly(Player player1, Player player2) {
Town town = getTown(player1);
Nation player1Nation = getNation(player1);
Nation player2Nation = getNation(player2);
boolean sameTown = town != null && town.hasResident(player2);
boolean sameNation = player1Nation != null && player1Nation.equals(player2Nation);
Town town1 = getTown(player1);
Town town2 = getTown(player2);
Nation nation1 = getNation(player1);
Nation nation2 = getNation(player2);
boolean sameTown = town1 != null && town2 != null && (town1.hasResident(player2) || town1.hasAlly(town2));
boolean sameNation = nation1 != null && nation2 != null && (nation1.equals(nation2) || nation1.hasAlly(nation2));
return sameTown || sameNation;
}
@@ -1,7 +1,9 @@
package com.tcoded.playerbountiesplus.listener;
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
import com.tcoded.playerbountiesplus.hook.team.AbstractTeamHook;
import com.tcoded.playerbountiesplus.event.BountyClaimEvent;
import com.tcoded.playerbountiesplus.hook.team.TeamHook;
import com.tcoded.playerbountiesplus.manager.BountyDataManager;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@@ -9,11 +11,10 @@ import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
public class DeathListener implements Listener {
private PlayerBountiesPlus plugin;
private final PlayerBountiesPlus plugin;
public DeathListener(PlayerBountiesPlus plugin) {
this.plugin = plugin;
@@ -25,22 +26,37 @@ public class DeathListener implements Listener {
Player killer = victim.getKiller();
if (killer != null) {
ConcurrentHashMap<UUID, Integer> bounties = this.plugin.getBountyDataManager().getBounties();
UUID victimId = victim.getUniqueId();
Integer bounty = bounties.get(victimId);
// Bounty check
if (bounty == null || bounty == 0) {
if (!killer.hasPermission("playerbountiesplus.event.claim")) {
killer.sendMessage(plugin.getLang().getColored("death.no-permission"));
return;
}
BountyDataManager bountyDataManager = this.plugin.getBountyDataManager();
UUID victimId = victim.getUniqueId();
// Bounty check
if (!bountyDataManager.hasBounty(victimId)) {
return;
}
int bounty = bountyDataManager.getBounty(victimId);
// Clan check
AbstractTeamHook teamHook = this.plugin.getTeamHook();
TeamHook teamHook = this.plugin.getTeamHook();
if (teamHook != null && teamHook.isFriendly(killer, victim)) {
killer.sendMessage(plugin.getLang().getColored("death.same-team"));
return;
}
// Trigger Bounty Claimed Event
BountyClaimEvent claimEvent = new BountyClaimEvent(killer, victim, bounty);
this.plugin.getServer().getPluginManager().callEvent(claimEvent);
// Check if event is cancelled
if (claimEvent.isCancelled()) {
return;
}
// Give reward!
if (plugin.getConfig().getBoolean("bounty-claimable", true)) {
double claimMultiplier = plugin.getConfig().getDouble("bounty-claim-multiplier", 1.0);
@@ -64,13 +80,13 @@ public class DeathListener implements Listener {
plugin.getLang().getColored("death.announce-claimed")
.replace("{killer}", killer.getName())
.replace("{victim}", victim.getName())
.replace("{bounty}", bounty.toString())
.replace("{bounty}", String.valueOf(bounty))
);
}
// Remove bounty
bounties.remove(victimId);
this.plugin.getBountyDataManager().saveBountiesAsync();
bountyDataManager.removeBounty(victimId);
bountyDataManager.saveBountiesAsync();
}
}
@@ -0,0 +1,28 @@
package com.tcoded.playerbountiesplus.listener;
import com.tcoded.playerbountiesplus.gui.IPbpGui;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.InventoryHolder;
public class GuiListener implements Listener {
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
// Get the inventory holder
InventoryHolder holder = event.getView().getTopInventory().getHolder();
// Ensure the holder is a GUI
if (!(holder instanceof IPbpGui gui)) {
return;
}
// Cancel normal click behaviour
event.setCancelled(true);
// Delegate the click handling
gui.handleClick(event);
}
}
@@ -50,6 +50,22 @@ public class BountyDataManager {
return this.bounties;
}
public boolean hasBounty(UUID player) {
return this.bounties.containsKey(player) && this.bounties.get(player) > 0;
}
public void setBounty(UUID player, int amount) {
this.bounties.put(player, amount);
}
public int getBounty(UUID player) {
return this.bounties.getOrDefault(player, 0);
}
public void removeBounty(UUID player) {
this.bounties.remove(player);
}
public void saveBounties() {
synchronized (this.savingFileLock) {
// Clear existing
@@ -83,7 +99,7 @@ public class BountyDataManager {
}
// Save
this.plugin.getFoliaLib().getImpl().runAsync(() -> {
this.plugin.getFoliaLib().getScheduler().runAsync(wt -> {
this.saveBounties();
this.savingAsync.set(false);
@@ -92,4 +108,5 @@ public class BountyDataManager {
}
});
}
}
+25
View File
@@ -1,6 +1,7 @@
death:
same-team: "&aDer Spieler, den du getötet hast, hat eine aktive Belohnung, aber du bist im selben Team wie er!"
announce-claimed: "&4&l{killer} hat die Belohnung von {victim} im Wert von ${bounty} beansprucht"
no-permission: "&cSie dürfen keine Kopfgelder beanspruchen!"
command:
no-permission: "&cDu hast keine Berechtigung, diesen Befehl zu verwenden!"
@@ -10,6 +11,30 @@ command:
reloaded: "&aDie Konfigurationsdateien wurden erfolgreich neu geladen!"
version:
no-permission: "&7(Version nicht sichtbar: Fehlende Berechtigung)"
bounty:
set:
missing-args: "&cBenutzung: /pbp bounty set <Spieler> <Betrag>"
amount-nan: "&cDas ist keine gültige Zahl!"
player-not-found: "&cDieser Spieler ist nicht online oder existiert nicht!"
success: "&aBelohnung für {target} auf {bounty} gesetzt."
add:
missing-args: "&cBenutzung: /pbp bounty add <Spieler> <Betrag>"
amount-nan: "&cDas ist keine gültige Zahl!"
player-not-found: "&cDieser Spieler ist nicht online oder existiert nicht!"
success: "&a{amount} zur Belohnung von {target} hinzugefügt. Gesamt: {total}."
remove:
missing-args: "&cBenutzung: /pbp bounty remove <Spieler> <Betrag>"
amount-nan: "&cDas ist keine gültige Zahl!"
player-not-found: "&cDieser Spieler ist nicht online oder existiert nicht!"
success: "&a{amount} von der Belohnung von {target} entfernt. Gesamt: {total}."
delete:
missing-args: "&cBenutzung: /pbp bounty delete <Spieler>"
player-not-found: "&cDieser Spieler ist nicht online oder existiert nicht!"
success: "&aBelohnung für {target} gelöscht."
get:
missing-args: "&cBenutzung: /pbp bounty get <Spieler>"
player-not-found: "&cDieser Spieler ist nicht online oder existiert nicht!"
success: "&a{target} hat derzeit eine Belohnung von {bounty}."
bounty:
no-action: "&cDu musst eine Aktion angeben! /bounty <set/top/check>"
invalid-action: "&cDas ist keine gültige Aktion!"
+26 -1
View File
@@ -1,6 +1,7 @@
death:
same-team: "&aThe player you killed has an active bounty but you are in the same team as they are!"
announce-claimed: "&4&l{killer} claimed {victim}'s bounty worth ${bounty}"
no-permission: "&cYou are not allowed to claim bounties!"
command:
no-permission: "&cYou don't have the permission to use this command!"
@@ -10,6 +11,30 @@ command:
reloaded: "&aSuccessfully reloaded the configuration files!"
version:
no-permission: "&7(Version not visible: Missing permission)"
bounty:
set:
missing-args: "&cUsage: /pbp bounty set <player> <amount>"
amount-nan: "&cThat's not a valid number!"
player-not-found: "&cThat player is not online or doesn't exist!"
success: "&aSet {target}'s bounty to {bounty}."
add:
missing-args: "&cUsage: /pbp bounty add <player> <amount>"
amount-nan: "&cThat's not a valid number!"
player-not-found: "&cThat player is not online or doesn't exist!"
success: "&aAdded {amount} bounty to {target}. Total: {total}."
remove:
missing-args: "&cUsage: /pbp bounty remove <player> <amount>"
amount-nan: "&cThat's not a valid number!"
player-not-found: "&cThat player is not online or doesn't exist!"
success: "&aRemoved {amount} bounty from {target}. Total: {total}."
delete:
missing-args: "&cUsage: /pbp bounty delete <player>"
player-not-found: "&cThat player is not online or doesn't exist!"
success: "&aDeleted bounty for {target}."
get:
missing-args: "&cUsage: /pbp bounty get <player>"
player-not-found: "&cThat player is not online or doesn't exist!"
success: "&a{target} currently has a bounty of {bounty}."
bounty:
no-action: "&cYou need to specify an action! /bounty <set/top/check>"
invalid-action: "&cThat's not a valid action!"
@@ -31,4 +56,4 @@ command:
bounty-found: "&aThere is a bounty worth {bounty} on {target}'s head!"
top:
top-10: "&eTop 10 bounties:"
no-bounties: "&r &cNo bounties were set!"
no-bounties: "&r &cNo bounties were set!"
+31 -1
View File
@@ -1,6 +1,7 @@
death:
same-team: "&aThe player you killed has an active bounty but you are in the same team as they are!"
announce-claimed: "&4&l{killer} claimed {victim}'s bounty worth ${bounty}"
no-permission: "&cYou are not allowed to claim bounties!"
command:
no-permission: "&cYou don't have the permission to use this command!"
@@ -10,6 +11,30 @@ command:
reloaded: "&aSuccessfully reloaded the configuration files!"
version:
no-permission: "&7(Version not visible: Missing permission)"
bounty:
set:
missing-args: "&cUsage: /pbp bounty set <player> <amount>"
amount-nan: "&cThat's not a valid number!"
player-not-found: "&cThat player is not online or doesn't exist!"
success: "&aSet {target}'s bounty to {bounty}."
add:
missing-args: "&cUsage: /pbp bounty add <player> <amount>"
amount-nan: "&cThat's not a valid number!"
player-not-found: "&cThat player is not online or doesn't exist!"
success: "&aAdded {amount} bounty to {target}. Total: {total}."
remove:
missing-args: "&cUsage: /pbp bounty remove <player> <amount>"
amount-nan: "&cThat's not a valid number!"
player-not-found: "&cThat player is not online or doesn't exist!"
success: "&aRemoved {amount} bounty from {target}. Total: {total}."
delete:
missing-args: "&cUsage: /pbp bounty delete <player>"
player-not-found: "&cThat player is not online or doesn't exist!"
success: "&aDeleted bounty for {target}."
get:
missing-args: "&cUsage: /pbp bounty get <player>"
player-not-found: "&cThat player is not online or doesn't exist!"
success: "&a{target} currently has a bounty of {bounty}."
bounty:
no-action: "&cYou need to specify an action! /bounty <set/top/check>"
invalid-action: "&cThat's not a valid action!"
@@ -31,4 +56,9 @@ command:
bounty-found: "&aThere is a bounty worth {bounty} on {target}'s head!"
top:
top-10: "&eTop 10 bounties:"
no-bounties: "&r &cNo bounties were set!"
no-bounties: "&r &cNo bounties were set!"
gui:
main:
title: "&eBounties"
+1
View File
@@ -1,6 +1,7 @@
death:
same-team: "&aDa pwayer you kiwwed has an active bounty but you awe in da same team as they awe!"
announce-claimed: "&4&w{killer} cwaimed {victim}'s bounty wowth ${bounty}"
no-permission: "&cYou awe nyot awwowed to cwaim bounties!"
command:
no-permission: "&cYou don't have da pewmission to use this command!"
+28 -3
View File
@@ -1,15 +1,40 @@
death:
same-team: "&aEl jugador que mataste tiene una recompensa activa pero estás en el mismo equipo que él."
announce-claimed: "&4&l{killer} reclamó la recompensa de {victim} valorada en ${bounty}"
no-permission: "&c¡No se le permite reclamar recompensas!"
command:
no-permission: "&cNo tienes permiso para usar este comando."
no-permission-detailed: "{no-permission-msg} &7({permission})"
admin:
reload:
reloaded: "&aLos archivos de configuración se han recargado con éxito."
reloaded: "&a¡Archivos de configuración recargados con éxito!"
version:
no-permission: "&7(Versión no visible: Permiso faltante)"
no-permission: "&7(Versión no visible: Falta permiso)"
bounty:
set:
missing-args: "&cUso: /pbp bounty set <jugador> <cantidad>"
amount-nan: "&c¡Ese no es un número válido!"
player-not-found: "&c¡Ese jugador no está en línea o no existe!"
success: "&aSe ha establecido la recompensa de {target} en {bounty}."
add:
missing-args: "&cUso: /pbp bounty add <jugador> <cantidad>"
amount-nan: "&c¡Ese no es un número válido!"
player-not-found: "&c¡Ese jugador no está en línea o no existe!"
success: "&aSe ha añadido una recompensa de {amount} a {target}. Total: {total}."
remove:
missing-args: "&cUso: /pbp bounty remove <jugador> <cantidad>"
amount-nan: "&c¡Ese no es un número válido!"
player-not-found: "&c¡Ese jugador no está en línea o no existe!"
success: "&aSe ha eliminado una recompensa de {amount} de {target}. Total: {total}."
delete:
missing-args: "&cUso: /pbp bounty delete <jugador>"
player-not-found: "&c¡Ese jugador no está en línea o no existe!"
success: "&aRecompensa eliminada para {target}."
get:
missing-args: "&cUso: /pbp bounty get <jugador>"
player-not-found: "&c¡Ese jugador no está en línea o no existe!"
success: "&a{target} actualmente tiene una recompensa de {bounty}."
bounty:
no-action: "&cDebes especificar una acción! /bounty <set/top/check>"
invalid-action: "&cEsa no es una acción válida."
@@ -31,4 +56,4 @@ command:
bounty-found: "&aHay una recompensa valorada en {bounty} en la cabeza de {target}."
top:
top-10: "&eLos 10 mejores recompensas:"
no-bounties: "&r &cNo se han establecido recompensas."
no-bounties: "&r &cNo se han establecido recompensas."
+40 -1
View File
@@ -1,6 +1,7 @@
death:
same-team: "&aLe joueur que vous avez tué a une prime sur sa tête mais vous êtes dans la même équipe!"
announce-claimed: "&4&l{killer} a gagné la prime de {victim} au prix de ${bounty}"
no-permission: "&cVous n'êtes pas autorisé à réclamer des primes!"
command:
no-permission: "&cVous n'avez pas la permission d'utiliser cette commande!"
@@ -10,6 +11,30 @@ command:
reloaded: "&aLes fichiers de configuration ont été mis à jour avec succès!"
version:
no-permission: "&7(Version non visible: Permission manquante)"
bounty:
set:
missing-args: "&cUtilisation : /pbp bounty set <joueur> <montant>"
amount-nan: "&cCe n'est pas un nombre valide !"
player-not-found: "&cCe joueur n'est pas en ligne ou n'existe pas !"
success: "&aPrime de {target} définie à {bounty}."
add:
missing-args: "&cUtilisation : /pbp bounty add <joueur> <montant>"
amount-nan: "&cCe n'est pas un nombre valide !"
player-not-found: "&cCe joueur n'est pas en ligne ou n'existe pas !"
success: "&aAjouté {amount} de prime à {target}. Total : {total}."
remove:
missing-args: "&cUtilisation : /pbp bounty remove <joueur> <montant>"
amount-nan: "&cCe n'est pas un nombre valide !"
player-not-found: "&cCe joueur n'est pas en ligne ou n'existe pas !"
success: "&aRetiré {amount} de la prime de {target}. Total : {total}."
delete:
missing-args: "&cUtilisation : /pbp bounty delete <joueur>"
player-not-found: "&cCe joueur n'est pas en ligne ou n'existe pas !"
success: "&aPrime supprimée pour {target}."
get:
missing-args: "&cUtilisation : /pbp bounty get <joueur>"
player-not-found: "&cCe joueur n'est pas en ligne ou n'existe pas !"
success: "&a{target} a actuellement une prime de {bounty}."
bounty:
no-action: "&cVous devez spécifier une action! /bounty <set/top/check>"
invalid-action: "&cCeci n'est pas une action valable!"
@@ -24,6 +49,20 @@ command:
success: "&cVous avez placé une prime de {bounty} sur la tête de {target}!"
announce: "\nUne prime de {bounty} a été placée sur la tête de {target} par {player}!{extra}\n"
announce-extra: " (Total: {total})"
add:
missing-args: "&cUtilisation : /pbp bounty add <joueur> <montant>"
amount-nan: "&cCe n'est pas un nombre valide !"
player-not-found: "&cCe joueur n'est pas en ligne ou n'existe pas !"
success: "&aAjouté {amount} de prime à {target}. Total : {total}."
remove:
missing-args: "&cUtilisation : /pbp bounty remove <joueur> <montant>"
amount-nan: "&cCe n'est pas un nombre valide !"
player-not-found: "&cCe joueur n'est pas en ligne ou n'existe pas !"
success: "&aRetiré {amount} de la prime de {target}. Total : {total}."
delete:
missing-args: "&cUtilisation : /pbp bounty delete <joueur>"
player-not-found: "&cCe joueur n'est pas en ligne ou n'existe pas !"
success: "&aPrime supprimée pour {target}."
check:
no-player-specified: "&cVous devez spécifier un joueur! /bounty check <player>"
player-not-found: "&cCe joueur n'est pas en ligne ou n'existe pas"
@@ -31,4 +70,4 @@ command:
bounty-found: "&aIl y a une prime de {bounty} sur la tête de {target}!"
top:
top-10: "&eLes top 10 primes:"
no-bounties: "&r &cAucune prime n'a été placée!"
no-bounties: "&r &cAucune prime n'a été placée!"
+1
View File
@@ -1,6 +1,7 @@
death:
same-team: "&aवह खिलाड़ी जिसे आपने मार डाला है, उसके पास एक सक्रिय इनाम है, लेकिन आप उनकी टीम में हैं!"
announce-claimed: "&4&l{killer} ने {victim} के इनाम {bounty} को मांग लिया"
no-permission: "&cआपको इनामों का दावा करने की अनुमति नहीं है!"
command:
no-permission: "&cआपके पास इस कमांड का उपयोग करने की अनुमति नहीं है!"
+1
View File
@@ -5,6 +5,7 @@
death:
same-team: "&aA játékos, akit megöltél, aktív fejpénzt volt a fején, de ugyanabba a csapatba tartozol, mint ő!"
announce-claimed: "&4&l{killer} behajtotta {victim} fejpénzét és megkapta jutalmát aminek értéke: ${bounty}"
no-permission: "&cNem igényelheted a fejpénzeket!"
command:
no-permission: "&cNincs jogosultságod ennek a parancsnak a használatához!"
+25
View File
@@ -1,6 +1,7 @@
death:
same-team: "&aIl giocatore che hai ucciso ha una taglia attiva, ma sei nella stessa squadra!"
announce-claimed: "&4&l{killer} ha reclamato la taglia di {victim} del valore di ${bounty}"
no-permission: "&cNon ti è permesso riscuotere le taglie!"
command:
no-permission: "&cNon hai il permesso di utilizzare questo comando!"
@@ -10,6 +11,30 @@ command:
reloaded: "&aHai ricaricato con successo i file di configurazione!"
version:
no-permission: "&7(Versione non visibile: Permesso mancante)"
bounty:
set:
missing-args: "&cUso: /pbp bounty set <giocatore> <quantità>"
amount-nan: "&cQuesto non è un numero valido!"
player-not-found: "&cQuesto giocatore non è online o non esiste!"
success: "&aTaglia di {bounty} impostata per {target}."
add:
missing-args: "&cUso: /pbp bounty add <giocatore> <quantità>"
amount-nan: "&cQuesto non è un numero valido!"
player-not-found: "&cQuesto giocatore non è online o non esiste!"
success: "&aAggiunta una taglia di {amount} a {target}. Totale: {total}."
remove:
missing-args: "&cUso: /pbp bounty remove <giocatore> <quantità>"
amount-nan: "&cQuesto non è un numero valido!"
player-not-found: "&cQuesto giocatore non è online o non esiste!"
success: "&aRimossa una taglia di {amount} da {target}. Totale: {total}."
delete:
missing-args: "&cUso: /pbp bounty delete <giocatore>"
player-not-found: "&cQuesto giocatore non è online o non esiste!"
success: "&aTaglia eliminata per {target}."
get:
missing-args: "&cUso: /pbp bounty get <giocatore>"
player-not-found: "&cQuesto giocatore non è online o non esiste!"
success: "&a{target} ha attualmente una taglia di {bounty}."
bounty:
no-action: "&cDevi specificare un'azione! /bounty <set/top/check>"
invalid-action: "&cQuesta non è un'azione valida!"
+27 -2
View File
@@ -1,15 +1,40 @@
death:
same-team: "&aDe speler die je hebt gedood heeft een actieve beloning, maar je zit in hetzelfde team als zij!"
announce-claimed: "&4&l{killer} heeft de beloning van {victim} ter waarde van ${bounty} geclaimd"
no-permission: "&cU mag geen premies claimen!"
command:
no-permission: "&cJe hebt geen toestemming om deze opdracht te gebruiken!"
no-permission-detailed: "{no-permission-msg} &7({permission})"
admin:
reload:
reloaded: "&aDe configuratiebestanden zijn succesvol herladen!"
reloaded: "&aConfiguratiebestanden succesvol herladen!"
version:
no-permission: "&7(Versie niet zichtbaar: Ontbrekende toestemming)"
no-permission: "&7(Versie niet zichtbaar: Ontbrekend recht)"
bounty:
set:
missing-args: "&cGebruik: /pbp bounty set <speler> <bedrag>"
amount-nan: "&cDat is geen geldig getal!"
player-not-found: "&cDie speler is niet online of bestaat niet!"
success: "&aDe premie van {target} is ingesteld op {bounty}."
add:
missing-args: "&cGebruik: /pbp bounty add <speler> <bedrag>"
amount-nan: "&cDat is geen geldig getal!"
player-not-found: "&cDie speler is niet online of bestaat niet!"
success: "&a{amount} premie toegevoegd aan {target}. Totaal: {total}."
remove:
missing-args: "&cGebruik: /pbp bounty remove <speler> <bedrag>"
amount-nan: "&cDat is geen geldig getal!"
player-not-found: "&cDie speler is niet online of bestaat niet!"
success: "&a{amount} premie verwijderd van {target}. Totaal: {total}."
delete:
missing-args: "&cGebruik: /pbp bounty delete <speler>"
player-not-found: "&cDie speler is niet online of bestaat niet!"
success: "&aPremie verwijderd voor {target}."
get:
missing-args: "&cGebruik: /pbp bounty get <speler>"
player-not-found: "&cDie speler is niet online of bestaat niet!"
success: "&a{target} heeft momenteel een premie van {bounty}."
bounty:
no-action: "&cJe moet een actie specificeren! /beloning <zet/hoogte/controle>"
invalid-action: "&cDit is geen geldige actie!"
+25
View File
@@ -1,6 +1,7 @@
death:
same-team: "&aИгрок, которого вы убили, имеет активную награду, но вы находитесь в одной команде с ними!"
announce-claimed: "&4&l{killer} получил награду {victim} на сумму ${bounty}"
no-permission: "&cВам не разрешено требовать наград!"
command:
no-permission: "&cУ вас нет разрешения использовать эту команду!"
@@ -10,6 +11,30 @@ command:
reloaded: "&aКонфигурационные файлы успешно перезагружены!"
version:
no-permission: "&7(Версия не видна: Отсутствует разрешение)"
bounty:
set:
missing-args: "&cИспользование: /pbp bounty set <игрок> <сумма>"
amount-nan: "&cЭто не число!"
player-not-found: "&cЭтот игрок не в сети или не существует!"
success: "&aНаграда {target} установлена на {bounty}."
add:
missing-args: "&cИспользование: /pbp bounty add <игрок> <сумма>"
amount-nan: "&cЭто не число!"
player-not-found: "&cЭтот игрок не в сети или не существует!"
success: "&aДобавлено {amount} к награде {target}. Всего: {total}."
remove:
missing-args: "&cИспользование: /pbp bounty remove <игрок> <сумма>"
amount-nan: "&cЭто не число!"
player-not-found: "&cЭтот игрок не в сети или не существует!"
success: "&aУдалено {amount} из награды {target}. Всего: {total}."
delete:
missing-args: "&cИспользование: /pbp bounty delete <игрок>"
player-not-found: "&cЭтот игрок не в сети или не существует!"
success: "&aНаграда для {target} удалена."
get:
missing-args: "&cИспользование: /pbp bounty get <игрок>"
player-not-found: "&cЭтот игрок не в сети или не существует!"
success: "&aУ {target} сейчас награда {bounty}."
bounty:
no-action: "&cВы должны указать действие! /bounty <set/top/check>"
invalid-action: "&cЭто недопустимое действие!"
+25
View File
@@ -1,6 +1,7 @@
death:
same-team: "&aDen spelare du dödade har en aktiv prissumma, men du tillhör samma lag som de är!"
announce-claimed: "&4&l{killer} har tagit {victim}s prissumma värd {bounty} dollar"
no-permission: "&cDu får inte hämta in prissummor!"
command:
no-permission: "&cDu har inte behörighet att använda detta kommando!"
@@ -10,6 +11,30 @@ command:
reloaded: "&aKonfigurationsfilerna har laddats om framgångsrikt!"
version:
no-permission: "&7(Version ej synlig: Saknad behörighet)"
bounty:
set:
missing-args: "&cAnvändning: /pbp bounty set <spelare> <summa>"
amount-nan: "&cDet är inte ett giltigt nummer!"
player-not-found: "&cDen spelaren är inte online eller existerar inte!"
success: "&aPrissumman för {target} har satts till {bounty}."
add:
missing-args: "&cAnvändning: /pbp bounty add <spelare> <summa>"
amount-nan: "&cDet är inte ett giltigt nummer!"
player-not-found: "&cDen spelaren är inte online eller existerar inte!"
success: "&aLade till {amount} i prissumma för {target}. Totalt: {total}."
remove:
missing-args: "&cAnvändning: /pbp bounty remove <spelare> <summa>"
amount-nan: "&cDet är inte ett giltigt nummer!"
player-not-found: "&cDen spelaren är inte online eller existerar inte!"
success: "&aTog bort {amount} från prissumman för {target}. Totalt: {total}."
delete:
missing-args: "&cAnvändning: /pbp bounty delete <spelare>"
player-not-found: "&cDen spelaren är inte online eller existerar inte!"
success: "&aPrissumman för {target} har tagits bort."
get:
missing-args: "&cAnvändning: /pbp bounty get <spelare>"
player-not-found: "&cDen spelaren är inte online eller existerar inte!"
success: "&a{target} har för närvarande en prissumma på {bounty}."
bounty:
no-action: "&cDu måste ange en åtgärd! /bounty <set/top/check>"
invalid-action: "&cDet är inte en giltig åtgärd!"
+26
View File
@@ -1,6 +1,7 @@
death:
same-team: "&a你击杀的玩家有悬赏,但你与他们在同一队伍中!"
announce-claimed: "&4&l{killer} 已领取 {victim} 的悬赏,价值 ${bounty}"
no-permission: "&c你没有权限领取悬赏!"
command:
no-permission: "&c你没有权限使用此命令!"
@@ -10,6 +11,30 @@ command:
reloaded: "&a成功重新加载配置文件!"
version:
no-permission: "&7(无法查看版本:缺少权限)"
bounty:
set:
missing-args: "&c用法:/pbp bounty set <玩家> <金额>"
amount-nan: "&c这不是一个有效的数字!"
player-not-found: "&c该玩家不在线或不存在!"
success: "&a已将 {target} 的悬赏设置为 {bounty}。"
add:
missing-args: "&c用法:/pbp bounty add <玩家> <金额>"
amount-nan: "&c这不是一个有效的数字!"
player-not-found: "&c该玩家不在线或不存在!"
success: "&a已为 {target} 增加了 {amount} 悬赏。总计:{total}。"
remove:
missing-args: "&c用法:/pbp bounty remove <玩家> <金额>"
amount-nan: "&c这不是一个有效的数字!"
player-not-found: "&c该玩家不在线或不存在!"
success: "&a已为 {target} 移除了 {amount} 悬赏。总计:{total}。"
delete:
missing-args: "&c用法:/pbp bounty delete <玩家>"
player-not-found: "&c该玩家不在线或不存在!"
success: "&a已删除 {target} 的悬赏。"
get:
missing-args: "&c用法:/pbp bounty get <玩家>"
player-not-found: "&c该玩家不在线或不存在!"
success: "&a{target} 当前有一个悬赏,金额为 {bounty}。"
bounty:
no-action: "&c你需要指定一个操作!/bounty <set/top/check>"
invalid-action: "&c这不是一个有效的操作!"
@@ -32,3 +57,4 @@ command:
top:
top-10: "&e前10名悬赏:"
no-bounties: "&r &c没有设置悬赏!"
+13 -5
View File
@@ -21,14 +21,22 @@ commands:
permission: playerbountiesplus.command.bounty
aliases: [bounties, prime, primes]
playerbountiesplusadmin:
permission: playerbountiesplus.command.admin
aliases: [playerbountiesplus, pbpa, pbp]
permissions:
playerbountiesplus.command.bounty:
default: true
playerbountiesplus.command.playerbountiesplus:
playerbountiesplus.command.admin:
default: op
children:
playerbountiesplus.command.playerbountiesplus.version:
default: true
playerbountiesplus.command.playerbountiesplus.reload:
default: op
playerbountiesplus.command.admin.version: {}
playerbountiesplus.command.admin.reload: {}
playerbountiesplus.command.admin.bounty.set: {}
playerbountiesplus.command.admin.bounty.add: {}
playerbountiesplus.command.admin.bounty.remove: {}
playerbountiesplus.command.admin.bounty.delete: {}
playerbountiesplus.command.bounty.set:
default: true
playerbountiesplus.event.claim:
default: true