mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-02-03 12:01:22 +01:00
Allow admins to use the admin shop in all cases
This fixes issues with the auto complete right click functionality not working with admin shops
This commit is contained in:
parent
12d2107ce1
commit
96b5a675d6
@ -22,7 +22,7 @@ public class NameChecker implements Listener {
|
|||||||
String name = event.getSignLine(NAME_LINE);
|
String name = event.getSignLine(NAME_LINE);
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if (name.isEmpty() || (!NameManager.canUseName(player, name) && !Permission.has(player, Permission.ADMIN))) {
|
if (name.isEmpty() || !NameManager.canUseName(player, name)) {
|
||||||
Account account = NameManager.getAccount(player.getName());
|
Account account = NameManager.getAccount(player.getName());
|
||||||
if (account != null) {
|
if (account != null) {
|
||||||
event.setSignLine(NAME_LINE, account.getShortName());
|
event.setSignLine(NAME_LINE, account.getShortName());
|
||||||
|
@ -58,7 +58,7 @@ public class RestrictedSign implements Listener {
|
|||||||
|
|
||||||
Sign sign = (Sign) connectedSign.getState();
|
Sign sign = (Sign) connectedSign.getState();
|
||||||
|
|
||||||
if (!ChestShopSign.canAccess(player, sign) && !Permission.has(player, ADMIN)) {
|
if (!ChestShopSign.canAccess(player, sign)) {
|
||||||
dropSignAndCancelEvent(event);
|
dropSignAndCancelEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ public class NameManager {
|
|||||||
|
|
||||||
public static boolean canUseName(Player player, String name) {
|
public static boolean canUseName(Player player, String name) {
|
||||||
if (ChestShopSign.isAdminShop(name)) {
|
if (ChestShopSign.isAdminShop(name)) {
|
||||||
return false;
|
return Permission.has(player, Permission.ADMIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Permission.otherName(player, name)) {
|
if (Permission.otherName(player, name)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user