UIHandler#canOpen is public now.

master
blablubbabc 2020-10-28 00:28:08 +01:00
parent 3a39d9bc9b
commit 58e1e9476b
11 changed files with 11 additions and 11 deletions

View File

@ -11,7 +11,7 @@ Date format: (YYYY-MM-DD)
* Fixed: Some messages would print an empty line when set to an empty text, instead of being disabled.
Internal:
* Internal API: UIHandler#canOpen has an additional 'silent' flag now.
* Internal API: UIHandler#canOpen is public and has an additional 'silent' flag now.
* Editor UIs are setup lazily now, only when required for the first time.
Internal:

View File

@ -30,7 +30,7 @@ public abstract class AbstractAdminShopkeeper extends AbstractShopkeeper impleme
}
@Override
protected boolean canOpen(Player player, boolean silent) {
public boolean canOpen(Player player, boolean silent) {
if (!super.canOpen(player, silent)) return false;
// Check trading permission:

View File

@ -25,7 +25,7 @@ public class RegularAdminShopEditorHandler extends EditorHandler {
}
@Override
protected boolean canOpen(Player player, boolean silent) {
public boolean canOpen(Player player, boolean silent) {
if (!super.canOpen(player, silent)) return false;
return this.getShopkeeper().getType().hasPermission(player);
}

View File

@ -28,7 +28,7 @@ public abstract class PlayerShopEditorHandler extends EditorHandler {
}
@Override
protected boolean canOpen(Player player, boolean silent) {
public boolean canOpen(Player player, boolean silent) {
if (!super.canOpen(player, silent)) return false;
return (this.getShopkeeper().isOwner(player) || PermissionUtils.hasPermission(player, ShopkeepersPlugin.BYPASS_PERMISSION));
}

View File

@ -31,7 +31,7 @@ public abstract class PlayerShopTradingHandler extends TradingHandler {
}
@Override
protected boolean canOpen(Player player, boolean silent) {
public boolean canOpen(Player player, boolean silent) {
if (!super.canOpen(player, silent)) return false;
PlayerShopkeeper shopkeeper = this.getShopkeeper();

View File

@ -68,7 +68,7 @@ public abstract class UIHandler {
* <code>false</code> to inform the player when the access is denied
* @return <code>true</code> if the given player is allowed to open this interface
*/
protected abstract boolean canOpen(Player player, boolean silent);
public abstract boolean canOpen(Player player, boolean silent);
/**
* Opens the interface window for the given player.

View File

@ -41,7 +41,7 @@ class UIListener implements Listener {
}
@Override
protected boolean canOpen(Player player, boolean silent) {
public boolean canOpen(Player player, boolean silent) {
return false;
}
};

View File

@ -638,7 +638,7 @@ public abstract class AbstractEditorHandler extends UIHandler {
}
@Override
protected boolean canOpen(Player player, boolean silent) {
public boolean canOpen(Player player, boolean silent) {
assert player != null;
// Permission for the type of shopkeeper is checked in the AdminShopkeeper specific EditorHandler.
// Owner is checked in the PlayerShopkeeper specific EditorHandler.

View File

@ -22,7 +22,7 @@ public abstract class HiringHandler extends AbstractShopkeeperUIHandler {
}
@Override
protected boolean canOpen(Player player, boolean silent) {
public boolean canOpen(Player player, boolean silent) {
assert player != null;
// Check for hire permission:
if (!PermissionUtils.hasPermission(player, ShopkeepersPlugin.HIRE_PERMISSION)) {

View File

@ -124,7 +124,7 @@ public class TradingHandler extends AbstractShopkeeperUIHandler {
}
@Override
protected boolean canOpen(Player player, boolean silent) {
public boolean canOpen(Player player, boolean silent) {
assert player != null;
if (!PermissionUtils.hasPermission(player, ShopkeepersPlugin.TRADE_PERMISSION)) {
if (!silent) {

View File

@ -60,7 +60,7 @@ public final class VillagerEditorHandler extends AbstractEditorHandler {
}
@Override
protected boolean canOpen(Player player, boolean silent) {
public boolean canOpen(Player player, boolean silent) {
assert player != null;
// Check permission:
if (villager instanceof WanderingTrader) {