本文整理汇总了Java中ru.tehkode.permissions.PermissionUser.getOption方法的典型用法代码示例。如果您正苦于以下问题:Java PermissionUser.getOption方法的具体用法?Java PermissionUser.getOption怎么用?Java PermissionUser.getOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ru.tehkode.permissions.PermissionUser
的用法示例。
在下文中一共展示了PermissionUser.getOption方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: permlistCmd
import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
@CommandHandler("permlist")
@Permission("craftoplugin.permission.permlist")
public void permlistCmd(CommandSender cs, String[] args) throws IOException {
if (!this.handler.isPresent()) { CraftoMessenger.sendFailure(cs, "handler not present"); return; }
Path p = FileUtils.getCraftoPluginDirectory().resolve("perm-user-list.txt");
Files.deleteIfExists(p);
StringBuilder file = new StringBuilder();
Set<PermissionUser> list = this.handler.get().getAllUsers();
cs.sendMessage("users: " + list.size());
for (PermissionUser user : list) {
if (!Check.isUUID(user.getIdentifier())) {
cs.sendMessage("Skipping " + user.getName() + " because identifier: " + user.getIdentifier());
continue;
}
String name = user.getOption("name");
UUID uuid = UUID.fromString(user.getIdentifier());
String group = getGroup(uuid).getName();
cs.sendMessage(name + "," + uuid + "," + group);
file.append(name + "," + uuid + "," + group).append('\n');
}
Files.write(p, file.toString().getBytes());
}
示例2: getMessageFormat
import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
@Override
public String getMessageFormat(Player p) {
PermissionUser user = ru.tehkode.permissions.bukkit.PermissionsEx.getPermissionManager().getUser(p);
return user.getOption(Config.FORMAT.getPath(), p.getWorld().getName(), Config.FORMAT.getString());
}
示例3: getGlobalMessageFormat
import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
@Override
public String getGlobalMessageFormat(Player p) {
PermissionUser user = ru.tehkode.permissions.bukkit.PermissionsEx.getPermissionManager().getUser(p);
return user.getOption(Config.GLOBALFORMAT.getPath(), p.getWorld().getName(), Config.GLOBALFORMAT.getString());
}