UIHandler#canOpen is public now.
parent
3a39d9bc9b
commit
58e1e9476b
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue