Compare commits
23
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6286d15a32 | ||
|
|
3221637a21 | ||
|
|
4b739a0561 | ||
|
|
908f04ce30 | ||
|
|
13b6ac5724 | ||
|
|
118c78959b | ||
|
|
5d9d070a72 | ||
|
|
f57883745c | ||
|
|
2471003e38 | ||
|
|
a798586951 | ||
|
|
62891307cd | ||
|
|
1beb8de05d | ||
|
|
8f4b0294f8 | ||
|
|
e263a872b0 | ||
|
|
3f18f57bbf | ||
|
|
f947450fbe | ||
|
|
b9255ab4e9 | ||
|
|
1d8c25368a | ||
|
|
b07acb7f68 | ||
|
|
563953088c | ||
|
|
cf2c447c40 | ||
|
|
cd3e2bc2f9 | ||
|
|
db23661546 |
No files matched your search
@@ -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
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.tcoded</groupId>
|
||||
<artifactId>PlayerBountiesPlus</artifactId>
|
||||
<version>1.4.10</version>
|
||||
<version>1.4.17</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>PlayerBountiesPlus</name>
|
||||
|
||||
@@ -12,6 +12,7 @@ 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 org.bstats.bukkit.Metrics;
|
||||
@@ -95,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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
+28
-4
@@ -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();
|
||||
}
|
||||
}
|
||||
+13
-1
@@ -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();
|
||||
}
|
||||
}
|
||||
+7
@@ -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();
|
||||
}
|
||||
}
|
||||
+77
@@ -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());
|
||||
}
|
||||
}
|
||||
+63
@@ -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();
|
||||
}
|
||||
}
|
||||
+63
@@ -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();
|
||||
}
|
||||
}
|
||||
+82
@@ -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();
|
||||
}
|
||||
}
|
||||
+74
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,15 @@ 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 {
|
||||
|
||||
@@ -47,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.stream.Collectors;
|
||||
|
||||
public class BountySetCmd {
|
||||
|
||||
@@ -16,6 +22,15 @@ 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];
|
||||
float amount;
|
||||
try {
|
||||
@@ -63,6 +78,17 @@ public class BountySetCmd {
|
||||
// Apply bounty multiplier
|
||||
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) {
|
||||
sender.sendMessage(plugin.getLang().getColored("command.bounty.set.internal-invalid-value"));
|
||||
@@ -108,4 +134,19 @@ public class BountySetCmd {
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ public class PlaceholderAPIHook extends PlaceholderExpansion implements Placehol
|
||||
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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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,6 +1,7 @@
|
||||
package com.tcoded.playerbountiesplus.listener;
|
||||
|
||||
import com.tcoded.playerbountiesplus.PlayerBountiesPlus;
|
||||
import com.tcoded.playerbountiesplus.event.BountyClaimEvent;
|
||||
import com.tcoded.playerbountiesplus.hook.team.TeamHook;
|
||||
import com.tcoded.playerbountiesplus.manager.BountyDataManager;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -25,11 +26,16 @@ public class DeathListener implements Listener {
|
||||
Player killer = victim.getKiller();
|
||||
|
||||
if (killer != null) {
|
||||
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)) {
|
||||
if (!bountyDataManager.hasBounty(victimId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -42,6 +48,15 @@ public class DeathListener implements Listener {
|
||||
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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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!"
|
||||
|
||||
@@ -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!"
|
||||
@@ -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,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!"
|
||||
|
||||
@@ -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."
|
||||
@@ -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,6 +1,7 @@
|
||||
death:
|
||||
same-team: "&aवह खिलाड़ी जिसे आपने मार डाला है, उसके पास एक सक्रिय इनाम है, लेकिन आप उनकी टीम में हैं!"
|
||||
announce-claimed: "&4&l{killer} ने {victim} के इनाम {bounty} को मांग लिया"
|
||||
no-permission: "&cआपको इनामों का दावा करने की अनुमति नहीं है!"
|
||||
|
||||
command:
|
||||
no-permission: "&cआपके पास इस कमांड का उपयोग करने की अनुमति नहीं है!"
|
||||
|
||||
@@ -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!"
|
||||
|
||||
@@ -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!"
|
||||
|
||||
@@ -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!"
|
||||
|
||||
@@ -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Это недопустимое действие!"
|
||||
|
||||
@@ -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!"
|
||||
|
||||
@@ -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没有设置悬赏!"
|
||||
|
||||
@@ -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
|
||||
Reference in new issue
Block a user