当前位置: 首页>>代码示例>>Java>>正文


Java PermissionDescription.Builder方法代码示例

本文整理汇总了Java中org.spongepowered.api.service.permission.PermissionDescription.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java PermissionDescription.Builder方法的具体用法?Java PermissionDescription.Builder怎么用?Java PermissionDescription.Builder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.spongepowered.api.service.permission.PermissionDescription的用法示例。


在下文中一共展示了PermissionDescription.Builder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: assign

import org.spongepowered.api.service.permission.PermissionDescription; //导入方法依赖的package包/类
@Nonnull
@Override
public PermissionDescription.Builder assign(@Nonnull String permission, boolean value) {
    Objects.requireNonNull(permission, "permission");
    this.roles.put(permission, Tristate.fromBoolean(value));
    return this;
}
 
开发者ID:lucko,项目名称:LuckPerms,代码行数:8,代码来源:LPDescriptionBuilder.java

示例2: newDescriptionBuilder

import org.spongepowered.api.service.permission.PermissionDescription; //导入方法依赖的package包/类
@Override
public PermissionDescription.Builder newDescriptionBuilder(@Nonnull Object o) {
    Optional<PluginContainer> container = Sponge.getGame().getPluginManager().fromInstance(o);
    if (!container.isPresent()) {
        throw new IllegalArgumentException("Couldn't find a plugin container for " + o.getClass().getSimpleName());
    }

    return new LPDescriptionBuilder(this.handle, container.get());
}
 
开发者ID:lucko,项目名称:LuckPerms,代码行数:10,代码来源:PermissionServiceProxy.java

示例3: newDescriptionBuilder

import org.spongepowered.api.service.permission.PermissionDescription; //导入方法依赖的package包/类
@Override
public Optional<PermissionDescription.Builder> newDescriptionBuilder(@Nonnull Object o) {
    Optional<PluginContainer> container = Sponge.getGame().getPluginManager().fromInstance(o);
    if (!container.isPresent()) {
        throw new IllegalArgumentException("Couldn't find a plugin container for " + o.getClass().getSimpleName());
    }

    return Optional.of(new LPDescriptionBuilder(this.handle, container.get()));
}
 
开发者ID:lucko,项目名称:LuckPerms,代码行数:10,代码来源:PermissionServiceProxy.java

示例4: newDescriptionBuilder

import org.spongepowered.api.service.permission.PermissionDescription; //导入方法依赖的package包/类
@Override
public PermissionDescription.Builder newDescriptionBuilder(final Object instance) {
	Optional<PluginContainer> container = this.plugin.getGame().getPluginManager().fromInstance(instance);
	if (!container.isPresent()) {
		throw new IllegalArgumentException("Couldn't find a plugin container for " + instance.getClass().getSimpleName());
	}
	return new EPPermissionDescription.Builder(this, container.get());
}
 
开发者ID:EverCraft,项目名称:EverPermissions,代码行数:9,代码来源:EPPermissionService.java

示例5: register

import org.spongepowered.api.service.permission.PermissionDescription; //导入方法依赖的package包/类
@Override
public void register(Permission perm) {
    if (this.permissions.stream().filter(p -> p.get().equalsIgnoreCase(perm.get())).count() > 0) return;
    this.permissions.add(perm);
    org.spongepowered.api.service.permission.PermissionService service = Sponge.getServiceManager().provide(org.spongepowered.api.service.permission.PermissionService.class).get();
    Optional<PermissionDescription.Builder> builder = service.newDescriptionBuilder(UltimateCore.get());
    if (!builder.isPresent()) return;
    builder.get().id(perm.get()).description(perm.getDescription()).register();
}
 
开发者ID:Bammerbom,项目名称:UltimateCore,代码行数:10,代码来源:UCPermissionService.java


注:本文中的org.spongepowered.api.service.permission.PermissionDescription.Builder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。