本文整理汇总了Java中ru.tehkode.permissions.PermissionUser类的典型用法代码示例。如果您正苦于以下问题:Java PermissionUser类的具体用法?Java PermissionUser怎么用?Java PermissionUser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PermissionUser类属于ru.tehkode.permissions包,在下文中一共展示了PermissionUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
@Nullable
protected String[] get(Event e) {
Object o = p.getSingle(e);
PermissionUser a = null;
if (o instanceof Player) {
a = PermissionsEx.getUser((Player) o);
}
if (o instanceof OfflinePlayer) {
a = PermissionsEx.getUser(((OfflinePlayer) o).getName());
} else {
a = PermissionsEx.getUser(o.toString());
}
ArrayList<String> farr = new ArrayList<String>();
for (PermissionGroup a1 : a.getParents()) {
farr.add(a1.getName());
}
return farr.toArray(new String[farr.size()]);
}
示例2: onJoin
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@EventHandler
public void onJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
PermissionUser user = PermissionsEx.getUser(player);
if(!user.getOption("displayname").equals(""))
{
player.setDisplayName(user.getOption("displayname"));
}
if(!user.getOption("joinmessage").equals(""))
{
event.setJoinMessage(ChatUtil.formatMessage(event.getPlayer(), user.getOption("joinmessage")));
}
else
{
user.setOption("joinmessage", "&6%player &6has entered the fringe.");
event.setJoinMessage(ChatUtil.formatMessage(event.getPlayer(), user.getOption("joinmessage")));
}
}
示例3: getUsers
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
Set<UUID> getUsers(final Group group) {
Check.notNull(group, "The group cannot be null!");
if (!this.getManager().isPresent()) { return Collections.emptySet(); }
final PermissionGroup pexGroup = this.getGroupMap().get(group);
if (pexGroup == null) { return Collections.emptySet(); }
final HashSet<UUID> uuids = new HashSet<>();
for (final PermissionUser user : pexGroup.getUsers()) {
final String hopefullyUuid = user.getIdentifier();
try {
final UUID uuid = UUID.fromString(hopefullyUuid);
uuids.add(uuid);
}
catch (final IllegalArgumentException ignore) { }
}
return uuids;
}
示例4: getPrefix
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
private static String getPrefix(Player target){
if (Bukkit.getPluginManager().getPlugin("PermissionsEx") == null){
return null;
} else {
PermissionUser user = PermissionsEx.getUser(target);
String prefix = user.getPrefix();
return prefix;
}
}
开发者ID:AdvancedWhois-Developers,项目名称:AdvancedWhoisPlus-Reloaded,代码行数:10,代码来源:AdditionalWhoisSender.java
示例5: execute
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
protected void execute(Event e) {
if (time.getSingle(e).getTicks_i() / 20 > 0) {
for (OfflinePlayer op : offplayers.getAll(e)) {
PermissionUser permuser = PermissionsEx.getPermissionManager().getUser(op.getUniqueId());
permuser.addTimedPermission(perm.getSingle(e), permuser.getPlayer().getWorld().getName(),
(int) time.getSingle(e).getTicks_i() / 20);
}
} else {
return;
}
}
示例6: execute
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
protected void execute(Event e) {
for (OfflinePlayer op : p.getAll(e)) {
PermissionUser permuser = PermissionsEx.getPermissionManager().getUser(op.getUniqueId());
permuser.addPermission(s.getSingle(e));
}
}
示例7: execute
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
protected void execute(Event e) {
for (OfflinePlayer op : offplayers.getAll(e)) {
PermissionUser permuser = PermissionsEx.getPermissionManager().getUser(op.getUniqueId());
permuser.removePermission(s.getSingle(e));
}
}
示例8: execute
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
protected void execute(Event e) {
for (OfflinePlayer op : p.getAll(e)) {
PermissionUser permuser = PermissionsEx.getPermissionManager().getUser(op.getUniqueId());
permuser.addGroup(s.getSingle(e));
}
}
示例9: execute
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
protected void execute(Event e) {
for (OfflinePlayer op : p.getAll(e)) {
PermissionUser permuser = PermissionsEx.getPermissionManager().getUser(op.getUniqueId());
permuser.removeGroup(s.getSingle(e));
}
}
示例10: getGroupUsers
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
/**
* 指定したグループのメンバーのプレイヤー名一覧を取得する
* @param group グループ名
* @return メンバーのプレイヤー名一覧
*/
public ArrayList<String> getGroupUsers(String group) {
ArrayList<String> result = new ArrayList<String>();
PermissionGroup g = PermissionsEx.getPermissionManager().getGroup(group);
for ( PermissionUser user : g.getUsers() ) {
result.add(user.getName());
}
return result;
}
示例11: getPrefix
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
public String getPrefix(Player p) {
PermissionUser user = ru.tehkode.permissions.bukkit.PermissionsEx.getPermissionManager().getUser(p);
if (user == null) {
return "";
}
if (!Config.MULTIPREFIXES.getBoolean()) {
return user.getPrefix(p.getWorld().getName());
}
String personalPrefix = user.getOwnPrefix();
String finalPrefix = "";
if (personalPrefix != null && !personalPrefix.isEmpty()) {
finalPrefix = personalPrefix;
}
PermissionGroup[] userGroups = user.getGroups();
int i = 0;
for (PermissionGroup group : userGroups) {
String groupPrefix = group.getPrefix();
if (groupPrefix != null && !groupPrefix.isEmpty()) {
if(i > 1) {
finalPrefix += " ";
}
finalPrefix += groupPrefix;
i ++;
}
}
return finalPrefix;
}
示例12: getSuffix
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
public String getSuffix(Player p) {
PermissionUser user = ru.tehkode.permissions.bukkit.PermissionsEx.getPermissionManager().getUser(p);
if (user == null) {
return "";
}
if (!Config.MULTISUFFIXES.getBoolean()) {
return user.getSuffix(p.getWorld().getName());
}
String personalSuffix = user.getOwnSuffix();
String finalSuffix = "";
if (personalSuffix != null && !personalSuffix.isEmpty()) {
finalSuffix = personalSuffix;
}
PermissionGroup[] userGroups = user.getGroups();
int i = 0;
for (PermissionGroup group : userGroups) {
String groupSuffix = group.getSuffix();
if (groupSuffix != null && !groupSuffix.isEmpty()) {
if(i > 1) {
finalSuffix += " ";
}
i ++;
finalSuffix += groupSuffix;
}
}
return finalSuffix;
}
示例13: getGroupNames
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
@Override
public String[] getGroupNames(Player p) {
PermissionUser user = ru.tehkode.permissions.bukkit.PermissionsEx.getPermissionManager().getUser(p);
if (user != null) {
return user.getGroupsNames();
}
String[] data = {""};
return data;
}
示例14: getFormats
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
public String[] getFormats(Player p) {
if(pex) {
PermissionUser pu = PermissionsEx.getPermissionManager().getUser(p);
return new String[] { ChatColor.translateAlternateColorCodes('&', pu.getPrefix()), ChatColor.translateAlternateColorCodes('&', pu.getSuffix()) };
}
if(p.isOp())
return new String[] { "§c", "§7> §r" };
return new String[] { "§a", "§7> §r" };
}
示例15: getPrefix
import ru.tehkode.permissions.PermissionUser; //导入依赖的package包/类
public static String getPrefix(Player player)
{
PermissionUser user = PermissionsEx.getUser(player);
if(user.getPrefix() != null)
{
return user.getPrefix();
}
else
{
return "";
}
}