• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java OverloadedWorldHolder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder的典型用法代码示例。如果您正苦于以下问题:Java OverloadedWorldHolder类的具体用法?Java OverloadedWorldHolder怎么用?Java OverloadedWorldHolder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OverloadedWorldHolder类属于org.anjocaido.groupmanager.dataholder包,在下文中一共展示了OverloadedWorldHolder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: changeUserGroup

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
public static boolean changeUserGroup(Player player, String groupName) {
    OverloadedWorldHolder dataHolder = null;

    if (player != null) {
        dataHolder = ((GroupManager) Bukkit.getPluginManager().getPlugin("GroupManager")).getWorldsHolder().getWorldData(player);
    }

    if (dataHolder != null) {
        Group auxGroup = dataHolder.getGroup(groupName);
        User auxUser = dataHolder.getUser(player.getName());
        if (auxGroup != null && auxUser != null) {
            auxUser.setGroup(auxGroup);
            return true;
        }
    }
    return false;
}
 
开发者ID:AlmuraDev,项目名称:AlmuraForgeBridge,代码行数:18,代码来源:UserUtil.java


示例2: addUserPermission

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
public static boolean addUserPermission(Player player, String permission) {
    OverloadedWorldHolder dataHolder = null;

    if (player != null) {
        dataHolder = ((GroupManager) Bukkit.getPluginManager().getPlugin("GroupManager")).getWorldsHolder().getWorldData(player);
    }

    if (dataHolder != null) {
        User auxUser = dataHolder.getUser(player.getName());
        if (!auxUser.hasSamePermissionNode(permission)) {
            auxUser.addPermission(permission);
            return true;
        }
    }
    return false;
}
 
开发者ID:AlmuraDev,项目名称:AlmuraForgeBridge,代码行数:17,代码来源:UserUtil.java


示例3: playerAdd

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
public boolean playerAdd(String worldName, String playerName, String permission) {
    OverloadedWorldHolder owh;
    if (worldName == null) {
        owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
    } else {
        owh = groupManager.getWorldsHolder().getWorldData(worldName);
    }
    if (owh == null) {
        return false;
    }

    User user = owh.getUser(playerName);
    if (user == null) {
        return false;
    }

    user.addPermission(permission);
    Player p = Bukkit.getPlayer(playerName);
    if (p != null) {
        GroupManager.BukkitPermissions.updatePermissions(p);
    }
    return true;
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:25,代码来源:Permission_GroupManager.java


示例4: playerRemove

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
public boolean playerRemove(String worldName, String playerName, String permission) {
    OverloadedWorldHolder owh;
    if (worldName == null) {
        owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
    } else {
        owh = groupManager.getWorldsHolder().getWorldData(worldName);
    }
    if (owh == null) {
        return false;
    }

    User user = owh.getUser(playerName);
    if (user == null) {
        return false;
    }

    user.removePermission(permission);
    Player p = Bukkit.getPlayer(playerName);
    if (p != null) {
        GroupManager.BukkitPermissions.updatePermissions(p);
    }
    return true;
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:25,代码来源:Permission_GroupManager.java


示例5: groupHas

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
public boolean groupHas(String worldName, String groupName, String permission) {
    OverloadedWorldHolder owh;
    if (worldName == null) {
        owh = groupManager.getWorldsHolder().getDefaultWorld();
    } else {
        owh = groupManager.getWorldsHolder().getWorldData(worldName);
    }
    if (owh == null) {
        return false;
    }

    Group group = owh.getGroup(groupName);
    if (group == null) {
        return false;
    }

    return group.hasSamePermissionNode(permission);
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:20,代码来源:Permission_GroupManager.java


示例6: groupAdd

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
public boolean groupAdd(String worldName, String groupName, String permission) {
    OverloadedWorldHolder owh;
    if (worldName == null) {
        owh = groupManager.getWorldsHolder().getDefaultWorld();
    } else {
        owh = groupManager.getWorldsHolder().getWorldData(worldName);
    }
    if (owh == null) {
        return false;
    }

    Group group = owh.getGroup(groupName);
    if (group == null) {
        return false;
    }

    group.addPermission(permission);
    return true;
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:21,代码来源:Permission_GroupManager.java


示例7: groupRemove

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
public boolean groupRemove(String worldName, String groupName, String permission) {
    OverloadedWorldHolder owh;
    if (worldName == null) {
        owh = groupManager.getWorldsHolder().getDefaultWorld();
    } else {
        owh = groupManager.getWorldsHolder().getWorldData(worldName);
    }
    if (owh == null) {
        return false;
    }

    Group group = owh.getGroup(groupName);
    if (group == null) {
        return false;
    }

    group.removePermission(permission);
    return true;
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:21,代码来源:Permission_GroupManager.java


示例8: getGroups

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
public String[] getGroups() {
    Set<String> groupNames = new HashSet<String>();
    for (World world : Bukkit.getServer().getWorlds()) {
        OverloadedWorldHolder owh = groupManager.getWorldsHolder().getWorldData(world.getName());
        if (owh == null) {
            continue;
        }
        Collection<Group> groups = owh.getGroupList();
        if (groups == null) {
            continue;
        }
        for (Group group : groups) {
            groupNames.add(group.getName());
        }
    }
    return groupNames.toArray(new String[0]);
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:19,代码来源:Permission_GroupManager.java


示例9: setPlayerValue

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
private void setPlayerValue(String worldName, String playerName, String node, Object value) {
    OverloadedWorldHolder owh;
    if (worldName == null) {
        owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
    } else {
        owh = groupManager.getWorldsHolder().getWorldData(worldName);
    }
    if (owh == null) {
        return;
    }
    User user = owh.getUser(playerName);
    if (user == null) {
        return;
    }
    user.getVariables().addVar(node, value);
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:17,代码来源:Chat_GroupManager.java


示例10: setGroupValue

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
private void setGroupValue(String worldName, String groupName, String node, Object value) {
    OverloadedWorldHolder owh;
    if (worldName == null) {
        owh = groupManager.getWorldsHolder().getDefaultWorld();
    } else {
        owh = groupManager.getWorldsHolder().getWorldData(worldName);
    }
    if (owh == null) {
        return;
    }
    Group group = owh.getGroup(groupName);
    if (group == null) {
        return;
    }
    group.getVariables().addVar(node, value);
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:17,代码来源:Chat_GroupManager.java


示例11: getWorldData

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
/**
 * Returns the dataHolder for the given world. If the world is not on the worlds list, returns the default world
 * holder.
 *
 * Mirrors return their parent world data. If no mirroring data it returns the default world.
 *
 * @param worldName
 * @return OverloadedWorldHolder
 */
public OverloadedWorldHolder getWorldData(String worldName)
{

	String worldNameLowered = worldName.toLowerCase();

	// Find this worlds data
	if (worldsData.containsKey(worldNameLowered))
	{
		return getUpdatedWorldData(worldNameLowered);
	}

	// Oddly no data source was found for this world so return the default.
	GroupManager.logger.finest("Requested world " + worldName + " not found or badly mirrored. Returning default world...");
	return getDefaultWorld();
}
 
开发者ID:Curtis3321,项目名称:Essentials,代码行数:25,代码来源:WorldsHolder.java


示例12: execute

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
protected void execute(Event e) {
	final Plugin GMplugin = Bukkit.getPluginManager().getPlugin("GroupManager");
	GroupManager GM = (GroupManager) GMplugin;
	OverloadedWorldHolder handler = null;

	if (player == null) {
		return;
	}
	;

	if (player.getSingle(e).isOnline()) {
		handler = GM.getWorldsHolder().getWorldDataByPlayerName(player.getSingle(e).getName());
	} else {
		handler = GM.getWorldsHolder().getDefaultWorld();
	}

	if (world != null) {
		handler = GM.getWorldsHolder().getWorldData(world.getSingle(e).getName());
	}
	for (Entry<String, User> a : handler.getUsers().entrySet()) {
		if (player.getSingle(e).getUniqueId().toString().equals(a.getValue().getUUID().toString())) {
			a.getValue().setGroup(new Group(group.getSingle(e)));
			a.getValue().setLastName(player.getSingle(e).getName());
			break;

		}
	}
	GM.getWorldsHolder().saveChanges();
	GM.getWorldsHolder().reloadAll();

}
 
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:33,代码来源:EffGroupManagerSetGroupOfPlayer.java


示例13: execute

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
protected void execute(Event e) {
	final Plugin GMplugin = Bukkit.getPluginManager().getPlugin("GroupManager");
	final GroupManager GM = (GroupManager) GMplugin;
	OverloadedWorldHolder handler = null;

	if (player == null) {
		return;
	}
	;

	if (player.getSingle(e).isOnline()) {
		handler = GM.getWorldsHolder().getWorldDataByPlayerName(player.getSingle(e).getName());
	} else {
		handler = GM.getWorldsHolder().getDefaultWorld();
	}

	if (world != null) {
		handler = GM.getWorldsHolder().getWorldData(world.getSingle(e).getName());
	}
	for (Entry<String, User> a : handler.getUsers().entrySet()) {
		if (player.getSingle(e).getUniqueId().toString().equals(a.getValue().getUUID().toString())) {
			try {
				a.getValue().removePermission(perm.getSingle(e));
				a.getValue().setLastName(player.getSingle(e).getName());
			} catch (NullPointerException ex) {
				return;
			}
			break;

		}
	}
	GM.getWorldsHolder().saveChanges();
	GM.getWorldsHolder().reloadAll();

}
 
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:37,代码来源:EffGroupManagerRemovePermission.java


示例14: execute

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
protected void execute(Event e) {
	final Plugin GMplugin = Bukkit.getPluginManager().getPlugin("GroupManager");
	GroupManager GM = (GroupManager) GMplugin;
	OverloadedWorldHolder handler = null;
	if (player == null) {
		return;
	}
	;

	if (player.getSingle(e).isOnline()) {
		handler = GM.getWorldsHolder().getWorldDataByPlayerName(player.getSingle(e).getName());
	} else {
		handler = GM.getWorldsHolder().getDefaultWorld();
	}

	if (world != null) {
		handler = GM.getWorldsHolder().getWorldData(world.getSingle(e).getName());
	}
	for (Entry<String, User> a : handler.getUsers().entrySet()) {
		if (player.getSingle(e).getUniqueId().toString().equals(a.getValue().getUUID().toString())) {
			a.getValue().addPermission(perm.getSingle(e));
			a.getValue().setLastName(player.getSingle(e).getName());
			break;
		}
	}
	GM.getWorldsHolder().saveChanges();
	GM.getWorldsHolder().reloadAll();

}
 
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:31,代码来源:EffGroupManagerAddPermission.java


示例15: execute

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
protected void execute(Event e) {

	final Plugin GMplugin = Bukkit.getPluginManager().getPlugin("GroupManager");
	GroupManager GM = (GroupManager) GMplugin;
	OverloadedWorldHolder handler = null;

	if (player == null) {
		return;
	}
	;

	if (player.getSingle(e).isOnline()) {
		handler = GM.getWorldsHolder().getWorldDataByPlayerName(player.getSingle(e).getName());
	} else {
		handler = GM.getWorldsHolder().getDefaultWorld();
	}

	if (world != null) {
		handler = GM.getWorldsHolder().getWorldData(world.getSingle(e).getName());
	}
	for (Entry<String, User> a : handler.getUsers().entrySet()) {
		if (player.getSingle(e).getUniqueId().toString().equals(a.getValue().getUUID().toString())) {
			a.getValue().addSubGroup(new Group(group.getSingle(e)));
			a.getValue().setLastName(player.getSingle(e).getName());
			break;
		}
	}
	GM.getWorldsHolder().saveChanges();
	GM.getWorldsHolder().reloadAll();

}
 
开发者ID:Sharpjaws,项目名称:SharpSK,代码行数:33,代码来源:EffGroupManagerAddSubGroupToPlayer.java


示例16: playerAddGroup

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
public boolean playerAddGroup(String worldName, String playerName, String groupName) {
    OverloadedWorldHolder owh;
    if (worldName == null) {
        owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
    } else {
        owh = groupManager.getWorldsHolder().getWorldData(worldName);
    }
    if (owh == null) {
        return false;
    }
    User user = owh.getUser(playerName);
    if (user == null) {
        return false;
    }
    Group group = owh.getGroup(groupName);
    if (group == null) {
        return false;
    }
    if (user.getGroup().equals(owh.getDefaultGroup())) {
        user.setGroup(group);
    } else if (group.getInherits().contains(user.getGroup().getName().toLowerCase())) {
        user.setGroup(group);
    } else {
        user.addSubGroup(group);
    }
    Player p = Bukkit.getPlayer(playerName);
    if (p != null) {
        GroupManager.BukkitPermissions.updatePermissions(p);
    }
    return true;
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:33,代码来源:Permission_GroupManager.java


示例17: playerRemoveGroup

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
@Override
public boolean playerRemoveGroup(String worldName, String playerName, String groupName) {
    OverloadedWorldHolder owh;
    if (worldName == null) {
        owh = groupManager.getWorldsHolder().getWorldDataByPlayerName(playerName);
    } else {
        owh = groupManager.getWorldsHolder().getWorldData(worldName);
    }
    if (owh == null) {
        return false;
    }
    User user = owh.getUser(playerName);
    if (user == null) {
        return false;
    }
    boolean success = false;
    if (user.getGroup().getName().equalsIgnoreCase(groupName)) {
        user.setGroup(owh.getDefaultGroup());
        success = true;
    } else {
        Group group = owh.getGroup(groupName);
        if (group != null) {
            success = user.removeSubGroup(group);
        }
    }
    if (success) {
        Player p = Bukkit.getPlayer(playerName);
        if (p != null) {
            GroupManager.BukkitPermissions.updatePermissions(p);
        }
    }
    return success;
}
 
开发者ID:Realmcraft,项目名称:Vault,代码行数:34,代码来源:Permission_GroupManager.java


示例18: resetWorldsHolder

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
public void resetWorldsHolder()
{

	worldsData = new HashMap<String, OverloadedWorldHolder>();
	mirrorsGroup = new HashMap<String, String>();
	mirrorsUser = new HashMap<String, String>();

	// Setup folders and check files exist for the primary world
	verifyFirstRun();
	initialLoad();
	if (serverDefaultWorldName == null)
	{
		throw new IllegalStateException("There is no default group! OMG!");
	}
}
 
开发者ID:Curtis3321,项目名称:Essentials,代码行数:16,代码来源:WorldsHolder.java


示例19: getUpdatedWorldData

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
/**
 * Get the requested world data and update it's dataSource to be relevant for this world
 *
 * @param worldName
 * @return updated world holder
 */
private OverloadedWorldHolder getUpdatedWorldData(String worldName)
{

	String worldNameLowered = worldName.toLowerCase();

	if (worldsData.containsKey(worldNameLowered))
	{
		OverloadedWorldHolder data = worldsData.get(worldNameLowered);
		data.updateDataSource();
		return data;
	}
	return null;

}
 
开发者ID:Curtis3321,项目名称:Essentials,代码行数:21,代码来源:WorldsHolder.java


示例20: getWorldDataByPlayerName

import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder; //导入依赖的package包/类
/**
 * Do a matching of playerName, if its found only one player, do getWorldData(player)
 *
 * @param playerName
 * @return null if matching returned no player, or more than one.
 */
public OverloadedWorldHolder getWorldDataByPlayerName(String playerName)
{

	List<Player> matchPlayer = plugin.getServer().matchPlayer(playerName);
	if (matchPlayer.size() == 1)
	{
		return getWorldData(matchPlayer.get(0));
	}
	return null;
}
 
开发者ID:Curtis3321,项目名称:Essentials,代码行数:17,代码来源:WorldsHolder.java



注:本文中的org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SpeechAndLanguageUnderstandingCollection类代码示例发布时间:2022-05-15
下一篇:
Java SpawnerSpawnEvent类代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap