Java Code Examples for cn.nukkit.permission.Permission#loadPermissions()
The following examples show how to use
cn.nukkit.permission.Permission#loadPermissions() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PluginDescription.java From Jupiter with GNU General Public License v3.0 | 4 votes |
@SuppressWarnings("unchecked") private void loadMap(Map<String, Object> plugin) throws PluginException { this.name = ((String) plugin.get("name")).replaceAll("[^A-Za-z0-9 _.-]", ""); if (this.name.equals("")) { throw new PluginException("Invalid PluginDescription name"); } this.name = this.name.replace(" ", "_"); this.version = String.valueOf(plugin.get("version")); this.main = (String) plugin.get("main"); Object api = plugin.get("api"); if (api instanceof List) { this.api = (List<String>) api; } else { List<String> list = new ArrayList<>(); list.add((String) api); this.api = list; } if (this.main.startsWith("cn.nukkit.")) { throw new PluginException("Invalid PluginDescription main, cannot start within the cn.nukkit. package"); } if (plugin.containsKey("commands") && plugin.get("commands") instanceof Map) { this.commands = (Map<String, Object>) plugin.get("commands"); } if (plugin.containsKey("depend")) { this.depend = (List<String>) plugin.get("depend"); } if (plugin.containsKey("softdepend")) { this.softDepend = (List<String>) plugin.get("softdepend"); } if (plugin.containsKey("loadbefore")) { this.loadBefore = (List<String>) plugin.get("loadbefore"); } if (plugin.containsKey("website")) { this.website = (String) plugin.get("website"); } if (plugin.containsKey("description")) { this.description = (String) plugin.get("description"); } if (plugin.containsKey("prefix")) { this.prefix = (String) plugin.get("prefix"); } if (plugin.containsKey("load")) { String order = (String) plugin.get("load"); try { this.order = PluginLoadOrder.valueOf(order); } catch (Exception e) { throw new PluginException("Invalid PluginDescription load"); } } if (plugin.containsKey("author")) { this.authors.add((String) plugin.get("author")); } if (plugin.containsKey("authors")) { this.authors.addAll((Collection<? extends String>) plugin.get("authors")); } if (plugin.containsKey("permissions")) { this.permissions = Permission.loadPermissions((Map<String, Object>) plugin.get("permissions")); } }
Example 2
Source File: PluginDescription.java From Nukkit with GNU General Public License v3.0 | 4 votes |
private void loadMap(Map<String, Object> plugin) throws PluginException { this.name = ((String) plugin.get("name")).replaceAll("[^A-Za-z0-9 _.-]", ""); if (this.name.equals("")) { throw new PluginException("Invalid PluginDescription name"); } this.name = this.name.replace(" ", "_"); this.version = String.valueOf(plugin.get("version")); this.main = (String) plugin.get("main"); Object api = plugin.get("api"); if (api instanceof List) { this.api = (List<String>) api; } else { List<String> list = new ArrayList<>(); list.add((String) api); this.api = list; } if (this.main.startsWith("cn.nukkit.")) { throw new PluginException("Invalid PluginDescription main, cannot start within the cn.nukkit. package"); } if (plugin.containsKey("commands") && plugin.get("commands") instanceof Map) { this.commands = (Map<String, Object>) plugin.get("commands"); } if (plugin.containsKey("depend")) { this.depend = (List<String>) plugin.get("depend"); } if (plugin.containsKey("softdepend")) { this.softDepend = (List<String>) plugin.get("softdepend"); } if (plugin.containsKey("loadbefore")) { this.loadBefore = (List<String>) plugin.get("loadbefore"); } if (plugin.containsKey("website")) { this.website = (String) plugin.get("website"); } if (plugin.containsKey("description")) { this.description = (String) plugin.get("description"); } if (plugin.containsKey("prefix")) { this.prefix = (String) plugin.get("prefix"); } if (plugin.containsKey("load")) { String order = (String) plugin.get("load"); try { this.order = PluginLoadOrder.valueOf(order); } catch (Exception e) { throw new PluginException("Invalid PluginDescription load"); } } if (plugin.containsKey("author")) { this.authors.add((String) plugin.get("author")); } if (plugin.containsKey("authors")) { this.authors.addAll((Collection<? extends String>) plugin.get("authors")); } if (plugin.containsKey("permissions")) { this.permissions = Permission.loadPermissions((Map<String, Object>) plugin.get("permissions")); } }
Example 3
Source File: PluginDescription.java From Nukkit with GNU General Public License v3.0 | 4 votes |
private void loadMap(Map<String, Object> plugin) throws PluginException { this.name = ((String) plugin.get("name")).replaceAll("[^A-Za-z0-9 _.-]", ""); if (this.name.equals("")) { throw new PluginException("Invalid PluginDescription name"); } this.name = this.name.replace(" ", "_"); this.version = String.valueOf(plugin.get("version")); this.main = (String) plugin.get("main"); Object api = plugin.get("api"); if (api instanceof List) { this.api = (List<String>) api; } else { List<String> list = new ArrayList<>(); list.add((String) api); this.api = list; } if (this.main.startsWith("cn.nukkit.")) { throw new PluginException("Invalid PluginDescription main, cannot start within the cn.nukkit. package"); } if (plugin.containsKey("commands") && plugin.get("commands") instanceof Map) { this.commands = (Map<String, Object>) plugin.get("commands"); } if (plugin.containsKey("depend")) { this.depend = (List<String>) plugin.get("depend"); } if (plugin.containsKey("softdepend")) { this.softDepend = (List<String>) plugin.get("softdepend"); } if (plugin.containsKey("loadbefore")) { this.loadBefore = (List<String>) plugin.get("loadbefore"); } if (plugin.containsKey("website")) { this.website = (String) plugin.get("website"); } if (plugin.containsKey("description")) { this.description = (String) plugin.get("description"); } if (plugin.containsKey("prefix")) { this.prefix = (String) plugin.get("prefix"); } if (plugin.containsKey("load")) { String order = (String) plugin.get("load"); try { this.order = PluginLoadOrder.valueOf(order); } catch (Exception e) { throw new PluginException("Invalid PluginDescription load"); } } if (plugin.containsKey("author")) { this.authors.add((String) plugin.get("author")); } if (plugin.containsKey("authors")) { this.authors.addAll((Collection<? extends String>) plugin.get("authors")); } if (plugin.containsKey("permissions")) { this.permissions = Permission.loadPermissions((Map<String, Object>) plugin.get("permissions")); } }