本文整理匯總了Java中org.bukkit.permissions.Permission.addParent方法的典型用法代碼示例。如果您正苦於以下問題:Java Permission.addParent方法的具體用法?Java Permission.addParent怎麽用?Java Permission.addParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.permissions.Permission
的用法示例。
在下文中一共展示了Permission.addParent方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: calcPermissions
import org.bukkit.permissions.Permission; //導入方法依賴的package包/類
@Override
public void calcPermissions() {
Permission perm = DownloadableUpdateChecker.this.getPermission();
if(perm != null) {
setPermission(perm);
if (getParent() != null)
perm.addParent(getParent().getAnyPerm(), true);
}
}
示例2: calculatePermissions
import org.bukkit.permissions.Permission; //導入方法依賴的package包/類
public void calculatePermissions() {
WithPermission perm = getClass().getAnnotation(WithPermission.class);
if (perm != null) {
String path;
if (parent != null) {
if (parent.getPermission() == null)
return;
path = parent.getPermission().getName() + '.' + perm.value();
} else path = perm.value();
permission = new Permission(path, perm.value(), perm.defaultPermission().get(this));
if (parent != null)
permission.addParent(parent.getAnyPerm(), true);
}
}
示例3: FunctionCommandParameter
import org.bukkit.permissions.Permission; //導入方法依賴的package包/類
public FunctionCommandParameter(FunctionCommand command, Parameter parameter) {
super(command);
WithName nameAnnotation = parameter.getAnnotation(WithName.class);
if (nameAnnotation != null) {
setName(nameAnnotation.value());
}
WithOptional optionalAnnotation = parameter.getAnnotation(WithOptional.class);
if (optionalAnnotation != null) {
setOptional(true);
setDefaultValue(optionalAnnotation.value());
}
WithPermission permissionAnnotation = parameter.getAnnotation(WithPermission.class);
if (permissionAnnotation != null) {
StringJoiner path = new StringJoiner(".");
if (command.getPermission() != null) {
path.add(command.getPermission().getName());
}
path.add(permissionAnnotation.value());
Permission permission = new Permission(path.toString());
if (command.getPermission() != null) {
permission.addParent(command.getPermission(), true);
}
permission.setDescription(permissionAnnotation.value());
setPermission(permission);
}
this.parameter = parameter;
}
示例4: createChannelPermission
import org.bukkit.permissions.Permission; //導入方法依賴的package包/類
protected Permission createChannelPermission(Party party) {
Permission permission = new Permission("pgm.chat.team." + this.match.getId() + '-' + party.hashCode() + ".receive", PermissionDefault.FALSE);
getMatch().getPluginManager().addPermission(permission);
permission.addParent(matchListeningPermission, true);
return permission;
}