1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-21 23:01:20 +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,11 +24,16 @@ public class clearownership implements Cmd {
for (String one : args) { 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]); 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; continue;
} }
}
if (one.contains(":") && location == null) { if (one.contains(":") && location == null) {
location = one; location = one;

View File

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