本文整理匯總了Java中vg.civcraft.mc.namelayer.permission.PermissionType.getPermission方法的典型用法代碼示例。如果您正苦於以下問題:Java PermissionType.getPermission方法的具體用法?Java PermissionType.getPermission怎麽用?Java PermissionType.getPermission使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vg.civcraft.mc.namelayer.permission.PermissionType
的用法示例。
在下文中一共展示了PermissionType.getPermission方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isPlayerInUnpermittedBastion
import vg.civcraft.mc.namelayer.permission.PermissionType; //導入方法依賴的package包/類
@Override
public boolean isPlayerInUnpermittedBastion(Player player) {
if (!isBastionEnabled()) {
return false;
}
try {
final BastionBlockManager manager = Bastion.getBastionManager();
Set<BastionBlock> bastions = manager.getBlockingBastions(player.getLocation());
PermissionType perm = PermissionType.getPermission(NameLayerPermissions.BASTION_ALLOW_EXILED);
for (BastionBlock bastion : bastions) {
if (!bastion.permAccess(player, perm)) {
return true;
}
}
} catch(Exception ex) {
ex.printStackTrace();
}
return false;
}
示例2: getPlayerInUnpermittedBastion
import vg.civcraft.mc.namelayer.permission.PermissionType; //導入方法依賴的package包/類
@Override
public List<BastionWrapper> getPlayerInUnpermittedBastion(Player player) {
if (!isBastionEnabled()) {
return new ArrayList<>();
}
try {
final BastionBlockManager manager = Bastion.getBastionManager();
Set<BastionBlock> bastions = manager.getBlockingBastions(player.getLocation());
List<BastionWrapper> wrapper = new LinkedList<>();
PermissionType perm = PermissionType.getPermission(NameLayerPermissions.BASTION_ALLOW_EXILED);
for (BastionBlock bastion : bastions) {
if (!bastion.permAccess(player, perm)) {
wrapper.add(new BastionWrapper(bastion));
}
}
return wrapper;
} catch(Exception ex) {
ex.printStackTrace();
}
return new ArrayList<>();
}
示例3: hasBastionAccess
import vg.civcraft.mc.namelayer.permission.PermissionType; //導入方法依賴的package包/類
private boolean hasBastionAccess(List<Player> players, Block block, ICitadel citadel) {
PermissionType perm = PermissionType.getPermission(PERMISSION_UNDRAW);
Location loc = block.getLocation();
Set<BastionBlock> bastions = this.blockManager.getBlockingBastions(loc);
if (bastions == null) return true;
ReinforcementManager reinManager = Citadel.getReinforcementManager();
Group citadelGroup = citadel.getGroupName() != null ? GroupManager.getGroup(citadel.getGroupName()) : null;
for(BastionBlock bastion : bastions) {
if(bastion.getType().isOnlyDirectDestruction() || !bastion.inField(loc)) continue;
Reinforcement rein = reinManager.getReinforcement(bastion.getLocation());
PlayerReinforcement playerRein = rein != null && (rein instanceof PlayerReinforcement) ? (PlayerReinforcement)rein : null;
if(playerRein == null) continue;
if(players == null) return false;
if(citadel.useJukeAlert() && !citadel.getGroupName().equalsIgnoreCase(playerRein.getGroup().getName())) {
return false;
} else if(citadelGroup == null || !this.groupManager.isAllowedGroup(playerRein.getGroup(), citadelGroup)) {
boolean hasAccess = false;
for (Player player : players) {
if (bastion.permAccess(player, perm)) {
hasAccess = true;
break;
}
}
if (!hasAccess) return false;
}
}
return true;
}