public String getWorldGroups(Player player) { World world = player.getWorld(); List<String> returnData = new ArrayList<>(); if (plugin.getXInventories() != null) { Main xInventories = plugin.getXInventories(); String xGroup = xInventories.getConfig().getString("worlds." + world.getName()); plugin.logDebug("xGroup: " + xGroup); if (xGroup != null) { returnData.add(xGroup); } } if (plugin.getMultiInvAPI() != null) { String worldname = world.getName(); MultiInvAPI multiInvAPI = plugin.getMultiInvAPI(); if (multiInvAPI.getGroups() != null) { if (multiInvAPI.getGroups().containsKey(worldname)) { returnData.add(multiInvAPI.getGroups().get(worldname)); } } } if (plugin.getWorldInvAPI()) { String worldname = world.getName(); try { returnData.add(WorldInventoriesAPI.findGroup(worldname).getName()); } catch (Exception ex) { } } if (plugin.myWorldsHook != null) { if (plugin.myWorldsHook.isEnabled()) { returnData.add(plugin.myWorldsHook.getLocationName(player.getLocation())); } } try { if (plugin.getMultiverseGroupManager() != null) { if (plugin.getMultiverseGroupManager().hasGroup(world.getName())) { for (WorldGroupProfile wgp : plugin.getMultiverseGroupManager().getGroupsForWorld(world.getName())) { returnData.add(wgp.getName()); } } } } catch (Exception ex) { plugin.logError(ex.getMessage()); } if (plugin.pwiHook != null) { returnData.add(plugin.pwiHook.getLocationName(world.getName())); } if (returnData.isEmpty()) { returnData.add(""); } return returnData.get(0); }
public boolean multipleInventories() { return plugin.getMultiInvAPI() != null || plugin.pwiHook != null || plugin.myWorldsHook != null || plugin.getWorldInvAPI() || plugin.getXInventories() != null || plugin.getMultiverseGroupManager() != null; }