mirror of
https://github.com/songoda/EpicVouchers.git
synced 2025-01-21 23:11:30 +01:00
Cleanup project
This commit is contained in:
parent
c6a4abf736
commit
a943cc9389
311
.editorconfig
Normal file
311
.editorconfig
Normal file
@ -0,0 +1,311 @@
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
# max_line_length = 120
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = true
|
||||
ij_continuation_indent_size = 8
|
||||
ij_formatter_off_tag = @formatter:off
|
||||
ij_formatter_on_tag = @formatter:on
|
||||
ij_formatter_tags_enabled = false
|
||||
ij_smart_tabs = false
|
||||
ij_visual_guides = none
|
||||
ij_wrap_on_typing = false
|
||||
|
||||
[*.java]
|
||||
ij_smart_tabs = true
|
||||
ij_java_align_consecutive_assignments = false
|
||||
ij_java_align_consecutive_variable_declarations = false
|
||||
ij_java_align_group_field_declarations = false
|
||||
ij_java_align_multiline_annotation_parameters = false
|
||||
ij_java_align_multiline_array_initializer_expression = false
|
||||
ij_java_align_multiline_assignment = false
|
||||
ij_java_align_multiline_binary_operation = false
|
||||
ij_java_align_multiline_chained_methods = false
|
||||
ij_java_align_multiline_extends_list = false
|
||||
ij_java_align_multiline_for = true
|
||||
ij_java_align_multiline_method_parentheses = false
|
||||
ij_java_align_multiline_parameters = true
|
||||
ij_java_align_multiline_parameters_in_calls = false
|
||||
ij_java_align_multiline_parenthesized_expression = false
|
||||
ij_java_align_multiline_records = true
|
||||
ij_java_align_multiline_resources = true
|
||||
ij_java_align_multiline_ternary_operation = false
|
||||
ij_java_align_multiline_text_blocks = false
|
||||
ij_java_align_multiline_throws_list = false
|
||||
ij_java_align_subsequent_simple_methods = false
|
||||
ij_java_align_throws_keyword = false
|
||||
ij_java_annotation_parameter_wrap = off
|
||||
ij_java_array_initializer_new_line_after_left_brace = false
|
||||
ij_java_array_initializer_right_brace_on_new_line = false
|
||||
ij_java_array_initializer_wrap = off
|
||||
ij_java_assert_statement_colon_on_next_line = false
|
||||
ij_java_assert_statement_wrap = off
|
||||
ij_java_assignment_wrap = off
|
||||
ij_java_binary_operation_sign_on_next_line = false
|
||||
ij_java_binary_operation_wrap = off
|
||||
ij_java_blank_lines_after_anonymous_class_header = 0
|
||||
ij_java_blank_lines_after_class_header = 0
|
||||
ij_java_blank_lines_after_imports = 1
|
||||
ij_java_blank_lines_after_package = 1
|
||||
ij_java_blank_lines_around_class = 1
|
||||
ij_java_blank_lines_around_field = 0
|
||||
ij_java_blank_lines_around_field_in_interface = 0
|
||||
ij_java_blank_lines_around_initializer = 1
|
||||
ij_java_blank_lines_around_method = 1
|
||||
ij_java_blank_lines_around_method_in_interface = 1
|
||||
ij_java_blank_lines_before_class_end = 0
|
||||
ij_java_blank_lines_before_imports = 1
|
||||
ij_java_blank_lines_before_method_body = 0
|
||||
ij_java_blank_lines_before_package = 0
|
||||
ij_java_block_brace_style = end_of_line
|
||||
ij_java_block_comment_at_first_column = true
|
||||
ij_java_builder_methods = none
|
||||
ij_java_call_parameters_new_line_after_left_paren = false
|
||||
ij_java_call_parameters_right_paren_on_new_line = false
|
||||
ij_java_call_parameters_wrap = off
|
||||
ij_java_case_statement_on_separate_line = true
|
||||
ij_java_catch_on_new_line = false
|
||||
ij_java_class_annotation_wrap = split_into_lines
|
||||
ij_java_class_brace_style = end_of_line
|
||||
ij_java_class_count_to_use_import_on_demand = 15
|
||||
ij_java_class_names_in_javadoc = 1
|
||||
ij_java_do_not_indent_top_level_class_members = false
|
||||
ij_java_do_not_wrap_after_single_annotation = false
|
||||
ij_java_do_while_brace_force = never
|
||||
ij_java_doc_add_blank_line_after_description = true
|
||||
ij_java_doc_add_blank_line_after_param_comments = true
|
||||
ij_java_doc_add_blank_line_after_return = true
|
||||
ij_java_doc_add_p_tag_on_empty_lines = true
|
||||
ij_java_doc_align_exception_comments = true
|
||||
ij_java_doc_align_param_comments = true
|
||||
ij_java_doc_do_not_wrap_if_one_line = true
|
||||
ij_java_doc_enable_formatting = true
|
||||
ij_java_doc_enable_leading_asterisks = true
|
||||
ij_java_doc_indent_on_continuation = true
|
||||
ij_java_doc_keep_empty_lines = true
|
||||
ij_java_doc_keep_empty_parameter_tag = true
|
||||
ij_java_doc_keep_empty_return_tag = true
|
||||
ij_java_doc_keep_empty_throws_tag = true
|
||||
ij_java_doc_keep_invalid_tags = true
|
||||
ij_java_doc_param_description_on_new_line = false
|
||||
ij_java_doc_preserve_line_breaks = false
|
||||
ij_java_doc_use_throws_not_exception_tag = true
|
||||
ij_java_else_on_new_line = false
|
||||
ij_java_enum_constants_wrap = off
|
||||
ij_java_extends_keyword_wrap = off
|
||||
ij_java_extends_list_wrap = off
|
||||
ij_java_field_annotation_wrap = split_into_lines
|
||||
ij_java_finally_on_new_line = false
|
||||
ij_java_for_brace_force = never
|
||||
ij_java_for_statement_new_line_after_left_paren = false
|
||||
ij_java_for_statement_right_paren_on_new_line = false
|
||||
ij_java_for_statement_wrap = off
|
||||
ij_java_generate_final_locals = false
|
||||
ij_java_generate_final_parameters = false
|
||||
ij_java_if_brace_force = never
|
||||
ij_java_imports_layout = *, |, javax.**, java.**, |, $*
|
||||
ij_java_indent_case_from_switch = true
|
||||
ij_java_insert_inner_class_imports = false
|
||||
ij_java_insert_override_annotation = true
|
||||
ij_java_keep_blank_lines_before_right_brace = 0
|
||||
ij_java_keep_blank_lines_between_package_declaration_and_header = 0
|
||||
ij_java_keep_blank_lines_in_code = 1
|
||||
ij_java_keep_blank_lines_in_declarations = 1
|
||||
ij_java_keep_builder_methods_indents = false
|
||||
ij_java_keep_control_statement_in_one_line = true
|
||||
ij_java_keep_first_column_comment = true
|
||||
ij_java_keep_indents_on_empty_lines = false
|
||||
ij_java_keep_line_breaks = true
|
||||
ij_java_keep_multiple_expressions_in_one_line = false
|
||||
ij_java_keep_simple_blocks_in_one_line = false
|
||||
ij_java_keep_simple_classes_in_one_line = true
|
||||
ij_java_keep_simple_lambdas_in_one_line = true
|
||||
ij_java_keep_simple_methods_in_one_line = true
|
||||
ij_java_label_indent_absolute = false
|
||||
ij_java_label_indent_size = 0
|
||||
ij_java_lambda_brace_style = end_of_line
|
||||
ij_java_layout_static_imports_separately = true
|
||||
ij_java_line_comment_add_space = false
|
||||
ij_java_line_comment_at_first_column = true
|
||||
ij_java_method_annotation_wrap = split_into_lines
|
||||
ij_java_method_brace_style = end_of_line
|
||||
ij_java_method_call_chain_wrap = off
|
||||
ij_java_method_parameters_new_line_after_left_paren = false
|
||||
ij_java_method_parameters_right_paren_on_new_line = false
|
||||
ij_java_method_parameters_wrap = off
|
||||
ij_java_modifier_list_wrap = false
|
||||
ij_java_names_count_to_use_import_on_demand = 9
|
||||
ij_java_new_line_after_lparen_in_record_header = false
|
||||
ij_java_packages_to_use_import_on_demand = _java.awt.*, _javax.swing.*
|
||||
ij_java_parameter_annotation_wrap = off
|
||||
ij_java_parentheses_expression_new_line_after_left_paren = false
|
||||
ij_java_parentheses_expression_right_paren_on_new_line = false
|
||||
ij_java_place_assignment_sign_on_next_line = false
|
||||
ij_java_prefer_longer_names = true
|
||||
ij_java_prefer_parameters_wrap = false
|
||||
ij_java_record_components_wrap = normal
|
||||
ij_java_repeat_synchronized = true
|
||||
ij_java_replace_instanceof_and_cast = true
|
||||
ij_java_replace_null_check = true
|
||||
ij_java_replace_sum_lambda_with_method_ref = true
|
||||
ij_java_resource_list_new_line_after_left_paren = false
|
||||
ij_java_resource_list_right_paren_on_new_line = false
|
||||
ij_java_resource_list_wrap = off
|
||||
ij_java_rparen_on_new_line_in_record_header = false
|
||||
ij_java_space_after_closing_angle_bracket_in_type_argument = false
|
||||
ij_java_space_after_colon = true
|
||||
ij_java_space_after_comma = true
|
||||
ij_java_space_after_comma_in_type_arguments = true
|
||||
ij_java_space_after_for_semicolon = true
|
||||
ij_java_space_after_quest = true
|
||||
ij_java_space_after_type_cast = true
|
||||
ij_java_space_before_annotation_array_initializer_left_brace = false
|
||||
ij_java_space_before_annotation_parameter_list = false
|
||||
ij_java_space_before_array_initializer_left_brace = true
|
||||
ij_java_space_before_catch_keyword = true
|
||||
ij_java_space_before_catch_left_brace = true
|
||||
ij_java_space_before_catch_parentheses = true
|
||||
ij_java_space_before_class_left_brace = true
|
||||
ij_java_space_before_colon = true
|
||||
ij_java_space_before_colon_in_foreach = true
|
||||
ij_java_space_before_comma = false
|
||||
ij_java_space_before_do_left_brace = true
|
||||
ij_java_space_before_else_keyword = true
|
||||
ij_java_space_before_else_left_brace = true
|
||||
ij_java_space_before_finally_keyword = true
|
||||
ij_java_space_before_finally_left_brace = true
|
||||
ij_java_space_before_for_left_brace = true
|
||||
ij_java_space_before_for_parentheses = true
|
||||
ij_java_space_before_for_semicolon = false
|
||||
ij_java_space_before_if_left_brace = true
|
||||
ij_java_space_before_if_parentheses = true
|
||||
ij_java_space_before_method_call_parentheses = false
|
||||
ij_java_space_before_method_left_brace = true
|
||||
ij_java_space_before_method_parentheses = false
|
||||
ij_java_space_before_opening_angle_bracket_in_type_parameter = false
|
||||
ij_java_space_before_quest = true
|
||||
ij_java_space_before_switch_left_brace = true
|
||||
ij_java_space_before_switch_parentheses = true
|
||||
ij_java_space_before_synchronized_left_brace = true
|
||||
ij_java_space_before_synchronized_parentheses = true
|
||||
ij_java_space_before_try_left_brace = true
|
||||
ij_java_space_before_try_parentheses = true
|
||||
ij_java_space_before_type_parameter_list = false
|
||||
ij_java_space_before_while_keyword = true
|
||||
ij_java_space_before_while_left_brace = true
|
||||
ij_java_space_before_while_parentheses = true
|
||||
ij_java_space_inside_one_line_enum_braces = false
|
||||
ij_java_space_within_empty_array_initializer_braces = true
|
||||
ij_java_space_within_empty_method_call_parentheses = false
|
||||
ij_java_space_within_empty_method_parentheses = false
|
||||
ij_java_spaces_around_additive_operators = true
|
||||
ij_java_spaces_around_assignment_operators = true
|
||||
ij_java_spaces_around_bitwise_operators = true
|
||||
ij_java_spaces_around_equality_operators = true
|
||||
ij_java_spaces_around_lambda_arrow = true
|
||||
ij_java_spaces_around_logical_operators = true
|
||||
ij_java_spaces_around_method_ref_dbl_colon = false
|
||||
ij_java_spaces_around_multiplicative_operators = true
|
||||
ij_java_spaces_around_relational_operators = true
|
||||
ij_java_spaces_around_shift_operators = true
|
||||
ij_java_spaces_around_type_bounds_in_type_parameters = true
|
||||
ij_java_spaces_around_unary_operator = false
|
||||
ij_java_spaces_within_angle_brackets = false
|
||||
ij_java_spaces_within_annotation_parentheses = false
|
||||
ij_java_spaces_within_array_initializer_braces = false
|
||||
ij_java_spaces_within_braces = true
|
||||
ij_java_spaces_within_brackets = false
|
||||
ij_java_spaces_within_cast_parentheses = false
|
||||
ij_java_spaces_within_catch_parentheses = false
|
||||
ij_java_spaces_within_for_parentheses = false
|
||||
ij_java_spaces_within_if_parentheses = false
|
||||
ij_java_spaces_within_method_call_parentheses = false
|
||||
ij_java_spaces_within_method_parentheses = false
|
||||
ij_java_spaces_within_parentheses = false
|
||||
ij_java_spaces_within_record_header = false
|
||||
ij_java_spaces_within_switch_parentheses = false
|
||||
ij_java_spaces_within_synchronized_parentheses = false
|
||||
ij_java_spaces_within_try_parentheses = false
|
||||
ij_java_spaces_within_while_parentheses = false
|
||||
ij_java_special_else_if_treatment = true
|
||||
ij_java_subclass_name_suffix = Impl
|
||||
ij_java_ternary_operation_signs_on_next_line = false
|
||||
ij_java_ternary_operation_wrap = off
|
||||
ij_java_test_name_suffix = Test
|
||||
ij_java_throws_keyword_wrap = off
|
||||
ij_java_throws_list_wrap = off
|
||||
ij_java_use_external_annotations = false
|
||||
ij_java_use_fq_class_names = false
|
||||
ij_java_use_relative_indents = false
|
||||
ij_java_use_single_class_imports = true
|
||||
ij_java_variable_annotation_wrap = off
|
||||
ij_java_visibility = public
|
||||
ij_java_while_brace_force = never
|
||||
ij_java_while_on_new_line = false
|
||||
ij_java_wrap_comments = false
|
||||
ij_java_wrap_first_method_in_call_chain = false
|
||||
ij_java_wrap_long_lines = false
|
||||
|
||||
[*.properties]
|
||||
ij_properties_align_group_field_declarations = false
|
||||
ij_properties_keep_blank_lines = false
|
||||
ij_properties_key_value_delimiter = equals
|
||||
ij_properties_spaces_around_key_value_delimiter = false
|
||||
|
||||
[.editorconfig]
|
||||
ij_editorconfig_align_group_field_declarations = false
|
||||
ij_editorconfig_space_after_colon = false
|
||||
ij_editorconfig_space_after_comma = true
|
||||
ij_editorconfig_space_before_colon = false
|
||||
ij_editorconfig_space_before_comma = false
|
||||
ij_editorconfig_spaces_around_assignment_operators = true
|
||||
|
||||
[{*.ant, *.fxml, *.jhm, *.jnlp, *.jrxml, *.pom, *.rng, *.tld, *.wsdl, *.xml, *.xsd, *.xsl, *.xslt, *.xul}]
|
||||
ij_xml_align_attributes = true
|
||||
ij_xml_align_text = false
|
||||
ij_xml_attribute_wrap = normal
|
||||
ij_xml_block_comment_at_first_column = true
|
||||
ij_xml_keep_blank_lines = 2
|
||||
ij_xml_keep_indents_on_empty_lines = false
|
||||
ij_xml_keep_line_breaks = true
|
||||
ij_xml_keep_line_breaks_in_text = true
|
||||
ij_xml_keep_whitespaces = false
|
||||
ij_xml_keep_whitespaces_around_cdata = preserve
|
||||
ij_xml_keep_whitespaces_inside_cdata = false
|
||||
ij_xml_line_comment_at_first_column = true
|
||||
ij_xml_space_after_tag_name = false
|
||||
ij_xml_space_around_equals_in_attribute = false
|
||||
ij_xml_space_inside_empty_tag = false
|
||||
ij_xml_text_wrap = normal
|
||||
|
||||
[{*.markdown, *.md}]
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
ij_markdown_force_one_space_after_blockquote_symbol = true
|
||||
ij_markdown_force_one_space_after_header_symbol = true
|
||||
ij_markdown_force_one_space_after_list_bullet = true
|
||||
ij_markdown_force_one_space_between_words = true
|
||||
ij_markdown_keep_indents_on_empty_lines = false
|
||||
ij_markdown_max_lines_around_block_elements = 1
|
||||
ij_markdown_max_lines_around_header = 1
|
||||
ij_markdown_max_lines_between_paragraphs = 1
|
||||
ij_markdown_min_lines_around_block_elements = 1
|
||||
ij_markdown_min_lines_around_header = 1
|
||||
ij_markdown_min_lines_between_paragraphs = 1
|
||||
|
||||
[{*.yaml, *.yml, *.lang}]
|
||||
indent_size = 2
|
||||
ij_yaml_align_values_properties = do_not_align
|
||||
ij_yaml_autoinsert_sequence_marker = true
|
||||
ij_yaml_block_mapping_on_new_line = false
|
||||
ij_yaml_indent_sequence_value = true
|
||||
ij_yaml_keep_indents_on_empty_lines = false
|
||||
ij_yaml_keep_line_breaks = true
|
||||
ij_yaml_sequence_on_new_line = false
|
||||
ij_yaml_space_before_colon = false
|
||||
ij_yaml_spaces_within_braces = true
|
||||
ij_yaml_spaces_within_brackets = true
|
9
.gitignore
vendored
9
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
\.idea
|
||||
\target
|
||||
EpicVouchers.iml
|
||||
dependency-reduced-pom.xml
|
||||
/target/
|
||||
|
||||
# JetBrains IDEs
|
||||
/.idea/
|
||||
*.iml
|
||||
|
@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="minecraft" name="Minecraft">
|
||||
<configuration>
|
||||
<autoDetectTypes>
|
||||
<platformType>SPIGOT</platformType>
|
||||
</autoDetectTypes>
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.13.2" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.14" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.songoda:songodaupdater:1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: co.aikar:acf-bukkit:0.5.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: co.aikar:acf-core:0.5.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: co.aikar:Table:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: co.aikar:DelegatingMap:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: co.aikar:locales:1.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.jodah:expiringmap:0.5.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: co.aikar:minecraft-timings:1.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jetbrains:annotations:13.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bstats:bstats-bukkit:1.4" level="project" />
|
||||
</component>
|
||||
</module>
|
2
LICENSE
2
LICENSE
@ -6,4 +6,4 @@ The same distribution rights and limitations above shall similarly apply to any
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
@ -1,20 +0,0 @@
|
||||
Hey loves,
|
||||
|
||||
Thanks for downloading our plugin ^_^ In order to
|
||||
run it you will need a plugin called arconix. It
|
||||
basically takes a bunch of methods that we use all
|
||||
over the place throughout our plugin lineup and
|
||||
stores it in one place so we don't have to write
|
||||
new code every time we need to get something simple
|
||||
done. So make sure to stay up to date with the latest
|
||||
updates for it.
|
||||
|
||||
Link to download:
|
||||
https://gitlab.com/Songoda/Arconix/-/jobs/artifacts/master/download?job=build
|
||||
|
||||
If you need help you can always join our
|
||||
discord in which is listed at the bottom of all of
|
||||
our plugin pages.
|
||||
|
||||
Enjoy <3
|
||||
Brianna & The Songoda Team.
|
66
pom.xml
66
pom.xml
@ -1,47 +1,45 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>EpicVouchers</artifactId>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<version>2.1.21</version>
|
||||
|
||||
<name>EpicVouchers</name>
|
||||
<description>Enhance your server with awesome customizable vouchers with a lot of features.</description>
|
||||
<url>https://songoda.com/marketplace/product/25</url>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<java.release>8</java.release>
|
||||
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<defaultGoal>clean install</defaultGoal>
|
||||
<finalName>EpicVouchers-${project.version}</finalName>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>3.8.1</version>
|
||||
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.google.code.maven-replacer-plugin</groupId>
|
||||
<artifactId>replacer</artifactId>
|
||||
<version>1.5.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>replace</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<file>${project.build.directory}/classes/plugin.yml</file>
|
||||
<replacements>
|
||||
<replacement>
|
||||
<token>maven-version-number</token>
|
||||
<value>${project.version}</value>
|
||||
</replacement>
|
||||
</replacements>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.3.0-SNAPSHOT</version>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>shaded</id>
|
||||
@ -49,14 +47,17 @@
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
|
||||
<configuration>
|
||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>com.songoda:SongodaCore</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
@ -67,6 +68,7 @@
|
||||
</excludes>
|
||||
</filter>
|
||||
</filters>
|
||||
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>com.songoda.core</pattern>
|
||||
@ -78,6 +80,7 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
@ -85,18 +88,21 @@
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>apache.snapshots</id>
|
||||
<url>https://repository.apache.org/snapshots/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>public</id>
|
||||
<id>songoda-public</id>
|
||||
<url>https://repo.songoda.com/repository/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
@ -104,16 +110,18 @@
|
||||
<version>1.17</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.2</version>
|
||||
<version>1.18.20</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -6,7 +6,14 @@ import com.songoda.core.commands.CommandManager;
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.configuration.Config;
|
||||
import com.songoda.core.gui.GuiManager;
|
||||
import com.songoda.epicvouchers.commands.*;
|
||||
import com.songoda.epicvouchers.commands.CommandEditor;
|
||||
import com.songoda.epicvouchers.commands.CommandEpicVouchers;
|
||||
import com.songoda.epicvouchers.commands.CommandForce;
|
||||
import com.songoda.epicvouchers.commands.CommandForceAll;
|
||||
import com.songoda.epicvouchers.commands.CommandGive;
|
||||
import com.songoda.epicvouchers.commands.CommandGiveAll;
|
||||
import com.songoda.epicvouchers.commands.CommandList;
|
||||
import com.songoda.epicvouchers.commands.CommandReload;
|
||||
import com.songoda.epicvouchers.handlers.Connections;
|
||||
import com.songoda.epicvouchers.libraries.inventory.FastInv;
|
||||
import com.songoda.epicvouchers.libraries.inventory.IconInv;
|
||||
@ -27,7 +34,6 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class EpicVouchers extends SongodaPlugin {
|
||||
|
||||
private static EpicVouchers INSTANCE;
|
||||
|
||||
private final GuiManager guiManager = new GuiManager(this);
|
||||
@ -37,7 +43,7 @@ public class EpicVouchers extends SongodaPlugin {
|
||||
private Connections connections;
|
||||
private CoolDownManager coolDowns;
|
||||
private VoucherExecutor voucherExecutor;
|
||||
private Config vouchersConfig = new Config(this, "vouchers.yml");
|
||||
private final Config vouchersConfig = new Config(this, "vouchers.yml");
|
||||
|
||||
public static EpicVouchers getInstance() {
|
||||
return INSTANCE;
|
||||
@ -241,4 +247,4 @@ public class EpicVouchers extends SongodaPlugin {
|
||||
public GuiManager getGuiManager() {
|
||||
return guiManager;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ import org.bukkit.entity.Player;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandEditor extends AbstractCommand {
|
||||
|
||||
final EpicVouchers instance;
|
||||
|
||||
public CommandEditor(EpicVouchers instance) {
|
||||
|
@ -8,7 +8,6 @@ import org.bukkit.command.CommandSender;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandEpicVouchers extends AbstractCommand {
|
||||
|
||||
final EpicVouchers instance;
|
||||
|
||||
public CommandEpicVouchers(EpicVouchers instance) {
|
||||
|
@ -8,14 +8,12 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CommandForce extends AbstractCommand {
|
||||
|
||||
final EpicVouchers instance;
|
||||
|
||||
public CommandForce(EpicVouchers instance) {
|
||||
|
@ -12,7 +12,6 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CommandForceAll extends AbstractCommand {
|
||||
|
||||
final EpicVouchers instance;
|
||||
|
||||
public CommandForceAll(EpicVouchers instance) {
|
||||
|
@ -2,21 +2,18 @@ package com.songoda.epicvouchers.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicvouchers.EpicVouchers;
|
||||
import com.songoda.epicvouchers.menus.VoucherMenu;
|
||||
import com.songoda.epicvouchers.voucher.Voucher;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CommandGive extends AbstractCommand {
|
||||
|
||||
final EpicVouchers instance;
|
||||
|
||||
public CommandGive(EpicVouchers instance) {
|
||||
|
@ -3,19 +3,13 @@ package com.songoda.epicvouchers.commands;
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicvouchers.EpicVouchers;
|
||||
import com.songoda.epicvouchers.voucher.Voucher;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CommandGiveAll extends AbstractCommand {
|
||||
|
||||
final EpicVouchers instance;
|
||||
|
||||
public CommandGiveAll(EpicVouchers instance) {
|
||||
|
@ -2,16 +2,13 @@ package com.songoda.epicvouchers.commands;
|
||||
|
||||
import com.songoda.core.commands.AbstractCommand;
|
||||
import com.songoda.epicvouchers.EpicVouchers;
|
||||
import com.songoda.epicvouchers.menus.VoucherMenu;
|
||||
import com.songoda.epicvouchers.voucher.Voucher;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CommandList extends AbstractCommand {
|
||||
|
||||
final EpicVouchers instance;
|
||||
|
||||
public CommandList(EpicVouchers instance) {
|
||||
|
@ -7,7 +7,6 @@ import org.bukkit.command.CommandSender;
|
||||
import java.util.List;
|
||||
|
||||
public class CommandReload extends AbstractCommand {
|
||||
|
||||
final EpicVouchers instance;
|
||||
|
||||
public CommandReload(EpicVouchers instance) {
|
||||
|
@ -7,7 +7,6 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class ForceRedeemEvent extends Event implements Cancellable {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
private final Player player;
|
||||
@ -48,6 +47,7 @@ public class ForceRedeemEvent extends Event implements Cancellable {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
@ -55,5 +55,4 @@ public class ForceRedeemEvent extends Event implements Cancellable {
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,13 @@ import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.epicvouchers.EpicVouchers;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Date;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.Statement;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class Connections {
|
||||
|
||||
private final EpicVouchers instance;
|
||||
private Connection connection;
|
||||
|
||||
@ -26,7 +29,6 @@ public class Connections {
|
||||
String mysqlUsername = instance.getConfig().getString("Database.Username");
|
||||
String mysqlPassword = instance.getConfig().getString("Database.Password");
|
||||
|
||||
|
||||
connection = DriverManager.getConnection("jdbc:mysql://" + mysqlIP + ":" + mysqlPort + "/" + mysqlDatabase + "?useSSL=true?autoReconnect=true", mysqlUsername, mysqlPassword);
|
||||
System.out.println(TextUtils.formatText("&fSuccessfully created a connection with MySQL."));
|
||||
} catch (Exception error) {
|
||||
@ -66,5 +68,4 @@ public class Connections {
|
||||
error.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,11 @@ import org.bukkit.block.banner.Pattern;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.*;
|
||||
import org.bukkit.inventory.meta.BannerMeta;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.LeatherArmorMeta;
|
||||
import org.bukkit.inventory.meta.PotionMeta;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
@ -18,13 +22,12 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* A complete {@link ItemStack} inventory for FastInv (only works on 1.8+).
|
||||
*
|
||||
* <p>
|
||||
* The project is on <a href="https://github.com/MrMicky-FR/FastInv">GitHub</a>
|
||||
*
|
||||
* @author MrMicky
|
||||
*/
|
||||
public class ItemBuilder {
|
||||
|
||||
private final ItemStack item;
|
||||
private ItemMeta meta;
|
||||
|
||||
|
@ -4,7 +4,11 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.*;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.event.inventory.InventoryAction;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.server.PluginDisableEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
@ -25,13 +29,12 @@ import java.util.Set;
|
||||
* @version 2.0.3 - Now supports async operations
|
||||
*/
|
||||
public class FastInv implements InventoryHolder {
|
||||
|
||||
private static Plugin plugin = null;
|
||||
private boolean cancelTasksOnClose = true, cancelled = true;
|
||||
private Set<FastInvCloseListener> closeListeners = new HashSet<>();
|
||||
private Set<FastInvClickListener> clickListeners = new HashSet<>();
|
||||
private Map<Integer, FastInvClickListener> itemListeners = new HashMap<>();
|
||||
private Set<BukkitTask> tasks = new HashSet<>();
|
||||
private final Set<FastInvCloseListener> closeListeners = new HashSet<>();
|
||||
private final Set<FastInvClickListener> clickListeners = new HashSet<>();
|
||||
private final Map<Integer, FastInvClickListener> itemListeners = new HashMap<>();
|
||||
private final Set<BukkitTask> tasks = new HashSet<>();
|
||||
private Inventory inventory;
|
||||
|
||||
/**
|
||||
@ -67,6 +70,7 @@ public class FastInv implements InventoryHolder {
|
||||
*
|
||||
* @param type The type of the menus.
|
||||
* @param title The title of the menus.
|
||||
*
|
||||
* @throws IllegalStateException if FastInv is not init with FastInv.init(Plugin plugin)
|
||||
*/
|
||||
public FastInv(InventoryType type, String title) {
|
||||
@ -103,6 +107,7 @@ public class FastInv implements InventoryHolder {
|
||||
* Add an {@link ItemStack} to the menus.
|
||||
*
|
||||
* @param item The item to add
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv addItem(ItemStack item) {
|
||||
@ -114,6 +119,7 @@ public class FastInv implements InventoryHolder {
|
||||
*
|
||||
* @param item The item to add.
|
||||
* @param listener The {@link FastInvClickListener} for the item.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv addItem(ItemStack item, FastInvClickListener listener) {
|
||||
@ -131,6 +137,7 @@ public class FastInv implements InventoryHolder {
|
||||
*
|
||||
* @param slot The slot of the item.
|
||||
* @param item The item to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv addItem(int slot, ItemStack item) {
|
||||
@ -140,8 +147,9 @@ public class FastInv implements InventoryHolder {
|
||||
/**
|
||||
* Add an {@link ItemStack} to the menus on specific slot with a {@link FastInvClickListener} to handle clicks.
|
||||
*
|
||||
* @param slot The slot of the item.
|
||||
* @param itemStack The icon to add.
|
||||
* @param slot The slot of the item.
|
||||
* @param itemStack The icon to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv addItem(int slot, ItemStack itemStack, FastInvClickListener listener) {
|
||||
@ -164,6 +172,7 @@ public class FastInv implements InventoryHolder {
|
||||
* @param slotFrom Starting slot to put the item in.
|
||||
* @param slotTo Ending slot to put the item in.
|
||||
* @param item The item to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv addItem(int slotFrom, int slotTo, ItemStack item) {
|
||||
@ -177,6 +186,7 @@ public class FastInv implements InventoryHolder {
|
||||
* @param slotTo Ending slot to put the item in.
|
||||
* @param item The item to add.
|
||||
* @param listener The IconClickListener for the item.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv addItem(int slotFrom, int slotTo, ItemStack item, FastInvClickListener listener) {
|
||||
@ -191,6 +201,7 @@ public class FastInv implements InventoryHolder {
|
||||
*
|
||||
* @param slots The slot of the item.
|
||||
* @param item The item to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv addItem(int[] slots, ItemStack item) {
|
||||
@ -201,6 +212,7 @@ public class FastInv implements InventoryHolder {
|
||||
* Add an {@link ItemStack} to the menus on the edges.
|
||||
*
|
||||
* @param item The item to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv edge(ItemStack item) {
|
||||
@ -223,6 +235,7 @@ public class FastInv implements InventoryHolder {
|
||||
* @param slots The slots to place the item.
|
||||
* @param item The item to add.
|
||||
* @param listener The IconClickListener for the item.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv addItem(int[] slots, ItemStack item, FastInvClickListener listener) {
|
||||
@ -243,7 +256,7 @@ public class FastInv implements InventoryHolder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public FastInv fill(ItemStack itemStack) {
|
||||
public FastInv fill(ItemStack itemStack) {
|
||||
return fill(itemStack, null);
|
||||
}
|
||||
|
||||
@ -251,6 +264,7 @@ public class FastInv implements InventoryHolder {
|
||||
* Add a {@link FastInvCloseListener} to listen on menus close.
|
||||
*
|
||||
* @param listener The {@link FastInvCloseListener} to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv onClose(FastInvCloseListener listener) {
|
||||
@ -262,6 +276,7 @@ public class FastInv implements InventoryHolder {
|
||||
* Add a {@link FastInvClickListener} to listen on menus click.
|
||||
*
|
||||
* @param listener The {@link FastInvClickListener} to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv onClick(FastInvClickListener listener) {
|
||||
@ -283,6 +298,7 @@ public class FastInv implements InventoryHolder {
|
||||
*
|
||||
* @param period Delay between each run.
|
||||
* @param runnable The {@link Runnable} task to run.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv onUpdate(long period, Runnable runnable) {
|
||||
@ -295,6 +311,7 @@ public class FastInv implements InventoryHolder {
|
||||
* @param delay Ticks to wait before starting the task.
|
||||
* @param period Delay between each run.
|
||||
* @param runnable The {@link Runnable} task to run.
|
||||
*
|
||||
* @return This FastInv instance, for chaining
|
||||
*/
|
||||
public FastInv onUpdate(long delay, long period, Runnable runnable) {
|
||||
@ -355,8 +372,8 @@ public class FastInv implements InventoryHolder {
|
||||
|
||||
public static abstract class FastInvEvent {
|
||||
|
||||
private Player player;
|
||||
private FastInv inventory;
|
||||
private final Player player;
|
||||
private final FastInv inventory;
|
||||
private boolean cancelled;
|
||||
|
||||
FastInvEvent(Player player, FastInv inventory, boolean cancelled) {
|
||||
@ -404,10 +421,10 @@ public class FastInv implements InventoryHolder {
|
||||
|
||||
public static class FastInvClickEvent extends FastInvEvent {
|
||||
|
||||
private int slot;
|
||||
private ItemStack item;
|
||||
private InventoryAction action;
|
||||
private ClickType clickType;
|
||||
private final int slot;
|
||||
private final ItemStack item;
|
||||
private final InventoryAction action;
|
||||
private final ClickType clickType;
|
||||
|
||||
private FastInvClickEvent(Player player, FastInv inventory, int slot, ItemStack item,
|
||||
boolean cancelled, InventoryAction action, ClickType clickType) {
|
||||
@ -532,6 +549,7 @@ public class FastInv implements InventoryHolder {
|
||||
* Set if the tasks will be cancel on menus close.
|
||||
*
|
||||
* @param cancelTasksOnClose Set if the tasks will be cancel
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public FastInv setCancelTasksOnClose(boolean cancelTasksOnClose) {
|
||||
|
@ -5,7 +5,11 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.*;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.event.inventory.InventoryAction;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.server.PluginDisableEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
@ -27,13 +31,12 @@ import java.util.function.Consumer;
|
||||
* @version 2.0.3 - Now supports async operations
|
||||
*/
|
||||
public class IconInv implements InventoryHolder {
|
||||
|
||||
private static Plugin plugin = null;
|
||||
private boolean cancelTasksOnClose = true, cancelled = true;
|
||||
private Set<IconInvCloseListener> closeListeners = new HashSet<>();
|
||||
private Set<IconClickListener> clickListeners = new HashSet<>();
|
||||
private Map<Integer, Icon> itemListeners = new HashMap<>();
|
||||
private Set<BukkitTask> tasks = new HashSet<>();
|
||||
private final Set<IconInvCloseListener> closeListeners = new HashSet<>();
|
||||
private final Set<IconClickListener> clickListeners = new HashSet<>();
|
||||
private final Map<Integer, Icon> itemListeners = new HashMap<>();
|
||||
private final Set<BukkitTask> tasks = new HashSet<>();
|
||||
private Inventory inventory;
|
||||
|
||||
/**
|
||||
@ -69,6 +72,7 @@ public class IconInv implements InventoryHolder {
|
||||
*
|
||||
* @param type The type of the menus.
|
||||
* @param title The title of the menus.
|
||||
*
|
||||
* @throws IllegalStateException if FastInv is not init with FastInv.init(Plugin plugin)
|
||||
*/
|
||||
public IconInv(InventoryType type, String title) {
|
||||
@ -104,7 +108,8 @@ public class IconInv implements InventoryHolder {
|
||||
/**
|
||||
* Add an {@link ItemStack} to the menus with a {@link IconClickListener} to handle clicks.
|
||||
*
|
||||
* @param icon The icon to add.
|
||||
* @param icon The icon to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public IconInv addIcon(Icon icon) {
|
||||
@ -122,6 +127,7 @@ public class IconInv implements InventoryHolder {
|
||||
*
|
||||
* @param slot The slot of the item.
|
||||
* @param icon The icon to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public IconInv addIcon(int slot, Icon icon) {
|
||||
@ -139,6 +145,7 @@ public class IconInv implements InventoryHolder {
|
||||
* @param slotFrom Starting slot to put the item in.
|
||||
* @param slotTo Ending slot to put the item in.
|
||||
* @param icon The icon to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public IconInv addIcon(int slotFrom, int slotTo, Icon icon) {
|
||||
@ -152,6 +159,7 @@ public class IconInv implements InventoryHolder {
|
||||
* Add an {@link ItemStack} to the menus on the edges.
|
||||
*
|
||||
* @param icon The icon to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public IconInv edge(Icon icon) {
|
||||
@ -171,8 +179,9 @@ public class IconInv implements InventoryHolder {
|
||||
/**
|
||||
* Add an {@link ItemStack} to the menus on multiples slots with a {@link IconClickListener} to handle click.
|
||||
*
|
||||
* @param slots The slots to place the item.
|
||||
* @param icon The icon to add.
|
||||
* @param slots The slots to place the item.
|
||||
* @param icon The icon to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public IconInv addIcon(int[] slots, Icon icon) {
|
||||
@ -209,6 +218,7 @@ public class IconInv implements InventoryHolder {
|
||||
* Add a {@link IconInvCloseListener} to listen on menus close.
|
||||
*
|
||||
* @param listener The {@link IconInvCloseListener} to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public IconInv onClose(IconInvCloseListener listener) {
|
||||
@ -220,6 +230,7 @@ public class IconInv implements InventoryHolder {
|
||||
* Add a {@link IconClickListener} to listen on menus click.
|
||||
*
|
||||
* @param listener The {@link IconClickListener} to add.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public IconInv onClick(IconClickListener listener) {
|
||||
@ -232,6 +243,7 @@ public class IconInv implements InventoryHolder {
|
||||
*
|
||||
* @param period Delay between each run.
|
||||
* @param runnable The {@link Runnable} task to run.
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public IconInv onUpdate(long period, Runnable runnable) {
|
||||
@ -244,6 +256,7 @@ public class IconInv implements InventoryHolder {
|
||||
* @param delay Ticks to wait before starting the task.
|
||||
* @param period Delay between each run.
|
||||
* @param runnable The {@link Runnable} task to run.
|
||||
*
|
||||
* @return This FastInv instance, for chaining
|
||||
*/
|
||||
public IconInv onUpdate(long delay, long period, Runnable runnable) {
|
||||
@ -298,6 +311,7 @@ public class IconInv implements InventoryHolder {
|
||||
* Set if the tasks will be cancel on menus close.
|
||||
*
|
||||
* @param cancelTasksOnClose Set if the tasks will be cancel
|
||||
*
|
||||
* @return This FastInv instance, for chaining.
|
||||
*/
|
||||
public IconInv setCancelTasksOnClose(boolean cancelTasksOnClose) {
|
||||
@ -314,9 +328,8 @@ public class IconInv implements InventoryHolder {
|
||||
}
|
||||
|
||||
public static abstract class IconEvent {
|
||||
|
||||
private Player player;
|
||||
private IconInv inventory;
|
||||
private final Player player;
|
||||
private final IconInv inventory;
|
||||
private boolean cancelled;
|
||||
|
||||
IconEvent(Player player, IconInv inventory, boolean cancelled) {
|
||||
@ -363,11 +376,10 @@ public class IconInv implements InventoryHolder {
|
||||
}
|
||||
|
||||
public static class IconClickEvent extends IconEvent {
|
||||
|
||||
private int slot;
|
||||
private ItemStack item;
|
||||
private InventoryAction action;
|
||||
private ClickType clickType;
|
||||
private final int slot;
|
||||
private final ItemStack item;
|
||||
private final InventoryAction action;
|
||||
private final ClickType clickType;
|
||||
|
||||
private IconClickEvent(Player player, IconInv inventory, int slot, ItemStack item,
|
||||
boolean cancelled, InventoryAction action, ClickType clickType) {
|
||||
|
@ -6,11 +6,11 @@ import org.bukkit.inventory.ItemStack;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class Icon {
|
||||
private ItemStack itemStack;
|
||||
private Consumer<IconClickEvent> consumer;
|
||||
private final ItemStack itemStack;
|
||||
private final Consumer<IconClickEvent> consumer;
|
||||
|
||||
public Icon(ItemStack itemStack) {
|
||||
this(itemStack, event -> {});
|
||||
this(itemStack, event -> { });
|
||||
}
|
||||
|
||||
public Icon(ItemStack item, Consumer<IconClickEvent> consumer) {
|
||||
|
@ -16,15 +16,17 @@ import static org.bukkit.Material.PAPER;
|
||||
|
||||
public class ListEntryIcon extends Icon {
|
||||
public ListEntryIcon(EpicVouchers instance, String entry, BiConsumer<Player, String> onRemove, BiConsumer<Player, Pair<String, String>> onEdit) {
|
||||
super(new ItemBuilder(PAPER).name(YELLOW + entry).lore(GRAY + "Right click to edit",
|
||||
GRAY + "Left click to remove").build(), event -> {
|
||||
if (event.getClickType() == ClickType.LEFT) {
|
||||
onRemove.accept(event.getPlayer(), entry);
|
||||
super(new ItemBuilder(PAPER)
|
||||
.name(YELLOW + entry)
|
||||
.lore(GRAY + "Right click to edit", GRAY + "Left click to remove")
|
||||
.build(), clickEvent -> {
|
||||
if (clickEvent.getClickType() == ClickType.LEFT) {
|
||||
onRemove.accept(clickEvent.getPlayer(), entry);
|
||||
return;
|
||||
}
|
||||
ChatPrompt.showPrompt(instance, event.getPlayer(), aevent -> {
|
||||
Bukkit.getScheduler().runTaskLater(instance, () -> onEdit.accept(event.getPlayer(), new Pair<>(entry, aevent.getMessage().trim())), 1L);
|
||||
});
|
||||
ChatPrompt.showPrompt(instance, clickEvent.getPlayer(),
|
||||
pEvent -> Bukkit.getScheduler().runTaskLater(instance,
|
||||
() -> onEdit.accept(clickEvent.getPlayer(), new Pair<>(entry, pEvent.getMessage().trim())), 1L));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ import static org.bukkit.ChatColor.GRAY;
|
||||
import static org.bukkit.ChatColor.WHITE;
|
||||
|
||||
public class StringIcon extends Icon {
|
||||
|
||||
public StringIcon(EpicVouchers instance, String string, String current, BiConsumer<Player, String> consumer) {
|
||||
this(instance, string, current, consumer, s -> true);
|
||||
}
|
||||
@ -57,10 +56,8 @@ public class StringIcon extends Icon {
|
||||
}
|
||||
event.getPlayer().sendMessage(TextUtils.formatText("&7Successfully set to &r" + msg + "&7."));
|
||||
Bukkit.getScheduler().runTaskLater(instance, () -> consumer.accept(event.getPlayer(), msg), 1L);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ public class ToggleableIcon extends Icon {
|
||||
super(new ItemBuilder(Material.PAPER)
|
||||
.name(ChatColor.YELLOW + displayname)
|
||||
.lore(state ? ChatColor.GREEN + "ENABLED" : ChatColor.RED + "DISABLED")
|
||||
.build(), event -> {});
|
||||
.build(), event -> { });
|
||||
this.consumer = consumer;
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@ import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
public class PlayerCommandListener implements Listener {
|
||||
|
||||
private static final HashMap<UUID, String> commands = new HashMap<>();
|
||||
|
||||
@EventHandler
|
||||
@ -23,8 +22,8 @@ public class PlayerCommandListener implements Listener {
|
||||
public static void addCommand(UUID uuid, String command) {
|
||||
commands.put(uuid, command);
|
||||
}
|
||||
|
||||
public static void removeCommand(UUID uuid) {
|
||||
commands.remove(uuid);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
public class PlayerInteractListener implements Listener {
|
||||
|
||||
private final EpicVouchers instance;
|
||||
|
||||
public PlayerInteractListener(EpicVouchers instance) {
|
||||
@ -56,4 +55,4 @@ public class PlayerInteractListener implements Listener {
|
||||
voucher.redeemVoucher(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import static org.bukkit.ChatColor.YELLOW;
|
||||
import static org.bukkit.Material.BARRIER;
|
||||
|
||||
public class ActionMenu extends FastInv {
|
||||
|
||||
public ActionMenu(EpicVouchers instance, Voucher voucher) {
|
||||
super(27, "Give menu");
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.songoda.epicvouchers.menus;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.epicvouchers.EpicVouchers;
|
||||
import com.songoda.epicvouchers.libraries.ItemBuilder;
|
||||
import com.songoda.epicvouchers.libraries.inventory.FastInv;
|
||||
@ -13,7 +12,6 @@ import static org.bukkit.enchantments.Enchantment.DURABILITY;
|
||||
import static org.bukkit.inventory.ItemFlag.HIDE_ENCHANTS;
|
||||
|
||||
public class ConfirmMenu extends FastInv {
|
||||
|
||||
public ConfirmMenu(EpicVouchers instance, Runnable success, Runnable failure) {
|
||||
super(27, instance.getLocale().getMessage("interface.confirmsettings.title").getMessage());
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.songoda.epicvouchers.menus;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import com.songoda.epicvouchers.EpicVouchers;
|
||||
import com.songoda.epicvouchers.libraries.ItemBuilder;
|
||||
@ -9,14 +8,15 @@ import com.songoda.epicvouchers.libraries.inventory.FastInv;
|
||||
import com.songoda.epicvouchers.menus.sub.editor.SetItemMenu;
|
||||
import com.songoda.epicvouchers.voucher.Voucher;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import static org.bukkit.ChatColor.GRAY;
|
||||
import static org.bukkit.ChatColor.YELLOW;
|
||||
import static org.bukkit.Material.*;
|
||||
import static org.bukkit.Material.BARRIER;
|
||||
import static org.bukkit.Material.BOOK;
|
||||
import static org.bukkit.Material.FEATHER;
|
||||
import static org.bukkit.Material.STONE;
|
||||
|
||||
public class OptionMenu extends FastInv {
|
||||
|
||||
public OptionMenu(EpicVouchers instance, Voucher voucher) {
|
||||
super(27, "Options: " + voucher.getKey());
|
||||
|
||||
@ -45,5 +45,4 @@ public class OptionMenu extends FastInv {
|
||||
|
||||
fill(new ItemBuilder(CompatibleMaterial.GRAY_STAINED_GLASS_PANE.getItem()).name(ChatColor.RESET.toString()).build());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public class VoucherEditorMenu extends IconInv {
|
||||
}));
|
||||
|
||||
addIcon(11, new StringIcon(instance, "Material", voucher.getMaterial().toString(), (player, editString) -> {
|
||||
if(editString.contains(":")) {
|
||||
if (editString.contains(":")) {
|
||||
voucher.setData(Short.parseShort(editString.split(":")[1]));
|
||||
voucher.setMaterial(Material.valueOf(editString.split(":")[0]));
|
||||
} else {
|
||||
@ -72,11 +72,11 @@ public class VoucherEditorMenu extends IconInv {
|
||||
|
||||
reopen(player);
|
||||
}, string -> {
|
||||
if (string.isEmpty()) {
|
||||
if (string.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(string.contains(":") && string.split(":").length == 2) {
|
||||
if (string.contains(":") && string.split(":").length == 2) {
|
||||
String[] split = string.split(":");
|
||||
return Material.matchMaterial(split[0]) != null && StringUtils.isNumeric(split[1]);
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
import static org.bukkit.Material.PAPER;
|
||||
|
||||
public class VoucherMenu extends IconInv {
|
||||
|
||||
public VoucherMenu(EpicVouchers instance) {
|
||||
super((int) (Math.ceil(instance.getVoucherManager().getVouchers().size() / 9.0) * 9 + (instance.getVoucherManager().getVouchers().size() % 9 == 0 ? 9 : 0)), "Vouchers");
|
||||
|
||||
@ -54,5 +53,4 @@ public class VoucherMenu extends IconInv {
|
||||
new ItemStack(Material.valueOf("GRAY_STAINED_GLASS_PANE")) :
|
||||
new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, (short) 7)).name(ChatColor.RESET.toString()).build()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,4 +12,4 @@ public class GiveMenu extends PlayersMenu {
|
||||
public GiveMenu(EpicVouchers instance, Voucher voucher) {
|
||||
super(instance, voucher, "Give Menu", (who, player) -> voucher.give(who, Collections.singletonList(player), 1), new ArrayList<>(Bukkit.getOnlinePlayers()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,5 @@ public class EffectsMenu extends IconInv {
|
||||
.name(YELLOW + "Return")
|
||||
.lore(GRAY + "Return to the editor")
|
||||
.build(), event -> new VoucherEditorMenu(instance, voucher).open(event.getPlayer()));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,5 @@ public class ParticlesMenu extends IconInv {
|
||||
.name(YELLOW + "Return")
|
||||
.lore(GRAY + "Return to the editor")
|
||||
.build(), event -> new VoucherEditorMenu(instance, voucher).open(event.getPlayer()));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ import static org.bukkit.ChatColor.GRAY;
|
||||
import static org.bukkit.ChatColor.YELLOW;
|
||||
|
||||
public class SetItemMenu extends FastInv {
|
||||
|
||||
public SetItemMenu(EpicVouchers instance, Voucher voucher) {
|
||||
super(27, "Set item");
|
||||
|
||||
@ -74,6 +73,5 @@ public class SetItemMenu extends FastInv {
|
||||
|
||||
new OptionMenu(instance, voucher).open(event.getPlayer());
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -14,11 +14,13 @@ import org.bukkit.Material;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.bukkit.ChatColor.*;
|
||||
import static org.bukkit.ChatColor.DARK_GRAY;
|
||||
import static org.bukkit.ChatColor.GRAY;
|
||||
import static org.bukkit.ChatColor.GREEN;
|
||||
import static org.bukkit.ChatColor.YELLOW;
|
||||
import static org.bukkit.Material.PAPER;
|
||||
|
||||
public class StringListMenu extends IconInv {
|
||||
|
||||
public StringListMenu(EpicVouchers instance, String key, List<String> list, String toEdit, Voucher voucher) {
|
||||
super((int) ((list.isEmpty() ? 9 : Math.ceil(list.size() / 9.0) * 9) + 9), key);
|
||||
int size = getInventory().getSize();
|
||||
@ -35,10 +37,9 @@ public class StringListMenu extends IconInv {
|
||||
|
||||
addIcon(size - 1, new ItemBuilder(PAPER).name(GREEN + "Add to list").build(), event -> {
|
||||
ChatPrompt.showPrompt(instance, event.getPlayer(), TextUtils.formatText("Enter a new value."), aevent -> {
|
||||
list.add(aevent.getMessage().trim());
|
||||
voucher.saveSetting(key.toLowerCase(), list);
|
||||
list.add(aevent.getMessage().trim());
|
||||
voucher.saveSetting(key.toLowerCase(), list);
|
||||
Bukkit.getScheduler().runTaskLater(instance, () -> new StringListMenu(instance, key, list, toEdit, voucher).open(event.getPlayer()), 1L);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@ -54,6 +55,5 @@ public class StringListMenu extends IconInv {
|
||||
new StringListMenu(instance, key, list, toEdit, voucher).open(player);
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,5 @@ public class TitlesMenu extends IconInv {
|
||||
.name(YELLOW + "Return")
|
||||
.lore(GRAY + "Return to the editor")
|
||||
.build(), event -> new VoucherEditorMenu(instance, voucher).open(event.getPlayer()));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ import org.bukkit.event.Listener;
|
||||
* Created by songo on 6/4/2017.
|
||||
*/
|
||||
public class Settings implements Listener {
|
||||
|
||||
static final Config config = EpicVouchers.getInstance().getCoreConfig();
|
||||
|
||||
public static final ConfigSetting FILL_GLASS = new ConfigSetting(config, "Interface.Fill Interfaces With Glass", true);
|
||||
@ -31,4 +30,4 @@ public class Settings implements Listener {
|
||||
config.setAutoremove(true).setAutosave(true);
|
||||
config.saveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,20 +1,22 @@
|
||||
package com.songoda.epicvouchers.utils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>A convenience class to represent name-value pairs.</p>
|
||||
*
|
||||
* @since JavaFX 2.0
|
||||
*/
|
||||
public class Pair<K,V> implements Serializable{
|
||||
|
||||
public class Pair<K, V> implements Serializable {
|
||||
/**
|
||||
* Key of this <code>Pair</code>.
|
||||
*/
|
||||
private String key;
|
||||
private final String key;
|
||||
|
||||
/**
|
||||
* Gets the key for this pair.
|
||||
*
|
||||
* @return key for this pair
|
||||
*/
|
||||
public String getKey() { return key; }
|
||||
@ -22,17 +24,19 @@ public class Pair<K,V> implements Serializable{
|
||||
/**
|
||||
* Value of this this <code>Pair</code>.
|
||||
*/
|
||||
private String value;
|
||||
private final String value;
|
||||
|
||||
/**
|
||||
* Gets the value for this pair.
|
||||
*
|
||||
* @return value for this pair
|
||||
*/
|
||||
public String getValue() { return value; }
|
||||
|
||||
/**
|
||||
* Creates a new pair
|
||||
* @param key The key for this pair
|
||||
*
|
||||
* @param key The key for this pair
|
||||
* @param value The value to use for this pair
|
||||
*/
|
||||
public Pair(String key, String value) {
|
||||
@ -46,7 +50,7 @@ public class Pair<K,V> implements Serializable{
|
||||
*
|
||||
* <p>The default name/value delimiter '=' is always used.</p>
|
||||
*
|
||||
* @return <code>String</code> representation of this <code>Pair</code>
|
||||
* @return <code>String</code> representation of this <code>Pair</code>
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -83,20 +87,18 @@ public class Pair<K,V> implements Serializable{
|
||||
* both the names and values are equal.</p>
|
||||
*
|
||||
* @param o the <code>Object</code> to test for
|
||||
* equality with this <code>Pair</code>
|
||||
* equality with this <code>Pair</code>
|
||||
*
|
||||
* @return <code>true</code> if the given <code>Object</code> is
|
||||
* equal to this <code>Pair</code> else <code>false</code>
|
||||
* equal to this <code>Pair</code> else <code>false</code>
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o instanceof Pair) {
|
||||
Pair pair = (Pair) o;
|
||||
if (key != null ? !key.equals(pair.key) : pair.key != null) return false;
|
||||
if (value != null ? !value.equals(pair.value) : pair.value != null) return false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
Pair<?, ?> pair = (Pair<?, ?>) o;
|
||||
return Objects.equals(key, pair.key) && Objects.equals(value, pair.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class CoolDownManager {
|
||||
|
||||
private final Map<UUID, Long> entries = new HashMap<>();
|
||||
private final EpicVouchers instance;
|
||||
|
||||
@ -22,9 +21,9 @@ public class CoolDownManager {
|
||||
}
|
||||
|
||||
if (voucher.getCoolDown() != 0) {
|
||||
entries.put(uuid, System.currentTimeMillis() + voucher.getCoolDown() * 1000);
|
||||
entries.put(uuid, System.currentTimeMillis() + voucher.getCoolDown() * 1000L);
|
||||
} else {
|
||||
entries.put(uuid, System.currentTimeMillis() + instance.getConfig().getInt("Main.Cooldown Delay") * 1000);
|
||||
entries.put(uuid, System.currentTimeMillis() + instance.getConfig().getInt("Main.Cooldown Delay") * 1000L);
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,4 +51,4 @@ public class CoolDownManager {
|
||||
|
||||
return (time - System.currentTimeMillis()) / 1000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ import static org.bukkit.Material.PAPER;
|
||||
|
||||
@Accessors(chain = true)
|
||||
public class Voucher {
|
||||
|
||||
private final String key;
|
||||
private final EpicVouchers instance;
|
||||
private String permission = "";
|
||||
@ -236,8 +235,7 @@ public class Voucher {
|
||||
if (confirm) {
|
||||
new ConfirmMenu(instance,
|
||||
() -> instance.getVoucherExecutor().redeemVoucher(player, this, event.getItem(), true, event),
|
||||
() -> {
|
||||
})
|
||||
() -> { })
|
||||
.open(player);
|
||||
} else {
|
||||
instance.getVoucherExecutor().redeemVoucher(player, this, event.getItem(), true, event);
|
||||
|
@ -1,9 +1,10 @@
|
||||
package com.songoda.epicvouchers.voucher;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class VoucherManager {
|
||||
|
||||
private final Map<String, Voucher> registeredVouchers = new HashMap<>();
|
||||
|
||||
public Voucher addVoucher(Voucher voucher) {
|
||||
|
@ -1,13 +1,16 @@
|
||||
name: EpicVouchers
|
||||
main: com.songoda.epicvouchers.EpicVouchers
|
||||
version: maven-version-number
|
||||
author: Songoda
|
||||
website: https://songoda.host/epicvouchers
|
||||
description: Enhance your server with awesome customizable vouchers with a lot of features.
|
||||
name: ${project.name}
|
||||
description: ${project.description}
|
||||
version: ${project.version}
|
||||
api-version: 1.13
|
||||
|
||||
main: com.songoda.epicvouchers.EpicVouchers
|
||||
|
||||
author: Songoda
|
||||
website: ${project.url}
|
||||
|
||||
commands:
|
||||
epicvouchers:
|
||||
description: View information on this plugin.
|
||||
default: true
|
||||
aliases: [ev]
|
||||
usage: /ev
|
||||
usage: /ev
|
||||
|
@ -51,4 +51,4 @@ vouchers:
|
||||
effects:
|
||||
effect: "SPEED"
|
||||
amplifier: 2
|
||||
duration: 10
|
||||
duration: 10
|
||||
|
Loading…
Reference in New Issue
Block a user