26 Commits
Author SHA1 Message Date
NotAlexNoyle 5063958d17 Use LGPLv3 license 2025-08-12 21:35:08 -04:00
TechnicallyCoded 0bb178f344 Add README (#21) 2025-08-08 22:46:39 +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
44 changed files with 1352 additions and 80 deletions

No files matched your search

+165
View File
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
+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
+6 -18
View File
@@ -6,7 +6,7 @@
<groupId>com.tcoded</groupId>
<artifactId>PlayerBountiesPlus</artifactId>
<version>1.4.9</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>
@@ -131,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>
@@ -150,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>
@@ -176,7 +164,7 @@
<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>
@@ -2,6 +2,7 @@ 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.EconomyHook;
@@ -11,9 +12,9 @@ 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;
@@ -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();
@@ -128,7 +130,7 @@ 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())
);
}
@@ -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();
}
}
@@ -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);
}
}
@@ -99,7 +99,7 @@ public class BountyDataManager {
}
// Save
this.plugin.getFoliaLib().getImpl().runAsync(() -> {
this.plugin.getFoliaLib().getScheduler().runAsync(wt -> {
this.saveBounties();
this.savingAsync.set(false);
+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