mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-02-10 07:21:20 +01:00
Fix Vault-Accountcheck for renamed player (#106)
This commit is contained in:
parent
c5c9e96b13
commit
21815197c6
@ -20,6 +20,7 @@ public class Messages {
|
||||
@PrecededBySpace
|
||||
public static String CLIENT_DEPOSIT_FAILED = "Money deposit to your account failed!";
|
||||
public static String SHOP_DEPOSIT_FAILED = "Money deposit to shop owner failed!";
|
||||
public static String NO_ECONOMY_ACCOUNT = "Economy account from shop owner doesn't exist!";
|
||||
|
||||
@PrecededBySpace
|
||||
public static String NO_BUYING_HERE = "You can't buy here!";
|
||||
|
@ -139,15 +139,19 @@ public class PlayerInteract implements Listener {
|
||||
String prices = sign.getLine(PRICE_LINE);
|
||||
String material = sign.getLine(ITEM_LINE);
|
||||
|
||||
Account account = NameManager.getAccountFromShortName(name);
|
||||
if (account == null)
|
||||
Account account = NameManager.getLastAccountFromShortName(name);
|
||||
if (account == null) {
|
||||
player.sendMessage(Messages.prefix(Messages.PLAYER_NOT_FOUND));
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean adminShop = ChestShopSign.isAdminShop(sign);
|
||||
|
||||
// check if player exists in economy
|
||||
if(!adminShop && !VaultListener.getProvider().hasAccount(account.getName()))
|
||||
if(!adminShop && !VaultListener.getProvider().hasAccount(account.getName())) {
|
||||
player.sendMessage(Messages.prefix(Messages.NO_ECONOMY_ACCOUNT));
|
||||
return null;
|
||||
}
|
||||
|
||||
Action buy = Properties.REVERSE_BUTTONS ? LEFT_CLICK_BLOCK : RIGHT_CLICK_BLOCK;
|
||||
double price = (action == buy ? PriceUtil.getBuyPrice(prices) : PriceUtil.getSellPrice(prices));
|
||||
|
Loading…
Reference in New Issue
Block a user