commit e0a5379ecfb1bd02dc6b0aa919187b7dddcf6cbc Author: Malcom Green Date: Tue May 23 13:19:15 2017 -0400 Initial Commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..32858aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/.gradle/2.13/taskArtifacts/cache.properties b/.gradle/2.13/taskArtifacts/cache.properties new file mode 100644 index 0000000..177e5ae --- /dev/null +++ b/.gradle/2.13/taskArtifacts/cache.properties @@ -0,0 +1 @@ +#Mon May 22 15:04:46 EDT 2017 diff --git a/.gradle/2.13/taskArtifacts/cache.properties.lock b/.gradle/2.13/taskArtifacts/cache.properties.lock new file mode 100644 index 0000000..9c4d3f2 Binary files /dev/null and b/.gradle/2.13/taskArtifacts/cache.properties.lock differ diff --git a/.gradle/2.13/taskArtifacts/fileHashes.bin b/.gradle/2.13/taskArtifacts/fileHashes.bin new file mode 100644 index 0000000..b459806 Binary files /dev/null and b/.gradle/2.13/taskArtifacts/fileHashes.bin differ diff --git a/.gradle/2.13/taskArtifacts/fileSnapshots.bin b/.gradle/2.13/taskArtifacts/fileSnapshots.bin new file mode 100644 index 0000000..1e4e3a0 Binary files /dev/null and b/.gradle/2.13/taskArtifacts/fileSnapshots.bin differ diff --git a/.gradle/2.13/taskArtifacts/taskArtifacts.bin b/.gradle/2.13/taskArtifacts/taskArtifacts.bin new file mode 100644 index 0000000..65892d9 Binary files /dev/null and b/.gradle/2.13/taskArtifacts/taskArtifacts.bin differ diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..583224e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..05e5219 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml b/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml new file mode 100644 index 0000000..fbdb0d6 --- /dev/null +++ b/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_core_2_8_5.xml b/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_core_2_8_5.xml new file mode 100644 index 0000000..73b3015 --- /dev/null +++ b/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_core_2_8_5.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_databind_2_8_5.xml b/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_databind_2_8_5.xml new file mode 100644 index 0000000..303ee9d --- /dev/null +++ b/.idea/libraries/Gradle__com_fasterxml_jackson_core_jackson_databind_2_8_5.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_google_code_gson_gson_2_3_1.xml b/.idea/libraries/Gradle__com_google_code_gson_gson_2_3_1.xml new file mode 100644 index 0000000..50e9569 --- /dev/null +++ b/.idea/libraries/Gradle__com_google_code_gson_gson_2_3_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_google_guava_guava_18_0.xml b/.idea/libraries/Gradle__com_google_guava_guava_18_0.xml new file mode 100644 index 0000000..71d7b90 --- /dev/null +++ b/.idea/libraries/Gradle__com_google_guava_guava_18_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_googlecode_json_simple_json_simple_1_1_1.xml b/.idea/libraries/Gradle__com_googlecode_json_simple_json_simple_1_1_1.xml new file mode 100644 index 0000000..1e91ade --- /dev/null +++ b/.idea/libraries/Gradle__com_googlecode_json_simple_json_simple_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_mashape_unirest_unirest_java_1_4_9.xml b/.idea/libraries/Gradle__com_mashape_unirest_unirest_java_1_4_9.xml new file mode 100644 index 0000000..7d2cf3e --- /dev/null +++ b/.idea/libraries/Gradle__com_mashape_unirest_unirest_java_1_4_9.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_neovisionaries_nv_websocket_client_1_31.xml b/.idea/libraries/Gradle__com_neovisionaries_nv_websocket_client_1_31.xml new file mode 100644 index 0000000..29d5b11 --- /dev/null +++ b/.idea/libraries/Gradle__com_neovisionaries_nv_websocket_client_1_31.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_neovisionaries_nv_websocket_client_2_0.xml b/.idea/libraries/Gradle__com_neovisionaries_nv_websocket_client_2_0.xml new file mode 100644 index 0000000..39b4477 --- /dev/null +++ b/.idea/libraries/Gradle__com_neovisionaries_nv_websocket_client_2_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_1_2_34.xml b/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_1_2_34.xml new file mode 100644 index 0000000..aad4706 --- /dev/null +++ b/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_1_2_34.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_1_2_39.xml b/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_1_2_39.xml new file mode 100644 index 0000000..46b8c65 --- /dev/null +++ b/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_1_2_39.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_common_1_0_4.xml b/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_common_1_0_4.xml new file mode 100644 index 0000000..3379601 --- /dev/null +++ b/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_common_1_0_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_common_1_0_5.xml b/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_common_1_0_5.xml new file mode 100644 index 0000000..4dd9c7f --- /dev/null +++ b/.idea/libraries/Gradle__com_sedmelluq_lavaplayer_common_1_0_5.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__commons_codec_commons_codec_1_9.xml b/.idea/libraries/Gradle__commons_codec_commons_codec_1_9.xml new file mode 100644 index 0000000..c3c3ec6 --- /dev/null +++ b/.idea/libraries/Gradle__commons_codec_commons_codec_1_9.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__commons_io_commons_io_2_5.xml b/.idea/libraries/Gradle__commons_io_commons_io_2_5.xml new file mode 100644 index 0000000..12ab8e6 --- /dev/null +++ b/.idea/libraries/Gradle__commons_io_commons_io_2_5.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__commons_lang_commons_lang_2_6.xml b/.idea/libraries/Gradle__commons_lang_commons_lang_2_6.xml new file mode 100644 index 0000000..5f76790 --- /dev/null +++ b/.idea/libraries/Gradle__commons_lang_commons_lang_2_6.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__commons_logging_commons_logging_1_2.xml b/.idea/libraries/Gradle__commons_logging_commons_logging_1_2.xml new file mode 100644 index 0000000..d26e061 --- /dev/null +++ b/.idea/libraries/Gradle__commons_logging_commons_logging_1_2.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__javax_persistence_persistence_api_1_0.xml b/.idea/libraries/Gradle__javax_persistence_persistence_api_1_0.xml new file mode 100644 index 0000000..3eff73a --- /dev/null +++ b/.idea/libraries/Gradle__javax_persistence_persistence_api_1_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__junit_junit_4_10.xml b/.idea/libraries/Gradle__junit_junit_4_10.xml new file mode 100644 index 0000000..1b0c3a2 --- /dev/null +++ b/.idea/libraries/Gradle__junit_junit_4_10.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__mysql_mysql_connector_java_5_1_38.xml b/.idea/libraries/Gradle__mysql_mysql_connector_java_5_1_38.xml new file mode 100644 index 0000000..9d0dff5 --- /dev/null +++ b/.idea/libraries/Gradle__mysql_mysql_connector_java_5_1_38.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__net_dv8tion_JDA_3_0_0_165.xml b/.idea/libraries/Gradle__net_dv8tion_JDA_3_0_0_165.xml new file mode 100644 index 0000000..fea02a1 --- /dev/null +++ b/.idea/libraries/Gradle__net_dv8tion_JDA_3_0_0_165.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__net_dv8tion_JDA_3_1_0_204.xml b/.idea/libraries/Gradle__net_dv8tion_JDA_3_1_0_204.xml new file mode 100644 index 0000000..73fb3f3 --- /dev/null +++ b/.idea/libraries/Gradle__net_dv8tion_JDA_3_1_0_204.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__net_iharder_base64_2_3_9.xml b/.idea/libraries/Gradle__net_iharder_base64_2_3_9.xml new file mode 100644 index 0000000..0733a96 --- /dev/null +++ b/.idea/libraries/Gradle__net_iharder_base64_2_3_9.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__net_java_dev_jna_jna_4_4_0.xml b/.idea/libraries/Gradle__net_java_dev_jna_jna_4_4_0.xml new file mode 100644 index 0000000..8ced7d6 --- /dev/null +++ b/.idea/libraries/Gradle__net_java_dev_jna_jna_4_4_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__net_md_5_bungeecord_chat_1_8_SNAPSHOT.xml b/.idea/libraries/Gradle__net_md_5_bungeecord_chat_1_8_SNAPSHOT.xml new file mode 100644 index 0000000..04e3408 --- /dev/null +++ b/.idea/libraries/Gradle__net_md_5_bungeecord_chat_1_8_SNAPSHOT.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__net_sf_trove4j_trove4j_3_0_3.xml b/.idea/libraries/Gradle__net_sf_trove4j_trove4j_3_0_3.xml new file mode 100644 index 0000000..c2571ac --- /dev/null +++ b/.idea/libraries/Gradle__net_sf_trove4j_trove4j_3_0_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_apache_commons_commons_collections4_4_1.xml b/.idea/libraries/Gradle__org_apache_commons_commons_collections4_4_1.xml new file mode 100644 index 0000000..aa6f5fb --- /dev/null +++ b/.idea/libraries/Gradle__org_apache_commons_commons_collections4_4_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_apache_commons_commons_lang3_3_5.xml b/.idea/libraries/Gradle__org_apache_commons_commons_lang3_3_5.xml new file mode 100644 index 0000000..fed9b56 --- /dev/null +++ b/.idea/libraries/Gradle__org_apache_commons_commons_lang3_3_5.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_apache_httpcomponents_httpasyncclient_4_1_1.xml b/.idea/libraries/Gradle__org_apache_httpcomponents_httpasyncclient_4_1_1.xml new file mode 100644 index 0000000..6c5bdd8 --- /dev/null +++ b/.idea/libraries/Gradle__org_apache_httpcomponents_httpasyncclient_4_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_apache_httpcomponents_httpclient_4_5_2.xml b/.idea/libraries/Gradle__org_apache_httpcomponents_httpclient_4_5_2.xml new file mode 100644 index 0000000..fac3d15 --- /dev/null +++ b/.idea/libraries/Gradle__org_apache_httpcomponents_httpclient_4_5_2.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_apache_httpcomponents_httpcore_4_4_4.xml b/.idea/libraries/Gradle__org_apache_httpcomponents_httpcore_4_4_4.xml new file mode 100644 index 0000000..e91e5b2 --- /dev/null +++ b/.idea/libraries/Gradle__org_apache_httpcomponents_httpcore_4_4_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_apache_httpcomponents_httpcore_nio_4_4_4.xml b/.idea/libraries/Gradle__org_apache_httpcomponents_httpcore_nio_4_4_4.xml new file mode 100644 index 0000000..00af8a2 --- /dev/null +++ b/.idea/libraries/Gradle__org_apache_httpcomponents_httpcore_nio_4_4_4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_apache_httpcomponents_httpmime_4_5_2.xml b/.idea/libraries/Gradle__org_apache_httpcomponents_httpmime_4_5_2.xml new file mode 100644 index 0000000..068a852 --- /dev/null +++ b/.idea/libraries/Gradle__org_apache_httpcomponents_httpmime_4_5_2.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_avaje_ebean_2_8_1.xml b/.idea/libraries/Gradle__org_avaje_ebean_2_8_1.xml new file mode 100644 index 0000000..81e29f8 --- /dev/null +++ b/.idea/libraries/Gradle__org_avaje_ebean_2_8_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_bukkit_bukkit_1_8_8_R0_1_SNAPSHOT.xml b/.idea/libraries/Gradle__org_bukkit_bukkit_1_8_8_R0_1_SNAPSHOT.xml new file mode 100644 index 0000000..17a26c4 --- /dev/null +++ b/.idea/libraries/Gradle__org_bukkit_bukkit_1_8_8_R0_1_SNAPSHOT.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_1.xml b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_1.xml new file mode 100644 index 0000000..932a17a --- /dev/null +++ b/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_json_json_20160810.xml b/.idea/libraries/Gradle__org_json_json_20160810.xml new file mode 100644 index 0000000..64dc62f --- /dev/null +++ b/.idea/libraries/Gradle__org_json_json_20160810.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_jsoup_jsoup_1_10_1.xml b/.idea/libraries/Gradle__org_jsoup_jsoup_1_10_1.xml new file mode 100644 index 0000000..d28c153 --- /dev/null +++ b/.idea/libraries/Gradle__org_jsoup_jsoup_1_10_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_22.xml b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_22.xml new file mode 100644 index 0000000..0c54512 --- /dev/null +++ b/.idea/libraries/Gradle__org_slf4j_slf4j_api_1_7_22.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_spigotmc_spigot_api_1_8_8_R0_1_SNAPSHOT.xml b/.idea/libraries/Gradle__org_spigotmc_spigot_api_1_8_8_R0_1_SNAPSHOT.xml new file mode 100644 index 0000000..199346b --- /dev/null +++ b/.idea/libraries/Gradle__org_spigotmc_spigot_api_1_8_8_R0_1_SNAPSHOT.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Gradle__org_yaml_snakeyaml_1_15.xml b/.idea/libraries/Gradle__org_yaml_snakeyaml_1_15.xml new file mode 100644 index 0000000..f3616db --- /dev/null +++ b/.idea/libraries/Gradle__org_yaml_snakeyaml_1_15.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..c6d8fb7 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..191cdf9 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/Rixa-MC.iml b/.idea/modules/Rixa-MC.iml new file mode 100644 index 0000000..9db8b88 --- /dev/null +++ b/.idea/modules/Rixa-MC.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/Rixa-MC_main.iml b/.idea/modules/Rixa-MC_main.iml new file mode 100644 index 0000000..dcc6aa1 --- /dev/null +++ b/.idea/modules/Rixa-MC_main.iml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/Rixa-MC_test.iml b/.idea/modules/Rixa-MC_test.iml new file mode 100644 index 0000000..8749137 --- /dev/null +++ b/.idea/modules/Rixa-MC_test.iml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/Rixa.iml b/.idea/modules/Rixa.iml new file mode 100644 index 0000000..5428a04 --- /dev/null +++ b/.idea/modules/Rixa.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/Rixa_main.iml b/.idea/modules/Rixa_main.iml new file mode 100644 index 0000000..bc371d9 --- /dev/null +++ b/.idea/modules/Rixa_main.iml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/Rixa_test.iml b/.idea/modules/Rixa_test.iml new file mode 100644 index 0000000..fb4c9a5 --- /dev/null +++ b/.idea/modules/Rixa_test.iml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..3b7bed9 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,1330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + project + + + + + + + + + + + + + + + + + + + + + + + + + + + 1495479808992 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No facets are configured + + + + + + + + bootstrap + + + + + + + + 1.8 + + + + + + + + Rixa + + + + + + + + 1.8 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..39a1278 --- /dev/null +++ b/build.gradle @@ -0,0 +1,30 @@ +plugins { + id'java' + id'application' + id'com.github.johnrengelman.shadow' version '1.2.4' +} + +mainClassName = 'me.savvy.rixa.Rixa' +version '1.0' + +jar { + baseName = project.name + manifest { + attributes 'Implementation-Version': version + attributes 'Main-Class': mainClassName + } +} + +sourceCompatibility = 1.8 + +repositories { + jcenter() +} + +dependencies { + compile 'net.dv8tion:JDA:3.1.0_204' + compile 'mysql:mysql-connector-java:5.1.38' + compile 'com.sedmelluq:lavaplayer:1.2.39' +} + +compileJava.options.encoding = 'UTF-8' diff --git a/build/distributions/Rixa-MC-1.0.tar b/build/distributions/Rixa-MC-1.0.tar new file mode 100644 index 0000000..2d18052 Binary files /dev/null and b/build/distributions/Rixa-MC-1.0.tar differ diff --git a/build/distributions/Rixa-MC-1.0.zip b/build/distributions/Rixa-MC-1.0.zip new file mode 100644 index 0000000..0dac05d Binary files /dev/null and b/build/distributions/Rixa-MC-1.0.zip differ diff --git a/build/resources/main/plugin.yml b/build/resources/main/plugin.yml new file mode 100644 index 0000000..c3e8b2b --- /dev/null +++ b/build/resources/main/plugin.yml @@ -0,0 +1,4 @@ +name: RixaMC +main: me.savvy.RixaMC +author: [Savvy] +version: 1.0 \ No newline at end of file diff --git a/build/scripts/Rixa-MC b/build/scripts/Rixa-MC new file mode 100644 index 0000000..b071235 --- /dev/null +++ b/build/scripts/Rixa-MC @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Rixa-MC start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/.." >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Rixa-MC" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and RIXA_MC_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/lib/Rixa-MC-1.0.jar:$APP_HOME/lib/JDA-3.0.0_165.jar:$APP_HOME/lib/mysql-connector-java-5.1.38.jar:$APP_HOME/lib/lavaplayer-1.2.34.jar:$APP_HOME/lib/spigot-api-1.8.8-R0.1-SNAPSHOT.jar:$APP_HOME/lib/bukkit-1.8.8-R0.1-SNAPSHOT.jar:$APP_HOME/lib/commons-lang3-3.5.jar:$APP_HOME/lib/commons-collections4-4.1.jar:$APP_HOME/lib/json-20160810.jar:$APP_HOME/lib/jna-4.4.0.jar:$APP_HOME/lib/nv-websocket-client-1.31.jar:$APP_HOME/lib/unirest-java-1.4.9.jar:$APP_HOME/lib/lavaplayer-common-1.0.4.jar:$APP_HOME/lib/slf4j-api-1.7.22.jar:$APP_HOME/lib/httpclient-4.5.2.jar:$APP_HOME/lib/commons-io-2.5.jar:$APP_HOME/lib/jackson-core-2.8.5.jar:$APP_HOME/lib/jackson-databind-2.8.5.jar:$APP_HOME/lib/jsoup-1.10.1.jar:$APP_HOME/lib/base64-2.3.9.jar:$APP_HOME/lib/commons-lang-2.6.jar:$APP_HOME/lib/json-simple-1.1.1.jar:$APP_HOME/lib/ebean-2.8.1.jar:$APP_HOME/lib/snakeyaml-1.15.jar:$APP_HOME/lib/bungeecord-chat-1.8-SNAPSHOT.jar:$APP_HOME/lib/httpasyncclient-4.1.1.jar:$APP_HOME/lib/httpmime-4.5.2.jar:$APP_HOME/lib/httpcore-4.4.4.jar:$APP_HOME/lib/commons-logging-1.2.jar:$APP_HOME/lib/commons-codec-1.9.jar:$APP_HOME/lib/jackson-annotations-2.8.0.jar:$APP_HOME/lib/junit-4.10.jar:$APP_HOME/lib/persistence-api-1.0.jar:$APP_HOME/lib/httpcore-nio-4.4.4.jar:$APP_HOME/lib/hamcrest-core-1.1.jar:$APP_HOME/lib/gson-2.3.1.jar:$APP_HOME/lib/guava-18.0.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And RIXA_MC_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $RIXA_MC_OPTS + + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" me.savvy.RixaMC "$@" diff --git a/build/scripts/Rixa-MC.bat b/build/scripts/Rixa-MC.bat new file mode 100644 index 0000000..233e267 --- /dev/null +++ b/build/scripts/Rixa-MC.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Rixa-MC startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME%.. + +@rem Add default JVM options here. You can also use JAVA_OPTS and RIXA_MC_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\lib\Rixa-MC-1.0.jar;%APP_HOME%\lib\JDA-3.0.0_165.jar;%APP_HOME%\lib\mysql-connector-java-5.1.38.jar;%APP_HOME%\lib\lavaplayer-1.2.34.jar;%APP_HOME%\lib\spigot-api-1.8.8-R0.1-SNAPSHOT.jar;%APP_HOME%\lib\bukkit-1.8.8-R0.1-SNAPSHOT.jar;%APP_HOME%\lib\commons-lang3-3.5.jar;%APP_HOME%\lib\commons-collections4-4.1.jar;%APP_HOME%\lib\json-20160810.jar;%APP_HOME%\lib\jna-4.4.0.jar;%APP_HOME%\lib\nv-websocket-client-1.31.jar;%APP_HOME%\lib\unirest-java-1.4.9.jar;%APP_HOME%\lib\lavaplayer-common-1.0.4.jar;%APP_HOME%\lib\slf4j-api-1.7.22.jar;%APP_HOME%\lib\httpclient-4.5.2.jar;%APP_HOME%\lib\commons-io-2.5.jar;%APP_HOME%\lib\jackson-core-2.8.5.jar;%APP_HOME%\lib\jackson-databind-2.8.5.jar;%APP_HOME%\lib\jsoup-1.10.1.jar;%APP_HOME%\lib\base64-2.3.9.jar;%APP_HOME%\lib\commons-lang-2.6.jar;%APP_HOME%\lib\json-simple-1.1.1.jar;%APP_HOME%\lib\ebean-2.8.1.jar;%APP_HOME%\lib\snakeyaml-1.15.jar;%APP_HOME%\lib\bungeecord-chat-1.8-SNAPSHOT.jar;%APP_HOME%\lib\httpasyncclient-4.1.1.jar;%APP_HOME%\lib\httpmime-4.5.2.jar;%APP_HOME%\lib\httpcore-4.4.4.jar;%APP_HOME%\lib\commons-logging-1.2.jar;%APP_HOME%\lib\commons-codec-1.9.jar;%APP_HOME%\lib\jackson-annotations-2.8.0.jar;%APP_HOME%\lib\junit-4.10.jar;%APP_HOME%\lib\persistence-api-1.0.jar;%APP_HOME%\lib\httpcore-nio-4.4.4.jar;%APP_HOME%\lib\hamcrest-core-1.1.jar;%APP_HOME%\lib\gson-2.3.1.jar;%APP_HOME%\lib\guava-18.0.jar + +@rem Execute Rixa-MC +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %RIXA_MC_OPTS% -classpath "%CLASSPATH%" me.savvy.RixaMC %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable RIXA_MC_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%RIXA_MC_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/build/tmp/jar/MANIFEST.MF b/build/tmp/jar/MANIFEST.MF new file mode 100644 index 0000000..9124702 --- /dev/null +++ b/build/tmp/jar/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Implementation-Version: 1.0 +Main-Class: me.savvy.RixaMC + diff --git a/build/tmp/shadowJar/MANIFEST.MF b/build/tmp/shadowJar/MANIFEST.MF new file mode 100644 index 0000000..9124702 --- /dev/null +++ b/build/tmp/shadowJar/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Implementation-Version: 1.0 +Main-Class: me.savvy.RixaMC + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..1ee19ea --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon May 22 15:06:51 EDT 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-all.zip diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..27309d9 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..832fdb6 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..0bad7c5 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,3 @@ +rootProject.name = 'Rixa-MC' +rootProject.name = 'Rixa' + diff --git a/src/main/java/me/savvy/rixa/Rixa.java b/src/main/java/me/savvy/rixa/Rixa.java new file mode 100644 index 0000000..f6bb40e --- /dev/null +++ b/src/main/java/me/savvy/rixa/Rixa.java @@ -0,0 +1,64 @@ +package me.savvy.rixa; + +import me.savvy.rixa.commands.general.HelpCommand; +import me.savvy.rixa.commands.general.InfoCommand; +import me.savvy.rixa.commands.general.ServerInfoCommand; +import me.savvy.rixa.commands.handlers.CommandHandler; +import me.savvy.rixa.events.MessageEvent; +import me.savvy.rixa.modules.reactions.handlers.ReactionManager; +import me.savvy.rixa.modules.reactions.react.HelpReaction; +import net.dv8tion.jda.core.AccountType; +import net.dv8tion.jda.core.JDA; +import net.dv8tion.jda.core.JDABuilder; +import net.dv8tion.jda.core.OnlineStatus; +import net.dv8tion.jda.core.entities.Game; +import net.dv8tion.jda.core.exceptions.RateLimitedException; +import net.dv8tion.jda.core.hooks.AnnotatedEventManager; + +import javax.security.auth.login.LoginException; +import java.util.LinkedList; +import java.util.List; +import java.util.logging.Logger; + +/** + * Created by Timber on 5/7/2017. + */ +public class Rixa { + + private static List shardsList; + private static long timeUp; + private static Rixa instance; // String search = event.getMessage().getContent().substring(event.getMessage().getContent().indexOf(" ") + 1); + + public static void main(String[] args) throws LoginException, InterruptedException, RateLimitedException { + instance = new Rixa(); + shardsList = new LinkedList<>(); + int shards = 4; + for(int i = 1; i < shards; i++){ + Logger.getLogger("Rixa").info("Loading shard #" + i); + JDABuilder jda = new JDABuilder(AccountType.BOT) + .setToken("MjkxNTM5Njg2NTEyNTI1MzMy.C6r1OA.-hRemXk-b3nP5GvT9kjh2V7RXDo") + .setEventManager(new AnnotatedEventManager()) + .addEventListener(new MessageEvent()) + .setGame(Game.of("Rixa 1.0 | In Dev", "http://rixa.io")) + .setAutoReconnect(true) + .setStatus(OnlineStatus.ONLINE) + .setAudioEnabled(true) + .useSharding(i, shards); + shardsList.add(jda.buildBlocking()); + Logger.getLogger("Rixa").info("Shard #" + i + " has been loaded"); + } + timeUp = System.currentTimeMillis(); + CommandHandler.registerCommand(new InfoCommand()); + CommandHandler.registerCommand(new ServerInfoCommand()); + CommandHandler.registerCommand(new HelpCommand()); + ReactionManager.registerReaction(new HelpReaction()); + } + + public static Rixa getInstance() { + return instance; + } + + public long getTimeUp() { + return timeUp; + } +} diff --git a/src/main/java/me/savvy/rixa/commands/general/HelpCommand.java b/src/main/java/me/savvy/rixa/commands/general/HelpCommand.java new file mode 100644 index 0000000..76cca91 --- /dev/null +++ b/src/main/java/me/savvy/rixa/commands/general/HelpCommand.java @@ -0,0 +1,46 @@ +package me.savvy.rixa.commands.general; + +import me.savvy.rixa.commands.handlers.Command; +import me.savvy.rixa.commands.handlers.CommandExec; +import net.dv8tion.jda.core.EmbedBuilder; +import net.dv8tion.jda.core.entities.ChannelType; +import net.dv8tion.jda.core.entities.Message; +import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent; +import net.dv8tion.jda.core.exceptions.ErrorResponseException; +import net.dv8tion.jda.core.exceptions.PermissionException; + +/** + * Created by Timber on 5/7/2017. + */ +public class HelpCommand implements CommandExec { + + @Command(usage = "%phelp", + channelType = ChannelType.TEXT, + description = "Receive information about the server!", + aliases = "", mainCommand = "help") + public void execute(GuildMessageReceivedEvent event) { + try { + event.getMessage().delete().complete(); + } catch (PermissionException ignored) {} + EmbedBuilder embedBuilder = new EmbedBuilder(); + String stringBuilder = "\u2753" + + " **Help**" + + "\n" + + "Click the corresponding number for more information about the command menu."; + embedBuilder.setTitle("Help", "http://rixa.io") + .setDescription(stringBuilder) + .addField("1 - General Commands", "Reveals usable commands intended for `everyone`", false) + .addField("2 - Staff Commands", "Reveals usable commands intended for `staff` use only", false) + .addField("3 - Music Commands", "Reveals usable commands to configure Rixa for your discord!", false) + .setColor(event.getMember().getColor()); + Message message = event.getAuthor().openPrivateChannel().complete().sendMessage(embedBuilder.build()).complete(); + event.getChannel().sendMessage(event.getMember().getAsMention() + + ", the help menu has been private messaged to you!").queue(); + try { + message.addReaction("\u0031\u20E3").queue(); + message.addReaction("\u0032\u20E3").queue(); + message.addReaction("\u0033\u20E3").queue(); + message.addReaction("\uD83D\uDDD1").queue(); + } catch (ErrorResponseException ignored) {} + } +} diff --git a/src/main/java/me/savvy/rixa/commands/general/InfoCommand.java b/src/main/java/me/savvy/rixa/commands/general/InfoCommand.java new file mode 100644 index 0000000..4dec9e0 --- /dev/null +++ b/src/main/java/me/savvy/rixa/commands/general/InfoCommand.java @@ -0,0 +1,52 @@ +package me.savvy.rixa.commands.general; + +import me.savvy.rixa.Rixa; +import com.lunaticdev.rixa.commands.handler.CommandType; +import me.savvy.rixa.commands.handlers.Command; +import me.savvy.rixa.commands.handlers.CommandExec; +import net.dv8tion.jda.core.EmbedBuilder; +import net.dv8tion.jda.core.entities.ChannelType; +import net.dv8tion.jda.core.entities.User; +import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent; + +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.concurrent.TimeUnit; + +/** + * Created by Timber on 5/7/2017. + */ +public class InfoCommand implements CommandExec { + + @Command(aliases = {""}, + description = "Receive information about Rixa", + type = CommandType.USER, + channelType = ChannelType.TEXT, + usage = "%pinfo", mainCommand = "info") + public void execute(GuildMessageReceivedEvent event) { + EmbedBuilder messageEmbed = new EmbedBuilder(); + User botOwner = event.getJDA().getUserById("202944101333729280"); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm:ss"); + Date date1 = new Date(Rixa.getInstance().getTimeUp()); + Date date2 = new Date(); + long difference = date2.getTime() - date1.getTime(); + long seconds = difference / 1000; + int day = (int)TimeUnit.SECONDS.toDays(seconds); + long hours = TimeUnit.SECONDS.toHours(seconds) - (day *24); + long minute = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds)* 60); + long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) *60); + messageEmbed + .setTitle("Rixa Discord Bot", "http://rixa.io/") + .setDescription("Rixa is a user-friendly, multi-purpose bot that is capable of being customized to your discord server needs. " + + "Rixa is complete with a dashboard, user profile, server statistics system, and many more features such as assigning " + + "roles on user join, music module, levels, and more. Rixa was created to bring ease and simplicity to managing discord" + + " servers, it has since then grown into much more than just a bot used for moderation.") + .addField("Created", event.getJDA().getSelfUser().getCreationTime().format(formatter), true) + .addField("Bot Uptime ", "Online For: " + day + " days " + hours + " hours " + minute + " minutes " + second + " seconds.", true) + .addField("Total Guilds", event.getJDA().getGuilds().size() + "", true) + .addField("Total Users", event.getJDA().getUsers().size() + "", true) + .addField("Rixa Developer", botOwner.getName() + "#" + botOwner.getDiscriminator(), true) + .setFooter("Requested by " + event.getAuthor().getName() + "#" + event.getAuthor().getDiscriminator(), event.getAuthor().getAvatarUrl()); + event.getChannel().sendMessage(messageEmbed.build()).queue(); + } +} diff --git a/src/main/java/me/savvy/rixa/commands/general/ServerInfoCommand.java b/src/main/java/me/savvy/rixa/commands/general/ServerInfoCommand.java new file mode 100644 index 0000000..c59d2eb --- /dev/null +++ b/src/main/java/me/savvy/rixa/commands/general/ServerInfoCommand.java @@ -0,0 +1,39 @@ +package me.savvy.rixa.commands.general; + +import me.savvy.rixa.commands.handlers.Command; +import me.savvy.rixa.commands.handlers.CommandExec; +import net.dv8tion.jda.core.EmbedBuilder; +import net.dv8tion.jda.core.entities.ChannelType; +import net.dv8tion.jda.core.entities.User; +import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent; + +import java.time.format.DateTimeFormatter; + +/** + * Created by Timber on 5/7/2017. + */ +public class ServerInfoCommand implements CommandExec { + + @Command(usage = "%pserverinfo", + channelType = ChannelType.TEXT, + description = "Receive information about the server!", + aliases = "sinfo", mainCommand = "serverinfo") + public void execute(GuildMessageReceivedEvent event) { + EmbedBuilder messageEmbed = new EmbedBuilder(); + User owner = event.getGuild().getOwner().getUser(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM/dd/yyyy HH:mm:ss"); + messageEmbed + .setTitle(event.getGuild().getName(), "http://rixa.io/servers/" + event.getGuild().getId()) + .setDescription("Description") + .addField("Created", event.getGuild().getCreationTime().format(formatter), true) + .addField("Region", event.getGuild().getRegion().toString(), true) + .addField("Users", String.valueOf(event.getGuild().getMembers().size()), true) + .addField("Text Channels", String.valueOf(event.getGuild().getTextChannels().size()), true) + .addField("Voice Channels", String.valueOf(event.getGuild().getVoiceChannels().size()), true) + .addField("Roles", String.valueOf(event.getGuild().getRoles().size()), true) + .addField("Owner", owner.getName() + "#" + owner.getDiscriminator(), true) + .setThumbnail(event.getGuild().getIconUrl()) + .setFooter("ServerID: " + event.getGuild().getId(), event.getGuild().getIconUrl()); + event.getChannel().sendMessage(messageEmbed.build()).queue(); + } +} diff --git a/src/main/java/me/savvy/rixa/commands/handlers/Command.java b/src/main/java/me/savvy/rixa/commands/handlers/Command.java new file mode 100644 index 0000000..a3f31ec --- /dev/null +++ b/src/main/java/me/savvy/rixa/commands/handlers/Command.java @@ -0,0 +1,30 @@ +package me.savvy.rixa.commands.handlers; + +import net.dv8tion.jda.core.entities.ChannelType; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Created by Timber on 5/7/2017. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface Command { + + String mainCommand(); + + String[] aliases(); + + String description() default ""; + + String usage() default ""; + + CommandType type() default CommandType.USER; + + boolean showInHelp() default true; + + ChannelType channelType() default ChannelType.PRIVATE; +} diff --git a/src/main/java/me/savvy/rixa/commands/handlers/CommandExec.java b/src/main/java/me/savvy/rixa/commands/handlers/CommandExec.java new file mode 100644 index 0000000..426e865 --- /dev/null +++ b/src/main/java/me/savvy/rixa/commands/handlers/CommandExec.java @@ -0,0 +1,11 @@ +package me.savvy.rixa.commands.handlers; + +import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent; + +/** + * Created by Timber on 5/7/2017. + */ +public interface CommandExec { + + public void execute(GuildMessageReceivedEvent event); +} diff --git a/src/main/java/me/savvy/rixa/commands/handlers/CommandHandler.java b/src/main/java/me/savvy/rixa/commands/handlers/CommandHandler.java new file mode 100644 index 0000000..50774cd --- /dev/null +++ b/src/main/java/me/savvy/rixa/commands/handlers/CommandHandler.java @@ -0,0 +1,52 @@ +package me.savvy.rixa.commands.handlers; + +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; + +/** + * Created by Timber on 5/7/2017. + */ +public class CommandHandler { + + private static final Map commands = new HashMap<>(); + + public static void registerCommand(CommandExec command) { + for (Method method : command.getClass().getMethods()) { + Command annotation = method.getAnnotation(Command.class); + if (annotation == null) continue; + CommandRegistrar cmd = new CommandRegistrar(annotation, method, command); + commands.put(annotation.mainCommand(), cmd); + } + } + + public static boolean hasCommand(String s) { + if(getCommands().containsKey(s)) { + return true; + } else { + for (CommandRegistrar commandRegistrar : getCommands().values()) { + for (String string : commandRegistrar.getCommandAnnotation().aliases()) { + if (string.equalsIgnoreCase(s)) return true; + } + } + return false; + } + } + + public static CommandRegistrar get(String s) { + if(getCommands().containsKey(s)) { + return getCommands().get(s); + } else { + for (CommandRegistrar commandRegistrar : getCommands().values()) { + for (String string : commandRegistrar.getCommandAnnotation().aliases()) { + if (string.equalsIgnoreCase(s)) return commandRegistrar; + } + } + return null; + } + } + + public static Map getCommands() { + return commands; + } +} \ No newline at end of file diff --git a/src/main/java/me/savvy/rixa/commands/handlers/CommandRegistrar.java b/src/main/java/me/savvy/rixa/commands/handlers/CommandRegistrar.java new file mode 100644 index 0000000..f8259ba --- /dev/null +++ b/src/main/java/me/savvy/rixa/commands/handlers/CommandRegistrar.java @@ -0,0 +1,31 @@ +package me.savvy.rixa.commands.handlers; + +import java.lang.reflect.Method; + +/** + * Created by Timber on 5/7/2017. + */ +public class CommandRegistrar { + + private final Command annotation; + private final Method method; + private final CommandExec executor; + + CommandRegistrar(Command annotation, Method method, CommandExec executor) { + this.annotation = annotation; + this.method = method; + this.executor = executor; + } + + public Command getCommandAnnotation() { + return annotation; + } + + public Method getMethod() { + return method; + } + + public CommandExec getExecutor() { + return executor; + } +} diff --git a/src/main/java/me/savvy/rixa/commands/handlers/CommandType.java b/src/main/java/me/savvy/rixa/commands/handlers/CommandType.java new file mode 100644 index 0000000..cb6cb07 --- /dev/null +++ b/src/main/java/me/savvy/rixa/commands/handlers/CommandType.java @@ -0,0 +1,8 @@ +package me.savvy.rixa.commands.handlers; + +/** + * Created by Timber on 5/22/2017. + */ +public enum CommandType { + USER, MOD, ADMIN, BOT_OWNER; +} diff --git a/src/main/java/me/savvy/rixa/events/MessageEvent.java b/src/main/java/me/savvy/rixa/events/MessageEvent.java new file mode 100644 index 0000000..fc7fd09 --- /dev/null +++ b/src/main/java/me/savvy/rixa/events/MessageEvent.java @@ -0,0 +1,57 @@ +package me.savvy.rixa.events; + +import com.mysql.jdbc.StringUtils; +import me.savvy.rixa.commands.handlers.CommandHandler; +import me.savvy.rixa.commands.handlers.CommandRegistrar; +import me.savvy.rixa.modules.reactions.handlers.ReactRegistrar; +import me.savvy.rixa.modules.reactions.handlers.ReactionManager; +import net.dv8tion.jda.core.entities.Message; +import net.dv8tion.jda.core.entities.MessageEmbed; +import net.dv8tion.jda.core.events.message.guild.GuildMessageReceivedEvent; +import net.dv8tion.jda.core.events.message.react.MessageReactionAddEvent; +import net.dv8tion.jda.core.hooks.SubscribeEvent; + +import java.lang.reflect.Method; + +/** + * Created by Timber on 5/7/2017. + */ +public class MessageEvent { + + @SubscribeEvent + public void handle(GuildMessageReceivedEvent event) { + if (event.getGuild() == null) return; + String prefix = "/"; + if (!event.getMessage().getContent().startsWith(prefix)) return; + // Map commands = CommandHandler.getCommands(); + String[] splitContent = event.getMessage().getContent().replace(prefix, "").split(" "); + if(!CommandHandler.hasCommand(splitContent[0])) { return; } + //if (!commands.containsKey(splitContent[0])) return; + CommandRegistrar cmd = CommandHandler.get(splitContent[0]); + //CommandRegistrar cmd = commands.get(splitContent[0]); + Method m = cmd.getMethod(); + try { + m.invoke(cmd.getExecutor(), event); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @SubscribeEvent + public void onReact(MessageReactionAddEvent event) { + Message message = event.getChannel().getMessageById(event.getMessageId()).complete(); + if(message == null || message.getEmbeds().size() != 1) return; + MessageEmbed embed = message.getEmbeds().get(0); + if(StringUtils.isNullOrEmpty(embed.getTitle())) return; + String[] titleSplit = embed.getTitle().split(": "); + if(ReactionManager.getReactions().containsKey(titleSplit[0])) { + ReactRegistrar reactRegistrar = ReactionManager.getReactions().get(titleSplit[0]); + Method m = reactRegistrar.getMethod(); + try { + m.invoke(reactRegistrar.getExecutor(), event); + } catch (Exception e) { + e.printStackTrace(); + } + } + } +} diff --git a/src/main/java/me/savvy/rixa/modules/RixaModule.java b/src/main/java/me/savvy/rixa/modules/RixaModule.java new file mode 100644 index 0000000..b688aba --- /dev/null +++ b/src/main/java/me/savvy/rixa/modules/RixaModule.java @@ -0,0 +1,11 @@ +package me.savvy.rixa.modules; + +/** + * Created by Timber on 5/23/2017. + */ +public interface RixaModule { + + String getName(); + + String getDescription(); +} diff --git a/src/main/java/me/savvy/rixa/modules/levels/LevelsModule.java b/src/main/java/me/savvy/rixa/modules/levels/LevelsModule.java new file mode 100644 index 0000000..8fba8d6 --- /dev/null +++ b/src/main/java/me/savvy/rixa/modules/levels/LevelsModule.java @@ -0,0 +1,18 @@ +package me.savvy.rixa.modules.levels; + +import me.savvy.rixa.modules.RixaModule; + +/** + * Created by Timber on 5/23/2017. + */ +public class LevelsModule implements RixaModule { + @Override + public String getName() { + return "Levels"; + } + + @Override + public String getDescription() { + return ""; + } +} diff --git a/src/main/java/me/savvy/rixa/modules/music/MusicModule.java b/src/main/java/me/savvy/rixa/modules/music/MusicModule.java new file mode 100644 index 0000000..2b63e09 --- /dev/null +++ b/src/main/java/me/savvy/rixa/modules/music/MusicModule.java @@ -0,0 +1,18 @@ +package me.savvy.rixa.modules.music; + +import me.savvy.rixa.modules.RixaModule; + +/** + * Created by Timber on 5/23/2017. + */ +public class MusicModule implements RixaModule { + @Override + public String getName() { + return "Music"; + } + + @Override + public String getDescription() { + return ""; + } +} diff --git a/src/main/java/me/savvy/rixa/modules/reactions/ReactionModule.java b/src/main/java/me/savvy/rixa/modules/reactions/ReactionModule.java new file mode 100644 index 0000000..8d9838d --- /dev/null +++ b/src/main/java/me/savvy/rixa/modules/reactions/ReactionModule.java @@ -0,0 +1,7 @@ +package me.savvy.rixa.modules.reactions; + +/** + * Created by Timber on 5/23/2017. + */ +public class ReactionModule { +} diff --git a/src/main/java/me/savvy/rixa/modules/reactions/handlers/React.java b/src/main/java/me/savvy/rixa/modules/reactions/handlers/React.java new file mode 100644 index 0000000..e9a0c85 --- /dev/null +++ b/src/main/java/me/savvy/rixa/modules/reactions/handlers/React.java @@ -0,0 +1,11 @@ +package me.savvy.rixa.modules.reactions.handlers; + +import net.dv8tion.jda.core.events.message.react.MessageReactionAddEvent; + +/** + * Created by Timber on 5/7/2017. + */ +public interface React { + + public void reactionTrigger(MessageReactionAddEvent event); +} diff --git a/src/main/java/me/savvy/rixa/modules/reactions/handlers/ReactHandle.java b/src/main/java/me/savvy/rixa/modules/reactions/handlers/ReactHandle.java new file mode 100644 index 0000000..669a25d --- /dev/null +++ b/src/main/java/me/savvy/rixa/modules/reactions/handlers/ReactHandle.java @@ -0,0 +1,18 @@ +package me.savvy.rixa.modules.reactions.handlers; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Created by Timber on 5/7/2017. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface ReactHandle { + + String title() default ""; + + String description() default ""; +} diff --git a/src/main/java/me/savvy/rixa/modules/reactions/handlers/ReactRegistrar.java b/src/main/java/me/savvy/rixa/modules/reactions/handlers/ReactRegistrar.java new file mode 100644 index 0000000..4a7e13c --- /dev/null +++ b/src/main/java/me/savvy/rixa/modules/reactions/handlers/ReactRegistrar.java @@ -0,0 +1,31 @@ +package me.savvy.rixa.modules.reactions.handlers; + +import java.lang.reflect.Method; + +/** + * Created by Timber on 5/7/2017. + */ +public class ReactRegistrar { + + private final ReactHandle annotation; + private final Method method; + private final React executor; + + ReactRegistrar(ReactHandle annotation, Method method, React executor) { + this.annotation = annotation; + this.method = method; + this.executor = executor; + } + + public ReactHandle getReactAnnotation() { + return annotation; + } + + public Method getMethod() { + return method; + } + + public React getExecutor() { + return executor; + } +} diff --git a/src/main/java/me/savvy/rixa/modules/reactions/handlers/ReactionManager.java b/src/main/java/me/savvy/rixa/modules/reactions/handlers/ReactionManager.java new file mode 100644 index 0000000..5e5cef5 --- /dev/null +++ b/src/main/java/me/savvy/rixa/modules/reactions/handlers/ReactionManager.java @@ -0,0 +1,26 @@ +package me.savvy.rixa.modules.reactions.handlers; + +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; + +/** + * Created by Timber on 5/7/2017. + */ +public class ReactionManager { + + private static final Map reactions = new HashMap<>(); + + public static void registerReaction(React react) { + for (Method method : react.getClass().getMethods()) { + ReactHandle annotation = method.getAnnotation(ReactHandle.class); + if (annotation == null) continue; + ReactRegistrar ant = new ReactRegistrar(annotation, method, react); + reactions.put(annotation.title(), ant); + } + } + + public static Map getReactions() { + return reactions; + } +} \ No newline at end of file diff --git a/src/main/java/me/savvy/rixa/modules/reactions/react/HelpReaction.java b/src/main/java/me/savvy/rixa/modules/reactions/react/HelpReaction.java new file mode 100644 index 0000000..761c3a8 --- /dev/null +++ b/src/main/java/me/savvy/rixa/modules/reactions/react/HelpReaction.java @@ -0,0 +1,89 @@ +package me.savvy.rixa.modules.reactions.react; + +import com.lunaticdev.rixa.commands.handler.CommandHandler; +import com.lunaticdev.rixa.commands.handler.CommandType; +import me.savvy.rixa.modules.reactions.handlers.React; +import me.savvy.rixa.modules.reactions.handlers.ReactHandle; +import net.dv8tion.jda.core.EmbedBuilder; +import net.dv8tion.jda.core.entities.ChannelType; +import net.dv8tion.jda.core.entities.Message; +import net.dv8tion.jda.core.events.message.react.MessageReactionAddEvent; +import net.dv8tion.jda.core.exceptions.ErrorResponseException; + +/** + * Created by Timber on 5/21/2017. + */ +public class HelpReaction implements React { + + @Override + @ReactHandle(title = "Help", description = "Help menu for Rixa") + public void reactionTrigger(MessageReactionAddEvent event) { + if(event.getChannel().getType() != ChannelType.PRIVATE + || event.getUser().getId().equalsIgnoreCase(event.getJDA().getSelfUser().getId())) { + return; + } + Message message = event.getChannel().getMessageById(event.getMessageId()).complete(); + EmbedBuilder embedBuilder; + try { + switch(event.getReaction().getEmote().getName()) { + case "\uD83D\uDDD1":// waste bin + if (message.getAuthor().getId().equalsIgnoreCase(event.getJDA().getSelfUser().getId())) { + message.delete().complete(); + } + break; + case "\u0031\u20E3":// one emoji + embedBuilder = new EmbedBuilder(); + String stringBuilder = "\u2753" + + " **General Commands Help**" + + "\n" + + "Click a number below for information about other commands."; + embedBuilder.setTitle("Help", "http://rixa.io"); + embedBuilder.setDescription(stringBuilder); + CommandHandler.getCommands().values().stream().filter(cmd -> cmd.getType() == CommandType.USER) + .forEach(cmd -> embedBuilder.addField("/"/*prefix*/ + cmd.getPrefix(), cmd.getDescription(), false)); + message.editMessage(embedBuilder.build()).queue();// = event.getChannel().sendMessage(embedBuilder.build()).complete(); + break; + case "\u0032\u20E3": // two emoji + embedBuilder = new EmbedBuilder(); + stringBuilder = "\u2753" + + " **Staff Commands Help**" + + "\n" + + "Click a number below for information about other commands."; + embedBuilder.setTitle("Help", "http://rixa.io"); + embedBuilder.setDescription(stringBuilder); + CommandHandler.getCommands().values().stream().filter(cmd -> cmd.getType() == CommandType.ADMIN || cmd.getType() == CommandType.MOD) + .forEach(cmd -> embedBuilder.addField("/"/*prefix*/ + cmd.getPrefix(), cmd.getDescription(), false)); + message.editMessage(embedBuilder.build()).queue(); + break; + case "\u0033\u20E3": // three emoji + embedBuilder = new EmbedBuilder(); + stringBuilder = "\u2753" + + " **Music Commands Help**" + + "\n" + + "Click a number below for information about other commands."; + embedBuilder.setTitle("Help", "http://rixa.io"); + embedBuilder.setDescription(stringBuilder); + String prefix = "/"; + embedBuilder.addField(prefix + "music join [name]", "Joins a voice channel that has the provided name", false) + .addField(prefix + "music join [id]", "Joins a voice channel based on the provided id.", false) + .addField(prefix + "music leave", "Leaves the voice channel that the bot is currently in.", false) + .addField(prefix + "music play", "Plays songs from the current queue. Starts playing again if it was previously paused", false) + .addField(prefix + "music play [url]", "Adds a new song to the queue and starts playing if it wasn't playing already", false) + .addField(prefix + "music pplay", "Adds a playlist to the queue and starts playing if not already playing", false) + .addField(prefix + "music pause", "Pauses audio playback", false) + .addField(prefix + "music stop", "Completely stops audio playback, skipping the current song.", false) + .addField(prefix + "music skip", "Skips the current song, automatically starting the next", false) + .addField(prefix + "music nowplaying", "Prints information about the currently playing song (title, current time)", false) + .addField(prefix + "music np", "Alias for nowplaying", false) + .addField(prefix + "music list", "Lists the songs in the queue", false) + .addField(prefix + "music volume [vol]", "Sets the volume of the MusicPlayer [10 - 100]", false) + .addField(prefix + "music restart", "Restarts the current song or restarts the previous song if there is no current song playing.", false) + .addField(prefix + "music repeat", "Makes the player repeat the currently playing song", false) + .addField(prefix + "music reset", "Completely resets the player, fixing all errors and clearing the queue.", false); + message.editMessage(embedBuilder.build()).queue(); + break; + } + } catch (ErrorResponseException ignored) { + } + } +} diff --git a/src/main/java/me/savvy/rixa/modules/reactions/react/PollReaction.java b/src/main/java/me/savvy/rixa/modules/reactions/react/PollReaction.java new file mode 100644 index 0000000..3d7a08c --- /dev/null +++ b/src/main/java/me/savvy/rixa/modules/reactions/react/PollReaction.java @@ -0,0 +1,18 @@ +package me.savvy.rixa.modules.reactions.react; + +import me.savvy.rixa.modules.reactions.handlers.React; +import me.savvy.rixa.modules.reactions.handlers.ReactHandle; +import net.dv8tion.jda.core.entities.Message; +import net.dv8tion.jda.core.events.message.react.MessageReactionAddEvent; + +/** + * Created by Timber on 5/7/2017. + */ +public class PollReaction implements React { + + @Override + @ReactHandle(title = "Poll", description = "Host polls right from your discord server!") + public void reactionTrigger(MessageReactionAddEvent event) { + Message message = event.getChannel().getMessageById(event.getMessageId()).complete(); + } +} diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml new file mode 100644 index 0000000..57c0051 --- /dev/null +++ b/src/main/resources/config.yml @@ -0,0 +1,3 @@ +bot: + token: tl2gu6rqrzZ0WotSGq_EiIVsiYnyWDOh + game: 'Minecraft' \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..c3e8b2b --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,4 @@ +name: RixaMC +main: me.savvy.RixaMC +author: [Savvy] +version: 1.0 \ No newline at end of file