本文整理汇总了Java中ru.tehkode.permissions.bukkit.PermissionsEx类的典型用法代码示例。如果您正苦于以下问题:Java PermissionsEx类的具体用法?Java PermissionsEx怎么用?Java PermissionsEx使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PermissionsEx类属于ru.tehkode.permissions.bukkit包,在下文中一共展示了PermissionsEx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的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.bukkit.PermissionsEx; //导入依赖的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: onPluginEnable
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR)
public void onPluginEnable(PluginEnableEvent event) {
if (permission.permission == null) {
Plugin perms = plugin.getServer().getPluginManager().getPlugin("PermissionsEx");
if (perms != null) {
try {
if (Double.valueOf(perms.getDescription().getVersion()) < 1.16) {
log.info(String.format("[%s][Permission] %s below 1.16 is not compatible with Vault! Falling back to SuperPerms only mode. PLEASE UPDATE!", plugin.getDescription().getName(), name));
return;
}
} catch (NumberFormatException e) {
// Do nothing
}
permission.permission = (PermissionsEx) perms;
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
}
}
}
示例4: getPrefix
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的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.bukkit.PermissionsEx; //导入依赖的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.bukkit.PermissionsEx; //导入依赖的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.bukkit.PermissionsEx; //导入依赖的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.bukkit.PermissionsEx; //导入依赖的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: change
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的package包/类
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode) {
if (mode == Changer.ChangeMode.SET) {
try {
Number first = (Number) delta[0];
Integer second = first.intValue();
PermissionsEx.getPermissionManager().getGroup(s.getSingle(e)).setRank(second);
} catch (NullPointerException ex) {
}
}
}
示例10: execute
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的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));
}
}
示例11: change
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的package包/类
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode) {
if (mode == Changer.ChangeMode.SET) {
try {
PermissionsEx.getPermissionManager().getGroup(s.getSingle(e)).setRankLadder((String) delta[0]);
} catch (NullPointerException ex) {
}
}
}
示例12: load
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的package包/类
/**
* PermissionsExをロードする
* @param plugin PermissionsExのプラグインインスタンス
* @return ロードしたbridgeのインスタンス
*/
public static PermissionsExBridge load(Plugin plugin) {
if ( plugin == null ) return null;
if ( !(plugin instanceof PermissionsEx) ) {
return null;
}
return new PermissionsExBridge();
}
示例13: getGroupOptionAsBoolean
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的package包/类
/**
* グループのオプション値を、Booleanとして取得する
* @param group グループ名
* @param option オプション名
* @return オプションの値
*/
public boolean getGroupOptionAsBoolean(String group, String option) {
PermissionGroup g = PermissionsEx.getPermissionManager().getGroup(group);
if ( g == null ) return false;
String value = g.getOption(option);
if ( value != null && value.equals("true") ) {
return true;
}
return false;
}
示例14: getGroupNamesByBooleanOption
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的package包/类
/**
* 指定のオプション値がtrueになっているグループのグループ名を取得する
* @param option オプション名
* @return 指定のオプションが設定されているグループのグループ名一覧
*/
public ArrayList<String> getGroupNamesByBooleanOption(String option) {
ArrayList<String> result = new ArrayList<String>();
for ( PermissionGroup group : PermissionsEx.getPermissionManager().getGroupList() ) {
String value = group.getOption(option);
if ( value == null || !value.equals("true") ) {
continue;
}
result.add(group.getName());
}
Collections.sort(result);
return result;
}
示例15: getGroupUsers
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的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;
}