Skip to content

Commit

Permalink
Release v1.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
svenar-nl committed Feb 8, 2021
1 parent 3f27b08 commit f3d8656
Show file tree
Hide file tree
Showing 40 changed files with 1,396 additions and 2,326 deletions.
17 changes: 16 additions & 1 deletion PowerRanks/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
Expand All @@ -17,5 +16,21 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
11 changes: 11 additions & 0 deletions PowerRanks/.project
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,15 @@
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1612295318236</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
1 change: 1 addition & 0 deletions PowerRanks/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
27 changes: 7 additions & 20 deletions PowerRanks/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
# --------------------
# PowerRanks storage
# 'type': YAML or MYSQL
# 'database':
# - 'host': database host
# - 'port': database port
# - 'username': database username
# - 'password': database password
# - 'database': database name
# --------------------
# Chat format
# Available options:
# [prefix] rank prefix
Expand Down Expand Up @@ -64,16 +55,6 @@
# 'automatic_update_config_files' Update the configuration files to the newest version.
# --------------------

storage:
type: 'YAML'
database:
host: 'localhost'
port: 3306
username: ''
password: ''
database: 'powerranks'
bungeecord:
enabled: true
chat:
enabled: true
format: '&a[world]&r [usertag] [prefix] [subprefix] [player] [subsuffix] [suffix]&r: [msg]'
Expand Down Expand Up @@ -105,4 +86,10 @@ announcements:
updates:
enable_update_checking: true
automatic_download_updates: false
automatic_update_config_files: true
automatic_update_config_files: true
addon_manager:
accepted_terms: false
rankup:
buy_command:
enabled: false
command: 'say %playername% just bought the rank %rankname%'
54 changes: 21 additions & 33 deletions PowerRanks/lang.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
# All PowerRanks messages can be changed here
# Available options:
# options starting with plugin_ are always available.
# options starting with argument_ are available for certain commands only!
# %plugin_name% | name of the plugin
# %plugin_prefix% | see general.prefix
# %argument_rank% | command argument rank name
# %argument_target_rank% | command argument target rank name
# %argument_subrank% | command argument subrank
# %argument_sender% | command argument sender name
# %argument_target% | command argument target name
# %argument_permission% | command argument permission node
# %argument_prefix% | command argument prefix
# %argument_suffix% | command argument suffix
# %argument_color% | command argument color
# %argument_cost% | command argument cost
# %argument_usertag_tag% | command argument usertag tag
# %argument_usertag_text% | command argument usertag text
# %argument_external_plugin% | command argument external plugin name
# %argument_addon% | command argument addon name
# %argument_material% | command argument material name
# %argument_plugin_name% | command argument plugin hook plugin name
# %argument_new_state% | command argument plugin hook state name
# %argument_config_target% | command argument config target

general:
prefix: "&0[&b%plugin_name%&0]&r"
Expand Down Expand Up @@ -116,8 +93,14 @@ messages:
config_worldtag_removed: "%plugin_prefix% &aThe world tag has been removed from the config!"
config_state_changed: "%plugin_prefix% &aState of '%argument_config_target%' in the config has be changed to %argument_new_state%&a!"
suggest_restart: "%plugin_prefix% &aChanges will take effect next restart."
addonmanager_terms_accepted: "%plugin_prefix% &aAdd-on manager terms accepted, to use the add-on manager run the add-on manager command again"
addonmanager_terms_declined: "%plugin_prefix% &cAdd-on manager terms declined, to use the add-on manager please accept the terms"
addonmanager_download_not_available: "%plugin_prefix% &cThis add-on can't be downloaded right now"
addonmanager_download_complete: "%plugin_prefix% &aSuccessfully downloaded add-on: %addonname%. Do '/pr addoninfo %addonname%' for more info"
addonmanager_download_failed: "%plugin_prefix% &cDownload failed for add-on: %addonname%"
addonmanager_uninstall_complete: "%plugin_prefix% &aSuccessfully uninstalled add-on: %addonname%."
commands:
usage_command_reload: "%plugin_prefix% &c%base_cmd% reload [config/plugin/all]"
usage_command_reload: "%plugin_prefix% &c%base_cmd% reload [config/plugin/addons/all]"
usage_command_setrank: "%plugin_prefix% &c%base_cmd% setrank <username> <rank>"
usage_command_setownrank: "%plugin_prefix% &c%base_cmd% setownrank <rank>"
usage_command_check: "%plugin_prefix% &c%base_cmd% check [player_name]"
Expand Down Expand Up @@ -151,11 +134,11 @@ commands:
usage_command_set_cost: "%plugin_prefix% &c%base_cmd% setcost <rank_name> <cost>"
usage_command_add_player_permission: "%plugin_prefix% &c%base_cmd% addplayerperm <player_name> <permission>"
usage_command_remove_player_permission: "%plugin_prefix% &c%base_cmd% delplayerperm <player_name> <permission>"
usage_command_create_usertag: "%plugin_prefix% &c%base_cmd% createusertag <tagName> <text>"
usage_command_edit_usertag: "%plugin_prefix% &c%base_cmd% editusertag <tagName> <text>"
usage_command_remove_usertag: "%plugin_prefix% &c%base_cmd% removeusertag <tagName>"
usage_command_set_usertag: "%plugin_prefix% &c%base_cmd% setusertag [player_name] <tagName>"
usage_command_clear_usertag: "%plugin_prefix% &c%base_cmd% clearusertag [player_name] <tagName>"
usage_command_create_usertag: "%plugin_prefix% &c%base_cmd% createusertag <tag_name> <text>"
usage_command_edit_usertag: "%plugin_prefix% &c%base_cmd% editusertag <tag_name> <text>"
usage_command_remove_usertag: "%plugin_prefix% &c%base_cmd% removeusertag <tag_name>"
usage_command_set_usertag: "%plugin_prefix% &c%base_cmd% setusertag [player_name] <tag_name>"
usage_command_clear_usertag: "%plugin_prefix% &c%base_cmd% clearusertag [player_name] <tag_name>"
usage_command_list_usertags: "%plugin_prefix% &c%base_cmd% listusertags"
usage_command_set_promoterank: "%plugin_prefix% &c%base_cmd% setpromoterank <rank> <promoteRank>"
usage_command_set_demoterank: "%plugin_prefix% &c%base_cmd% setdemoterank <rank> <promoteRank>"
Expand All @@ -164,8 +147,8 @@ commands:
usage_command_addoninfo: "%plugin_prefix% &c%base_cmd% addoninfo <addon_name>"
usage_command_factoryreset: "%plugin_prefix% &c%base_cmd% factoryreset"
usage_command_seticon: "%plugin_prefix% &c%base_cmd% seticon <rank>"
usage_command_verbose: "%plugin_prefix% &c%base_cmd% verbose <start/stop/save/clear>"
usage_command_playerinfo: "%plugin_prefix% &c%base_cmd% playerinfo <player_name>"
usage_command_verbose: "%plugin_prefix% &c%base_cmd% verbose <start/stop/save>"
usage_command_buyrank: "%plugin_prefix% &c%base_cmd% buyrank [rank_name] [confirm]"
usage_command_pluginhook: "%plugin_prefix% &c%base_cmd% pluginhook [enable/disable] [plugin_name]"
usage_command_config: "%plugin_prefix% &c%base_cmd% config <removeworldtag / (enable/disable chat_formatting/tablist_formatting)>"
Expand All @@ -174,6 +157,8 @@ commands:
reload_config_done: "%plugin_prefix% &2Reloaded config!"
reload_plugin: "%plugin_prefix% &2Reloading plugin"
reload_plugin_done: "%plugin_prefix% &2Reloaded plugin!"
reload_addons: "%plugin_prefix% &2Reloading plugin"
reload_addons_done: "%plugin_prefix% &2Reloaded plugin!"
help:
help:
command: "help [page_number]"
Expand Down Expand Up @@ -224,7 +209,7 @@ commands:
command: "listsubranks <player_name>"
description: "List all subranks of a player"
reload:
command: "reload [config/plugin/all]"
command: "reload [config/plugin/addons/all]"
description: "Reload PowerRanks"
addperm:
command: "addperm <rank> <permission>"
Expand Down Expand Up @@ -296,10 +281,10 @@ commands:
command: "removeusertag <tag>"
description: "Delete a user tag"
setusertag:
command: "setusertag [player_name] <tag>"
command: "setusertag [player] <tag>"
description: "Assign a user tag"
clearusertag:
command: "clearusertag [player_name] <tag>"
command: "clearusertag [player] <tag>"
description: "Remove a user tag"
listusertags:
command: "listusertags"
Expand Down Expand Up @@ -331,6 +316,9 @@ commands:
addoninfo:
command: "addoninfo <addon_name>"
description: "Show information about a specific add-on"
addonmanager:
command: "addonmanager"
description: "Manage the PowerRanks add-ons"
config:
command: "config <removeworldtag / (enable/disable chat_formatting/tablist_formatting)>"
description: "Edit the configuration file"
Expand Down
6 changes: 4 additions & 2 deletions PowerRanks/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: PowerRanks
version: 1.9.6 BETA 1
name: ${project.name}
version: ${project.version}
main: nl.svenar.PowerRanks.PowerRanks
api-version: 1.13
authors: [svenar_nl]
Expand Down Expand Up @@ -128,6 +128,8 @@ permissions:
default: op
powerranks.cmd.addoninfo:
default: op
powerranks.cmd.addonmanager:
default: op
powerranks.cmd.setguiicon:
default: op
powerranks.cmd.playerinfo:
Expand Down
27 changes: 23 additions & 4 deletions PowerRanks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nl.svenar</groupId>
<artifactId>PowerRanks</artifactId>
<version>1.9.6</version>
<artifactId>powerranks</artifactId>
<version>1.9.7</version>
<name>PowerRanks</name>
<description>An amazing permission plugin!</description>

Expand All @@ -14,7 +14,18 @@
</properties>

<build>
<defaultGoal>clean compile package</defaultGoal>
<finalName>${project.name}</finalName>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory></directory>
<includes>
<include>*.yml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -27,6 +38,14 @@
</plugins>
</build>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub svenar-nl Apache Maven Packages</name>
<url>https://maven.pkg.github.com/svenar-nl/PowerRanks</url>
</repository>
</distributionManagement>

<repositories>
<repository>
<id>spigotmc-repo</id>
Expand All @@ -45,7 +64,7 @@
<url>https://jitpack.io</url>
</repository>
<repository>
<id>svenar.nl</id>
<id>svenar</id>
<url>https://svenar.nl/repo/</url>
</repository>
</repositories>
Expand Down Expand Up @@ -78,7 +97,7 @@
<dependency>
<groupId>com.nametagedit</groupId>
<artifactId>nametagedit</artifactId>
<version>4.1.0</version>
<version>4.4.12</version>
</dependency>
</dependencies>
</project>
19 changes: 4 additions & 15 deletions PowerRanks/src/nl/svenar/PowerRanks/Cache/CachedConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public class CachedConfig {

private static HashMap<String, Object> config_data = new HashMap<String, Object>();

private static HashMap<String, PowerConfigurationSection> config_configuration_sections = new HashMap<String, PowerConfigurationSection>();
private static HashMap<String, ConfigurationSection> config_configuration_sections = new HashMap<String, ConfigurationSection>();
private static HashMap<String, String> config_strings = new HashMap<String, String>();
private static HashMap<String, List<String>> config_string_lists = new HashMap<String, List<String>>();
private static HashMap<String, Boolean> config_booleans = new HashMap<String, Boolean>();
private static HashMap<String, Integer> config_ints = new HashMap<String, Integer>();
private static HashMap<String, Boolean> config_booleans = new HashMap<String, Boolean>();

private static PowerRanks pr;

Expand All @@ -37,16 +37,14 @@ public static void update() {
config_strings.clear();
config_string_lists.clear();
config_booleans.clear();
config_ints.clear();

try {
configYaml.load(configFile);
for (String field : configYaml.getConfigurationSection("").getKeys(true)) {
config_data.put(field, configYaml.get(field));

if (configYaml.isConfigurationSection(field)) {
// config_configuration_sections.put(field, configYaml.getConfigurationSection(field));
setupPowerConfigurationSectionFromYaml(field, configYaml.getConfigurationSection(field));
config_configuration_sections.put(field, configYaml.getConfigurationSection(field));
} else if (configYaml.isString(field)) {
config_strings.put(field, configYaml.getString(field));
} else if (configYaml.isList(field)) {
Expand All @@ -64,16 +62,11 @@ public static void update() {
}
}

private static void setupPowerConfigurationSectionFromYaml(String field, ConfigurationSection cs) {
PowerConfigurationSection pcs = new PowerConfigurationSection(cs);
config_configuration_sections.put(field, pcs);
}

public static Object get(String field) {
return config_data.get(field);
}

public static PowerConfigurationSection getConfigurationSection(String field) {
public static ConfigurationSection getConfigurationSection(String field) {
return config_configuration_sections.get(field);
}

Expand All @@ -92,10 +85,6 @@ public static boolean getBoolean(String field) {
public static boolean contains(String field) {
return config_data.containsKey(field);
}

public static int getInt(String field) {
return config_ints.get(field);
}

public static void set(String field, Object data) {
final File configFile = new File(pr.getDataFolder() + File.separator + "config" + ".yml");
Expand Down
Loading

0 comments on commit f3d8656

Please sign in to comment.