1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-19 05:42:01 +01:00

clearownership fix when using target player name without permission

This commit is contained in:
Zrips 2023-02-15 17:51:24 +02:00
parent 2165e1fe68
commit bd430b3cd7
2 changed files with 8 additions and 3 deletions

View File

@ -24,10 +24,15 @@ public class clearownership implements Cmd {
for (String one : args) {
if (!one.contains(":") && jPlayer == null && !sender.getName().equalsIgnoreCase(one) && Jobs.hasPermission(sender, "jobs.command.admin.clearownership", true)) {
if (!one.contains(":") && jPlayer == null) {
jPlayer = Jobs.getPlayerManager().getJobsPlayer(args[0]);
if (jPlayer != null)
if (jPlayer != null) {
if (!sender.getName().equalsIgnoreCase(one) && !Jobs.hasPermission(sender, "jobs.command.admin.clearownership", true))
return true;
continue;
}
}
if (one.contains(":") && location == null) {

View File

@ -279,7 +279,7 @@ public class ShopManager {
player.sendMessage(Jobs.getLanguage().getMessage("command.shop.info.Paid", "%amount%", item.getPointPrice()));
}
if (item.getVaultPrice() > 0) {
jPlayer.withdraw(item.getPointPrice());
jPlayer.withdraw(item.getVaultPrice());
player.sendMessage(Jobs.getLanguage().getMessage("command.shop.info.Paid", "%amount%", Jobs.getEconomy().getEconomy().format(item.getVaultPrice())));
}
openShopGui(player, page);