本文整理汇总了Java中ru.tehkode.permissions.bukkit.PermissionsEx类的典型用法代码示例。如果您正苦于以下问题:Java PermissionsEx类的具体用法?Java PermissionsEx怎么用?Java PermissionsEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PermissionsEx类属于ru.tehkode.permissions.bukkit包,在下文中一共展示了PermissionsEx类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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()]);
}
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:26,代码来源:ExprPexGroupOf.java
示例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")));
}
}
开发者ID:Zingalicious,项目名称:Songlantern,代码行数:20,代码来源:JoinListener.java
示例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));
}
}
}
开发者ID:Realmcraft,项目名称:Vault,代码行数:20,代码来源:Permission_PermissionsEx.java
示例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;
}
}
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:14,代码来源:EffGiveTimedPexPerm.java
示例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));
}
}
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:8,代码来源:EffAddPexPerm.java
示例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));
}
}
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:8,代码来源:EffRemovePexPerm.java
示例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));
}
}
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:9,代码来源:EffPexAddgroup.java
示例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) {
}
}
}
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:14,代码来源:ExprPexGroupRank.java
示例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));
}
}
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:9,代码来源:EffPexRemoveGroupFromPlayer.java
示例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) {
}
}
}
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:12,代码来源:ExprPexGroupRankLadder.java
示例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();
}
开发者ID:ucchyocean,项目名称:UndineMailer,代码行数:13,代码来源:PermissionsExBridge.java
示例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;
}
开发者ID:ucchyocean,项目名称:UndineMailer,代码行数:16,代码来源:PermissionsExBridge.java
示例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;
}
开发者ID:ucchyocean,项目名称:UndineMailer,代码行数:18,代码来源:PermissionsExBridge.java
示例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;
}
开发者ID:ucchyocean,项目名称:UndineMailer,代码行数:14,代码来源:PermissionsExBridge.java
示例16: setupPermissionsEx
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的package包/类
/**
* Called by the constructor to help initialize and set up PermissionsEX
*/
private void setupPermissionsEx() {
if (Bukkit.getPluginManager().isPluginEnabled(permissionExName)) {
permissionsExHandler = PermissionsEx.getPermissionManager();
if (permissionsExHandler == null) {
log.warn(Reporter.getDefaultConsolePrefix() + "Failed to obtain PermissionsEx handler.");
log.warn(Reporter.getDefaultConsolePrefix() + "PermissionsEx support could not be enabled.");
} else {
type = PermissionType.PermissionsEx;
}
}
}
开发者ID:KabOOm356,项目名称:Reporter,代码行数:16,代码来源:PermissionHandler.java
示例17: getFormats
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的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" };
}
开发者ID:maker56,项目名称:UltimateSurvivalGames,代码行数:11,代码来源:ChatListener.java
示例18: getPrefix
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的package包/类
public static String getPrefix(Player player)
{
PermissionUser user = PermissionsEx.getUser(player);
if(user.getPrefix() != null)
{
return user.getPrefix();
}
else
{
return "";
}
}
开发者ID:Zingalicious,项目名称:Cordstone,代码行数:13,代码来源:ChatUtil.java
示例19: getSuffix
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的package包/类
public static String getSuffix(Player player)
{
PermissionUser user = PermissionsEx.getUser(player);
if(user.getSuffix() != null)
{
return user.getSuffix();
}
else
{
return "";
}
}
开发者ID:Zingalicious,项目名称:Cordstone,代码行数:13,代码来源:ChatUtil.java
示例20: formatMessage
import ru.tehkode.permissions.bukkit.PermissionsEx; //导入依赖的package包/类
public static String formatMessage(Player player, String message)
{
PermissionUser user = PermissionsEx.getUser(player);
message = message.replace("%prefix", user.getPrefix());
message = message.replace("%suffix", user.getSuffix());
message = message.replace("%player", player.getDisplayName());
message = formatColours(message);
return message;
}
开发者ID:Zingalicious,项目名称:Cordstone,代码行数:11,代码来源:ChatUtil.java
注:本文中的ru.tehkode.permissions.bukkit.PermissionsEx类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论