diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..25cb845 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,638 @@ +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = false +max_line_length = 100 +tab_width = 2 +ij_continuation_indent_size = 4 +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_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 = false +ij_java_align_multiline_method_parentheses = false +ij_java_align_multiline_parameters = false +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 = false +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 = normal +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 = true +ij_java_binary_operation_wrap = normal +ij_java_blank_lines_after_anonymous_class_header = 0 +ij_java_blank_lines_after_class_header = 1 +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_add_space = false +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 = normal +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 = 999 +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 = always +ij_java_doc_add_blank_line_after_description = true +ij_java_doc_add_blank_line_after_param_comments = false +ij_java_doc_add_blank_line_after_return = false +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 = false +ij_java_doc_enable_formatting = true +ij_java_doc_enable_leading_asterisks = true +ij_java_doc_indent_on_continuation = false +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 = normal +ij_java_field_annotation_wrap = split_into_lines +ij_java_finally_on_new_line = false +ij_java_for_brace_force = always +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 = normal +ij_java_generate_final_locals = false +ij_java_generate_final_parameters = false +ij_java_if_brace_force = always +ij_java_imports_layout = $*, |, * +ij_java_indent_case_from_switch = true +ij_java_insert_inner_class_imports = true +ij_java_insert_override_annotation = true +ij_java_keep_blank_lines_before_right_brace = 2 +ij_java_keep_blank_lines_between_package_declaration_and_header = 2 +ij_java_keep_blank_lines_in_code = 1 +ij_java_keep_blank_lines_in_declarations = 2 +ij_java_keep_builder_methods_indents = false +ij_java_keep_control_statement_in_one_line = false +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 = false +ij_java_keep_simple_lambdas_in_one_line = false +ij_java_keep_simple_methods_in_one_line = false +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 = normal +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 = normal +ij_java_modifier_list_wrap = false +ij_java_names_count_to_use_import_on_demand = 999 +ij_java_new_line_after_lparen_in_record_header = false +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 = false +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 = false +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 = false +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 = false +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 = true +ij_java_ternary_operation_wrap = normal +ij_java_test_name_suffix = Test +ij_java_throws_keyword_wrap = normal +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 = always +ij_java_while_on_new_line = false +ij_java_wrap_comments = true +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,*.jspx,*.pom,*.rng,*.tagx,*.tld,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul}] +ij_continuation_indent_size = 2 +ij_xml_align_attributes = false +ij_xml_align_text = false +ij_xml_attribute_wrap = normal +ij_xml_block_comment_add_space = false +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 +ij_xml_use_custom_settings = true + +[{*.bash,*.sh,*.zsh}] +ij_shell_binary_ops_start_line = false +ij_shell_keep_column_alignment_padding = false +ij_shell_minify_program = false +ij_shell_redirect_followed_by_space = false +ij_shell_switch_cases_indented = false +ij_shell_use_unix_line_separator = true + +[{*.gant,*.groovy,*.gy}] +indent_size = 4 +tab_width = 4 +ij_continuation_indent_size = 8 +ij_groovy_align_group_field_declarations = false +ij_groovy_align_multiline_array_initializer_expression = false +ij_groovy_align_multiline_assignment = false +ij_groovy_align_multiline_binary_operation = false +ij_groovy_align_multiline_chained_methods = false +ij_groovy_align_multiline_extends_list = false +ij_groovy_align_multiline_for = true +ij_groovy_align_multiline_list_or_map = true +ij_groovy_align_multiline_method_parentheses = false +ij_groovy_align_multiline_parameters = true +ij_groovy_align_multiline_parameters_in_calls = false +ij_groovy_align_multiline_resources = true +ij_groovy_align_multiline_ternary_operation = false +ij_groovy_align_multiline_throws_list = false +ij_groovy_align_named_args_in_map = true +ij_groovy_align_throws_keyword = false +ij_groovy_array_initializer_new_line_after_left_brace = false +ij_groovy_array_initializer_right_brace_on_new_line = false +ij_groovy_array_initializer_wrap = off +ij_groovy_assert_statement_wrap = off +ij_groovy_assignment_wrap = off +ij_groovy_binary_operation_wrap = off +ij_groovy_blank_lines_after_class_header = 0 +ij_groovy_blank_lines_after_imports = 1 +ij_groovy_blank_lines_after_package = 1 +ij_groovy_blank_lines_around_class = 1 +ij_groovy_blank_lines_around_field = 0 +ij_groovy_blank_lines_around_field_in_interface = 0 +ij_groovy_blank_lines_around_method = 1 +ij_groovy_blank_lines_around_method_in_interface = 1 +ij_groovy_blank_lines_before_imports = 1 +ij_groovy_blank_lines_before_method_body = 0 +ij_groovy_blank_lines_before_package = 0 +ij_groovy_block_brace_style = end_of_line +ij_groovy_block_comment_add_space = false +ij_groovy_block_comment_at_first_column = true +ij_groovy_call_parameters_new_line_after_left_paren = false +ij_groovy_call_parameters_right_paren_on_new_line = false +ij_groovy_call_parameters_wrap = off +ij_groovy_catch_on_new_line = false +ij_groovy_class_annotation_wrap = split_into_lines +ij_groovy_class_brace_style = end_of_line +ij_groovy_class_count_to_use_import_on_demand = 5 +ij_groovy_do_while_brace_force = never +ij_groovy_else_on_new_line = false +ij_groovy_enum_constants_wrap = off +ij_groovy_extends_keyword_wrap = off +ij_groovy_extends_list_wrap = off +ij_groovy_field_annotation_wrap = split_into_lines +ij_groovy_finally_on_new_line = false +ij_groovy_for_brace_force = never +ij_groovy_for_statement_new_line_after_left_paren = false +ij_groovy_for_statement_right_paren_on_new_line = false +ij_groovy_for_statement_wrap = off +ij_groovy_if_brace_force = never +ij_groovy_import_annotation_wrap = 2 +ij_groovy_imports_layout = *, |, javax.**, java.**, |, $* +ij_groovy_indent_case_from_switch = true +ij_groovy_indent_label_blocks = true +ij_groovy_insert_inner_class_imports = false +ij_groovy_keep_blank_lines_before_right_brace = 2 +ij_groovy_keep_blank_lines_in_code = 2 +ij_groovy_keep_blank_lines_in_declarations = 2 +ij_groovy_keep_control_statement_in_one_line = true +ij_groovy_keep_first_column_comment = true +ij_groovy_keep_indents_on_empty_lines = false +ij_groovy_keep_line_breaks = true +ij_groovy_keep_multiple_expressions_in_one_line = false +ij_groovy_keep_simple_blocks_in_one_line = false +ij_groovy_keep_simple_classes_in_one_line = true +ij_groovy_keep_simple_lambdas_in_one_line = true +ij_groovy_keep_simple_methods_in_one_line = true +ij_groovy_label_indent_absolute = false +ij_groovy_label_indent_size = 0 +ij_groovy_lambda_brace_style = end_of_line +ij_groovy_layout_static_imports_separately = true +ij_groovy_line_comment_add_space = false +ij_groovy_line_comment_at_first_column = true +ij_groovy_method_annotation_wrap = split_into_lines +ij_groovy_method_brace_style = end_of_line +ij_groovy_method_call_chain_wrap = off +ij_groovy_method_parameters_new_line_after_left_paren = false +ij_groovy_method_parameters_right_paren_on_new_line = false +ij_groovy_method_parameters_wrap = off +ij_groovy_modifier_list_wrap = false +ij_groovy_names_count_to_use_import_on_demand = 3 +ij_groovy_packages_to_use_import_on_demand = java.awt.*, javax.swing.* +ij_groovy_parameter_annotation_wrap = off +ij_groovy_parentheses_expression_new_line_after_left_paren = false +ij_groovy_parentheses_expression_right_paren_on_new_line = false +ij_groovy_prefer_parameters_wrap = false +ij_groovy_resource_list_new_line_after_left_paren = false +ij_groovy_resource_list_right_paren_on_new_line = false +ij_groovy_resource_list_wrap = off +ij_groovy_space_after_assert_separator = true +ij_groovy_space_after_colon = true +ij_groovy_space_after_comma = true +ij_groovy_space_after_comma_in_type_arguments = true +ij_groovy_space_after_for_semicolon = true +ij_groovy_space_after_quest = true +ij_groovy_space_after_type_cast = true +ij_groovy_space_before_annotation_parameter_list = false +ij_groovy_space_before_array_initializer_left_brace = false +ij_groovy_space_before_assert_separator = false +ij_groovy_space_before_catch_keyword = true +ij_groovy_space_before_catch_left_brace = true +ij_groovy_space_before_catch_parentheses = true +ij_groovy_space_before_class_left_brace = true +ij_groovy_space_before_closure_left_brace = true +ij_groovy_space_before_colon = true +ij_groovy_space_before_comma = false +ij_groovy_space_before_do_left_brace = true +ij_groovy_space_before_else_keyword = true +ij_groovy_space_before_else_left_brace = true +ij_groovy_space_before_finally_keyword = true +ij_groovy_space_before_finally_left_brace = true +ij_groovy_space_before_for_left_brace = true +ij_groovy_space_before_for_parentheses = true +ij_groovy_space_before_for_semicolon = false +ij_groovy_space_before_if_left_brace = true +ij_groovy_space_before_if_parentheses = true +ij_groovy_space_before_method_call_parentheses = false +ij_groovy_space_before_method_left_brace = true +ij_groovy_space_before_method_parentheses = false +ij_groovy_space_before_quest = true +ij_groovy_space_before_record_parentheses = false +ij_groovy_space_before_switch_left_brace = true +ij_groovy_space_before_switch_parentheses = true +ij_groovy_space_before_synchronized_left_brace = true +ij_groovy_space_before_synchronized_parentheses = true +ij_groovy_space_before_try_left_brace = true +ij_groovy_space_before_try_parentheses = true +ij_groovy_space_before_while_keyword = true +ij_groovy_space_before_while_left_brace = true +ij_groovy_space_before_while_parentheses = true +ij_groovy_space_in_named_argument = true +ij_groovy_space_in_named_argument_before_colon = false +ij_groovy_space_within_empty_array_initializer_braces = false +ij_groovy_space_within_empty_method_call_parentheses = false +ij_groovy_spaces_around_additive_operators = true +ij_groovy_spaces_around_assignment_operators = true +ij_groovy_spaces_around_bitwise_operators = true +ij_groovy_spaces_around_equality_operators = true +ij_groovy_spaces_around_lambda_arrow = true +ij_groovy_spaces_around_logical_operators = true +ij_groovy_spaces_around_multiplicative_operators = true +ij_groovy_spaces_around_regex_operators = true +ij_groovy_spaces_around_relational_operators = true +ij_groovy_spaces_around_shift_operators = true +ij_groovy_spaces_within_annotation_parentheses = false +ij_groovy_spaces_within_array_initializer_braces = false +ij_groovy_spaces_within_braces = true +ij_groovy_spaces_within_brackets = false +ij_groovy_spaces_within_cast_parentheses = false +ij_groovy_spaces_within_catch_parentheses = false +ij_groovy_spaces_within_for_parentheses = false +ij_groovy_spaces_within_gstring_injection_braces = false +ij_groovy_spaces_within_if_parentheses = false +ij_groovy_spaces_within_list_or_map = false +ij_groovy_spaces_within_method_call_parentheses = false +ij_groovy_spaces_within_method_parentheses = false +ij_groovy_spaces_within_parentheses = false +ij_groovy_spaces_within_switch_parentheses = false +ij_groovy_spaces_within_synchronized_parentheses = false +ij_groovy_spaces_within_try_parentheses = false +ij_groovy_spaces_within_tuple_expression = false +ij_groovy_spaces_within_while_parentheses = false +ij_groovy_special_else_if_treatment = true +ij_groovy_ternary_operation_wrap = off +ij_groovy_throws_keyword_wrap = off +ij_groovy_throws_list_wrap = off +ij_groovy_use_flying_geese_braces = false +ij_groovy_use_fq_class_names = false +ij_groovy_use_fq_class_names_in_javadoc = true +ij_groovy_use_relative_indents = false +ij_groovy_use_single_class_imports = true +ij_groovy_variable_annotation_wrap = off +ij_groovy_while_brace_force = never +ij_groovy_while_on_new_line = false +ij_groovy_wrap_chain_calls_after_dot = false +ij_groovy_wrap_long_lines = false + +[{*.har,*.json,mcmod.info,pack.mcmeta}] +ij_json_keep_blank_lines_in_code = 0 +ij_json_keep_indents_on_empty_lines = false +ij_json_keep_line_breaks = true +ij_json_space_after_colon = true +ij_json_space_after_comma = true +ij_json_space_before_colon = true +ij_json_space_before_comma = false +ij_json_spaces_within_braces = false +ij_json_spaces_within_brackets = false +ij_json_wrap_long_lines = false + +[{*.htm,*.html,*.sht,*.shtm,*.shtml}] +ij_html_add_new_line_before_tags = body, div, p, form, h1, h2, h3 +ij_html_align_attributes = true +ij_html_align_text = false +ij_html_attribute_wrap = normal +ij_html_block_comment_add_space = false +ij_html_block_comment_at_first_column = true +ij_html_do_not_align_children_of_min_lines = 0 +ij_html_do_not_break_if_inline_tags = title, h1, h2, h3, h4, h5, h6, p +ij_html_do_not_indent_children_of_tags = html, body, thead, tbody, tfoot +ij_html_enforce_quotes = false +ij_html_inline_tags = a, abbr, acronym, b, basefont, bdo, big, br, cite, cite, code, dfn, em, font, i, img, input, kbd, label, q, s, samp, select, small, span, strike, strong, sub, sup, textarea, tt, u, var +ij_html_keep_blank_lines = 2 +ij_html_keep_indents_on_empty_lines = false +ij_html_keep_line_breaks = true +ij_html_keep_line_breaks_in_text = true +ij_html_keep_whitespaces = false +ij_html_keep_whitespaces_inside = span, pre, textarea +ij_html_line_comment_at_first_column = true +ij_html_new_line_after_last_attribute = never +ij_html_new_line_before_first_attribute = never +ij_html_quote_style = double +ij_html_remove_new_line_before_tags = br +ij_html_space_after_tag_name = false +ij_html_space_around_equality_in_attribute = false +ij_html_space_inside_empty_tag = false +ij_html_text_wrap = normal + +[{*.kt,*.kts}] +indent_size = 4 +tab_width = 4 +ij_continuation_indent_size = 8 +ij_kotlin_align_in_columns_case_branch = false +ij_kotlin_align_multiline_binary_operation = false +ij_kotlin_align_multiline_extends_list = false +ij_kotlin_align_multiline_method_parentheses = false +ij_kotlin_align_multiline_parameters = true +ij_kotlin_align_multiline_parameters_in_calls = false +ij_kotlin_allow_trailing_comma = false +ij_kotlin_allow_trailing_comma_on_call_site = false +ij_kotlin_assignment_wrap = normal +ij_kotlin_blank_lines_after_class_header = 0 +ij_kotlin_blank_lines_around_block_when_branches = 0 +ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1 +ij_kotlin_block_comment_add_space = false +ij_kotlin_block_comment_at_first_column = true +ij_kotlin_call_parameters_new_line_after_left_paren = true +ij_kotlin_call_parameters_right_paren_on_new_line = true +ij_kotlin_call_parameters_wrap = on_every_item +ij_kotlin_catch_on_new_line = false +ij_kotlin_class_annotation_wrap = split_into_lines +ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL +ij_kotlin_continuation_indent_for_chained_calls = false +ij_kotlin_continuation_indent_for_expression_bodies = false +ij_kotlin_continuation_indent_in_argument_lists = false +ij_kotlin_continuation_indent_in_elvis = false +ij_kotlin_continuation_indent_in_if_conditions = false +ij_kotlin_continuation_indent_in_parameter_lists = false +ij_kotlin_continuation_indent_in_supertype_lists = false +ij_kotlin_else_on_new_line = false +ij_kotlin_enum_constants_wrap = off +ij_kotlin_extends_list_wrap = normal +ij_kotlin_field_annotation_wrap = split_into_lines +ij_kotlin_finally_on_new_line = false +ij_kotlin_if_rparen_on_new_line = true +ij_kotlin_import_nested_classes = false +ij_kotlin_imports_layout = *, java.**, javax.**, kotlin.**, ^ +ij_kotlin_insert_whitespaces_in_simple_one_line_method = true +ij_kotlin_keep_blank_lines_before_right_brace = 2 +ij_kotlin_keep_blank_lines_in_code = 2 +ij_kotlin_keep_blank_lines_in_declarations = 2 +ij_kotlin_keep_first_column_comment = true +ij_kotlin_keep_indents_on_empty_lines = false +ij_kotlin_keep_line_breaks = true +ij_kotlin_lbrace_on_next_line = false +ij_kotlin_line_comment_add_space = false +ij_kotlin_line_comment_at_first_column = true +ij_kotlin_method_annotation_wrap = split_into_lines +ij_kotlin_method_call_chain_wrap = normal +ij_kotlin_method_parameters_new_line_after_left_paren = true +ij_kotlin_method_parameters_right_paren_on_new_line = true +ij_kotlin_method_parameters_wrap = on_every_item +ij_kotlin_name_count_to_use_star_import = 5 +ij_kotlin_name_count_to_use_star_import_for_members = 3 +ij_kotlin_packages_to_use_import_on_demand = java.util.*, kotlinx.android.synthetic.**, io.ktor.** +ij_kotlin_parameter_annotation_wrap = off +ij_kotlin_space_after_comma = true +ij_kotlin_space_after_extend_colon = true +ij_kotlin_space_after_type_colon = true +ij_kotlin_space_before_catch_parentheses = true +ij_kotlin_space_before_comma = false +ij_kotlin_space_before_extend_colon = true +ij_kotlin_space_before_for_parentheses = true +ij_kotlin_space_before_if_parentheses = true +ij_kotlin_space_before_lambda_arrow = true +ij_kotlin_space_before_type_colon = false +ij_kotlin_space_before_when_parentheses = true +ij_kotlin_space_before_while_parentheses = true +ij_kotlin_spaces_around_additive_operators = true +ij_kotlin_spaces_around_assignment_operators = true +ij_kotlin_spaces_around_equality_operators = true +ij_kotlin_spaces_around_function_type_arrow = true +ij_kotlin_spaces_around_logical_operators = true +ij_kotlin_spaces_around_multiplicative_operators = true +ij_kotlin_spaces_around_range = false +ij_kotlin_spaces_around_relational_operators = true +ij_kotlin_spaces_around_unary_operator = false +ij_kotlin_spaces_around_when_arrow = true +ij_kotlin_variable_annotation_wrap = off +ij_kotlin_while_on_new_line = false +ij_kotlin_wrap_elvis_expressions = 1 +ij_kotlin_wrap_expression_body_functions = 1 +ij_kotlin_wrap_first_method_in_call_chain = false + +[{*.markdown,*.md,CONTRIBUTE}] +indent_size = 4 +tab_width = 4 +ij_continuation_indent_size = 8 +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 + +[{*.toml,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,poetry.lock}] +indent_size = 4 +tab_width = 4 +ij_continuation_indent_size = 8 +ij_toml_keep_indents_on_empty_lines = false + +[{*.yaml,*.yml}] +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 diff --git a/.gitignore b/.gitignore index 744289d..937761b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,134 @@ -# Project exclude paths -/target/ \ No newline at end of file +### .gitignore generated by ".ignore File" plugin +# Template contains ignored files of Java, Maven, IntelliJ, Eclipse, Linux, Windows, macOS +# Manully removed cases that are not needed. + +# IntelliJ project files +.idea +*.iml +out +gen + +### Maven template +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +### Eclipse template +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +.project + +### Java template +# Compiled class file +*.class + +# Log file +*.log + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Linux template +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### Windows template +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +### macOS template +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..a0fdc19 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_code_findbugs_jsr305_1_3_9.xml b/.idea/libraries/Maven__com_google_code_findbugs_jsr305_1_3_9.xml deleted file mode 100644 index 0e66824..0000000 --- a/.idea/libraries/Maven__com_google_code_findbugs_jsr305_1_3_9.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_code_gson_gson_2_8_0.xml b/.idea/libraries/Maven__com_google_code_gson_gson_2_8_0.xml deleted file mode 100644 index 6e5d5b7..0000000 --- a/.idea/libraries/Maven__com_google_code_gson_gson_2_8_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_google_guava_guava_21_0.xml b/.idea/libraries/Maven__com_google_guava_guava_21_0.xml deleted file mode 100644 index a923456..0000000 --- a/.idea/libraries/Maven__com_google_guava_guava_21_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml b/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml deleted file mode 100644 index f3f3738..0000000 --- a/.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_ibm_icu_icu4j_61_1.xml b/.idea/libraries/Maven__com_ibm_icu_icu4j_61_1.xml new file mode 100644 index 0000000..425700e --- /dev/null +++ b/.idea/libraries/Maven__com_ibm_icu_icu4j_61_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sk89q_commandbook_2_3.xml b/.idea/libraries/Maven__com_sk89q_commandbook_2_3.xml deleted file mode 100644 index 589fb53..0000000 --- a/.idea/libraries/Maven__com_sk89q_commandbook_2_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sk89q_intake_intake_4_2_SNAPSHOT.xml b/.idea/libraries/Maven__com_sk89q_intake_intake_4_2_SNAPSHOT.xml deleted file mode 100644 index 8a4cdb0..0000000 --- a/.idea/libraries/Maven__com_sk89q_intake_intake_4_2_SNAPSHOT.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sk89q_squirrelid_0_2_0.xml b/.idea/libraries/Maven__com_sk89q_squirrelid_0_2_0.xml deleted file mode 100644 index 7e8d00a..0000000 --- a/.idea/libraries/Maven__com_sk89q_squirrelid_0_2_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_bukkit_7_0_0_SNAPSHOT.xml b/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_bukkit_7_0_0_SNAPSHOT.xml deleted file mode 100644 index 19767c5..0000000 --- a/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_bukkit_7_0_0_SNAPSHOT.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_bukkit_7_2_6_SNAPSHOT.xml b/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_bukkit_7_2_6_SNAPSHOT.xml new file mode 100644 index 0000000..87773e8 --- /dev/null +++ b/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_bukkit_7_2_6_SNAPSHOT.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_core_7_0_0_SNAPSHOT.xml b/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_core_7_2_6_SNAPSHOT.xml similarity index 52% rename from .idea/libraries/Maven__com_sk89q_worldedit_worldedit_core_7_0_0_SNAPSHOT.xml rename to .idea/libraries/Maven__com_sk89q_worldedit_worldedit_core_7_2_6_SNAPSHOT.xml index e4f342d..f5a5e53 100644 --- a/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_core_7_0_0_SNAPSHOT.xml +++ b/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_core_7_2_6_SNAPSHOT.xml @@ -1,13 +1,13 @@ - + - + - + - + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_libs_bukkit_7_0_0_SNAPSHOT.xml b/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_libs_bukkit_7_0_0_SNAPSHOT.xml deleted file mode 100644 index ea19676..0000000 --- a/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_libs_bukkit_7_0_0_SNAPSHOT.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_libs_core_7_0_0_SNAPSHOT.xml b/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_libs_core_7_2_6_SNAPSHOT.xml similarity index 67% rename from .idea/libraries/Maven__com_sk89q_worldedit_worldedit_libs_core_7_0_0_SNAPSHOT.xml rename to .idea/libraries/Maven__com_sk89q_worldedit_worldedit_libs_core_7_2_6_SNAPSHOT.xml index 9915c11..c06be2e 100644 --- a/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_libs_core_7_0_0_SNAPSHOT.xml +++ b/.idea/libraries/Maven__com_sk89q_worldedit_worldedit_libs_core_7_2_6_SNAPSHOT.xml @@ -1,13 +1,13 @@ - + - + - + - + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sk89q_worldguard_worldguard_bukkit_7_0_0.xml b/.idea/libraries/Maven__com_sk89q_worldguard_worldguard_bukkit_7_0_6.xml similarity index 67% rename from .idea/libraries/Maven__com_sk89q_worldguard_worldguard_bukkit_7_0_0.xml rename to .idea/libraries/Maven__com_sk89q_worldguard_worldguard_bukkit_7_0_6.xml index e249fab..65b84f5 100644 --- a/.idea/libraries/Maven__com_sk89q_worldguard_worldguard_bukkit_7_0_0.xml +++ b/.idea/libraries/Maven__com_sk89q_worldguard_worldguard_bukkit_7_0_6.xml @@ -1,13 +1,13 @@ - + - + - + - + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sk89q_worldguard_worldguard_core_7_0_0.xml b/.idea/libraries/Maven__com_sk89q_worldguard_worldguard_core_7_0_6.xml similarity index 68% rename from .idea/libraries/Maven__com_sk89q_worldguard_worldguard_core_7_0_0.xml rename to .idea/libraries/Maven__com_sk89q_worldguard_worldguard_core_7_0_6.xml index 57df4ec..bf70a8a 100644 --- a/.idea/libraries/Maven__com_sk89q_worldguard_worldguard_core_7_0_0.xml +++ b/.idea/libraries/Maven__com_sk89q_worldguard_worldguard_core_7_0_6.xml @@ -1,13 +1,13 @@ - + - + - + - + \ No newline at end of file diff --git a/.idea/libraries/Maven__com_sk89q_worldguard_worldguard_libs_core_7_0_6.xml b/.idea/libraries/Maven__com_sk89q_worldguard_worldguard_libs_core_7_0_6.xml new file mode 100644 index 0000000..080b6ad --- /dev/null +++ b/.idea/libraries/Maven__com_sk89q_worldguard_worldguard_libs_core_7_0_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__de_schlichtherle_truezip_6_8_3.xml b/.idea/libraries/Maven__de_schlichtherle_truezip_6_8_3.xml deleted file mode 100644 index 31ae2cd..0000000 --- a/.idea/libraries/Maven__de_schlichtherle_truezip_6_8_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__it_unimi_dsi_fastutil_8_2_1.xml b/.idea/libraries/Maven__it_unimi_dsi_fastutil_8_2_1.xml new file mode 100644 index 0000000..3873e57 --- /dev/null +++ b/.idea/libraries/Maven__it_unimi_dsi_fastutil_8_2_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__junit_junit_4_10.xml b/.idea/libraries/Maven__junit_junit_4_10.xml deleted file mode 100644 index ed8bf5f..0000000 --- a/.idea/libraries/Maven__junit_junit_4_10.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_16_R0_3.xml b/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_16_R0_3.xml deleted file mode 100644 index 2019f9a..0000000 --- a/.idea/libraries/Maven__net_md_5_bungeecord_chat_1_16_R0_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_abego_treelayout_org_abego_treelayout_core_1_0_3.xml b/.idea/libraries/Maven__org_abego_treelayout_org_abego_treelayout_core_1_0_3.xml new file mode 100644 index 0000000..7add102 --- /dev/null +++ b/.idea/libraries/Maven__org_abego_treelayout_org_abego_treelayout_core_1_0_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_antlr_ST4_4_3.xml b/.idea/libraries/Maven__org_antlr_ST4_4_3.xml new file mode 100644 index 0000000..7cc44a6 --- /dev/null +++ b/.idea/libraries/Maven__org_antlr_ST4_4_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_antlr_antlr4_4_9_1.xml b/.idea/libraries/Maven__org_antlr_antlr4_4_9_1.xml new file mode 100644 index 0000000..0a8aa63 --- /dev/null +++ b/.idea/libraries/Maven__org_antlr_antlr4_4_9_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_antlr_antlr4_runtime_4_9_1.xml b/.idea/libraries/Maven__org_antlr_antlr4_runtime_4_9_1.xml new file mode 100644 index 0000000..28f7bb9 --- /dev/null +++ b/.idea/libraries/Maven__org_antlr_antlr4_runtime_4_9_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_antlr_antlr_runtime_3_5_2.xml b/.idea/libraries/Maven__org_antlr_antlr_runtime_3_5_2.xml new file mode 100644 index 0000000..4fc5cbb --- /dev/null +++ b/.idea/libraries/Maven__org_antlr_antlr_runtime_3_5_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_8_1.xml b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_14_1.xml similarity index 59% rename from .idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_8_1.xml rename to .idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_14_1.xml index ff9feed..700b41b 100644 --- a/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_8_1.xml +++ b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_14_1.xml @@ -1,13 +1,13 @@ - + - + - + - + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_apache_logging_log4j_log4j_slf4j_impl_2_8_1.xml b/.idea/libraries/Maven__org_apache_logging_log4j_log4j_slf4j_impl_2_8_1.xml deleted file mode 100644 index 7658b06..0000000 --- a/.idea/libraries/Maven__org_apache_logging_log4j_log4j_slf4j_impl_2_8_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_bstats_bstats_bukkit_1_4.xml b/.idea/libraries/Maven__org_bstats_bstats_bukkit_1_4.xml deleted file mode 100644 index e5d05de..0000000 --- a/.idea/libraries/Maven__org_bstats_bstats_bukkit_1_4.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_bukkit_bukkit_1_13_R0_1_SNAPSHOT.xml b/.idea/libraries/Maven__org_bukkit_bukkit_1_13_R0_1_SNAPSHOT.xml deleted file mode 100644 index 83cb176..0000000 --- a/.idea/libraries/Maven__org_bukkit_bukkit_1_13_R0_1_SNAPSHOT.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_glassfish_javax_json_1_0_4.xml b/.idea/libraries/Maven__org_glassfish_javax_json_1_0_4.xml new file mode 100644 index 0000000..7fbea5f --- /dev/null +++ b/.idea/libraries/Maven__org_glassfish_javax_json_1_0_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml deleted file mode 100644 index acdf443..0000000 --- a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_khelekore_prtree_1_5_0.xml b/.idea/libraries/Maven__org_khelekore_prtree_1_5_0.xml deleted file mode 100644 index 4b8f0e6..0000000 --- a/.idea/libraries/Maven__org_khelekore_prtree_1_5_0.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_mozilla_rhino_runtime_1_7_13.xml b/.idea/libraries/Maven__org_mozilla_rhino_runtime_1_7_13.xml new file mode 100644 index 0000000..9305f59 --- /dev/null +++ b/.idea/libraries/Maven__org_mozilla_rhino_runtime_1_7_13.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_26.xml b/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_26.xml deleted file mode 100644 index 6545f77..0000000 --- a/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_26.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_spigotmc_spigot_api_1_16_1_R0_1_SNAPSHOT.xml b/.idea/libraries/Maven__org_spigotmc_spigot_api_1_16_1_R0_1_SNAPSHOT.xml deleted file mode 100644 index 9b24410..0000000 --- a/.idea/libraries/Maven__org_spigotmc_spigot_api_1_16_1_R0_1_SNAPSHOT.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__org_yaml_snakeyaml_1_26.xml b/.idea/libraries/Maven__org_yaml_snakeyaml_1_26.xml deleted file mode 100644 index e998675..0000000 --- a/.idea/libraries/Maven__org_yaml_snakeyaml_1_26.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/Maven__rhino_js_1_7R2.xml b/.idea/libraries/Maven__rhino_js_1_7R2.xml deleted file mode 100644 index 73d4473..0000000 --- a/.idea/libraries/Maven__rhino_js_1_7R2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 9dd240e..1518e28 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..1adb32a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,58 @@ +# Contributing + +## Issues + +Found an issue? Great, you can report bugs and crashes by opening an issue on +our [issue tracker](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/issues). Before opening a +new issue, use the search tool to make sure that your issue has not already been reported and ensure +that you have completely filled out the issue template. Issues that are duplicates or do not contain +the necessary information to triage and debug may be closed. + +Please provide the following details in your issue: + +* The exact version of the plugin you are running and the server version you are using. +* If your issue is a crash, attach the latest log which include the crash you are referencing to. +* If your issue is a bug or otherwise unexpected behavior, explain what you expected to happen. +* If your issue only occurs with other plugins installed, be sure to specify the names and versions + of those. + +## Balancing + +Want to contribute balancing changes to the default config? Great, please open an issue and let us +know about your changes. We will be happy to integrate them. + +## Translation + +You want to translate FreeRPG to a different language? Great, clone this repository or download the +[languages.yml](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/blob/master/src/main/resources/languages.yml) +file. Open it using a texteditor or an IDE. Start by coping for example the english translation ( +check out the +[link](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/blob/2301f9fbbea164e581973130d62509f891cb0103/src/main/resources/languages.yml#L4-L634) +for the marked section of a file that needs to be copied for a full translation) to the bottom of +the file. Replace `enUS:` by your country and start translating the values of the key. A key value +pair is defined by `variableName: Variable Name` for example `languageName: English`, `languageName` +is the variable name and `English` is the translation. In other words you always need to replace the +words next to the variable name with your translation. + +## Adding Blocks and Entities from newer Minecraft versions to FreeRPG + +Most new blocks, items and entities can be simply added by adding them to the different +configuration files. Afterwards some changes need to be done to the source code to actually apply +some of these changes. Check out these two +commits ([2455c8c](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/commit/2455c8c45134a0cd2392e096fd17ac357ee8c35c) +, [21cda30](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/commit/21cda30e69d3b567a295c2ba9b07098de1dc0540)) +to get a rough understanding where and how to add them. + +## Source code + +Want to contribute changes to the source code? Set up your development environment as described in +the [spigot wiki](https://www.spigotmc.org/wiki/spigot-plugin-development/). Please make sure your +changes are following .editorconfig style, let your IDE format your changes to ensure that. Open a +pull request with your changes, and we will happily integrate them. + +### Tasks to be done + +- [ ] Clean up code +- [ ] Reduce code duplication +- [ ] Simplify methods, so code is more readable + diff --git a/FreeRPG_1.16.iml b/FreeRPG_1.16.iml index cd5bd64..c4e54fe 100644 --- a/FreeRPG_1.16.iml +++ b/FreeRPG_1.16.iml @@ -21,34 +21,35 @@ - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - + diff --git a/README.md b/README.md new file mode 100644 index 0000000..74900e4 --- /dev/null +++ b/README.md @@ -0,0 +1,122 @@ +# FreeRPG + +![GitHub license](https://img.shields.io/github/license/AdvancedWipe/Minecraft_FreeRPG_1.16.svg) +![GitHub issues](https://img.shields.io/github/issues/AdvancedWipe/Minecraft_FreeRPG_1.16.svg) +![GitHub tag](https://img.shields.io/github/tag/AdvancedWipe/Minecraft_FreeRPG_1.16.svg) + +This is a fork of the Spigot plugin with the equivalent name, for which further development was discontinued. FreeRPG is a spigot 1.15+ plugin that adds an RPG skill system to Minecraft. Inspired by Mcmmo, the +goal is to offer a free Mcmmo alternative. Each skill has a skill tree, with an additional global +skill tree. The skill trees can be accessed with a very simplistic, Hypixel inspired GUI. + +## Download + +* [Download on Modrinth](https://modrinth.com/plugin/freerpg) +* [Download on Github Releases](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/releases) + +## Getting Started + +![FreeRPG GUI](https://cdn-raw.modrinth.com/data/m3YFnJQM/images/c896cb6a3921b4687e9a45ba878ebdfff39bab38.png) + +To get started playing, type ``/frpg``. This will bring up the GUI seen in the screenshot above. +Clicking on any of the icons will take you to that skill's skill tree. Hovering over any of the +icons or clicking on them will tell you more about the perk as shown in the screenshot below. + +![](https://cdn-raw.modrinth.com/data/m3YFnJQM/images/bb28b3843f16076c7c07b5c4d30650a7adc314d1.png) + +Earning experience is straightforward, mine blocks to get mining experience, cut trees to get woodcutting +experience, etc. + +By the default configuration, each level you finish, will gain **1 passive token** which can be +invested in the passive skills represented by the dyes on the left. Every 100 levels, you will +gain **1 skill token** which can be invested in the skills represented by the terracotta skill tree. +Every 1000 levels, you will gain **1 global token** that can be used in the global skill tree. +Please check the wiki, for further information on how to configure FreeRPG to your needs. + +FreeRPG provides 10 abilities to the player which can be leveled. + +| Name | Related Skill | Description | Activation | Duration by default | +|--------------------------|---------------|---------------------------------------------------------------------------------|----------------------------------------------------------------------------|---------------------| +| **Big Dig** | Digging | Increases dig speed drastically. | Right-clicking a shovel, then breaking a block. | 300 sec | +| **Timber** | Woodcutting | Will cause all logs above to break. | Right-clicking a pickaxe, then breaking a block. | 300 sec | +| **Berserk Pick** | Mining | Will increase mining speed drastically. | Right-clicking a pickaxe, then breaking a block. | 300 sec | +| **Natural Regeneration** | Farming | Automatically replants all crops at a random growth stage. | Right-clicking a hoe, then breaking a crop. | 300 sec | +| **Super Bait** | Fishing | Fish are instantly pulled out of the water, without waiting to get a bite. | Left-clicking a fishing rod, then fishing. | 300 sec | +| **Rapid Fire** | Archery | Arrow shots come out at maximum speed no matter how far the bow is pulled back. | Left-clicking a bow. | 300 sec | +| **Spur Kick** | Beast Mastery | Grants your horse a temporary speed boost. | Right-clicking most items while on a horse, then left-clicking most items. | 300 sec | +| **Swift Strikes** | Swordsmanship | Your swings no longer have a cooldown. | Right-clicking a sword then hitting an entity. | 300 sec | +| **Stone Solid** | Defense | Grants resistance at the cost of being slowed down. | Right-clicking with an empty hand, then hitting an entity. | 300 sec | +| **Great Axe** | Axe Mastery | Your attacks become an AOE strike that deals damage in a certain radius. | Right-clicking an axe, then hitting an entity. | 300 sec | + +For further features and information on configuration, permissions and usage check out +the [wiki](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/wiki). + +## Language Support + +FreeRPG fully/partially supports the following languages by default: + +- 🇺🇸 English +- 🇭🇺 Hungarian (Translated by: vERKE) +- 🇫🇷 French (Translated by: Temuel) +- 🇩🇪 German (Translated by: KlenerTeufel96 of FruitLab.gg) +- 🇵🇱 Polish (Translated by: QuarVey) +- 🇪🇸 Spanish (Translated by: PibeChileno) +- 🇷🇺 Russian (Translated by: Cr1stalz_, MoKotik, and DevilPlay) +- 🇵🇹 Portuguese (Translated by: gbuueno) +- 🇨🇿 Czech (Translated by: Pieck444 and Fractvival) +- 🇰🇷 Korean (Translated by: Re_Oh) + +The default server language can be set in config.yml. Additionally, each player can pick which +language they want the plugin to be represented in. Server administrators can add their own +languages to languages.yml. If you want to add your translation to be hardcoded into languages.yml, +please open a pull request with the added language. For further information check the [CONTRIBUTING](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/blob/master/CONTRIBUTING.md) file in this repository + +## Wiki + +The [wiki](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/wiki) provides you with detailed information about the abilities, skill trees and plugin configuration. + +## Compatibility + +FreeRPG should be compatible with most popular plugins. It has been tested with Essentials, +Bssentials, World Edit, Worldguard, Silk Spawners, and PlaceholderAPI and yielded no issues. It has +additionally, been tested with Multiverse and has no major issues. However, player profiles for +different worlds are not possible at the moment. + +## Links + +* [Wiki](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/wiki) +* [Modrinth](https://modrinth.com/plugin/freerpg) +* [Github](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16) + +## Contribute + +You want to contribute to this plugin by providing a translation, balancing changes or source code +changes? Great, please check the [CONTRIBUTING](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/blob/master/CONTRIBUTING.md) +file in this repository for further information. + +### Reporting Issues + +You can report bugs, crashes or any other issue you found by opening a new issue on +our [issue tracker](https://github.com/AdvancedWipe/Minecraft_FreeRPG_1.16/issues). Before opening a +new issue, use the search tool to make sure that your issue has not already been reported and ensure +that you have completely filled out the issue template. + +Please provide the following details in your issue: + +* The exact version of the plugin you are running and the server version you are using. +* If your issue is a crash, attach the latest log which include the crash you are referencing to. +* If your issue is a bug or otherwise unexpected behavior, explain what you expected to happen. +* If your issue only occurs with other plugins installed, be sure to specify the names and versions + of those. + +## Licence + +FreeRPG is licensed under MIT license, a free and open-source license. For more information, please +see the [license](LICENSE) file. + + + + + + + + diff --git a/pom.xml b/pom.xml index c0a39e1..a9e23e2 100644 --- a/pom.xml +++ b/pom.xml @@ -1,96 +1,96 @@ - - 4.0.0 + + freerpg - mc.carlton - freerpg - 1.4.49 - jar + + clean package + + + maven-compiler-plugin + + ${java.version} + ${java.version} + + org.apache.maven.plugins + 3.7.0 + + + maven-shade-plugin + + + + false + + + shade + + package + + + org.apache.maven.plugins + 3.1.0 + + + + + src/main/resources + true + + + + + + spigot-api + org.spigotmc + provided + 1.18.1-R0.1-SNAPSHOT + + + worldguard-bukkit + com.sk89q.worldguard + provided + 7.0.6 + + + placeholderapi + me.clip + provided + 2.10.9 + + + Minecraft 1.15-1.16 RPG Plugin + mc.carlton - FreeRPG + 4.0.0 - Minecraft 1.15-1.16 RPG Plugin - - 1.8 - UTF-8 - + FreeRPG + jar - - clean package - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - ${java.version} - ${java.version} - - - - org.apache.maven.plugins - maven-shade-plugin - 3.1.0 - - - package - - shade - - - false - - - - - - - - src/main/resources - true - - - + + 1.8 + UTF-8 + - - - spigotmc-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - sonatype - https://oss.sonatype.org/content/groups/public/ - - - sk89q-repo - https://maven.enginehub.org/repo/ - - - placeholderapi - https://repo.extendedclip.com/content/repositories/placeholderapi/ - - + + + spigotmc-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + sonatype + https://oss.sonatype.org/content/groups/public/ + + + sk89q-repo + https://maven.enginehub.org/repo/ + + + placeholderapi + https://repo.extendedclip.com/content/repositories/placeholderapi/ + + - - - org.spigotmc - spigot-api - 1.16.1-R0.1-SNAPSHOT - provided - - - com.sk89q.worldguard - worldguard-bukkit - 7.0.0 - provided - - - me.clip - placeholderapi - 2.10.9 - provided - - + 1.4.52 diff --git a/src/main/java/mc/carlton/freerpg/FreeRPG.java b/src/main/java/mc/carlton/freerpg/FreeRPG.java index 26e8bd5..d8401e8 100644 --- a/src/main/java/mc/carlton/freerpg/FreeRPG.java +++ b/src/main/java/mc/carlton/freerpg/FreeRPG.java @@ -1,36 +1,93 @@ package mc.carlton.freerpg; -import mc.carlton.freerpg.brewingEvents.BrewingInventoryClick; -import mc.carlton.freerpg.brewingEvents.FinishedBrewing; -import mc.carlton.freerpg.clickEvents.PlayerLeftClick; -import mc.carlton.freerpg.clickEvents.PlayerLeftClickDeveloper; -import mc.carlton.freerpg.clickEvents.PlayerRightClick; -import mc.carlton.freerpg.clickEvents.PlayerRightClickEntity; -import mc.carlton.freerpg.combatEvents.*; -import mc.carlton.freerpg.commands.*; -import mc.carlton.freerpg.customContainers.CustomContainerImporter; -import mc.carlton.freerpg.customContainers.CustomPotion; -import mc.carlton.freerpg.customContainers.collections.CustomRecipe; -import mc.carlton.freerpg.enchantingEvents.*; -import mc.carlton.freerpg.furnaceEvents.FurnaceBurn; -import mc.carlton.freerpg.furnaceEvents.FurnaceInventoryClick; -import mc.carlton.freerpg.furnaceEvents.FurnaceSmelt; -import mc.carlton.freerpg.globalVariables.*; -import mc.carlton.freerpg.guiEvents.*; -import mc.carlton.freerpg.leaveAndJoin.LoginProcedure; -import mc.carlton.freerpg.leaveAndJoin.LogoutProcedure; -import mc.carlton.freerpg.miscEvents.*; -import mc.carlton.freerpg.leaveAndJoin.PlayerJoin; -import mc.carlton.freerpg.leaveAndJoin.PlayerLeave; -import mc.carlton.freerpg.newEvents.eventCallers.FrpgAbilityItemMovedEventCaller; -import mc.carlton.freerpg.newEvents.eventCallers.FrpgPlayerCraftItemEventCaller; -import mc.carlton.freerpg.newEvents.eventCallers.FrpgPlayerRightClickEventCaller; -import mc.carlton.freerpg.pistonEvents.PistonEvents; -import mc.carlton.freerpg.playerInfo.*; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverFileManagement.*; -import mc.carlton.freerpg.serverInfo.*; -import org.bukkit.*; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Field; +import java.util.HashMap; +import mc.carlton.freerpg.commands.FrpgCommands; +import mc.carlton.freerpg.commands.SpiteQuote; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.Leaderboards; +import mc.carlton.freerpg.core.info.player.OfflinePlayerStatLoadIn; +import mc.carlton.freerpg.core.info.server.FreeRPGPlaceHolders; +import mc.carlton.freerpg.core.info.server.MinecraftVersion; +import mc.carlton.freerpg.core.info.server.RunTimeData; +import mc.carlton.freerpg.core.info.server.WorldGuardChecks; +import mc.carlton.freerpg.core.leaveAndJoin.LoginProcedure; +import mc.carlton.freerpg.core.leaveAndJoin.LogoutProcedure; +import mc.carlton.freerpg.core.leaveAndJoin.PlayerJoin; +import mc.carlton.freerpg.core.leaveAndJoin.PlayerLeave; +import mc.carlton.freerpg.core.serverFileManagement.LeaderBoardFilesManager; +import mc.carlton.freerpg.core.serverFileManagement.PeriodicSaving; +import mc.carlton.freerpg.core.serverFileManagement.PlacedBlockFileManager; +import mc.carlton.freerpg.core.serverFileManagement.PlayerStatsFilePreparation; +import mc.carlton.freerpg.core.serverFileManagement.RecentPlayersFileManager; +import mc.carlton.freerpg.core.serverFileManagement.ServerDataFolderPreparation; +import mc.carlton.freerpg.core.serverFileManagement.YMLManager; +import mc.carlton.freerpg.events.brewing.BrewingInventoryClick; +import mc.carlton.freerpg.events.brewing.FinishedBrewing; +import mc.carlton.freerpg.events.click.PlayerLeftClick; +import mc.carlton.freerpg.events.click.PlayerLeftClickDeveloper; +import mc.carlton.freerpg.events.click.PlayerRightClick; +import mc.carlton.freerpg.events.click.PlayerRightClickEntity; +import mc.carlton.freerpg.events.combat.ArrowLand; +import mc.carlton.freerpg.events.combat.EntityGetDamaged; +import mc.carlton.freerpg.events.combat.EntityHitEntity; +import mc.carlton.freerpg.events.combat.LingeringPotionSplash; +import mc.carlton.freerpg.events.combat.PlayerDeath; +import mc.carlton.freerpg.events.combat.PlayerKillEntity; +import mc.carlton.freerpg.events.combat.PlayerShootBow; +import mc.carlton.freerpg.events.combat.PlayerTakeDamage; +import mc.carlton.freerpg.events.combat.PotionSplash; +import mc.carlton.freerpg.events.enchanting.AnvilClick; +import mc.carlton.freerpg.events.enchanting.ExperienceBottleBreak; +import mc.carlton.freerpg.events.enchanting.PlayerEnchant; +import mc.carlton.freerpg.events.enchanting.PlayerGetExperience; +import mc.carlton.freerpg.events.enchanting.PrepareEnchanting; +import mc.carlton.freerpg.events.enchanting.PrepareRepair; +import mc.carlton.freerpg.events.furnace.FurnaceBurn; +import mc.carlton.freerpg.events.furnace.FurnaceInventoryClick; +import mc.carlton.freerpg.events.furnace.FurnaceSmelt; +import mc.carlton.freerpg.events.gui.ConfigurationGUIClick; +import mc.carlton.freerpg.events.gui.ConfirmationGUIClick; +import mc.carlton.freerpg.events.gui.CraftingGUIclick; +import mc.carlton.freerpg.events.gui.MainGUIclick; +import mc.carlton.freerpg.events.gui.SkillsConfigGUIClick; +import mc.carlton.freerpg.events.gui.SkillsGUIclick; +import mc.carlton.freerpg.events.misc.CreatureSpawn; +import mc.carlton.freerpg.events.misc.DispenserDispenseItem; +import mc.carlton.freerpg.events.misc.EntityPickUpItem; +import mc.carlton.freerpg.events.misc.PlayerBlockBreak; +import mc.carlton.freerpg.events.misc.PlayerBlockBreakDeveloper; +import mc.carlton.freerpg.events.misc.PlayerBlockPlace; +import mc.carlton.freerpg.events.misc.PlayerBreedEntity; +import mc.carlton.freerpg.events.misc.PlayerConsumeItem; +import mc.carlton.freerpg.events.misc.PlayerCraft; +import mc.carlton.freerpg.events.misc.PlayerDismount; +import mc.carlton.freerpg.events.misc.PlayerDropItem; +import mc.carlton.freerpg.events.misc.PlayerEnterVehicle; +import mc.carlton.freerpg.events.misc.PlayerFish; +import mc.carlton.freerpg.events.misc.PlayerMount; +import mc.carlton.freerpg.events.misc.PlayerMoveAbilityItem; +import mc.carlton.freerpg.events.misc.PlayerPrepareCrafting; +import mc.carlton.freerpg.events.misc.PlayerRespawn; +import mc.carlton.freerpg.events.misc.PlayerShear; +import mc.carlton.freerpg.events.misc.PlayerToggleSprint; +import mc.carlton.freerpg.events.misc.TameEntityEvent; +import mc.carlton.freerpg.events.newEvents.eventCallers.FrpgAbilityItemMovedEventCaller; +import mc.carlton.freerpg.events.newEvents.eventCallers.FrpgPlayerCraftItemEventCaller; +import mc.carlton.freerpg.events.newEvents.eventCallers.FrpgPlayerRightClickEventCaller; +import mc.carlton.freerpg.events.piston.PistonEvents; +import mc.carlton.freerpg.utils.globalVariables.CraftingRecipes; +import mc.carlton.freerpg.utils.globalVariables.EntityGroups; +import mc.carlton.freerpg.utils.globalVariables.ExpMaps; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import mc.carlton.freerpg.utils.globalVariables.StringsAndOtherData; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.bukkit.Bukkit; +import org.bukkit.NamespacedKey; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; @@ -38,266 +95,268 @@ import org.bukkit.plugin.Plugin; import org.bukkit.plugin.java.JavaPlugin; -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Field; -import java.util.HashMap; - public final class FreeRPG extends JavaPlugin implements Listener { - @Override - public void onEnable() { - //Plugin startup logic - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - - //Saves Resources if they aren't there - getConfig().options().copyDefaults(); - saveDefaultConfig(); - saveResource("languages.yml",false); - saveResource("advancedConfig.yml",false); - - - //Checks config.yml and languages.yml for updates, and update them if needed (while trying to keep any edits) - YMLManager ymlManager = new YMLManager(); - ymlManager.updateCheckYML("config.yml"); - ymlManager.updateCheckYML("languages.yml"); - ymlManager.updateCheckYML("advancedConfig.yml"); - - - - //Loads config to into memory - ConfigLoad loadConfig = new ConfigLoad(); - loadConfig.initializeConfig(); - - //Makes SeverData Folder - ServerDataFolderPreparation serverDataFolderPreparation = new ServerDataFolderPreparation(); - serverDataFolderPreparation.initializeServerDataFolder(); - - //Makes PlayerData Folder - PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); - playerStatsFilePreparation.initializePlayerDataBase(); - - //Initialize Placed Blocks Map - PlacedBlockFileManager placedBlockFileManager = new PlacedBlockFileManager(); - placedBlockFileManager.initializePlacedBlocksFile(); //Creates blockLocations.dat if not already made - placedBlockFileManager.initializePlacedBlocks(); //Imports data from blockLocations.dat into a hashamp - - //Initializes RecentLogouts List - RecentPlayersFileManager recentPlayersFileManager = new RecentPlayersFileManager(); - recentPlayersFileManager.initializeRecentPlayersFile(); //Creates recentPlayers.dat if not already made - recentPlayersFileManager.initializeRecentPlayers(); //Imports data from recentPlayters.dat to an arrayList in RecentLogouts - - - //Check if the server uses world guard - WorldGuardChecks CheckWorldGuardExistence = new WorldGuardChecks(); - CheckWorldGuardExistence.initializeWorldGuardPresent(); - - //Checks if the server has PlaceHolderAPI - if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { - if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI").isEnabled()) { - new FreeRPGPlaceHolders(this).register(); - } - } - - //Initializes all "global" variables - MinecraftVersion minecraftVersion = new MinecraftVersion(); - minecraftVersion.initializeVersion(); - EntityGroups entityGroups = new EntityGroups(); - entityGroups.initializeAllEntityGroups(); - ExpMaps expMaps = new ExpMaps(); - expMaps.initializeAllExpMaps(); - ItemGroups itemGroups = new ItemGroups(); - itemGroups.initializeItemGroups(); - CraftingRecipes craftingRecipes = new CraftingRecipes(); - craftingRecipes.initializeAllCraftingRecipes(); - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - stringsAndOtherData.initializeData(); - - //Initializes Player Leaderboard (and may create a file) - Leaderboards playerLeaderboard = new Leaderboards(); - LeaderBoardFilesManager leaderBoardFilesManager = new LeaderBoardFilesManager(); - playerLeaderboard.initializeLeaderboards(); - boolean didCreateFile = leaderBoardFilesManager.createLeaderBoardFile(false); - if (!didCreateFile) { - leaderBoardFilesManager.readInLeaderBoardFile(); - } - - //Initiliazes periodically saving stats - PeriodicSaving saveStats = new PeriodicSaving(); - saveStats.periodicallySaveStats(); - - //Events - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.isSaveRunTimeData()) { - getServer().getPluginManager().registerEvents(new PlayerLeftClick(), this); - getServer().getPluginManager().registerEvents(new PlayerBlockBreak(), this); - } - else{ - getServer().getPluginManager().registerEvents(new PlayerLeftClickDeveloper(), this); - getServer().getPluginManager().registerEvents(new PlayerBlockBreakDeveloper(), this); - } - getServer().getPluginManager().registerEvents(this, this); - getServer().getPluginManager().registerEvents(new PlayerJoin(), this); - getServer().getPluginManager().registerEvents(new PlayerLeave(), this); - getServer().getPluginManager().registerEvents(new MainGUIclick(), this); - getServer().getPluginManager().registerEvents(new SkillsGUIclick(), this); - getServer().getPluginManager().registerEvents(new CraftingGUIclick(), this); - getServer().getPluginManager().registerEvents(new ConfirmationGUIClick(), this); - getServer().getPluginManager().registerEvents(new ConfigurationGUIClick(), this); - getServer().getPluginManager().registerEvents(new PlayerBlockPlace(), this); - getServer().getPluginManager().registerEvents(new PlayerRightClick(), this); - getServer().getPluginManager().registerEvents(new PlayerTakeDamage(), this); - getServer().getPluginManager().registerEvents(new PlayerCraft(), this); - getServer().getPluginManager().registerEvents(new PlayerPrepareCrafting(), this); - getServer().getPluginManager().registerEvents(new EntityHitEntity(), this); - getServer().getPluginManager().registerEvents(new PlayerKillEntity(), this); - getServer().getPluginManager().registerEvents(new PlayerConsumeItem(), this); - getServer().getPluginManager().registerEvents(new PlayerRightClickEntity(), this); - getServer().getPluginManager().registerEvents(new PlayerShear(), this); - getServer().getPluginManager().registerEvents(new PlayerFish(), this); - getServer().getPluginManager().registerEvents(new PlayerShootBow(), this); - getServer().getPluginManager().registerEvents(new ArrowLand(), this); - getServer().getPluginManager().registerEvents(new EntityGetDamaged(), this); - getServer().getPluginManager().registerEvents(new TameEntityEvent(), this); - getServer().getPluginManager().registerEvents(new PlayerMount(), this); - getServer().getPluginManager().registerEvents(new PlayerDismount(), this); - getServer().getPluginManager().registerEvents(new PlayerBreedEntity(), this); - getServer().getPluginManager().registerEvents(new PlayerToggleSprint(), this); - getServer().getPluginManager().registerEvents(new BrewingInventoryClick(), this); - getServer().getPluginManager().registerEvents(new PotionSplash(), this); - getServer().getPluginManager().registerEvents(new LingeringPotionSplash(), this); - getServer().getPluginManager().registerEvents(new FinishedBrewing(), this); - getServer().getPluginManager().registerEvents(new PlayerGetExperience(), this); - getServer().getPluginManager().registerEvents(new PrepareEnchanting(), this); - getServer().getPluginManager().registerEvents(new PrepareRepair(), this); - getServer().getPluginManager().registerEvents(new AnvilClick(), this); - getServer().getPluginManager().registerEvents(new PlayerEnchant(), this); - getServer().getPluginManager().registerEvents(new PlayerDeath(), this); - getServer().getPluginManager().registerEvents(new FurnaceSmelt(), this); - getServer().getPluginManager().registerEvents(new FurnaceInventoryClick(), this); - getServer().getPluginManager().registerEvents(new FurnaceBurn(), this); - getServer().getPluginManager().registerEvents(new PlayerRespawn(), this); - getServer().getPluginManager().registerEvents(new PlayerDropItem(), this); - getServer().getPluginManager().registerEvents(new ExperienceBottleBreak(), this); - getServer().getPluginManager().registerEvents(new SkillsConfigGUIClick(), this); - getServer().getPluginManager().registerEvents(new EntityPickUpItem(), this); - getServer().getPluginManager().registerEvents(new CreatureSpawn(), this); - getServer().getPluginManager().registerEvents(new DispenserDispenseItem(), this); - getServer().getPluginManager().registerEvents(new PlayerMoveAbilityItem(), this); - getServer().getPluginManager().registerEvents(new PlayerEnterVehicle(), this); - getServer().getPluginManager().registerEvents(new PistonEvents(), this); - getServer().getPluginManager().registerEvents(new FrpgPlayerCraftItemEventCaller(), this); - getServer().getPluginManager().registerEvents(new FrpgAbilityItemMovedEventCaller(), this); - getServer().getPluginManager().registerEvents(new FrpgPlayerRightClickEventCaller(), this); - - //Registers commands - getCommand("frpg").setExecutor(new FrpgCommands()); - getCommand("spite").setExecutor(new SpiteQuote()); - - - //If the plugin starts with players online - for (Player p : Bukkit.getOnlinePlayers()) { - LoginProcedure login = new LoginProcedure(p); - login.playerLogin(); - } - - //Begin Asynchronous loading of offline player stats - OfflinePlayerStatLoadIn offlinePlayerStatLoadIn = new OfflinePlayerStatLoadIn(); - offlinePlayerStatLoadIn.loadInOfflinePlayers(); - - //Check extra stuff on load-up - //saveResource("perkConfig.yml",false); - //ymlManager.updateCheckYML("perkConfig.yml"); - //test(); + private static Logger LOGGER = LogManager.getLogger(FreeRPG.class.getSimpleName()); + + public static void log(Level level, String message) { + LOGGER.log(level, message); + } + + @Override + public void onEnable() { + log(Level.INFO, "Starting FreeRPG"); + //Plugin startup logic + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + //Saves Resources if they aren't there + getConfig().options().copyDefaults(); + saveDefaultConfig(); + saveResource("languages.yml", false); + saveResource("advancedConfig.yml", false); + + //Checks config.yml and languages.yml for updates, and update them if needed (while trying to keep any edits) + log(Level.INFO, "Checking for config and language files"); + YMLManager ymlManager = new YMLManager(); + ymlManager.updateCheckYML("config.yml"); + ymlManager.updateCheckYML("languages.yml"); + ymlManager.updateCheckYML("advancedConfig.yml"); + + //Loads config to into memory + log(Level.INFO, "Loading configs"); + ConfigLoad loadConfig = new ConfigLoad(); + loadConfig.initializeConfig(); + + //Makes SeverData Folder + ServerDataFolderPreparation serverDataFolderPreparation = new ServerDataFolderPreparation(); + serverDataFolderPreparation.initializeServerDataFolder(); + + //Makes PlayerData Folder + PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); + playerStatsFilePreparation.initializePlayerDataBase(); + + //Initialize Placed Blocks Map + PlacedBlockFileManager placedBlockFileManager = new PlacedBlockFileManager(); + placedBlockFileManager.initializePlacedBlocksFile(); //Creates blockLocations.dat if not already made + placedBlockFileManager.initializePlacedBlocks(); //Imports data from blockLocations.dat into a hashamp + + //Initializes RecentLogouts List + RecentPlayersFileManager recentPlayersFileManager = new RecentPlayersFileManager(); + recentPlayersFileManager.initializeRecentPlayersFile(); //Creates recentPlayers.dat if not already made + recentPlayersFileManager.initializeRecentPlayers(); //Imports data from recentPlayters.dat to an arrayList in RecentLogouts + + //Check if the server uses world guard + log(Level.INFO, "Checking for APIs"); + WorldGuardChecks CheckWorldGuardExistence = new WorldGuardChecks(); + CheckWorldGuardExistence.initializeWorldGuardPresent(); + + //Checks if the server has PlaceHolderAPI + if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { + if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI").isEnabled()) { + new FreeRPGPlaceHolders(this).register(); + log(Level.INFO, "PlaceholderAPI is present: true"); + } } - public void test() { //The purpose of this is to just place test code to run when the plugin is enabled or disabled - - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - - File f = new File(plugin.getDataFolder(),"perkConfig.yml"); - f.setReadable(true,false); - f.setWritable(true,false); - YamlConfiguration config = YamlConfiguration.loadConfiguration(f); - - final String testConfigPath = "global.skill-1.level-1.test"; - Object test = config.get(testConfigPath); - System.out.println(test); - System.out.println(test.getClass()); - //CustomRecipe customRecipe = new CustomContainerImporter(testConfigPath).getCustomRecipe(test,"TEST"); - //customRecipe.addTranslatedVariants(); - //System.out.println(customRecipe); - //System.out.println(CustomContainerImporter.convertListedTableRowToMap(test,testConfigPath)); - + //Initializes all "global" variables + // TODO find a better solution + log(Level.INFO, "Initializing FreeRPG"); + MinecraftVersion minecraftVersion = new MinecraftVersion(); + minecraftVersion.initializeVersion(); + EntityGroups entityGroups = new EntityGroups(); + entityGroups.initializeAllEntityGroups(); + ExpMaps expMaps = new ExpMaps(); + expMaps.initializeAllExpMaps(); + ItemGroups itemGroups = new ItemGroups(); + itemGroups.initializeItemGroups(); + CraftingRecipes craftingRecipes = new CraftingRecipes(); + craftingRecipes.initializeAllCraftingRecipes(); + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + stringsAndOtherData.initializeData(); + + //Initializes Player Leaderboard (and may create a file) + Leaderboards playerLeaderboard = new Leaderboards(); + LeaderBoardFilesManager leaderBoardFilesManager = new LeaderBoardFilesManager(); + playerLeaderboard.initializeLeaderboards(); + boolean didCreateFile = leaderBoardFilesManager.createLeaderBoardFile(false); + if (!didCreateFile) { + leaderBoardFilesManager.readInLeaderBoardFile(); } - public void onDisable() { - - //Does everything that would normally be done if a player were to log out - for (Player p : Bukkit.getOnlinePlayers()) { - LogoutProcedure logout = new LogoutProcedure(p); - try { - logout.playerLogout(true); - } catch (IOException e) { - e.printStackTrace(); - } - } - - PlacedBlockFileManager saveBlocks = new PlacedBlockFileManager(); - saveBlocks.writePlacedBlocks(); - RecentPlayersFileManager recentPlayersFileManager = new RecentPlayersFileManager(); - recentPlayersFileManager.writeRecentPlayers(); - LeaderBoardFilesManager leaderBoardFilesManager = new LeaderBoardFilesManager(); - leaderBoardFilesManager.writeOutPlayerLeaderBoardFile(); - - ConfigLoad configLoad = new ConfigLoad(); - if (configLoad.isSaveRunTimeData()) { - RunTimeData runTimeData = new RunTimeData(); - runTimeData.logRunTimeData(); - } + //Initializes periodically saving stats + PeriodicSaving saveStats = new PeriodicSaving(); + saveStats.periodicallySaveStats(); + + //Register Events + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.isSaveRunTimeData()) { + getServer().getPluginManager().registerEvents(new PlayerLeftClick(), this); + getServer().getPluginManager().registerEvents(new PlayerBlockBreak(), this); + } else { + getServer().getPluginManager().registerEvents(new PlayerLeftClickDeveloper(), this); + getServer().getPluginManager().registerEvents(new PlayerBlockBreakDeveloper(), this); + } + getServer().getPluginManager().registerEvents(this, this); + getServer().getPluginManager().registerEvents(new PlayerJoin(), this); + getServer().getPluginManager().registerEvents(new PlayerLeave(), this); + getServer().getPluginManager().registerEvents(new MainGUIclick(), this); + getServer().getPluginManager().registerEvents(new SkillsGUIclick(), this); + getServer().getPluginManager().registerEvents(new CraftingGUIclick(), this); + getServer().getPluginManager().registerEvents(new ConfirmationGUIClick(), this); + getServer().getPluginManager().registerEvents(new ConfigurationGUIClick(), this); + getServer().getPluginManager().registerEvents(new PlayerBlockPlace(), this); + getServer().getPluginManager().registerEvents(new PlayerRightClick(), this); + getServer().getPluginManager().registerEvents(new PlayerTakeDamage(), this); + getServer().getPluginManager().registerEvents(new PlayerCraft(), this); + getServer().getPluginManager().registerEvents(new PlayerPrepareCrafting(), this); + getServer().getPluginManager().registerEvents(new EntityHitEntity(), this); + getServer().getPluginManager().registerEvents(new PlayerKillEntity(), this); + getServer().getPluginManager().registerEvents(new PlayerConsumeItem(), this); + getServer().getPluginManager().registerEvents(new PlayerRightClickEntity(), this); + getServer().getPluginManager().registerEvents(new PlayerShear(), this); + getServer().getPluginManager().registerEvents(new PlayerFish(), this); + getServer().getPluginManager().registerEvents(new PlayerShootBow(), this); + getServer().getPluginManager().registerEvents(new ArrowLand(), this); + getServer().getPluginManager().registerEvents(new EntityGetDamaged(), this); + getServer().getPluginManager().registerEvents(new TameEntityEvent(), this); + getServer().getPluginManager().registerEvents(new PlayerMount(), this); + getServer().getPluginManager().registerEvents(new PlayerDismount(), this); + getServer().getPluginManager().registerEvents(new PlayerBreedEntity(), this); + getServer().getPluginManager().registerEvents(new PlayerToggleSprint(), this); + getServer().getPluginManager().registerEvents(new BrewingInventoryClick(), this); + getServer().getPluginManager().registerEvents(new PotionSplash(), this); + getServer().getPluginManager().registerEvents(new LingeringPotionSplash(), this); + getServer().getPluginManager().registerEvents(new FinishedBrewing(), this); + getServer().getPluginManager().registerEvents(new PlayerGetExperience(), this); + getServer().getPluginManager().registerEvents(new PrepareEnchanting(), this); + getServer().getPluginManager().registerEvents(new PrepareRepair(), this); + getServer().getPluginManager().registerEvents(new AnvilClick(), this); + getServer().getPluginManager().registerEvents(new PlayerEnchant(), this); + getServer().getPluginManager().registerEvents(new PlayerDeath(), this); + getServer().getPluginManager().registerEvents(new FurnaceSmelt(), this); + getServer().getPluginManager().registerEvents(new FurnaceInventoryClick(), this); + getServer().getPluginManager().registerEvents(new FurnaceBurn(), this); + getServer().getPluginManager().registerEvents(new PlayerRespawn(), this); + getServer().getPluginManager().registerEvents(new PlayerDropItem(), this); + getServer().getPluginManager().registerEvents(new ExperienceBottleBreak(), this); + getServer().getPluginManager().registerEvents(new SkillsConfigGUIClick(), this); + getServer().getPluginManager().registerEvents(new EntityPickUpItem(), this); + getServer().getPluginManager().registerEvents(new CreatureSpawn(), this); + getServer().getPluginManager().registerEvents(new DispenserDispenseItem(), this); + getServer().getPluginManager().registerEvents(new PlayerMoveAbilityItem(), this); + getServer().getPluginManager().registerEvents(new PlayerEnterVehicle(), this); + getServer().getPluginManager().registerEvents(new PistonEvents(), this); + getServer().getPluginManager().registerEvents(new FrpgPlayerCraftItemEventCaller(), this); + getServer().getPluginManager().registerEvents(new FrpgAbilityItemMovedEventCaller(), this); + getServer().getPluginManager().registerEvents(new FrpgPlayerRightClickEventCaller(), this); + + //Register commands + getCommand("frpg").setExecutor(new FrpgCommands()); + getCommand("spite").setExecutor(new SpiteQuote()); + + //If the plugin starts with players online + for (Player p : Bukkit.getOnlinePlayers()) { + LoginProcedure login = new LoginProcedure(p); + login.playerLogin(); } - //Load custom enchantments - public void registerEnchantment(Enchantment enchantment) { - boolean registered = true; - try { - Field f = Enchantment.class.getDeclaredField("acceptingNew"); - f.setAccessible(true); - f.set(null, true); - Enchantment.registerEnchantment(enchantment); - } catch (Exception e) { - registered = false; - e.printStackTrace(); - } - if(registered){ - // It's been registered! - } + //Begin Asynchronous loading of offline player stats + OfflinePlayerStatLoadIn offlinePlayerStatLoadIn = new OfflinePlayerStatLoadIn(); + offlinePlayerStatLoadIn.loadInOfflinePlayers(); + + //Check extra stuff on load-up + //saveResource("perkConfig.yml",false); + //ymlManager.updateCheckYML("perkConfig.yml"); + //test(); + } + + public void test() { //The purpose of this is to just place test code to run when the plugin is enabled or disabled + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + File f = new File(plugin.getDataFolder(), "perkConfig.yml"); + f.setReadable(true, false); + f.setWritable(true, false); + YamlConfiguration config = YamlConfiguration.loadConfiguration(f); + + final String testConfigPath = "global.skill-1.level-1.test"; + Object test = config.get(testConfigPath); + System.out.println(test); + System.out.println(test.getClass()); + //CustomRecipe customRecipe = new CustomContainerImporter(testConfigPath).getCustomRecipe(test,"TEST"); + //customRecipe.addTranslatedVariants(); + //System.out.println(customRecipe); + //System.out.println(CustomContainerImporter.convertListedTableRowToMap(test,testConfigPath)); + } + + public void onDisable() { + log(Level.INFO, "Shutting down FreeRPG"); + + //Does everything that would normally be done if a player were to log out + for (Player p : Bukkit.getOnlinePlayers()) { + LogoutProcedure logout = new LogoutProcedure(p); + try { + logout.playerLogout(true); + } catch (IOException e) { + log(Level.ERROR, e.getMessage()); + } } - public void unregisterEnchantments(Enchantment enchantment) { - try { - Field keyField = Enchantment.class.getDeclaredField("byKey"); + PlacedBlockFileManager saveBlocks = new PlacedBlockFileManager(); + saveBlocks.writePlacedBlocks(); + RecentPlayersFileManager recentPlayersFileManager = new RecentPlayersFileManager(); + recentPlayersFileManager.writeRecentPlayers(); + LeaderBoardFilesManager leaderBoardFilesManager = new LeaderBoardFilesManager(); + leaderBoardFilesManager.writeOutPlayerLeaderBoardFile(); + + ConfigLoad configLoad = new ConfigLoad(); + if (configLoad.isSaveRunTimeData()) { + RunTimeData runTimeData = new RunTimeData(); + runTimeData.logRunTimeData(); + } + } + + //Load custom enchantments + public void registerEnchantment(Enchantment enchantment) { + boolean registered = true; + try { + Field f = Enchantment.class.getDeclaredField("acceptingNew"); + f.setAccessible(true); + f.set(null, true); + Enchantment.registerEnchantment(enchantment); + } catch (Exception e) { + registered = false; + log(Level.ERROR, e.getMessage()); + } + if (registered) { + // It's been registered! + } + } - keyField.setAccessible(true); - @SuppressWarnings("unchecked") - HashMap byKey = (HashMap) keyField.get(null); + public void unregisterEnchantments(Enchantment enchantment) { + try { + Field keyField = Enchantment.class.getDeclaredField("byKey"); - if(byKey.containsKey(enchantment.getKey())) { - byKey.remove(enchantment.getKey()); - } + keyField.setAccessible(true); + @SuppressWarnings("unchecked") + HashMap byKey = (HashMap) keyField.get( + null); - Field nameField = Enchantment.class.getDeclaredField("byName"); + if (byKey.containsKey(enchantment.getKey())) { + byKey.remove(enchantment.getKey()); + } - nameField.setAccessible(true); - @SuppressWarnings("unchecked") - HashMap byName = (HashMap) nameField.get(null); + Field nameField = Enchantment.class.getDeclaredField("byName"); - if(byName.containsKey(enchantment.getName())) { - byName.remove(enchantment.getName()); - } + nameField.setAccessible(true); + @SuppressWarnings("unchecked") + HashMap byName = (HashMap) nameField.get(null); - } catch (Exception ignored) { } + if (byName.containsKey(enchantment.getName())) { + byName.remove(enchantment.getName()); + } + } catch (Exception ignored) { } - + } } diff --git a/src/main/java/mc/carlton/freerpg/brewingEvents/BrewingInventoryClick.java b/src/main/java/mc/carlton/freerpg/brewingEvents/BrewingInventoryClick.java deleted file mode 100644 index 66252fd..0000000 --- a/src/main/java/mc/carlton/freerpg/brewingEvents/BrewingInventoryClick.java +++ /dev/null @@ -1,168 +0,0 @@ -package mc.carlton.freerpg.brewingEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.BrewingStandUserTracker; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.perksAndAbilities.Alchemy; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.Material; -import org.bukkit.block.BrewingStand; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryType; -import org.bukkit.inventory.BrewerInventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.plugin.Plugin; -import org.bukkit.potion.PotionData; -import org.bukkit.potion.PotionType; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class BrewingInventoryClick implements Listener { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - @EventHandler(priority = EventPriority.HIGHEST) - void onInventoryClick(InventoryClickEvent e) { - if (e.isCancelled()) { - return; - } - try { - InventoryType invType = e.getClickedInventory().getType(); - } catch (Exception except) { - return; - } - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("alchemy")) { - return; - } - - /* Perk removed - if (e.getInventory().getHolder() instanceof BrewingStand) { //This section is very buggy, and not clean. Hopefully I can improve it in the future - Player p = (Player) e.getWhoClicked(); - BrewingStandUserTracker brewTracker = new BrewingStandUserTracker(); - brewTracker.addstand((BrewingStand) e.getInventory().getHolder(),p); - int slot = e.getSlot(); - if ( (slot <= 5) || (e.getClick() == ClickType.SHIFT_LEFT || e.getClick() == ClickType.SHIFT_RIGHT) ) { - BrewerInventory brewingInventory = (BrewerInventory) e.getInventory(); - playerStats pStatClass = new playerStats(p); - Map> pStat = pStatClass.getPlayerData(); - int speedBrewingLevel = (int) pStat.get("alchemy").get(7); - int time = (int) Math.round((1 - speedBrewingLevel * 0.15) * 400); - final BrewingStand stand = (BrewingStand) e.getInventory().getHolder(); - stand.setBrewingTime(time); - stand.update(); - } - } - */ - - if (e.getInventory().getHolder() instanceof BrewingStand) { //This section is very buggy, and not clean. Hopefully I can improve it in the future - Player p = (Player) e.getWhoClicked(); - BrewingStandUserTracker brewTracker = new BrewingStandUserTracker(); - brewTracker.addstand((BrewingStand) e.getInventory().getHolder(), p); - } - - if (e.getClick() != ClickType.LEFT) { - return; - } - if (e.getClickedInventory() instanceof BrewerInventory) { - ItemGroups itemGroups = new ItemGroups(); - List oldIngredients = itemGroups.getOldIngredients(); - List newIngredients = itemGroups.getNewIngredients(); - ItemStack heroPotion = itemGroups.getHeroPotion(); - ItemStack fatiguePotion = itemGroups.getFatiguePotion(); - ItemStack hastePotion = itemGroups.getHastePotion(); - ItemStack decayPotion = itemGroups.getDecayPotion(); - ItemStack resistancePotion = itemGroups.getResistancePotion(); - - - BrewerInventory brewingInventory = (BrewerInventory) e.getClickedInventory(); - Player p = (Player) e.getWhoClicked(); - if (e.getSlot() == 3) { - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - ItemStack awkwardBottle = new ItemStack(Material.POTION,1); - PotionMeta awkward = (PotionMeta) awkwardBottle.getItemMeta(); - awkward.setBasePotionData(new PotionData(PotionType.AWKWARD)); - awkwardBottle.setItemMeta(awkward); - final ItemStack ingredient = e.getCurrentItem(); - final ItemStack cursorClone = e.getCursor().clone(); - final ItemStack potionSlot1 = e.getInventory().getItem(0); - final ItemStack potionSlot2 = e.getInventory().getItem(1); - final ItemStack potionSlot3 = e.getInventory().getItem(2); - final ItemStack[] potionSlots = {potionSlot1,potionSlot2,potionSlot3}; - if (cursorClone == null) { - return; - } - if (cursorClone.getType() == Material.AIR) { - return; - } - if (cursorClone.getType() == ingredient.getType()) { - e.setCancelled(true); - return; - } - new BukkitRunnable() { - @Override - public void run() { - if (!(oldIngredients.contains(cursorClone.getType()))) { - e.getView().setCursor(ingredient); - e.getClickedInventory().setItem(e.getSlot(), cursorClone); - p.updateInventory(); - } - Alchemy alchemyClass = new Alchemy(p); - if (newIngredients.contains(cursorClone.getType())) { - ItemStack[] potionSlots = {potionSlot1,potionSlot2,potionSlot3}; - boolean[] slotsAwkward = {alchemyClass.comparePotionEffects(potionSlot1, awkwardBottle), alchemyClass.comparePotionEffects(potionSlot2, awkwardBottle), alchemyClass.comparePotionEffects(potionSlot3, awkwardBottle)}; - boolean proceed = true; - for (int i = 0; i < 3; i++) { - if (slotsAwkward[i]) { - continue; - } else if (potionSlots[i] == null) { - continue; - } else if (potionSlots[i].getType() == Material.AIR) { - continue; - } - proceed = false; - break; - } - if (proceed) { - if (newIngredients.indexOf(cursorClone.getType()) == 0 && (int)pStat.get("alchemy").get(9) >= 1) { - alchemyClass.startBrewing(brewingInventory, heroPotion, cursorClone); - } else if (newIngredients.indexOf(cursorClone.getType()) == 1 && (int)pStat.get("alchemy").get(9) >= 2) { - alchemyClass.startBrewing(brewingInventory, fatiguePotion, cursorClone); - } else if (newIngredients.indexOf(cursorClone.getType()) == 2 && (int)pStat.get("alchemy").get(9) >= 3) { - alchemyClass.startBrewing(brewingInventory, hastePotion, cursorClone); - } else if (newIngredients.indexOf(cursorClone.getType()) == 3 && (int)pStat.get("alchemy").get(9) >= 4) { - alchemyClass.startBrewing(brewingInventory, decayPotion, cursorClone); - } else if (newIngredients.indexOf(cursorClone.getType()) == 4 && (int)pStat.get("alchemy").get(9) >= 5) { - alchemyClass.startBrewing(brewingInventory, resistancePotion, cursorClone); - } - } - } else if (cursorClone.getType() == Material.GLOWSTONE_DUST || cursorClone.getType() == Material.REDSTONE) { - boolean[] slotsToCheck = {false,false,false}; - for (int i = 0; i < 3; i++) { - if (potionSlots[i] != null) { - if (potionSlots[i].getItemMeta().hasEnchant(Enchantment.LOYALTY)) { - slotsToCheck[i] = true; - } - } - } - if ( !slotsToCheck[0] && !slotsToCheck[1] && !slotsToCheck[2]) { - return; - } - alchemyClass.upgradeBrewing(brewingInventory, cursorClone,slotsToCheck); - } - } - }.runTaskLater(plugin, 1); - } - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/brewingEvents/FinishedBrewing.java b/src/main/java/mc/carlton/freerpg/brewingEvents/FinishedBrewing.java deleted file mode 100644 index b09acbf..0000000 --- a/src/main/java/mc/carlton/freerpg/brewingEvents/FinishedBrewing.java +++ /dev/null @@ -1,96 +0,0 @@ -package mc.carlton.freerpg.brewingEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.BrewingStandUserTracker; -import mc.carlton.freerpg.perksAndAbilities.Alchemy; -import mc.carlton.freerpg.playerInfo.ChangeStats; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.block.BrewingStand; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.BrewEvent; -import org.bukkit.inventory.BrewerInventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.plugin.Plugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.Map; - -public class FinishedBrewing implements Listener { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - @EventHandler(priority = EventPriority.HIGH) - void onBrewComplete(BrewEvent e){ - if (e.isCancelled()) { - return; - } - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("alchemy")) { - return; - } - BrewerInventory inventory = e.getContents(); - ItemStack ingredient = inventory.getItem(3).clone(); - ItemStack[] slotItems = {inventory.getItem(0),inventory.getItem(1),inventory.getItem(2)}; - BrewingStandUserTracker brewTracker = new BrewingStandUserTracker(); - Player p = brewTracker.getPlayer(inventory.getHolder()); - if (p != null) { - Alchemy alchemyClass = new Alchemy(p); - alchemyClass.giveBrewingEXP(ingredient,slotItems); - } - if (ingredient.getType() == Material.DRAGON_BREATH || ingredient.getType() == Material.GUNPOWDER) { - new BukkitRunnable() { - @Override - public void run() { - BrewingStand stand = inventory.getHolder(); - for (int i=0; i<3;i++) { - ItemStack slot_i = slotItems[i]; - if (slot_i != null) { - if (slot_i.getType() != Material.AIR) { - if (slot_i.getEnchantments().containsKey(Enchantment.LOYALTY) || slot_i.getEnchantments().containsKey(Enchantment.DURABILITY)) { - PotionMeta slotMeta = (PotionMeta) slot_i.getItemMeta(); - String normalName = slotMeta.getDisplayName().substring(2); - if (ingredient.getType() == Material.GUNPOWDER) { - if (slot_i.getType() == Material.POTION) { - slot_i.setType(Material.SPLASH_POTION); - slotMeta.setDisplayName(ChatColor.RESET + "Splash " + normalName); - } - } - else { - if (slot_i.getType() == Material.SPLASH_POTION) { - slot_i.setType(Material.LINGERING_POTION); - normalName = normalName.substring(7); - slotMeta.setDisplayName(ChatColor.RESET + "Lingering " + normalName); - PotionEffectType effectType = slotMeta.getCustomEffects().get(0).getType(); - int newLength = (int) Math.round(slotMeta.getCustomEffects().get(0).getDuration()*0.25); - int level = slotMeta.getCustomEffects().get(0).getAmplifier(); - slotMeta.addCustomEffect(new PotionEffect(effectType,newLength,level),true); - } - } - slot_i.setItemMeta(slotMeta); - stand.getSnapshotInventory().setItem(i,slot_i); - stand.update(); - if (p != null) { - ConfigLoad configLoad1 = new ConfigLoad(); - Map expMap = configLoad1.getExpMapForSkill("alchemy"); - ChangeStats increaseStats = new ChangeStats(p); - increaseStats.changeEXP("alchemy", expMap.get("brewSplashPotion")); - } - } - } - - } - } - - } - }.runTaskLater(plugin, 1); - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/clickEvents/PlayerLeftClick.java b/src/main/java/mc/carlton/freerpg/clickEvents/PlayerLeftClick.java deleted file mode 100644 index c95a413..0000000 --- a/src/main/java/mc/carlton/freerpg/clickEvents/PlayerLeftClick.java +++ /dev/null @@ -1,78 +0,0 @@ -package mc.carlton.freerpg.clickEvents; - -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.perksAndAbilities.*; -import mc.carlton.freerpg.playerInfo.AbilityTracker; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.GameMode; -import org.bukkit.Material; -import org.bukkit.World; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -public class PlayerLeftClick implements Listener { - - @EventHandler - void onLeftClick(PlayerInteractEvent e) { - Action a = e.getAction(); - - if ((a.equals(Action.LEFT_CLICK_AIR)) || (a.equals(Action.LEFT_CLICK_BLOCK))) { - Player p = e.getPlayer(); - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - World world = p.getWorld(); - Material itemType = p.getInventory().getItemInMainHand().getType(); - - ItemGroups itemGroups = new ItemGroups(); - List leftClickItems = itemGroups.getLeftClickItems(); - - if (itemType == Material.FISHING_ROD && a.equals(Action.LEFT_CLICK_BLOCK)) { - Fishing fishingClass = new Fishing(p); - fishingClass.initiateAbility(); - } - - else if (itemType == Material.BOW) { - Archery archeryClass = new Archery(p); - archeryClass.initiateAbility(); - } - else if (itemType == Material.CROSSBOW) { - Archery archeryClass = new Archery(p); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("archery").get(12) > 0) { - archeryClass.initiateAbility(); - } - } - else if (p.getVehicle() != null) { - EntityType[] acceptableVehicles0 = {EntityType.HORSE,EntityType.SKELETON_HORSE,EntityType.ZOMBIE_HORSE,EntityType.PIG,EntityType.DONKEY,EntityType.MULE,EntityType.LLAMA}; - List acceptableVehicles = Arrays.asList(acceptableVehicles0); - if (!leftClickItems.contains(itemType) && acceptableVehicles.contains(p.getVehicle().getType())) { - AbilityTracker abilities = new AbilityTracker(p); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[6] > -1) { - BeastMastery beastMasteryClass = new BeastMastery(p); - beastMasteryClass.enableAbility(); - } - } - } - - - if (a.equals(Action.LEFT_CLICK_BLOCK)) { - BlockFace blockface = e.getBlockFace(); - Digging diggingClass = new Digging(p); - diggingClass.storeBlockFace(blockface); - } - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/clickEvents/PlayerLeftClickDeveloper.java b/src/main/java/mc/carlton/freerpg/clickEvents/PlayerLeftClickDeveloper.java deleted file mode 100644 index 6f395fc..0000000 --- a/src/main/java/mc/carlton/freerpg/clickEvents/PlayerLeftClickDeveloper.java +++ /dev/null @@ -1,85 +0,0 @@ -package mc.carlton.freerpg.clickEvents; - -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.perksAndAbilities.*; -import mc.carlton.freerpg.playerInfo.AbilityTracker; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import mc.carlton.freerpg.serverInfo.RunTimeData; -import org.bukkit.GameMode; -import org.bukkit.Material; -import org.bukkit.World; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class PlayerLeftClickDeveloper implements Listener { - - @EventHandler - void onLeftClick(PlayerInteractEvent e) { - Action a = e.getAction(); - - if ((a.equals(Action.LEFT_CLICK_AIR)) || (a.equals(Action.LEFT_CLICK_BLOCK))) { - RunTimeData runTimeData = new RunTimeData(); - Player p = e.getPlayer(); - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - World world = p.getWorld(); - Material itemType = p.getInventory().getItemInMainHand().getType(); - - ItemGroups itemGroups = new ItemGroups(); - List leftClickItems = itemGroups.getLeftClickItems(); - - long timer = System.currentTimeMillis(); - if (itemType == Material.FISHING_ROD && a.equals(Action.LEFT_CLICK_BLOCK)) { - Fishing fishingClass = new Fishing(p); - fishingClass.initiateAbility(); - } - - else if (itemType == Material.BOW) { - Archery archeryClass = new Archery(p); - archeryClass.initiateAbility(); - } - else if (itemType == Material.CROSSBOW) { - Archery archeryClass = new Archery(p); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("archery").get(12) > 0) { - archeryClass.initiateAbility(); - } - } - else if (p.getVehicle() != null) { - if (!leftClickItems.contains(itemType) && p.getVehicle().getType() == EntityType.HORSE) { - AbilityTracker abilities = new AbilityTracker(p); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[6] > -1) { - BeastMastery beastMasteryClass = new BeastMastery(p); - beastMasteryClass.enableAbility(); - } - } - } - - - if (a.equals(Action.LEFT_CLICK_BLOCK)) { - long timer1 = System.currentTimeMillis(); - BlockFace blockface = e.getBlockFace(); - Digging diggingClass = new Digging(p); - diggingClass.storeBlockFace(blockface); - long storeBlockFaceTime = System.currentTimeMillis() - timer1; - runTimeData.addTime(storeBlockFaceTime,"blockFace"); - - } - long allConditionals = System.currentTimeMillis() - timer; - runTimeData.addTime(allConditionals,"leftClickConditionals"); - - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/clickEvents/PlayerRightClick.java b/src/main/java/mc/carlton/freerpg/clickEvents/PlayerRightClick.java deleted file mode 100644 index 2f149c8..0000000 --- a/src/main/java/mc/carlton/freerpg/clickEvents/PlayerRightClick.java +++ /dev/null @@ -1,282 +0,0 @@ -package mc.carlton.freerpg.clickEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.perksAndAbilities.*; -import mc.carlton.freerpg.playerInfo.*; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.WorldGuardChecks; -import org.bukkit.*; -import org.bukkit.block.Block; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.EquipmentSlot; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.*; - - -public class PlayerRightClick implements Listener { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - - @EventHandler - void onRightClick(PlayerInteractEvent e) { - Action a = e.getAction(); - if (e.getHand() == EquipmentSlot.OFF_HAND) { - return; - } - if ((a.equals(Action.RIGHT_CLICK_AIR)) || (a.equals(Action.RIGHT_CLICK_BLOCK))) { - Player p = e.getPlayer(); - PlayerStats pStatClass = new PlayerStats(p); - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - ChangeStats increaseStats = new ChangeStats(p); - AbilityTracker abilities = new AbilityTracker(p); - Integer[] pAbilities = abilities.getPlayerAbilities(); - ItemStack itemInHand = p.getInventory().getItemInMainHand(); - Material itemInHandType = itemInHand.getType(); - ItemGroups itemGroups = new ItemGroups(); - List pickaxes = itemGroups.getPickaxes(); - List axes = itemGroups.getAxes(); - List hoes = itemGroups.getHoes(); - List swords = itemGroups.getSwords(); - List shovels = itemGroups.getShovels(); - List noRightClick = itemGroups.getNoRightClick(); - List actionableBlocks = itemGroups.getActionableBlocks(); - - LanguageSelector langManager = new LanguageSelector(p); - - - //Right clicking blocks - if (a.equals(Action.RIGHT_CLICK_BLOCK)) { - //Composter EXP - Farming farmingClass = new Farming(p); - farmingClass.composterEXP(e.getClickedBlock()); - - //Repair - if (e.getClickedBlock().getType() == Material.IRON_BLOCK && !itemInHandType.isBlock()) { - if (pAbilities[0] != -2 && pAbilities[2] != -2 && pAbilities[7] != -2) { - Repair repairClass = new Repair(p); - repairClass.repairItem(); - e.setCancelled(true); - } - else { - p.sendMessage(ChatColor.RED + langManager.getString("cannotRepair")); - } - return; - } - //Salvaging - else if (e.getClickedBlock().getType() == Material.GOLD_BLOCK && !itemInHandType.isBlock()) { - if (p.isSneaking()) { - if (pAbilities[0] != -2 && pAbilities[2] != -2 && pAbilities[7] != -2) { - Repair repairClass = new Repair(p); - repairClass.salvaging(); - e.setCancelled(true); - } - else { - p.sendMessage(ChatColor.RED + langManager.getString("cannotSalvage")); - } - return; - } - } - //Stopping abilities from activating on stuff like doors - if (actionableBlocks.contains(e.getClickedBlock().getType())) { - return; - } - } - - if (p.getInventory().getItemInOffHand().getType() == Material.TORCH && a.equals(Action.RIGHT_CLICK_BLOCK)) { - return; - } - - int waitTicks = 0; - //Shield smoothness - if (p.getInventory().getItemInOffHand().getType() == Material.SHIELD) { - waitTicks = 6; - } - - - //Explosions - if (itemInHandType == Material.FLINT_AND_STEEL) { - Block blockLit = e.getClickedBlock(); - if (blockLit == null) { - return; - } - WorldGuardChecks BuildingCheck = new WorldGuardChecks(); - ConfigLoad canExplode = new ConfigLoad(); - if (!canExplode.isAllowExplosions()) { - return; - } - if (!BuildingCheck.canBuild(p, blockLit.getLocation())) { - return; - } - if (blockLit.getType() == Material.TNT) { - e.setCancelled(true); - Mining miningClass = new Mining(p); - miningClass.tntExplode(blockLit); - } - } - - //Digging - else if (shovels.contains(itemInHandType)) { - Digging diggingClass = new Digging(p); - if (a.equals(Action.RIGHT_CLICK_BLOCK)) { - if (!(e.getClickedBlock().getType() == Material.GRASS_BLOCK)) { - new BukkitRunnable() { - @Override - public void run() { - if (p.isOnline()) { - if (!p.isBlocking()) { - diggingClass.initiateAbility(); - } - } - } - }.runTaskLater(plugin, waitTicks); - - } - } else { - new BukkitRunnable() { - @Override - public void run() { - if (p.isOnline()) { - if (!p.isBlocking()) { - diggingClass.initiateAbility(); - } - } - } - }.runTaskLater(plugin, waitTicks); - } - } - //Woodcutting and AxeMastery - else if (axes.contains(itemInHandType)) { - Woodcutting woodcuttingClass = new Woodcutting(p); - if (a.equals(Action.RIGHT_CLICK_BLOCK)) { - if (woodcuttingClass.blacklistedBlock(e.getClickedBlock())) { - return; - } - } - new BukkitRunnable() { - @Override - public void run() { - if (p.isOnline()) { - if (!p.isBlocking()) { - woodcuttingClass.initiateAbility(); - } - } - } - }.runTaskLater(plugin, waitTicks); - AxeMastery axeMasteryClass = new AxeMastery(p); - new BukkitRunnable() { - @Override - public void run() { - if (p.isOnline()) { - if (!p.isBlocking()) { - axeMasteryClass.initiateAbility(); - } - } - } - }.runTaskLater(plugin, waitTicks); - } - //Mining - else if (pickaxes.contains(itemInHandType)) { - Mining miningClass = new Mining(p); - new BukkitRunnable() { - @Override - public void run() { - if (p.isOnline()) { - if (!p.isBlocking()) { - miningClass.initiateAbility(); - } - } - } - }.runTaskLater(plugin, waitTicks); - } - - //Farming - else if (hoes.contains(itemInHandType)) { - if (a.equals(Action.RIGHT_CLICK_BLOCK)) { - if (!(e.getClickedBlock().getType() == Material.DIRT || e.getClickedBlock().getType() == Material.GRASS_BLOCK || e.getClickedBlock().getType() == Material.GRASS_PATH )) { - Farming farmingClass = new Farming(p); - farmingClass.initiateAbility(); - } else { - Material blockAbove = e.getClickedBlock().getRelative(0,1,0).getType(); - if (blockAbove == Material.AIR || blockAbove == Material.CAVE_AIR || blockAbove == Material.VOID_AIR) { - ConfigLoad configLoad = new ConfigLoad(); - Map expMap = configLoad.getExpMapForSkill("farming"); - increaseStats.changeEXP("farming", expMap.get("tillLand")); - } - } - } else { - Farming farmingClass = new Farming(p); - farmingClass.initiateAbility(); - } - - } else if (itemInHandType == Material.BONE_MEAL && a.equals(Action.RIGHT_CLICK_BLOCK)) { - Farming farmingClass = new Farming(p); - farmingClass.fertilizerSave(e.getClickedBlock()); - } - - //Archery - else if (itemInHandType == Material.BOW) { - if (pAbilities[5] > -1) { - Archery archeryClass = new Archery(p); - archeryClass.enableAbility(); - } - } else if (itemInHandType == Material.CROSSBOW) { - if ((int) pStat.get("archery").get(12) > 0) { - Archery archeryClass = new Archery(p); - if (pAbilities[5] > -1) { - archeryClass.enableAbility(); - archeryClass.crossbowAbility(); - } else if (pAbilities[5] == -2) { - archeryClass.crossbowAbility(); - } - } - } - - //beastMastery - else if (p.getVehicle() != null) { - EntityType[] acceptableVehicles0 = {EntityType.HORSE,EntityType.SKELETON_HORSE,EntityType.ZOMBIE_HORSE,EntityType.PIG,EntityType.DONKEY,EntityType.MULE,EntityType.LLAMA}; - List acceptableVehicles = Arrays.asList(acceptableVehicles0); - if (acceptableVehicles.contains(p.getVehicle().getType())) { - if ((noRightClick.contains(itemInHandType) || (a == Action.RIGHT_CLICK_AIR && itemInHand.getType().isBlock()))) { - BeastMastery beastMasteryClass = new BeastMastery(p); - beastMasteryClass.initiateAbility(); - } - } - } - - //Swordsmanship - else if (swords.contains(itemInHandType)) { - Swordsmanship swordsmanshipClass = new Swordsmanship(p); - new BukkitRunnable() { - @Override - public void run() { - if (p.isOnline()) { - if (!p.isBlocking()) { - swordsmanshipClass.initiateAbility(); - } - } - } - }.runTaskLater(plugin, waitTicks); - } - - //Defense - else if (itemInHandType == Material.AIR) { - Defense defenseClass = new Defense(p); - defenseClass.initiateAbility(); - } - - - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/clickEvents/PlayerRightClickEntity.java b/src/main/java/mc/carlton/freerpg/clickEvents/PlayerRightClickEntity.java deleted file mode 100644 index 0ed7ce9..0000000 --- a/src/main/java/mc/carlton/freerpg/clickEvents/PlayerRightClickEntity.java +++ /dev/null @@ -1,35 +0,0 @@ -package mc.carlton.freerpg.clickEvents; - -import mc.carlton.freerpg.perksAndAbilities.BeastMastery; -import mc.carlton.freerpg.perksAndAbilities.Farming; -import org.bukkit.GameMode; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerInteractEntityEvent; - -public class PlayerRightClickEntity implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onRightClick(PlayerInteractEntityEvent e) { - if (e.isCancelled()) { - return; - } - Player p = e.getPlayer(); - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - Entity entity = e.getRightClicked(); - - //Farming - Farming farmingClass = new Farming(p); - farmingClass.babyAnimalGrow(entity); - farmingClass.milkingEXP(entity); - - //Beast Mastery - BeastMastery beastMasteryClass = new BeastMastery(p); - beastMasteryClass.getHorseStats(entity); - - } -} diff --git a/src/main/java/mc/carlton/freerpg/combatEvents/ArrowLand.java b/src/main/java/mc/carlton/freerpg/combatEvents/ArrowLand.java deleted file mode 100644 index 223fb5e..0000000 --- a/src/main/java/mc/carlton/freerpg/combatEvents/ArrowLand.java +++ /dev/null @@ -1,27 +0,0 @@ -package mc.carlton.freerpg.combatEvents; - -import mc.carlton.freerpg.perksAndAbilities.Archery; -import org.bukkit.entity.*; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.ProjectileHitEvent; -import org.bukkit.projectiles.ProjectileSource; - -public class ArrowLand implements Listener { - @EventHandler - void onArrowLand(ProjectileHitEvent e){ - Entity projectile = e.getEntity(); - if (projectile instanceof Projectile) { - if (projectile instanceof Arrow || projectile instanceof SpectralArrow) { - ProjectileSource shooter = ((Projectile) projectile).getShooter(); - if (shooter instanceof Player) { - Player p = (Player) shooter; - Archery archeryClass = new Archery(p); - archeryClass.retrievalRemoval(projectile); - - } - } - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/combatEvents/EntityGetDamaged.java b/src/main/java/mc/carlton/freerpg/combatEvents/EntityGetDamaged.java deleted file mode 100644 index bd5e3e1..0000000 --- a/src/main/java/mc/carlton/freerpg/combatEvents/EntityGetDamaged.java +++ /dev/null @@ -1,49 +0,0 @@ -package mc.carlton.freerpg.combatEvents; - -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.entity.*; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityDamageEvent; - -import java.util.*; - -public class EntityGetDamaged implements Listener { - @EventHandler(priority = EventPriority.HIGHEST) - - void onEntityDamaged(EntityDamageEvent e) { - if (e.isCancelled()) { - return; - } - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("beastMastery")) { - return; - } - if (e.getEntity() instanceof Entity) { - Entity wolf = e.getEntity(); - if (wolf.getType() == EntityType.WOLF) { - Tameable dog = (Tameable) wolf; - if (dog.isTamed()){ - if (!(dog.getOwner() instanceof Player)) { //Player is offline or something like that. - return; - } - Player p = (Player) dog.getOwner(); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - if (e.getCause().equals(EntityDamageEvent.DamageCause.FALL)) { - if ((int)pStat.get("beastMastery").get(11) > 0) { - e.setDamage(0); - } - } - else { - int thickFurLevel = (int)pStat.get("beastMastery").get(7); - double thickFurMultiplier = 1 - thickFurLevel*0.1; - e.setDamage(e.getDamage()*thickFurMultiplier); - } - } - } - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/combatEvents/EntityHitEntity.java b/src/main/java/mc/carlton/freerpg/combatEvents/EntityHitEntity.java deleted file mode 100644 index 95b1745..0000000 --- a/src/main/java/mc/carlton/freerpg/combatEvents/EntityHitEntity.java +++ /dev/null @@ -1,326 +0,0 @@ -package mc.carlton.freerpg.combatEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.FireworkShotByPlayerTracker; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.perksAndAbilities.*; -import mc.carlton.freerpg.playerInfo.*; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.GameMode; -import org.bukkit.Material; -import org.bukkit.attribute.Attributable; -import org.bukkit.attribute.Attribute; -import org.bukkit.entity.*; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.plugin.Plugin; -import org.bukkit.projectiles.ProjectileSource; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.util.Vector; - -import java.util.*; - -public class EntityHitEntity implements Listener { - @EventHandler(priority = EventPriority.HIGHEST) - - void onEntityHit(EntityDamageByEntityEvent e) { - Random rand = new Random(); - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - - if (e.isCancelled()) { - return; - } - - if (e.getEntity().isInvulnerable()) { //Godmode check - return; - } - - //removes PvP effects if PvP is disabled - if (e.getEntity() instanceof Player) { - ConfigLoad loadConfig = new ConfigLoad(); - if (e.getDamager() instanceof Player) { - if (!loadConfig.isAllowPvP()) { - return; - } - } - else if (e.getDamager() instanceof Projectile) { - ProjectileSource shooter = ((Projectile) e.getDamager()).getShooter(); - if (shooter instanceof Player) { - if (!loadConfig.isAllowPvP()) { - return; - } else if (shooter.equals(e.getEntity())) { - return; //Shooter shot himself - } - } - } - } - //removes hurting animals effects if hurting animals is disabled - else if (e.getEntity() instanceof Animals) { - ConfigLoad loadConfig = new ConfigLoad(); - if (e.getDamager() instanceof Player) { - if (!loadConfig.isAllowHurtAnimals()) { - return; - } - } - else if (e.getDamager() instanceof Projectile) { - if (((Projectile) e.getDamager()).getShooter() instanceof Player) { - if (!loadConfig.isAllowHurtAnimals()) { - return; - } - } - } - } - - if (e.getDamager() instanceof Player) { - ItemGroups itemGroups = new ItemGroups(); - List shovels = itemGroups.getShovels(); - List swords = itemGroups.getSwords(); - List axes = itemGroups.getAxes(); - - - Player p = (Player) e.getDamager(); - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - AbilityTracker abilities = new AbilityTracker(p); - Integer[] pAbilities = abilities.getPlayerAbilities(); - - - - //Digging - if (shovels.contains(p.getInventory().getItemInMainHand().getType())) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("digging")) { - return; - } - int shovelKnightLevel = (int) pStat.get("digging").get(12); - double multiplier = Math.min(2.0,1.0+shovelKnightLevel); - e.setDamage(e.getDamage() * multiplier); - } - - //swordsmanship - else if (swords.contains(p.getInventory().getItemInMainHand().getType())) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("swordsmanship")) { - return; - } - Swordsmanship swordsmanshipClass = new Swordsmanship(p); - if (pAbilities[7] > -1) { - swordsmanshipClass.enableAbility(); - } - double damage = e.getDamage(); - if ((int)pStat.get("swordsmanship").get(13) > 0) { - damage += 2; - e.setDamage(damage); - } - Entity damagedEntity = e.getEntity(); - swordsmanshipClass.doubleHit(damagedEntity,damage); - swordsmanshipClass.giveHitEXP(e.getFinalDamage(),damagedEntity); - } - - //Defense - else if (p.getInventory().getItemInMainHand().getType() == Material.AIR) { - Defense defenseClass = new Defense(p); - if (pAbilities[8] > -1) { - defenseClass.enableAbility(); - } - } - - else if (axes.contains(p.getInventory().getItemInMainHand().getType())) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("axeMastery")) { - return; - } - AxeMastery axeMasteryClass = new AxeMastery(p); - double damage = e.getDamage(); - if ((int)pStat.get("axeMastery").get(13) > 0) { - damage += 2; - e.setDamage(damage); - } - if (pAbilities[9] > -1) { - axeMasteryClass.enableAbility(); - axeMasteryClass.greaterAxe(e.getEntity(),p.getWorld(),e.getFinalDamage()); - } - else if (pAbilities[9] == -2) { - axeMasteryClass.greaterAxe(e.getEntity(),p.getWorld(),e.getFinalDamage()); - } - double multiplier = axeMasteryClass.divineCritical(); - e.setDamage(e.getDamage()*multiplier); - axeMasteryClass.holyAxe(e.getEntity(),p.getWorld(),e.getFinalDamage()); - axeMasteryClass.giveHitEXP(e.getFinalDamage(),e.getEntity()); - - } - - } - //Arrow of Light - else if (e.getDamager() instanceof Arrow || e.getDamager() instanceof SpectralArrow) { - ProjectileSource shooter; - if (e.getDamager() instanceof SpectralArrow) { - shooter = ((SpectralArrow) e.getDamager()).getShooter(); - } else { - shooter = ((Arrow) e.getDamager()).getShooter(); - } - if (shooter instanceof Player) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("archery")) { - return; - } - Player p = (Player) shooter; - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - Archery archeryClass = new Archery(p); - archeryClass.explosiveArrows(e.getDamager(),e.getEntity().getLocation()); - Material arrowType = archeryClass.getArrowType(); - if (arrowType == Material.SPECTRAL_ARROW) { - int arrowOfLightLevel = (int) pStat.get("archery").get(10); - double multiplier = Math.min(arrowOfLightLevel * 0.05 + 1.0, 2.0); - e.setDamage(Math.min(e.getDamage() * multiplier, 32)); - } - archeryClass.giveHitEXP(e.getFinalDamage(),e.getEntity()); - if (e.getEntity() instanceof LivingEntity) { - if (e.getFinalDamage() > ((LivingEntity) e.getEntity()).getHealth()) { - archeryClass.giveKillEXP(e.getEntity()); - } - } - } - } - //Crossbow Strike - else if (e.getDamager() instanceof Firework) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("archery")) { - return; - } - Entity firework = e.getDamager(); - FireworkShotByPlayerTracker fireworkTracker = new FireworkShotByPlayerTracker(); - Player p = fireworkTracker.getPlayer(firework); - fireworkTracker.removeFireWork(firework); - if (p != null) { - Archery archeryClass = new Archery(p); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("archery").get(13) > 0) { - e.setDamage(Math.min(e.getDamage() * 2, 32)); - archeryClass.giveHitEXP(e.getFinalDamage(),e.getEntity()); - } - if (e.getEntity() instanceof LivingEntity) { - if (e.getFinalDamage() > ((LivingEntity) e.getEntity()).getHealth()) { - archeryClass.giveKillEXP(e.getEntity()); - } - } - } - } - //Sharp Teeth and Keep Away - else if (e.getDamager() instanceof Entity) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("beastMastery")) { - return; - } - Entity wolf = e.getDamager(); - if (wolf.getType() == EntityType.WOLF) { - Tameable dog = (Tameable) wolf; - if (dog.isTamed()) { - if (!(dog.getOwner() instanceof Player)) { //Player is offline or something like that. - return; - } - Player p = (Player) dog.getOwner(); - BeastMastery beastMastery = new BeastMastery(p); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - - double crit = 1.0; - int critLevel = (int) pStat.get("beastMastery").get(5); - double critChance = critLevel * 0.00025; - if (critChance > rand.nextDouble()) { - crit = 1.5; - } - - int sharpTeethLevel = (int) pStat.get("beastMastery").get(8); - double damageMultiplier = sharpTeethLevel * 0.1 + 1; - e.setDamage(e.getDamage() * crit * damageMultiplier); - - Entity enemy = e.getEntity(); - int keepAwayLevel = (int) pStat.get("beastMastery").get(10); - double knockBackChance = keepAwayLevel * 0.05; - if (knockBackChance > rand.nextDouble()) { - Vector knockback = enemy.getVelocity(); - double multiplier; - if (knockback.length() > 0.1) { - double newKnockback = Math.min(knockback.length() * 5, 100.0); - multiplier = newKnockback / knockback.length(); - } - else { - multiplier = 5.0; - } - new BukkitRunnable() { - @Override - public void run() { - enemy.setVelocity(knockback.multiply(multiplier).setY(0.4)); - } - }.runTaskLater(plugin, 1); - } - LivingEntity livingEnemy = (LivingEntity) enemy; - if (e.getFinalDamage() > livingEnemy.getHealth()) { - double heartsHealed = (int) pStat.get("beastMastery").get(9); - LivingEntity livingDog = (LivingEntity) dog; - double maxHealth = ((Attributable) dog).getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue(); - livingDog.setHealth(Math.min(livingDog.getHealth() + heartsHealed, maxHealth)); - beastMastery.dogKillEntity(enemy); - } - beastMastery.giveHitEXP(e.getFinalDamage(),enemy); - - } - } - } - //Wolf take damage EXP - else if (e.getEntity() instanceof Entity) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("beastMastery")) { - return; - } - if (!(e.getDamager() instanceof Player)) { - Entity wolf = e.getEntity(); - if (wolf.getType() == EntityType.WOLF) { - Tameable dog = (Tameable) wolf; - if (dog.isTamed()) { - if (!(dog.getOwner() instanceof Player)) { //Player is offline or something like that. - return; - } - Player p = (Player) dog.getOwner(); - ChangeStats increaseStats = new ChangeStats(p); - increaseStats.changeEXP("beastMastery", (int) Math.round(e.getFinalDamage() * 3) * 10); - } - } - } - } - - //Getting hit (defense) - if (e.getEntity() instanceof Player) { - Player p = (Player) e.getEntity(); - if (e.getDamage() != 0 && !e.getCause().equals(EntityDamageEvent.DamageCause.HOT_FLOOR) && - !e.getCause().equals(EntityDamageEvent.DamageCause.STARVATION) && - !e.getCause().equals(EntityDamageEvent.DamageCause.VOID) && - !e.getCause().equals(EntityDamageEvent.DamageCause.SUFFOCATION) && - !e.getCause().equals(EntityDamageEvent.DamageCause.CUSTOM) && - !e.getCause().equals(EntityDamageEvent.DamageCause.CONTACT) - ) { - Agility agilityClass = new Agility(p); - boolean dodge = agilityClass.dodge(e.getFinalDamage()); - if (dodge) { - e.setCancelled(true); - } - - Defense defenseClass = new Defense(p); - double multiplier = defenseClass.hardBody(); - e.setDamage(e.getDamage() * multiplier); - defenseClass.reactions(e.getFinalDamage()); - defenseClass.giveHitEXP(e.getDamage(),e.getDamager()); - } - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/combatEvents/LingeringPotionSplash.java b/src/main/java/mc/carlton/freerpg/combatEvents/LingeringPotionSplash.java deleted file mode 100644 index 136892b..0000000 --- a/src/main/java/mc/carlton/freerpg/combatEvents/LingeringPotionSplash.java +++ /dev/null @@ -1,48 +0,0 @@ -package mc.carlton.freerpg.combatEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.entity.Player; -import org.bukkit.entity.ThrownPotion; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.LingeringPotionSplashEvent; -import org.bukkit.plugin.Plugin; -import org.bukkit.potion.PotionEffect; - -import java.util.ArrayList; -import java.util.Map; - -public class LingeringPotionSplash implements Listener { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - @EventHandler(priority = EventPriority.HIGHEST) - void onPotionSplash(LingeringPotionSplashEvent e) { - if (e.isCancelled()) { - return; - } - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("alchemy")) { - return; - } - - ThrownPotion potionEntity = e.getEntity(); - if (!(potionEntity.getShooter() instanceof Player)) { - return; - } - Player p = (Player) potionEntity.getShooter(); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - int potionMasterLevel = (int) pStat.get("alchemy").get(13); - if ((int)pStat.get("global").get(15) != 1) { - potionMasterLevel = 0; - } - int potionDurationLevel = (int) pStat.get("alchemy").get(4); - double durationMultiplier = potionDurationLevel * 0.001 + 1; - for (PotionEffect effect : potionEntity.getEffects()) { - e.getAreaEffectCloud().addCustomEffect(new PotionEffect(effect.getType(), (int) Math.round(effect.getDuration() * durationMultiplier), effect.getAmplifier() + potionMasterLevel), true); - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/combatEvents/PlayerDeath.java b/src/main/java/mc/carlton/freerpg/combatEvents/PlayerDeath.java deleted file mode 100644 index b8a8cfe..0000000 --- a/src/main/java/mc/carlton/freerpg/combatEvents/PlayerDeath.java +++ /dev/null @@ -1,90 +0,0 @@ -package mc.carlton.freerpg.combatEvents; - -import mc.carlton.freerpg.perksAndAbilities.*; -import mc.carlton.freerpg.playerInfo.AbilityLogoutTracker; -import mc.carlton.freerpg.playerInfo.AbilityTracker; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.PlayerDeathEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.persistence.PersistentDataType; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -public class PlayerDeath implements Listener { - - @EventHandler(priority = EventPriority.HIGHEST) - void onPlayerDie(PlayerDeathEvent e){ - Player p = e.getEntity(); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - ConfigLoad configLoad = new ConfigLoad(); - if (configLoad.getAllowedSkillsMap().get("alchemy")) { - int immortalExperienceLevel = (int) pStat.get("enchanting").get(13); - int expBuffLevel = (int) pStat.get("enchanting").get(4); - double multiplier = 1 + expBuffLevel*0.002; - e.setDroppedExp( (int) Math.round(e.getDroppedExp()/multiplier) ); - if (immortalExperienceLevel > 0) { - e.setKeepLevel(true); - e.setDroppedExp(0); - } - } - List drops = e.getDrops(); - AbilityTracker abilities = new AbilityTracker(p); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[0] != -1) { - AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); - NamespacedKey key = logoutTracker.getPlayerKeys().get("digging"); - int taskID_digging = logoutTracker.getPlayerTasks().get("digging"); - for (ItemStack drop : drops) { - if (drop.getItemMeta().getPersistentDataContainer().has(key, PersistentDataType.STRING)) { - ItemStack abilityItem = drop; - Digging diggingClass = new Digging(p); - diggingClass.preventLogoutTheft(taskID_digging, abilityItem,key,false); - break; - } - } - } - if (pAbilities[2] != -1) { - AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); - NamespacedKey key = logoutTracker.getPlayerKeys().get("mining"); - int taskID_mining = logoutTracker.getPlayerTasks().get("mining"); - for (ItemStack drop: drops) { - if (drop.getItemMeta().getPersistentDataContainer().has(key, PersistentDataType.STRING)) { - ItemStack abilityItem = drop; - Mining miningClass = new Mining(p); - miningClass.preventLogoutTheft(taskID_mining, abilityItem,key,false); - break; - } - } - } - if (pAbilities[7] != -1) { - AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); - NamespacedKey key = logoutTracker.getPlayerKeys().get("swordsmanship"); - int taskID_swordsmanship = logoutTracker.getPlayerTasks().get("swordsmanship"); - for (ItemStack drop: drops) { - if (drop.getItemMeta().getPersistentDataContainer().has(key, PersistentDataType.STRING)) { - ItemStack abilityItem = drop; - Swordsmanship swordsmanshipClass = new Swordsmanship(p); - swordsmanshipClass.preventLogoutTheft(taskID_swordsmanship, abilityItem,key,false); - break; - } - } - } - - if (!e.getKeepInventory()) { //Player does not keep inventory - if (!configLoad.isKeepinventory()) { //Server is not using some advanced keep inventory plugin - Global globalClass = new Global(p); - globalClass.betterResurrectionDeath(drops); - } - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/combatEvents/PlayerKillEntity.java b/src/main/java/mc/carlton/freerpg/combatEvents/PlayerKillEntity.java deleted file mode 100644 index 7e22257..0000000 --- a/src/main/java/mc/carlton/freerpg/combatEvents/PlayerKillEntity.java +++ /dev/null @@ -1,75 +0,0 @@ -package mc.carlton.freerpg.combatEvents; - -import mc.carlton.freerpg.gameTools.EntityPickedUpItemStorage; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.perksAndAbilities.*; -import org.bukkit.GameMode; -import org.bukkit.World; -import org.bukkit.entity.Entity; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityDeathEvent; -import org.bukkit.inventory.ItemStack; - -import java.util.List; - -public class PlayerKillEntity implements Listener { - @EventHandler - void onEntityDie(EntityDeathEvent e){ - LivingEntity entity = e.getEntity(); - Player p = e.getEntity().getKiller(); - - if (p != null) { - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - World world = p.getWorld(); - List drops = e.getDrops(); - - //Farming - Farming farmingClass = new Farming(p); - farmingClass.animalDoubleDrops(entity,world,drops); - farmingClass.killFarmAnimalEXP(entity); - - //Swordsmanship - if (itemGroups.getSwords().contains(p.getInventory().getItemInMainHand().getType())) { - Swordsmanship swordsmanshipClass = new Swordsmanship(p); - swordsmanshipClass.killBuffs(e.getEntity()); - swordsmanshipClass.thirstForBlood(e.getEntity()); - swordsmanshipClass.giveKillEXP(entity); - } - - //Defense - Defense defenseClass = new Defense(p); - defenseClass.doubleDrops(entity,drops,world); - defenseClass.healer(); - defenseClass.giveKillEXP(entity); - - //Axe Mastery - if (itemGroups.getAxes().contains(p.getInventory().getItemInMainHand().getType())) { - AxeMastery axeMasteryClass = new AxeMastery(p); - axeMasteryClass.revitalized(); - axeMasteryClass.warriorBlood(); - axeMasteryClass.giveKillEXP(entity); - } - - //Fishing - Fishing fishingClass = new Fishing(p); - fishingClass.killFishEXP(entity); - - //Global (Souls) - Global globalClass = new Global(p); - globalClass.gainSoul(entity); - - } - - EntityPickedUpItemStorage entityPickedUpItemStorage = new EntityPickedUpItemStorage(); - entityPickedUpItemStorage.removeEntity(entity); - - - - } -} diff --git a/src/main/java/mc/carlton/freerpg/combatEvents/PlayerShootBow.java b/src/main/java/mc/carlton/freerpg/combatEvents/PlayerShootBow.java deleted file mode 100644 index f038bb7..0000000 --- a/src/main/java/mc/carlton/freerpg/combatEvents/PlayerShootBow.java +++ /dev/null @@ -1,38 +0,0 @@ -package mc.carlton.freerpg.combatEvents; - -import mc.carlton.freerpg.gameTools.FireworkShotByPlayerTracker; -import mc.carlton.freerpg.perksAndAbilities.Archery; - -import org.bukkit.entity.*; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityShootBowEvent; -import org.bukkit.inventory.ItemStack; - -public class PlayerShootBow implements Listener { - @EventHandler(priority = EventPriority.HIGHEST) - void onEntityShoot(EntityShootBowEvent e){ - if (e.isCancelled()) { - return; - } - Entity entity = e.getEntity(); - if (entity instanceof Player && (e.getProjectile() instanceof Arrow || e.getProjectile() instanceof SpectralArrow)) { - Player p = (Player) entity; - ItemStack bow = e.getBow(); - Entity projectile = e.getProjectile(); - Archery archeryClass = new Archery(p); - archeryClass.rapidFire(projectile,bow); - archeryClass.sniper(projectile); - archeryClass.retrieval(projectile,bow); - - } - else if (entity instanceof Player && e.getProjectile() instanceof Firework) { - Player p = (Player) entity; - Entity projectile = e.getProjectile(); - FireworkShotByPlayerTracker fireworkTracker = new FireworkShotByPlayerTracker(); - fireworkTracker.addFirework(projectile,p); - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/combatEvents/PlayerTakeDamage.java b/src/main/java/mc/carlton/freerpg/combatEvents/PlayerTakeDamage.java deleted file mode 100644 index 20a94b0..0000000 --- a/src/main/java/mc/carlton/freerpg/combatEvents/PlayerTakeDamage.java +++ /dev/null @@ -1,65 +0,0 @@ -package mc.carlton.freerpg.combatEvents; - - -import mc.carlton.freerpg.perksAndAbilities.Agility; -import mc.carlton.freerpg.perksAndAbilities.Global; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityDamageEvent; - -import java.util.ArrayList; -import java.util.Map; -import java.util.Random; - -public class PlayerTakeDamage implements Listener { - - @EventHandler(priority = EventPriority.HIGHEST) - void onPlayerTakeDamage(EntityDamageEvent e){ - if (e.isCancelled()) { - return; - } - if (e.getEntity() instanceof Player) { - Player p = (Player) e.getEntity(); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - Random rand = new Random(); - if (e.getCause() == EntityDamageEvent.DamageCause.BLOCK_EXPLOSION) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("mining")) { - return; - } - if ( (int)pStat.get("mining").get(12) >0) { - e.setDamage(0); - } - } - if (e.getCause() == EntityDamageEvent.DamageCause.FALL) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("agility")) { - return; - } - Agility agilityClass = new Agility(p); - double damageReduction = agilityClass.roll(e.getFinalDamage()); - e.setDamage(e.getDamage()*damageReduction); - } - - if (e.getFinalDamage() > p.getHealth()) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("global")) { - return; - } - if ((int) pStat.get("global").get(10) > 0) { - if ( 0.1 > rand.nextFloat()) { - e.setDamage(0); - Global globalClass = new Global(p); - globalClass.avatar(); - } - } - } - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/combatEvents/PotionSplash.java b/src/main/java/mc/carlton/freerpg/combatEvents/PotionSplash.java deleted file mode 100644 index 4efdaa4..0000000 --- a/src/main/java/mc/carlton/freerpg/combatEvents/PotionSplash.java +++ /dev/null @@ -1,107 +0,0 @@ -package mc.carlton.freerpg.combatEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.GameMode; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.entity.ThrownPotion; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.PotionSplashEvent; -import org.bukkit.plugin.Plugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.*; - -public class PotionSplash implements Listener { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - @EventHandler(priority = EventPriority.HIGHEST) - void onPotionSplash(PotionSplashEvent e){ - if (e.isCancelled()) { - return; - } - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("alchemy")) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - List harmfulEffects = itemGroups.getHarmfulEffects(); - - ThrownPotion potionEntity = e.getPotion(); - if (!(potionEntity.getShooter() instanceof Player)) { - return; - } - Player p = (Player) potionEntity.getShooter(); - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - int potionMasterLevel = (int) pStat.get("alchemy").get(13); - if ((int)pStat.get("global").get(15) != 1) { - potionMasterLevel = 0; - } - int potionDurationLevel = (int) pStat.get("alchemy").get(4); - double durationMultiplier = potionDurationLevel*0.001 + 1; - for (LivingEntity entity : e.getAffectedEntities()) { - for (PotionEffect effect : e.getPotion().getEffects()) { - if (p.equals(entity)) { - if (harmfulEffects.contains(effect.getType())) { - int finalPotionMasterLevel = potionMasterLevel; - new BukkitRunnable() { - @Override - public void run() { - if (entity.equals(p)) { - if (!effect.getType().equals(PotionEffectType.HARM)) { - entity.addPotionEffect(new PotionEffect(effect.getType(), (int) Math.round(effect.getDuration() * (1.0 / durationMultiplier)), effect.getAmplifier()), true); - } - } - else if (!(entity instanceof Player)){ - if (!effect.getType().equals(PotionEffectType.HARM)) { - entity.addPotionEffect(new PotionEffect(effect.getType(), (int) Math.round(effect.getDuration()*durationMultiplier), effect.getAmplifier()+ finalPotionMasterLevel), true); - } - else { - if (finalPotionMasterLevel > 0) { - entity.addPotionEffect(new PotionEffect(effect.getType(), 1, 0)); //Add 3 HP to whatever the damage was - } - } - } - else { - if (configLoad.isAllowPvP()) { - if (!effect.getType().equals(PotionEffectType.HARM)) { - entity.addPotionEffect(new PotionEffect(effect.getType(), (int) Math.round(effect.getDuration()*durationMultiplier), effect.getAmplifier()+ finalPotionMasterLevel), true); - } - else { - if (finalPotionMasterLevel > 0) { - entity.addPotionEffect(new PotionEffect(effect.getType(), 1, 0)); //Add 3 HP to whatever the damage was - } - } - } - } - } - }.runTaskLater(plugin, 2); - } - else if (effect.getType().equals(PotionEffectType.HEAL)) { - if (potionMasterLevel > 0) { - entity.addPotionEffect(new PotionEffect(effect.getType(), 1, 0)); //Add 2 HP to whatever the healing was - } - } - else { - entity.addPotionEffect(new PotionEffect(effect.getType(), (int) Math.round(effect.getDuration() * durationMultiplier), effect.getAmplifier() + potionMasterLevel),true); - } - } - else { - entity.addPotionEffect(new PotionEffect(effect.getType(), (int) Math.round(effect.getDuration() * durationMultiplier), effect.getAmplifier() + potionMasterLevel),true); - } - } - } - - - } -} diff --git a/src/main/java/mc/carlton/freerpg/commands/CommandHelper.java b/src/main/java/mc/carlton/freerpg/commands/CommandHelper.java index fb84b01..5d8b2b7 100644 --- a/src/main/java/mc/carlton/freerpg/commands/CommandHelper.java +++ b/src/main/java/mc/carlton/freerpg/commands/CommandHelper.java @@ -1,167 +1,184 @@ package mc.carlton.freerpg.commands; -import mc.carlton.freerpg.gameTools.LanguageSelector; +import mc.carlton.freerpg.utils.game.LanguageSelector; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class CommandHelper { - /* - * This class perform simple tests on common "properties" of a command to see if the user's input is valid. - * It also provides feedback to the user via message when the inputs are incorrect, - */ - private CommandSender sender; - private String[] args; - private int minArguments; - private int maxArguments; - private String permissionName; - private boolean isPlayerOnlyCommand = false; - private boolean checkInBed = false; - private String improperArgumentsMessage; - /** - * Constructor for CommandHelper - * @param sender CommandSender instance - * @param args Arguments of command - * @param minArguments The minimum number of allowed arguments - * @param maxArguments The maximum number of allowed arguments (set to 0 for no restriciton) - * @param improperArgumentsMessage The message to be displayed if the user fails a validity test of the command. - * The message string can be formatted such that it can be decoded by - * @see LanguageSelector#translateMessage(String) - * - */ - public CommandHelper(CommandSender sender, String[] args, int minArguments, int maxArguments, String improperArgumentsMessage) { - this.sender = sender; - this.args = args; - this.minArguments = minArguments; - this.maxArguments = maxArguments; - this.improperArgumentsMessage = improperArgumentsMessage; - } + /* + * This class perform simple tests on common "properties" of a command to see if the user's input is valid. + * It also provides feedback to the user via message when the inputs are incorrect, + */ + private CommandSender sender; + private String[] args; + private int minArguments; + private int maxArguments; + private String permissionName; + private boolean isPlayerOnlyCommand = false; + private boolean checkInBed = false; + private String improperArgumentsMessage; - /** - * Constructor for CommandHelper - * @param sender CommandSender instance - * @param args Arguments of command - * @param numberOfArguments The maximum number of allowed arguments (set to 0 for no restriciton) - * @param improperArgumentsMessage The message to be displayed if the user fails a validity test of the command. - * The message string can be formatted such that it can be decoded by - * @see LanguageSelector#translateMessage(String) - * - */ - public CommandHelper(CommandSender sender, String[] args, int numberOfArguments, String improperArgumentsMessage) { - this.sender = sender; - this.args = args; - this.minArguments = numberOfArguments; - this.maxArguments = numberOfArguments; - this.improperArgumentsMessage = improperArgumentsMessage; - } + /** + * Constructor for CommandHelper + * + * @param sender CommandSender instance + * @param args Arguments of command + * @param minArguments The minimum number of allowed arguments + * @param maxArguments The maximum number of allowed arguments (set to 0 for no + * restriciton) + * @param improperArgumentsMessage The message to be displayed if the user fails a validity test + * of the command. The message string can be formatted such that + * it can be decoded by + * @see LanguageSelector#translateMessage(String) + */ + public CommandHelper(CommandSender sender, String[] args, int minArguments, int maxArguments, + String improperArgumentsMessage) { + this.sender = sender; + this.args = args; + this.minArguments = minArguments; + this.maxArguments = maxArguments; + this.improperArgumentsMessage = improperArgumentsMessage; + } - public void setPermissionName(String permissionName) { - this.permissionName = permissionName; - } + /** + * Constructor for CommandHelper + * + * @param sender CommandSender instance + * @param args Arguments of command + * @param numberOfArguments The maximum number of allowed arguments (set to 0 for no + * restriciton) + * @param improperArgumentsMessage The message to be displayed if the user fails a validity test + * of the command. The message string can be formatted such that + * it can be decoded by + * @see LanguageSelector#translateMessage(String) + */ + public CommandHelper(CommandSender sender, String[] args, int numberOfArguments, + String improperArgumentsMessage) { + this.sender = sender; + this.args = args; + this.minArguments = numberOfArguments; + this.maxArguments = numberOfArguments; + this.improperArgumentsMessage = improperArgumentsMessage; + } - public void setPlayerOnlyCommand(boolean isPlayerOnlyCommand) { - this.isPlayerOnlyCommand = isPlayerOnlyCommand; - } + public void setPermissionName(String permissionName) { + this.permissionName = permissionName; + } - public void setCheckInBed(boolean checkInBed) { - this.checkInBed = checkInBed; - } + public void setPlayerOnlyCommand(boolean isPlayerOnlyCommand) { + this.isPlayerOnlyCommand = isPlayerOnlyCommand; + } - /** - * Checks if a command is properly sent - * @return true if the command is "proper", i.e has a proper number of arguments, is cast by an allowed sender, the sender has the proper permissions, - * and the sender is not in a bed (if restricted). - */ - public boolean isProperCommand(){ - if (maxArguments > 0) { //Ignore argument restrictions if argument is less than 0 - if (!hasProperNumberOfArguments()) { - return false; //Improper arguments - } - } - if (isPlayerOnlyCommand) { - if (!isPlayer()) { - return false; //Not a player (player only command) - } - } - if (!hasPermission()) { - return false; //No permission - } - if (checkInBed) { - if (isInBed()) { - return false; //Cannot be in bed - } - } - return true; //Passed all tests - } + public void setCheckInBed(boolean checkInBed) { + this.checkInBed = checkInBed; + } - /** - * Checks if a player has permission to use a command and sends the player a message if they do not have permission - * @return true if player has permission, false otherwise - */ - public boolean hasPermission() { - if (sender instanceof Player) { - Player p = (Player) sender; - if (!p.hasPermission("freeRPG." + permissionName)) { - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(ChatColor.RED + lang.getString("noPermission")); - return false; - } - } - return true; + /** + * Checks if a command is properly sent + * + * @return true if the command is "proper", i.e has a proper number of arguments, is cast by an + * allowed sender, the sender has the proper permissions, and the sender is not in a bed (if + * restricted). + */ + public boolean isProperCommand() { + if (maxArguments > 0) { //Ignore argument restrictions if argument is less than 0 + if (!hasProperNumberOfArguments()) { + return false; //Improper arguments + } } + if (isPlayerOnlyCommand) { + if (!isPlayer()) { + return false; //Not a player (player only command) + } + } + if (!hasPermission()) { + return false; //No permission + } + if (checkInBed) { + if (isInBed()) { + return false; //Cannot be in bed + } + } + return true; //Passed all tests + } - /** - * Checks if a player is in bed and sends the player a message if they are - * @return true if player is in a bed - */ - public boolean isInBed() { - if (sender instanceof Player) { - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - if (p.isSleeping()) { - p.sendMessage(ChatColor.RED + lang.getString("bedGUI")); - return true; - } - } + /** + * Checks if a player has permission to use a command and sends the player a message if they do + * not have permission + * + * @return true if player has permission, false otherwise + */ + public boolean hasPermission() { + if (sender instanceof Player) { + Player p = (Player) sender; + if (!p.hasPermission("freeRPG." + permissionName)) { + LanguageSelector lang = new LanguageSelector(p); + p.sendMessage(ChatColor.RED + lang.getString("noPermission")); return false; + } } + return true; + } - /** - * Checks if the CommandSender is a player and sends them a message if not - * @return true if commandSender is a player - */ - public boolean isPlayer() { - if (sender instanceof Player) { - return true; - } - sender.sendMessage("You must be a player to cast this command!"); - return false; + /** + * Checks if a player is in bed and sends the player a message if they are + * + * @return true if player is in a bed + */ + public boolean isInBed() { + if (sender instanceof Player) { + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + if (p.isSleeping()) { + p.sendMessage(ChatColor.RED + lang.getString("bedGUI")); + return true; + } + } + return false; + } + + /** + * Checks if the CommandSender is a player and sends them a message if not + * + * @return true if commandSender is a player + */ + public boolean isPlayer() { + if (sender instanceof Player) { + return true; } + sender.sendMessage("You must be a player to cast this command!"); + return false; + } - /** - * Checks if the command has the proper number of arguments and sends a message to the sender if not - * @return true if the command has a proper number of arguments - */ - public boolean hasProperNumberOfArguments() { - if (minArguments <= args.length && args.length <= maxArguments) { - return true; - } else { - sendImproperArgumentsMessage(); - return false; - } + /** + * Checks if the command has the proper number of arguments and sends a message to the sender if + * not + * + * @return true if the command has a proper number of arguments + */ + public boolean hasProperNumberOfArguments() { + if (minArguments <= args.length && args.length <= maxArguments) { + return true; + } else { + sendImproperArgumentsMessage(); + return false; } + } - /** - * Sends an "Improper Arguments" message to the player. - */ - public void sendImproperArgumentsMessage() { - if (sender instanceof Player) { - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(ChatColor.RED +lang.getString("improperArguments")+lang.translateMessage(improperArgumentsMessage)); - } else { - sender.sendMessage("Improper Arugments, try " + LanguageSelector.getEnglishMessage(improperArgumentsMessage)); - } + /** + * Sends an "Improper Arguments" message to the player. + */ + public void sendImproperArgumentsMessage() { + if (sender instanceof Player) { + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + p.sendMessage(ChatColor.RED + lang.getString("improperArguments") + lang.translateMessage( + improperArgumentsMessage)); + } else { + sender.sendMessage("Improper Arguments, try " + LanguageSelector.getEnglishMessage( + improperArgumentsMessage)); } + } } diff --git a/src/main/java/mc/carlton/freerpg/commands/FrpgCommands.java b/src/main/java/mc/carlton/freerpg/commands/FrpgCommands.java index 3de277f..8a54655 100644 --- a/src/main/java/mc/carlton/freerpg/commands/FrpgCommands.java +++ b/src/main/java/mc/carlton/freerpg/commands/FrpgCommands.java @@ -1,21 +1,36 @@ package mc.carlton.freerpg.commands; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.UUID; import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.AbilityTimers; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.player.Leaderboards; +import mc.carlton.freerpg.core.info.player.OfflinePlayerStatLoadIn; +import mc.carlton.freerpg.core.info.player.PlayerLeaderboardStat; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.core.info.player.PlayerStatsLoadIn; +import mc.carlton.freerpg.core.serverFileManagement.PeriodicSaving; +import mc.carlton.freerpg.core.serverFileManagement.PlayerStatsFilePreparation; import mc.carlton.freerpg.customContainers.collections.OldCustomRecipe; -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.gameTools.PsuedoEnchanting; -import mc.carlton.freerpg.globalVariables.CraftingRecipes; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.globalVariables.StringsAndOtherData; -import mc.carlton.freerpg.guiTools.GuiDisplayStatistic; -import mc.carlton.freerpg.guiTools.GuiItem; -import mc.carlton.freerpg.guiTools.GuiWrapper; -import mc.carlton.freerpg.perksAndAbilities.Agility; -import mc.carlton.freerpg.playerInfo.*; -import mc.carlton.freerpg.serverFileManagement.PeriodicSaving; -import mc.carlton.freerpg.serverFileManagement.PlayerStatsFilePreparation; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.utilities.UtilityMethods; +import mc.carlton.freerpg.skills.perksAndAbilities.Agility; +import mc.carlton.freerpg.utils.UtilityMethods; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import mc.carlton.freerpg.utils.game.PsuedoEnchanting; +import mc.carlton.freerpg.utils.globalVariables.CraftingRecipes; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import mc.carlton.freerpg.utils.globalVariables.StringsAndOtherData; +import mc.carlton.freerpg.utils.gui.GuiDisplayStatistic; +import mc.carlton.freerpg.utils.gui.GuiItem; +import mc.carlton.freerpg.utils.gui.GuiWrapper; +import org.apache.logging.log4j.Level; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -30,3335 +45,3493 @@ import org.bukkit.plugin.Plugin; import org.bukkit.scheduler.BukkitRunnable; -import java.io.File; -import java.io.IOException; -import java.util.*; - public class FrpgCommands implements CommandExecutor { - private boolean isTargetOnline(Player target, CommandSender sender) { - if (target == null) { - if (sender instanceof Player) { - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(ChatColor.RED + lang.getString("playerOffline")); - } - else { - sender.sendMessage("Player not online"); - } - return false; - } + private boolean isTargetOnline(Player target, CommandSender sender) { + if (target == null) { + if (sender instanceof Player) { + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + p.sendMessage(ChatColor.RED + lang.getString("playerOffline")); + } else { + sender.sendMessage("Player not online"); + } + return false; + } + return true; + } + + private int getArgumentAsInteger(String arg) { + int integerValueOfArg = 0; + try { + integerValueOfArg = Integer.valueOf(arg); + return integerValueOfArg; + } catch (NumberFormatException e) { + return Integer.MAX_VALUE; //This is a cheap trick; when we return max value, that's our way of saying "could not convert" without throwing error + } + } + + private double getArgumentAsDouble(String arg) { + double doubleValueOfArg = 0; + try { + doubleValueOfArg = Double.valueOf(arg); + return doubleValueOfArg; + } catch (NumberFormatException e) { + return Double.MAX_VALUE; //This is a cheap trick; when we return max value, that's our way of saying "could not convert" without throwing error + } + } + + private boolean togglePerk(String id, CommandSender sender, String[] args) { + String permission; + String langID; + String skillName; + int skillIndex; + int globalIndex; + switch (id) { + case "flintToggle": + permission = "toggleFlint"; + langID = "diggingPerkTitle4"; + skillName = "digging"; + skillIndex = 11; + globalIndex = 12; + break; + case "flamePickToggle": + permission = "toggleFlamePick"; + langID = "smeltingPerkTitle2"; + skillName = "smelting"; + skillIndex = 13; + globalIndex = 13; + break; + case "speedToggle": + permission = "toggleSpeed"; + langID = "agilityPerkTitle2"; + skillName = "agility"; + skillIndex = 13; + globalIndex = 14; + break; + case "potionToggle": + permission = "togglePotion"; + langID = "alchemyPerkTitle2"; + skillName = "alchemy"; + skillIndex = 13; + globalIndex = 15; + break; + case "grappleToggle": + permission = "toggleGrapple"; + langID = "fishingPerkTitle4"; + skillName = "fishing"; + skillIndex = 11; + globalIndex = 16; + break; + case "hotRodToggle": + permission = "toggleHotRod"; + langID = "fishingPerkTitle5"; + skillName = "fishing"; + skillIndex = 12; + globalIndex = 17; + break; + case "veinMinerToggle": + permission = "toggleVeinMiner"; + langID = "miningPerkTitle4"; + skillName = "mining"; + skillIndex = 11; + globalIndex = 18; + break; + case "megaDigToggle": + permission = "toggleMegaDig"; + langID = "diggingPerkTitle6"; + skillName = "digging"; + skillIndex = 13; + globalIndex = 19; + break; + case "leafBlowerToggle": + permission = "toggleLeafBlower"; + langID = "woodcuttingPerkTitle5"; + skillName = "woodcutting"; + skillIndex = 12; + globalIndex = 26; + break; + case "holyAxeToggle": + permission = "toggleHolyAxe"; + langID = "axeMasteryPerkTitle1"; + skillName = "axeMastery"; + skillIndex = 8; + globalIndex = 27; + break; + default: return true; } - private int getArgumentAsInteger(String arg) { - int integerValueOfArg = 0; - try { - integerValueOfArg = Integer.valueOf(arg); - return integerValueOfArg; - } - catch (NumberFormatException e) { - return Integer.MAX_VALUE; //This is a cheap trick; when we return max value, that's our way of saying "could not convert" without throwing error - } + + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg " + id; + CommandHelper commandHelper = new CommandHelper(sender, args, 1, 2, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPlayerOnlyCommand(true); + commandHelper.setPermissionName(permission); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player p = (Player) sender; + + LanguageSelector lang = new LanguageSelector(p); + PlayerStats pStatClass = new PlayerStats(p); + Agility agility = new Agility(p); + Map>> statAll = pStatClass.getData(); + Map> pStat = pStatClass.getPlayerData(); + int level = (int) pStat.get(skillName).get(skillIndex); + + if (level <= 0) { + p.sendMessage( + ChatColor.RED + lang.getString("unlockToggle") + " " + ChatColor.BOLD + lang.getString( + langID)); + return true; + } + if (args.length == 1) { + int toggle = (int) pStat.get("global").get(globalIndex); + if (toggle > 0) { + p.sendMessage(ChatColor.RED + lang.getString(langID) + ": " + lang.getString("off0")); + pStat.get("global").set(globalIndex, 0); + if (id.equalsIgnoreCase("speedToggle")) { + agility.gracefulFeetEnd(); + } + } else { + p.sendMessage(ChatColor.GREEN + lang.getString(langID) + ": " + lang.getString("on0")); + pStat.get("global").set(globalIndex, 1); + if (id.equalsIgnoreCase("speedToggle")) { + agility.gracefulFeetStart(); + } + } + statAll.put(p.getUniqueId(), pStat); + pStatClass.setData(statAll); + } else if (args.length == 2) { + if (args[1].equalsIgnoreCase("off")) { + p.sendMessage(ChatColor.RED + lang.getString(langID) + ": " + lang.getString("off0")); + pStat.get("global").set(globalIndex, 0); + statAll.put(p.getUniqueId(), pStat); + pStatClass.setData(statAll); + if (id.equalsIgnoreCase("speedToggle")) { + agility.gracefulFeetEnd(); + } + } else if (args[1].equalsIgnoreCase("on")) { + p.sendMessage(ChatColor.GREEN + lang.getString(langID) + ": " + lang.getString("on0")); + pStat.get("global").set(globalIndex, 1); + statAll.put(p.getUniqueId(), pStat); + pStatClass.setData(statAll); + if (id.equalsIgnoreCase("speedToggle")) { + agility.gracefulFeetStart(); + } + } else { + commandHelper.sendImproperArgumentsMessage(); + } + } + return true; + } + + private void togglePerkSetGuiItem(String id, Player p, GuiWrapper gui) { + String langID; + int globalIndex; + int guiIndex = 28; + boolean enchanted = false; + Material icon; + switch (id) { + case "flintToggle": + langID = "diggingPerkTitle4"; + globalIndex = 12; + icon = Material.FLINT; + break; + case "flamePickToggle": + langID = "smeltingPerkTitle2"; + globalIndex = 13; + icon = Material.BLAZE_POWDER; + break; + case "speedToggle": + langID = "agilityPerkTitle2"; + globalIndex = 14; + icon = Material.LEATHER_BOOTS; + break; + case "potionToggle": + langID = "alchemyPerkTitle2"; + globalIndex = 15; + icon = Material.POTION; + break; + case "grappleToggle": + langID = "fishingPerkTitle4"; + globalIndex = 16; + icon = Material.LEAD; + break; + case "hotRodToggle": + langID = "fishingPerkTitle5"; + globalIndex = 17; + guiIndex = 29; + icon = Material.FISHING_ROD; + break; + case "veinMinerToggle": + langID = "miningPerkTitle4"; + globalIndex = 18; + icon = Material.DIAMOND_PICKAXE; + break; + case "megaDigToggle": + langID = "diggingPerkTitle6"; + globalIndex = 19; + guiIndex = 29; + icon = Material.DIAMOND_SHOVEL; + break; + case "leafBlowerToggle": + langID = "woodcuttingPerkTitle5"; + globalIndex = 26; + icon = Material.OAK_LEAVES; + break; + case "holyAxeToggle": + langID = "axeMasteryPerkTitle1"; + globalIndex = 27; + icon = Material.DIAMOND_AXE; + enchanted = true; + break; + default: + return; } - private double getArgumentAsDouble(String arg) { - double doubleValueOfArg = 0; - try { - doubleValueOfArg = Double.valueOf(arg); - return doubleValueOfArg; - } - catch (NumberFormatException e) { - return Double.MAX_VALUE; //This is a cheap trick; when we return max value, that's our way of saying "could not convert" without throwing error - } - } - private boolean togglePerk(String id,CommandSender sender,String[] args) { - String permission; - String langID; - String skillName; - int skillIndex; - int globalIndex; - switch (id) { - case "flintToggle": - permission = "toggleFlint"; - langID = "diggingPerkTitle4"; - skillName = "digging"; - skillIndex = 11; - globalIndex = 12; - break; - case "flamePickToggle": - permission = "toggleFlamePick"; - langID = "smeltingPerkTitle2"; - skillName = "smelting"; - skillIndex = 13; - globalIndex = 13; - break; - case "speedToggle": - permission = "toggleSpeed"; - langID = "agilityPerkTitle2"; - skillName = "agility"; - skillIndex = 13; - globalIndex = 14; - break; - case "potionToggle": - permission = "togglePotion"; - langID = "alchemyPerkTitle2"; - skillName = "alchemy"; - skillIndex = 13; - globalIndex = 15; - break; - case "grappleToggle": - permission = "toggleGrapple"; - langID = "fishingPerkTitle4"; - skillName = "fishing"; - skillIndex = 11; - globalIndex = 16; - break; - case "hotRodToggle": - permission = "toggleHotRod"; - langID = "fishingPerkTitle5"; - skillName = "fishing"; - skillIndex = 12; - globalIndex = 17; - break; - case "veinMinerToggle": - permission = "toggleVeinMiner"; - langID = "miningPerkTitle4"; - skillName = "mining"; - skillIndex = 11; - globalIndex = 18; - break; - case "megaDigToggle": - permission = "toggleMegaDig"; - langID = "diggingPerkTitle6"; - skillName = "digging"; - skillIndex = 13; - globalIndex = 19; - break; - case "leafBlowerToggle": - permission = "toggleLeafBlower"; - langID = "woodcuttingPerkTitle5"; - skillName = "woodcutting"; - skillIndex = 12; - globalIndex = 26; - break; - case "holyAxeToggle": - permission = "toggleHolyAxe"; - langID = "axeMasteryPerkTitle1"; - skillName = "axeMastery"; - skillIndex = 8; - globalIndex = 27; - break; - default: - return true; - } - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg " +id; - CommandHelper commandHelper = new CommandHelper(sender,args,1,2,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPlayerOnlyCommand(true); - commandHelper.setPermissionName(permission); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player p = (Player) sender; + String parsableName = "::" + langID + "::" + " " + "::toggle::"; + addToggleButton(p, gui, parsableName, icon, guiIndex, globalIndex); + if (enchanted) { + gui.getItem(guiIndex).addEnchantmentGlow(); + } + } + + private String getExpToNextString(Player p, String skillName) { + ChangeStats getEXP = new ChangeStats(p); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + + int maxLevel = getEXP.getMaxLevel(skillName); + int EXP = pStat.get(skillName).get(1).intValue(); + int level = pStat.get(skillName).get(0).intValue(); + + String EXPtoNextString; + if (level < maxLevel) { + int nextEXP = getEXP.getEXPfromLevel(level + 1); + int EXPtoNext = nextEXP - EXP; + EXPtoNextString = String.valueOf(EXPtoNext); + } else { + EXPtoNextString = "N/A"; + } + return EXPtoNextString; + } + + private int getTotalSkillTokens(Player p) { + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + int totalSkillTokens = 0; + for (String j : pStat.keySet()) { + if (!j.equalsIgnoreCase("global")) { + totalSkillTokens += pStat.get(j).get(3).intValue(); + } + } + return totalSkillTokens; + } + + private int getTotalPassiveTokens(Player p) { + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + int totalPassiveTokens = 0; + for (String j : pStat.keySet()) { + if (!j.equalsIgnoreCase("global")) { + totalPassiveTokens += pStat.get(j).get(2).intValue(); + } + } + return totalPassiveTokens; + } + + private void generateMainMenu(Player p) { + //Player Information and Leaderboard + LanguageSelector lang = new LanguageSelector(p); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + Leaderboards leaderboards = new Leaderboards(); + PlayerStats timeStats = new PlayerStats(p); + + //Gui Set-up + GuiWrapper gui = new GuiWrapper(p, Bukkit.createInventory(p, 45, "Skills")); + String nameColor = ChatColor.AQUA.toString() + ChatColor.BOLD.toString(); + String descriptionColor = ChatColor.GRAY.toString() + ChatColor.ITALIC.toString(); + String statisticNameColor = ChatColor.GRAY.toString(); + String statisticColor = ChatColor.BLUE.toString(); + + //Menu Options (Items) + GuiItem global = new GuiItem(Material.NETHER_STAR, 4, gui); + GuiItem digging = new GuiItem(Material.IRON_SHOVEL, 11, gui); + GuiItem woodcutting = new GuiItem(Material.IRON_AXE, 12, gui); + GuiItem mining = new GuiItem(Material.IRON_PICKAXE, 13, gui); + GuiItem farming = new GuiItem(Material.IRON_HOE, 14, gui); + GuiItem fishing = new GuiItem(Material.FISHING_ROD, 15, gui); + GuiItem archery = new GuiItem(Material.BOW, 20, gui); + GuiItem beastMastery = new GuiItem(Material.BONE, 21, gui); + GuiItem swords = new GuiItem(Material.IRON_SWORD, 22, gui); + GuiItem armor = new GuiItem(Material.IRON_CHESTPLATE, 23, gui); + GuiItem axes = new GuiItem(Material.GOLDEN_AXE, 24, gui); + GuiItem repair = new GuiItem(Material.ANVIL, 29, gui); + GuiItem agility = new GuiItem(Material.LEATHER_LEGGINGS, 30, gui); + GuiItem alchemy = new GuiItem(Material.POTION, 31, gui); + GuiItem smelting = new GuiItem(Material.COAL, 32, gui); + GuiItem enchanting = new GuiItem(Material.ENCHANTING_TABLE, 33, gui); + GuiItem info = new GuiItem(Material.MAP, 36, gui); + GuiItem configuration = new GuiItem(Material.REDSTONE, 44, gui); + + GuiItem[] guiItems = {global, digging, woodcutting, mining, farming, fishing, archery, + beastMastery, swords, armor, axes, repair, agility, alchemy, smelting, enchanting, info, + configuration}; + String[] labels = {lang.getString("global"), lang.getString("digging"), + lang.getString("woodcutting"), lang.getString("mining"), lang.getString("farming"), + lang.getString("fishing"), lang.getString("archery"), lang.getString("beastMastery"), + lang.getString("swordsmanship"), lang.getString("defense"), lang.getString("axeMastery"), + lang.getString("repair"), lang.getString("agility"), lang.getString("alchemy"), + lang.getString("smelting"), lang.getString("enchanting"), lang.getString("information"), + lang.getString("configuration")}; + String[] labels0 = {"global", "digging", "woodcutting", "mining", "farming", "fishing", + "archery", "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", + "alchemy", "smelting", "enchanting", "information", "configuration"}; + + for (int i = 0; i < guiItems.length; i++) { + GuiItem item = guiItems[i]; + String translatedLabel = labels[i]; + String label = labels0[i]; + item.setName(translatedLabel); + item.setNameColor(nameColor); + if (i == 0) { //Global + int globalTokens = (int) pStat.get(labels0[i]).get(1); + int totalLevel = pStat.get("global").get(0).intValue(); + int totalExperience = (int) pStat.get("global").get(29); + int totalPlayers = leaderboards.getLeaderboardSize("global"); + int rank = leaderboards.getLeaderboardPosition(p, "global"); + + item.addStatistic(lang.getString("total") + " " + lang.getString("level"), + String.valueOf(totalLevel)); + item.addStatistic(lang.getString("total") + " " + lang.getString("exp"), + String.valueOf(totalExperience)); + item.addSpecialLoreLine(statisticNameColor + lang.getString("rank") + ": " + ChatColor.WHITE + + ChatColor.BOLD.toString() + "" + String.format("%,d", rank) + ChatColor.RESET + + descriptionColor + " " + lang.getString("outOf") + " " + ChatColor.RESET + + ChatColor.WHITE.toString() + totalPlayers); + if (globalTokens > 0) { + item.addEnchantmentGlow(); + } + + } else if (i < 16) { //Skills + String skillName = labels0[i]; + int passiveTokens = (int) pStat.get(labels0[i]).get(2); + int skillTokens = (int) pStat.get(labels0[i]).get(3); + int level = pStat.get(labels0[i]).get(0).intValue(); + int EXP = pStat.get(labels0[i]).get(1).intValue(); + int totalPlayers = leaderboards.getLeaderboardSize(labels0[i]); + int rank = leaderboards.getLeaderboardPosition(p, labels0[i]); + String EXPtoNextString = getExpToNextString(p, skillName); + + GuiDisplayStatistic levelStat = new GuiDisplayStatistic(lang.getString("level"), level, + ChatColor.GRAY.toString(), ChatColor.BLUE.toString()); + GuiDisplayStatistic expStat = new GuiDisplayStatistic(lang.getString("experience"), EXP, + ChatColor.GRAY.toString(), ChatColor.BLUE.toString()); + GuiDisplayStatistic expToLevelStat = new GuiDisplayStatistic(lang.getString("expToLevel"), + EXPtoNextString, ChatColor.GRAY.toString(), ChatColor.GREEN.toString()); + + item.addStatistic(levelStat); + item.addStatistic(expStat); + item.addStatistic(expToLevelStat); + item.addSpecialLoreLine(statisticNameColor + lang.getString("rank") + ": " + ChatColor.WHITE + + ChatColor.BOLD.toString() + "" + String.format("%,d", rank) + ChatColor.RESET + + descriptionColor + " " + lang.getString("outOf") + " " + ChatColor.RESET + + ChatColor.WHITE.toString() + totalPlayers); + if (passiveTokens > 0 || skillTokens > 0) { + item.addEnchantmentGlow(); + } + + } else if (i == 16) { //Information + int totalSkillTokens = getTotalSkillTokens(p); + int totalPassiveTokens = getTotalPassiveTokens(p); + int globalTokens = pStat.get("global").get(1).intValue(); + String playTimeString = timeStats.getPlayerPlayTimeString(); + double personalMultiplier = (double) pStat.get("global").get(23); + int souls = (int) pStat.get("global").get(20); + + item.addStatistic(lang.getString("totalPlayTime"), playTimeString); + item.addStatistic(lang.getString("personalMultiplier"), + String.valueOf(personalMultiplier) + "x"); + item.addStatistic(lang.getString("globalPassiveTitle0"), globalTokens); + item.addStatistic(lang.getString("diggingPassiveTitle2"), totalSkillTokens); + item.addStatistic(lang.getString("diggingPassiveTitle0"), totalPassiveTokens); + item.addStatistic(UtilityMethods.capitalizeString(lang.getString("souls")), souls); + } else if (i == 17) {//Configuration + item.setDescription(lang.getString("clickForOptions")); + } + gui.addItem(item); + } - LanguageSelector lang = new LanguageSelector(p); - PlayerStats pStatClass = new PlayerStats(p); - Agility agility = new Agility(p); - Map>> statAll = pStatClass.getData(); - Map> pStat = pStatClass.getPlayerData(); - int level = (int)pStat.get(skillName).get(skillIndex); - - if (level <= 0) { - p.sendMessage(ChatColor.RED + lang.getString("unlockToggle") + " " +ChatColor.BOLD + lang.getString(langID)); - return true; - } - if (args.length == 1) { - int toggle = (int) pStat.get("global").get(globalIndex); - if (toggle > 0) { - p.sendMessage(ChatColor.RED + lang.getString(langID) + ": " + lang.getString("off0")); - pStat.get("global").set(globalIndex,0); - if (id.equalsIgnoreCase("speedToggle")) { - agility.gracefulFeetEnd(); - } - } - else { - p.sendMessage(ChatColor.GREEN + lang.getString(langID) + ": " + lang.getString("on0")); - pStat.get("global").set(globalIndex,1); - if (id.equalsIgnoreCase("speedToggle")) { - agility.gracefulFeetStart(); - } - } - statAll.put(p.getUniqueId(), pStat); - pStatClass.setData(statAll); - } else if (args.length == 2) { - if (args[1].equalsIgnoreCase("off")) { - p.sendMessage(ChatColor.RED + lang.getString(langID) + ": " + lang.getString("off0")); - pStat.get("global").set(globalIndex,0); - statAll.put(p.getUniqueId(), pStat); - pStatClass.setData(statAll); - if (id.equalsIgnoreCase("speedToggle")) { - agility.gracefulFeetEnd(); - } - } - else if (args[1].equalsIgnoreCase("on")) { - p.sendMessage(ChatColor.GREEN + lang.getString(langID) + ": " + lang.getString("on0")); - pStat.get("global").set(globalIndex,1); - statAll.put(p.getUniqueId(), pStat); - pStatClass.setData(statAll); - if (id.equalsIgnoreCase("speedToggle")) { - agility.gracefulFeetStart(); - } - } - else { - commandHelper.sendImproperArgumentsMessage(); - } - } - return true; + //Put the items in the inventory + gui.displayGuiForPlayer(); + } + + private void messagePlayerHelpScreen(CommandSender sender, int page) { + if (sender instanceof Player) { + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + final int TOTAL_PAGES = 4; + if (page > TOTAL_PAGES || page < 1) { + page = 1; //Page input out of bounds + } + p.sendMessage( + ChatColor.RED + "------| " + ChatColor.GREEN + ChatColor.BOLD.toString() + " Help" + + ChatColor.RESET + ChatColor.GREEN.toString() + " " + lang.getString("page") + " [" + + Integer.toString(page) + "/" + Integer.toString(TOTAL_PAGES) + "]" + + ChatColor.RED.toString() + " |-----"); + switch (page) { + case 1: + p.sendMessage( + ChatColor.GOLD + "/frpg" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc0")); + p.sendMessage(ChatColor.GOLD + "/frpg skillTreeGUI [" + lang.getString("skillName") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc1")); + p.sendMessage(ChatColor.GOLD + "/frpg configurationGUI" + ChatColor.RESET + + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc2")); + p.sendMessage(ChatColor.GOLD + "/frpg giveEXP [" + lang.getString("playerName") + "] [" + + lang.getString("skillName") + "] [amount]" + ChatColor.RESET + + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc3")); + p.sendMessage(ChatColor.GOLD + "/frpg setLevel [" + lang.getString("playerName") + "] [" + + lang.getString("skillName") + "] [" + lang.getString("level") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc4")); + p.sendMessage(ChatColor.GOLD + "/frpg statReset [" + lang.getString("playerName") + "] [" + + lang.getString("skillName") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc5")); + p.sendMessage(ChatColor.GOLD + "/frpg statLeaders [" + lang.getString("skillName") + "] [" + + lang.getString("page") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc6")); + p.sendMessage( + ChatColor.GOLD + "/frpg info" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc7")); + break; + case 2: + p.sendMessage(ChatColor.GOLD + "/frpg flintToggle [" + lang.getString("onOrOff") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + + lang.getString("diggingPerkTitle4")); + p.sendMessage(ChatColor.GOLD + "/frpg speedToggle [" + lang.getString("onOrOff") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + + lang.getString("agilityPerkTitle2")); + p.sendMessage(ChatColor.GOLD + "/frpg potionToggle [" + lang.getString("onOrOff") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + + lang.getString("alchemyPerkTitle2")); + p.sendMessage(ChatColor.GOLD + "/frpg flamePickToggle [" + lang.getString("onOrOff") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + + lang.getString("smeltingPerkTitle2")); + p.sendMessage(ChatColor.GOLD + "/frpg grappleToggle [" + lang.getString("onOrOff") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + + lang.getString("fishingPerkTitle4")); + p.sendMessage(ChatColor.GOLD + "/frpg hotRodToggle [" + lang.getString("onOrOff") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + + lang.getString("fishingPerkTitle5")); + p.sendMessage(ChatColor.GOLD + "/frpg veinMinerToggle [" + lang.getString("onOrOff") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + + lang.getString("miningPerkTitle4")); + p.sendMessage(ChatColor.GOLD + "/frpg megaDigToggle [" + lang.getString("onOrOff") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + + lang.getString("diggingPerkTitle6")); + break; + case 3: + p.sendMessage( + ChatColor.GOLD + "/frpg leafBlowerToggle [" + lang.getString("onOrOff") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + + lang.getString("woodcuttingPerkTitle5")); + p.sendMessage(ChatColor.GOLD + "/frpg holyAxeToggle [" + lang.getString("onOrOff") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + + lang.getString("axeMasteryPerkTitle1")); + p.sendMessage(ChatColor.GOLD + "/frpg enchantItem [" + lang.getString("level") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc8")); + p.sendMessage( + ChatColor.GOLD + "/frpg setSouls" + " [" + lang.getString("playerName") + "]" + " [" + + lang.getString("amount") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc9")); + p.sendMessage( + ChatColor.GOLD + "/frpg setTokens" + " [" + lang.getString("playerName") + "]" + " [" + + lang.getString("skillName") + "]" + " [skill/passive]" + " [" + lang.getString( + "amount") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc10")); + p.sendMessage( + ChatColor.GOLD + "/frpg setTokens" + " [" + lang.getString("playerName") + "]" + + " global" + " [" + lang.getString("amount") + "]" + ChatColor.RESET + + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc11")); + p.sendMessage(ChatColor.GOLD + "/frpg saveStats [" + lang.getString("playerName") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc12")); + p.sendMessage( + ChatColor.GOLD + "/frpg setMultiplier [" + lang.getString("playerName") + "] " + "[" + + lang.getString("amount") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc13")); + break; + case 4: + p.sendMessage( + ChatColor.GOLD + "/frpg resetCooldown [" + lang.getString("playerName") + "] [" + + lang.getString("skillName") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc14")); + p.sendMessage(ChatColor.GOLD + "/frpg statLookup [" + lang.getString("playerName") + "]" + + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc15")); + p.sendMessage( + ChatColor.GOLD + "/frpg changeMultiplier [" + lang.getString("playerName") + "] " + + "[" + lang.getString("expIncrease") + "]" + ChatColor.RESET + + ChatColor.GRAY.toString() + " - " + + ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc16")); + default: + break; + } } - private void togglePerkSetGuiItem(String id, Player p, GuiWrapper gui) { - String langID; - int globalIndex; - int guiIndex = 28; - boolean enchanted = false; - Material icon; - switch (id) { - case "flintToggle": - langID = "diggingPerkTitle4"; - globalIndex = 12; - icon = Material.FLINT; - break; - case "flamePickToggle": - langID = "smeltingPerkTitle2"; - globalIndex = 13; - icon = Material.BLAZE_POWDER; - break; - case "speedToggle": - langID = "agilityPerkTitle2"; - globalIndex = 14; - icon = Material.LEATHER_BOOTS; - break; - case "potionToggle": - langID = "alchemyPerkTitle2"; - globalIndex = 15; - icon = Material.POTION; - break; - case "grappleToggle": - langID = "fishingPerkTitle4"; - globalIndex = 16; - icon = Material.LEAD; - break; - case "hotRodToggle": - langID = "fishingPerkTitle5"; - globalIndex = 17; - guiIndex = 29; - icon = Material.FISHING_ROD; - break; - case "veinMinerToggle": - langID = "miningPerkTitle4"; - globalIndex = 18; - icon = Material.DIAMOND_PICKAXE; - break; - case "megaDigToggle": - langID = "diggingPerkTitle6"; - globalIndex = 19; - guiIndex = 29; - icon = Material.DIAMOND_SHOVEL; - break; - case "leafBlowerToggle": - langID = "woodcuttingPerkTitle5"; - globalIndex = 26; - icon = Material.OAK_LEAVES; - break; - case "holyAxeToggle": - langID = "axeMasteryPerkTitle1"; - globalIndex = 27; - icon = Material.DIAMOND_AXE; - enchanted = true; - break; - default: - return; + } + + private void createLeaderboard(CommandSender sender, int page, String skillName) { + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting", "global", "playTime"}; + List labels_arr = Arrays.asList(labels_0); + + Leaderboards getStats = new Leaderboards(); + if (!getStats.isLeaderboardsLoaded()) { + if (sender instanceof Player) { + Player p = (Player) sender; + p.sendMessage(ChatColor.RED + "Leaderboard is not yet loaded, try again soon"); + } else { + sender.sendMessage("Leaderboard is not yet loaded, try again soon"); + } + } + //Sorts and Updates leaderboard (if dynamic updates are on) + getStats.sortLeaderBoard(skillName); + + ArrayList sortedStats = getStats.getLeaderboard(skillName); + int totalPlayers = sortedStats.size(); + int totalPages = (int) Math.ceil(totalPlayers / 10.0); + if (page > totalPages) { + page = 1; + } + if (sender instanceof Player) { + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + String[] titles_0 = {lang.getString("digging"), lang.getString("woodcutting"), + lang.getString("mining"), lang.getString("farming"), + lang.getString("fishing"), lang.getString("archery"), lang.getString("beastMastery"), + lang.getString("swordsmanship"), + lang.getString("defense"), lang.getString("axeMastery"), lang.getString("repair"), + lang.getString("agility"), lang.getString("alchemy"), + lang.getString("smelting"), lang.getString("enchanting"), lang.getString("global"), + lang.getString("totalPlayTime")}; + String skillTitle = titles_0[labels_arr.indexOf(skillName)]; + p.sendMessage( + ChatColor.AQUA + "------| " + ChatColor.WHITE + ChatColor.BOLD.toString() + skillTitle + + " " + lang.getString("leaderboard") + "" + + ChatColor.RESET + ChatColor.WHITE.toString() + " " + lang.getString("page") + " [" + + Integer.toString(page) + "/" + Integer.toString(totalPages) + "]" + + ChatColor.AQUA.toString() + " |-----"); + for (int i = 10 * (page - 1); i < (int) Math.min(10 * page, totalPlayers); i++) { + PlayerLeaderboardStat info = sortedStats.get(i); + if (skillName.equalsIgnoreCase("global")) { + p.sendMessage( + ChatColor.WHITE + Integer.toString(i + 1) + ". " + ChatColor.AQUA + info.get_pName() + + ChatColor.WHITE.toString() + " - " + ChatColor.WHITE + String.format("%,d", + info.get_sortedStat()) + ChatColor.WHITE + " (" + ChatColor.GRAY + String.format( + "%,d", info.get_stat2()) + ChatColor.WHITE + ")"); + } else if (skillName.equalsIgnoreCase("playTime")) { + p.sendMessage( + ChatColor.WHITE + Integer.toString(i + 1) + ". " + ChatColor.AQUA + info.get_pName() + + ChatColor.WHITE.toString() + " - " + ChatColor.WHITE + + info.get_playTimeString()); + } else { + p.sendMessage( + ChatColor.WHITE + Integer.toString(i + 1) + ". " + ChatColor.AQUA + info.get_pName() + + ChatColor.WHITE.toString() + " - " + ChatColor.WHITE + String.format("%,d", + info.get_stat2()) + ChatColor.WHITE + " (" + ChatColor.GRAY + String.format("%,d", + info.get_sortedStat()) + ChatColor.WHITE + ")"); + } + } + } else { + String[] titles_0 = {"Digging", "Woodcutting", "Mining", "Farming", "Fishing", "Archery", + "Beast Mastery", "Swordsmanship", "Defense", "Axe Mastery", "Repair", "Agility", + "Alchemy", "Smelting", "Enchanting", "Global"}; + String skillTitle = titles_0[labels_arr.indexOf(skillName)]; + sender.sendMessage( + "------| " + skillTitle + " Leaderboard" + " Page [" + Integer.toString(page) + "/" + + Integer.toString(totalPages) + "]" + " |-----"); + for (int i = 10 * (page - 1); i < (int) Math.min(10 * page, totalPlayers); i++) { + PlayerLeaderboardStat info = sortedStats.get(i); + if (skillName.equalsIgnoreCase("global")) { + sender.sendMessage( + Integer.toString(i + 1) + ". " + info.get_pName() + " - " + Integer.toString( + (int) info.get_sortedStat()) + " (" + info.get_stat2() + ")"); + } else if (skillName.equalsIgnoreCase("playTime")) { + sender.sendMessage(Integer.toString(i + 1) + ". " + info.get_pName() + " - " + + info.get_playTimeString()); + } else { + sender.sendMessage( + Integer.toString(i + 1) + ". " + info.get_pName() + " - " + Integer.toString( + (int) info.get_stat2()) + " (" + info.get_sortedStat() + ")"); } - String parsableName = "::"+langID+"::" + " " + "::toggle::"; - addToggleButton(p,gui,parsableName,icon,guiIndex,globalIndex); - if (enchanted) { - gui.getItem(guiIndex).addEnchantmentGlow(); + } + } + } + + private void createStatLookup(CommandSender sender, String playerName) { + Leaderboards leaderboards = new Leaderboards(); + if (sender instanceof Player) { + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + List leaderboardNames = leaderboards.getLeaderboardNames(); + p.sendMessage( + ChatColor.AQUA + "--------| " + ChatColor.WHITE + ChatColor.BOLD.toString() + playerName + + ChatColor.RESET + ChatColor.WHITE.toString() + " " + lang.getString("stats") + + ChatColor.AQUA.toString() + " |-------"); + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + for (String leaderboardName : leaderboardNames) { + int rank = leaderboards.getLeaderboardPosition(playerName, leaderboardName); + PlayerLeaderboardStat playerStat = leaderboards.getPlayerStat(playerName, leaderboardName); + String displayedStat; + String displayTitle; + String rankString = UtilityMethods.intToRankingString(rank); + if (rankString.equals("1st")) { + rankString = ChatColor.YELLOW + rankString; + } else if (rankString.equals("2nd")) { + rankString = ChatColor.WHITE + rankString; + } else if (rankString.equals("3rd")) { + rankString = ChatColor.GOLD + rankString; + } else { + rankString = ChatColor.GRAY + rankString; + } + if (leaderboardName.equalsIgnoreCase("playTime")) { + displayedStat = playerStat.get_playTimeString(); + displayTitle = "Play Time"; + } else if (leaderboardName.equalsIgnoreCase("global")) { + displayedStat = String.format("%,d", playerStat.get_sortedStat()); + displayTitle = "Global Level"; + } else { + displayedStat = String.format("%,d", playerStat.get_stat2()); + displayTitle = stringsAndOtherData.camelCaseToTitle(leaderboardName); + } + p.sendMessage(ChatColor.AQUA + ChatColor.BOLD.toString() + displayTitle + ChatColor.RESET + + ChatColor.GRAY.toString() + " - " + + ChatColor.WHITE + displayedStat + " (" + rankString + ChatColor.WHITE + ")"); + } + + } else { + List leaderboardNames = leaderboards.getLeaderboardNames(); + sender.sendMessage("--------| " + playerName + " stats |-------"); + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + for (String leaderboardName : leaderboardNames) { + int rank = leaderboards.getLeaderboardPosition(playerName, leaderboardName); + PlayerLeaderboardStat playerStat = leaderboards.getPlayerStat(playerName, leaderboardName); + String displayedStat; + String displayTitle; + String rankString = UtilityMethods.intToRankingString(rank); + if (leaderboardName.equalsIgnoreCase("playTime")) { + displayedStat = playerStat.get_playTimeString(); + displayTitle = "Play Time"; + } else if (leaderboardName.equalsIgnoreCase("global")) { + displayedStat = String.format("%,d", playerStat.get_sortedStat()); + displayTitle = "Global Level"; + } else { + displayedStat = String.format("%,d", playerStat.get_stat2()); + displayTitle = stringsAndOtherData.camelCaseToTitle(leaderboardName); } + sender.sendMessage(displayTitle + " - " + displayedStat + " (" + rankString + ")"); + } + } + } + + private void addToggleButton(Player p, GuiWrapper gui, String parseableName, + Material iconItemType, int iconPosition, int toggleIndex) { + LanguageSelector lang = new LanguageSelector(p); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + + GuiItem guiItem = new GuiItem(iconItemType, iconPosition, gui); + guiItem.setName(lang.translateMessage(parseableName)); + gui.addItem(guiItem); + + GuiItem guiItemToggle = new GuiItem(Material.LIME_DYE, iconPosition + 9, gui); + if ((int) pStat.get("global").get(toggleIndex) > 0) { + guiItemToggle.setNameColor(ChatColor.BOLD + ChatColor.GREEN.toString()); + guiItemToggle.setName(lang.getString("on0")); + } else { + guiItemToggle.setItemType(Material.GRAY_DYE); + guiItemToggle.setNameColor(ChatColor.BOLD + ChatColor.RED.toString()); + guiItemToggle.setName(lang.getString("off0")); + } + gui.addItem(guiItemToggle); + } + + private void addToggleButton(Player p, GuiWrapper gui, String parseableName, + Material iconItemType, int iconPosition, boolean toggleCondition) { + LanguageSelector lang = new LanguageSelector(p); + PlayerStats pStatClass = new PlayerStats(p); + + GuiItem guiItem = new GuiItem(iconItemType, iconPosition, gui); + guiItem.setName(lang.translateMessage(parseableName)); + gui.addItem(guiItem); + + GuiItem guiItemToggle = new GuiItem(Material.LIME_DYE, iconPosition + 9, gui); + if (toggleCondition) { + guiItemToggle.setNameColor(ChatColor.BOLD + ChatColor.GREEN.toString()); + guiItemToggle.setName(lang.getString("on0")); + } else { + guiItemToggle.setItemType(Material.GRAY_DYE); + guiItemToggle.setNameColor(ChatColor.BOLD + ChatColor.RED.toString()); + guiItemToggle.setName(lang.getString("off0")); + } + gui.addItem(guiItemToggle); + } + + private void setTranslatedSkillTreeInformation(Player p, String skillName, + Map perksMap, Map descriptionsMap, + Map passivePerksMap, Map passiveDescriptionsMap) { + LanguageSelector lang = new LanguageSelector(p); + String[] newTitles = perksMap.get(skillName); + String[] newDescs = descriptionsMap.get(skillName); + String[] newPassiveTitles = passivePerksMap.get(skillName); + String[] newPassiveDescs = passiveDescriptionsMap.get(skillName); + int i = 0; + for (String title : perksMap.get(skillName)) { + String id = skillName + "PerkTitle" + i; + newTitles[i] = lang.getString(id); + i += 1; + } + i = 0; + for (String desc : descriptionsMap.get(skillName)) { + String id = skillName + "PerkDesc" + i; + newDescs[i] = lang.getString(id); + i += 1; + } + i = 0; + for (String passiveTitle : passivePerksMap.get(skillName)) { + String id = skillName + "PassiveTitle" + i; + newPassiveTitles[i] = lang.getString(id); + i += 1; + } + i = 0; + for (String passiveDesc : passiveDescriptionsMap.get(skillName)) { + String id = skillName + "PassiveDesc" + i; + newPassiveDescs[i] = lang.getString(id); + i += 1; + } + perksMap.put(skillName, newTitles); + descriptionsMap.put(skillName, newDescs); + passivePerksMap.put(skillName, newPassiveTitles); + passiveDescriptionsMap.put(skillName, newPassiveDescs); + } + + private void setSkillTreeProgressMainSkill(Player p, String skillName, GuiWrapper gui) { + PlayerStats pStatClass = new PlayerStats(p); + Map> pStatAll = pStatClass.getPlayerData(); + ArrayList pStats = pStatAll.get(skillName); + Integer[] indices = {11, 29, 13, 31, 7, 43, 26}; + int skill_1a_level = (Integer) pStats.get(7); + int skill_1b_level = (Integer) pStats.get(8); + int skill_2a_level = (Integer) pStats.get(9); + int skill_2b_level = (Integer) pStats.get(10); + int skill_3a_level = (Integer) pStats.get(11); + int skill_3b_level = (Integer) pStats.get(12); + int skill_M_level = (Integer) pStats.get(13); + + GuiItem skill_1a = new GuiItem(Material.PINK_TERRACOTTA, 11, gui); + GuiItem skill_2a = new GuiItem(Material.RED_TERRACOTTA, 13, gui); + GuiItem skill_3a = new GuiItem(Material.RED_TERRACOTTA, 7, gui); + GuiItem skill_1b = new GuiItem(Material.PINK_TERRACOTTA, 29, gui); + GuiItem skill_2b = new GuiItem(Material.RED_TERRACOTTA, 31, gui); + GuiItem skill_3b = new GuiItem(Material.RED_TERRACOTTA, 43, gui); + GuiItem skill_M = new GuiItem(Material.RED_TERRACOTTA, 26, gui); + + if (skill_1a_level == 0) { + skill_1a.setItemType(Material.PINK_TERRACOTTA); + } else if (skill_1a_level > 0 && skill_1a_level < 5) { + skill_1a.setItemType(Material.YELLOW_TERRACOTTA); + } else { + skill_1a.setItemType(Material.GREEN_TERRACOTTA); } - private String getExpToNextString(Player p,String skillName) { - ChangeStats getEXP = new ChangeStats(p); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - int maxLevel = getEXP.getMaxLevel(skillName); - int EXP = pStat.get(skillName).get(1).intValue(); - int level = pStat.get(skillName).get(0).intValue(); + if (skill_1b_level == 0) { + skill_1b.setItemType(Material.PINK_TERRACOTTA); + } else if (skill_1b_level > 0 && skill_1b_level < 5) { + skill_1b.setItemType(Material.YELLOW_TERRACOTTA); + } else { + skill_1b.setItemType(Material.GREEN_TERRACOTTA); + } - String EXPtoNextString; - if (level < maxLevel) { - int nextEXP = getEXP.getEXPfromLevel(level+1); - int EXPtoNext = nextEXP - EXP; - EXPtoNextString = String.valueOf(EXPtoNext); - } - else { - EXPtoNextString = "N/A"; - } - return EXPtoNextString; + if (skill_2a_level == 0) { + if (skill_1a_level >= 2) { + skill_2a.setItemType(Material.PINK_TERRACOTTA); + } + } else if (skill_2a_level > 0 && skill_2a_level < 5) { + skill_2a.setItemType(Material.YELLOW_TERRACOTTA); + } else { + skill_2a.setItemType(Material.GREEN_TERRACOTTA); } - private int getTotalSkillTokens(Player p) { - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - int totalSkillTokens = 0; - for (String j : pStat.keySet()){ - if (!j.equalsIgnoreCase("global")){ - totalSkillTokens += pStat.get(j).get(3).intValue(); - } - } - return totalSkillTokens; + + if (skill_2b_level == 0) { + if (skill_1b_level >= 2) { + skill_2b.setItemType(Material.PINK_TERRACOTTA); + } + } else if (skill_2b_level > 0 && skill_2b_level < 5) { + skill_2b.setItemType(Material.YELLOW_TERRACOTTA); + } else { + skill_2b.setItemType(Material.GREEN_TERRACOTTA); } - private int getTotalPassiveTokens(Player p) { - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - int totalPassiveTokens = 0; - for (String j : pStat.keySet()){ - if (!j.equalsIgnoreCase("global")){ - totalPassiveTokens += pStat.get(j).get(2).intValue(); - } - } - return totalPassiveTokens; + + if (skill_3a_level == 0) { + if (skill_2a_level >= 2) { + skill_3a.setItemType(Material.PINK_TERRACOTTA); + } + } else { + skill_3a.setItemType(Material.GREEN_TERRACOTTA); } - private void generateMainMenu(Player p) { - //Player Information and Leaderboard - LanguageSelector lang = new LanguageSelector(p); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - Leaderboards leaderboards = new Leaderboards(); - PlayerStats timeStats = new PlayerStats(p); - - //Gui Set-up - GuiWrapper gui = new GuiWrapper(p,Bukkit.createInventory(p, 45, "Skills")); - String nameColor = ChatColor.AQUA.toString() + ChatColor.BOLD.toString(); - String descriptionColor = ChatColor.GRAY.toString() + ChatColor.ITALIC.toString(); - String statisticNameColor = ChatColor.GRAY.toString(); - String statisticColor = ChatColor.BLUE.toString(); - - //Menu Options (Items) - GuiItem global = new GuiItem(Material.NETHER_STAR,4,gui); - GuiItem digging = new GuiItem(Material.IRON_SHOVEL,11,gui); - GuiItem woodcutting = new GuiItem(Material.IRON_AXE,12,gui); - GuiItem mining = new GuiItem(Material.IRON_PICKAXE,13,gui); - GuiItem farming = new GuiItem(Material.IRON_HOE,14,gui); - GuiItem fishing = new GuiItem(Material.FISHING_ROD,15,gui); - GuiItem archery = new GuiItem(Material.BOW,20,gui); - GuiItem beastMastery = new GuiItem(Material.BONE,21,gui); - GuiItem swords = new GuiItem(Material.IRON_SWORD,22,gui); - GuiItem armor = new GuiItem(Material.IRON_CHESTPLATE,23,gui); - GuiItem axes = new GuiItem(Material.GOLDEN_AXE,24,gui); - GuiItem repair = new GuiItem(Material.ANVIL,29,gui); - GuiItem agility = new GuiItem(Material.LEATHER_LEGGINGS,30,gui); - GuiItem alchemy = new GuiItem(Material.POTION,31,gui); - GuiItem smelting = new GuiItem(Material.COAL,32,gui); - GuiItem enchanting = new GuiItem(Material.ENCHANTING_TABLE,33,gui); - GuiItem info = new GuiItem(Material.MAP,36,gui); - GuiItem configuration = new GuiItem(Material.REDSTONE,44,gui); - - GuiItem[] guiItems = {global,digging,woodcutting,mining,farming,fishing,archery,beastMastery,swords,armor,axes,repair,agility,alchemy,smelting,enchanting,info,configuration}; - String[] labels = {lang.getString("global"),lang.getString("digging"),lang.getString("woodcutting"),lang.getString("mining"),lang.getString("farming"),lang.getString("fishing"),lang.getString("archery"),lang.getString("beastMastery"),lang.getString("swordsmanship"),lang.getString("defense"),lang.getString("axeMastery"),lang.getString("repair"),lang.getString("agility"),lang.getString("alchemy"),lang.getString("smelting"),lang.getString("enchanting"),lang.getString("information"),lang.getString("configuration")}; - String[] labels0 = {"global","digging", "woodcutting", "mining", "farming", "fishing", "archery", "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", "smelting", "enchanting","information","configuration"}; - - for (int i = 0; i < guiItems.length; i++) { - GuiItem item = guiItems[i]; - String translatedLabel = labels[i]; - String label = labels0[i]; - item.setName(translatedLabel); - item.setNameColor(nameColor); - if (i == 0) { //Global - int globalTokens = (int) pStat.get(labels0[i]).get(1); - int totalLevel = pStat.get("global").get(0).intValue(); - int totalExperience = (int) pStat.get("global").get(29); - int totalPlayers = leaderboards.getLeaderboardSize("global"); - int rank = leaderboards.getLeaderboardPosition(p,"global"); - - item.addStatistic(lang.getString("total") + " " + lang.getString("level"), String.valueOf(totalLevel)); - item.addStatistic(lang.getString("total") + " " + lang.getString("exp"), String.valueOf(totalExperience)); - item.addSpecialLoreLine(statisticNameColor + lang.getString("rank") +": " + ChatColor.WHITE+ChatColor.BOLD.toString() + "" + String.format("%,d",rank) + ChatColor.RESET + descriptionColor +" " + lang.getString("outOf")+ " " + ChatColor.RESET + ChatColor.WHITE.toString() + totalPlayers); - if (globalTokens > 0) { - item.addEnchantmentGlow(); - } - } else if (i < 16) { //Skills - String skillName = labels0[i]; - int passiveTokens = (int) pStat.get(labels0[i]).get(2); - int skillTokens = (int) pStat.get(labels0[i]).get(3); - int level = pStat.get(labels0[i]).get(0).intValue(); - int EXP = pStat.get(labels0[i]).get(1).intValue(); - int totalPlayers = leaderboards.getLeaderboardSize(labels0[i]); - int rank = leaderboards.getLeaderboardPosition(p,labels0[i]); - String EXPtoNextString = getExpToNextString(p,skillName); - - GuiDisplayStatistic levelStat = new GuiDisplayStatistic(lang.getString("level"),level,ChatColor.GRAY.toString(),ChatColor.BLUE.toString()); - GuiDisplayStatistic expStat = new GuiDisplayStatistic(lang.getString("experience"),EXP,ChatColor.GRAY.toString(),ChatColor.BLUE.toString()); - GuiDisplayStatistic expToLevelStat = new GuiDisplayStatistic(lang.getString("expToLevel"),EXPtoNextString,ChatColor.GRAY.toString(),ChatColor.GREEN.toString()); - - item.addStatistic(levelStat); - item.addStatistic(expStat); - item.addStatistic(expToLevelStat); - item.addSpecialLoreLine(statisticNameColor + lang.getString("rank") +": " + ChatColor.WHITE+ChatColor.BOLD.toString() + "" + String.format("%,d",rank) + ChatColor.RESET + descriptionColor +" " + lang.getString("outOf")+ " " + ChatColor.RESET + ChatColor.WHITE.toString() + totalPlayers); - if (passiveTokens > 0 || skillTokens > 0) { - item.addEnchantmentGlow(); - } + if (skill_3b_level == 0) { + if (skill_2b_level >= 2) { + skill_3b.setItemType(Material.PINK_TERRACOTTA); + } + } else { + skill_3b.setItemType(Material.GREEN_TERRACOTTA); + } - } else if (i == 16){ //Information - int totalSkillTokens = getTotalSkillTokens(p); - int totalPassiveTokens = getTotalPassiveTokens(p); - int globalTokens = pStat.get("global").get(1).intValue(); - String playTimeString = timeStats.getPlayerPlayTimeString(); - double personalMultiplier = (double) pStat.get("global").get(23); - int souls = (int) pStat.get("global").get(20); - - item.addStatistic(lang.getString("totalPlayTime"),playTimeString); - item.addStatistic(lang.getString("personalMultiplier"),String.valueOf(personalMultiplier)+"x"); - item.addStatistic(lang.getString("globalPassiveTitle0"),globalTokens); - item.addStatistic(lang.getString("diggingPassiveTitle2"),totalSkillTokens); - item.addStatistic(lang.getString("diggingPassiveTitle0"),totalPassiveTokens); - item.addStatistic(UtilityMethods.capitalizeString(lang.getString("souls")),souls); - } else if (i == 17) {//Configuration - item.setDescription(lang.getString("clickForOptions")); - } - gui.addItem(item); - } + if (skill_M_level == 0) { + if (skill_1a_level + skill_1b_level + skill_2a_level + skill_2b_level + skill_3a_level + + skill_3b_level >= 10) { + skill_M.setItemType(Material.PINK_TERRACOTTA); + } + } else { + skill_M.setItemType(Material.GREEN_TERRACOTTA); + } + } + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + // /frpg aka MainGUI + if (args.length == 0) { + CommandHelper commandHelper = new CommandHelper(sender, args, 0, ""); + commandHelper.setCheckInBed(true); + commandHelper.setPlayerOnlyCommand(true); + commandHelper.setPermissionName("mainGUI"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player p = (Player) sender; + generateMainMenu(p); //Generates the Main GUI + return true; + } - //Put the items in the inventory - gui.displayGuiForPlayer(); + //Help + else if (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("?")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg help [::page::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 1, 2, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPlayerOnlyCommand(true); + commandHelper.setPermissionName("help"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + int page = 1; + if (args.length == 2) { + page = getArgumentAsInteger(args[1]); + if (page == Integer.MAX_VALUE) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper input + } + } + messagePlayerHelpScreen(sender, page); //Sends player the corresponding help screen } - private void messagePlayerHelpScreen(CommandSender sender, int page) { - if (sender instanceof Player) { - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - final int TOTAL_PAGES = 4; - if (page > TOTAL_PAGES || page < 1) { - page = 1; //Page input out of bounds - } - p.sendMessage(ChatColor.RED + "------| " + ChatColor.GREEN + ChatColor.BOLD.toString() + " Help" + - ChatColor.RESET + ChatColor.GREEN.toString() + " " + lang.getString("page") + " [" + Integer.toString(page) + "/" + Integer.toString(TOTAL_PAGES) + "]" + - ChatColor.RED.toString() + " |-----"); - switch (page) { - case 1: - p.sendMessage(ChatColor.GOLD + "/frpg" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc0")); - p.sendMessage(ChatColor.GOLD + "/frpg skillTreeGUI [" + lang.getString("skillName") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc1")); - p.sendMessage(ChatColor.GOLD + "/frpg configurationGUI" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc2")); - p.sendMessage(ChatColor.GOLD + "/frpg giveEXP [" + lang.getString("playerName") + "] [" + lang.getString("skillName") + "] [amount]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc3")); - p.sendMessage(ChatColor.GOLD + "/frpg setLevel [" + lang.getString("playerName") + "] [" + lang.getString("skillName") + "] [" + lang.getString("level") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc4")); - p.sendMessage(ChatColor.GOLD + "/frpg statReset [" + lang.getString("playerName") + "] [" + lang.getString("skillName") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc5")); - p.sendMessage(ChatColor.GOLD + "/frpg statLeaders [" + lang.getString("skillName") + "] [" + lang.getString("page") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc6")); - p.sendMessage(ChatColor.GOLD + "/frpg info" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc7")); - break; - case 2: - p.sendMessage(ChatColor.GOLD + "/frpg flintToggle [" + lang.getString("onOrOff") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + lang.getString("diggingPerkTitle4")); - p.sendMessage(ChatColor.GOLD + "/frpg speedToggle [" + lang.getString("onOrOff") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + lang.getString("agilityPerkTitle2")); - p.sendMessage(ChatColor.GOLD + "/frpg potionToggle [" + lang.getString("onOrOff") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + lang.getString("alchemyPerkTitle2")); - p.sendMessage(ChatColor.GOLD + "/frpg flamePickToggle [" + lang.getString("onOrOff") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + lang.getString("smeltingPerkTitle2")); - p.sendMessage(ChatColor.GOLD + "/frpg grappleToggle [" + lang.getString("onOrOff") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + lang.getString("fishingPerkTitle4")); - p.sendMessage(ChatColor.GOLD + "/frpg hotRodToggle [" + lang.getString("onOrOff") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + lang.getString("fishingPerkTitle5")); - p.sendMessage(ChatColor.GOLD + "/frpg veinMinerToggle [" + lang.getString("onOrOff") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + lang.getString("miningPerkTitle4")); - p.sendMessage(ChatColor.GOLD + "/frpg megaDigToggle [" + lang.getString("onOrOff") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + lang.getString("diggingPerkTitle6")); - break; - case 3: - p.sendMessage(ChatColor.GOLD + "/frpg leafBlowerToggle [" + lang.getString("onOrOff") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + lang.getString("woodcuttingPerkTitle5")); - p.sendMessage(ChatColor.GOLD + "/frpg holyAxeToggle [" + lang.getString("onOrOff") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("manuallyToggles") + " " + lang.getString("axeMasteryPerkTitle1")); - p.sendMessage(ChatColor.GOLD + "/frpg enchantItem [" + lang.getString("level") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc8")); - p.sendMessage(ChatColor.GOLD + "/frpg setSouls" + " [" + lang.getString("playerName") + "]" + " [" + lang.getString("amount") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc9")); - p.sendMessage(ChatColor.GOLD + "/frpg setTokens" + " [" + lang.getString("playerName") + "]" + " [" + lang.getString("skillName") + "]" + " [skill/passive]" + " [" + lang.getString("amount") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc10")); - p.sendMessage(ChatColor.GOLD + "/frpg setTokens" + " [" + lang.getString("playerName") + "]" + " global" + " [" + lang.getString("amount") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc11")); - p.sendMessage(ChatColor.GOLD + "/frpg saveStats [" + lang.getString("playerName") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc12")); - p.sendMessage(ChatColor.GOLD + "/frpg setMultiplier [" + lang.getString("playerName") + "] " + "[" + lang.getString("amount") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc13")); - break; - case 4: - p.sendMessage(ChatColor.GOLD + "/frpg resetCooldown [" + lang.getString("playerName") + "] [" + lang.getString("skillName") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc14")); - p.sendMessage(ChatColor.GOLD + "/frpg statLookup [" + lang.getString("playerName") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc15")); - p.sendMessage(ChatColor.GOLD + "/frpg changeMultiplier [" + lang.getString("playerName") + "] " + "[" + lang.getString("expIncrease") + "]" + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.RESET + ChatColor.WHITE + lang.getString("commandDesc16")); - default: - break; - } + + //saveStats + else if (args[0].equalsIgnoreCase("saveStats") || args[0].equalsIgnoreCase("statSave")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg saveStats"; + CommandHelper commandHelper = new CommandHelper(sender, args, 1, 2, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("saveStats"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + if (args.length == 1) { + PeriodicSaving saveAll = new PeriodicSaving(); + saveAll.saveAllStats(false); + } else if (args.length == 2) { + String playerName = args[1]; + Player target = plugin.getServer().getPlayer(playerName); + if (!isTargetOnline(target, sender)) { + return true; //Player not online + } + PlayerStatsLoadIn saveStats = new PlayerStatsLoadIn(target); + try { + saveStats.setPlayerStatsMap(); + } catch (IOException e) { + FreeRPG.log(Level.ERROR, e.getMessage()); } + } } - private void createLeaderboard(CommandSender sender, int page, String skillName) { - String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", "smelting", "enchanting","global","playTime"}; - List labels_arr = Arrays.asList(labels_0); - Leaderboards getStats = new Leaderboards(); - if (!getStats.isLeaderboardsLoaded()) { - if (sender instanceof Player) { - Player p = (Player) sender; - p.sendMessage(ChatColor.RED +"Leaderboard is not yet loaded, try again soon"); - } else { - sender.sendMessage("Leaderboard is not yet loaded, try again soon"); - } - } - //Sorts and Updates leaderboard (if dynamic updates are on) - getStats.sortLeaderBoard(skillName); + // Tutorial Document (Info) + else if (args[0].equalsIgnoreCase("info") || args[0].equalsIgnoreCase("use")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg info"; + CommandHelper commandHelper = new CommandHelper(sender, args, 0, IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPlayerOnlyCommand(true); + commandHelper.setPermissionName("info"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + p.sendMessage( + lang.getString("informationURL") + ": " + ChatColor.AQUA + ChatColor.UNDERLINE.toString() + + "shorturl.at/ptCDX" + + ChatColor.RESET + ChatColor.GOLD.toString() + ChatColor.BOLD.toString() + "<-- " + + lang.getString("click")); + } - ArrayList sortedStats = getStats.getLeaderboard(skillName); - int totalPlayers = sortedStats.size(); - int totalPages = (int) Math.ceil(totalPlayers / 10.0); - if (page > totalPages) { - page = 1; - } + //Enchant Item Command + else if (args[0].equalsIgnoreCase("enchantItem") || args[0].equalsIgnoreCase("enchant")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg enchantItem [::level::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPlayerOnlyCommand(true); + commandHelper.setPermissionName("enchantItem"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player p = (Player) sender; + int level = getArgumentAsInteger(args[1]); + if (level == Integer.MAX_VALUE) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper input + } + if (level > 40) { + LanguageSelector lang = new LanguageSelector(p); + p.sendMessage(ChatColor.RED + lang.getString("levelArgument")); + return true; //Level input too high + } + ItemStack item = p.getInventory().getItemInMainHand(); + PsuedoEnchanting enchant = new PsuedoEnchanting(); + item = enchant.enchantItem(item, level, false); + p.getInventory().setItemInMainHand(item); + } + + //Leader Board + else if (args[0].equalsIgnoreCase("leaderboard") || args[0].equalsIgnoreCase("statLeaders") + || args[0].equalsIgnoreCase("top")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg top [::skillName::] [::page::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, 3, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("leaderboard"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + int page = 1; + if (args.length == 3) { + page = getArgumentAsInteger(args[2]); + if (page == Integer.MAX_VALUE) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper input + } + } + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting", "global", "playTime"}; + List labels_arr = Arrays.asList(labels_0); + String skillName = UtilityMethods.convertStringToListCasing(labels_arr, args[1]); + if (!labels_arr.contains(skillName)) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper input + } + createLeaderboard(sender, page, skillName); + } + + //Stat Lookup + else if (args[0].equalsIgnoreCase("statLookup") || args[0].equalsIgnoreCase("lookupStats") + || args[0].equalsIgnoreCase("stats")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg stats [::playerName::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 1, 2, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("statLookup"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + if (args.length == 1) { if (sender instanceof Player) { - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - String[] titles_0 = {lang.getString("digging"),lang.getString("woodcutting"),lang.getString("mining"),lang.getString("farming"), - lang.getString("fishing"),lang.getString("archery"),lang.getString("beastMastery"),lang.getString("swordsmanship"), - lang.getString("defense"),lang.getString("axeMastery"),lang.getString("repair"),lang.getString("agility"),lang.getString("alchemy"), - lang.getString("smelting"),lang.getString("enchanting"),lang.getString("global"),lang.getString("totalPlayTime")}; - String skillTitle = titles_0[labels_arr.indexOf(skillName)]; - p.sendMessage(ChatColor.AQUA + "------| " + ChatColor.WHITE + ChatColor.BOLD.toString() + skillTitle + " "+lang.getString("leaderboard")+"" + - ChatColor.RESET + ChatColor.WHITE.toString() + " "+lang.getString("page")+" [" + Integer.toString(page) + "/" + Integer.toString(totalPages) + "]" + - ChatColor.AQUA.toString() + " |-----"); - for (int i = 10 * (page - 1); i < (int) Math.min(10 * page, totalPlayers); i++) { - PlayerLeaderboardStat info = sortedStats.get(i); - if (skillName.equalsIgnoreCase("global")) { - p.sendMessage(ChatColor.WHITE + Integer.toString(i + 1) + ". " + ChatColor.AQUA + info.get_pName() + ChatColor.WHITE.toString() + " - " + ChatColor.WHITE + String.format("%,d", info.get_sortedStat()) + ChatColor.WHITE + " (" + ChatColor.GRAY + String.format("%,d", info.get_stat2()) + ChatColor.WHITE + ")"); - } - else if (skillName.equalsIgnoreCase("playTime")){ - p.sendMessage(ChatColor.WHITE + Integer.toString(i + 1) + ". " + ChatColor.AQUA + info.get_pName() + ChatColor.WHITE.toString() + " - " + ChatColor.WHITE + info.get_playTimeString() ); - } - else { - p.sendMessage(ChatColor.WHITE + Integer.toString(i + 1) + ". " + ChatColor.AQUA + info.get_pName() + ChatColor.WHITE.toString() + " - " + ChatColor.WHITE + String.format("%,d", info.get_stat2()) + ChatColor.WHITE + " (" + ChatColor.GRAY + String.format("%,d", info.get_sortedStat()) + ChatColor.WHITE + ")"); - } - } + Player p = (Player) sender; + p.performCommand("frpg statLookup " + p.getName()); } else { - String[] titles_0 = {"Digging", "Woodcutting", "Mining", "Farming", "Fishing", "Archery", "Beast Mastery", "Swordsmanship", "Defense", "Axe Mastery", "Repair", "Agility", "Alchemy", "Smelting", "Enchanting", "Global"}; - String skillTitle = titles_0[labels_arr.indexOf(skillName)]; - sender.sendMessage("------| " + skillTitle + " Leaderboard" + " Page [" + Integer.toString(page) + "/" + Integer.toString(totalPages) + "]" + " |-----"); - for (int i = 10 * (page - 1); i < (int) Math.min(10 * page, totalPlayers); i++) { - PlayerLeaderboardStat info = sortedStats.get(i); - if (skillName.equalsIgnoreCase("global")) { - sender.sendMessage(Integer.toString(i + 1) + ". " + info.get_pName() + " - " + Integer.toString((int)info.get_sortedStat()) + " (" + info.get_stat2() + ")"); - } - else if (skillName.equalsIgnoreCase("playTime")) { - sender.sendMessage(Integer.toString(i + 1) + ". " + info.get_pName() + " - " + info.get_playTimeString()); - } - else { - sender.sendMessage(Integer.toString(i + 1) + ". " + info.get_pName() + " - " + Integer.toString((int)info.get_stat2()) + " (" + info.get_sortedStat() + ")"); - } - - } + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper Arguments } - } - private void createStatLookup(CommandSender sender, String playerName) { + } else if (args.length == 2) { + String playerName = args[1]; Leaderboards leaderboards = new Leaderboards(); - if (sender instanceof Player) { + if (!leaderboards.isPlayerOnLeaderboards(playerName)) { + if (sender instanceof Player) { Player p = (Player) sender; LanguageSelector lang = new LanguageSelector(p); - List leaderboardNames = leaderboards.getLeaderboardNames(); - p.sendMessage(ChatColor.AQUA + "--------| " + ChatColor.WHITE + ChatColor.BOLD.toString() + playerName + ChatColor.RESET + ChatColor.WHITE.toString() + " " + lang.getString("stats") + - ChatColor.AQUA.toString() + " |-------"); - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - for (String leaderboardName : leaderboardNames) { - int rank = leaderboards.getLeaderboardPosition(playerName, leaderboardName); - PlayerLeaderboardStat playerStat = leaderboards.getPlayerStat(playerName, leaderboardName); - String displayedStat; - String displayTitle; - String rankString = UtilityMethods.intToRankingString(rank); - if (rankString.equals("1st")) { - rankString = ChatColor.YELLOW + rankString; - } else if (rankString.equals("2nd")) { - rankString = ChatColor.WHITE + rankString; - } else if (rankString.equals("3rd")) { - rankString = ChatColor.GOLD + rankString; - } else { - rankString = ChatColor.GRAY + rankString; - } - if (leaderboardName.equalsIgnoreCase("playTime")) { - displayedStat = playerStat.get_playTimeString(); - displayTitle = "Play Time"; - } else if (leaderboardName.equalsIgnoreCase("global")) { - displayedStat = String.format("%,d", playerStat.get_sortedStat()); - displayTitle = "Global Level"; - } else { - displayedStat = String.format("%,d", playerStat.get_stat2()); - displayTitle = stringsAndOtherData.camelCaseToTitle(leaderboardName); - } - p.sendMessage(ChatColor.AQUA + ChatColor.BOLD.toString() + displayTitle + ChatColor.RESET + ChatColor.GRAY.toString() + " - " + - ChatColor.WHITE + displayedStat + " (" + rankString + ChatColor.WHITE + ")"); - } + p.sendMessage(ChatColor.RED + lang.getString("playerNotInLeaderboard")); + } else { + sender.sendMessage("That player is not on any leaderboards"); + } + return true; //Player not on leaderboards + } + createStatLookup(sender, playerName); + } + } + //CooldownReset + else if (args[0].equalsIgnoreCase("resetCooldown") || args[0].equalsIgnoreCase( + "cooldownReset")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg resetCooldown [::playerName::] [::skillName::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, 3, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("resetCooldown"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + //Arguments --> Variables + Player target; + String skillNameInput; + if (args.length == 2) { + if (sender instanceof Player) { + target = (Player) sender; + skillNameInput = args[1]; } else { - List leaderboardNames = leaderboards.getLeaderboardNames(); - sender.sendMessage("--------| " + playerName + " stats |-------"); - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - for (String leaderboardName : leaderboardNames) { - int rank = leaderboards.getLeaderboardPosition(playerName, leaderboardName); - PlayerLeaderboardStat playerStat = leaderboards.getPlayerStat(playerName, leaderboardName); - String displayedStat; - String displayTitle; - String rankString = UtilityMethods.intToRankingString(rank); - if (leaderboardName.equalsIgnoreCase("playTime")) { - displayedStat = playerStat.get_playTimeString(); - displayTitle = "Play Time"; - } else if (leaderboardName.equalsIgnoreCase("global")) { - displayedStat = String.format("%,d", playerStat.get_sortedStat()); - displayTitle = "Global Level"; - } else { - displayedStat = String.format("%,d", playerStat.get_stat2()); - displayTitle = stringsAndOtherData.camelCaseToTitle(leaderboardName); - } - sender.sendMessage(displayTitle + " - " + displayedStat + " (" + rankString +")"); - } - } + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper Arguments + } + } else { + String playerName = args[1]; + skillNameInput = args[2]; + + //Target Online Check + target = plugin.getServer().getPlayer(playerName); + boolean targetOnline = isTargetOnline(target, sender); + if (!targetOnline) { + return true; //Target not online + } + } + + //Skill name match check + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery"}; + List labels = Arrays.asList(labels_0); + String skillName = UtilityMethods.convertStringToListCasing(labels, skillNameInput); + if (!labels.contains(skillName)) { + commandHelper.sendImproperArgumentsMessage(); + return true; + } + + AbilityTimers abilityTimers = new AbilityTimers(target); + abilityTimers.setPlayerCooldownTime(skillName, 0); + } - private void addToggleButton(Player p, GuiWrapper gui, String parseableName, Material iconItemType, int iconPosition, int toggleIndex) { - LanguageSelector lang = new LanguageSelector(p); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - GuiItem guiItem = new GuiItem(iconItemType,iconPosition,gui); - guiItem.setName(lang.translateMessage(parseableName)); - gui.addItem(guiItem); + //createFakePlayers + else if (args[0].equalsIgnoreCase("createFakePlayers") || args[0].equalsIgnoreCase( + "createFakeProfiles")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg createFakePlayers [#]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("createFakePlayers"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + + int numPlayers = getArgumentAsInteger(args[1]); + if (numPlayers == Integer.MAX_VALUE) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper input + } + + PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); + Random rand = new Random(); + for (int i = 0; i < numPlayers; i++) { + String fakeName = "FakePlayer" + rand.nextInt(100000); + UUID fakeUUID = UUID.fromString("badf" + UUID.randomUUID().toString() + .substring(4)); //"badf" hexadecimal identifier for "bad files" + playerStatsFilePreparation.preparePlayerFile(fakeName, fakeUUID, false); + } - GuiItem guiItemToggle = new GuiItem(Material.LIME_DYE,iconPosition+9,gui); - if ( (int) pStat.get("global").get(toggleIndex) > 0) { - guiItemToggle.setNameColor(ChatColor.BOLD + ChatColor.GREEN.toString()); - guiItemToggle.setName(lang.getString("on0")); - } - else { - guiItemToggle.setItemType(Material.GRAY_DYE); - guiItemToggle.setNameColor(ChatColor.BOLD + ChatColor.RED.toString()); - guiItemToggle.setName(lang.getString("off0")); - } - gui.addItem(guiItemToggle); } - private void addToggleButton(Player p, GuiWrapper gui, String parseableName, Material iconItemType, int iconPosition, boolean toggleCondition) { - LanguageSelector lang = new LanguageSelector(p); - PlayerStats pStatClass = new PlayerStats(p); - GuiItem guiItem = new GuiItem(iconItemType,iconPosition,gui); - guiItem.setName(lang.translateMessage(parseableName)); - gui.addItem(guiItem); + //removeFakePlayers + else if (args[0].equalsIgnoreCase("deleteFakePlayers") || args[0].equalsIgnoreCase( + "deleteFakeProfiles") || args[0].equalsIgnoreCase("removeFakePlayers") + || args[0].equalsIgnoreCase("removeFakeProfiles")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg deleteFakePlayers"; + CommandHelper commandHelper = new CommandHelper(sender, args, 0, IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("createFakePlayers"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + + File userdata = new File( + Bukkit.getServer().getPluginManager().getPlugin("FreeRPG").getDataFolder(), + File.separator + "PlayerDatabase"); + File[] allUsers = userdata.listFiles(); + for (File f : allUsers) { + if (f.getName().substring(0, 4).equalsIgnoreCase("badf")) { + f.delete(); + } + } - GuiItem guiItemToggle = new GuiItem(Material.LIME_DYE,iconPosition+9,gui); - if (toggleCondition) { - guiItemToggle.setNameColor(ChatColor.BOLD + ChatColor.GREEN.toString()); - guiItemToggle.setName(lang.getString("on0")); - } - else { - guiItemToggle.setItemType(Material.GRAY_DYE); - guiItemToggle.setNameColor(ChatColor.BOLD + ChatColor.RED.toString()); - guiItemToggle.setName(lang.getString("off0")); - } - gui.addItem(guiItemToggle); } - private void setTranslatedSkillTreeInformation(Player p,String skillName,Map perksMap,Map descriptionsMap,Map passivePerksMap,Map passiveDescriptionsMap) { - LanguageSelector lang = new LanguageSelector(p); - String[] newTitles = perksMap.get(skillName); - String[] newDescs = descriptionsMap.get(skillName); - String[] newPassiveTitles = passivePerksMap.get(skillName); - String[] newPassiveDescs = passiveDescriptionsMap.get(skillName); - int i = 0; - for (String title : perksMap.get(skillName)) { - String id = skillName + "PerkTitle" + i; - newTitles[i] = lang.getString(id); - i += 1; - } - i = 0; - for (String desc : descriptionsMap.get(skillName)) { - String id = skillName + "PerkDesc" + i; - newDescs[i] = lang.getString(id); - i += 1; - } - i = 0; - for (String passiveTitle : passivePerksMap.get(skillName)) { - String id = skillName + "PassiveTitle" + i; - newPassiveTitles[i] = lang.getString(id); - i += 1; - } - i = 0; - for (String passiveDesc : passiveDescriptionsMap.get(skillName)) { - String id = skillName + "PassiveDesc" + i; - newPassiveDescs[i] = lang.getString(id); - i += 1; - } - perksMap.put(skillName, newTitles); - descriptionsMap.put(skillName, newDescs); - passivePerksMap.put(skillName, newPassiveTitles); - passiveDescriptionsMap.put(skillName, newPassiveDescs); - } - private void setSkillTreeProgressMainSkill(Player p, String skillName, GuiWrapper gui){ - PlayerStats pStatClass = new PlayerStats(p); - Map> pStatAll = pStatClass.getPlayerData(); - ArrayList pStats = pStatAll.get(skillName); - Integer[] indices = {11,29,13,31,7,43,26}; - int skill_1a_level = (Integer) pStats.get(7); - int skill_1b_level = (Integer) pStats.get(8); - int skill_2a_level = (Integer) pStats.get(9); - int skill_2b_level = (Integer) pStats.get(10); - int skill_3a_level = (Integer) pStats.get(11); - int skill_3b_level = (Integer) pStats.get(12); - int skill_M_level = (Integer) pStats.get(13); - - GuiItem skill_1a = new GuiItem(Material.PINK_TERRACOTTA,11,gui); - GuiItem skill_2a = new GuiItem(Material.RED_TERRACOTTA,13,gui); - GuiItem skill_3a = new GuiItem(Material.RED_TERRACOTTA,7,gui); - GuiItem skill_1b = new GuiItem(Material.PINK_TERRACOTTA,29,gui); - GuiItem skill_2b = new GuiItem(Material.RED_TERRACOTTA,31,gui); - GuiItem skill_3b = new GuiItem(Material.RED_TERRACOTTA,43,gui); - GuiItem skill_M = new GuiItem(Material.RED_TERRACOTTA,26,gui); - if (skill_1a_level == 0) { - skill_1a.setItemType(Material.PINK_TERRACOTTA); - } - else if (skill_1a_level > 0 && skill_1a_level < 5) { - skill_1a.setItemType(Material.YELLOW_TERRACOTTA); - } - else { - skill_1a.setItemType(Material.GREEN_TERRACOTTA); + //Save FRPG Data + else if (args[0].equalsIgnoreCase("thoroughSave")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg save"; + CommandHelper commandHelper = new CommandHelper(sender, args, 0, IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("saveStats"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + + PeriodicSaving periodicSaving = new PeriodicSaving(); + new BukkitRunnable() { + @Override + public void run() { + periodicSaving.saveAllStats(true); } + }.runTaskAsynchronously(plugin); + } - if (skill_1b_level == 0) { - skill_1b.setItemType(Material.PINK_TERRACOTTA); - } - else if (skill_1b_level > 0 && skill_1b_level < 5) { - skill_1b.setItemType(Material.YELLOW_TERRACOTTA); - } - else { - skill_1b.setItemType(Material.GREEN_TERRACOTTA); - } + //Load in all players + else if (args[0].equalsIgnoreCase("loadInAllPlayerFiles") || args[0].equalsIgnoreCase( + "loadInPlayerFiles")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg save"; + CommandHelper commandHelper = new CommandHelper(sender, args, 0, IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("saveStats"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + OfflinePlayerStatLoadIn offlinePlayerStatLoadIn = new OfflinePlayerStatLoadIn(); + offlinePlayerStatLoadIn.loadInAllOfflinePlayers(); + } - if (skill_2a_level == 0) { - if (skill_1a_level >= 2) { - skill_2a.setItemType(Material.PINK_TERRACOTTA); - } - } - else if (skill_2a_level > 0 && skill_2a_level < 5) { - skill_2a.setItemType(Material.YELLOW_TERRACOTTA); - } - else { - skill_2a.setItemType(Material.GREEN_TERRACOTTA); + //GiveEXP + else if (args[0].equalsIgnoreCase("giveEXP") || args[0].equalsIgnoreCase("expGive")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg giveEXP [::playerName::] [::skillName::] [::exp::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 3, 4, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("giveEXP"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player target; + String skillNameInput; + String expInput; + if (args.length == 3) { + if (sender instanceof Player) { + target = (Player) sender; + skillNameInput = args[1]; + expInput = args[2]; + } else { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper Arguments + } + } else { + String playerName = args[1]; + skillNameInput = args[2]; + expInput = args[3]; + + //Target Online Check + target = plugin.getServer().getPlayer(playerName); + boolean targetOnline = isTargetOnline(target, sender); + if (!targetOnline) { + return true; //Target not online + } + } + + int exp = getArgumentAsInteger(expInput); + if (exp == Integer.MAX_VALUE) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper argument (exp not integer) + } + + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + List labels_arr = Arrays.asList(labels_0); + String skillName = UtilityMethods.convertStringToListCasing(labels_arr, skillNameInput); + if (!labels_arr.contains(skillName)) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper argument (skillName not valid) + } + + if (exp < 0) { + if (sender instanceof Player) { + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + p.sendMessage(ChatColor.RED + lang.getString("onlyIncrease")); + } else { + sender.sendMessage( + "Please only increase exp with this command, otherwise, use /frpg statReset then /frpg giveEXP"); } + return true; //Improper argument (exp change not positive) + } + ChangeStats increaseStats = new ChangeStats(target); + increaseStats.set_isCommand(true); + increaseStats.changeEXP(skillName, exp); + increaseStats.setTotalLevel(); + increaseStats.setTotalExperience(); + } - if (skill_2b_level == 0) { - if (skill_1b_level >= 2) { - skill_2b.setItemType(Material.PINK_TERRACOTTA); - } - } - else if (skill_2b_level > 0 && skill_2b_level < 5) { - skill_2b.setItemType(Material.YELLOW_TERRACOTTA); - } - else { - skill_2b.setItemType(Material.GREEN_TERRACOTTA); + //setLevel + else if (args[0].equalsIgnoreCase("setLevel") || args[0].equalsIgnoreCase("levelSet")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg setLevel [::playerName::] [::skillName::] [::level::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 3, 4, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("setLevel"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player target; + String skillNameInput; + String levelInput; + if (args.length == 3) { + if (sender instanceof Player) { + target = (Player) sender; + skillNameInput = args[1]; + levelInput = args[2]; + } else { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper Arguments + } + } else { + String playerName = args[1]; + skillNameInput = args[2]; + levelInput = args[3]; + + //Target Online Check + target = plugin.getServer().getPlayer(playerName); + boolean targetOnline = isTargetOnline(target, sender); + if (!targetOnline) { + return true; //Target not online + } + } + + int level = getArgumentAsInteger(levelInput); + if (level == Integer.MAX_VALUE) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper argument (exp not integer) + } + + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + List labels_arr = Arrays.asList(labels_0); + String skillName = UtilityMethods.convertStringToListCasing(labels_arr, skillNameInput); + if (!labels_arr.contains(skillName)) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper argument (skillName not valid) + } + + ChangeStats increaseStats = new ChangeStats(target); + int exp = increaseStats.getEXPfromLevel(level); + PlayerStats pStatClass = new PlayerStats(target); + Map> pStat = pStatClass.getPlayerData(); + int currentExp = (int) pStat.get(skillName).get(1); + + if (exp <= currentExp) { + if (sender instanceof Player) { + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + p.sendMessage(ChatColor.RED + lang.getString("onlyIncrease")); + } else { + sender.sendMessage( + "Please only increase levels with this command, otherwise, use /frpg statReset then /frpg setLevel"); } + return true; //Improper argument (exp change not positive) + } + increaseStats.set_isCommand(true); + increaseStats.changeEXP(skillName, exp - currentExp + 1); + increaseStats.setTotalLevel(); + increaseStats.setTotalExperience(); + } - if (skill_3a_level == 0) { - if (skill_2a_level >= 2) { - skill_3a.setItemType(Material.PINK_TERRACOTTA); - } - } - else { - skill_3a.setItemType(Material.GREEN_TERRACOTTA); - } + //statReset + else if (args[0].equalsIgnoreCase("statReset") || args[0].equalsIgnoreCase("resetStat")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg statReset [::playerName::] [::skillName::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, 3, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("statReset"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player target; + String skillNameInput; + if (args.length == 2) { + if (sender instanceof Player) { + target = (Player) sender; + skillNameInput = args[1]; + } else { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper Arguments + } + } else { + String playerName = args[1]; + skillNameInput = args[2]; + + //Target Online Check + target = plugin.getServer().getPlayer(playerName); + boolean targetOnline = isTargetOnline(target, sender); + if (!targetOnline) { + return true; //Target not online + } + } + + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", + "repair", "agility", "alchemy", "smelting", "enchanting", + "global", "all"}; + List labels_arr = Arrays.asList(labels_0); + String skillName = UtilityMethods.convertStringToListCasing(labels_arr, skillNameInput); + if (!labels_arr.contains(skillName)) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper argument (skillName not valid) + } + ChangeStats changeStats = new ChangeStats(target); + if (!skillName.equalsIgnoreCase("all")) { + changeStats.resetStat(skillName); + } else { + for (String skillNameLabel : labels_arr) { + if (!skillNameLabel.equalsIgnoreCase("all")) { + changeStats.resetStat(skillNameLabel); + } + } + } + } - if (skill_3b_level == 0) { - if (skill_2b_level >= 2) { - skill_3b.setItemType(Material.PINK_TERRACOTTA); - } - } - else { - skill_3b.setItemType(Material.GREEN_TERRACOTTA); + //setSouls + else if (args[0].equalsIgnoreCase("setSouls") || args[0].equalsIgnoreCase("soulsSet")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg setSouls [::playerName::] [::amount::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, 3, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("setSouls"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player target; + String soulsInput; + if (args.length == 2) { + if (sender instanceof Player) { + target = (Player) sender; + soulsInput = args[1]; + } else { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper Arguments } + } else { + String playerName = args[1]; + soulsInput = args[2]; - if (skill_M_level == 0) { - if (skill_1a_level+skill_1b_level+skill_2a_level+skill_2b_level+skill_3a_level+skill_3b_level >=10) { - skill_M.setItemType(Material.PINK_TERRACOTTA); - } + //Target Online Check + target = plugin.getServer().getPlayer(playerName); + boolean targetOnline = isTargetOnline(target, sender); + if (!targetOnline) { + return true; //Target not online } - else { - skill_M.setItemType(Material.GREEN_TERRACOTTA); - } - } + } - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + int souls = getArgumentAsInteger(soulsInput); + if (souls == Integer.MAX_VALUE) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper argument (souls not integer) + } + ChangeStats increaseStats = new ChangeStats(target); + increaseStats.setStat("global", 20, souls); + } - // /frpg aka MainGUI - if (args.length == 0) { - CommandHelper commandHelper = new CommandHelper(sender,args,0,""); - commandHelper.setCheckInBed(true); - commandHelper.setPlayerOnlyCommand(true); - commandHelper.setPermissionName("mainGUI"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player p = (Player) sender; - generateMainMenu(p); //Generates the Main GUI - return true; - } - - //Help - else if (args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("?")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg help [::page::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,1,2,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPlayerOnlyCommand(true); - commandHelper.setPermissionName("help"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - int page = 1; - if (args.length == 2) { - page = getArgumentAsInteger(args[1]); - if (page == Integer.MAX_VALUE) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper input - } - } - messagePlayerHelpScreen(sender,page); //Sends player the corresponding help screen - } + //setTokens + else if (args[0].equalsIgnoreCase("setTokens") || args[0].equalsIgnoreCase("tokensSet")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg setTokens [::playerName::] global [::amount::] or /frpg setTokens [::playerName::] [::skillName::] skill/passive [::amount::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 3, 5, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("setTokens"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player target; + String skillNameInput; + String tokenType; + String amountInput; + if (args.length == 3) { // Two inputs: tokenType and amount + if (sender instanceof Player) { + target = (Player) sender; + tokenType = args[1]; + amountInput = args[2]; + skillNameInput = "global"; + } else { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper Arguments + } + } else if (args.length == 4) { + if (args[2].equalsIgnoreCase("global")) { //Three inputs: PlayerName, token type, amount + String playerName = args[1]; + tokenType = args[2]; + skillNameInput = "global"; + amountInput = args[3]; + + //Target Online Check + target = plugin.getServer().getPlayer(playerName); + boolean targetOnline = isTargetOnline(target, sender); + if (!targetOnline) { + return true; //Target not online + } + } else { //Three inputs: Skillname, tokenType, amount + target = (Player) sender; + skillNameInput = args[1]; + tokenType = args[2]; + amountInput = args[3]; + } + } else { //Four inputs: Playername, skillName, tokenType, amount + String playerName = args[1]; + skillNameInput = args[2]; + tokenType = args[3]; + amountInput = args[4]; + + //Target Online Check + target = plugin.getServer().getPlayer(playerName); + boolean targetOnline = isTargetOnline(target, sender); + if (!targetOnline) { + return true; //Target not online + } + } + + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting", "global"}; + List labels_arr = Arrays.asList(labels_0); + String skillName = UtilityMethods.convertStringToListCasing(labels_arr, skillNameInput); + if (!labels_arr.contains(skillName)) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper argument (skillName not valid) + } + + int amount = getArgumentAsInteger(amountInput); + if (amount == Integer.MAX_VALUE) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper argument (amount not integer) + } + + if (!(tokenType.equalsIgnoreCase("global") || tokenType.equalsIgnoreCase("skill") + || tokenType.equalsIgnoreCase("passive"))) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper arguemnt (token type not global, skill, or passive) + } + + ChangeStats increaseStats = new ChangeStats(target); + if (tokenType.equalsIgnoreCase("global")) { + increaseStats.setStat("global", 1, amount); + } else if (tokenType.equalsIgnoreCase("passive")) { + increaseStats.setStat(skillName, 2, amount); + } else if (tokenType.equalsIgnoreCase("skill")) { + increaseStats.setStat(skillName, 3, amount); + } - //saveStats - else if (args[0].equalsIgnoreCase("saveStats") || args[0].equalsIgnoreCase("statSave")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg saveStats"; - CommandHelper commandHelper = new CommandHelper(sender,args,1,2,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("saveStats"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - if (args.length == 1) { - PeriodicSaving saveAll = new PeriodicSaving(); - saveAll.saveAllStats(false); - } - else if (args.length == 2) { - String playerName = args[1]; - Player target = plugin.getServer().getPlayer(playerName); - if (!isTargetOnline(target,sender)) { - return true; //Player not online - } - PlayerStatsLoadIn saveStats = new PlayerStatsLoadIn(target); - try { - saveStats.setPlayerStatsMap(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } + } - // Tutorial Document (Info) - else if (args[0].equalsIgnoreCase("info") || args[0].equalsIgnoreCase("use")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg info"; - CommandHelper commandHelper = new CommandHelper(sender,args,0,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPlayerOnlyCommand(true); - commandHelper.setPermissionName("info"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(lang.getString("informationURL")+": " + ChatColor.AQUA + ChatColor.UNDERLINE.toString() + "shorturl.at/ptCDX" + - ChatColor.RESET + ChatColor.GOLD.toString() + ChatColor.BOLD.toString() + "<-- " +lang.getString("click")); - } - - //Enchant Item Command - else if (args[0].equalsIgnoreCase("enchantItem") || args[0].equalsIgnoreCase("enchant")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg enchantItem [::level::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPlayerOnlyCommand(true); - commandHelper.setPermissionName("enchantItem"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player p = (Player) sender; - int level = getArgumentAsInteger(args[1]); - if (level == Integer.MAX_VALUE) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper input - } - if (level > 40) { - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(ChatColor.RED +lang.getString("levelArgument")); - return true; //Level input too high - } - ItemStack item = p.getInventory().getItemInMainHand(); - PsuedoEnchanting enchant = new PsuedoEnchanting(); - item = enchant.enchantItem(item, level, false); - p.getInventory().setItemInMainHand(item); - } - - //Leader Board - else if (args[0].equalsIgnoreCase("leaderboard") || args[0].equalsIgnoreCase("statLeaders") || args[0].equalsIgnoreCase("top")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg top [::skillName::] [::page::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,3,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("leaderboard"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - int page = 1; - if (args.length == 3) { - page = getArgumentAsInteger(args[2]); - if (page == Integer.MAX_VALUE) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper input - } - } - String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", "smelting", "enchanting","global","playTime"}; - List labels_arr = Arrays.asList(labels_0); - String skillName = UtilityMethods.convertStringToListCasing(labels_arr,args[1]); - if (!labels_arr.contains(skillName)) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper input - } - createLeaderboard(sender,page,skillName); + //setMultiplier + else if (args[0].equalsIgnoreCase("setMultiplier") || args[0].equalsIgnoreCase( + "multiplierSet")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg setMultiplier [::playerName::] [::expIncrease::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, 3, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("setMultiplier"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player target; + String multiplierInput; + if (args.length == 2) { + if (sender instanceof Player) { + target = (Player) sender; + multiplierInput = args[1]; + } else { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper Arguments } + } else { + String playerName = args[1]; + multiplierInput = args[2]; - //Stat Lookup - else if (args[0].equalsIgnoreCase("statLookup") || args[0].equalsIgnoreCase("lookupStats") || args[0].equalsIgnoreCase("stats")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg stats [::playerName::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,1,2,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("statLookup"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - if (args.length == 1) { - if (sender instanceof Player) { - Player p = (Player) sender; - p.performCommand("frpg statLookup " + p.getName()); - } else { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper Arguments - } - } - else if (args.length == 2) { - String playerName = args[1]; - Leaderboards leaderboards = new Leaderboards(); - if (!leaderboards.isPlayerOnLeaderboards(playerName)) { - if (sender instanceof Player) { - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(ChatColor.RED + lang.getString("playerNotInLeaderboard")); - } else { - sender.sendMessage("That player is not on any leaderboards"); - } - return true; //Player not on leaderboards - } - createStatLookup(sender,playerName); - } + //Target Online Check + target = plugin.getServer().getPlayer(playerName); + boolean targetOnline = isTargetOnline(target, sender); + if (!targetOnline) { + return true; //Target not online } + } - //CooldownReset - else if (args[0].equalsIgnoreCase("resetCooldown") || args[0].equalsIgnoreCase("cooldownReset")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg resetCooldown [::playerName::] [::skillName::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,3,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("resetCooldown"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - //Arguments --> Variables - Player target; - String skillNameInput; - if (args.length == 2) { - if (sender instanceof Player) { - target = (Player) sender; - skillNameInput = args[1]; - } else { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper Arguments - } - } else { - String playerName = args[1]; - skillNameInput = args[2]; - - //Target Online Check - target = plugin.getServer().getPlayer(playerName); - boolean targetOnline = isTargetOnline(target,sender); - if (!targetOnline) { - return true; //Target not online - } - } + double multiplier = getArgumentAsDouble(multiplierInput); + if (multiplier == Double.MAX_VALUE) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper argument (amount not integer) + } - //Skill name match check - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery"}; - List labels = Arrays.asList(labels_0); - String skillName = UtilityMethods.convertStringToListCasing(labels,skillNameInput); - if (!labels.contains(skillName)) { - commandHelper.sendImproperArgumentsMessage(); - return true; - } + ChangeStats setMultiplier = new ChangeStats(target); + setMultiplier.setStat("global", 23, multiplier); - AbilityTimers abilityTimers = new AbilityTimers(target); - abilityTimers.setPlayerCooldownTime(skillName,0); + } + //addMultiplier + else if (args[0].equalsIgnoreCase("addMultiplier") || args[0].equalsIgnoreCase( + "changeMultiplier")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg addMultiplier [::playerName::] [::expIncrease::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, 3, + IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPermissionName("setMultiplier"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player target; + String multiplierInput; + if (args.length == 2) { + if (sender instanceof Player) { + target = (Player) sender; + multiplierInput = args[1]; + } else { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper Arguments } + } else { + String playerName = args[1]; + multiplierInput = args[2]; - //createFakePlayers - else if (args[0].equalsIgnoreCase("createFakePlayers") || args[0].equalsIgnoreCase("createFakeProfiles")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg createFakePlayers [#]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("createFakePlayers"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } + //Target Online Check + target = plugin.getServer().getPlayer(playerName); + boolean targetOnline = isTargetOnline(target, sender); + if (!targetOnline) { + return true; //Target not online + } + } - int numPlayers = getArgumentAsInteger(args[1]); - if (numPlayers == Integer.MAX_VALUE) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper input - } + double multiplier = getArgumentAsDouble(multiplierInput); + if (multiplier == Double.MAX_VALUE) { + commandHelper.sendImproperArgumentsMessage(); + return true; //Improper argument (amount not integer) + } - PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); - Random rand = new Random(); - for (int i = 0; i < numPlayers; i++) { - String fakeName = "FakePlayer" + rand.nextInt(100000); - UUID fakeUUID = UUID.fromString("badf"+UUID.randomUUID().toString().substring(4)); //"badf" hexadecimal identifier for "bad files" - playerStatsFilePreparation.preparePlayerFile(fakeName,fakeUUID,false); - } + ChangeStats setMultiplier = new ChangeStats(target); + setMultiplier.changeStat("global", 23, multiplier); - } + } - //removeFakePlayers - else if (args[0].equalsIgnoreCase("deleteFakePlayers") || args[0].equalsIgnoreCase("deleteFakeProfiles") || args[0].equalsIgnoreCase("removeFakePlayers") || args[0].equalsIgnoreCase("removeFakeProfiles")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg deleteFakePlayers"; - CommandHelper commandHelper = new CommandHelper(sender,args,0,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("createFakePlayers"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } + //flamePickToggle + else if (args[0].equalsIgnoreCase("toggleFlamePick") || args[0].equalsIgnoreCase( + "flamePickToggle")) { + return togglePerk("flamePickToggle", sender, args); + } - File userdata = new File(Bukkit.getServer().getPluginManager().getPlugin("FreeRPG").getDataFolder(), File.separator + "PlayerDatabase"); - File[] allUsers = userdata.listFiles(); - for (File f : allUsers) { - if (f.getName().substring(0,4).equalsIgnoreCase("badf")) { - f.delete(); - } - } + //flintToggle + else if (args[0].equalsIgnoreCase("toggleFlint") || args[0].equalsIgnoreCase("flintToggle")) { + return togglePerk("flintToggle", sender, args); + } - } + //grappleToggle + else if (args[0].equalsIgnoreCase("toggleGrapple") || args[0].equalsIgnoreCase( + "grappleToggle")) { + return togglePerk("grappleToggle", sender, args); + } - //Save FRPG Data - else if (args[0].equalsIgnoreCase("thoroughSave")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg save"; - CommandHelper commandHelper = new CommandHelper(sender,args,0,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("saveStats"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } + //HotRodToggle + else if (args[0].equalsIgnoreCase("toggleHotRod") || args[0].equalsIgnoreCase("hotRodToggle")) { + return togglePerk("hotRodToggle", sender, args); + } - PeriodicSaving periodicSaving = new PeriodicSaving(); - new BukkitRunnable() { - @Override - public void run() { - periodicSaving.saveAllStats(true); - } - }.runTaskAsynchronously(plugin); + //MegaDigToggle + else if (args[0].equalsIgnoreCase("toggleMegaDig") || args[0].equalsIgnoreCase( + "megaDigToggle")) { + return togglePerk("megaDigToggle", sender, args); + } - } - - //Load in all players - else if (args[0].equalsIgnoreCase("loadInAllPlayerFiles") || args[0].equalsIgnoreCase("loadInPlayerFiles")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg save"; - CommandHelper commandHelper = new CommandHelper(sender,args,0,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("saveStats"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - OfflinePlayerStatLoadIn offlinePlayerStatLoadIn = new OfflinePlayerStatLoadIn(); - offlinePlayerStatLoadIn.loadInAllOfflinePlayers(); - - } - - //GiveEXP - else if (args[0].equalsIgnoreCase("giveEXP") || args[0].equalsIgnoreCase("expGive")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg giveEXP [::playerName::] [::skillName::] [::exp::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,3,4,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("giveEXP"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player target; - String skillNameInput; - String expInput; - if (args.length == 3) { - if (sender instanceof Player) { - target = (Player) sender; - skillNameInput = args[1]; - expInput = args[2]; - } else { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper Arguments - } - } else { - String playerName = args[1]; - skillNameInput = args[2]; - expInput = args[3]; - - //Target Online Check - target = plugin.getServer().getPlayer(playerName); - boolean targetOnline = isTargetOnline(target,sender); - if (!targetOnline) { - return true; //Target not online - } - } - - int exp = getArgumentAsInteger(expInput); - if (exp == Integer.MAX_VALUE) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper argument (exp not integer) - } - - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - List labels_arr = Arrays.asList(labels_0); - String skillName = UtilityMethods.convertStringToListCasing(labels_arr,skillNameInput); - if (!labels_arr.contains(skillName)) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper argument (skillName not valid) - } - - if (exp < 0) { - if (sender instanceof Player) { - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(ChatColor.RED + lang.getString("onlyIncrease")); - } else { - sender.sendMessage("Please only increase exp with this command, otherwise, use /frpg statReset then /frpg giveEXP"); - } - return true; //Improper argument (exp change not positive) - } - - ChangeStats increaseStats = new ChangeStats(target); - increaseStats.set_isCommand(true); - increaseStats.changeEXP(skillName, exp); - increaseStats.setTotalLevel(); - increaseStats.setTotalExperience(); - } - - //setLevel - else if (args[0].equalsIgnoreCase("setLevel") || args[0].equalsIgnoreCase("levelSet")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg setLevel [::playerName::] [::skillName::] [::level::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,3,4,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("setLevel"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player target; - String skillNameInput; - String levelInput; - if (args.length == 3) { - if (sender instanceof Player) { - target = (Player) sender; - skillNameInput = args[1]; - levelInput = args[2]; - } else { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper Arguments - } - } else { - String playerName = args[1]; - skillNameInput = args[2]; - levelInput = args[3]; - - //Target Online Check - target = plugin.getServer().getPlayer(playerName); - boolean targetOnline = isTargetOnline(target,sender); - if (!targetOnline) { - return true; //Target not online - } - } - - int level = getArgumentAsInteger(levelInput); - if (level == Integer.MAX_VALUE) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper argument (exp not integer) - } - - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - List labels_arr = Arrays.asList(labels_0); - String skillName = UtilityMethods.convertStringToListCasing(labels_arr,skillNameInput); - if (!labels_arr.contains(skillName)) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper argument (skillName not valid) - } - - ChangeStats increaseStats = new ChangeStats(target); - int exp = increaseStats.getEXPfromLevel(level); - PlayerStats pStatClass = new PlayerStats(target); - Map> pStat = pStatClass.getPlayerData(); - int currentExp = (int) pStat.get(skillName).get(1); - - if (exp <= currentExp) { - if (sender instanceof Player) { - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(ChatColor.RED + lang.getString("onlyIncrease")); - } else { - sender.sendMessage("Please only increase levels with this command, otherwise, use /frpg statReset then /frpg setLevel"); - } - return true; //Improper argument (exp change not positive) - } - - increaseStats.set_isCommand(true); - increaseStats.changeEXP(skillName,exp-currentExp+1); - increaseStats.setTotalLevel(); - increaseStats.setTotalExperience(); - } - - //statReset - else if (args[0].equalsIgnoreCase("statReset") || args[0].equalsIgnoreCase("resetStat")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg statReset [::playerName::] [::skillName::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,3,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("statReset"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player target; - String skillNameInput; - if (args.length == 2) { - if (sender instanceof Player) { - target = (Player) sender; - skillNameInput = args[1]; - } else { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper Arguments - } - } else { - String playerName = args[1]; - skillNameInput = args[2]; - - //Target Online Check - target = plugin.getServer().getPlayer(playerName); - boolean targetOnline = isTargetOnline(target,sender); - if (!targetOnline) { - return true; //Target not online - } - } - - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery", - "beastMastery","swordsmanship","defense","axeMastery", - "repair","agility","alchemy","smelting","enchanting", - "global","all"}; - List labels_arr = Arrays.asList(labels_0); - String skillName = UtilityMethods.convertStringToListCasing(labels_arr,skillNameInput); - if (!labels_arr.contains(skillName)) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper argument (skillName not valid) - } - ChangeStats changeStats = new ChangeStats(target); - if (!skillName.equalsIgnoreCase("all")) { - changeStats.resetStat(skillName); - } else { - for (String skillNameLabel : labels_arr) { - if (!skillNameLabel.equalsIgnoreCase("all")) { - changeStats.resetStat(skillNameLabel); - } - } - } - - } - - //setSouls - else if (args[0].equalsIgnoreCase("setSouls") || args[0].equalsIgnoreCase("soulsSet")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg setSouls [::playerName::] [::amount::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,3,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("setSouls"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player target; - String soulsInput; - if (args.length == 2) { - if (sender instanceof Player) { - target = (Player) sender; - soulsInput = args[1]; - } else { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper Arguments - } - } else { - String playerName = args[1]; - soulsInput = args[2]; - - //Target Online Check - target = plugin.getServer().getPlayer(playerName); - boolean targetOnline = isTargetOnline(target,sender); - if (!targetOnline) { - return true; //Target not online - } - } - - int souls = getArgumentAsInteger(soulsInput); - if (souls == Integer.MAX_VALUE) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper argument (souls not integer) - } - - ChangeStats increaseStats = new ChangeStats(target); - increaseStats.setStat("global",20,souls); - } - - //setTokens - else if (args[0].equalsIgnoreCase("setTokens") || args[0].equalsIgnoreCase("tokensSet")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg setTokens [::playerName::] global [::amount::] or /frpg setTokens [::playerName::] [::skillName::] skill/passive [::amount::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,3,5,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("setTokens"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player target; - String skillNameInput; - String tokenType; - String amountInput; - if (args.length == 3) { // Two inputs: tokenType and amount - if (sender instanceof Player) { - target = (Player) sender; - tokenType = args[1]; - amountInput = args[2]; - skillNameInput = "global"; - } else { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper Arguments - } - } else if (args.length == 4) { - if (args[2].equalsIgnoreCase("global")) { //Three inputs: PlayerName, token type, amount - String playerName = args[1]; - tokenType = args[2]; - skillNameInput = "global"; - amountInput = args[3]; - - //Target Online Check - target = plugin.getServer().getPlayer(playerName); - boolean targetOnline = isTargetOnline(target,sender); - if (!targetOnline) { - return true; //Target not online - } - } else { //Three inputs: Skillname, tokenType, amount - target = (Player) sender; - skillNameInput = args[1]; - tokenType = args[2]; - amountInput = args[3]; - } - } else { //Four inputs: Playername, skillName, tokenType, amount - String playerName = args[1]; - skillNameInput = args[2]; - tokenType = args[3]; - amountInput = args[4]; - - //Target Online Check - target = plugin.getServer().getPlayer(playerName); - boolean targetOnline = isTargetOnline(target,sender); - if (!targetOnline) { - return true; //Target not online - } - } - - String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", "smelting", "enchanting","global"}; - List labels_arr = Arrays.asList(labels_0); - String skillName = UtilityMethods.convertStringToListCasing(labels_arr, skillNameInput); - if (!labels_arr.contains(skillName)) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper argument (skillName not valid) - } + //PotionToggle + else if (args[0].equalsIgnoreCase("togglePotion") || args[0].equalsIgnoreCase("potionToggle")) { + return togglePerk("potionToggle", sender, args); + } - int amount = getArgumentAsInteger(amountInput); - if (amount == Integer.MAX_VALUE) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper argument (amount not integer) - } + //SpeedToggle + else if (args[0].equalsIgnoreCase("toggleSpeed") || args[0].equalsIgnoreCase("speedToggle")) { + return togglePerk("speedToggle", sender, args); + } - if (!(tokenType.equalsIgnoreCase("global") || tokenType.equalsIgnoreCase("skill") || tokenType.equalsIgnoreCase("passive"))) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper arguemnt (token type not global, skill, or passive) - } + //VeinMinerToggle + else if (args[0].equalsIgnoreCase("toggleVeinMiner") || args[0].equalsIgnoreCase( + "veinMinerToggle")) { + return togglePerk("veinMinerToggle", sender, args); + } - ChangeStats increaseStats = new ChangeStats(target); - if (tokenType.equalsIgnoreCase("global")) { - increaseStats.setStat("global", 1, amount); - } else if (tokenType.equalsIgnoreCase("passive")){ - increaseStats.setStat(skillName, 2, amount); - } else if (tokenType.equalsIgnoreCase("skill")) { - increaseStats.setStat(skillName, 3, amount); - } + //LeafBlowerToggle + else if (args[0].equalsIgnoreCase("toggleLeafBlower") || args[0].equalsIgnoreCase( + "leafBlowerToggle")) { + return togglePerk("leafBlowerToggle", sender, args); + } - } + //holyAxeToggle + else if (args[0].equalsIgnoreCase("toggleHolyAxe") || args[0].equalsIgnoreCase( + "holyAxeToggle")) { + return togglePerk("holyAxeToggle", sender, args); + } - //setMultiplier - else if (args[0].equalsIgnoreCase("setMultiplier") || args[0].equalsIgnoreCase("multiplierSet")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg setMultiplier [::playerName::] [::expIncrease::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,3,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("setMultiplier"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player target; - String multiplierInput; - if (args.length == 2) { - if (sender instanceof Player) { - target = (Player) sender; - multiplierInput = args[1]; - } else { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper Arguments - } - } else { - String playerName = args[1]; - multiplierInput = args[2]; - - //Target Online Check - target = plugin.getServer().getPlayer(playerName); - boolean targetOnline = isTargetOnline(target,sender); - if (!targetOnline) { - return true; //Target not online - } - } + //ConfigGUI + else if (args[0].equalsIgnoreCase("configGUI") || args[0].equalsIgnoreCase( + "configurationGUI")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg configGUI"; + CommandHelper commandHelper = new CommandHelper(sender, args, 1, IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPlayerOnlyCommand(true); + commandHelper.setCheckInBed(true); + commandHelper.setPermissionName("configGUI"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + + //GuiWrapper + GuiWrapper gui = new GuiWrapper(p, "Configuration Window", 54); + + //Back button + GuiItem backButton = new GuiItem(Material.ARROW, 45, gui); + backButton.setName(lang.getString("diggingPassiveTitle1")); + backButton.setDescription(lang.getString("diggingPassiveDesc1")); + gui.addItem(backButton); + + //Simple Toggle Buttons + addToggleButton(p, gui, "::levelUpNotif::", Material.OAK_SIGN, 1, + 21); //Level up Notifications + addToggleButton(p, gui, "::abilityPreparationNotif::", Material.OAK_SIGN, 2, + 22); //Ability Prep Notifications + addToggleButton(p, gui, "::triggerAbilities::", Material.WOODEN_PICKAXE, 3, + 24); //Ability Trigger + addToggleButton(p, gui, "::showEXPBar::", Material.EXPERIENCE_BOTTLE, 4, 25); //EXP bar show + + //Ability Duration Bar + GuiItem durationBar = new GuiItem(Material.CLOCK, 5, gui); + durationBar.setName(lang.getString("numberOfAbilityTimersDisplayed")); + gui.addItem(durationBar); + + GuiItem durationBarToggle = new GuiItem(Material.LIME_DYE, 14, gui); + int numberOfBars = (int) pStat.get("global").get(28); + if (numberOfBars > 0) { + durationBarToggle.setNameColor(ChatColor.BOLD + ChatColor.GREEN.toString()); + durationBarToggle.setName(String.valueOf(numberOfBars)); + } else { + durationBarToggle.setNameColor(ChatColor.BOLD + ChatColor.RED.toString()); + durationBarToggle.setName(String.valueOf(0)); + durationBarToggle.setItemType(Material.GRAY_DYE); + } + durationBarToggle.setItemAmount(Math.max(1, numberOfBars)); + gui.addItem(durationBarToggle); + + //Sets all the items into the gui (This is redundant, but makes the code a bit clearer) + gui.setGui(); + + //LANGUAGES (sets all the language items into the gui) + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + stringsAndOtherData.setLanguageItems(p, gui.getGui()); + + //Put the items in the inventory + gui.displayGuiForPlayer(); + } - double multiplier = getArgumentAsDouble(multiplierInput); - if (multiplier == Double.MAX_VALUE) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper argument (amount not integer) - } + //SkillConfigGUI + else if (args[0].equalsIgnoreCase("skillConfigGUI") || args[0].equalsIgnoreCase( + "skillConfigurationGUI") || args[0].equalsIgnoreCase("skillConfig")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg skillConfigGUI [::skillName::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPlayerOnlyCommand(true); + commandHelper.setCheckInBed(true); + commandHelper.setPermissionName("skillConfigGUI"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + PlayerStats pStatClass = new PlayerStats(p); + ConfigLoad configLoad = new ConfigLoad(); + + String[] titles_0 = {"Digging", "Woodcutting", "Mining", "Farming", "Fishing", "Archery", + "Beast Mastery", "Swordsmanship", "Defense", "Axe Mastery", "Repair", "Agility", + "Alchemy", "Smelting", "Enchanting"}; + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + String[] passiveLabels0 = {"repair", "agility", "alchemy", "smelting", "enchanting"}; + List labels = Arrays.asList(labels_0); + List passiveLabels = Arrays.asList(passiveLabels0); + String skillName = UtilityMethods.convertStringToListCasing(labels, args[1]); + if (!labels.contains(skillName)) { + commandHelper.sendImproperArgumentsMessage(); + return true; + } + + String skillTitle = titles_0[labels.indexOf(skillName)]; + GuiWrapper gui = new GuiWrapper(p, + Bukkit.createInventory(p, 54, skillTitle + " Configuration")); + + addToggleButton(p, gui, "::showEXPBar::", Material.EXPERIENCE_BOTTLE, 10, + pStatClass.isPlayerSkillExpBarOn(skillName)); //EXP bar show + if (!passiveLabels.contains(skillName)) { + addToggleButton(p, gui, "::triggerAbilities::", Material.WOODEN_PICKAXE, 11, + pStatClass.isPlayerSkillAbilityOn(skillName)); //Trigger Abilities + } + + if (!configLoad.getAllowedSkillsMap() + .get(skillName)) { //Special condition to return (skill disabled) + p.sendMessage(ChatColor.RED + lang.getString("disabledSkill")); + return true; + } + + //Back button + GuiItem backButton = new GuiItem(Material.ARROW, 45, gui); + backButton.setName(lang.getString("diggingPassiveTitle1")); + backButton.setDescription(lang.getString("diggingPassiveDesc1")); + gui.addItem(backButton); + + GuiItem skillIcon = new GuiItem(Material.WOODEN_PICKAXE, 4, gui); + skillIcon.setNameColor(ChatColor.AQUA.toString() + ChatColor.BOLD.toString()); + skillIcon.setName(lang.getString(skillName)); + + switch (skillName) { + case "digging": + skillIcon.setItemType(Material.IRON_SHOVEL); + //flintFinder + togglePerkSetGuiItem("flintToggle", p, gui); + + //Mega Dig + togglePerkSetGuiItem("megaDigToggle", p, gui); + break; + case "woodcutting": + skillIcon.setItemType(Material.IRON_AXE); + + //leafBlower + togglePerkSetGuiItem("leafBlowerToggle", p, gui); + break; + case "mining": + skillIcon.setItemType(Material.IRON_PICKAXE); + + //veinMiner + togglePerkSetGuiItem("veinMinerToggle", p, gui); + + break; + case "farming": + skillIcon.setItemType(Material.IRON_HOE); + break; + case "fishing": + skillIcon.setItemType(Material.FISHING_ROD); + + //grappling Hook + togglePerkSetGuiItem("grappleToggle", p, gui); + + //hot Rod + togglePerkSetGuiItem("hotRodToggle", p, gui); + break; + case "archery": + skillIcon.setItemType(Material.BOW); + break; + case "beastMastery": + skillIcon.setItemType(Material.BONE); + break; + case "swordsmanship": + skillIcon.setItemType(Material.IRON_SWORD); + break; + case "defense": + skillIcon.setItemType(Material.IRON_CHESTPLATE); + break; + case "axeMastery": + skillIcon.setItemType(Material.GOLDEN_AXE); + + //Holy Axe + togglePerkSetGuiItem("holyAxeToggle", p, gui); + break; + case "repair": + skillIcon.setItemType(Material.ANVIL); + break; + case "agility": + skillIcon.setItemType(Material.LEATHER_LEGGINGS); + + //gracefulFeet + togglePerkSetGuiItem("speedToggle", p, gui); + + break; + case "alchemy": + skillIcon.setItemType(Material.POTION); + + //potionMaster + togglePerkSetGuiItem("potionToggle", p, gui); + break; + case "smelting": + skillIcon.setItemType(Material.COAL); + + //flamePick + togglePerkSetGuiItem("flamePickToggle", p, gui); + break; + case "enchanting": + skillIcon.setItemType(Material.ENCHANTING_TABLE); + break; + default: + break; + + } + gui.addItem(skillIcon); + + //Sets all the items into the gui (This is redundant, but makes the code a bit clearer) + gui.setGui(); + + //Put the items in the inventory + gui.displayGuiForPlayer(); + } - ChangeStats setMultiplier = new ChangeStats(target); - setMultiplier.setStat("global",23,multiplier); + //ConfirmationGUI + else if (args[0].equalsIgnoreCase("confirmGUI") || args[0].equalsIgnoreCase( + "confirmationGUI")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg confirmationGUI [::skillName::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPlayerOnlyCommand(true); + commandHelper.setCheckInBed(true); + commandHelper.setPermissionName("confirmGUI"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting", "global"}; + String[] titles_0 = {lang.getString("digging"), lang.getString("woodcutting"), + lang.getString("mining"), lang.getString("farming"), lang.getString("fishing"), + lang.getString("archery"), lang.getString("beastMastery"), + lang.getString("swordsmanship"), lang.getString("defense"), lang.getString("axeMastery"), + lang.getString("repair"), lang.getString("agility"), lang.getString("alchemy"), + lang.getString("smelting"), lang.getString("enchanting"), lang.getString("global")}; + List labels = Arrays.asList(labels_0); + String skillName = UtilityMethods.convertStringToListCasing(labels, args[1]); + if (!labels.contains(skillName)) { + commandHelper.sendImproperArgumentsMessage(); + return true; + } + String skillTitle = titles_0[labels.indexOf(skillName)]; + GuiWrapper gui = new GuiWrapper(p, Bukkit.createInventory(p, 54, "Confirmation Window")); + + //Load souls data + ConfigLoad loadConfig = new ConfigLoad(); + ArrayList soulsInfo = loadConfig.getSoulsInfo(); + String refundCost = Integer.toString(soulsInfo.get(1)); + + //Information + GuiItem info = new GuiItem(Material.PAPER, 22, gui); + info.setNameColor(ChatColor.YELLOW.toString() + ChatColor.BOLD.toString()); + info.setName(lang.getString("warning")); + //The following is pretty messy, but it's all just to format a long strong + String partOne = + lang.getString("refundSkillTree0") + " " + refundCost + " " + lang.getString("souls") + + " " + lang.getString("refundSkillTree1"); + String partTwo = lang.getString("refundSkillTree2") + " " + ChatColor.WHITE.toString() + + skillTitle + ChatColor.RESET.toString() + ChatColor.ITALIC.toString() + + ChatColor.GRAY.toString() + " " + lang.getString("skill") + "?"; + String refundWarningMessage = partOne + " " + partTwo; + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + for (String line : stringsAndOtherData.getStringLines(refundWarningMessage)) { + info.addSpecialLoreLine(ChatColor.ITALIC + ChatColor.GRAY.toString() + line); + } + gui.addItem(info); + + //Yes Button + GuiItem yes = new GuiItem(Material.LIME_TERRACOTTA, 38, gui); + yes.setNameColor(ChatColor.GREEN.toString() + ChatColor.BOLD.toString()); + yes.setName(lang.getString("yes0")); + gui.addItem(yes); + + //No Button + GuiItem no = new GuiItem(Material.RED_TERRACOTTA, 42, gui); + no.setNameColor(ChatColor.RED.toString() + ChatColor.BOLD.toString()); + no.setName(lang.getString("no0")); + gui.addItem(no); + + //Skill Item (Indicator) + GuiItem skillIcon = new GuiItem(Material.IRON_SHOVEL, 4, gui); + switch (skillName) { + case "digging": + skillIcon.setItemType(Material.IRON_SHOVEL); + break; + case "woodcutting": + skillIcon.setItemType(Material.IRON_AXE); + break; + case "mining": + skillIcon.setItemType(Material.IRON_PICKAXE); + break; + case "farming": + skillIcon.setItemType(Material.IRON_HOE); + break; + case "fishing": + skillIcon.setItemType(Material.FISHING_ROD); + break; + case "archery": + skillIcon.setItemType(Material.BOW); + break; + case "beastMastery": + skillIcon.setItemType(Material.BONE); + break; + case "swordsmanship": + skillIcon.setItemType(Material.IRON_SWORD); + break; + case "defense": + skillIcon.setItemType(Material.IRON_CHESTPLATE); + break; + case "axeMastery": + skillIcon.setItemType(Material.GOLDEN_AXE); + break; + case "repair": + skillIcon.setItemType(Material.ANVIL); + break; + case "agility": + skillIcon.setItemType(Material.LEATHER_LEGGINGS); + break; + case "alchemy": + skillIcon.setItemType(Material.POTION); + break; + case "smelting": + skillIcon.setItemType(Material.COAL); + break; + case "enchanting": + skillIcon.setItemType(Material.ENCHANTING_TABLE); + break; + default: + break; + } + skillIcon.setNameColor(ChatColor.AQUA.toString() + ChatColor.BOLD.toString()); + skillIcon.setName(skillTitle); + gui.addItem(skillIcon); + + //Sets all the items into the gui (This is redundant, but makes the code a bit clearer) + gui.setGui(); + + //Put the items in the inventory + gui.displayGuiForPlayer(); + } - } + //CraftingGUI + else if (args[0].equalsIgnoreCase("craftingGUI") || args[0].equalsIgnoreCase("recipeGUI")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg craftingRecipe [::skillName::[#]]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPlayerOnlyCommand(true); + commandHelper.setCheckInBed(true); + commandHelper.setPermissionName("craftGUI"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + String[] labels_0 = {"archery1", "farming1", "farming2", "farming3", "farming4", "farming5", + "enchanting1", "enchanting2", "enchanting3", "enchanting4", "enchanting5", + "enchanting6", "enchanting7", "enchanting8", "enchanting9", "enchanting10", + "alchemy1", "alchemy2", "alchemy3", "alchemy4", "alchemy5"}; + List labels = Arrays.asList(labels_0); + String identifier = UtilityMethods.convertStringToListCasing(labels, args[1]); + if (!labels.contains(identifier)) { + commandHelper.sendImproperArgumentsMessage(); + return true; + } + + ConfigLoad configLoad = new ConfigLoad(); + Map craftingRecipes = configLoad.getCraftingRecipes(); + ArrayList recipe; + ItemStack output; + if (identifier.equalsIgnoreCase("archery1")) { + CraftingRecipes craftingRecipesClass = new CraftingRecipes(); + recipe = craftingRecipesClass.getTippedArrowRecipe(); + output = new ItemStack(Material.TIPPED_ARROW, 8); + } else { + recipe = craftingRecipes.get(identifier).getRecipe(); + output = craftingRecipes.get(identifier).getItemStack(); + } + + GuiWrapper gui = new GuiWrapper(p, Bukkit.createInventory(p, 54, "Crafting Recipe")); + + //Back button + GuiItem backButton = new GuiItem(Material.ARROW, 45, gui); + backButton.setName(lang.getString("diggingPassiveTitle1")); + backButton.setDescription(lang.getString("diggingPassiveDesc1")); + gui.addItem(backButton); + + //Crafting Tables + Integer[] indicies = {1, 2, 3, 4, 5, 10, 14, 19, 23, 28, 32, 37, 38, 39, 40, 41}; + + for (int i : indicies) { + GuiItem craftingTable = new GuiItem(Material.CRAFTING_TABLE, i, gui); + craftingTable.setName(ChatColor.WHITE.toString()); + gui.addItem(craftingTable); + } + + //Connectors + GuiItem connector = new GuiItem(Material.GLASS_PANE, 24, gui); + connector.setName(ChatColor.WHITE.toString()); + gui.addItem(connector); + + //Crafting Inputs and Output + Integer[] recipeIndices = {11, 12, 13, 20, 21, 22, 29, 30, 31}; + for (int i = 0; i < 9; i++) { + if (recipe.get(i) != null && recipe.get(i) != Material.AIR) { + GuiItem recipePart = new GuiItem(recipe.get(i), recipeIndices[i], gui); + gui.addItem(recipePart); + } + } + GuiItem outputItem = new GuiItem(output, 25, gui); + gui.addItem(outputItem); + + //Sets all the items into the gui (This is redundant, but makes the code a bit clearer) + gui.setGui(); + + //Put the items in the inventory + gui.displayGuiForPlayer(); + } - //addMultiplier - else if (args[0].equalsIgnoreCase("addMultiplier") || args[0].equalsIgnoreCase("changeMultiplier")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg addMultiplier [::playerName::] [::expIncrease::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,3,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPermissionName("setMultiplier"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player target; - String multiplierInput; - if (args.length == 2) { - if (sender instanceof Player) { - target = (Player) sender; - multiplierInput = args[1]; - } else { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper Arguments - } - } else { - String playerName = args[1]; - multiplierInput = args[2]; - - //Target Online Check - target = plugin.getServer().getPlayer(playerName); - boolean targetOnline = isTargetOnline(target,sender); - if (!targetOnline) { - return true; //Target not online - } - } + //MainGUI + else if (args[0].equalsIgnoreCase("mainGUI") || args[0].equalsIgnoreCase("skills")) { + if (sender instanceof Player) { + Player p = (Player) sender; + p.performCommand("frpg"); + } else { + FreeRPG.log(Level.WARN, "You must be a player to perform this command"); + } + } - double multiplier = getArgumentAsDouble(multiplierInput); - if (multiplier == Double.MAX_VALUE) { - commandHelper.sendImproperArgumentsMessage(); - return true; //Improper argument (amount not integer) - } - ChangeStats setMultiplier = new ChangeStats(target); - setMultiplier.changeStat("global",23,multiplier); - } + /* + This next conditional is the biggest by far + It handles all the skill tree GUIs, which are the most adaptable with the most unique buttons + */ - //flamePickToggle - else if (args[0].equalsIgnoreCase("toggleFlamePick") || args[0].equalsIgnoreCase("flamePickToggle")) { - return togglePerk("flamePickToggle",sender,args); - } + //SkillTreeGUI + else if (args[0].equalsIgnoreCase("skillTree") || args[0].equalsIgnoreCase("skillTreeGUI")) { + final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg skillTree [::skillName::]"; + CommandHelper commandHelper = new CommandHelper(sender, args, 2, IMPROPER_ARGUMENTS_MESSSAGE); + commandHelper.setPlayerOnlyCommand(true); + commandHelper.setCheckInBed(true); + commandHelper.setPermissionName("skillsGUI"); + if (!commandHelper.isProperCommand()) { + return true; //Command Restricted or Improper + } + + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStatAll = pStatClass.getPlayerData(); + ConfigLoad configLoad = new ConfigLoad(); + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + + String[] titles_0 = {"Digging", "Woodcutting", "Mining", "Farming", "Fishing", "Archery", + "Beast Mastery", "Swordsmanship", "Defense", "Axe Mastery", "Repair", "Agility", + "Alchemy", "Smelting", "Enchanting", "Global"}; + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting", "global"}; + List labels_arr = Arrays.asList(labels_0); + String skillName = UtilityMethods.convertStringToListCasing(labels_arr, args[1]); + + if (!labels_arr.contains(skillName)) { + commandHelper.sendImproperArgumentsMessage(); + return true; + } + String skillTitle = titles_0[labels_arr.indexOf(skillName)]; - //flintToggle - else if (args[0].equalsIgnoreCase("toggleFlint") || args[0].equalsIgnoreCase("flintToggle")) { - return togglePerk("flintToggle",sender,args); - } + if (!configLoad.getAllowedSkillsMap() + .get(skillName)) { //Special condition to return (skill disabled) + p.sendMessage(ChatColor.RED + lang.getString("disabledSkill")); + return true; + } - //grappleToggle - else if (args[0].equalsIgnoreCase("toggleGrapple") || args[0].equalsIgnoreCase("grappleToggle")) { - return togglePerk("grappleToggle",sender,args); - } + ArrayList soulsInfo = configLoad.getSoulsInfo(); + String refundCost = Integer.toString(soulsInfo.get(1)); - //HotRodToggle - else if (args[0].equalsIgnoreCase("toggleHotRod") || args[0].equalsIgnoreCase("hotRodToggle")) { - return togglePerk("hotRodToggle",sender,args); - } + Map perksMap = stringsAndOtherData.getPerksMap(); + Map descriptionsMap = stringsAndOtherData.getDescriptionsMap(); + Map passivePerksMap = stringsAndOtherData.getPassivePerksMap(); + Map passiveDescriptionsMap = stringsAndOtherData.getPassiveDescriptionsMap(); + setTranslatedSkillTreeInformation(p, skillName, perksMap, descriptionsMap, passivePerksMap, + passiveDescriptionsMap); - //MegaDigToggle - else if (args[0].equalsIgnoreCase("toggleMegaDig") || args[0].equalsIgnoreCase("megaDigToggle")) { - return togglePerk("megaDigToggle",sender,args); - } + //Create Gui + //GuiWrapper gui = new GuiWrapper(p,Bukkit.createInventory(p, 54,skillTitle)); + Inventory gui = Bukkit.createInventory(p, 54, skillTitle); - //PotionToggle - else if (args[0].equalsIgnoreCase("togglePotion") || args[0].equalsIgnoreCase("potionToggle")) { - return togglePerk("potionToggle",sender,args); - } + if (labels_arr.indexOf(skillName) < 10) { //One of the 10 "main" skills - //SpeedToggle - else if (args[0].equalsIgnoreCase("toggleSpeed") || args[0].equalsIgnoreCase("speedToggle")) { - return togglePerk("speedToggle",sender,args); - } + //Sets colors of the skill icons to indicate whether the perk is locked/unlocked/in progress/completed + //setSkillTreeProgressMainSkill(p,skillName,gui); - //VeinMinerToggle - else if (args[0].equalsIgnoreCase("toggleVeinMiner") || args[0].equalsIgnoreCase("veinMinerToggle")) { - return togglePerk("veinMinerToggle",sender,args); - } + ArrayList pStats = pStatAll.get(skillName); + int skill_1a_level = (Integer) pStats.get(7); + int skill_1b_level = (Integer) pStats.get(8); + int skill_2a_level = (Integer) pStats.get(9); + int skill_2b_level = (Integer) pStats.get(10); + int skill_3a_level = (Integer) pStats.get(11); + int skill_3b_level = (Integer) pStats.get(12); + int skill_M_level = (Integer) pStats.get(13); + + int tokens_P = (Integer) pStats.get(2); + int tokens_S = (Integer) pStats.get(3); + Number passive1 = pStats.get(4); + Number passive2 = pStats.get(5); + Number passive3 = pStats.get(6); + + ItemStack skill_1a = new ItemStack(Material.PINK_TERRACOTTA); + ItemStack skill_2a = new ItemStack(Material.RED_TERRACOTTA); + ItemStack skill_3a = new ItemStack(Material.RED_TERRACOTTA); + ItemStack skill_1b = new ItemStack(Material.PINK_TERRACOTTA); + ItemStack skill_2b = new ItemStack(Material.RED_TERRACOTTA); + ItemStack skill_3b = new ItemStack(Material.RED_TERRACOTTA); + ItemStack skill_M = new ItemStack(Material.RED_TERRACOTTA); - //LeafBlowerToggle - else if (args[0].equalsIgnoreCase("toggleLeafBlower") || args[0].equalsIgnoreCase("leafBlowerToggle")) { - return togglePerk("leafBlowerToggle",sender,args); + if (skill_1a_level == 0) { + skill_1a.setType(Material.PINK_TERRACOTTA); + } else if (skill_1a_level > 0 && skill_1a_level < 5) { + skill_1a.setType(Material.YELLOW_TERRACOTTA); + } else { + skill_1a.setType(Material.GREEN_TERRACOTTA); } - //holyAxeToggle - else if (args[0].equalsIgnoreCase("toggleHolyAxe") || args[0].equalsIgnoreCase("holyAxeToggle")) { - return togglePerk("holyAxeToggle",sender,args); + if (skill_1b_level == 0) { + skill_1b.setType(Material.PINK_TERRACOTTA); + } else if (skill_1b_level > 0 && skill_1b_level < 5) { + skill_1b.setType(Material.YELLOW_TERRACOTTA); + } else { + skill_1b.setType(Material.GREEN_TERRACOTTA); } - //ConfigGUI - else if (args[0].equalsIgnoreCase("configGUI") || args[0].equalsIgnoreCase("configurationGUI")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg configGUI"; - CommandHelper commandHelper = new CommandHelper(sender,args,1,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPlayerOnlyCommand(true); - commandHelper.setCheckInBed(true); - commandHelper.setPermissionName("configGUI"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - - //GuiWrapper - GuiWrapper gui = new GuiWrapper(p,"Configuration Window",54); - - //Back button - GuiItem backButton = new GuiItem(Material.ARROW,45,gui); - backButton.setName(lang.getString("diggingPassiveTitle1")); - backButton.setDescription(lang.getString("diggingPassiveDesc1")); - gui.addItem(backButton); - - //Simple Toggle Buttons - addToggleButton(p,gui,"::levelUpNotif::",Material.OAK_SIGN,1,21); //Level up Notifications - addToggleButton(p,gui,"::abilityPreparationNotif::",Material.OAK_SIGN,2,22); //Ability Prep Notifications - addToggleButton(p,gui,"::triggerAbilities::",Material.WOODEN_PICKAXE,3,24); //Ability Trigger - addToggleButton(p,gui,"::showEXPBar::",Material.EXPERIENCE_BOTTLE,4,25); //EXP bar show - - //Ability Duration Bar - GuiItem durationBar = new GuiItem(Material.CLOCK,5,gui); - durationBar.setName(lang.getString("numberOfAbilityTimersDisplayed")); - gui.addItem(durationBar); - - GuiItem durationBarToggle = new GuiItem(Material.LIME_DYE,14,gui); - int numberOfBars = (int) pStat.get("global").get(28); - if (numberOfBars > 0) { - durationBarToggle.setNameColor(ChatColor.BOLD + ChatColor.GREEN.toString()); - durationBarToggle.setName(String.valueOf(numberOfBars)); - } - else { - durationBarToggle.setNameColor(ChatColor.BOLD + ChatColor.RED.toString()); - durationBarToggle.setName(String.valueOf(0)); - durationBarToggle.setItemType(Material.GRAY_DYE); - } - durationBarToggle.setItemAmount(Math.max(1,numberOfBars)); - gui.addItem(durationBarToggle); - - //Sets all the items into the gui (This is redundant, but makes the code a bit clearer) - gui.setGui(); - - //LANGUAGES (sets all the language items into the gui) - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - stringsAndOtherData.setLanguageItems(p,gui.getGui()); - - //Put the items in the inventory - gui.displayGuiForPlayer(); + if (skill_2a_level == 0) { + if (skill_1a_level >= 2) { + skill_2a.setType(Material.PINK_TERRACOTTA); + } + } else if (skill_2a_level > 0 && skill_2a_level < 5) { + skill_2a.setType(Material.YELLOW_TERRACOTTA); + } else { + skill_2a.setType(Material.GREEN_TERRACOTTA); } - //SkillConfigGUI - else if (args[0].equalsIgnoreCase("skillConfigGUI") || args[0].equalsIgnoreCase("skillConfigurationGUI") || args[0].equalsIgnoreCase("skillConfig")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg skillConfigGUI [::skillName::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPlayerOnlyCommand(true); - commandHelper.setCheckInBed(true); - commandHelper.setPermissionName("skillConfigGUI"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - PlayerStats pStatClass = new PlayerStats(p); - ConfigLoad configLoad = new ConfigLoad(); - - String[] titles_0 = {"Digging","Woodcutting","Mining","Farming","Fishing","Archery","Beast Mastery","Swordsmanship","Defense","Axe Mastery","Repair","Agility","Alchemy","Smelting","Enchanting"}; - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - String[] passiveLabels0 = {"repair","agility","alchemy","smelting","enchanting"}; - List labels = Arrays.asList(labels_0); - List passiveLabels = Arrays.asList(passiveLabels0); - String skillName = UtilityMethods.convertStringToListCasing(labels,args[1]); - if (!labels.contains(skillName) ) { - commandHelper.sendImproperArgumentsMessage(); - return true; - } - - String skillTitle = titles_0[labels.indexOf(skillName)]; - GuiWrapper gui = new GuiWrapper(p,Bukkit.createInventory(p, 54, skillTitle + " Configuration")); - - addToggleButton(p,gui,"::showEXPBar::",Material.EXPERIENCE_BOTTLE,10,pStatClass.isPlayerSkillExpBarOn(skillName)); //EXP bar show - if (!passiveLabels.contains(skillName)) { - addToggleButton(p,gui,"::triggerAbilities::",Material.WOODEN_PICKAXE,11,pStatClass.isPlayerSkillAbilityOn(skillName)); //Trigger Abilities - } - - if (!configLoad.getAllowedSkillsMap().get(skillName)) { //Special condition to return (skill disabled) - p.sendMessage(ChatColor.RED + lang.getString("disabledSkill")); - return true; - } - - //Back button - GuiItem backButton = new GuiItem(Material.ARROW,45,gui); - backButton.setName(lang.getString("diggingPassiveTitle1")); - backButton.setDescription(lang.getString("diggingPassiveDesc1")); - gui.addItem(backButton); - - GuiItem skillIcon = new GuiItem(Material.WOODEN_PICKAXE,4,gui); - skillIcon.setNameColor(ChatColor.AQUA.toString() + ChatColor.BOLD.toString()); - skillIcon.setName(lang.getString(skillName)); - - switch (skillName) { - case "digging": - skillIcon.setItemType(Material.IRON_SHOVEL); - //flintFinder - togglePerkSetGuiItem("flintToggle",p,gui); - - //Mega Dig - togglePerkSetGuiItem("megaDigToggle",p,gui); - break; - case "woodcutting": - skillIcon.setItemType(Material.IRON_AXE); - - //leafBlower - togglePerkSetGuiItem("leafBlowerToggle",p,gui); - break; - case "mining": - skillIcon.setItemType(Material.IRON_PICKAXE); - - //veinMiner - togglePerkSetGuiItem("veinMinerToggle",p,gui); - - break; - case "farming": - skillIcon.setItemType(Material.IRON_HOE); - break; - case "fishing": - skillIcon.setItemType(Material.FISHING_ROD); - - //grappling Hook - togglePerkSetGuiItem("grappleToggle",p,gui); - - //hot Rod - togglePerkSetGuiItem("hotRodToggle",p,gui); - break; - case "archery": - skillIcon.setItemType(Material.BOW); - break; - case "beastMastery": - skillIcon.setItemType(Material.BONE); - break; - case "swordsmanship": - skillIcon.setItemType(Material.IRON_SWORD); - break; - case "defense": - skillIcon.setItemType(Material.IRON_CHESTPLATE); - break; - case "axeMastery": - skillIcon.setItemType(Material.GOLDEN_AXE); - - //Holy Axe - togglePerkSetGuiItem("holyAxeToggle",p,gui); - break; - case "repair": - skillIcon.setItemType(Material.ANVIL); - break; - case "agility": - skillIcon.setItemType(Material.LEATHER_LEGGINGS); - - //gracefulFeet - togglePerkSetGuiItem("speedToggle",p,gui); - - break; - case "alchemy": - skillIcon.setItemType(Material.POTION); - - //potionMaster - togglePerkSetGuiItem("potionToggle",p,gui); - break; - case "smelting": - skillIcon.setItemType(Material.COAL); - - //flamePick - togglePerkSetGuiItem("flamePickToggle",p,gui); - break; - case "enchanting": - skillIcon.setItemType(Material.ENCHANTING_TABLE); - break; - default: - break; - - } - gui.addItem(skillIcon); - - //Sets all the items into the gui (This is redundant, but makes the code a bit clearer) - gui.setGui(); - - //Put the items in the inventory - gui.displayGuiForPlayer(); + if (skill_2b_level == 0) { + if (skill_1b_level >= 2) { + skill_2b.setType(Material.PINK_TERRACOTTA); + } + } else if (skill_2b_level > 0 && skill_2b_level < 5) { + skill_2b.setType(Material.YELLOW_TERRACOTTA); + } else { + skill_2b.setType(Material.GREEN_TERRACOTTA); } - //ConfirmationGUI - else if (args[0].equalsIgnoreCase("confirmGUI") || args[0].equalsIgnoreCase("confirmationGUI")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg confirmationGUI [::skillName::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPlayerOnlyCommand(true); - commandHelper.setCheckInBed(true); - commandHelper.setPermissionName("confirmGUI"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting","global"}; - String[] titles_0 = {lang.getString("digging"),lang.getString("woodcutting"),lang.getString("mining"),lang.getString("farming"),lang.getString("fishing"),lang.getString("archery"),lang.getString("beastMastery"),lang.getString("swordsmanship"),lang.getString("defense"),lang.getString("axeMastery"),lang.getString("repair"),lang.getString("agility"),lang.getString("alchemy"),lang.getString("smelting"),lang.getString("enchanting"),lang.getString("global")}; - List labels = Arrays.asList(labels_0); - String skillName = UtilityMethods.convertStringToListCasing(labels,args[1]); - if (!labels.contains(skillName) ) { - commandHelper.sendImproperArgumentsMessage(); - return true; - } - String skillTitle = titles_0[labels.indexOf(skillName)]; - GuiWrapper gui = new GuiWrapper(p,Bukkit.createInventory(p, 54, "Confirmation Window")); - - //Load souls data - ConfigLoad loadConfig = new ConfigLoad(); - ArrayList soulsInfo = loadConfig.getSoulsInfo(); - String refundCost = Integer.toString(soulsInfo.get(1)); - - //Information - GuiItem info = new GuiItem(Material.PAPER,22,gui); - info.setNameColor(ChatColor.YELLOW.toString() + ChatColor.BOLD.toString()); - info.setName(lang.getString("warning")); - //The following is pretty messy, but it's all just to format a long strong - String partOne = lang.getString("refundSkillTree0") + " " + refundCost + " " + lang.getString("souls") + " " + lang.getString("refundSkillTree1"); - String partTwo = lang.getString("refundSkillTree2") + " " + ChatColor.WHITE.toString() + - skillTitle + ChatColor.RESET.toString() + ChatColor.ITALIC.toString() + ChatColor.GRAY.toString()+ " " +lang.getString("skill") +"?"; - String refundWarningMessage = partOne + " " + partTwo; - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - for (String line : stringsAndOtherData.getStringLines(refundWarningMessage)) { - info.addSpecialLoreLine(ChatColor.ITALIC+ChatColor.GRAY.toString() + line); - } - gui.addItem(info); - - //Yes Button - GuiItem yes = new GuiItem(Material.LIME_TERRACOTTA,38,gui); - yes.setNameColor(ChatColor.GREEN.toString() + ChatColor.BOLD.toString()); - yes.setName(lang.getString("yes0")); - gui.addItem(yes); - - //No Button - GuiItem no = new GuiItem(Material.RED_TERRACOTTA,42,gui); - no.setNameColor(ChatColor.RED.toString() + ChatColor.BOLD.toString()); - no.setName(lang.getString("no0")); - gui.addItem(no); - - //Skill Item (Indicator) - GuiItem skillIcon = new GuiItem(Material.IRON_SHOVEL,4,gui); - switch (skillName) { - case "digging": - skillIcon.setItemType(Material.IRON_SHOVEL); - break; - case "woodcutting": - skillIcon.setItemType(Material.IRON_AXE); - break; - case "mining": - skillIcon.setItemType(Material.IRON_PICKAXE); - break; - case "farming": - skillIcon.setItemType(Material.IRON_HOE); - break; - case "fishing": - skillIcon.setItemType(Material.FISHING_ROD); - break; - case "archery": - skillIcon.setItemType(Material.BOW); - break; - case "beastMastery": - skillIcon.setItemType(Material.BONE); - break; - case "swordsmanship": - skillIcon.setItemType(Material.IRON_SWORD); - break; - case "defense": - skillIcon.setItemType(Material.IRON_CHESTPLATE); - break; - case "axeMastery": - skillIcon.setItemType(Material.GOLDEN_AXE); - break; - case "repair": - skillIcon.setItemType(Material.ANVIL); - break; - case "agility": - skillIcon.setItemType(Material.LEATHER_LEGGINGS); - break; - case "alchemy": - skillIcon.setItemType(Material.POTION); - break; - case "smelting": - skillIcon.setItemType(Material.COAL); - break; - case "enchanting": - skillIcon.setItemType(Material.ENCHANTING_TABLE); - break; - default: - break; - } - skillIcon.setNameColor(ChatColor.AQUA.toString() + ChatColor.BOLD.toString()); - skillIcon.setName(skillTitle); - gui.addItem(skillIcon); - - //Sets all the items into the gui (This is redundant, but makes the code a bit clearer) - gui.setGui(); - - //Put the items in the inventory - gui.displayGuiForPlayer(); - } - - //CraftingGUI - else if (args[0].equalsIgnoreCase("craftingGUI") || args[0].equalsIgnoreCase("recipeGUI")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg craftingRecipe [::skillName::[#]]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPlayerOnlyCommand(true); - commandHelper.setCheckInBed(true); - commandHelper.setPermissionName("craftGUI"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - String[] labels_0 = {"archery1", "farming1", "farming2", "farming3", "farming4", "farming5", - "enchanting1", "enchanting2", "enchanting3", "enchanting4", "enchanting5", - "enchanting6", "enchanting7", "enchanting8", "enchanting9", "enchanting10", - "alchemy1","alchemy2","alchemy3","alchemy4","alchemy5"}; - List labels = Arrays.asList(labels_0); - String identifier = UtilityMethods.convertStringToListCasing(labels,args[1]); - if (!labels.contains(identifier) ) { - commandHelper.sendImproperArgumentsMessage(); - return true; - } - - ConfigLoad configLoad = new ConfigLoad(); - Map craftingRecipes = configLoad.getCraftingRecipes(); - ArrayList recipe; - ItemStack output; - if (identifier.equalsIgnoreCase("archery1")) { - CraftingRecipes craftingRecipesClass = new CraftingRecipes(); - recipe = craftingRecipesClass.getTippedArrowRecipe(); - output = new ItemStack(Material.TIPPED_ARROW, 8); - } else { - recipe = craftingRecipes.get(identifier).getRecipe(); - output = craftingRecipes.get(identifier).getItemStack(); - } - - - GuiWrapper gui = new GuiWrapper(p,Bukkit.createInventory(p, 54, "Crafting Recipe")); - - //Back button - GuiItem backButton = new GuiItem(Material.ARROW,45,gui); - backButton.setName(lang.getString("diggingPassiveTitle1")); - backButton.setDescription(lang.getString("diggingPassiveDesc1")); - gui.addItem(backButton); - - //Crafting Tables - Integer[] indicies = {1,2,3,4,5,10,14,19,23,28,32,37,38,39,40,41}; - - for (int i : indicies) { - GuiItem craftingTable = new GuiItem(Material.CRAFTING_TABLE,i,gui); - craftingTable.setName(ChatColor.WHITE.toString()); - gui.addItem(craftingTable); - } - - //Connectors - GuiItem connector = new GuiItem(Material.GLASS_PANE,24,gui); - connector.setName(ChatColor.WHITE.toString()); - gui.addItem(connector); - - //Crafting Inputs and Output - Integer[] recipeIndices = {11,12,13,20,21,22,29,30,31}; - for (int i=0; i <9; i++) { - if (recipe.get(i) != null && recipe.get(i) != Material.AIR) { - GuiItem recipePart = new GuiItem(recipe.get(i), recipeIndices[i], gui); - gui.addItem(recipePart); - } - } - GuiItem outputItem = new GuiItem(output,25,gui); - gui.addItem(outputItem); - - - //Sets all the items into the gui (This is redundant, but makes the code a bit clearer) - gui.setGui(); - - //Put the items in the inventory - gui.displayGuiForPlayer(); + if (skill_3a_level == 0) { + if (skill_2a_level >= 2) { + skill_3a.setType(Material.PINK_TERRACOTTA); + } + } else { + skill_3a.setType(Material.GREEN_TERRACOTTA); } - //MainGUI - else if (args[0].equalsIgnoreCase("mainGUI") || args[0].equalsIgnoreCase("skills")) { - if (sender instanceof Player) { - Player p = (Player) sender; - p.performCommand("frpg"); - } - else { - System.out.println("You must be a player to perform this command"); - } + if (skill_3b_level == 0) { + if (skill_2b_level >= 2) { + skill_3b.setType(Material.PINK_TERRACOTTA); + } + } else { + skill_3b.setType(Material.GREEN_TERRACOTTA); } - - - /* - This next conditional is the biggest by far - It handles all the skill tree GUIs, which are the most adaptable with the most unique buttons - */ - - - //SkillTreeGUI - else if (args[0].equalsIgnoreCase("skillTree") || args[0].equalsIgnoreCase("skillTreeGUI")) { - final String IMPROPER_ARGUMENTS_MESSSAGE = " /frpg skillTree [::skillName::]"; - CommandHelper commandHelper = new CommandHelper(sender,args,2,IMPROPER_ARGUMENTS_MESSSAGE); - commandHelper.setPlayerOnlyCommand(true); - commandHelper.setCheckInBed(true); - commandHelper.setPermissionName("skillsGUI"); - if (!commandHelper.isProperCommand()) { - return true; //Command Restricted or Improper - } - - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStatAll = pStatClass.getPlayerData(); - ConfigLoad configLoad = new ConfigLoad(); - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - - - String[] titles_0 = {"Digging","Woodcutting","Mining","Farming","Fishing","Archery","Beast Mastery","Swordsmanship","Defense","Axe Mastery","Repair","Agility","Alchemy","Smelting","Enchanting","Global"}; - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting","global"}; - List labels_arr = Arrays.asList(labels_0); - String skillName = UtilityMethods.convertStringToListCasing(labels_arr,args[1]); - - - if (!labels_arr.contains(skillName) ) { - commandHelper.sendImproperArgumentsMessage(); - return true; - } - String skillTitle = titles_0[labels_arr.indexOf(skillName)]; - - if (!configLoad.getAllowedSkillsMap().get(skillName)) { //Special condition to return (skill disabled) - p.sendMessage(ChatColor.RED + lang.getString("disabledSkill")); - return true; + if (skill_M_level == 0) { + if (skill_1a_level + skill_1b_level + skill_2a_level + skill_2b_level + skill_3a_level + + skill_3b_level >= 10) { + skill_M.setType(Material.PINK_TERRACOTTA); + } + } else { + skill_M.setType(Material.GREEN_TERRACOTTA); + } + + //Beginning state of the menu + ItemStack[] menu_items = {skill_1a, skill_1b, skill_2a, skill_2b, skill_3a, skill_3b, + skill_M}; + String[] labels = perksMap.get(skillName); + String[] lores_line2 = descriptionsMap.get(skillName); + + //Initialize some varibales for use + String desc = ""; + Map customRecipeMap = configLoad.getCraftingRecipes(); + + //Make changes to some skills independent of level + if (skillName.equalsIgnoreCase("woodcutting")) { + ArrayList timberBreakLimits = configLoad.getTimberBreakLimits(); + String timberBreakLimitInitial = String.valueOf(timberBreakLimits.get(0)); + String timberBreakLimitUpgraded = String.valueOf(timberBreakLimits.get(1)); + String newLore0 = stringsAndOtherData.replaceIfPresent(lores_line2[4], "64", + timberBreakLimitInitial); + String newLore1 = stringsAndOtherData.replaceIfPresent(newLore0, "128", + timberBreakLimitUpgraded); + lores_line2[4] = newLore1; + } + + int special_index = 0; + switch (skillName) { + case "mining": + special_index = 0; + switch (skill_1a_level) { + case 0: + desc = lang.getString("miningPerkDesc0_1"); + lores_line2[special_index] = desc; + break; + case 1: + desc = lang.getString("miningPerkDesc0_2"); + lores_line2[special_index] = desc; + break; + case 2: + desc = lang.getString("miningPerkDesc0_3"); + lores_line2[special_index] = desc; + break; + case 3: + desc = lang.getString("miningPerkDesc0_4"); + lores_line2[special_index] = desc; + break; + case 4: + desc = lang.getString("miningPerkDesc0_5"); + lores_line2[special_index] = desc; + break; + default: + break; } - - ArrayList soulsInfo = configLoad.getSoulsInfo(); - String refundCost = Integer.toString(soulsInfo.get(1)); - - Map perksMap = stringsAndOtherData.getPerksMap(); - Map descriptionsMap = stringsAndOtherData.getDescriptionsMap(); - Map passivePerksMap = stringsAndOtherData.getPassivePerksMap(); - Map passiveDescriptionsMap = stringsAndOtherData.getPassiveDescriptionsMap(); - setTranslatedSkillTreeInformation(p,skillName,perksMap,descriptionsMap,passivePerksMap,passiveDescriptionsMap); - - //Create Gui - //GuiWrapper gui = new GuiWrapper(p,Bukkit.createInventory(p, 54,skillTitle)); - Inventory gui = Bukkit.createInventory(p, 54,skillTitle); - - if (labels_arr.indexOf(skillName) < 10) { //One of the 10 "main" skills - - //Sets colors of the skill icons to indicate whether the perk is locked/unlocked/in progress/completed - //setSkillTreeProgressMainSkill(p,skillName,gui); - - ArrayList pStats = pStatAll.get(skillName); - int skill_1a_level = (Integer) pStats.get(7); - int skill_1b_level = (Integer) pStats.get(8); - int skill_2a_level = (Integer) pStats.get(9); - int skill_2b_level = (Integer) pStats.get(10); - int skill_3a_level = (Integer) pStats.get(11); - int skill_3b_level = (Integer) pStats.get(12); - int skill_M_level = (Integer) pStats.get(13); - - int tokens_P = (Integer) pStats.get(2); - int tokens_S = (Integer) pStats.get(3); - Number passive1 = pStats.get(4); - Number passive2 = pStats.get(5); - Number passive3 = pStats.get(6); - - ItemStack skill_1a = new ItemStack(Material.PINK_TERRACOTTA); - ItemStack skill_2a = new ItemStack(Material.RED_TERRACOTTA); - ItemStack skill_3a = new ItemStack(Material.RED_TERRACOTTA); - ItemStack skill_1b = new ItemStack(Material.PINK_TERRACOTTA); - ItemStack skill_2b = new ItemStack(Material.RED_TERRACOTTA); - ItemStack skill_3b = new ItemStack(Material.RED_TERRACOTTA); - ItemStack skill_M = new ItemStack(Material.RED_TERRACOTTA); - - if (skill_1a_level == 0) { - skill_1a.setType(Material.PINK_TERRACOTTA); - } - else if (skill_1a_level > 0 && skill_1a_level < 5) { - skill_1a.setType(Material.YELLOW_TERRACOTTA); - } - else { - skill_1a.setType(Material.GREEN_TERRACOTTA); - } - - - if (skill_1b_level == 0) { - skill_1b.setType(Material.PINK_TERRACOTTA); - } - else if (skill_1b_level > 0 && skill_1b_level < 5) { - skill_1b.setType(Material.YELLOW_TERRACOTTA); - } - else { - skill_1b.setType(Material.GREEN_TERRACOTTA); - } - - - if (skill_2a_level == 0) { - if (skill_1a_level >= 2) { - skill_2a.setType(Material.PINK_TERRACOTTA); - } - } - else if (skill_2a_level > 0 && skill_2a_level < 5) { - skill_2a.setType(Material.YELLOW_TERRACOTTA); - } - else { - skill_2a.setType(Material.GREEN_TERRACOTTA); - } - - - if (skill_2b_level == 0) { - if (skill_1b_level >= 2) { - skill_2b.setType(Material.PINK_TERRACOTTA); - } - } - else if (skill_2b_level > 0 && skill_2b_level < 5) { - skill_2b.setType(Material.YELLOW_TERRACOTTA); - } - else { - skill_2b.setType(Material.GREEN_TERRACOTTA); - } - - - if (skill_3a_level == 0) { - if (skill_2a_level >= 2) { - skill_3a.setType(Material.PINK_TERRACOTTA); - } - } - else { - skill_3a.setType(Material.GREEN_TERRACOTTA); - } - - - if (skill_3b_level == 0) { - if (skill_2b_level >= 2) { - skill_3b.setType(Material.PINK_TERRACOTTA); - } - } - else { - skill_3b.setType(Material.GREEN_TERRACOTTA); - } - - if (skill_M_level == 0) { - if (skill_1a_level+skill_1b_level+skill_2a_level+skill_2b_level+skill_3a_level+skill_3b_level >=10) { - skill_M.setType(Material.PINK_TERRACOTTA); - } - } - else { - skill_M.setType(Material.GREEN_TERRACOTTA); - } - - //Beginning state of the menu - ItemStack[] menu_items = {skill_1a,skill_1b,skill_2a,skill_2b,skill_3a,skill_3b,skill_M}; - String[] labels = perksMap.get(skillName); - String[] lores_line2 = descriptionsMap.get(skillName); - - //Initialize some varibales for use - String desc = ""; - Map customRecipeMap = configLoad.getCraftingRecipes(); - - //Make changes to some skills independent of level - if (skillName.equalsIgnoreCase("woodcutting")) { - ArrayList timberBreakLimits = configLoad.getTimberBreakLimits(); - String timberBreakLimitInitial = String.valueOf(timberBreakLimits.get(0)); - String timberBreakLimitUpgraded = String.valueOf(timberBreakLimits.get(1)); - String newLore0 = stringsAndOtherData.replaceIfPresent(lores_line2[4],"64",timberBreakLimitInitial); - String newLore1 = stringsAndOtherData.replaceIfPresent(newLore0,"128",timberBreakLimitUpgraded); - lores_line2[4] = newLore1; - } - - int special_index = 0; - switch (skillName){ - case "mining": - special_index = 0; - switch (skill_1a_level) { - case 0: - desc = lang.getString("miningPerkDesc0_1"); - lores_line2[special_index] = desc; - break; - case 1: - desc = lang.getString("miningPerkDesc0_2"); - lores_line2[special_index] = desc; - break; - case 2: - desc = lang.getString("miningPerkDesc0_3"); - lores_line2[special_index] = desc; - break; - case 3: - desc = lang.getString("miningPerkDesc0_4"); - lores_line2[special_index] = desc; - break; - case 4: - desc = lang.getString("miningPerkDesc0_5"); - lores_line2[special_index] = desc; - break; - default: - break; - } - break; - case "woodcutting": - special_index = 3; - desc = lang.getString("woodcuttingPerkDesc3_1") + " "; - ArrayList woodcuttingInfo = configLoad.getWoodcuttingInfo(); - switch (skill_2b_level) { - case 0: - Material mat0 = (Material) woodcuttingInfo.get(0); - String itemName0 = ""; - if (mat0 != null) { - itemName0 = mat0.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName0 = "feather"; - } - desc += itemName0; - lores_line2[special_index] = desc; - break; - case 1: - Material mat1 = (Material) woodcuttingInfo.get(3); - String itemName1 = ""; - if (mat1 != null) { - itemName1 = mat1.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName1 = "gold nugget"; - } - desc += itemName1; - lores_line2[special_index] = desc; - break; - case 2: - Material mat2 = (Material) woodcuttingInfo.get(6); - String itemName2 = ""; - if (mat2 != null) { - itemName2 = mat2.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName2 = "golden apple"; - } - desc += itemName2; - lores_line2[special_index] = desc; - break; - case 3: - Material mat3 = (Material) woodcuttingInfo.get(9); - String itemName3 = ""; - if (mat3 != null) { - itemName3 = mat3.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName3 = "experience bottle"; - } - desc += itemName3; - lores_line2[special_index] = desc; - break; - case 4: - Material mat4 = (Material) woodcuttingInfo.get(12); - String itemName4 = ""; - if (mat4 != null) { - itemName4 = mat4.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName4 = "enchanted golden apple"; - } - desc += itemName4; - lores_line2[special_index] = desc; - break; - default: - break; - } - break; - case "fishing": - special_index = 1; - desc = lang.getString("fishingPerkDesc1_1") + " "; - switch (skill_1b_level) { - case 0: - desc += "I ("+lang.getString("common") +")"; - lores_line2[special_index] = desc; - break; - case 1: - desc += "II ("+lang.getString("uncommon") +")"; - lores_line2[special_index] = desc; - break; - case 2: - desc += "III ("+lang.getString("rare") +")"; - lores_line2[special_index] = desc; - break; - case 3: - desc += "IV ("+lang.getString("veryRare") +")"; - lores_line2[special_index] = desc; - break; - case 4: - desc += "V ("+lang.getString("legendary") +")"; - lores_line2[special_index] = desc; - break; - default: - break; - } - break; - case "farming": - special_index = 1; - desc = lang.getString("farmingPerkDesc1_1") + " "; - switch (skill_1b_level) { - case 0: - Material output1 = customRecipeMap.get("farming"+1).getOutput(); - if (output1.equals(Material.COW_SPAWN_EGG)) { - desc += lang.getString("cowSpawnEgg"); - } - else { - desc += stringsAndOtherData.cleanUpTitleString(output1.toString()); - } - lores_line2[special_index] = desc; - break; - case 1: - Material output2 = customRecipeMap.get("farming"+2).getOutput(); - if (output2.equals(Material.BEE_SPAWN_EGG)) { - desc += lang.getString("beeSpawnEgg"); - } - else { - desc += stringsAndOtherData.cleanUpTitleString(output2.toString()); - } - lores_line2[special_index] = desc; - break; - case 2: - Material output3 = customRecipeMap.get("farming"+3).getOutput(); - if (output3.equals(Material.MOOSHROOM_SPAWN_EGG)) { - desc += lang.getString("mooshroomSpawnEgg"); - } - else { - desc += stringsAndOtherData.cleanUpTitleString(output3.toString()); - } - lores_line2[special_index] = desc; - break; - case 3: - Material output4 = customRecipeMap.get("farming"+4).getOutput(); - if (output4.equals(Material.HORSE_SPAWN_EGG)) { - desc += lang.getString("horseSpawnEgg"); - } - else { - desc += stringsAndOtherData.cleanUpTitleString(output4.toString()); - } - lores_line2[special_index] = desc; - break; - case 4: - Material output5 = customRecipeMap.get("farming"+5).getOutput(); - if (output5.equals(Material.SLIME_SPAWN_EGG)) { - desc += lang.getString("slimeSpawnEgg"); - } - else { - desc += stringsAndOtherData.cleanUpTitleString(output5.toString()); - } - lores_line2[special_index] = desc; - break; - default: - break; - } - break; - case "digging": - special_index = 0; - ArrayList diggingInfo = configLoad.getDiggingInfo(); - switch (skill_1a_level) { - case 0: - desc = lang.getString("diggingPerkDesc0_1") + " "; - Material mat0 = (Material) diggingInfo.get(10); - String itemName0 = ""; - if (mat0 != null) { - itemName0 = mat0.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName0 = "gold ingot"; - } - desc += itemName0; - lores_line2[special_index] = desc; - break; - case 1: - desc = lang.getString("diggingPerkDesc0_1")+ " "; - Material mat1 = (Material) diggingInfo.get(12); - String itemName1 = ""; - if (mat1 != null) { - itemName1 = mat1.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName1 = "name tag"; - } - desc += itemName1; - lores_line2[special_index] = desc; - break; - case 2: - desc = lang.getString("diggingPerkDesc0_1")+ " "; - Material mat2 = (Material) diggingInfo.get(14); - String itemName2 = ""; - if (mat2 != null) { - itemName2 = mat2.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName2 = "music discs"; - } - desc += itemName2; - lores_line2[special_index] = desc; - break; - case 3: - desc = lang.getString("diggingPerkDesc0_1")+ " "; - Material mat3 = (Material) diggingInfo.get(16); - String itemName3 = ""; - if (mat3 != null) { - itemName3 = mat3.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName3 = "horse armor"; - } - desc += itemName3; - lores_line2[special_index] = desc; - break; - case 4: - desc = lang.getString("diggingPerkDesc0_1")+ " "; - Material mat4 = (Material) diggingInfo.get(18); - String itemName4 = ""; - if (mat4 != null) { - itemName4 = mat4.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName4 = "diamond"; - } - desc += itemName4; - lores_line2[special_index] = desc; - break; - default: - break; - } - switch (skill_2a_level) { - case 0: - desc = lang.getString("diggingPerkDesc0_1")+ " "; - Material mat5 = (Material) diggingInfo.get(21); - String itemName5 = ""; - if (mat5 != null) { - itemName5 = mat5.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName5 = "emerald"; - } - desc += itemName5; - lores_line2[2] = desc; - break; - case 1: - desc = lang.getString("diggingPerkDesc0_1")+ " "; - Material mat6 = (Material) diggingInfo.get(24); - String itemName6 = ""; - if (mat6 != null) { - itemName6 = mat6.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName6 = "enchanted book"; - } - desc += itemName6; - lores_line2[2] = desc; - break; - case 2: - desc = lang.getString("diggingPerkDesc0_1")+ " "; - Material mat7 = (Material) diggingInfo.get(27); - String itemName7 = ""; - if (mat7 != null) { - itemName7 = mat7.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName7 = "dragon breath"; - } - desc += itemName7; - lores_line2[2] = desc; - break; - case 3: - desc = lang.getString("diggingPerkDesc0_1")+ " "; - Material mat8 = (Material) diggingInfo.get(30); - String itemName8 = ""; - if (mat8 != null) { - itemName8 = mat8.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName8 = "totem of undying"; - } - desc += itemName8; - lores_line2[2] = desc; - break; - case 4: - desc = lang.getString("diggingPerkDesc0_1")+ " "; - Material mat9 = (Material) diggingInfo.get(30); - String itemName9 = ""; - if (mat9 != null) { - itemName9 = mat9.toString().replaceAll("_", " ").toLowerCase(); - } - else { - itemName9 = "nether star"; - } - desc += itemName9; - lores_line2[2] = desc; - break; - default: - break; - } - break; - case "defense": - special_index = 0; - switch (skill_1a_level) { - case 0: - case 2: - case 1: - desc = lang.getString("defensePerkDesc0_1"); - lores_line2[special_index] = desc; - break; - case 3: - case 4: - desc = lang.getString("defensePerkDesc0_2"); - lores_line2[special_index] = desc; - break; - default: - break; - } - break; - default: - break; + break; + case "woodcutting": + special_index = 3; + desc = lang.getString("woodcuttingPerkDesc3_1") + " "; + ArrayList woodcuttingInfo = configLoad.getWoodcuttingInfo(); + switch (skill_2b_level) { + case 0: + Material mat0 = (Material) woodcuttingInfo.get(0); + String itemName0 = ""; + if (mat0 != null) { + itemName0 = mat0.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName0 = "feather"; } - - String[] lores_line1 = {"Level: 0/5","Level: 0/5","Level: 0/5","Level: 0/5","Level: 0/1","Level: 0/1","Level: 0/1"}; //Data lines 7-13 - for (int i = 0; i < 4; i++) { - String level = pStats.get(7+i).toString(); - lores_line1[i] = ChatColor.GRAY +lang.getString("level") +" " + ChatColor.GREEN + level + "/5"; + desc += itemName0; + lores_line2[special_index] = desc; + break; + case 1: + Material mat1 = (Material) woodcuttingInfo.get(3); + String itemName1 = ""; + if (mat1 != null) { + itemName1 = mat1.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName1 = "gold nugget"; } - for (int i = 0; i < 3; i++) { - String level = pStats.get(11+i).toString(); - if (i != 2) { - lores_line1[i + 4] = ChatColor.GRAY + lang.getString("level") +" " + ChatColor.BLUE + level + "/1"; - } - else { - lores_line1[i + 4] = ChatColor.GRAY + lang.getString("level") +" " + ChatColor.DARK_PURPLE + level + "/1"; - } + desc += itemName1; + lores_line2[special_index] = desc; + break; + case 2: + Material mat2 = (Material) woodcuttingInfo.get(6); + String itemName2 = ""; + if (mat2 != null) { + itemName2 = mat2.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName2 = "golden apple"; } - - Integer[] indices = {11,29,13,31,7,43,26}; - // - for (int i = 0; i < labels.length; i++) { - ItemMeta meta = menu_items[i].getItemMeta(); - meta.setDisplayName(ChatColor.BOLD + labels[i]); - ArrayList lore = new ArrayList<>(); - lore.add(lores_line1[i]); - String longString = lores_line2[i]; - ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); - for (int j = 0; j < splitDescs.size(); j++) { - lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); - } - meta.setLore(lore); - menu_items[i].setItemMeta(meta); - gui.setItem(indices[i], menu_items[i]); + desc += itemName2; + lores_line2[special_index] = desc; + break; + case 3: + Material mat3 = (Material) woodcuttingInfo.get(9); + String itemName3 = ""; + if (mat3 != null) { + itemName3 = mat3.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName3 = "experience bottle"; } - //Tokens, passives, and back button - ItemStack passive_token = new ItemStack(Material.IRON_NUGGET); - ItemStack skill_token = new ItemStack(Material.GOLD_NUGGET); - ItemStack passive_1 = new ItemStack(Material.RED_DYE,1); - ItemStack passive_2 = new ItemStack(Material.GREEN_DYE,2); - ItemStack passive_3 = new ItemStack(Material.BLUE_DYE,3); - ItemStack back_button = new ItemStack(Material.ARROW); - - - - ItemStack[] menu_items_2 = {passive_token,back_button,skill_token,passive_1,passive_2,passive_3}; - String[] labels_2 = passivePerksMap.get(skillName); - String[] lores_line1_2 = {"Total: 0","","Total: 0","Duration: 1 s","Percentage: 0%","Percentage: 0%"}; - String[] lores_line2_2 = passiveDescriptionsMap.get(skillName); - - //Total Passive Tokens - lores_line1_2[0] = ChatColor.BLUE + lang.getString("total") +": " + ChatColor.GOLD + String.valueOf(tokens_P); - if (tokens_P > 1 && tokens_P < 64){ - passive_token.setAmount(tokens_P); + desc += itemName3; + lores_line2[special_index] = desc; + break; + case 4: + Material mat4 = (Material) woodcuttingInfo.get(12); + String itemName4 = ""; + if (mat4 != null) { + itemName4 = mat4.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName4 = "enchanted golden apple"; } - else if (tokens_P >= 64){ - passive_token.setAmount(64); + desc += itemName4; + lores_line2[special_index] = desc; + break; + default: + break; + } + break; + case "fishing": + special_index = 1; + desc = lang.getString("fishingPerkDesc1_1") + " "; + switch (skill_1b_level) { + case 0: + desc += "I (" + lang.getString("common") + ")"; + lores_line2[special_index] = desc; + break; + case 1: + desc += "II (" + lang.getString("uncommon") + ")"; + lores_line2[special_index] = desc; + break; + case 2: + desc += "III (" + lang.getString("rare") + ")"; + lores_line2[special_index] = desc; + break; + case 3: + desc += "IV (" + lang.getString("veryRare") + ")"; + lores_line2[special_index] = desc; + break; + case 4: + desc += "V (" + lang.getString("legendary") + ")"; + lores_line2[special_index] = desc; + break; + default: + break; + } + break; + case "farming": + special_index = 1; + desc = lang.getString("farmingPerkDesc1_1") + " "; + switch (skill_1b_level) { + case 0: + Material output1 = customRecipeMap.get("farming" + 1).getOutput(); + if (output1.equals(Material.COW_SPAWN_EGG)) { + desc += lang.getString("cowSpawnEgg"); + } else { + desc += stringsAndOtherData.cleanUpTitleString(output1.toString()); } - - //Total skill tokens - lores_line1_2[2] = ChatColor.BLUE + lang.getString("total") +": " + ChatColor.GOLD + String.valueOf(tokens_S); - if (tokens_S > 1 && tokens_S < 64){ - skill_token.setAmount(tokens_S); + lores_line2[special_index] = desc; + break; + case 1: + Material output2 = customRecipeMap.get("farming" + 2).getOutput(); + if (output2.equals(Material.BEE_SPAWN_EGG)) { + desc += lang.getString("beeSpawnEgg"); + } else { + desc += stringsAndOtherData.cleanUpTitleString(output2.toString()); } - else if (tokens_S >= 64){ - skill_token.setAmount(64); + lores_line2[special_index] = desc; + break; + case 2: + Material output3 = customRecipeMap.get("farming" + 3).getOutput(); + if (output3.equals(Material.MOOSHROOM_SPAWN_EGG)) { + desc += lang.getString("mooshroomSpawnEgg"); + } else { + desc += stringsAndOtherData.cleanUpTitleString(output3.toString()); } - - double duration = passive1.doubleValue(); - double chance1 = passive2.doubleValue(); - double chance2 = passive3.doubleValue(); - //Passive 1 - duration = duration*0.02+ 2; - duration = Math.round(duration*1000)/1000.0d; - lores_line1_2[3] = ChatColor.GRAY + lang.getString("duration") +": " + ChatColor.AQUA + String.valueOf(duration) + " s"; - switch (skillName){ - case "digging": - //Passive2 - chance1 = 1 + chance1*0.01; - chance1 = Math.round(chance1*1000)/1000.0d; - lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance1) + "%"; - - //Passive 3 - break; - case "woodcutting": - case "archery": - //Passive 2 - chance1 = chance1*0.05; - chance1 = Math.round(chance1*1000)/1000.0d; - lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance1) + "%"; - - //Passive 3 - break; - - //Passive 3 - case "mining": - //Passive 2 - chance1 = chance1*0.05; - chance1 = Math.round(chance1*1000)/1000.0d; - lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance1) + "%"; - - //Passive 3 - chance2 = chance2*0.01; - chance2 = Math.round(chance2*1000)/1000.0d; - lores_line1_2[5] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance2) + "%"; - break; - case "farming": - //Passive 2 - chance1 = chance1*0.05; - chance1 = Math.round(chance1*1000)/1000.0d; - lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance1) + "%"; - - //Passive 3 - chance2 = chance2*0.05; - chance2 = Math.round(chance2*1000)/1000.0d; - lores_line1_2[5] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance2) + "%"; - break; - case "fishing": - //Passive 1 - duration = duration/2.0; - duration = Math.round(duration*1000)/1000.0d; - lores_line1_2[3] = ChatColor.GRAY + lang.getString("duration") +": " + ChatColor.AQUA + String.valueOf(duration) + " s"; - - //Passive 2 - chance1 = chance1*0.05; - chance1 = Math.round(chance1*1000)/1000.0d; - lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance1) + "%"; - - //Passive 3 - chance2 = 10 - chance2*0.005; - chance2 = Math.round(chance2*1000)/1000.0d; - lores_line1_2[5] = ChatColor.GRAY + lang.getString("junkChance") +": " + ChatColor.AQUA + String.valueOf(chance2) + "%"; - break; - - //Passive 3 - case "beastMastery": - //Passive 2 - chance1 = chance1*0.025; - chance1 = Math.round(chance1*1000)/1000.0d; - lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance1) + "%"; - - //Passive 3 - break; - case "swordsmanship": - //Passive 2 - chance1 = chance1*0.02; - chance1 = Math.round(chance1*1000)/1000.0d; - lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance1) + "%"; - - //Passive 3 - break; - case "defense": - //Passive 2 - chance1 = 1 + chance1*0.01; - chance1 = Math.round(chance1*1000)/1000.0d; - lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance1) + "%"; - - //Passive 3 - chance2 = chance2*0.05; - chance2 = Math.round(chance2*1000)/1000.0d; - lores_line1_2[5] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance2) + "%"; - - break; - - - case "axeMastery": - //Passive 2 - chance1 = chance1*0.01; - chance1 = Math.round(chance1*1000)/1000.0d; - lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") +": " + ChatColor.AQUA + String.valueOf(chance1) + "%"; - - //Passive 3 - break; - - //Passive 3 - default: - break; + lores_line2[special_index] = desc; + break; + case 3: + Material output4 = customRecipeMap.get("farming" + 4).getOutput(); + if (output4.equals(Material.HORSE_SPAWN_EGG)) { + desc += lang.getString("horseSpawnEgg"); + } else { + desc += stringsAndOtherData.cleanUpTitleString(output4.toString()); } - - Integer[] indices_2 = {0,45,9,18,27,36}; - for (int i = 0; i < labels_2.length; i++) { - ItemMeta meta = menu_items_2[i].getItemMeta(); - meta.setDisplayName(ChatColor.BOLD + labels_2[i]); - ArrayList lore = new ArrayList<>(); - String longString = lores_line2_2[i]; - ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); - - if (i == 3) { - splitDescs.add(""); - splitDescs.add(ChatColor.UNDERLINE + lang.getString("abilityDescription")); - ArrayList appendingDesc = stringsAndOtherData.getStringLines(lang.getString("abilityDescription_"+skillName)); - splitDescs.addAll(appendingDesc); - } - lore.add(lores_line1_2[i]); - for (int j = 0; j < splitDescs.size(); j++) { - lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); - } - meta.setLore(lore); - menu_items_2[i].setItemMeta(meta); - gui.setItem(indices_2[i], menu_items_2[i]); + lores_line2[special_index] = desc; + break; + case 4: + Material output5 = customRecipeMap.get("farming" + 5).getOutput(); + if (output5.equals(Material.SLIME_SPAWN_EGG)) { + desc += lang.getString("slimeSpawnEgg"); + } else { + desc += stringsAndOtherData.cleanUpTitleString(output5.toString()); } - - if (skillName.equalsIgnoreCase("farming")) { - Integer[] indices_crafting = {48,49,50,51,52}; - ItemStack[] crafting = {new ItemStack(Material.CRAFTING_TABLE),new ItemStack(Material.CRAFTING_TABLE), - new ItemStack(Material.CRAFTING_TABLE),new ItemStack(Material.CRAFTING_TABLE), - new ItemStack(Material.CRAFTING_TABLE)}; - String[] craftingNames = {lang.getString("cowEgg"),lang.getString("beeEgg"),lang.getString("mooshroomEgg"),lang.getString("horseEgg"),lang.getString("slimeEgg")}; - Material[] defaultMaterials = {Material.COW_SPAWN_EGG,Material.BEE_SPAWN_EGG,Material.MOOSHROOM_SPAWN_EGG,Material.HORSE_SPAWN_EGG,Material.SLIME_SPAWN_EGG}; - for (int i = 0; i < craftingNames.length; i++) { - int stringIndex = i+1; - Material output = customRecipeMap.get("farming"+stringIndex).getOutput(); - if (!output.equals(defaultMaterials[i])) { - craftingNames[i] = stringsAndOtherData.cleanUpTitleString(output.toString()); - } - } - int animalFarmLevel = (int) pStats.get(8); - for (int i=0; i < craftingNames.length; i++) { - ArrayList lore = new ArrayList<>(); - ItemMeta craftingMeta = crafting[i].getItemMeta(); - if ( animalFarmLevel >= i+1) { - lore.add(ChatColor.GREEN + ChatColor.ITALIC.toString() + lang.getString("unlocked") ); - } - else { - lore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked") ); - } - craftingMeta.setDisplayName(ChatColor.BOLD + craftingNames[i]); - craftingMeta.setLore(lore); - crafting[i].setItemMeta(craftingMeta); - gui.setItem(indices_crafting[i],crafting[i]); - } + lores_line2[special_index] = desc; + break; + default: + break; + } + break; + case "digging": + special_index = 0; + ArrayList diggingInfo = configLoad.getDiggingInfo(); + switch (skill_1a_level) { + case 0: + desc = lang.getString("diggingPerkDesc0_1") + " "; + Material mat0 = (Material) diggingInfo.get(10); + String itemName0 = ""; + if (mat0 != null) { + itemName0 = mat0.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName0 = "gold ingot"; } - else if (skillName.equalsIgnoreCase("archery")) { - Integer[] indices_crafting = {48,49,50,51,52}; - ItemStack[] crafting = {new ItemStack(Material.CRAFTING_TABLE)}; - String[] craftingNames = {lang.getString("tippedArrows")}; - int dragonlessArrowsLevel = (int) pStats.get(11); - for (int i=0; i < craftingNames.length; i++) { - ArrayList lore = new ArrayList<>(); - ItemMeta craftingMeta = crafting[i].getItemMeta(); - if ( dragonlessArrowsLevel >= 1) { - lore.add(ChatColor.GREEN + ChatColor.ITALIC.toString() + lang.getString("unlocked") ); - } - else { - lore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked") ); - } - craftingMeta.setDisplayName(ChatColor.BOLD + craftingNames[i]); - craftingMeta.setLore(lore); - crafting[i].setItemMeta(craftingMeta); - gui.setItem(indices_crafting[i],crafting[i]); - } + desc += itemName0; + lores_line2[special_index] = desc; + break; + case 1: + desc = lang.getString("diggingPerkDesc0_1") + " "; + Material mat1 = (Material) diggingInfo.get(12); + String itemName1 = ""; + if (mat1 != null) { + itemName1 = mat1.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName1 = "name tag"; } - - //Soul Bucket (Refunding) - ItemStack soul = new ItemStack(Material.COMPOSTER); - ItemMeta soulMeta = soul.getItemMeta(); - ArrayList soulLore = new ArrayList<>(); - soulMeta.setDisplayName(ChatColor.BOLD + lang.getString("refundSkillTitle")); - if ((int) pStatAll.get("global").get(9) < 1) { - soulLore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked") ); + desc += itemName1; + lores_line2[special_index] = desc; + break; + case 2: + desc = lang.getString("diggingPerkDesc0_1") + " "; + Material mat2 = (Material) diggingInfo.get(14); + String itemName2 = ""; + if (mat2 != null) { + itemName2 = mat2.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName2 = "music discs"; } - else { - int souls = (int) pStatAll.get("global").get(20); - String soulsString = lang.getString("souls"); - String soulsCapitilized = UtilityMethods.capitalizeString(soulsString); - soulLore.add(soulsCapitilized +": " + ChatColor.AQUA + ChatColor.ITALIC.toString() + souls + "/" + refundCost); - soulLore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + lang.getString("refundSkillTreeDesc")); - soulLore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + "(-"+refundCost+" "+ lang.getString("souls")+ ")"); + desc += itemName2; + lores_line2[special_index] = desc; + break; + case 3: + desc = lang.getString("diggingPerkDesc0_1") + " "; + Material mat3 = (Material) diggingInfo.get(16); + String itemName3 = ""; + if (mat3 != null) { + itemName3 = mat3.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName3 = "horse armor"; } - soulMeta.setLore(soulLore); - soul.setItemMeta(soulMeta); - gui.setItem(47,soul); - - //Configuration Menu: - ItemStack configItem = new ItemStack(Material.REDSTONE); - ItemMeta configItemMeta = configItem.getItemMeta(); - ArrayList configItemLore = new ArrayList<>(); - configItemMeta.setDisplayName(ChatColor.BOLD + lang.getString("configuration")); - configItemLore.addAll(stringsAndOtherData.getStringLines(lang.getString("skillConfigDesc"))); - configItemMeta.setLore(configItemLore); - configItem.setItemMeta(configItemMeta); - gui.setItem(53,configItem); - - - //Connectors - ItemStack connector = new ItemStack(Material.GLASS_PANE); - ItemMeta connectorMeta = connector.getItemMeta(); - connectorMeta.setDisplayName(ChatColor.WHITE.toString()); - connector.setItemMeta(connectorMeta); - Integer[] indices_3 = {6,12,14,24,25,30,32,42}; - for (int i = 0; i < indices_3.length; i++) { - gui.setItem(indices_3[i], connector); + desc += itemName3; + lores_line2[special_index] = desc; + break; + case 4: + desc = lang.getString("diggingPerkDesc0_1") + " "; + Material mat4 = (Material) diggingInfo.get(18); + String itemName4 = ""; + if (mat4 != null) { + itemName4 = mat4.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName4 = "diamond"; } - //Put the items in the inventory - p.openInventory(gui); + desc += itemName4; + lores_line2[special_index] = desc; + break; + default: + break; } - else if (sender instanceof Player && labels_arr.indexOf(args[1]) >= 10 && labels_arr.indexOf(args[1]) < 15) { - - //Skills - ArrayList pStats = pStatAll.get(skillName); - int tokens_S = (Integer) pStats.get(3); - Number passive1 = pStats.get(4); - int skill_1a_level = (Integer) pStats.get(7); - int skill_2a_level = (Integer) pStats.get(9); - int skill_M_level = (Integer) pStats.get(13); - - ItemStack skill_1a = new ItemStack(Material.PINK_TERRACOTTA); - ItemStack skill_2a = new ItemStack(Material.RED_TERRACOTTA); - ItemStack skill_M = new ItemStack(Material.RED_TERRACOTTA); - - if (skill_1a_level == 0) { - skill_1a.setType(Material.PINK_TERRACOTTA); - } else if (skill_1a_level > 0 && skill_1a_level < 5) { - skill_1a.setType(Material.YELLOW_TERRACOTTA); + switch (skill_2a_level) { + case 0: + desc = lang.getString("diggingPerkDesc0_1") + " "; + Material mat5 = (Material) diggingInfo.get(21); + String itemName5 = ""; + if (mat5 != null) { + itemName5 = mat5.toString().replaceAll("_", " ").toLowerCase(); } else { - skill_1a.setType(Material.GREEN_TERRACOTTA); + itemName5 = "emerald"; } - - if (skill_2a_level == 0) { - if (skill_1a_level >= 2) { - skill_2a.setType(Material.PINK_TERRACOTTA); - } - } else if (skill_2a_level > 0 && skill_2a_level < 5) { - skill_2a.setType(Material.YELLOW_TERRACOTTA); + desc += itemName5; + lores_line2[2] = desc; + break; + case 1: + desc = lang.getString("diggingPerkDesc0_1") + " "; + Material mat6 = (Material) diggingInfo.get(24); + String itemName6 = ""; + if (mat6 != null) { + itemName6 = mat6.toString().replaceAll("_", " ").toLowerCase(); } else { - skill_2a.setType(Material.GREEN_TERRACOTTA); + itemName6 = "enchanted book"; } - - if (skill_M_level == 0) { - if (skill_1a_level + skill_2a_level >= 10) { - skill_M.setType(Material.PINK_TERRACOTTA); - } + desc += itemName6; + lores_line2[2] = desc; + break; + case 2: + desc = lang.getString("diggingPerkDesc0_1") + " "; + Material mat7 = (Material) diggingInfo.get(27); + String itemName7 = ""; + if (mat7 != null) { + itemName7 = mat7.toString().replaceAll("_", " ").toLowerCase(); } else { - skill_M.setType(Material.GREEN_TERRACOTTA); + itemName7 = "dragon breath"; } - - ItemStack[] menu_items = {skill_1a, skill_2a, skill_M}; - String[] labels = perksMap.get(skillName); - String[] lores_line2 = descriptionsMap.get(skillName); - String desc = ""; - int special_index = 0; - switch (skillName) { - case "alchemy": - special_index = 1; - switch (skill_2a_level) { - case 0: - desc = lang.getString("alchemyPerkDesc1_0") + " "; - desc += stringsAndOtherData.getPotionEffectTypeString(1,p); - lores_line2[special_index] = desc; - break; - case 1: - desc = lang.getString("alchemyPerkDesc1_0") + " "; - desc += stringsAndOtherData.getPotionEffectTypeString(2,p); - lores_line2[special_index] = desc; - break; - case 2: - desc = lang.getString("alchemyPerkDesc1_0") + " "; - desc += stringsAndOtherData.getPotionEffectTypeString(3,p); - lores_line2[special_index] = desc; - break; - case 3: - desc = lang.getString("alchemyPerkDesc1_0") + " "; - desc += stringsAndOtherData.getPotionEffectTypeString(4,p); - lores_line2[special_index] = desc; - break; - case 4: - desc = lang.getString("alchemyPerkDesc1_0") + " "; - desc += stringsAndOtherData.getPotionEffectTypeString(5,p); - lores_line2[special_index] = desc; - break; - default: - break; - } - switch (skill_1a_level) { - case 0: - desc = lang.getString("alchemyPerkDesc0_0") + " "; - desc += stringsAndOtherData.getPotionTypeString(1,p); - lores_line2[0] = desc; - break; - case 1: - desc = lang.getString("alchemyPerkDesc0_0") + " "; - desc += stringsAndOtherData.getPotionTypeString(2,p); - lores_line2[0] = desc; - break; - case 2: - desc = lang.getString("alchemyPerkDesc0_0") + " "; - desc += stringsAndOtherData.getPotionTypeString(3,p); - lores_line2[0] = desc; - break; - case 3: - desc = lang.getString("alchemyPerkDesc0_0") + " "; - desc += stringsAndOtherData.getPotionTypeString(4,p); - lores_line2[0] = desc; - break; - case 4: - desc = lang.getString("alchemyPerkDesc0_0") + " "; - desc += stringsAndOtherData.getPotionTypeString(5,p); - lores_line2[0] = desc; - break; - default: - break; - } - break; - case "enchanting": - special_index = 1; - desc = lang.getString("enchantingPerkDesc1_0")+" "; - StringsAndOtherData stringsAndOtherData1 = new StringsAndOtherData(); - switch (skill_2a_level) { - case 0: - desc += stringsAndOtherData1.getEnchantmentPerkDescString(1,p); - lores_line2[special_index] = desc; - break; - case 1: - desc += stringsAndOtherData1.getEnchantmentPerkDescString(2,p); - lores_line2[special_index] = desc; - break; - case 2: - desc += stringsAndOtherData1.getEnchantmentPerkDescString(3,p); - lores_line2[special_index] = desc; - break; - case 3: - desc += stringsAndOtherData1.getEnchantmentPerkDescString(4,p); - lores_line2[special_index] = desc; - break; - case 4: - desc += stringsAndOtherData1.getEnchantmentPerkDescString(5,p); - lores_line2[special_index] = desc; - break; - default: - break; - } - break; - case "repair": - special_index = 0; - switch (skill_1a_level) { - case 0: - case 1: - case 2: - case 3: - desc += lang.getString("repairPerkDesc0_1"); - lores_line2[special_index] = desc; - break; - case 4: - desc += lang.getString("repairPerkDesc0_2"); - lores_line2[special_index] = desc; - break; - default: - break; - } - break; - } - String[] lores_line1 = {"Level: 0/5","Level: 0/5","Level: 0/1"}; - String level = pStats.get(7).toString(); - lores_line1[0] = ChatColor.GRAY + lang.getString("level") + " " + ChatColor.GREEN + level + "/5"; - level = pStats.get(9).toString(); - lores_line1[1] = ChatColor.GRAY + lang.getString("level") + " " + ChatColor.GREEN + level + "/5"; - level = pStats.get(13).toString(); - lores_line1[2] = ChatColor.GRAY + lang.getString("level") + " " + ChatColor.DARK_PURPLE + level + "/1"; - - Integer[] indices = {20,23,26}; - //Set skills - for (int i = 0; i < labels.length; i++) { - ItemMeta meta = menu_items[i].getItemMeta(); - meta.setDisplayName(ChatColor.BOLD + labels[i]); - ArrayList lore = new ArrayList<>(); - lore.add(lores_line1[i]); - String longString = lores_line2[i]; - ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); - for (int j = 0; j < splitDescs.size(); j++) { - lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); - } - meta.setLore(lore); - menu_items[i].setItemMeta(meta); - gui.setItem(indices[i], menu_items[i]); - } - - //Tokens, passives, and back button - ItemStack skill_token = new ItemStack(Material.GOLD_NUGGET); - ItemStack passive_1 = new ItemStack(Material.RED_DYE,1); - ItemStack back_button = new ItemStack(Material.ARROW); - - - - ItemStack[] menu_items_2 = {back_button,skill_token,passive_1}; - String[] labels_2 = passivePerksMap.get(skillName); - String[] lores_line1_2 = {"","Total: 0","Chance: 0 %"}; - String[] lores_line2_2 = passiveDescriptionsMap.get(skillName); - - //Total skill tokens - lores_line1_2[1] = ChatColor.BLUE + lang.getString("total")+": " + ChatColor.GOLD + String.valueOf(tokens_S); - if (tokens_S > 1 && tokens_S < 64){ - skill_token.setAmount(tokens_S); + desc += itemName7; + lores_line2[2] = desc; + break; + case 3: + desc = lang.getString("diggingPerkDesc0_1") + " "; + Material mat8 = (Material) diggingInfo.get(30); + String itemName8 = ""; + if (mat8 != null) { + itemName8 = mat8.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName8 = "totem of undying"; } - else if (tokens_S >= 64){ - skill_token.setAmount(64); + desc += itemName8; + lores_line2[2] = desc; + break; + case 4: + desc = lang.getString("diggingPerkDesc0_1") + " "; + Material mat9 = (Material) diggingInfo.get(30); + String itemName9 = ""; + if (mat9 != null) { + itemName9 = mat9.toString().replaceAll("_", " ").toLowerCase(); + } else { + itemName9 = "nether star"; } + desc += itemName9; + lores_line2[2] = desc; + break; + default: + break; + } + break; + case "defense": + special_index = 0; + switch (skill_1a_level) { + case 0: + case 2: + case 1: + desc = lang.getString("defensePerkDesc0_1"); + lores_line2[special_index] = desc; + break; + case 3: + case 4: + desc = lang.getString("defensePerkDesc0_2"); + lores_line2[special_index] = desc; + break; + default: + break; + } + break; + default: + break; + } + + String[] lores_line1 = {"Level: 0/5", "Level: 0/5", "Level: 0/5", "Level: 0/5", + "Level: 0/1", "Level: 0/1", "Level: 0/1"}; //Data lines 7-13 + for (int i = 0; i < 4; i++) { + String level = pStats.get(7 + i).toString(); + lores_line1[i] = + ChatColor.GRAY + lang.getString("level") + " " + ChatColor.GREEN + level + "/5"; + } + for (int i = 0; i < 3; i++) { + String level = pStats.get(11 + i).toString(); + if (i != 2) { + lores_line1[i + 4] = + ChatColor.GRAY + lang.getString("level") + " " + ChatColor.BLUE + level + "/1"; + } else { + lores_line1[i + 4] = + ChatColor.GRAY + lang.getString("level") + " " + ChatColor.DARK_PURPLE + level + + "/1"; + } + } + + Integer[] indices = {11, 29, 13, 31, 7, 43, 26}; + // + for (int i = 0; i < labels.length; i++) { + ItemMeta meta = menu_items[i].getItemMeta(); + meta.setDisplayName(ChatColor.BOLD + labels[i]); + ArrayList lore = new ArrayList<>(); + lore.add(lores_line1[i]); + String longString = lores_line2[i]; + ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); + for (int j = 0; j < splitDescs.size(); j++) { + lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); + } + meta.setLore(lore); + menu_items[i].setItemMeta(meta); + gui.setItem(indices[i], menu_items[i]); + } + //Tokens, passives, and back button + ItemStack passive_token = new ItemStack(Material.IRON_NUGGET); + ItemStack skill_token = new ItemStack(Material.GOLD_NUGGET); + ItemStack passive_1 = new ItemStack(Material.RED_DYE, 1); + ItemStack passive_2 = new ItemStack(Material.GREEN_DYE, 2); + ItemStack passive_3 = new ItemStack(Material.BLUE_DYE, 3); + ItemStack back_button = new ItemStack(Material.ARROW); + + ItemStack[] menu_items_2 = {passive_token, back_button, skill_token, passive_1, passive_2, + passive_3}; + String[] labels_2 = passivePerksMap.get(skillName); + String[] lores_line1_2 = {"Total: 0", "", "Total: 0", "Duration: 1 s", "Percentage: 0%", + "Percentage: 0%"}; + String[] lores_line2_2 = passiveDescriptionsMap.get(skillName); + + //Total Passive Tokens + lores_line1_2[0] = + ChatColor.BLUE + lang.getString("total") + ": " + ChatColor.GOLD + String.valueOf( + tokens_P); + if (tokens_P > 1 && tokens_P < 64) { + passive_token.setAmount(tokens_P); + } else if (tokens_P >= 64) { + passive_token.setAmount(64); + } + + //Total skill tokens + lores_line1_2[2] = + ChatColor.BLUE + lang.getString("total") + ": " + ChatColor.GOLD + String.valueOf( + tokens_S); + if (tokens_S > 1 && tokens_S < 64) { + skill_token.setAmount(tokens_S); + } else if (tokens_S >= 64) { + skill_token.setAmount(64); + } + + double duration = passive1.doubleValue(); + double chance1 = passive2.doubleValue(); + double chance2 = passive3.doubleValue(); + //Passive 1 + duration = duration * 0.02 + 2; + duration = Math.round(duration * 1000) / 1000.0d; + lores_line1_2[3] = + ChatColor.GRAY + lang.getString("duration") + ": " + ChatColor.AQUA + String.valueOf( + duration) + " s"; + switch (skillName) { + case "digging": + //Passive2 + chance1 = 1 + chance1 * 0.01; + chance1 = Math.round(chance1 * 1000) / 1000.0d; + lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance1) + "%"; + + //Passive 3 + break; + case "woodcutting": + case "archery": + //Passive 2 + chance1 = chance1 * 0.05; + chance1 = Math.round(chance1 * 1000) / 1000.0d; + lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance1) + "%"; + + //Passive 3 + break; + + //Passive 3 + case "mining": + //Passive 2 + chance1 = chance1 * 0.05; + chance1 = Math.round(chance1 * 1000) / 1000.0d; + lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance1) + "%"; + + //Passive 3 + chance2 = chance2 * 0.01; + chance2 = Math.round(chance2 * 1000) / 1000.0d; + lores_line1_2[5] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance2) + "%"; + break; + case "farming": + //Passive 2 + chance1 = chance1 * 0.05; + chance1 = Math.round(chance1 * 1000) / 1000.0d; + lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance1) + "%"; + + //Passive 3 + chance2 = chance2 * 0.05; + chance2 = Math.round(chance2 * 1000) / 1000.0d; + lores_line1_2[5] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance2) + "%"; + break; + case "fishing": + //Passive 1 + duration = duration / 2.0; + duration = Math.round(duration * 1000) / 1000.0d; + lores_line1_2[3] = ChatColor.GRAY + lang.getString("duration") + ": " + ChatColor.AQUA + + String.valueOf(duration) + " s"; + + //Passive 2 + chance1 = chance1 * 0.05; + chance1 = Math.round(chance1 * 1000) / 1000.0d; + lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance1) + "%"; + + //Passive 3 + chance2 = 10 - chance2 * 0.005; + chance2 = Math.round(chance2 * 1000) / 1000.0d; + lores_line1_2[5] = ChatColor.GRAY + lang.getString("junkChance") + ": " + ChatColor.AQUA + + String.valueOf(chance2) + "%"; + break; + + //Passive 3 + case "beastMastery": + //Passive 2 + chance1 = chance1 * 0.025; + chance1 = Math.round(chance1 * 1000) / 1000.0d; + lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance1) + "%"; + + //Passive 3 + break; + case "swordsmanship": + //Passive 2 + chance1 = chance1 * 0.02; + chance1 = Math.round(chance1 * 1000) / 1000.0d; + lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance1) + "%"; + + //Passive 3 + break; + case "defense": + //Passive 2 + chance1 = 1 + chance1 * 0.01; + chance1 = Math.round(chance1 * 1000) / 1000.0d; + lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance1) + "%"; + + //Passive 3 + chance2 = chance2 * 0.05; + chance2 = Math.round(chance2 * 1000) / 1000.0d; + lores_line1_2[5] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance2) + "%"; + + break; + + case "axeMastery": + //Passive 2 + chance1 = chance1 * 0.01; + chance1 = Math.round(chance1 * 1000) / 1000.0d; + lores_line1_2[4] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(chance1) + "%"; + + //Passive 3 + break; + + //Passive 3 + default: + break; + } + + Integer[] indices_2 = {0, 45, 9, 18, 27, 36}; + for (int i = 0; i < labels_2.length; i++) { + ItemMeta meta = menu_items_2[i].getItemMeta(); + meta.setDisplayName(ChatColor.BOLD + labels_2[i]); + ArrayList lore = new ArrayList<>(); + String longString = lores_line2_2[i]; + ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); + + if (i == 3) { + splitDescs.add(""); + splitDescs.add(ChatColor.UNDERLINE + lang.getString("abilityDescription")); + ArrayList appendingDesc = stringsAndOtherData.getStringLines( + lang.getString("abilityDescription_" + skillName)); + splitDescs.addAll(appendingDesc); + } + lore.add(lores_line1_2[i]); + for (int j = 0; j < splitDescs.size(); j++) { + lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); + } + meta.setLore(lore); + menu_items_2[i].setItemMeta(meta); + gui.setItem(indices_2[i], menu_items_2[i]); + } + + if (skillName.equalsIgnoreCase("farming")) { + Integer[] indices_crafting = {48, 49, 50, 51, 52}; + ItemStack[] crafting = {new ItemStack(Material.CRAFTING_TABLE), + new ItemStack(Material.CRAFTING_TABLE), + new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.CRAFTING_TABLE), + new ItemStack(Material.CRAFTING_TABLE)}; + String[] craftingNames = {lang.getString("cowEgg"), lang.getString("beeEgg"), + lang.getString("mooshroomEgg"), lang.getString("horseEgg"), + lang.getString("slimeEgg")}; + Material[] defaultMaterials = {Material.COW_SPAWN_EGG, Material.BEE_SPAWN_EGG, + Material.MOOSHROOM_SPAWN_EGG, Material.HORSE_SPAWN_EGG, Material.SLIME_SPAWN_EGG}; + for (int i = 0; i < craftingNames.length; i++) { + int stringIndex = i + 1; + Material output = customRecipeMap.get("farming" + stringIndex).getOutput(); + if (!output.equals(defaultMaterials[i])) { + craftingNames[i] = stringsAndOtherData.cleanUpTitleString(output.toString()); + } + } + int animalFarmLevel = (int) pStats.get(8); + for (int i = 0; i < craftingNames.length; i++) { + ArrayList lore = new ArrayList<>(); + ItemMeta craftingMeta = crafting[i].getItemMeta(); + if (animalFarmLevel >= i + 1) { + lore.add(ChatColor.GREEN + ChatColor.ITALIC.toString() + lang.getString("unlocked")); + } else { + lore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked")); + } + craftingMeta.setDisplayName(ChatColor.BOLD + craftingNames[i]); + craftingMeta.setLore(lore); + crafting[i].setItemMeta(craftingMeta); + gui.setItem(indices_crafting[i], crafting[i]); + } + } else if (skillName.equalsIgnoreCase("archery")) { + Integer[] indices_crafting = {48, 49, 50, 51, 52}; + ItemStack[] crafting = {new ItemStack(Material.CRAFTING_TABLE)}; + String[] craftingNames = {lang.getString("tippedArrows")}; + int dragonlessArrowsLevel = (int) pStats.get(11); + for (int i = 0; i < craftingNames.length; i++) { + ArrayList lore = new ArrayList<>(); + ItemMeta craftingMeta = crafting[i].getItemMeta(); + if (dragonlessArrowsLevel >= 1) { + lore.add(ChatColor.GREEN + ChatColor.ITALIC.toString() + lang.getString("unlocked")); + } else { + lore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked")); + } + craftingMeta.setDisplayName(ChatColor.BOLD + craftingNames[i]); + craftingMeta.setLore(lore); + crafting[i].setItemMeta(craftingMeta); + gui.setItem(indices_crafting[i], crafting[i]); + } + } + + //Soul Bucket (Refunding) + ItemStack soul = new ItemStack(Material.COMPOSTER); + ItemMeta soulMeta = soul.getItemMeta(); + ArrayList soulLore = new ArrayList<>(); + soulMeta.setDisplayName(ChatColor.BOLD + lang.getString("refundSkillTitle")); + if ((int) pStatAll.get("global").get(9) < 1) { + soulLore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked")); + } else { + int souls = (int) pStatAll.get("global").get(20); + String soulsString = lang.getString("souls"); + String soulsCapitilized = UtilityMethods.capitalizeString(soulsString); + soulLore.add( + soulsCapitilized + ": " + ChatColor.AQUA + ChatColor.ITALIC.toString() + souls + "/" + + refundCost); + soulLore.add( + ChatColor.GRAY + ChatColor.ITALIC.toString() + lang.getString("refundSkillTreeDesc")); + soulLore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + "(-" + refundCost + " " + + lang.getString("souls") + ")"); + } + soulMeta.setLore(soulLore); + soul.setItemMeta(soulMeta); + gui.setItem(47, soul); + + //Configuration Menu: + ItemStack configItem = new ItemStack(Material.REDSTONE); + ItemMeta configItemMeta = configItem.getItemMeta(); + ArrayList configItemLore = new ArrayList<>(); + configItemMeta.setDisplayName(ChatColor.BOLD + lang.getString("configuration")); + configItemLore.addAll( + stringsAndOtherData.getStringLines(lang.getString("skillConfigDesc"))); + configItemMeta.setLore(configItemLore); + configItem.setItemMeta(configItemMeta); + gui.setItem(53, configItem); + + //Connectors + ItemStack connector = new ItemStack(Material.GLASS_PANE); + ItemMeta connectorMeta = connector.getItemMeta(); + connectorMeta.setDisplayName(ChatColor.WHITE.toString()); + connector.setItemMeta(connectorMeta); + Integer[] indices_3 = {6, 12, 14, 24, 25, 30, 32, 42}; + for (int i = 0; i < indices_3.length; i++) { + gui.setItem(indices_3[i], connector); + } + //Put the items in the inventory + p.openInventory(gui); + } else if (sender instanceof Player && labels_arr.indexOf(args[1]) >= 10 + && labels_arr.indexOf(args[1]) < 15) { - double passive = passive1.doubleValue(); - switch (skillName){ - case "repair": - passive = passive; - //passive = Math.round(passive*1000)/1000.0d; - lores_line1_2[2] = ChatColor.GRAY + lang.getString("level")+": " + ChatColor.AQUA + String.valueOf(passive); - break; - case "agility": - passive = passive*0.05; - passive = Math.round(passive*1000)/1000.0d; - lores_line1_2[2] = ChatColor.GRAY + lang.getString("likelihood")+": " + ChatColor.AQUA + String.valueOf(passive)+"%"; - break; - case "enchanting": - passive = passive*0.2; - passive = Math.round(passive*1000)/1000.0d; - lores_line1_2[2] = ChatColor.GRAY + lang.getString("xpBoost")+": " + ChatColor.AQUA + "+"+String.valueOf(passive)+"%"; - break; - case "smelting": - passive = passive*0.2; - passive = Math.round(passive*1000)/1000.0d; - lores_line1_2[2] = ChatColor.GRAY + lang.getString("speedBoost")+": " + ChatColor.AQUA + "+"+String.valueOf(passive)+"%"; - break; - case "alchemy": - passive = passive*0.1; - passive = Math.round(passive*1000)/1000.0d; - lores_line1_2[2] = ChatColor.GRAY + lang.getString("timeExtension")+": " + ChatColor.AQUA + "+"+String.valueOf(passive)+"%"; - break; - default: - break; - } + //Skills + ArrayList pStats = pStatAll.get(skillName); + int tokens_S = (Integer) pStats.get(3); + Number passive1 = pStats.get(4); + int skill_1a_level = (Integer) pStats.get(7); + int skill_2a_level = (Integer) pStats.get(9); + int skill_M_level = (Integer) pStats.get(13); - Integer[] indices_2 = {45,0,18}; - for (int i = 0; i < labels_2.length; i++) { - ItemMeta meta = menu_items_2[i].getItemMeta(); - meta.setDisplayName(ChatColor.BOLD + labels_2[i]); - ArrayList lore = new ArrayList<>(); - lore.add(lores_line1_2[i]); - String longString = lores_line2_2[i]; - ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); - for (int j = 0; j < splitDescs.size(); j++) { - lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); - }; - meta.setLore(lore); - menu_items_2[i].setItemMeta(meta); - gui.setItem(indices_2[i], menu_items_2[i]); - } + ItemStack skill_1a = new ItemStack(Material.PINK_TERRACOTTA); + ItemStack skill_2a = new ItemStack(Material.RED_TERRACOTTA); + ItemStack skill_M = new ItemStack(Material.RED_TERRACOTTA); - //Crafting - if (skillName.equalsIgnoreCase("enchanting")) { - Integer[] indices_crafting = {39,40,41,42,43,48,49,50,51,52}; - ItemStack[] crafting = {new ItemStack(Material.CRAFTING_TABLE),new ItemStack(Material.CRAFTING_TABLE), - new ItemStack(Material.CRAFTING_TABLE),new ItemStack(Material.CRAFTING_TABLE), - new ItemStack(Material.CRAFTING_TABLE),new ItemStack(Material.CRAFTING_TABLE), - new ItemStack(Material.CRAFTING_TABLE),new ItemStack(Material.CRAFTING_TABLE), - new ItemStack(Material.CRAFTING_TABLE),new ItemStack(Material.CRAFTING_TABLE)}; - String[] craftingNames = stringsAndOtherData.getEnchantingCraftingNames(p); - int bookSmartLevel = (int) pStats.get(9); - for (int i=0; i < craftingNames.length; i++) { - ArrayList lore = new ArrayList<>(); - ItemMeta craftingMeta = crafting[i].getItemMeta(); - if ( bookSmartLevel >= Math.ceil((double) (i+1)/2.0)) { - lore.add(ChatColor.GREEN + ChatColor.ITALIC.toString() + lang.getString("unlocked") ); - } - else { - lore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked") ); - } - craftingMeta.setDisplayName(ChatColor.BOLD + craftingNames[i]); - craftingMeta.setLore(lore); - crafting[i].setItemMeta(craftingMeta); - gui.setItem(indices_crafting[i],crafting[i]); - } - } - else if (skillName.equalsIgnoreCase("alchemy")) { - Integer[] indices_crafting = {48,49,50,51,52}; - ItemStack[] crafting = {new ItemStack(Material.CRAFTING_TABLE),new ItemStack(Material.CRAFTING_TABLE), - new ItemStack(Material.CRAFTING_TABLE),new ItemStack(Material.CRAFTING_TABLE), - new ItemStack(Material.CRAFTING_TABLE)}; - String[] craftingNames = {stringsAndOtherData.getPotionTypeString(1,p), - stringsAndOtherData.getPotionTypeString(2,p), - stringsAndOtherData.getPotionTypeString(3,p), - stringsAndOtherData.getPotionTypeString(4,p), - stringsAndOtherData.getPotionTypeString(5,p)}; - int alchemicalSummoningLevel = (int) pStats.get(7); - for (int i=0; i < craftingNames.length; i++) { - ArrayList lore = new ArrayList<>(); - ItemMeta craftingMeta = crafting[i].getItemMeta(); - if ( alchemicalSummoningLevel > i) { - lore.add(ChatColor.GREEN + ChatColor.ITALIC.toString() + lang.getString("unlocked") ); - } - else { - lore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked") ); - } - craftingMeta.setDisplayName(ChatColor.BOLD + craftingNames[i]); - craftingMeta.setLore(lore); - crafting[i].setItemMeta(craftingMeta); - gui.setItem(indices_crafting[i],crafting[i]); - } - Integer[] indices_brewing = {39,40,41,42,43}; - ItemStack[] brewing = {new ItemStack(Material.IRON_BARS),new ItemStack(Material.IRON_BARS), - new ItemStack(Material.IRON_BARS),new ItemStack(Material.IRON_BARS), - new ItemStack(Material.IRON_BARS)}; - ItemGroups itemGroups = new ItemGroups(); - List brewingUnlocked = itemGroups.getNewIngredients(); - int ancientKnowledgeLevel = (int) pStats.get(9); - for (int i=0; i < brewing.length; i++) { - String lvl = String.valueOf(i+1); - ArrayList lore = new ArrayList<>(); - ItemStack brewingItem = brewing[i]; - ItemMeta brewingMeta = brewingItem.getItemMeta(); - brewingMeta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); - brewingMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); - brewingMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - String brewingName = lang.getString("alchemyPerkTitle1") + " " + lang.getString("lvl") + " " + lvl + " " + lang.getString("ingredient"); - if (ancientKnowledgeLevel > i) { - brewingItem.setType(brewingUnlocked.get(i)); - lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + lang.getString("usedToBrew") ); - lore.add(ChatColor.GRAY + stringsAndOtherData.getPotionEffectTypeString(i+1,p)); - } - else { - lore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked") ); - } - brewingMeta.setDisplayName(ChatColor.WHITE + ChatColor.BOLD.toString() +brewingName); - brewingMeta.setLore(lore); - brewingItem.setItemMeta(brewingMeta); - gui.setItem(indices_brewing[i],brewingItem); - - } - } + if (skill_1a_level == 0) { + skill_1a.setType(Material.PINK_TERRACOTTA); + } else if (skill_1a_level > 0 && skill_1a_level < 5) { + skill_1a.setType(Material.YELLOW_TERRACOTTA); + } else { + skill_1a.setType(Material.GREEN_TERRACOTTA); + } - //Souls (refunding) - ItemStack soul = new ItemStack(Material.COMPOSTER); - ItemMeta soulMeta = soul.getItemMeta(); - ArrayList soulLore = new ArrayList<>(); - soulMeta.setDisplayName(ChatColor.BOLD + lang.getString("refundSkillTitle")); - if ((int) pStatAll.get("global").get(9) < 1) { - soulLore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked") ); - } - else { - int souls = (int) pStatAll.get("global").get(20); - String soulsString = lang.getString("souls"); - String soulsCapitilized = UtilityMethods.capitalizeString(soulsString); - soulLore.add(soulsCapitilized +": " + ChatColor.AQUA + ChatColor.ITALIC.toString() + souls + "/" + refundCost); - soulLore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + lang.getString("refundSkillTreeDesc")); - soulLore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + "(-"+refundCost+" "+ lang.getString("souls")+ ")"); - } - soulMeta.setLore(soulLore); - soul.setItemMeta(soulMeta); - gui.setItem(47,soul); - - ItemStack configItem = new ItemStack(Material.REDSTONE); - ItemMeta configItemMeta = configItem.getItemMeta(); - ArrayList configItemLore = new ArrayList<>(); - configItemMeta.setDisplayName(ChatColor.BOLD + lang.getString("configuration")); - configItemLore.addAll(stringsAndOtherData.getStringLines(lang.getString("skillConfigDesc"))); - configItemMeta.setLore(configItemLore); - configItem.setItemMeta(configItemMeta); - gui.setItem(53,configItem); - - //Connectors - ItemStack connector = new ItemStack(Material.GLASS_PANE); - ItemMeta connectorMeta = connector.getItemMeta(); - connectorMeta.setDisplayName(ChatColor.WHITE.toString()); - connector.setItemMeta(connectorMeta); - Integer[] indices_3 = {21,22,24,25}; - for (int i = 0; i < indices_3.length; i++) { - gui.setItem(indices_3[i], connector); - } - //Put the items in the inventory - p.openInventory(gui); + if (skill_2a_level == 0) { + if (skill_1a_level >= 2) { + skill_2a.setType(Material.PINK_TERRACOTTA); + } + } else if (skill_2a_level > 0 && skill_2a_level < 5) { + skill_2a.setType(Material.YELLOW_TERRACOTTA); + } else { + skill_2a.setType(Material.GREEN_TERRACOTTA); + } + if (skill_M_level == 0) { + if (skill_1a_level + skill_2a_level >= 10) { + skill_M.setType(Material.PINK_TERRACOTTA); + } + } else { + skill_M.setType(Material.GREEN_TERRACOTTA); + } + + ItemStack[] menu_items = {skill_1a, skill_2a, skill_M}; + String[] labels = perksMap.get(skillName); + String[] lores_line2 = descriptionsMap.get(skillName); + String desc = ""; + int special_index = 0; + switch (skillName) { + case "alchemy": + special_index = 1; + switch (skill_2a_level) { + case 0: + desc = lang.getString("alchemyPerkDesc1_0") + " "; + desc += stringsAndOtherData.getPotionEffectTypeString(1, p); + lores_line2[special_index] = desc; + break; + case 1: + desc = lang.getString("alchemyPerkDesc1_0") + " "; + desc += stringsAndOtherData.getPotionEffectTypeString(2, p); + lores_line2[special_index] = desc; + break; + case 2: + desc = lang.getString("alchemyPerkDesc1_0") + " "; + desc += stringsAndOtherData.getPotionEffectTypeString(3, p); + lores_line2[special_index] = desc; + break; + case 3: + desc = lang.getString("alchemyPerkDesc1_0") + " "; + desc += stringsAndOtherData.getPotionEffectTypeString(4, p); + lores_line2[special_index] = desc; + break; + case 4: + desc = lang.getString("alchemyPerkDesc1_0") + " "; + desc += stringsAndOtherData.getPotionEffectTypeString(5, p); + lores_line2[special_index] = desc; + break; + default: + break; } - else if (sender instanceof Player && labels_arr.indexOf(args[1]) > 10 && labels_arr.indexOf(args[1]) == 15) { - ArrayList pStats = pStatAll.get(skillName); - - int tokens_G = (Integer) pStats.get(1); - int skill_1a_level = (Integer) pStats.get(2); - int skill_1b_level = (Integer) pStats.get(3); - int skill_1c_level = (Integer) pStats.get(4); - int skill_2a_level = (Integer) pStats.get(5); - int skill_2b_level = (Integer) pStats.get(6); - int skill_2c_level = (Integer) pStats.get(7); - int skill_3a_level = (Integer) pStats.get(8); - int skill_3b_level = (Integer) pStats.get(9); - int skill_3c_level = (Integer) pStats.get(10); - int skill_M_level = (Integer) pStats.get(11); - - ItemStack skill_1a = new ItemStack(Material.PINK_TERRACOTTA); - ItemStack skill_2a = new ItemStack(Material.PINK_TERRACOTTA); - ItemStack skill_3a = new ItemStack(Material.PINK_TERRACOTTA); - ItemStack skill_1b = new ItemStack(Material.RED_TERRACOTTA); - ItemStack skill_2b = new ItemStack(Material.RED_TERRACOTTA); - ItemStack skill_3b = new ItemStack(Material.RED_TERRACOTTA); - ItemStack skill_1c = new ItemStack(Material.RED_TERRACOTTA); - ItemStack skill_2c = new ItemStack(Material.RED_TERRACOTTA); - ItemStack skill_3c = new ItemStack(Material.RED_TERRACOTTA); - ItemStack skill_M = new ItemStack(Material.RED_TERRACOTTA); - - - if (skill_1a_level == 0) { - skill_1a.setType(Material.PINK_TERRACOTTA); - } - else { - skill_1a.setType(Material.GREEN_TERRACOTTA); - } - - if (skill_1b_level == 0) { - skill_1b.setType(Material.PINK_TERRACOTTA); - } - else { - skill_1b.setType(Material.GREEN_TERRACOTTA); - } + switch (skill_1a_level) { + case 0: + desc = lang.getString("alchemyPerkDesc0_0") + " "; + desc += stringsAndOtherData.getPotionTypeString(1, p); + lores_line2[0] = desc; + break; + case 1: + desc = lang.getString("alchemyPerkDesc0_0") + " "; + desc += stringsAndOtherData.getPotionTypeString(2, p); + lores_line2[0] = desc; + break; + case 2: + desc = lang.getString("alchemyPerkDesc0_0") + " "; + desc += stringsAndOtherData.getPotionTypeString(3, p); + lores_line2[0] = desc; + break; + case 3: + desc = lang.getString("alchemyPerkDesc0_0") + " "; + desc += stringsAndOtherData.getPotionTypeString(4, p); + lores_line2[0] = desc; + break; + case 4: + desc = lang.getString("alchemyPerkDesc0_0") + " "; + desc += stringsAndOtherData.getPotionTypeString(5, p); + lores_line2[0] = desc; + break; + default: + break; + } + break; + case "enchanting": + special_index = 1; + desc = lang.getString("enchantingPerkDesc1_0") + " "; + StringsAndOtherData stringsAndOtherData1 = new StringsAndOtherData(); + switch (skill_2a_level) { + case 0: + desc += stringsAndOtherData1.getEnchantmentPerkDescString(1, p); + lores_line2[special_index] = desc; + break; + case 1: + desc += stringsAndOtherData1.getEnchantmentPerkDescString(2, p); + lores_line2[special_index] = desc; + break; + case 2: + desc += stringsAndOtherData1.getEnchantmentPerkDescString(3, p); + lores_line2[special_index] = desc; + break; + case 3: + desc += stringsAndOtherData1.getEnchantmentPerkDescString(4, p); + lores_line2[special_index] = desc; + break; + case 4: + desc += stringsAndOtherData1.getEnchantmentPerkDescString(5, p); + lores_line2[special_index] = desc; + break; + default: + break; + } + break; + case "repair": + special_index = 0; + switch (skill_1a_level) { + case 0: + case 1: + case 2: + case 3: + desc += lang.getString("repairPerkDesc0_1"); + lores_line2[special_index] = desc; + break; + case 4: + desc += lang.getString("repairPerkDesc0_2"); + lores_line2[special_index] = desc; + break; + default: + break; + } + break; + } + String[] lores_line1 = {"Level: 0/5", "Level: 0/5", "Level: 0/1"}; + String level = pStats.get(7).toString(); + lores_line1[0] = + ChatColor.GRAY + lang.getString("level") + " " + ChatColor.GREEN + level + "/5"; + level = pStats.get(9).toString(); + lores_line1[1] = + ChatColor.GRAY + lang.getString("level") + " " + ChatColor.GREEN + level + "/5"; + level = pStats.get(13).toString(); + lores_line1[2] = + ChatColor.GRAY + lang.getString("level") + " " + ChatColor.DARK_PURPLE + level + "/1"; + + Integer[] indices = {20, 23, 26}; + //Set skills + for (int i = 0; i < labels.length; i++) { + ItemMeta meta = menu_items[i].getItemMeta(); + meta.setDisplayName(ChatColor.BOLD + labels[i]); + ArrayList lore = new ArrayList<>(); + lore.add(lores_line1[i]); + String longString = lores_line2[i]; + ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); + for (int j = 0; j < splitDescs.size(); j++) { + lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); + } + meta.setLore(lore); + menu_items[i].setItemMeta(meta); + gui.setItem(indices[i], menu_items[i]); + } + + //Tokens, passives, and back button + ItemStack skill_token = new ItemStack(Material.GOLD_NUGGET); + ItemStack passive_1 = new ItemStack(Material.RED_DYE, 1); + ItemStack back_button = new ItemStack(Material.ARROW); + + ItemStack[] menu_items_2 = {back_button, skill_token, passive_1}; + String[] labels_2 = passivePerksMap.get(skillName); + String[] lores_line1_2 = {"", "Total: 0", "Chance: 0 %"}; + String[] lores_line2_2 = passiveDescriptionsMap.get(skillName); + + //Total skill tokens + lores_line1_2[1] = + ChatColor.BLUE + lang.getString("total") + ": " + ChatColor.GOLD + String.valueOf( + tokens_S); + if (tokens_S > 1 && tokens_S < 64) { + skill_token.setAmount(tokens_S); + } else if (tokens_S >= 64) { + skill_token.setAmount(64); + } + + double passive = passive1.doubleValue(); + switch (skillName) { + case "repair": + passive = passive; + //passive = Math.round(passive*1000)/1000.0d; + lores_line1_2[2] = + ChatColor.GRAY + lang.getString("level") + ": " + ChatColor.AQUA + String.valueOf( + passive); + break; + case "agility": + passive = passive * 0.05; + passive = Math.round(passive * 1000) / 1000.0d; + lores_line1_2[2] = ChatColor.GRAY + lang.getString("likelihood") + ": " + ChatColor.AQUA + + String.valueOf(passive) + "%"; + break; + case "enchanting": + passive = passive * 0.2; + passive = Math.round(passive * 1000) / 1000.0d; + lores_line1_2[2] = + ChatColor.GRAY + lang.getString("xpBoost") + ": " + ChatColor.AQUA + "+" + + String.valueOf(passive) + "%"; + break; + case "smelting": + passive = passive * 0.2; + passive = Math.round(passive * 1000) / 1000.0d; + lores_line1_2[2] = + ChatColor.GRAY + lang.getString("speedBoost") + ": " + ChatColor.AQUA + "+" + + String.valueOf(passive) + "%"; + break; + case "alchemy": + passive = passive * 0.1; + passive = Math.round(passive * 1000) / 1000.0d; + lores_line1_2[2] = + ChatColor.GRAY + lang.getString("timeExtension") + ": " + ChatColor.AQUA + "+" + + String.valueOf(passive) + "%"; + break; + default: + break; + } + + Integer[] indices_2 = {45, 0, 18}; + for (int i = 0; i < labels_2.length; i++) { + ItemMeta meta = menu_items_2[i].getItemMeta(); + meta.setDisplayName(ChatColor.BOLD + labels_2[i]); + ArrayList lore = new ArrayList<>(); + lore.add(lores_line1_2[i]); + String longString = lores_line2_2[i]; + ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); + for (int j = 0; j < splitDescs.size(); j++) { + lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); + } + ; + meta.setLore(lore); + menu_items_2[i].setItemMeta(meta); + gui.setItem(indices_2[i], menu_items_2[i]); + } + + //Crafting + if (skillName.equalsIgnoreCase("enchanting")) { + Integer[] indices_crafting = {39, 40, 41, 42, 43, 48, 49, 50, 51, 52}; + ItemStack[] crafting = {new ItemStack(Material.CRAFTING_TABLE), + new ItemStack(Material.CRAFTING_TABLE), + new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.CRAFTING_TABLE), + new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.CRAFTING_TABLE), + new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.CRAFTING_TABLE), + new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.CRAFTING_TABLE)}; + String[] craftingNames = stringsAndOtherData.getEnchantingCraftingNames(p); + int bookSmartLevel = (int) pStats.get(9); + for (int i = 0; i < craftingNames.length; i++) { + ArrayList lore = new ArrayList<>(); + ItemMeta craftingMeta = crafting[i].getItemMeta(); + if (bookSmartLevel >= Math.ceil((double) (i + 1) / 2.0)) { + lore.add(ChatColor.GREEN + ChatColor.ITALIC.toString() + lang.getString("unlocked")); + } else { + lore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked")); + } + craftingMeta.setDisplayName(ChatColor.BOLD + craftingNames[i]); + craftingMeta.setLore(lore); + crafting[i].setItemMeta(craftingMeta); + gui.setItem(indices_crafting[i], crafting[i]); + } + } else if (skillName.equalsIgnoreCase("alchemy")) { + Integer[] indices_crafting = {48, 49, 50, 51, 52}; + ItemStack[] crafting = {new ItemStack(Material.CRAFTING_TABLE), + new ItemStack(Material.CRAFTING_TABLE), + new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.CRAFTING_TABLE), + new ItemStack(Material.CRAFTING_TABLE)}; + String[] craftingNames = {stringsAndOtherData.getPotionTypeString(1, p), + stringsAndOtherData.getPotionTypeString(2, p), + stringsAndOtherData.getPotionTypeString(3, p), + stringsAndOtherData.getPotionTypeString(4, p), + stringsAndOtherData.getPotionTypeString(5, p)}; + int alchemicalSummoningLevel = (int) pStats.get(7); + for (int i = 0; i < craftingNames.length; i++) { + ArrayList lore = new ArrayList<>(); + ItemMeta craftingMeta = crafting[i].getItemMeta(); + if (alchemicalSummoningLevel > i) { + lore.add(ChatColor.GREEN + ChatColor.ITALIC.toString() + lang.getString("unlocked")); + } else { + lore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked")); + } + craftingMeta.setDisplayName(ChatColor.BOLD + craftingNames[i]); + craftingMeta.setLore(lore); + crafting[i].setItemMeta(craftingMeta); + gui.setItem(indices_crafting[i], crafting[i]); + } + Integer[] indices_brewing = {39, 40, 41, 42, 43}; + ItemStack[] brewing = {new ItemStack(Material.IRON_BARS), + new ItemStack(Material.IRON_BARS), + new ItemStack(Material.IRON_BARS), new ItemStack(Material.IRON_BARS), + new ItemStack(Material.IRON_BARS)}; + ItemGroups itemGroups = new ItemGroups(); + List brewingUnlocked = itemGroups.getNewIngredients(); + int ancientKnowledgeLevel = (int) pStats.get(9); + for (int i = 0; i < brewing.length; i++) { + String lvl = String.valueOf(i + 1); + ArrayList lore = new ArrayList<>(); + ItemStack brewingItem = brewing[i]; + ItemMeta brewingMeta = brewingItem.getItemMeta(); + brewingMeta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); + brewingMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); + brewingMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); + String brewingName = + lang.getString("alchemyPerkTitle1") + " " + lang.getString("lvl") + " " + lvl + " " + + lang.getString("ingredient"); + if (ancientKnowledgeLevel > i) { + brewingItem.setType(brewingUnlocked.get(i)); + lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + lang.getString("usedToBrew")); + lore.add(ChatColor.GRAY + stringsAndOtherData.getPotionEffectTypeString(i + 1, p)); + } else { + lore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked")); + } + brewingMeta.setDisplayName(ChatColor.WHITE + ChatColor.BOLD.toString() + brewingName); + brewingMeta.setLore(lore); + brewingItem.setItemMeta(brewingMeta); + gui.setItem(indices_brewing[i], brewingItem); - if (skill_1c_level == 0) { - skill_1c.setType(Material.PINK_TERRACOTTA); - } - else { - skill_1c.setType(Material.GREEN_TERRACOTTA); - } + } + } - if (skill_2a_level == 0) { - if (skill_1a_level == 1) { - skill_2a.setType(Material.PINK_TERRACOTTA); - } - else { - skill_2a.setType(Material.RED_TERRACOTTA); - } - } - else { - skill_2a.setType(Material.GREEN_TERRACOTTA); - } + //Souls (refunding) + ItemStack soul = new ItemStack(Material.COMPOSTER); + ItemMeta soulMeta = soul.getItemMeta(); + ArrayList soulLore = new ArrayList<>(); + soulMeta.setDisplayName(ChatColor.BOLD + lang.getString("refundSkillTitle")); + if ((int) pStatAll.get("global").get(9) < 1) { + soulLore.add(ChatColor.RED + ChatColor.ITALIC.toString() + lang.getString("locked")); + } else { + int souls = (int) pStatAll.get("global").get(20); + String soulsString = lang.getString("souls"); + String soulsCapitilized = UtilityMethods.capitalizeString(soulsString); + soulLore.add( + soulsCapitilized + ": " + ChatColor.AQUA + ChatColor.ITALIC.toString() + souls + "/" + + refundCost); + soulLore.add( + ChatColor.GRAY + ChatColor.ITALIC.toString() + lang.getString("refundSkillTreeDesc")); + soulLore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + "(-" + refundCost + " " + + lang.getString("souls") + ")"); + } + soulMeta.setLore(soulLore); + soul.setItemMeta(soulMeta); + gui.setItem(47, soul); + + ItemStack configItem = new ItemStack(Material.REDSTONE); + ItemMeta configItemMeta = configItem.getItemMeta(); + ArrayList configItemLore = new ArrayList<>(); + configItemMeta.setDisplayName(ChatColor.BOLD + lang.getString("configuration")); + configItemLore.addAll( + stringsAndOtherData.getStringLines(lang.getString("skillConfigDesc"))); + configItemMeta.setLore(configItemLore); + configItem.setItemMeta(configItemMeta); + gui.setItem(53, configItem); + + //Connectors + ItemStack connector = new ItemStack(Material.GLASS_PANE); + ItemMeta connectorMeta = connector.getItemMeta(); + connectorMeta.setDisplayName(ChatColor.WHITE.toString()); + connector.setItemMeta(connectorMeta); + Integer[] indices_3 = {21, 22, 24, 25}; + for (int i = 0; i < indices_3.length; i++) { + gui.setItem(indices_3[i], connector); + } + //Put the items in the inventory + p.openInventory(gui); - if (skill_2b_level == 0) { - if (skill_1b_level == 1) { - skill_2b.setType(Material.PINK_TERRACOTTA); - } - else { - skill_2b.setType(Material.RED_TERRACOTTA); - } - } - else { - skill_2b.setType(Material.GREEN_TERRACOTTA); - } + } else if (sender instanceof Player && labels_arr.indexOf(args[1]) > 10 && labels_arr.indexOf( + args[1]) == 15) { + ArrayList pStats = pStatAll.get(skillName); - if (skill_2c_level == 0) { - if (skill_1c_level == 1) { - skill_2c.setType(Material.PINK_TERRACOTTA); - } - else { - skill_2c.setType(Material.RED_TERRACOTTA); - } - } - else { - skill_2c.setType(Material.GREEN_TERRACOTTA); - } + int tokens_G = (Integer) pStats.get(1); + int skill_1a_level = (Integer) pStats.get(2); + int skill_1b_level = (Integer) pStats.get(3); + int skill_1c_level = (Integer) pStats.get(4); + int skill_2a_level = (Integer) pStats.get(5); + int skill_2b_level = (Integer) pStats.get(6); + int skill_2c_level = (Integer) pStats.get(7); + int skill_3a_level = (Integer) pStats.get(8); + int skill_3b_level = (Integer) pStats.get(9); + int skill_3c_level = (Integer) pStats.get(10); + int skill_M_level = (Integer) pStats.get(11); + + ItemStack skill_1a = new ItemStack(Material.PINK_TERRACOTTA); + ItemStack skill_2a = new ItemStack(Material.PINK_TERRACOTTA); + ItemStack skill_3a = new ItemStack(Material.PINK_TERRACOTTA); + ItemStack skill_1b = new ItemStack(Material.RED_TERRACOTTA); + ItemStack skill_2b = new ItemStack(Material.RED_TERRACOTTA); + ItemStack skill_3b = new ItemStack(Material.RED_TERRACOTTA); + ItemStack skill_1c = new ItemStack(Material.RED_TERRACOTTA); + ItemStack skill_2c = new ItemStack(Material.RED_TERRACOTTA); + ItemStack skill_3c = new ItemStack(Material.RED_TERRACOTTA); + ItemStack skill_M = new ItemStack(Material.RED_TERRACOTTA); - if (skill_3a_level == 0) { - if (skill_3b_level == 1) { - skill_3a.setType(Material.PINK_TERRACOTTA); - } - else { - skill_3a.setType(Material.RED_TERRACOTTA); - } - } - else { - skill_3a.setType(Material.GREEN_TERRACOTTA); - } + if (skill_1a_level == 0) { + skill_1a.setType(Material.PINK_TERRACOTTA); + } else { + skill_1a.setType(Material.GREEN_TERRACOTTA); + } - if (skill_3c_level == 0) { - if (skill_3b_level == 1) { - skill_3c.setType(Material.PINK_TERRACOTTA); - } - else { - skill_3c.setType(Material.RED_TERRACOTTA); - } - } - else { - skill_3c.setType(Material.GREEN_TERRACOTTA); - } + if (skill_1b_level == 0) { + skill_1b.setType(Material.PINK_TERRACOTTA); + } else { + skill_1b.setType(Material.GREEN_TERRACOTTA); + } - if (skill_3b_level == 0) { - if (skill_2a_level == 1 && skill_2b_level == 1 && skill_2c_level == 1) { - skill_3b.setType(Material.PINK_TERRACOTTA); - } - else { - skill_3b.setType(Material.RED_TERRACOTTA); - } - } - else { - skill_3b.setType(Material.GREEN_TERRACOTTA); - } + if (skill_1c_level == 0) { + skill_1c.setType(Material.PINK_TERRACOTTA); + } else { + skill_1c.setType(Material.GREEN_TERRACOTTA); + } - if (skill_M_level == 0) { - if (skill_3a_level == 1 && skill_3b_level == 1 && skill_3c_level == 1) { - skill_M.setType(Material.PINK_TERRACOTTA); - } - else { - skill_M.setType(Material.RED_TERRACOTTA); - } - } - else { - skill_M.setType(Material.GREEN_TERRACOTTA); - } + if (skill_2a_level == 0) { + if (skill_1a_level == 1) { + skill_2a.setType(Material.PINK_TERRACOTTA); + } else { + skill_2a.setType(Material.RED_TERRACOTTA); + } + } else { + skill_2a.setType(Material.GREEN_TERRACOTTA); + } - ItemStack[] menu_items = {skill_1a,skill_1b,skill_1c,skill_2a,skill_2b,skill_2c,skill_3a,skill_3b,skill_3c,skill_M}; - String[] labels = perksMap.get(skillName); - String[] lores_line2 = descriptionsMap.get(skillName); - String[] lores_line1 = {"1","2","3","4","5","6","7","8","9","10"}; //Data lines 7-13 - for (int i = 0; i < labels.length; i++) { - String level = pStats.get(2+i).toString(); - lores_line1[i] = ChatColor.GRAY + lang.getString("level")+" " + ChatColor.BLUE + level + "/1"; - if (i==9) { - lores_line1[i] = ChatColor.GRAY + lang.getString("level")+" " + ChatColor.DARK_PURPLE + level + "/1"; - } - } + if (skill_2b_level == 0) { + if (skill_1b_level == 1) { + skill_2b.setType(Material.PINK_TERRACOTTA); + } else { + skill_2b.setType(Material.RED_TERRACOTTA); + } + } else { + skill_2b.setType(Material.GREEN_TERRACOTTA); + } - Integer[] indices = {1,19,37,3,21,39,6,24,42,26}; - // - for (int i = 0; i < labels.length; i++) { - ItemMeta meta = menu_items[i].getItemMeta(); - meta.setDisplayName(ChatColor.BOLD + labels[i]); - ArrayList lore = new ArrayList<>(); - lore.add(lores_line1[i]); - String longString = lores_line2[i]; - ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); - for (int j = 0; j < splitDescs.size(); j++) { - lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); - } - meta.setLore(lore); - menu_items[i].setItemMeta(meta); - gui.setItem(indices[i], menu_items[i]); - } - ItemStack g_token = new ItemStack(Material.DIAMOND); - ItemStack back_button = new ItemStack(Material.ARROW); - ItemStack[] menu_items_2 = {g_token,back_button}; - String[] labels_2 = passivePerksMap.get(skillName); - String[] lores_line1_2 = {"Total: 0",""}; - String[] lores_line2_2 = passiveDescriptionsMap.get(skillName); - - //Total global Tokens - lores_line1_2[0] = ChatColor.BLUE + lang.getString("total")+": " + ChatColor.GOLD + String.valueOf(tokens_G); - if (tokens_G > 1 && tokens_G < 64){ - g_token.setAmount(tokens_G); - } - else if (tokens_G >= 64){ - g_token.setAmount(64); - } - Integer[] indices_2 = {0,45}; - for (int i = 0; i < labels_2.length; i++) { - ItemMeta meta = menu_items_2[i].getItemMeta(); - meta.setDisplayName(ChatColor.BOLD + labels_2[i]); - ArrayList lore = new ArrayList<>(); - lore.add(lores_line1_2[i]); - String longString = lores_line2_2[i]; - ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); - for (int j = 0; j < splitDescs.size(); j++) { - lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); - } - meta.setLore(lore); - menu_items_2[i].setItemMeta(meta); - gui.setItem(indices_2[i], menu_items_2[i]); - } - //Connectors - ItemStack connector = new ItemStack(Material.GLASS_PANE); - ItemMeta connectorMeta = connector.getItemMeta(); - connectorMeta.setDisplayName(ChatColor.WHITE.toString()); - connector.setItemMeta(connectorMeta); - Integer[] indices_3 = {2,4,7,8,13,15,17,20,22,23,25,31,33,35,38,40,43,44}; - for (int i = 0; i < indices_3.length; i++) { - gui.setItem(indices_3[i], connector); - } - //Put the items in the inventory - p.openInventory(gui); + if (skill_2c_level == 0) { + if (skill_1c_level == 1) { + skill_2c.setType(Material.PINK_TERRACOTTA); + } else { + skill_2c.setType(Material.RED_TERRACOTTA); + } + } else { + skill_2c.setType(Material.GREEN_TERRACOTTA); + } + if (skill_3a_level == 0) { + if (skill_3b_level == 1) { + skill_3a.setType(Material.PINK_TERRACOTTA); + } else { + skill_3a.setType(Material.RED_TERRACOTTA); + } + } else { + skill_3a.setType(Material.GREEN_TERRACOTTA); + } - } + if (skill_3c_level == 0) { + if (skill_3b_level == 1) { + skill_3c.setType(Material.PINK_TERRACOTTA); + } else { + skill_3c.setType(Material.RED_TERRACOTTA); + } + } else { + skill_3c.setType(Material.GREEN_TERRACOTTA); + } - else { - System.out.println("You need to be a player to cast this command"); - } + if (skill_3b_level == 0) { + if (skill_2a_level == 1 && skill_2b_level == 1 && skill_2c_level == 1) { + skill_3b.setType(Material.PINK_TERRACOTTA); + } else { + skill_3b.setType(Material.RED_TERRACOTTA); + } + } else { + skill_3b.setType(Material.GREEN_TERRACOTTA); } - else { - if (sender instanceof Player) { - Player p = (Player) sender; - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(ChatColor.RED + lang.getString("unknownCommand")); - } - else { - sender.sendMessage("Unknown command"); - } + if (skill_M_level == 0) { + if (skill_3a_level == 1 && skill_3b_level == 1 && skill_3c_level == 1) { + skill_M.setType(Material.PINK_TERRACOTTA); + } else { + skill_M.setType(Material.RED_TERRACOTTA); + } + } else { + skill_M.setType(Material.GREEN_TERRACOTTA); + } + + ItemStack[] menu_items = {skill_1a, skill_1b, skill_1c, skill_2a, skill_2b, skill_2c, + skill_3a, skill_3b, skill_3c, skill_M}; + String[] labels = perksMap.get(skillName); + String[] lores_line2 = descriptionsMap.get(skillName); + String[] lores_line1 = {"1", "2", "3", "4", "5", "6", "7", "8", "9", + "10"}; //Data lines 7-13 + for (int i = 0; i < labels.length; i++) { + String level = pStats.get(2 + i).toString(); + lores_line1[i] = + ChatColor.GRAY + lang.getString("level") + " " + ChatColor.BLUE + level + "/1"; + if (i == 9) { + lores_line1[i] = + ChatColor.GRAY + lang.getString("level") + " " + ChatColor.DARK_PURPLE + level + + "/1"; + } + } + + Integer[] indices = {1, 19, 37, 3, 21, 39, 6, 24, 42, 26}; + // + for (int i = 0; i < labels.length; i++) { + ItemMeta meta = menu_items[i].getItemMeta(); + meta.setDisplayName(ChatColor.BOLD + labels[i]); + ArrayList lore = new ArrayList<>(); + lore.add(lores_line1[i]); + String longString = lores_line2[i]; + ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); + for (int j = 0; j < splitDescs.size(); j++) { + lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); + } + meta.setLore(lore); + menu_items[i].setItemMeta(meta); + gui.setItem(indices[i], menu_items[i]); + } + ItemStack g_token = new ItemStack(Material.DIAMOND); + ItemStack back_button = new ItemStack(Material.ARROW); + ItemStack[] menu_items_2 = {g_token, back_button}; + String[] labels_2 = passivePerksMap.get(skillName); + String[] lores_line1_2 = {"Total: 0", ""}; + String[] lores_line2_2 = passiveDescriptionsMap.get(skillName); + + //Total global Tokens + lores_line1_2[0] = + ChatColor.BLUE + lang.getString("total") + ": " + ChatColor.GOLD + String.valueOf( + tokens_G); + if (tokens_G > 1 && tokens_G < 64) { + g_token.setAmount(tokens_G); + } else if (tokens_G >= 64) { + g_token.setAmount(64); + } + Integer[] indices_2 = {0, 45}; + for (int i = 0; i < labels_2.length; i++) { + ItemMeta meta = menu_items_2[i].getItemMeta(); + meta.setDisplayName(ChatColor.BOLD + labels_2[i]); + ArrayList lore = new ArrayList<>(); + lore.add(lores_line1_2[i]); + String longString = lores_line2_2[i]; + ArrayList splitDescs = stringsAndOtherData.getStringLines(longString); + for (int j = 0; j < splitDescs.size(); j++) { + lore.add(ChatColor.GRAY + ChatColor.ITALIC.toString() + splitDescs.get(j)); + } + meta.setLore(lore); + menu_items_2[i].setItemMeta(meta); + gui.setItem(indices_2[i], menu_items_2[i]); + } + //Connectors + ItemStack connector = new ItemStack(Material.GLASS_PANE); + ItemMeta connectorMeta = connector.getItemMeta(); + connectorMeta.setDisplayName(ChatColor.WHITE.toString()); + connector.setItemMeta(connectorMeta); + Integer[] indices_3 = {2, 4, 7, 8, 13, 15, 17, 20, 22, 23, 25, 31, 33, 35, 38, 40, 43, 44}; + for (int i = 0; i < indices_3.length; i++) { + gui.setItem(indices_3[i], connector); } + //Put the items in the inventory + p.openInventory(gui); - return true; + + } else { + System.out.println("You need to be a player to cast this command"); + } + } else { + if (sender instanceof Player) { + Player p = (Player) sender; + LanguageSelector lang = new LanguageSelector(p); + p.sendMessage(ChatColor.RED + lang.getString("unknownCommand")); + } else { + sender.sendMessage("Unknown command"); + } } + + return true; + } } diff --git a/src/main/java/mc/carlton/freerpg/commands/SpiteQuote.java b/src/main/java/mc/carlton/freerpg/commands/SpiteQuote.java index f7418e5..54aed04 100644 --- a/src/main/java/mc/carlton/freerpg/commands/SpiteQuote.java +++ b/src/main/java/mc/carlton/freerpg/commands/SpiteQuote.java @@ -1,7 +1,9 @@ package mc.carlton.freerpg.commands; -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.globalVariables.StringsAndOtherData; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import mc.carlton.freerpg.utils.globalVariables.StringsAndOtherData; +import org.apache.logging.log4j.Level; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; @@ -10,18 +12,19 @@ public class SpiteQuote implements CommandExecutor { - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (sender instanceof Player) { - Player p = (Player) sender; - LanguageSelector langManager = new LanguageSelector(p); - p.sendMessage(ChatColor.ITALIC + langManager.getString("spite")); - } else { - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - String version = stringsAndOtherData.getVersion(); - System.out.println("[COMMAND_OUT] Running FreeRPG version " + version); - } - return true; + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if (sender instanceof Player) { + Player p = (Player) sender; + LanguageSelector langManager = new LanguageSelector(p); + p.sendMessage(ChatColor.ITALIC + langManager.getString("spite")); + } else { + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + String version = stringsAndOtherData.getVersion(); + FreeRPG.log(Level.INFO, "[COMMAND_OUT] Running FreeRPG version " + version); } + return true; + } } diff --git a/src/main/java/mc/carlton/freerpg/config/ConfigLoad.java b/src/main/java/mc/carlton/freerpg/config/ConfigLoad.java new file mode 100644 index 0000000..38afce7 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/config/ConfigLoad.java @@ -0,0 +1,632 @@ +package mc.carlton.freerpg.config; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.customContainers.OldCustomPotion; +import mc.carlton.freerpg.customContainers.collections.OldCustomRecipe; +import org.apache.logging.log4j.Level; +import org.bukkit.Color; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.enchantments.EnchantmentWrapper; +import org.bukkit.plugin.Plugin; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.potion.PotionType; + +public class ConfigLoad { + + static int playerStatFilesLoadedInOnStartup; + static boolean forceLanguage; + static double basePlayerHP; + static boolean saveRunTimeData; + static boolean verboseRunTimeData; + static int saveStatsTimer; + static String defaultLanguage; + static boolean allowExplosions; + static boolean allowBuild; + static boolean allowPvP; + static boolean allowHurtAnimals; + static int furnaceDeleteTimer; + static boolean getEXPFromEnchantingBottles; + static boolean trackFewerBlocks; + static boolean flamePickGiveXP; + static boolean shiftRightClickInvestAll; + static int veinMinerMaxBreakSize; + static int superBaitCooldown; + static boolean leaderboardDyanmicUpdate; + static int leaderboardUpdateTimer; + static boolean preventUnsafeRepair; + static boolean preventUnsafeSalvage; + static boolean earnExperiencePastMaxLevel; + static double agilityMinSprintTimeForExperience; + static int maxLevelForBeginnerMessage; + static String beginnerLevelUpMessage; + static boolean advancedKeepinventory; + static Map specialMultiplier = new HashMap<>(); + static Map maxLevels = new HashMap<>(); + static ArrayList soulsInfo = new ArrayList<>(); + static ArrayList multipliers = new ArrayList<>(); + static ArrayList tokensInfo = new ArrayList<>(); + static ArrayList levelingInfo = new ArrayList<>(); + static ArrayList diggingInfo = new ArrayList<>(); + static ArrayList woodcuttingInfo = new ArrayList<>(); + static ArrayList fishingInfo = new ArrayList<>(); + static ArrayList fishingInfoBaseChances = new ArrayList<>(); + static ArrayList fishingInfoHotRod = new ArrayList<>(); + static ArrayList fishingInfoEnchants = new ArrayList<>(); + static Map allowedSkillsMap = new HashMap<>(); + static Map allowedSkillGainEXPMap = new HashMap<>(); + static Map alchemyInfo = new HashMap<>(); + static Map> expMap = new HashMap<>(); + static Map craftingRecipes = new HashMap<>(); + static HashSet veinMinerBlocks = new HashSet<>(); + static ArrayList timberBreakLimits = new ArrayList<>(); + static Map abilityCooldowns = new HashMap<>(); + static Map spawnerEXPMultipliers = new HashMap<>(); + static Map mobFarmEXPMultipliers = new HashMap<>(); + static Map durabilityModifiers = new HashMap<>(); + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + public void initializeConfig() { + setConfigData(); + } + + + public void setConfigData() { + File f = new File(plugin.getDataFolder(), "config.yml"); + f.setReadable(true, false); + f.setWritable(true, false); + FileConfiguration config = YamlConfiguration.loadConfiguration(f); + File f1 = new File(plugin.getDataFolder(), "advancedConfig.yml"); + f.setReadable(true, false); + f.setWritable(true, false); + FileConfiguration advancedConfig = YamlConfiguration.loadConfiguration(f1); + + //Useful Label Groups: + String[] labels = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + String[] combatLabels = {"archery", "beastMastery", "swordsmanship", "defense", "axeMastery"}; + + //General Config and Config that has no real category + defaultLanguage = config.getString("general.defaultLanguage"); + //basePlayerHP = config.getDouble("general.playerBaseHP"); + forceLanguage = config.getBoolean("general.forceLanguage"); + playerStatFilesLoadedInOnStartup = advancedConfig.getInt( + "general.playerStatFilesLoadedInOnStartup"); + saveRunTimeData = advancedConfig.getBoolean("general.saveRunTimeData"); + verboseRunTimeData = advancedConfig.getBoolean("general.verboseRunTimeData"); + saveStatsTimer = advancedConfig.getInt("general.saveStatsTimer"); + allowExplosions = advancedConfig.getBoolean("general.allowCustomExplosions"); + allowBuild = advancedConfig.getBoolean("general.allowBuild"); + allowPvP = advancedConfig.getBoolean("general.allowPvP"); + allowHurtAnimals = advancedConfig.getBoolean("general.allowHurtAnimals"); + furnaceDeleteTimer = advancedConfig.getInt("smelting.removePlayerFurnacesTimer"); + trackFewerBlocks = advancedConfig.getBoolean("general.trackFewerBlocks"); + leaderboardDyanmicUpdate = advancedConfig.getBoolean("general.leaderboardDynamicUpdate"); + leaderboardUpdateTimer = advancedConfig.getInt("general.leaderboardUpdateTimer"); + getEXPFromEnchantingBottles = advancedConfig.getBoolean( + "enchanting.gainEXPfromEnchantingBottles"); + flamePickGiveXP = advancedConfig.getBoolean("smelting.flamePickGiveMinecraftXP"); + preventUnsafeRepair = advancedConfig.getBoolean( + "repair.preventRepairOfItemsWithUnsafeEnchantments"); + preventUnsafeSalvage = advancedConfig.getBoolean( + "repair.preventSalvageOfItemsWithUnsafeEnchantments"); + maxLevelForBeginnerMessage = advancedConfig.getInt("leveling.beginnerLevelUpMessageMaxLevel"); + beginnerLevelUpMessage = advancedConfig.getString("leveling.customBegginerLevelUpMessage"); + advancedKeepinventory = advancedConfig.getBoolean("general.keepInventoryOn"); + List veinMinerBlockStrings = advancedConfig.getStringList("mining.veinMinerBlocks"); + for (String matString : veinMinerBlockStrings) { + if (Material.matchMaterial(matString) != null) { + veinMinerBlocks.add(Material.matchMaterial(matString)); + } + } + veinMinerMaxBreakSize = advancedConfig.getInt("mining.veinMinerMaximumBlocksBroken"); + timberBreakLimits.add(advancedConfig.getInt("woodcutting.timberMaxBreakInitial")); + timberBreakLimits.add(advancedConfig.getInt("woodcutting.timberMaxBreakUpgraded")); + shiftRightClickInvestAll = advancedConfig.getBoolean( + "tokens.passiveShiftClickAndRightClickInvestAll"); + superBaitCooldown = advancedConfig.getInt("fishing.superBaitCooldown"); + earnExperiencePastMaxLevel = config.getBoolean("leveling.earnExperiencePastMaxLevel"); + agilityMinSprintTimeForExperience = advancedConfig.getDouble("agility.sprintTimeThreshold"); + + maxLevels.put("global", Integer.valueOf(config.getString("leveling.maxLevel"))); + allowedSkillsMap.put("global", config.getBoolean("global.skillAllowed")); + for (String label : labels) { + maxLevels.put(label, Integer.valueOf(config.getString(label + ".maxLevel"))); + allowedSkillsMap.put(label, config.getBoolean(label + ".skillAllowed")); + abilityCooldowns.put(label, config.getInt(label + ".abilityCooldown")); + allowedSkillGainEXPMap.put(label, + advancedConfig.getBoolean(label + ".expDrops.enableEXPDrops")); + } + abilityCooldowns.put("robCooldown", advancedConfig.getInt("fishing.robCooldown")); + + durabilityModifiers.put("megaDig", + advancedConfig.getDouble("digging.megaDigDurabilityModifier")); + durabilityModifiers.put("timber", + advancedConfig.getDouble("woodcutting.timberDurabilityModifier")); + durabilityModifiers.put("leafBlower", + advancedConfig.getDouble("woodcutting.leafBlowerDurabilityModifier")); + durabilityModifiers.put("veinMiner", + advancedConfig.getDouble("mining.veinMinerDurabilityModifier")); + durabilityModifiers.put("flamePick", + advancedConfig.getDouble("smelting.smeltingDurabilityModifier")); + + //Config that is skill dependant (not used in all skills) + for (String label : combatLabels) { + spawnerEXPMultipliers.put(label, + advancedConfig.getDouble(label + ".spawnerMobsEXPMultiplier")); + mobFarmEXPMultipliers.put(label, advancedConfig.getDouble(label + ".mobFarmEXPMultiplier")); + } + + soulsInfo.add(Integer.valueOf(advancedConfig.getString("souls.startingSouls"))); + soulsInfo.add(Integer.valueOf(advancedConfig.getString("souls.refundCost"))); + + multipliers.add(Double.valueOf(config.getString("global.EXP_Multiplier"))); + for (String label : labels) { + multipliers.add(config.getDouble(label + ".EXP_Multiplier")); + } + + tokensInfo.add( + Double.valueOf(advancedConfig.getString("tokens.levelsPerAutomaticPassiveUpgrade"))); + tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.levelsPerPassiveToken"))); + tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.levelsPerSkillToken"))); + tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.levelsPerGlobalToken"))); + tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.startingPassiveTokens"))); + tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.startingSkillTokens"))); + tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.startingGlobalTokens"))); + tokensInfo.add( + Double.valueOf(advancedConfig.getString("tokens.skillTokenToPassiveTokenConversion"))); + tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.globalTokenToEXPbuff"))); + tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.passiveRightClickInvestment"))); + tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.passiveShiftClickInvestment"))); + + levelingInfo.add(Double.valueOf(config.getString("leveling.maxLevel"))); + levelingInfo.add(Double.valueOf(advancedConfig.getString("leveling.exponentialGrowthFactor"))); + levelingInfo.add( + Double.valueOf(advancedConfig.getString("leveling.exponentialReferenceLevel"))); + levelingInfo.add(Double.valueOf(advancedConfig.getString("leveling.exponentialReferenceEXP"))); + levelingInfo.add(Double.valueOf(advancedConfig.getString("leveling.levelBeginLinear"))); + levelingInfo.add(Double.valueOf(advancedConfig.getString("leveling.LinearEXPperLevel"))); + + for (int i = 1; i <= 9; i++) { + diggingInfo.add( + Material.matchMaterial(advancedConfig.getString("digging.drops.drop" + i + "Name"))); + diggingInfo.add( + Integer.valueOf(advancedConfig.getString("digging.drops.drop" + i + "Amount"))); + } + for (int i = 10; i <= 15; i++) { + diggingInfo.add( + Material.matchMaterial(advancedConfig.getString("digging.drops.drop" + i + "Name"))); + diggingInfo.add( + Integer.valueOf(advancedConfig.getString("digging.drops.drop" + i + "Amount"))); + diggingInfo.add( + Double.valueOf(advancedConfig.getString("digging.drops.drop" + i + "BaseChance"))); + } + + for (int i = 1; i <= 5; i++) { + woodcuttingInfo.add(Material.matchMaterial( + advancedConfig.getString("woodcutting.drops.leavesDrop" + i + "Name"))); + woodcuttingInfo.add( + Integer.valueOf(advancedConfig.getString("woodcutting.drops.leavesDrop" + i + "Amount"))); + woodcuttingInfo.add( + Double.valueOf(advancedConfig.getString("woodcutting.drops.leavesDrop" + i + "Chance"))); + } + + fishingInfoBaseChances.add( + Double.valueOf(advancedConfig.getString("fishing.drops.tier1_baseChance"))); + fishingInfoBaseChances.add( + Double.valueOf(advancedConfig.getString("fishing.drops.tier2_baseChance"))); + fishingInfoBaseChances.add( + Double.valueOf(advancedConfig.getString("fishing.drops.tier3_baseChance"))); + fishingInfoBaseChances.add( + Double.valueOf(advancedConfig.getString("fishing.drops.tier4_baseChance"))); + fishingInfoBaseChances.add( + Double.valueOf(advancedConfig.getString("fishing.drops.tier5_baseChance"))); + + fishingInfoEnchants.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier1_enchantedArmor"))); + fishingInfoEnchants.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_enchantedArmor"))); + fishingInfoEnchants.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier3_enchantedArmor"))); + fishingInfoEnchants.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier4_enchantedArmor"))); + fishingInfoEnchants.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier5_enchantedArmor"))); + + for (int i = 1; i <= 5; i++) { + for (int j = 1; j <= 4; j++) { + fishingInfo.add(Material.matchMaterial( + advancedConfig.getString("fishing.drops.tier" + i + "_drop" + j + "Name"))); + fishingInfo.add(Integer.valueOf( + advancedConfig.getString("fishing.drops.tier" + i + "_drop" + j + "Amount"))); + fishingInfo.add(Integer.valueOf( + advancedConfig.getString("fishing.drops.tier" + i + "_drop" + j + "Random"))); + } + } + + fishingInfoHotRod.add( + Material.matchMaterial(advancedConfig.getString("fishing.drops.tier1_drop1Name_HotRod"))); + fishingInfoHotRod.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier1_drop1Amount_HotRod"))); + fishingInfoHotRod.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier1_drop1Random_HotRod"))); + fishingInfoHotRod.add( + Material.matchMaterial(advancedConfig.getString("fishing.drops.tier1_drop2Name_HotRod"))); + fishingInfoHotRod.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier1_drop2Amount_HotRod"))); + fishingInfoHotRod.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier1_drop2Random_HotRod"))); + fishingInfoHotRod.add( + Material.matchMaterial(advancedConfig.getString("fishing.drops.tier2_drop1Name_HotRod"))); + fishingInfoHotRod.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop1Amount_HotRod"))); + fishingInfoHotRod.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop1Random_HotRod"))); + fishingInfoHotRod.add( + Material.matchMaterial(advancedConfig.getString("fishing.drops.tier2_drop3Name_HotRod"))); + fishingInfoHotRod.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop3Amount_HotRod"))); + fishingInfoHotRod.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop3Random_HotRod"))); + fishingInfoHotRod.add( + Material.matchMaterial(advancedConfig.getString("fishing.drops.tier2_drop4Name_HotRod"))); + fishingInfoHotRod.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop4Amount_HotRod"))); + fishingInfoHotRod.add( + Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop4Random_HotRod"))); + + //Alchemy Info + for (int i = 1; i <= 5; i++) { + OldCustomPotion customPotion = new OldCustomPotion(); + customPotion.setPotionEffectType(PotionEffectType.getByName( + advancedConfig.getString("alchemy.customPotions.potionType" + i))); + customPotion.setIngredient(Material.matchMaterial( + advancedConfig.getString("alchemy.customPotions.potionIngredient" + i))); + customPotion.setPotionDuration( + advancedConfig.getInt("alchemy.customPotions.potionDuration" + i)); + customPotion.setColor( + getColorFromString(advancedConfig.getString("alchemy.customPotions.potionColor" + i))); + customPotion.setPotionName(); + alchemyInfo.put("customPotion" + i, customPotion); + } + + //EXP Info + for (String label : labels) { + Map skillExpMap = new HashMap<>(); + ConfigurationSection skillExpDrops = advancedConfig.getConfigurationSection( + label + ".expDrops"); + for (String id : skillExpDrops.getKeys(false)) { + if (!id.equalsIgnoreCase("enableEXPDrops")) { + skillExpMap.put(id, advancedConfig.getInt(label + ".expDrops." + id)); + } + } + expMap.put(label, skillExpMap); + } + + //Special Multipliers + specialMultiplier.put("megaDigEXPMultiplier", + advancedConfig.getDouble("digging.megaDigEXPMultiplier")); + specialMultiplier.put("superBaitEXPMultiplier", + advancedConfig.getDouble("fishing.superBaitEXPMultiplier")); + specialMultiplier.put("timberEXPMultiplier", + advancedConfig.getDouble("woodcutting.timberEXPMultiplier")); + specialMultiplier.put("blockingEXPMultiplier", + advancedConfig.getDouble("defense.blockingEXPMultiplier")); + + //Crafting arrays + for (int i = 1; i <= 5; i++) { + OldCustomRecipe oldCustomRecipe = new OldCustomRecipe(); + oldCustomRecipe.setOutput( + Material.matchMaterial(advancedConfig.getString("farming.crafting.recipeOutput" + i))); + oldCustomRecipe.setOutputAmount( + advancedConfig.getInt("farming.crafting.recipeOutputAmount" + i)); + List recipeStrings = advancedConfig.getStringList("farming.crafting.recipe" + i); + ArrayList recipeMaterials = new ArrayList<>(); + for (String item : recipeStrings) { + Material recipeMaterial = Material.matchMaterial(item); + if (recipeMaterial == null) { + FreeRPG.log(Level.WARN, "[FreeRPG] WARNING: Unrecognized Material in " + + "farming.crafting.recipe" + i + "(Some materials will be treated as air"); + } + recipeMaterials.add(recipeMaterial); + } + oldCustomRecipe.setRecipe(recipeMaterials); + oldCustomRecipe.setYAML_ID("farming.crafting.recipe" + i); + craftingRecipes.put("farming" + i, oldCustomRecipe); + } + for (int i = 1; i <= 10; i++) { + OldCustomRecipe oldCustomRecipe = new OldCustomRecipe(); + oldCustomRecipe.setOutput( + Material.matchMaterial(advancedConfig.getString("enchanting.crafting.recipeOutput" + i))); + oldCustomRecipe.setOutputAmount( + advancedConfig.getInt("enchanting.crafting.recipeOutputAmount" + i)); + String enchantType = advancedConfig.getString("enchanting.crafting.recipeEnchant" + i); + if (!enchantType.equalsIgnoreCase("none")) { + oldCustomRecipe.setEnchantment( + EnchantmentWrapper.getByKey(NamespacedKey.minecraft(enchantType))); + oldCustomRecipe.setEnchantmentLevel( + advancedConfig.getInt("enchanting.crafting.recipeEnchantLevel" + i)); + oldCustomRecipe.setXPcraftCost( + advancedConfig.getInt("enchanting.crafting.XPcostToCraft" + i)); + } + List recipeStrings = advancedConfig.getStringList("enchanting.crafting.recipe" + i); + ArrayList recipeMaterials = new ArrayList<>(); + for (String item : recipeStrings) { + Material recipeMaterial = Material.matchMaterial(item); + if (recipeMaterial == null) { + FreeRPG.log(Level.WARN, "[FreeRPG] WARNING: Unrecognized Material in " + + "enchanting.crafting.recipe" + i + "(Some materials will be treated as air"); + } + recipeMaterials.add(recipeMaterial); + } + oldCustomRecipe.setRecipe(recipeMaterials); + oldCustomRecipe.setYAML_ID("enchanting.crafting.recipe" + i); + craftingRecipes.put("enchanting" + i, oldCustomRecipe); + } + for (int i = 1; i <= 5; i++) { + OldCustomRecipe oldCustomRecipe = new OldCustomRecipe(); + String materialString = advancedConfig.getString("alchemy.crafting.recipeOutput" + i); + oldCustomRecipe.setOutput(Material.matchMaterial(materialString)); + oldCustomRecipe.setOutputAmount( + advancedConfig.getInt("alchemy.crafting.recipeOutputAmount" + i)); + if (materialString.equalsIgnoreCase("POTION")) { + oldCustomRecipe.setPotionType( + PotionType.valueOf(advancedConfig.getString("alchemy.crafting.recipePotionType" + i))); + oldCustomRecipe.setExtended( + advancedConfig.getBoolean("alchemy.crafting.recipePotionExtended" + i)); + oldCustomRecipe.setUpgraded( + advancedConfig.getBoolean("alchemy.crafting.recipePotionUpgraded" + i)); + } + List recipeStrings = advancedConfig.getStringList("alchemy.crafting.recipe" + i); + ArrayList recipeMaterials = new ArrayList<>(); + for (String item : recipeStrings) { + Material recipeMaterial = Material.matchMaterial(item); + if (recipeMaterial == null) { + FreeRPG.log(Level.WARN, "[FreeRPG] WARNING: Unrecognized Material in " + + "alchemy.crafting.recipe" + i + "(Some materials will be treated as air"); + } + recipeMaterials.add(recipeMaterial); + } + oldCustomRecipe.setRecipe(recipeMaterials); + oldCustomRecipe.setYAML_ID("alchemy.crafting.recipe" + i); + craftingRecipes.put("alchemy" + i, oldCustomRecipe); + } + + } + + public Color getColorFromString(String colorString) { + colorString = colorString.substring(1, colorString.length() - 1); + List RGB = Arrays.asList(colorString.trim().split(",")); + int red = 0; + int green = 0; + int blue = 0; + if (RGB.size() == 3) { + red = Integer.parseInt(RGB.get(0)); + green = Integer.parseInt(RGB.get(1)); + blue = Integer.parseInt(RGB.get(2)); + } + return Color.fromRGB(red, green, blue); + } + + public int getSaveStatsTimer() { + return saveStatsTimer; + } + + public String getDefaultLanguage() { + return defaultLanguage; + } + + public void setDefaultLanguage(String languageCode) { + defaultLanguage = languageCode; + } + + public boolean isAllowExplosions() { + return allowExplosions; + } + + public boolean isAllowBuild() { + return allowBuild; + } + + public boolean isAllowPvP() { + return allowPvP; + } + + public boolean isAllowHurtAnimals() { + return allowHurtAnimals; + } + + public Map getMaxLevels() { + return maxLevels; + } + + public ArrayList getSoulsInfo() { + return soulsInfo; + } + + public ArrayList getMultipliers() { + return multipliers; + } + + public ArrayList getTokensInfo() { + return tokensInfo; + } + + public ArrayList getLevelingInfo() { + return levelingInfo; + } + + public ArrayList getDiggingInfo() { + return diggingInfo; + } + + public ArrayList getWoodcuttingInfo() { + return woodcuttingInfo; + } + + public ArrayList getFishingInfo1() { + return fishingInfo; + } + + public ArrayList getFishingInfo2() { + return fishingInfoBaseChances; + } + + public ArrayList getFishingInfo3() { + return fishingInfoHotRod; + } + + public ArrayList getFishingInfo4() { + return fishingInfoEnchants; + } + + public boolean isGetEXPFromEnchantingBottles() { + return getEXPFromEnchantingBottles; + } + + public boolean isSaveRunTimeData() { + return saveRunTimeData; + } + + public boolean isVerboseRunTimeData() { + return verboseRunTimeData; + } + + public int getFurnaceDeleteTimer() { + return furnaceDeleteTimer; + } + + public Map getAllowedSkillsMap() { + return allowedSkillsMap; + } + + public Map getAllowedSkillGainEXPMap() { + return allowedSkillGainEXPMap; + } + + public Map getAlchemyInfo() { + return alchemyInfo; + } + + public Map> getExpMap() { + return expMap; + } + + public Map getExpMapForSkill(String skillName) { + if (expMap.containsKey(skillName)) { + return expMap.get(skillName); + } + return null; + } + + public Map getSpecialMultiplier() { + return specialMultiplier; + } + + public Map getCraftingRecipes() { + return craftingRecipes; + } + + public boolean isTrackFewerBlocks() { + return trackFewerBlocks; + } + + public boolean isFlamePickGiveXP() { + return flamePickGiveXP; + } + + public HashSet getVeinMinerBlocks() { + return veinMinerBlocks; + } + + public int getVeinMinerMaxBreakSize() { + return veinMinerMaxBreakSize; + } + + public ArrayList getTimberBreakLimits() { + return timberBreakLimits; + } + + public Map getAbilityCooldowns() { + return abilityCooldowns; + } + + public boolean isShiftRightClickInvestAll() { + return shiftRightClickInvestAll; + } + + public Map getMobFarmEXPMultipliers() { + return mobFarmEXPMultipliers; + } + + public Map getSpawnerEXPMultipliers() { + return spawnerEXPMultipliers; + } + + public int getPlayerStatFilesLoadedInOnStartup() { + return playerStatFilesLoadedInOnStartup; + } + + public double getBasePlayerHP() { + return basePlayerHP; + } + + public int getSuperBaitCooldown() { + return superBaitCooldown; + } + + public int getLeaderboardUpdateTimer() { + return leaderboardUpdateTimer; + } + + public boolean isLeaderboardDyanmicUpdate() { + return leaderboardDyanmicUpdate; + } + + public boolean isPreventUnsafeRepair() { + return preventUnsafeRepair; + } + + public boolean isPreventUnsafeSalvage() { + return preventUnsafeSalvage; + } + + public boolean isEarnExperiencePastMaxLevel() { + return earnExperiencePastMaxLevel; + } + + public double getAgilityMinSprintTimeForExperience() { + return agilityMinSprintTimeForExperience; + } + + public Map getDurabilityModifiers() { + return durabilityModifiers; + } + + public int getMaxLevelForBeginnerMessage() { + return maxLevelForBeginnerMessage; + } + + public String getBeginnerLevelUpMessage() { + return beginnerLevelUpMessage; + } + + public boolean isKeepinventory() { + return advancedKeepinventory; + } + + public boolean isForceLanguage() { + return forceLanguage; + } +} diff --git a/src/main/java/mc/carlton/freerpg/config/PerkConfig.java b/src/main/java/mc/carlton/freerpg/config/PerkConfig.java new file mode 100644 index 0000000..277b32c --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/config/PerkConfig.java @@ -0,0 +1,212 @@ +package mc.carlton.freerpg.config; + +import java.io.File; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.customContainers.CustomContainerImporter; +import mc.carlton.freerpg.customContainers.collections.CustomEffect; +import mc.carlton.freerpg.skills.SkillName; +import mc.carlton.freerpg.skills.skillAndPerkInfo.LowestLevelInfo; +import mc.carlton.freerpg.skills.skillAndPerkInfo.PassivePerkInfo; +import mc.carlton.freerpg.skills.skillAndPerkInfo.PerkInfo; +import mc.carlton.freerpg.skills.skillAndPerkInfo.SkillPerkInfo; +import mc.carlton.freerpg.skills.skillAndPerkInfo.SkillPerkLevelInfo; +import mc.carlton.freerpg.skills.skillAndPerkInfo.SkillTreeInfo; +import mc.carlton.freerpg.utils.UtilityMethods; +import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; + +public class PerkConfig { + + private static final List DROP_TABLE_KEYS = Arrays.asList( + new String[]{"dropTable", "dropsAdded"}); + private static final List MOB_DROP_TABLE_KEYS = Arrays.asList( + new String[]{"mobDropTable", "entityDropTable"}); + private static final List MOB_LIST_KEYS = Arrays.asList( + new String[]{"mobList", "entityList", "entityTypeList"}); + private static final List MATERIAL_LIST_KEYS = Arrays.asList( + new String[]{"itemList", "blockList"}); + private static final List DAMAGE_LIST_KEYS = Arrays.asList( + new String[]{"damageTypeList", "damageCauseList"}); + private static final List CUSTOM_RECIPE_LIST_KEYS = Arrays.asList( + new String[]{"recipes", "customRecipes"}); + private static final List CUSTOM_DROP_MAP_KEYS = Arrays.asList( + new String[]{"dropChanges", "changedDrops"}); + private static final List POTION_DATA_LIST_KEYS = Arrays.asList( + new String[]{"potionDataList", "potionTypeList"}); + private static final List CUSTOM_POTION_KEYS = Arrays.asList( + new String[]{"decreasingTiers", "increasingTiers"}); + private static final List CUSTOM_EFFECTS_GIVEN_KEYS = Arrays.asList( + new String[]{"effectsGiven", "customEffect"}); + private static final List SPECIAL_KEYS = Arrays.asList( + new String[]{"decreasingTiers", "increasingTiers", "affectedMobs", "added-enchantmentList", + "changedEffects"}); + private static final List IGNORED_KEYS = Arrays.asList( + new String[]{"effectChance", "activationChance", "enabled", "startingValue", "allowedRange", + "changePerLevel"}); + private static final String ENABLED = "enabled"; + private static final String EFFECT_CHANCE = "effectChance"; + static private Map allPerkInfo = new HashMap<>(); + + static public void readInAllPerkInfo(FileConfiguration config) { + for (String skillNameString : config.getKeys(false)) { + SkillName skillName = SkillName.matchSkillName(skillNameString); + if (skillName != null) { + allPerkInfo.put(skillName, + getSkillTreeInfoFromConfig(skillName, config.getConfigurationSection(skillNameString))); + } + } + } + + static public void readInAllPerkInfo(File f) { + YamlConfiguration config = YamlConfiguration.loadConfiguration(f); + readInAllPerkInfo(config); + } + + static private SkillTreeInfo getSkillTreeInfoFromConfig(SkillName skillName, + ConfigurationSection configSection) { + SkillTreeInfo skillTreeInfo = new SkillTreeInfo(skillName); + for (String skillIdString : configSection.getKeys(false)) { + skillTreeInfo.addPerkInfo(skillIdString, + getSkillPerkInfoFromConfig(configSection.getConfigurationSection(skillIdString))); + } + return skillTreeInfo; + } + + static private PerkInfo getSkillPerkInfoFromConfig(ConfigurationSection configSection) { + if (configSection.getName().contains("passive")) { //Passive Skill + PassivePerkInfo passivePerkInfo = new PassivePerkInfo(); + passivePerkInfo.setMinLevel(0); + passivePerkInfo.setMaxLevel(getMaxPassivePerkLevel(configSection)); + passivePerkInfo.setEnabled(configSection.getBoolean(ENABLED)); + for (String key : configSection.getKeys(false)) { + addNodeInformation(passivePerkInfo, configSection, key); + } + return passivePerkInfo; + } else { //Regular Skill + SkillPerkInfo skillPerkInfo = new SkillPerkInfo(); + skillPerkInfo.setEnabled(configSection.getBoolean(ENABLED)); + int minLevel = Integer.MAX_VALUE; + int maxLevel = Integer.MIN_VALUE; + for (String key : configSection.getKeys( + false)) { //Get each level information, also determine min and max levels + String[] splitKey = key.split("-"); + if (splitKey.length == 2 && splitKey[0].equalsIgnoreCase("level")) { //Level information + int level = Integer.valueOf(splitKey[1]); + skillPerkInfo.addSkillPerkInfo(level, + getSkillPerkLevelFromConfig(configSection.getConfigurationSection(key), + level)); //Adds the skillPerkInfo + if (level < minLevel) { + minLevel = level; + } + if (level > maxLevel) { + maxLevel = level; + } + } + } + skillPerkInfo.setMaxLevel(maxLevel); + skillPerkInfo.setMinLevel(minLevel); + return skillPerkInfo; + } + } + + static private int getMaxPassivePerkLevel(ConfigurationSection configSection) { + double startingValue = configSection.getDouble("startingValue"); + double changePerLevel = configSection.getDouble("changePerLevel"); + List allowedRange = (List) configSection.getList("allowedRange"); + double lowerBound = parseDoubleWithInfinity(allowedRange.get(0).toString()); + double upperBound = parseDoubleWithInfinity(allowedRange.get(1).toString()); + if (changePerLevel > 0) { + return (int) Math.max(Math.ceil(upperBound - startingValue / changePerLevel), 0); + } else if (changePerLevel < 0) { + return (int) Math.max(Math.ceil(lowerBound - startingValue / changePerLevel), 0); + } else { //Change per level is 0, so the max level is 0 + return 0; + } + } + + static private double parseDoubleWithInfinity(String doubleString) { + if (doubleString.equalsIgnoreCase("INF")) { + return Double.MAX_VALUE; + } else if (doubleString.equalsIgnoreCase("-INF")) { + return Double.MIN_VALUE; + } else { + return Double.valueOf(doubleString); + } + } + + static private void addNodeInformation(LowestLevelInfo lowLevelInformationHolder, + ConfigurationSection configurationSection, String key) { + if (!UtilityMethods.stringCollectionContainsIgnoreCase(IGNORED_KEYS, key)) { + //Some keys are ignored because they've already been handled or will be handled another way + lowLevelInformationHolder.addInfo(key, getNodeInformation(configurationSection, key)); + } + } + + static private SkillPerkLevelInfo getSkillPerkLevelFromConfig(ConfigurationSection configSection, + int level) { + SkillPerkLevelInfo skillPerkLevelInfo = new SkillPerkLevelInfo(level); + for (String key : configSection.getKeys(false)) { + addNodeInformation(skillPerkLevelInfo, configSection, key); + } + return skillPerkLevelInfo; + } + + static private Object getNodeInformation(ConfigurationSection configSection, + String localConfigNodeName) { + final String PATH = configSection.getCurrentPath() + "." + localConfigNodeName; + if (!configSection.contains(localConfigNodeName)) { + return null; + } + Object configInformation = configSection.get(localConfigNodeName); + + //TODO: Make CustomBrewables behave like CustomRecipes, change the config to be more comprehensive + // Other things to think about: + // - Experience for crafting things + CustomContainerImporter customContainerImporter = new CustomContainerImporter(PATH); + if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName, MOB_DROP_TABLE_KEYS)) { + //This must be checked before DROP_TABLE_KEYS, because any MobDropTable node contains the one of the DROP_TABLE_KEYS + return customContainerImporter.getMobDropTable(configInformation); + } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName, DROP_TABLE_KEYS)) { + return customContainerImporter.getDropTable(configInformation); + } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName, MOB_LIST_KEYS)) { + return customContainerImporter.getEntityTypeList(configInformation); + } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName, MATERIAL_LIST_KEYS)) { + return customContainerImporter.getMaterialList(configInformation); + } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName, DAMAGE_LIST_KEYS)) { + return customContainerImporter.getDamageCauseList(configInformation); + } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName, + CUSTOM_RECIPE_LIST_KEYS)) { + return customContainerImporter.getCustomRecipeList(configInformation, PATH); + } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName, CUSTOM_DROP_MAP_KEYS)) { + return customContainerImporter.getCustomItemMapping(configInformation); + } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName, + POTION_DATA_LIST_KEYS)) { + return customContainerImporter.getPotionDataList(configInformation); + } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName, + CUSTOM_EFFECTS_GIVEN_KEYS)) { + CustomEffect customEffect = customContainerImporter.getCustomEffect(configInformation); + if (configSection.contains("effectChance")) { + customEffect.setProbability(configSection.getDouble("effectChance", 1.0)); + } + return customEffect; + } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName, SPECIAL_KEYS)) { + return customContainerImporter.convertListedTableRowToMap(configInformation); + } else { + return configInformation; + } + + } + + public SkillTreeInfo getSkillTreeInfo(SkillName skillName) { + if (allPerkInfo.containsKey(skillName)) { + return allPerkInfo.get(skillName); + } + return null; + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/configStorage/ConfigLoad.java b/src/main/java/mc/carlton/freerpg/configStorage/ConfigLoad.java deleted file mode 100644 index c9e4e13..0000000 --- a/src/main/java/mc/carlton/freerpg/configStorage/ConfigLoad.java +++ /dev/null @@ -1,495 +0,0 @@ -package mc.carlton.freerpg.configStorage; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.customContainers.OldCustomPotion; -import mc.carlton.freerpg.customContainers.collections.OldCustomRecipe; -import org.bukkit.Color; -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.enchantments.EnchantmentWrapper; -import org.bukkit.plugin.Plugin; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.potion.PotionType; - -import java.io.File; -import java.util.*; - -public class ConfigLoad { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - static int playerStatFilesLoadedInOnStartup; - static boolean forceLanguage; - static double basePlayerHP; - static boolean saveRunTimeData; - static boolean verboseRunTimeData; - static int saveStatsTimer; - static String defaultLanguage; - static boolean allowExplosions; - static boolean allowBuild; - static boolean allowPvP; - static boolean allowHurtAnimals; - static int furnaceDeleteTimer; - static boolean getEXPFromEnchantingBottles; - static boolean trackFewerBlocks; - static boolean flamePickGiveXP; - static boolean shiftRightClickInvestAll; - static int veinMinerMaxBreakSize; - static int superBaitCooldown; - static boolean leaderboardDyanmicUpdate; - static int leaderboardUpdateTimer; - static boolean preventUnsafeRepair; - static boolean preventUnsafeSalvage; - static boolean earnExperiencePastMaxLevel; - static double agilityMinSprintTimeForExperience; - static int maxLevelForBeginnerMessage; - static String beginnerLevelUpMessage; - static boolean advancedKeepinventory; - static Map specialMultiplier = new HashMap<>(); - static Map maxLevels = new HashMap<>(); - static ArrayList soulsInfo = new ArrayList<>(); - static ArrayList multipliers = new ArrayList<>(); - static ArrayList tokensInfo = new ArrayList<>(); - static ArrayList levelingInfo = new ArrayList<>(); - static ArrayList diggingInfo = new ArrayList<>(); - static ArrayList woodcuttingInfo = new ArrayList<>(); - static ArrayList fishingInfo = new ArrayList<>(); - static ArrayList fishingInfoBaseChances = new ArrayList<>(); - static ArrayList fishingInfoHotRod = new ArrayList<>(); - static ArrayList fishingInfoEnchants = new ArrayList<>(); - static Map allowedSkillsMap = new HashMap<>(); - static Map allowedSkillGainEXPMap = new HashMap<>(); - static Map alchemyInfo = new HashMap<>(); - static Map> expMap = new HashMap<>(); - static Map craftingRecipes = new HashMap<>(); - static HashSet veinMinerBlocks = new HashSet<>(); - static ArrayList timberBreakLimits = new ArrayList<>(); - static Map abilityCooldowns = new HashMap<>(); - static Map spawnerEXPMultipliers = new HashMap<>(); - static Map mobFarmEXPMultipliers = new HashMap<>(); - static Map durabilityModifiers = new HashMap<>(); - - - public void initializeConfig(){ - setConfigData(); - } - - - public void setConfigData() { - File f = new File(plugin.getDataFolder(),"config.yml"); - f.setReadable(true,false); - f.setWritable(true,false); - FileConfiguration config = YamlConfiguration.loadConfiguration(f); - File f1 = new File(plugin.getDataFolder(),"advancedConfig.yml"); - f.setReadable(true,false); - f.setWritable(true,false); - FileConfiguration advancedConfig = YamlConfiguration.loadConfiguration(f1); - - //Useful Label Groups: - String[] labels = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - String[] combatLabels = {"archery","beastMastery","swordsmanship","defense","axeMastery"}; - - //General Config and Config that has no real category - defaultLanguage = config.getString("general.defaultLanguage"); - //basePlayerHP = config.getDouble("general.playerBaseHP"); - forceLanguage = config.getBoolean("general.forceLanguage"); - playerStatFilesLoadedInOnStartup = advancedConfig.getInt("general.playerStatFilesLoadedInOnStartup"); - saveRunTimeData = advancedConfig.getBoolean("general.saveRunTimeData"); - verboseRunTimeData = advancedConfig.getBoolean("general.verboseRunTimeData"); - saveStatsTimer = advancedConfig.getInt("general.saveStatsTimer"); - allowExplosions = advancedConfig.getBoolean("general.allowCustomExplosions"); - allowBuild = advancedConfig.getBoolean("general.allowBuild"); - allowPvP = advancedConfig.getBoolean("general.allowPvP"); - allowHurtAnimals = advancedConfig.getBoolean("general.allowHurtAnimals"); - furnaceDeleteTimer = advancedConfig.getInt("smelting.removePlayerFurnacesTimer"); - trackFewerBlocks = advancedConfig.getBoolean("general.trackFewerBlocks"); - leaderboardDyanmicUpdate = advancedConfig.getBoolean("general.leaderboardDynamicUpdate"); - leaderboardUpdateTimer = advancedConfig.getInt("general.leaderboardUpdateTimer"); - getEXPFromEnchantingBottles = advancedConfig.getBoolean("enchanting.gainEXPfromEnchantingBottles"); - flamePickGiveXP = advancedConfig.getBoolean("smelting.flamePickGiveMinecraftXP"); - preventUnsafeRepair = advancedConfig.getBoolean("repair.preventRepairOfItemsWithUnsafeEnchantments"); - preventUnsafeSalvage = advancedConfig.getBoolean("repair.preventSalvageOfItemsWithUnsafeEnchantments"); - maxLevelForBeginnerMessage = advancedConfig.getInt("leveling.beginnerLevelUpMessageMaxLevel"); - beginnerLevelUpMessage = advancedConfig.getString("leveling.customBegginerLevelUpMessage"); - advancedKeepinventory = advancedConfig.getBoolean("general.keepInventoryOn"); - List veinMinerBlockStrings = advancedConfig.getStringList("mining.veinMinerBlocks"); - for (String matString : veinMinerBlockStrings) { - if (Material.matchMaterial(matString) != null) - veinMinerBlocks.add(Material.matchMaterial(matString)); - } - veinMinerMaxBreakSize = advancedConfig.getInt("mining.veinMinerMaximumBlocksBroken"); - timberBreakLimits.add(advancedConfig.getInt("woodcutting.timberMaxBreakInitial")); - timberBreakLimits.add(advancedConfig.getInt("woodcutting.timberMaxBreakUpgraded")); - shiftRightClickInvestAll = advancedConfig.getBoolean("tokens.passiveShiftClickAndRightClickInvestAll"); - superBaitCooldown = advancedConfig.getInt("fishing.superBaitCooldown"); - earnExperiencePastMaxLevel = config.getBoolean("leveling.earnExperiencePastMaxLevel"); - agilityMinSprintTimeForExperience = advancedConfig.getDouble("agility.sprintTimeThreshold"); - - - maxLevels.put("global",Integer.valueOf(config.getString("leveling.maxLevel"))); - allowedSkillsMap.put("global",config.getBoolean("global.skillAllowed")); - for (String label : labels) { - maxLevels.put(label,Integer.valueOf(config.getString(label+".maxLevel"))); - allowedSkillsMap.put(label,config.getBoolean(label+".skillAllowed")); - abilityCooldowns.put(label,config.getInt(label+".abilityCooldown")); - allowedSkillGainEXPMap.put(label,advancedConfig.getBoolean(label+".expDrops.enableEXPDrops")); - } - abilityCooldowns.put("robCooldown",advancedConfig.getInt("fishing.robCooldown")); - - durabilityModifiers.put("megaDig",advancedConfig.getDouble("digging.megaDigDurabilityModifier")); - durabilityModifiers.put("timber",advancedConfig.getDouble("woodcutting.timberDurabilityModifier")); - durabilityModifiers.put("leafBlower",advancedConfig.getDouble("woodcutting.leafBlowerDurabilityModifier")); - durabilityModifiers.put("veinMiner",advancedConfig.getDouble("mining.veinMinerDurabilityModifier")); - durabilityModifiers.put("flamePick",advancedConfig.getDouble("smelting.smeltingDurabilityModifier")); - - - //Config that is skill dependant (not used in all skills) - for (String label : combatLabels) { - spawnerEXPMultipliers.put(label,advancedConfig.getDouble(label+".spawnerMobsEXPMultiplier")); - mobFarmEXPMultipliers.put(label,advancedConfig.getDouble(label+".mobFarmEXPMultiplier")); - } - - soulsInfo.add(Integer.valueOf(advancedConfig.getString("souls.startingSouls"))); - soulsInfo.add(Integer.valueOf(advancedConfig.getString("souls.refundCost"))); - - multipliers.add(Double.valueOf(config.getString("global.EXP_Multiplier"))); - for (String label : labels) { - multipliers.add(config.getDouble(label+".EXP_Multiplier")); - } - - tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.levelsPerAutomaticPassiveUpgrade"))); - tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.levelsPerPassiveToken"))); - tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.levelsPerSkillToken"))); - tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.levelsPerGlobalToken"))); - tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.startingPassiveTokens"))); - tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.startingSkillTokens"))); - tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.startingGlobalTokens"))); - tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.skillTokenToPassiveTokenConversion"))); - tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.globalTokenToEXPbuff"))); - tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.passiveRightClickInvestment"))); - tokensInfo.add(Double.valueOf(advancedConfig.getString("tokens.passiveShiftClickInvestment"))); - - levelingInfo.add(Double.valueOf(config.getString("leveling.maxLevel"))); - levelingInfo.add(Double.valueOf(advancedConfig.getString("leveling.exponentialGrowthFactor"))); - levelingInfo.add(Double.valueOf(advancedConfig.getString("leveling.exponentialReferenceLevel"))); - levelingInfo.add(Double.valueOf(advancedConfig.getString("leveling.exponentialReferenceEXP"))); - levelingInfo.add(Double.valueOf(advancedConfig.getString("leveling.levelBeginLinear"))); - levelingInfo.add(Double.valueOf(advancedConfig.getString("leveling.LinearEXPperLevel"))); - - for (int i = 1; i<= 9; i++) { - diggingInfo.add(Material.matchMaterial(advancedConfig.getString("digging.drops.drop"+i+"Name"))); - diggingInfo.add(Integer.valueOf(advancedConfig.getString("digging.drops.drop"+i+"Amount"))); - } - for (int i = 10; i<=15;i++) { - diggingInfo.add(Material.matchMaterial(advancedConfig.getString("digging.drops.drop"+i+"Name"))); - diggingInfo.add(Integer.valueOf(advancedConfig.getString("digging.drops.drop"+i+"Amount"))); - diggingInfo.add(Double.valueOf(advancedConfig.getString("digging.drops.drop"+i+"BaseChance"))); - } - - for (int i = 1; i<=5 ; i++) { - woodcuttingInfo.add(Material.matchMaterial(advancedConfig.getString("woodcutting.drops.leavesDrop"+i+"Name"))); - woodcuttingInfo.add(Integer.valueOf(advancedConfig.getString("woodcutting.drops.leavesDrop"+i+"Amount"))); - woodcuttingInfo.add(Double.valueOf(advancedConfig.getString("woodcutting.drops.leavesDrop"+i+"Chance"))); - } - - fishingInfoBaseChances.add(Double.valueOf(advancedConfig.getString("fishing.drops.tier1_baseChance"))); - fishingInfoBaseChances.add(Double.valueOf(advancedConfig.getString("fishing.drops.tier2_baseChance"))); - fishingInfoBaseChances.add(Double.valueOf(advancedConfig.getString("fishing.drops.tier3_baseChance"))); - fishingInfoBaseChances.add(Double.valueOf(advancedConfig.getString("fishing.drops.tier4_baseChance"))); - fishingInfoBaseChances.add(Double.valueOf(advancedConfig.getString("fishing.drops.tier5_baseChance"))); - - fishingInfoEnchants.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier1_enchantedArmor"))); - fishingInfoEnchants.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_enchantedArmor"))); - fishingInfoEnchants.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier3_enchantedArmor"))); - fishingInfoEnchants.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier4_enchantedArmor"))); - fishingInfoEnchants.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier5_enchantedArmor"))); - - for (int i = 1; i<=5; i++) { - for (int j = 1; j<=4; j++) { - fishingInfo.add(Material.matchMaterial(advancedConfig.getString("fishing.drops.tier"+i+"_drop"+j+"Name"))); - fishingInfo.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier"+i+"_drop"+j+"Amount"))); - fishingInfo.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier"+i+"_drop"+j+"Random"))); - } - } - - fishingInfoHotRod.add(Material.matchMaterial(advancedConfig.getString("fishing.drops.tier1_drop1Name_HotRod"))); - fishingInfoHotRod.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier1_drop1Amount_HotRod"))); - fishingInfoHotRod.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier1_drop1Random_HotRod"))); - fishingInfoHotRod.add(Material.matchMaterial(advancedConfig.getString("fishing.drops.tier1_drop2Name_HotRod"))); - fishingInfoHotRod.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier1_drop2Amount_HotRod"))); - fishingInfoHotRod.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier1_drop2Random_HotRod"))); - fishingInfoHotRod.add(Material.matchMaterial(advancedConfig.getString("fishing.drops.tier2_drop1Name_HotRod"))); - fishingInfoHotRod.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop1Amount_HotRod"))); - fishingInfoHotRod.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop1Random_HotRod"))); - fishingInfoHotRod.add(Material.matchMaterial(advancedConfig.getString("fishing.drops.tier2_drop3Name_HotRod"))); - fishingInfoHotRod.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop3Amount_HotRod"))); - fishingInfoHotRod.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop3Random_HotRod"))); - fishingInfoHotRod.add(Material.matchMaterial(advancedConfig.getString("fishing.drops.tier2_drop4Name_HotRod"))); - fishingInfoHotRod.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop4Amount_HotRod"))); - fishingInfoHotRod.add(Integer.valueOf(advancedConfig.getString("fishing.drops.tier2_drop4Random_HotRod"))); - - //Alchemy Info - for (int i = 1; i<= 5; i++) { - OldCustomPotion customPotion = new OldCustomPotion(); - customPotion.setPotionEffectType(PotionEffectType.getByName(advancedConfig.getString("alchemy.customPotions.potionType"+i))); - customPotion.setIngredient(Material.matchMaterial(advancedConfig.getString("alchemy.customPotions.potionIngredient"+i))); - customPotion.setPotionDuration(advancedConfig.getInt("alchemy.customPotions.potionDuration"+i)); - customPotion.setColor(getColorFromString(advancedConfig.getString("alchemy.customPotions.potionColor"+i))); - customPotion.setPotionName(); - alchemyInfo.put("customPotion"+i,customPotion); - } - - //EXP Info - for (String label : labels) { - Map skillExpMap = new HashMap<>(); - ConfigurationSection skillExpDrops = advancedConfig.getConfigurationSection(label+".expDrops"); - for (String id : skillExpDrops.getKeys(false)) { - if (!id.equalsIgnoreCase("enableEXPDrops")) { - skillExpMap.put(id,advancedConfig.getInt(label+".expDrops." + id)); - } - } - expMap.put(label,skillExpMap); - } - - //Special Multipliers - specialMultiplier.put("megaDigEXPMultiplier",advancedConfig.getDouble("digging.megaDigEXPMultiplier")); - specialMultiplier.put("superBaitEXPMultiplier",advancedConfig.getDouble("fishing.superBaitEXPMultiplier")); - specialMultiplier.put("timberEXPMultiplier",advancedConfig.getDouble("woodcutting.timberEXPMultiplier")); - specialMultiplier.put("blockingEXPMultiplier",advancedConfig.getDouble("defense.blockingEXPMultiplier")); - - //Crafting arrays - for (int i = 1; i <= 5; i++) { - OldCustomRecipe oldCustomRecipe = new OldCustomRecipe(); - oldCustomRecipe.setOutput(Material.matchMaterial(advancedConfig.getString("farming.crafting.recipeOutput"+i))); - oldCustomRecipe.setOutputAmount(advancedConfig.getInt("farming.crafting.recipeOutputAmount"+i)); - List recipeStrings = advancedConfig.getStringList("farming.crafting.recipe"+i); - ArrayList recipeMaterials = new ArrayList<>(); - for (String item : recipeStrings) { - Material recipeMaterial = Material.matchMaterial(item); - if (recipeMaterial == null) { - System.out.println("[FreeRPG] WARNING: Unrecognized Material in " + "farming.crafting.recipe"+i + "(Some materials will be treated as air"); - } - recipeMaterials.add(recipeMaterial); - } - oldCustomRecipe.setRecipe(recipeMaterials); - oldCustomRecipe.setYAML_ID("farming.crafting.recipe"+i); - craftingRecipes.put("farming"+i, oldCustomRecipe); - } - for (int i = 1; i <= 10; i++) { - OldCustomRecipe oldCustomRecipe = new OldCustomRecipe(); - oldCustomRecipe.setOutput(Material.matchMaterial(advancedConfig.getString("enchanting.crafting.recipeOutput"+i))); - oldCustomRecipe.setOutputAmount(advancedConfig.getInt("enchanting.crafting.recipeOutputAmount"+i)); - String enchantType = advancedConfig.getString("enchanting.crafting.recipeEnchant"+i); - if (!enchantType.equalsIgnoreCase("none")) { - oldCustomRecipe.setEnchantment(EnchantmentWrapper.getByKey(NamespacedKey.minecraft(enchantType))); - oldCustomRecipe.setEnchantmentLevel(advancedConfig.getInt("enchanting.crafting.recipeEnchantLevel"+i)); - oldCustomRecipe.setXPcraftCost(advancedConfig.getInt("enchanting.crafting.XPcostToCraft"+i)); - } - List recipeStrings = advancedConfig.getStringList("enchanting.crafting.recipe"+i); - ArrayList recipeMaterials = new ArrayList<>(); - for (String item : recipeStrings) { - Material recipeMaterial = Material.matchMaterial(item); - if (recipeMaterial == null) { - System.out.println("[FreeRPG] WARNING: Unrecognized Material in " + "enchanting.crafting.recipe"+i + "(Some materials will be treated as air"); - } - recipeMaterials.add(recipeMaterial); - } - oldCustomRecipe.setRecipe(recipeMaterials); - oldCustomRecipe.setYAML_ID("enchanting.crafting.recipe"+i); - craftingRecipes.put("enchanting"+i, oldCustomRecipe); - } - for (int i = 1; i <= 5; i++) { - OldCustomRecipe oldCustomRecipe = new OldCustomRecipe(); - String materialString = advancedConfig.getString("alchemy.crafting.recipeOutput"+i); - oldCustomRecipe.setOutput(Material.matchMaterial(materialString)); - oldCustomRecipe.setOutputAmount(advancedConfig.getInt("alchemy.crafting.recipeOutputAmount"+i)); - if (materialString.equalsIgnoreCase("POTION")) { - oldCustomRecipe.setPotionType(PotionType.valueOf(advancedConfig.getString("alchemy.crafting.recipePotionType"+i))); - oldCustomRecipe.setExtended(advancedConfig.getBoolean("alchemy.crafting.recipePotionExtended"+i)); - oldCustomRecipe.setUpgraded(advancedConfig.getBoolean("alchemy.crafting.recipePotionUpgraded"+i)); - } - List recipeStrings = advancedConfig.getStringList("alchemy.crafting.recipe"+i); - ArrayList recipeMaterials = new ArrayList<>(); - for (String item : recipeStrings) { - Material recipeMaterial = Material.matchMaterial(item); - if (recipeMaterial == null) { - System.out.println("[FreeRPG] WARNING: Unrecognized Material in " + "alchemy.crafting.recipe"+i + "(Some materials will be treated as air"); - } - recipeMaterials.add(recipeMaterial); - } - oldCustomRecipe.setRecipe(recipeMaterials); - oldCustomRecipe.setYAML_ID("alchemy.crafting.recipe"+i); - craftingRecipes.put("alchemy"+i, oldCustomRecipe); - } - - } - - public Color getColorFromString(String colorString) { - colorString = colorString.substring(1,colorString.length()-1); - List RGB = Arrays.asList(colorString.trim().split(",")); - int red = 0; - int green = 0; - int blue = 0; - if (RGB.size() == 3) { - red = Integer.parseInt(RGB.get(0)); - green = Integer.parseInt(RGB.get(1)); - blue = Integer.parseInt(RGB.get(2)); - } - return Color.fromRGB(red,green,blue); - } - - public int getSaveStatsTimer() {return saveStatsTimer;} - public String getDefaultLanguage() {return defaultLanguage;} - public boolean isAllowExplosions() {return allowExplosions;} - public boolean isAllowBuild() {return allowBuild;} - public boolean isAllowPvP() {return allowPvP;} - public boolean isAllowHurtAnimals() {return allowHurtAnimals;} - public Map getMaxLevels(){ - return maxLevels; - } - public ArrayList getSoulsInfo(){ - return soulsInfo; - } - public ArrayList getMultipliers(){ - return multipliers; - } - public ArrayList getTokensInfo(){ - return tokensInfo; - } - public ArrayList getLevelingInfo(){ - return levelingInfo; - } - public ArrayList getDiggingInfo(){ - return diggingInfo; - } - public ArrayList getWoodcuttingInfo(){ - return woodcuttingInfo; - } - public ArrayList getFishingInfo1(){ - return fishingInfo; - } - public ArrayList getFishingInfo2(){ - return fishingInfoBaseChances; - } - public ArrayList getFishingInfo3(){ - return fishingInfoHotRod; - } - public ArrayList getFishingInfo4(){ - return fishingInfoEnchants; - } - public boolean isGetEXPFromEnchantingBottles() {return getEXPFromEnchantingBottles;} - public boolean isSaveRunTimeData() {return saveRunTimeData;} - public boolean isVerboseRunTimeData() {return verboseRunTimeData;} - public int getFurnaceDeleteTimer() {return furnaceDeleteTimer;} - public Map getAllowedSkillsMap() {return allowedSkillsMap;} - public Map getAllowedSkillGainEXPMap() {return allowedSkillGainEXPMap;} - public Map getAlchemyInfo() { return alchemyInfo; } - public Map> getExpMap() {return expMap;} - public Map getExpMapForSkill(String skillName) { - if (expMap.containsKey(skillName)) { - return expMap.get(skillName); - } - return null; - } - public Map getSpecialMultiplier(){return specialMultiplier;} - - public Map getCraftingRecipes() { - return craftingRecipes; - } - - public boolean isTrackFewerBlocks() { - return trackFewerBlocks; - } - - public boolean isFlamePickGiveXP() { - return flamePickGiveXP; - } - - public HashSet getVeinMinerBlocks() { - return veinMinerBlocks; - } - - public int getVeinMinerMaxBreakSize() { - return veinMinerMaxBreakSize; - } - - public ArrayList getTimberBreakLimits() { - return timberBreakLimits; - } - - public Map getAbilityCooldowns() { - return abilityCooldowns; - } - - public boolean isShiftRightClickInvestAll() { - return shiftRightClickInvestAll; - } - - public Map getMobFarmEXPMultipliers() { - return mobFarmEXPMultipliers; - } - - public Map getSpawnerEXPMultipliers() { - return spawnerEXPMultipliers; - } - - public int getPlayerStatFilesLoadedInOnStartup() { - return playerStatFilesLoadedInOnStartup; - } - - public double getBasePlayerHP() { - return basePlayerHP; - } - - public int getSuperBaitCooldown() { - return superBaitCooldown; - } - - public int getLeaderboardUpdateTimer() { - return leaderboardUpdateTimer; - } - - public boolean isLeaderboardDyanmicUpdate() { - return leaderboardDyanmicUpdate; - } - - public boolean isPreventUnsafeRepair() { - return preventUnsafeRepair; - } - - public boolean isPreventUnsafeSalvage() { - return preventUnsafeSalvage; - } - - public boolean isEarnExperiencePastMaxLevel() { - return earnExperiencePastMaxLevel; - } - - public double getAgilityMinSprintTimeForExperience() { - return agilityMinSprintTimeForExperience; - } - public void setDefaultLanguage(String languageCode) { - defaultLanguage = languageCode; - } - - public Map getDurabilityModifiers() { - return durabilityModifiers; - } - - public int getMaxLevelForBeginnerMessage() { - return maxLevelForBeginnerMessage; - } - - public String getBeginnerLevelUpMessage() { - return beginnerLevelUpMessage; - } - - public boolean isKeepinventory() { - return advancedKeepinventory; - } - - public boolean isForceLanguage() { - return forceLanguage; - } -} diff --git a/src/main/java/mc/carlton/freerpg/configStorage/PerkConfig.java b/src/main/java/mc/carlton/freerpg/configStorage/PerkConfig.java deleted file mode 100644 index 208ab59..0000000 --- a/src/main/java/mc/carlton/freerpg/configStorage/PerkConfig.java +++ /dev/null @@ -1,183 +0,0 @@ -package mc.carlton.freerpg.configStorage; - -import mc.carlton.freerpg.customContainers.CustomContainerImporter; -import mc.carlton.freerpg.customContainers.collections.CustomEffect; -import mc.carlton.freerpg.skillAndPerkInfo.*; -import mc.carlton.freerpg.skills.SkillName; -import mc.carlton.freerpg.utilities.UtilityMethods; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; - -import java.io.File; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class PerkConfig { - static private Map allPerkInfo = new HashMap<>(); - - private static final List DROP_TABLE_KEYS = Arrays.asList(new String[]{"dropTable", "dropsAdded"}); - private static final List MOB_DROP_TABLE_KEYS = Arrays.asList(new String[]{"mobDropTable", "entityDropTable"}); - private static final List MOB_LIST_KEYS = Arrays.asList(new String[]{"mobList","entityList","entityTypeList"}); - private static final List MATERIAL_LIST_KEYS = Arrays.asList(new String[]{"itemList","blockList"}); - private static final List DAMAGE_LIST_KEYS = Arrays.asList(new String[]{"damageTypeList","damageCauseList"}); - private static final List CUSTOM_RECIPE_LIST_KEYS = Arrays.asList(new String[]{"recipes","customRecipes"}); - private static final List CUSTOM_DROP_MAP_KEYS = Arrays.asList(new String[]{"dropChanges","changedDrops"}); - private static final List POTION_DATA_LIST_KEYS = Arrays.asList(new String[]{"potionDataList","potionTypeList"}); - private static final List CUSTOM_POTION_KEYS = Arrays.asList(new String[]{"decreasingTiers","increasingTiers"}); - private static final List CUSTOM_EFFECTS_GIVEN_KEYS = Arrays.asList(new String[]{"effectsGiven","customEffect"}); - private static final List SPECIAL_KEYS = Arrays.asList(new String[]{"decreasingTiers","increasingTiers","affectedMobs","added-enchantmentList","changedEffects"}); - private static final List IGNORED_KEYS = Arrays.asList(new String[]{"effectChance","activationChance","enabled", "startingValue", "allowedRange", "changePerLevel"}); - - private static final String ENABLED = "enabled"; - private static final String EFFECT_CHANCE = "effectChance"; - - public SkillTreeInfo getSkillTreeInfo(SkillName skillName) { - if (allPerkInfo.containsKey(skillName)) { - return allPerkInfo.get(skillName); - } - return null; - } - - static public void readInAllPerkInfo(FileConfiguration config) { - for (String skillNameString: config.getKeys(false)) { - SkillName skillName = SkillName.matchSkillName(skillNameString); - if (skillName != null) { - allPerkInfo.put(skillName,getSkillTreeInfoFromConfig(skillName, config.getConfigurationSection(skillNameString))); - } - } - } - - static public void readInAllPerkInfo(File f) { - YamlConfiguration config = YamlConfiguration.loadConfiguration(f); - readInAllPerkInfo(config); - } - - static private SkillTreeInfo getSkillTreeInfoFromConfig(SkillName skillName, ConfigurationSection configSection) { - SkillTreeInfo skillTreeInfo = new SkillTreeInfo(skillName); - for (String skillIdString: configSection.getKeys(false)) { - skillTreeInfo.addPerkInfo(skillIdString,getSkillPerkInfoFromConfig(configSection.getConfigurationSection(skillIdString))); - } - return skillTreeInfo; - } - - static private PerkInfo getSkillPerkInfoFromConfig(ConfigurationSection configSection) { - if (configSection.getName().contains("passive")) { //Passive Skill - PassivePerkInfo passivePerkInfo = new PassivePerkInfo(); - passivePerkInfo.setMinLevel(0); - passivePerkInfo.setMaxLevel(getMaxPassivePerkLevel(configSection)); - passivePerkInfo.setEnabled(configSection.getBoolean(ENABLED)); - for (String key : configSection.getKeys(false)) { - addNodeInformation(passivePerkInfo,configSection,key); - } - return passivePerkInfo; - } else { //Regular Skill - SkillPerkInfo skillPerkInfo = new SkillPerkInfo(); - skillPerkInfo.setEnabled(configSection.getBoolean(ENABLED)); - int minLevel = Integer.MAX_VALUE; - int maxLevel = Integer.MIN_VALUE; - for (String key : configSection.getKeys(false)) { //Get each level information, also determine min and max levels - String[] splitKey = key.split("-"); - if (splitKey.length == 2 && splitKey[0].equalsIgnoreCase("level")) { //Level information - int level = Integer.valueOf(splitKey[1]); - skillPerkInfo.addSkillPerkInfo(level,getSkillPerkLevelFromConfig(configSection.getConfigurationSection(key),level)); //Adds the skillPerkInfo - if (level < minLevel) { - minLevel = level; - } - if (level > maxLevel) { - maxLevel = level; - } - } - } - skillPerkInfo.setMaxLevel(maxLevel); - skillPerkInfo.setMinLevel(minLevel); - return skillPerkInfo; - } - } - - static private int getMaxPassivePerkLevel(ConfigurationSection configSection) { - double startingValue = configSection.getDouble("startingValue"); - double changePerLevel = configSection.getDouble("changePerLevel"); - List allowedRange = (List) configSection.getList("allowedRange"); - double lowerBound = parseDoubleWithInfinity(allowedRange.get(0).toString()); - double upperBound = parseDoubleWithInfinity(allowedRange.get(1).toString()); - if (changePerLevel > 0) { - return (int) Math.max(Math.ceil(upperBound-startingValue/changePerLevel),0); - } else if (changePerLevel < 0) { - return (int) Math.max(Math.ceil(lowerBound-startingValue/changePerLevel),0); - } else { //Change per level is 0, so the max level is 0 - return 0; - } - } - - static private double parseDoubleWithInfinity(String doubleString) { - if (doubleString.equalsIgnoreCase("INF")) { - return Double.MAX_VALUE; - } else if (doubleString.equalsIgnoreCase("-INF")) { - return Double.MIN_VALUE; - } else { - return Double.valueOf(doubleString); - } - } - - static private void addNodeInformation(LowestLevelInfo lowLevelInformationHolder, ConfigurationSection configurationSection, String key) { - if (!UtilityMethods.stringCollectionContainsIgnoreCase(IGNORED_KEYS,key)) { - //Some keys are ignored because they've already been handled or will be handled another way - lowLevelInformationHolder.addInfo(key,getNodeInformation(configurationSection,key)); - } - } - - static private SkillPerkLevelInfo getSkillPerkLevelFromConfig(ConfigurationSection configSection, int level) { - SkillPerkLevelInfo skillPerkLevelInfo = new SkillPerkLevelInfo(level); - for (String key : configSection.getKeys(false)) { - addNodeInformation(skillPerkLevelInfo,configSection,key); - } - return skillPerkLevelInfo; - } - - static private Object getNodeInformation(ConfigurationSection configSection, String localConfigNodeName) { - final String PATH = configSection.getCurrentPath() + "." + localConfigNodeName; - if (!configSection.contains(localConfigNodeName)) { - return null; - } - Object configInformation = configSection.get(localConfigNodeName); - - //TODO: Make CustomBrewables behave like CustomRecipes, change the config to be more comprehensive - // Other things to think about: - // - Experience for crafting things - CustomContainerImporter customContainerImporter = new CustomContainerImporter(PATH); - if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName,MOB_DROP_TABLE_KEYS)) { - //This must be checked before DROP_TABLE_KEYS, because any MobDropTable node contains the one of the DROP_TABLE_KEYS - return customContainerImporter.getMobDropTable(configInformation); - } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName,DROP_TABLE_KEYS)) { - return customContainerImporter.getDropTable(configInformation); - } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName,MOB_LIST_KEYS)) { - return customContainerImporter.getEntityTypeList(configInformation); - } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName,MATERIAL_LIST_KEYS)) { - return customContainerImporter.getMaterialList(configInformation); - } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName,DAMAGE_LIST_KEYS)) { - return customContainerImporter.getDamageCauseList(configInformation); - } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName,CUSTOM_RECIPE_LIST_KEYS)) { - return customContainerImporter.getCustomRecipeList(configInformation,PATH); - } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName,CUSTOM_DROP_MAP_KEYS)) { - return customContainerImporter.getCustomItemMapping(configInformation); - } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName,POTION_DATA_LIST_KEYS)) { - return customContainerImporter.getPotionDataList(configInformation); - } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName,CUSTOM_EFFECTS_GIVEN_KEYS)) { - CustomEffect customEffect = customContainerImporter.getCustomEffect(configInformation); - if (configSection.contains("effectChance")) { - customEffect.setProbability(configSection.getDouble("effectChance",1.0)); - } - return customEffect; - } else if (UtilityMethods.stringContainsIgnoreCase(localConfigNodeName,SPECIAL_KEYS)) { - return customContainerImporter.convertListedTableRowToMap(configInformation); - } else { - return configInformation; - } - - } - - -} diff --git a/src/main/java/mc/carlton/freerpg/core/info/player/AbilityLogoutTracker.java b/src/main/java/mc/carlton/freerpg/core/info/player/AbilityLogoutTracker.java new file mode 100644 index 0000000..4753d6b --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/player/AbilityLogoutTracker.java @@ -0,0 +1,87 @@ +package mc.carlton.freerpg.core.info.player; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import mc.carlton.freerpg.FreeRPG; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.Player; + +public class AbilityLogoutTracker { + + static Map> playerTasks = new HashMap<>(); + static Map> playerKeys = new HashMap<>(); + private Player p; + private UUID playerUUID; + + public AbilityLogoutTracker(Player p) { + this.p = p; + this.playerUUID = p.getUniqueId(); + } + + public Map> getTasks() { + return playerTasks; + } + + public void setTasks(Map> player_tasks) { + playerTasks = player_tasks; + } + + public Map getPlayerTasks() { + return playerTasks.get(playerUUID); + } + + public void setPlayerTasks(Map tasks) { + playerTasks.put(playerUUID, tasks); + } + + public Map> getKeys() { + return playerKeys; + } + + public Map getPlayerKeys() { + return playerKeys.get(playerUUID); + } + + public void setItems(Map> player_keys) { + playerKeys = player_keys; + } + + public void setPlayerItems(Map items) { + playerKeys.put(playerUUID, items); + } + + public void setPlayerTask(String ability, int taskID) { + Map pTasks = playerTasks.get(playerUUID); + pTasks.put(ability, taskID); + playerTasks.put(playerUUID, pTasks); + } + + public void setPlayerItem(String ability, NamespacedKey key) { + if (!playerKeys.containsKey(playerUUID)) { //Assures player is initialized + initializePlayer(); + } + Map pItems = playerKeys.get(playerUUID); + pItems.put(ability, key); + playerKeys.put(playerUUID, pItems); + } + + public void removePlayer() { + playerTasks.remove(playerUUID); + playerKeys.remove(playerUUID); + } + + public void initializePlayer() { + String[] names = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", + "axeMastery", "woodcuttingHaste", "swordSpeed", "swordStrength"}; + Map player_Tasks = new HashMap<>(); + Map player_Keys = new HashMap<>(); + for (String name : names) { + player_Tasks.put(name, -1); + player_Keys.put(name, new NamespacedKey(FreeRPG.getPlugin(FreeRPG.class), "x")); + } + playerTasks.put(playerUUID, player_Tasks); + playerKeys.put(playerUUID, player_Keys); + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/player/AbilityTimers.java b/src/main/java/mc/carlton/freerpg/core/info/player/AbilityTimers.java new file mode 100644 index 0000000..7682bc0 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/player/AbilityTimers.java @@ -0,0 +1,465 @@ +package mc.carlton.freerpg.core.info.player; + +import java.util.ArrayList; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.utils.game.ActionBarMessages; +import mc.carlton.freerpg.utils.game.BossBarStorage; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import mc.carlton.freerpg.utils.game.TrackItem; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.NamespacedKey; +import org.bukkit.attribute.Attributable; +import org.bukkit.attribute.Attribute; +import org.bukkit.boss.BossBar; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class AbilityTimers { + + static Map cooldownTimes = new ConcurrentHashMap<>(); + static Map cooldownTaskIds = new ConcurrentHashMap<>(); + static Map abilityDurationTaskIds = new ConcurrentHashMap<>(); + static Map> abilityDurationTimes = new ConcurrentHashMap<>(); + static Map> abilityDurationBossBar = new ConcurrentHashMap<>(); + ItemStack itemInHand; + private Player player; + private UUID uuid; + + public AbilityTimers(Player p) { + this.player = p; + this.uuid = player.getUniqueId(); + } + + public Integer[] getPlayerCooldownTimes() { + if (!cooldownTimes.containsKey(uuid)) { + Integer[] initTimers = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + cooldownTimes.put(uuid, initTimers); + } + return cooldownTimes.get(uuid); + } + + public Map getCooldownTimes() { + if (!cooldownTimes.containsKey(uuid)) { + Integer[] initTimers = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + cooldownTimes.put(uuid, initTimers); + } + return cooldownTimes; + } + + public void setPlayerCooldownTime(String ability, int timeRemaining) { + Integer[] pTimes = cooldownTimes.get(uuid); + switch (ability) { + case "digging": + pTimes[0] = timeRemaining; + break; + case "woodcutting": + pTimes[1] = timeRemaining; + break; + case "mining": + pTimes[2] = timeRemaining; + break; + case "farming": + pTimes[3] = timeRemaining; + break; + case "fishing": + pTimes[4] = timeRemaining; + break; + case "archery": + pTimes[5] = timeRemaining; + break; + case "beastMastery": + pTimes[6] = timeRemaining; + break; + case "swordsmanship": + pTimes[7] = timeRemaining; + break; + case "defense": + pTimes[8] = timeRemaining; + break; + case "axeMastery": + pTimes[9] = timeRemaining; + break; + case "woodcuttingHaste": + pTimes[10] = timeRemaining; + break; + case "fishingRob": + pTimes[11] = timeRemaining; + default: + break; + } + cooldownTimes.put(uuid, pTimes); + } + + public int getPlayerCooldownTime(String ability) { + if (!cooldownTimes.containsKey(uuid)) { + Integer[] initTimers = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + cooldownTimes.put(uuid, initTimers); + } + Integer[] pTimes = cooldownTimes.get(uuid); + switch (ability) { + case "digging": + return pTimes[0]; + case "woodcutting": + return pTimes[1]; + case "mining": + return pTimes[2]; + case "farming": + return pTimes[3]; + case "fishing": + return pTimes[4]; + case "archery": + return pTimes[5]; + case "beastMastery": + return pTimes[6]; + case "swordsmanship": + return pTimes[7]; + case "defense": + return pTimes[8]; + case "axeMastery": + return pTimes[9]; + case "woodcuttingHaste": + return pTimes[10]; + case "fishingRob": + return pTimes[11]; + default: + return 0; + } + } + + public void setTimes(Map timers) { + this.cooldownTimes = timers; + } + + public void removePlayer() { + Integer[] pTimers = getPlayerCooldownTimes(); + boolean allZero = true; + for (int i : pTimers) { + if (i > 0) { + allZero = false; + break; + } + } + if (allZero) { + cooldownTimes.remove(uuid); + abilityDurationTimes.remove(uuid); + abilityDurationBossBar.remove(uuid); + } + } + + public void killCooldownTask(UUID taskUUID) { + int taskId = cooldownTaskIds.get(taskUUID); + Bukkit.getScheduler().cancelTask(taskId); + cooldownTaskIds.remove(taskUUID); + } + + public void initializeCooldownTimer( + String skillName) { //Used to make sure the cooldown if the player logs out before it starts + setPlayerCooldownTime(skillName, 1); + } + + public void cooldownTimer(String skillName, String cooldownCompleteMessage) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + PlayerStats pStatClass = new PlayerStats(player); + Map> pStat = pStatClass.getPlayerData(); + ConfigLoad configLoad = new ConfigLoad(); + int cooldown = configLoad.getAbilityCooldowns().get(skillName); + if ((int) pStat.get("global").get(11) > 0) { + cooldown = (int) Math.round(cooldown * 2.0 / 3.0); + } + setPlayerCooldownTime(skillName, cooldown); + UUID taskUUID = UUID.randomUUID(); + int taskId = new BukkitRunnable() { + @Override + public void run() { + int timeRemaining = getPlayerCooldownTime(skillName) - 1; + if (timeRemaining <= 0) { + setPlayerCooldownTime(skillName, timeRemaining); + if (!player.isOnline()) { + removePlayer(); + } else { + ActionBarMessages actionMessage = new ActionBarMessages(player); + actionMessage.sendMessage(cooldownCompleteMessage); + } + killCooldownTask(taskUUID); + } else { + setPlayerCooldownTime(skillName, timeRemaining); + } + } + }.runTaskTimer(plugin, 20, 20).getTaskId(); + cooldownTaskIds.put(taskUUID, taskId); + } + + public void abilityDurationTimer(String skillName, long duration, String endMessage, + String cooldownEndMessage) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + initializeCooldownTimer(skillName); + setAbilityDurationTime(skillName, (int) duration); + int refreshTicks = 2; + UUID taskUUID = UUID.randomUUID(); + int taskID = new BukkitRunnable() { //The outer task is used for Ability time remaining bars and is accurate to 0.1 seconds on default + @Override + public void run() { + int timeRemaining = getPlayerDurationTime(skillName) - refreshTicks; + durationBarUpdate(skillName, timeRemaining, duration); + if (timeRemaining < refreshTicks) { + new BukkitRunnable() { + @Override + public void run() { + endAbility(skillName, endMessage, cooldownEndMessage, false); + } + }.runTaskLater(plugin, timeRemaining); + killDurationTask(taskUUID); //Kill this task as soon as the new task is scheduled + } else { + setAbilityDurationTime(skillName, timeRemaining); + } + } + }.runTaskTimer(plugin, refreshTicks, refreshTicks).getTaskId(); + abilityDurationTaskIds.put(taskUUID, taskID); + AbilityLogoutTracker incaseLogout = new AbilityLogoutTracker(player); + incaseLogout.setPlayerTask(skillName, taskID); + } + + public void abilityDurationTimer(String skillName, long duration, String endMessage, + String cooldownEndMessage, NamespacedKey key, ItemStack itemHeldInHand, int enchantLevel, + int levelReqLevel) { //OverSpecified for Mining/Digging/Swordsmanship + this.itemInHand = itemHeldInHand; + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + initializeCooldownTimer(skillName); + setAbilityDurationTime(skillName, (int) duration); + int refreshTicks = 2; + UUID taskUUID = UUID.randomUUID(); + int taskID = new BukkitRunnable() { //The outer task is used for Ability time remaining bars and is accurate to 0.1 seconds on default + @Override + public void run() { + int timeRemaining = getPlayerDurationTime(skillName) - refreshTicks; + durationBarUpdate(skillName, timeRemaining, duration); + if (timeRemaining < refreshTicks) { + new BukkitRunnable() { + @Override + public void run() { + endAbility(skillName, endMessage, cooldownEndMessage, key, itemHeldInHand, + enchantLevel, levelReqLevel, false); + } + }.runTaskLater(plugin, timeRemaining); + killDurationTask(taskUUID); //Kill this task as soon as the new task is scheduled + } else { + setAbilityDurationTime(skillName, timeRemaining); + } + } + }.runTaskTimer(plugin, refreshTicks, refreshTicks).getTaskId(); + abilityDurationTaskIds.put(taskUUID, taskID); + AbilityLogoutTracker incaseLogout = new AbilityLogoutTracker(player); + incaseLogout.setPlayerItem(skillName, key); + incaseLogout.setPlayerTask(skillName, taskID); + } + + public void endAbility(String skillName, String endMessage, String cooldownEndMessage, + boolean isDisabling) { + ActionBarMessages actionMessage = new ActionBarMessages(player); + AbilityTracker abilities = new AbilityTracker(player); + if (player.isOnline()) { + actionMessage.sendMessage(endMessage); + } + abilities.setPlayerAbility(skillName, -1); + durationBarUpdate(skillName, 0, + 1); //The total duration doesn't matter here, the bar should be removed + if (!isDisabling) { + cooldownTimer(skillName, cooldownEndMessage); + } + } + + public void endAbility(String skillName, String endMessage, String cooldownEndMessage, + NamespacedKey key, ItemStack itemHeldInHand, int enchantLevel, int levelReqLevel, + boolean isDisabling) { + ActionBarMessages actionMessage = new ActionBarMessages(player); + AbilityTracker abilities = new AbilityTracker(player); + if (player.isOnline()) { + actionMessage.sendMessage(endMessage); + } + abilities.setPlayerAbility(skillName, -1); + durationBarUpdate(skillName, 0, + 1); //The total duration doesn't matter here, the bar should be removed + if (skillName.equalsIgnoreCase("digging") || skillName.equalsIgnoreCase("mining")) { + TrackItem trackItem = new TrackItem(); + ItemStack potentialAbilityItem = trackItem.findTrackedItemInInventory(player, key); + if (potentialAbilityItem != null) { + itemHeldInHand = potentialAbilityItem; + } + itemHeldInHand.removeEnchantment(Enchantment.DIG_SPEED); + if (enchantLevel != 0) { + itemHeldInHand.addUnsafeEnchantment(Enchantment.DIG_SPEED, enchantLevel); + } + } else if (skillName.equalsIgnoreCase("swordsmanship")) { + TrackItem trackItem = new TrackItem(); + ItemStack potentialAbilityItem = trackItem.findTrackedItemInInventory(player, key); + if (potentialAbilityItem != null) { + itemHeldInHand = potentialAbilityItem; + } + ((Attributable) player).getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(4.0); + if (levelReqLevel > 0) { + if (enchantLevel > 0) { + itemHeldInHand.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, enchantLevel); + } else { + itemHeldInHand.removeEnchantment(Enchantment.DAMAGE_ALL); + } + } + } + if (!isDisabling) { + cooldownTimer(skillName, cooldownEndMessage); + } + } + + + public void killDurationTask(UUID taskID) { + int taskId = abilityDurationTaskIds.get(taskID); + Bukkit.getScheduler().cancelTask(taskId); + abilityDurationTaskIds.remove(taskID); + } + + public void setAbilityDurationTime(String skillName, int duration) { + initializeAbilityDurationTimes(); + Map playerAbilityDurations = abilityDurationTimes.get(uuid); + playerAbilityDurations.put(skillName, duration); + abilityDurationTimes.put(uuid, playerAbilityDurations); + } + + public void initializeAbilityDurationTimes() { + Map skillTimes = new ConcurrentHashMap<>(); + abilityDurationTimes.putIfAbsent(uuid, skillTimes); + } + + public int getPlayerDurationTime(String skillName) { + if (abilityDurationTimes.containsKey(uuid)) { + if (abilityDurationTimes.get(uuid).containsKey(skillName)) { + return abilityDurationTimes.get(uuid).get(skillName); + } + } + return 0; + } + + public void durationBarUpdate(String skillName, long timeRemaining, long totalDuration) { + BossBarStorage bossBarStorage = new BossBarStorage(); + PlayerStats playerStats = new PlayerStats(player); + int numberOfBossBarsAllowed = (int) playerStats.getPlayerData().get("global").get(28); + + if (!player.isOnline()) { //If the player is offline, the bossbar is gone, but we still want the task to run + return; + } + + //Get the bossbar object + BossBar durationBar = getPlayerBossBar(skillName); + if (durationBar + == null) { //If the bossbar hasn't been stored yet, get it from the bossbarstorage class + int numberOfActiveBars = bossBarStorage.numberOfActiveDurationBars(player); + if (numberOfBossBarsAllowed + <= numberOfActiveBars) { //If there's already too many ability bars running, don't add a new one + return; + } else { + durationBar = bossBarStorage.getLowestUnoccupiedBar(player); + setPlayerBossBar(skillName, durationBar); + } + } + + if (timeRemaining + <= 0) { //If there's no time left, just remove the boss bar and set it to invisible/unused + durationBar.setVisible(false); + removeDurationBar(skillName); + return; + } + + //Set the bossbar for player viewing + LanguageSelector lang = new LanguageSelector(player); + double totalTime = (double) totalDuration; + double timeLeft = (double) timeRemaining; + double percentageTimeRemaining = timeLeft / totalTime; + double integerMultiple = 0.2; + double timeRemainingInSeconds = round((timeLeft / 20.0), integerMultiple); + int roundingPlace = 0; + String integerMultipleString = String.valueOf(integerMultiple); + if (integerMultipleString.contains(".")) { + String[] splitter = integerMultipleString.split("\\."); + roundingPlace = splitter[1].length(); + } + String formatString = "%." + roundingPlace + "f"; + String timeRemainingInSecondsString = String.format(formatString, timeRemainingInSeconds); + durationBar.setProgress(percentageTimeRemaining); + durationBar.setTitle( + ChatColor.GRAY + getAbilityName(skillName) + " " + lang.getString("timeRemaining") + ": " + + ChatColor.WHITE + timeRemainingInSecondsString + ChatColor.GRAY + "s"); + durationBar.setVisible(true); + + } + + public double round(double num, double integerMultipleOf) { + return Math.round(num / integerMultipleOf) * integerMultipleOf; + } + + public String getAbilityName(String skillName) { + LanguageSelector lang = new LanguageSelector(player); + switch (skillName) { + case "archery": + return lang.getString("rapidFire"); + case "axeMastery": + return lang.getString("greatAxe"); + case "beastMastery": + return lang.getString("spurKick"); + case "defense": + return lang.getString("stoneSoldier"); + case "digging": + return lang.getString("bigDig"); + case "farming": + return lang.getString("naturalRegeneration"); + case "fishing": + return lang.getString("superBait"); + case "mining": + return lang.getString("berserkPick"); + case "swordsmanship": + return lang.getString("swiftStrikes"); + case "woodcutting": + return lang.getString("timber"); + default: + return ""; + + } + } + + public void initializePlayerBossBars() { + Map skillBossBars = new ConcurrentHashMap<>(); + abilityDurationBossBar.putIfAbsent(uuid, skillBossBars); + } + + public BossBar getPlayerBossBar(String skillName) { + if (abilityDurationBossBar.containsKey(uuid)) { + if (abilityDurationBossBar.get(uuid).containsKey(skillName)) { + return abilityDurationBossBar.get(uuid).get(skillName); + } + } + return null; + } + + public void setPlayerBossBar(String skillName, BossBar durationBar) { + initializePlayerBossBars(); + Map playerAbilityDurationBars = abilityDurationBossBar.get(uuid); + playerAbilityDurationBars.put(skillName, durationBar); + abilityDurationBossBar.put(uuid, playerAbilityDurationBars); + } + + public void removeDurationBar(String skillName) { + if (abilityDurationBossBar.containsKey(uuid)) { + if (abilityDurationBossBar.get(uuid).containsKey(skillName)) { + Map playerAbilityDurationBars = abilityDurationBossBar.get(uuid); + playerAbilityDurationBars.remove(skillName); + abilityDurationBossBar.putIfAbsent(uuid, playerAbilityDurationBars); + } + } + } + +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/player/AbilityTracker.java b/src/main/java/mc/carlton/freerpg/core/info/player/AbilityTracker.java new file mode 100644 index 0000000..81829e8 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/player/AbilityTracker.java @@ -0,0 +1,143 @@ +package mc.carlton.freerpg.core.info.player; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.bukkit.entity.Player; + +public class AbilityTracker { + + static Map playerAbilities = new HashMap(); + private Player player; + private UUID uuid; + + public AbilityTracker(Player p) { + this.player = p; + this.uuid = player.getUniqueId(); + } + + public Integer[] getPlayerAbilities() { + if (!playerAbilities.containsKey(uuid)) { + Integer[] initAbils = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; + playerAbilities.put(uuid, initAbils); + } + return playerAbilities.get(uuid); + } + + public Map getAbilities() { + if (!playerAbilities.containsKey(uuid)) { + Integer[] initAbils = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; + playerAbilities.put(uuid, initAbils); + } + return playerAbilities; + } + + public void setAbilities(Map abilities) { + this.playerAbilities = abilities; + } + + public void setPlayerAbility(String ability, int taskID) { + if (!playerAbilities.containsKey(uuid)) { + return; + } + Integer[] pAbils = playerAbilities.get(uuid); + switch (ability) { + case "digging": + pAbils[0] = taskID; + break; + case "woodcutting": + pAbils[1] = taskID; + break; + case "mining": + pAbils[2] = taskID; + break; + case "farming": + pAbils[3] = taskID; + break; + case "fishing": + pAbils[4] = taskID; + break; + case "archery": + pAbils[5] = taskID; + break; + case "beastMastery": + pAbils[6] = taskID; + break; + case "swordsmanship": + pAbils[7] = taskID; + break; + case "defense": + pAbils[8] = taskID; + break; + case "axeMastery": + pAbils[9] = taskID; + break; + case "woodcuttingHaste": + pAbils[10] = taskID; + break; + case "diggingToggle": + pAbils[11] = taskID; + break; + case "archeryCrossbow": + pAbils[12] = taskID; + break; + case "swordsSpeed": + pAbils[13] = taskID; + break; + case "swordsStrength": + pAbils[14] = taskID; + break; + default: + break; + } + playerAbilities.put(uuid, pAbils); + } + + public int getPlayerAbility(String ability) { + if (!playerAbilities.containsKey(uuid)) { + Integer[] initAbils = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; + playerAbilities.put(uuid, initAbils); + } + Integer[] pAbils = playerAbilities.get(uuid); + switch (ability) { + case "digging": + return pAbils[0]; + case "woodcutting": + return pAbils[1]; + case "mining": + return pAbils[2]; + case "farming": + return pAbils[3]; + case "fishing": + return pAbils[4]; + case "archery": + return pAbils[5]; + case "beastMastery": + return pAbils[6]; + case "swordsmanship": + return pAbils[7]; + case "defense": + return pAbils[8]; + case "axeMastery": + return pAbils[9]; + case "woodcuttingHaste": + return pAbils[10]; + case "diggingToggle": + return pAbils[11]; + case "archeryCrossbow": + return pAbils[12]; + case "swordsSpeed": + return pAbils[13]; + case "swordsStrength": + return pAbils[14]; + default: + return -1; + } + } + + public void removePlayer() { + playerAbilities.remove(uuid); + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/player/ChangeStats.java b/src/main/java/mc/carlton/freerpg/core/info/player/ChangeStats.java new file mode 100644 index 0000000..5e37600 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/player/ChangeStats.java @@ -0,0 +1,914 @@ +package mc.carlton.freerpg.core.info.player; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.leaveAndJoin.LogoutProcedure; +import mc.carlton.freerpg.events.gui.MaxPassiveLevels; +import mc.carlton.freerpg.skills.perksAndAbilities.Agility; +import mc.carlton.freerpg.skills.perksAndAbilities.Defense; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import mc.carlton.freerpg.skills.perksAndAbilities.Fishing; +import mc.carlton.freerpg.skills.perksAndAbilities.Global; +import mc.carlton.freerpg.utils.game.ActionBarMessages; +import mc.carlton.freerpg.utils.game.BossBarStorage; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.GameMode; +import org.bukkit.Sound; +import org.bukkit.boss.BarColor; +import org.bukkit.boss.BossBar; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class ChangeStats { + + static Map isPlayerFlashingText = new ConcurrentHashMap<>(); + static Map playerRemoveEXPBarTaskIdMap = new ConcurrentHashMap<>(); + ArrayList multipliers; + ArrayList tokensInfo; + ArrayList levelingInfo; + Map maxLevels; + ActionBarMessages actionMessage; + Map allowedSkillsMap = new HashMap<>(); + Map allowedSkillGainEXPMap = new HashMap<>(); + String beginnerLevelUpMessage; + int maxLevelForBeginnerMessage; + private Player p; + private String pName; + private UUID uuid; + private boolean isCommand; + private boolean isSilent; + + public ChangeStats(Player p) { + this.p = p; + this.pName = p.getDisplayName(); + this.uuid = p.getUniqueId(); + ConfigLoad loadConfig = new ConfigLoad(); + maxLevels = loadConfig.getMaxLevels(); + multipliers = loadConfig.getMultipliers(); + tokensInfo = loadConfig.getTokensInfo(); + levelingInfo = loadConfig.getLevelingInfo(); + this.isCommand = false; + this.isSilent = false; + this.actionMessage = new ActionBarMessages(p); + this.allowedSkillsMap = loadConfig.getAllowedSkillsMap(); + this.allowedSkillGainEXPMap = loadConfig.getAllowedSkillGainEXPMap(); + this.beginnerLevelUpMessage = loadConfig.getBeginnerLevelUpMessage(); + this.maxLevelForBeginnerMessage = loadConfig.getMaxLevelForBeginnerMessage(); + } + + public void set_isCommand(boolean isFromCommand) { + this.isCommand = isFromCommand; + } + + public void set_silent(boolean isSilentExectuion) { + this.isSilent = isSilentExectuion; + } + + public boolean checkPerms(String skillName) { + boolean hasPerms = true; + String perm = "freeRPG." + skillName + "EXP"; + if (!p.hasPermission(perm)) { + hasPerms = false; + } + return hasPerms; + } + + public void changeEXP(String skillName, int expChange) { + boolean hasPerms = checkPerms(skillName); + if (!hasPerms) { + return; + } + if (p.getGameMode() == GameMode.CREATIVE && !isCommand) { + return; + } + if (expChange <= 0) { + return; + } + if (!skillName.equals("global")) { + LanguageSelector lang = new LanguageSelector(p); + String[] titles_0 = {lang.getString("digging"), lang.getString("woodcutting"), + lang.getString("mining"), lang.getString("farming"), lang.getString("fishing"), + lang.getString("archery"), lang.getString("beastMastery"), + lang.getString("swordsmanship"), lang.getString("defense"), lang.getString("axeMastery"), + lang.getString("repair"), lang.getString("agility"), lang.getString("alchemy"), + lang.getString("smelting"), lang.getString("enchanting"), lang.getString("global")}; + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting", "global"}; + List labels_arr = Arrays.asList(labels_0); + String skillTitle = titles_0[labels_arr.indexOf(skillName)]; + + //Check if gaining skill EXP is disabled or the skill is disabled + if (!allowedSkillGainEXPMap.get(skillName) || !allowedSkillsMap.get(skillName)) { + return; + } + + //Get stats + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ArrayList pStats = pStatAll.get(skillName); + ArrayList pGlobalStats = pStatAll.get("global"); + + //Multipliers + if (!isCommand) { + expChange = (int) Math.ceil( + expChange * getSkillMultiplier(skillName)); //multiplies exp by all mutlipliers + } + + //Get Corresponding maxLevel + int maxLevel = getMaxLevel(skillName); + + //TokensInfo + double autoPassive = tokensInfo.get(0); + double levelsPerPassive = tokensInfo.get(1); + double levelsPerSkill = tokensInfo.get(2); + double levelsPerGlobal = tokensInfo.get(3); + + // get old stats + int exp = pStats.get(1).intValue(); + int oldLevel = pStats.get(0).intValue(); + int oldGlobalLevel = pGlobalStats.get(0).intValue(); + int tokens_S = (int) pStats.get(3); + int tokens_P = (int) pStats.get(2); + int tokens_G = (int) pGlobalStats.get(1); + + //If currently level is already maxed, do nothing + if (oldLevel >= maxLevel) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.isEarnExperiencePastMaxLevel()) { + return; + } + } + + // set new stats + exp += expChange; + int totalEXP = (int) pGlobalStats.get(29) + expChange; + int level = 0; + int newTokens_S = 0; + int newTokens_P = 0; + int newTokens_G = 0; + level = getLevelfromEXP(exp); + + //if new level is greater than the max level, set it to the max level + boolean isMaxLevel = false; + if (level >= maxLevel) { + level = maxLevel; + isMaxLevel = true; + } + + //EXP bar + setupBossBar(exp, oldLevel, level, skillTitle, skillName, expChange, isMaxLevel); + + int levelChange = level - oldLevel; + int globalLevel = oldGlobalLevel + levelChange; + if (levelChange > 0) { + int oldLevel_s = (int) Math.floor(oldLevel / levelsPerSkill); + int level_s = (int) Math.floor(level / levelsPerSkill); + int oldLevel_g = (int) Math.floor(oldGlobalLevel / levelsPerGlobal); + int level_g = (int) Math.floor(globalLevel / levelsPerGlobal); + newTokens_S = level_s - oldLevel_s; + newTokens_G = level_g - oldLevel_g; + int extraSkillTokens = -100; + int extraGlobalTokens = -100; + boolean gainedGlobalToken = false; + int passiveBoost = 0; + if (newTokens_S > 0) { + extraSkillTokens = areSkillsMaxed(skillName, newTokens_S); + if (extraSkillTokens >= 0) { + newTokens_S -= extraSkillTokens; + } + } + if (newTokens_G > 0) { + gainedGlobalToken = true; + extraGlobalTokens = areGlobalPerksMaxed(newTokens_G); + if (extraGlobalTokens >= 0) { + newTokens_G -= extraGlobalTokens; + ConfigLoad loadConfig = new ConfigLoad(); + double multiplierIncrease = extraGlobalTokens * loadConfig.getTokensInfo().get(8); + changeStat("global", 23, multiplierIncrease); + } + } + if (!skillName.equals("repair") && !skillName.equals("agility") && !skillName.equals( + "alchemy") && !skillName.equals("smelting") && !skillName.equals("enchanting")) { + int oldLevel_p = (int) Math.floor(oldLevel / levelsPerPassive); + int level_p = (int) Math.floor(level / levelsPerPassive); + newTokens_P = level_p - oldLevel_p; + if (extraSkillTokens > 0) { + ConfigLoad loadConfig = new ConfigLoad(); + newTokens_P += (int) (extraSkillTokens * loadConfig.getTokensInfo().get(7)); + } + } else { + if (extraSkillTokens > 0) { + ConfigLoad loadConfig = new ConfigLoad(); + passiveBoost += (int) (extraSkillTokens * loadConfig.getTokensInfo().get(7)); + } + } + tokens_S += newTokens_S; + tokens_P += newTokens_P; + tokens_G += newTokens_G; + String bars = "------------------------------------------------"; + String levelUpMessage = skillTitle + " " + lang.getString("level") + " " + level + "!"; + String sbSpace = ""; + int spaces = bars.length() - levelUpMessage.length(); + if (!(spaces % 2 == 0)) { + bars += "-"; + spaces -= 1; + } + for (int i = 0; i < spaces / 2.0; i++) { + sbSpace += " "; + } + if ((int) pGlobalStats.get(21) > 0 && !isSilent) { //Level Up Message Toggle Conditional + if (gainedGlobalToken) { + p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_HARP, 1, 1); + if (newTokens_G > 0 && extraGlobalTokens <= 0) { + p.sendTitle(ChatColor.DARK_PURPLE + lang.getString("globalPassiveTitle0") + " " + "+" + + newTokens_G, + ChatColor.YELLOW + lang.getString("try0") + " /frpg skillTree global", 5, 40, 20); + } else { + ConfigLoad loadConfig = new ConfigLoad(); + double multiplierIncrease = extraGlobalTokens * loadConfig.getTokensInfo().get(8); + String percentageIncreaseString = String.valueOf(multiplierIncrease * 100) + "%"; + p.sendTitle(ChatColor.DARK_PURPLE + lang.getString("expIncrease") + " +" + + percentageIncreaseString, + ChatColor.RED + lang.getString("globalPassiveTitle0") + " " + "+" + newTokens_G, + 5, 40, 20); + } + } + if (newTokens_S > 0 || oldLevel < 3) { + p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_HARP, 1, 1); + p.sendMessage(bars); + p.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + sbSpace + levelUpMessage); + if (newTokens_P > 0) { + p.sendMessage(ChatColor.LIGHT_PURPLE + "+" + newTokens_P + " " + lang.getString( + "diggingPassiveTitle0")); + } + if (newTokens_S > 0) { + p.sendMessage(ChatColor.GOLD + "+" + newTokens_S + " " + lang.getString( + "diggingPassiveTitle2")); + } + if (newTokens_G > 0) { + p.sendMessage(ChatColor.DARK_PURPLE + "+" + newTokens_G + " " + lang.getString( + "globalPassiveTitle0")); + } + if (oldLevel < maxLevelForBeginnerMessage) { + p.sendMessage(""); + if (!beginnerLevelUpMessage.equalsIgnoreCase("")) { + p.sendMessage(ChatColor.ITALIC + beginnerLevelUpMessage); + } else { + p.sendMessage(ChatColor.ITALIC + lang.getString("passiveImprove")); + p.sendMessage( + ChatColor.ITALIC + lang.getString("try0") + " /frpg skillTree " + skillName); + } + } + p.sendMessage(bars); + } else { + actionMessage.sendMessage( + ChatColor.YELLOW + skillTitle + " " + lang.getString("increasedBy") + " " + + Integer.toString(levelChange) + ". (" + level + ")"); + } + } + pStats.set(0, level); //Level change + pStats.set(2, tokens_P); //Passive token change + pStats.set(3, tokens_S); //Skill token change + int autoPassivesChange = 0; + int oldLevel_auto_p = (int) Math.floor(oldLevel / autoPassive); + int level_auto_p = (int) Math.floor(level / autoPassive); + autoPassivesChange = level_auto_p - oldLevel_auto_p; + pStats.set(4, + (int) pStats.get(4) + autoPassivesChange + passiveBoost); //Duration (passive 1) Boost + MaxPassiveLevels passiveMax = new MaxPassiveLevels(); + int passiveMax2 = passiveMax.findMaxLevel(skillName, 2); + int passiveMax3 = passiveMax.findMaxLevel(skillName, 3); + pStats.set(5, (int) Math.min((int) pStats.get(5) + autoPassivesChange + passiveBoost, + passiveMax2)); //Passive 2 Boost + pStats.set(6, (int) Math.min((int) pStats.get(6) + autoPassivesChange + passiveBoost, + passiveMax3)); //Passive 3 Boost + pGlobalStats.set(0, globalLevel); //Global level change + pGlobalStats.set(1, tokens_G); //Global token change + } + + pStats.set(1, exp); //Set skill exp + pGlobalStats.set(29, totalEXP); //Set global exp + + // Sets stats + pStatAll.put(skillName, pStats); + pStatAll.put("global", pGlobalStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + + //Update Player Leaderboard + ConfigLoad configLoad = new ConfigLoad(); + if (configLoad.isLeaderboardDyanmicUpdate()) { + Leaderboards leaderboards = new Leaderboards(); + leaderboards.updatePlayerStats(p, skillName, exp, level); //Updates skill + leaderboards.updatePlayerStats(p, "global", globalLevel, totalEXP); //Updates Global + } + } + } + + /* Currently Broken + private int getPassiveTokenIncrease(int oldLevel, int newLevel){ + double levelsPerPassive = tokensInfo.get(1); + int oldLevel_p = (int)Math.floor(oldLevel/levelsPerPassive); + int level_p = (int) Math.floor(newLevel/levelsPerPassive); + int newTokens_P = level_p-oldLevel_p; + return newTokens_P; + } + + */ + + private int getAutomaticPassiveSkillIncrease(String skillName, int oldLevel, int newLevel, + int passiveSkillIndex) { + + //Get current passive tokens + ArrayList pStats = getPlayerSkillStats(skillName); + int passiveSkillLevel = (int) pStats.get(3 + passiveSkillIndex); //Get the passive skill level + + //Get automatic passive tokens gained + int autoPassivesChange = getAutoPassiveChange(oldLevel, newLevel); + + //Get the max passive skill level + MaxPassiveLevels passiveMax = new MaxPassiveLevels(); + int passiveMaxLevel = passiveMax.findMaxLevel(skillName, passiveSkillIndex); + + //Determine how many tokens to add + int automaticPassiveTokensGained; + if (passiveSkillLevel + autoPassivesChange >= passiveMaxLevel) { + automaticPassiveTokensGained = + passiveMaxLevel - passiveSkillLevel; //Reward the player just enough to get them the max + } else { + automaticPassiveTokensGained = autoPassivesChange; //Reward the player the normal amount + } + + return automaticPassiveTokensGained; + } + + private int getAutoPassiveChange(int oldLevel, int newLevel) { + double autoPassive = tokensInfo.get(0); + int oldLevel_auto_p = (int) Math.floor(oldLevel / autoPassive); + int level_auto_p = (int) Math.floor(newLevel / autoPassive); + int autoPassivesChange = level_auto_p - oldLevel_auto_p; + return autoPassivesChange; + } + + /* CURRENTLY BROKEN + private int getSkillTokenIncrease(int oldLevel, int newLevel) { + double levelsPerSkill = tokensInfo.get(2); + int oldLevel_s = (int)Math.floor(oldLevel/levelsPerSkill); + int level_s = (int) Math.floor(newLevel/levelsPerSkill); + int newTokens_S = level_s-oldLevel_s; + return newTokens_S; + } + + */ + + private int getGlobalTokenIncrease(int oldLevel, int newLevel) { + double levelsPerGlobal = tokensInfo.get(3); + int oldLevel_g = (int) Math.floor(oldLevel / levelsPerGlobal); + int level_g = (int) Math.floor(newLevel / levelsPerGlobal); + int newTokens_G = level_g - oldLevel_g; + if (newTokens_G > 0) { + int extraGlobalTokens = areGlobalPerksMaxed(newTokens_G); + if (extraGlobalTokens >= 0) { + newTokens_G = newTokens_G - extraGlobalTokens; + } + } + return newTokens_G; + } + + public double getSkillMultiplier(String skillName) { + PlayerStats pStatClass = new PlayerStats(p); + ArrayList pGlobalStats = pStatClass.getPlayerData().get("global"); + Global globalClass = new Global(p); + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting", "global"}; + List labels_arr = Arrays.asList(labels_0); + return ((double) pGlobalStats.get(23) * multipliers.get(0)) * (multipliers.get( + labels_arr.indexOf(skillName) + 1)) * (globalClass.expBoost(skillName)); + } + + public void checkPlayerLevelEXPCurveConsistency() { + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + set_silent(true); + set_isCommand(true); + PlayerStats pStatClass = new PlayerStats(p); + Map>> allStats = pStatClass.getData(); + Map> pStats = allStats.get(p.getUniqueId()); + Map expTotalMap = new HashMap<>(); + boolean statsNeedToBeChanged = false; + for (String label : labels_0) { + int maxLevel = getMaxLevel(label); + ArrayList pStat = pStats.get(label); + int exp = (int) pStat.get(1); + expTotalMap.put(label, exp); + int level = (int) pStat.get(0); + int expectedLevel = getLevelfromEXP(exp); + if (level != expectedLevel && level < maxLevel) { + statsNeedToBeChanged = true; + } + } + if (statsNeedToBeChanged) { + resetStat("global"); + String[] labels_1 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + for (String label : labels_1) { + resetStat(label); //Reset all stats + } + for (String label : labels_1) { //Might cause global token errors if done in the same loop + changeEXP(label, expTotalMap.get(label)); //Increase experience for all stats + } + LanguageSelector lang = new LanguageSelector(p); + p.sendMessage(ChatColor.RED + lang.getString("statsUpdated")); + } + } + + public void resetStat(String skillName) { + PlayerStats pStatClass = new PlayerStats(p); + Map>> allStats = pStatClass.getData(); + Map> pStats = allStats.get(p.getUniqueId()); + ArrayList pStat = pStats.get(skillName); + int maxIndex = 13; + if (skillName.equalsIgnoreCase("global")) { + maxIndex = 11; + } + for (int i = 0; i <= maxIndex; i++) { + pStat.set(i, 0); + } + pStats.put(skillName, pStat); + allStats.put(p.getUniqueId(), pStats); + pStatClass.setData(allStats); + setTotalLevel(); + setTotalExperience(); + if (!skillName.equalsIgnoreCase("global")) { + //Currently disabled to prevent accidental infinite skill token gain + //reevaluatedGlobalTree(); + } + } + + public void reevaluatedGlobalTree() { + resetStat("global"); + setTotalLevel(); + ArrayList globalStats = getPlayerSkillStats("global"); + int globalTokens = getGlobalTokenIncrease(0, (int) globalStats.get(0)); + setStat("global", 1, globalTokens); + } + + public void refundSkillTree(String skillName) { + endSkillTasks(skillName); //Ends tasks like "Fish Person" and other repeating tasks + resetSkillTokens(skillName); //Refund skill tokens + resetPassiveTokens(skillName); //Refund passive tokens + } + + private void resetSkillTokens(String skillName) { + ArrayList pStats = getPlayerSkillStats(skillName); + //Find Skill Tokens, Refund skill tokens, set skills to 0 + if (!skillName.equalsIgnoreCase("global")) { + int totalSkillTokens = ((int) pStats.get(3) + (int) pStats.get(7) + (int) pStats.get(8) + + (int) pStats.get(9) + (int) pStats.get(10) + (int) pStats.get(11) + (int) pStats.get(12) + + (int) pStats.get(13)); + setStat(skillName, 3, totalSkillTokens); + setStat(skillName, 7, 0); + setStat(skillName, 8, 0); + setStat(skillName, 9, 0); + setStat(skillName, 10, 0); + setStat(skillName, 11, 0); + setStat(skillName, 12, 0); + setStat(skillName, 13, 0); + } else { + int totalGlobalTokens = ((int) pStats.get(1) + (int) pStats.get(2) + (int) pStats.get(3) + + (int) pStats.get(4) + + (int) pStats.get(5) + (int) pStats.get(6) + (int) pStats.get(7) + (int) pStats.get(8) + + (int) pStats.get(9) + (int) pStats.get(10) + (int) pStats.get(11)); + setStat(skillName, 1, totalGlobalTokens); + setStat(skillName, 2, 0); + setStat(skillName, 3, 0); + setStat(skillName, 4, 0); + setStat(skillName, 5, 0); + setStat(skillName, 6, 0); + setStat(skillName, 7, 0); + setStat(skillName, 8, 0); + setStat(skillName, 9, 0); + setStat(skillName, 10, 0); + setStat(skillName, 11, 0); + } + } + + private void resetPassiveTokens(String skillName) { + String[] mainSkills_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery"}; + List mainSkills = Arrays.asList(mainSkills_0); + ArrayList pStats = getPlayerSkillStats(skillName); + if (mainSkills.contains(skillName)) { + int level = (int) pStats.get(0); + int automaticPassiveTokens = getAutoPassiveChange(0, level); + + // Set new passive tokens to spend + // passive tokens to spend = Total current tokens + investments into 3 passive skills - automatic tokens gained in 3 passive skills + int totalPassiveTokens = (int) pStats.get(2) + //Current passive tokens + Math.max((int) pStats.get(4) - automaticPassiveTokens, 0) + + //Tokens invested into passive 1 + Math.max((int) pStats.get(5) - automaticPassiveTokens, 0) + + //Tokens invested into passive 2 + Math.max((int) pStats.get(6) - automaticPassiveTokens, + 0); //Tokens invested into passive 3 + setStat(skillName, 2, totalPassiveTokens); + + //Get maximum passive skill levels + MaxPassiveLevels maxPassiveLevels = new MaxPassiveLevels(); + + //Set passive skills to what they would have been if no skill points were invested + setStat(skillName, 4, + Math.min(automaticPassiveTokens, maxPassiveLevels.findMaxLevel(skillName, 1))); + setStat(skillName, 5, + Math.min(automaticPassiveTokens, maxPassiveLevels.findMaxLevel(skillName, 2))); + setStat(skillName, 6, + Math.min(automaticPassiveTokens, maxPassiveLevels.findMaxLevel(skillName, 3))); + } + } + + private void endSkillTasks(String skillName) { + ArrayList pStats = getPlayerSkillStats(skillName); + + //We use some methods from logoutProcedure + LogoutProcedure logoutProcedure = new LogoutProcedure(p); + if (skillName.equalsIgnoreCase("swordsmanship")) { + logoutProcedure.preventLogoutTheftSwordsmanship(false); + } else if (skillName.equalsIgnoreCase("defense")) { + logoutProcedure.preventLogoutTheftDefense(false); + } else if (skillName.equalsIgnoreCase("mining")) { + logoutProcedure.preventLogoutTheftMining(false); + } else if (skillName.equalsIgnoreCase("digging")) { + logoutProcedure.preventLogoutTheftDigging(false); + } + + //Ends all tasks that track players' buffs gained from some skills + if (skillName.equals("farming") && (int) pStats.get(13) > 0) { + Farming farmingClass = new Farming(p); + farmingClass.oneWithNatureEnd(); + } else if (skillName.equals("fishing") && (int) pStats.get(13) > 0) { + Fishing fishingClass = new Fishing(p); + fishingClass.fishPersonEnd(); + } else if (skillName.equals("agility") && (int) pStats.get(13) > 0) { + Agility agilityClass = new Agility(p); + agilityClass.gracefulFeetEnd(); + } else if (skillName.equals("defense") && (int) pStats.get(13) > 0) { + Defense defenseClass = new Defense(p); + defenseClass.toggleHearty(0, (int) getPlayerSkillStats("global").get(30)); + } + } + + private ArrayList getPlayerSkillStats(String skillName) { + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ArrayList pStats = pStatAll.get(skillName); + return pStats; + } + + public int areSkillsMaxed(String skillName, int skillTokensGained) { + String[] passive_skills_0 = {"repair", "agility", "alchemy", "smelting", "enchanting"}; + List passiveSkills = Arrays.asList(passive_skills_0); + int maxSkillTokens = 23; + int currentSkillTotal = 0; + if (passiveSkills.contains(skillName)) { + maxSkillTokens = 11; + } + + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ArrayList pStats = pStatAll.get(skillName); + currentSkillTotal = + (int) pStats.get(3) + (int) pStats.get(7) + (int) pStats.get(8) + (int) pStats.get(9) + + (int) pStats.get(10) + (int) pStats.get(11) + (int) pStats.get(12) + (int) pStats.get( + 13); + currentSkillTotal += skillTokensGained; + return currentSkillTotal - maxSkillTokens; + } + + public int areGlobalPerksMaxed(int globalTokensGained) { + int maxGlobalTotal = 10; + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ArrayList pStats = pStatAll.get("global"); + int currentGlobalTotal = + globalTokensGained + (int) pStats.get(1) + (int) pStats.get(2) + (int) pStats.get(3) + + (int) pStats.get(4) + (int) pStats.get(5) + (int) pStats.get(6) + (int) pStats.get(7) + + (int) pStats.get(8) + (int) pStats.get(9) + (int) pStats.get(10) + (int) pStats.get( + 11); + return currentGlobalTotal - maxGlobalTotal; + } + + public int getMaxLevel(String skillName) { + int maxLevel = (int) maxLevels.get(skillName); + if (maxLevel == -1) { + maxLevel = maxLevels.get("global"); + if (maxLevel == -1) { + maxLevel = Integer.MAX_VALUE; + } + } + return maxLevel; + } + + public int getEXPfromLevel(int level) { + double B = levelingInfo.get(1); + int referenceLevel = (int) Math.round(levelingInfo.get(2)); + int referenceEXP = (int) Math.round(levelingInfo.get(3)); + int linearStartingLevel = (int) Math.round(levelingInfo.get(4)); + int linearEXP = (int) Math.round(levelingInfo.get(5)); + int EXP = 0; + if (level > linearStartingLevel) { + int exponentialMaxEXP = getEXPfromLevel(linearStartingLevel); + EXP = exponentialMaxEXP + linearEXP * (level - linearStartingLevel); + } else { + EXP = (int) Math.floor( + referenceEXP * ((Math.pow(B, level) - 1) / (Math.pow(B, referenceLevel) - 1))); + } + return EXP; + } + + public int getLevelfromEXP(int exp) { + double B = levelingInfo.get(1); + int referenceLevel = (int) Math.round(levelingInfo.get(2)); + int referenceEXP = (int) Math.round(levelingInfo.get(3)); + int linearStartingLevel = (int) Math.round(levelingInfo.get(4)); + int linearEXP = (int) Math.round(levelingInfo.get(5)); + int exponentialMaxEXP = getEXPfromLevel(linearStartingLevel); + int level = 0; + if (exp <= exponentialMaxEXP) { + level = (int) Math.floor( + ((Math.log((exp * (1.0 / referenceEXP) * (Math.pow(B, referenceLevel) - 1)) + 1) + / Math.log(B)))); + } else { + level = (int) Math.floor((exp - exponentialMaxEXP) / linearEXP) + linearStartingLevel; + } + return level; + } + + public void increaseTokens(String skillName, String type, int amount) { + //Get stats + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ArrayList pStats = pStatAll.get(skillName); + ArrayList pGlobalStats = pStatAll.get("global"); + switch (type) { + case "global": + int tokens_G = (int) pGlobalStats.get(1); + int extraGlobalTokens = areGlobalPerksMaxed(amount); + if (extraGlobalTokens > 0) { + amount -= extraGlobalTokens; + ConfigLoad loadConfig = new ConfigLoad(); + double multiplierIncrease = extraGlobalTokens * loadConfig.getTokensInfo().get(8); + changeStat("global", 23, multiplierIncrease); + } + pGlobalStats.set(1, tokens_G + amount); + break; + case "passive": + int tokens_P = (int) pStats.get(2); + pStats.set(2, tokens_P + amount); + break; + case "skill": + int tokens_S = (int) pStats.get(3); + int extraSkillTokens = areSkillsMaxed(skillName, amount); + if (extraSkillTokens > 0) { + amount -= extraSkillTokens; + if (!skillName.equals("repair") && !skillName.equals("agility") && !skillName.equals( + "alchemy") && !skillName.equals("smelting") && !skillName.equals("enchanting")) { + int newTokens_P = 0; + if (extraSkillTokens > 0) { + ConfigLoad loadConfig = new ConfigLoad(); + newTokens_P += (int) (extraSkillTokens * loadConfig.getTokensInfo().get(7)); + } + pStats.set(2, (int) pStats.get(2) + newTokens_P); + } else { + int passiveBoost = 0; + if (extraSkillTokens > 0) { + ConfigLoad loadConfig = new ConfigLoad(); + passiveBoost += (int) (extraSkillTokens * loadConfig.getTokensInfo().get(7)); + } + pStats.set(4, (int) pStats.get(4) + passiveBoost); + } + } + pStats.set(3, tokens_S + amount); + break; + default: + break; + } + + // Sets stats + pStatAll.put(skillName, pStats); + pStatAll.put("global", pGlobalStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + } + + public void changeStat(String skillName, int statIndex, Number valueChange) { + //Get stats + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ArrayList pStats = pStatAll.get(skillName); + + //change stat + if (skillName.equalsIgnoreCase("global") && statIndex == 23) { + double originalValue = (double) pStats.get(statIndex); + double valueChangeDouble = (double) valueChange; + pStats.set(statIndex, Math.round((originalValue + valueChangeDouble) * 100000.0) / 100000.0); + } else { + int originalValue = (int) pStats.get(statIndex); + int valueChangeInt = (int) valueChange; + pStats.set(statIndex, originalValue + valueChangeInt); + } + + // Sets stats + pStatAll.put(skillName, pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + } + + public void setStat(String skillName, int statIndex, Number newValue) { + //Get stats + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ArrayList pStats = pStatAll.get(skillName); + + //change stat + if (skillName.equalsIgnoreCase("global") && statIndex == 23) { + double newValueDouble = (double) newValue; + pStats.set(statIndex, newValueDouble); + } else { + int newValueInt = (int) newValue; + pStats.set(statIndex, newValueInt); + } + + // Sets stats + pStatAll.put(skillName, pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + } + + public int setTotalLevel() { + int totalLevel = 0; + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + //Get stats + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ArrayList pStats = pStatAll.get("global"); + + //Calculate total Level + for (String skillName : labels_0) { + totalLevel += (int) pStatAll.get(skillName).get(0); + } + + //set total Level + pStats.set(0, totalLevel); + pStatAll.put("global", pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + + return totalLevel; + } + + public int setTotalExperience() { + int totalExperience = 0; + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + //Get stats + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ArrayList pStats = pStatAll.get("global"); + + //Calculate total Level + for (String skillName : labels_0) { + totalExperience += (int) pStatAll.get(skillName).get(1); + } + + //set total Level + pStats.set(29, totalExperience); + pStatAll.put("global", pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + + return totalExperience; + } + + public void setupBossBar(int exp, int oldLevel, int newLevel, String skillTitle, String skillName, + int expChange, boolean isMaxed) { + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(25) < 1 || !pStatClass.isPlayerSkillExpBarOn(skillName)) { + return; + } + if (isPlayerFlashingText.containsKey(p)) { + if (isPlayerFlashingText.get(p)) { + return; + } + } + LanguageSelector lang = new LanguageSelector(p); + if (newLevel > oldLevel) { + BossBarStorage bossBarStorage = new BossBarStorage(); + BossBar expBar = bossBarStorage.getPlayerExpBar(p); + expBar.setProgress(1.0); + String message = + skillTitle.toUpperCase() + " " + lang.getString("level").toUpperCase() + " " + newLevel + + "!"; + expBar.setVisible(true); + flashEXPBarText(message, ChatColor.GOLD, ChatColor.DARK_PURPLE, expBar); + removeEXPBar(expBar); + } else { + if (isMaxed) { + oldLevel = getLevelfromEXP(exp); + } + int lastLevelEXP = getEXPfromLevel(oldLevel); + int nextLevelEXP = getEXPfromLevel(oldLevel + 1); + double progressEXP = Math.max(exp - lastLevelEXP, 0); + double neededEXP = nextLevelEXP - lastLevelEXP; + double percentProgress = Math.min(progressEXP / neededEXP, 1.0); + BossBarStorage bossBarStorage = new BossBarStorage(); + BossBar expBar = bossBarStorage.getPlayerExpBar(p); + expBar.setProgress(percentProgress); + if (!isMaxed) { + expBar.setColor(BarColor.GREEN); + expBar.setTitle( + ChatColor.GRAY + skillTitle + ChatColor.GOLD + " " + lang.getString("lvl") + " " + + newLevel + + ChatColor.YELLOW + " (+" + expChange + " " + lang.getString("exp") + ")"); + } else { + expBar.setColor(BarColor.BLUE); + expBar.setTitle( + ChatColor.LIGHT_PURPLE + "(" + lang.getString("virtual") + ") " + ChatColor.GRAY + + skillTitle + ChatColor.GOLD + " " + lang.getString("lvl") + " " + oldLevel + + ChatColor.YELLOW + " (+" + expChange + " " + lang.getString("exp") + ")"); + } + expBar.setVisible(true); + removeEXPBar(expBar); + } + + } + + public void flashEXPBarText(String message, ChatColor color1, ChatColor color2, BossBar expBar) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + expBar.setProgress(1.0); + isPlayerFlashingText.put(p, true); + //Sets up 6 flashes + for (int i = 0; i <= 5; i++) { + int finalI = i; + new BukkitRunnable() { + @Override + public void run() { + if (p.isOnline()) { + if (finalI % 2 == 0) { + expBar.setTitle(color1 + message); + } else { + expBar.setTitle(color2 + message); + } + } + if (finalI == 5) { + isPlayerFlashingText.remove(p); + } + } + }.runTaskLater(plugin, 10 * i); + } + } + + public void removeEXPBar(BossBar expBar) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + if (playerRemoveEXPBarTaskIdMap.containsKey(p)) { + Bukkit.getScheduler().cancelTask(playerRemoveEXPBarTaskIdMap.get(p)); + } + int taskId = new BukkitRunnable() { + @Override + public void run() { + expBar.setVisible(false); + if (playerRemoveEXPBarTaskIdMap.containsKey(p)) { + playerRemoveEXPBarTaskIdMap.remove(p); + } + } + }.runTaskLater(plugin, 60).getTaskId(); + playerRemoveEXPBarTaskIdMap.put(p, taskId); + } + +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/player/Leaderboards.java b/src/main/java/mc/carlton/freerpg/core/info/player/Leaderboards.java new file mode 100644 index 0000000..7296998 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/player/Leaderboards.java @@ -0,0 +1,464 @@ +package mc.carlton.freerpg.core.info.player; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.utils.globalVariables.StringsAndOtherData; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class Leaderboards { + + static Map> leaderboards = new ConcurrentHashMap<>(); + static Map> playerUUID_to_personalSkillLeaderboards = new ConcurrentHashMap<>(); + static Map> playerName_to_personalSkillLeaderboards = new ConcurrentHashMap<>(); + static boolean leaderboardsLoaded; + static List leaderboardNames = new ArrayList<>(); + static boolean leaderboardUpdating; + + public boolean isLeaderboardsLoaded() { + return leaderboardsLoaded; + } + + public void setLeaderboardsLoaded(boolean isLeaderboardsLoaded) { + Leaderboards.leaderboardsLoaded = isLeaderboardsLoaded; + } + + public List getLeaderboardNames() { + return leaderboardNames; + } + + public void initializeLeaderboards() { + leaderboardUpdating = false; + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + ArrayList skillNames = stringsAndOtherData.getSkillNames(); + leaderboardNames.add("playTime"); + leaderboardNames.add("global"); + for (String skillName : skillNames) { + leaderboardNames.add(skillName); + } + for (String leaderboardName : leaderboardNames) { + leaderboards.put(leaderboardName, new ArrayList<>()); + } + asyncUpdateLeaderBoards(); + } + + public void initializeNewPlayer(Player p) { + UUID playerUUID = p.getUniqueId(); + if (playerUUID_to_personalSkillLeaderboards.containsKey( + playerUUID)) { //Player is already loaded in (i.e not new) + updatePlayerName(p); //Updates the player's username if it has changed + return; + } + if (leaderboardUpdating) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + new BukkitRunnable() { + @Override + public void run() { + initializeNewPlayer(p); + } + }.runTaskLater(plugin, 20); + return; + } + PlayerStats playerStats = new PlayerStats(p); + for (String leaderBoardName : leaderboardNames) { + PlayerLeaderboardStat player; + if (leaderBoardName.equalsIgnoreCase("global")) { + int level = (int) playerStats.getPlayerData().get(leaderBoardName).get(0); + int totalExperience = (int) playerStats.getPlayerData().get(leaderBoardName).get(29); + player = new PlayerLeaderboardStat(playerUUID, p.getName(), level, totalExperience); + + } else if (leaderBoardName.equalsIgnoreCase("playTime")) { + long playTime = playerStats.getPlayerPlayTime(); + player = new PlayerLeaderboardStat(playerUUID, p.getName(), playTime); + } else { + int exp = (int) playerStats.getPlayerData().get(leaderBoardName).get(1); + player = new PlayerLeaderboardStat(playerUUID, p.getName(), exp); + } + ArrayList leaderboard = leaderboards.get(leaderBoardName); + leaderboard.add(player); + leaderboards.put(leaderBoardName, leaderboard); + addPlayerLeaderboardProfilePointer(playerUUID, p.getName(), leaderBoardName, player); + } + } + + public void addPlayerSkillStat(UUID playerUUID, String playerName, int experience, + String skillName) { + PlayerLeaderboardStat player = new PlayerLeaderboardStat(playerUUID, playerName, experience); + ArrayList leaderboard = leaderboards.get(skillName); + leaderboard.add(player); + leaderboards.put(skillName, leaderboard); + addPlayerLeaderboardProfilePointer(playerUUID, playerName, skillName, player); + + } + + public void addPlayerGlobalStat(UUID playerUUID, String playerName, int totalLevel, + int totalExperience) { + PlayerLeaderboardStat player = new PlayerLeaderboardStat(playerUUID, playerName, totalLevel, + totalExperience); + ArrayList leaderboard = leaderboards.get("global"); + leaderboard.add(player); + leaderboards.put("global", leaderboard); + addPlayerLeaderboardProfilePointer(playerUUID, playerName, "global", player); + } + + public void addPlayerTimeStat(UUID playerUUID, String playerName, long timePlayed) { + PlayerLeaderboardStat player = new PlayerLeaderboardStat(playerUUID, playerName, timePlayed); + ArrayList leaderboard = leaderboards.get("playTime"); + leaderboard.add(player); + leaderboards.put("playTime", leaderboard); + addPlayerLeaderboardProfilePointer(playerUUID, playerName, "playTime", player); + } + + public void sortAllLeaderBoards() { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.isLeaderboardDyanmicUpdate()) { + return; + } + for (String leaderBoardName : leaderboardNames) { + sortLeaderBoard(leaderBoardName); + } + } + + public void sortAllLeaderBoards(boolean forceSort) { + if (!forceSort) { + sortAllLeaderBoards(); + } + for (String leaderBoardName : leaderboardNames) { + sortLeaderBoard(leaderBoardName, forceSort); + } + } + + public void sortLeaderBoard(String skillName) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.isLeaderboardDyanmicUpdate()) { + return; + } + if (skillName.equalsIgnoreCase( + "playTime")) { //PlayTime doesn't update dynamically like the others, + updateLeaderboard("playTime"); + } + ArrayList leaderboard = leaderboards.get(skillName); + leaderboard.sort(new Comparator() { + @Override + public int compare(PlayerLeaderboardStat o1, PlayerLeaderboardStat o2) { + if (o1.get_sortedStat().doubleValue() < o2.get_sortedStat().doubleValue()) { + return 1; + } else { + return -1; + } + } + }); + leaderboards.put(skillName, leaderboard); + } + + public void sortLeaderBoard(String skillName, boolean forceSort) { + if (!forceSort) { + sortLeaderBoard(skillName); + } + if (skillName.equalsIgnoreCase( + "playTime")) { //PlayTime doesn't update dynamically like the others, + updateLeaderboard("playTime"); + } + ArrayList leaderboard = leaderboards.get(skillName); + leaderboard.sort(new Comparator() { + @Override + public int compare(PlayerLeaderboardStat o1, PlayerLeaderboardStat o2) { + if (o1.get_sortedStat().doubleValue() < o2.get_sortedStat().doubleValue()) { + return 1; + } else { + return -1; + } + } + }); + } + + public void updateAllLeaderboards() { + for (UUID playerUUID : playerUUID_to_personalSkillLeaderboards.keySet()) { + if (Bukkit.getPlayer(playerUUID) != null) { + if (Bukkit.getPlayer(playerUUID).isOnline()) { + PlayerStats playerStats = new PlayerStats(playerUUID); + Map> pStats = playerStats.getPlayerData(); + for (String leaderboardName : leaderboardNames) { + if (leaderboardName.equalsIgnoreCase("global")) { + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_sortedStat(pStats.get(leaderboardName).get(0)); + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_stat2(pStats.get(leaderboardName).get(29)); + } else if (leaderboardName.equalsIgnoreCase("playTime")) { + long playTime = playerStats.getNewPlayTime(); + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_sortedStat(playTime); + } else { + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_stat2(pStats.get(leaderboardName).get(0)); + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_sortedStat(pStats.get(leaderboardName).get(1)); + } + } + } + } + } + } + + public void updateLeaderboard(String leaderboardName) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.isLeaderboardDyanmicUpdate()) { + return; + } + for (UUID playerUUID : playerUUID_to_personalSkillLeaderboards.keySet()) { + if (Bukkit.getPlayer(playerUUID) != null) { + if (Bukkit.getPlayer(playerUUID).isOnline()) { + PlayerStats playerStats = new PlayerStats(playerUUID); + Map> pStats = playerStats.getPlayerData(); + if (leaderboardName.equalsIgnoreCase("global")) { + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_sortedStat(pStats.get(leaderboardName).get(0)); + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_stat2(pStats.get(leaderboardName).get(29)); + } else if (leaderboardName.equalsIgnoreCase("playTime")) { + long playTime = playerStats.getNewPlayTime(); + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_sortedStat(playTime); + } else { + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_stat2(pStats.get(leaderboardName).get(0)); + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_sortedStat(pStats.get(leaderboardName).get(1)); + } + } + } + } + } + + public void updateLeaderboard(String leaderboardName, boolean forceUpdate) { + if (!forceUpdate) { + updateLeaderboard(leaderboardName); + } + for (UUID playerUUID : playerUUID_to_personalSkillLeaderboards.keySet()) { + if (Bukkit.getPlayer(playerUUID) != null) { + if (Bukkit.getPlayer(playerUUID).isOnline()) { + PlayerStats playerStats = new PlayerStats(playerUUID); + Map> pStats = playerStats.getPlayerData(); + if (leaderboardName.equalsIgnoreCase("global")) { + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_sortedStat(pStats.get(leaderboardName).get(0)); + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_stat2(pStats.get(leaderboardName).get(29)); + } else if (leaderboardName.equalsIgnoreCase("playTime")) { + long playTime = playerStats.getNewPlayTime(); + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_sortedStat(playTime); + } else { + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_stat2(pStats.get(leaderboardName).get(0)); + playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName) + .set_sortedStat(pStats.get(leaderboardName).get(1)); + } + } + } + } + } + + public void asyncUpdateLeaderBoards() { + ConfigLoad configLoad = new ConfigLoad(); + if (configLoad.isLeaderboardDyanmicUpdate()) { + return; + } + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + int ticksWait = 20 * configLoad.getLeaderboardUpdateTimer(); + new BukkitRunnable() { + @Override + public void run() { + if (leaderboardsLoaded) { + leaderboardUpdating = true; + updateAllLeaderboards(); + + sortAllLeaderBoards(true); + leaderboardUpdating = false; + } + } + }.runTaskTimerAsynchronously(plugin, ticksWait, ticksWait); + } + + public ArrayList getLeaderboard(String skillName) { + return leaderboards.get(skillName); + } + + public Map> getLeaderboards() { + return leaderboards; + } + + public void addPlayerLeaderboardProfilePointer(UUID playerUUID, String playerName, + String skillName, PlayerLeaderboardStat player) { + if (!playerUUID_to_personalSkillLeaderboards.containsKey(playerUUID)) { + Map initialMap = new ConcurrentHashMap<>(); + initialMap.put(skillName, player); + playerUUID_to_personalSkillLeaderboards.put(playerUUID, initialMap); + } else { + Map map = playerUUID_to_personalSkillLeaderboards.get( + playerUUID); + map.put(skillName, player); + playerUUID_to_personalSkillLeaderboards.put(playerUUID, map); + } + if (!playerName_to_personalSkillLeaderboards.containsKey(playerName)) { + Map initialMap = new ConcurrentHashMap<>(); + initialMap.put(skillName, player); + playerName_to_personalSkillLeaderboards.put(playerName, initialMap); + } else { + Map map = playerName_to_personalSkillLeaderboards.get( + playerName); + map.put(skillName, player); + playerName_to_personalSkillLeaderboards.put(playerName, map); + } + } + + public void removeForbiddenUUIDs(HashSet allPlayerUUIDs) { + for (String skillName : leaderboards.keySet()) { + ArrayList forbiddenLeaderBoardStats = new ArrayList<>(); + ArrayList players = leaderboards.get(skillName); + for (PlayerLeaderboardStat player : players) { + if (!allPlayerUUIDs.contains(player.get_playerUUID())) { + forbiddenLeaderBoardStats.add(player); + } + } + players.removeAll(forbiddenLeaderBoardStats); + leaderboards.put(skillName, players); + } + } + + public void updatePlayerStats(Player p, String skillName, Number sortedStat, Object stat2) { + UUID playerUUID = p.getUniqueId(); + updatePlayerStats(playerUUID, skillName, sortedStat, stat2); + } + + public void updatePlayerStats(UUID playerUUID, String skillName, Number sortedStat, + Object stat2) { + PlayerLeaderboardStat player = playerUUID_to_personalSkillLeaderboards.get(playerUUID) + .get(skillName); + player.updateStats(sortedStat, stat2); + } + + public PlayerLeaderboardStat getPlayerStatAtLeaderBoardPosition(String leaderboardName, + int position) { + if (!leaderboards.containsKey(leaderboardName)) { + return null; + } + sortLeaderBoard(leaderboardName); + ArrayList leaderboard = leaderboards.get(leaderboardName); + + if (position < 1) { + position = 1; + } else if (position > leaderboard.size()) { + position = leaderboard.size(); + } + return leaderboard.get(position - 1); + } + + public int getLeaderboardPosition(Player p, String leaderboardName) { + UUID playerUUID = p.getUniqueId(); + return getLeaderboardPosition(playerUUID, leaderboardName); + } + + public int getLeaderboardPosition(UUID playerUUID, String leaderboardName) { + sortLeaderBoard(leaderboardName); + if (!leaderboards.containsKey(leaderboardName)) { + return -1; + } + PlayerLeaderboardStat playerStat = playerUUID_to_personalSkillLeaderboards.get(playerUUID) + .get(leaderboardName); + int position = leaderboards.get(leaderboardName).indexOf(playerStat) + 1; + return position; + } + + public int getLeaderboardPosition(String playerName, String leaderboardName) { + sortLeaderBoard(leaderboardName); + if (!leaderboards.containsKey(leaderboardName)) { + return -1; + } + PlayerLeaderboardStat playerStat = playerName_to_personalSkillLeaderboards.get(playerName) + .get(leaderboardName); + int position = leaderboards.get(leaderboardName).indexOf(playerStat) + 1; + return position; + } + + public int getLeaderboardSize(String leaderboardName) { + if (!leaderboards.containsKey(leaderboardName)) { + return -1; + } + return leaderboards.get(leaderboardName).size(); + } + + public PlayerLeaderboardStat getPlayerStat(String playerName, String leaderboardName) { + if (playerName_to_personalSkillLeaderboards.containsKey(playerName)) { + return playerName_to_personalSkillLeaderboards.get(playerName).get(leaderboardName); + } else { + return null; + } + } + + public PlayerLeaderboardStat getPlayerStat(UUID playerUUID, String leaderboardName) { + if (playerUUID_to_personalSkillLeaderboards.containsKey(playerUUID)) { + return playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName); + } else { + return null; + } + } + + public boolean isPlayerOnLeaderboards(String playerName) { + if (playerName_to_personalSkillLeaderboards.containsKey(playerName)) { + return true; + } else { + return false; + } + } + + private void updatePlayerName(Player p) { + /* + * This method uses a general approach. I.e it does not make some assumptions that should be true. + * Notably, it does NOT assume that each PlayerLeaderBoardStat Object in the playerLeaderboardStats has the same player Name. (this should be true) + * However, it does assume that each PlayerLeaderBoardStat Object in the playerLeaderboardStats does indeed belond to the player UUID. + */ + UUID playerUUID = p.getUniqueId(); + if (playerUUID_to_personalSkillLeaderboards.containsKey( + playerUUID)) { //Player is already loaded in (i.e not new) + String currentName = p.getName(); + String oldName = currentName; + Map playerLeaderboardStats = playerUUID_to_personalSkillLeaderboards.get( + playerUUID); + for (String leaderboadName : playerLeaderboardStats.keySet()) { + PlayerLeaderboardStat playerLeaderboardStat = playerLeaderboardStats.get(leaderboadName); + if (!playerLeaderboardStat.get_pName().equals( + currentName)) { //Name associated with this leaderboard stat does not correspond with player's current name + if (!playerLeaderboardStat.get_pName().equals( + oldName)) { //This name has not been removed from playerName_to_personalSkillLeaderboards yet + /* + * This conditional should always be met for the first playerLeaderBoard stat with an incorrect name, because currentName == oldName initialially + * The username is removed from playerName_to_personalSkillLeaderboards and oldName is updated. + * It SHOULD be true that every stat in playerLeaderboardStats shares the same old name, so this conditional should not fire again + * I use a general approach here to be safe, and assume that playerLeaderboardStats could contain stats with many different names. If this is the case, + * then these wrong names will be removed from playerName_to_personalSkillLeaderboards as well (if they are in the map) + */ + playerName_to_personalSkillLeaderboards.remove( + oldName); //Removes old name key, if present + oldName = playerLeaderboardStat.get_pName(); //Updates oldName + } + playerLeaderboardStat.set_pName( + currentName); //Updates pName to the current name. This is the name that will be saved to leaderboards.yml and displayed on /frpg top {skillName} + } + } + playerName_to_personalSkillLeaderboards.put(currentName, + playerLeaderboardStats); //finally, we change playerName_to_personalSkillLeaderboards so it contains the new player name + } + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/player/OfflinePlayerStatLoadIn.java b/src/main/java/mc/carlton/freerpg/core/info/player/OfflinePlayerStatLoadIn.java new file mode 100644 index 0000000..0899216 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/player/OfflinePlayerStatLoadIn.java @@ -0,0 +1,113 @@ +package mc.carlton.freerpg.core.info.player; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.UUID; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.core.info.server.RecentLogouts; +import mc.carlton.freerpg.core.leaveAndJoin.LoginProcedure; +import mc.carlton.freerpg.core.serverFileManagement.PlayerStatsFilePreparation; +import org.apache.logging.log4j.Level; +import org.bukkit.Bukkit; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class OfflinePlayerStatLoadIn { + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + private int safeDeleteTaskID; + + public void loadInOfflinePlayers() { + RecentLogouts recentLogouts = new RecentLogouts(); + ArrayList playersToLoadIn = recentLogouts.getLastLogouts(); + new BukkitRunnable() { + @Override + public void run() { + for (UUID pUUID : playersToLoadIn) { + PlayerStats playerStats = new PlayerStats(pUUID); + if (playerStats.isPlayerRegistered()) { + continue; + } + PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); + playerStatsFilePreparation.preparePlayerFile(null, pUUID, false); + LoginProcedure loginProcedure = new LoginProcedure(pUUID); + loginProcedure.addStatsToPlayerMap(false); + } + } + }.runTaskAsynchronously(plugin); + } + + public void loadInAllOfflinePlayers() { + new BukkitRunnable() { + @Override + public void run() { + File userdata = new File( + Bukkit.getServer().getPluginManager().getPlugin("FreeRPG").getDataFolder(), + File.separator + "PlayerDatabase"); + File[] allUsers = userdata.listFiles(); + HashSet times = new HashSet<>(); + double N = 0; + for (File f : allUsers) { + UUID pUUID = UUID.fromString(f.getName().replace(".yml", "")); + PlayerStats playerStats = new PlayerStats(pUUID); + if (playerStats.isPlayerRegistered()) { + continue; + } + long time = System.currentTimeMillis(); + PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); + playerStatsFilePreparation.preparePlayerFile(null, pUUID, false); + LoginProcedure loginProcedure = new LoginProcedure(pUUID); + loginProcedure.addStatsToPlayerMap(false); + times.add(System.currentTimeMillis() - time); + N += 1.0; + } + long sum = 0; + for (long time : times) { + sum += time; + } + double avg = Math.round((sum / N) * 100) / 100.0; + FreeRPG.log(Level.INFO, "Total time Taken: " + sum + " ms"); + FreeRPG.log(Level.INFO, "Average time Taken: " + avg + " ms"); + } + }.runTaskAsynchronously(plugin); + + } + + public void unloadAllOfflinePlayers() { + //One of the rare cases we need to access the playerStats class without a player, so we use a random UUID + PlayerStats allStats = new PlayerStats(UUID.randomUUID()); + for (UUID playerUUID : allStats.getData().keySet()) { + unloadOfflinePlayer(playerUUID); + } + } + + public void unloadOfflinePlayer(UUID playerUUID) { + safeRemovePlayer(playerUUID); + } + + public void safeRemovePlayer(UUID playerUUID) { + int taskID = new BukkitRunnable() { + @Override + public void run() { + PlayerStats playerStats = new PlayerStats(playerUUID); + if (isPlayerOnline(playerUUID)) { //We don't want to remove the stats of an online player + Bukkit.getScheduler().cancelTask(safeDeleteTaskID); + } else if (playerStats.arePlayerStatsSaved()) { + playerStats.removePlayer(); + Bukkit.getScheduler().cancelTask(safeDeleteTaskID); + } + } + }.runTaskTimer(plugin, 1, 50).getTaskId(); + safeDeleteTaskID = taskID; + } + + public boolean isPlayerOnline(UUID playerUUID) { + if (Bukkit.getPlayer(playerUUID) != null) { + if (Bukkit.getPlayer(playerUUID).isOnline()) { + return true; + } + } + return false; + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/player/PlayerLeaderboardStat.java b/src/main/java/mc/carlton/freerpg/core/info/player/PlayerLeaderboardStat.java new file mode 100644 index 0000000..fc1c8f3 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/player/PlayerLeaderboardStat.java @@ -0,0 +1,158 @@ +package mc.carlton.freerpg.core.info.player; + +import java.util.ArrayList; +import java.util.UUID; +import mc.carlton.freerpg.config.ConfigLoad; + +public class PlayerLeaderboardStat { + + String pName; + UUID playerUUID; + Number sortedStat; + Object stat2; + + //This is used for all skills + public PlayerLeaderboardStat(UUID playerUUID, String pName, + int experience) { //By default, levelSupplied = false + super(); + this.playerUUID = playerUUID; + this.pName = pName; + this.sortedStat = experience; + this.stat2 = getLevelfromEXP(experience); + } + + public PlayerLeaderboardStat(UUID playerUUID, String pName, Number sortedStat, + Object stat2) { //Used for global stats + super(); + this.playerUUID = playerUUID; + this.pName = pName; + this.sortedStat = sortedStat; + this.stat2 = stat2; + } + + public PlayerLeaderboardStat(UUID playerUUID, String pName, + Number sortedStat) { //By default, levelSupplied = false + super(); + this.playerUUID = playerUUID; + this.pName = pName; + this.sortedStat = sortedStat; + } + + + public void updateStats(Number sortedStat, Object stat2) { + this.sortedStat = sortedStat; + this.stat2 = stat2; + } + + public void updateStats(Number sortedStat) { + this.sortedStat = sortedStat; + } + + public String get_pName() { + return this.pName; + } + + public void set_pName(String pName) { + this.pName = pName; + } + + public UUID get_playerUUID() { + return this.playerUUID; + } + + public void set_playerUUID(UUID playerUUID) { + this.playerUUID = playerUUID; + } + + public Number get_sortedStat() { + return this.sortedStat; + } + + public void set_sortedStat(Number sortedStat) { + this.sortedStat = sortedStat; + } + + public Object get_stat2() { + return this.stat2; + } + + public void set_stat2(Object stat2) { + this.stat2 = stat2; + } + + public String get_playTimeString() { + if (sortedStat instanceof Integer || sortedStat instanceof Long) { + return getPlayerPlayTimeString(sortedStat.intValue()); + } else { + return null; + } + } + + public int getLevelfromEXP(int exp) { + ConfigLoad loadConfig = new ConfigLoad(); + ArrayList levelingInfo = loadConfig.getLevelingInfo(); + double B = levelingInfo.get(1); + int referenceLevel = (int) Math.round(levelingInfo.get(2)); + int referenceEXP = (int) Math.round(levelingInfo.get(3)); + int linearStartingLevel = (int) Math.round(levelingInfo.get(4)); + int linearEXP = (int) Math.round(levelingInfo.get(5)); + int exponentialMaxEXP = getEXPfromLevel(linearStartingLevel); + int level = 0; + if (exp <= exponentialMaxEXP) { + level = (int) Math.floor( + ((Math.log((exp * (1.0 / referenceEXP) * (Math.pow(B, referenceLevel) - 1)) + 1) + / Math.log(B)))); + } else { + level = (int) Math.floor((exp - exponentialMaxEXP) / linearEXP) + linearStartingLevel; + } + return level; + } + + public int getEXPfromLevel(int level) { + ConfigLoad loadConfig = new ConfigLoad(); + ArrayList levelingInfo = loadConfig.getLevelingInfo(); + double B = levelingInfo.get(1); + int referenceLevel = (int) Math.round(levelingInfo.get(2)); + int referenceEXP = (int) Math.round(levelingInfo.get(3)); + int linearStartingLevel = (int) Math.round(levelingInfo.get(4)); + int linearEXP = (int) Math.round(levelingInfo.get(5)); + int EXP = 0; + if (level > linearStartingLevel) { + int exponentialMaxEXP = getEXPfromLevel(linearStartingLevel); + EXP = exponentialMaxEXP + linearEXP * (level - linearStartingLevel); + } else { + EXP = (int) Math.floor( + referenceEXP * ((Math.pow(B, level) - 1) / (Math.pow(B, referenceLevel) - 1))); + } + return EXP; + } + + public String getPlayerPlayTimeString(int playTime) { + String playTime_string = ""; + int hours = (int) Math.floor(playTime / 3600.0); + int minutes = (int) Math.floor((playTime - (hours * 3600)) / 60.0); + int seconds = (int) Math.floor((playTime - (hours * 3600) - (minutes * 60))); + String hoursString = Integer.toString(hours); + if (hoursString.length() < 2) { + hoursString = "0" + hoursString; + } + String minutesString = Integer.toString(minutes); + if (minutesString.length() < 2) { + minutesString = "0" + minutesString; + } + String secondsString = Integer.toString(seconds); + if (secondsString.length() < 2) { + secondsString = "0" + secondsString; + } + playTime_string = hoursString + ":" + minutesString + ":" + secondsString; + return playTime_string; + } + + @Override + public String toString() { + return "PlayerLeaderboardStats [username=" + pName + ", sortedStat=" + sortedStat + ", stat2=" + + stat2 + "]"; + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/player/PlayerStats.java b/src/main/java/mc/carlton/freerpg/core/info/player/PlayerStats.java new file mode 100644 index 0000000..3729763 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/player/PlayerStats.java @@ -0,0 +1,227 @@ +package mc.carlton.freerpg.core.info.player; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.bukkit.entity.Player; + +public class PlayerStats { + + static Map>> player_statsMap = new HashMap>>(); + static Map player_LoginTime = new HashMap<>(); + static Map player_playTime = new HashMap<>(); + static Map player_language = new HashMap<>(); + static Map> playerSkillToggleEXPBar = new HashMap<>(); + static Map> playerSkillToggleAbility = new HashMap<>(); + static Map playerAreStatsSaved = new HashMap<>(); + //This class is very messy, it would be better if I created a class to store all these stats for each player, + // And used a hashmap to assign that class to a UUID, but that would take major restructuring + private UUID uuid; + + public PlayerStats(Player p) { + this.uuid = p.getUniqueId(); + } + + public PlayerStats(UUID playerUUID) { + this.uuid = playerUUID; + } + + //Common boolean questions asked + public boolean isPlayerRegistered() { + if (player_statsMap.containsKey(uuid)) { + return true; + } else { + return false; + } + } + + public Map>> getData() { + if (!player_statsMap.containsKey(uuid)) { + PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); + Map> playerStats0 = loadInPlayer.getPlayerStatsMapFromFile(); + player_statsMap.put(uuid, playerStats0); + } + return player_statsMap; + } + + //Getters and setters for entire playerbase map + public void setData(Map>> playerStatsMap) { + this.player_statsMap = playerStatsMap; + } + + //Getters and setters for single player stats + public Map> getPlayerData() { + if (!player_statsMap.containsKey(uuid)) { + PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); + Map> playerStats0 = loadInPlayer.getPlayerStatsMapFromFile(); + player_statsMap.put(uuid, playerStats0); + } + return player_statsMap.get(uuid); + } + + //Getters and setters for if they player's data has been saved + public void setPlayerAreStatsSaved(boolean areStatsSaved) { + playerAreStatsSaved.put(uuid, areStatsSaved); + } + + public boolean arePlayerStatsSaved() { + if (playerAreStatsSaved.containsKey(uuid)) { + return playerAreStatsSaved.get(uuid); + } else { + return true; + } + } + + //Getters and setters for player times + public void addPlayerTimes(long loginTime, long playTime) { + player_LoginTime.put(uuid, loginTime); + player_playTime.put(uuid, playTime); + } + + public long getPlayerLoginTime() { + if (!player_LoginTime.containsKey(uuid)) { + PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); + long loginTime = loadInPlayer.getLoginTime(); + player_LoginTime.put(uuid, loginTime); + } + return (long) player_LoginTime.get(uuid); + } + + public long getPlayerPlayTime() { + if (!player_playTime.containsKey(uuid)) { + PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); + long playTime = loadInPlayer.getPlayTime(); + player_playTime.put(uuid, playTime); + } + return (long) player_playTime.get(uuid); + } + + //Turns player play time to a string + public String getPlayerPlayTimeString() { + String playTime_string = ""; + long newPlayTime = getNewPlayTime(); + int hours = (int) Math.floor(newPlayTime / 3600.0); + int minutes = (int) Math.floor((newPlayTime - (hours * 3600)) / 60.0); + int seconds = (int) Math.floor((newPlayTime - (hours * 3600) - (minutes * 60))); + String hoursString = Integer.toString(hours); + if (hoursString.length() < 2) { + hoursString = "0" + hoursString; + } + String minutesString = Integer.toString(minutes); + if (minutesString.length() < 2) { + minutesString = "0" + minutesString; + } + String secondsString = Integer.toString(seconds); + if (secondsString.length() < 2) { + secondsString = "0" + secondsString; + } + playTime_string = hoursString + ":" + minutesString + ":" + secondsString; + return playTime_string; + } + + public long getNewPlayTime() { + long loginTime = getPlayerLoginTime(); + long playTime = getPlayerPlayTime(); + long currentTime = Instant.now().getEpochSecond(); + long newPlayTime = playTime + (currentTime - loginTime); + return newPlayTime; + } + + public String getPlayerLanguage() { + if (!player_language.containsKey(uuid)) { + PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); + String language = loadInPlayer.getPlayerLanguage(); + player_language.put(uuid, language); + } + return player_language.get(uuid); + } + + //Getters and setters for player language + public void setPlayerLanguage(String language) { + player_language.put(uuid, language); + } + + //Getters and setters for toggle ability/exp bar + public void addPlayerSkillToggleExpBar(Map skillToggles) { + playerSkillToggleEXPBar.put(uuid, skillToggles); + } + + public void addPlayerSkillToggleAbility(Map skillToggles) { + playerSkillToggleAbility.put(uuid, skillToggles); + } + + public Map getSkillToggleExpBar() { + if (!playerSkillToggleEXPBar.containsKey(uuid)) { + PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); + Map playerStats0 = loadInPlayer.getSkillExpBarToggles(); + playerSkillToggleEXPBar.put(uuid, playerStats0); + } + return playerSkillToggleEXPBar.get(uuid); + } + + public Map getSkillToggleAbility() { + if (!playerSkillToggleAbility.containsKey(uuid)) { + PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); + Map playerStats0 = loadInPlayer.getSkillAbilityToggles(); + playerSkillToggleAbility.put(uuid, playerStats0); + } + return playerSkillToggleAbility.get(uuid); + } + + //expbar/skillability boolean information + public boolean isPlayerSkillExpBarOn(String skillName) { + int expBarOn = getSkillToggleExpBar().get(skillName); + if (expBarOn == 1) { + return true; + } else { + return false; + } + } + + public boolean isPlayerSkillAbilityOn(String skillName) { + int abilityOn = getSkillToggleAbility().get(skillName); + if (abilityOn == 1) { + return true; + } else { + return false; + } + } + + //Methods to toggle expbar/skillability + public void togglePlayerSkillExpBar(String skillName) { + Map playerSkillEXPBarMap = getSkillToggleExpBar(); + int expBarOn = playerSkillEXPBarMap.get(skillName); + if (expBarOn == 1) { + playerSkillEXPBarMap.put(skillName, 0); + } else { + playerSkillEXPBarMap.put(skillName, 1); + } + playerSkillToggleEXPBar.put(uuid, playerSkillEXPBarMap); + } + + public void togglePlayerSkillAbility(String skillName) { + Map playerSkillAbiliytMap = getSkillToggleAbility(); + int abilityOn = playerSkillAbiliytMap.get(skillName); + if (abilityOn == 1) { + playerSkillAbiliytMap.put(skillName, 0); + } else { + playerSkillAbiliytMap.put(skillName, 1); + } + playerSkillToggleAbility.put(uuid, playerSkillAbiliytMap); + } + + + //Used to delete all player data from memory + public void removePlayer() { + player_statsMap.remove(uuid); + player_LoginTime.remove(uuid); + player_playTime.remove(uuid); + player_language.remove(uuid); + playerSkillToggleEXPBar.remove(uuid); + playerSkillToggleAbility.remove(uuid); + playerAreStatsSaved.remove(uuid); + } + +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/player/PlayerStatsLoadIn.java b/src/main/java/mc/carlton/freerpg/core/info/player/PlayerStatsLoadIn.java new file mode 100644 index 0000000..59c5f0a --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/player/PlayerStatsLoadIn.java @@ -0,0 +1,315 @@ +package mc.carlton.freerpg.core.info.player; + +import java.io.File; +import java.io.IOException; +import java.time.Instant; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.serverFileManagement.PlayerFilesManager; +import org.apache.logging.log4j.Level; +import org.bukkit.Bukkit; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class PlayerStatsLoadIn { + + Map> statsMap = new HashMap>(); + File f; + UUID pUUID; + FileConfiguration playerData; + private Player p; + + public PlayerStatsLoadIn(Player player) { + PlayerFilesManager playerFilesManager = new PlayerFilesManager(); + this.p = player; + this.pUUID = p.getUniqueId(); + this.f = playerFilesManager.getPlayerFile(p); + this.playerData = YamlConfiguration.loadConfiguration(f); + } + + public PlayerStatsLoadIn(UUID pUUID) { + PlayerFilesManager playerFilesManager = new PlayerFilesManager(); + if (Bukkit.getPlayer(pUUID) != null) { + this.p = Bukkit.getPlayer(pUUID); + } + this.pUUID = pUUID; + this.f = playerFilesManager.getPlayerFile(pUUID); + this.playerData = YamlConfiguration.loadConfiguration(f); + } + + public long getLoginTime() { + long loginTime = 0; + if (f.exists()) { + long unixTime = Instant.now().getEpochSecond(); + loginTime = Long.valueOf(getStat("general.lastLogin", unixTime).toString()); + return loginTime; + } + return Instant.now().getEpochSecond(); + } + + public long getPlayTime() { + long playTime = 0; + if (f.exists()) { + playTime = Long.valueOf(getStat("general.playTime", 0L).toString()); + return playTime; + } + return Instant.now().getEpochSecond(); + } + + public String getPlayerLanguage() { + String language = "enUs"; + if (f.exists()) { + String defaultLanguage = new ConfigLoad().getDefaultLanguage(); + language = String.valueOf(getInformation("general.language", defaultLanguage)); + return language; + } + return language; + } + + public Map getSkillExpBarToggles() { + Map skillExpBarToggleMap = new HashMap<>(); + String[] labels = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + for (String label : labels) { + skillExpBarToggleMap.put(label, (Integer) getStat(label + ".showEXPBarToggle", 1)); + } + return skillExpBarToggleMap; + } + + public Map getSkillAbilityToggles() { + Map skillAbilityToggleMap = new HashMap<>(); + String[] labels = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + for (String label : labels) { + skillAbilityToggleMap.put(label, (Integer) getStat(label + ".triggerAbilityToggle", 1)); + } + return skillAbilityToggleMap; + } + + public Map> getPlayerStatsMapFromFile() { + readInPlayerStats(); + + /* + + // There might be some problems in the future, so I'm keeping this block of code + + if(f.exists()) { + + } + else { //If for some reason, the player file doesn't exist, we still want the stat map. + if (p != null) { + PlayerFilesManager playerFilesManager = new PlayerFilesManager(); + this.f = playerFilesManager.getPlayerFile(pUUID); + this.playerData = YamlConfiguration.loadConfiguration(f); + PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); + playerStatsFilePreparation.preparePlayerFile(p.getName(),pUUID,true); + return getPlayerStatsMapFromFile(); + } + } + + */ + + return statsMap; + } + + public void readInPlayerStats() { + String[] labels = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + ArrayList globalStats = new ArrayList(); + addStat(globalStats, "globalStats.totalLevel", 0); //0 + addStat(globalStats, "globalStats.globalTokens", 0); //1 + addStat(globalStats, "globalStats.skill_1a", 0); //2 + addStat(globalStats, "globalStats.skill_1b", 0); //3 + addStat(globalStats, "globalStats.skill_1c", 0); //4 + addStat(globalStats, "globalStats.skill_2a", 0); //5 + addStat(globalStats, "globalStats.skill_2b", 0); //6 + addStat(globalStats, "globalStats.skill_2c", 0); //7 + addStat(globalStats, "globalStats.skill_3a", 0); //8 + addStat(globalStats, "globalStats.skill_3b", 0); //9 + addStat(globalStats, "globalStats.skill_3c", 0); //10 + addStat(globalStats, "globalStats.skill_M", 0); //11 + addStat(globalStats, "globalStats.flintToggle", 1); //12 + addStat(globalStats, "globalStats.oreToggle", 1); //13 + addStat(globalStats, "globalStats.speedToggle", 1); //14 + addStat(globalStats, "globalStats.potionToggle", 1); //15 + addStat(globalStats, "globalStats.grappleToggle", 1); //16 + addStat(globalStats, "globalStats.hotRodToggle", 1); //17 + addStat(globalStats, "globalStats.veinMinerToggle", 1); //18 + addStat(globalStats, "globalStats.megaDigToggle", 1); //19 + addStat(globalStats, "globalStats.souls", 0); //20 + addStat(globalStats, "globalStats.levelUpMessageToggle", 1); //21 + addStat(globalStats, "globalStats.abilityPrepareMessageToggle", 1); //22 + addStat(globalStats, "globalStats.personalEXPMultiplier", 1.0); //23 + addStat(globalStats, "globalStats.triggerAbilitiesToggle", 1); //24 + addStat(globalStats, "globalStats.showEXPBarToggle", 1); //25 + addStat(globalStats, "globalStats.leafBlowerToggle", 1); //26 + addStat(globalStats, "globalStats.holyAxeToggle", 1); //27 + addStat(globalStats, "globalStats.numberOfCooldownBars", 1); //28 + addStat(globalStats, "globalStats.totalExperience", 0); //29 + addStat(globalStats, "globalStats.heartyToggle", 0); //30 + + statsMap.put("global", globalStats); + + for (int i = 0; i < labels.length; i++) { + String skillName = labels[i]; + ArrayList skillStats = new ArrayList(); + addStat(skillStats, labels[i] + ".level", 0); //0 + addStat(skillStats, labels[i] + ".experience", 0); //1 + addStat(skillStats, labels[i] + ".passiveTokens", 0); //2 + addStat(skillStats, labels[i] + ".skillTokens", 0); //3 + addStat(skillStats, labels[i] + ".passive1", 0); //4 + addStat(skillStats, labels[i] + ".passive2", 0); //5 + addStat(skillStats, labels[i] + ".passive3", 0); //6 + addStat(skillStats, labels[i] + ".skill_1a", 0); //7 + addStat(skillStats, labels[i] + ".skill_1b", 0); //8 + addStat(skillStats, labels[i] + ".skill_2a", 0); //9 + addStat(skillStats, labels[i] + ".skill_2b", 0); //10 + addStat(skillStats, labels[i] + ".skill_3a", 0); //11 + addStat(skillStats, labels[i] + ".skill_3b", 0); //12 + addStat(skillStats, labels[i] + ".skill_M", 0); //13 + statsMap.put(skillName, skillStats); + } + } + + private void addStat(ArrayList statList, String path, + Number defaultValue) { //This exists because I am dumb + statList.add(getStat(path, defaultValue)); + } + + private Number getStat(String path, Number defaultValue) { + if (playerData.contains(path)) { + return (Number) playerData.get(path); + } else { + return defaultValue; + } + } + + private Object getInformation(String path, Object defaultValue) { //General version of getStat + if (playerData.contains(path)) { + return playerData.get(path); + } else { + return defaultValue; + } + } + + public void setPlayerStatsMap() throws IOException { + setPlayerStatsMap(true); + } + + public void setPlayerStatsMap(boolean savePlayTime) throws IOException { + PlayerStats pStatClass = new PlayerStats(pUUID); + Map> pStatAll = pStatClass.getPlayerData(); + Map expBarToggles = pStatClass.getSkillToggleExpBar(); + Map abilityToggles = pStatClass.getSkillToggleAbility(); + String pName; + if (p != null) { + pName = p.getName(); + } else { + pName = null; + } + long unixTime = Instant.now().getEpochSecond(); + if (f.exists()) { + if (pName != null) { + playerData.set("general.username", pName); + } + + //Setting playTime in seconds + if (savePlayTime) { + playerData.set("general.lastLogout", unixTime); + long lastLoginTime = pStatClass.getPlayerLoginTime(); + long playTime = unixTime - lastLoginTime; + playerData.set("general.playTime", playTime); + } + + //Setting player Language + String playerLanguage = pStatClass.getPlayerLanguage(); + playerData.set("general.language", playerLanguage); + + for (String i : pStatAll.keySet()) { + if (i.equalsIgnoreCase("global")) { + playerData.set("globalStats.totalLevel", pStatAll.get(i).get(0)); + playerData.set("globalStats.globalTokens", pStatAll.get(i).get(1)); + playerData.set("globalStats.skill_1a", pStatAll.get(i).get(2)); + playerData.set("globalStats.skill_1b", pStatAll.get(i).get(3)); + playerData.set("globalStats.skill_1c", pStatAll.get(i).get(4)); + playerData.set("globalStats.skill_2a", pStatAll.get(i).get(5)); + playerData.set("globalStats.skill_2b", pStatAll.get(i).get(6)); + playerData.set("globalStats.skill_2c", pStatAll.get(i).get(7)); + playerData.set("globalStats.skill_3a", pStatAll.get(i).get(8)); + playerData.set("globalStats.skill_3b", pStatAll.get(i).get(9)); + playerData.set("globalStats.skill_3c", pStatAll.get(i).get(10)); + playerData.set("globalStats.skill_M", pStatAll.get(i).get(11)); + playerData.set("globalStats.flintToggle", pStatAll.get(i).get(12)); + playerData.set("globalStats.oreToggle", pStatAll.get(i).get(13)); + playerData.set("globalStats.speedToggle", pStatAll.get(i).get(14)); + playerData.set("globalStats.potionToggle", pStatAll.get(i).get(15)); + playerData.set("globalStats.grappleToggle", pStatAll.get(i).get(16)); + playerData.set("globalStats.hotRodToggle", pStatAll.get(i).get(17)); + playerData.set("globalStats.veinMinerToggle", pStatAll.get(i).get(18)); + playerData.set("globalStats.megaDigToggle", pStatAll.get(i).get(19)); + playerData.set("globalStats.souls", pStatAll.get(i).get(20)); + playerData.set("globalStats.levelUpMessageToggle", pStatAll.get(i).get(21)); + playerData.set("globalStats.abilityPrepareMessageToggle", pStatAll.get(i).get(22)); + playerData.set("globalStats.personalEXPMultiplier", pStatAll.get(i).get(23)); + playerData.set("globalStats.triggerAbilitiesToggle", pStatAll.get(i).get(24)); + playerData.set("globalStats.showEXPBarToggle", pStatAll.get(i).get(25)); + playerData.set("globalStats.leafBlowerToggle", pStatAll.get(i).get(26)); + playerData.set("globalStats.holyAxeToggle", pStatAll.get(i).get(27)); + playerData.set("globalStats.numberOfCooldownBars", pStatAll.get(i).get(28)); + playerData.set("globalStats.totalExperience", pStatAll.get(i).get(29)); + playerData.set("globalStats.heartyToggle", pStatAll.get(i).get(30)); + } else { + playerData.set(i + ".level", pStatAll.get(i).get(0)); + playerData.set(i + ".experience", pStatAll.get(i).get(1)); + playerData.set(i + ".passiveTokens", pStatAll.get(i).get(2)); + playerData.set(i + ".skillTokens", pStatAll.get(i).get(3)); + playerData.set(i + ".passive1", pStatAll.get(i).get(4)); + playerData.set(i + ".passive2", pStatAll.get(i).get(5)); + playerData.set(i + ".passive3", pStatAll.get(i).get(6)); + playerData.set(i + ".skill_1a", pStatAll.get(i).get(7)); + playerData.set(i + ".skill_1b", pStatAll.get(i).get(8)); + playerData.set(i + ".skill_2a", pStatAll.get(i).get(9)); + playerData.set(i + ".skill_2b", pStatAll.get(i).get(10)); + playerData.set(i + ".skill_3a", pStatAll.get(i).get(11)); + playerData.set(i + ".skill_3b", pStatAll.get(i).get(12)); + playerData.set(i + ".skill_M", pStatAll.get(i).get(13)); + playerData.set(i + ".triggerAbilityToggle", expBarToggles.get(i)); + playerData.set(i + ".showEXPBarToggle", abilityToggles.get(i)); + } + } + playerData.save(f); + PlayerStats playerStats = new PlayerStats(pUUID); + playerStats.setPlayerAreStatsSaved(true); + if (pName != null) { + FreeRPG.log(Level.INFO, "[FreeRPG] Saved " + pName + " stats successfully"); + } else { + FreeRPG.log(Level.INFO, + "[FreeRPG] Saved player UUID " + pUUID.toString() + " stats successfully"); + } + } + } + + public void asyncStatSave() { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + new BukkitRunnable() { + @Override + public void run() { + try { + setPlayerStatsMap(); + } catch (IOException e) { + FreeRPG.log(Level.ERROR, e.getMessage()); + } + } + }.runTaskAsynchronously(plugin); + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/server/FreeRPGPlaceHolders.java b/src/main/java/mc/carlton/freerpg/core/info/server/FreeRPGPlaceHolders.java new file mode 100644 index 0000000..9f17639 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/server/FreeRPGPlaceHolders.java @@ -0,0 +1,266 @@ +package mc.carlton.freerpg.core.info.server; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.player.Leaderboards; +import mc.carlton.freerpg.core.info.player.PlayerLeaderboardStat; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.utils.globalVariables.StringsAndOtherData; +import me.clip.placeholderapi.expansion.PlaceholderExpansion; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; + +/** + * This class will automatically register as a placeholder expansion when a jar including this class + * is added to the /plugins/placeholderapi/expansions/ folder + */ +public class FreeRPGPlaceHolders extends PlaceholderExpansion { + + private Plugin freeRPG; + + public FreeRPGPlaceHolders(Plugin plugin) { + this.freeRPG = plugin; + } + + /** + * Because this is an internal class, you must override this method to let PlaceholderAPI know to + * not unregister your expansion class when PlaceholderAPI is reloaded + * + * @return true to persist through reloads + */ + @Override + public boolean persist() { + return true; + } + + /** + * This method should always return true unless we have a dependency we need to make sure is on + * the server for our placeholders to work! This expansion does not require a dependency so we + * will always return true + */ + @Override + public boolean canRegister() { + return true; + } + + /** + * The name of the person who created this expansion should go here + */ + /** + * The name of the person who created this expansion should go here. + *
For convienience do we return the author from the plugin.yml + * + * @return The name of the author as a String. + */ + @Override + public String getAuthor() { + return freeRPG.getDescription().getAuthors().toString(); + } + + /** + * The placeholder identifier should go here This is what tells PlaceholderAPI to call our + * onPlaceholderRequest method to obtain a value if a placeholder starts with our identifier. This + * must be unique and can not contain % or _ + */ + @Override + public String getIdentifier() { + return "freeRPG"; + } + + /** + * This is the version of this expansion + */ + @Override + public String getVersion() { + return freeRPG.getDescription().getVersion(); + } + + /** + * This is the method called when a placeholder with our identifier is found and needs a value. + *
We specify the value identifier in this method. + *
Since version 2.9.1 can you use OfflinePlayers in your requests. + * + * @param p Player + * @param identifier A String containing the identifier/value. + * @return possibly-null String of the requested identifier. + */ + @Override + public String onPlaceholderRequest(Player p, String identifier) { + String[] identifierParts = identifier.split("_"); + + //Checks if the request is a leaderboard request + if (identifierParts.length >= 4 && identifierParts[0].equalsIgnoreCase( + "leaderboard")) { //Required for any leaderboard request + Leaderboards leaderboards = new Leaderboards(); + List leaderboardNames = leaderboards.getLeaderboardNames(); + String leaderboardName = ""; + for (String leaderboardTypeName : leaderboardNames) { //Is the first + if (identifierParts[1].equalsIgnoreCase(leaderboardTypeName)) { + leaderboardName = leaderboardTypeName; + } + } + if (!leaderboardName.equalsIgnoreCase("")) { + int position = 0; + try { + position = Integer.valueOf(identifierParts[2]); + } catch (NumberFormatException e) { + // TODO needs some code in it + return null; + } + PlayerLeaderboardStat playerStatFromLeaderboard = leaderboards.getPlayerStatAtLeaderBoardPosition( + leaderboardName, position); + String stat = identifierParts[3]; + ArrayList leaderboardIdentifiers = getLeaderboardIdentifiers(leaderboardName); + if (stat.equalsIgnoreCase(leaderboardIdentifiers.get(0))) { + return playerStatFromLeaderboard.get_playerUUID().toString(); + } else if (stat.equalsIgnoreCase(leaderboardIdentifiers.get(1)) || stat.equalsIgnoreCase( + "username")) { + return playerStatFromLeaderboard.get_pName(); + } else if (stat.equalsIgnoreCase(leaderboardIdentifiers.get(2)) || stat.equalsIgnoreCase( + "sortedStat")) { + if (leaderboardName.equalsIgnoreCase("playTime")) { + if (identifierParts.length > 4) { + if (identifierParts[4].equalsIgnoreCase("formatted")) { + return playerStatFromLeaderboard.get_playTimeString(); + } + } + return String.valueOf(playerStatFromLeaderboard.get_sortedStat()); + } else { + return formatOutput(identifierParts, playerStatFromLeaderboard.get_sortedStat(), 4); + } + } else if (stat.equalsIgnoreCase(leaderboardIdentifiers.get(3)) || stat.equalsIgnoreCase( + "stat2")) { + if (playerStatFromLeaderboard.get_stat2() != null) { + return formatOutput(identifierParts, playerStatFromLeaderboard.get_stat2(), 4); + } else { + return null; + } + } + } + } + + if (p == null) { + return ""; + } + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + ArrayList skillNames = stringsAndOtherData.getSkillNames(); + + PlayerStats playerStats = new PlayerStats(p); + Map> pStats = playerStats.getPlayerData(); + + //Global Parameters (The else-ifs aren't really necessary, but it helps me organize) + if (identifierParts[0].equalsIgnoreCase("globalLevel")) { + return formatOutput(identifierParts, pStats.get("global").get(0), 1); + + } else if (identifierParts[0].equalsIgnoreCase("globalTokens")) { + return formatOutput(identifierParts, pStats.get("global").get(1), 1); + } else if (identifierParts[0].equalsIgnoreCase("personalMultiplier")) { + return formatOutput(identifierParts, pStats.get("global").get(23), 1); + } else if (identifierParts[0].equalsIgnoreCase("totalSkillTokens")) { + int totalSkilTokens = 0; + for (String skillName : pStats.keySet()) { + if (!skillName.equalsIgnoreCase("global")) { + totalSkilTokens += pStats.get(skillName).get(3).intValue(); + } + } + return formatOutput(identifierParts, totalSkilTokens, 1); + } else if (identifierParts[0].equalsIgnoreCase("totalPassiveTokens")) { + int totalPassiveTokens = 0; + for (String skillName : pStats.keySet()) { + if (!skillName.equalsIgnoreCase("global")) { + totalPassiveTokens += pStats.get(skillName).get(2).intValue(); + } + } + return formatOutput(identifierParts, totalPassiveTokens, 1); + } else if (identifierParts[0].equalsIgnoreCase("souls")) { + return formatOutput(identifierParts, pStats.get("global").get(20), 1); + } else if (identifierParts[0].equalsIgnoreCase("totalEXP") || identifier.equalsIgnoreCase( + "totalExperience")) { + return formatOutput(identifierParts, pStats.get("global").get(29), 1); + } else if (identifierParts[0].equalsIgnoreCase("playTime")) { + if (identifierParts.length > 1) { + if (identifierParts[1].equalsIgnoreCase("formatted")) { + return playerStats.getPlayerPlayTimeString(); + } + } + return String.valueOf(playerStats.getNewPlayTime()); + } else if (identifierParts[0].equalsIgnoreCase("globalLevelRank")) { + Leaderboards leaderboards = new Leaderboards(); + return String.valueOf(leaderboards.getLeaderboardPosition(p, + "global")); //Total play time (with FreeRPG installed) + } else if (identifierParts[0].equalsIgnoreCase("playTimeRank")) { + Leaderboards leaderboards = new Leaderboards(); + return String.valueOf(leaderboards.getLeaderboardPosition(p, + "playTime")); //Total play time (with FreeRPG installed) + } + + // Check if the request contains a skill name + boolean potentialSkillSpecificRequest = false; + String skillName = ""; + for (String sName : skillNames) { + if (identifierParts[0].toLowerCase().equalsIgnoreCase(sName)) { + potentialSkillSpecificRequest = true; + skillName = sName; + } + } + + //All skill specific requests + if (potentialSkillSpecificRequest) { //We know identifierParts[0] is a skillName + if (identifierParts[1].equalsIgnoreCase("Level")) { //Level + return formatOutput(identifierParts, pStats.get(skillName).get(0), 2); + } else if (identifierParts[1].equalsIgnoreCase("EXP") || identifier.equalsIgnoreCase( + skillName + "experience")) { //Experience + return formatOutput(identifierParts, pStats.get(skillName).get(1), 2); + } else if (identifierParts[1].equalsIgnoreCase("passiveTokens")) { //Passive Tokens + return formatOutput(identifierParts, pStats.get(skillName).get(2), 2); + } else if (identifierParts[1].equalsIgnoreCase("skillTokens")) { //Skill Tokens + return formatOutput(identifierParts, pStats.get(skillName).get(3), 2); + } else if (identifierParts[1].equalsIgnoreCase("Multiplier")) { //Skill Multiplier + ChangeStats changeStats = new ChangeStats(p); + return String.valueOf(changeStats.getSkillMultiplier(skillName)); + } else if (identifierParts[1].equalsIgnoreCase("EXPtoNext")) { //Skill EXP to next + int EXP = pStats.get(skillName).get(1).intValue(); + int level = pStats.get(skillName).get(0).intValue(); + ChangeStats getEXP = new ChangeStats(p); + int nextEXP = getEXP.getEXPfromLevel(level + 1); + int EXPtoNext = nextEXP - EXP; + return formatOutput(identifierParts, EXPtoNext, 2); + } else if (identifierParts[1].equalsIgnoreCase("rank")) { + Leaderboards leaderboards = new Leaderboards(); + return String.valueOf(leaderboards.getLeaderboardPosition(p, + skillName)); //Total play time (with FreeRPG installed) + } + } + + return null; + } + + public ArrayList getLeaderboardIdentifiers(String leaderboardName) { + ArrayList identifiers = new ArrayList<>(); + identifiers.add("UUID"); + identifiers.add("playerName"); + if (leaderboardName.equalsIgnoreCase("global")) { + identifiers.add("totalLevel"); + identifiers.add("totalEXP"); + } else if (leaderboardName.equalsIgnoreCase("playTime")) { + identifiers.add("totalTimePlayed"); + identifiers.add("null"); + } else { + identifiers.add("exp"); + identifiers.add("level"); + } + return identifiers; + } + + public String formatOutput(String[] identifierParts, Object value, int formatIdentifierLocation) { + if (identifierParts.length > formatIdentifierLocation) { + if (identifierParts[formatIdentifierLocation].equalsIgnoreCase("formatted")) { + return String.format("%,d", value); + } + } + return String.valueOf(value); + } + +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/server/MinecraftVersion.java b/src/main/java/mc/carlton/freerpg/core/info/server/MinecraftVersion.java new file mode 100644 index 0000000..c19c81c --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/server/MinecraftVersion.java @@ -0,0 +1,73 @@ +package mc.carlton.freerpg.core.info.server; + +import mc.carlton.freerpg.FreeRPG; +import org.apache.logging.log4j.Level; +import org.bukkit.Bukkit; + +/** + * MinecraftVersion is the class which provides the current Minecraft version of the server the + * plugin is running on. This helps to turn off certain features of the plugin if they are not + * supported in this version. + */ +public class MinecraftVersion { + + public static String minecraftVersion; + public static double minecraftVersion_Double; + + /** + * Initializes the Minecraft version of the server the plugin is running, so features can be + * turned off for certain versions. + */ + public void initializeVersion() { + minecraftVersion = Bukkit.getVersion(); + if (minecraftVersion.contains("1.8")) { + minecraftVersion_Double = 1.8; + } else if (minecraftVersion.contains("1.9")) { + minecraftVersion_Double = 1.9; + } else if (minecraftVersion.contains("1.10")) { + minecraftVersion_Double = 1.10; + } else if (minecraftVersion.contains("1.11")) { + minecraftVersion_Double = 1.11; + } else if (minecraftVersion.contains("1.12")) { + minecraftVersion_Double = 1.12; + } else if (minecraftVersion.contains("1.13")) { + minecraftVersion_Double = 1.13; + } else if (minecraftVersion.contains("1.14")) { + minecraftVersion_Double = 1.14; + } else if (minecraftVersion.contains("1.15")) { + minecraftVersion_Double = 1.15; + } else if (minecraftVersion.contains("1.16")) { + minecraftVersion_Double = 1.16; + } else if (minecraftVersion.contains("1.17")) { + minecraftVersion_Double = 1.17; + } else if (minecraftVersion.contains("1.18")) { + minecraftVersion_Double = 1.18; + } else { + minecraftVersion_Double = 1.18; + // TODO replace with logger call + FreeRPG.log(Level.WARN, + "Could not determine minecraft version, the plugin assumes 1.18. " + + "This might be caused due to the usage of a newer minecraft version the plugin does not support. " + + "If you notice unexpected behaviour please visit the plugins Github page and open a new issue!"); + } + } + + /** + * Provides the current Minecraft version of the server as a double. A server running on Minecraft + * 1.18 returns the double 1.18 + * + * @return + */ + public double getMinecraftVersionAsDouble() { + return minecraftVersion_Double; + } + + /** + * Provides the current Minecraft version of the server as a String. + * + * @return + */ + public String getMinecraftVersionAsString() { + return minecraftVersion; + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/server/PlacedBlocksManager.java b/src/main/java/mc/carlton/freerpg/core/info/server/PlacedBlocksManager.java new file mode 100644 index 0000000..0d4abdb --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/server/PlacedBlocksManager.java @@ -0,0 +1,86 @@ +package mc.carlton.freerpg.core.info.server; + +import java.util.HashSet; +import mc.carlton.freerpg.FreeRPG; +import org.bukkit.Location; +import org.bukkit.block.Block; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class PlacedBlocksManager { + + private static HashSet blocks = new HashSet<>(); //The set of all tracked blocks on the server + private static HashSet temporaryBlocks = new HashSet<>(); //Temporary blocks to be added to blocks later, but are still checked to see if tracked + private static boolean isFileMangerMakingCopy = false; + private static int copiesBeingMade = 0; + + + public boolean isBlockTracked(Block block) { + Location location = block.getLocation(); + return isLocationTracked(location); + } + + public boolean isLocationTracked(Location location) { + return blocks.contains(location) || temporaryBlocks.contains( + location); //If it is in EITHER list + } + + public HashSet getBlocks() { + isFileMangerMakingCopy = true; //Let all classes know a copy is being made + copiesBeingMade += 1; //Add to total number of copies currently being made + HashSet blocksCopy = new HashSet<>(blocks); + copiesBeingMade -= 1; //Copy is made, reduce the number of total copies currently being made by one + if (copiesBeingMade + <= 0) { //If there are no copies being made (It can be the case that multiple calls to getBlocksMap() were made around the same time + isFileMangerMakingCopy = false; // we can say tell all classes that no copies are being made + } + return blocksCopy; + } + + public void setBlocksMap(HashSet newblocks) { + this.blocks = newblocks; + } + + public void addBlock(Block block) { + Location location = block.getLocation(); + addLocation(location); + } + + public void addLocation(Location location) { + temporaryBlocks.add( + location); //Adds the location to a temporary list (NEVER saved to file or iterated through) + if (!isFileMangerMakingCopy) { //If we are making a copy + blocks.add(location); //add the location to the main list of block + temporaryBlocks.remove(location); //Remove from the secondary list + } else { //If we're not making a copy + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + new BukkitRunnable() { //Try again in 1 tick (0.05 s) + @Override + public void run() { + addLocation(location); + } + }.runTaskLater(plugin, 1).getTaskId(); + } + } + + public void removeBlock(Block block) { + Location location = block.getLocation(); + removeLocation(location); + } + + public void removeLocation(Location location) { + if (!isFileMangerMakingCopy) { //If we are not currently making a copy, remove the block + if (blocks.contains(location)) { + blocks.remove(location); + } + } else { //If we are currently making a copy, wait a tick to try to remove the location again + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + new BukkitRunnable() { + @Override + public void run() { + removeLocation(location); + } + }.runTaskLater(plugin, 1).getTaskId(); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/server/RecentLogouts.java b/src/main/java/mc/carlton/freerpg/core/info/server/RecentLogouts.java new file mode 100644 index 0000000..322cde8 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/server/RecentLogouts.java @@ -0,0 +1,83 @@ +package mc.carlton.freerpg.core.info.server; + +import java.io.File; +import java.util.ArrayList; +import java.util.UUID; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.OfflinePlayerStatLoadIn; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; + +public class RecentLogouts { + + static ArrayList lastLogouts = new ArrayList<>(); + private int maxPlayersStored; + + public RecentLogouts() { + ConfigLoad configLoad = new ConfigLoad(); + maxPlayersStored = configLoad.getPlayerStatFilesLoadedInOnStartup(); + } + + public ArrayList getLastLogouts() { + return lastLogouts; + } + + public void setLastLogouts(ArrayList lastLogouts) { + RecentLogouts.lastLogouts = lastLogouts; + if (lastLogouts.size() < maxPlayersStored) { + fillLastLogoutSlots(); + } else if (lastLogouts.size() > maxPlayersStored) { + removeLastEntries(false); + } + } + + public void playerLogout(Player p, boolean disablePlugin) { + UUID playerUUID = p.getUniqueId(); + if (lastLogouts.contains( + playerUUID)) { //If a player logs out while they were already in the list of recent logouts, remove them + lastLogouts.remove(playerUUID); + } + removeLastEntries( + disablePlugin); //Ensure the recent logout list never exceeds a specified limit (maxPlayerStored) + lastLogouts.add(0, playerUUID); //Adds this player as the most recent logout + } + + public void removeLastEntries(boolean disablePlugin) { + int playersStored = lastLogouts.size(); + if (playersStored + >= maxPlayersStored) { //We are about to add a person, so if the list is full we need to remove the last person on this list + OfflinePlayerStatLoadIn offlinePlayerStatLoadIn = new OfflinePlayerStatLoadIn(); + for (int i = 0; i <= (playersStored - maxPlayersStored); i++) { + if (lastLogouts.isEmpty()) { + return; + } + UUID removedPlayerUUID = lastLogouts.get(lastLogouts.size() - 1); + if (!disablePlugin) { //They will be removed anyway if the plugin is disabling + offlinePlayerStatLoadIn.unloadOfflinePlayer( + removedPlayerUUID); //Unloads the players stats ONLY if they're offline + } + lastLogouts.remove(lastLogouts.size() - 1); //Removes the player's stats from the queue. + //At this point the player is either online and will be added to lastLogouts soon + //Or they are too inactive for their stats to be preloaded with the server. + } + } + } + + public void fillLastLogoutSlots() { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + File userdata = new File(plugin.getDataFolder(), File.separator + "PlayerDatabase"); + File[] allUsers = userdata.listFiles(); + for (File f : allUsers) { + UUID playerUUID = UUID.fromString(f.getName().replace(".yml", "")); + if (!lastLogouts.contains(playerUUID)) { + lastLogouts.add(playerUUID); + } + if (lastLogouts.size() >= maxPlayersStored) { + break; + } + } + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/server/RunTimeData.java b/src/main/java/mc/carlton/freerpg/core/info/server/RunTimeData.java new file mode 100644 index 0000000..33e742f --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/server/RunTimeData.java @@ -0,0 +1,246 @@ +package mc.carlton.freerpg.core.info.server; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import org.apache.logging.log4j.Level; +import org.bukkit.plugin.Plugin; + +public class RunTimeData { + + static ArrayList breakBlockTrackedBlockCheckTimes = new ArrayList<>(); + static ArrayList breakBlockConditionalsTimes = new ArrayList<>(); + static ArrayList leftCLickConditionalsTimes = new ArrayList<>(); + static ArrayList changeEXPTimes = new ArrayList<>(); + static ArrayList flintFinderTimes = new ArrayList<>(); + static ArrayList diggingTreasureDropTimes = new ArrayList<>(); + static ArrayList doubleDropTimes = new ArrayList<>(); + static ArrayList logXPDropTimes = new ArrayList<>(); + static ArrayList logBookDropTimes = new ArrayList<>(); + static ArrayList leavesDropTimes = new ArrayList<>(); + static ArrayList timedHasteTimes = new ArrayList<>(); + static ArrayList miningTreasureDropTimes = new ArrayList<>(); + static ArrayList miningWastelessHasteTimes = new ArrayList<>(); + static ArrayList veinMinerTimes = new ArrayList<>(); + static ArrayList leafBlowerTimes = new ArrayList<>(); + static ArrayList storeBlockFaceTimes = new ArrayList<>(); + + + public void logRunTimeData() { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + File runTimeDataFolder = new File(plugin.getDataFolder(), File.separator + "RunTimes"); + if (!runTimeDataFolder.exists()) { + runTimeDataFolder.mkdir(); + } + SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");//dd/MM/yyyy + Date now = new Date(); + String strDate0 = sdfDate.format(now); + String strDate = strDate0.replaceAll(" ", "_"); + File f = new File(runTimeDataFolder, "RunTimeData_" + strDate + ".dat"); + f.setReadable(true, false); + f.setWritable(true, false); + String path = f.getPath(); + try { + if (!f.exists()) { + f.createNewFile(); + try (FileWriter fileWriter = new FileWriter(path)) { + ArrayList> allData = getAllData(); + for (int i = 0; i < allData.size(); i++) { + writeHeader(fileWriter, i); + writeBody(fileWriter, allData.get(i)); + } + + } catch (IOException exception) { + FreeRPG.log(Level.ERROR, exception.getMessage()); + } + } + } catch (IOException error) { + error.printStackTrace(); + } + } + + public void addTime(long time, String timeGroup) { + double timeInSeconds = (double) time / 1000.0; + if (timeGroup.equalsIgnoreCase("BreakBlocktrackedBlocks")) { + breakBlockTrackedBlockCheckTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("BreakBlockconditionals")) { + breakBlockConditionalsTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("leftClickConditionals")) { + leftCLickConditionalsTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("changeEXP")) { + changeEXPTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("flintFinder")) { + flintFinderTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("diggingTreasureDrop")) { + diggingTreasureDropTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("doubleDrop")) { + doubleDropTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("logXP")) { + logXPDropTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("logBook")) { + logBookDropTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("leaves")) { + leavesDropTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("woodcuttingHaste")) { + timedHasteTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("miningTreasureDrop")) { + miningTreasureDropTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("wastelessHaste")) { + miningWastelessHasteTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("veinMiner")) { + veinMinerTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("leafBlower")) { + leafBlowerTimes.add(timeInSeconds); + } else if (timeGroup.equalsIgnoreCase("blockFace")) { + storeBlockFaceTimes.add(timeInSeconds); + } + } + + public Map getTimesStatistics(ArrayList times) { + if (times.isEmpty()) { + return null; + } + double sum = 0; + double max = times.get(0); + double min = times.get(0); + for (double time : times) { + sum += time; + if (time > max) { + max = time; + } else if (time < min) { + min = time; + } + } + double average = sum / times.size(); + double sqAvgDiff = 0; + for (double time : times) { + sqAvgDiff += (time - average) * (time - average); + } + double var = sqAvgDiff / times.size(); + double stDev = Math.sqrt(var); + Map data = new HashMap<>(); + data.put("total", Double.valueOf(times.size())); + data.put("sum", roundThreePlaces(sum)); + data.put("max", roundThreePlaces(max)); + data.put("min", roundThreePlaces(min)); + data.put("avg", roundThreePlaces(average)); + data.put("stDev", roundThreePlaces(stDev)); + return data; + + } + + public double roundThreePlaces(double number) { + return Math.round(number * 1000) / 1000.0; + } + + public ArrayList> getAllData() { + ArrayList> allData = new ArrayList<>(); + allData.add(breakBlockTrackedBlockCheckTimes); + allData.add(breakBlockConditionalsTimes); + allData.add(leftCLickConditionalsTimes); + allData.add(changeEXPTimes); + allData.add(flintFinderTimes); + allData.add(diggingTreasureDropTimes); + allData.add(doubleDropTimes); + allData.add(logXPDropTimes); + allData.add(logBookDropTimes); + allData.add(leavesDropTimes); + allData.add(timedHasteTimes); + allData.add(miningTreasureDropTimes); + allData.add(miningWastelessHasteTimes); + allData.add(veinMinerTimes); + allData.add(leafBlowerTimes); + allData.add(storeBlockFaceTimes); + return allData; + } + + public void writeHeader(FileWriter fileWriter, int i) throws IOException { + String horizontalLine = + "---------------------------------------------------------------" + "\n"; + fileWriter.write(horizontalLine); + switch (i) { + case 0: + fileWriter.write("Break Block Tracked Blocks Check" + "\n"); + break; + case 1: + fileWriter.write("Break Block Conditionals" + "\n"); + break; + case 2: + fileWriter.write("Left Click Conditionals" + "\n"); + break; + case 3: + fileWriter.write("Change EXP" + "\n"); + break; + case 4: + fileWriter.write("Flint Finder" + "\n"); + break; + case 5: + fileWriter.write("Digging Treasure Drop" + "\n"); + break; + case 6: + fileWriter.write("Double Drop" + "\n"); + break; + case 7: + fileWriter.write("Log XP Drop" + "\n"); + break; + case 8: + fileWriter.write("Log Book Drop" + "\n"); + break; + case 9: + fileWriter.write("Leaves Drop" + "\n"); + break; + case 10: + fileWriter.write("Woodcutting Timed Haste" + "\n"); + break; + case 11: + fileWriter.write("Mining Treasure Drop" + "\n"); + break; + case 12: + fileWriter.write("Mining Wasteless Haste" + "\n"); + break; + case 13: + fileWriter.write("Vein Miner" + "\n"); + break; + case 14: + fileWriter.write("Leaf Blower" + "\n"); + break; + case 15: + fileWriter.write("Store Block Face" + "\n"); + break; + default: + break; + } + fileWriter.write(horizontalLine); + } + + public void writeBody(FileWriter fileWriter, ArrayList data) throws IOException { + String horizontalBreak = + "><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><" + "\n"; + Map statistics = getTimesStatistics(data); + if (statistics != null) { + fileWriter.write("Total # of Times: " + ((int) Math.round(statistics.get("total"))) + "\n"); + fileWriter.write("Total Time Taken: " + (statistics.get("sum")) + " s" + "\n"); + fileWriter.write("Maximum Time Taken: " + (statistics.get("max")) + " s" + "\n"); + fileWriter.write("Minimum Time Taken: " + (statistics.get("min")) + " s" + "\n"); + fileWriter.write("Average Time Taken: " + (statistics.get("avg")) + " s" + "\n"); + fileWriter.write("Standard Deviation: " + (statistics.get("stDev")) + " s" + "\n"); + fileWriter.write(horizontalBreak); + } + ConfigLoad configLoad = new ConfigLoad(); + if (configLoad.isVerboseRunTimeData()) { + for (int i = 0; i < data.size(); i++) { + fileWriter.write(i + ": " + data.get(i) + " s" + "\n"); + } + } + fileWriter.write("\n"); + fileWriter.write("\n"); + + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/info/server/WorldGuardChecks.java b/src/main/java/mc/carlton/freerpg/core/info/server/WorldGuardChecks.java new file mode 100644 index 0000000..f21ff75 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/info/server/WorldGuardChecks.java @@ -0,0 +1,123 @@ +package mc.carlton.freerpg.core.info.server; + +import com.sk89q.worldedit.bukkit.BukkitAdapter; +import com.sk89q.worldguard.LocalPlayer; +import com.sk89q.worldguard.WorldGuard; +import com.sk89q.worldguard.bukkit.WorldGuardPlugin; +import com.sk89q.worldguard.protection.ApplicableRegionSet; +import com.sk89q.worldguard.protection.flags.Flags; +import com.sk89q.worldguard.protection.regions.RegionContainer; +import com.sk89q.worldguard.protection.regions.RegionQuery; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import org.apache.logging.log4j.Level; +import org.bukkit.Location; +import org.bukkit.entity.Player; + +/** + * WorldGuardChecks is the class which checks if the Worldguard plugin is installed. + */ +public class WorldGuardChecks { + + static boolean worldGuardPresent; + + public void initializeWorldGuardPresent() { + worldGuardPresent = true; + try { + WorldGuard.getInstance(); + } catch (NoClassDefFoundError e) { + worldGuardPresent = false; + } + FreeRPG.log(Level.INFO, "Worldguard is present: " + worldGuardPresent); + } + + public boolean canBuild(Player p, Location l) { + if (!worldGuardPresent) { + return true; + } + if (!inRegion(l)) { + ConfigLoad loadConfig = new ConfigLoad(); + return loadConfig.isAllowBuild(); + } + RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery(); + LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(p); + com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(l); + if (!hasBypass(localPlayer)) { + return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(p), Flags.BUILD); + } else { + return true; + } + } + + public boolean canPvP(Player p, Location l) { + if (!worldGuardPresent) { + return true; + } + if (!inRegion(l)) { + ConfigLoad loadConfig = new ConfigLoad(); + return loadConfig.isAllowPvP(); + } + RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery(); + LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(p); + com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(l); + if (!hasBypass(localPlayer)) { + return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(p), Flags.PVP); + } else { + return true; + } + } + + public boolean canDamageEntities(Player p, Location l) { + if (!worldGuardPresent) { + return true; + } + if (!inRegion(l)) { + ConfigLoad loadConfig = new ConfigLoad(); + return loadConfig.isAllowHurtAnimals(); + } + RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery(); + LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(p); + com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(l); + if (!hasBypass(localPlayer)) { + return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(p), Flags.DAMAGE_ANIMALS); + } else { + return true; + } + } + + public boolean canExplode(Player p, Location l) { + if (!worldGuardPresent) { + return true; + } + if (!inRegion(l)) { + ConfigLoad loadConfig = new ConfigLoad(); + return loadConfig.isAllowExplosions(); + } + RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery(); + LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(p); + com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(l); + if (!hasBypass(localPlayer)) { + return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(p), Flags.OTHER_EXPLOSION); + } else { + return true; + } + } + + + public boolean hasBypass(LocalPlayer localPlayer) { + return WorldGuard.getInstance().getPlatform().getSessionManager() + .hasBypass(localPlayer, localPlayer.getWorld()); + } + + public boolean inRegion(Location l) { + boolean inRegion = false; + com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(l); + RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer(); + RegionQuery query = container.createQuery(); + ApplicableRegionSet set = query.getApplicableRegions(loc); + if (!set.getRegions().isEmpty()) { + inRegion = true; + } + return inRegion; + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/leaveAndJoin/LoginProcedure.java b/src/main/java/mc/carlton/freerpg/core/leaveAndJoin/LoginProcedure.java new file mode 100644 index 0000000..d95f577 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/leaveAndJoin/LoginProcedure.java @@ -0,0 +1,144 @@ +package mc.carlton.freerpg.core.leaveAndJoin; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.Map; +import java.util.UUID; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.core.info.player.AbilityLogoutTracker; +import mc.carlton.freerpg.core.info.player.AbilityTimers; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.player.Leaderboards; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.core.info.player.PlayerStatsLoadIn; +import mc.carlton.freerpg.core.serverFileManagement.PlayerStatsFilePreparation; +import mc.carlton.freerpg.skills.perksAndAbilities.Agility; +import mc.carlton.freerpg.skills.perksAndAbilities.Defense; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import mc.carlton.freerpg.skills.perksAndAbilities.Fishing; +import mc.carlton.freerpg.utils.game.BossBarStorage; +import mc.carlton.freerpg.utils.game.FurnaceUserTracker; +import org.bukkit.Bukkit; +import org.bukkit.attribute.Attributable; +import org.bukkit.attribute.Attribute; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; + +public class LoginProcedure { + + Player p; + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + private UUID uuid; + + + public LoginProcedure(Player p) { + this.p = p; + this.uuid = p.getUniqueId(); + + } + + public LoginProcedure(UUID playerUUID) { + this.p = Bukkit.getPlayer(playerUUID); + this.uuid = playerUUID; + + } + + public void addStatsToPlayerMap(boolean onlinePlayer) { + //Read in player's past stats stats + PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); + long loginTime = loadInPlayer.getLoginTime(); + long playTime = loadInPlayer.getPlayTime(); + String language = loadInPlayer.getPlayerLanguage(); + Map> playerStats0 = loadInPlayer.getPlayerStatsMapFromFile(); + Map playerSkillExpBarToggles = loadInPlayer.getSkillExpBarToggles(); + Map playerSkillAbilityToggles = loadInPlayer.getSkillAbilityToggles(); + + //Combine the player's stats with everyone on the server's + PlayerStats pStatsClass = new PlayerStats(uuid); + Map>> allStats = pStatsClass.getData(); + allStats.put(uuid, playerStats0); + pStatsClass.setData(allStats); + pStatsClass.addPlayerTimes(loginTime, playTime); + pStatsClass.setPlayerLanguage(language); + pStatsClass.addPlayerSkillToggleAbility(playerSkillAbilityToggles); + pStatsClass.addPlayerSkillToggleExpBar(playerSkillExpBarToggles); + pStatsClass.setPlayerAreStatsSaved(!onlinePlayer); + } + + public void updatePlayerLoginTime() { + PlayerStats pStatsClass = new PlayerStats(uuid); + long playTime = pStatsClass.getPlayerPlayTime(); + pStatsClass.addPlayerTimes(Instant.now().getEpochSecond(), playTime); + pStatsClass.setPlayerAreStatsSaved(false); + } + + public void playerLogin() { + PlayerStats playerStats = new PlayerStats(uuid); + if (!playerStats.isPlayerRegistered()) { //If the player is registered, we assume this has already been done + //If the player is new, creates a new stats file for them, + //If the player's stat file is not properly formatted, this also fixes that + PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); + playerStatsFilePreparation.playJoinConditions(p); + + //Read in player's past stats into an the playerStats Class + addStatsToPlayerMap(true); + } else { + updatePlayerLoginTime(); + } + + //Loads player into leaderboard stat tracking if it's their first time logging in/they have no player profile + Leaderboards leaderboards = new Leaderboards(); + leaderboards.initializeNewPlayer(p); + + //Makes sure the player's stats are consistent with the defined EXP curve + ChangeStats changeStats = new ChangeStats(p); + changeStats.checkPlayerLevelEXPCurveConsistency(); + changeStats.setTotalLevel(); + changeStats.setTotalExperience(); + + //Makes sure player's attack speed is normal + ((Attributable) p).getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(4.0); + + //Initiates player abilities + Integer[] initAbils = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; + AbilityTracker abilitiesClass = new AbilityTracker(p); + Map allAbilities = abilitiesClass.getAbilities(); + allAbilities.put(uuid, initAbils); + abilitiesClass.setAbilities(allAbilities); + + //Initiates player timers + AbilityTimers timersClass = new AbilityTimers(p); + Map allTimers = timersClass.getCooldownTimes(); + if (!allTimers.containsKey(uuid)) { + Integer[] initTimers = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + allTimers.put(uuid, initTimers); + timersClass.setTimes(allTimers); + } + + //Initiates player abiliyLogoutTracker + AbilityLogoutTracker abilityLogout = new AbilityLogoutTracker(p); + abilityLogout.initializePlayer(); + + //Initializes Abilities + Farming farmingClass = new Farming(p); + farmingClass.oneWithNatureStart(); + + Fishing fishingClass = new Fishing(p); + fishingClass.fishPersonStart(); + + Agility agilityClass = new Agility(p); + agilityClass.gracefulFeetStart(); + + Defense defenseClass = new Defense(p); + defenseClass.hearty(); + + //Sets up bossbar + BossBarStorage bossBarStorage = new BossBarStorage(); + bossBarStorage.initializeNewPlayer(p); + + //Checks if player recently logged out with active furnaces + FurnaceUserTracker furnaceUserTracker = new FurnaceUserTracker(); + furnaceUserTracker.playerLogin(p); + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/leaveAndJoin/LogoutProcedure.java b/src/main/java/mc/carlton/freerpg/core/leaveAndJoin/LogoutProcedure.java new file mode 100644 index 0000000..93439de --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/leaveAndJoin/LogoutProcedure.java @@ -0,0 +1,156 @@ +package mc.carlton.freerpg.core.leaveAndJoin; + +import java.io.IOException; +import mc.carlton.freerpg.core.info.player.AbilityLogoutTracker; +import mc.carlton.freerpg.core.info.player.AbilityTimers; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.core.info.player.PlayerStatsLoadIn; +import mc.carlton.freerpg.core.info.server.RecentLogouts; +import mc.carlton.freerpg.skills.perksAndAbilities.Agility; +import mc.carlton.freerpg.skills.perksAndAbilities.Defense; +import mc.carlton.freerpg.skills.perksAndAbilities.Digging; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import mc.carlton.freerpg.skills.perksAndAbilities.Fishing; +import mc.carlton.freerpg.skills.perksAndAbilities.Mining; +import mc.carlton.freerpg.skills.perksAndAbilities.Swordsmanship; +import mc.carlton.freerpg.utils.game.BlockFaceTracker; +import mc.carlton.freerpg.utils.game.BossBarStorage; +import mc.carlton.freerpg.utils.game.BrewingStandUserTracker; +import mc.carlton.freerpg.utils.game.FurnaceUserTracker; +import mc.carlton.freerpg.utils.game.TrackItem; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +public class LogoutProcedure { + + Player p; + private String pName; + + public LogoutProcedure(Player p) { + this.p = p; + this.pName = p.getDisplayName(); + } + + public void playerLogout(boolean disablePlugin) throws IOException { + // The player stats have not been saved yet, so we don't want to remove the player + PlayerStats playerStats = new PlayerStats(p); + playerStats.setPlayerAreStatsSaved(false); + + //Adds player to the list of last n logouts ("n" specified in config) + RecentLogouts recentLogouts = new RecentLogouts(); + recentLogouts.playerLogout(p, disablePlugin); + + //Saves Player Stats to file + PlayerStatsLoadIn saveStats = new PlayerStatsLoadIn(p); + + if (disablePlugin) { //If the plugin is disabled, I don't care about performance (Plus I can't run an async task) + saveStats.setPlayerStatsMap(); + } else { //If the plugin is not disabled, we async remove the player's stats to not affect performance + saveStats.asyncStatSave(); + } + + //Ensures no items stay permanently altered from abilities + preventLogoutTheft(disablePlugin); + + //Ends all tasks that track players' buffs gained from some skills + Farming farmingClass = new Farming(p); + farmingClass.oneWithNatureEnd(); + Fishing fishingClass = new Fishing(p); + fishingClass.fishPersonEnd(); + Agility agilityClass = new Agility(p); + agilityClass.gracefulFeetEnd(); + + BossBarStorage bossBarStorage = new BossBarStorage(); + bossBarStorage.removePlayer(p); + + //If the plugin has been disabled, the rest will take care of itself. + if (disablePlugin) { + return; + } + + //Removes tracked player data + BrewingStandUserTracker brewDelete = new BrewingStandUserTracker(); + brewDelete.removeAllPlayerStands(p); + FurnaceUserTracker furnaceDelete = new FurnaceUserTracker(); + furnaceDelete.removeAllPlayerfurnaceLocations(p); + BlockFaceTracker blockFaceDelete = new BlockFaceTracker(); + blockFaceDelete.removePlayerBlockFace(p); + + //Removes players stats,abilities,timers,and logout trackers from the hashmaps, all stat information should be saved + + /*Player stats SHOULD be removed by OfflinePlayerStatLoadIn. + PlayerStats deleteStats = new PlayerStats(p); + deleteStats.removePlayer(); + */ + + AbilityTracker deleteAbilities = new AbilityTracker(p); + deleteAbilities.removePlayer(); + + AbilityTimers deleteTimers = new AbilityTimers(p); + deleteTimers.removePlayer(); + + AbilityLogoutTracker deleteLogoutTracked = new AbilityLogoutTracker(p); + deleteLogoutTracked.removePlayer(); + } + + public void preventLogoutTheft(boolean disablePlugin) { + preventLogoutTheftDefense(disablePlugin); + preventLogoutTheftMining(disablePlugin); + preventLogoutTheftDigging(disablePlugin); + preventLogoutTheftSwordsmanship(disablePlugin); + } + + public void preventLogoutTheftMining(boolean disablePlugin) { + AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); + TrackItem trackItem = new TrackItem(); + + NamespacedKey key_mining = logoutTracker.getPlayerKeys().get("mining"); + int taskID_mining = logoutTracker.getPlayerTasks().get("mining"); + ItemStack itemInHand_mining = trackItem.findTrackedItemInInventory(p, key_mining); + + if (itemInHand_mining != null) { + Mining miningClass = new Mining(p); + miningClass.preventLogoutTheft(taskID_mining, itemInHand_mining, key_mining, disablePlugin); + } + } + + public void preventLogoutTheftDigging(boolean disablePlugin) { + AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); + TrackItem trackItem = new TrackItem(); + + NamespacedKey key_digging = logoutTracker.getPlayerKeys().get("digging"); + int taskID_digging = logoutTracker.getPlayerTasks().get("digging"); + ItemStack itemInHand_digging = trackItem.findTrackedItemInInventory(p, key_digging); + + if (itemInHand_digging != null) { + Digging diggingClass = new Digging(p); + diggingClass.preventLogoutTheft(taskID_digging, itemInHand_digging, key_digging, + disablePlugin); + } + } + + public void preventLogoutTheftSwordsmanship(boolean disablePlugin) { + AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); + TrackItem trackItem = new TrackItem(); + + NamespacedKey key_swordsmanship = logoutTracker.getPlayerKeys().get("swordsmanship"); + int taskID_swordsmanship = logoutTracker.getPlayerTasks().get("swordsmanship"); + ItemStack itemInHand_swordsmanship = trackItem.findTrackedItemInInventory(p, key_swordsmanship); + + if (itemInHand_swordsmanship != null) { + Swordsmanship swordsmanshipClass = new Swordsmanship(p); + swordsmanshipClass.preventLogoutTheft(taskID_swordsmanship, itemInHand_swordsmanship, + key_swordsmanship, disablePlugin); + } + } + + public void preventLogoutTheftDefense(boolean disablePlugin) { + AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); + int taskID_defense = logoutTracker.getPlayerTasks().get("defense"); + + Defense defenseClass = new Defense(p); + defenseClass.preventLogoutTheft(taskID_defense, disablePlugin); + } +} diff --git a/src/main/java/mc/carlton/freerpg/leaveAndJoin/PlayerJoin.java b/src/main/java/mc/carlton/freerpg/core/leaveAndJoin/PlayerJoin.java similarity index 64% rename from src/main/java/mc/carlton/freerpg/leaveAndJoin/PlayerJoin.java rename to src/main/java/mc/carlton/freerpg/core/leaveAndJoin/PlayerJoin.java index b51b19b..fb71eba 100644 --- a/src/main/java/mc/carlton/freerpg/leaveAndJoin/PlayerJoin.java +++ b/src/main/java/mc/carlton/freerpg/core/leaveAndJoin/PlayerJoin.java @@ -1,28 +1,22 @@ -package mc.carlton.freerpg.leaveAndJoin; +package mc.carlton.freerpg.core.leaveAndJoin; -import mc.carlton.freerpg.FreeRPG; -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.EnchantmentStorageMeta; -import org.bukkit.inventory.meta.ItemMeta; public class PlayerJoin implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onPlayerJoin(PlayerJoinEvent e){ - Player p = e.getPlayer(); - LoginProcedure login = new LoginProcedure(p); - login.playerLogin(); - } + @EventHandler(priority = EventPriority.HIGH) + void onPlayerJoin(PlayerJoinEvent e) { + Player p = e.getPlayer(); + LoginProcedure login = new LoginProcedure(p); + login.playerLogin(); + } + // TODO remove dead code! /* Some code testing a custom enchantment I was making ItemStack choppingAxe = new ItemStack(Material.DIAMOND_AXE,1); choppingAxe.addUnsafeEnchantment(Enchantment.getByKey(new NamespacedKey(FreeRPG.getPlugin(FreeRPG.class),"chopping")),1); diff --git a/src/main/java/mc/carlton/freerpg/core/leaveAndJoin/PlayerLeave.java b/src/main/java/mc/carlton/freerpg/core/leaveAndJoin/PlayerLeave.java new file mode 100644 index 0000000..829a347 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/leaveAndJoin/PlayerLeave.java @@ -0,0 +1,20 @@ +package mc.carlton.freerpg.core.leaveAndJoin; + +import java.io.IOException; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerQuitEvent; + +public class PlayerLeave implements Listener { + + @EventHandler(priority = EventPriority.HIGHEST) + void onPlayerLeave(PlayerQuitEvent e) throws IOException { + Player p = e.getPlayer(); + p.leaveVehicle(); + LogoutProcedure logout = new LogoutProcedure(p); + logout.playerLogout(false); + + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/serverFileManagement/LeaderBoardFilesManager.java b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/LeaderBoardFilesManager.java new file mode 100644 index 0000000..c525897 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/LeaderBoardFilesManager.java @@ -0,0 +1,271 @@ +package mc.carlton.freerpg.core.serverFileManagement; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.core.info.player.Leaderboards; +import mc.carlton.freerpg.core.info.player.PlayerLeaderboardStat; +import org.apache.logging.log4j.Level; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; + +public class LeaderBoardFilesManager { + + static File leaderBoardsYML; + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + public void initializePlayerFile() { + File serverData = new File(plugin.getDataFolder(), File.separator + "ServerData"); + File f = new File(serverData, "leaderboards.yml"); + f.setReadable(true, false); + f.setWritable(true, false); + leaderBoardsYML = f; + } + + public void writeOutPlayerLeaderBoardFile() { + //Each time we write the leaderboard file, we want to make the yaml config from scratch so we don't include + //Player's whose files have been deleted. They could linger and mess up rankings order (probably not, but let's be safe, + // as it costs no extra computation) + YamlConfiguration newYamlConfiguration = new YamlConfiguration(); + HashSet allPlayerUUIDs = getHashSetOfAllPlayerUUIDs(); + Leaderboards leaderboards = new Leaderboards(); + leaderboards.removeForbiddenUUIDs( + allPlayerUUIDs); //Get rid of players no longer stored in player files + Map> allLeaderboards = leaderboards.getLeaderboards(); + for (String skillName : allLeaderboards.keySet()) { + ArrayList leaderboard = (ArrayList) allLeaderboards.get( + skillName).clone(); //We clone here to avoid concurrent modification exception + newYamlConfiguration.createSection(skillName); + if (skillName.equalsIgnoreCase("global")) { + for (int i = 0; i < leaderboard.size(); i++) { + PlayerLeaderboardStat player = leaderboard.get(i); + String section = skillName + "." + i; + newYamlConfiguration.createSection(section); + newYamlConfiguration.set(section + ".UUID", player.get_playerUUID().toString()); + newYamlConfiguration.set(section + ".playerName", player.get_pName()); + newYamlConfiguration.set(section + ".level", player.get_sortedStat()); + newYamlConfiguration.set(section + ".totalExperience", player.get_stat2()); + } + } else if (skillName.equalsIgnoreCase("playTime")) { + for (int i = 0; i < leaderboard.size(); i++) { + PlayerLeaderboardStat player = leaderboard.get(i); + String section = skillName + "." + i; + newYamlConfiguration.createSection(section); + newYamlConfiguration.set(section + ".UUID", player.get_playerUUID().toString()); + newYamlConfiguration.set(section + ".playerName", player.get_pName()); + newYamlConfiguration.set(section + ".totalPlayTime", player.get_sortedStat()); + } + } else { + for (int i = 0; i < leaderboard.size(); i++) { + PlayerLeaderboardStat player = leaderboard.get(i); + String section = skillName + "." + i; + newYamlConfiguration.createSection(section); + newYamlConfiguration.set(section + ".UUID", player.get_playerUUID().toString()); + newYamlConfiguration.set(section + ".playerName", player.get_pName()); + newYamlConfiguration.set(section + ".experience", player.get_sortedStat()); + } + } + } + try { + newYamlConfiguration.save(leaderBoardsYML); + } catch (IOException e) { + FreeRPG.log(Level.ERROR, e.getMessage()); + } + } + + public HashSet getHashSetOfAllPlayerUUIDs() { + // ATTENTION + // THIS NEEDS TO BE CHANGED WHEN MYSQL SUPPORT IS ADDED + // OTHERWISE, LEADERBOARD STATS WILL NOT SAVE PROPERLY + File userdata = new File(plugin.getDataFolder(), File.separator + "PlayerDatabase"); + File[] allUsers = userdata.listFiles(); + HashSet allPlayerUUIDs = new HashSet<>(); + for (File userFile : allUsers) { + UUID playerUUID = UUID.fromString(userFile.getName().substring(0, 36)); + allPlayerUUIDs.add(playerUUID); + } + return allPlayerUUIDs; + } + + public void readInLeaderBoardFile() { + YamlConfiguration leaderboardsConfig = YamlConfiguration.loadConfiguration(leaderBoardsYML); + Leaderboards leaderboards = new Leaderboards(); + for (String skillName : leaderboardsConfig.getKeys(false)) { + for (String playerRank : leaderboardsConfig.getConfigurationSection(skillName) + .getKeys(false)) { + String rankKey = skillName + "." + playerRank; + if (skillName.equalsIgnoreCase("global")) { + UUID playerUUID = UUID.fromString(leaderboardsConfig.getString(rankKey + ".UUID")); + String playerName = leaderboardsConfig.getString(rankKey + ".playerName"); + int level = leaderboardsConfig.getInt(rankKey + ".level"); + int totalExperience = leaderboardsConfig.getInt(rankKey + ".totalExperience"); + leaderboards.addPlayerGlobalStat(playerUUID, playerName, level, totalExperience); + } else if (skillName.equalsIgnoreCase("playTime")) { + UUID playerUUID = UUID.fromString(leaderboardsConfig.getString(rankKey + ".UUID")); + String playerName = leaderboardsConfig.getString(rankKey + ".playerName"); + long totalPlayTime = leaderboardsConfig.getLong(rankKey + ".totalPlayTime"); + leaderboards.addPlayerTimeStat(playerUUID, playerName, totalPlayTime); + } else { + UUID playerUUID = UUID.fromString(leaderboardsConfig.getString(rankKey + ".UUID")); + String playerName = leaderboardsConfig.getString(rankKey + ".playerName"); + int experience = leaderboardsConfig.getInt(rankKey + ".experience"); + leaderboards.addPlayerSkillStat(playerUUID, playerName, experience, skillName); + } + } + } + leaderboards.sortAllLeaderBoards(true); //Sorts all leaderboards + leaderboards.setLeaderboardsLoaded(true); + } + + public void deleteAbsentPlayersFromFile() { //This is likely best run aysnc + deleteLeaderBoardFile(); + PeriodicSaving periodicSaving = new PeriodicSaving(); + periodicSaving.saveAllStats(false); + createLeaderBoardFile( + true); //We just recreate the file, it will only include players in the directory + } + + public void deleteLeaderBoardFile() { + leaderBoardsYML.delete(); + } + + public boolean createLeaderBoardFile( + boolean forceCreate) { //This creates a leaderboard file using every player's file on the server, it may take a while to execute + initializePlayerFile(); + if (!leaderBoardsYML.exists() || forceCreate) { + FreeRPG.log(Level.INFO, "[FreeRPG] Creating Leaderboard File, this may take a while..."); + //Load playerLeaderBoard class and set it to false (since this will likely be done async) + Leaderboards leaderboards = new Leaderboards(); + leaderboards.setLeaderboardsLoaded(false); + + File userdata = new File(plugin.getDataFolder(), File.separator + "PlayerDatabase"); + File[] allUsers = userdata.listFiles(); + YamlConfiguration leaderboardConfig = YamlConfiguration.loadConfiguration(leaderBoardsYML); + List leaderboardNames = leaderboards.getLeaderboardNames(); + + for (String skillName : leaderboardNames) { + leaderboardConfig.createSection(skillName); + } + for (File userFile : allUsers) { //First we must get the stats of all users and create an arraylist "leaderboard" + Object[] outputOfPlayerDataLoad = loadPlayerDataFromFile(userFile); + YamlConfiguration playerData = (YamlConfiguration) outputOfPlayerDataLoad[0]; + UUID playerUUID = (UUID) outputOfPlayerDataLoad[1]; + for (String skillName : leaderboardNames) { + if (skillName.equalsIgnoreCase("global")) { + String playerName = playerData.getString("general.username"); + int level = playerData.getInt("globalStats.totalLevel"); + int totalExperience = playerData.getInt("globalStats.totalExperience"); + leaderboards.addPlayerGlobalStat(playerUUID, playerName, level, totalExperience); + + } else if (skillName.equalsIgnoreCase("playTime")) { + String playerName = playerData.getString("general.username"); + long playTime = playerData.getLong("general.playTime"); + leaderboards.addPlayerTimeStat(playerUUID, playerName, playTime); + } else { + String playerName = playerData.getString("general.username"); + int experience = playerData.getInt(skillName + ".experience"); + leaderboards.addPlayerSkillStat(playerUUID, playerName, experience, skillName); + } + } + } + //Now that all the player's information is added to the PlayerLeaderboardClass, we can sort the data + addDataToFile(leaderBoardsYML, + leaderboardConfig); //Adds data to leaderboards yaml configuration and saves + leaderboards.setLeaderboardsLoaded(true); + FreeRPG.log(Level.INFO, "[FreeRPG] leaderboards.yml created successfully!"); + return true; + } + return false; + + } + + public void addDataToFile(File f, YamlConfiguration leaderboardsConfig) { + Leaderboards leaderboards = new Leaderboards(); + List leaderboardNames = leaderboards.getLeaderboardNames(); + leaderboards.sortAllLeaderBoards(true); + //Once it's sorted, we can iterate through every leaderboard + for (String skillName : leaderboardNames) { + ArrayList leaderboard = leaderboards.getLeaderboard(skillName); + if (skillName.equalsIgnoreCase("global")) { + for (int i = 0; i < leaderboard.size(); i++) { //Index each leaderboard player + addPlayerSkillStatsToLeaderBoardGlobal(leaderboardsConfig, i, leaderboard); + } + } else if (skillName.equalsIgnoreCase("playTime")) { + for (int i = 0; i < leaderboard.size(); i++) { //Index each leaderboard player + addPlayerSkillStatsToLeaderBoardTime(leaderboardsConfig, i, leaderboard); + } + } else { + for (int i = 0; i < leaderboard.size(); i++) { //Index each leaderboard player + addPlayerSkillStatsToLeaderBoard(leaderboardsConfig, skillName, i, leaderboard); + } + } + } + try { + leaderboardsConfig.save(f); + } catch (IOException e) { + e.printStackTrace(); + } + } + + + public void addPlayerSkillStatsToLeaderBoard(YamlConfiguration leaderBoardYAML, String skillName, + int position, ArrayList leaderboard) { + PlayerLeaderboardStat player = leaderboard.get(position); + UUID playerUUID = player.get_playerUUID(); + String playerName = player.get_pName(); + int experience = (int) player.get_sortedStat(); + String section = skillName + "." + position; + if (!leaderBoardYAML.contains(section)) { + leaderBoardYAML.createSection(section); + } + leaderBoardYAML.set(section + ".UUID", playerUUID.toString()); + leaderBoardYAML.set(section + ".playerName", playerName); + leaderBoardYAML.set(section + ".experience", experience); + } + + public void addPlayerSkillStatsToLeaderBoardGlobal(YamlConfiguration leaderBoardYAML, + int position, ArrayList leaderboard) { + PlayerLeaderboardStat player = leaderboard.get(position); + UUID playerUUID = player.get_playerUUID(); + String playerName = player.get_pName(); + int level = (int) player.get_sortedStat(); + int totalExperience = (int) player.get_stat2(); + String section = "global" + "." + position; + if (!leaderBoardYAML.contains(section)) { + leaderBoardYAML.createSection(section); + } + leaderBoardYAML.set(section + ".UUID", playerUUID.toString()); + leaderBoardYAML.set(section + ".playerName", playerName); + leaderBoardYAML.set(section + ".level", level); + leaderBoardYAML.set(section + ".totalExperience", totalExperience); + } + + public void addPlayerSkillStatsToLeaderBoardTime(YamlConfiguration leaderBoardYAML, int position, + ArrayList leaderboard) { + PlayerLeaderboardStat player = leaderboard.get(position); + UUID playerUUID = player.get_playerUUID(); + String playerName = player.get_pName(); + long playTime = (long) player.get_sortedStat(); + String section = "playTime" + "." + position; + if (!leaderBoardYAML.contains(section)) { + leaderBoardYAML.createSection(section); + } + leaderBoardYAML.set(section + ".UUID", playerUUID.toString()); + leaderBoardYAML.set(section + ".playerName", playerName); + leaderBoardYAML.set(section + ".totalPlayTime", playTime); + } + + public Object[] loadPlayerDataFromFile(File userFile) { + PlayerFilesManager playerFilesManager = new PlayerFilesManager(); + UUID playerUUID = UUID.fromString(userFile.getName().substring(0, 36)); + File f1 = playerFilesManager.getPlayerFile(playerUUID); + YamlConfiguration playerData = YamlConfiguration.loadConfiguration(f1); + return new Object[]{playerData, playerUUID}; + } + +} diff --git a/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PeriodicSaving.java b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PeriodicSaving.java new file mode 100644 index 0000000..6dabb40 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PeriodicSaving.java @@ -0,0 +1,97 @@ +package mc.carlton.freerpg.core.serverFileManagement; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Map; +import java.util.UUID; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.core.info.player.PlayerStatsLoadIn; +import org.apache.logging.log4j.Level; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class PeriodicSaving { + + public void periodicallySaveStats() { + int secondsWait; + ConfigLoad loadConfig = new ConfigLoad(); + secondsWait = loadConfig.getSaveStatsTimer(); + if (secondsWait < 1) { + return; + } + int ticksWait = secondsWait * 20; + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + new BukkitRunnable() { + @Override + public void run() { + saveAllStats(false); + } + }.runTaskTimerAsynchronously(plugin, ticksWait, ticksWait); + } + + public void saveAllStats(boolean thoroughSave) { + if (thoroughSave) { + //A random UUID is used here for the rare occasion where we the need the full players' stats map without a player + PlayerStats playerStats = new PlayerStats(UUID.randomUUID()); + Map>> player_statsMap = playerStats.getData(); + HashSet times = new HashSet<>(); + double N = 0; + for (UUID pUUId : player_statsMap.keySet()) { + long time = System.currentTimeMillis(); + savePlayer(pUUId); + times.add(System.currentTimeMillis() - time); + N += 1.0; + } + long sum = 0; + for (long time : times) { + sum += time; + } + double avg = Math.round((sum / N) * 100) / 100.0; + FreeRPG.log(Level.INFO, "[FreeRPG] Total time Taken: " + sum + " ms"); + FreeRPG.log(Level.INFO, "[FreeRPG] Average time Taken: " + avg + " ms"); + } else { + for (Player p : Bukkit.getOnlinePlayers()) { + savePlayer(p); + } + } + RecentPlayersFileManager recentPlayersFileManager = new RecentPlayersFileManager(); + recentPlayersFileManager.writeRecentPlayers(); + LeaderBoardFilesManager leaderBoardFilesManager = new LeaderBoardFilesManager(); + leaderBoardFilesManager.writeOutPlayerLeaderBoardFile(); + PlacedBlockFileManager saveBlocks = new PlacedBlockFileManager(); + saveBlocks.writePlacedBlocks(); + } + + public void savePlayer(Player p) { + try { + PlayerStatsLoadIn loadIn = new PlayerStatsLoadIn(p); + loadIn.setPlayerStatsMap(); + } catch (IOException e) { + FreeRPG.log(Level.ERROR, "[FreeRPG] FAILED TO SAVE STATS OF PLAYER: " + p.getDisplayName()); + } + } + + public void savePlayer(UUID playerUUID) { + try { + PlayerStatsLoadIn loadIn = new PlayerStatsLoadIn(playerUUID); + loadIn.setPlayerStatsMap(isPlayerOnline(playerUUID)); + } catch (IOException e) { + FreeRPG.log(Level.ERROR, + "[FreeRPG] FAILED TO SAVE STATS OF PLAYER UUID:" + playerUUID.toString()); + } + } + + public boolean isPlayerOnline(UUID playerUUID) { + if (Bukkit.getPlayer(playerUUID) != null) { + if (Bukkit.getPlayer(playerUUID).isOnline()) { + return true; + } + } + return false; + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PlacedBlockFileManager.java b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PlacedBlockFileManager.java new file mode 100644 index 0000000..8a15360 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PlacedBlockFileManager.java @@ -0,0 +1,103 @@ +package mc.carlton.freerpg.core.serverFileManagement; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.util.HashSet; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.core.info.server.PlacedBlocksManager; +import org.apache.logging.log4j.Level; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.plugin.Plugin; + +public class PlacedBlockFileManager { + + static File placedBlocksDat; + + + public void initializePlacedBlocks() { + PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); + HashSet blocks = placedBlocksManager.getBlocks(); + File f = placedBlocksDat; + String path = f.getPath(); + if (f.exists()) { + try (BufferedReader fileReader = new BufferedReader(new FileReader(path))) { + String line = fileReader.readLine(); + while (line != null) { + String[] coords_string = line.split(","); + String worldName = coords_string[0]; + double x = Integer.parseInt(coords_string[1]); + double y = Integer.parseInt(coords_string[2]); + double z = Integer.parseInt(coords_string[3]); + World world = Bukkit.getWorld(worldName); + Location location = new Location(world, x, y, z); + blocks.add(location); + line = fileReader.readLine(); + } + placedBlocksManager.setBlocksMap(blocks); + } catch (IOException error) { + FreeRPG.log(Level.ERROR, error.getMessage()); + } + } + } + + public void writePlacedBlocks() { + File f = placedBlocksDat; + PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); + HashSet blocks = placedBlocksManager.getBlocks(); + String path = f.getPath(); + if (f.exists()) { + try (BufferedWriter fileWriter = new BufferedWriter(new FileWriter(path, false))) { + for (Location location : blocks) { + if (!location.isWorldLoaded()) { //If a world is unloaded, location.getWorld() doesn't work. Will fix later + continue; + } + World world = location.getWorld(); + if (world != null) { + String worldName = world.getName(); + String x = Integer.toString(location.getBlockX()); + String y = Integer.toString(location.getBlockY()); + String z = Integer.toString(location.getBlockZ()); + fileWriter.write(worldName + "," + x + "," + y + "," + z); + fileWriter.write("\n"); + } + } + } catch (IOException error) { + FreeRPG.log(Level.ERROR, error.getMessage()); + } + } + } + + public void initializePlacedBlocksFile() { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + File serverData = new File(plugin.getDataFolder(), File.separator + "ServerData"); + File f = new File(serverData, "blockLocations.dat"); + f.setReadable(true, false); + f.setWritable(true, false); + placedBlocksDat = f; + String path = f.getPath(); + World world = Bukkit.getServer().getWorlds().get(0); + String worldName = world.getName(); + //When BlocksPlacedData file is created for the first time... + try { + if (!f.exists()) { + f.createNewFile(); + try (FileWriter fileWriter = new FileWriter(path)) { + fileWriter.write(worldName + ",0,0,0"); + fileWriter.write("\n"); + fileWriter.write(worldName + ",1,1,1"); + } catch (IOException exception) { + exception.printStackTrace(); + } + } + } catch (IOException error) { + FreeRPG.log(Level.ERROR, error.getMessage()); + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PlayerFilesManager.java b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PlayerFilesManager.java new file mode 100644 index 0000000..c3e1777 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PlayerFilesManager.java @@ -0,0 +1,69 @@ +package mc.carlton.freerpg.core.serverFileManagement; + +import java.io.File; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import mc.carlton.freerpg.FreeRPG; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; + +public class PlayerFilesManager { + + static Map playerFiles = new ConcurrentHashMap<>(); + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + public void addPlayerFile(Player p, File file) { + UUID uuid = p.getUniqueId(); + playerFiles.put(uuid, file); + } + + public void addPlayerFile(UUID playerUUID, File file) { + playerFiles.put(playerUUID, file); + } + + public File getPlayerFile(Player p) { + UUID uuid = p.getUniqueId(); + if (playerFiles.containsKey(uuid)) { + return playerFiles.get(uuid); + } else { + return loadPlayerFile(p); + } + } + + public File getPlayerFile(UUID playerUUID) { + if (playerFiles.containsKey(playerUUID)) { + return playerFiles.get(playerUUID); + } else { + return loadPlayerFile(playerUUID); + } + } + + public File loadPlayerFile(Player p) { + return loadPlayerFile(p.getUniqueId()); + } + + public File loadPlayerFile(UUID playerUUID) { + File f = new File(plugin.getDataFolder(), + File.separator + "PlayerDatabase" + File.separator + playerUUID.toString() + ".yml"); + f.setReadable(true, false); + f.setWritable(true, false); + addPlayerFile(playerUUID, f); + return f; + } + + public void removePlayerFile(Player p) { + UUID playerUUID = p.getUniqueId(); + if (playerFiles.containsKey(playerUUID)) { + playerFiles.remove(playerUUID); + } + } + + public void removePlayerFile(UUID playerUUID) { + if (playerFiles.containsKey(playerUUID)) { + playerFiles.remove(playerUUID); + } + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PlayerStatsFilePreparation.java b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PlayerStatsFilePreparation.java new file mode 100644 index 0000000..362710f --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/PlayerStatsFilePreparation.java @@ -0,0 +1,276 @@ +package mc.carlton.freerpg.core.serverFileManagement; + +import java.io.File; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.time.Instant; +import java.util.ArrayList; +import java.util.Date; +import java.util.UUID; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import org.apache.logging.log4j.Level; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + + +public class PlayerStatsFilePreparation { + + FileConfiguration playerData; + + public void initializePlayerDataBase() { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + File userdata = new File(plugin.getDataFolder(), File.separator + "PlayerDatabase"); + if (!userdata.exists()) { + userdata.mkdir(); + } + } + + public void playJoinConditions(Player p) { + String pName = p.getName(); + UUID pUUID = p.getUniqueId(); + preparePlayerFile(pName, pUUID, true); + } + + public void preparePlayerFile(String pName, UUID playerUUID, boolean isRealLogin) { + //When player file is created for the first time... + PlayerFilesManager playerFilesManager = new PlayerFilesManager(); + File f = playerFilesManager.getPlayerFile(playerUUID); + if (!f.exists()) { + asyncCreatePlayerFile(f, pName); + } else { //If the player's file already exists + asyncUpdatePlayerFile(f, pName, isRealLogin); + } + + } + + public void addIfMissing(String key, Object value) { + if (!playerData.contains(key)) { + playerData.set(key, value); + } + } + + public void createPlayerYAML(String pName) { + //Load some file creation config + ConfigLoad loadConfig = new ConfigLoad(); + String defaultLanguage = loadConfig.getDefaultLanguage(); + ArrayList tokensInfo = loadConfig.getTokensInfo(); + ArrayList soulsInfo = loadConfig.getSoulsInfo(); + int passiveTokens0 = (int) Math.round(tokensInfo.get(4)); + int skillTokens0 = (int) Math.round(tokensInfo.get(5)); + int globalTokens0 = (int) Math.round(tokensInfo.get(6)); + int souls0 = (int) soulsInfo.get(0); + String[] labels = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + long unixTime = Instant.now().getEpochSecond(); + Date now = new Date(); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); + + //General Player information + playerData.createSection("general"); + playerData.set("general.username", pName); + playerData.set("general.firstLogin", "\"" + simpleDateFormat.format(now) + "\""); + playerData.set("general.lastLogin", unixTime); + playerData.set("general.lastLogout", unixTime); + playerData.set("general.playTime", 0); + playerData.set("general.language", defaultLanguage); + + //Global stats data + playerData.createSection("globalStats"); + playerData.set("globalStats.totalLevel", 0); + playerData.set("globalStats.globalTokens", globalTokens0); + playerData.set("globalStats.skill_1a", 0); + playerData.set("globalStats.skill_1b", 0); + playerData.set("globalStats.skill_1c", 0); + playerData.set("globalStats.skill_2a", 0); + playerData.set("globalStats.skill_2b", 0); + playerData.set("globalStats.skill_2c", 0); + playerData.set("globalStats.skill_3a", 0); + playerData.set("globalStats.skill_3b", 0); + playerData.set("globalStats.skill_3c", 0); + playerData.set("globalStats.skill_M", 0); + playerData.set("globalStats.flintToggle", 1); + playerData.set("globalStats.oreToggle", 1); + playerData.set("globalStats.speedToggle", 1); + playerData.set("globalStats.potionToggle", 1); + playerData.set("globalStats.grappleToggle", 1); + playerData.set("globalStats.hotRodToggle", 1); + playerData.set("globalStats.veinMinerToggle", 1); + playerData.set("globalStats.megaDigToggle", 1); + playerData.set("globalStats.souls", souls0); + playerData.set("globalStats.levelUpMessageToggle", 1); + playerData.set("globalStats.abilityPrepareMessageToggle", 1); + playerData.set("globalStats.personalEXPMultiplier", 1.0); + playerData.set("globalStats.triggerAbilitiesToggle", 1); + playerData.set("globalStats.showEXPBarToggle", 1); + playerData.set("globalStats.leafBlowerToggle", 1); + playerData.set("globalStats.holyAxeToggle", 1); + playerData.set("globalStats.numberOfCooldownBars", 1); + playerData.set("globalStats.totalExperience", 0); + playerData.set("globalStats.heartyToggle", 0); + + // Skill Type Data + for (int i = 0; i < labels.length; i++) { + playerData.createSection(labels[i] + ""); + playerData.set(labels[i] + ".level", 0); + playerData.set(labels[i] + ".experience", 0); + playerData.set(labels[i] + ".passiveTokens", passiveTokens0); + playerData.set(labels[i] + ".skillTokens", skillTokens0); + playerData.set(labels[i] + ".passive1", 0); + playerData.set(labels[i] + ".passive2", 0); + playerData.set(labels[i] + ".passive3", 0); + playerData.set(labels[i] + ".skill_1a", 0); + playerData.set(labels[i] + ".skill_1b", 0); + playerData.set(labels[i] + ".skill_2a", 0); + playerData.set(labels[i] + ".skill_2b", 0); + playerData.set(labels[i] + ".skill_3a", 0); + playerData.set(labels[i] + ".skill_3b", 0); + playerData.set(labels[i] + ".skill_M", 0); + playerData.set(labels[i] + ".triggerAbilityToggle", 1); + playerData.set(labels[i] + ".showEXPBarToggle", 1); + } + } + + public void updatePlayerYAML(String pName, boolean isRealLogin) { + String[] labels = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + long unixTime = Instant.now().getEpochSecond(); + Date now = new Date(); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); + //General Player information + if (!playerData.contains("general")) { + playerData.createSection("general"); + } + if (!playerData.contains("general.username")) { + playerData.set("general.username", pName); + } else { + if (isRealLogin) { + String registeredName = playerData.getString("general.username"); + if (!registeredName.equalsIgnoreCase(pName)) { + playerData.set("general.username", pName); + } + } + } + addIfMissing("general.firstLogin", "\"" + simpleDateFormat.format(now) + "\""); + + //Whether it exists or not, the last login will be set to the current unix timestamp + if (isRealLogin) { + playerData.set("general.lastLogin", unixTime); + } else { + addIfMissing("general.lastLogin", unixTime); + } + + addIfMissing("general.lastLogout", unixTime); + addIfMissing("general.playTime", 0); + + if (!playerData.contains("general.language")) { + ConfigLoad loadConfig = new ConfigLoad(); + String defaultLanguage = loadConfig.getDefaultLanguage(); + playerData.set("general.language", defaultLanguage); + } + + //Global stats data + if (!playerData.contains("globalStats")) { + playerData.createSection("globalStats"); + } + addIfMissing("globalStats.totalLevel", 0); + addIfMissing("globalStats.globalTokens", 0); + addIfMissing("globalStats.skill_1a", 0); + addIfMissing("globalStats.skill_1b", 0); + addIfMissing("globalStats.skill_1c", 0); + addIfMissing("globalStats.skill_2a", 0); + addIfMissing("globalStats.skill_2b", 0); + addIfMissing("globalStats.skill_2c", 0); + addIfMissing("globalStats.skill_3a", 0); + addIfMissing("globalStats.skill_3b", 0); + addIfMissing("globalStats.skill_3c", 0); + addIfMissing("globalStats.skill_M", 0); + addIfMissing("globalStats.flintToggle", 1); + addIfMissing("globalStats.oreToggle", 1); + addIfMissing("globalStats.speedToggle", 1); + addIfMissing("globalStats.potionToggle", 1); + addIfMissing("globalStats.grappleToggle", 1); + addIfMissing("globalStats.hotRodToggle", 1); + addIfMissing("globalStats.veinMinerToggle", 1); + addIfMissing("globalStats.megaDigToggle", 1); + addIfMissing("globalStats.souls", 0); + addIfMissing("globalStats.levelUpMessageToggle", 1); + addIfMissing("globalStats.abilityPrepareMessageToggle", 1); + addIfMissing("globalStats.personalEXPMultiplier", 1.0); + addIfMissing("globalStats.triggerAbilitiesToggle", 1); + addIfMissing("globalStats.showEXPBarToggle", 1); + addIfMissing("globalStats.leafBlowerToggle", 1); + addIfMissing("globalStats.holyAxeToggle", 1); + addIfMissing("globalStats.numberOfCooldownBars", 1); + addIfMissing("globalStats.totalExperience", 0); + addIfMissing("globalStats.heartyToggle", 0); + + // Skill Type Data + for (int i = 0; i < labels.length; i++) { + if (!playerData.contains(labels[i] + "")) { + playerData.createSection(labels[i] + ""); + } + addIfMissing(labels[i] + ".level", 0); + addIfMissing(labels[i] + ".experience", 0); + addIfMissing(labels[i] + ".passiveTokens", 0); + addIfMissing(labels[i] + ".skillTokens", 0); + addIfMissing(labels[i] + ".passive1", 0); + addIfMissing(labels[i] + ".passive2", 0); + addIfMissing(labels[i] + ".passive3", 0); + addIfMissing(labels[i] + ".skill_1a", 0); + addIfMissing(labels[i] + ".skill_1b", 0); + addIfMissing(labels[i] + ".skill_2a", 0); + addIfMissing(labels[i] + ".skill_2b", 0); + addIfMissing(labels[i] + ".skill_3a", 0); + addIfMissing(labels[i] + ".skill_3b", 0); + addIfMissing(labels[i] + ".skill_M", 0); + addIfMissing(labels[i] + ".triggerAbilityToggle", 1); + addIfMissing(labels[i] + ".showEXPBarToggle", 1); + } + } + + public void createPlayerFile(File f, String pName) { + try { + playerData = YamlConfiguration.loadConfiguration(f); + createPlayerYAML(pName); + playerData.save(f); + } catch (IOException exception) { + FreeRPG.log(Level.ERROR, exception.getMessage()); + } + } + + public void updatePlayerFile(File f, String pName, boolean isRealLogin) { + try { + playerData = YamlConfiguration.loadConfiguration(f); + updatePlayerYAML(pName, isRealLogin); + playerData.save(f); + } catch (IOException exception) { + FreeRPG.log(Level.ERROR, exception.getMessage()); + } + } + + public void asyncCreatePlayerFile(File f, String pName) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + new BukkitRunnable() { + @Override + public void run() { + createPlayerFile(f, pName); + } + }.runTaskAsynchronously(plugin); + } + + public void asyncUpdatePlayerFile(File f, String pName, boolean isRealLogin) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + new BukkitRunnable() { + @Override + public void run() { + updatePlayerFile(f, pName, isRealLogin); + } + }.runTaskAsynchronously(plugin); + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/serverFileManagement/RecentPlayersFileManager.java b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/RecentPlayersFileManager.java new file mode 100644 index 0000000..aba38fd --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/RecentPlayersFileManager.java @@ -0,0 +1,76 @@ +package mc.carlton.freerpg.core.serverFileManagement; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.UUID; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.core.info.server.RecentLogouts; +import org.apache.logging.log4j.Level; +import org.bukkit.plugin.Plugin; + +public class RecentPlayersFileManager { + + static File recentPlayersDat; + + public void initializeRecentPlayers() { + RecentLogouts recentLogouts = new RecentLogouts(); + ArrayList lastLogoutUUIDs = recentLogouts.getLastLogouts(); + File f = recentPlayersDat; + String path = f.getPath(); + if (f.exists()) { + try (BufferedReader fileReader = new BufferedReader(new FileReader(path))) { + String line = fileReader.readLine(); + while (line != null) { + UUID playerUUID = UUID.fromString(line); + lastLogoutUUIDs.add(playerUUID); + line = fileReader.readLine(); + } + recentLogouts.setLastLogouts(lastLogoutUUIDs); + } catch (IOException error) { + FreeRPG.log(Level.ERROR, error.getMessage()); + } + } + } + + public void writeRecentPlayers() { + File f = recentPlayersDat; + RecentLogouts recentLogouts = new RecentLogouts(); + ArrayList lastLogouts = (ArrayList) recentLogouts.getLastLogouts() + .clone(); //We clone here to avoid concurrent modification exception + String path = f.getPath(); + if (f.exists()) { + try (BufferedWriter fileWriter = new BufferedWriter(new FileWriter(path, false))) { + for (UUID playerUUID : lastLogouts) { + fileWriter.write(playerUUID.toString()); + fileWriter.write("\n"); + } + } catch (IOException error) { + FreeRPG.log(Level.ERROR, error.getMessage()); + } + } + } + + public void initializeRecentPlayersFile() { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + File serverData = new File(plugin.getDataFolder(), File.separator + "ServerData"); + File f = new File(serverData, "recentPlayers.dat"); + f.setReadable(true, false); + f.setWritable(true, false); + recentPlayersDat = f; + //When file is created for the first time... + try { + if (!f.exists()) { + f.createNewFile(); + } + } catch (IOException error) { + FreeRPG.log(Level.ERROR, error.getMessage()); + } + + } + +} diff --git a/src/main/java/mc/carlton/freerpg/core/serverFileManagement/ServerDataFolderPreparation.java b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/ServerDataFolderPreparation.java new file mode 100644 index 0000000..710e608 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/ServerDataFolderPreparation.java @@ -0,0 +1,29 @@ +package mc.carlton.freerpg.core.serverFileManagement; + +import java.io.File; +import java.util.Arrays; +import mc.carlton.freerpg.FreeRPG; +import org.bukkit.plugin.Plugin; +import org.bukkit.util.FileUtil; + +public class ServerDataFolderPreparation { + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + public void initializeServerDataFolder() { + File serverData = new File(plugin.getDataFolder(), File.separator + "ServerData"); + if (!serverData.exists()) { + serverData.mkdir(); + } + moveFile("blockLocations.dat", serverData); + } + + public void moveFile(String fName, File serverData) { + File f = new File(plugin.getDataFolder(), fName); + if (Arrays.asList(plugin.getDataFolder().listFiles()).contains(f)) { + File newF = new File(serverData, fName); + FileUtil.copy(f, newF); + f.delete(); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/core/serverFileManagement/YMLManager.java b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/YMLManager.java new file mode 100644 index 0000000..e734837 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/core/serverFileManagement/YMLManager.java @@ -0,0 +1,234 @@ +package mc.carlton.freerpg.core.serverFileManagement; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import mc.carlton.freerpg.FreeRPG; +import org.apache.logging.log4j.Level; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.plugin.Plugin; +import org.bukkit.util.FileUtil; + +public class YMLManager { + + public void updateCheckYML(String fileName) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + File f0 = new File(plugin.getDataFolder(), "config.yml"); + f0.setReadable(true, false); + f0.setWritable(true, false); + FileConfiguration config = YamlConfiguration.loadConfiguration(f0); + if (fileName.equalsIgnoreCase("config.yml") || fileName.equalsIgnoreCase("advancedConfig.yml") + || fileName.equalsIgnoreCase("perkConfig.yml")) { + if (config.contains("general.autoUpdateConfig")) { + if (!config.getBoolean("general.autoUpdateConfig")) { + return; + } + } + } else if (fileName.equalsIgnoreCase("languages.yml")) { + if (config.contains("general.autoUpdateLanguages")) { + if (!config.getBoolean("general.autoUpdateLanguages")) { + return; + } + } + } + File f = new File(plugin.getDataFolder(), fileName); + f.setReadable(true, false); + f.setWritable(true, false); + FileConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(f); + File f1 = inputStreamToFile(plugin.getResource(fileName), "TEMP_" + fileName); + f1.setReadable(true, false); + f1.setWritable(true, false); + FileConfiguration yamlConfigurationTrue = YamlConfiguration.loadConfiguration(f1); + if (!yamlConfiguration.getKeys(true).equals(yamlConfigurationTrue.getKeys(true))) { + if (fileName.equalsIgnoreCase("languages.yml")) { + updateLanguagesYML(fileName); + } else { + updateYML(fileName); + } + } + f1.delete(); + } + + public void storeOldFile(String fileName) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + File f = new File(plugin.getDataFolder(), fileName); + f.setReadable(true, false); + f.setWritable(true, false); + File oldLanguagesYMLFolder = new File(plugin.getDataFolder(), + File.separator + "OutdatedYMLFiles"); + if (!oldLanguagesYMLFolder.exists()) { + oldLanguagesYMLFolder.mkdir(); + } + File newF = new File(oldLanguagesYMLFolder, "OUTDATED_" + fileName); + FileUtil.copy(f, newF); + } + + public File inputStreamToFile(InputStream inputStream, String fileName) { + try { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + Path outputPath = Paths.get(plugin.getDataFolder().getPath() + "/" + fileName); + Files.copy(inputStream, outputPath, StandardCopyOption.REPLACE_EXISTING); + return new File(plugin.getDataFolder().getPath(), fileName); + } catch (IOException e) { + FreeRPG.log(Level.ERROR, e.getMessage()); + return null; + } + + } + + public ArrayList getAllLastLevelKeys(FileConfiguration configuration) { + ArrayList lastLevelKeys = new ArrayList<>(); + for (String key : configuration.getKeys(true)) { + if (configuration.getConfigurationSection(key) == null) { + lastLevelKeys.add(key); + } + } + return lastLevelKeys; + } + + public void updateLanguagesYML(String fileName) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + FreeRPG.log(Level.INFO, "[FreeRPG] " + fileName + + " keys mismatch the current version's keys. The file may be updated... "); + storeOldFile(fileName); + FreeRPG.log(Level.INFO, + "[FreeRPG] Old " + fileName + " stored in /.../FreeRPG/OutdatedYMLFiles"); + + plugin.saveResource(fileName, true); //Saves default file (with comments) + + File f = new File(plugin.getDataFolder(), fileName); + f.setReadable(true, false); + f.setWritable(true, false); + File outdatedYAML = new File(plugin.getDataFolder(), File.separator + "OutdatedYMLFiles"); + File f2 = new File(outdatedYAML, "OUTDATED_" + fileName); + f2.setReadable(true, false); + f2.setWritable(true, false); + FileConfiguration oldYAML = YamlConfiguration.loadConfiguration(f2); + File f3 = new File(plugin.getDataFolder(), "TEMP_" + fileName); + f3.setReadable(true, false); + f3.setWritable(true, false); + FileConfiguration newYAML = YamlConfiguration.loadConfiguration(f3); + boolean needToSave = false; + boolean addedLines = false; + boolean overWroteData = false; + for (String key : oldYAML.getConfigurationSection("lang") + .getKeys(false)) { //Checks all languages in the old file + if (!newYAML.contains("lang." + key) || key.equalsIgnoreCase( + "custom")) { //Checks for new languages in the old file + if (!key.equalsIgnoreCase("custom")) { //If there is a new language, add it to the new file + newYAML.createSection("lang." + key); //Creates new language section + needToSave = true; + } + for (String lastLevelKey : newYAML.getConfigurationSection("lang.enUs") + .getKeys(false)) { //For every key... + String customKey = "lang." + key + "." + lastLevelKey; + String enUsKey = "lang.enUs." + lastLevelKey; + if (oldYAML.contains(customKey)) { + newYAML.set(customKey, + oldYAML.get(customKey)); //Add the custom language's key to the new file + } else { + newYAML.set(customKey, + newYAML.get(enUsKey)); //Set the custom language's missing key to the new file + addedLines = true; + needToSave = true; + } + } + } else { //Checks other languages to see if they were changed, overwrites any changes + for (String lastLevelKey : newYAML.getConfigurationSection("lang." + key) + .getKeys(false)) { //for all language keys + String fullKey = "lang." + key + "." + lastLevelKey; + if (oldYAML.contains(fullKey)) { //if the old file has this key + if (!(oldYAML.get(fullKey).equals( + newYAML.get(fullKey)))) { //and that key is different from the resource file's key + overWroteData = true; //This line tells the plugin what to output + needToSave = true; //This line tells the plugin it must be saved over + } + } else { //If oldYAML is completely missing the key + overWroteData = true; //This line tells the plugin what to output + needToSave = true; //This line tells the plugin it must be saved over + addedLines = true; //Keys were added + } + } + } + } + + if (needToSave) { + try { + newYAML.save(f); //Changes file (comments are lost) + if (addedLines) { + FreeRPG.log(Level.INFO, "[FreeRPG] " + fileName + " updated to include new keys."); + } else { + FreeRPG.log(Level.INFO, "[FreeRPG] " + fileName + " no new keys were added."); + } + if (overWroteData) { + FreeRPG.log(Level.INFO, "[FreeRPG] Overwrote some data in " + fileName + + " (You may not edit previously defined languages)."); + } else { + FreeRPG.log(Level.INFO, "[FreeRPG] No data was overwritten in " + fileName); + } + } catch (IOException e) { + FreeRPG.log(Level.ERROR, e.getMessage()); + } + } + } + + public void updateYML(String fileName) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + FreeRPG.log(Level.INFO, + "[FreeRPG] " + fileName + " keys mismatch the current version's keys. " + + "The file may be updated... "); + storeOldFile(fileName); + FreeRPG.log(Level.INFO, + "[FreeRPG] Old " + fileName + " stored in /.../FreeRPG/OutdatedYMLFiles"); + + plugin.saveResource(fileName, true); //Saves default file (with comments) + + //Loads the new files + File f = new File(plugin.getDataFolder(), fileName); + f.setReadable(true, false); + f.setWritable(true, false); + File outdatedYAML = new File(plugin.getDataFolder(), File.separator + "OutdatedYMLFiles"); + File f2 = new File(outdatedYAML, "OUTDATED_" + fileName); + f2.setReadable(true, false); + f2.setWritable(true, false); + FileConfiguration oldYAML = YamlConfiguration.loadConfiguration(f2); + File f3 = new File(plugin.getDataFolder(), "TEMP_" + fileName); + f3.setReadable(true, false); + f3.setWritable(true, false); + FileConfiguration newYAML = YamlConfiguration.loadConfiguration(f3); + boolean changeMade = false; + ArrayList lastLevelKeys = getAllLastLevelKeys(newYAML); + for (String key : lastLevelKeys) { + if (oldYAML.contains(key) && newYAML.contains(key)) { + if (!oldYAML.get(key).equals(newYAML.get(key))) { + newYAML.set(key, + oldYAML.get(key)); //Sets the new config to whatever data was in the old config + changeMade = true; + } + } + } + + if (fileName.equalsIgnoreCase("languages.yml")) { + + } + + if (changeMade) { + try { + newYAML.save(f); //Changes file (comments are lost) + FreeRPG.log(Level.INFO, "[FreeRPG] " + fileName + " updated to include new keys."); + } catch (IOException e) { + FreeRPG.log(Level.ERROR, e.getMessage()); + } + } else { + FreeRPG.log(Level.INFO, + "[FreeRPG] " + fileName + " updated to default version successfully! " + + "(If you previously made changes to " + fileName + " this is an error)"); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/customContainers/CustomContainer.java b/src/main/java/mc/carlton/freerpg/customContainers/CustomContainer.java index d67c7c0..4b278c8 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/CustomContainer.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/CustomContainer.java @@ -3,17 +3,18 @@ import java.util.Map; public class CustomContainer { - public Map containerInformation; //We only use this in the general case - public CustomContainer( Map containerInformation){ - this.containerInformation = containerInformation; - } + public Map containerInformation; //We only use this in the general case - public void setContainerInformation(Map containerInformation) { - this.containerInformation = containerInformation; - } + public CustomContainer(Map containerInformation) { + this.containerInformation = containerInformation; + } - public Map getContainerInformation() { - return containerInformation; - } + public Map getContainerInformation() { + return containerInformation; + } + + public void setContainerInformation(Map containerInformation) { + this.containerInformation = containerInformation; + } } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/CustomContainerImporter.java b/src/main/java/mc/carlton/freerpg/customContainers/CustomContainerImporter.java index 17339bc..19eaac0 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/CustomContainerImporter.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/CustomContainerImporter.java @@ -1,11 +1,17 @@ package mc.carlton.freerpg.customContainers; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.FreeRPG; import mc.carlton.freerpg.customContainers.collections.CustomEffect; import mc.carlton.freerpg.customContainers.collections.CustomRecipe; import mc.carlton.freerpg.customContainers.collections.DropTable; import mc.carlton.freerpg.customContainers.collections.MobDropTable; -import mc.carlton.freerpg.utilities.FrpgPrint; -import mc.carlton.freerpg.utilities.UtilityMethods; +import mc.carlton.freerpg.utils.UtilityMethods; +import org.apache.logging.log4j.Level; import org.bukkit.ChatColor; import org.bukkit.Color; import org.bukkit.Material; @@ -19,791 +25,861 @@ import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionType; -import java.util.*; - /* This Class' purpose is to import information from a config node into an actually a container class (CustomItem, CustomPotion, etc...) */ public class CustomContainerImporter { - String configPath; - - /* - Error Messages to display - */ - private static final String NO_PATH = "Unknown Config Path"; - private static final String IMPROPER_CONFIG = "WARNING: Improper Config at "; - private static final String MATERIAL_NOT_FOUND = "Material not found: "; - private static final String IMPROPER_AMOUNT = "Amount cannot be less than 1 "; - private static final String DURABILITY_PARAMETERS_INVALID = "Durability Parameters Invalid"; - private static final String INVALID_DURABILITY_BOUND = "Minimum durability cannot be greater than maximum durability"; - private static final String RANDOM_ENCHANTMENT_PARAMETERS_INVALID = "Random Enchantment Parameters Invalid"; - private static final String INVALID_ENCHANTMENT_BOUNDS = "Minimum Enchantment level cannot be greater than Maximum enchantment level"; - private static final String STATIC_ENCHANTMENT_PARAMETERS_INVALID = "Static Enchantment Parameters Invalid"; - private static final String NEGATIVE_WEIGHT = "Weight Value cannot be negative"; - private static final String INVALID_PROBABILITY = "Probability value must be between 0 and 1"; - private static final String IMPROPER_DURABILITY_LIMITS = "Durability Limits cannot be less than 0"; - private static final String IMPROPER_ENCHANTMENT_LIMITS = "Enchantment Limits cannot be less than 0"; - private static final String INVALID_ENCHANTMENT = "Invalid Enchantment: "; - private static final String INVALID_ENCHANTMENT_LEVEL = "Invalid Enchantment Level: "; - private static final String INVALID_POTION_TYPE = "Invalid potion type: "; - private static final String INVALID_EFFECT_TYPE = "Invalid effect type: "; - private static final String INVALID_DURATION = "Potion Duration must be greater than 0"; - private static final String INVALID_POTION_LEVEL = "Invalid Potion Level: "; - private static final String EXPECTED_LIST = "Expected List at config node: "; - private static final String EXPECTED_LIST_OF_MAPS = "Expected List elements to be Maps/Dictionaries at config node: "; - private static final String UNKNOWN_CONFIG_LOCATION = "Unknown Config Location"; - private static final String POTION_EFFECT_TYPE_INVALID = "Potion Effect Type Parameters Invalid"; - private static final String INVALID_POTION_COLOR = "RGB values must be in the range 0 - 255"; - private static final String ITEM_TYPE_REQUIRED = "An Item Type is required for a custom item"; - private static final String POTION_EFFECT_TYPE_REQUIRED = "A Potion Effect Type is required for a custom effect"; - private static final String INVALID_DELAY = "Delay cannot be negative"; - private static final String INVALID_DURATION_MULTIPLIER = "Duration Multiplier cannot be negative"; - private static final String INVALID_RECIPE_ARRAYLIST = "Invalid Recipe Array: "; - private static final String RECIPE_REQUIRED = "Invalid Recipe Array: "; - private static final String OUTPUT_REQUIRED = "Invalid Recipe Array: "; - private static final String INVALID_ENTITY = "EntityType not found, "; - private static final String INVALID_DAMAGE_CAUSE = "DamageCause not found, "; - - /* - Acceptable keywords for expected information to be read in - */ - private static final List MATERIAL_KEYWORDS = Arrays.asList(new String[]{"item","drop"}); - private static final List AMOUNT_KEYWORDS = Arrays.asList(new String[]{"amount"}); - private static final List NANE_KEYWORDS = Arrays.asList(new String[]{"itemName","name"}); - private static final List DURABILITY_KEYWORDS = Arrays.asList(new String[]{"durability","durabilityModifier"}); - private static final List ENCHANTMENT_BOUNDS_KEYWORDS = Arrays.asList(new String[]{"randomEnchantment","enchantmentBounds"}); - private static final List ENCHANTMENTS_KEYWORDS = Arrays.asList(new String[]{"staticEnchantments","enchantments"}); - private static final List WEIGHT_KEYWORDS = Arrays.asList(new String[]{"weight"}); - private static final List PROBABILITY_KEYWORDS = Arrays.asList(new String[]{"prob","probability"}); - private static final List EXPERIENCE_KEYWORDS = Arrays.asList(new String[]{"experience","exp"}); - private static final List POTION_KEYWORDS = Arrays.asList(new String[]{"potion","potionEffect"}); - private static final List EFFECT_TYPE_KEYWORDS = Arrays.asList(new String[]{"effect","potionEffect"}); - private static final List EFFECT_LEVEL_KEYWORDS = Arrays.asList(new String[]{"level","effectLevel","potionLevel"}); - private static final List EFFECT_DURATION_KEYWORDS = Arrays.asList(new String[]{"duration","length"}); - private static final List EFFECT_DELAY_KEYWORDS = Arrays.asList(new String[]{"delay","timeDelay"}); - private static final List EFFECT_DURATION_MULTIPLIER_KEYWORDS = Arrays.asList(new String[]{"durationMultiplier","relativeDuration"}); - private static final List EFFECT_DURATION_ADDED_KEYWORDS = Arrays.asList(new String[]{"durationAdded","relativeDurationAdded"}); - private static final List RECIPE_OUTPUT_KEYWORDS = Arrays.asList(new String[]{"output","result"}); - private static final List RECIPE_RECIPE_KEYWORDS = Arrays.asList(new String[]{"recipe","craftingGrid"}); - private static final List RECIPE_XP_COST_KEYWORDS = Arrays.asList(new String[]{"xpCost","experienceCost"}); - private static final String LOWER_BOUND_KEY_WORD = "lower"; - private static final String UPPER_BOUND_KEY_WORD = "upper"; - private static final String IS_TREASURE_KEYWORD = "isTreasure"; - private static final String ENCHANTMENT_KEYWORD = "enchant"; - private static final String LEVEL_KEYWORD = "level"; - private static final String EFFECT_KEYWORD = "effect"; - private static final String DURATION_KEYWORD = "duration"; - private static final String COLOR_KEYWORD = "color"; - private static final String IS_UPGRADED_KEYWORD = "isUpgraded"; - private static final String IS_EXTENDED_KEYWORD = "isExtended"; - private static final String MOB_KEYWORD = "mob"; - private static final String OLD_DROP_KEYWORD = "oldDrop"; - private static final String NEW_DROP_KEYWORD = "newDrop"; - - public CustomContainerImporter(String configPath) { - this.configPath = configPath; - } - public CustomContainerImporter() { - this(NO_PATH); - } - - public List getDamageCauseList(Object configDamageCauseList) { - if (!(configDamageCauseList instanceof List)) { - printReadInError(); - return null; - } - ArrayList damageCauseList = new ArrayList<>(); - for (Object damageCauseString : (List) configDamageCauseList) { - EntityDamageEvent.DamageCause damageCause = UtilityMethods.matchDamageCause(damageCauseString.toString()); - if (damageCause != null) { - damageCauseList.add(damageCause); - } else { - printReadInError(INVALID_DAMAGE_CAUSE + damageCauseString); - } - } - return damageCauseList; - } - - public List getMaterialList(Object configMaterialList) { - if (!(configMaterialList instanceof List)) { - printReadInError(); - return null; - } - ArrayList materialList = new ArrayList<>(); - for (Object materialTypeString : (List) configMaterialList) { - Material material = Material.matchMaterial(materialTypeString.toString()); - if (material != null) { - materialList.add(material); - } else { - printReadInError(MATERIAL_NOT_FOUND + materialTypeString); - } - } - return materialList; - } - - public List getEntityTypeList(Object configEntityTypeList) { - if (!(configEntityTypeList instanceof List)) { - printReadInError(); - return null; - } - ArrayList entityTypeList = new ArrayList<>(); - for (Object entityTypeString : (List) configEntityTypeList) { - EntityType entityType = UtilityMethods.matchEntityType(entityTypeString.toString()); - if (entityType != null) { - entityTypeList.add(entityType); - } else { - printReadInError(INVALID_ENTITY + entityTypeString); - } - } - return entityTypeList; - } - - public Map getCustomItemMapping(Object configCustomItemMapping) { - if (!(configCustomItemMapping instanceof List)) { - printReadInError(); - return null; - } - Map customItemMap = new HashMap<>(); - for (Object configCustomItemMap : (List) configCustomItemMapping) { - if (configCustomItemMap instanceof Map) { - Map oldDropNewDropNodes = (Map) configCustomItemMapping; - if (oldDropNewDropNodes.containsKey(OLD_DROP_KEYWORD) && oldDropNewDropNodes.containsKey(NEW_DROP_KEYWORD)) { - CustomItem oldCustomItem = getCustomItem(oldDropNewDropNodes.get(OLD_DROP_KEYWORD)); - CustomItem newCustomItem = getCustomItem(oldDropNewDropNodes.get(NEW_DROP_KEYWORD)); - if (oldCustomItem != null && newCustomItem != null) { - customItemMap.put(oldCustomItem,newCustomItem); - } else { - printReadInError(); - } - } else { - printReadInError(); - } - } else { - printReadInError(); - } - } - return customItemMap; - } - - public List getPotionDataList(Object configPotionDataList) { - if (!(configPotionDataList instanceof List)) { - printReadInError(); - return null; - } - ArrayList potionDataList = new ArrayList<>(); - for (Object configPotionDataRow : (List) configPotionDataList) { - Map potionDataRow = convertListedTableRowToMap(configPotionDataRow); - PotionData potionData = null; - if (potionDataRow.containsKey(EFFECT_KEYWORD) && potionDataRow.containsKey(IS_EXTENDED_KEYWORD)) { - potionData = new PotionData(UtilityMethods.matchPotionType(potionDataRow.get(EFFECT_KEYWORD).toString()), Boolean.valueOf(potionDataRow.get(IS_EXTENDED_KEYWORD).toString()),false); - } - else if (potionDataRow.containsKey(EFFECT_KEYWORD) && potionDataRow.containsKey(IS_EXTENDED_KEYWORD)) { - potionData = new PotionData(UtilityMethods.matchPotionType(potionDataRow.get(EFFECT_KEYWORD).toString()), false,Boolean.valueOf(potionDataRow.get(IS_UPGRADED_KEYWORD).toString())); - } - if (potionData != null) { - potionDataList.add(potionData); - } - } - return potionDataList; - - - } - - public CustomPotion getCustomPotion(Object configPotionInformation) { - if (!(configPotionInformation instanceof List)) { - printReadInError(); - return null; - } - Map itemInformation = convertListedTableRowToMap(configPotionInformation); - CustomPotion customPotion = new CustomPotion(itemInformation); - constructCustomItem(customPotion,itemInformation); - return customPotion; - } - - public MobDropTable getMobDropTable(Object configMobDropTable) { - if (!(configMobDropTable instanceof List)) { - printReadInError(); - return null; - } - MobDropTable mobdropTable = new MobDropTable(); - for (Object configRow : (List) configMobDropTable) { - CustomItem dropTableItem = getCustomItem(configRow); - if (dropTableItem != null) { - Map row = convertListedTableRowToMap(configRow); - if (row.containsKey(MOB_KEYWORD)) { - EntityType entityType = UtilityMethods.matchEntityType(row.get(MOB_KEYWORD).toString()); - if (entityType != null) { - mobdropTable.addDropToMob(entityType,dropTableItem); - } - } - } - } - return mobdropTable; - } - public DropTable getDropTable(Object configDropTable) { - if (!(configDropTable instanceof List)) { + /* + Error Messages to display + */ + private static final String NO_PATH = "Unknown Config Path"; + private static final String IMPROPER_CONFIG = "WARNING: Improper Config at "; + private static final String MATERIAL_NOT_FOUND = "Material not found: "; + private static final String IMPROPER_AMOUNT = "Amount cannot be less than 1 "; + private static final String DURABILITY_PARAMETERS_INVALID = "Durability Parameters Invalid"; + private static final String INVALID_DURABILITY_BOUND = "Minimum durability cannot be greater than maximum durability"; + private static final String RANDOM_ENCHANTMENT_PARAMETERS_INVALID = "Random Enchantment Parameters Invalid"; + private static final String INVALID_ENCHANTMENT_BOUNDS = "Minimum Enchantment level cannot be greater than Maximum enchantment level"; + private static final String STATIC_ENCHANTMENT_PARAMETERS_INVALID = "Static Enchantment Parameters Invalid"; + private static final String NEGATIVE_WEIGHT = "Weight Value cannot be negative"; + private static final String INVALID_PROBABILITY = "Probability value must be between 0 and 1"; + private static final String IMPROPER_DURABILITY_LIMITS = "Durability Limits cannot be less than 0"; + private static final String IMPROPER_ENCHANTMENT_LIMITS = "Enchantment Limits cannot be less than 0"; + private static final String INVALID_ENCHANTMENT = "Invalid Enchantment: "; + private static final String INVALID_ENCHANTMENT_LEVEL = "Invalid Enchantment Level: "; + private static final String INVALID_POTION_TYPE = "Invalid potion type: "; + private static final String INVALID_EFFECT_TYPE = "Invalid effect type: "; + private static final String INVALID_DURATION = "Potion Duration must be greater than 0"; + private static final String INVALID_POTION_LEVEL = "Invalid Potion Level: "; + private static final String EXPECTED_LIST = "Expected List at config node: "; + private static final String EXPECTED_LIST_OF_MAPS = "Expected List elements to be Maps/Dictionaries at config node: "; + private static final String UNKNOWN_CONFIG_LOCATION = "Unknown Config Location"; + private static final String POTION_EFFECT_TYPE_INVALID = "Potion Effect Type Parameters Invalid"; + private static final String INVALID_POTION_COLOR = "RGB values must be in the range 0 - 255"; + private static final String ITEM_TYPE_REQUIRED = "An Item Type is required for a custom item"; + private static final String POTION_EFFECT_TYPE_REQUIRED = "A Potion Effect Type is required for a custom effect"; + private static final String INVALID_DELAY = "Delay cannot be negative"; + private static final String INVALID_DURATION_MULTIPLIER = "Duration Multiplier cannot be negative"; + private static final String INVALID_RECIPE_ARRAYLIST = "Invalid Recipe Array: "; + private static final String RECIPE_REQUIRED = "Invalid Recipe Array: "; + private static final String OUTPUT_REQUIRED = "Invalid Recipe Array: "; + private static final String INVALID_ENTITY = "EntityType not found, "; + private static final String INVALID_DAMAGE_CAUSE = "DamageCause not found, "; + /* + Acceptable keywords for expected information to be read in + */ + private static final List MATERIAL_KEYWORDS = Arrays.asList(new String[]{"item", "drop"}); + private static final List AMOUNT_KEYWORDS = Arrays.asList(new String[]{"amount"}); + private static final List NANE_KEYWORDS = Arrays.asList(new String[]{"itemName", "name"}); + private static final List DURABILITY_KEYWORDS = Arrays.asList( + new String[]{"durability", "durabilityModifier"}); + private static final List ENCHANTMENT_BOUNDS_KEYWORDS = Arrays.asList( + new String[]{"randomEnchantment", "enchantmentBounds"}); + private static final List ENCHANTMENTS_KEYWORDS = Arrays.asList( + new String[]{"staticEnchantments", "enchantments"}); + private static final List WEIGHT_KEYWORDS = Arrays.asList(new String[]{"weight"}); + private static final List PROBABILITY_KEYWORDS = Arrays.asList( + new String[]{"prob", "probability"}); + private static final List EXPERIENCE_KEYWORDS = Arrays.asList( + new String[]{"experience", "exp"}); + private static final List POTION_KEYWORDS = Arrays.asList( + new String[]{"potion", "potionEffect"}); + private static final List EFFECT_TYPE_KEYWORDS = Arrays.asList( + new String[]{"effect", "potionEffect"}); + private static final List EFFECT_LEVEL_KEYWORDS = Arrays.asList( + new String[]{"level", "effectLevel", "potionLevel"}); + private static final List EFFECT_DURATION_KEYWORDS = Arrays.asList( + new String[]{"duration", "length"}); + private static final List EFFECT_DELAY_KEYWORDS = Arrays.asList( + new String[]{"delay", "timeDelay"}); + private static final List EFFECT_DURATION_MULTIPLIER_KEYWORDS = Arrays.asList( + new String[]{"durationMultiplier", "relativeDuration"}); + private static final List EFFECT_DURATION_ADDED_KEYWORDS = Arrays.asList( + new String[]{"durationAdded", "relativeDurationAdded"}); + private static final List RECIPE_OUTPUT_KEYWORDS = Arrays.asList( + new String[]{"output", "result"}); + private static final List RECIPE_RECIPE_KEYWORDS = Arrays.asList( + new String[]{"recipe", "craftingGrid"}); + private static final List RECIPE_XP_COST_KEYWORDS = Arrays.asList( + new String[]{"xpCost", "experienceCost"}); + private static final String LOWER_BOUND_KEY_WORD = "lower"; + private static final String UPPER_BOUND_KEY_WORD = "upper"; + private static final String IS_TREASURE_KEYWORD = "isTreasure"; + private static final String ENCHANTMENT_KEYWORD = "enchant"; + private static final String LEVEL_KEYWORD = "level"; + private static final String EFFECT_KEYWORD = "effect"; + private static final String DURATION_KEYWORD = "duration"; + private static final String COLOR_KEYWORD = "color"; + private static final String IS_UPGRADED_KEYWORD = "isUpgraded"; + private static final String IS_EXTENDED_KEYWORD = "isExtended"; + private static final String MOB_KEYWORD = "mob"; + private static final String OLD_DROP_KEYWORD = "oldDrop"; + private static final String NEW_DROP_KEYWORD = "newDrop"; + String configPath; + + public CustomContainerImporter(String configPath) { + this.configPath = configPath; + } + + public CustomContainerImporter() { + this(NO_PATH); + } + + public List getDamageCauseList(Object configDamageCauseList) { + if (!(configDamageCauseList instanceof List)) { + printReadInError(); + return null; + } + ArrayList damageCauseList = new ArrayList<>(); + for (Object damageCauseString : (List) configDamageCauseList) { + EntityDamageEvent.DamageCause damageCause = UtilityMethods.matchDamageCause( + damageCauseString.toString()); + if (damageCause != null) { + damageCauseList.add(damageCause); + } else { + printReadInError(INVALID_DAMAGE_CAUSE + damageCauseString); + } + } + return damageCauseList; + } + + public List getMaterialList(Object configMaterialList) { + if (!(configMaterialList instanceof List)) { + printReadInError(); + return null; + } + ArrayList materialList = new ArrayList<>(); + for (Object materialTypeString : (List) configMaterialList) { + Material material = Material.matchMaterial(materialTypeString.toString()); + if (material != null) { + materialList.add(material); + } else { + printReadInError(MATERIAL_NOT_FOUND + materialTypeString); + } + } + return materialList; + } + + public List getEntityTypeList(Object configEntityTypeList) { + if (!(configEntityTypeList instanceof List)) { + printReadInError(); + return null; + } + ArrayList entityTypeList = new ArrayList<>(); + for (Object entityTypeString : (List) configEntityTypeList) { + EntityType entityType = UtilityMethods.matchEntityType(entityTypeString.toString()); + if (entityType != null) { + entityTypeList.add(entityType); + } else { + printReadInError(INVALID_ENTITY + entityTypeString); + } + } + return entityTypeList; + } + + public Map getCustomItemMapping(Object configCustomItemMapping) { + if (!(configCustomItemMapping instanceof List)) { + printReadInError(); + return null; + } + Map customItemMap = new HashMap<>(); + for (Object configCustomItemMap : (List) configCustomItemMapping) { + if (configCustomItemMap instanceof Map) { + Map oldDropNewDropNodes = (Map) configCustomItemMapping; + if (oldDropNewDropNodes.containsKey(OLD_DROP_KEYWORD) && oldDropNewDropNodes.containsKey( + NEW_DROP_KEYWORD)) { + CustomItem oldCustomItem = getCustomItem(oldDropNewDropNodes.get(OLD_DROP_KEYWORD)); + CustomItem newCustomItem = getCustomItem(oldDropNewDropNodes.get(NEW_DROP_KEYWORD)); + if (oldCustomItem != null && newCustomItem != null) { + customItemMap.put(oldCustomItem, newCustomItem); + } else { printReadInError(); - return null; - } - ArrayList dropTableList = new ArrayList<>(); - for (Object configItem : (List) configDropTable) { - CustomItem dropTableItem = getCustomItem(configItem); - if (dropTableItem != null) { - dropTableList.add(dropTableItem); - } - } - return new DropTable(dropTableList); - } - - public List getCustomRecipeList(Object configRecipes, String newRecipesBaseId) { - if (!(configRecipes instanceof List)) { - printReadInError(); - return null; - } - ArrayList customRecipes = new ArrayList<>(); - List configRecipesList = (List) configRecipes; - for (int i = 0; i < configRecipesList.size(); i++) { - CustomRecipe newRecipe = getCustomRecipe(configRecipesList.get(i),newRecipesBaseId+UtilityMethods.toAlphabetic(i)); - if (newRecipe != null) { - customRecipes.add(newRecipe); - } - } - return customRecipes; - } - - public CustomRecipe getCustomRecipe(Object configRecipe, String newRecipeId) { - if (!(configRecipe instanceof Map)) { - printReadInError(); - return null; - } - Map recipeInformation = new HashMap<>(); - for (Object object : ((Map) configRecipe).keySet()) { - recipeInformation.put(object.toString(),((Map) configRecipe).get(object)); - } - CustomItem output = null; - ArrayList recipe = null; - Integer xpCost = 0; - for (String key : recipeInformation.keySet()) { - if (UtilityMethods.stringCollectionContainsIgnoreCase(RECIPE_OUTPUT_KEYWORDS,key)) { - output = getCustomItem(recipeInformation.get(key)); - } - if (UtilityMethods.stringCollectionContainsIgnoreCase(RECIPE_RECIPE_KEYWORDS,key)) { - recipe = getRecipeArrayList(recipeInformation.get(key)); - } - if (UtilityMethods.stringCollectionContainsIgnoreCase(RECIPE_XP_COST_KEYWORDS,key)) { - xpCost = Integer.valueOf(recipeInformation.get(key).toString()); - } - } - if (output == null) { - printReadInError(OUTPUT_REQUIRED); - return null; - } - if (recipe == null) { - printReadInError(RECIPE_REQUIRED); - return null; - } - return new CustomRecipe(recipe,output.getItemStack(),xpCost,newRecipeId); - } - - public CustomItem getCustomItem(Object configItem) { - if (!(configItem instanceof List)) { - printReadInError(); - return null; - } - Map itemInformation = convertListedTableRowToMap(configItem); - Material material = null; - for (String key : itemInformation.keySet()) { - if (UtilityMethods.stringCollectionContainsIgnoreCase(MATERIAL_KEYWORDS,key)) { - material = getMaterial(itemInformation.get(key)); - break; - } - } - if (material == null) { - printReadInError(ITEM_TYPE_REQUIRED); - return null; - } - if (material.equals(Material.POTION)) { - CustomPotion customPotion = new CustomPotion(itemInformation); - constructCustomItem(customPotion,itemInformation); - return customPotion; + } } else { - CustomItem customItem = new CustomItem(material,itemInformation); - constructCustomItem(customItem,itemInformation); - return customItem; - } - } - - public CustomEffect getCustomEffect(Object configEffect) { - if (!(configEffect instanceof List)) { - printReadInError(); - return null; - } - CustomEffect customEffect = new CustomEffect(); - for (Object configEffectPiece : (List) configEffect) { - CustomEffectPiece customEffectPiece = getCustomEffectPiece(configEffectPiece); - if (customEffectPiece != null) { - customEffect.addEffect(customEffectPiece); - } - } - return customEffect; - } - - public CustomEffectPiece getCustomEffectPiece(Object configEffect) { - if (!(configEffect instanceof List)) { - printReadInError(); - return null; - } - Map effectInformation = convertListedTableRowToMap(configEffect); - PotionEffectType potionEffectType = null; - for (String key : effectInformation.keySet()) { - if (UtilityMethods.stringCollectionContainsIgnoreCase(EFFECT_TYPE_KEYWORDS,key)) { - potionEffectType = getEffectType(effectInformation.get(key)); - break; - } - } - if (potionEffectType == null) { - printReadInError(POTION_EFFECT_TYPE_REQUIRED); - return null; - } - CustomEffectPiece customEffect = new CustomEffectPiece(potionEffectType); - constructCustomEffect(customEffect,effectInformation); - return customEffect; - } - - private void constructCustomItem(CustomItem customItem, Map itemInformation) { - for (String key : itemInformation.keySet()) { - Object value = itemInformation.get(key); - assignCustomItemValue(customItem,value, key); - } - } - - private void constructCustomItem(CustomPotion customPotion, Map itemInformation) { - for (String key : itemInformation.keySet()) { - Object value = itemInformation.get(key); - assignCustomItemValue(customPotion,value, key); - assignCustomPotionValues(customPotion,value, key); - } - } - - private void constructCustomEffect(CustomEffectPiece customEffect, Map effectInformation) { - for (String key : effectInformation.keySet()) { - Object value = effectInformation.get(key); - assignCustomEffectValue(customEffect,value, key); - } - } - - private void assignCustomItemValue(CustomItem customItemContainer, Object value, String mapKey) { - if (UtilityMethods.stringCollectionContainsIgnoreCase(AMOUNT_KEYWORDS,mapKey)) { - Integer amount = Integer.valueOf(value.toString()); - if ( amount < 0) { - printReadInError(IMPROPER_AMOUNT + amount); - return; - } - customItemContainer.setAmount(amount); - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(DURABILITY_KEYWORDS,mapKey)) { - Map durabilityInfo = getMap(value); - if (durabilityInfo == null) { - return; - } - //Get lower and upper bound doubles - boolean lowerBoundPresent = UtilityMethods.stringCollectionContainsIgnoreCase(durabilityInfo.keySet(), LOWER_BOUND_KEY_WORD); - boolean upperBoundPresent = UtilityMethods.stringCollectionContainsIgnoreCase(durabilityInfo.keySet(), UPPER_BOUND_KEY_WORD); - if (!lowerBoundPresent && !upperBoundPresent) { - printReadInError(DURABILITY_PARAMETERS_INVALID); - } - double lowerBound = (lowerBoundPresent) ? Double.valueOf(durabilityInfo.get(LOWER_BOUND_KEY_WORD).toString()) : 1.0; - double upperBound = (upperBoundPresent) ? Double.valueOf(durabilityInfo.get(UPPER_BOUND_KEY_WORD).toString()) : 1.0; - if (lowerBound > upperBound) { - printReadInError(INVALID_DURABILITY_BOUND); - lowerBound = upperBound; - } - if (lowerBound < 0 || upperBound < 0 ) { - printReadInError(IMPROPER_DURABILITY_LIMITS); - return; - } - customItemContainer.setDurabilityRange(lowerBound,upperBound); - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(ENCHANTMENT_BOUNDS_KEYWORDS,mapKey)) { - Map enchantmentInfo = getMap(value); - if (enchantmentInfo == null) { - return; - } - //Get lower and upper bound doubles - boolean lowerBoundPresent = UtilityMethods.stringCollectionContainsIgnoreCase(enchantmentInfo.keySet(), LOWER_BOUND_KEY_WORD); - boolean upperBoundPresent = UtilityMethods.stringCollectionContainsIgnoreCase(enchantmentInfo.keySet(), UPPER_BOUND_KEY_WORD); - boolean isTreasurePresent = UtilityMethods.stringCollectionContainsIgnoreCase(enchantmentInfo.keySet(), IS_TREASURE_KEYWORD); - if (!lowerBoundPresent && !upperBoundPresent && !isTreasurePresent) { - printReadInError(RANDOM_ENCHANTMENT_PARAMETERS_INVALID); - } - int lowerBound = (lowerBoundPresent) ? Integer.valueOf(enchantmentInfo.get(LOWER_BOUND_KEY_WORD).toString()) : 0; - int upperBound = (upperBoundPresent) ? Integer.valueOf(enchantmentInfo.get(UPPER_BOUND_KEY_WORD).toString()) : 0; - boolean isTreasure = (isTreasurePresent) ? Boolean.valueOf(enchantmentInfo.get(IS_TREASURE_KEYWORD).toString()) : true; - if (lowerBound > upperBound) { - printReadInError(INVALID_ENCHANTMENT_BOUNDS); - lowerBound = upperBound; - } - if (lowerBound < 0 || upperBound < 0 ) { - printReadInError(IMPROPER_ENCHANTMENT_LIMITS); - return; - } - customItemContainer.setEnchantmentLevelRange(lowerBound,upperBound); - customItemContainer.setTreasure(isTreasure); - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(ENCHANTMENTS_KEYWORDS,mapKey)) { - List enchantmentsListUnParsed = getList(value); - if (enchantmentsListUnParsed == null) { - return; - } - List> enchantmentsList = getConfigTableInformation(enchantmentsListUnParsed); - if (enchantmentsList == null) { - return; - } - for (Map enchantmentInfo : enchantmentsList) { - Enchantment enchantment = (UtilityMethods.stringCollectionContainsIgnoreCase(enchantmentInfo.keySet(), ENCHANTMENT_KEYWORD)) ? getEnchantment(enchantmentInfo.get(ENCHANTMENT_KEYWORD)) : null; - if (enchantment == null) { - printReadInError(STATIC_ENCHANTMENT_PARAMETERS_INVALID); - continue; - } - int level = (UtilityMethods.stringCollectionContainsIgnoreCase(enchantmentInfo.keySet(), LEVEL_KEYWORD)) ? Integer.valueOf(enchantmentInfo.get(LEVEL_KEYWORD).toString()) : 1; - if (level < 0) { - printReadInError(INVALID_ENCHANTMENT_LEVEL + level); - level = 1; - } - customItemContainer.addEnchantment(enchantment,level); - } - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(WEIGHT_KEYWORDS,mapKey)) { - Double weight = Double.valueOf(value.toString()); - if ( weight < 0) { - printReadInError(NEGATIVE_WEIGHT); - return; - } - customItemContainer.setWeight(weight); - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(PROBABILITY_KEYWORDS,mapKey)) { - Double prob = Double.valueOf(value.toString()); - if ( prob < 0 || prob > 1) { - printReadInError(INVALID_PROBABILITY); - return; - } - customItemContainer.setProbability(prob); - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(EXPERIENCE_KEYWORDS,mapKey)) { - Integer exp = Integer.valueOf(value.toString()); - customItemContainer.setAmount(exp); - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(NANE_KEYWORDS,mapKey)) { - String name = ChatColor.translateAlternateColorCodes('&', String.valueOf(mapKey)); - customItemContainer.setItemName(name); - } - } - - private void assignCustomPotionValues(CustomPotion customPotionContainer, Object value, String mapKey) { - if (UtilityMethods.stringCollectionContainsIgnoreCase(POTION_KEYWORDS,mapKey)) { - Map minecraftPotionInfo = getMap(value,true); - - if (minecraftPotionInfo == null) { //Custom Potion Case - List customEffectInfoUnParsed = getList(value); - if (customEffectInfoUnParsed == null) { - return; - } - List> customEffectInfoList = getConfigTableInformation(customEffectInfoUnParsed); - if (customEffectInfoList == null) { - return; - } - - //Custom Effect Case - for (Map customEffectInfo : customEffectInfoList) { - boolean effectPresent = UtilityMethods.stringCollectionContainsIgnoreCase(customEffectInfo.keySet(), EFFECT_KEYWORD); - boolean durationPresent = UtilityMethods.stringCollectionContainsIgnoreCase(customEffectInfo.keySet(), DURATION_KEYWORD); - boolean levelPresent = UtilityMethods.stringCollectionContainsIgnoreCase(customEffectInfo.keySet(), LEVEL_KEYWORD); - boolean colorPresent = UtilityMethods.stringCollectionContainsIgnoreCase(customEffectInfo.keySet(), COLOR_KEYWORD); - - PotionEffectType effectType = (effectPresent) ? getEffectType(customEffectInfo.get(EFFECT_KEYWORD)) : null; - Double duration = (durationPresent) ? Double.valueOf(customEffectInfo.get(DURATION_KEYWORD).toString()) : 0.0; - Integer level = (levelPresent) ? Integer.valueOf(customEffectInfo.get(LEVEL_KEYWORD).toString()) : 1; - Color color = (colorPresent) ? getPotionColor(customEffectInfo.get(COLOR_KEYWORD).toString()) : null; - - if (effectType == null) { - printReadInError(POTION_EFFECT_TYPE_INVALID); - continue; - } - if (duration < 0) { - printReadInError(INVALID_DURATION); - duration = 0.0; - } - if (level < 0) { - printReadInError(INVALID_POTION_LEVEL + level); - level = 1; - } - if (color != null) { - customPotionContainer.addColor(color); - } - customPotionContainer.addPotionEffect(effectType,duration,level); - } - return; - } else { //Vanilla Potion Case - boolean effectPresent = UtilityMethods.stringCollectionContainsIgnoreCase(minecraftPotionInfo.keySet(), EFFECT_KEYWORD); - boolean isUpgradedPresent = UtilityMethods.stringCollectionContainsIgnoreCase(minecraftPotionInfo.keySet(), IS_UPGRADED_KEYWORD); - boolean isExtendedPresent = UtilityMethods.stringCollectionContainsIgnoreCase(minecraftPotionInfo.keySet(), IS_EXTENDED_KEYWORD); - - PotionType effectType = (effectPresent) ? getPotionType(minecraftPotionInfo.get(EFFECT_KEYWORD)) : null; - boolean isUpgraded = (isUpgradedPresent) ? Boolean.valueOf(minecraftPotionInfo.get(IS_UPGRADED_KEYWORD).toString()) : false; - boolean isExtended = (isExtendedPresent) ? Boolean.valueOf(minecraftPotionInfo.get(IS_EXTENDED_KEYWORD).toString()) : false; - customPotionContainer.setPotion(effectType, isUpgraded, isExtended); - } - } - } - - private void assignCustomEffectValue(CustomEffectPiece customEffect, Object value, String mapKey) { - if (UtilityMethods.stringCollectionContainsIgnoreCase(EFFECT_LEVEL_KEYWORDS,mapKey)) { - Integer level = Integer.valueOf(value.toString()); - if (level < 1) { - printReadInError(INVALID_POTION_LEVEL + level); - return; - } - customEffect.setLevel(level); - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(EFFECT_DURATION_KEYWORDS,mapKey)) { - Double duration = Double.valueOf(value.toString()); - if (duration < 0) { - printReadInError(INVALID_DURATION + duration); - return; - } - customEffect.setDuration(duration); - - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(EFFECT_DELAY_KEYWORDS,mapKey)) { - Double delay = Double.valueOf(value.toString()); - if (delay < 0) { - printReadInError(INVALID_DELAY + delay); - return; - } - customEffect.setDelay(delay); - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(PROBABILITY_KEYWORDS,mapKey)) { - Double prob = Double.valueOf(value.toString()); - if (prob < 0 || prob > 1) { - printReadInError(INVALID_PROBABILITY + prob); - return; - } - customEffect.setProbability(prob); - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(EFFECT_DURATION_MULTIPLIER_KEYWORDS,mapKey)) { - Double durationMultiplier = Double.valueOf(value.toString()); - if (durationMultiplier < 0) { - printReadInError(INVALID_DURATION_MULTIPLIER + durationMultiplier); - return; - } - customEffect.setRelativeDurationMultiplier(durationMultiplier); - } else if (UtilityMethods.stringCollectionContainsIgnoreCase(EFFECT_DURATION_ADDED_KEYWORDS,mapKey)) { - Double durationAdded = Double.valueOf(value.toString()); - customEffect.setRelativeDurationAdded(durationAdded); - } - } - - private Material getMaterial(Object value) { - Material material = Material.getMaterial(value.toString()); - if (material == null) { - printReadInError(MATERIAL_NOT_FOUND + value.toString()); - } - return material; - } - - private ArrayList getRecipeArrayList(Object value) { - if (!(value instanceof List)) { - printReadInError(INVALID_RECIPE_ARRAYLIST + value.toString()); - return null; - } - List valueList = (List) value; - if (valueList.size() != 9) { - printReadInError(INVALID_RECIPE_ARRAYLIST + value.toString()); - return null; - } - ArrayList recipe = new ArrayList<>(); - for (Object materialObject : valueList) { - recipe.add(getMaterial(materialObject)); - } - for (int i = 0; i < recipe.size(); i++) { - if (recipe.get(i) == null) { - recipe.set(i,Material.AIR); - } - } - return recipe; - } - - private Map getMap(Object value) { - return getMap(value,false); - } - - private Map getMap(Object value, boolean silent) { - if (!(value instanceof Map)) { - if (!silent) { - printReadInError(); - } - return null; - } - for (Object object : ((Map) value).keySet()) { - if (!(object instanceof String)) { - if (!silent) { - printReadInError(); - } - return null; - } - } - return (Map) value; - } - - private List getList(Object value) { - if (!(value instanceof List)) { - printReadInError(); - return null; - } - return (List) value; - } - - private Enchantment getEnchantment(Object value) { - Enchantment enchantment = EnchantmentWrapper.getByKey(NamespacedKey.minecraft(value.toString().toLowerCase())); + printReadInError(); + } + } else { + printReadInError(); + } + } + return customItemMap; + } + + public List getPotionDataList(Object configPotionDataList) { + if (!(configPotionDataList instanceof List)) { + printReadInError(); + return null; + } + ArrayList potionDataList = new ArrayList<>(); + for (Object configPotionDataRow : (List) configPotionDataList) { + Map potionDataRow = convertListedTableRowToMap(configPotionDataRow); + PotionData potionData = null; + if (potionDataRow.containsKey(EFFECT_KEYWORD) && potionDataRow.containsKey( + IS_EXTENDED_KEYWORD)) { + potionData = new PotionData( + UtilityMethods.matchPotionType(potionDataRow.get(EFFECT_KEYWORD).toString()), + Boolean.valueOf(potionDataRow.get(IS_EXTENDED_KEYWORD).toString()), false); + } else if (potionDataRow.containsKey(EFFECT_KEYWORD) && potionDataRow.containsKey( + IS_EXTENDED_KEYWORD)) { + potionData = new PotionData( + UtilityMethods.matchPotionType(potionDataRow.get(EFFECT_KEYWORD).toString()), false, + Boolean.valueOf(potionDataRow.get(IS_UPGRADED_KEYWORD).toString())); + } + if (potionData != null) { + potionDataList.add(potionData); + } + } + return potionDataList; + + + } + + public CustomPotion getCustomPotion(Object configPotionInformation) { + if (!(configPotionInformation instanceof List)) { + printReadInError(); + return null; + } + Map itemInformation = convertListedTableRowToMap(configPotionInformation); + CustomPotion customPotion = new CustomPotion(itemInformation); + constructCustomItem(customPotion, itemInformation); + return customPotion; + } + + public MobDropTable getMobDropTable(Object configMobDropTable) { + if (!(configMobDropTable instanceof List)) { + printReadInError(); + return null; + } + MobDropTable mobdropTable = new MobDropTable(); + for (Object configRow : (List) configMobDropTable) { + CustomItem dropTableItem = getCustomItem(configRow); + if (dropTableItem != null) { + Map row = convertListedTableRowToMap(configRow); + if (row.containsKey(MOB_KEYWORD)) { + EntityType entityType = UtilityMethods.matchEntityType(row.get(MOB_KEYWORD).toString()); + if (entityType != null) { + mobdropTable.addDropToMob(entityType, dropTableItem); + } + } + } + } + return mobdropTable; + } + + public DropTable getDropTable(Object configDropTable) { + if (!(configDropTable instanceof List)) { + printReadInError(); + return null; + } + ArrayList dropTableList = new ArrayList<>(); + for (Object configItem : (List) configDropTable) { + CustomItem dropTableItem = getCustomItem(configItem); + if (dropTableItem != null) { + dropTableList.add(dropTableItem); + } + } + return new DropTable(dropTableList); + } + + public List getCustomRecipeList(Object configRecipes, String newRecipesBaseId) { + if (!(configRecipes instanceof List)) { + printReadInError(); + return null; + } + ArrayList customRecipes = new ArrayList<>(); + List configRecipesList = (List) configRecipes; + for (int i = 0; i < configRecipesList.size(); i++) { + CustomRecipe newRecipe = getCustomRecipe(configRecipesList.get(i), + newRecipesBaseId + UtilityMethods.toAlphabetic(i)); + if (newRecipe != null) { + customRecipes.add(newRecipe); + } + } + return customRecipes; + } + + public CustomRecipe getCustomRecipe(Object configRecipe, String newRecipeId) { + if (!(configRecipe instanceof Map)) { + printReadInError(); + return null; + } + Map recipeInformation = new HashMap<>(); + for (Object object : ((Map) configRecipe).keySet()) { + recipeInformation.put(object.toString(), ((Map) configRecipe).get(object)); + } + CustomItem output = null; + ArrayList recipe = null; + Integer xpCost = 0; + for (String key : recipeInformation.keySet()) { + if (UtilityMethods.stringCollectionContainsIgnoreCase(RECIPE_OUTPUT_KEYWORDS, key)) { + output = getCustomItem(recipeInformation.get(key)); + } + if (UtilityMethods.stringCollectionContainsIgnoreCase(RECIPE_RECIPE_KEYWORDS, key)) { + recipe = getRecipeArrayList(recipeInformation.get(key)); + } + if (UtilityMethods.stringCollectionContainsIgnoreCase(RECIPE_XP_COST_KEYWORDS, key)) { + xpCost = Integer.valueOf(recipeInformation.get(key).toString()); + } + } + if (output == null) { + printReadInError(OUTPUT_REQUIRED); + return null; + } + if (recipe == null) { + printReadInError(RECIPE_REQUIRED); + return null; + } + return new CustomRecipe(recipe, output.getItemStack(), xpCost, newRecipeId); + } + + public CustomItem getCustomItem(Object configItem) { + if (!(configItem instanceof List)) { + printReadInError(); + return null; + } + Map itemInformation = convertListedTableRowToMap(configItem); + Material material = null; + for (String key : itemInformation.keySet()) { + if (UtilityMethods.stringCollectionContainsIgnoreCase(MATERIAL_KEYWORDS, key)) { + material = getMaterial(itemInformation.get(key)); + break; + } + } + if (material == null) { + printReadInError(ITEM_TYPE_REQUIRED); + return null; + } + if (material.equals(Material.POTION)) { + CustomPotion customPotion = new CustomPotion(itemInformation); + constructCustomItem(customPotion, itemInformation); + return customPotion; + } else { + CustomItem customItem = new CustomItem(material, itemInformation); + constructCustomItem(customItem, itemInformation); + return customItem; + } + } + + public CustomEffect getCustomEffect(Object configEffect) { + if (!(configEffect instanceof List)) { + printReadInError(); + return null; + } + CustomEffect customEffect = new CustomEffect(); + for (Object configEffectPiece : (List) configEffect) { + CustomEffectPiece customEffectPiece = getCustomEffectPiece(configEffectPiece); + if (customEffectPiece != null) { + customEffect.addEffect(customEffectPiece); + } + } + return customEffect; + } + + public CustomEffectPiece getCustomEffectPiece(Object configEffect) { + if (!(configEffect instanceof List)) { + printReadInError(); + return null; + } + Map effectInformation = convertListedTableRowToMap(configEffect); + PotionEffectType potionEffectType = null; + for (String key : effectInformation.keySet()) { + if (UtilityMethods.stringCollectionContainsIgnoreCase(EFFECT_TYPE_KEYWORDS, key)) { + potionEffectType = getEffectType(effectInformation.get(key)); + break; + } + } + if (potionEffectType == null) { + printReadInError(POTION_EFFECT_TYPE_REQUIRED); + return null; + } + CustomEffectPiece customEffect = new CustomEffectPiece(potionEffectType); + constructCustomEffect(customEffect, effectInformation); + return customEffect; + } + + private void constructCustomItem(CustomItem customItem, Map itemInformation) { + for (String key : itemInformation.keySet()) { + Object value = itemInformation.get(key); + assignCustomItemValue(customItem, value, key); + } + } + + private void constructCustomItem(CustomPotion customPotion, Map itemInformation) { + for (String key : itemInformation.keySet()) { + Object value = itemInformation.get(key); + assignCustomItemValue(customPotion, value, key); + assignCustomPotionValues(customPotion, value, key); + } + } + + private void constructCustomEffect(CustomEffectPiece customEffect, + Map effectInformation) { + for (String key : effectInformation.keySet()) { + Object value = effectInformation.get(key); + assignCustomEffectValue(customEffect, value, key); + } + } + + private void assignCustomItemValue(CustomItem customItemContainer, Object value, String mapKey) { + if (UtilityMethods.stringCollectionContainsIgnoreCase(AMOUNT_KEYWORDS, mapKey)) { + Integer amount = Integer.valueOf(value.toString()); + if (amount < 0) { + printReadInError(IMPROPER_AMOUNT + amount); + return; + } + customItemContainer.setAmount(amount); + } else if (UtilityMethods.stringCollectionContainsIgnoreCase(DURABILITY_KEYWORDS, mapKey)) { + Map durabilityInfo = getMap(value); + if (durabilityInfo == null) { + return; + } + //Get lower and upper bound doubles + boolean lowerBoundPresent = UtilityMethods.stringCollectionContainsIgnoreCase( + durabilityInfo.keySet(), LOWER_BOUND_KEY_WORD); + boolean upperBoundPresent = UtilityMethods.stringCollectionContainsIgnoreCase( + durabilityInfo.keySet(), UPPER_BOUND_KEY_WORD); + if (!lowerBoundPresent && !upperBoundPresent) { + printReadInError(DURABILITY_PARAMETERS_INVALID); + } + double lowerBound = + (lowerBoundPresent) ? Double.valueOf(durabilityInfo.get(LOWER_BOUND_KEY_WORD).toString()) + : 1.0; + double upperBound = + (upperBoundPresent) ? Double.valueOf(durabilityInfo.get(UPPER_BOUND_KEY_WORD).toString()) + : 1.0; + if (lowerBound > upperBound) { + printReadInError(INVALID_DURABILITY_BOUND); + lowerBound = upperBound; + } + if (lowerBound < 0 || upperBound < 0) { + printReadInError(IMPROPER_DURABILITY_LIMITS); + return; + } + customItemContainer.setDurabilityRange(lowerBound, upperBound); + } else if (UtilityMethods.stringCollectionContainsIgnoreCase(ENCHANTMENT_BOUNDS_KEYWORDS, + mapKey)) { + Map enchantmentInfo = getMap(value); + if (enchantmentInfo == null) { + return; + } + //Get lower and upper bound doubles + boolean lowerBoundPresent = UtilityMethods.stringCollectionContainsIgnoreCase( + enchantmentInfo.keySet(), LOWER_BOUND_KEY_WORD); + boolean upperBoundPresent = UtilityMethods.stringCollectionContainsIgnoreCase( + enchantmentInfo.keySet(), UPPER_BOUND_KEY_WORD); + boolean isTreasurePresent = UtilityMethods.stringCollectionContainsIgnoreCase( + enchantmentInfo.keySet(), IS_TREASURE_KEYWORD); + if (!lowerBoundPresent && !upperBoundPresent && !isTreasurePresent) { + printReadInError(RANDOM_ENCHANTMENT_PARAMETERS_INVALID); + } + int lowerBound = (lowerBoundPresent) ? Integer.valueOf( + enchantmentInfo.get(LOWER_BOUND_KEY_WORD).toString()) : 0; + int upperBound = (upperBoundPresent) ? Integer.valueOf( + enchantmentInfo.get(UPPER_BOUND_KEY_WORD).toString()) : 0; + boolean isTreasure = + (isTreasurePresent) ? Boolean.valueOf(enchantmentInfo.get(IS_TREASURE_KEYWORD).toString()) + : true; + if (lowerBound > upperBound) { + printReadInError(INVALID_ENCHANTMENT_BOUNDS); + lowerBound = upperBound; + } + if (lowerBound < 0 || upperBound < 0) { + printReadInError(IMPROPER_ENCHANTMENT_LIMITS); + return; + } + customItemContainer.setEnchantmentLevelRange(lowerBound, upperBound); + customItemContainer.setTreasure(isTreasure); + } else if (UtilityMethods.stringCollectionContainsIgnoreCase(ENCHANTMENTS_KEYWORDS, mapKey)) { + List enchantmentsListUnParsed = getList(value); + if (enchantmentsListUnParsed == null) { + return; + } + List> enchantmentsList = getConfigTableInformation( + enchantmentsListUnParsed); + if (enchantmentsList == null) { + return; + } + for (Map enchantmentInfo : enchantmentsList) { + Enchantment enchantment = + (UtilityMethods.stringCollectionContainsIgnoreCase(enchantmentInfo.keySet(), + ENCHANTMENT_KEYWORD)) ? getEnchantment(enchantmentInfo.get(ENCHANTMENT_KEYWORD)) + : null; if (enchantment == null) { - printReadInError(INVALID_ENCHANTMENT + value.toString()); - return null; - } - return enchantment; - } - - private PotionType getPotionType(Object value) { - PotionType potionType = PotionType.valueOf(value.toString().toUpperCase()); - if (potionType == null) { - printReadInError(INVALID_POTION_TYPE + value.toString()); - return null; - } - return potionType; - } - - private PotionEffectType getEffectType(Object value) { - PotionEffectType effectType = PotionEffectType.getByName(value.toString().toUpperCase()); - if (effectType == null) { - printReadInError(INVALID_EFFECT_TYPE + value.toString()); - return null; - } - return effectType; - } - - private Color getPotionColor(Object value) { - String colorString = value.toString(); - colorString = colorString.substring(1,colorString.length()-1); - List RGB = Arrays.asList(colorString.trim().split(",")); - int red = 0; - int green = 0; - int blue = 0; - if (RGB.size() == 3) { - red = Integer.parseInt(RGB.get(0)); - green = Integer.parseInt(RGB.get(1)); - blue = Integer.parseInt(RGB.get(2)); - } else { - printReadInError(INVALID_POTION_COLOR); - return null; - } - return Color.fromRGB(red,green,blue); - } - - private void printReadInError() { - FrpgPrint.print(IMPROPER_CONFIG + configPath); - } - - private void printReadInError(String extraMessage) { - FrpgPrint.print(IMPROPER_CONFIG + configPath + " (" + extraMessage + ")"); - } - - private Object getOnlyKey(Map map) { - Object mapKey = null; - if (map.keySet().size() > 1) { - printReadInError(); - } - for (Object key : map.keySet()) { //We assume the keyset is size one - mapKey = key; - } - return mapKey; - } - - private Object getOnlyKey(Map map, String extraErrorMessage) { - Object mapKey = null; - if (map.keySet().size() > 1) { - printReadInError(extraErrorMessage); - } - for (Object key : map.keySet()) { //We assume the keyset is size one - mapKey = key; - } - return mapKey; - } - - - - /** - * Converts a "Table" (which is a list of a list of config nodes) to an easier to read form - * @param config the section of config where the table is located - * @return A list of maps of config nodes, for each item in the "table" This acts as a list of rows. - */ - public List> getConfigTableInformation(YamlConfiguration config) { - List configTable = config.getList(configPath); - if (configTable == null) { - FrpgPrint.print(EXPECTED_LIST + configPath); - return null; - } - return getConfigTableInformation(configTable); - } - - /** - * Converts a "Table" (which is a list of a list of config nodes) to an easier to read form - * @param configTable A "table" from a config file, a list of a list of nodes. - * @return A list of maps of config nodes, for each item in the "table" This acts as a list of rows. - */ - public List> getConfigTableInformation(Object configTable) { - if (!(configTable instanceof List)) { - FrpgPrint.print(EXPECTED_LIST+ configPath); - return null; - } - ArrayList> tableInformation = new ArrayList<>(); - for (Object tableRow : (List) configTable) { - tableInformation.add(convertListedTableRowToMap(tableRow)); - } - return tableInformation; - } - - - /* - * Converts a "Table" (which is a list of a list of config nodes) to an easier to read form - * This version will not print where the config is if an errors occurs - * @param configTable A "table" from a config file, a list of a list of nodes. - * @return A list of maps of config nodes, for each item in the "table" This acts as a list of rows. - */ + printReadInError(STATIC_ENCHANTMENT_PARAMETERS_INVALID); + continue; + } + int level = (UtilityMethods.stringCollectionContainsIgnoreCase(enchantmentInfo.keySet(), + LEVEL_KEYWORD)) ? Integer.valueOf(enchantmentInfo.get(LEVEL_KEYWORD).toString()) : 1; + if (level < 0) { + printReadInError(INVALID_ENCHANTMENT_LEVEL + level); + level = 1; + } + customItemContainer.addEnchantment(enchantment, level); + } + } else if (UtilityMethods.stringCollectionContainsIgnoreCase(WEIGHT_KEYWORDS, mapKey)) { + Double weight = Double.valueOf(value.toString()); + if (weight < 0) { + printReadInError(NEGATIVE_WEIGHT); + return; + } + customItemContainer.setWeight(weight); + } else if (UtilityMethods.stringCollectionContainsIgnoreCase(PROBABILITY_KEYWORDS, mapKey)) { + Double prob = Double.valueOf(value.toString()); + if (prob < 0 || prob > 1) { + printReadInError(INVALID_PROBABILITY); + return; + } + customItemContainer.setProbability(prob); + } else if (UtilityMethods.stringCollectionContainsIgnoreCase(EXPERIENCE_KEYWORDS, mapKey)) { + Integer exp = Integer.valueOf(value.toString()); + customItemContainer.setAmount(exp); + } else if (UtilityMethods.stringCollectionContainsIgnoreCase(NANE_KEYWORDS, mapKey)) { + String name = ChatColor.translateAlternateColorCodes('&', String.valueOf(mapKey)); + customItemContainer.setItemName(name); + } + } + + private void assignCustomPotionValues(CustomPotion customPotionContainer, Object value, + String mapKey) { + if (UtilityMethods.stringCollectionContainsIgnoreCase(POTION_KEYWORDS, mapKey)) { + Map minecraftPotionInfo = getMap(value, true); + + if (minecraftPotionInfo == null) { //Custom Potion Case + List customEffectInfoUnParsed = getList(value); + if (customEffectInfoUnParsed == null) { + return; + } + List> customEffectInfoList = getConfigTableInformation( + customEffectInfoUnParsed); + if (customEffectInfoList == null) { + return; + } + + //Custom Effect Case + for (Map customEffectInfo : customEffectInfoList) { + boolean effectPresent = UtilityMethods.stringCollectionContainsIgnoreCase( + customEffectInfo.keySet(), EFFECT_KEYWORD); + boolean durationPresent = UtilityMethods.stringCollectionContainsIgnoreCase( + customEffectInfo.keySet(), DURATION_KEYWORD); + boolean levelPresent = UtilityMethods.stringCollectionContainsIgnoreCase( + customEffectInfo.keySet(), LEVEL_KEYWORD); + boolean colorPresent = UtilityMethods.stringCollectionContainsIgnoreCase( + customEffectInfo.keySet(), COLOR_KEYWORD); + + PotionEffectType effectType = + (effectPresent) ? getEffectType(customEffectInfo.get(EFFECT_KEYWORD)) : null; + Double duration = + (durationPresent) ? Double.valueOf(customEffectInfo.get(DURATION_KEYWORD).toString()) + : 0.0; + Integer level = + (levelPresent) ? Integer.valueOf(customEffectInfo.get(LEVEL_KEYWORD).toString()) : 1; + Color color = + (colorPresent) ? getPotionColor(customEffectInfo.get(COLOR_KEYWORD).toString()) + : null; + + if (effectType == null) { + printReadInError(POTION_EFFECT_TYPE_INVALID); + continue; + } + if (duration < 0) { + printReadInError(INVALID_DURATION); + duration = 0.0; + } + if (level < 0) { + printReadInError(INVALID_POTION_LEVEL + level); + level = 1; + } + if (color != null) { + customPotionContainer.addColor(color); + } + customPotionContainer.addPotionEffect(effectType, duration, level); + } + return; + } else { //Vanilla Potion Case + boolean effectPresent = UtilityMethods.stringCollectionContainsIgnoreCase( + minecraftPotionInfo.keySet(), EFFECT_KEYWORD); + boolean isUpgradedPresent = UtilityMethods.stringCollectionContainsIgnoreCase( + minecraftPotionInfo.keySet(), IS_UPGRADED_KEYWORD); + boolean isExtendedPresent = UtilityMethods.stringCollectionContainsIgnoreCase( + minecraftPotionInfo.keySet(), IS_EXTENDED_KEYWORD); + + PotionType effectType = + (effectPresent) ? getPotionType(minecraftPotionInfo.get(EFFECT_KEYWORD)) : null; + boolean isUpgraded = (isUpgradedPresent) ? Boolean.valueOf( + minecraftPotionInfo.get(IS_UPGRADED_KEYWORD).toString()) : false; + boolean isExtended = (isExtendedPresent) ? Boolean.valueOf( + minecraftPotionInfo.get(IS_EXTENDED_KEYWORD).toString()) : false; + customPotionContainer.setPotion(effectType, isUpgraded, isExtended); + } + } + } + + private void assignCustomEffectValue(CustomEffectPiece customEffect, Object value, + String mapKey) { + if (UtilityMethods.stringCollectionContainsIgnoreCase(EFFECT_LEVEL_KEYWORDS, mapKey)) { + Integer level = Integer.valueOf(value.toString()); + if (level < 1) { + printReadInError(INVALID_POTION_LEVEL + level); + return; + } + customEffect.setLevel(level); + } else if (UtilityMethods.stringCollectionContainsIgnoreCase(EFFECT_DURATION_KEYWORDS, + mapKey)) { + Double duration = Double.valueOf(value.toString()); + if (duration < 0) { + printReadInError(INVALID_DURATION + duration); + return; + } + customEffect.setDuration(duration); + + } else if (UtilityMethods.stringCollectionContainsIgnoreCase(EFFECT_DELAY_KEYWORDS, mapKey)) { + Double delay = Double.valueOf(value.toString()); + if (delay < 0) { + printReadInError(INVALID_DELAY + delay); + return; + } + customEffect.setDelay(delay); + } else if (UtilityMethods.stringCollectionContainsIgnoreCase(PROBABILITY_KEYWORDS, mapKey)) { + Double prob = Double.valueOf(value.toString()); + if (prob < 0 || prob > 1) { + printReadInError(INVALID_PROBABILITY + prob); + return; + } + customEffect.setProbability(prob); + } else if (UtilityMethods.stringCollectionContainsIgnoreCase( + EFFECT_DURATION_MULTIPLIER_KEYWORDS, mapKey)) { + Double durationMultiplier = Double.valueOf(value.toString()); + if (durationMultiplier < 0) { + printReadInError(INVALID_DURATION_MULTIPLIER + durationMultiplier); + return; + } + customEffect.setRelativeDurationMultiplier(durationMultiplier); + } else if (UtilityMethods.stringCollectionContainsIgnoreCase(EFFECT_DURATION_ADDED_KEYWORDS, + mapKey)) { + Double durationAdded = Double.valueOf(value.toString()); + customEffect.setRelativeDurationAdded(durationAdded); + } + } + + private Material getMaterial(Object value) { + Material material = Material.getMaterial(value.toString()); + if (material == null) { + printReadInError(MATERIAL_NOT_FOUND + value.toString()); + } + return material; + } + + private ArrayList getRecipeArrayList(Object value) { + if (!(value instanceof List)) { + printReadInError(INVALID_RECIPE_ARRAYLIST + value.toString()); + return null; + } + List valueList = (List) value; + if (valueList.size() != 9) { + printReadInError(INVALID_RECIPE_ARRAYLIST + value.toString()); + return null; + } + ArrayList recipe = new ArrayList<>(); + for (Object materialObject : valueList) { + recipe.add(getMaterial(materialObject)); + } + for (int i = 0; i < recipe.size(); i++) { + if (recipe.get(i) == null) { + recipe.set(i, Material.AIR); + } + } + return recipe; + } + + private Map getMap(Object value) { + return getMap(value, false); + } + + private Map getMap(Object value, boolean silent) { + if (!(value instanceof Map)) { + if (!silent) { + printReadInError(); + } + return null; + } + for (Object object : ((Map) value).keySet()) { + if (!(object instanceof String)) { + if (!silent) { + printReadInError(); + } + return null; + } + } + return (Map) value; + } + + private List getList(Object value) { + if (!(value instanceof List)) { + printReadInError(); + return null; + } + return (List) value; + } + + private Enchantment getEnchantment(Object value) { + Enchantment enchantment = EnchantmentWrapper.getByKey( + NamespacedKey.minecraft(value.toString().toLowerCase())); + if (enchantment == null) { + printReadInError(INVALID_ENCHANTMENT + value.toString()); + return null; + } + return enchantment; + } + + private PotionType getPotionType(Object value) { + PotionType potionType = PotionType.valueOf(value.toString().toUpperCase()); + if (potionType == null) { + printReadInError(INVALID_POTION_TYPE + value.toString()); + return null; + } + return potionType; + } + + private PotionEffectType getEffectType(Object value) { + PotionEffectType effectType = PotionEffectType.getByName(value.toString().toUpperCase()); + if (effectType == null) { + printReadInError(INVALID_EFFECT_TYPE + value.toString()); + return null; + } + return effectType; + } + + private Color getPotionColor(Object value) { + String colorString = value.toString(); + colorString = colorString.substring(1, colorString.length() - 1); + List RGB = Arrays.asList(colorString.trim().split(",")); + int red = 0; + int green = 0; + int blue = 0; + if (RGB.size() == 3) { + red = Integer.parseInt(RGB.get(0)); + green = Integer.parseInt(RGB.get(1)); + blue = Integer.parseInt(RGB.get(2)); + } else { + printReadInError(INVALID_POTION_COLOR); + return null; + } + return Color.fromRGB(red, green, blue); + } + + private void printReadInError() { + FreeRPG.log(Level.INFO, IMPROPER_CONFIG + configPath); + } + + private void printReadInError(String extraMessage) { + FreeRPG.log(Level.INFO, IMPROPER_CONFIG + configPath + " (" + extraMessage + ")"); + } + + private Object getOnlyKey(Map map) { + Object mapKey = null; + if (map.keySet().size() > 1) { + printReadInError(); + } + for (Object key : map.keySet()) { //We assume the keyset is size one + mapKey = key; + } + return mapKey; + } + + private Object getOnlyKey(Map map, String extraErrorMessage) { + Object mapKey = null; + if (map.keySet().size() > 1) { + printReadInError(extraErrorMessage); + } + for (Object key : map.keySet()) { //We assume the keyset is size one + mapKey = key; + } + return mapKey; + } + + + /** + * Converts a "Table" (which is a list of a list of config nodes) to an easier to read form + * + * @param config the section of config where the table is located + * @return A list of maps of config nodes, for each item in the "table" This acts as a list of + * rows. + */ + public List> getConfigTableInformation(YamlConfiguration config) { + List configTable = config.getList(configPath); + if (configTable == null) { + FreeRPG.log(Level.INFO, EXPECTED_LIST + configPath); + return null; + } + return getConfigTableInformation(configTable); + } + + /** + * Converts a "Table" (which is a list of a list of config nodes) to an easier to read form + * + * @param configTable A "table" from a config file, a list of a list of nodes. + * @return A list of maps of config nodes, for each item in the "table" This acts as a list of + * rows. + */ + public List> getConfigTableInformation(Object configTable) { + if (!(configTable instanceof List)) { + FreeRPG.log(Level.INFO, EXPECTED_LIST + configPath); + return null; + } + ArrayList> tableInformation = new ArrayList<>(); + for (Object tableRow : (List) configTable) { + tableInformation.add(convertListedTableRowToMap(tableRow)); + } + return tableInformation; + } + + + /* + * Converts a "Table" (which is a list of a list of config nodes) to an easier to read form + * This version will not print where the config is if an errors occurs + * @param configTable A "table" from a config file, a list of a list of nodes. + * @return A list of maps of config nodes, for each item in the "table" This acts as a list of rows. + */ /* public List> getConfigTableInformation(List configTable) { return getConfigTableInformation(configTable,UNKNOWN_CONFIG_LOCATION); } */ - /** - * Converts List of config nodes to a Map format (removes extraneous lists used to compact lines in .yml files) - * @param listOfConfigNodes List that contains config nodes (Maps) - * @return A map format of the list - */ - public Map convertListedTableRowToMap(Object listOfConfigNodes) { - if (!(listOfConfigNodes instanceof List)) { - FrpgPrint.print(EXPECTED_LIST+ configPath); - return null; - } - Map tableRow = new HashMap<>(); - if (!UtilityMethods.collectionOnlyContainsOneClass((List) listOfConfigNodes,Map.class)) { //Checks if the list only contains maps first - FrpgPrint.print(EXPECTED_LIST_OF_MAPS+ configPath); - return null; - } - for (Object tableElementObject : (List) listOfConfigNodes) { - Map tableElement = (Map) tableElementObject; - for (Object key : tableElement.keySet()) { - Object value = tableElement.get(key); - if (value instanceof List) { - if (!((List) value).isEmpty()) { - if (UtilityMethods.collectionOnlyContainsOneClass((List) value,Map.class)) { - value = convertListedTableRowToMap(value); - } - } - } - tableRow.put(key.toString(), value); - } - } - return tableRow; - } + /** + * Converts List of config nodes to a Map format (removes extraneous lists used to compact lines + * in .yml files) + * + * @param listOfConfigNodes List that contains config nodes (Maps) + * @return A map format of the list + */ + public Map convertListedTableRowToMap(Object listOfConfigNodes) { + if (!(listOfConfigNodes instanceof List)) { + FreeRPG.log(Level.INFO,EXPECTED_LIST + configPath); + return null; + } + Map tableRow = new HashMap<>(); + if (!UtilityMethods.collectionOnlyContainsOneClass((List) listOfConfigNodes, + Map.class)) { //Checks if the list only contains maps first + FreeRPG.log(Level.INFO,EXPECTED_LIST_OF_MAPS + configPath); + return null; + } + for (Object tableElementObject : (List) listOfConfigNodes) { + Map tableElement = (Map) tableElementObject; + for (Object key : tableElement.keySet()) { + Object value = tableElement.get(key); + if (value instanceof List) { + if (!((List) value).isEmpty()) { + if (UtilityMethods.collectionOnlyContainsOneClass((List) value, Map.class)) { + value = convertListedTableRowToMap(value); + } + } + } + tableRow.put(key.toString(), value); + } + } + return tableRow; + } } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/CustomEffectPiece.java b/src/main/java/mc/carlton/freerpg/customContainers/CustomEffectPiece.java index e8d9cec..e921c7c 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/CustomEffectPiece.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/CustomEffectPiece.java @@ -1,218 +1,239 @@ package mc.carlton.freerpg.customContainers; +import java.util.Map; import mc.carlton.freerpg.customContainers.collections.CustomEffect; -import org.bukkit.enchantments.Enchantment; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import java.util.Map; - public class CustomEffectPiece extends CustomContainer { - private PotionEffectType effectType; - private int level = 1; - private double duration = 0.0; - private double delay = 0.0; - - private CustomEffectPiece relativeEffect; - private double relativeDurationMultiplier = 1.0; - private double relativeDurationAdded = 0.0; - - private double probability = 1.0; - - public CustomEffectPiece(PotionEffectType effectType){ - this(effectType,null); - } - - public CustomEffectPiece(PotionEffectType effectType, Map containerInformation){ - super(containerInformation); - this.effectType = effectType; - } - - /** - * Sets the delay - * @param delay delay in seconds - */ - public void setDelay(double delay) { - this.delay = delay; - } - - /** - * Sets the delay - * @param delayTicks delay in ticks - */ - public void setDelayTicks(int delayTicks) { - this.delay = delayTicks/20.0; - } - - /** - * Sets the duration - * @param duration duration in seconds - */ - public void setDuration(double duration) { - this.duration = duration; - } - - /** - * Sets the duration - * @param durationTicks duration in ticks - */ - public void setDurationTicks(int durationTicks) { - this.duration = durationTicks/20.0; - } - - /** - * Sets the effect type - * @param effectType a PotionEffectType - */ - public void setEffectType(PotionEffectType effectType) { - this.effectType = effectType; - } - - /** - * Sets the effect level - * @param level potion level of the effect - */ - public void setLevel(int level) { - this.level = level; - } - - /** - * Sets the probability - * @param probability probability the effect is added - */ - public void setProbability(double probability) { - this.probability = probability; - } - - /** - * Sets additional time added to the duration - * @param relativeDurationAdded time added in seconds - */ - public void setRelativeDurationAdded(double relativeDurationAdded) { - this.relativeDurationAdded = relativeDurationAdded; - } - /** - * Sets additional time added to the duration - * @param relativeDurationAddedTicks time added in ticks - */ - public void setRelativeDurationAddedTicks(int relativeDurationAddedTicks) { - this.relativeDurationAdded = relativeDurationAddedTicks/20.0; - } - - /** - * Sets the relative duration multiplier - * @param relativeDurationMultiplier multiplier for the duration of a relative effect, determines the duration in conjunction with relativeDurationAdded - */ - public void setRelativeDurationMultiplier(double relativeDurationMultiplier) { - this.relativeDurationMultiplier = relativeDurationMultiplier; - } - - /** - * Sets the relative effect - * @param relativeEffect a CustomEffectPiece acting as the relative effect - */ - public void setRelativeEffect(CustomEffectPiece relativeEffect) { - this.relativeEffect = relativeEffect; - } - - /** - * Sets the relative effect as the CustomEffectPiece with the longest duration in the CustomEffect relativeEffect - * @param relativeEffect a CustomEffect (list of CustomEffectPiece classes) - */ - public void setRelativeEffect(CustomEffect relativeEffect) { - int longestDurationOfRelativeEffectPieceSet = 0; - for (CustomEffectPiece relativeEffectPiece : relativeEffect.getCustomEffectPieces()) { - if (longestDurationOfRelativeEffectPieceSet < relativeEffectPiece.getDuration()) { - this.relativeEffect = relativeEffectPiece; - longestDurationOfRelativeEffectPieceSet = relativeEffectPiece.getDuration(); - } - } - } - - /** - * Getter for the probability this effect is activated - * @return the probability that this effect piece activates - */ - public double getProbability() { - return probability; - } - - /** - * Getter for relativeEffect - * @return the CustomEffectPiece that determines the duration of this effect - */ - public CustomEffectPiece getRelativeEffect() { - return relativeEffect; - } - - /** - * Getter for delay - * @return the delay in ticks - */ - public int getDelay() { - return (int) Math.round(20*delay); - } - - /** - * Getter for duration - * @return the duration in ticks - */ - public int getDuration() { - double trueDuration = 0.0; - if (relativeEffect != null) { - trueDuration = relativeDurationMultiplier*relativeEffect.getDuration(); - } else { - trueDuration = duration; - } - trueDuration += relativeDurationAdded; - return (int) Math.round(20*trueDuration); - } - - /** - * Getter for level - * @return the level of the potion effect - */ - public int getLevel() { - return level; - } - - /** - * Returns the amplifier of the effect, which is level - 1 - * @return the amplifier of the effect, which is level -1 - */ - public int getAmplifier() { - return level - 1; - } - - /** - * Getter for the effectType - * @return PotionEffectType - */ - public PotionEffectType getEffectType() { - return effectType; - } - - /** - * Constructs and returns a potionEffect - * @return PotionEffect that embodies some information in this CustomEffectPiece - */ - public PotionEffect getPotionEffect() { - return new PotionEffect(getEffectType(),getDuration(),getLevel()); - } - - @Override - public String toString() { - String stringValue = ""; - stringValue += "["; - stringValue += "Effect: " + this.effectType.getName() + ", "; - stringValue += "Duration: " + this.duration + ", "; - stringValue += "Delay: " + this.delay + ", "; - stringValue += "Probability: " + this.probability + ", "; - stringValue += "Relative Duration Multiplier: " + this.relativeDurationMultiplier + ", "; - stringValue += "Relative Duration Added: " + this.relativeDurationAdded; - stringValue += "]"; - - return stringValue; - } + private PotionEffectType effectType; + private int level = 1; + private double duration = 0.0; + private double delay = 0.0; + + private CustomEffectPiece relativeEffect; + private double relativeDurationMultiplier = 1.0; + private double relativeDurationAdded = 0.0; + + private double probability = 1.0; + + public CustomEffectPiece(PotionEffectType effectType) { + this(effectType, null); + } + + public CustomEffectPiece(PotionEffectType effectType, Map containerInformation) { + super(containerInformation); + this.effectType = effectType; + } + + /** + * Sets the delay + * + * @param delayTicks delay in ticks + */ + public void setDelayTicks(int delayTicks) { + this.delay = delayTicks / 20.0; + } + + /** + * Sets the duration + * + * @param durationTicks duration in ticks + */ + public void setDurationTicks(int durationTicks) { + this.duration = durationTicks / 20.0; + } + + /** + * Sets additional time added to the duration + * + * @param relativeDurationAdded time added in seconds + */ + public void setRelativeDurationAdded(double relativeDurationAdded) { + this.relativeDurationAdded = relativeDurationAdded; + } + + /** + * Sets additional time added to the duration + * + * @param relativeDurationAddedTicks time added in ticks + */ + public void setRelativeDurationAddedTicks(int relativeDurationAddedTicks) { + this.relativeDurationAdded = relativeDurationAddedTicks / 20.0; + } + + /** + * Sets the relative duration multiplier + * + * @param relativeDurationMultiplier multiplier for the duration of a relative effect, determines + * the duration in conjunction with relativeDurationAdded + */ + public void setRelativeDurationMultiplier(double relativeDurationMultiplier) { + this.relativeDurationMultiplier = relativeDurationMultiplier; + } + + /** + * Getter for the probability this effect is activated + * + * @return the probability that this effect piece activates + */ + public double getProbability() { + return probability; + } + + /** + * Sets the probability + * + * @param probability probability the effect is added + */ + public void setProbability(double probability) { + this.probability = probability; + } + + /** + * Getter for relativeEffect + * + * @return the CustomEffectPiece that determines the duration of this effect + */ + public CustomEffectPiece getRelativeEffect() { + return relativeEffect; + } + + /** + * Sets the relative effect + * + * @param relativeEffect a CustomEffectPiece acting as the relative effect + */ + public void setRelativeEffect(CustomEffectPiece relativeEffect) { + this.relativeEffect = relativeEffect; + } + + /** + * Sets the relative effect as the CustomEffectPiece with the longest duration in the CustomEffect + * relativeEffect + * + * @param relativeEffect a CustomEffect (list of CustomEffectPiece classes) + */ + public void setRelativeEffect(CustomEffect relativeEffect) { + int longestDurationOfRelativeEffectPieceSet = 0; + for (CustomEffectPiece relativeEffectPiece : relativeEffect.getCustomEffectPieces()) { + if (longestDurationOfRelativeEffectPieceSet < relativeEffectPiece.getDuration()) { + this.relativeEffect = relativeEffectPiece; + longestDurationOfRelativeEffectPieceSet = relativeEffectPiece.getDuration(); + } + } + } + + /** + * Getter for delay + * + * @return the delay in ticks + */ + public int getDelay() { + return (int) Math.round(20 * delay); + } + + /** + * Sets the delay + * + * @param delay delay in seconds + */ + public void setDelay(double delay) { + this.delay = delay; + } + + /** + * Getter for duration + * + * @return the duration in ticks + */ + public int getDuration() { + double trueDuration = 0.0; + if (relativeEffect != null) { + trueDuration = relativeDurationMultiplier * relativeEffect.getDuration(); + } else { + trueDuration = duration; + } + trueDuration += relativeDurationAdded; + return (int) Math.round(20 * trueDuration); + } + + /** + * Sets the duration + * + * @param duration duration in seconds + */ + public void setDuration(double duration) { + this.duration = duration; + } + + /** + * Getter for level + * + * @return the level of the potion effect + */ + public int getLevel() { + return level; + } + + /** + * Sets the effect level + * + * @param level potion level of the effect + */ + public void setLevel(int level) { + this.level = level; + } + + /** + * Returns the amplifier of the effect, which is level - 1 + * + * @return the amplifier of the effect, which is level -1 + */ + public int getAmplifier() { + return level - 1; + } + + /** + * Getter for the effectType + * + * @return PotionEffectType + */ + public PotionEffectType getEffectType() { + return effectType; + } + + /** + * Sets the effect type + * + * @param effectType a PotionEffectType + */ + public void setEffectType(PotionEffectType effectType) { + this.effectType = effectType; + } + + /** + * Constructs and returns a potionEffect + * + * @return PotionEffect that embodies some information in this CustomEffectPiece + */ + public PotionEffect getPotionEffect() { + return new PotionEffect(getEffectType(), getDuration(), getLevel()); + } + + @Override + public String toString() { + String stringValue = ""; + stringValue += "["; + stringValue += "Effect: " + this.effectType.getName() + ", "; + stringValue += "Duration: " + this.duration + ", "; + stringValue += "Delay: " + this.delay + ", "; + stringValue += "Probability: " + this.probability + ", "; + stringValue += "Relative Duration Multiplier: " + this.relativeDurationMultiplier + ", "; + stringValue += "Relative Duration Added: " + this.relativeDurationAdded; + stringValue += "]"; + + return stringValue; + } } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/CustomItem.java b/src/main/java/mc/carlton/freerpg/customContainers/CustomItem.java index 1991614..d79f1f7 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/CustomItem.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/CustomItem.java @@ -1,339 +1,374 @@ package mc.carlton.freerpg.customContainers; -import mc.carlton.freerpg.gameTools.PsuedoEnchanting; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.utils.game.PsuedoEnchanting; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.Damageable; import org.bukkit.inventory.meta.ItemMeta; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; - public class CustomItem extends CustomContainer { - protected Material material; - protected int amount = 1; - protected double minDurabilityPortion = 1.00; - protected double maxDurabilityPortion = 1.00; - protected int minEnchantmentLevel = 0; - protected int maxEnchantmentLevel = 0; - protected boolean isTreasure = true; - protected Map enchantments = new HashMap<>(); - protected double weight = 1.0; - protected double probability = -1.0; - protected int experienceDrop = 0; - protected String itemName; - - /** - * Constructor for CustomItem - * @param material the item type - */ - public CustomItem(Material material) { - this(material,null); - } - /** - * Constructor for CustomItem - * @param material the item type - */ - public CustomItem(Material material, Map containerInformation) { - super(containerInformation); - this.material = material; - } - - public CustomItem(ItemStack itemStack) { - this(itemStack,null); - } - - public CustomItem(ItemStack itemStack, Map containerInformation) { - super(containerInformation); - ItemMeta itemMeta = itemStack.getItemMeta(); - this.material = itemStack.getType(); - this.amount = itemStack.getAmount(); - if (itemStack.getItemMeta() instanceof Damageable) { - double maxDurabiliy = itemStack.getType().getMaxDurability(); - double currentDamage = ((Damageable) itemMeta).getDamage(); - double durabilityPortion = (maxDurabiliy - currentDamage)/maxDurabiliy; - this.minDurabilityPortion = durabilityPortion; - this.maxDurabilityPortion = durabilityPortion; - } - this.enchantments = itemMeta.getEnchants(); - } - - /** - * Tests if the item is a potion - * @return true if item is potion - */ - public boolean isPotion() { - return (material.equals(Material.POTION)); - } - - /** - * Returns an item stack to represent the custom item - * @return Itemstack to match custom item information - */ - public ItemStack getItemStack() { - return getItemStackWithoutPotionEffects(); - } - - protected ItemStack getItemStackWithoutPotionEffects() { - ItemStack item = new ItemStack(material,amount); - ItemMeta itemMeta = item.getItemMeta(); - itemMeta.setDisplayName(itemName); - Random random = new Random(); - if (itemMeta instanceof Damageable) { - short maxDurability = item.getType().getMaxDurability(); - double randomDamageMultiplier = 1.0 - (random.nextDouble()*(maxDurabilityPortion - minDurabilityPortion) + minDurabilityPortion); - ((Damageable) itemMeta).setDamage((int) Math.round(maxDurability*randomDamageMultiplier)); - } - item.setItemMeta(itemMeta); - if (!enchantments.isEmpty()) { - item.addUnsafeEnchantments(enchantments); - } - int enchantLevel = random.nextInt((maxEnchantmentLevel + 1) - minEnchantmentLevel) + minEnchantmentLevel; - if (enchantLevel > 0) { - PsuedoEnchanting psuedoEnchanting = new PsuedoEnchanting(); - if (enchantments.isEmpty()) { - psuedoEnchanting.enchantItem(item,enchantLevel,isTreasure); - } else { - psuedoEnchanting.addEnchant(item,enchantLevel,isTreasure); - } - } - return item; - } - - /** - * Setter for item name - * @param name the displayed name of the item in game - */ - public void setItemName(String name) { - this.itemName = name; - } - - /** - * Setter for amount - * @param amount quantity of item - */ - public void setAmount(int amount) { - this.amount = amount; - } - - /** - * Setter for minimum durability portion - * @param minDurabilityPortion minimum durability portion (relative to it's full durability) the item can be set to (<= 1) - */ - public void setMinDurabilityPortion(double minDurabilityPortion) { - this.minDurabilityPortion = minDurabilityPortion; - } - - /** - * Setter for maximum durability portion - * @param maxDurabilityPortion maximum durability portion (relative to it's full durability) the item can be set to (<=1) - */ - public void setMaxDurabilityPortion(double maxDurabilityPortion) { - this.maxDurabilityPortion = maxDurabilityPortion; - } - /** - * Setter for both minDurabilityPortion and maxDurabilityPortion - * @param minDurabilityPortion minimum durability portion (relative to it's full durability) the item can be set to (<= 1) - * @param maxDurabilityPortion maximum durability portion (relative to it's full durability) the item can be set to (<=1) - */ - public void setDurabilityRange(double minDurabilityPortion, double maxDurabilityPortion) { - setMinDurabilityPortion(minDurabilityPortion); - setMaxDurabilityPortion(maxDurabilityPortion); + protected Material material; + protected int amount = 1; + protected double minDurabilityPortion = 1.00; + protected double maxDurabilityPortion = 1.00; + protected int minEnchantmentLevel = 0; + protected int maxEnchantmentLevel = 0; + protected boolean isTreasure = true; + protected Map enchantments = new HashMap<>(); + protected double weight = 1.0; + protected double probability = -1.0; + protected int experienceDrop = 0; + protected String itemName; + + /** + * Constructor for CustomItem + * + * @param material the item type + */ + public CustomItem(Material material) { + this(material, null); + } + + /** + * Constructor for CustomItem + * + * @param material the item type + */ + public CustomItem(Material material, Map containerInformation) { + super(containerInformation); + this.material = material; + } + + public CustomItem(ItemStack itemStack) { + this(itemStack, null); + } + + public CustomItem(ItemStack itemStack, Map containerInformation) { + super(containerInformation); + ItemMeta itemMeta = itemStack.getItemMeta(); + this.material = itemStack.getType(); + this.amount = itemStack.getAmount(); + if (itemStack.getItemMeta() instanceof Damageable) { + double maxDurabiliy = itemStack.getType().getMaxDurability(); + double currentDamage = ((Damageable) itemMeta).getDamage(); + double durabilityPortion = (maxDurabiliy - currentDamage) / maxDurabiliy; + this.minDurabilityPortion = durabilityPortion; + this.maxDurabilityPortion = durabilityPortion; } - - /** - * Setter for maximum random enchantment level - * @param maxEnchantmentLevel maximum enchantment level (can be greater than 30) - */ - public void setMaxEnchantmentLevel(int maxEnchantmentLevel) { - this.maxEnchantmentLevel = maxEnchantmentLevel; - } - - /** - * Setter for minimum random enchantment level - * @param minEnchantmentLevel minimum enchantment level - */ - public void setMinEnchantmentLevel(int minEnchantmentLevel) { - this.minEnchantmentLevel = minEnchantmentLevel; - } - - /** - * Setter for both minimum and maximum random enchantment level - * @param minEnchantmentLevel minimum enchantment level - * @param maxEnchantmentLevel maximum enchantment level (can be greater than 30) - */ - public void setEnchantmentLevelRange(int minEnchantmentLevel, int maxEnchantmentLevel) { - setMinEnchantmentLevel(minEnchantmentLevel); - setMaxEnchantmentLevel(maxEnchantmentLevel); - } - - /** - * Setter for the map of static enchantments on the item - * @param enchantments Map of enchantments with corresponding level - */ - public void setEnchantments(Map enchantments) { - this.enchantments = enchantments; + this.enchantments = itemMeta.getEnchants(); + } + + /** + * Tests if the item is a potion + * + * @return true if item is potion + */ + public boolean isPotion() { + return (material.equals(Material.POTION)); + } + + /** + * Returns an item stack to represent the custom item + * + * @return Itemstack to match custom item information + */ + public ItemStack getItemStack() { + return getItemStackWithoutPotionEffects(); + } + + protected ItemStack getItemStackWithoutPotionEffects() { + ItemStack item = new ItemStack(material, amount); + ItemMeta itemMeta = item.getItemMeta(); + itemMeta.setDisplayName(itemName); + Random random = new Random(); + if (itemMeta instanceof Damageable) { + short maxDurability = item.getType().getMaxDurability(); + double randomDamageMultiplier = + 1.0 - (random.nextDouble() * (maxDurabilityPortion - minDurabilityPortion) + + minDurabilityPortion); + ((Damageable) itemMeta).setDamage((int) Math.round(maxDurability * randomDamageMultiplier)); } - - /** - * Adds an enchantment to the map of static enchantments on the item - * @param enchantment - * @param level - */ - public void addEnchantment(Enchantment enchantment, int level) { - this.enchantments.put(enchantment,level); + item.setItemMeta(itemMeta); + if (!enchantments.isEmpty()) { + item.addUnsafeEnchantments(enchantments); } - - /** - * Add multiple enchantments to the map of static enchantments on the item - * @param enchantments Map of enchantments with level - */ - public void addEnchantments(Map enchantments) { - for (Enchantment enchantment : enchantments.keySet()) { - addEnchantment(enchantment,enchantments.get(enchantment)); - } + int enchantLevel = + random.nextInt((maxEnchantmentLevel + 1) - minEnchantmentLevel) + minEnchantmentLevel; + if (enchantLevel > 0) { + PsuedoEnchanting psuedoEnchanting = new PsuedoEnchanting(); + if (enchantments.isEmpty()) { + psuedoEnchanting.enchantItem(item, enchantLevel, isTreasure); + } else { + psuedoEnchanting.addEnchant(item, enchantLevel, isTreasure); + } } - - /** - * Sets the material for an item - * @param material Item type - */ - public void setMaterial(Material material) { - this.material = material; + return item; + } + + /** + * Setter for amount + * + * @param amount quantity of item + */ + public void setAmount(int amount) { + this.amount = amount; + } + + /** + * Setter for minimum durability portion + * + * @param minDurabilityPortion minimum durability portion (relative to it's full durability) the + * item can be set to (<= 1) + */ + public void setMinDurabilityPortion(double minDurabilityPortion) { + this.minDurabilityPortion = minDurabilityPortion; + } + + /** + * Setter for maximum durability portion + * + * @param maxDurabilityPortion maximum durability portion (relative to it's full durability) the + * item can be set to (<=1) + */ + public void setMaxDurabilityPortion(double maxDurabilityPortion) { + this.maxDurabilityPortion = maxDurabilityPortion; + } + + /** + * Setter for both minDurabilityPortion and maxDurabilityPortion + * + * @param minDurabilityPortion minimum durability portion (relative to it's full durability) the + * item can be set to (<= 1) + * @param maxDurabilityPortion maximum durability portion (relative to it's full durability) the + * item can be set to (<=1) + */ + public void setDurabilityRange(double minDurabilityPortion, double maxDurabilityPortion) { + setMinDurabilityPortion(minDurabilityPortion); + setMaxDurabilityPortion(maxDurabilityPortion); + } + + /** + * Setter for maximum random enchantment level + * + * @param maxEnchantmentLevel maximum enchantment level (can be greater than 30) + */ + public void setMaxEnchantmentLevel(int maxEnchantmentLevel) { + this.maxEnchantmentLevel = maxEnchantmentLevel; + } + + /** + * Setter for minimum random enchantment level + * + * @param minEnchantmentLevel minimum enchantment level + */ + public void setMinEnchantmentLevel(int minEnchantmentLevel) { + this.minEnchantmentLevel = minEnchantmentLevel; + } + + /** + * Setter for both minimum and maximum random enchantment level + * + * @param minEnchantmentLevel minimum enchantment level + * @param maxEnchantmentLevel maximum enchantment level (can be greater than 30) + */ + public void setEnchantmentLevelRange(int minEnchantmentLevel, int maxEnchantmentLevel) { + setMinEnchantmentLevel(minEnchantmentLevel); + setMaxEnchantmentLevel(maxEnchantmentLevel); + } + + /** + * Setter for the map of static enchantments on the item + * + * @param enchantments Map of enchantments with corresponding level + */ + public void setEnchantments(Map enchantments) { + this.enchantments = enchantments; + } + + /** + * Adds an enchantment to the map of static enchantments on the item + * + * @param enchantment + * @param level + */ + public void addEnchantment(Enchantment enchantment, int level) { + this.enchantments.put(enchantment, level); + } + + /** + * Add multiple enchantments to the map of static enchantments on the item + * + * @param enchantments Map of enchantments with level + */ + public void addEnchantments(Map enchantments) { + for (Enchantment enchantment : enchantments.keySet()) { + addEnchantment(enchantment, enchantments.get(enchantment)); } - - - /** - * Getter for item name - * @return the name the item will have in game - */ - public String getItemName() { - return itemName; + } + + /** + * Getter for item name + * + * @return the name the item will have in game + */ + public String getItemName() { + return itemName; + } + + /** + * Setter for item name + * + * @param name the displayed name of the item in game + */ + public void setItemName(String name) { + this.itemName = name; + } + + /** + * Getter for material + * + * @return material + */ + public Material getMaterial() { + return material; + } + + /** + * Sets the material for an item + * + * @param material Item type + */ + public void setMaterial(Material material) { + this.material = material; + } + + /** + * Amount of FreeRPG experience that is dropped when a player recieves this item + * + * @param experienceDrop integer experience amount + */ + public void setExperienceDrop(int experienceDrop) { + this.experienceDrop = experienceDrop; + } + + /** + * Whether or not the random enchantment on this item is a treasure enchantment or not + * + * @param isTreasure true if the item is a treasure, false otherwise + */ + public void setTreasure(boolean isTreasure) { + this.isTreasure = isTreasure; + } + + /** + * Getter for probability + * + * @return + */ + public double getProbability() { + return probability; + } + + /** + * Sets the static probability this item drops + * + * @param probability Static drop rate for this item (should be <=1) + */ + public void setProbability(double probability) { + this.probability = probability; + } + + /** + * Getter for weight + * + * @return + */ + public double getWeight() { + return weight; + } + + /** + * Sets the drop probability weight for this item. This value is compared to other weights of + * items in a drop table + * + * @param weight Weight value (higher --> more likely) + */ + public void setWeight(double weight) { + this.weight = weight; + } + + public boolean isStaticProbability() { + if (probability == -1.0) { + return false; + } else { + return true; } + } - /** - * Getter for material - * @return material - */ - public Material getMaterial() { - return material; + @Override + public boolean equals(Object o) { + if (o == this) { + return true; } - - /** - * Amount of FreeRPG experience that is dropped when a player recieves this item - * @param experienceDrop integer experience amount - */ - public void setExperienceDrop(int experienceDrop) { - this.experienceDrop = experienceDrop; + if (!(o instanceof CustomItem)) { + return false; } - /** - * Whether or not the random enchantment on this item is a treasure enchantment or not - * @param isTreasure true if the item is a treasure, false otherwise - */ - public void setTreasure(boolean isTreasure) { - this.isTreasure = isTreasure; + CustomItem otherCustomItem = (CustomItem) o; + return customItemEquals(otherCustomItem); + } + + public boolean customItemEquals(CustomItem otherCustomItem) { + if (material.equals(otherCustomItem.material) && + amount == otherCustomItem.amount && + minDurabilityPortion == otherCustomItem.minDurabilityPortion && + maxDurabilityPortion == otherCustomItem.maxDurabilityPortion && + minEnchantmentLevel == otherCustomItem.minEnchantmentLevel && + isTreasure == otherCustomItem.isTreasure && + enchantments.equals(otherCustomItem.enchantments) && + weight == otherCustomItem.weight && + probability == otherCustomItem.probability && + experienceDrop == otherCustomItem.experienceDrop && + itemName.equals(otherCustomItem.itemName)) { + return true; } - - /** - * Sets the static probability this item drops - * @param probability Static drop rate for this item (should be <=1) - */ - public void setProbability(double probability) { - this.probability = probability; + return false; + } + + @Override + public String toString() { + String stringValue = ""; + stringValue += "["; + stringValue += "Material: " + this.material.toString() + ", "; + stringValue += "Amount: " + this.amount + ", "; + stringValue += + "Durability: (" + this.minDurabilityPortion + ", " + this.maxDurabilityPortion + "), "; + stringValue += + "Random Enchantment Range: (" + this.minEnchantmentLevel + ", " + this.maxEnchantmentLevel + + ", treasure=" + isTreasure + "), "; + stringValue += "Static Enchantments: {"; + int counter = 0; + for (Enchantment enchantment : enchantments.keySet()) { + stringValue += enchantment.getKey().getKey() + "-" + enchantments.get(enchantment).toString(); + counter += 1; + if (counter < enchantments.size()) { + stringValue += ", "; + } } - - /** - * Getter for probability - * @return - */ - public double getProbability() { - return probability; - } - - /** - * Sets the drop probability weight for this item. This value is compared to other weights of items in a drop table - * @param weight Weight value (higher --> more likely) - */ - public void setWeight(double weight) { - this.weight = weight; - } - - /** - * Getter for weight - * @return - */ - public double getWeight() { - return weight; - } - - public boolean isStaticProbability() { - if (probability == -1.0) { - return false; - } else { - return true; - } - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (!(o instanceof CustomItem)) { - return false; - } - - CustomItem otherCustomItem = (CustomItem) o; - return customItemEquals(otherCustomItem); - } - - public boolean customItemEquals(CustomItem otherCustomItem) { - if (material.equals(otherCustomItem.material) && - amount == otherCustomItem.amount && - minDurabilityPortion == otherCustomItem.minDurabilityPortion && - maxDurabilityPortion == otherCustomItem.maxDurabilityPortion && - minEnchantmentLevel == otherCustomItem.minEnchantmentLevel && - isTreasure == otherCustomItem.isTreasure && - enchantments.equals(otherCustomItem.enchantments) && - weight == otherCustomItem.weight && - probability == otherCustomItem.probability && - experienceDrop == otherCustomItem.experienceDrop && - itemName.equals(otherCustomItem.itemName)) { - return true; - } - return false; - } - - @Override - public String toString() { - String stringValue = ""; - stringValue += "["; - stringValue += "Material: " + this.material.toString() + ", "; - stringValue += "Amount: " + this.amount + ", "; - stringValue += "Durability: (" + this.minDurabilityPortion + ", " + this.maxDurabilityPortion + "), "; - stringValue += "Random Enchantment Range: (" + this.minEnchantmentLevel + ", " + this.maxEnchantmentLevel + ", treasure=" + isTreasure + "), "; - stringValue += "Static Enchantments: {"; - int counter = 0; - for (Enchantment enchantment : enchantments.keySet()) { - stringValue += enchantment.getKey().getKey() + "-" + enchantments.get(enchantment).toString(); - counter += 1; - if (counter < enchantments.size()) { - stringValue += ", "; - } - } - stringValue += "}, "; - if (probability != -1) { - stringValue += "Probability: " + probability + ", "; - } else { - stringValue += "Weight: " + weight + ", "; - } - stringValue += "Exp: " + experienceDrop; - stringValue += "]"; - return stringValue; + stringValue += "}, "; + if (probability != -1) { + stringValue += "Probability: " + probability + ", "; + } else { + stringValue += "Weight: " + weight + ", "; } + stringValue += "Exp: " + experienceDrop; + stringValue += "]"; + return stringValue; + } } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/CustomPotion.java b/src/main/java/mc/carlton/freerpg/customContainers/CustomPotion.java index f7ed1fc..af9cf89 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/CustomPotion.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/CustomPotion.java @@ -1,7 +1,10 @@ package mc.carlton.freerpg.customContainers; -import jdk.internal.org.jline.utils.Colors; -import mc.carlton.freerpg.utilities.UtilityMethods; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.utils.UtilityMethods; import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -12,241 +15,245 @@ import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionType; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; - public class CustomPotion extends CustomItem { - private PotionType potionType; - private boolean isUpgraded = false; - private boolean isExtended = false; - private List potionEffects = new ArrayList<>(); - private Color color; - private ArrayList colors = new ArrayList<>(); - private static Map potionEffectColors; - public CustomPotion(Map containerInformation) { - super(Material.POTION,containerInformation); - setPotionEffectColors(); - } + private static Map potionEffectColors; + private PotionType potionType; + private boolean isUpgraded = false; + private boolean isExtended = false; + private List potionEffects = new ArrayList<>(); + private Color color; + private ArrayList colors = new ArrayList<>(); - public CustomPotion() { - super(Material.POTION); - } + public CustomPotion(Map containerInformation) { + super(Material.POTION, containerInformation); + setPotionEffectColors(); + } - public void setPotion(PotionType potionType, boolean isUpgraded, boolean isExtended) { - this.potionType = potionType; - this.isUpgraded = isUpgraded; - this.isExtended = isExtended; - } + public CustomPotion() { + super(Material.POTION); + } - public ItemStack getPotion() { - ItemStack potion = getItemStackWithoutPotionEffects(); - PotionMeta potionMeta = (PotionMeta) potion.getItemMeta(); - if (potionType != null) { - potionMeta.setBasePotionData(new PotionData(potionType,isExtended,isUpgraded)); - } else { - for (PotionEffect potionEffect : potionEffects) { - potionMeta.addCustomEffect(potionEffect,true); - } - potionMeta.setColor(determinePotionColor()); - } - potion.setItemMeta(potionMeta); - return potion; - } + public void setPotion(PotionType potionType, boolean isUpgraded, boolean isExtended) { + this.potionType = potionType; + this.isUpgraded = isUpgraded; + this.isExtended = isExtended; + } - private Color determinePotionColor() { - if (color != null) { - return color; - } - if (colors.isEmpty()) { - ArrayList defaultColors = new ArrayList<>(); - for (PotionEffect potionEffect : potionEffects) { - defaultColors.add(potionEffectColors.get(potionEffect.getType())); - } - return mixColors(defaultColors); - } - return mixColors(colors); + public ItemStack getPotion() { + ItemStack potion = getItemStackWithoutPotionEffects(); + PotionMeta potionMeta = (PotionMeta) potion.getItemMeta(); + if (potionType != null) { + potionMeta.setBasePotionData(new PotionData(potionType, isExtended, isUpgraded)); + } else { + for (PotionEffect potionEffect : potionEffects) { + potionMeta.addCustomEffect(potionEffect, true); + } + potionMeta.setColor(determinePotionColor()); } + potion.setItemMeta(potionMeta); + return potion; + } - private Color mixColors(Collection colorsToBeMixed) { - if (colorsToBeMixed.isEmpty()) { - return Color.fromRGB(255,255,255); //Absolute default is white - } - int numberOfColors = colors.size(); - double red = 0; - double green = 0; - double blue = 0; - for (Color c : colors) { - red += c.getRed()/((double)numberOfColors); - green += c.getGreen()/((double)numberOfColors); - blue += c.getBlue()/((double)numberOfColors); - } - return Color.fromRGB( (int) Math.round(Math.min(Math.max(red,0),255)),(int) Math.round(Math.min(Math.max(green,0),255)), (int) Math.round(Math.min(Math.max(blue,0),255))); + public void setPotion(List potionEffects) { + this.potionEffects = potionEffects; + } + + private Color determinePotionColor() { + if (color != null) { + return color; + } + if (colors.isEmpty()) { + ArrayList defaultColors = new ArrayList<>(); + for (PotionEffect potionEffect : potionEffects) { + defaultColors.add(potionEffectColors.get(potionEffect.getType())); + } + return mixColors(defaultColors); } + return mixColors(colors); + } - public void setPotion(List potionEffects) { - this.potionEffects = potionEffects; + private Color mixColors(Collection colorsToBeMixed) { + if (colorsToBeMixed.isEmpty()) { + return Color.fromRGB(255, 255, 255); //Absolute default is white } + int numberOfColors = colors.size(); + double red = 0; + double green = 0; + double blue = 0; + for (Color c : colors) { + red += c.getRed() / ((double) numberOfColors); + green += c.getGreen() / ((double) numberOfColors); + blue += c.getBlue() / ((double) numberOfColors); + } + return Color.fromRGB((int) Math.round(Math.min(Math.max(red, 0), 255)), + (int) Math.round(Math.min(Math.max(green, 0), 255)), + (int) Math.round(Math.min(Math.max(blue, 0), 255))); + } - public void addPotionEffect(PotionEffect potionEffect) { - this.potionEffects.add(potionEffect); + public void addPotionEffect(PotionEffect potionEffect) { + this.potionEffects.add(potionEffect); - } + } - public void addPotionEffect(PotionEffectType potionEffectType,double duration, int level) { - PotionEffect potionEffect = new PotionEffect(potionEffectType,(int) Math.round(duration*20),level-1); - potionEffects.add(potionEffect); - } + public void addPotionEffect(PotionEffectType potionEffectType, double duration, int level) { + PotionEffect potionEffect = new PotionEffect(potionEffectType, (int) Math.round(duration * 20), + level - 1); + potionEffects.add(potionEffect); + } - public void setPotionColor(Color color) { - this.color = color; - } + public void setPotionColor(Color color) { + this.color = color; + } - public void setPotionColor(String colorString) { - this.color = UtilityMethods.getColorFromString(colorString); - } + public void setPotionColor(String colorString) { + this.color = UtilityMethods.getColorFromString(colorString); + } - public void addColor(Color color) { - colors.add(color); - } + public void addColor(Color color) { + colors.add(color); + } - public void removeColor(Color color) { - if (colors.contains(color)) { - colors.remove(color); - } + public void removeColor(Color color) { + if (colors.contains(color)) { + colors.remove(color); } + } - public void addColor(String colorString) { - addColor(UtilityMethods.getColorFromString(colorString)); - } + public void addColor(String colorString) { + addColor(UtilityMethods.getColorFromString(colorString)); + } - public void removeColor(String colorString) { - removeColor(UtilityMethods.getColorFromString(colorString)); - } + public void removeColor(String colorString) { + removeColor(UtilityMethods.getColorFromString(colorString)); + } - private void setPotionEffectColors() { - if (potionEffectColors.isEmpty()) { - PotionMeta potionMeta = ((PotionMeta) new ItemStack(Material.POTION).getItemMeta()); + private void setPotionEffectColors() { + if (potionEffectColors.isEmpty()) { + PotionMeta potionMeta = ((PotionMeta) new ItemStack(Material.POTION).getItemMeta()); - //Effects with predetermined color - potionMeta.setBasePotionData(new PotionData(PotionType.FIRE_RESISTANCE)); - potionEffectColors.put(PotionEffectType.FIRE_RESISTANCE,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.FIRE_RESISTANCE)); - potionEffectColors.put(PotionEffectType.FIRE_RESISTANCE,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.FIRE_RESISTANCE)); - potionEffectColors.put(PotionEffectType.FIRE_RESISTANCE,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.INSTANT_DAMAGE)); - potionEffectColors.put(PotionEffectType.HARM,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.INSTANT_HEAL)); - potionEffectColors.put(PotionEffectType.HEAL,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.STRENGTH)); - potionEffectColors.put(PotionEffectType.INCREASE_DAMAGE,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.INVISIBILITY)); - potionEffectColors.put(PotionEffectType.INVISIBILITY,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.JUMP)); - potionEffectColors.put(PotionEffectType.JUMP,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.SLOW_FALLING)); - potionEffectColors.put(PotionEffectType.LEVITATION,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.NIGHT_VISION)); - potionEffectColors.put(PotionEffectType.NIGHT_VISION,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.POISON)); - potionEffectColors.put(PotionEffectType.POISON,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.REGEN)); - potionEffectColors.put(PotionEffectType.REGENERATION,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.SLOWNESS)); - potionEffectColors.put(PotionEffectType.SLOW,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.SPEED)); - potionEffectColors.put(PotionEffectType.SPEED,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.WATER_BREATHING)); - potionEffectColors.put(PotionEffectType.WATER_BREATHING,potionMeta.getColor()); - potionMeta.setBasePotionData(new PotionData(PotionType.WEAKNESS)); - potionEffectColors.put(PotionEffectType.WEAKNESS,potionMeta.getColor()); + //Effects with predetermined color + potionMeta.setBasePotionData(new PotionData(PotionType.FIRE_RESISTANCE)); + potionEffectColors.put(PotionEffectType.FIRE_RESISTANCE, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.FIRE_RESISTANCE)); + potionEffectColors.put(PotionEffectType.FIRE_RESISTANCE, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.FIRE_RESISTANCE)); + potionEffectColors.put(PotionEffectType.FIRE_RESISTANCE, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.INSTANT_DAMAGE)); + potionEffectColors.put(PotionEffectType.HARM, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.INSTANT_HEAL)); + potionEffectColors.put(PotionEffectType.HEAL, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.STRENGTH)); + potionEffectColors.put(PotionEffectType.INCREASE_DAMAGE, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.INVISIBILITY)); + potionEffectColors.put(PotionEffectType.INVISIBILITY, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.JUMP)); + potionEffectColors.put(PotionEffectType.JUMP, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.SLOW_FALLING)); + potionEffectColors.put(PotionEffectType.LEVITATION, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.NIGHT_VISION)); + potionEffectColors.put(PotionEffectType.NIGHT_VISION, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.POISON)); + potionEffectColors.put(PotionEffectType.POISON, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.REGEN)); + potionEffectColors.put(PotionEffectType.REGENERATION, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.SLOWNESS)); + potionEffectColors.put(PotionEffectType.SLOW, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.SPEED)); + potionEffectColors.put(PotionEffectType.SPEED, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.WATER_BREATHING)); + potionEffectColors.put(PotionEffectType.WATER_BREATHING, potionMeta.getColor()); + potionMeta.setBasePotionData(new PotionData(PotionType.WEAKNESS)); + potionEffectColors.put(PotionEffectType.WEAKNESS, potionMeta.getColor()); - // Effects with no predetermined color - potionEffectColors.put(PotionEffectType.ABSORPTION,Color.fromRGB(196, 201, 34)); - potionEffectColors.put(PotionEffectType.BAD_OMEN,Color.fromRGB(150, 147, 147)); - potionEffectColors.put(PotionEffectType.CONDUIT_POWER,Color.fromRGB(119, 230, 252)); - potionEffectColors.put(PotionEffectType.CONFUSION,Color.fromRGB(116, 153, 130)); - potionEffectColors.put(PotionEffectType.DAMAGE_RESISTANCE,Color.fromRGB(46, 67, 143)); - potionEffectColors.put(PotionEffectType.DOLPHINS_GRACE,Color.fromRGB(0,0,0)); - potionEffectColors.put(PotionEffectType.FAST_DIGGING,Color.fromRGB(176, 189, 36)); - potionEffectColors.put(PotionEffectType.GLOWING,Color.fromRGB(239, 252, 50)); - potionEffectColors.put(PotionEffectType.HEALTH_BOOST,Color.fromRGB(252, 10, 192)); - potionEffectColors.put(PotionEffectType.HERO_OF_THE_VILLAGE,Color.fromRGB(33, 138, 10)); - potionEffectColors.put(PotionEffectType.HUNGER,Color.fromRGB(110, 76, 49)); - potionEffectColors.put(PotionEffectType.LUCK,Color.fromRGB(130, 219, 83)); - potionEffectColors.put(PotionEffectType.SATURATION,Color.fromRGB(219, 166, 86)); - potionEffectColors.put(PotionEffectType.UNLUCK,Color.fromRGB(50, 77, 61)); - potionEffectColors.put(PotionEffectType.WITHER,Color.fromRGB(59, 59, 59)); - } + // Effects with no predetermined color + potionEffectColors.put(PotionEffectType.ABSORPTION, Color.fromRGB(196, 201, 34)); + potionEffectColors.put(PotionEffectType.BAD_OMEN, Color.fromRGB(150, 147, 147)); + potionEffectColors.put(PotionEffectType.CONDUIT_POWER, Color.fromRGB(119, 230, 252)); + potionEffectColors.put(PotionEffectType.CONFUSION, Color.fromRGB(116, 153, 130)); + potionEffectColors.put(PotionEffectType.DAMAGE_RESISTANCE, Color.fromRGB(46, 67, 143)); + potionEffectColors.put(PotionEffectType.DOLPHINS_GRACE, Color.fromRGB(0, 0, 0)); + potionEffectColors.put(PotionEffectType.FAST_DIGGING, Color.fromRGB(176, 189, 36)); + potionEffectColors.put(PotionEffectType.GLOWING, Color.fromRGB(239, 252, 50)); + potionEffectColors.put(PotionEffectType.HEALTH_BOOST, Color.fromRGB(252, 10, 192)); + potionEffectColors.put(PotionEffectType.HERO_OF_THE_VILLAGE, Color.fromRGB(33, 138, 10)); + potionEffectColors.put(PotionEffectType.HUNGER, Color.fromRGB(110, 76, 49)); + potionEffectColors.put(PotionEffectType.LUCK, Color.fromRGB(130, 219, 83)); + potionEffectColors.put(PotionEffectType.SATURATION, Color.fromRGB(219, 166, 86)); + potionEffectColors.put(PotionEffectType.UNLUCK, Color.fromRGB(50, 77, 61)); + potionEffectColors.put(PotionEffectType.WITHER, Color.fromRGB(59, 59, 59)); } + } - @Override - public String toString() { - String stringValue = ""; - stringValue += "["; - stringValue += "Material: " + this.material.toString() + ", "; - stringValue += "Amount: " + this.amount + ", "; - stringValue += "Durability: (" + this.minDurabilityPortion + ", " + this.maxDurabilityPortion + "), "; - stringValue += "Random Enchantment Range: (" + this.minEnchantmentLevel + ", " + this.maxEnchantmentLevel + ", treasure=" + isTreasure + "), "; - stringValue += "Static Enchantments: {"; - int counter = 0; - for (Enchantment enchantment : enchantments.keySet()) { - stringValue += enchantment.getKey().getKey() + "-" + enchantments.get(enchantment).toString(); - counter += 1; - if (counter < enchantments.size()) { - stringValue += ", "; - } - } - stringValue += "}, "; - if (probability != -1) { - stringValue += "Probability: " + probability + ", "; - } else { - stringValue += "Weight: " + weight + ", "; - } - stringValue += "Exp: " + experienceDrop + ", "; - if (potionType != null) { - stringValue += "Potion: " + potionType.toString() + ", level: " + (isUpgraded ? 1 : 2) + ", duration: " + (isExtended ? "normal" : "extended") + ", "; - } - if (!potionEffects.isEmpty()) { - stringValue += "Potion Effects: {"; - int counter2 = 0; - for (PotionEffect potionEffect : potionEffects) { - stringValue += potionEffect.toString(); - counter2 +=1; - if (counter2 < potionEffects.size()) { - stringValue += ", "; - } - } - stringValue += "}"; + @Override + public String toString() { + String stringValue = ""; + stringValue += "["; + stringValue += "Material: " + this.material.toString() + ", "; + stringValue += "Amount: " + this.amount + ", "; + stringValue += + "Durability: (" + this.minDurabilityPortion + ", " + this.maxDurabilityPortion + "), "; + stringValue += + "Random Enchantment Range: (" + this.minEnchantmentLevel + ", " + this.maxEnchantmentLevel + + ", treasure=" + isTreasure + "), "; + stringValue += "Static Enchantments: {"; + int counter = 0; + for (Enchantment enchantment : enchantments.keySet()) { + stringValue += enchantment.getKey().getKey() + "-" + enchantments.get(enchantment).toString(); + counter += 1; + if (counter < enchantments.size()) { + stringValue += ", "; + } + } + stringValue += "}, "; + if (probability != -1) { + stringValue += "Probability: " + probability + ", "; + } else { + stringValue += "Weight: " + weight + ", "; + } + stringValue += "Exp: " + experienceDrop + ", "; + if (potionType != null) { + stringValue += + "Potion: " + potionType.toString() + ", level: " + (isUpgraded ? 1 : 2) + ", duration: " + + (isExtended ? "normal" : "extended") + ", "; + } + if (!potionEffects.isEmpty()) { + stringValue += "Potion Effects: {"; + int counter2 = 0; + for (PotionEffect potionEffect : potionEffects) { + stringValue += potionEffect.toString(); + counter2 += 1; + if (counter2 < potionEffects.size()) { + stringValue += ", "; } - stringValue += "]"; - return stringValue; + } + stringValue += "}"; } + stringValue += "]"; + return stringValue; + } - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (!(o instanceof CustomPotion)) { - return false; - } + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof CustomPotion)) { + return false; + } - CustomPotion otherCustomPotion = (CustomPotion) o; + CustomPotion otherCustomPotion = (CustomPotion) o; - if (!customItemEquals(otherCustomPotion)) { //Are inherited variables not equal? - return false; - } - if (potionType.equals(otherCustomPotion.potionType) && - isUpgraded == otherCustomPotion.isUpgraded && - isExtended == otherCustomPotion.isExtended && - potionEffects.equals(otherCustomPotion.potionEffects)) { - return true; - } - return false; + if (!customItemEquals(otherCustomPotion)) { //Are inherited variables not equal? + return false; + } + if (potionType.equals(otherCustomPotion.potionType) && + isUpgraded == otherCustomPotion.isUpgraded && + isExtended == otherCustomPotion.isExtended && + potionEffects.equals(otherCustomPotion.potionEffects)) { + return true; + } + return false; /* private PotionType potionType; private boolean isUpgraded = false; @@ -255,5 +262,5 @@ public boolean equals(Object o) { private Color color; private static Map potionEffectColors; */ - } + } } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/CustomRecipeCraftingGrid.java b/src/main/java/mc/carlton/freerpg/customContainers/CustomRecipeCraftingGrid.java index 8e90287..8d9e7b7 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/CustomRecipeCraftingGrid.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/CustomRecipeCraftingGrid.java @@ -1,5 +1,9 @@ package mc.carlton.freerpg.customContainers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; import mc.carlton.freerpg.FreeRPG; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -9,157 +13,153 @@ import org.bukkit.inventory.ShapedRecipe; import org.bukkit.plugin.Plugin; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - public class CustomRecipeCraftingGrid { - private ArrayList recipe = new ArrayList<>(); - private NamespacedKey key; - private boolean recipeRegistered; - private String keyString; - - public CustomRecipeCraftingGrid(ArrayList recipeCraftingGrid) { - this.recipe = recipeCraftingGrid; - } - - public ArrayList getRecipe() { - return recipe; - } - - public Recipe getBukkitRecipe() { - if (key != null) { - return Bukkit.getRecipe(key); - } - return null; - } - - public boolean doesBukkitRecipeMatch(Recipe recipe) { - if (recipe.equals(getBukkitRecipe())) { - return true; - } else { - return false; - } - } - - public NamespacedKey getKey() { - return key; - } - - public String getKeyString() { - return keyString; - } - - public void setRecipe(ArrayList recipe) { - this.recipe = recipe; - } - - public void setKey(NamespacedKey key) { - this.keyString = key.getKey(); - this.key = key; - } - - public void setKey(String keyString) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - this.keyString = keyString; - this.key = new NamespacedKey(plugin, keyString); - } - - private Map getItemToCharacterMap(ArrayList recipe){ - String[] letters = {"A","B","C","D","E","F","G","H","I"}; - Map recipeLettersMap = new HashMap<>(); - for (int i = 0; i < 9; i++) { - if (!recipe.get(i).equals(Material.AIR) && !recipe.get(i).equals(Material.CAVE_AIR) && !recipe.get(i).equals(Material.VOID_AIR) && recipe.get(i) != null) { - recipeLettersMap.put(i,letters[i]); - } - else { - recipeLettersMap.put(i," "); - } - } - return recipeLettersMap; - } - - private ArrayList getShapedRecipeLines(Map recipeLettersMap){ - String line1 = recipeLettersMap.get(0) + recipeLettersMap.get(1) + recipeLettersMap.get(2); - String line2 = recipeLettersMap.get(3) + recipeLettersMap.get(4) + recipeLettersMap.get(5); - String line3 = recipeLettersMap.get(6) + recipeLettersMap.get(7) + recipeLettersMap.get(8); - ArrayList craftingLines = new ArrayList<>(); - craftingLines.add(line1); - craftingLines.add(line2); - craftingLines.add(line3); - return craftingLines; - } - - public void unRegisterRecipe() { - if (key == null) { - return; - } - if (recipeRegistered) { - Bukkit.removeRecipe(key); - recipeRegistered = false; - } - } - public void registerRecipe(ItemStack itemStack, String id){ - if (recipe.isEmpty()) { - return; //No recipe to register - } - unRegisterRecipe(); //Unregisters recipe (if an old recipe was registered) - setKey(id); - registerRecipeHelper(itemStack); - } - - public void registerRecipe(ItemStack itemStack){ - if (recipe.isEmpty()) { - return; //No recipe to register - } - if (key == null) { - return; - } - unRegisterRecipe(); //Unregisters recipe (if it is registered already) - registerRecipeHelper(itemStack); - } - - private void registerRecipeHelper(ItemStack itemStack) { - ShapedRecipe shapedRecipe = new ShapedRecipe(key, itemStack); - Map recipeLettersMap = getItemToCharacterMap(recipe); - ArrayList shapeLines = getShapedRecipeLines(recipeLettersMap); - shapedRecipe.shape(shapeLines.get(0), shapeLines.get(1), shapeLines.get(2)); - for (int index : recipeLettersMap.keySet()) { - String character = recipeLettersMap.get(index); - if (!character.equalsIgnoreCase(" ")) { - shapedRecipe.setIngredient(character.charAt(0), recipe.get(index)); - } - } - Bukkit.addRecipe(shapedRecipe); - recipeRegistered = true; - } - - @Override - public boolean equals(Object object){ - if (!(object instanceof CustomRecipeCraftingGrid)){ - return false; - } - CustomRecipeCraftingGrid otherCustomRecipeCraftingGrid = (CustomRecipeCraftingGrid) object; - if (this.recipe.equals(otherCustomRecipeCraftingGrid.recipe)) { - return true; - } - return false; - } - - @Override - public String toString() { - return "CustomRecipeCraftingGrid{" + - "recipe=" + recipe + - ", key=" + key + - ", recipeRegistered=" + recipeRegistered + - ", keyString='" + keyString + '\'' + - '}'; - } - - @Override - public int hashCode() { - return Objects.hash(recipe); - } + private ArrayList recipe = new ArrayList<>(); + private NamespacedKey key; + private boolean recipeRegistered; + private String keyString; + + public CustomRecipeCraftingGrid(ArrayList recipeCraftingGrid) { + this.recipe = recipeCraftingGrid; + } + + public ArrayList getRecipe() { + return recipe; + } + + public void setRecipe(ArrayList recipe) { + this.recipe = recipe; + } + + public Recipe getBukkitRecipe() { + if (key != null) { + return Bukkit.getRecipe(key); + } + return null; + } + + public boolean doesBukkitRecipeMatch(Recipe recipe) { + if (recipe.equals(getBukkitRecipe())) { + return true; + } else { + return false; + } + } + + public NamespacedKey getKey() { + return key; + } + + public void setKey(NamespacedKey key) { + this.keyString = key.getKey(); + this.key = key; + } + + public void setKey(String keyString) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + this.keyString = keyString; + this.key = new NamespacedKey(plugin, keyString); + } + + public String getKeyString() { + return keyString; + } + + private Map getItemToCharacterMap(ArrayList recipe) { + String[] letters = {"A", "B", "C", "D", "E", "F", "G", "H", "I"}; + Map recipeLettersMap = new HashMap<>(); + for (int i = 0; i < 9; i++) { + if (!recipe.get(i).equals(Material.AIR) && !recipe.get(i).equals(Material.CAVE_AIR) + && !recipe.get(i).equals(Material.VOID_AIR) && recipe.get(i) != null) { + recipeLettersMap.put(i, letters[i]); + } else { + recipeLettersMap.put(i, " "); + } + } + return recipeLettersMap; + } + + private ArrayList getShapedRecipeLines(Map recipeLettersMap) { + String line1 = recipeLettersMap.get(0) + recipeLettersMap.get(1) + recipeLettersMap.get(2); + String line2 = recipeLettersMap.get(3) + recipeLettersMap.get(4) + recipeLettersMap.get(5); + String line3 = recipeLettersMap.get(6) + recipeLettersMap.get(7) + recipeLettersMap.get(8); + ArrayList craftingLines = new ArrayList<>(); + craftingLines.add(line1); + craftingLines.add(line2); + craftingLines.add(line3); + return craftingLines; + } + + public void unRegisterRecipe() { + if (key == null) { + return; + } + if (recipeRegistered) { + Bukkit.removeRecipe(key); + recipeRegistered = false; + } + } + + public void registerRecipe(ItemStack itemStack, String id) { + if (recipe.isEmpty()) { + return; //No recipe to register + } + unRegisterRecipe(); //Unregisters recipe (if an old recipe was registered) + setKey(id); + registerRecipeHelper(itemStack); + } + + public void registerRecipe(ItemStack itemStack) { + if (recipe.isEmpty()) { + return; //No recipe to register + } + if (key == null) { + return; + } + unRegisterRecipe(); //Unregisters recipe (if it is registered already) + registerRecipeHelper(itemStack); + } + + private void registerRecipeHelper(ItemStack itemStack) { + ShapedRecipe shapedRecipe = new ShapedRecipe(key, itemStack); + Map recipeLettersMap = getItemToCharacterMap(recipe); + ArrayList shapeLines = getShapedRecipeLines(recipeLettersMap); + shapedRecipe.shape(shapeLines.get(0), shapeLines.get(1), shapeLines.get(2)); + for (int index : recipeLettersMap.keySet()) { + String character = recipeLettersMap.get(index); + if (!character.equalsIgnoreCase(" ")) { + shapedRecipe.setIngredient(character.charAt(0), recipe.get(index)); + } + } + Bukkit.addRecipe(shapedRecipe); + recipeRegistered = true; + } + + @Override + public boolean equals(Object object) { + if (!(object instanceof CustomRecipeCraftingGrid)) { + return false; + } + CustomRecipeCraftingGrid otherCustomRecipeCraftingGrid = (CustomRecipeCraftingGrid) object; + if (this.recipe.equals(otherCustomRecipeCraftingGrid.recipe)) { + return true; + } + return false; + } + + @Override + public String toString() { + return "CustomRecipeCraftingGrid{" + + "recipe=" + recipe + + ", key=" + key + + ", recipeRegistered=" + recipeRegistered + + ", keyString='" + keyString + '\'' + + '}'; + } + + @Override + public int hashCode() { + return Objects.hash(recipe); + } } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/OldCustomPotion.java b/src/main/java/mc/carlton/freerpg/customContainers/OldCustomPotion.java index 0b7fc54..fedb27a 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/OldCustomPotion.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/OldCustomPotion.java @@ -1,6 +1,6 @@ package mc.carlton.freerpg.customContainers; -import mc.carlton.freerpg.globalVariables.StringsAndOtherData; +import mc.carlton.freerpg.utils.globalVariables.StringsAndOtherData; import org.bukkit.ChatColor; import org.bukkit.Color; import org.bukkit.Material; @@ -12,70 +12,71 @@ import org.bukkit.potion.PotionEffectType; public class OldCustomPotion { - public PotionEffectType potionEffectType; - public Material ingredient; - public int potionDuration; - public Color color; - public String potionName; - public OldCustomPotion() { - this.potionEffectType = null; - this.ingredient = null; - this.potionDuration = 9; - this.color = null; - this.potionName = null; - } + public PotionEffectType potionEffectType; + public Material ingredient; + public int potionDuration; + public Color color; + public String potionName; - public Color getColor() { - return color; - } + public OldCustomPotion() { + this.potionEffectType = null; + this.ingredient = null; + this.potionDuration = 9; + this.color = null; + this.potionName = null; + } - public int getPotionDuration() { - return potionDuration; - } + public Color getColor() { + return color; + } - public Material getIngredient() { - return ingredient; - } + public void setColor(Color color) { + this.color = color; + } - public PotionEffectType getPotionEffectType() { - return potionEffectType; - } + public int getPotionDuration() { + return potionDuration; + } - public String getPotionName() { - return potionName; - } + public void setPotionDuration(int potionDuration) { + this.potionDuration = potionDuration; + } - public void setColor(Color color) { - this.color = color; - } + public Material getIngredient() { + return ingredient; + } - public void setIngredient(Material ingredient) { - this.ingredient = ingredient; - } + public void setIngredient(Material ingredient) { + this.ingredient = ingredient; + } - public void setPotionDuration(int potionDuration) { - this.potionDuration = potionDuration; - } + public PotionEffectType getPotionEffectType() { + return potionEffectType; + } - public void setPotionEffectType(PotionEffectType potionEffectType) { - this.potionEffectType = potionEffectType; - } + public void setPotionEffectType(PotionEffectType potionEffectType) { + this.potionEffectType = potionEffectType; + } - public void setPotionName() { - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - this.potionName = stringsAndOtherData.getPotionNameFromEffect(potionEffectType); - } + public String getPotionName() { + return potionName; + } - public ItemStack getPotionItemStack() { - ItemStack potion = new ItemStack(Material.POTION,1); - potion.addUnsafeEnchantment(Enchantment.LOYALTY,1); - PotionMeta meta = (PotionMeta) potion.getItemMeta(); - meta.addCustomEffect(new PotionEffect(potionEffectType,potionDuration*20,0),true); - meta.addItemFlags(ItemFlag.HIDE_ENCHANTS); - meta.setColor(color); - meta.setDisplayName(ChatColor.RESET + potionName); - potion.setItemMeta(meta); - return potion; - } + public void setPotionName() { + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + this.potionName = stringsAndOtherData.getPotionNameFromEffect(potionEffectType); + } + + public ItemStack getPotionItemStack() { + ItemStack potion = new ItemStack(Material.POTION, 1); + potion.addUnsafeEnchantment(Enchantment.LOYALTY, 1); + PotionMeta meta = (PotionMeta) potion.getItemMeta(); + meta.addCustomEffect(new PotionEffect(potionEffectType, potionDuration * 20, 0), true); + meta.addItemFlags(ItemFlag.HIDE_ENCHANTS); + meta.setColor(color); + meta.setDisplayName(ChatColor.RESET + potionName); + potion.setItemMeta(meta); + return potion; + } } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomBrewable.java b/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomBrewable.java index f960fbb..ad5a4ca 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomBrewable.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomBrewable.java @@ -2,12 +2,11 @@ import org.bukkit.inventory.ItemStack; -import java.util.HashSet; - public class CustomBrewable { - private ItemStack outputItem; - private ItemStack ingredient; - private ItemStack potionSlotItem; + + private ItemStack outputItem; + private ItemStack ingredient; + private ItemStack potionSlotItem; } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomEffect.java b/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomEffect.java index 189215f..63f9070 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomEffect.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomEffect.java @@ -1,114 +1,120 @@ package mc.carlton.freerpg.customContainers.collections; -import mc.carlton.freerpg.customContainers.CustomEffectPiece; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - import java.util.Collection; import java.util.HashSet; import java.util.Random; +import mc.carlton.freerpg.customContainers.CustomEffectPiece; +import org.bukkit.entity.LivingEntity; +import org.bukkit.potion.PotionEffect; public class CustomEffect { - private HashSet customEffectPieces = new HashSet<>(); - private double probability = 1.0; - /** - * Constuctor; initializes the custom effect as and empty set of effects - */ - public CustomEffect(){ - this(new HashSet<>()); - } + private HashSet customEffectPieces = new HashSet<>(); + private double probability = 1.0; - /** - * Constructor, initializes the custom effect as a set of effects - * @param effects a collection of CustomEFfectPiece classes - */ - public CustomEffect(Collection effects){ - addEffects(effects); - } + /** + * Constuctor; initializes the custom effect as and empty set of effects + */ + public CustomEffect() { + this(new HashSet<>()); + } - /** - * Adds an effect to the CustomEffect - * @param effect a CustomEffectPiece - */ - public void addEffect(CustomEffectPiece effect) { - customEffectPieces.add(effect); - } + /** + * Constructor, initializes the custom effect as a set of effects + * + * @param effects a collection of CustomEFfectPiece classes + */ + public CustomEffect(Collection effects) { + addEffects(effects); + } - /** - * Adds effect(s) to the CustomEffect - * @param effects a collection of CustomEffectPiece classes - */ - public void addEffects(Collection effects) { - for (CustomEffectPiece effect : effects) { - addEffect(effect); - } - } + /** + * Adds an effect to the CustomEffect + * + * @param effect a CustomEffectPiece + */ + public void addEffect(CustomEffectPiece effect) { + customEffectPieces.add(effect); + } - /** - * Getter for set of customEffectPieces - * @return A set of all the customEffectPieces that make up the CustomEffect - */ - public HashSet getCustomEffectPieces() { - return customEffectPieces; + /** + * Adds effect(s) to the CustomEffect + * + * @param effects a collection of CustomEffectPiece classes + */ + public void addEffects(Collection effects) { + for (CustomEffectPiece effect : effects) { + addEffect(effect); } + } - /** - * Getter for probability - * @return the probability that this effect activates (as a whole) - */ - public double getProbability() { - return probability; - } + /** + * Getter for set of customEffectPieces + * + * @return A set of all the customEffectPieces that make up the CustomEffect + */ + public HashSet getCustomEffectPieces() { + return customEffectPieces; + } - /** - * Setter for probability - * @param probability the probability that this effect activates (as a whole) - */ - public void setProbability(double probability) { - this.probability = probability; - } + /** + * Getter for probability + * + * @return the probability that this effect activates (as a whole) + */ + public double getProbability() { + return probability; + } - /** - * Gives an entity the potion effect(s) using an initial seed for the random number generator - * @param entity a LivingEntity that will receive the CustomEffect - * @param seed a seed for the random number generator - */ - public void giveEntityEffect(LivingEntity entity, long seed) { - Random random = new Random(seed); - HashSet effectsToGive = new HashSet<>(); - for (CustomEffectPiece customEffectPiece : customEffectPieces) { - if (random.nextDouble() < customEffectPiece.getProbability()) { - effectsToGive.add(customEffectPiece.getPotionEffect()); - } - } - entity.addPotionEffects(effectsToGive); - } + /** + * Setter for probability + * + * @param probability the probability that this effect activates (as a whole) + */ + public void setProbability(double probability) { + this.probability = probability; + } - /** - * Gives an entity the potion effect(s) - * @param entity a LivingEntity that will receive the CustomEffect - */ - public void giveEntityEffect(LivingEntity entity) { - giveEntityEffect(entity,new Random().nextLong()); + /** + * Gives an entity the potion effect(s) using an initial seed for the random number generator + * + * @param entity a LivingEntity that will receive the CustomEffect + * @param seed a seed for the random number generator + */ + public void giveEntityEffect(LivingEntity entity, long seed) { + Random random = new Random(seed); + HashSet effectsToGive = new HashSet<>(); + for (CustomEffectPiece customEffectPiece : customEffectPieces) { + if (random.nextDouble() < customEffectPiece.getProbability()) { + effectsToGive.add(customEffectPiece.getPotionEffect()); + } } + entity.addPotionEffects(effectsToGive); + } - /* - This method may not be necessary - IT IS ALSO INCOMPLETE AS A RESULT - */ - private boolean shouldAddEffect(LivingEntity entity, CustomEffectPiece customEffectPiece) { - if (!entity.hasPotionEffect(customEffectPiece.getEffectType())) { - return true; - } - PotionEffect currentEffect = entity.getPotionEffect(customEffectPiece.getEffectType()); - int futureCurrentEffectLength = currentEffect.getDuration() - customEffectPiece.getDelay(); //The length of the effect when the effect may be added, in ticks - if (futureCurrentEffectLength > customEffectPiece.getDuration()) { - return false; - } - return true; + /** + * Gives an entity the potion effect(s) + * + * @param entity a LivingEntity that will receive the CustomEffect + */ + public void giveEntityEffect(LivingEntity entity) { + giveEntityEffect(entity, new Random().nextLong()); + } + + /* + This method may not be necessary + IT IS ALSO INCOMPLETE AS A RESULT + */ + private boolean shouldAddEffect(LivingEntity entity, CustomEffectPiece customEffectPiece) { + if (!entity.hasPotionEffect(customEffectPiece.getEffectType())) { + return true; + } + PotionEffect currentEffect = entity.getPotionEffect(customEffectPiece.getEffectType()); + int futureCurrentEffectLength = currentEffect.getDuration() + - customEffectPiece.getDelay(); //The length of the effect when the effect may be added, in ticks + if (futureCurrentEffectLength > customEffectPiece.getDuration()) { + return false; } + return true; + } } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomRecipe.java b/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomRecipe.java index 5cc460f..566cedc 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomRecipe.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/collections/CustomRecipe.java @@ -1,201 +1,209 @@ package mc.carlton.freerpg.customContainers.collections; -import mc.carlton.freerpg.customContainers.CustomItem; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; import mc.carlton.freerpg.customContainers.CustomRecipeCraftingGrid; -import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.Recipe; -import org.bukkit.inventory.ShapedRecipe; - -import java.util.*; public class CustomRecipe { - private CustomRecipeCraftingGrid initialRecipe; - private HashSet recipeVariants = new HashSet<>(); - private ItemStack outputItem; - private int xpCost; - private String keyStringBase; - - public CustomRecipe(CustomRecipeCraftingGrid initialRecipe, ItemStack outputItem, int xpCost, String keyBase) { - this.initialRecipe = initialRecipe; - recipeVariants.add(initialRecipe); - this.outputItem = outputItem; - this.xpCost = xpCost; - this.keyStringBase = keyBase; - } - - public CustomRecipe(CustomRecipeCraftingGrid initialRecipe, ItemStack outputItem, String keyBase) { - this(initialRecipe,outputItem, 0, keyBase); - } - - public CustomRecipe(ArrayList recipe, ItemStack outputItem, String keyBase) { - this(new CustomRecipeCraftingGrid(recipe),outputItem,keyBase); - } - - public CustomRecipe(ArrayList recipe, ItemStack outputItem, int xpCost, String keyBase) { - this(new CustomRecipeCraftingGrid(recipe), outputItem,xpCost,keyBase); - } - public ItemStack getOutputCustomItem() { - return outputItem; - } - - public Material getOutputMaterial() { - return outputItem.getType(); - } - - public int getXpCost() { - return xpCost; - } - - public String getKeyStringBase() { - return keyStringBase; - } - - public void setOutputItem(ItemStack outputItem) { - this.outputItem = outputItem; - } - - public void setXpCost(int xpCost) { - this.xpCost = xpCost; - } - - public void setKeyStringBase(String keyStringBase) { - this.keyStringBase = keyStringBase; - } - - public void addRecipeVariant(CustomRecipeCraftingGrid recipeVariant) { - this.recipeVariants.add(recipeVariant); - } - - public void addRecipeVariants(Collection recipeVariants) { - for (CustomRecipeCraftingGrid recipeVariant : recipeVariants) { - addRecipeVariant(recipeVariant); + private CustomRecipeCraftingGrid initialRecipe; + private HashSet recipeVariants = new HashSet<>(); + private ItemStack outputItem; + private int xpCost; + private String keyStringBase; + + public CustomRecipe(CustomRecipeCraftingGrid initialRecipe, ItemStack outputItem, int xpCost, + String keyBase) { + this.initialRecipe = initialRecipe; + recipeVariants.add(initialRecipe); + this.outputItem = outputItem; + this.xpCost = xpCost; + this.keyStringBase = keyBase; + } + + public CustomRecipe(CustomRecipeCraftingGrid initialRecipe, ItemStack outputItem, + String keyBase) { + this(initialRecipe, outputItem, 0, keyBase); + } + + public CustomRecipe(ArrayList recipe, ItemStack outputItem, String keyBase) { + this(new CustomRecipeCraftingGrid(recipe), outputItem, keyBase); + } + + public CustomRecipe(ArrayList recipe, ItemStack outputItem, int xpCost, + String keyBase) { + this(new CustomRecipeCraftingGrid(recipe), outputItem, xpCost, keyBase); + } + + public ItemStack getOutputCustomItem() { + return outputItem; + } + + public Material getOutputMaterial() { + return outputItem.getType(); + } + + public int getXpCost() { + return xpCost; + } + + public void setXpCost(int xpCost) { + this.xpCost = xpCost; + } + + public String getKeyStringBase() { + return keyStringBase; + } + + public void setKeyStringBase(String keyStringBase) { + this.keyStringBase = keyStringBase; + } + + public void setOutputItem(ItemStack outputItem) { + this.outputItem = outputItem; + } + + public void addRecipeVariant(CustomRecipeCraftingGrid recipeVariant) { + this.recipeVariants.add(recipeVariant); + } + + public void addRecipeVariants(Collection recipeVariants) { + for (CustomRecipeCraftingGrid recipeVariant : recipeVariants) { + addRecipeVariant(recipeVariant); + } + } + + public void addTranslatedVariants() { + addRecipeVariants(getTranslatedVariants()); + } + + public void registerRecipeAndVariants() { + int counter = 0; + for (CustomRecipeCraftingGrid recipeVariant : recipeVariants) { + recipeVariant.registerRecipe(this.outputItem, keyStringBase + "_" + counter); + counter += 1; + } + } + + public boolean isRecipeMatch(Recipe recipe) { + for (CustomRecipeCraftingGrid recipeVariant : recipeVariants) { + if (recipeVariant.doesBukkitRecipeMatch(recipe)) { + return true; + } + } + return false; + } + + private HashSet getTranslatedVariants() { + if (!initialRecipe.getRecipe().isEmpty()) { + return getTranslatedVariants(initialRecipe); + } + return null; + } + + private HashSet getTranslatedVariants( + CustomRecipeCraftingGrid initialRecipe) { + return getTranslatedVariants(initialRecipe.getRecipe()); + } + + private HashSet getTranslatedVariants( + ArrayList initialRecipe) { + HashSet translatedVariants = new HashSet<>(); + ArrayList indices = getOccupiedIndicesInRecipe(initialRecipe); + + if (indices.size() + >= 7) { //If there are 7 unique items in the grid, there is never a possible shift + translatedVariants.add(new CustomRecipeCraftingGrid(initialRecipe)); + return translatedVariants; + } + + for (int i = -2; i <= 2; i++) { //Up and down shifting + for (int j = -2; j <= 2; j++) { //Left and right shifting + //create shifted indices + boolean possibleFormat = true; + ArrayList shiftedIndices = new ArrayList<>(); + shiftedIndicesLoop: + for (int index : indices) { + int newIndex = getShiftedCraftingIndex(index, i, j); + if (newIndex == -1) { + possibleFormat = false; + break shiftedIndicesLoop; + } else { + shiftedIndices.add(newIndex); + } } - } - public void addTranslatedVariants() { - addRecipeVariants(getTranslatedVariants()); - } - - public void registerRecipeAndVariants() { - int counter = 0; - for (CustomRecipeCraftingGrid recipeVariant : recipeVariants) { - recipeVariant.registerRecipe(this.outputItem,keyStringBase+"_"+counter); - counter += 1; + //If all shifted indices are possible, add it to the list of possible recipes + if (possibleFormat) { + ArrayList possibleRecipe = getTransformedRecipe(initialRecipe, shiftedIndices); + translatedVariants.add(new CustomRecipeCraftingGrid(possibleRecipe)); } - } - - public boolean isRecipeMatch(Recipe recipe) { - for (CustomRecipeCraftingGrid recipeVariant : recipeVariants) { - if (recipeVariant.doesBukkitRecipeMatch(recipe)) { - return true; - } - } - return false; - } - - private HashSet getTranslatedVariants() { - if (!initialRecipe.getRecipe().isEmpty()) { - return getTranslatedVariants(initialRecipe); - } - return null; - } - - private HashSet getTranslatedVariants(CustomRecipeCraftingGrid initialRecipe) { - return getTranslatedVariants(initialRecipe.getRecipe()); - } - - private HashSet getTranslatedVariants(ArrayList initialRecipe) { - HashSet translatedVariants = new HashSet<>(); - ArrayList indices = getOccupiedIndicesInRecipe(initialRecipe); - - if (indices.size() >= 7) { //If there are 7 unique items in the grid, there is never a possible shift - translatedVariants.add(new CustomRecipeCraftingGrid(initialRecipe)); - return translatedVariants; - } - - for (int i = -2; i <= 2 ; i++) { //Up and down shifting - for (int j = -2; j <= 2; j++) { //Left and right shifting - //create shifted indices - boolean possibleFormat = true; - ArrayList shiftedIndices = new ArrayList<>(); - shiftedIndicesLoop: - for (int index : indices) { - int newIndex = getShiftedCraftingIndex(index,i,j); - if (newIndex == -1) { - possibleFormat = false; - break shiftedIndicesLoop; - } - else{ - shiftedIndices.add(newIndex); - } - } - - //If all shifted indices are possible, add it to the list of possible recipes - if (possibleFormat) { - ArrayList possibleRecipe = getTransformedRecipe(initialRecipe,shiftedIndices); - translatedVariants.add(new CustomRecipeCraftingGrid(possibleRecipe)); - } - } - } - return translatedVariants; - } - - private int getShiftedCraftingIndex(int originalIndex,int vertShift,int horzShift) { - //Convert original index to row/column - int row = Math.floorDiv(originalIndex,3); - int column = originalIndex % 3; - //Add the shift - int newRow = row+vertShift; - int newColumn = column+horzShift; - //Determine if the shift yeilds a new recipe still inside the crafting grid - if (newRow < 0 || newRow > 2) { - return -1; - } - if (newColumn <0 || newColumn > 2) { - return -1; - } - return newRow*3 + newColumn; - - } - - private ArrayList getOccupiedIndicesInRecipe(ArrayList recipe){ - ArrayList indices = new ArrayList<>(); - for (int i=0; i< recipe.size();i++) { - if (!recipe.get(i).equals(Material.AIR) && !recipe.get(i).equals(Material.CAVE_AIR) && !recipe.get(i).equals(Material.VOID_AIR) && recipe.get(i) != null) { - indices.add(i); - } - } - return indices; - } - - private ArrayList getTransformedRecipe(ArrayList initialRecipe,ArrayList newIndices) { - ArrayList indices = getOccupiedIndicesInRecipe(initialRecipe); - Map transformationMap = new HashMap<>(); - for (int i = 0; i < indices.size(); i++) { - transformationMap.put(indices.get(i),newIndices.get(i)); - } - ArrayList newRecipe = new ArrayList<>(); - for (int i = 0; i < 9; i++) { - newRecipe.add(Material.AIR); - } - for (int index : transformationMap.keySet()) { - int newIndex = transformationMap.get(index); - newRecipe.set(newIndex,initialRecipe.get(index)); - } - return newRecipe; - } - - @Override - public String toString() { - return "CustomRecipe{" + - "initialRecipe=" + initialRecipe + - ", Number of Variants=" + recipeVariants.size() + - ", outputItem=" + outputItem + - ", xpCost=" + xpCost + - ", keyStringBase='" + keyStringBase + '\'' + - '}'; - } + } + } + return translatedVariants; + } + + private int getShiftedCraftingIndex(int originalIndex, int vertShift, int horzShift) { + //Convert original index to row/column + int row = Math.floorDiv(originalIndex, 3); + int column = originalIndex % 3; + //Add the shift + int newRow = row + vertShift; + int newColumn = column + horzShift; + //Determine if the shift yeilds a new recipe still inside the crafting grid + if (newRow < 0 || newRow > 2) { + return -1; + } + if (newColumn < 0 || newColumn > 2) { + return -1; + } + return newRow * 3 + newColumn; + + } + + private ArrayList getOccupiedIndicesInRecipe(ArrayList recipe) { + ArrayList indices = new ArrayList<>(); + for (int i = 0; i < recipe.size(); i++) { + if (!recipe.get(i).equals(Material.AIR) && !recipe.get(i).equals(Material.CAVE_AIR) + && !recipe.get(i).equals(Material.VOID_AIR) && recipe.get(i) != null) { + indices.add(i); + } + } + return indices; + } + + private ArrayList getTransformedRecipe(ArrayList initialRecipe, + ArrayList newIndices) { + ArrayList indices = getOccupiedIndicesInRecipe(initialRecipe); + Map transformationMap = new HashMap<>(); + for (int i = 0; i < indices.size(); i++) { + transformationMap.put(indices.get(i), newIndices.get(i)); + } + ArrayList newRecipe = new ArrayList<>(); + for (int i = 0; i < 9; i++) { + newRecipe.add(Material.AIR); + } + for (int index : transformationMap.keySet()) { + int newIndex = transformationMap.get(index); + newRecipe.set(newIndex, initialRecipe.get(index)); + } + return newRecipe; + } + + @Override + public String toString() { + return "CustomRecipe{" + + "initialRecipe=" + initialRecipe + + ", Number of Variants=" + recipeVariants.size() + + ", outputItem=" + outputItem + + ", xpCost=" + xpCost + + ", keyStringBase='" + keyStringBase + '\'' + + '}'; + } } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/collections/DropTable.java b/src/main/java/mc/carlton/freerpg/customContainers/collections/DropTable.java index 8384330..ebd5834 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/collections/DropTable.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/collections/DropTable.java @@ -1,155 +1,166 @@ package mc.carlton.freerpg.customContainers.collections; -import mc.carlton.freerpg.customContainers.CustomItem; -import org.bukkit.inventory.ItemStack; - import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Random; +import mc.carlton.freerpg.customContainers.CustomItem; +import org.bukkit.inventory.ItemStack; public class DropTable { - private ArrayList weightedProbabilityDrops = new ArrayList<>(); - private ArrayList staticProbabilityDrops = new ArrayList<>(); - - /** - * Constructor - * @param drops pre-made drop table - */ - public DropTable(List drops) { - addDrops(drops); - } - - /** - * Constructor (empty drop table entries) - */ - public DropTable() { - this(new ArrayList<>()); - } - - /** - * Adds a single drop to the dropTable and categorizes it - * @param drop a CustomItem - */ - public void addDrop(CustomItem drop) { - if (drop.isStaticProbability()) { - staticProbabilityDrops.add(drop); - } else { - weightedProbabilityDrops.add(drop); - } - } - - /** - * Adds multiple drops to the drop table and categorizes them - * @param drops a collection of CustomItems - */ - public void addDrops(Collection drops) { - for (CustomItem drop : drops) { - addDrop(drop); - } - } - /** - * Removes a drop from the drop table - * @param drop a CustomItem - */ - public void removeDrop(CustomItem drop) { - if (drop.isStaticProbability()) { - staticProbabilityDrops.remove(drop); - } else { - weightedProbabilityDrops.remove(drop); - } + private ArrayList weightedProbabilityDrops = new ArrayList<>(); + private ArrayList staticProbabilityDrops = new ArrayList<>(); + + /** + * Constructor + * + * @param drops pre-made drop table + */ + public DropTable(List drops) { + addDrops(drops); + } + + /** + * Constructor (empty drop table entries) + */ + public DropTable() { + this(new ArrayList<>()); + } + + /** + * Adds a single drop to the dropTable and categorizes it + * + * @param drop a CustomItem + */ + public void addDrop(CustomItem drop) { + if (drop.isStaticProbability()) { + staticProbabilityDrops.add(drop); + } else { + weightedProbabilityDrops.add(drop); } - - /** - * Removes multiple drops from the drop table - * @param drops a collection of CustomItems - */ - public void removeDrops(Collection drops) { - for (CustomItem drop : drops) { - removeDrop(drop); - } + } + + /** + * Adds multiple drops to the drop table and categorizes them + * + * @param drops a collection of CustomItems + */ + public void addDrops(Collection drops) { + for (CustomItem drop : drops) { + addDrop(drop); } - - /** - * Rolls for a custom item in the drop table - * @return the random CustomItem - */ - public CustomItem getRolledCustomItem() { - return getRolledCustomItem(new Random().nextLong()); //Uses another random class to generate a random seed + } + + /** + * Removes a drop from the drop table + * + * @param drop a CustomItem + */ + public void removeDrop(CustomItem drop) { + if (drop.isStaticProbability()) { + staticProbabilityDrops.remove(drop); + } else { + weightedProbabilityDrops.remove(drop); } - - /** - * Rolls for a custom item in the drop table using a set seed - * @param seed an initial seed used to construct Random() - * @return the random CustomItem - */ - public CustomItem getRolledCustomItem(long seed) { - Random random = new Random(seed); - double initialRoll = random.nextDouble(); - double staticProbabilitySum = 0.0; - for (CustomItem drop : staticProbabilityDrops) { - staticProbabilitySum += drop.getProbability(); - if (initialRoll < staticProbabilitySum) { - return drop; - } - } - double totalWeight = getTotalWeight(); - double randomWeightValue = random.nextDouble()*totalWeight; - double weightSum = 0.0; - for (CustomItem drop : weightedProbabilityDrops) { - weightSum += drop.getWeight(); - if (randomWeightValue < weightSum) { - return drop; - } - } - return null; //The drop tables are empty (or something went wrong) + } + + /** + * Removes multiple drops from the drop table + * + * @param drops a collection of CustomItems + */ + public void removeDrops(Collection drops) { + for (CustomItem drop : drops) { + removeDrop(drop); } - - public boolean isEmpty() { - return (staticProbabilityDrops.isEmpty() && weightedProbabilityDrops.isEmpty()); + } + + /** + * Rolls for a custom item in the drop table + * + * @return the random CustomItem + */ + public CustomItem getRolledCustomItem() { + return getRolledCustomItem( + new Random().nextLong()); //Uses another random class to generate a random seed + } + + /** + * Rolls for a custom item in the drop table using a set seed + * + * @param seed an initial seed used to construct Random() + * @return the random CustomItem + */ + public CustomItem getRolledCustomItem(long seed) { + Random random = new Random(seed); + double initialRoll = random.nextDouble(); + double staticProbabilitySum = 0.0; + for (CustomItem drop : staticProbabilityDrops) { + staticProbabilitySum += drop.getProbability(); + if (initialRoll < staticProbabilitySum) { + return drop; + } } - - /** - * Rolls for a custom item in the drop table, and returns the ItemStack representation - * @return the ItemStack representation of the random CustomItem - */ - public ItemStack getRolledItemStack() { - return getRolledCustomItem().getItemStack(); + double totalWeight = getTotalWeight(); + double randomWeightValue = random.nextDouble() * totalWeight; + double weightSum = 0.0; + for (CustomItem drop : weightedProbabilityDrops) { + weightSum += drop.getWeight(); + if (randomWeightValue < weightSum) { + return drop; + } } - - /** - * Rolls for a custom item in the drop table, and returns the ItemStack representation using a set seed - * @param seed an initial seed used to construct Random() - * @return the ItemStack representation of the random CustomItem - */ - public ItemStack getRolledItemStack(long seed) { - return getRolledCustomItem(seed).getItemStack(); - } - - private double getTotalWeight() { - double totalWeight = 0.0; - for (CustomItem drop : weightedProbabilityDrops) { - totalWeight += drop.getWeight(); - } - return totalWeight; - } - - private double getTotalStaticProbability() { - double totalProb = 0.0; - for (CustomItem drop : staticProbabilityDrops) { - totalProb += drop.getProbability(); - } - return totalProb; + return null; //The drop tables are empty (or something went wrong) + } + + public boolean isEmpty() { + return (staticProbabilityDrops.isEmpty() && weightedProbabilityDrops.isEmpty()); + } + + /** + * Rolls for a custom item in the drop table, and returns the ItemStack representation + * + * @return the ItemStack representation of the random CustomItem + */ + public ItemStack getRolledItemStack() { + return getRolledCustomItem().getItemStack(); + } + + /** + * Rolls for a custom item in the drop table, and returns the ItemStack representation using a set + * seed + * + * @param seed an initial seed used to construct Random() + * @return the ItemStack representation of the random CustomItem + */ + public ItemStack getRolledItemStack(long seed) { + return getRolledCustomItem(seed).getItemStack(); + } + + private double getTotalWeight() { + double totalWeight = 0.0; + for (CustomItem drop : weightedProbabilityDrops) { + totalWeight += drop.getWeight(); } + return totalWeight; + } - @Override - public String toString() { - int numberOfItems = weightedProbabilityDrops.size() + staticProbabilityDrops.size(); - return "{Number of Items=" + numberOfItems + - ", Total Static Probability=" + getTotalStaticProbability() + - ", Total Weight=" + getTotalWeight() + - "}"; + private double getTotalStaticProbability() { + double totalProb = 0.0; + for (CustomItem drop : staticProbabilityDrops) { + totalProb += drop.getProbability(); } + return totalProb; + } + + @Override + public String toString() { + int numberOfItems = weightedProbabilityDrops.size() + staticProbabilityDrops.size(); + return "{Number of Items=" + numberOfItems + + ", Total Static Probability=" + getTotalStaticProbability() + + ", Total Weight=" + getTotalWeight() + + "}"; + } } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/collections/MobDropTable.java b/src/main/java/mc/carlton/freerpg/customContainers/collections/MobDropTable.java index 0feccd3..fbe75e0 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/collections/MobDropTable.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/collections/MobDropTable.java @@ -1,83 +1,83 @@ package mc.carlton.freerpg.customContainers.collections; -import mc.carlton.freerpg.customContainers.CustomItem; -import org.bukkit.entity.EntityType; -import org.bukkit.inventory.ItemStack; - import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Random; +import mc.carlton.freerpg.customContainers.CustomItem; +import org.bukkit.entity.EntityType; +import org.bukkit.inventory.ItemStack; public class MobDropTable { - private Map mobDropTable; - public MobDropTable() { - mobDropTable = new HashMap<>(); - } + private Map mobDropTable; - public void addMobDropTable(EntityType entityType, DropTable dropTable) { - addMob(entityType); //Adds entity type if not there - mobDropTable.put(entityType,dropTable); - } + public MobDropTable() { + mobDropTable = new HashMap<>(); + } - private void addMob(EntityType entityType) { - if (mobDropTable.containsKey(entityType)) { - return; - } else { - mobDropTable.put(entityType,new DropTable()); - } - } + public void addMobDropTable(EntityType entityType, DropTable dropTable) { + addMob(entityType); //Adds entity type if not there + mobDropTable.put(entityType, dropTable); + } - public void addDropToMob(EntityType entityType, CustomItem drop) { - addMob(entityType); //Adds entity type if not there - mobDropTable.get(entityType).addDrop(drop); + private void addMob(EntityType entityType) { + if (mobDropTable.containsKey(entityType)) { + return; + } else { + mobDropTable.put(entityType, new DropTable()); } + } - public void addDropsToMobTable(EntityType entityType, Collection drops) { - addMob(entityType); //Adds entity type if not there - mobDropTable.get(entityType).addDrops(drops); - } + public void addDropToMob(EntityType entityType, CustomItem drop) { + addMob(entityType); //Adds entity type if not there + mobDropTable.get(entityType).addDrop(drop); + } - public void removeDropFromMob(EntityType entityType, CustomItem drop) { - if (mobDropTable.containsKey(entityType)) { - mobDropTable.get(entityType).removeDrop(drop); - removeMobDropTableIfEmpty(entityType); - } - } + public void addDropsToMobTable(EntityType entityType, Collection drops) { + addMob(entityType); //Adds entity type if not there + mobDropTable.get(entityType).addDrops(drops); + } - public void removeDropsFromMob(EntityType entityType, Collection drops) { - if (mobDropTable.containsKey(entityType)) { - mobDropTable.get(entityType).removeDrops(drops); - removeMobDropTableIfEmpty(entityType); - } + public void removeDropFromMob(EntityType entityType, CustomItem drop) { + if (mobDropTable.containsKey(entityType)) { + mobDropTable.get(entityType).removeDrop(drop); + removeMobDropTableIfEmpty(entityType); } + } - private void removeMobDropTableIfEmpty(EntityType entityType) { - if (mobDropTable.get(entityType).isEmpty()) { - mobDropTable.remove(entityType); - } + public void removeDropsFromMob(EntityType entityType, Collection drops) { + if (mobDropTable.containsKey(entityType)) { + mobDropTable.get(entityType).removeDrops(drops); + removeMobDropTableIfEmpty(entityType); } + } - public CustomItem getRolledCustomItem(EntityType entityType, long seed) { - if (mobDropTable.containsKey(entityType)) { - return mobDropTable.get(entityType).getRolledCustomItem(seed); - } - return null; + private void removeMobDropTableIfEmpty(EntityType entityType) { + if (mobDropTable.get(entityType).isEmpty()) { + mobDropTable.remove(entityType); } + } - public ItemStack getRolledItem(EntityType entityType, long seed) { - if (mobDropTable.containsKey(entityType)) { - return mobDropTable.get(entityType).getRolledItemStack(seed); - } - return null; + public CustomItem getRolledCustomItem(EntityType entityType, long seed) { + if (mobDropTable.containsKey(entityType)) { + return mobDropTable.get(entityType).getRolledCustomItem(seed); } + return null; + } - public CustomItem getRolledCustomItem(EntityType entityType) { - return getRolledCustomItem(entityType,new Random().nextLong()); + public ItemStack getRolledItem(EntityType entityType, long seed) { + if (mobDropTable.containsKey(entityType)) { + return mobDropTable.get(entityType).getRolledItemStack(seed); } + return null; + } - public ItemStack getRolledItem(EntityType entityType) { - return getRolledItem(entityType,new Random().nextLong()); - } + public CustomItem getRolledCustomItem(EntityType entityType) { + return getRolledCustomItem(entityType, new Random().nextLong()); + } + + public ItemStack getRolledItem(EntityType entityType) { + return getRolledItem(entityType, new Random().nextLong()); + } } diff --git a/src/main/java/mc/carlton/freerpg/customContainers/collections/OldCustomRecipe.java b/src/main/java/mc/carlton/freerpg/customContainers/collections/OldCustomRecipe.java index 07485cb..d5da6cf 100644 --- a/src/main/java/mc/carlton/freerpg/customContainers/collections/OldCustomRecipe.java +++ b/src/main/java/mc/carlton/freerpg/customContainers/collections/OldCustomRecipe.java @@ -1,5 +1,6 @@ package mc.carlton.freerpg.customContainers.collections; +import java.util.ArrayList; import mc.carlton.freerpg.customContainers.CustomItem; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -10,153 +11,153 @@ import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionType; -import java.util.ArrayList; - public class OldCustomRecipe { - private ArrayList recipe; - private Material output; - private int outputAmount; - private Enchantment ench; - private int enchantmentLevel; - private PotionType potionType; - private boolean isExtended; - private boolean isUpgraded; - private int XPcraftCost; - private String YAML_ID; - - /* - * I'm too lazy to make like 20 constructors for every case. It's easiest just to - * Create a "blank" custom recipe and fill in what you need - */ - public OldCustomRecipe(){ - this.YAML_ID = ""; - } - public OldCustomRecipe(ArrayList recipe, Material output, int outputAmount){ - setRecipe(recipe); - setOutput(output); - setOutputAmount(outputAmount); - this.YAML_ID = ""; - } - public OldCustomRecipe(ArrayList recipe, CustomItem customItem) { + private ArrayList recipe; + private Material output; + private int outputAmount; + private Enchantment ench; + private int enchantmentLevel; + private PotionType potionType; + private boolean isExtended; + private boolean isUpgraded; + private int XPcraftCost; + private String YAML_ID; + + /* + * I'm too lazy to make like 20 constructors for every case. It's easiest just to + * Create a "blank" custom recipe and fill in what you need + */ + public OldCustomRecipe() { + this.YAML_ID = ""; + } + + public OldCustomRecipe(ArrayList recipe, Material output, int outputAmount) { + setRecipe(recipe); + setOutput(output); + setOutputAmount(outputAmount); + this.YAML_ID = ""; + } - } + public OldCustomRecipe(ArrayList recipe, CustomItem customItem) { + + } - public ArrayList getRecipe() { - return new ArrayList<>(recipe); - } - - public boolean isExtended() { - return isExtended; - } - - public boolean isUpgraded() { - return isUpgraded; - } - - public Enchantment getEnchantment() { - return ench; - } - - public int getEnchantmentLevel() { - return enchantmentLevel; - } - - public int getOutputAmount() { - return outputAmount; - } - - public Material getOutput() { - return output; - } - - public PotionType getPotionType() { - return potionType; - } - - public int getXPcraftCost() { - return XPcraftCost; - } - - public String getYAML_ID() { - return YAML_ID; - } - - public void setEnchantment(Enchantment enchantment) { - this.ench = enchantment; - } - - public void setEnchantmentLevel(int enchantmentLevel) { - this.enchantmentLevel = enchantmentLevel; - } - - public void setExtended(boolean extended) { - isExtended = extended; - } - - public void setOutput(Material output) { - this.output = output; - } - - public void setOutputAmount(int outputAmount) { - this.outputAmount = outputAmount; - } - - public void setPotionType(PotionType potionType) { - this.potionType = potionType; - } - - public void setRecipe(ArrayList recipe) { - this.recipe = recipe; - } - - public void setUpgraded(boolean upgraded) { - isUpgraded = upgraded; - } - - public void setXPcraftCost(int XPcraftCost) { - this.XPcraftCost = XPcraftCost; - } - - public void setYAML_ID(String YAML_ID) { - this.YAML_ID = YAML_ID; - } - - public boolean outputIsPotion() { - if (potionType != null) { - return true; - } - return false; - } - public boolean outputIsEnchanted() { - if (ench != null) { - return true; - } - return false; - } - public ItemStack getItemStack() { - if (output == null) { - throw(new IllegalArgumentException("Unexpected Output Material at " + YAML_ID)); - } - ItemStack item = new ItemStack(output, outputAmount); - if (outputIsEnchanted()) { - if (output.equals(Material.ENCHANTED_BOOK)) { - EnchantmentStorageMeta meta = (EnchantmentStorageMeta) item.getItemMeta(); - meta.addStoredEnchant(ench,enchantmentLevel,true); - item.setItemMeta(meta); - } - else { - ItemMeta meta =item.getItemMeta(); - meta.addEnchant(ench,enchantmentLevel,true); - item.setItemMeta(meta); - } - } - else if (outputIsPotion()) { - PotionMeta meta = (PotionMeta) item.getItemMeta(); - meta.setBasePotionData(new PotionData(potionType,isExtended,isUpgraded)); - item.setItemMeta(meta); - } - return item; - } + public ArrayList getRecipe() { + return new ArrayList<>(recipe); + } + + public void setRecipe(ArrayList recipe) { + this.recipe = recipe; + } + + public boolean isExtended() { + return isExtended; + } + + public void setExtended(boolean extended) { + isExtended = extended; + } + + public boolean isUpgraded() { + return isUpgraded; + } + + public void setUpgraded(boolean upgraded) { + isUpgraded = upgraded; + } + + public Enchantment getEnchantment() { + return ench; + } + + public void setEnchantment(Enchantment enchantment) { + this.ench = enchantment; + } + + public int getEnchantmentLevel() { + return enchantmentLevel; + } + + public void setEnchantmentLevel(int enchantmentLevel) { + this.enchantmentLevel = enchantmentLevel; + } + + public int getOutputAmount() { + return outputAmount; + } + + public void setOutputAmount(int outputAmount) { + this.outputAmount = outputAmount; + } + + public Material getOutput() { + return output; + } + + public void setOutput(Material output) { + this.output = output; + } + + public PotionType getPotionType() { + return potionType; + } + + public void setPotionType(PotionType potionType) { + this.potionType = potionType; + } + + public int getXPcraftCost() { + return XPcraftCost; + } + + public void setXPcraftCost(int XPcraftCost) { + this.XPcraftCost = XPcraftCost; + } + + public String getYAML_ID() { + return YAML_ID; + } + + public void setYAML_ID(String YAML_ID) { + this.YAML_ID = YAML_ID; + } + + public boolean outputIsPotion() { + if (potionType != null) { + return true; + } + return false; + } + + public boolean outputIsEnchanted() { + if (ench != null) { + return true; + } + return false; + } + + public ItemStack getItemStack() { + if (output == null) { + throw (new IllegalArgumentException("Unexpected Output Material at " + YAML_ID)); + } + ItemStack item = new ItemStack(output, outputAmount); + if (outputIsEnchanted()) { + if (output.equals(Material.ENCHANTED_BOOK)) { + EnchantmentStorageMeta meta = (EnchantmentStorageMeta) item.getItemMeta(); + meta.addStoredEnchant(ench, enchantmentLevel, true); + item.setItemMeta(meta); + } else { + ItemMeta meta = item.getItemMeta(); + meta.addEnchant(ench, enchantmentLevel, true); + item.setItemMeta(meta); + } + } else if (outputIsPotion()) { + PotionMeta meta = (PotionMeta) item.getItemMeta(); + meta.setBasePotionData(new PotionData(potionType, isExtended, isUpgraded)); + item.setItemMeta(meta); + } + return item; + } } diff --git a/src/main/java/mc/carlton/freerpg/enchantingEvents/AnvilClick.java b/src/main/java/mc/carlton/freerpg/enchantingEvents/AnvilClick.java deleted file mode 100644 index abadff2..0000000 --- a/src/main/java/mc/carlton/freerpg/enchantingEvents/AnvilClick.java +++ /dev/null @@ -1,47 +0,0 @@ -package mc.carlton.freerpg.enchantingEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.playerInfo.ChangeStats; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryType; -import org.bukkit.inventory.AnvilInventory; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.Map; - -public class AnvilClick implements Listener { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - @EventHandler(priority = EventPriority.HIGH) - void onInventoryClick(InventoryClickEvent e) { - if (e.isCancelled()) { - return; - } - try { - InventoryType invType = e.getClickedInventory().getType(); - } catch (Exception except) { - return; - } - if (e.getInventory() instanceof AnvilInventory) { //This section is very buggy, and not clean. Hopefully I can improve it in the future - Player p = (Player) e.getWhoClicked(); - int level = p.getLevel(); - new BukkitRunnable() { - @Override - public void run() { - int newLevel = p.getLevel(); - if (newLevel < level) { - ConfigLoad configLoad1 = new ConfigLoad(); - Map expMap = configLoad1.getExpMapForSkill("enchanting"); - ChangeStats increaseStats = new ChangeStats(p); - increaseStats.changeEXP("enchanting",expMap.get("useAnvil_EXPperLevelUsed")*(level-newLevel)); - } - } - }.runTaskLater(plugin, 2); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/enchantingEvents/ExperienceBottleBreak.java b/src/main/java/mc/carlton/freerpg/enchantingEvents/ExperienceBottleBreak.java deleted file mode 100644 index 3d104fc..0000000 --- a/src/main/java/mc/carlton/freerpg/enchantingEvents/ExperienceBottleBreak.java +++ /dev/null @@ -1,18 +0,0 @@ -package mc.carlton.freerpg.enchantingEvents; - -import mc.carlton.freerpg.gameTools.ExperienceBottleTracking; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.ExpBottleEvent; - -public class ExperienceBottleBreak implements Listener { - @EventHandler - void onExpBottleBreak(ExpBottleEvent e){ - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.isGetEXPFromEnchantingBottles()) { - ExperienceBottleTracking experienceBottleTracking = new ExperienceBottleTracking(); - experienceBottleTracking.addLocation(e.getEntity().getLocation()); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/enchantingEvents/PlayerEnchant.java b/src/main/java/mc/carlton/freerpg/enchantingEvents/PlayerEnchant.java deleted file mode 100644 index 96c58e7..0000000 --- a/src/main/java/mc/carlton/freerpg/enchantingEvents/PlayerEnchant.java +++ /dev/null @@ -1,30 +0,0 @@ -package mc.carlton.freerpg.enchantingEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.perksAndAbilities.Enchanting; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.enchantment.EnchantItemEvent; -import org.bukkit.inventory.EnchantingInventory; -import org.bukkit.plugin.Plugin; - -public class PlayerEnchant implements Listener { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - @EventHandler(priority = EventPriority.HIGH) - void onEnchant(EnchantItemEvent e){ - if (e.isCancelled()) { - return; - } - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("enchanting")) { - return; - } - Player p = (Player) e.getEnchanter(); - Enchanting enchantingClass = new Enchanting(p); - enchantingClass.enchantItem(e.getItem(),e.whichButton(),(EnchantingInventory) e.getInventory()); - - } -} diff --git a/src/main/java/mc/carlton/freerpg/enchantingEvents/PlayerGetExperience.java b/src/main/java/mc/carlton/freerpg/enchantingEvents/PlayerGetExperience.java deleted file mode 100644 index 382e95b..0000000 --- a/src/main/java/mc/carlton/freerpg/enchantingEvents/PlayerGetExperience.java +++ /dev/null @@ -1,43 +0,0 @@ -package mc.carlton.freerpg.enchantingEvents; - -import mc.carlton.freerpg.gameTools.ExperienceBottleTracking; -import mc.carlton.freerpg.perksAndAbilities.Enchanting; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerExpChangeEvent; - -public class PlayerGetExperience implements Listener { - @EventHandler - void onExperienceGain(PlayerExpChangeEvent e){ - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("enchanting")) { - return; - } - Player p = e.getPlayer(); - boolean naturalEXPGain = false; - boolean fromBottle = false; - for(Entity entity: p.getNearbyEntities(1,1,1) ) { - if (entity.getType().equals(EntityType.EXPERIENCE_ORB)) { - naturalEXPGain = true; - if (!configLoad.isGetEXPFromEnchantingBottles()) { - ExperienceBottleTracking experienceBottleTracking = new ExperienceBottleTracking(); - fromBottle = experienceBottleTracking.fromEnchantingBottle(entity); - break; - } - } - } - if (naturalEXPGain && !fromBottle) { - Enchanting enchantingClass = new Enchanting(p); - enchantingClass.giveEXP(e.getAmount()); - int oldAmount = e.getAmount(); - int newAmount = enchantingClass.xpIncrease(oldAmount); - e.setAmount(newAmount); - } - - - } -} diff --git a/src/main/java/mc/carlton/freerpg/enchantingEvents/PrepareEnchanting.java b/src/main/java/mc/carlton/freerpg/enchantingEvents/PrepareEnchanting.java deleted file mode 100644 index 75cafd9..0000000 --- a/src/main/java/mc/carlton/freerpg/enchantingEvents/PrepareEnchanting.java +++ /dev/null @@ -1,31 +0,0 @@ -package mc.carlton.freerpg.enchantingEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.perksAndAbilities.Enchanting; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.enchantments.EnchantmentOffer; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.enchantment.PrepareItemEnchantEvent; -import org.bukkit.plugin.Plugin; - -public class PrepareEnchanting implements Listener { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - @EventHandler(priority = EventPriority.HIGH) - void onEnchantOpen(PrepareItemEnchantEvent e) { - if (e.isCancelled()) { - return; - } - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("enchanting")) { - return; - } - Player p = (Player) e.getEnchanter(); - Enchanting enchantingClass = new Enchanting(p); - EnchantmentOffer[] oldOffers = e.getOffers(); - EnchantmentOffer[] newOffers = enchantingClass.enchantmentDiscount(oldOffers); - - } -} diff --git a/src/main/java/mc/carlton/freerpg/enchantingEvents/PrepareRepair.java b/src/main/java/mc/carlton/freerpg/enchantingEvents/PrepareRepair.java deleted file mode 100644 index ed7f80a..0000000 --- a/src/main/java/mc/carlton/freerpg/enchantingEvents/PrepareRepair.java +++ /dev/null @@ -1,36 +0,0 @@ -package mc.carlton.freerpg.enchantingEvents; - -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.PrepareAnvilEvent; -import org.bukkit.inventory.AnvilInventory; - -import java.util.ArrayList; -import java.util.Map; - -public class PrepareRepair implements Listener { - @EventHandler - void onRepairOpen(PrepareAnvilEvent e){ - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("enchanting")) { - return; - } - AnvilInventory anvil = e.getInventory(); - try { - Player p = (Player) anvil.getViewers().get(0); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - int levelSubtract = (int) pStat.get("enchanting").get(7); - int newCost = Math.max(2,anvil.getRepairCost()-levelSubtract); - anvil.setRepairCost(newCost); - } - catch (IndexOutOfBoundsException error){ - return; - } - - - } -} diff --git a/src/main/java/mc/carlton/freerpg/events/brewing/BrewingInventoryClick.java b/src/main/java/mc/carlton/freerpg/events/brewing/BrewingInventoryClick.java new file mode 100644 index 0000000..e4646cf --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/brewing/BrewingInventoryClick.java @@ -0,0 +1,178 @@ +package mc.carlton.freerpg.events.brewing; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.skills.perksAndAbilities.Alchemy; +import mc.carlton.freerpg.utils.game.BrewingStandUserTracker; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.Material; +import org.bukkit.block.BrewingStand; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.BrewerInventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.plugin.Plugin; +import org.bukkit.potion.PotionData; +import org.bukkit.potion.PotionType; +import org.bukkit.scheduler.BukkitRunnable; + +public class BrewingInventoryClick implements Listener { + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + @EventHandler(priority = EventPriority.HIGHEST) + void onInventoryClick(InventoryClickEvent e) { + if (e.isCancelled()) { + return; + } + try { + InventoryType invType = e.getClickedInventory().getType(); + } catch (Exception except) { + return; + } + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("alchemy")) { + return; + } + + /* Perk removed + if (e.getInventory().getHolder() instanceof BrewingStand) { //This section is very buggy, and not clean. Hopefully I can improve it in the future + Player p = (Player) e.getWhoClicked(); + BrewingStandUserTracker brewTracker = new BrewingStandUserTracker(); + brewTracker.addstand((BrewingStand) e.getInventory().getHolder(),p); + int slot = e.getSlot(); + if ( (slot <= 5) || (e.getClick() == ClickType.SHIFT_LEFT || e.getClick() == ClickType.SHIFT_RIGHT) ) { + BrewerInventory brewingInventory = (BrewerInventory) e.getInventory(); + playerStats pStatClass = new playerStats(p); + Map> pStat = pStatClass.getPlayerData(); + int speedBrewingLevel = (int) pStat.get("alchemy").get(7); + int time = (int) Math.round((1 - speedBrewingLevel * 0.15) * 400); + final BrewingStand stand = (BrewingStand) e.getInventory().getHolder(); + stand.setBrewingTime(time); + stand.update(); + } + } + */ + + if (e.getInventory() + .getHolder() instanceof BrewingStand) { //This section is very buggy, and not clean. Hopefully I can improve it in the future + Player p = (Player) e.getWhoClicked(); + BrewingStandUserTracker brewTracker = new BrewingStandUserTracker(); + brewTracker.addstand((BrewingStand) e.getInventory().getHolder(), p); + } + + if (e.getClick() != ClickType.LEFT) { + return; + } + if (e.getClickedInventory() instanceof BrewerInventory) { + ItemGroups itemGroups = new ItemGroups(); + List oldIngredients = itemGroups.getOldIngredients(); + List newIngredients = itemGroups.getNewIngredients(); + ItemStack heroPotion = itemGroups.getHeroPotion(); + ItemStack fatiguePotion = itemGroups.getFatiguePotion(); + ItemStack hastePotion = itemGroups.getHastePotion(); + ItemStack decayPotion = itemGroups.getDecayPotion(); + ItemStack resistancePotion = itemGroups.getResistancePotion(); + + BrewerInventory brewingInventory = (BrewerInventory) e.getClickedInventory(); + Player p = (Player) e.getWhoClicked(); + if (e.getSlot() == 3) { + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + ItemStack awkwardBottle = new ItemStack(Material.POTION, 1); + PotionMeta awkward = (PotionMeta) awkwardBottle.getItemMeta(); + awkward.setBasePotionData(new PotionData(PotionType.AWKWARD)); + awkwardBottle.setItemMeta(awkward); + final ItemStack ingredient = e.getCurrentItem(); + final ItemStack cursorClone = e.getCursor().clone(); + final ItemStack potionSlot1 = e.getInventory().getItem(0); + final ItemStack potionSlot2 = e.getInventory().getItem(1); + final ItemStack potionSlot3 = e.getInventory().getItem(2); + final ItemStack[] potionSlots = {potionSlot1, potionSlot2, potionSlot3}; + if (cursorClone == null) { + return; + } + if (cursorClone.getType() == Material.AIR) { + return; + } + if (cursorClone.getType() == ingredient.getType()) { + e.setCancelled(true); + return; + } + new BukkitRunnable() { + @Override + public void run() { + if (!(oldIngredients.contains(cursorClone.getType()))) { + e.getView().setCursor(ingredient); + e.getClickedInventory().setItem(e.getSlot(), cursorClone); + p.updateInventory(); + } + Alchemy alchemyClass = new Alchemy(p); + if (newIngredients.contains(cursorClone.getType())) { + ItemStack[] potionSlots = {potionSlot1, potionSlot2, potionSlot3}; + boolean[] slotsAwkward = { + alchemyClass.comparePotionEffects(potionSlot1, awkwardBottle), + alchemyClass.comparePotionEffects(potionSlot2, awkwardBottle), + alchemyClass.comparePotionEffects(potionSlot3, awkwardBottle)}; + boolean proceed = true; + for (int i = 0; i < 3; i++) { + if (slotsAwkward[i]) { + continue; + } else if (potionSlots[i] == null) { + continue; + } else if (potionSlots[i].getType() == Material.AIR) { + continue; + } + proceed = false; + break; + } + if (proceed) { + if (newIngredients.indexOf(cursorClone.getType()) == 0 + && (int) pStat.get("alchemy").get(9) >= 1) { + alchemyClass.startBrewing(brewingInventory, heroPotion, cursorClone); + } else if (newIngredients.indexOf(cursorClone.getType()) == 1 + && (int) pStat.get("alchemy").get(9) >= 2) { + alchemyClass.startBrewing(brewingInventory, fatiguePotion, cursorClone); + } else if (newIngredients.indexOf(cursorClone.getType()) == 2 + && (int) pStat.get("alchemy").get(9) >= 3) { + alchemyClass.startBrewing(brewingInventory, hastePotion, cursorClone); + } else if (newIngredients.indexOf(cursorClone.getType()) == 3 + && (int) pStat.get("alchemy").get(9) >= 4) { + alchemyClass.startBrewing(brewingInventory, decayPotion, cursorClone); + } else if (newIngredients.indexOf(cursorClone.getType()) == 4 + && (int) pStat.get("alchemy").get(9) >= 5) { + alchemyClass.startBrewing(brewingInventory, resistancePotion, cursorClone); + } + } + } else if (cursorClone.getType() == Material.GLOWSTONE_DUST + || cursorClone.getType() == Material.REDSTONE) { + boolean[] slotsToCheck = {false, false, false}; + for (int i = 0; i < 3; i++) { + if (potionSlots[i] != null) { + if (potionSlots[i].getItemMeta().hasEnchant(Enchantment.LOYALTY)) { + slotsToCheck[i] = true; + } + } + } + if (!slotsToCheck[0] && !slotsToCheck[1] && !slotsToCheck[2]) { + return; + } + alchemyClass.upgradeBrewing(brewingInventory, cursorClone, slotsToCheck); + } + } + }.runTaskLater(plugin, 1); + } + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/brewing/FinishedBrewing.java b/src/main/java/mc/carlton/freerpg/events/brewing/FinishedBrewing.java new file mode 100644 index 0000000..77e0407 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/brewing/FinishedBrewing.java @@ -0,0 +1,100 @@ +package mc.carlton.freerpg.events.brewing; + +import java.util.Map; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.skills.perksAndAbilities.Alchemy; +import mc.carlton.freerpg.utils.game.BrewingStandUserTracker; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.block.BrewingStand; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.BrewEvent; +import org.bukkit.inventory.BrewerInventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.plugin.Plugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +public class FinishedBrewing implements Listener { + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + @EventHandler(priority = EventPriority.HIGH) + void onBrewComplete(BrewEvent e) { + if (e.isCancelled()) { + return; + } + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("alchemy")) { + return; + } + BrewerInventory inventory = e.getContents(); + ItemStack ingredient = inventory.getItem(3).clone(); + ItemStack[] slotItems = {inventory.getItem(0), inventory.getItem(1), inventory.getItem(2)}; + BrewingStandUserTracker brewTracker = new BrewingStandUserTracker(); + Player p = brewTracker.getPlayer(inventory.getHolder()); + if (p != null) { + Alchemy alchemyClass = new Alchemy(p); + alchemyClass.giveBrewingEXP(ingredient, slotItems); + } + if (ingredient.getType() == Material.DRAGON_BREATH + || ingredient.getType() == Material.GUNPOWDER) { + new BukkitRunnable() { + @Override + public void run() { + BrewingStand stand = inventory.getHolder(); + for (int i = 0; i < 3; i++) { + ItemStack slot_i = slotItems[i]; + if (slot_i != null) { + if (slot_i.getType() != Material.AIR) { + if (slot_i.getEnchantments().containsKey(Enchantment.LOYALTY) + || slot_i.getEnchantments().containsKey(Enchantment.DURABILITY)) { + PotionMeta slotMeta = (PotionMeta) slot_i.getItemMeta(); + String normalName = slotMeta.getDisplayName().substring(2); + if (ingredient.getType() == Material.GUNPOWDER) { + if (slot_i.getType() == Material.POTION) { + slot_i.setType(Material.SPLASH_POTION); + slotMeta.setDisplayName(ChatColor.RESET + "Splash " + normalName); + } + } else { + if (slot_i.getType() == Material.SPLASH_POTION) { + slot_i.setType(Material.LINGERING_POTION); + normalName = normalName.substring(7); + slotMeta.setDisplayName(ChatColor.RESET + "Lingering " + normalName); + PotionEffectType effectType = slotMeta.getCustomEffects().get(0).getType(); + int newLength = (int) Math.round( + slotMeta.getCustomEffects().get(0).getDuration() * 0.25); + int level = slotMeta.getCustomEffects().get(0).getAmplifier(); + slotMeta.addCustomEffect(new PotionEffect(effectType, newLength, level), + true); + } + } + slot_i.setItemMeta(slotMeta); + stand.getSnapshotInventory().setItem(i, slot_i); + stand.update(); + if (p != null) { + ConfigLoad configLoad1 = new ConfigLoad(); + Map expMap = configLoad1.getExpMapForSkill("alchemy"); + ChangeStats increaseStats = new ChangeStats(p); + increaseStats.changeEXP("alchemy", expMap.get("brewSplashPotion")); + } + } + } + + } + } + + } + }.runTaskLater(plugin, 1); + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/click/PlayerLeftClick.java b/src/main/java/mc/carlton/freerpg/events/click/PlayerLeftClick.java new file mode 100644 index 0000000..13fb139 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/click/PlayerLeftClick.java @@ -0,0 +1,78 @@ +package mc.carlton.freerpg.events.click; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.skills.perksAndAbilities.Archery; +import mc.carlton.freerpg.skills.perksAndAbilities.BeastMastery; +import mc.carlton.freerpg.skills.perksAndAbilities.Digging; +import mc.carlton.freerpg.skills.perksAndAbilities.Fishing; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.GameMode; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; + +public class PlayerLeftClick implements Listener { + + @EventHandler + void onLeftClick(PlayerInteractEvent e) { + Action a = e.getAction(); + + if ((a.equals(Action.LEFT_CLICK_AIR)) || (a.equals(Action.LEFT_CLICK_BLOCK))) { + Player p = e.getPlayer(); + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + World world = p.getWorld(); + Material itemType = p.getInventory().getItemInMainHand().getType(); + + ItemGroups itemGroups = new ItemGroups(); + List leftClickItems = itemGroups.getLeftClickItems(); + + if (itemType == Material.FISHING_ROD && a.equals(Action.LEFT_CLICK_BLOCK)) { + Fishing fishingClass = new Fishing(p); + fishingClass.initiateAbility(); + } else if (itemType == Material.BOW) { + Archery archeryClass = new Archery(p); + archeryClass.initiateAbility(); + } else if (itemType == Material.CROSSBOW) { + Archery archeryClass = new Archery(p); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("archery").get(12) > 0) { + archeryClass.initiateAbility(); + } + } else if (p.getVehicle() != null) { + EntityType[] acceptableVehicles0 = {EntityType.HORSE, EntityType.SKELETON_HORSE, + EntityType.ZOMBIE_HORSE, EntityType.PIG, EntityType.DONKEY, EntityType.MULE, + EntityType.LLAMA}; + List acceptableVehicles = Arrays.asList(acceptableVehicles0); + if (!leftClickItems.contains(itemType) && acceptableVehicles.contains( + p.getVehicle().getType())) { + AbilityTracker abilities = new AbilityTracker(p); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[6] > -1) { + BeastMastery beastMasteryClass = new BeastMastery(p); + beastMasteryClass.enableAbility(); + } + } + } + + if (a.equals(Action.LEFT_CLICK_BLOCK)) { + BlockFace blockface = e.getBlockFace(); + Digging diggingClass = new Digging(p); + diggingClass.storeBlockFace(blockface); + } + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/click/PlayerLeftClickDeveloper.java b/src/main/java/mc/carlton/freerpg/events/click/PlayerLeftClickDeveloper.java new file mode 100644 index 0000000..984220c --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/click/PlayerLeftClickDeveloper.java @@ -0,0 +1,82 @@ +package mc.carlton.freerpg.events.click; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.core.info.server.RunTimeData; +import mc.carlton.freerpg.skills.perksAndAbilities.Archery; +import mc.carlton.freerpg.skills.perksAndAbilities.BeastMastery; +import mc.carlton.freerpg.skills.perksAndAbilities.Digging; +import mc.carlton.freerpg.skills.perksAndAbilities.Fishing; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.GameMode; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; + +public class PlayerLeftClickDeveloper implements Listener { + + @EventHandler + void onLeftClick(PlayerInteractEvent e) { + Action a = e.getAction(); + + if ((a.equals(Action.LEFT_CLICK_AIR)) || (a.equals(Action.LEFT_CLICK_BLOCK))) { + RunTimeData runTimeData = new RunTimeData(); + Player p = e.getPlayer(); + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + World world = p.getWorld(); + Material itemType = p.getInventory().getItemInMainHand().getType(); + + ItemGroups itemGroups = new ItemGroups(); + List leftClickItems = itemGroups.getLeftClickItems(); + + long timer = System.currentTimeMillis(); + if (itemType == Material.FISHING_ROD && a.equals(Action.LEFT_CLICK_BLOCK)) { + Fishing fishingClass = new Fishing(p); + fishingClass.initiateAbility(); + } else if (itemType == Material.BOW) { + Archery archeryClass = new Archery(p); + archeryClass.initiateAbility(); + } else if (itemType == Material.CROSSBOW) { + Archery archeryClass = new Archery(p); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("archery").get(12) > 0) { + archeryClass.initiateAbility(); + } + } else if (p.getVehicle() != null) { + if (!leftClickItems.contains(itemType) && p.getVehicle().getType() == EntityType.HORSE) { + AbilityTracker abilities = new AbilityTracker(p); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[6] > -1) { + BeastMastery beastMasteryClass = new BeastMastery(p); + beastMasteryClass.enableAbility(); + } + } + } + + if (a.equals(Action.LEFT_CLICK_BLOCK)) { + long timer1 = System.currentTimeMillis(); + BlockFace blockface = e.getBlockFace(); + Digging diggingClass = new Digging(p); + diggingClass.storeBlockFace(blockface); + long storeBlockFaceTime = System.currentTimeMillis() - timer1; + runTimeData.addTime(storeBlockFaceTime, "blockFace"); + + } + long allConditionals = System.currentTimeMillis() - timer; + runTimeData.addTime(allConditionals, "leftClickConditionals"); + + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/click/PlayerRightClick.java b/src/main/java/mc/carlton/freerpg/events/click/PlayerRightClick.java new file mode 100644 index 0000000..a3d8802 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/click/PlayerRightClick.java @@ -0,0 +1,302 @@ +package mc.carlton.freerpg.events.click; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.core.info.server.WorldGuardChecks; +import mc.carlton.freerpg.skills.perksAndAbilities.Archery; +import mc.carlton.freerpg.skills.perksAndAbilities.AxeMastery; +import mc.carlton.freerpg.skills.perksAndAbilities.BeastMastery; +import mc.carlton.freerpg.skills.perksAndAbilities.Defense; +import mc.carlton.freerpg.skills.perksAndAbilities.Digging; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import mc.carlton.freerpg.skills.perksAndAbilities.Mining; +import mc.carlton.freerpg.skills.perksAndAbilities.Repair; +import mc.carlton.freerpg.skills.perksAndAbilities.Swordsmanship; +import mc.carlton.freerpg.skills.perksAndAbilities.Woodcutting; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.ChatColor; +import org.bukkit.GameMode; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + + +public class PlayerRightClick implements Listener { + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + @EventHandler + void onRightClick(PlayerInteractEvent e) { + Action a = e.getAction(); + if (e.getHand() == EquipmentSlot.OFF_HAND) { + return; + } + if ((a.equals(Action.RIGHT_CLICK_AIR)) || (a.equals(Action.RIGHT_CLICK_BLOCK))) { + Player p = e.getPlayer(); + PlayerStats pStatClass = new PlayerStats(p); + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + ChangeStats increaseStats = new ChangeStats(p); + AbilityTracker abilities = new AbilityTracker(p); + Integer[] pAbilities = abilities.getPlayerAbilities(); + ItemStack itemInHand = p.getInventory().getItemInMainHand(); + Material itemInHandType = itemInHand.getType(); + ItemGroups itemGroups = new ItemGroups(); + List pickaxes = itemGroups.getPickaxes(); + List axes = itemGroups.getAxes(); + List hoes = itemGroups.getHoes(); + List swords = itemGroups.getSwords(); + List shovels = itemGroups.getShovels(); + List noRightClick = itemGroups.getNoRightClick(); + List actionableBlocks = itemGroups.getActionableBlocks(); + + LanguageSelector langManager = new LanguageSelector(p); + + //Right clicking blocks + if (a.equals(Action.RIGHT_CLICK_BLOCK)) { + //Composter EXP + Farming farmingClass = new Farming(p); + farmingClass.composterEXP(e.getClickedBlock()); + + //Repair + if (e.getClickedBlock().getType() == Material.IRON_BLOCK && !itemInHandType.isBlock()) { + if (pAbilities[0] != -2 && pAbilities[2] != -2 && pAbilities[7] != -2) { + Repair repairClass = new Repair(p); + repairClass.repairItem(); + e.setCancelled(true); + } else { + p.sendMessage(ChatColor.RED + langManager.getString("cannotRepair")); + } + return; + } + //Salvaging + else if (e.getClickedBlock().getType() == Material.GOLD_BLOCK + && !itemInHandType.isBlock()) { + if (p.isSneaking()) { + if (pAbilities[0] != -2 && pAbilities[2] != -2 && pAbilities[7] != -2) { + Repair repairClass = new Repair(p); + repairClass.salvaging(); + e.setCancelled(true); + } else { + p.sendMessage(ChatColor.RED + langManager.getString("cannotSalvage")); + } + return; + } + } + //Stopping abilities from activating on stuff like doors + if (actionableBlocks.contains(e.getClickedBlock().getType())) { + return; + } + } + + if (p.getInventory().getItemInOffHand().getType() == Material.TORCH && a.equals( + Action.RIGHT_CLICK_BLOCK)) { + return; + } + + int waitTicks = 0; + //Shield smoothness + if (p.getInventory().getItemInOffHand().getType() == Material.SHIELD) { + waitTicks = 6; + } + + //Explosions + if (itemInHandType == Material.FLINT_AND_STEEL) { + Block blockLit = e.getClickedBlock(); + if (blockLit == null) { + return; + } + WorldGuardChecks BuildingCheck = new WorldGuardChecks(); + ConfigLoad canExplode = new ConfigLoad(); + if (!canExplode.isAllowExplosions()) { + return; + } + if (!BuildingCheck.canBuild(p, blockLit.getLocation())) { + return; + } + if (blockLit.getType() == Material.TNT) { + e.setCancelled(true); + Mining miningClass = new Mining(p); + miningClass.tntExplode(blockLit); + } + } + + //Digging + else if (shovels.contains(itemInHandType)) { + Digging diggingClass = new Digging(p); + if (a.equals(Action.RIGHT_CLICK_BLOCK)) { + if (!(e.getClickedBlock().getType() == Material.GRASS_BLOCK)) { + new BukkitRunnable() { + @Override + public void run() { + if (p.isOnline()) { + if (!p.isBlocking()) { + diggingClass.initiateAbility(); + } + } + } + }.runTaskLater(plugin, waitTicks); + + } + } else { + new BukkitRunnable() { + @Override + public void run() { + if (p.isOnline()) { + if (!p.isBlocking()) { + diggingClass.initiateAbility(); + } + } + } + }.runTaskLater(plugin, waitTicks); + } + } + //Woodcutting and AxeMastery + else if (axes.contains(itemInHandType)) { + Woodcutting woodcuttingClass = new Woodcutting(p); + if (a.equals(Action.RIGHT_CLICK_BLOCK)) { + if (woodcuttingClass.blacklistedBlock(e.getClickedBlock())) { + return; + } + } + new BukkitRunnable() { + @Override + public void run() { + if (p.isOnline()) { + if (!p.isBlocking()) { + woodcuttingClass.initiateAbility(); + } + } + } + }.runTaskLater(plugin, waitTicks); + AxeMastery axeMasteryClass = new AxeMastery(p); + new BukkitRunnable() { + @Override + public void run() { + if (p.isOnline()) { + if (!p.isBlocking()) { + axeMasteryClass.initiateAbility(); + } + } + } + }.runTaskLater(plugin, waitTicks); + } + //Mining + else if (pickaxes.contains(itemInHandType)) { + Mining miningClass = new Mining(p); + new BukkitRunnable() { + @Override + public void run() { + if (p.isOnline()) { + if (!p.isBlocking()) { + miningClass.initiateAbility(); + } + } + } + }.runTaskLater(plugin, waitTicks); + } + + //Farming + else if (hoes.contains(itemInHandType)) { + if (a.equals(Action.RIGHT_CLICK_BLOCK)) { + if (!(e.getClickedBlock().getType() == Material.DIRT + || e.getClickedBlock().getType() == Material.GRASS_BLOCK + || e.getClickedBlock().getType() == Material.DIRT_PATH)) { + Farming farmingClass = new Farming(p); + farmingClass.initiateAbility(); + } else { + Material blockAbove = e.getClickedBlock().getRelative(0, 1, 0).getType(); + if (blockAbove == Material.AIR || blockAbove == Material.CAVE_AIR + || blockAbove == Material.VOID_AIR) { + ConfigLoad configLoad = new ConfigLoad(); + Map expMap = configLoad.getExpMapForSkill("farming"); + increaseStats.changeEXP("farming", expMap.get("tillLand")); + } + } + } else { + Farming farmingClass = new Farming(p); + farmingClass.initiateAbility(); + } + + } else if (itemInHandType == Material.BONE_MEAL && a.equals(Action.RIGHT_CLICK_BLOCK)) { + Farming farmingClass = new Farming(p); + farmingClass.fertilizerSave(e.getClickedBlock()); + } + + //Archery + else if (itemInHandType == Material.BOW) { + if (pAbilities[5] > -1) { + Archery archeryClass = new Archery(p); + archeryClass.enableAbility(); + } + } else if (itemInHandType == Material.CROSSBOW) { + if ((int) pStat.get("archery").get(12) > 0) { + Archery archeryClass = new Archery(p); + if (pAbilities[5] > -1) { + archeryClass.enableAbility(); + archeryClass.crossbowAbility(); + } else if (pAbilities[5] == -2) { + archeryClass.crossbowAbility(); + } + } + } + + //beastMastery + else if (p.getVehicle() != null) { + EntityType[] acceptableVehicles0 = {EntityType.HORSE, EntityType.SKELETON_HORSE, + EntityType.ZOMBIE_HORSE, EntityType.PIG, EntityType.DONKEY, EntityType.MULE, + EntityType.LLAMA}; + List acceptableVehicles = Arrays.asList(acceptableVehicles0); + if (acceptableVehicles.contains(p.getVehicle().getType())) { + if ((noRightClick.contains(itemInHandType) || (a == Action.RIGHT_CLICK_AIR + && itemInHand.getType().isBlock()))) { + BeastMastery beastMasteryClass = new BeastMastery(p); + beastMasteryClass.initiateAbility(); + } + } + } + + //Swordsmanship + else if (swords.contains(itemInHandType)) { + Swordsmanship swordsmanshipClass = new Swordsmanship(p); + new BukkitRunnable() { + @Override + public void run() { + if (p.isOnline()) { + if (!p.isBlocking()) { + swordsmanshipClass.initiateAbility(); + } + } + } + }.runTaskLater(plugin, waitTicks); + } + + //Defense + else if (itemInHandType == Material.AIR) { + Defense defenseClass = new Defense(p); + defenseClass.initiateAbility(); + } + + + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/click/PlayerRightClickEntity.java b/src/main/java/mc/carlton/freerpg/events/click/PlayerRightClickEntity.java new file mode 100644 index 0000000..8a30faf --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/click/PlayerRightClickEntity.java @@ -0,0 +1,36 @@ +package mc.carlton.freerpg.events.click; + +import mc.carlton.freerpg.skills.perksAndAbilities.BeastMastery; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import org.bukkit.GameMode; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerInteractEntityEvent; + +public class PlayerRightClickEntity implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onRightClick(PlayerInteractEntityEvent e) { + if (e.isCancelled()) { + return; + } + Player p = e.getPlayer(); + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + Entity entity = e.getRightClicked(); + + //Farming + Farming farmingClass = new Farming(p); + farmingClass.babyAnimalGrow(entity); + farmingClass.milkingEXP(entity); + + //Beast Mastery + BeastMastery beastMasteryClass = new BeastMastery(p); + beastMasteryClass.getHorseStats(entity); + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/combat/ArrowLand.java b/src/main/java/mc/carlton/freerpg/events/combat/ArrowLand.java new file mode 100644 index 0000000..f8ffb4e --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/combat/ArrowLand.java @@ -0,0 +1,32 @@ +package mc.carlton.freerpg.events.combat; + +import mc.carlton.freerpg.skills.perksAndAbilities.Archery; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.entity.Projectile; +import org.bukkit.entity.SpectralArrow; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.ProjectileHitEvent; +import org.bukkit.projectiles.ProjectileSource; + +public class ArrowLand implements Listener { + + @EventHandler + void onArrowLand(ProjectileHitEvent e) { + Entity projectile = e.getEntity(); + if (projectile instanceof Projectile) { + if (projectile instanceof Arrow || projectile instanceof SpectralArrow) { + ProjectileSource shooter = ((Projectile) projectile).getShooter(); + if (shooter instanceof Player) { + Player p = (Player) shooter; + Archery archeryClass = new Archery(p); + archeryClass.retrievalRemoval(projectile); + + } + } + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/combat/EntityGetDamaged.java b/src/main/java/mc/carlton/freerpg/events/combat/EntityGetDamaged.java new file mode 100644 index 0000000..57d94d8 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/combat/EntityGetDamaged.java @@ -0,0 +1,51 @@ +package mc.carlton.freerpg.events.combat; + +import java.util.ArrayList; +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.entity.Tameable; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityDamageEvent; + +public class EntityGetDamaged implements Listener { + + @EventHandler(priority = EventPriority.HIGHEST) + void onEntityDamaged(EntityDamageEvent e) { + if (e.isCancelled()) { + return; + } + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("beastMastery")) { + return; + } + if (e.getEntity() instanceof Entity) { + Entity wolf = e.getEntity(); + if (wolf.getType() == EntityType.WOLF) { + Tameable dog = (Tameable) wolf; + if (dog.isTamed()) { + if (!(dog.getOwner() instanceof Player)) { //Player is offline or something like that. + return; + } + Player p = (Player) dog.getOwner(); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + if (e.getCause().equals(EntityDamageEvent.DamageCause.FALL)) { + if ((int) pStat.get("beastMastery").get(11) > 0) { + e.setDamage(0); + } + } else { + int thickFurLevel = (int) pStat.get("beastMastery").get(7); + double thickFurMultiplier = 1 - thickFurLevel * 0.1; + e.setDamage(e.getDamage() * thickFurMultiplier); + } + } + } + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/combat/EntityHitEntity.java b/src/main/java/mc/carlton/freerpg/events/combat/EntityHitEntity.java new file mode 100644 index 0000000..df480ec --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/combat/EntityHitEntity.java @@ -0,0 +1,336 @@ +package mc.carlton.freerpg.events.combat; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.skills.perksAndAbilities.Agility; +import mc.carlton.freerpg.skills.perksAndAbilities.Archery; +import mc.carlton.freerpg.skills.perksAndAbilities.AxeMastery; +import mc.carlton.freerpg.skills.perksAndAbilities.BeastMastery; +import mc.carlton.freerpg.skills.perksAndAbilities.Defense; +import mc.carlton.freerpg.skills.perksAndAbilities.Swordsmanship; +import mc.carlton.freerpg.utils.game.FireworkShotByPlayerTracker; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.GameMode; +import org.bukkit.Material; +import org.bukkit.attribute.Attributable; +import org.bukkit.attribute.Attribute; +import org.bukkit.entity.Animals; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Firework; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.entity.Projectile; +import org.bukkit.entity.SpectralArrow; +import org.bukkit.entity.Tameable; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.plugin.Plugin; +import org.bukkit.projectiles.ProjectileSource; +import org.bukkit.scheduler.BukkitRunnable; +import org.bukkit.util.Vector; + +public class EntityHitEntity implements Listener { + + @EventHandler(priority = EventPriority.HIGHEST) + void onEntityHit(EntityDamageByEntityEvent e) { + Random rand = new Random(); + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + if (e.isCancelled()) { + return; + } + + if (e.getEntity().isInvulnerable()) { //Godmode check + return; + } + + //removes PvP effects if PvP is disabled + if (e.getEntity() instanceof Player) { + ConfigLoad loadConfig = new ConfigLoad(); + if (e.getDamager() instanceof Player) { + if (!loadConfig.isAllowPvP()) { + return; + } + } else if (e.getDamager() instanceof Projectile) { + ProjectileSource shooter = ((Projectile) e.getDamager()).getShooter(); + if (shooter instanceof Player) { + if (!loadConfig.isAllowPvP()) { + return; + } else if (shooter.equals(e.getEntity())) { + return; //Shooter shot himself + } + } + } + } + //removes hurting animals effects if hurting animals is disabled + else if (e.getEntity() instanceof Animals) { + ConfigLoad loadConfig = new ConfigLoad(); + if (e.getDamager() instanceof Player) { + if (!loadConfig.isAllowHurtAnimals()) { + return; + } + } else if (e.getDamager() instanceof Projectile) { + if (((Projectile) e.getDamager()).getShooter() instanceof Player) { + if (!loadConfig.isAllowHurtAnimals()) { + return; + } + } + } + } + + if (e.getDamager() instanceof Player) { + ItemGroups itemGroups = new ItemGroups(); + List shovels = itemGroups.getShovels(); + List swords = itemGroups.getSwords(); + List axes = itemGroups.getAxes(); + + Player p = (Player) e.getDamager(); + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + AbilityTracker abilities = new AbilityTracker(p); + Integer[] pAbilities = abilities.getPlayerAbilities(); + + //Digging + if (shovels.contains(p.getInventory().getItemInMainHand().getType())) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("digging")) { + return; + } + int shovelKnightLevel = (int) pStat.get("digging").get(12); + double multiplier = Math.min(2.0, 1.0 + shovelKnightLevel); + e.setDamage(e.getDamage() * multiplier); + } + + //swordsmanship + else if (swords.contains(p.getInventory().getItemInMainHand().getType())) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("swordsmanship")) { + return; + } + Swordsmanship swordsmanshipClass = new Swordsmanship(p); + if (pAbilities[7] > -1) { + swordsmanshipClass.enableAbility(); + } + double damage = e.getDamage(); + if ((int) pStat.get("swordsmanship").get(13) > 0) { + damage += 2; + e.setDamage(damage); + } + Entity damagedEntity = e.getEntity(); + swordsmanshipClass.doubleHit(damagedEntity, damage); + swordsmanshipClass.giveHitEXP(e.getFinalDamage(), damagedEntity); + } + + //Defense + else if (p.getInventory().getItemInMainHand().getType() == Material.AIR) { + Defense defenseClass = new Defense(p); + if (pAbilities[8] > -1) { + defenseClass.enableAbility(); + } + } else if (axes.contains(p.getInventory().getItemInMainHand().getType())) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("axeMastery")) { + return; + } + AxeMastery axeMasteryClass = new AxeMastery(p); + double damage = e.getDamage(); + if ((int) pStat.get("axeMastery").get(13) > 0) { + damage += 2; + e.setDamage(damage); + } + if (pAbilities[9] > -1) { + axeMasteryClass.enableAbility(); + axeMasteryClass.greaterAxe(e.getEntity(), p.getWorld(), e.getFinalDamage()); + } else if (pAbilities[9] == -2) { + axeMasteryClass.greaterAxe(e.getEntity(), p.getWorld(), e.getFinalDamage()); + } + double multiplier = axeMasteryClass.divineCritical(); + e.setDamage(e.getDamage() * multiplier); + axeMasteryClass.holyAxe(e.getEntity(), p.getWorld(), e.getFinalDamage()); + axeMasteryClass.giveHitEXP(e.getFinalDamage(), e.getEntity()); + + } + + } + //Arrow of Light + else if (e.getDamager() instanceof Arrow || e.getDamager() instanceof SpectralArrow) { + ProjectileSource shooter; + if (e.getDamager() instanceof SpectralArrow) { + shooter = ((SpectralArrow) e.getDamager()).getShooter(); + } else { + shooter = ((Arrow) e.getDamager()).getShooter(); + } + if (shooter instanceof Player) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("archery")) { + return; + } + Player p = (Player) shooter; + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + Archery archeryClass = new Archery(p); + archeryClass.explosiveArrows(e.getDamager(), e.getEntity().getLocation()); + Material arrowType = archeryClass.getArrowType(); + if (arrowType == Material.SPECTRAL_ARROW) { + int arrowOfLightLevel = (int) pStat.get("archery").get(10); + double multiplier = Math.min(arrowOfLightLevel * 0.05 + 1.0, 2.0); + e.setDamage(Math.min(e.getDamage() * multiplier, 32)); + } + archeryClass.giveHitEXP(e.getFinalDamage(), e.getEntity()); + if (e.getEntity() instanceof LivingEntity) { + if (e.getFinalDamage() > ((LivingEntity) e.getEntity()).getHealth()) { + archeryClass.giveKillEXP(e.getEntity()); + } + } + } + } + //Crossbow Strike + else if (e.getDamager() instanceof Firework) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("archery")) { + return; + } + Entity firework = e.getDamager(); + FireworkShotByPlayerTracker fireworkTracker = new FireworkShotByPlayerTracker(); + Player p = fireworkTracker.getPlayer(firework); + fireworkTracker.removeFireWork(firework); + if (p != null) { + Archery archeryClass = new Archery(p); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("archery").get(13) > 0) { + e.setDamage(Math.min(e.getDamage() * 2, 32)); + archeryClass.giveHitEXP(e.getFinalDamage(), e.getEntity()); + } + if (e.getEntity() instanceof LivingEntity) { + if (e.getFinalDamage() > ((LivingEntity) e.getEntity()).getHealth()) { + archeryClass.giveKillEXP(e.getEntity()); + } + } + } + } + //Sharp Teeth and Keep Away + else if (e.getDamager() instanceof Entity) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("beastMastery")) { + return; + } + Entity wolf = e.getDamager(); + if (wolf.getType() == EntityType.WOLF) { + Tameable dog = (Tameable) wolf; + if (dog.isTamed()) { + if (!(dog.getOwner() instanceof Player)) { //Player is offline or something like that. + return; + } + Player p = (Player) dog.getOwner(); + BeastMastery beastMastery = new BeastMastery(p); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + + double crit = 1.0; + int critLevel = (int) pStat.get("beastMastery").get(5); + double critChance = critLevel * 0.00025; + if (critChance > rand.nextDouble()) { + crit = 1.5; + } + + int sharpTeethLevel = (int) pStat.get("beastMastery").get(8); + double damageMultiplier = sharpTeethLevel * 0.1 + 1; + e.setDamage(e.getDamage() * crit * damageMultiplier); + + Entity enemy = e.getEntity(); + int keepAwayLevel = (int) pStat.get("beastMastery").get(10); + double knockBackChance = keepAwayLevel * 0.05; + if (knockBackChance > rand.nextDouble()) { + Vector knockback = enemy.getVelocity(); + double multiplier; + if (knockback.length() > 0.1) { + double newKnockback = Math.min(knockback.length() * 5, 100.0); + multiplier = newKnockback / knockback.length(); + } else { + multiplier = 5.0; + } + new BukkitRunnable() { + @Override + public void run() { + enemy.setVelocity(knockback.multiply(multiplier).setY(0.4)); + } + }.runTaskLater(plugin, 1); + } + LivingEntity livingEnemy = (LivingEntity) enemy; + if (e.getFinalDamage() > livingEnemy.getHealth()) { + double heartsHealed = (int) pStat.get("beastMastery").get(9); + LivingEntity livingDog = (LivingEntity) dog; + double maxHealth = ((Attributable) dog).getAttribute(Attribute.GENERIC_MAX_HEALTH) + .getBaseValue(); + livingDog.setHealth(Math.min(livingDog.getHealth() + heartsHealed, maxHealth)); + beastMastery.dogKillEntity(enemy); + } + beastMastery.giveHitEXP(e.getFinalDamage(), enemy); + + } + } + } + //Wolf take damage EXP + else if (e.getEntity() instanceof Entity) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("beastMastery")) { + return; + } + if (!(e.getDamager() instanceof Player)) { + Entity wolf = e.getEntity(); + if (wolf.getType() == EntityType.WOLF) { + Tameable dog = (Tameable) wolf; + if (dog.isTamed()) { + if (!(dog.getOwner() instanceof Player)) { //Player is offline or something like that. + return; + } + Player p = (Player) dog.getOwner(); + ChangeStats increaseStats = new ChangeStats(p); + increaseStats.changeEXP("beastMastery", (int) Math.round(e.getFinalDamage() * 3) * 10); + } + } + } + } + + //Getting hit (defense) + if (e.getEntity() instanceof Player) { + Player p = (Player) e.getEntity(); + if (e.getDamage() != 0 && !e.getCause().equals(EntityDamageEvent.DamageCause.HOT_FLOOR) && + !e.getCause().equals(EntityDamageEvent.DamageCause.STARVATION) && + !e.getCause().equals(EntityDamageEvent.DamageCause.VOID) && + !e.getCause().equals(EntityDamageEvent.DamageCause.SUFFOCATION) && + !e.getCause().equals(EntityDamageEvent.DamageCause.CUSTOM) && + !e.getCause().equals(EntityDamageEvent.DamageCause.CONTACT) + ) { + Agility agilityClass = new Agility(p); + boolean dodge = agilityClass.dodge(e.getFinalDamage()); + if (dodge) { + e.setCancelled(true); + } + + Defense defenseClass = new Defense(p); + double multiplier = defenseClass.hardBody(); + e.setDamage(e.getDamage() * multiplier); + defenseClass.reactions(e.getFinalDamage()); + defenseClass.giveHitEXP(e.getDamage(), e.getDamager()); + } + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/combat/LingeringPotionSplash.java b/src/main/java/mc/carlton/freerpg/events/combat/LingeringPotionSplash.java new file mode 100644 index 0000000..558b063 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/combat/LingeringPotionSplash.java @@ -0,0 +1,51 @@ +package mc.carlton.freerpg.events.combat; + +import java.util.ArrayList; +import java.util.Map; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import org.bukkit.entity.Player; +import org.bukkit.entity.ThrownPotion; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.LingeringPotionSplashEvent; +import org.bukkit.plugin.Plugin; +import org.bukkit.potion.PotionEffect; + +public class LingeringPotionSplash implements Listener { + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + @EventHandler(priority = EventPriority.HIGHEST) + void onPotionSplash(LingeringPotionSplashEvent e) { + if (e.isCancelled()) { + return; + } + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("alchemy")) { + return; + } + + ThrownPotion potionEntity = e.getEntity(); + if (!(potionEntity.getShooter() instanceof Player)) { + return; + } + Player p = (Player) potionEntity.getShooter(); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + int potionMasterLevel = (int) pStat.get("alchemy").get(13); + if ((int) pStat.get("global").get(15) != 1) { + potionMasterLevel = 0; + } + int potionDurationLevel = (int) pStat.get("alchemy").get(4); + double durationMultiplier = potionDurationLevel * 0.001 + 1; + for (PotionEffect effect : potionEntity.getEffects()) { + e.getAreaEffectCloud().addCustomEffect(new PotionEffect(effect.getType(), + (int) Math.round(effect.getDuration() * durationMultiplier), + effect.getAmplifier() + potionMasterLevel), true); + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/combat/PlayerDeath.java b/src/main/java/mc/carlton/freerpg/events/combat/PlayerDeath.java new file mode 100644 index 0000000..119453f --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/combat/PlayerDeath.java @@ -0,0 +1,92 @@ +package mc.carlton.freerpg.events.combat; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.AbilityLogoutTracker; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.skills.perksAndAbilities.Digging; +import mc.carlton.freerpg.skills.perksAndAbilities.Global; +import mc.carlton.freerpg.skills.perksAndAbilities.Mining; +import mc.carlton.freerpg.skills.perksAndAbilities.Swordsmanship; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.persistence.PersistentDataType; + +public class PlayerDeath implements Listener { + + @EventHandler(priority = EventPriority.HIGHEST) + void onPlayerDie(PlayerDeathEvent e) { + Player p = e.getEntity(); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + ConfigLoad configLoad = new ConfigLoad(); + if (configLoad.getAllowedSkillsMap().get("alchemy")) { + int immortalExperienceLevel = (int) pStat.get("enchanting").get(13); + int expBuffLevel = (int) pStat.get("enchanting").get(4); + double multiplier = 1 + expBuffLevel * 0.002; + e.setDroppedExp((int) Math.round(e.getDroppedExp() / multiplier)); + if (immortalExperienceLevel > 0) { + e.setKeepLevel(true); + e.setDroppedExp(0); + } + } + List drops = e.getDrops(); + AbilityTracker abilities = new AbilityTracker(p); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[0] != -1) { + AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); + NamespacedKey key = logoutTracker.getPlayerKeys().get("digging"); + int taskID_digging = logoutTracker.getPlayerTasks().get("digging"); + for (ItemStack drop : drops) { + if (drop.getItemMeta().getPersistentDataContainer().has(key, PersistentDataType.STRING)) { + ItemStack abilityItem = drop; + Digging diggingClass = new Digging(p); + diggingClass.preventLogoutTheft(taskID_digging, abilityItem, key, false); + break; + } + } + } + if (pAbilities[2] != -1) { + AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); + NamespacedKey key = logoutTracker.getPlayerKeys().get("mining"); + int taskID_mining = logoutTracker.getPlayerTasks().get("mining"); + for (ItemStack drop : drops) { + if (drop.getItemMeta().getPersistentDataContainer().has(key, PersistentDataType.STRING)) { + ItemStack abilityItem = drop; + Mining miningClass = new Mining(p); + miningClass.preventLogoutTheft(taskID_mining, abilityItem, key, false); + break; + } + } + } + if (pAbilities[7] != -1) { + AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); + NamespacedKey key = logoutTracker.getPlayerKeys().get("swordsmanship"); + int taskID_swordsmanship = logoutTracker.getPlayerTasks().get("swordsmanship"); + for (ItemStack drop : drops) { + if (drop.getItemMeta().getPersistentDataContainer().has(key, PersistentDataType.STRING)) { + ItemStack abilityItem = drop; + Swordsmanship swordsmanshipClass = new Swordsmanship(p); + swordsmanshipClass.preventLogoutTheft(taskID_swordsmanship, abilityItem, key, false); + break; + } + } + } + + if (!e.getKeepInventory()) { //Player does not keep inventory + if (!configLoad.isKeepinventory()) { //Server is not using some advanced keep inventory plugin + Global globalClass = new Global(p); + globalClass.betterResurrectionDeath(drops); + } + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/combat/PlayerKillEntity.java b/src/main/java/mc/carlton/freerpg/events/combat/PlayerKillEntity.java new file mode 100644 index 0000000..44d5ffd --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/combat/PlayerKillEntity.java @@ -0,0 +1,75 @@ +package mc.carlton.freerpg.events.combat; + +import java.util.List; +import mc.carlton.freerpg.skills.perksAndAbilities.AxeMastery; +import mc.carlton.freerpg.skills.perksAndAbilities.Defense; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import mc.carlton.freerpg.skills.perksAndAbilities.Fishing; +import mc.carlton.freerpg.skills.perksAndAbilities.Global; +import mc.carlton.freerpg.skills.perksAndAbilities.Swordsmanship; +import mc.carlton.freerpg.utils.game.EntityPickedUpItemStorage; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.GameMode; +import org.bukkit.World; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityDeathEvent; +import org.bukkit.inventory.ItemStack; + +public class PlayerKillEntity implements Listener { + + @EventHandler + void onEntityDie(EntityDeathEvent e) { + LivingEntity entity = e.getEntity(); + Player p = e.getEntity().getKiller(); + + if (p != null) { + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + World world = p.getWorld(); + List drops = e.getDrops(); + + //Farming + Farming farmingClass = new Farming(p); + farmingClass.animalDoubleDrops(entity, world, drops); + farmingClass.killFarmAnimalEXP(entity); + + //Swordsmanship + if (itemGroups.getSwords().contains(p.getInventory().getItemInMainHand().getType())) { + Swordsmanship swordsmanshipClass = new Swordsmanship(p); + swordsmanshipClass.killBuffs(e.getEntity()); + swordsmanshipClass.thirstForBlood(e.getEntity()); + swordsmanshipClass.giveKillEXP(entity); + } + + //Defense + Defense defenseClass = new Defense(p); + defenseClass.doubleDrops(entity, drops, world); + defenseClass.healer(); + defenseClass.giveKillEXP(entity); + + //Axe Mastery + if (itemGroups.getAxes().contains(p.getInventory().getItemInMainHand().getType())) { + AxeMastery axeMasteryClass = new AxeMastery(p); + axeMasteryClass.revitalized(); + axeMasteryClass.warriorBlood(); + axeMasteryClass.giveKillEXP(entity); + } + + //Fishing + Fishing fishingClass = new Fishing(p); + fishingClass.killFishEXP(entity); + + //Global (Souls) + Global globalClass = new Global(p); + globalClass.gainSoul(entity); + } + + EntityPickedUpItemStorage entityPickedUpItemStorage = new EntityPickedUpItemStorage(); + entityPickedUpItemStorage.removeEntity(entity); + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/combat/PlayerShootBow.java b/src/main/java/mc/carlton/freerpg/events/combat/PlayerShootBow.java new file mode 100644 index 0000000..ae4c79e --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/combat/PlayerShootBow.java @@ -0,0 +1,42 @@ +package mc.carlton.freerpg.events.combat; + +import mc.carlton.freerpg.skills.perksAndAbilities.Archery; +import mc.carlton.freerpg.utils.game.FireworkShotByPlayerTracker; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Firework; +import org.bukkit.entity.Player; +import org.bukkit.entity.SpectralArrow; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityShootBowEvent; +import org.bukkit.inventory.ItemStack; + +public class PlayerShootBow implements Listener { + + @EventHandler(priority = EventPriority.HIGHEST) + void onEntityShoot(EntityShootBowEvent e) { + if (e.isCancelled()) { + return; + } + Entity entity = e.getEntity(); + if (entity instanceof Player && (e.getProjectile() instanceof Arrow + || e.getProjectile() instanceof SpectralArrow)) { + Player p = (Player) entity; + ItemStack bow = e.getBow(); + Entity projectile = e.getProjectile(); + Archery archeryClass = new Archery(p); + archeryClass.rapidFire(projectile, bow); + archeryClass.sniper(projectile); + archeryClass.retrieval(projectile, bow); + + } else if (entity instanceof Player && e.getProjectile() instanceof Firework) { + Player p = (Player) entity; + Entity projectile = e.getProjectile(); + FireworkShotByPlayerTracker fireworkTracker = new FireworkShotByPlayerTracker(); + fireworkTracker.addFirework(projectile, p); + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/combat/PlayerTakeDamage.java b/src/main/java/mc/carlton/freerpg/events/combat/PlayerTakeDamage.java new file mode 100644 index 0000000..b921fb4 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/combat/PlayerTakeDamage.java @@ -0,0 +1,64 @@ +package mc.carlton.freerpg.events.combat; + + +import java.util.ArrayList; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.skills.perksAndAbilities.Agility; +import mc.carlton.freerpg.skills.perksAndAbilities.Global; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityDamageEvent; + +public class PlayerTakeDamage implements Listener { + + @EventHandler(priority = EventPriority.HIGHEST) + void onPlayerTakeDamage(EntityDamageEvent e) { + if (e.isCancelled()) { + return; + } + if (e.getEntity() instanceof Player) { + Player p = (Player) e.getEntity(); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + Random rand = new Random(); + if (e.getCause() == EntityDamageEvent.DamageCause.BLOCK_EXPLOSION) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("mining")) { + return; + } + if ((int) pStat.get("mining").get(12) > 0) { + e.setDamage(0); + } + } + if (e.getCause() == EntityDamageEvent.DamageCause.FALL) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("agility")) { + return; + } + Agility agilityClass = new Agility(p); + double damageReduction = agilityClass.roll(e.getFinalDamage()); + e.setDamage(e.getDamage() * damageReduction); + } + + if (e.getFinalDamage() > p.getHealth()) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("global")) { + return; + } + if ((int) pStat.get("global").get(10) > 0) { + if (0.1 > rand.nextFloat()) { + e.setDamage(0); + Global globalClass = new Global(p); + globalClass.avatar(); + } + } + } + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/combat/PotionSplash.java b/src/main/java/mc/carlton/freerpg/events/combat/PotionSplash.java new file mode 100644 index 0000000..d1c9118 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/combat/PotionSplash.java @@ -0,0 +1,116 @@ +package mc.carlton.freerpg.events.combat; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.GameMode; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.entity.ThrownPotion; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.PotionSplashEvent; +import org.bukkit.plugin.Plugin; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +public class PotionSplash implements Listener { + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + @EventHandler(priority = EventPriority.HIGHEST) + void onPotionSplash(PotionSplashEvent e) { + if (e.isCancelled()) { + return; + } + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("alchemy")) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + List harmfulEffects = itemGroups.getHarmfulEffects(); + + ThrownPotion potionEntity = e.getPotion(); + if (!(potionEntity.getShooter() instanceof Player)) { + return; + } + Player p = (Player) potionEntity.getShooter(); + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + int potionMasterLevel = (int) pStat.get("alchemy").get(13); + if ((int) pStat.get("global").get(15) != 1) { + potionMasterLevel = 0; + } + int potionDurationLevel = (int) pStat.get("alchemy").get(4); + double durationMultiplier = potionDurationLevel * 0.001 + 1; + for (LivingEntity entity : e.getAffectedEntities()) { + for (PotionEffect effect : e.getPotion().getEffects()) { + if (p.equals(entity)) { + if (harmfulEffects.contains(effect.getType())) { + int finalPotionMasterLevel = potionMasterLevel; + new BukkitRunnable() { + @Override + public void run() { + if (entity.equals(p)) { + if (!effect.getType().equals(PotionEffectType.HARM)) { + entity.addPotionEffect(new PotionEffect(effect.getType(), + (int) Math.round(effect.getDuration() * (1.0 / durationMultiplier)), + effect.getAmplifier()), true); + } + } else if (!(entity instanceof Player)) { + if (!effect.getType().equals(PotionEffectType.HARM)) { + entity.addPotionEffect(new PotionEffect(effect.getType(), + (int) Math.round(effect.getDuration() * durationMultiplier), + effect.getAmplifier() + finalPotionMasterLevel), true); + } else { + if (finalPotionMasterLevel > 0) { + entity.addPotionEffect(new PotionEffect(effect.getType(), 1, + 0)); //Add 3 HP to whatever the damage was + } + } + } else { + if (configLoad.isAllowPvP()) { + if (!effect.getType().equals(PotionEffectType.HARM)) { + entity.addPotionEffect(new PotionEffect(effect.getType(), + (int) Math.round(effect.getDuration() * durationMultiplier), + effect.getAmplifier() + finalPotionMasterLevel), true); + } else { + if (finalPotionMasterLevel > 0) { + entity.addPotionEffect(new PotionEffect(effect.getType(), 1, + 0)); //Add 3 HP to whatever the damage was + } + } + } + } + } + }.runTaskLater(plugin, 2); + } else if (effect.getType().equals(PotionEffectType.HEAL)) { + if (potionMasterLevel > 0) { + entity.addPotionEffect( + new PotionEffect(effect.getType(), 1, 0)); //Add 2 HP to whatever the healing was + } + } else { + entity.addPotionEffect(new PotionEffect(effect.getType(), + (int) Math.round(effect.getDuration() * durationMultiplier), + effect.getAmplifier() + potionMasterLevel), true); + } + } else { + entity.addPotionEffect(new PotionEffect(effect.getType(), + (int) Math.round(effect.getDuration() * durationMultiplier), + effect.getAmplifier() + potionMasterLevel), true); + } + } + } + + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/enchanting/AnvilClick.java b/src/main/java/mc/carlton/freerpg/events/enchanting/AnvilClick.java new file mode 100644 index 0000000..7a53b8b --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/enchanting/AnvilClick.java @@ -0,0 +1,51 @@ +package mc.carlton.freerpg.events.enchanting; + +import java.util.Map; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import org.apache.logging.log4j.Level; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.AnvilInventory; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class AnvilClick implements Listener { + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + @EventHandler(priority = EventPriority.HIGH) + void onInventoryClick(InventoryClickEvent e) { + if (e.isCancelled()) { + return; + } + try { + InventoryType invType = e.getClickedInventory().getType(); + } catch (Exception except) { + FreeRPG.log(Level.WARN, except.getMessage()); + return; + } + if (e.getInventory() instanceof AnvilInventory) { //This section is very buggy, and not clean. Hopefully I can improve it in the future + Player p = (Player) e.getWhoClicked(); + int level = p.getLevel(); + new BukkitRunnable() { + @Override + public void run() { + int newLevel = p.getLevel(); + if (newLevel < level) { + ConfigLoad configLoad1 = new ConfigLoad(); + Map expMap = configLoad1.getExpMapForSkill("enchanting"); + ChangeStats increaseStats = new ChangeStats(p); + increaseStats.changeEXP("enchanting", + expMap.get("useAnvil_EXPperLevelUsed") * (level - newLevel)); + } + } + }.runTaskLater(plugin, 2); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/enchanting/ExperienceBottleBreak.java b/src/main/java/mc/carlton/freerpg/events/enchanting/ExperienceBottleBreak.java new file mode 100644 index 0000000..2640598 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/enchanting/ExperienceBottleBreak.java @@ -0,0 +1,19 @@ +package mc.carlton.freerpg.events.enchanting; + +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.utils.game.ExperienceBottleTracking; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.ExpBottleEvent; + +public class ExperienceBottleBreak implements Listener { + + @EventHandler + void onExpBottleBreak(ExpBottleEvent e) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.isGetEXPFromEnchantingBottles()) { + ExperienceBottleTracking experienceBottleTracking = new ExperienceBottleTracking(); + experienceBottleTracking.addLocation(e.getEntity().getLocation()); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/enchanting/PlayerEnchant.java b/src/main/java/mc/carlton/freerpg/events/enchanting/PlayerEnchant.java new file mode 100644 index 0000000..2087bb3 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/enchanting/PlayerEnchant.java @@ -0,0 +1,33 @@ +package mc.carlton.freerpg.events.enchanting; + +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.skills.perksAndAbilities.Enchanting; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.enchantment.EnchantItemEvent; +import org.bukkit.inventory.EnchantingInventory; +import org.bukkit.plugin.Plugin; + +public class PlayerEnchant implements Listener { + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + @EventHandler(priority = EventPriority.HIGH) + void onEnchant(EnchantItemEvent e) { + if (e.isCancelled()) { + return; + } + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("enchanting")) { + return; + } + Player p = (Player) e.getEnchanter(); + Enchanting enchantingClass = new Enchanting(p); + enchantingClass.enchantItem(e.getItem(), e.whichButton(), + (EnchantingInventory) e.getInventory()); + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/enchanting/PlayerGetExperience.java b/src/main/java/mc/carlton/freerpg/events/enchanting/PlayerGetExperience.java new file mode 100644 index 0000000..b7666a0 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/enchanting/PlayerGetExperience.java @@ -0,0 +1,44 @@ +package mc.carlton.freerpg.events.enchanting; + +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.skills.perksAndAbilities.Enchanting; +import mc.carlton.freerpg.utils.game.ExperienceBottleTracking; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerExpChangeEvent; + +public class PlayerGetExperience implements Listener { + + @EventHandler + void onExperienceGain(PlayerExpChangeEvent e) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("enchanting")) { + return; + } + Player p = e.getPlayer(); + boolean naturalEXPGain = false; + boolean fromBottle = false; + for (Entity entity : p.getNearbyEntities(1, 1, 1)) { + if (entity.getType().equals(EntityType.EXPERIENCE_ORB)) { + naturalEXPGain = true; + if (!configLoad.isGetEXPFromEnchantingBottles()) { + ExperienceBottleTracking experienceBottleTracking = new ExperienceBottleTracking(); + fromBottle = experienceBottleTracking.fromEnchantingBottle(entity); + break; + } + } + } + if (naturalEXPGain && !fromBottle) { + Enchanting enchantingClass = new Enchanting(p); + enchantingClass.giveEXP(e.getAmount()); + int oldAmount = e.getAmount(); + int newAmount = enchantingClass.xpIncrease(oldAmount); + e.setAmount(newAmount); + } + + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/enchanting/PrepareEnchanting.java b/src/main/java/mc/carlton/freerpg/events/enchanting/PrepareEnchanting.java new file mode 100644 index 0000000..0ab01ea --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/enchanting/PrepareEnchanting.java @@ -0,0 +1,33 @@ +package mc.carlton.freerpg.events.enchanting; + +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.skills.perksAndAbilities.Enchanting; +import org.bukkit.enchantments.EnchantmentOffer; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.enchantment.PrepareItemEnchantEvent; +import org.bukkit.plugin.Plugin; + +public class PrepareEnchanting implements Listener { + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + @EventHandler(priority = EventPriority.HIGH) + void onEnchantOpen(PrepareItemEnchantEvent e) { + if (e.isCancelled()) { + return; + } + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("enchanting")) { + return; + } + Player p = (Player) e.getEnchanter(); + Enchanting enchantingClass = new Enchanting(p); + EnchantmentOffer[] oldOffers = e.getOffers(); + EnchantmentOffer[] newOffers = enchantingClass.enchantmentDiscount(oldOffers); + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/enchanting/PrepareRepair.java b/src/main/java/mc/carlton/freerpg/events/enchanting/PrepareRepair.java new file mode 100644 index 0000000..df8e2f1 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/enchanting/PrepareRepair.java @@ -0,0 +1,35 @@ +package mc.carlton.freerpg.events.enchanting; + +import java.util.ArrayList; +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.PrepareAnvilEvent; +import org.bukkit.inventory.AnvilInventory; + +public class PrepareRepair implements Listener { + + @EventHandler + void onRepairOpen(PrepareAnvilEvent e) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("enchanting")) { + return; + } + AnvilInventory anvil = e.getInventory(); + try { + Player p = (Player) anvil.getViewers().get(0); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + int levelSubtract = (int) pStat.get("enchanting").get(7); + int newCost = Math.max(2, anvil.getRepairCost() - levelSubtract); + anvil.setRepairCost(newCost); + } catch (IndexOutOfBoundsException error) { + return; + } + + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/furnace/FurnaceBurn.java b/src/main/java/mc/carlton/freerpg/events/furnace/FurnaceBurn.java new file mode 100644 index 0000000..94a3f45 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/furnace/FurnaceBurn.java @@ -0,0 +1,34 @@ +package mc.carlton.freerpg.events.furnace; + +import mc.carlton.freerpg.skills.perksAndAbilities.Smelting; +import mc.carlton.freerpg.utils.game.FurnaceUserTracker; +import org.bukkit.Material; +import org.bukkit.block.Furnace; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.FurnaceBurnEvent; + +public class FurnaceBurn implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onBurn(FurnaceBurnEvent e) { + if (e.isCancelled()) { + return; + } + boolean isBlast = false; + if (e.getBlock().getType() == Material.BLAST_FURNACE + || e.getBlock().getType() == Material.SMOKER) { + isBlast = true; + } + Furnace furnace = (Furnace) e.getBlock().getState(); + FurnaceUserTracker furnaceTracker = new FurnaceUserTracker(); + Player p = furnaceTracker.getPlayer(furnace.getLocation()); + if (p != null && p.isOnline()) { + Smelting smeltingClass = new Smelting(p); + smeltingClass.fuelBurn(furnace, isBlast); + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/furnace/FurnaceInventoryClick.java b/src/main/java/mc/carlton/freerpg/events/furnace/FurnaceInventoryClick.java new file mode 100644 index 0000000..e0a5d44 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/furnace/FurnaceInventoryClick.java @@ -0,0 +1,40 @@ +package mc.carlton.freerpg.events.furnace; + +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.utils.game.FurnaceUserTracker; +import org.apache.logging.log4j.Level; +import org.bukkit.block.Furnace; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.plugin.Plugin; + +public class FurnaceInventoryClick implements Listener { + + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + @EventHandler(priority = EventPriority.HIGH) + void onInventoryClick(InventoryClickEvent e) { + if (e.isCancelled()) { + return; + } + try { + InventoryType invType = e.getClickedInventory().getType(); + } catch (Exception except) { + FreeRPG.log(Level.WARN, except.getMessage()); + return; + } + if (e.getInventory() + .getHolder() instanceof Furnace) { //This section is very buggy, and not clean. Hopefully I can improve it in the future + Furnace furnace = (Furnace) e.getInventory().getHolder(); + Player p = (Player) e.getWhoClicked(); + if (furnace.getBurnTime() == 0 || furnace.getCookTime() == 0) { + FurnaceUserTracker furnaceTracker = new FurnaceUserTracker(); + furnaceTracker.addfurnaceLocation(furnace.getLocation(), p); + } + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/furnace/FurnaceSmelt.java b/src/main/java/mc/carlton/freerpg/events/furnace/FurnaceSmelt.java new file mode 100644 index 0000000..25ee3b2 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/furnace/FurnaceSmelt.java @@ -0,0 +1,34 @@ +package mc.carlton.freerpg.events.furnace; + +import mc.carlton.freerpg.skills.perksAndAbilities.Smelting; +import mc.carlton.freerpg.utils.game.FurnaceUserTracker; +import org.bukkit.Material; +import org.bukkit.block.Furnace; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.FurnaceSmeltEvent; + +public class FurnaceSmelt implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onSmelt(FurnaceSmeltEvent e) { + if (e.isCancelled()) { + return; + } + boolean isBlast = false; + if (e.getBlock().getType() == Material.BLAST_FURNACE + || e.getBlock().getType() == Material.SMOKER) { + isBlast = true; + } + Furnace furnace = (Furnace) e.getBlock().getState(); + FurnaceUserTracker furnaceTracker = new FurnaceUserTracker(); + Player p = furnaceTracker.getPlayer(furnace.getLocation()); + if (p != null && p.isOnline()) { + Smelting smeltingClass = new Smelting(p); + smeltingClass.speedUpFurnace(furnace, isBlast); + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/gui/ConfigurationGUIClick.java b/src/main/java/mc/carlton/freerpg/events/gui/ConfigurationGUIClick.java new file mode 100644 index 0000000..dad9944 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/gui/ConfigurationGUIClick.java @@ -0,0 +1,140 @@ +package mc.carlton.freerpg.events.gui; + +import java.util.ArrayList; +import java.util.Map; +import java.util.UUID; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import mc.carlton.freerpg.utils.globalVariables.StringsAndOtherData; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; + +public class ConfigurationGUIClick implements Listener { + + @EventHandler + public void clickEvent(InventoryClickEvent e) { + boolean proceed = true; + try { + InventoryType invType = e.getClickedInventory().getType(); + } catch (Exception except) { + proceed = false; + return; + } + if (e.getView().getTitle().equalsIgnoreCase("Configuration Window")) { + if (e.getClickedInventory().getType() == InventoryType.PLAYER) { + e.setCancelled(true); + return; + } + if (e.getClick() != ClickType.LEFT) { + e.setCancelled(true); + } + if (e.getCursor().getType() != Material.AIR) { + e.setCancelled(true); + } + Player p = (Player) e.getWhoClicked(); + LanguageSelector lang = new LanguageSelector(p); + PlayerStats pStatClass = new PlayerStats(p); + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + Map>> statAll = pStatClass.getData(); + Map> pStat = pStatClass.getPlayerData(); + Map bookIndexes = stringsAndOtherData.getBookIndexes(); + Map dyeIndexes = stringsAndOtherData.getDyeIndexes(); + if (e.getCurrentItem() != null) { + PlayerStats languageChange = new PlayerStats(p); + for (int index : bookIndexes.keySet()) { + if (e.getRawSlot() == index) { + String languageCode = bookIndexes.get(index); + switch (languageCode) { + case "enUs": + break; + default: + p.sendMessage( + ChatColor.GOLD + lang.getString("translators") + ChatColor.GRAY + ": " + + ChatColor.WHITE + lang.getString("translationCredit", languageCode)); + break; + } + e.setCancelled(true); + return; + } + } + for (int index : dyeIndexes.keySet()) { + if (e.getRawSlot() == index) { + String languageCode = dyeIndexes.get(index); + languageChange.setPlayerLanguage(languageCode); + p.performCommand("frpg configurationGUI"); + e.setCancelled(true); + return; + } + } + switch (e.getRawSlot()) { + case 10: + if ((int) pStat.get("global").get(21) > 0) { + pStat.get("global").set(21, 0); + } else { + pStat.get("global").set(21, 1); + } + statAll.put(p.getUniqueId(), pStat); + pStatClass.setData(statAll); + p.performCommand("frpg configurationGUI"); + break; + case 11: + if ((int) pStat.get("global").get(22) > 0) { + pStat.get("global").set(22, 0); + } else { + pStat.get("global").set(22, 1); + } + statAll.put(p.getUniqueId(), pStat); + pStatClass.setData(statAll); + p.performCommand("frpg configurationGUI"); + break; + case 12: + if ((int) pStat.get("global").get(24) > 0) { + pStat.get("global").set(24, 0); + + } else { + pStat.get("global").set(24, 1); + } + statAll.put(p.getUniqueId(), pStat); + pStatClass.setData(statAll); + p.performCommand("frpg configurationGUI"); + break; + case 13: + if ((int) pStat.get("global").get(25) > 0) { + pStat.get("global").set(25, 0); + } else { + pStat.get("global").set(25, 1); + } + statAll.put(p.getUniqueId(), pStat); + pStatClass.setData(statAll); + p.performCommand("frpg configurationGUI"); + break; + case 14: + int numberOfBars = (int) pStat.get("global").get(28); + if (numberOfBars < 3) { + pStat.get("global").set(28, Math.max(numberOfBars + 1, 0)); + } else { + pStat.get("global").set(28, 0); + } + statAll.put(p.getUniqueId(), pStat); + pStatClass.setData(statAll); + p.performCommand("frpg configurationGUI"); + break; + case 45: + p.performCommand("frpg skills"); + break; + default: + break; + } + } + + e.setCancelled(true); //So they cant take the items + } + } +} + diff --git a/src/main/java/mc/carlton/freerpg/events/gui/ConfirmationGUIClick.java b/src/main/java/mc/carlton/freerpg/events/gui/ConfirmationGUIClick.java new file mode 100644 index 0000000..d251987 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/gui/ConfirmationGUIClick.java @@ -0,0 +1,143 @@ +package mc.carlton.freerpg.events.gui; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.skills.perksAndAbilities.Global; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; + +public class ConfirmationGUIClick implements Listener { + + @EventHandler + public void clickEvent(InventoryClickEvent e) { + boolean proceed = true; + try { + InventoryType invType = e.getClickedInventory().getType(); + } catch (Exception except) { + proceed = false; + return; + } + if (e.getView().getTitle().equalsIgnoreCase("Confirmation Window")) { + if (e.getClickedInventory().getType() == InventoryType.PLAYER) { + e.setCancelled(true); + return; + } + if (e.getClick() != ClickType.LEFT) { + e.setCancelled(true); + } + if (e.getCursor().getType() != Material.AIR) { + e.setCancelled(true); + } + Player p = (Player) e.getWhoClicked(); + Inventory inv = e.getClickedInventory(); + if (e.getCurrentItem() != null) { + String skillName = ""; + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", + "alchemy", "smelting", "enchanting", "global"}; + String[] mainSkills_0 = {"digging", "woodcutting", "mining", "farming", "fishing", + "archery", "beastMastery", "swordsmanship", "defense", "axeMastery"}; + List mainSkills = Arrays.asList(mainSkills_0); + Material indicator = inv.getItem(4).getType(); + switch (indicator) { + case IRON_SHOVEL: + skillName = labels_0[0]; + break; + case IRON_AXE: + skillName = labels_0[1]; + break; + case IRON_PICKAXE: + skillName = labels_0[2]; + break; + case IRON_HOE: + skillName = labels_0[3]; + break; + case FISHING_ROD: + skillName = labels_0[4]; + break; + case BOW: + skillName = labels_0[5]; + break; + case BONE: + skillName = labels_0[6]; + break; + case IRON_SWORD: + skillName = labels_0[7]; + break; + case IRON_CHESTPLATE: + skillName = labels_0[8]; + break; + case GOLDEN_AXE: + skillName = labels_0[9]; + break; + case ANVIL: + skillName = labels_0[10]; + break; + case LEATHER_LEGGINGS: + skillName = labels_0[11]; + break; + case POTION: + skillName = labels_0[12]; + break; + case COAL: + skillName = labels_0[13]; + break; + case ENCHANTING_TABLE: + skillName = labels_0[14]; + break; + default: + break; + + } + if (e.getCurrentItem().getType() == Material.LIME_TERRACOTTA) { + UUID uuid = p.getUniqueId(); + ChangeStats refundStat = new ChangeStats(p); + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ConfigLoad loadConfig = new ConfigLoad(); + ArrayList soulsInfo = loadConfig.getSoulsInfo(); + int refundCost = (int) soulsInfo.get(1); + int souls = (int) pStatAll.get("global").get(20); + if (souls >= refundCost) { + + //Refund the skill tree + refundStat.refundSkillTree(skillName); + + //Remove the souls + Global globalClass = new Global(p); + globalClass.loseSouls(refundCost); + } else { + LanguageSelector langManager = new LanguageSelector(p); + String refundCostString = Integer.toString(refundCost); + p.sendMessage( + ChatColor.RED + refundCostString + " " + langManager.getString("requiredSouls")); + } + + p.closeInventory(); + p.performCommand("frpg skillTreeGUI " + skillName); + } else if (e.getCurrentItem().getType() == Material.RED_TERRACOTTA) { + p.closeInventory(); + p.performCommand("frpg skillTreeGUI " + skillName); + } + } + + e.setCancelled(true); //So they cant take the items + } + } +} + diff --git a/src/main/java/mc/carlton/freerpg/events/gui/CraftingGUIclick.java b/src/main/java/mc/carlton/freerpg/events/gui/CraftingGUIclick.java new file mode 100644 index 0000000..afad5af --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/gui/CraftingGUIclick.java @@ -0,0 +1,62 @@ +package mc.carlton.freerpg.events.gui; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; + +public class CraftingGUIclick implements Listener { + + @EventHandler + public void clickEvent(InventoryClickEvent e) { + boolean proceed = true; + try { + InventoryType invType = e.getClickedInventory().getType(); + } catch (Exception except) { + proceed = false; + return; + } + if (e.getView().getTitle().equalsIgnoreCase("Crafting Recipe")) { + if (e.getClickedInventory().getType() == InventoryType.PLAYER) { + e.setCancelled(true); + return; + } + if (e.getClick() != ClickType.LEFT) { + e.setCancelled(true); + } + if (e.getCursor().getType() != Material.AIR) { + e.setCancelled(true); + } + Player p = (Player) e.getWhoClicked(); + Inventory inv = e.getClickedInventory(); + if (e.getCurrentItem() != null) { + if (e.getCurrentItem().getType() == Material.ARROW) { + switch (inv.getItem(25).getType()) { + case TIPPED_ARROW: + p.performCommand("frpg skillTreeGUI archery"); + break; + case COW_SPAWN_EGG: + case BEE_SPAWN_EGG: + case MOOSHROOM_SPAWN_EGG: + case HORSE_SPAWN_EGG: + case SLIME_SPAWN_EGG: + p.performCommand("frpg skillTreeGUI farming"); + break; + case POTION: + p.performCommand("frpg skillTreeGUI alchemy"); + break; + default: + p.performCommand("frpg skillTreeGUI enchanting"); + break; + } + } + } + + e.setCancelled(true); //So they cant take the items + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/gui/MainGUIclick.java b/src/main/java/mc/carlton/freerpg/events/gui/MainGUIclick.java new file mode 100644 index 0000000..98b963b --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/gui/MainGUIclick.java @@ -0,0 +1,116 @@ +package mc.carlton.freerpg.events.gui; + +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; + +public class MainGUIclick implements Listener { + + @EventHandler + public void clickEvent(InventoryClickEvent e) { + boolean proceed = true; + try { + InventoryType invType = e.getClickedInventory().getType(); + } catch (Exception except) { + proceed = false; + } + //Check to see if its the GUI menu + if (proceed) { + if (e.getView().getTitle().equalsIgnoreCase("Skills")) { + if (e.getClickedInventory().getType() == InventoryType.PLAYER) { + e.setCancelled(true); + return; + } + if (e.getClick() != ClickType.LEFT) { + e.setCancelled(true); + } + if (e.getCursor().getType() != Material.AIR) { + e.setCancelled(true); + } + Player p = (Player) e.getWhoClicked(); + //Determine what they selected and what to do + if (e.getCurrentItem() != null) { + switch (e.getCurrentItem().getType()) { + case NETHER_STAR: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI global"); + break; + case IRON_SHOVEL: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI digging"); + break; + case IRON_AXE: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI woodcutting"); + break; + case IRON_PICKAXE: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI mining"); + break; + case IRON_HOE: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI farming"); + break; + case FISHING_ROD: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI fishing"); + break; + case BOW: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI archery"); + break; + case BONE: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI beastMastery"); + break; + case IRON_SWORD: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI swordsmanship"); + break; + case IRON_CHESTPLATE: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI defense"); + break; + case GOLDEN_AXE: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI axeMastery"); + break; + case ANVIL: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI repair"); + break; + case LEATHER_LEGGINGS: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI agility"); + break; + case POTION: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI alchemy"); + break; + case COAL: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI smelting"); + break; + case ENCHANTING_TABLE: + p.closeInventory(); + p.performCommand("frpg skillTreeGUI enchanting"); + break; + case REDSTONE: + p.closeInventory(); + p.performCommand("frpg configurationGUI"); + break; + default: + break; + } + } + + e.setCancelled(true); //So they cant take the items + } + + } + } +} \ No newline at end of file diff --git a/src/main/java/mc/carlton/freerpg/events/gui/MaxPassiveLevels.java b/src/main/java/mc/carlton/freerpg/events/gui/MaxPassiveLevels.java new file mode 100644 index 0000000..51a49d6 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/gui/MaxPassiveLevels.java @@ -0,0 +1,104 @@ +package mc.carlton.freerpg.events.gui; + +public class MaxPassiveLevels { + + public int findMaxLevel(String skillName, int index) { + int maxLevel = Integer.MAX_VALUE; + switch (skillName) { + case "digging": + switch (index) { + case 2: + maxLevel = 2400; + break; + default: + break; + } + break; + case "archery": + case "woodcutting": + switch (index) { + case 2: + maxLevel = 2000; + break; + default: + break; + } + break; + case "mining": + switch (index) { + case 2: + maxLevel = 2000; + break; + case 3: + maxLevel = 10000; + break; + default: + break; + } + break; + case "farming": + case "fishing": + switch (index) { + case 2: + case 3: + maxLevel = 2000; + break; + default: + break; + } + break; + case "beastMastery": + switch (index) { + case 2: + maxLevel = 4000; + break; + default: + break; + } + break; + case "swordsmanship": + switch (index) { + case 2: + maxLevel = 5000; + break; + default: + break; + } + break; + case "defense": + switch (index) { + case 2: + maxLevel = 9900; + break; + case 3: + maxLevel = 2000; + break; + default: + break; + } + break; + case "axeMastery": + switch (index) { + case 2: + maxLevel = 10000; + break; + default: + break; + } + break; + case "agility": + switch (index) { + case 1: + maxLevel = 2000; + break; + default: + break; + } + break; + default: + break; + } + + return maxLevel; + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/gui/SkillsConfigGUIClick.java b/src/main/java/mc/carlton/freerpg/events/gui/SkillsConfigGUIClick.java new file mode 100644 index 0000000..8268a3f --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/gui/SkillsConfigGUIClick.java @@ -0,0 +1,138 @@ +package mc.carlton.freerpg.events.gui; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; + +public class SkillsConfigGUIClick implements Listener { + + @EventHandler + public void clickEvent(InventoryClickEvent e) { + boolean proceed = true; + try { + InventoryType invType = e.getClickedInventory().getType(); + } catch (Exception except) { + proceed = false; + return; + } + String[] titles_0 = {"Digging", "Woodcutting", "Mining", "Farming", "Fishing", "Archery", + "Beast Mastery", "Swordsmanship", "Defense", "Axe Mastery", "Repair", "Agility", "Alchemy", + "Smelting", "Enchanting"}; + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + String[] passiveLabels_0 = {"repair", "agility", "alchemy", "smelting", "enchanting"}; + List labels = Arrays.asList(labels_0); + List skillTitles = Arrays.asList(titles_0); + List passiveLabels = Arrays.asList(passiveLabels_0); + for (String skillTitle : skillTitles) { + if (e.getView().getTitle().equalsIgnoreCase(skillTitle + " Configuration")) { + String skillName = labels.get(skillTitles.indexOf(skillTitle)); + if (e.getClickedInventory().getType() == InventoryType.PLAYER) { + e.setCancelled(true); + return; + } + if (e.getClick() != ClickType.LEFT) { + e.setCancelled(true); + } + if (e.getCursor().getType() != Material.AIR) { + e.setCancelled(true); + } + Player p = (Player) e.getWhoClicked(); + LanguageSelector lang = new LanguageSelector(p); + Inventory inv = e.getClickedInventory(); + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStat = pStatClass.getPlayerData(); + if (e.getCurrentItem() != null) { + PlayerStats languageChange = new PlayerStats(p); + if (e.getCurrentItem().getType().equals(Material.ARROW)) { + p.performCommand("frpg skillTreeGUI " + skillName); + } else if (e.getRawSlot() == 19) {//Toggle EXPBar for skill + pStatClass.togglePlayerSkillExpBar(skillName); + p.performCommand("frpg skillConfigGUI " + skillName); + } else if (e.getRawSlot() == 20 && !passiveLabels.contains( + skillName)) { //Toggle Ability for skill + pStatClass.togglePlayerSkillAbility(skillName); + p.performCommand("frpg skillConfigGUI " + skillName); + } else { + switch (skillName) { + case "digging": + if (e.getSlot() == 37) { + p.performCommand("frpg flintToggle"); + p.performCommand("frpg skillConfigGUI " + skillName); + } else if (e.getSlot() == 38) { + p.performCommand("frpg megaDigToggle"); + p.performCommand("frpg skillConfigGUI " + skillName); + } + break; + case "woodcutting": + if (e.getSlot() == 37) { + p.performCommand("frpg leafBlowerToggle"); + p.performCommand("frpg skillConfigGUI " + skillName); + } + break; + case "mining": + if (e.getSlot() == 37) { + p.performCommand("frpg veinMinerToggle"); + p.performCommand("frpg skillConfigGUI " + skillName); + } + break; + case "fishing": + if (e.getSlot() == 37) { + p.performCommand("frpg grappleToggle"); + p.performCommand("frpg skillConfigGUI " + skillName); + } else if (e.getSlot() == 38) { + p.performCommand("frpg hotRodToggle"); + p.performCommand("frpg skillConfigGUI " + skillName); + } + break; + case "axeMastery": + if (e.getSlot() == 37) { + p.performCommand("frpg holyAxeToggle"); + p.performCommand("frpg skillConfigGUI " + skillName); + } + break; + case "agility": + if (e.getSlot() == 37) { + p.performCommand("frpg speedToggle"); + p.performCommand("frpg skillConfigGUI " + skillName); + } + break; + case "alchemy": + if (e.getSlot() == 37) { + p.performCommand("frpg potionToggle"); + p.performCommand("frpg skillConfigGUI " + skillName); + } + break; + case "smelting": + if (e.getSlot() == 37) { + p.performCommand("frpg flamePickToggle"); + p.performCommand("frpg skillConfigGUI " + skillName); + } + break; + default: + break; + } + } + + e.setCancelled(true); //So they cant take the items + } + break; + } + } + } +} + diff --git a/src/main/java/mc/carlton/freerpg/events/gui/SkillsGUIclick.java b/src/main/java/mc/carlton/freerpg/events/gui/SkillsGUIclick.java new file mode 100644 index 0000000..6e04b52 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/gui/SkillsGUIclick.java @@ -0,0 +1,452 @@ +package mc.carlton.freerpg.events.gui; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.skills.perksAndAbilities.Agility; +import mc.carlton.freerpg.skills.perksAndAbilities.Defense; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import mc.carlton.freerpg.skills.perksAndAbilities.Fishing; +import mc.carlton.freerpg.skills.perksAndAbilities.Global; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryType; + +public class SkillsGUIclick implements Listener { + + @EventHandler + public void clickEvent(InventoryClickEvent e) { + boolean proceed = true; + try { + InventoryType invType = e.getClickedInventory().getType(); + } catch (Exception except) { + proceed = false; + return; + } + + String[] titles_0 = {"Digging", "Woodcutting", "Mining", "Farming", "Fishing", "Archery", + "Beast Mastery", "Swordsmanship", "Defense", "Axe Mastery", "Repair", "Agility", "Alchemy", + "Smelting", "Enchanting"}; + String[] labels = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + List titles = Arrays.asList(titles_0); + String title = e.getView().getTitle(); + int titleIndex = titles.indexOf(title); + //Check to see if its the GUI menu + if (proceed) { + if (titleIndex != -1) { + if (e.getClickedInventory().getType() == InventoryType.PLAYER) { + e.setCancelled(true); + return; + } + if (e.getClick() != ClickType.LEFT) { + e.setCancelled(true); + } + if (e.getCursor().getType() != Material.AIR) { + e.setCancelled(true); + } + Player p = (Player) e.getWhoClicked(); + LanguageSelector langManager = new LanguageSelector(p); + UUID uuid = p.getUniqueId(); + String skillName = labels[titleIndex]; + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ArrayList pStats = pStatAll.get(skillName); + MaxPassiveLevels passiveMax = new MaxPassiveLevels(); + int passiveTokens = pStats.get(2).intValue(); + //Determine what they selected and what to do + if (e.getCurrentItem() != null) { + switch (e.getCurrentItem().getType()) { + case ARROW: + p.closeInventory(); + p.performCommand("frpg skills"); + break; + case COMPOSTER: + if ((int) pStatAll.get("global").get(20) >= 250 + && (int) pStatAll.get("global").get(9) > 0) { + p.closeInventory(); + p.performCommand("frpg confirmationGUI " + skillName); + } else { + if ((int) pStatAll.get("global").get(9) > 0) { + ConfigLoad loadConfig = new ConfigLoad(); + ArrayList soulsInfo = loadConfig.getSoulsInfo(); + String refundCost = Integer.toString(soulsInfo.get(1)); + p.sendMessage( + ChatColor.RED + refundCost + " " + langManager.getString("refundSkill")); + } else { + p.sendMessage( + ChatColor.RED + langManager.getString("needToUnlock") + " " + ChatColor.BOLD + + langManager.getString("globalPerkTitle7") + ChatColor.RESET + + ChatColor.RED.toString() + " " + langManager.getString("refundSkill2")); + } + } + break; + case RED_TERRACOTTA: + if (e.getSlot() == 13 || e.getSlot() == 31 || e.getSlot() == 7 || e.getSlot() == 43 + || e.getSlot() == 20 || e.getSlot() == 23) { + p.sendMessage(ChatColor.RED + langManager.getString("perkRequirement")); + } else if (e.getSlot() == 26) { + p.sendMessage(ChatColor.RED + langManager.getString("perkRequirementM")); + } + break; + case PINK_TERRACOTTA: + case YELLOW_TERRACOTTA: + if (pStats.get(3).intValue() > 0) { + pStats.set(3, pStats.get(3).intValue() - 1); + switch (e.getSlot()) { + case 20: + case 11: + pStats.set(7, pStats.get(7).intValue() + 1); + break; + case 29: + pStats.set(8, pStats.get(8).intValue() + 1); + break; + case 23: + case 13: + pStats.set(9, pStats.get(9).intValue() + 1); + break; + case 31: + pStats.set(10, pStats.get(10).intValue() + 1); + break; + case 7: + pStats.set(11, pStats.get(11).intValue() + 1); + break; + case 43: + pStats.set(12, pStats.get(12).intValue() + 1); + break; + case 26: + pStats.set(13, pStats.get(13).intValue() + 1); + if (skillName.equals("farming")) { + pStatAll.put(skillName, pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + Farming farmingClass = new Farming(p); + farmingClass.oneWithNatureStart(); + } else if (skillName.equals("fishing")) { + pStatAll.put(skillName, pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + Fishing fishingClass = new Fishing(p); + fishingClass.fishPersonStart(); + } else if (skillName.equals("defense")) { + pStatAll.put(skillName, pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + Defense defenseClass = new Defense(p); + defenseClass.hearty(); + } else if (skillName.equals("agility")) { + pStatAll.put(skillName, pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + Agility agilityClass = new Agility(p); + agilityClass.gracefulFeetStart(); + } + break; + } + pStatAll.put(skillName, pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + } else { + p.sendMessage(ChatColor.RED + langManager.getString("noSkillTokens")); + } + p.performCommand("frpg skillTreeGUI " + skillName); + break; + + case GREEN_TERRACOTTA: + p.sendMessage(ChatColor.RED + langManager.getString("maxedOutPerk")); + break; + case RED_DYE: + if (passiveTokens > 0) { + upgradePassive(passiveTokens, pStats, e, Integer.MAX_VALUE, 1); + pStatAll.put(skillName, pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + } else { + p.sendMessage(ChatColor.RED + langManager.getString("noPassiveTokens")); + } + + p.performCommand("frpg skillTreeGUI " + skillName); + break; + case GREEN_DYE: + int maxLevel2 = passiveMax.findMaxLevel(skillName, 2); + int currentLevel2 = pStats.get(5).intValue(); + if (currentLevel2 >= maxLevel2) { + p.sendMessage(ChatColor.RED + langManager.getString("maxedOutPerk")); + } else { + if (passiveTokens > 0) { + upgradePassive(passiveTokens, pStats, e, maxLevel2, 2); + pStatAll.put(skillName, pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + } else { + p.sendMessage(ChatColor.RED + langManager.getString("noPassiveTokens")); + } + } + p.performCommand("frpg skillTreeGUI " + skillName); + break; + case BLUE_DYE: + int maxLevel3 = passiveMax.findMaxLevel(skillName, 3); + int currentLevel3 = pStats.get(6).intValue(); + if (currentLevel3 >= maxLevel3) { + p.sendMessage(ChatColor.RED + langManager.getString("maxedOutPerk")); + } else { + if (passiveTokens > 0) { + upgradePassive(passiveTokens, pStats, e, maxLevel3, 3); + pStatAll.put(skillName, pStats); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + } else { + p.sendMessage(ChatColor.RED + langManager.getString("noPassiveTokens")); + } + } + p.performCommand("frpg skillTreeGUI " + skillName); + break; + case REDSTONE: + p.closeInventory(); + p.performCommand("frpg skillConfigGUI " + skillName); + break; + case CRAFTING_TABLE: + if (skillName.equalsIgnoreCase("farming")) { + switch (e.getRawSlot()) { + case 48: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "farming1"); + break; + case 49: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "farming2"); + break; + case 50: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "farming3"); + break; + case 51: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "farming4"); + break; + case 52: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "farming5"); + break; + default: + break; + } + } else if (skillName.equalsIgnoreCase("archery")) { + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "archery1"); + } else if (skillName.equalsIgnoreCase("enchanting")) { + switch (e.getRawSlot()) { + case 39: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "enchanting1"); + break; + case 40: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "enchanting2"); + break; + case 41: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "enchanting3"); + break; + case 42: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "enchanting4"); + break; + case 43: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "enchanting5"); + break; + case 48: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "enchanting6"); + break; + case 49: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "enchanting7"); + break; + case 50: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "enchanting8"); + break; + case 51: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "enchanting9"); + break; + case 52: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "enchanting10"); + break; + default: + break; + } + } + if (skillName.equalsIgnoreCase("alchemy")) { + switch (e.getRawSlot()) { + case 48: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "alchemy1"); + break; + case 49: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "alchemy2"); + break; + case 50: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "alchemy3"); + break; + case 51: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "alchemy4"); + break; + case 52: + p.closeInventory(); + p.performCommand("frpg craftingGUI " + "alchemy5"); + break; + } + } + default: + break; + } + e.setCancelled(true); //So they cant take the items + } + } else if (title.equalsIgnoreCase("Global")) { + if (e.getClickedInventory().getType() == InventoryType.PLAYER) { + e.setCancelled(true); + return; + } + if (e.getClick() != ClickType.LEFT) { + e.setCancelled(true); + } + if (e.getCursor().getType() != Material.AIR) { + e.setCancelled(true); + } + Player p = (Player) e.getWhoClicked(); + LanguageSelector langManager = new LanguageSelector(p); + String skillName = "global"; + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(p.getUniqueId()); + ArrayList pStats = pStatAll.get(skillName); + if (e.getCurrentItem() != null && e.getSlot() < 54) { + switch (e.getCurrentItem().getType()) { + case ARROW: + p.closeInventory(); + p.performCommand("frpg skills"); + break; + case RED_TERRACOTTA: + if (e.getSlot() == 3 || e.getSlot() == 21 || e.getSlot() == 39) { + p.sendMessage(ChatColor.RED + langManager.getString("requiredGlobalPerks0")); + } else if (e.getSlot() == 24) { + p.sendMessage(ChatColor.RED + langManager.getString("globalPerkTitle3") + ", " + + langManager.getString("globalPerkTitle4") + ", " + langManager.getString( + "globalPerkTitle5") + " " + langManager.getString("requiredGlobalPerks1")); + } else if (e.getSlot() == 6 || e.getSlot() == 42) { + p.sendMessage(ChatColor.RED + langManager.getString("globalPerkTitle7") + " " + + langManager.getString("requiredGlobalPerks2")); + } else if (e.getSlot() == 26) { + p.sendMessage(ChatColor.RED + langManager.getString("requiredGlobalPerks3")); + } + break; + case PINK_TERRACOTTA: + if (pStats.get(1).intValue() > 0) { + pStats.set(1, pStats.get(1).intValue() - 1); + switch (e.getSlot()) { + case 1: + pStats.set(2, pStats.get(2).intValue() + 1); + break; + case 19: + pStats.set(3, pStats.get(3).intValue() + 1); + break; + case 37: + pStats.set(4, pStats.get(4).intValue() + 1); + break; + case 3: + pStats.set(5, pStats.get(5).intValue() + 1); + Global globalClass5 = new Global(p); + globalClass5.skillTokenBoost(5); + break; + case 21: + pStats.set(6, pStats.get(6).intValue() + 1); + Global globalClass6 = new Global(p); + globalClass6.skillTokenBoost(6); + break; + case 39: + pStats.set(7, pStats.get(7).intValue() + 1); + Global globalClass7 = new Global(p); + globalClass7.skillTokenBoost(7); + break; + case 6: + pStats.set(8, pStats.get(8).intValue() + 1); + break; + case 24: + pStats.set(9, pStats.get(9).intValue() + 1); + + /* Old Skill_3b perk + Global globalClass9 = new Global(p); + globalClass9.passiveTokenBoost(); + */ + break; + case 42: + pStats.set(10, pStats.get(10).intValue() + 1); + break; + case 26: + pStats.set(11, pStats.get(11).intValue() + 1); + break; + } + pStatAll.put(skillName, pStats); + statAll.put(p.getUniqueId(), pStatAll); + pStatClass.setData(statAll); + } else { + p.sendMessage(ChatColor.RED + langManager.getString("noSkillTokens")); + } + p.performCommand("frpg skillTreeGUI " + skillName); + break; + + case GREEN_TERRACOTTA: + p.sendMessage(ChatColor.RED + langManager.getString("maxedOutPerk")); + break; + + } + e.setCancelled(true); //So they cant take the items + } + } + } + } + + public void upgradePassive(int passiveTokens, ArrayList pStats, InventoryClickEvent e, + int maxPassiveLevel, int passiveSkillIndex) { + ConfigLoad configLoad = new ConfigLoad(); + ArrayList tokensInfo = configLoad.getTokensInfo(); + passiveSkillIndex += 3; //Sets the index to the proper value + int rightClickInvestment = (int) Math.round(tokensInfo.get(9)); + int shiftClickInvestment = (int) Math.round(tokensInfo.get(10)); + int currentPassiveSkillLevel = pStats.get(passiveSkillIndex).intValue(); + int investment = 0; + if (e.isShiftClick() && e.isRightClick() && configLoad.isShiftRightClickInvestAll()) { + investment = passiveTokens; + } else if (e.isShiftClick()) { + investment = Math.min(passiveTokens, shiftClickInvestment); + } else if (e.isRightClick()) { + investment = Math.min(passiveTokens, rightClickInvestment); + } else { + investment = 1; + } + if (investment + currentPassiveSkillLevel > maxPassiveLevel) { + investment = maxPassiveLevel - currentPassiveSkillLevel; + } + pStats.set(2, passiveTokens - investment); + pStats.set(passiveSkillIndex, pStats.get(passiveSkillIndex).intValue() + investment); + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/CreatureSpawn.java b/src/main/java/mc/carlton/freerpg/events/misc/CreatureSpawn.java new file mode 100644 index 0000000..0ab3613 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/CreatureSpawn.java @@ -0,0 +1,23 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.FreeRPG; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.metadata.FixedMetadataValue; +import org.bukkit.plugin.Plugin; + +public class CreatureSpawn implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onEntitySpawn(CreatureSpawnEvent e) { + if (e.isCancelled()) { + return; + } + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + if (e.getSpawnReason().equals(CreatureSpawnEvent.SpawnReason.SPAWNER)) { + e.getEntity().setMetadata("frpgSpawnerMob", new FixedMetadataValue(plugin, "frpg")); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/DispenserDispenseItem.java b/src/main/java/mc/carlton/freerpg/events/misc/DispenserDispenseItem.java new file mode 100644 index 0000000..b1cea6b --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/DispenserDispenseItem.java @@ -0,0 +1,31 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.utils.game.EntityPickedUpItemStorage; +import org.bukkit.Location; +import org.bukkit.block.Block; +import org.bukkit.block.data.Directional; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.block.BlockDispenseEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.util.Vector; + +public class DispenserDispenseItem implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onDispenserDispense(BlockDispenseEvent e) { + if (e.isCancelled()) { + return; + } + ItemStack item = e.getItem(); + Block dispenser = e.getBlock(); + if (dispenser.getBlockData() instanceof Directional) { + Directional directional = (Directional) dispenser.getBlockData(); + Vector normalVector = directional.getFacing().getDirection(); + Location location = e.getBlock().getLocation().add(normalVector); + EntityPickedUpItemStorage entityPickedUpItemStorage = new EntityPickedUpItemStorage(); + entityPickedUpItemStorage.addPickedUpItemFromDispenser(item, location); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/EntityPickUpItem.java b/src/main/java/mc/carlton/freerpg/events/misc/EntityPickUpItem.java new file mode 100644 index 0000000..1bbf33f --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/EntityPickUpItem.java @@ -0,0 +1,30 @@ +package mc.carlton.freerpg.events.misc; + +import java.util.List; +import mc.carlton.freerpg.utils.game.EntityPickedUpItemStorage; +import mc.carlton.freerpg.utils.globalVariables.EntityGroups; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityPickupItemEvent; +import org.bukkit.inventory.ItemStack; + +public class EntityPickUpItem implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onEntityPickUpItem(EntityPickupItemEvent e) { + if (e.isCancelled()) { + return; + } + LivingEntity entity = e.getEntity(); + ItemStack item = e.getItem().getItemStack(); + EntityGroups entityGroups = new EntityGroups(); + List hostileMobs = entityGroups.getHostileMobs(); + if (hostileMobs.contains(entity.getType())) { + EntityPickedUpItemStorage entityPickedUpItemStorage = new EntityPickedUpItemStorage(); + entityPickedUpItemStorage.addPickedUpItem(item, entity); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerBlockBreak.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerBlockBreak.java new file mode 100644 index 0000000..b98b899 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerBlockBreak.java @@ -0,0 +1,247 @@ +package mc.carlton.freerpg.events.misc; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.core.info.server.PlacedBlocksManager; +import mc.carlton.freerpg.skills.perksAndAbilities.Digging; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import mc.carlton.freerpg.skills.perksAndAbilities.Mining; +import mc.carlton.freerpg.skills.perksAndAbilities.Smelting; +import mc.carlton.freerpg.skills.perksAndAbilities.Woodcutting; +import mc.carlton.freerpg.utils.globalVariables.ExpMaps; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.data.Ageable; +import org.bukkit.block.data.BlockData; +import org.bukkit.block.data.type.Cocoa; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.inventory.ItemStack; + +public class PlayerBlockBreak implements Listener { + + @EventHandler(priority = EventPriority.HIGHEST) + void onblockBreak(BlockBreakEvent e) { + //WorldGuard Check + if (e.isCancelled()) { + return; + } + + Player p = e.getPlayer(); + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + + Block block = e.getBlock(); + Location loc = block.getLocation(); + Material blockType = block.getType(); + World world = e.getBlock().getWorld(); + + ItemGroups itemGroups = new ItemGroups(); + + // Tools and Other + List pickaxes = itemGroups.getPickaxes(); + List axes = itemGroups.getAxes(); + List shovels = itemGroups.getShovels(); + List hoes = itemGroups.getHoes(); + + //Blocks + List tallCrops = itemGroups.getTallCrops(); + List logs = itemGroups.getLogs(); + + //Gets Block-EXP maps + ExpMaps expMaps = new ExpMaps(); + Map diggingEXP = expMaps.getDiggingEXP(); + Map woodcuttingEXP = expMaps.getWoodcuttingEXP(); + Map miningEXP = expMaps.getMiningEXP(); + Map farmingEXP = expMaps.getFarmingEXP(); + Map flamePickEXP = expMaps.getFlamePickEXP(); + + //Config + ConfigLoad configLoad = new ConfigLoad(); + + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + + ChangeStats increaseStats = new ChangeStats(p); + + AbilityTracker abilities = new AbilityTracker(p); + Integer[] pAbilities = abilities.getPlayerAbilities(); + + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + + ItemStack itemInHand = p.getInventory().getItemInMainHand(); + + //Tracked Blocks + PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); + boolean natural = !placedBlocksManager.isBlockTracked(block); + + //EXP drops + if (flamePickEXP.containsKey(blockType) && pickaxes.contains(itemInHand.getType()) + && (int) pStat.get("global").get(13) > 0 && (int) pStat.get("smelting").get(13) > 0) { + Object[] flamePickData = flamePickEXP.get(blockType); + if (natural) { + increaseStats.changeEXP((String) flamePickData[0], (int) flamePickData[1]); + } + int veinMinerLevel = (int) pStat.get("mining").get(11); + int veinMinerToggle = (int) pStat.get("global").get(18); + if (itemGroups.getFlamePickOres().contains(blockType)) { + Mining miningClass = new Mining(p); + miningClass.wastelessHaste(blockType); + if (veinMinerLevel > 0 && veinMinerToggle > 0) { + miningClass.veinMiner(block, blockType); + } else { + Smelting smeltingClass = new Smelting(p); + smeltingClass.flamePick(block, world, blockType, true); + } + } else { + Smelting smeltingClass = new Smelting(p); + smeltingClass.flamePick(block, world, blockType, true); + } + } else if (diggingEXP.containsKey(blockType) && natural) { + if (!configLoad.getAllowedSkillsMap().get("digging")) { + return; + } + increaseStats.changeEXP("digging", diggingEXP.get(blockType)); + Material[] treasureBlocks0 = {Material.CLAY, Material.GRASS_BLOCK, Material.GRAVEL, + Material.MYCELIUM, Material.PODZOL, Material.COARSE_DIRT, + Material.DIRT, Material.RED_SAND, Material.SAND, Material.SOUL_SAND, Material.SNOW_BLOCK}; + List treasureBlocks = Arrays.asList(treasureBlocks0); + Digging diggingClass = new Digging(p); + boolean dropFlint = diggingClass.flintFinder(blockType); + if (dropFlint) { + e.setDropItems(false); + world.dropItemNaturally(loc, new ItemStack(Material.FLINT, 1)); + } + if (treasureBlocks.contains(blockType)) { + diggingClass.diggingTreasureDrop(world, loc, blockType); + } + + } else if (woodcuttingEXP.containsKey(blockType) && natural) { + increaseStats.changeEXP("woodcutting", woodcuttingEXP.get(blockType)); + Woodcutting woodcuttingClass = new Woodcutting(p); + woodcuttingClass.woodcuttingDoubleDrop(block, world); + woodcuttingClass.logXPdrop(block, world); + woodcuttingClass.logBookDrop(block, world); + woodcuttingClass.leafBlower(block); + woodcuttingClass.leavesDrops(block, world, 1, 1); + woodcuttingClass.timedHaste(block); + + } else if (miningEXP.containsKey(blockType) && natural) { + increaseStats.changeEXP("mining", miningEXP.get(blockType)); + Mining miningClass = new Mining(p); + miningClass.wastelessHaste(blockType); + miningClass.miningDoubleDrop(block, world); + miningClass.veinMiner(block, blockType); + if (pAbilities[2] == -2) { + //Treasure Drops: + int passive2_mining = (int) pStat.get("mining").get(9); + double treasureDropChance = passive2_mining * 0.01; + miningClass.miningTreasureDrop(treasureDropChance, world, loc); + } + + if (blockType == Material.SPAWNER) { + increaseStats.changeEXP("defense", miningEXP.get(blockType)); + increaseStats.changeEXP("swordsmanship", miningEXP.get(blockType)); + increaseStats.changeEXP("archery", miningEXP.get(blockType)); + increaseStats.changeEXP("axeMastery", miningEXP.get(blockType)); + } + } else if (configLoad.getVeinMinerBlocks().contains(blockType)) { + Mining miningClass = new Mining(p); + miningClass.veinMiner(block, blockType); + } else if (farmingEXP.containsKey(blockType) && natural) { + BlockData block_data = block.getBlockData(); + Farming farmingClass = new Farming(p); + if (tallCrops.contains(blockType)) { + farmingClass.tallCrops(block, world); + } else if (block_data instanceof Ageable) { + Ageable age = (Ageable) block_data; + if (age.getAge() == age.getMaximumAge()) { + increaseStats.changeEXP("farming", farmingEXP.get(blockType)); + if (blockType == Material.NETHER_WART) { + Map expMap = configLoad.getExpMapForSkill("alchemy"); + increaseStats.changeEXP("alchemy", expMap.get("breakNetherWart")); + } + farmingClass.farmingDoubleDropCrop(block, world); + } + } else if (block_data instanceof Cocoa) { + Cocoa coco = (Cocoa) block_data; + if (coco.getAge() == coco.getMaximumAge()) { + increaseStats.changeEXP("farming", farmingEXP.get(blockType)); + farmingClass.farmingDoubleDropCrop(block, world); + } + } else { + increaseStats.changeEXP("farming", farmingEXP.get(blockType)); + farmingClass.farmingDoubleDropCrop(block, world); + } + } + + //Abilities + + //Digging + if (shovels.contains(itemInHand.getType()) && diggingEXP.containsKey(blockType)) { + Digging diggingClass = new Digging(p); + if (pAbilities[0] > -1) { + diggingClass.enableAbility(); + } else if (pAbilities[0] == -2) { + diggingClass.megaDig(block, diggingEXP); + } + } + + //Woodcutting + else if (axes.contains(itemInHand.getType()) && logs.contains(blockType)) { + Woodcutting woodcuttingClass = new Woodcutting(p); + if (pAbilities[1] > -1 && natural) { + woodcuttingClass.enableAbility(); + woodcuttingClass.timber(block); + } else if (pAbilities[1] == -2 && natural) { + woodcuttingClass.timber(block); + } + } + //Mining + else if (pickaxes.contains(itemInHand.getType()) && pAbilities[2] > -1 && miningEXP.containsKey( + blockType)) { + Mining miningClass = new Mining(p); + miningClass.enableAbility(); + } + + //Farming + else if ((hoes.contains(itemInHand.getType()) || axes.contains(itemInHand.getType())) + && farmingEXP.containsKey(blockType)) { + Farming farmingClass = new Farming(p); + if (pAbilities[3] > -1 && natural && axes.contains(itemInHand.getType()) && ( + blockType == Material.MELON || blockType == Material.PUMPKIN)) { + farmingClass.enableAbility(); + farmingClass.naturalRegeneration(block, world); + } else if (pAbilities[3] == -2 && natural && axes.contains(itemInHand.getType()) && ( + blockType == Material.MELON || blockType == Material.PUMPKIN)) { + farmingClass.naturalRegeneration(block, world); + } else if (pAbilities[3] > -1 && natural && (hoes.contains(itemInHand.getType()))) { + farmingClass.enableAbility(); + + } else if (pAbilities[3] == -2 && natural && (hoes.contains(itemInHand.getType()))) { + farmingClass.naturalRegeneration(block, world); + } + } + + //If the block wasn't natural, now remove it from the list + if (!natural) { + placedBlocksManager.removeBlock(block); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerBlockBreakDeveloper.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerBlockBreakDeveloper.java new file mode 100644 index 0000000..e0afb1e --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerBlockBreakDeveloper.java @@ -0,0 +1,312 @@ +package mc.carlton.freerpg.events.misc; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.core.info.server.PlacedBlocksManager; +import mc.carlton.freerpg.core.info.server.RunTimeData; +import mc.carlton.freerpg.skills.perksAndAbilities.Digging; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import mc.carlton.freerpg.skills.perksAndAbilities.Mining; +import mc.carlton.freerpg.skills.perksAndAbilities.Smelting; +import mc.carlton.freerpg.skills.perksAndAbilities.Woodcutting; +import mc.carlton.freerpg.utils.globalVariables.ExpMaps; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.data.Ageable; +import org.bukkit.block.data.BlockData; +import org.bukkit.block.data.type.Cocoa; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.inventory.ItemStack; + +public class PlayerBlockBreakDeveloper implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onblockBreak(BlockBreakEvent e) { + RunTimeData runTimeData = new RunTimeData(); + + //WorldGuard Check + if (e.isCancelled()) { + return; + } + + Player p = e.getPlayer(); + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + + Block block = e.getBlock(); + Location loc = block.getLocation(); + Material blockType = block.getType(); + World world = e.getBlock().getWorld(); + ItemStack itemInHand = p.getInventory().getItemInMainHand(); + + ItemGroups itemGroups = new ItemGroups(); + + // Tools and Other + List pickaxes = itemGroups.getPickaxes(); + List axes = itemGroups.getAxes(); + List shovels = itemGroups.getShovels(); + List hoes = itemGroups.getHoes(); + + //Blocks + List tallCrops = itemGroups.getTallCrops(); + List logs = itemGroups.getLogs(); + + //Gets Block-EXP maps + ExpMaps expMaps = new ExpMaps(); + Map diggingEXP = expMaps.getDiggingEXP(); + Map woodcuttingEXP = expMaps.getWoodcuttingEXP(); + Map miningEXP = expMaps.getMiningEXP(); + Map farmingEXP = expMaps.getFarmingEXP(); + Map flamePickEXP = expMaps.getFlamePickEXP(); + + //Config + ConfigLoad configLoad = new ConfigLoad(); + + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + + ChangeStats increaseStats = new ChangeStats(p); + + AbilityTracker abilities = new AbilityTracker(p); + Integer[] pAbilities = abilities.getPlayerAbilities(); + + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + + long timer = System.currentTimeMillis(); + //Tracked Blocks + PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); + boolean natural = !placedBlocksManager.isBlockTracked(block); + + long getTrackedBlocks = System.currentTimeMillis() - timer; + runTimeData.addTime(getTrackedBlocks, "BreakBlocktrackedBlocks"); + timer = System.currentTimeMillis(); + + //EXP drops + if (flamePickEXP.containsKey(blockType) && pickaxes.contains(itemInHand.getType()) + && (int) pStat.get("global").get(13) > 0 && (int) pStat.get("smelting").get(13) > 0) { + Object[] flamePickData = flamePickEXP.get(blockType); + if (natural) { + increaseStats.changeEXP((String) flamePickData[0], (int) flamePickData[1]); + } + int veinMinerLevel = (int) pStat.get("mining").get(11); + int veinMinerToggle = (int) pStat.get("global").get(18); + if (itemGroups.getFlamePickOres().contains(blockType)) { + Mining miningClass = new Mining(p); + miningClass.wastelessHaste(blockType); + if (veinMinerLevel > 0 && veinMinerToggle > 0) { + miningClass.veinMiner(block, blockType); + } else { + Smelting smeltingClass = new Smelting(p); + smeltingClass.flamePick(block, world, blockType, true); + } + } else { + Smelting smeltingClass = new Smelting(p); + smeltingClass.flamePick(block, world, blockType, false); + } + } else if (diggingEXP.containsKey(blockType) && natural) { + if (!configLoad.getAllowedSkillsMap().get("digging")) { + return; + } + long timer1 = System.currentTimeMillis(); + increaseStats.changeEXP("digging", diggingEXP.get(blockType)); + long changeDiggingEXP = System.currentTimeMillis() - timer1; + runTimeData.addTime(changeDiggingEXP, "changeEXP"); + + Material[] treasureBlocks0 = {Material.CLAY, Material.GRASS_BLOCK, Material.GRAVEL, + Material.MYCELIUM, Material.PODZOL, Material.COARSE_DIRT, + Material.DIRT, Material.RED_SAND, Material.SAND, Material.SOUL_SAND, Material.SNOW_BLOCK}; + List treasureBlocks = Arrays.asList(treasureBlocks0); + timer1 = System.currentTimeMillis(); + Digging diggingClass = new Digging(p); + boolean dropFlint = diggingClass.flintFinder(blockType); + if (dropFlint) { + e.setDropItems(false); + world.dropItemNaturally(loc, new ItemStack(Material.FLINT, 1)); + } + long flintFinder = System.currentTimeMillis() - timer1; + runTimeData.addTime(flintFinder, "flintFinder"); + + if (treasureBlocks.contains(blockType)) { + long timer2 = System.currentTimeMillis(); + diggingClass.diggingTreasureDrop(world, loc, blockType); + long treasureDropTime = System.currentTimeMillis() - timer2; + runTimeData.addTime(treasureDropTime, "diggingTreasureDrop"); + } + + } else if (woodcuttingEXP.containsKey(blockType) && natural) { + long timer1 = System.currentTimeMillis(); + increaseStats.changeEXP("woodcutting", woodcuttingEXP.get(blockType)); + long woodcuttingEXPTime = System.currentTimeMillis() - timer1; + runTimeData.addTime(woodcuttingEXPTime, "changeEXP"); + + timer1 = System.currentTimeMillis(); + Woodcutting woodcuttingClass = new Woodcutting(p); + woodcuttingClass.woodcuttingDoubleDrop(block, world); + long woodcuttingDoubleDropTime = System.currentTimeMillis() - timer1; + runTimeData.addTime(woodcuttingDoubleDropTime, "doubleDrop"); + + timer1 = System.currentTimeMillis(); + woodcuttingClass.logXPdrop(block, world); + long logXPDropTime = System.currentTimeMillis() - timer1; + runTimeData.addTime(logXPDropTime, "logXP"); + + timer1 = System.currentTimeMillis(); + ; + woodcuttingClass.logBookDrop(block, world); + long logBookDropTime = System.currentTimeMillis() - timer1; + runTimeData.addTime(logBookDropTime, "logBook"); + + woodcuttingClass.leafBlower(block); + + timer1 = System.currentTimeMillis(); + woodcuttingClass.leavesDrops(block, world, 1, 1); + long leavesDropTime = System.currentTimeMillis() - timer1; + runTimeData.addTime(leavesDropTime, "leaves"); + + timer1 = System.currentTimeMillis(); + woodcuttingClass.timedHaste(block); + long timedHasteTime = System.currentTimeMillis() - timer1; + runTimeData.addTime(timedHasteTime, "woodcuttingHaste"); + + } else if (miningEXP.containsKey(blockType) && natural) { + long timer1 = System.currentTimeMillis(); + increaseStats.changeEXP("mining", miningEXP.get(blockType)); + long miningEXPTime = System.currentTimeMillis() - timer1; + runTimeData.addTime(miningEXPTime, "changeEXP"); + + List ores = itemGroups.getOres(); + Mining miningClass = new Mining(p); + if (pAbilities[2] == -2) { + long timer2 = System.currentTimeMillis(); + //Treasure Drops: + int passive2_mining = (int) pStat.get("mining").get(9); + double treasureDropChance = passive2_mining * 0.01; + miningClass.miningTreasureDrop(treasureDropChance, world, loc); + long miningTreasureDropTime = System.currentTimeMillis() - timer2; + runTimeData.addTime(miningTreasureDropTime, "miningTreasureDrop"); + } + long timer2 = System.currentTimeMillis(); + miningClass.wastelessHaste(blockType); + long miningWastelessHasteTime = System.currentTimeMillis() - timer2; + runTimeData.addTime(miningWastelessHasteTime, "wastelessHaste"); + + timer2 = System.currentTimeMillis(); + miningClass.miningDoubleDrop(block, world); + long miningDoubleDropTime = System.currentTimeMillis() - timer2; + runTimeData.addTime(miningDoubleDropTime, "doubleDrop"); + + timer2 = System.currentTimeMillis(); + miningClass.veinMiner(block, blockType); + long veinMinerTimes = System.currentTimeMillis() - timer2; + runTimeData.addTime(veinMinerTimes, "veinMiner"); + + if (blockType == Material.SPAWNER) { + increaseStats.changeEXP("defense", miningEXP.get(blockType)); + increaseStats.changeEXP("swordsmanship", miningEXP.get(blockType)); + increaseStats.changeEXP("archery", miningEXP.get(blockType)); + increaseStats.changeEXP("axeMastery", miningEXP.get(blockType)); + } + } else if (configLoad.getVeinMinerBlocks().contains(blockType)) { + Mining miningClass = new Mining(p); + miningClass.veinMiner(block, blockType); + } else if (farmingEXP.containsKey(blockType) && natural) { + BlockData block_data = block.getBlockData(); + Farming farmingClass = new Farming(p); + if (tallCrops.contains(blockType)) { + farmingClass.tallCrops(block, world); + } else if (block_data instanceof Ageable) { + Ageable age = (Ageable) block_data; + if (age.getAge() == age.getMaximumAge()) { + increaseStats.changeEXP("farming", farmingEXP.get(blockType)); + if (blockType == Material.NETHER_WART) { + Map expMap = configLoad.getExpMapForSkill("alchemy"); + increaseStats.changeEXP("alchemy", expMap.get("breakNetherWart")); + } + farmingClass.farmingDoubleDropCrop(block, world); + } + } else if (block_data instanceof Cocoa) { + Cocoa coco = (Cocoa) block_data; + if (coco.getAge() == coco.getMaximumAge()) { + increaseStats.changeEXP("farming", farmingEXP.get(blockType)); + farmingClass.farmingDoubleDropCrop(block, world); + } + } else { + increaseStats.changeEXP("farming", farmingEXP.get(blockType)); + farmingClass.farmingDoubleDropCrop(block, world); + } + } + + //Abilities + + //Digging + if (shovels.contains(itemInHand.getType()) && diggingEXP.containsKey(blockType)) { + Digging diggingClass = new Digging(p); + if (pAbilities[0] > -1) { + diggingClass.enableAbility(); + } else if (pAbilities[0] == -2) { + diggingClass.megaDig(block, diggingEXP); + } + } + + //Woodcutting + else if (axes.contains(itemInHand.getType()) && logs.contains(blockType)) { + Woodcutting woodcuttingClass = new Woodcutting(p); + if (pAbilities[1] > -1 && natural) { + woodcuttingClass.enableAbility(); + woodcuttingClass.timber(block); + } else if (pAbilities[1] == -2 && natural) { + woodcuttingClass.timber(block); + } + } + //Mining + else if (pickaxes.contains(itemInHand.getType()) && pAbilities[2] > -1 && miningEXP.containsKey( + blockType)) { + Mining miningClass = new Mining(p); + miningClass.enableAbility(); + } + + //Farming + else if ((hoes.contains(itemInHand.getType()) || axes.contains(itemInHand.getType())) + && farmingEXP.containsKey(blockType)) { + Farming farmingClass = new Farming(p); + if (pAbilities[3] > -1 && natural && axes.contains(itemInHand.getType()) && ( + blockType == Material.MELON || blockType == Material.PUMPKIN)) { + farmingClass.enableAbility(); + farmingClass.naturalRegeneration(block, world); + } else if (pAbilities[3] == -2 && natural && axes.contains(itemInHand.getType()) && ( + blockType == Material.MELON || blockType == Material.PUMPKIN)) { + farmingClass.naturalRegeneration(block, world); + } else if (pAbilities[3] > -1 && natural && (hoes.contains(itemInHand.getType()))) { + farmingClass.enableAbility(); + + } else if (pAbilities[3] == -2 && natural && (hoes.contains(itemInHand.getType()))) { + farmingClass.naturalRegeneration(block, world); + } + + } + long allConditionals = System.currentTimeMillis() - timer; + runTimeData.addTime(allConditionals, "BreakBlockconditionals"); + + //If the block wasn't natural, now remove it from the list + if (!natural) { + placedBlocksManager.removeBlock(block); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerBlockPlace.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerBlockPlace.java new file mode 100644 index 0000000..32205f0 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerBlockPlace.java @@ -0,0 +1,44 @@ +package mc.carlton.freerpg.events.misc; + + +import java.util.Map; +import mc.carlton.freerpg.core.info.server.PlacedBlocksManager; +import mc.carlton.freerpg.core.info.server.WorldGuardChecks; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.block.BlockPlaceEvent; + + +public class PlayerBlockPlace implements Listener { + + @EventHandler(priority = EventPriority.HIGHEST) + void onblockPlace(BlockPlaceEvent e) { + Player p = e.getPlayer(); + Block block = e.getBlockPlaced(); + Location loc = block.getLocation(); + + if (e.isCancelled()) { + return; + } + + //WorldGuard Check + WorldGuardChecks BuildingCheck = new WorldGuardChecks(); + if (!BuildingCheck.canBuild(p, loc)) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + Map trackedBlocks = itemGroups.getTrackedBlocks(); + Material blockType = block.getType(); + boolean isTracked = trackedBlocks.containsKey(blockType); + if (isTracked) { + PlacedBlocksManager blockTracker = new PlacedBlocksManager(); + blockTracker.addLocation(loc); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerBreedEntity.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerBreedEntity.java new file mode 100644 index 0000000..801e07b --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerBreedEntity.java @@ -0,0 +1,29 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.skills.perksAndAbilities.BeastMastery; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityBreedEvent; + +public class PlayerBreedEntity implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onPlayerBreed(EntityBreedEvent e) { + if (e.isCancelled()) { + return; + } + if (e.getBreeder() instanceof Player) { + Player p = (Player) e.getBreeder(); + Entity entity = e.getEntity(); + Farming farmingClass = new Farming(p); + farmingClass.breedingEXP(entity); + BeastMastery beastMasteryClass = new BeastMastery(p); + beastMasteryClass.breedingEXP(entity); + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerConsumeItem.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerConsumeItem.java new file mode 100644 index 0000000..0b5a974 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerConsumeItem.java @@ -0,0 +1,36 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.skills.perksAndAbilities.Alchemy; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import mc.carlton.freerpg.skills.perksAndAbilities.Fishing; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerItemConsumeEvent; +import org.bukkit.inventory.ItemStack; + +public class PlayerConsumeItem implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onConsumeItem(PlayerItemConsumeEvent e) { + if (e.isCancelled()) { + return; + } + Player p = e.getPlayer(); + ItemStack consumedItem = e.getItem(); + + // Farming + Farming farmingClass = new Farming(p); + farmingClass.eatFarmFood(consumedItem); + + // Fishing + Fishing fishingClass = new Fishing(p); + fishingClass.eatFishFood(consumedItem); + + // Alchemy + Alchemy alchemyClass = new Alchemy(p); + alchemyClass.drinkPotion(consumedItem); + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerCraft.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerCraft.java new file mode 100644 index 0000000..26e2669 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerCraft.java @@ -0,0 +1,373 @@ +package mc.carlton.freerpg.events.misc; + +import java.util.ArrayList; +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.customContainers.collections.OldCustomRecipe; +import mc.carlton.freerpg.events.newEvents.FrpgPlayerCraftItemEvent; +import mc.carlton.freerpg.skills.perksAndAbilities.Defense; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import mc.carlton.freerpg.utils.globalVariables.CraftingRecipes; +import org.bukkit.ChatColor; +import org.bukkit.Effect; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.CraftItemEvent; +import org.bukkit.inventory.ItemStack; + +public class PlayerCraft implements Listener { + + private boolean craftingMatch(ArrayList customRecipe, ArrayList crafting) { + if (customRecipe.size() != 9 || crafting.size() != 9) { + return false; + } + CraftingRecipes craftingRecipes = new CraftingRecipes(); + ArrayList> allCustomRecipes = craftingRecipes.getTranslatedVariants( + customRecipe); + for (ArrayList customRecipeVariant : allCustomRecipes) { + if (customRecipeVariant.equals(crafting)) { + return true; + } + } + return false; + } + + private int getAmountToBeCrafted(ItemStack[] craftingMatrix) { + int limitingMaterialAmount = Integer.MAX_VALUE; + for (int i = 0; i < 9; i++) { + if (craftingMatrix[i] != null) { + if (!craftingMatrix[i].getType().equals(Material.AIR)) { + int amountOfMaterial = craftingMatrix[i].getAmount(); + if (amountOfMaterial < limitingMaterialAmount) { + limitingMaterialAmount = amountOfMaterial; + } + } + } + } + return (limitingMaterialAmount == Integer.MAX_VALUE) ? 0 : limitingMaterialAmount; + } + + private ArrayList getRecipeMaterial(ItemStack[] craftingMatrix) { + ArrayList crafting = new ArrayList<>(); + for (int i = 0; i < 9; i++) { + if (craftingMatrix[i] == null) { + crafting.add(Material.AIR); + } else { + crafting.add(craftingMatrix[i].getType()); + } + } + return crafting; + } + + @EventHandler(priority = EventPriority.HIGH) + void onFrpgPlayerCraft(FrpgPlayerCraftItemEvent e) { + Defense defenseClass = new Defense(e.getPlayer()); + defenseClass.armorEXP(e.getResult()); + } + + @EventHandler(priority = EventPriority.HIGH) + void onPlayerCraft(CraftItemEvent e) { + Player p = (Player) e.getWhoClicked(); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + LanguageSelector lang = new LanguageSelector(p); + ConfigLoad configLoad = new ConfigLoad(); + + CraftingRecipes craftingRecipes = new CraftingRecipes(); + ItemStack[] craftingMatrix = e.getInventory().getMatrix(); + if (craftingMatrix.length != 9) { + return; + } + ArrayList crafting = getRecipeMaterial(craftingMatrix); + int amountCrafted = getAmountToBeCrafted(craftingMatrix); + + Map craftingRecipeClasses = configLoad.getCraftingRecipes(); + ArrayList cowEgg = craftingRecipes.getCowEggRecipe(); + ArrayList beeEgg = craftingRecipes.getBeeEggRecipe(); + ArrayList mooshroomEgg = craftingRecipes.getMooshroomEggRecipe(); + ArrayList horseEgg = craftingRecipes.getHorseEggRecipe(); + ArrayList slimeEgg = craftingRecipes.getSlimeEggRecipe(); + ArrayList tippedArrow = craftingRecipes.getTippedArrowRecipe(); + ArrayList power = craftingRecipes.getPowerRecipe(); + ArrayList efficiency = craftingRecipes.getEfficiencyRecipe(); + ArrayList sharpness = craftingRecipes.getSharpnessRecipe(); + ArrayList protection = craftingRecipes.getProtectionRecipe(); + ArrayList luck = craftingRecipes.getLuckRecipe(); + ArrayList lure = craftingRecipes.getLureRecipe(); + ArrayList depth = craftingRecipes.getDepthRecipe(); + ArrayList frost = craftingRecipes.getFrostRecipe(); + ArrayList mending = craftingRecipes.getMendingRecipe(); + ArrayList fortune = craftingRecipes.getFortuneRecipe(); + ArrayList waterBreathing = craftingRecipes.getWaterBreathingRecipe(); + ArrayList speed = craftingRecipes.getSpeedRecipe(); + ArrayList fireResistance = craftingRecipes.getFireResistanceRecipe(); + ArrayList healing = craftingRecipes.getHealingRecipe(); + ArrayList strength = craftingRecipes.getStrengthRecipe(); + + if (craftingMatch(cowEgg, crafting)) { + if ((int) pStat.get("farming").get(8) < 1 || !configLoad.getAllowedSkillsMap() + .get("farming")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("farmingPerkTitle1") + + " (1/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } + } else if (craftingMatch(beeEgg, crafting)) { + if ((int) pStat.get("farming").get(8) < 2 || !configLoad.getAllowedSkillsMap() + .get("farming")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("farmingPerkTitle1") + + " (2/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } + } else if (craftingMatch(mooshroomEgg, crafting)) { + if ((int) pStat.get("farming").get(8) < 3 || !configLoad.getAllowedSkillsMap() + .get("farming")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("farmingPerkTitle1") + + " (3/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } + } else if (craftingMatch(horseEgg, crafting)) { + if ((int) pStat.get("farming").get(8) < 4 || !configLoad.getAllowedSkillsMap() + .get("farming")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("farmingPerkTitle1") + + " (4/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } + } else if (craftingMatch(slimeEgg, crafting)) { + if ((int) pStat.get("farming").get(8) < 5 || !configLoad.getAllowedSkillsMap() + .get("farming")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("farmingPerkTitle1") + + " (5/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } + } else if (craftingMatch(tippedArrow, crafting)) { + if ((int) pStat.get("archery").get(11) < 1 || !configLoad.getAllowedSkillsMap() + .get("archery")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("archeryPerkTitle4") + + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } + } else if (craftingMatch(power, crafting) || craftingMatch(efficiency, crafting)) { + int xpLevelCost = 0; + if (craftingMatch(power, crafting)) { + xpLevelCost = craftingRecipeClasses.get("enchanting1").getXPcraftCost(); + } else { + xpLevelCost = craftingRecipeClasses.get("enchanting2").getXPcraftCost(); + } + xpLevelCost *= (e.isShiftClick()) ? amountCrafted : 1; + + String xpLevel_Id = "xpLevel"; + if (xpLevelCost != 1) { + xpLevel_Id += "s"; + } + if ((int) pStat.get("enchanting").get(9) < 1 || !configLoad.getAllowedSkillsMap() + .get("enchanting")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("enchantingPerkTitle1") + + " (1/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } else if (p.getLevel() < xpLevelCost) { + e.setCancelled(true); + p.sendMessage(ChatColor.RED + lang.getString("craftXPRequirement") + " " + xpLevelCost + " " + + lang.getString(xpLevel_Id)); + } else { + p.setLevel(p.getLevel() - xpLevelCost); + p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE, 1); + } + } else if (craftingMatch(sharpness, crafting) || craftingMatch(protection, crafting)) { + int xpLevelCost = 0; + if (craftingMatch(sharpness, crafting)) { + xpLevelCost = craftingRecipeClasses.get("enchanting3").getXPcraftCost(); + } else { + xpLevelCost = craftingRecipeClasses.get("enchanting4").getXPcraftCost(); + } + xpLevelCost *= (e.isShiftClick()) ? amountCrafted : 1; + + String xpLevel_Id = "xpLevel"; + if (xpLevelCost != 1) { + xpLevel_Id += "s"; + } + if ((int) pStat.get("enchanting").get(9) < 2 || !configLoad.getAllowedSkillsMap() + .get("enchanting")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("enchantingPerkTitle1") + + " (2/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } else if (p.getLevel() < xpLevelCost) { + e.setCancelled(true); + p.sendMessage(ChatColor.RED + lang.getString("craftXPRequirement") + " " + xpLevelCost + " " + + lang.getString(xpLevel_Id)); + } else { + p.setLevel(p.getLevel() - xpLevelCost); + p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE, 1); + } + } else if (craftingMatch(luck, crafting) || craftingMatch(lure, crafting)) { + int xpLevelCost = 0; + if (craftingMatch(luck, crafting)) { + xpLevelCost = craftingRecipeClasses.get("enchanting5").getXPcraftCost(); + } else { + xpLevelCost = craftingRecipeClasses.get("enchanting6").getXPcraftCost(); + } + xpLevelCost *= (e.isShiftClick()) ? amountCrafted : 1; + + String xpLevel_Id = "xpLevel"; + if (xpLevelCost != 1) { + xpLevel_Id += "s"; + } + if ((int) pStat.get("enchanting").get(9) < 3 || !configLoad.getAllowedSkillsMap() + .get("enchanting")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("enchantingPerkTitle1") + + " (3/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } else if (p.getLevel() < xpLevelCost) { + e.setCancelled(true); + p.sendMessage(ChatColor.RED + lang.getString("craftXPRequirement") + " " + xpLevelCost + " " + + lang.getString(xpLevel_Id)); + } else { + p.setLevel(p.getLevel() - xpLevelCost); + p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE, 1); + } + } else if (craftingMatch(depth, crafting) || craftingMatch(frost, crafting)) { + int xpLevelCost = 0; + if (craftingMatch(frost, crafting)) { + xpLevelCost = craftingRecipeClasses.get("enchanting7").getXPcraftCost(); + } else { + xpLevelCost = craftingRecipeClasses.get("enchanting8").getXPcraftCost(); + } + xpLevelCost *= (e.isShiftClick()) ? amountCrafted : 1; + + String xpLevel_Id = "xpLevel"; + if (xpLevelCost != 1) { + xpLevel_Id += "s"; + } + if ((int) pStat.get("enchanting").get(9) < 4 || !configLoad.getAllowedSkillsMap() + .get("enchanting")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("enchantingPerkTitle1") + + " (4/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } else if (p.getLevel() < xpLevelCost) { + e.setCancelled(true); + p.sendMessage(ChatColor.RED + lang.getString("craftXPRequirement") + " " + xpLevelCost + " " + + lang.getString(xpLevel_Id)); + } else { + p.setLevel(p.getLevel() - xpLevelCost); + p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE, 1); + } + } else if (craftingMatch(mending, crafting) || craftingMatch(fortune, crafting)) { + int xpLevelCost = 0; + if (craftingMatch(mending, crafting)) { + xpLevelCost = craftingRecipeClasses.get("enchanting9").getXPcraftCost(); + } else { + xpLevelCost = craftingRecipeClasses.get("enchanting10").getXPcraftCost(); + } + xpLevelCost *= (e.isShiftClick()) ? amountCrafted : 1; + + String xpLevel_Id = "xpLevel"; + if (xpLevelCost != 1) { + xpLevel_Id += "s"; + } + if ((int) pStat.get("enchanting").get(9) < 5 || !configLoad.getAllowedSkillsMap() + .get("enchanting")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("enchantingPerkTitle1") + + " (5/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } else if (p.getLevel() < xpLevelCost) { + e.setCancelled(true); + p.sendMessage(ChatColor.RED + lang.getString("craftXPRequirement") + " " + xpLevelCost + " " + + lang.getString(xpLevel_Id)); + } else { + p.setLevel(p.getLevel() - xpLevelCost); + p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE, 1); + } + } else if (craftingMatch(waterBreathing, crafting)) { + if ((int) pStat.get("alchemy").get(7) < 1 || !configLoad.getAllowedSkillsMap() + .get("alchemy")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("alchemyPerkTitle0") + + " (1/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } + } else if (craftingMatch(speed, crafting)) { + if ((int) pStat.get("alchemy").get(7) < 2 || !configLoad.getAllowedSkillsMap() + .get("alchemy")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("alchemyPerkTitle0") + + " (2/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } + } else if (craftingMatch(fireResistance, crafting)) { + if ((int) pStat.get("alchemy").get(7) < 3 || !configLoad.getAllowedSkillsMap() + .get("alchemy")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("alchemyPerkTitle0") + + " (3/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } + } else if (craftingMatch(healing, crafting)) { + if ((int) pStat.get("alchemy").get(7) < 4 || !configLoad.getAllowedSkillsMap() + .get("alchemy")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("alchemyPerkTitle0") + + " (4/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } + } else if (craftingMatch(strength, crafting)) { + if ((int) pStat.get("alchemy").get(7) < 5 || !configLoad.getAllowedSkillsMap() + .get("alchemy")) { + e.setCancelled(true); + p.sendMessage( + ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("alchemyPerkTitle0") + + " (5/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString( + "craftRequirement")); + } + } + + + + + + /* EXAMPLE FOR CRAFTING PERMS + ItemStack[] TNT2 = {null, new ItemStack(Material.SAND,1), null, + new ItemStack(Material.SAND,1), new ItemStack(Material.GUNPOWDER,1), new ItemStack(Material.SAND,1), + null, new ItemStack(Material.SAND,1), null }; + + //TNT crafting + if (craftingMatch(TNT2,crafting)) { + + if ((int)pStat.get("mining").get(12) < 1) { + e.setCancelled(true); + p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + "More Bombs" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement)); + } + } + */ + + } + +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerDismount.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerDismount.java new file mode 100644 index 0000000..6198978 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerDismount.java @@ -0,0 +1,26 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.utils.game.HorseRiding; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.spigotmc.event.entity.EntityDismountEvent; + +public class PlayerDismount implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onPlayerTakeDamage(EntityDismountEvent e) { + if (e.isCancelled()) { + return; + } + Entity mount = e.getDismounted(); + HorseRiding horseRiding = new HorseRiding(); + Player p = horseRiding.getPlayerFromMount(mount.getUniqueId()); + if (p != null) { + horseRiding.deletePlayerData(p); + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerDropItem.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerDropItem.java new file mode 100644 index 0000000..ccd9c01 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerDropItem.java @@ -0,0 +1,63 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.core.info.player.AbilityLogoutTracker; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.skills.perksAndAbilities.Digging; +import mc.carlton.freerpg.skills.perksAndAbilities.Mining; +import mc.carlton.freerpg.skills.perksAndAbilities.Swordsmanship; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerDropItemEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.persistence.PersistentDataType; + +public class PlayerDropItem implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onItemDrop(PlayerDropItemEvent e) { + if (e.isCancelled()) { + return; + } + Player p = (Player) e.getPlayer(); + AbilityTracker abilities = new AbilityTracker(p); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[0] != -1) { + AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); + NamespacedKey key = logoutTracker.getPlayerKeys().get("digging"); + int taskID_digging = logoutTracker.getPlayerTasks().get("digging"); + if (e.getItemDrop().getItemStack().getItemMeta().getPersistentDataContainer() + .has(key, PersistentDataType.STRING)) { + ItemStack abilityItem = e.getItemDrop().getItemStack(); + Digging diggingClass = new Digging(p); + diggingClass.preventLogoutTheft(taskID_digging, abilityItem, key, false); + } + } + if (pAbilities[2] != -1) { + AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); + NamespacedKey key = logoutTracker.getPlayerKeys().get("mining"); + int taskID_mining = logoutTracker.getPlayerTasks().get("mining"); + if (e.getItemDrop().getItemStack().getItemMeta().getPersistentDataContainer() + .has(key, PersistentDataType.STRING)) { + ItemStack abilityItem = e.getItemDrop().getItemStack(); + Mining miningClass = new Mining(p); + miningClass.preventLogoutTheft(taskID_mining, abilityItem, key, false); + } + } + + if (pAbilities[7] != -1) { + AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); + NamespacedKey key = logoutTracker.getPlayerKeys().get("swordsmanship"); + int taskID_swordsmanship = logoutTracker.getPlayerTasks().get("swordsmanship"); + if (e.getItemDrop().getItemStack().getItemMeta().getPersistentDataContainer() + .has(key, PersistentDataType.STRING)) { + ItemStack abilityItem = e.getItemDrop().getItemStack(); + Swordsmanship swordsmanshipClass = new Swordsmanship(p); + swordsmanshipClass.preventLogoutTheft(taskID_swordsmanship, abilityItem, key, false); + } + } + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerEnterVehicle.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerEnterVehicle.java new file mode 100644 index 0000000..b3162f4 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerEnterVehicle.java @@ -0,0 +1,25 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.skills.perksAndAbilities.Agility; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.vehicle.VehicleEnterEvent; + +public class PlayerEnterVehicle implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onEnterVehicle(VehicleEnterEvent e) { + if (e.isCancelled()) { + return; + } + if (e.getEntered() instanceof Player) { + Player p = (Player) e.getEntered(); + Agility agilityClass = new Agility(p); + agilityClass.sprintingEXP(false); + } + + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerFish.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerFish.java new file mode 100644 index 0000000..32bec71 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerFish.java @@ -0,0 +1,77 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.skills.perksAndAbilities.Fishing; +import org.bukkit.GameMode; +import org.bukkit.World; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerFishEvent; + +public class PlayerFish implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onPlayerFish(PlayerFishEvent e) { + Player p = e.getPlayer(); + if (e.isCancelled()) { + return; + } + if (!p.hasPermission("freeRPG.fish")) { + return; + } + if (p.getGameMode() == GameMode.CREATIVE) { + return; + } + + World world = p.getWorld(); + Entity caughtThing = e.getCaught(); + AbilityTracker abilities = new AbilityTracker(p); + Integer[] pAbilities = abilities.getPlayerAbilities(); + + if (e.getState() == PlayerFishEvent.State.FISHING) { + if (pAbilities[4] > -1) { + Fishing fishingClass = new Fishing(p); + fishingClass.enableAbility(); + } + } else if (e.getState() == PlayerFishEvent.State.REEL_IN) { + Fishing fishingClass = new Fishing(p); + if (pAbilities[4] == -2) { + fishingClass.superBait(e.getHook(), caughtThing, world); + } + + } else if (e.getState() == PlayerFishEvent.State.IN_GROUND) { + Fishing fishingClass = new Fishing(p); + fishingClass.grapplingHook(e.getHook(), world); + } else if (e.getState() == PlayerFishEvent.State.CAUGHT_FISH) { + Fishing fishingClass = new Fishing(p); + if (pAbilities[4] == -2) { + fishingClass.superBait(e.getHook(), caughtThing, world); + } + } else if (e.getState() == PlayerFishEvent.State.CAUGHT_ENTITY) { + Fishing fishingClass = new Fishing(p); + fishingClass.rob(e.getHook(), e.getCaught(), world); + } + + // TODO remove dead code! + /* + System.out.println(e.getState());; + System.out.println(e.getHook().getLocation().getBlock().getType()); + if (caughtThing == null && e.getState() == PlayerFishEvent.State.REEL_IN) { + double dx = p.getLocation().getX() - e.getHook().getLocation().getX(); + double dy = p.getLocation().getY() - e.getHook().getLocation().getY(); + double dz = p.getLocation().getZ() - e.getHook().getLocation().getZ(); + double distance = Math.sqrt(dx*dx + dy*dy + dz+dz); + double multiplier = 0.08; + Item droppedItem = world.dropItemNaturally(e.getHook().getLocation(),new ItemStack(Material.GOLD_INGOT,1)); + Vector velocity = new Vector(dx*multiplier,dy*multiplier + (double) Math.sqrt(distance)*0.1 ,dz*multiplier); + droppedItem.setVelocity(velocity); + + + } + + */ + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerMount.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerMount.java new file mode 100644 index 0000000..52adf36 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerMount.java @@ -0,0 +1,38 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.skills.perksAndAbilities.BeastMastery; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; +import org.spigotmc.event.entity.EntityMountEvent; + +public class PlayerMount implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onPlayerMount(EntityMountEvent e) { + if (e.isCancelled()) { + return; + } + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + new BukkitRunnable() { + @Override + public void run() { + Entity mount = e.getMount(); + for (Entity passenger : e.getMount().getPassengers()) { + if (passenger instanceof Player) { + Player p = (Player) passenger; + BeastMastery beastMasteryClass = new BeastMastery(p); + beastMasteryClass.horseRidingEXP(mount); + } + } + + } + }.runTaskLater(plugin, 1); + + } +} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerMoveAbilityItem.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerMoveAbilityItem.java similarity index 69% rename from src/main/java/mc/carlton/freerpg/miscEvents/PlayerMoveAbilityItem.java rename to src/main/java/mc/carlton/freerpg/events/misc/PlayerMoveAbilityItem.java index 44a39ce..1c4bc89 100644 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerMoveAbilityItem.java +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerMoveAbilityItem.java @@ -1,41 +1,16 @@ -package mc.carlton.freerpg.miscEvents; +package mc.carlton.freerpg.events.misc; -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.ActionBarMessages; -import mc.carlton.freerpg.gameTools.TrackItem; -import mc.carlton.freerpg.newEvents.FrpgAbilityItemMovedEvent; -import mc.carlton.freerpg.perksAndAbilities.Digging; -import mc.carlton.freerpg.perksAndAbilities.Mining; -import mc.carlton.freerpg.perksAndAbilities.Swordsmanship; -import mc.carlton.freerpg.playerInfo.AbilityLogoutTracker; -import mc.carlton.freerpg.playerInfo.AbilityTimers; -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.Player; +import mc.carlton.freerpg.events.newEvents.FrpgAbilityItemMovedEvent; import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryDragEvent; -import org.bukkit.event.inventory.InventoryType; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.persistence.PersistentDataContainer; -import org.bukkit.persistence.PersistentDataType; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; public class PlayerMoveAbilityItem implements Listener { - @EventHandler - public void moveAbilityItem(FrpgAbilityItemMovedEvent e) { - e.setCancelled(true); //We simply want to cancel the ability item being moved in all cases - } + @EventHandler + public void moveAbilityItem(FrpgAbilityItemMovedEvent e) { + e.setCancelled(true); //We simply want to cancel the ability item being moved in all cases + } + // TODO remove dead code! /* @EventHandler(priority = EventPriority.HIGH) public void clickEvent(InventoryClickEvent e) { diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerPrepareCrafting.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerPrepareCrafting.java new file mode 100644 index 0000000..46f6909 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerPrepareCrafting.java @@ -0,0 +1,203 @@ +package mc.carlton.freerpg.events.misc; + +import java.util.ArrayList; +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.PrepareItemCraftEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.potion.PotionData; + +public class PlayerPrepareCrafting implements Listener { + + @EventHandler + public void craftEvent(PrepareItemCraftEvent event) { + ItemStack[] contents = event.getInventory().getContents(); + ItemStack firstInContents = contents[0]; + Player p = (Player) event.getView().getPlayer(); + PlayerStats pStatClass = new PlayerStats(p); + Map> pStat = pStatClass.getPlayerData(); + + if ((firstInContents.getType() == Material.TNT) && (firstInContents.getAmount() == 1)) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("mining")) { + return; + } + int moreBombsLevel = (int) pStat.get("mining").get(8); + if (moreBombsLevel > 0) { + firstInContents.setAmount(Math.min(6, moreBombsLevel + 1)); + } + } else if ((firstInContents.getType() == Material.ARROW) && (firstInContents.getAmount() + < 64)) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("archery")) { + return; + } + if ((int) pStat.get("archery").get(7) > 0) { + firstInContents.setAmount(4 + (int) pStat.get("archery").get(7)); + } + } else if (firstInContents.getType() == Material.TIPPED_ARROW + && contents[5].getType() == Material.POTION) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("archery")) { + return; + } + PotionMeta potionMeta = (PotionMeta) contents[5].getItemMeta(); + ItemGroups itemGroups = new ItemGroups(); + ItemStack arrow = new ItemStack(Material.ARROW, 1); + PotionData pData = potionMeta.getBasePotionData(); + switch (pData.getType()) { + case LUCK: + arrow = itemGroups.getArrow("luck"); + break; + case JUMP: + arrow = itemGroups.getArrow("leaping"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_leaping"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_leaping"); + } + break; + case REGEN: + arrow = itemGroups.getArrow("regeneration"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_regeneration"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_regeneration"); + } + break; + case SPEED: + arrow = itemGroups.getArrow("swiftness"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_swiftness"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_swiftness"); + } + break; + case POISON: + arrow = itemGroups.getArrow("poison"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_poison"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_poison"); + } + break; + case SLOWNESS: + arrow = itemGroups.getArrow("slowness"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_slowness"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_slowness"); + } + break; + case STRENGTH: + arrow = itemGroups.getArrow("strength"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_strength"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_strength"); + } + break; + case WEAKNESS: + arrow = itemGroups.getArrow("weakness"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_weakness"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_weakness"); + } + break; + case INSTANT_HEAL: + arrow = itemGroups.getArrow("healing"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_healing"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_healing"); + } + break; + case INVISIBILITY: + arrow = itemGroups.getArrow("invisibility"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_invisibility"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_invisibility"); + } + break; + case NIGHT_VISION: + arrow = itemGroups.getArrow("night_vision"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_night_vision"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_night_vision"); + } + break; + case SLOW_FALLING: + arrow = itemGroups.getArrow("slow_falling"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_slow_falling"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_slow_falling"); + } + break; + case TURTLE_MASTER: + arrow = itemGroups.getArrow("turtle_master"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_turtle_master"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_turtle_master"); + } + break; + case INSTANT_DAMAGE: + arrow = itemGroups.getArrow("harming"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_harming"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_harming"); + } + break; + case FIRE_RESISTANCE: + arrow = itemGroups.getArrow("fire_resistance"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_fire_resistance"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_fire_resistance"); + } + break; + case WATER_BREATHING: + arrow = itemGroups.getArrow("water_breathing"); + if (pData.isExtended()) { + arrow = itemGroups.getArrow("long_water_breathing"); + } + if (pData.isUpgraded()) { + arrow = itemGroups.getArrow("strong_water_breathing"); + } + break; + default: + arrow = new ItemStack(Material.AIR); + break; + } + event.getInventory().setResult(arrow); + } + + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerRespawn.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerRespawn.java new file mode 100644 index 0000000..2880403 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerRespawn.java @@ -0,0 +1,18 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.skills.perksAndAbilities.Global; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerRespawnEvent; + +public class PlayerRespawn implements Listener { + + @EventHandler + void onRespawn(PlayerRespawnEvent e) { + Player p = (Player) e.getPlayer(); + Global globalClass = new Global(p); + globalClass.betterResurrectionRespawn(); + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerShear.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerShear.java new file mode 100644 index 0000000..d411184 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerShear.java @@ -0,0 +1,37 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.skills.perksAndAbilities.Farming; +import org.bukkit.World; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerShearEntityEvent; + +public class PlayerShear implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onPlayerShear(PlayerShearEntityEvent e) { + if (e.isCancelled()) { + return; + } + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.getAllowedSkillsMap().get("farming")) { + return; + } + Player p = e.getPlayer(); + Entity entity = e.getEntity(); + World world = p.getWorld(); + if (entity.getType().equals(EntityType.SHEEP)) { + e.setCancelled(true); + } + + //Farming + Farming farmingClass = new Farming(p); + farmingClass.shearSheep(entity, world); + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/PlayerToggleSprint.java b/src/main/java/mc/carlton/freerpg/events/misc/PlayerToggleSprint.java new file mode 100644 index 0000000..bac2cb7 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/PlayerToggleSprint.java @@ -0,0 +1,22 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.skills.perksAndAbilities.Agility; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerToggleSprintEvent; + +public class PlayerToggleSprint implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onSprintToggle(PlayerToggleSprintEvent e) { + if (e.isCancelled()) { + return; + } + Player p = e.getPlayer(); + Agility agilityClass = new Agility(p); + agilityClass.sprintingEXP(e.isSprinting()); + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/misc/TameEntityEvent.java b/src/main/java/mc/carlton/freerpg/events/misc/TameEntityEvent.java new file mode 100644 index 0000000..d92fe8a --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/misc/TameEntityEvent.java @@ -0,0 +1,24 @@ +package mc.carlton.freerpg.events.misc; + +import mc.carlton.freerpg.skills.perksAndAbilities.BeastMastery; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityTameEvent; + +public class TameEntityEvent implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onEntityTame(EntityTameEvent e) { + if (e.isCancelled()) { + return; + } + Entity entity = e.getEntity(); + Player p = (Player) e.getOwner(); + BeastMastery beastMasteryClass = new BeastMastery(p); + beastMasteryClass.tamingEXP(entity); + + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/newEvents/FrpgAbilityItemMovedEvent.java b/src/main/java/mc/carlton/freerpg/events/newEvents/FrpgAbilityItemMovedEvent.java new file mode 100644 index 0000000..eb05d9d --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/newEvents/FrpgAbilityItemMovedEvent.java @@ -0,0 +1,125 @@ +package mc.carlton.freerpg.events.newEvents; + +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryDragEvent; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; + +/* + * This event constitutes multiple event in the case that an ability item is moved + */ +public class FrpgAbilityItemMovedEvent extends Event implements Cancellable { + + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + private Event event; + private Player player; + private ItemStack abilityItem; + + private FrpgAbilityItemMovedEvent(ItemStack abilityItem, Event event) { + this.event = event; + this.abilityItem = abilityItem; + if (event instanceof Cancellable) { + this.cancelled = ((Cancellable) event).isCancelled(); + } + } + + /** + * Class constructor + * + * @param event InventoryClickEvent + * @param abilityItem Item that has active ability on it + */ + public FrpgAbilityItemMovedEvent(InventoryClickEvent event, ItemStack abilityItem) { + this(abilityItem, event); + this.player = (Player) event.getWhoClicked(); + } + + /** + * Class constructor + * + * @param event InventoryDragEvent + * @param abilityItem Item that has active ability on it + */ + public FrpgAbilityItemMovedEvent(InventoryDragEvent event, ItemStack abilityItem) { + this(abilityItem, event); + this.player = (Player) event.getWhoClicked(); + } + + /** + * Class constructor + * + * @param event FrpgPlayerRightClickEvent + * @param abilityItem Item that has active ability on it + */ + public FrpgAbilityItemMovedEvent(FrpgPlayerRightClickEvent event, ItemStack abilityItem) { + this(abilityItem, event); + this.player = event.getPlayer(); + } + + /** + * Class constructor + * + * @param event FrpgPlayerRightClickEvent + * @param abilityItem Item that has active ability on it + */ + public FrpgAbilityItemMovedEvent(PlayerInteractEntityEvent event, ItemStack abilityItem) { + this(abilityItem, event); + this.player = event.getPlayer(); + } + + public static HandlerList getHandlerList() { + return handlers; + } + + /** + * Getter for the player + * + * @return Player who moved the ability item + */ + public Player getPlayer() { + return player; + } + + /** + * getter for abilityItem + * + * @return The resulting itemstack that is an ability item + */ + public ItemStack getAbilityItem() { + return abilityItem; + } + + /** + * Getter for cancelled + * + * @return true if the associated event is cancelled + */ + @Override + public boolean isCancelled() { + return cancelled; + } + + /** + * Setter for cancrlled, also cancels the event + * + * @param cancel true if the event is to be cancelled + */ + @Override + public void setCancelled(boolean cancel) { + if (event instanceof Cancellable) { + ((Cancellable) event).setCancelled(cancel); + } + this.cancelled = cancel; + } + + @Override + public @NotNull HandlerList getHandlers() { + return handlers; + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/newEvents/FrpgPlayerCraftItemEvent.java b/src/main/java/mc/carlton/freerpg/events/newEvents/FrpgPlayerCraftItemEvent.java new file mode 100644 index 0000000..4d3c4e3 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/newEvents/FrpgPlayerCraftItemEvent.java @@ -0,0 +1,91 @@ +package mc.carlton.freerpg.events.newEvents; + +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.inventory.CraftItemEvent; +import org.bukkit.inventory.ItemStack; + +/* + * A more specific case of the CraftItemEvent that only fires if the item is actually crafted + * (Spigot's version will fire event if the item is not actually crafted) + */ +public class FrpgPlayerCraftItemEvent extends Event implements Cancellable { + + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + private CraftItemEvent craftItemEvent; + private Player player; + private ItemStack result; + + /** + * Constructor for the event + * + * @param event The wrapped craftItemEvent + * @param p Player who crafted the recipe + */ + public FrpgPlayerCraftItemEvent(CraftItemEvent event, Player p) { + this.craftItemEvent = event; + this.player = p; + this.result = event.getRecipe().getResult(); + this.cancelled = event.isCancelled(); + } + + public static HandlerList getHandlerList() { + return handlers; + } + + /** + * getter for result + * + * @return The resulting itemstack crafted + */ + public ItemStack getResult() { + return result; + } + + /** + * Getter for the craft item event + * + * @return the CraftItemEvent associated with this event + */ + public CraftItemEvent getCraftItemEvent() { + return craftItemEvent; + } + + /** + * Getter for the player + * + * @return Player who crafted the item + */ + public Player getPlayer() { + return player; + } + + /** + * Getter for cancelled + * + * @return whether or not the event has been cancelled + */ + @Override + public boolean isCancelled() { + return cancelled; + } + + /** + * Setter for cancelled, cancels the assocaited craftItemEvent + * + * @param cancel true if event is to be cancelled, false otherwise + */ + @Override + public void setCancelled(boolean cancel) { + this.craftItemEvent.setCancelled(true); //Cancels the wrapped event + cancelled = cancel; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/newEvents/FrpgPlayerRightClickEvent.java b/src/main/java/mc/carlton/freerpg/events/newEvents/FrpgPlayerRightClickEvent.java new file mode 100644 index 0000000..e91695a --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/newEvents/FrpgPlayerRightClickEvent.java @@ -0,0 +1,95 @@ +package mc.carlton.freerpg.events.newEvents; + +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.EquipmentSlot; +import org.jetbrains.annotations.NotNull; + + +/* + * An event that wraps PlayerInteractEvent, but only fires if the interaction type is a right click + */ +public class FrpgPlayerRightClickEvent extends Event implements Cancellable { + + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + private PlayerInteractEvent playerInteractEvent; + private boolean isClickAir; + private boolean isOffHand; + + public FrpgPlayerRightClickEvent(PlayerInteractEvent event) { + this.playerInteractEvent = event; + this.isClickAir = event.getAction().equals(Action.RIGHT_CLICK_AIR); + this.isOffHand = event.getHand().equals(EquipmentSlot.OFF_HAND); + } + + public static HandlerList getHandlerList() { + return handlers; + } + + /** + * Getter for the playerInteractEvent + * + * @return the associated PlayerInteractEvent + */ + public PlayerInteractEvent getPlayerInteractEvent() { + return playerInteractEvent; + } + + /** + * Getter for the player + * + * @return the player associated PlayerInteractEvent (player who right clicked) + */ + public Player getPlayer() { + return playerInteractEvent.getPlayer(); + } + + /** + * Getter for isClickAir + * + * @return true if the right click was on an air block, false otherwise + */ + public boolean isClickAir() { + return isClickAir; + } + + /** + * Getter for isOffHand + * + * @return true if the right click was made using an offhand item, false otherwise + */ + public boolean isOffHand() { + return isOffHand; + } + + /** + * Getter for cancelled + * + * @return false (always because the associated PlayerInteractEvent has two cancelled states) + */ + @Override + public boolean isCancelled() { + return cancelled; + } + + /** + * Setter for cancelled + * + * @param cancel true if the associated PlayerInteractEvent is to be cancelled + */ + @Override + public void setCancelled(boolean cancel) { + playerInteractEvent.setCancelled(true); + this.cancelled = cancel; + } + + @Override + public @NotNull HandlerList getHandlers() { + return handlers; + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/newEvents/eventCallers/FrpgAbilityItemMovedEventCaller.java b/src/main/java/mc/carlton/freerpg/events/newEvents/eventCallers/FrpgAbilityItemMovedEventCaller.java new file mode 100644 index 0000000..17abfd2 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/newEvents/eventCallers/FrpgAbilityItemMovedEventCaller.java @@ -0,0 +1,141 @@ +package mc.carlton.freerpg.events.newEvents.eventCallers; + +import mc.carlton.freerpg.events.newEvents.FrpgAbilityItemMovedEvent; +import mc.carlton.freerpg.utils.game.TrackItem; +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.ItemFrame; +import org.bukkit.entity.Player; +import org.bukkit.event.Event; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryDragEvent; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.PluginManager; + +public class FrpgAbilityItemMovedEventCaller implements Listener { + + @EventHandler + public void inventoryClickAbilityItem(InventoryClickEvent e) { + Player p; + + Inventory clickedInventory; + InventoryType clickedInventoryType; + try { + p = (Player) e.getWhoClicked(); + clickedInventory = e.getClickedInventory(); + clickedInventoryType = clickedInventory.getType(); + } catch (Exception except) { + return; + } + if (e.getClick().equals(ClickType.NUMBER_KEY)) { + if (!clickedInventoryType.equals(InventoryType.PLAYER)) { + ItemStack itemToBeMoved = p.getInventory().getItem(e.getHotbarButton()); + callEventIfItemIsTracked(itemToBeMoved, p, e); //Calls event + } + } else if (e.getClick().equals(ClickType.SWAP_OFFHAND)) { + ItemStack itemInOffhand = p.getInventory().getItemInOffHand(); + if (itemInOffhand != null) { + callEventIfItemIsTracked(itemInOffhand, p, e); //Calls event + } + } else if (e.isShiftClick()) { + ItemStack clickedItem = e.getCurrentItem(); + callEventIfItemIsTracked(clickedItem, p, e); //Calls event + } else if (e.getCursor() != null) { + if (!e.getCursor().getType().equals(Material.AIR)) { + if (!clickedInventoryType.equals(InventoryType.PLAYER)) { + ItemStack clickedItem = e.getCursor(); + callEventIfItemIsTracked(clickedItem, p, e); //Calls event + } + } + } + } + + @EventHandler + public void inventoryDragAbilityItem(InventoryDragEvent e) { + Player p; + + Inventory clickedInventory; + InventoryType clickedInventoryType; + try { + p = (Player) e.getWhoClicked(); + clickedInventory = e.getInventory(); + clickedInventoryType = clickedInventory.getType(); + } catch (Exception except) { + return; + } + if (e.getOldCursor() != null) { + if (!e.getOldCursor().getType().equals(Material.AIR)) { + ItemStack clickedItem = e.getOldCursor(); + callEventIfItemIsTracked(clickedItem, p, e); //Calls event + } + } + } + + @EventHandler + public void itemFrameRightClickAbilityItem(PlayerInteractEntityEvent e) { + if (!(e.getRightClicked() instanceof ItemFrame)) { + return; + } + ItemStack clickedItem; + Player p = e.getPlayer(); + if (e.getHand().equals(EquipmentSlot.HAND)) { + clickedItem = p.getInventory().getItemInMainHand(); + } else { + clickedItem = p.getInventory().getItemInOffHand(); + } + callEventIfItemIsTracked(clickedItem, p, e); //Calls event + } + + private void createAndCallAbilityItemMovedEvent(ItemStack itemStack, Event event) { + FrpgAbilityItemMovedEvent abilityItemMovedEvent = null; + if (event instanceof PlayerInteractEntityEvent) { + abilityItemMovedEvent = new FrpgAbilityItemMovedEvent((PlayerInteractEntityEvent) event, + itemStack); + } else if (event instanceof InventoryDragEvent) { + abilityItemMovedEvent = new FrpgAbilityItemMovedEvent((InventoryDragEvent) event, itemStack); + } else if (event instanceof InventoryClickEvent) { + abilityItemMovedEvent = new FrpgAbilityItemMovedEvent((InventoryClickEvent) event, itemStack); + } + if (abilityItemMovedEvent != null) { + PluginManager pluginManager = Bukkit.getServer().getPluginManager(); + pluginManager.callEvent(abilityItemMovedEvent); //Call event + } + } + + private void callEventIfItemIsTracked(ItemStack itemStack, Player p, Event event) { + TrackItem trackItem = new TrackItem(); + NamespacedKey key = trackItem.getFreeRPGItemKey(itemStack, p); + if (key != null) { + createAndCallAbilityItemMovedEvent(itemStack, event); + } + + /* + Below is a more specific version of the same method + */ + /* + TrackItem trackItem = new TrackItem(); + NamespacedKey key = trackItem.getFreeRPGItemKey(clickedItem,p); + if (key != null) { + ItemMeta itemMeta = clickedItem.getItemMeta(); + PersistentDataContainer container = itemMeta.getPersistentDataContainer(); + String specialItemType = container.get(key, PersistentDataType.STRING); + if (specialItemType == null) { + return; + } + if (specialItemType.equalsIgnoreCase("frpg-digging") || specialItemType.equalsIgnoreCase("frpg-mining") + || specialItemType.equalsIgnoreCase("frpg-swordsmanship")) { + FrpgAbilityItemMovedEvent abilityItemMovedEvent = new FrpgAbilityItemMovedEvent(e,clickedItem); + pluginManager.callEvent(abilityItemMovedEvent); //Call event + } + } + */ + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/newEvents/eventCallers/FrpgPlayerCraftItemEventCaller.java b/src/main/java/mc/carlton/freerpg/events/newEvents/eventCallers/FrpgPlayerCraftItemEventCaller.java new file mode 100644 index 0000000..ba141a6 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/newEvents/eventCallers/FrpgPlayerCraftItemEventCaller.java @@ -0,0 +1,66 @@ +package mc.carlton.freerpg.events.newEvents.eventCallers; + +import mc.carlton.freerpg.events.newEvents.FrpgPlayerCraftItemEvent; +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.CraftItemEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.PluginManager; + +public class FrpgPlayerCraftItemEventCaller implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onPlayerCraft(CraftItemEvent e) { + Player p = (Player) e.getWhoClicked(); + FrpgPlayerCraftItemEvent playerCraftItemEvent = new FrpgPlayerCraftItemEvent(e, p); + PluginManager pluginManager = Bukkit.getServer().getPluginManager(); + if (e.getClick().equals(ClickType.MIDDLE) || e.getClick().equals(ClickType.UNKNOWN) || + e.getClick().equals(ClickType.WINDOW_BORDER_LEFT) || e.getClick() + .equals(ClickType.WINDOW_BORDER_RIGHT)) { + return; + } else if (e.getClick().equals(ClickType.SWAP_OFFHAND)) { + ItemStack itemInOffhand = p.getInventory().getItemInOffHand(); + if (itemInOffhand != null) { + if (!itemInOffhand.getType().equals(Material.AIR)) { + return; + } + } + pluginManager.callEvent(playerCraftItemEvent); //Call event + } else if (e.getClick().equals(ClickType.SHIFT_RIGHT) || e.getClick() + .equals(ClickType.SHIFT_LEFT) || + e.getClick().equals(ClickType.LEFT) || e.getClick().equals(ClickType.RIGHT) || + e.getClick().equals(ClickType.NUMBER_KEY)) { + /* + Only god knows what I was thinking when I wrote these nested conditionals, but it works. + */ + if (e.getCursor() != null) { //Should never be the case, but just to prevent errors + if (e.getCursor().getType().equals(Material.AIR) + || e.isShiftClick()) { //User must click with empty cursor (or shift click) + if (e.getHotbarButton() != -1 + || e.isShiftClick()) { //User used number key or shift clicked + if (p.getInventory().firstEmpty() != -1) { //Inventory is not full + if (e.getHotbarButton() != -1) { //Hotbar button click case + if (p.getInventory().getItem(e.getHotbarButton()) + == null) { //Null case, same as the "else if" (to be safe, should never occur) + pluginManager.callEvent(playerCraftItemEvent); //Call event + } else if (p.getInventory().getItem(e.getHotbarButton()).getType() + .equals(Material.AIR)) { //Reward EXP if the hotbar slot is empty (item crafted) + pluginManager.callEvent(playerCraftItemEvent); //Call event + } + } else { //Shift click case + pluginManager.callEvent(playerCraftItemEvent); //Call event + } + } + } else { //If user clicked with empty cursor + pluginManager.callEvent(playerCraftItemEvent); //Call event + } + } + } + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/newEvents/eventCallers/FrpgPlayerRightClickEventCaller.java b/src/main/java/mc/carlton/freerpg/events/newEvents/eventCallers/FrpgPlayerRightClickEventCaller.java new file mode 100644 index 0000000..4e146a9 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/newEvents/eventCallers/FrpgPlayerRightClickEventCaller.java @@ -0,0 +1,26 @@ +package mc.carlton.freerpg.events.newEvents.eventCallers; + +import mc.carlton.freerpg.events.newEvents.FrpgPlayerRightClickEvent; +import org.bukkit.Bukkit; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.plugin.PluginManager; + +public class FrpgPlayerRightClickEventCaller implements Listener { + + @EventHandler + void onRightClick(PlayerInteractEvent e) { + Action a = e.getAction(); + if (e.getHand() == EquipmentSlot.OFF_HAND) { + return; + } + if ((a.equals(Action.RIGHT_CLICK_AIR)) || (a.equals(Action.RIGHT_CLICK_BLOCK))) { + FrpgPlayerRightClickEvent playerRightClickEvent = new FrpgPlayerRightClickEvent(e); + PluginManager pluginManager = Bukkit.getServer().getPluginManager(); + pluginManager.callEvent(playerRightClickEvent); //Call event + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/events/piston/PistonEvents.java b/src/main/java/mc/carlton/freerpg/events/piston/PistonEvents.java new file mode 100644 index 0000000..c629294 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/piston/PistonEvents.java @@ -0,0 +1,80 @@ +package mc.carlton.freerpg.events.piston; + +import java.util.ArrayList; +import java.util.List; +import mc.carlton.freerpg.core.info.server.PlacedBlocksManager; +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.block.BlockPistonExtendEvent; +import org.bukkit.event.block.BlockPistonRetractEvent; +import org.bukkit.util.Vector; + +public class PistonEvents implements Listener { + + @EventHandler(priority = EventPriority.HIGH) + void onPistonExtend(BlockPistonExtendEvent e) { + pistonChangeBlockLocation(e); + } + + @EventHandler(priority = EventPriority.HIGH) + void onPistonRetract(BlockPistonRetractEvent e) { + pistonChangeBlockLocation(e); + } + + private void pistonChangeBlockLocation(BlockPistonExtendEvent e) { + if (e.isCancelled()) { + return; + } + List blocks = e.getBlocks(); + PlacedBlocksManager blockTracker = new PlacedBlocksManager(); + if (blocks.size() != 0) { + ArrayList trackedLocations = new ArrayList<>(); + World world = blocks.get(0).getWorld(); + Vector dir = e.getDirection().getDirection(); + for (Block block : blocks) { + boolean natural = !blockTracker.isBlockTracked(block); + if (natural == false) { + trackedLocations.add(block.getLocation()); + blockTracker.removeBlock(block); + } + } + for (Location loc : trackedLocations) { + int newX = loc.getBlockX() + dir.getBlockX(); + int newY = loc.getBlockY() + dir.getBlockY(); + int newZ = loc.getBlockZ() + dir.getBlockZ(); + blockTracker.addLocation(new Location(world, newX, newY, newZ)); + } + } + } + + private void pistonChangeBlockLocation(BlockPistonRetractEvent e) { + if (e.isCancelled()) { + return; + } + List blocks = e.getBlocks(); + PlacedBlocksManager blockTracker = new PlacedBlocksManager(); + if (blocks.size() != 0) { + ArrayList trackedLocations = new ArrayList<>(); + World world = blocks.get(0).getWorld(); + Vector dir = e.getDirection().getDirection(); + for (Block block : blocks) { + boolean natural = !blockTracker.isBlockTracked(block); + if (natural == false) { + trackedLocations.add(block.getLocation()); + blockTracker.removeBlock(block); + } + } + for (Location loc : trackedLocations) { + int newX = loc.getBlockX() + dir.getBlockX(); + int newY = loc.getBlockY() + dir.getBlockY(); + int newZ = loc.getBlockZ() + dir.getBlockZ(); + blockTracker.addLocation(new Location(world, newX, newY, newZ)); + } + } + } + +} diff --git a/src/main/java/mc/carlton/freerpg/events/piston/PistonRetract.java b/src/main/java/mc/carlton/freerpg/events/piston/PistonRetract.java new file mode 100644 index 0000000..c72c919 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/events/piston/PistonRetract.java @@ -0,0 +1,7 @@ +package mc.carlton.freerpg.events.piston; + +import org.bukkit.event.Listener; + +public class PistonRetract implements Listener { + +} diff --git a/src/main/java/mc/carlton/freerpg/furnaceEvents/FurnaceBurn.java b/src/main/java/mc/carlton/freerpg/furnaceEvents/FurnaceBurn.java deleted file mode 100644 index 0231bf6..0000000 --- a/src/main/java/mc/carlton/freerpg/furnaceEvents/FurnaceBurn.java +++ /dev/null @@ -1,32 +0,0 @@ -package mc.carlton.freerpg.furnaceEvents; - -import mc.carlton.freerpg.gameTools.FurnaceUserTracker; -import mc.carlton.freerpg.perksAndAbilities.Smelting; -import org.bukkit.Material; -import org.bukkit.block.Furnace; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.FurnaceBurnEvent; - -public class FurnaceBurn implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onBurn(FurnaceBurnEvent e){ - if (e.isCancelled()) { - return; - } - boolean isBlast = false; - if (e.getBlock().getType() == Material.BLAST_FURNACE || e.getBlock().getType() == Material.SMOKER) { - isBlast = true; - } - Furnace furnace = (Furnace) e.getBlock().getState(); - FurnaceUserTracker furnaceTracker = new FurnaceUserTracker(); - Player p = furnaceTracker.getPlayer(furnace.getLocation()); - if (p != null && p.isOnline()) { - Smelting smeltingClass = new Smelting(p); - smeltingClass.fuelBurn(furnace,isBlast); - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/furnaceEvents/FurnaceInventoryClick.java b/src/main/java/mc/carlton/freerpg/furnaceEvents/FurnaceInventoryClick.java deleted file mode 100644 index 5f2151d..0000000 --- a/src/main/java/mc/carlton/freerpg/furnaceEvents/FurnaceInventoryClick.java +++ /dev/null @@ -1,35 +0,0 @@ -package mc.carlton.freerpg.furnaceEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.FurnaceUserTracker; -import org.bukkit.block.Furnace; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryType; -import org.bukkit.plugin.Plugin; - -public class FurnaceInventoryClick implements Listener { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - @EventHandler(priority = EventPriority.HIGH) - void onInventoryClick(InventoryClickEvent e) { - if (e.isCancelled()) { - return; - } - try { - InventoryType invType = e.getClickedInventory().getType(); - } catch (Exception except) { - return; - } - if (e.getInventory().getHolder() instanceof Furnace) { //This section is very buggy, and not clean. Hopefully I can improve it in the future - Furnace furnace = (Furnace) e.getInventory().getHolder(); - Player p = (Player) e.getWhoClicked(); - if (furnace.getBurnTime() == 0 || furnace.getCookTime() == 0) { - FurnaceUserTracker furnaceTracker = new FurnaceUserTracker(); - furnaceTracker.addfurnaceLocation(furnace.getLocation(),p); - } - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/furnaceEvents/FurnaceSmelt.java b/src/main/java/mc/carlton/freerpg/furnaceEvents/FurnaceSmelt.java deleted file mode 100644 index f7b5e59..0000000 --- a/src/main/java/mc/carlton/freerpg/furnaceEvents/FurnaceSmelt.java +++ /dev/null @@ -1,34 +0,0 @@ -package mc.carlton.freerpg.furnaceEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.FurnaceUserTracker; -import mc.carlton.freerpg.perksAndAbilities.Smelting; -import org.bukkit.Material; -import org.bukkit.block.Furnace; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.FurnaceSmeltEvent; -import org.bukkit.plugin.Plugin; - -public class FurnaceSmelt implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onSmelt(FurnaceSmeltEvent e){ - if (e.isCancelled()) { - return; - } - boolean isBlast = false; - if (e.getBlock().getType() == Material.BLAST_FURNACE || e.getBlock().getType() == Material.SMOKER) { - isBlast = true; - } - Furnace furnace = (Furnace) e.getBlock().getState(); - FurnaceUserTracker furnaceTracker = new FurnaceUserTracker(); - Player p = furnaceTracker.getPlayer(furnace.getLocation()); - if (p != null && p.isOnline()) { - Smelting smeltingClass = new Smelting(p); - smeltingClass.speedUpFurnace(furnace,isBlast); - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/ActionBarMessages.java b/src/main/java/mc/carlton/freerpg/gameTools/ActionBarMessages.java deleted file mode 100644 index ac43dbb..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/ActionBarMessages.java +++ /dev/null @@ -1,22 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import net.md_5.bungee.api.ChatMessageType; -import net.md_5.bungee.api.chat.TextComponent; -import org.bukkit.entity.Player; - -public class ActionBarMessages { - private Player p; - - public ActionBarMessages(Player p) { - this.p = p; - } - - public void sendMessage(String message) { - try { - p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message)); - } - catch (NoSuchMethodError e) { //This occurs when using craft bukkit - p.sendMessage(message); //In this case, we'll just send the player the message - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/BlockFaceTracker.java b/src/main/java/mc/carlton/freerpg/gameTools/BlockFaceTracker.java deleted file mode 100644 index 1247023..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/BlockFaceTracker.java +++ /dev/null @@ -1,27 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import org.bukkit.block.BlockFace; -import org.bukkit.entity.Player; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -public class BlockFaceTracker { - static Map blockFacePlayerMap = new ConcurrentHashMap<>(); - - public void addBlockFace(BlockFace blockface, Player player) { - blockFacePlayerMap.put(player, blockface); - } - - public BlockFace getBlockface(Player player) { - if (blockFacePlayerMap.containsKey(player)) { - return blockFacePlayerMap.get(player); - } - return null; - } - - public void removePlayerBlockFace(Player player) { - blockFacePlayerMap.remove(player); - } -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/BossBarStorage.java b/src/main/java/mc/carlton/freerpg/gameTools/BossBarStorage.java deleted file mode 100644 index fd492fc..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/BossBarStorage.java +++ /dev/null @@ -1,132 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import mc.carlton.freerpg.FreeRPG; -import org.bukkit.Bukkit; -import org.bukkit.NamespacedKey; -import org.bukkit.boss.BarColor; -import org.bukkit.boss.BarStyle; -import org.bukkit.boss.BossBar; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -public class BossBarStorage { - static Map playerExpBarMap = new ConcurrentHashMap<>(); - static Map playerAbilityDurationMap_Slot1 = new ConcurrentHashMap<>(); - static Map playerAbilityDurationMap_Slot2 = new ConcurrentHashMap<>(); - static Map playerAbilityDurationMap_Slot3 = new ConcurrentHashMap<>(); - - public void initializeNewPlayer(Player p){ - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - BossBar expBar = Bukkit.createBossBar(new NamespacedKey(plugin,p.getUniqueId().toString()),p.getDisplayName()+"'s EXP Bar", BarColor.GREEN, BarStyle.SOLID); - expBar.setVisible(false); - expBar.addPlayer(p); - BossBar abilityDurationBar1 = Bukkit.createBossBar(new NamespacedKey(plugin,p.getUniqueId().toString()),p.getDisplayName()+"'s Ability Duration Bar 1", BarColor.YELLOW, BarStyle.SOLID); - abilityDurationBar1.setVisible(false); - abilityDurationBar1.addPlayer(p); - BossBar abilityDurationBar2 = Bukkit.createBossBar(new NamespacedKey(plugin,p.getUniqueId().toString()),p.getDisplayName()+"'s Ability Duration Bar 1", BarColor.YELLOW, BarStyle.SOLID); - abilityDurationBar2.setVisible(false); - abilityDurationBar2.addPlayer(p); - BossBar abilityDurationBar3 = Bukkit.createBossBar(new NamespacedKey(plugin,p.getUniqueId().toString()),p.getDisplayName()+"'s Ability Duration Bar 1", BarColor.YELLOW, BarStyle.SOLID); - abilityDurationBar3.setVisible(false); - abilityDurationBar3.addPlayer(p); - playerExpBarMap.putIfAbsent(p,expBar); - playerAbilityDurationMap_Slot1.putIfAbsent(p,abilityDurationBar1); - playerAbilityDurationMap_Slot2.putIfAbsent(p,abilityDurationBar2); - playerAbilityDurationMap_Slot3.putIfAbsent(p,abilityDurationBar3); - } - - public BossBar getPlayerExpBar(Player p) { - if (!playerExpBarMap.containsKey(p)) { - initializeNewPlayer(p); - } - return playerExpBarMap.get(p); - } - - public BossBar getPlayerDurationBar1(Player p) { - if (!playerAbilityDurationMap_Slot1.containsKey(p)) { - initializeNewPlayer(p); - } - return playerAbilityDurationMap_Slot1.get(p); - } - - public BossBar getPlayerDurationBar2(Player p) { - if (!playerAbilityDurationMap_Slot2.containsKey(p)) { - initializeNewPlayer(p); - } - return playerAbilityDurationMap_Slot2.get(p); - } - - public BossBar getPlayerDurationBar3(Player p) { - if (!playerAbilityDurationMap_Slot3.containsKey(p)) { - initializeNewPlayer(p); - } - return playerAbilityDurationMap_Slot3.get(p); - } - - public void removePlayer(Player p) { - if (playerExpBarMap.containsKey(p)) { - playerExpBarMap.get(p).removePlayer(p); - playerExpBarMap.remove(p); - } - if (playerAbilityDurationMap_Slot1.containsKey(p)) { - playerAbilityDurationMap_Slot1.get(p).removePlayer(p); - playerAbilityDurationMap_Slot1.remove(p); - } - if (playerAbilityDurationMap_Slot2.containsKey(p)) { - playerAbilityDurationMap_Slot2.get(p).removePlayer(p); - playerAbilityDurationMap_Slot2.remove(p); - } - if (playerAbilityDurationMap_Slot3.containsKey(p)) { - playerAbilityDurationMap_Slot3.get(p).removePlayer(p); - playerAbilityDurationMap_Slot3.remove(p); - } - } - - public boolean isDurationBarActive(Player p,int number) { - BossBar bossBar; - if (number == 1) { - bossBar = getPlayerDurationBar1(p); - } - else if (number == 2) { - bossBar = getPlayerDurationBar2(p); - } - else { - bossBar = getPlayerDurationBar3(p); - } - if (bossBar.isVisible()) { - return true; - } - else { - return false; - } - } - - public int numberOfActiveDurationBars(Player p) { - int numberOfBarsActive = 0; - for (int i = 1; i < 4; i++) { - if (isDurationBarActive(p,i)) { - numberOfBarsActive +=1; - } - } - return numberOfBarsActive; - } - - public BossBar getLowestUnoccupiedBar(Player p) { - if (!isDurationBarActive(p,1)) { - return getPlayerDurationBar1(p); - } - else if (!isDurationBarActive(p,2)) { - return getPlayerDurationBar2(p); - } - else if (!isDurationBarActive(p,3)) { - return getPlayerDurationBar3(p); - } - return null; - - } - - -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/BrewingStandUserTracker.java b/src/main/java/mc/carlton/freerpg/gameTools/BrewingStandUserTracker.java deleted file mode 100644 index 452822d..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/BrewingStandUserTracker.java +++ /dev/null @@ -1,38 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import org.bukkit.block.BrewingStand; -import org.bukkit.entity.Player; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -public class BrewingStandUserTracker { - static Map standPlayerMap = new ConcurrentHashMap<>(); - - public void addstand(BrewingStand stand, Player player) { - if (stand instanceof BrewingStand) { - standPlayerMap.put(stand, player); - } - } - - public Player getPlayer(BrewingStand stand) { - if (stand instanceof BrewingStand) { - if (standPlayerMap.containsKey(stand)) { - return standPlayerMap.get(stand); - } - } - return null; - } - - public void removeStand(BrewingStand stand) { - standPlayerMap.remove(stand); - } - public void removeAllPlayerStands(Player p) { - for (BrewingStand stand : standPlayerMap.keySet()) { - if (standPlayerMap.get(stand) == p) { - standPlayerMap.remove(stand); - } - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/EntityPickedUpItemStorage.java b/src/main/java/mc/carlton/freerpg/gameTools/EntityPickedUpItemStorage.java deleted file mode 100644 index e73a6f1..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/EntityPickedUpItemStorage.java +++ /dev/null @@ -1,94 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.globalVariables.EntityGroups; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.LivingEntity; -import org.bukkit.inventory.EntityEquipment; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.persistence.PersistentDataContainer; -import org.bukkit.persistence.PersistentDataType; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - -public class EntityPickedUpItemStorage { - public static Map> entityPickedUpItemsMap = new ConcurrentHashMap<>(); - - public void addEntity(LivingEntity entity) { - entityPickedUpItemsMap.putIfAbsent(entity,new HashSet<>()); - } - public void addPickedUpItem(ItemStack itemStack, LivingEntity entity) { - Material material = itemStack.getType(); - addEntity(entity); - HashSet currentItemsPickedUp = entityPickedUpItemsMap.get(entity); - currentItemsPickedUp.add(material); - entityPickedUpItemsMap.put(entity,currentItemsPickedUp); - } - - public boolean wasItemPickedUp(ItemStack itemStack, LivingEntity entity) { - if (entityPickedUpItemsMap.containsKey(entity)) { - if (entityPickedUpItemsMap.get(entity).contains(itemStack.getType())) { - return true; - } - } - return false; - } - public void removeEntity(LivingEntity entity) { - if (entityPickedUpItemsMap.containsKey(entity)) { - entityPickedUpItemsMap.remove(entity); - } - } - - public void addPickedUpItemFromDispenser(ItemStack item, Location location) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - EntityGroups entityGroups = new EntityGroups(); - List hostileMobs = entityGroups.getHostileMobs(); - Map> entity_EquipmentMap = new HashMap<>(); - for (Entity entity : location.getWorld().getNearbyEntities(location,1,1,1)) { - if (hostileMobs.contains(entity.getType())) { - LivingEntity hostileMob = (LivingEntity) entity; - List equipment = getEntityEquipment(hostileMob); - entity_EquipmentMap.put(hostileMob,equipment); - } - } - if (entity_EquipmentMap.isEmpty()) { - return; - } - new BukkitRunnable() { - @Override - public void run() { - for (LivingEntity entity : entity_EquipmentMap.keySet()) { - List equipment = entity_EquipmentMap.get(entity); - List newEquipment = getEntityEquipment(entity); - for (int i = 0; i < equipment.size(); i++) { - if (!equipment.get(i).equals(newEquipment.get(i))) { - addPickedUpItem(item,entity); - break; - } - } - - } - } - }.runTaskLater(plugin, 1); - } - - public List getEntityEquipment(LivingEntity entity) { - EntityEquipment equipment = entity.getEquipment(); - List equipmentItems = new ArrayList<>(); - equipmentItems.add(equipment.getItemInMainHand()); - equipmentItems.add(equipment.getItemInOffHand()); - equipmentItems.add(equipment.getHelmet()); - equipmentItems.add(equipment.getChestplate()); - equipmentItems.add(equipment.getLeggings()); - equipmentItems.add(equipment.getBoots()); - return equipmentItems; - } -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/ExpFarmTracker.java b/src/main/java/mc/carlton/freerpg/gameTools/ExpFarmTracker.java deleted file mode 100644 index 45c97b3..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/ExpFarmTracker.java +++ /dev/null @@ -1,75 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.attribute.Attributable; -import org.bukkit.attribute.Attribute; -import org.bukkit.entity.Creature; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Golem; -import org.bukkit.entity.Monster; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Map; - -public class ExpFarmTracker { - static HashSet expFarmLocations = new HashSet<>(); - - public double getExpFarmAndSpawnerCombinedMultiplier(Entity entity,String skillName) { - ConfigLoad configLoad = new ConfigLoad(); - Map spawnerEXPMultipliers = configLoad.getSpawnerEXPMultipliers(); - Map mobFarmEXPMultipliers = configLoad.getMobFarmEXPMultipliers(); - double multiplier = 1.0; - if (spawnerEXPMultipliers.containsKey(skillName)) { - if (entity.hasMetadata("frpgSpawnerMob")) { - multiplier *= spawnerEXPMultipliers.get(skillName); - } - } - if (mobFarmEXPMultipliers.containsKey(skillName)) { - if (isExpFarm(entity)) { - multiplier *= mobFarmEXPMultipliers.get(skillName); - } - } - return multiplier; - } - - - public boolean isExpFarm(Entity entity) { - Location location = entity.getLocation(); - World world = location.getWorld(); - for (Location expFarmLocation : expFarmLocations) { - if (world.equals(expFarmLocation.getWorld())) { - if (expFarmLocation.distance(location) < 3.0) { - return true; - } - } - } - return checkSurroundingMobs(world,location,entity); - } - - public boolean checkSurroundingMobs(World world, Location location, Entity entity) { - if (!(entity instanceof Monster) && !(entity instanceof Golem)) { - return false; - } - Collection nearbyEntities = world.getNearbyEntities(location, 1, 1, 1); - double HP = ((Attributable)entity).getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue(); - int numberOfLowHPEntitiesOfSameType = 0; - for (Entity surroundingEntity : nearbyEntities) { - if (surroundingEntity.getType().equals(entity.getType())) { - if (((Creature)surroundingEntity).getHealth() < HP*0.2) { - numberOfLowHPEntitiesOfSameType += 1; - } - } - if (numberOfLowHPEntitiesOfSameType >= 5) { - break; - } - } - if (numberOfLowHPEntitiesOfSameType >= 5) { - expFarmLocations.add(location); - return true; - } - return false; - } -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/ExperienceBottleTracking.java b/src/main/java/mc/carlton/freerpg/gameTools/ExperienceBottleTracking.java deleted file mode 100644 index f39f81e..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/ExperienceBottleTracking.java +++ /dev/null @@ -1,88 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import mc.carlton.freerpg.FreeRPG; -import org.bukkit.Location; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.ExperienceOrb; -import org.bukkit.entity.LivingEntity; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -public class ExperienceBottleTracking { - static Map trackedEXPOrbs = new ConcurrentHashMap<>(); - - public void addLocation(Location location){ - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - removeDeadEntities(); - trackedEXPOrbs.putIfAbsent(location,false); - new BukkitRunnable() { - @Override - public void run() { - for (Entity entity : location.getWorld().getNearbyEntities(location,1,1,1)) { - if (entity.getType().equals(EntityType.EXPERIENCE_ORB)) { - trackedEXPOrbs.put(location,entity); - } - } - } - }.runTaskLater(plugin, 1); - } - - - public boolean fromEnchantingBottle(Entity entity){ //Bug: False true for first exp picked up after throwing 2+(?) enchanting bottles and not collecting exp - Location orbLoc = entity.getLocation(); - for (Location originLocation : trackedEXPOrbs.keySet()) { - if (originLocation.getWorld().equals(orbLoc.getWorld())) { - if (originLocation.distance(orbLoc) <= 0.5) { - removeCloseOriginLocations(originLocation); - removeDeadEntities(); - return true; - } else if (!(trackedEXPOrbs.get(originLocation) instanceof Boolean)) { - if (entity.equals(trackedEXPOrbs.get(originLocation))) { - removeCloseOriginLocations(originLocation); - removeDeadEntities(); - return true; - } - } - } - } - removeDeadEntities(); - return false; - /* - boolean fromBottle = false; - for (ExperienceOrb experienceOrb : trackedEXPOrbs.keySet()) { - if (experienceOrb.isDead()) { - trackedEXPOrbs.remove(experienceOrb); - fromBottle = true; - } - } - return fromBottle; - - */ - } - - public void removeCloseOriginLocations(Location location) { - for (Location originLocation : trackedEXPOrbs.keySet()) { - if (originLocation.getWorld().equals(location.getWorld())) { - if (location.distance(originLocation) <= 1) { - trackedEXPOrbs.remove(originLocation); - } - } - } - } - - public void removeDeadEntities() { - for (Location originLocation : trackedEXPOrbs.keySet()) { - Object trackedObject = trackedEXPOrbs.get(originLocation); - if (trackedObject instanceof Entity) { - if ( ((ExperienceOrb)trackedObject).isDead()) { - trackedEXPOrbs.remove(originLocation); - } - } - } - } - -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/FireworkShotByPlayerTracker.java b/src/main/java/mc/carlton/freerpg/gameTools/FireworkShotByPlayerTracker.java deleted file mode 100644 index 20db7bf..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/FireworkShotByPlayerTracker.java +++ /dev/null @@ -1,33 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import org.bukkit.entity.Entity; -import org.bukkit.entity.Firework; -import org.bukkit.entity.Player; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; - -public class FireworkShotByPlayerTracker { - static Map fireWorkPlayerMap = new ConcurrentHashMap<>(); - - public void addFirework(Entity firework, Player player) { - if (firework instanceof Firework) { - fireWorkPlayerMap.put(firework.getUniqueId(), player); - } - } - - public Player getPlayer(Entity firework) { - if (firework instanceof Firework) { - if (fireWorkPlayerMap.containsKey(firework.getUniqueId())) { - return fireWorkPlayerMap.get(firework.getUniqueId()); - } - } - return null; - } - - public void removeFireWork(Entity firework) { - fireWorkPlayerMap.remove(firework); - } -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/FurnaceUserTracker.java b/src/main/java/mc/carlton/freerpg/gameTools/FurnaceUserTracker.java deleted file mode 100644 index b6fb574..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/FurnaceUserTracker.java +++ /dev/null @@ -1,83 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; - -public class FurnaceUserTracker { - static Map furnaceLocationPlayerMap = new ConcurrentHashMap<>(); - static Map playerRemoveFurnacesTaskIdMap = new ConcurrentHashMap<>(); - static Map waitingOnTaskMap = new ConcurrentHashMap<>(); - - public void addfurnaceLocation(Location furnaceLocation, Player player) { - if (furnaceLocation instanceof Location && player instanceof Player) { - furnaceLocationPlayerMap.put(furnaceLocation, player); - } - } - - public Player getPlayer(Location furnaceLocation) { - if (furnaceLocation instanceof Location) { - if (furnaceLocationPlayerMap.containsKey(furnaceLocation)) { - return furnaceLocationPlayerMap.get(furnaceLocation); - } - } - return null; - } - - public boolean getWaitingOnTask(Location furnaceLoc) { - if (waitingOnTaskMap.containsKey(furnaceLoc)) { - return waitingOnTaskMap.get(furnaceLoc); - } - else { - return false; - } - } - - public void setWaitingOnTaskMap(boolean isWaiting,Location furnaceLoc) { - waitingOnTaskMap.put(furnaceLoc,isWaiting); - } - public void removeWaitingOnTaskMap(Location furnaceLoc) { - if (waitingOnTaskMap.containsKey(furnaceLoc)) { - waitingOnTaskMap.remove(furnaceLoc); - } - } - - public void removefurnaceLocation(Location furnaceLocation) { - furnaceLocationPlayerMap.remove(furnaceLocation); - } - public void removeAllPlayerfurnaceLocations(Player p) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - ConfigLoad configLoad = new ConfigLoad(); - int removeFurnaceTimer = 20*configLoad.getFurnaceDeleteTimer(); - int taskID = new BukkitRunnable() { - @Override - public void run() { - for (Location furnaceLocation : furnaceLocationPlayerMap.keySet()) { - if (furnaceLocationPlayerMap.get(furnaceLocation) == p) { - furnaceLocationPlayerMap.remove(furnaceLocation); - } - } - if (playerRemoveFurnacesTaskIdMap.containsKey(p.getUniqueId())) { - playerRemoveFurnacesTaskIdMap.remove(p.getUniqueId()); - } - } - }.runTaskLater(plugin, removeFurnaceTimer).getTaskId(); - playerRemoveFurnacesTaskIdMap.put(p.getUniqueId(),taskID); - - } - - public void playerLogin(Player p) { - if (playerRemoveFurnacesTaskIdMap.containsKey(p.getUniqueId())) { - int taskID = (int) playerRemoveFurnacesTaskIdMap.get(p.getUniqueId()); - Bukkit.getScheduler().cancelTask(taskID); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/HorseRiding.java b/src/main/java/mc/carlton/freerpg/gameTools/HorseRiding.java deleted file mode 100644 index f97576b..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/HorseRiding.java +++ /dev/null @@ -1,58 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.entity.Player; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; - -public class HorseRiding { - static Map taskMap = new ConcurrentHashMap<>(); - static Map mountPlayerMap = new ConcurrentHashMap<>(); - static Map playerLocationMap = new ConcurrentHashMap<>(); - - public void setTaskMap(int taskID,Player p){ - taskMap.put(p,taskID); - } - public void setMountPlayerMap(UUID entityUUID,Player p) { - mountPlayerMap.put(entityUUID,p); - } - public void setPlayerLocationMap(Player p) { - playerLocationMap.put(p,p.getLocation()); - } - - public Integer getTask(Player p) { - return taskMap.get(p); - } - public Player getPlayerFromMount(UUID mountUUID) { - if (mountPlayerMap.containsKey(mountUUID)) { - Player toReturn = mountPlayerMap.get(mountUUID); - mountPlayerMap.remove(mountUUID); - return toReturn; - } - return null; - - } - public Location getOldLocation(Player p) { - return playerLocationMap.get(p); - } - - public void deletePlayerData(Player p) { - if (taskMap.containsKey(p)) { - Bukkit.getScheduler().cancelTask(taskMap.get(p)); - taskMap.remove(p); - } - if (playerLocationMap.containsKey(p)) { - playerLocationMap.remove(p); - } - for (UUID i : mountPlayerMap.keySet()) { - if (mountPlayerMap.get(i) == p) { - mountPlayerMap.remove(i); - } - } - } - -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/LanguageSelector.java b/src/main/java/mc/carlton/freerpg/gameTools/LanguageSelector.java deleted file mode 100644 index fd28633..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/LanguageSelector.java +++ /dev/null @@ -1,96 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import mc.carlton.freerpg.globalVariables.StringsAndOtherData; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.entity.Player; - - -import java.util.Map; - -public class LanguageSelector { - Player p; - String playerLanguage; - - - public LanguageSelector(Player player) { - if (player != null) { - this.p = player; - PlayerStats languageStat = new PlayerStats(p); - ConfigLoad configLoad = new ConfigLoad(); - if (configLoad.isForceLanguage()) { - this.playerLanguage = configLoad.getDefaultLanguage(); - } - else { - this.playerLanguage = languageStat.getPlayerLanguage(); - } - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - } - } - - public String getLanguage(){ - return playerLanguage; - } - - public String getString(String id) { - return getString(id,playerLanguage); - } - - /** - * Translates a string into the player's preffered language assuming pieces identified by $:translateable;$ are a id - * - * @param message a String that may contain identifier for parts of string to be translated - * Example: "/frpg help [$:page:$]" --> "/frpg help [page]" - * @return - */ - public String translateMessage(String message) { - return translateMessage(message,playerLanguage); - } - - - /** - * Translates a string into english assuming pieces identified by ::translateable;: are a id - * - * @param message a String that may contain identifier for parts of string to be translated - * Example: "/frpg help [::page::]" --> "/frpg help [page]" - * @return - */ - public static String getEnglishMessage(String message) { - return translateMessage(message,"enUs"); - } - - /** - * - * @param message a String that may contain identifier for parts of string to be translated - * Example: "/frpg help [$:page:$]" --> "/frpg help [page]" - * @param languageCode a valid language identifier found in languages.yml - * @return - */ - public static String translateMessage(String message,String languageCode) { - String[] splitString = message.split("::"); - String translatedMessage = ""; - for (int i = 0; i < splitString.length; i++) { - if (i % 2 == 0) { //Even indicies are never translated - translatedMessage += splitString[i]; - } else { //Odd indicies are always translated - translatedMessage += getString(splitString[i],languageCode); - } - } - return translatedMessage; - } - - public static String getString(String id,String languageCode) { //Used if we want to ignore the player's language choice - String text = ""; - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - Map idToStringMap = stringsAndOtherData.getIdToStringMap(); - Object text0 = idToStringMap.get(languageCode + "." + id); - if (text0 != null) { - text = text0.toString(); - } else { - text = id; //If the text isn't found, the next best thing is the identifier - } - return text; - } - - -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/PsuedoEnchanting.java b/src/main/java/mc/carlton/freerpg/gameTools/PsuedoEnchanting.java deleted file mode 100644 index 99b7c94..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/PsuedoEnchanting.java +++ /dev/null @@ -1,431 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import mc.carlton.freerpg.serverInfo.MinecraftVersion; -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.enchantments.EnchantmentWrapper; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.EnchantmentStorageMeta; -import org.bukkit.inventory.meta.ItemMeta; - -import java.util.*; - -public class PsuedoEnchanting { - Map toolEnchantMap = new HashMap<>(); - Map itemEnchantTypeMap = new HashMap<>(); - Map enchantmentWeightMap = new HashMap<>(); - Map enchantmentBracketMap = new HashMap<>(); - - Random rand = new Random(); - - public PsuedoEnchanting() { - //toolEnchantMao - MinecraftVersion minecraftVersion = new MinecraftVersion(); - double mcVersion = minecraftVersion.getMinecraftVersion_Double(); - - toolEnchantMap.put("chestplate",new Enchantment[]{Enchantment.DURABILITY,Enchantment.MENDING,Enchantment.VANISHING_CURSE,Enchantment.PROTECTION_ENVIRONMENTAL,Enchantment.PROTECTION_EXPLOSIONS,Enchantment.PROTECTION_FIRE,Enchantment.PROTECTION_PROJECTILE,Enchantment.THORNS,Enchantment.BINDING_CURSE}); - toolEnchantMap.put("leggings",new Enchantment[]{Enchantment.DURABILITY,Enchantment.MENDING,Enchantment.VANISHING_CURSE,Enchantment.PROTECTION_ENVIRONMENTAL, Enchantment.PROTECTION_EXPLOSIONS, Enchantment.PROTECTION_FIRE, Enchantment.PROTECTION_PROJECTILE, Enchantment.BINDING_CURSE}); - toolEnchantMap.put("boots",new Enchantment[]{Enchantment.DURABILITY,Enchantment.MENDING,Enchantment.VANISHING_CURSE,Enchantment.PROTECTION_ENVIRONMENTAL, Enchantment.PROTECTION_EXPLOSIONS, Enchantment.PROTECTION_FIRE, Enchantment.PROTECTION_PROJECTILE, Enchantment.BINDING_CURSE,Enchantment.DEPTH_STRIDER,Enchantment.FROST_WALKER, Enchantment.PROTECTION_FALL}); - toolEnchantMap.put("helmet",new Enchantment[]{Enchantment.DURABILITY,Enchantment.MENDING,Enchantment.VANISHING_CURSE,Enchantment.PROTECTION_ENVIRONMENTAL, Enchantment.PROTECTION_EXPLOSIONS, Enchantment.PROTECTION_FIRE, Enchantment.PROTECTION_PROJECTILE, Enchantment.BINDING_CURSE,Enchantment.WATER_WORKER,Enchantment.OXYGEN}); - toolEnchantMap.put("sword", new Enchantment[]{Enchantment.DURABILITY,Enchantment.MENDING,Enchantment.VANISHING_CURSE,Enchantment.DAMAGE_ALL,Enchantment.DAMAGE_ARTHROPODS,Enchantment.DAMAGE_UNDEAD,Enchantment.KNOCKBACK,Enchantment.FIRE_ASPECT,Enchantment.LOOT_BONUS_MOBS,Enchantment.SWEEPING_EDGE}); - toolEnchantMap.put("tool", new Enchantment[]{Enchantment.DURABILITY,Enchantment.MENDING,Enchantment.VANISHING_CURSE,Enchantment.DIG_SPEED,Enchantment.LOOT_BONUS_BLOCKS,Enchantment.SILK_TOUCH}); - toolEnchantMap.put("bow", new Enchantment[]{Enchantment.DURABILITY,Enchantment.MENDING,Enchantment.VANISHING_CURSE,Enchantment.ARROW_DAMAGE,Enchantment.ARROW_FIRE,Enchantment.ARROW_INFINITE,Enchantment.ARROW_KNOCKBACK}); - toolEnchantMap.put("rod", new Enchantment[]{Enchantment.DURABILITY,Enchantment.MENDING,Enchantment.VANISHING_CURSE,Enchantment.LUCK,Enchantment.LURE}); - toolEnchantMap.put("trident",new Enchantment[]{Enchantment.DURABILITY,Enchantment.MENDING,Enchantment.VANISHING_CURSE,Enchantment.LOYALTY,Enchantment.IMPALING,Enchantment.RIPTIDE,Enchantment.CHANNELING}); - toolEnchantMap.put("crossbow", new Enchantment[]{Enchantment.DURABILITY,Enchantment.MENDING,Enchantment.VANISHING_CURSE,Enchantment.QUICK_CHARGE,Enchantment.MULTISHOT,Enchantment.PIERCING}); - Enchantment[] holder = new Enchantment[]{Enchantment.DURABILITY,Enchantment.MENDING,Enchantment.VANISHING_CURSE,Enchantment.PIERCING,Enchantment.MULTISHOT,Enchantment.QUICK_CHARGE,Enchantment.CHANNELING,Enchantment.RIPTIDE,Enchantment.IMPALING,Enchantment.LOYALTY,Enchantment.LURE,Enchantment.LUCK, - Enchantment.ARROW_INFINITE,Enchantment.ARROW_KNOCKBACK,Enchantment.ARROW_FIRE,Enchantment.ARROW_DAMAGE,Enchantment.SILK_TOUCH,Enchantment.LOOT_BONUS_BLOCKS,Enchantment.DIG_SPEED,Enchantment.SWEEPING_EDGE,Enchantment.LOOT_BONUS_MOBS,Enchantment.FIRE_ASPECT, - Enchantment.DAMAGE_UNDEAD,Enchantment.KNOCKBACK,Enchantment.DAMAGE_ARTHROPODS,Enchantment.DAMAGE_ALL,Enchantment.BINDING_CURSE,Enchantment.THORNS,Enchantment.FROST_WALKER,Enchantment.DEPTH_STRIDER,Enchantment.OXYGEN,Enchantment.PROTECTION_EXPLOSIONS, - Enchantment.WATER_WORKER,Enchantment.PROTECTION_PROJECTILE,Enchantment.PROTECTION_FIRE,Enchantment.PROTECTION_FALL,Enchantment.PROTECTION_ENVIRONMENTAL}; - toolEnchantMap.put("book",holder); - - //itemEnchantMap - - itemEnchantTypeMap.put(Material.DIAMOND_SWORD,new Object[]{"sword",10}); - itemEnchantTypeMap.put(Material.STONE_SWORD,new Object[]{"sword",5}); - itemEnchantTypeMap.put(Material.GOLDEN_SWORD,new Object[]{"sword",22}); - itemEnchantTypeMap.put(Material.IRON_SWORD,new Object[]{"sword",14}); - itemEnchantTypeMap.put(Material.WOODEN_SWORD,new Object[]{"sword",15}); - itemEnchantTypeMap.put(Material.DIAMOND_AXE,new Object[]{"tool",10}); - itemEnchantTypeMap.put(Material.STONE_AXE,new Object[]{"tool",5}); - itemEnchantTypeMap.put(Material.GOLDEN_AXE,new Object[]{"tool",22}); - itemEnchantTypeMap.put(Material.IRON_AXE,new Object[]{"tool",14}); - itemEnchantTypeMap.put(Material.WOODEN_AXE,new Object[]{"tool",15}); - itemEnchantTypeMap.put(Material.DIAMOND_PICKAXE,new Object[]{"tool",10}); - itemEnchantTypeMap.put(Material.STONE_PICKAXE,new Object[]{"tool",5}); - itemEnchantTypeMap.put(Material.GOLDEN_PICKAXE,new Object[]{"tool",22}); - itemEnchantTypeMap.put(Material.IRON_PICKAXE,new Object[]{"tool",14}); - itemEnchantTypeMap.put(Material.WOODEN_PICKAXE,new Object[]{"tool",15}); - itemEnchantTypeMap.put(Material.DIAMOND_SHOVEL,new Object[]{"tool",10}); - itemEnchantTypeMap.put(Material.STONE_SHOVEL,new Object[]{"tool",5}); - itemEnchantTypeMap.put(Material.GOLDEN_SHOVEL,new Object[]{"tool",22}); - itemEnchantTypeMap.put(Material.IRON_SHOVEL,new Object[]{"tool",14}); - itemEnchantTypeMap.put(Material.WOODEN_SHOVEL,new Object[]{"tool",15}); - itemEnchantTypeMap.put(Material.BOW,new Object[]{"bow",1}); - itemEnchantTypeMap.put(Material.ENCHANTED_BOOK,new Object[]{"book",1}); - itemEnchantTypeMap.put(Material.BOOK,new Object[]{"book",1}); - itemEnchantTypeMap.put(Material.FISHING_ROD,new Object[]{"rod",1}); - itemEnchantTypeMap.put(Material.TRIDENT,new Object[]{"trident",1}); - itemEnchantTypeMap.put(Material.CROSSBOW,new Object[]{"crossbow",1}); - itemEnchantTypeMap.put(Material.CHAINMAIL_HELMET,new Object[]{"helmet",12}); - itemEnchantTypeMap.put(Material.DIAMOND_HELMET,new Object[]{"helmet",10}); - itemEnchantTypeMap.put(Material.GOLDEN_HELMET,new Object[]{"helmet",25}); - itemEnchantTypeMap.put(Material.IRON_HELMET,new Object[]{"helmet",9}); - itemEnchantTypeMap.put(Material.LEATHER_HELMET,new Object[]{"helmet",15}); - itemEnchantTypeMap.put(Material.TURTLE_HELMET,new Object[]{"helmet",1}); - itemEnchantTypeMap.put(Material.CHAINMAIL_CHESTPLATE,new Object[]{"chestplate",12}); - itemEnchantTypeMap.put(Material.DIAMOND_CHESTPLATE,new Object[]{"chestplate",10}); - itemEnchantTypeMap.put(Material.GOLDEN_CHESTPLATE,new Object[]{"chestplate",25}); - itemEnchantTypeMap.put(Material.IRON_CHESTPLATE,new Object[]{"chestplate",9}); - itemEnchantTypeMap.put(Material.LEATHER_CHESTPLATE,new Object[]{"chestplate",15}); - itemEnchantTypeMap.put(Material.LEATHER_LEGGINGS,new Object[]{"leggings",15}); - itemEnchantTypeMap.put(Material.CHAINMAIL_LEGGINGS,new Object[]{"leggings",12}); - itemEnchantTypeMap.put(Material.DIAMOND_LEGGINGS,new Object[]{"leggings",10}); - itemEnchantTypeMap.put(Material.GOLDEN_LEGGINGS,new Object[]{"leggings",25}); - itemEnchantTypeMap.put(Material.IRON_LEGGINGS,new Object[]{"leggings",9}); - itemEnchantTypeMap.put(Material.CHAINMAIL_BOOTS,new Object[]{"boots",12}); - itemEnchantTypeMap.put(Material.DIAMOND_BOOTS,new Object[]{"boots",10}); - itemEnchantTypeMap.put(Material.GOLDEN_BOOTS,new Object[]{"boots",25}); - itemEnchantTypeMap.put(Material.IRON_BOOTS,new Object[]{"boots",9}); - itemEnchantTypeMap.put(Material.LEATHER_BOOTS,new Object[]{"boots",15}); - - if (mcVersion >= 1.16) { - itemEnchantTypeMap.put(Material.NETHERITE_SWORD, new Object[]{"sword", 15}); - itemEnchantTypeMap.put(Material.NETHERITE_AXE, new Object[]{"tool", 15}); - itemEnchantTypeMap.put(Material.NETHERITE_PICKAXE, new Object[]{"tool", 15}); - itemEnchantTypeMap.put(Material.NETHERITE_SHOVEL, new Object[]{"tool", 15}); - itemEnchantTypeMap.put(Material.NETHERITE_HELMET, new Object[]{"helmet", 15}); - itemEnchantTypeMap.put(Material.NETHERITE_CHESTPLATE, new Object[]{"chestplate", 15}); - itemEnchantTypeMap.put(Material.NETHERITE_LEGGINGS, new Object[]{"leggings", 15}); - itemEnchantTypeMap.put(Material.NETHERITE_BOOTS, new Object[]{"boots", 15}); - } - - enchantmentWeightMap.put(Enchantment.PROTECTION_ENVIRONMENTAL,10); - enchantmentWeightMap.put(Enchantment.PROTECTION_FALL,5); - enchantmentWeightMap.put(Enchantment.PROTECTION_FIRE,5); - enchantmentWeightMap.put(Enchantment.PROTECTION_PROJECTILE,5); - enchantmentWeightMap.put(Enchantment.WATER_WORKER,2); - enchantmentWeightMap.put(Enchantment.PROTECTION_EXPLOSIONS,2); - enchantmentWeightMap.put(Enchantment.OXYGEN,2); - enchantmentWeightMap.put(Enchantment.DEPTH_STRIDER,2); - enchantmentWeightMap.put(Enchantment.FROST_WALKER,2); - enchantmentWeightMap.put(Enchantment.THORNS,1); - enchantmentWeightMap.put(Enchantment.BINDING_CURSE,1); - enchantmentWeightMap.put(Enchantment.DAMAGE_ALL,10); - enchantmentWeightMap.put(Enchantment.DAMAGE_ARTHROPODS,5); - enchantmentWeightMap.put(Enchantment.KNOCKBACK,5); - enchantmentWeightMap.put(Enchantment.DAMAGE_UNDEAD,5); - enchantmentWeightMap.put(Enchantment.FIRE_ASPECT,2); - enchantmentWeightMap.put(Enchantment.LOOT_BONUS_MOBS,2); - enchantmentWeightMap.put(Enchantment.SWEEPING_EDGE,2); - enchantmentWeightMap.put(Enchantment.DIG_SPEED,10); - enchantmentWeightMap.put(Enchantment.LOOT_BONUS_BLOCKS,2); - enchantmentWeightMap.put(Enchantment.SILK_TOUCH,2); - enchantmentWeightMap.put(Enchantment.ARROW_DAMAGE,10); - enchantmentWeightMap.put(Enchantment.ARROW_FIRE,2); - enchantmentWeightMap.put(Enchantment.ARROW_KNOCKBACK,2); - enchantmentWeightMap.put(Enchantment.ARROW_INFINITE,1); - enchantmentWeightMap.put(Enchantment.LUCK,2); - enchantmentWeightMap.put(Enchantment.LURE,2); - enchantmentWeightMap.put(Enchantment.LOYALTY,5); - enchantmentWeightMap.put(Enchantment.IMPALING,2); - enchantmentWeightMap.put(Enchantment.RIPTIDE,2); - enchantmentWeightMap.put(Enchantment.CHANNELING,1); - enchantmentWeightMap.put(Enchantment.QUICK_CHARGE,10); - enchantmentWeightMap.put(Enchantment.MULTISHOT,3); - enchantmentWeightMap.put(Enchantment.PIERCING,30); - enchantmentWeightMap.put(Enchantment.DURABILITY,5); - enchantmentWeightMap.put(Enchantment.MENDING,2); - enchantmentWeightMap.put(Enchantment.VANISHING_CURSE,1); - - - enchantmentBracketMap.put(Enchantment.PROTECTION_ENVIRONMENTAL,new Integer[]{1,12,12,23,23,34,34,45}); - enchantmentBracketMap.put(Enchantment.PROTECTION_FALL,new Integer[]{5,11,11,17,17,23,23,29}); - enchantmentBracketMap.put(Enchantment.PROTECTION_FIRE,new Integer[]{10,18,18,26,26,34,34,42}); - enchantmentBracketMap.put(Enchantment.PROTECTION_PROJECTILE,new Integer[]{3,9,9,15,15,21,21,27}); - enchantmentBracketMap.put(Enchantment.WATER_WORKER,new Integer[]{1,41}); - enchantmentBracketMap.put(Enchantment.PROTECTION_EXPLOSIONS,new Integer[]{5,13,13,21,21,29,29,37}); - enchantmentBracketMap.put(Enchantment.OXYGEN,new Integer[]{10,40,20,50,30,60}); - enchantmentBracketMap.put(Enchantment.DEPTH_STRIDER,new Integer[]{10,25,20,35,30,45}); - enchantmentBracketMap.put(Enchantment.FROST_WALKER,new Integer[]{10,25}); - enchantmentBracketMap.put(Enchantment.THORNS,new Integer[]{10,61,30,71,50,81}); - enchantmentBracketMap.put(Enchantment.BINDING_CURSE,new Integer[]{25,50}); - enchantmentBracketMap.put(Enchantment.DAMAGE_ALL,new Integer[]{1,21,12,32,23,43,34,54,45,65}); - enchantmentBracketMap.put(Enchantment.DAMAGE_ARTHROPODS,new Integer[]{5,12,13,33,21,41,29,49,37,57}); - enchantmentBracketMap.put(Enchantment.KNOCKBACK,new Integer[]{5,61,25,71}); - enchantmentBracketMap.put(Enchantment.DAMAGE_UNDEAD,new Integer[]{5,12,13,33,21,41,29,49,37,57}); - enchantmentBracketMap.put(Enchantment.FIRE_ASPECT,new Integer[]{10,61,30,71}); - enchantmentBracketMap.put(Enchantment.LOOT_BONUS_MOBS,new Integer[]{15,61,24,71,33,81}); - enchantmentBracketMap.put(Enchantment.SWEEPING_EDGE,new Integer[]{5,20,14,29,23,38}); - enchantmentBracketMap.put(Enchantment.DIG_SPEED,new Integer[]{1,61,11,71,21,81,31,91,41,101}); - enchantmentBracketMap.put(Enchantment.LOOT_BONUS_BLOCKS,new Integer[]{15,61,24,71,33,81}); - enchantmentBracketMap.put(Enchantment.SILK_TOUCH,new Integer[]{15,81}); - enchantmentBracketMap.put(Enchantment.ARROW_DAMAGE,new Integer[]{1,16,11,26,21,36,31,46,41,56}); - enchantmentBracketMap.put(Enchantment.ARROW_FIRE,new Integer[]{20,50}); - enchantmentBracketMap.put(Enchantment.ARROW_KNOCKBACK,new Integer[]{12,37,32,57}); - enchantmentBracketMap.put(Enchantment.ARROW_INFINITE,new Integer[]{20,50}); - enchantmentBracketMap.put(Enchantment.LUCK,new Integer[]{15,61,24,71,33,81}); - enchantmentBracketMap.put(Enchantment.LURE,new Integer[]{15,61,24,71,33,81}); - enchantmentBracketMap.put(Enchantment.LOYALTY,new Integer[]{12,50,19,50,26,50}); - enchantmentBracketMap.put(Enchantment.IMPALING,new Integer[]{1,21,9,29,17,37,25,45,33,53}); - enchantmentBracketMap.put(Enchantment.RIPTIDE,new Integer[]{17,50,24,50,31,50}); - enchantmentBracketMap.put(Enchantment.CHANNELING,new Integer[]{25,50}); - enchantmentBracketMap.put(Enchantment.QUICK_CHARGE,new Integer[]{12,50,32,50,42,50}); - enchantmentBracketMap.put(Enchantment.MULTISHOT,new Integer[]{20,50}); - enchantmentBracketMap.put(Enchantment.PIERCING,new Integer[]{1,50,11,50,21,50,31,50}); - enchantmentBracketMap.put(Enchantment.DURABILITY,new Integer[]{5,61,13,71,21,81}); - enchantmentBracketMap.put(Enchantment.MENDING,new Integer[]{25,75}); - enchantmentBracketMap.put(Enchantment.VANISHING_CURSE,new Integer[]{25,50}); - } - - public void printInfo() { - for (Enchantment enchant : enchantmentWeightMap.keySet()) { - System.out.println(enchant.getKey()); - } - } - - public ItemStack enchantItem(ItemStack item, int level,boolean isTreasure) { - //Getting data - Material itemType = item.getType(); - if (!itemEnchantTypeMap.containsKey(itemType)) { - return item; //Does not enchant the item if it is not contained - } - int enchantability = (int)itemEnchantTypeMap.get(itemType)[1]; - Enchantment[] possibleEnchants0 = toolEnchantMap.get((String)itemEnchantTypeMap.get(itemType)[0]); - Map enchantment_level= new HashMap<>(); - ItemStack enchantedItem = item; - ItemMeta meta = enchantedItem.getItemMeta(); - - ArrayList possibleEnchants = new ArrayList<>(Arrays.asList(possibleEnchants0)); - if (!isTreasure) { - if (possibleEnchants.contains(Enchantment.BINDING_CURSE)) { - possibleEnchants.remove(Enchantment.BINDING_CURSE); - } - if (possibleEnchants.contains(Enchantment.VANISHING_CURSE)) { - possibleEnchants.remove(Enchantment.VANISHING_CURSE); - } - if (possibleEnchants.contains(Enchantment.MENDING)) { - possibleEnchants.remove(Enchantment.MENDING); - } - } - - //Determining modified level - int rand_enchantability = 1 + rand.nextInt(Math.round(enchantability / 4 + 1)) + rand.nextInt(Math.round(enchantability / 4 + 1)); - - int k = level + rand_enchantability; - - double rand_bonus_percent = 1 + (rand.nextDouble() + rand.nextDouble() - 1) * 0.15; - - int modifiedLevel = (int) Math.round(k*rand_bonus_percent); - if (modifiedLevel < 1) { - modifiedLevel = 1; - } - - //Finding possible enchants - int T = 0; - for (Enchantment enchant : possibleEnchants) { - Integer[] brackets = enchantmentBracketMap.get(enchant); - int power = brackets.length/2; - for (int i=0; i= modifiedLevel) { - if (enchantment_level.containsKey(enchant)) { - enchantment_level.put(enchant,i+1); - } - else { - enchantment_level.put(enchant,i+1); - T += enchantmentWeightMap.get(enchant); - } - } - } - } - if (T < 1) { - T = 1; - } - - //Picking enchantment - int w = rand.nextInt(T); - for (Enchantment enchant : enchantment_level.keySet()) { - w = w - enchantmentWeightMap.get(enchant); - if (w < 0) { - if (enchantedItem.getType() == Material.BOOK || enchantedItem.getType() == Material.ENCHANTED_BOOK) { - ((EnchantmentStorageMeta) meta).addStoredEnchant(enchant,enchantment_level.get(enchant),false); - enchantedItem.setItemMeta(meta); - } - else { - enchantedItem.addUnsafeEnchantment(enchant,enchantment_level.get(enchant)); - } - break; - } - } - - return moreEnchants(enchantedItem, (int) Math.round(modifiedLevel), enchantment_level); - - - } - - public ItemStack moreEnchants(ItemStack enchanted_Item, int modifiedLevel, Map possibleEnchants) { - ItemStack enchantedItem = enchanted_Item; - ItemMeta meta = enchantedItem.getItemMeta(); - Map enchants = enchanted_Item.getEnchantments(); - if (enchantedItem.getType() == Material.BOOK && enchantedItem.getType() == Material.ENCHANTED_BOOK) { - enchants = ((EnchantmentStorageMeta) meta).getStoredEnchants(); - } - double prob = (modifiedLevel + 1) / 50.0; - if (prob < rand.nextDouble()) { - return enchantedItem; - } - for (Enchantment enchantment : enchants.keySet()) { - if (enchantment.equals(Enchantment.DAMAGE_ALL) || enchantment.equals(Enchantment.DAMAGE_ARTHROPODS) || enchantment.equals(Enchantment.DAMAGE_UNDEAD)) { - if (possibleEnchants.containsKey(Enchantment.DAMAGE_ALL)) { - possibleEnchants.remove(Enchantment.DAMAGE_ALL); - } - if (possibleEnchants.containsKey(Enchantment.DAMAGE_ARTHROPODS)) { - possibleEnchants.remove(Enchantment.DAMAGE_ARTHROPODS); - } - if (possibleEnchants.containsKey(Enchantment.DAMAGE_UNDEAD)) { - possibleEnchants.remove(Enchantment.DAMAGE_UNDEAD); - } - } else if (enchantment.equals(Enchantment.PROTECTION_ENVIRONMENTAL) || enchantment.equals(Enchantment.PROTECTION_EXPLOSIONS) || enchantment.equals(Enchantment.PROTECTION_FIRE) || enchantment.equals(Enchantment.PROTECTION_PROJECTILE)) { - if (possibleEnchants.containsKey(Enchantment.PROTECTION_ENVIRONMENTAL)) { - possibleEnchants.remove(Enchantment.PROTECTION_ENVIRONMENTAL); - } - if (possibleEnchants.containsKey(Enchantment.PROTECTION_EXPLOSIONS)) { - possibleEnchants.remove(Enchantment.PROTECTION_EXPLOSIONS); - } - if (possibleEnchants.containsKey(Enchantment.PROTECTION_PROJECTILE)) { - possibleEnchants.remove(Enchantment.PROTECTION_PROJECTILE); - } - if (possibleEnchants.containsKey(Enchantment.PROTECTION_FIRE)) { - possibleEnchants.remove(Enchantment.PROTECTION_FIRE); - } - } else if (enchantment.equals(Enchantment.SILK_TOUCH) || enchantment.equals(Enchantment.LOOT_BONUS_BLOCKS)) { - if (possibleEnchants.containsKey(Enchantment.SILK_TOUCH)) { - possibleEnchants.remove(Enchantment.SILK_TOUCH); - } - if (possibleEnchants.containsKey(Enchantment.LOOT_BONUS_BLOCKS)) { - possibleEnchants.remove(Enchantment.LOOT_BONUS_BLOCKS); - } - } else if (enchantment.equals(Enchantment.DEPTH_STRIDER) || enchantment.equals(Enchantment.FROST_WALKER)) { - if (possibleEnchants.containsKey(Enchantment.DEPTH_STRIDER)) { - possibleEnchants.remove(Enchantment.DEPTH_STRIDER); - } - if (possibleEnchants.containsKey(Enchantment.FROST_WALKER)) { - possibleEnchants.remove(Enchantment.FROST_WALKER); - } - } else if (enchantment.equals(Enchantment.MENDING) || enchantment.equals(Enchantment.ARROW_INFINITE)) { - if (possibleEnchants.containsKey(Enchantment.MENDING)) { - possibleEnchants.remove(Enchantment.MENDING); - } - if (possibleEnchants.containsKey(Enchantment.ARROW_INFINITE)) { - possibleEnchants.remove(Enchantment.ARROW_INFINITE); - } - } else if (enchantment.equals(Enchantment.RIPTIDE)) { - if (possibleEnchants.containsKey(Enchantment.LOYALTY)) { - possibleEnchants.remove(Enchantment.LOYALTY); - } - if (possibleEnchants.containsKey(Enchantment.RIPTIDE)) { - possibleEnchants.remove(Enchantment.RIPTIDE); - } - if (possibleEnchants.containsKey(Enchantment.CHANNELING)) { - possibleEnchants.remove(Enchantment.CHANNELING); - } - } else if (enchantment.equals(Enchantment.CHANNELING) || enchantment.equals(Enchantment.LOYALTY)) { - if (possibleEnchants.containsKey(Enchantment.RIPTIDE)) { - possibleEnchants.remove(Enchantment.RIPTIDE); - } - } else if (enchantment.equals(Enchantment.MULTISHOT) || enchantment.equals(Enchantment.PIERCING)) { - if (possibleEnchants.containsKey(Enchantment.MULTISHOT)) { - possibleEnchants.remove(Enchantment.MULTISHOT); - } - if (possibleEnchants.containsKey(Enchantment.PIERCING)) { - possibleEnchants.remove(Enchantment.PIERCING); - } - } - if (possibleEnchants.containsKey(enchantment)) { - possibleEnchants.remove(enchantment); - } - } - int T = 0; - for (Enchantment enchantment : possibleEnchants.keySet()) { - T += enchantmentWeightMap.get(enchantment); - } - if (T < 1) { - T = 1; - } - - int w = rand.nextInt(T); - for (Enchantment enchant : possibleEnchants.keySet()) { - w = w - enchantmentWeightMap.get(enchant); - if (w < 0) { - if (enchantedItem.getType() == Material.BOOK || enchantedItem.getType() == Material.ENCHANTED_BOOK) { - ((EnchantmentStorageMeta) meta).addStoredEnchant(enchant,possibleEnchants.get(enchant),false); - enchantedItem.setItemMeta(meta); - } - else { - enchantedItem.addUnsafeEnchantment(enchant,possibleEnchants.get(enchant)); - } - break; - } - } - - return moreEnchants(enchantedItem, (int) Math.round(modifiedLevel / 2), possibleEnchants); - } - - public ItemStack addEnchant(ItemStack preEnchantedItem, int level,boolean isTreasure) { - //Getting data - Material itemType = preEnchantedItem.getType(); - if (!itemEnchantTypeMap.containsKey(itemType)) { - return preEnchantedItem; //Does not enchant the item if it is not contained - } - int enchantAbility = (int)itemEnchantTypeMap.get(itemType)[1]; - Enchantment[] possibleEnchants0 = toolEnchantMap.get((String)itemEnchantTypeMap.get(itemType)[0]); - Map enchantment_level= new HashMap<>(); - ItemStack enchantedItem = preEnchantedItem; - - ArrayList possibleEnchants = new ArrayList<>(Arrays.asList(possibleEnchants0)); - if (!isTreasure) { - if (possibleEnchants.contains(Enchantment.BINDING_CURSE)) { - possibleEnchants.remove(Enchantment.BINDING_CURSE); - } - if (possibleEnchants.contains(Enchantment.VANISHING_CURSE)) { - possibleEnchants.remove(Enchantment.VANISHING_CURSE); - } - if (possibleEnchants.contains(Enchantment.MENDING)) { - possibleEnchants.remove(Enchantment.MENDING); - } - } - - //Determining modified level - int rand_enchantability = 1 + rand.nextInt(Math.round(enchantAbility / 4 + 1)) + rand.nextInt(Math.round(enchantAbility / 4 + 1)); - - int k = level + rand_enchantability; - - double rand_bonus_percent = 1 + (rand.nextDouble() + rand.nextDouble() - 1) * 0.15; - - int modifiedLevel = (int) Math.round(k*rand_bonus_percent); - if (modifiedLevel < 1) { - modifiedLevel = 1; - } - - //Finding possible enchants - int T = 0; - for (Enchantment enchant : possibleEnchants) { - Integer[] brackets = enchantmentBracketMap.get(enchant); - int power = brackets.length/2; - for (int i=0; i= modifiedLevel) { - if (enchantment_level.containsKey(enchant)) { - enchantment_level.put(enchant,i+1); - } - else { - enchantment_level.put(enchant,i+1); - T += enchantmentWeightMap.get(enchant); - } - } - } - } - - return moreEnchants(enchantedItem, (int) Math.round(modifiedLevel), enchantment_level); - } -} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/TrackItem.java b/src/main/java/mc/carlton/freerpg/gameTools/TrackItem.java deleted file mode 100644 index 9e61871..0000000 --- a/src/main/java/mc/carlton/freerpg/gameTools/TrackItem.java +++ /dev/null @@ -1,79 +0,0 @@ -package mc.carlton.freerpg.gameTools; - -import mc.carlton.freerpg.playerInfo.AbilityLogoutTracker; -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.persistence.PersistentDataContainer; -import org.bukkit.persistence.PersistentDataType; - -import java.util.Map; - -public class TrackItem { - - public ItemStack findTrackedItemInInventory(Player p, NamespacedKey key) { - for (ItemStack item : p.getInventory().getContents()) { - if (doesItemHaveKey(item,key)) { - removeItemKey(item,key); - return item; - } - } - ItemStack cursorItem = p.getItemOnCursor(); - if (doesItemHaveKey(cursorItem,key)) { - removeItemKey(cursorItem,key); - return cursorItem; - } - return null; - } - - public boolean doesItemHaveKey(ItemStack item,NamespacedKey key) { - if (item == null) { - return false; - } - if (item.getType() == Material.AIR) { - return false; - } - ItemMeta itemMeta = item.getItemMeta(); - PersistentDataContainer container = itemMeta.getPersistentDataContainer(); - if (container.has(key,PersistentDataType.STRING)) { - return true; - } - return false; - } - - public NamespacedKey getFreeRPGItemKey(ItemStack item,Player p) { //This assumes there is only one NamespacedKey per item (which should be a safe assumption) - if (item == null) { - return null; - } - if (item.getType() == Material.AIR) { - return null; - } - AbilityLogoutTracker abilityLogoutTracker = new AbilityLogoutTracker(p); - Map allPlayerKeys = abilityLogoutTracker.getPlayerKeys(); - ItemMeta itemMeta = item.getItemMeta(); - PersistentDataContainer container = itemMeta.getPersistentDataContainer(); - for (String name : allPlayerKeys.keySet()) { - NamespacedKey key = allPlayerKeys.get(name); - if (container.has(key,PersistentDataType.STRING)) { - if (key.getKey().contains("frpg")) { - return key; - } - } - } - return null; - } - - public void removeItemKey(ItemStack item, NamespacedKey key) { - if (key == null) { - return; - } - ItemMeta itemMeta = item.getItemMeta(); - PersistentDataContainer container = itemMeta.getPersistentDataContainer(); - if (container.has(key,PersistentDataType.STRING)) { - container.remove(key); - item.setItemMeta(itemMeta); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/globalVariables/EntityGroups.java b/src/main/java/mc/carlton/freerpg/globalVariables/EntityGroups.java deleted file mode 100644 index 4f8189d..0000000 --- a/src/main/java/mc/carlton/freerpg/globalVariables/EntityGroups.java +++ /dev/null @@ -1,335 +0,0 @@ -package mc.carlton.freerpg.globalVariables; - -import mc.carlton.freerpg.gameTools.ExpFarmTracker; -import mc.carlton.freerpg.playerInfo.ChangeStats; -import mc.carlton.freerpg.serverInfo.MinecraftVersion; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Mob; - -import java.util.*; - -public class EntityGroups { - private MinecraftVersion minecraftVersion = new MinecraftVersion(); - private double mcVersion = minecraftVersion.getMinecraftVersion_Double(); - - static List hostileMobs; - static List breedingAnimals; - static List animals; - static List babyAnimals; - static List breedingAnimalsFarming; - static List thirstMobs; - static List hookableEntities; - - public void initializeAllEntityGroups() { - initializeHostileMobs(); - initializeTameableAnimals(); - initializeFarmingAnimals(); - initializeThirstMobs(); - initializeHookableMobs(); - } - - public void initializeHookableMobs() { - EntityType[] hookableEntities0 = {EntityType.BLAZE,EntityType.GHAST,EntityType.ZOMBIE,EntityType.SPIDER, - EntityType.CAVE_SPIDER,EntityType.PIG,EntityType.CREEPER,EntityType.WITCH,EntityType.CHICKEN, - EntityType.SKELETON,EntityType.WITHER_SKELETON,EntityType.MAGMA_CUBE,EntityType.COW,EntityType.MUSHROOM_COW, - EntityType.ENDERMAN,EntityType.SHEEP,EntityType.IRON_GOLEM,EntityType.SNOWMAN,EntityType.SHULKER}; - hookableEntities = new LinkedList<>(Arrays.asList(hookableEntities0)); - if (mcVersion >= 1.16) { - hookableEntities.add(EntityType.ZOMBIFIED_PIGLIN); - } - } - - public void initializeHostileMobs() { - EntityType[] hostileMobs0 = {EntityType.SPIDER,EntityType.CAVE_SPIDER,EntityType.ENDERMAN, - EntityType.BLAZE,EntityType.CREEPER,EntityType.DROWNED,EntityType.ELDER_GUARDIAN, - EntityType.ENDERMITE,EntityType.EVOKER,EntityType.GHAST,EntityType.GUARDIAN, - EntityType.HUSK,EntityType.MAGMA_CUBE,EntityType.PHANTOM,EntityType.PILLAGER, - EntityType.RAVAGER,EntityType.SHULKER,EntityType.SKELETON,EntityType.SLIME, - EntityType.STRAY,EntityType.VEX,EntityType.VINDICATOR,EntityType.WITCH, - EntityType.WITHER_SKELETON,EntityType.ZOMBIE,EntityType.ZOMBIE_VILLAGER}; - hostileMobs = new LinkedList<>(Arrays.asList(hostileMobs0)); - if (mcVersion >= 1.16) { - hostileMobs.add(EntityType.HOGLIN); - hostileMobs.add(EntityType.PIGLIN); - hostileMobs.add(EntityType.ZOMBIFIED_PIGLIN); - hostileMobs.add(EntityType.ZOGLIN); - } - } - - public void initializeTameableAnimals() { - EntityType[] breedingAnimals0 = {EntityType.HORSE,EntityType.WOLF,EntityType.CAT,EntityType.OCELOT,EntityType.PARROT}; - breedingAnimals = Arrays.asList(breedingAnimals0); - } - - public void initializeFarmingAnimals() { - EntityType[] animals0 = {EntityType.CHICKEN,EntityType.COW,EntityType.DONKEY,EntityType.FOX,EntityType.HORSE,EntityType.MUSHROOM_COW, - EntityType.MULE,EntityType.PARROT,EntityType.PIG,EntityType.RABBIT,EntityType.SHEEP,EntityType.SQUID, - EntityType.SKELETON_HORSE,EntityType.TURTLE}; - animals = Arrays.asList(animals0); - EntityType[] babyAnimals0 = {EntityType.MUSHROOM_COW,EntityType.COW,EntityType.SHEEP,EntityType.PIG,EntityType.CHICKEN,EntityType.RABBIT, - EntityType.WOLF,EntityType.CAT,EntityType.OCELOT,EntityType.LLAMA,EntityType.POLAR_BEAR, - EntityType.HORSE,EntityType.DONKEY,EntityType.MULE,EntityType.SKELETON_HORSE,EntityType.TURTLE, - EntityType.PANDA,EntityType.FOX,EntityType.BEE}; - babyAnimals = Arrays.asList(babyAnimals0); - EntityType[] breedingAnimals0 = {EntityType.MUSHROOM_COW,EntityType.COW,EntityType.SHEEP,EntityType.PIG,EntityType.CHICKEN,EntityType.RABBIT, - EntityType.TURTLE, EntityType.PANDA,EntityType.FOX,EntityType.BEE}; - breedingAnimalsFarming = Arrays.asList(breedingAnimals0); - } - - public void initializeThirstMobs() { - EntityType[] thirstMobs0 = {EntityType.DROWNED,EntityType.ELDER_GUARDIAN, EntityType.EVOKER,EntityType.GUARDIAN, - EntityType.HUSK,EntityType.PILLAGER, EntityType.RAVAGER, EntityType.VINDICATOR,EntityType.WITCH, EntityType.ZOMBIE,EntityType.ZOMBIE_VILLAGER}; - thirstMobs =new LinkedList<>(Arrays.asList(thirstMobs0)); - if (mcVersion >= 1.16) { - thirstMobs.add(EntityType.HOGLIN); - thirstMobs.add(EntityType.PIGLIN); - thirstMobs.add(EntityType.ZOMBIFIED_PIGLIN); - thirstMobs.add(EntityType.ZOGLIN); - } - } - - public void killEntity(Entity entity, String skillName, Map expMap,ChangeStats increaseStats) { - if (entity instanceof LivingEntity) { - if (entity instanceof Mob) { - Mob mob = (Mob) entity; - EntityType type = mob.getType(); - int expReward = expMap.get("killAnythingElse"); - if(type.equals(EntityType.BAT)) { - expReward = expMap.get("killBat"); - } - else if (type.equals(EntityType.CAT)) { - expReward = expMap.get("killCat"); - } - else if (type.equals(EntityType.CHICKEN)) { - expReward = expMap.get("killChicken"); - } - else if (type.equals(EntityType.COD)) { - expReward = expMap.get("killCod"); - } - else if (type.equals(EntityType.COW)) { - expReward = expMap.get("killCow"); - } - else if (type.equals(EntityType.DONKEY)) { - expReward = expMap.get("killDonkey"); - } - else if (type.equals(EntityType.FOX)) { - expReward = expMap.get("killFox"); - } - else if (type.equals(EntityType.HORSE)) { - expReward = expMap.get("killHorse"); - } - else if (type.equals(EntityType.POLAR_BEAR)) { - expReward = expMap.get("killPolarBear"); - } - else if (type.equals(EntityType.MUSHROOM_COW)) { - expReward = expMap.get("killMooshroom"); - } - else if (type.equals(EntityType.MULE)) { - expReward = expMap.get("killMule"); - } - else if (type.equals(EntityType.OCELOT)) { - expReward = expMap.get("killOcelot"); - } - else if (type.equals(EntityType.PARROT)) { - expReward = expMap.get("killParrot"); - } - else if (type.equals(EntityType.PIG)) { - expReward = expMap.get("killPig"); - } - else if (type.equals(EntityType.RABBIT)) { - expReward = expMap.get("killRabbit"); - } - else if (type.equals(EntityType.SALMON)) { - expReward = expMap.get("killSalmon"); - } - else if (type.equals(EntityType.SHEEP)) { - expReward = expMap.get("killSheep"); - } - else if (type.equals(EntityType.SKELETON_HORSE)) { - expReward = expMap.get("killSkeleton_Horse"); - } - else if (type.equals(EntityType.SNOWMAN)) { - expReward = expMap.get("killSnowman"); - } - else if (type.equals(EntityType.SQUID)) { - expReward = expMap.get("killSquid"); - } - else if (type.equals(EntityType.TROPICAL_FISH)) { - expReward = expMap.get("killTropical_Fish"); - } - else if (type.equals(EntityType.TURTLE)) { - expReward = expMap.get("killTurtle"); - } - else if (type.equals(EntityType.VILLAGER)) { - expReward = expMap.get("killVillager"); - } - else if (type.equals(EntityType.WANDERING_TRADER)) { - expReward = expMap.get("killWandering_Trader"); - } - else if (type.equals(EntityType.BEE)) { - expReward = expMap.get("killBee"); - } - else if (type.equals(EntityType.CAVE_SPIDER)) { - expReward = expMap.get("killCaveSpider"); - } - else if (type.equals(EntityType.DOLPHIN)) { - expReward = expMap.get("killDolphin"); - } - else if (type.equals(EntityType.ENDERMAN)) { - expReward = expMap.get("killEnderman"); - } - else if (type.equals(EntityType.IRON_GOLEM)) { - expReward = expMap.get("killIron_Golem"); - } - else if (type.equals(EntityType.LLAMA)) { - expReward = expMap.get("killLlama"); - } - else if (type.equals(EntityType.PANDA)) { - expReward = expMap.get("killPanda"); - } - else if (type.equals(EntityType.PUFFERFISH)) { - expReward = expMap.get("killPufferfish"); - } - else if (type.equals(EntityType.SPIDER)) { - expReward = expMap.get("killSpider"); - } - else if (type.equals(EntityType.WOLF)) { - expReward = expMap.get("killWolf"); - } - else if (type.equals(EntityType.BLAZE)) { - expReward = expMap.get("killBlaze"); - } - else if (type.equals(EntityType.CREEPER)) { - expReward = expMap.get("killCreeper"); - } - else if (type.equals(EntityType.DROWNED)) { - expReward = expMap.get("killDrowned"); - } - else if (type.equals(EntityType.ELDER_GUARDIAN)) { - expReward = expMap.get("killElder_Guardian"); - } - else if (type.equals(EntityType.ENDERMITE)) { - expReward = expMap.get("killEndermite"); - } - else if (type.equals(EntityType.EVOKER)) { - expReward = expMap.get("killEvoker"); - } - else if (type.equals(EntityType.GHAST)) { - expReward = expMap.get("killGhast"); - } - else if (type.equals(EntityType.GUARDIAN)) { - expReward = expMap.get("killGuardian"); - } - else if (type.equals(EntityType.HUSK)) { - expReward = expMap.get("killHusk"); - } - else if (type.equals(EntityType.MAGMA_CUBE)) { - expReward = expMap.get("killMagma_Cube"); - } - else if (type.equals(EntityType.PHANTOM)) { - expReward = expMap.get("killPhantom"); - } - else if (type.equals(EntityType.PILLAGER)) { - expReward = expMap.get("killPillager"); - } - else if (type.equals(EntityType.RAVAGER)) { - expReward = expMap.get("killRavager"); - } - else if (type.equals(EntityType.SHULKER)) { - expReward = expMap.get("killShulker"); - } - else if (type.equals(EntityType.SILVERFISH)) { - expReward = expMap.get("killSilverfish"); - } - else if (type.equals(EntityType.SKELETON)) { - expReward = expMap.get("killSkeleton"); - } - else if (type.equals(EntityType.SLIME)) { - expReward = expMap.get("killSlime"); - } - else if (type.equals(EntityType.STRAY)) { - expReward = expMap.get("killStray"); - } - else if (type.equals(EntityType.VEX)) { - expReward = expMap.get("killVex"); - } - else if (type.equals(EntityType.VINDICATOR)) { - expReward = expMap.get("killVindicator"); - } - else if (type.equals(EntityType.WITCH)) { - expReward = expMap.get("killWitch"); - } - else if (type.equals(EntityType.WITHER_SKELETON)) { - expReward = expMap.get("killWitherSkeleton"); - } - else if (type.equals(EntityType.ZOMBIE)) { - expReward = expMap.get("killZombie"); - } - else if (type.equals(EntityType.ZOMBIE_VILLAGER)) { - expReward = expMap.get("killZombie_Villager"); - } - else if (type.equals(EntityType.ENDER_DRAGON)) { - expReward = expMap.get("killEnder_Dragon"); - } - else if (type.equals(EntityType.WITHER)) { - expReward = expMap.get("killWither"); - } - else if (type.equals(EntityType.ZOMBIE_HORSE)) { - expReward = expMap.get("killZombie_Horse"); - } - else if (type.equals(EntityType.ILLUSIONER)) { - expReward = expMap.get("killIllusioner"); - } - else if (type.equals(EntityType.GIANT)) { - expReward = expMap.get("killGiant"); - } - if (mcVersion >= 1.16) { - if (type.equals(EntityType.PIGLIN)) { - expReward = expMap.get("killPiglin"); - } else if (type.equals(EntityType.ZOGLIN)) { - expReward = expMap.get("killZoglin"); - } else if (type.equals(EntityType.HOGLIN)) { - expReward = expMap.get("killHoglin"); - } else if (type.equals(EntityType.ZOMBIFIED_PIGLIN)) { - expReward = expMap.get("killZombie_Pigman"); - } else if (type.equals(EntityType.STRIDER)) { - expReward = expMap.get("killStrider"); - } - } - ExpFarmTracker expFarmTracker = new ExpFarmTracker(); - double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity,skillName); - increaseStats.changeEXP(skillName,(int) Math.round(expReward*multiplier)); - } - } - } - - public List getBreedingAnimals() { - return breedingAnimals; - } - - public List getHostileMobs() { - return hostileMobs; - } - - public List getAnimals() { - return animals; - } - - public List getBabyAnimals() { - return babyAnimals; - } - - public List getBreedingAnimalsFarming() { - return breedingAnimalsFarming; - } - - public List getThirstMobs() { - return thirstMobs; - } - - public List getHookableEntities() { - return hookableEntities; - } -} diff --git a/src/main/java/mc/carlton/freerpg/globalVariables/ExpMaps.java b/src/main/java/mc/carlton/freerpg/globalVariables/ExpMaps.java deleted file mode 100644 index 7952a69..0000000 --- a/src/main/java/mc/carlton/freerpg/globalVariables/ExpMaps.java +++ /dev/null @@ -1,246 +0,0 @@ -package mc.carlton.freerpg.globalVariables; - -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.MinecraftVersion; -import org.bukkit.Material; - -import java.util.HashMap; -import java.util.Map; - -public class ExpMaps { - private MinecraftVersion minecraftVersion = new MinecraftVersion(); - private double mcVersion = minecraftVersion.getMinecraftVersion_Double(); - - static Map diggingEXP = new HashMap(); - static Map woodcuttingEXP = new HashMap(); - static Map miningEXP = new HashMap(); - static Map farmingEXP = new HashMap(); - static Map flamePickEXP = new HashMap(); - - public void initializeAllExpMaps(){ - initializeDiggingEXP(); - initializeWoodcuttingEXP(); - initializeMiningEXP(); - initializeFarmingEXP(); - initializeFlamePickEXP(); - } - public void initializeDiggingEXP() { - ConfigLoad configLoad = new ConfigLoad(); - Map expMap = configLoad.getExpMapForSkill("digging"); - diggingEXP.put(Material.CLAY, expMap.get("breakClay")); - diggingEXP.put(Material.FARMLAND,expMap.get("breakFarmland")); - diggingEXP.put(Material.GRASS_BLOCK,expMap.get("breakGrassBlock")); - diggingEXP.put(Material.GRASS_PATH,expMap.get("breakGrassPath")); - diggingEXP.put(Material.GRAVEL,expMap.get("breakGravel")); - diggingEXP.put(Material.MYCELIUM,expMap.get("breakMycelium")); - diggingEXP.put(Material.PODZOL,expMap.get("breakPodzol")); - diggingEXP.put(Material.COARSE_DIRT,expMap.get("breakCoarse_Dirt")); - diggingEXP.put(Material.DIRT,expMap.get("breakDirt")); - diggingEXP.put(Material.RED_SAND,expMap.get("breakRed_Sand")); - diggingEXP.put(Material.SAND,expMap.get("breakSand")); - diggingEXP.put(Material.SOUL_SAND,expMap.get("breakSoulSand")); - diggingEXP.put(Material.SNOW_BLOCK,expMap.get("breakSnowBlock")); - diggingEXP.put(Material.SNOW,expMap.get("breakSnow")); - diggingEXP.put(Material.WHITE_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.ORANGE_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.MAGENTA_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.LIGHT_BLUE_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.YELLOW_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.LIME_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.PINK_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.GRAY_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.LIGHT_GRAY_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.CYAN_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.PURPLE_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.BLUE_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.BROWN_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.GREEN_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.RED_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - diggingEXP.put(Material.BLACK_CONCRETE_POWDER,expMap.get("breakConcretePowder")); - if (mcVersion >= 1.16) { - diggingEXP.put(Material.SOUL_SOIL,expMap.get("breakSoulSoil")); - } - } - - public void initializeWoodcuttingEXP() { - ConfigLoad configLoad = new ConfigLoad(); - Map expMap = configLoad.getExpMapForSkill("woodcutting"); - woodcuttingEXP.put(Material.ACACIA_LOG,expMap.get("breakAcacia_Log")); - woodcuttingEXP.put(Material.BIRCH_LOG,expMap.get("breakBirch_Log")); - woodcuttingEXP.put(Material.DARK_OAK_LOG,expMap.get("breakDark_Oak_Log")); - woodcuttingEXP.put(Material.OAK_LOG,expMap.get("breakOak_Log")); - woodcuttingEXP.put(Material.SPRUCE_LOG,expMap.get("breakSpruce_Log")); - woodcuttingEXP.put(Material.JUNGLE_LOG,expMap.get("breakJungle_Log")); - woodcuttingEXP.put(Material.STRIPPED_ACACIA_LOG,expMap.get("breakAcacia_Log")); - woodcuttingEXP.put(Material.STRIPPED_BIRCH_LOG,expMap.get("breakBirch_Log")); - woodcuttingEXP.put(Material.STRIPPED_DARK_OAK_LOG,expMap.get("breakDark_Oak_Log")); - woodcuttingEXP.put(Material.STRIPPED_OAK_LOG,expMap.get("breakOak_Log")); - woodcuttingEXP.put(Material.STRIPPED_SPRUCE_LOG,expMap.get("breakSpruce_Log")); - woodcuttingEXP.put(Material.STRIPPED_JUNGLE_LOG,expMap.get("breakJungle_Log")); - woodcuttingEXP.put(Material.ACACIA_WOOD,expMap.get("breakAcacia_Log")); - woodcuttingEXP.put(Material.BIRCH_WOOD,expMap.get("breakBirch_Log")); - woodcuttingEXP.put(Material.DARK_OAK_WOOD,expMap.get("breakDark_Oak_Log")); - woodcuttingEXP.put(Material.OAK_WOOD,expMap.get("breakOak_Log")); - woodcuttingEXP.put(Material.SPRUCE_WOOD,expMap.get("breakSpruce_Log")); - woodcuttingEXP.put(Material.JUNGLE_WOOD,expMap.get("breakJungle_Log")); - woodcuttingEXP.put(Material.STRIPPED_ACACIA_WOOD,expMap.get("breakAcacia_Log")); - woodcuttingEXP.put(Material.STRIPPED_BIRCH_WOOD,expMap.get("breakBirch_Log")); - woodcuttingEXP.put(Material.STRIPPED_DARK_OAK_WOOD,expMap.get("breakDark_Oak_Log")); - woodcuttingEXP.put(Material.STRIPPED_OAK_WOOD,expMap.get("breakOak_Log")); - woodcuttingEXP.put(Material.STRIPPED_SPRUCE_WOOD,expMap.get("breakSpruce_Log")); - woodcuttingEXP.put(Material.STRIPPED_JUNGLE_WOOD,expMap.get("breakJungle_Log")); - woodcuttingEXP.put(Material.ACACIA_PLANKS,expMap.get("breakAcacia_Plank")); - woodcuttingEXP.put(Material.BIRCH_PLANKS,expMap.get("breakBirch_Plank")); - woodcuttingEXP.put(Material.DARK_OAK_PLANKS,expMap.get("breakDark_Oak_Plank")); - woodcuttingEXP.put(Material.OAK_PLANKS,expMap.get("breakOak_Plank")); - woodcuttingEXP.put(Material.SPRUCE_PLANKS,expMap.get("breakSpruce_Plank")); - woodcuttingEXP.put(Material.JUNGLE_PLANKS,expMap.get("breakJungle_Plank")); - woodcuttingEXP.put(Material.ACACIA_LEAVES,expMap.get("breakAcacia_Leaves")); - woodcuttingEXP.put(Material.BIRCH_LEAVES,expMap.get("breakBirch_Leaves")); - woodcuttingEXP.put(Material.DARK_OAK_LEAVES,expMap.get("breakDark_Oak_Leaves")); - woodcuttingEXP.put(Material.OAK_LEAVES,expMap.get("breakOak_Leaves")); - woodcuttingEXP.put(Material.SPRUCE_LEAVES,expMap.get("breakSpruce_Leaves")); - woodcuttingEXP.put(Material.JUNGLE_LEAVES,expMap.get("breakJungle_Leaves")); - woodcuttingEXP.put(Material.BROWN_MUSHROOM_BLOCK,expMap.get("breakBrown_Mushroom_Block")); - woodcuttingEXP.put(Material.RED_MUSHROOM_BLOCK,expMap.get("breakRed_Mushroom_Block")); - //1.16 Blocks, EXP subject to change - if (mcVersion >= 1.16) { - woodcuttingEXP.put(Material.CRIMSON_STEM, expMap.get("breakCrimson_Stem")); - woodcuttingEXP.put(Material.WARPED_STEM, expMap.get("breakWarped_Stem")); - woodcuttingEXP.put(Material.STRIPPED_CRIMSON_STEM, expMap.get("breakCrimson_Stem")); - woodcuttingEXP.put(Material.STRIPPED_WARPED_STEM, expMap.get("breakWarped_Stem")); - woodcuttingEXP.put(Material.WARPED_PLANKS, expMap.get("breakCrimson_Planks")); - woodcuttingEXP.put(Material.CRIMSON_PLANKS, expMap.get("breakWarped_Planks")); - } - } - - public void initializeMiningEXP() { - ConfigLoad configLoad = new ConfigLoad(); - Map expMap = configLoad.getExpMapForSkill("mining"); - miningEXP.put(Material.ICE,expMap.get("breakIce")); - miningEXP.put(Material.BLUE_ICE,expMap.get("breakBlue_Ice")); - miningEXP.put(Material.PACKED_ICE,expMap.get("breakPacked_Ice")); - miningEXP.put(Material.FROSTED_ICE,expMap.get("breakFrosted_Ice")); - miningEXP.put(Material.ANDESITE,expMap.get("breakAndesite")); - miningEXP.put(Material.COAL_ORE,expMap.get("breakCoal_Ore")); - miningEXP.put(Material.DIORITE,expMap.get("breakDiorite")); - miningEXP.put(Material.END_STONE,expMap.get("breakEnd_Stone")); - miningEXP.put(Material.GRANITE,expMap.get("breakGranite")); - miningEXP.put(Material.NETHERRACK,expMap.get("breakNetherrack")); - miningEXP.put(Material.NETHER_QUARTZ_ORE,expMap.get("breakNether_Quartz_Ore")); - miningEXP.put(Material.MOSSY_COBBLESTONE,expMap.get("breakMossy_Cobblestone")); - miningEXP.put(Material.SANDSTONE,expMap.get("breakSandstone")); - miningEXP.put(Material.RED_SANDSTONE,expMap.get("breakRed_Sandstone")); - miningEXP.put(Material.SPAWNER,expMap.get("breakSpawner")); - miningEXP.put(Material.STONE,expMap.get("breakStone")); - miningEXP.put(Material.TERRACOTTA,expMap.get("breakTerracotta")); - miningEXP.put(Material.RED_TERRACOTTA,expMap.get("breakTerracotta")); - miningEXP.put(Material.ORANGE_TERRACOTTA,expMap.get("breakTerracotta")); - miningEXP.put(Material.YELLOW_TERRACOTTA,expMap.get("breakTerracotta")); - miningEXP.put(Material.BROWN_TERRACOTTA,expMap.get("breakTerracotta")); - miningEXP.put(Material.WHITE_TERRACOTTA,expMap.get("breakTerracotta")); - miningEXP.put(Material.LIGHT_GRAY_TERRACOTTA,expMap.get("breakTerracotta")); - miningEXP.put(Material.IRON_ORE,expMap.get("breakIron_Ore")); - miningEXP.put(Material.REDSTONE_ORE,expMap.get("breakRedstone_Ore")); - miningEXP.put(Material.LAPIS_ORE,expMap.get("breakLapis_Ore")); - miningEXP.put(Material.DIAMOND_ORE,expMap.get("breakDiamond_Ore")); - miningEXP.put(Material.GOLD_ORE,expMap.get("breakGold_Ore")); - miningEXP.put(Material.EMERALD_ORE,expMap.get("breakEmerald_Ore")); - miningEXP.put(Material.OBSIDIAN,expMap.get("breakObsidian")); - miningEXP.put(Material.GLOWSTONE,0); - if (mcVersion >= 1.16) { - miningEXP.put(Material.ANCIENT_DEBRIS, expMap.get("breakAncient_Debris")); - miningEXP.put(Material.NETHER_GOLD_ORE, expMap.get("breakNether_Gold_Ore")); - miningEXP.put(Material.BASALT, expMap.get("breakBasalt")); - miningEXP.put(Material.BLACKSTONE, expMap.get("breakBlackstone")); - miningEXP.put(Material.CRYING_OBSIDIAN, expMap.get("breakCrying_Obsidian")); - miningEXP.put(Material.CRIMSON_NYLIUM, expMap.get("breakCrimson_Nylium")); - miningEXP.put(Material.WARPED_NYLIUM, expMap.get("breakWarped_Nylium")); - miningEXP.put(Material.GILDED_BLACKSTONE, expMap.get("breakGilded_Blackstone")); - } - } - - public void initializeFarmingEXP() { - ConfigLoad configLoad = new ConfigLoad(); - Map expMap = configLoad.getExpMapForSkill("farming"); - farmingEXP.put(Material.WHEAT,expMap.get("breakWheat")); - farmingEXP.put(Material.BEETROOTS,expMap.get("breakBeatRoots")); - farmingEXP.put(Material.CARROTS,expMap.get("breakCarrots")); - farmingEXP.put(Material.POTATOES,expMap.get("breakPotatoes")); - farmingEXP.put(Material.MELON,expMap.get("breakMelon")); - farmingEXP.put(Material.PUMPKIN,expMap.get("breakPumpkin")); - farmingEXP.put(Material.BAMBOO,expMap.get("breakBamboo")); - farmingEXP.put(Material.COCOA,expMap.get("breakCocoa")); - farmingEXP.put(Material.SUGAR_CANE,expMap.get("breakSugarCane")); - farmingEXP.put(Material.CACTUS,expMap.get("breakCactus")); - farmingEXP.put(Material.RED_MUSHROOM,expMap.get("breakRed_Mushroom")); - farmingEXP.put(Material.BROWN_MUSHROOM,expMap.get("breakBrown_Mushroom")); - farmingEXP.put(Material.SWEET_BERRIES,expMap.get("breakSweetBerries")); - farmingEXP.put(Material.KELP,expMap.get("breakKelp")); - farmingEXP.put(Material.SEA_PICKLE,expMap.get("breakSea_Pickle")); - farmingEXP.put(Material.NETHER_WART,expMap.get("breakNether_Wart")); - farmingEXP.put(Material.CHORUS_PLANT,expMap.get("breakChorusPlant")); - } - public void initializeFlamePickEXP() { - ConfigLoad configLoad = new ConfigLoad(); - Map> expMap = configLoad.getExpMap(); - flamePickEXP.put(Material.IRON_ORE,new Object[]{"mining",expMap.get("mining").get("breakIron_Ore")}); - flamePickEXP.put(Material.GOLD_ORE,new Object[]{"mining",expMap.get("mining").get("breakGold_Ore")}); - flamePickEXP.put(Material.COBBLESTONE,new Object[]{"mining",0}); - flamePickEXP.put(Material.STONE,new Object[]{"mining",expMap.get("mining").get("breakStone")}); - flamePickEXP.put(Material.SANDSTONE,new Object[]{"mining",expMap.get("mining").get("breakSandstone")}); - flamePickEXP.put(Material.RED_SANDSTONE,new Object[]{"mining",expMap.get("mining").get("breakRed_Sandstone")}); - flamePickEXP.put(Material.SAND,new Object[]{"digging",expMap.get("digging").get("breakSand")}); - flamePickEXP.put(Material.QUARTZ_BLOCK,new Object[]{"mining",0}); - flamePickEXP.put(Material.NETHERRACK,new Object[]{"mining",expMap.get("mining").get("breakNetherrack")}); - flamePickEXP.put(Material.CLAY,new Object[]{"digging",expMap.get("digging").get("breakClay")}); - flamePickEXP.put(Material.STONE_BRICKS,new Object[]{"mining",0}); - flamePickEXP.put(Material.WET_SPONGE,new Object[]{"mining",0}); - flamePickEXP.put(Material.CACTUS,new Object[]{"farming",expMap.get("farming").get("breakCactus")}); - flamePickEXP.put(Material.JUNGLE_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakJungle_Log")}); - flamePickEXP.put(Material.SPRUCE_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakSpruce_Log")}); - flamePickEXP.put(Material.OAK_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakOak_Log")}); - flamePickEXP.put(Material.DARK_OAK_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakDark_Oak_Log")}); - flamePickEXP.put(Material.BIRCH_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakBirch_Log")}); - flamePickEXP.put(Material.ACACIA_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakAcacia_Log")}); - flamePickEXP.put(Material.STRIPPED_JUNGLE_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakJungle_Log")}); - flamePickEXP.put(Material.STRIPPED_SPRUCE_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakSpruce_Log")}); - flamePickEXP.put(Material.STRIPPED_OAK_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakOak_Log")}); - flamePickEXP.put(Material.STRIPPED_DARK_OAK_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakDark_Oak_Log")}); - flamePickEXP.put(Material.STRIPPED_BIRCH_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakBirch_Log")}); - flamePickEXP.put(Material.STRIPPED_ACACIA_LOG,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakAcacia_Log")}); - flamePickEXP.put(Material.JUNGLE_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakJungle_Log")}); - flamePickEXP.put(Material.SPRUCE_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakSpruce_Log")}); - flamePickEXP.put(Material.OAK_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakOak_Log")}); - flamePickEXP.put(Material.DARK_OAK_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakDark_Oak_Log")}); - flamePickEXP.put(Material.BIRCH_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakBirch_Log")}); - flamePickEXP.put(Material.ACACIA_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakAcacia_Log")}); - flamePickEXP.put(Material.STRIPPED_JUNGLE_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakJungle_Log")}); - flamePickEXP.put(Material.STRIPPED_SPRUCE_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakSpruce_Log")}); - flamePickEXP.put(Material.STRIPPED_OAK_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakOak_Log")}); - flamePickEXP.put(Material.STRIPPED_DARK_OAK_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakDark_Oak_Log")}); - flamePickEXP.put(Material.STRIPPED_BIRCH_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakBirch_Log")}); - flamePickEXP.put(Material.STRIPPED_ACACIA_WOOD,new Object[]{"woodcutting",expMap.get("woodcutting").get("breakAcacia_Log")}); - if (mcVersion >= 1.16) { - flamePickEXP.put(Material.NETHER_GOLD_ORE,new Object[]{"mining",expMap.get("mining").get("breakNether_Gold_Ore")}); - flamePickEXP.put(Material.ANCIENT_DEBRIS,new Object[]{"mining",expMap.get("mining").get("breakAncient_Debris")}); - } - } - - - public Map getDiggingEXP() { - return diggingEXP; - } - public Map getWoodcuttingEXP() { - return woodcuttingEXP; - } - public Map getMiningEXP() { - return miningEXP; - } - public Map getFarmingEXP() { - return farmingEXP; - } - public Map getFlamePickEXP() { - return flamePickEXP; - } -} diff --git a/src/main/java/mc/carlton/freerpg/globalVariables/ItemGroups.java b/src/main/java/mc/carlton/freerpg/globalVariables/ItemGroups.java deleted file mode 100644 index c45946a..0000000 --- a/src/main/java/mc/carlton/freerpg/globalVariables/ItemGroups.java +++ /dev/null @@ -1,913 +0,0 @@ -package mc.carlton.freerpg.globalVariables; - -import mc.carlton.freerpg.customContainers.OldCustomPotion; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.MinecraftVersion; -import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.potion.PotionData; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.potion.PotionType; - -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - -public class ItemGroups { - private MinecraftVersion minecraftVersion = new MinecraftVersion(); - private double mcVersion = minecraftVersion.getMinecraftVersion_Double(); - - static List newIngredients = new ArrayList<>(); - static List oldIngredients = new ArrayList<>(); - static ItemStack hastePotion; - static ItemStack fatiguePotion; - static ItemStack heroPotion; - static ItemStack decayPotion; - static ItemStack resistancePotion; - static List leftClickItems; - static List pickaxes; - static List axes; - static List shovels; - static List hoes; - static List swords; - static List noRightClick; - static List actionableBlocks; - static List harmfulEffects; - static List logs; - static List tallCrops; - static Map trackedBlocks = new ConcurrentHashMap<>(); - static Map enchantmentLevelMap = new HashMap<>(); - static List crops; - static Map farmFood = new HashMap(); - static Map meatFood = new HashMap(); - static Map farmFoodSaturation = new HashMap(); - static Map meatFoodSaturation = new HashMap(); - static Map fishFood = new HashMap(); - static Map fishFoodSaturation = new HashMap(); - static List valuableItems; - static List ores; - static List flamePickOres; - static HashSet veinMinerBlocks = new HashSet<>(); - static Map repairItems = new HashMap<>(); - static Map repairItemsAmount = new HashMap<>(); - static List strippedLogs; - static List wood; - static List strippedWood; - static ArrayList allLogs = new ArrayList<>(); - static List leaves; - static Map effectArrows = new HashMap<>(); - static Map smeltableItemsMap = new HashMap<>(); - static Map smeltingXPMap = new HashMap<>(); - - - public void initializeItemGroups(){ - initializeRepairItems(); - initializeIngredients(); - initializeCustomPostions(); - initializeLeftClickItems(); - initializeTools(); - initializeActionItems(); - initializeHarmfulPotions(); - initializeBlocks(); - initializeEnchantmentLevelMap(); - initializeFoodMaps(); - initializeValuableItems(); - initalizeArrows(); - initializeSmeltableItemsMap(); - initializeSmeltingXPMap(); - initializeTrackedBlocks(); - } - - public void initializeEnchantmentLevelMap() { - enchantmentLevelMap.put(Enchantment.ARROW_KNOCKBACK, 2); - enchantmentLevelMap.put(Enchantment.ARROW_DAMAGE, 5); - enchantmentLevelMap.put(Enchantment.ARROW_FIRE, 1); - enchantmentLevelMap.put(Enchantment.ARROW_INFINITE, 1); - enchantmentLevelMap.put(Enchantment.BINDING_CURSE, 1); - enchantmentLevelMap.put(Enchantment.CHANNELING, 1); - enchantmentLevelMap.put(Enchantment.DAMAGE_ALL, 4); - enchantmentLevelMap.put(Enchantment.DAMAGE_ARTHROPODS, 4); - enchantmentLevelMap.put(Enchantment.DAMAGE_UNDEAD, 4); - enchantmentLevelMap.put(Enchantment.DEPTH_STRIDER, 2); - enchantmentLevelMap.put(Enchantment.DIG_SPEED, 4); - enchantmentLevelMap.put(Enchantment.DURABILITY, 3); - enchantmentLevelMap.put(Enchantment.FIRE_ASPECT, 2); - enchantmentLevelMap.put(Enchantment.FROST_WALKER, 2); - enchantmentLevelMap.put(Enchantment.IMPALING, 4); - enchantmentLevelMap.put(Enchantment.KNOCKBACK, 2); - enchantmentLevelMap.put(Enchantment.LOOT_BONUS_BLOCKS, 3); - enchantmentLevelMap.put(Enchantment.LUCK, 3); - enchantmentLevelMap.put(Enchantment.LOOT_BONUS_MOBS, 3); - enchantmentLevelMap.put(Enchantment.LOYALTY, 3); - enchantmentLevelMap.put(Enchantment.LURE, 3); - enchantmentLevelMap.put(Enchantment.MENDING, 1); - enchantmentLevelMap.put(Enchantment.MULTISHOT, 1); - enchantmentLevelMap.put(Enchantment.OXYGEN, 3); - enchantmentLevelMap.put(Enchantment.PIERCING, 4); - enchantmentLevelMap.put(Enchantment.PROTECTION_ENVIRONMENTAL, 4); - enchantmentLevelMap.put(Enchantment.PROTECTION_EXPLOSIONS, 4); - enchantmentLevelMap.put(Enchantment.PROTECTION_FALL, 4); - enchantmentLevelMap.put(Enchantment.PROTECTION_FIRE, 4); - enchantmentLevelMap.put(Enchantment.PROTECTION_PROJECTILE, 4); - enchantmentLevelMap.put(Enchantment.QUICK_CHARGE, 3); - enchantmentLevelMap.put(Enchantment.RIPTIDE, 3); - enchantmentLevelMap.put(Enchantment.SILK_TOUCH, 1); - enchantmentLevelMap.put(Enchantment.SWEEPING_EDGE, 3); - enchantmentLevelMap.put(Enchantment.THORNS, 3); - enchantmentLevelMap.put(Enchantment.VANISHING_CURSE, 1); - enchantmentLevelMap.put(Enchantment.WATER_WORKER, 1); - } - - public void initializeTrackedBlocks() { - Material[] trackedBlocks0 = new Material[]{Material.ACACIA_LOG, Material.ACACIA_LEAVES, Material.BIRCH_LOG, Material.BIRCH_LEAVES, - Material.DARK_OAK_LOG, Material.DARK_OAK_LEAVES, Material.JUNGLE_LOG, Material.JUNGLE_LEAVES, - Material.OAK_LOG, Material.OAK_LEAVES, Material.SPRUCE_LOG, Material.SPRUCE_LEAVES, - Material.COAL_ORE, Material.DIAMOND_ORE, Material.EMERALD_ORE, Material.GOLD_ORE, - Material.IRON_ORE, Material.LAPIS_ORE, Material.NETHER_QUARTZ_ORE, Material.REDSTONE_ORE, - Material.SUGAR_CANE, Material.MELON, Material.PUMPKIN, Material.RED_MUSHROOM, Material.BROWN_MUSHROOM, - Material.BAMBOO, Material.CACTUS, Material.SPAWNER}; - List trackedBlocks1 = new LinkedList<>(Arrays.asList(trackedBlocks0)); - if (mcVersion >= 1.16) { - Material[] trackedBlocks_v1_16 = {Material.ANCIENT_DEBRIS, Material.NETHER_GOLD_ORE, Material.WARPED_STEM, Material.CRIMSON_STEM, - Material.GILDED_BLACKSTONE}; - List trackedBlocks_append = Arrays.asList(trackedBlocks_v1_16); - trackedBlocks1.addAll(trackedBlocks_append); - } - for (Material mat : trackedBlocks1) { - trackedBlocks.putIfAbsent(mat,true); - } - ConfigLoad configLoad = new ConfigLoad(); - ExpMaps expMaps = new ExpMaps(); - if (!configLoad.isTrackFewerBlocks()) { - for (Material mat : expMaps.getWoodcuttingEXP().keySet()) { - trackedBlocks.putIfAbsent(mat,true); - } - for (Material mat : expMaps.getDiggingEXP().keySet()) { - trackedBlocks.putIfAbsent(mat,true); - } - for (Material mat : expMaps.getFlamePickEXP().keySet()) { - trackedBlocks.putIfAbsent(mat,true); - } - for (Material mat : expMaps.getMiningEXP().keySet()) { - trackedBlocks.putIfAbsent(mat,true); - } - } - } - - public void initializeBlocks() { - Material[] tallCrops0 = {Material.SUGAR_CANE,Material.BAMBOO,Material.CACTUS,Material.KELP,Material.KELP_PLANT}; - tallCrops = Arrays.asList(tallCrops0); - Material[] logs0 = {Material.ACACIA_LOG,Material.BIRCH_LOG,Material.DARK_OAK_LOG,Material.OAK_LOG,Material.SPRUCE_LOG,Material.JUNGLE_LOG, - Material.STRIPPED_ACACIA_LOG,Material.STRIPPED_BIRCH_LOG,Material.STRIPPED_DARK_OAK_LOG,Material.STRIPPED_JUNGLE_LOG, - Material.STRIPPED_OAK_LOG,Material.STRIPPED_SPRUCE_LOG}; - logs = new LinkedList<>(Arrays.asList(logs0)); - if (mcVersion >= 1.16) { - Material[] logs_append0 = {Material.CRIMSON_STEM,Material.WARPED_STEM, Material.STRIPPED_CRIMSON_STEM,Material.STRIPPED_WARPED_STEM}; - List logs_append = Arrays.asList(logs_append0); - logs.addAll(logs_append); - } - - Material[] crops0 = {Material.WHEAT,Material.BEETROOTS,Material.CARROTS,Material.CHORUS_FLOWER,Material.MELON_STEM,Material.MELON, - Material.NETHER_WART,Material.POTATOES,Material.PUMPKIN_STEM,Material.PUMPKIN,Material.SWEET_BERRY_BUSH,Material.COCOA}; - crops = Arrays.asList(crops0); - Material[] ores0 = {Material.REDSTONE_ORE,Material.NETHER_QUARTZ_ORE,Material.LAPIS_ORE,Material.IRON_ORE,Material.GOLD_ORE, - Material.EMERALD_ORE,Material.DIAMOND_ORE,Material.COAL_ORE}; - ores = new LinkedList<>(Arrays.asList(ores0)); - if (mcVersion >= 1.16) { - Material[] ores_append0 = {Material.NETHER_GOLD_ORE,Material.ANCIENT_DEBRIS,Material.GILDED_BLACKSTONE}; - List ores_append = Arrays.asList(ores_append0); - ores.addAll(ores_append); - } - Material[] flamePickOres0 = {Material.IRON_ORE,Material.GOLD_ORE}; - flamePickOres = new LinkedList<>(Arrays.asList(flamePickOres0)); - if (mcVersion >= 1.16) { - Material[] flamePickOres_append0 = {Material.NETHER_GOLD_ORE,Material.ANCIENT_DEBRIS}; - List flamePickOres_append = Arrays.asList(flamePickOres_append0); - flamePickOres.addAll(flamePickOres_append); - } - Material[] strippedLogs0 = {Material.STRIPPED_SPRUCE_LOG,Material.STRIPPED_OAK_LOG,Material.STRIPPED_JUNGLE_LOG,Material.STRIPPED_DARK_OAK_LOG,Material.STRIPPED_BIRCH_LOG,Material.STRIPPED_ACACIA_LOG}; - strippedLogs = Arrays.asList(strippedLogs0); - Material[] wood0 = {Material.SPRUCE_WOOD,Material.OAK_WOOD,Material.JUNGLE_WOOD,Material.DARK_OAK_WOOD,Material.BIRCH_WOOD,Material.ACACIA_WOOD}; - wood = Arrays.asList(wood0); - Material[] strippedWood0 = {Material.STRIPPED_SPRUCE_WOOD,Material.STRIPPED_OAK_WOOD,Material.STRIPPED_JUNGLE_WOOD,Material.STRIPPED_DARK_OAK_WOOD,Material.STRIPPED_BIRCH_WOOD,Material.STRIPPED_ACACIA_WOOD}; - strippedWood = Arrays.asList(strippedWood0); - allLogs.addAll(logs); - allLogs.addAll(strippedLogs); - allLogs.addAll(wood); - allLogs.addAll(strippedWood); - Material[] leaves0 = {Material.ACACIA_LEAVES,Material.BIRCH_LEAVES,Material.DARK_OAK_LEAVES,Material.OAK_LEAVES,Material.SPRUCE_LEAVES,Material.JUNGLE_LEAVES}; - leaves = Arrays.asList(leaves0); - - ConfigLoad configLoad = new ConfigLoad(); - veinMinerBlocks = configLoad.getVeinMinerBlocks(); - } - - public void initializeHarmfulPotions(){ - PotionEffectType[] harmfulEffects0 = {PotionEffectType.WEAKNESS,PotionEffectType.POISON,PotionEffectType.BLINDNESS,PotionEffectType.HUNGER, - PotionEffectType.HARM,PotionEffectType.SLOW_DIGGING,PotionEffectType.SLOW,PotionEffectType.WEAKNESS,PotionEffectType.WITHER}; - harmfulEffects = Arrays.asList(harmfulEffects0); - } - - public void initializeActionItems() { - Material[] noRightClick0 = {Material.AIR,Material.ARROW,Material.SPECTRAL_ARROW, Material.TIPPED_ARROW,Material.BLAZE_POWDER, - Material.BLAZE_ROD, Material.BONE,Material.BOOK,Material.BOWL, Material.CHARCOAL, - Material.COAL,Material.CLAY,Material.BRICK,Material.COMPASS,Material.DIAMOND_HORSE_ARMOR,Material.DRAGON_BREATH, - Material.MAP,Material.ENCHANTED_BOOK,Material.FEATHER,Material.FERMENTED_SPIDER_EYE,Material.FIREWORK_STAR, - Material.FLINT,Material.GHAST_TEAR,Material.GLISTERING_MELON_SLICE,Material.GLOWSTONE_DUST,Material.GOLDEN_HORSE_ARMOR, - Material.GOLD_NUGGET,Material.GOLD_INGOT,Material.GUNPOWDER,Material.INK_SAC,Material.IRON_HORSE_ARMOR, - Material.MAGMA_CREAM,Material.NETHER_BRICK,Material.NETHER_WART,Material.PAPER,Material.PRISMARINE_SHARD,Material.PRISMARINE_CRYSTALS, - Material.RABBIT_HIDE,Material.LEATHER,Material.LEATHER_HORSE_ARMOR,Material.RABBIT_FOOT,Material.SADDLE,Material.SHEARS, - Material.SLIME_BALL,Material.SHULKER_SHELL,Material.SPIDER_EYE,Material.STICK,Material.STRING,Material.TOTEM_OF_UNDYING, - Material.CLOCK,Material.WRITTEN_BOOK}; - noRightClick = Arrays.asList(noRightClick0); - Material[] actionableBlocks0 = {Material.ANVIL, Material.BLACK_BED, Material.BLUE_BED, Material.BROWN_BED, Material.CYAN_BED, Material.GRAY_BED, - Material.GREEN_BED,Material.LIGHT_BLUE_BED,Material.LIGHT_GRAY_BED,Material.LIME_BED,Material.MAGENTA_BED, - Material.ORANGE_BED,Material.PINK_BED,Material.PURPLE_BED,Material.RED_BED,Material.WHITE_BED,Material.YELLOW_BED, - Material.BELL,Material.BLAST_FURNACE,Material.BREWING_STAND,Material.CARTOGRAPHY_TABLE,Material.CHEST,Material.COMPOSTER, - Material.CRAFTING_TABLE,Material.ACACIA_DOOR,Material.BIRCH_DOOR,Material.DARK_OAK_DOOR,Material.IRON_DOOR,Material.JUNGLE_DOOR, - Material.OAK_DOOR,Material.SPRUCE_DOOR,Material.ENCHANTING_TABLE,Material.ACACIA_FENCE_GATE,Material.BIRCH_FENCE_GATE, - Material.DARK_OAK_FENCE_GATE,Material.JUNGLE_FENCE_GATE,Material.OAK_FENCE_GATE,Material.SPRUCE_FENCE_GATE,Material.FURNACE, - Material.GRINDSTONE,Material.JUKEBOX,Material.LECTERN,Material.LOOM,Material.NOTE_BLOCK,Material.SMOKER,Material.STONECUTTER, - Material.TRAPPED_CHEST,Material.ACACIA_TRAPDOOR,Material.BIRCH_TRAPDOOR,Material.DARK_OAK_TRAPDOOR,Material.IRON_TRAPDOOR, - Material.JUNGLE_TRAPDOOR,Material.OAK_TRAPDOOR,Material.SPRUCE_TRAPDOOR,Material.BARREL,Material.ACACIA_BUTTON,Material.BIRCH_BUTTON, - Material.DARK_OAK_BUTTON,Material.OAK_BUTTON,Material.JUNGLE_BUTTON,Material.SPRUCE_BUTTON,Material.STONE_BUTTON,Material.REPEATER, - Material.COMPARATOR,Material.HOPPER,Material.HOPPER_MINECART,Material.DAYLIGHT_DETECTOR,Material.LEVER,Material.FURNACE_MINECART, - Material.DISPENSER,Material.DROPPER,Material.CHIPPED_ANVIL,Material.DAMAGED_ANVIL,Material.SHULKER_BOX,Material.ENDER_CHEST,Material.BLACK_SHULKER_BOX, - Material.BLUE_SHULKER_BOX,Material.BROWN_SHULKER_BOX,Material.CYAN_SHULKER_BOX,Material.GRAY_SHULKER_BOX,Material.GREEN_SHULKER_BOX,Material.LIGHT_BLUE_SHULKER_BOX, - Material.LIGHT_GRAY_SHULKER_BOX,Material.LIME_SHULKER_BOX,Material.MAGENTA_SHULKER_BOX, Material.RED_SHULKER_BOX,Material.WHITE_SHULKER_BOX,Material.YELLOW_SHULKER_BOX, - Material.ORANGE_SHULKER_BOX, Material.PURPLE_SHULKER_BOX,Material.PINK_SHULKER_BOX}; - actionableBlocks = Arrays.asList(actionableBlocks0); - } - - public void initializeTools() { - Material[] pickaxes0 = {Material.DIAMOND_PICKAXE, Material.GOLDEN_PICKAXE, Material.IRON_PICKAXE, Material.STONE_PICKAXE, Material.WOODEN_PICKAXE}; - pickaxes = new LinkedList<>(Arrays.asList(pickaxes0)); - Material[] axes0 = {Material.DIAMOND_AXE,Material.GOLDEN_AXE,Material.IRON_AXE, Material.STONE_AXE,Material.WOODEN_AXE}; - axes = new LinkedList<>(Arrays.asList(axes0)); - Material[] shovels0 = {Material.DIAMOND_SHOVEL,Material.GOLDEN_SHOVEL,Material.IRON_SHOVEL, Material.STONE_SHOVEL,Material.WOODEN_SHOVEL}; - shovels = new LinkedList<>(Arrays.asList(shovels0)); - Material[] hoes0 = {Material.DIAMOND_HOE,Material.GOLDEN_HOE,Material.IRON_HOE, Material.STONE_HOE,Material.WOODEN_HOE}; - hoes = new LinkedList<>(Arrays.asList(hoes0)); - Material[] swords0 = {Material.WOODEN_SWORD,Material.STONE_SWORD,Material.GOLDEN_SWORD,Material.DIAMOND_SWORD,Material.IRON_SWORD}; - swords = new LinkedList<>(Arrays.asList(swords0)); - if (mcVersion >= 1.16) { - pickaxes.add(Material.NETHERITE_PICKAXE); - axes.add(Material.NETHERITE_AXE); - shovels.add(Material.NETHERITE_SHOVEL); - hoes.add(Material.NETHERITE_HOE); - swords.add(Material.NETHERITE_SWORD); - } - } - - public void initializeLeftClickItems(){ - Material[] leftClickItems0 = {Material.IRON_SWORD,Material.DIAMOND_SWORD,Material.GOLDEN_SWORD,Material.STONE_SWORD,Material.WOODEN_SWORD, - Material.IRON_PICKAXE,Material.DIAMOND_PICKAXE,Material.STONE_PICKAXE,Material.GOLDEN_PICKAXE,Material.WOODEN_PICKAXE, - Material.IRON_SHOVEL,Material.DIAMOND_SHOVEL,Material.GOLDEN_SHOVEL,Material.STONE_SHOVEL,Material.WOODEN_SHOVEL, - Material.IRON_AXE,Material.DIAMOND_AXE,Material.GOLDEN_AXE,Material.STONE_AXE,Material.WOODEN_AXE, - Material.BOW,Material.CROSSBOW}; - leftClickItems = new LinkedList<>(Arrays.asList(leftClickItems0)); - if (mcVersion >= 1.16) { - Material[] leftClickItems_append0 = {Material.NETHERITE_SWORD,Material.NETHERITE_SHOVEL,Material.NETHERITE_AXE,Material.NETHERITE_PICKAXE}; - List leftClickItems_append = Arrays.asList(leftClickItems_append0); - leftClickItems.addAll(leftClickItems_append); - } - } - - public void initializeIngredients() { - ConfigLoad configLoad = new ConfigLoad(); - Map alchemyInfo = configLoad.getAlchemyInfo(); - Material[] newIngredients0 = {alchemyInfo.get("customPotion1").getIngredient(),alchemyInfo.get("customPotion2").getIngredient(),alchemyInfo.get("customPotion3").getIngredient(), - alchemyInfo.get("customPotion4").getIngredient(),alchemyInfo.get("customPotion5").getIngredient()}; - newIngredients = Arrays.asList(newIngredients0); - Material[] oldIngredients0 = {Material.NETHER_WART,Material.GUNPOWDER,Material.GLOWSTONE_DUST,Material.SPIDER_EYE,Material.GHAST_TEAR, - Material.RABBIT_FOOT,Material.BLAZE_POWDER,Material.GLISTERING_MELON_SLICE,Material.SUGAR,Material.MAGMA_CREAM, - Material.REDSTONE, Material.PUFFERFISH, Material.GOLDEN_CARROT,Material.TURTLE_HELMET,Material.PHANTOM_MEMBRANE, - Material.FERMENTED_SPIDER_EYE}; - oldIngredients = Arrays.asList(oldIngredients0); - } - - public void initializeCustomPostions() { - ConfigLoad configLoad = new ConfigLoad(); - Map alchemyInfo = configLoad.getAlchemyInfo(); - - //Hero Potion - heroPotion = alchemyInfo.get("customPotion1").getPotionItemStack(); - - //Mining Fatigue Potion - fatiguePotion = alchemyInfo.get("customPotion2").getPotionItemStack(); - - //Haste Potion - hastePotion = alchemyInfo.get("customPotion3").getPotionItemStack(); - - //decay Potion - decayPotion = alchemyInfo.get("customPotion4").getPotionItemStack(); - - //resistance Potion - resistancePotion = alchemyInfo.get("customPotion5").getPotionItemStack(); - } - - public void initializeFoodMaps(){ - farmFood.put(Material.GOLDEN_APPLE,4); - farmFoodSaturation.put(Material.GOLDEN_APPLE,13.6); - farmFood.put(Material.GOLDEN_CARROT,6); - farmFoodSaturation.put(Material.GOLDEN_CARROT,14.4); - farmFood.put(Material.BAKED_POTATO,5); - farmFoodSaturation.put(Material.BAKED_POTATO,6.0); - farmFood.put(Material.BEETROOT,1); - farmFoodSaturation.put(Material.BEETROOT,1.2); - farmFood.put(Material.BEETROOT_SOUP,6); - farmFoodSaturation.put(Material.BEETROOT_SOUP,7.2); - farmFood.put(Material.BREAD,5); - farmFoodSaturation.put(Material.BREAD,6.0); - farmFood.put(Material.CARROT,3); - farmFoodSaturation.put(Material.CARROT,3.6); - farmFood.put(Material.MUSHROOM_STEW,6); - farmFoodSaturation.put(Material.MUSHROOM_STEW,13.2); - farmFood.put(Material.APPLE,4); - farmFoodSaturation.put(Material.APPLE,2.4); - farmFood.put(Material.CHORUS_FRUIT,4); - farmFoodSaturation.put(Material.CHORUS_FRUIT,2.4); - farmFood.put(Material.DRIED_KELP,1); - farmFoodSaturation.put(Material.DRIED_KELP,0.6); - farmFood.put(Material.MELON_SLICE,2); - farmFoodSaturation.put(Material.MELON_SLICE,1.2); - farmFood.put(Material.POTATO,1); - farmFoodSaturation.put(Material.POTATO,0.6); - farmFood.put(Material.PUMPKIN_PIE,8); - farmFoodSaturation.put(Material.PUMPKIN_PIE,4.8); - farmFood.put(Material.CAKE,2); - farmFoodSaturation.put(Material.CAKE,0.4); - farmFood.put(Material.COOKIE,2); - farmFoodSaturation.put(Material.COOKIE,0.4); - farmFood.put(Material.HONEY_BOTTLE,6); - farmFoodSaturation.put(Material.HONEY_BOTTLE,1.2); - farmFood.put(Material.SWEET_BERRIES,2); - farmFoodSaturation.put(Material.SWEET_BERRIES,0.4); - - meatFood.put(Material.COOKED_MUTTON,6); - meatFoodSaturation.put(Material.COOKED_MUTTON,9.6); - meatFood.put(Material.COOKED_PORKCHOP,8); - meatFoodSaturation.put(Material.COOKED_PORKCHOP,12.8); - meatFood.put(Material.COOKED_BEEF,8); - meatFoodSaturation.put(Material.COOKED_BEEF,12.8); - meatFood.put(Material.COOKED_CHICKEN,6); - meatFoodSaturation.put(Material.COOKED_CHICKEN,7.2); - meatFood.put(Material.COOKED_RABBIT,5); - meatFoodSaturation.put(Material.COOKED_RABBIT,6.0); - meatFood.put(Material.RABBIT_STEW,10); - meatFoodSaturation.put(Material.RABBIT_STEW,12.0); - meatFood.put(Material.BEEF,3); - meatFoodSaturation.put(Material.BEEF,1.8); - meatFood.put(Material.MUTTON,2); - meatFoodSaturation.put(Material.MUTTON,1.2); - meatFood.put(Material.PORKCHOP,3); - meatFoodSaturation.put(Material.PORKCHOP,1.8); - meatFood.put(Material.RABBIT,3); - meatFoodSaturation.put(Material.RABBIT,1.8); - meatFood.put(Material.CHICKEN,2); - meatFoodSaturation.put(Material.CHICKEN,1.2); - meatFood.put(Material.ROTTEN_FLESH,4); - meatFoodSaturation.put(Material.ROTTEN_FLESH,0.8); - - fishFood.put(Material.COOKED_SALMON,6); - fishFoodSaturation.put(Material.COOKED_SALMON,1.6); - fishFood.put(Material.COOKED_COD,5); - fishFoodSaturation.put(Material.COOKED_COD,1.2); - fishFood.put(Material.COD,2); - fishFoodSaturation.put(Material.COD,0.4); - fishFood.put(Material.SALMON,2); - fishFoodSaturation.put(Material.SALMON,0.4); - fishFood.put(Material.TROPICAL_FISH,1); - fishFoodSaturation.put(Material.TROPICAL_FISH,0.2); - fishFood.put(Material.PUFFERFISH,1); - fishFoodSaturation.put(Material.PUFFERFISH,0.2); - fishFood.put(Material.DRIED_KELP,1); - fishFoodSaturation.put(Material.DRIED_KELP,0.6); - } - - public void initializeValuableItems() { - Material[] valuableItems0 = {Material.IRON_ORE,Material.GOLD_ORE,Material.DIAMOND_ORE,Material.EMERALD_ORE,Material.REDSTONE_ORE,Material.LAPIS_ORE, - Material.IRON_BLOCK,Material.GOLD_BLOCK,Material.DIAMOND_BLOCK,Material.EMERALD_BLOCK,Material.REDSTONE_BLOCK,Material.LAPIS_BLOCK, - Material.SLIME_BLOCK,Material.SPONGE,Material.NETHER_QUARTZ_ORE,Material.NETHER_WART_BLOCK,Material.DRAGON_EGG,Material.SHULKER_BOX, - Material.ENCHANTING_TABLE,Material.ANVIL,Material.BEACON,Material.BREWING_STAND,Material.CAKE,Material.JUKEBOX, - Material.TNT,Material.CREEPER_HEAD,Material.DRAGON_HEAD,Material.PLAYER_HEAD,Material.ZOMBIE_HEAD,Material.SKELETON_SKULL,Material.WITHER_SKELETON_SKULL, - Material.ENDER_EYE,Material.ENDER_PEARL,Material.FIREWORK_ROCKET,Material.FIRE_CHARGE,Material.POTION,Material.SPLASH_POTION,Material.LINGERING_POTION, - Material.NETHER_WART,Material.REDSTONE,Material.TRIDENT,Material.DIAMOND_AXE,Material.DIAMOND_BOOTS,Material.DIAMOND_CHESTPLATE, - Material.DIAMOND_HELMET,Material.DIAMOND_HOE,Material.DIAMOND_LEGGINGS,Material.DIAMOND_PICKAXE,Material.DIAMOND_SHOVEL,Material.DIAMOND_SWORD, - Material.ELYTRA,Material.ENCHANTED_BOOK,Material.ENCHANTED_GOLDEN_APPLE,Material.GOLDEN_APPLE,Material.IRON_INGOT, - Material.MUSIC_DISC_11, Material.MUSIC_DISC_13, Material.MUSIC_DISC_BLOCKS, Material.MUSIC_DISC_CAT, - Material.MUSIC_DISC_CHIRP, Material.MUSIC_DISC_FAR, Material.MUSIC_DISC_MALL, Material.MUSIC_DISC_MELLOHI, - Material.MUSIC_DISC_STAL, Material.MUSIC_DISC_STRAD, Material.MUSIC_DISC_WAIT, Material.MUSIC_DISC_WARD, - Material.NAME_TAG,Material.TIPPED_ARROW,Material.TOTEM_OF_UNDYING,Material.SPECTRAL_ARROW,Material.DIAMOND,Material.GOLD_INGOT, - Material.HEART_OF_THE_SEA,Material.DRAGON_BREATH,Material.EMERALD,Material.NAUTILUS_SHELL,Material.NETHER_STAR,Material.SLIME_BALL, - Material.RABBIT_FOOT}; - valuableItems = new LinkedList<>(Arrays.asList(valuableItems0)); - if (mcVersion >= 1.16) { - Material[] valuableItems_append0 = {Material.NETHERITE_SWORD,Material.NETHERITE_HOE,Material.NETHERITE_SHOVEL,Material.NETHERITE_AXE,Material.NETHERITE_PICKAXE,Material.NETHER_GOLD_ORE, - Material.NETHERITE_BLOCK,Material.NETHERITE_BOOTS,Material.NETHERITE_CHESTPLATE,Material.NETHERITE_HELMET,Material.NETHERITE_INGOT,Material.NETHERITE_LEGGINGS, - Material.NETHERITE_SCRAP,Material.ANCIENT_DEBRIS}; - List valueableItems_append = Arrays.asList(valuableItems_append0); - valuableItems.addAll(valueableItems_append); - } - } - - public void initializeRepairItems() { - repairItems.put(Material.WOODEN_AXE,Material.STICK); - repairItems.put(Material.WOODEN_HOE,Material.STICK); - repairItems.put(Material.WOODEN_PICKAXE,Material.STICK); - repairItems.put(Material.WOODEN_SWORD,Material.STICK); - repairItems.put(Material.WOODEN_SHOVEL,Material.STICK); - repairItems.put(Material.LEATHER_HELMET,Material.LEATHER); - repairItems.put(Material.LEATHER_CHESTPLATE,Material.LEATHER); - repairItems.put(Material.LEATHER_LEGGINGS,Material.LEATHER); - repairItems.put(Material.LEATHER_BOOTS,Material.LEATHER); - repairItems.put(Material.IRON_AXE,Material.IRON_INGOT); - repairItems.put(Material.IRON_HOE,Material.IRON_INGOT); - repairItems.put(Material.IRON_PICKAXE,Material.IRON_INGOT); - repairItems.put(Material.IRON_SWORD,Material.IRON_INGOT); - repairItems.put(Material.IRON_SHOVEL,Material.IRON_INGOT); - repairItems.put(Material.IRON_HELMET,Material.IRON_INGOT); - repairItems.put(Material.IRON_CHESTPLATE,Material.IRON_INGOT); - repairItems.put(Material.IRON_LEGGINGS,Material.IRON_INGOT); - repairItems.put(Material.IRON_BOOTS,Material.IRON_INGOT); - repairItems.put(Material.GOLDEN_AXE,Material.GOLD_INGOT); - repairItems.put(Material.GOLDEN_HOE,Material.GOLD_INGOT); - repairItems.put(Material.GOLDEN_PICKAXE,Material.GOLD_INGOT); - repairItems.put(Material.GOLDEN_SWORD,Material.GOLD_INGOT); - repairItems.put(Material.GOLDEN_SHOVEL,Material.GOLD_INGOT); - repairItems.put(Material.GOLDEN_HELMET,Material.GOLD_INGOT); - repairItems.put(Material.GOLDEN_CHESTPLATE,Material.GOLD_INGOT); - repairItems.put(Material.GOLDEN_LEGGINGS,Material.GOLD_INGOT); - repairItems.put(Material.GOLDEN_BOOTS,Material.GOLD_INGOT); - repairItems.put(Material.STONE_AXE,Material.COBBLESTONE); - repairItems.put(Material.STONE_HOE,Material.COBBLESTONE); - repairItems.put(Material.STONE_PICKAXE,Material.COBBLESTONE); - repairItems.put(Material.STONE_SWORD,Material.COBBLESTONE); - repairItems.put(Material.STONE_SHOVEL,Material.COBBLESTONE); - repairItems.put(Material.CHAINMAIL_HELMET,Material.IRON_INGOT); - repairItems.put(Material.CHAINMAIL_CHESTPLATE,Material.IRON_INGOT); - repairItems.put(Material.CHAINMAIL_LEGGINGS,Material.IRON_INGOT); - repairItems.put(Material.CHAINMAIL_BOOTS,Material.IRON_INGOT); - repairItems.put(Material.DIAMOND_AXE,Material.DIAMOND); - repairItems.put(Material.DIAMOND_HOE,Material.DIAMOND); - repairItems.put(Material.DIAMOND_PICKAXE,Material.DIAMOND); - repairItems.put(Material.DIAMOND_SWORD,Material.DIAMOND); - repairItems.put(Material.DIAMOND_SHOVEL,Material.DIAMOND); - repairItems.put(Material.DIAMOND_HELMET,Material.DIAMOND); - repairItems.put(Material.DIAMOND_CHESTPLATE,Material.DIAMOND); - repairItems.put(Material.DIAMOND_LEGGINGS,Material.DIAMOND); - repairItems.put(Material.DIAMOND_BOOTS,Material.DIAMOND); - repairItems.put(Material.SHEARS,Material.IRON_INGOT); - repairItems.put(Material.FISHING_ROD,Material.STRING); - repairItems.put(Material.CARROT_ON_A_STICK,Material.CARROT); - repairItems.put(Material.FLINT_AND_STEEL,Material.FLINT); - repairItems.put(Material.BOW,Material.STRING); - repairItems.put(Material.TRIDENT,Material.PRISMARINE_BRICKS); - repairItems.put(Material.ELYTRA,Material.PHANTOM_MEMBRANE); - repairItems.put(Material.SHIELD,Material.IRON_INGOT); - repairItems.put(Material.CROSSBOW,Material.STRING); - if (mcVersion >= 1.16) { - repairItems.put(Material.NETHERITE_AXE,Material.NETHERITE_SCRAP); - repairItems.put(Material.NETHERITE_HOE,Material.NETHERITE_SCRAP); - repairItems.put(Material.NETHERITE_PICKAXE,Material.NETHERITE_SCRAP); - repairItems.put(Material.NETHERITE_SWORD,Material.NETHERITE_SCRAP); - repairItems.put(Material.NETHERITE_SHOVEL,Material.NETHERITE_SCRAP); - repairItems.put(Material.NETHERITE_HELMET,Material.NETHERITE_SCRAP); - repairItems.put(Material.NETHERITE_CHESTPLATE,Material.NETHERITE_SCRAP); - repairItems.put(Material.NETHERITE_LEGGINGS,Material.NETHERITE_SCRAP); - repairItems.put(Material.NETHERITE_BOOTS,Material.NETHERITE_SCRAP); - } - - repairItemsAmount.put(Material.WOODEN_AXE,3); - repairItemsAmount.put(Material.WOODEN_HOE,2); - repairItemsAmount.put(Material.WOODEN_PICKAXE,3); - repairItemsAmount.put(Material.WOODEN_SWORD,2); - repairItemsAmount.put(Material.WOODEN_SHOVEL,1); - repairItemsAmount.put(Material.LEATHER_HELMET,5); - repairItemsAmount.put(Material.LEATHER_CHESTPLATE,8); - repairItemsAmount.put(Material.LEATHER_LEGGINGS,7); - repairItemsAmount.put(Material.LEATHER_BOOTS,4); - repairItemsAmount.put(Material.IRON_AXE,3); - repairItemsAmount.put(Material.IRON_HOE,2); - repairItemsAmount.put(Material.IRON_PICKAXE,3); - repairItemsAmount.put(Material.IRON_SWORD,2); - repairItemsAmount.put(Material.IRON_SHOVEL,1); - repairItemsAmount.put(Material.IRON_HELMET,5); - repairItemsAmount.put(Material.IRON_CHESTPLATE,8); - repairItemsAmount.put(Material.IRON_LEGGINGS,7); - repairItemsAmount.put(Material.IRON_BOOTS,4); - repairItemsAmount.put(Material.GOLDEN_AXE,3); - repairItemsAmount.put(Material.GOLDEN_HOE,2); - repairItemsAmount.put(Material.GOLDEN_PICKAXE,3); - repairItemsAmount.put(Material.GOLDEN_SWORD,2); - repairItemsAmount.put(Material.GOLDEN_SHOVEL,1); - repairItemsAmount.put(Material.GOLDEN_HELMET,5); - repairItemsAmount.put(Material.GOLDEN_CHESTPLATE,8); - repairItemsAmount.put(Material.GOLDEN_LEGGINGS,7); - repairItemsAmount.put(Material.GOLDEN_BOOTS,4); - repairItemsAmount.put(Material.STONE_AXE,3); - repairItemsAmount.put(Material.STONE_HOE,3); - repairItemsAmount.put(Material.STONE_PICKAXE,3); - repairItemsAmount.put(Material.STONE_SWORD,2); - repairItemsAmount.put(Material.STONE_SHOVEL,1); - repairItemsAmount.put(Material.CHAINMAIL_HELMET,5); - repairItemsAmount.put(Material.CHAINMAIL_CHESTPLATE,8); - repairItemsAmount.put(Material.CHAINMAIL_LEGGINGS,7); - repairItemsAmount.put(Material.CHAINMAIL_BOOTS,4); - repairItemsAmount.put(Material.DIAMOND_AXE,3); - repairItemsAmount.put(Material.DIAMOND_HOE,2); - repairItemsAmount.put(Material.DIAMOND_PICKAXE,3); - repairItemsAmount.put(Material.DIAMOND_SWORD,2); - repairItemsAmount.put(Material.DIAMOND_SHOVEL,1); - repairItemsAmount.put(Material.DIAMOND_HELMET,5); - repairItemsAmount.put(Material.DIAMOND_CHESTPLATE,8); - repairItemsAmount.put(Material.DIAMOND_LEGGINGS,7); - repairItemsAmount.put(Material.DIAMOND_BOOTS,4); - repairItemsAmount.put(Material.SHEARS,2); - repairItemsAmount.put(Material.FISHING_ROD,2); - if (mcVersion >= 1.16) { - repairItemsAmount.put(Material.NETHERITE_AXE,3); - repairItemsAmount.put(Material.NETHERITE_HOE,2); - repairItemsAmount.put(Material.NETHERITE_PICKAXE,3); - repairItemsAmount.put(Material.NETHERITE_SWORD,2); - repairItemsAmount.put(Material.NETHERITE_SHOVEL,1); - repairItemsAmount.put(Material.NETHERITE_HELMET,5); - repairItemsAmount.put(Material.NETHERITE_CHESTPLATE,8); - repairItemsAmount.put(Material.NETHERITE_LEGGINGS,7); - repairItemsAmount.put(Material.NETHERITE_BOOTS,4); - } - - repairItemsAmount.put(Material.BOW,3); - - repairItemsAmount.put(Material.ELYTRA,10); - repairItemsAmount.put(Material.SHIELD,1); - repairItemsAmount.put(Material.CROSSBOW,2); - } - - public void initalizeArrows() { - PotionType[] potionType = {PotionType.WATER,PotionType.MUNDANE,PotionType.THICK,PotionType.AWKWARD,PotionType.NIGHT_VISION, - PotionType.INVISIBILITY,PotionType.JUMP,PotionType.FIRE_RESISTANCE,PotionType.SPEED,PotionType.SLOWNESS, - PotionType.WATER_BREATHING,PotionType.INSTANT_HEAL,PotionType.INSTANT_DAMAGE,PotionType.POISON, - PotionType.REGEN,PotionType.STRENGTH,PotionType.WEAKNESS,PotionType.LUCK,PotionType.TURTLE_MASTER,PotionType.SLOW_FALLING}; - String[] labels = {"water","mundane","thick","awkward","night_vision","invisibility","leaping","fire_resistance","swiftness","slowness", - "breathing_water","healing","harming","poison","regeneration","strength","weakness","luck","turtle_master","slow_falling"}; - String[] modifiers = {"","long_","strong_"}; - for (int i = 0; i= 1.16) { - smeltableItemsMap.put(Material.ANCIENT_DEBRIS,Material.NETHERITE_SCRAP); - smeltableItemsMap.put(Material.NETHER_GOLD_ORE,Material.GOLD_INGOT); - smeltableItemsMap.put(Material.NETHER_BRICK,Material.CRACKED_NETHER_BRICKS); - - } - - } - - public void initializeSmeltingXPMap() { - smeltingXPMap.put(Material.BEEF,0.35); - smeltingXPMap.put(Material.CHICKEN,0.35); - smeltingXPMap.put(Material.COD,0.35); - smeltingXPMap.put(Material.SALMON,0.35); - smeltingXPMap.put(Material.POTATO,0.35); - smeltingXPMap.put(Material.MUTTON,0.35); - smeltingXPMap.put(Material.RABBIT,0.35); - smeltingXPMap.put(Material.KELP,0.35); - - smeltingXPMap.put(Material.IRON_ORE,0.7); - smeltingXPMap.put(Material.GOLD_ORE,1.0); - smeltingXPMap.put(Material.SAND,0.1); - smeltingXPMap.put(Material.RED_SAND,0.1); - smeltingXPMap.put(Material.COBBLESTONE,0.1); - smeltingXPMap.put(Material.SANDSTONE,0.1); - smeltingXPMap.put(Material.RED_SANDSTONE,0.1); - smeltingXPMap.put(Material.STONE,0.1); - smeltingXPMap.put(Material.CLAY_BALL,0.3); - smeltingXPMap.put(Material.NETHERRACK,0.1); - smeltingXPMap.put(Material.CLAY,0.35); - smeltingXPMap.put(Material.STONE_BRICKS,0.1); - smeltingXPMap.put(Material.BLACK_TERRACOTTA,0.1); - smeltingXPMap.put(Material.WHITE_TERRACOTTA,0.1); - smeltingXPMap.put(Material.LIGHT_GRAY_TERRACOTTA,0.1); - smeltingXPMap.put(Material.GRAY_TERRACOTTA,0.1); - smeltingXPMap.put(Material.BROWN_TERRACOTTA,0.1); - smeltingXPMap.put(Material.RED_TERRACOTTA,0.1); - smeltingXPMap.put(Material.ORANGE_TERRACOTTA,0.1); - smeltingXPMap.put(Material.YELLOW_TERRACOTTA,0.1); - smeltingXPMap.put(Material.LIME_TERRACOTTA,0.1); - smeltingXPMap.put(Material.GREEN_TERRACOTTA,0.1); - smeltingXPMap.put(Material.CYAN_TERRACOTTA,0.1); - smeltingXPMap.put(Material.LIGHT_BLUE_TERRACOTTA,0.1); - smeltingXPMap.put(Material.BLUE_TERRACOTTA,0.1); - smeltingXPMap.put(Material.PURPLE_TERRACOTTA,0.1); - smeltingXPMap.put(Material.MAGENTA_TERRACOTTA,0.1); - smeltingXPMap.put(Material.PINK_TERRACOTTA,0.1); - smeltingXPMap.put(Material.CACTUS,1.0); - for (Material log : logs) { - smeltingXPMap.put(log,0.15); - } - for (Material strippedLog : strippedLogs) { - smeltingXPMap.put(strippedLog,0.15); - } - for (Material strippedLog : wood) { - smeltingXPMap.put(strippedLog,0.15); - } - for (Material strippedLog : strippedWood) { - smeltingXPMap.put(strippedLog,0.15); - } - smeltingXPMap.put(Material.CHORUS_FRUIT,0.1); - smeltingXPMap.put(Material.WET_SPONGE,0.15); - smeltingXPMap.put(Material.SEA_PICKLE,0.1); - smeltingXPMap.put(Material.DIAMOND_ORE,1.0); - smeltingXPMap.put(Material.LAPIS_ORE,0.2); - smeltingXPMap.put(Material.REDSTONE_ORE,0.3); - smeltingXPMap.put(Material.COAL_ORE,0.1); - smeltingXPMap.put(Material.EMERALD_ORE,1.0); - smeltingXPMap.put(Material.NETHER_QUARTZ_ORE,0.2); - - smeltingXPMap.put(Material.IRON_SWORD,0.1); - smeltingXPMap.put(Material.IRON_PICKAXE,0.1); - smeltingXPMap.put(Material.IRON_AXE,0.1); - smeltingXPMap.put(Material.IRON_SHOVEL,0.1); - smeltingXPMap.put(Material.IRON_HOE,0.1); - smeltingXPMap.put(Material.CHAINMAIL_HELMET,0.1); - smeltingXPMap.put(Material.CHAINMAIL_CHESTPLATE,0.1); - smeltingXPMap.put(Material.CHAINMAIL_LEGGINGS,0.1); - smeltingXPMap.put(Material.CHAINMAIL_BOOTS,0.1); - smeltingXPMap.put(Material.IRON_HELMET,0.1); - smeltingXPMap.put(Material.IRON_CHESTPLATE,0.1); - smeltingXPMap.put(Material.IRON_LEGGINGS,0.1); - smeltingXPMap.put(Material.IRON_BOOTS,0.1); - smeltingXPMap.put(Material.IRON_HORSE_ARMOR,0.1); - - smeltingXPMap.put(Material.GOLDEN_SWORD,0.1); - smeltingXPMap.put(Material.GOLDEN_PICKAXE,0.1); - smeltingXPMap.put(Material.GOLDEN_AXE,0.1); - smeltingXPMap.put(Material.GOLDEN_SHOVEL,0.1); - smeltingXPMap.put(Material.GOLDEN_HOE,0.1); - smeltingXPMap.put(Material.GOLDEN_HELMET,0.1); - smeltingXPMap.put(Material.GOLDEN_CHESTPLATE,0.1); - smeltingXPMap.put(Material.GOLDEN_LEGGINGS,0.1); - smeltingXPMap.put(Material.GOLDEN_BOOTS,0.1); - smeltingXPMap.put(Material.GOLDEN_HORSE_ARMOR,0.1); - - if (mcVersion >= 1.16) { - smeltingXPMap.put(Material.ANCIENT_DEBRIS,2.0); - smeltingXPMap.put(Material.NETHER_GOLD_ORE,1.0); - smeltingXPMap.put(Material.NETHER_BRICK,0.1); - - } - - } - - - - //Getters - public List getNewIngredients(){ - return newIngredients; - } - public List getOldIngredients(){ - return oldIngredients; - } - public ItemStack getHastePotion(){ - return hastePotion; - } - public ItemStack getFatiguePotion(){ - return fatiguePotion; - } - public ItemStack getHeroPotion(){ - return heroPotion; - } - public ItemStack getDecayPotion(){ - return decayPotion; - } - public ItemStack getResistancePotion(){ - return resistancePotion; - } - public List getLeftClickItems() { - return leftClickItems; - } - public List getPickaxes() { - return pickaxes; - } - public List getAxes() { - return axes; - } - public List getShovels() { - return shovels; - } - public List getHoes() { - return hoes; - } - public List getSwords() { - return swords; - } - public List getNoRightClick() { - return noRightClick; - } - public List getActionableBlocks() { - return actionableBlocks; - } - public List getHarmfulEffects() {return harmfulEffects;} - public List getLogs() {return logs;} - public List getTallCrops() {return tallCrops;} - public Map getTrackedBlocks() {return trackedBlocks;} - public Map getEnchantmentLevelMap() { - return enchantmentLevelMap; - } - - public List getCrops() { - return crops; - } - - public Map getFarmFoodSaturation() { - return farmFoodSaturation; - } - - public Map getMeatFoodSaturation() { - return meatFoodSaturation; - } - - public Map getFarmFood() { - return farmFood; - } - - public Map getMeatFood() { - return meatFood; - } - - public Map getFishFoodSaturation() { - return fishFoodSaturation; - } - - public Map getFishFood() { - return fishFood; - } - - public List getValuableItems() { - return valuableItems; - } - public List getOres() { return ores;} - - public Map getRepairItemsAmount() { - return repairItemsAmount; - } - - public Map getRepairItems() { - return repairItems; - } - - public List getLeaves() { - return leaves; - } - - public List getStrippedLogs() { - return strippedLogs; - } - - public Map getSmeltableItemsMap() { - return smeltableItemsMap; - } - - public ItemStack getArrow(String type) { - if (effectArrows.containsKey(type)) { - effectArrows.get(type).setAmount(8); - return effectArrows.get(type); - } - return new ItemStack(Material.ARROW,8); - } - - public Map getSmeltingXPMap() { - return smeltingXPMap; - } - - public static ArrayList getAllLogs() { - return allLogs; - } - - public HashSet getVeinMinerBlocks() { - return veinMinerBlocks; - } - - public List getFlamePickOres() { - return flamePickOres; - } -} diff --git a/src/main/java/mc/carlton/freerpg/globalVariables/StringsAndOtherData.java b/src/main/java/mc/carlton/freerpg/globalVariables/StringsAndOtherData.java deleted file mode 100644 index c9bc6d5..0000000 --- a/src/main/java/mc/carlton/freerpg/globalVariables/StringsAndOtherData.java +++ /dev/null @@ -1,756 +0,0 @@ -package mc.carlton.freerpg.globalVariables; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.customContainers.OldCustomPotion; -import mc.carlton.freerpg.customContainers.collections.OldCustomRecipe; -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.utilities.UtilityMethods; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.plugin.Plugin; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.potion.PotionType; - -import java.io.File; -import java.util.*; - -public class StringsAndOtherData { - static ArrayList skillNames = new ArrayList<>(); - static ArrayList skillNamesWithGlobal = new ArrayList<>(); - static Map perksMap = new HashMap<>(); - static Map descriptionsMap = new HashMap<>(); - static Map passivePerksMap = new HashMap<>(); - static Map passiveDescriptionsMap = new HashMap<>(); - static public String version; - static Map idToStringMap = new HashMap<>(); - static Map languageProgress = new HashMap<>(); - static ArrayList languageCodes = new ArrayList<>(); - static Map bookIndexes = new HashMap<>(); - static Map dyeIndexes = new HashMap<>(); - - ArrayList levelingInfo; - - public StringsAndOtherData(){ - ConfigLoad configLoad = new ConfigLoad(); - levelingInfo = configLoad.getLevelingInfo(); - } - - public void initializeData() { - initializeSkillNames(); - initializeSkillDescriptions(); - initializeVersion(); - initializeLanguagesData(); - initializeConfigGUIIndexInfo(); - initializeLanguageCompletions(); - } - - public void initializeSkillNames() { - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting","global"}; - List labels_arr = Arrays.asList(labels_0); - skillNamesWithGlobal = new ArrayList<>(labels_arr); - String[] labels_1 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - List labels_arr1 = Arrays.asList(labels_1); - skillNames = new ArrayList<>(labels_arr1); - } - - - public void initializeLanguagesData() { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - File languagesYML = new File(plugin.getDataFolder()+"/languages.yml"); - languagesYML.setReadable(true,false); - languagesYML.setWritable(true,false); - FileConfiguration languages = YamlConfiguration.loadConfiguration(languagesYML); - for (String language : languages.getConfigurationSection("lang").getKeys(false)) { - languageCodes.add(language); - for (String id : languages.getConfigurationSection("lang." + language).getKeys(false)) { - String fullId = language +"." + id; - idToStringMap.put(fullId,languages.getString("lang." + language + "." + id)); - } - } - if (languageCodes.size() > 14) { - System.out.println("[FreeRPG] WARNING: Player configuration currently only supports the first 12 language options!"); - } - ConfigLoad configLoad = new ConfigLoad(); - String newDefaultLanguageCode = UtilityMethods.convertStringToListCasing(languageCodes,configLoad.getDefaultLanguage()); - configLoad.setDefaultLanguage(newDefaultLanguageCode); - } - - public void initializeConfigGUIIndexInfo() { - ConfigLoad configLoad = new ConfigLoad(); - if (configLoad.isForceLanguage()) { - return; - } - int totalIndexes = Math.min(languageCodes.size(),14); - int[] possibleBookIndexes = {19,20,21,22,23,24,25,37,38,39,40,41,42,43}; - int[] possibleDyeIndexes = {28,29,30,31,32,33,34,46,47,48,49,50,51,52}; - for (int i = 0; i < totalIndexes; i++) { - bookIndexes.put(possibleBookIndexes[i],languageCodes.get(i)); - dyeIndexes.put(possibleDyeIndexes[i],languageCodes.get(i)); - } - } - - public void initializeLanguageCompletions() { - if (!languageCodes.contains("enUs")) { - System.out.println("[FreeRPG] Languages.yml is missing enUs! Some features may be broken"); - for (String language : languageCodes) { - languageProgress.put(language,1.0); - } - return; - } - languageProgress.put("enUs",1.0); - Map totalLanguageString = new HashMap<>(); - Map totalIncompleteLanguageString = new HashMap<>(); - for (String language : languageCodes) { - totalLanguageString.put(language,0); - totalIncompleteLanguageString.put(language,0); - } - for (String partialYamlKey : idToStringMap.keySet()) { - languagesLoop: - for (String language : languageCodes) { - if (language.equalsIgnoreCase("enUs")) { - continue; - } - if (partialYamlKey.contains(language)) { - int indexOfDot = partialYamlKey.indexOf("."); - String englishKey = "enUs" + partialYamlKey.substring(indexOfDot); - totalLanguageString.put(language,totalLanguageString.get(language)+1); - if (idToStringMap.get(partialYamlKey).equalsIgnoreCase(idToStringMap.get(englishKey))) { - totalIncompleteLanguageString.put(language,totalIncompleteLanguageString.get(language)+1); - } - break languagesLoop; - } - } - } - for (String language : languageCodes) { - if (language.equalsIgnoreCase("enUs")) { - continue; - } - double totalStrings = totalLanguageString.get(language); - double totalIncomplete = totalIncompleteLanguageString.get(language); - languageProgress.put(language,(totalStrings - totalIncomplete)/totalStrings); - } - } - - public void initializeSkillDescriptions() { - String s_Name = ""; - String[] perks = {}; - String[] descriptions = {}; - String[] passivePerks = {}; - String[] passiveDescriptions = {}; - - //digging - s_Name = "digging"; - perks = new String[]{"Mo' drops", "Double Treasure", "Rarer Drops", "Soul Stealer", "Flint Finder", "Shovel Knight", "Mega Dig"}; - descriptions = new String[]{"Expands treasure drop table by 1 item per level","+5% chance of receiving double treasure drop per level (when treasure is rolled)","Further expands drop table by item per level","Soul sand is +5% more likely to drop treasure per level","Gravel has 100% flint drop rate (toggleable by /flintToggle)","Shovels do double damage","When using ability, you now break a 3x3 block section (20% of normal treasure rate when active)"}; - passivePerks = new String[]{"Passive Tokens","Back","Skill Tokens","Big Dig Duration","Treasure Chance"}; - passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)","Takes you back to the main skills menu","Tokens to invest in skill tree","Increases duration of Big Dig by 0.02 s","Increases chance of digging up treasure by 0.005%"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //woodcutting - s_Name = "woodcutting"; - perks = new String[]{"Zealous Roots", "Fresh Arms", "Hidden Knowledge", "Leaf Scavenger", "Timber+", "Leaf Blower", "Able Axe"}; - descriptions = new String[]{"+20% chance for logs to drop 1 XP per level","+12 s per level of Haste I after first log broken in 5 minutes","Logs have a +0.2% chance per level to drop an enchanted book","Leaves have a 1% chance to drop +1 treasure item per level","Timber break limit increased from 64 to 128","Instantly break leaves by holding left click with an axe","Double drops, Zealous Roots, and Hidden Knowledge all now apply to timber (at half effectiveness)"}; - passivePerks = new String[]{"Passive Tokens","Back","Skill Tokens","Timber Duration","Double Drops"}; - passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)","Takes you back to the main skills menu","Tokens to invest in skill tree","Increases duration of Timber by 0.02 s","Increases chance to receive a double drop by 0.05%"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //mining - s_Name = "mining"; - perks = new String[]{"Wasteless Haste", "More Bombs", "Treasure Seeker", "Bomb-boyage", "Vein Miner", "Demolition Man", "Triple Trouble"}; - descriptions = new String[]{"Gain haste after mining ores for each level","The crafting recipe for TNT produces +1 TNT block per level","When using ability on stones, +1% per level chance for an ore to drop (extra exp is earned from dropped ores)","Increases TNT blast radius (when lit by flint and steel) each level","Ore veins are instantly mined upon breaking one block (toggle-able)","No damage is taken from TNT explosions","Double drops are now triple drops"}; - passivePerks = new String[]{"Passive Tokens","Back","Skill Tokens","Berserk Pick Duration","Double Drops","Blast Mining"}; - passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)","Takes you back to the main skills menu","Tokens to invest in skill tree","Increases duration of Berserk Pick by 0.02s","Increases chance to receive a double drop from ores by 0.05%","Increases chances for ore to be created from TNT explosions by 0.01% (rolled 10 times per explosion)"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //farming - s_Name = "farming"; - perks = new String[]{"Better Fertilizer", "Animal Farm", "Farmer's Diet", "Carnivore", "Green Thumb", "Growth Hormones", "One with Nature"}; - descriptions = new String[]{"+10% chance to not consume bonemeal on use","Can craft an additional spawn egg per level","Farm food is +20% more effective at restoring hunger and saturation per level","Meat is +20% more effective at restoring hunger and saturation per level","Ability may replant crops fully grown with higher chance of replanting in later growth stages; ability now effects Melons and Pumpkins","Sugar can be used on baby animals to make them grow instantly","Gain Regeneration I when standing still on grass"}; - passivePerks = new String[]{"Passive Tokens","Back","Skill Tokens","Natural Regeneration Duration","Double Drops (Crops)","Double Drops (Animals)"}; - passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)","Takes you back to the main skills menu","Tokens to invest in skill tree","Increases duration of Natural Regeneration by 0.02s","Increases chance to receive a double drop from crops by 0.05%","Increases chance to receive a double drop from most passive animals by 0.05%"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //fishing - s_Name = "fishing"; - perks = new String[]{"Rob", "Scavenger", "Fisherman's Diet", "Filtration", "Grappling Hook", "Hot Rod", "Fish Person"}; - descriptions = new String[]{"+15% chance to pull item off a mob per level","Unlocks new tier of fishing treasure","Fish restore +20% hunger per level","Higher tier (II-V) loot becomes more common, lower tier (I) becomes less common","Fishing rod now acts as a grappling hook (toggleable with /grappleToggle )","Fish are now cooked when caught, some fishing treasures are changed (toggleable with /hotRodToggle)","Infinite night vision when underwater, infinite dolphin's grace when in the water"}; - passivePerks = new String[]{"Passive Tokens","Back","Skill Tokens","Super Bait Duration","Double catches","Treasure Finder"}; - passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)","Takes you back to the main skills menu","Tokens to invest in skill tree","Increases duration of Super Bait by 0.01s","Increases chance to receive a double drop by 0.05%","Decreases chance of finding junk by 0.005%, increases chance of finding treasure by 0.005%"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //archery - s_Name = "archery"; - perks = new String[]{"Extra Arrows", "Sniper", "Arrow of Light", "Explosive Arrows", "Dragon-less Arrows", "Crossbow Rapid Load", "Deadly Strike"}; - descriptions = new String[]{"+1 arrow gained from crafting per level","Arrow speed increases by +2% per level (~4% damage increase/level)","Spectral arrows get a +5% damage boost per level","Arrows have a +1% of creating an explosion on hit","Allows crafting all tipped arrows with regular potions instead of lingering potions","Ability can now be used with crossbows, making all shots load instantly","Fireworks shot from crossbows do double damage (up to 16 hearts of damage)"}; - passivePerks = new String[]{"Passive Tokens","Back","Skill Tokens","Rapid Fire Duration","Retrieval"}; - passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)","Takes you back to the main skills menu","Tokens to invest in skill tree","Increases duration of Rapid Fire by 0.02s","Increases chance for arrow shot to not consume arrow by 0.05% per level"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //beastMastery - s_Name = "beastMastery"; - perks = new String[]{"Thick Fur","Sharp Teeth","Healthy Bites","Keep Away","Acro-Dog","Identify","Adrenaline Boost"}; - descriptions = new String[]{"Dogs take -10% damage per level","Dogs do +10% more damage per level","Dogs heal +1/2 heart per level from killing","Dogs have gain +5% chance of knocking back foes","Dogs do not take fall damage","Using a compass on a horse or wolf now shows their stats","Spur kick buff is now speed III"}; - passivePerks = new String[]{"Passive Tokens","Back","Skill Tokens","Spur Kick Duration","Critical Bite"}; - passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)","Takes you back to the main skills menu","Tokens to invest in skill tree","Increases duration of Spur Kick by 0.02s","Increases chance for a dog to have a critical hit by 0.025%"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //swordsmanship - s_Name = "swordsmanship"; - perks = new String[]{"Adrenaline","Killing Dpree","Adrenaline+","Killing Frenzy","Thirst for Blood","Sharper!","Sword Mastery"}; - descriptions = new String[]{"Killing hostile mobs with a sword provides +2 s of speed per level","Killing hostile mobs with a sword provides +2 s of strength per level","+20% of speed I buff from Adrenaline is now speed II","+20% of strength I buff from Killing Spree is now strength II","Killing certain aggressive mobs with a sword restores hunger","Swift strikes now adds a level of sharpness to your sword","Swords permanently do +1 heart of damage"}; - passivePerks = new String[]{"Passive Tokens","Back","Skill Tokens","Swift Strikes Duration","Double Hit"}; - passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)","Takes you back to the main skills menu","Tokens to invest in skill tree","Increases duration of Swift Strikes by 0.02s","Increases chance to hit mob twice (second hit does 50% damage) by 0.02%"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //defense - s_Name = "defense"; - perks = new String[]{"Healer","Stiffen","Hard Headed","Stiffen+","Gift From Above","Stronger Legs","Hearty"}; - descriptions = new String[]{"Gain +3s of regen per level on kill","+2% chance to gain resistance I for 5s when hit","Hard Body decreases damage by an additional 6.6% per level","+2% chance to gain resistance II for 5s when hit","Stone Solid now grants 4 absorption hearts for ability length +1 minute","Stone Solid now gives slowness I instead of slowness IV","+2 hearts permanently"}; - passivePerks = new String[]{"Passive Tokens","Back","Skill Tokens","Stone Solid Duration","Hard Body","Double Drops (Hostile Mobs)"}; - passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)","Takes you back to the main skills menu","Tokens to invest in skill tree","Increases duration of Stone Solid by 0.02s","Increases chance to take reduced (base -33%) damage by 0.01% per level","Increases chance to receive double drops from aggressive mobs by 0.05%"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //axeMastery - s_Name = "axeMastery"; - perks = new String[]{"Greater Axe","Holy Axe","Revitalized","Warrior Blood","Earthquake","Better Crits","Axe Man"}; - descriptions = new String[]{"Great Axe damage radius increases by 1 block per level","+2% chance for lighting to strike mobs on axe hit","+1% chance for full heal on kill per level","+3 s per level of Strength I on kills with an axe","Ability's AOE damage is doubled (25% -> 50% of damage)","Divine Crits now have 1.6x multiplier instead of 1.25x","Axes permanently do +1 heart of damage"}; - passivePerks = new String[]{"Passive Tokens","Back","Skill Tokens","Great Axe Duration","Divine Crits"}; - passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)","Takes you back to the main skills menu","Tokens to invest in skill tree","Increases duration of Great Axe by 0.02s","Increases random crit chance (base 1.25x damage) by 0.01%"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //Repair - s_Name = "repair"; - perks = new String[]{"Salvaging","Resourceful","Magic Repair Mastery"}; - descriptions = new String[]{"Get more materials on average from salvaging","+10% chance of keeping material used when repairing","Guarenteed to keep enchants on repair"}; - passivePerks = new String[]{"Back","Skill Tokens","Proficiency"}; - passiveDescriptions = new String[]{"Takes you back to the main skills menu","Tokens to invest in skill tree","Materials restore more durability on repair"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //Agility - s_Name = "agility"; - perks = new String[]{"Dodge","Steel Bones","Graceful Feet"}; - descriptions = new String[]{"+4% chance to dodge attacks per level","-10% fall damage per level","Permanent speed I buff (toggleable by /speedToggle)"}; - passivePerks = new String[]{"Back","Skill Tokens","Roll"}; - passiveDescriptions = new String[]{"Takes you back to the main skills menu","Tokens to invest in skill tree","Chance to roll and take reduced fall damage"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //Alchemy - s_Name = "alchemy"; - perks = new String[]{"Alchemical Summoning","Ancient Knowledge","Potion Master"}; - descriptions = new String[]{"Allows crafting of some potions without a brewing stand","Unlocks ability to brew new potions","All used potions are increased in level by 1 (toggleable with /togglePotion)"}; - passivePerks = new String[]{"Back","Skill Tokens","Half-life+"}; - passiveDescriptions = new String[]{"Takes you back to the main skills menu","Tokens to invest in skill tree","Increase in duration of potions when used"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //Smelting - s_Name = "smelting"; - perks = new String[]{"Fuel Efficiency","Double Smelt","Flame Pickaxe"}; - descriptions = new String[]{"Fuel last +20% longer per level","+5% chance for smelted ore to be doubled per level","Mined ores are instantly smelted (toggleable with /toggleFlamePick)"}; - passivePerks = new String[]{"Back","Skill Tokens","Fuel Speed"}; - passiveDescriptions = new String[]{"Takes you back to the main skills menu","Tokens to invest in skill tree","Increasing cooking speed"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //Enchanting - s_Name = "enchanting"; - perks = new String[]{"Efficient Enchanting","Booksmart","Immortal Experience"}; - descriptions = new String[]{"Levels needed to enchant -1 per level, anvil repair costs -1 (minimum of 2) XP levels per level","Unlocks crafting recipes for some enchanted books","Keep xp on death"}; - passivePerks = new String[]{"Back","Skill Tokens","Quicker Development"}; - passiveDescriptions = new String[]{"Takes you back to the main skills menu","Tokens to invest in skill tree","All xp received increased"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - - //Enchanting - s_Name = "global"; - perks = new String[]{"Gatherer","Scholar","Fighter","Hard Work","Research","Training","Reincarnation+","Soul Harvesting","Avatar","Master of the Arts"}; - descriptions = new String[]{"+20% exp gained in Digging, Woodcutting, Mining, Farming, and Fishing","+20% exp gained in Repair, Agility, Brewing, Smelting, and Enchanting","+20% exp gained in Archery, Beast Mastery, Swordsmanship, Defense, and Axe Mastery","+1 skill token in all Gatherer skills","+1 skill token in all Scholar skills","+1 skill token in all Fighter skills","On death, 50% chance to keep some of each valuable item in your inventory","You now harvest souls from killing aggressive mobs, which can be used to refund skill trees","10% chance to take no damage and gain all in-game buffs for 10s on a hit that would normallu kill you","Ability cooldowns decreased by 33%"}; - passivePerks = new String[]{"Global Tokens","Back"}; - passiveDescriptions = new String[]{"Tokens to invest in skill tree","Takes you back to the main skills menu"}; - perksMap.put(s_Name,perks); - descriptionsMap.put(s_Name,descriptions); - passivePerksMap.put(s_Name,passivePerks); - passiveDescriptionsMap.put(s_Name,passiveDescriptions); - } - - public void initializeVersion() { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - version = plugin.getDescription().getVersion(); - } - - public String replaceIfPresent(String initialString,String searchFor,String replaceWith) { - if (initialString.contains(searchFor)) { - return initialString.replace(searchFor,replaceWith); - } - else { - return initialString; - } - } - - public ArrayList getStringLines(String string) { - if (string == null) { - return new ArrayList<>(); - } - ArrayList splitDescs = new ArrayList<>(); - splitDescs.add(string); - int iter = 0; - while (splitDescs.get(splitDescs.size()-1).length() > 30) { - int lastIndex = splitDescs.size()-1; - boolean foundSpace = false; - int counter = 30; - while (foundSpace == false && counter > 0){ - if (splitDescs.get(lastIndex).charAt(counter) == ' ') { - splitDescs.add(splitDescs.get(lastIndex).substring(0, counter)); - splitDescs.add(splitDescs.get(lastIndex).substring(counter+1)); - splitDescs.remove(iter); - iter += 1; - foundSpace = true; - } - else if (counter == 1) { - splitDescs.add(splitDescs.get(lastIndex).substring(0, 30)+"-"); - splitDescs.add(splitDescs.get(lastIndex).substring(30+1)); - splitDescs.remove(iter); - iter += 1; - foundSpace = true; - } - counter = counter - 1; - } - if (iter > 20) { - break; - } - } - return splitDescs; - } - - public String camelCaseToTitle(String string) { - String newString = ""; - ArrayList splitIndexes = new ArrayList<>(); - splitIndexes.add(0); - for (int i = 0; i customRecipeMap = configLoad.getCraftingRecipes(); - Enchantment[] defaultEnchants = {Enchantment.ARROW_DAMAGE,Enchantment.DIG_SPEED,Enchantment.DAMAGE_ALL,Enchantment.PROTECTION_ENVIRONMENTAL,Enchantment.LUCK, - Enchantment.LURE,Enchantment.FROST_WALKER,Enchantment.DEPTH_STRIDER,Enchantment.MENDING,Enchantment.LOOT_BONUS_BLOCKS}; - for (int i = 0; i < craftingNames.length; i++) { - int stringIndex = i+1; - OldCustomRecipe oldCustomRecipe = customRecipeMap.get("enchanting"+stringIndex); - Material output = oldCustomRecipe.getOutput(); - if (oldCustomRecipe.outputIsEnchanted()) { - Enchantment enchantment = oldCustomRecipe.getEnchantment(); - if (!enchantment.equals(defaultEnchants[i]) || !output.equals(Material.ENCHANTED_BOOK)) { - craftingNames[i] = cleanUpTitleString(getBetterEnchantmentString(enchantment.toString())+ " " + oldCustomRecipe.getEnchantmentLevel() + " " + output.toString()); - } - } - else { - craftingNames[i] = cleanUpTitleString(output.toString()); - } - } - return craftingNames; - } - - public String getBetterEnchantmentString(String enchantmentString) { - int i = enchantmentString.indexOf(":"); - int j = enchantmentString.indexOf(","); - if (j == -1) { - j = enchantmentString.length(); - } - return enchantmentString.substring(i+1,j); - } - public String getEnchantmentPerkDescString(int level,Player p) { - ConfigLoad configLoad = new ConfigLoad(); - Map customRecipeMap = configLoad.getCraftingRecipes(); - String[] craftingNames = getEnchantingCraftingNames(p); - LanguageSelector lang = new LanguageSelector(p); - int index1 = 2*(level-1); - int index2 = 2*(level-1)+1; - String name1 = craftingNames[index1]; - String name2 = craftingNames[index2]; - if ( name1.equalsIgnoreCase(lang.getString("enchantingCraft"+index1)) && name2.equalsIgnoreCase(lang.getString("enchantingCraft"+index2)) ) { - return lang.getString("enchantingPerkDesc1_"+level); - } - else { - index1 += 1; - index2 += 1; - OldCustomRecipe oldCustomRecipe1 = customRecipeMap.get("enchanting"+index1); - OldCustomRecipe oldCustomRecipe2 = customRecipeMap.get("enchanting"+index2); - String newString = ""; - int cost1 = oldCustomRecipe1.getXPcraftCost(); - int cost2 = oldCustomRecipe2.getXPcraftCost(); - String id1 = "xpLevel"; - String id2 = "xpLevel"; - if (cost1 != 1) { - id1+="s"; - } - if (cost2 != 1) { - id2+="s"; - } - - newString = name1 + " (" + lang.getString("costs") + " "+cost1+" " + lang.getString(id1) + ")" + " & " + name2 + " (" + lang.getString("costs") + " "+cost2+" " + lang.getString(id2) + ")"; - return newString; - } - } - - public String getPotionEffectTypeString(int level, Player p) { - ConfigLoad configLoad = new ConfigLoad(); - Map alchemyInfo = configLoad.getAlchemyInfo(); - String name = getPotionNameFromEffect(alchemyInfo.get("customPotion"+level).getPotionEffectType()); - String effectType = ""; - if (!name.equalsIgnoreCase("Potion")) { - LanguageSelector lang = new LanguageSelector(p); - String id = "potion" + name.substring(10).replace(" ",""); - effectType = lang.getString(id); - } - return effectType; - } - - public void setLanguageItems(Player p,Inventory gui) { - ConfigLoad configLoad = new ConfigLoad(); - if (configLoad.isForceLanguage()) { - return; - } - int[] indexes = {19,20,21,22,23,24,25,37,38,39,40,41,42,43}; - int maxIndex = Math.min(indexes.length,languageCodes.size()); - for (int i = 0; i langItemLore = new ArrayList<>(); - langItemLore.add(ChatColor.ITALIC + ChatColor.GRAY.toString() + "(" + englishName + ")"); - langItemLore.add(ChatColor.ITALIC + ChatColor.GRAY.toString() + lang.getString("status") + ": " + - ChatColor.RESET + color + progressString + " " + lang.getString("complete")); - langItemMeta.setLore(langItemLore); - langItem.setItemMeta(langItemMeta); - gui.setItem(indexes[i], langItem); - - ItemStack langItemToggle = new ItemStack(Material.LIME_DYE); - ItemMeta langItemToggleMeta = langItemToggle.getItemMeta(); - if (language.equalsIgnoreCase(languageCode)) { - langItemToggleMeta.setDisplayName(ChatColor.BOLD + ChatColor.GREEN.toString() + lang.getString("on0")); - } else { - langItemToggle.setType(Material.GRAY_DYE); - langItemToggleMeta.setDisplayName(ChatColor.BOLD + ChatColor.RED.toString() + lang.getString("off0")); - } - langItemToggle.setItemMeta(langItemToggleMeta); - gui.setItem(indexes[i] + 9, langItemToggle); - } - } - - public String getPotionTypeString(int level,Player p) { - String effectType = ""; - LanguageSelector lang = new LanguageSelector(p); - ConfigLoad configLoad = new ConfigLoad(); - Map customRecipeMap = configLoad.getCraftingRecipes(); - OldCustomRecipe oldCustomRecipe = customRecipeMap.get("alchemy"+level); - if (oldCustomRecipe.outputIsPotion()) { - String id = getPotionNameIDFromPotionType(oldCustomRecipe.getPotionType()); - effectType = lang.getString(id); - } - else { - effectType = cleanUpTitleString(oldCustomRecipe.getOutput().toString()); - } - return effectType; - } - - public String getPotionNameIDFromPotionType(PotionType potionType) { - switch (potionType) { - case AWKWARD: - return "potionAwkward"; - case UNCRAFTABLE: - return "potionUncraftable"; - case MUNDANE: - return "potionMundane"; - case TURTLE_MASTER: - return "potionTurtleMaster"; - case THICK: - return "potionThick"; - case WATER: - return "potionWater"; - default: - String tempName = getPotionNameFromEffect(potionType.getEffectType()); - String id = "potion" + tempName.substring(10).replace(" ",""); - return id; - } - - } - - public String getPotionNameFromEffect(PotionEffectType potionEffectType) { - String name = "Potion"; - switch (potionEffectType.getName()) { - case "ABSORPTION": - name = "Potion of Absorption"; - break; - case "BAD_OMEN": - name = "Potion of Bad Omen"; - break; - case "BLINDNESS": - name = "Potion of Blindness"; - break; - case "CONDUIT_POWER": - name = "Potion of Conduit Power"; - break; - case "CONFUSION": - name = "Potion of Confusion"; - break; - case "DAMAGE_RESISTANCE": - name = "Potion of Resistance"; - break; - case "DOLPHINS_GRACE": - name = "Potion of Dolphin's Grace"; - break; - case "FAST_DIGGING": - name = "Potion of Haste"; - break; - case "FIRE_RESISTANCE": - name = "Potion of Fire Resistance"; - break; - case "GLOWING": - name = "Potion of Glowing"; - break; - case "HARM": - name = "Potion of Harm"; - break; - case "HEAL": - name = "Potion of Healing"; - break; - case "HEALTH_BOOST": - name = "Potion of Health Boost"; - break; - case "HERO_OF_THE_VILLAGE": - name = "Potion of the Hero"; - break; - case "HUNGER": - name = "Potion of Hunger"; - break; - case "INCREASE_DAMAGE": - name = "Potion of Strength"; - break; - case "INVISIBILITY": - name = "Potion of Invisibility"; - break; - case "JUMP": - name = "Potion of Jump"; - break; - case "LEVITATION": - name = "Potion of Levitation"; - break; - case "LUCK": - name = "Potion of Luck"; - break; - case "NIGHT_VISION": - name = "Potion of Night Vision"; - break; - case "POISON": - name = "Potion of Night Vision"; - break; - case "REGENERATION": - name = "Potion of Regeneration"; - break; - case "SATURATION": - name = "Potion of Saturation"; - break; - case "SLOW": - name = "Potion of Slowness"; - break; - case "SLOW_DIGGING": - name = "Potion of Fatigue"; - break; - case "SLOW_FALLING": - name = "Potion of Slow Falling"; - break; - case "SPEED": - name = "Potion of Speed"; - break; - case "UNLUCK": - name = "Potion of Bad Luck"; - break; - case "WATER_BREATHING": - name = "Potion of Water Breathing"; - break; - case "WEAKNESS": - name = "Potion of Weakness"; - break; - case "WITHER": - name = "Potion of Decay"; - break; - default: - break; - - } - return name; - } - - public Map getDescriptionsMap() { - return descriptionsMap; - } - - public Map getPassiveDescriptionsMap() { - return passiveDescriptionsMap; - } - - public Map getPassivePerksMap() { - return passivePerksMap; - } - - public Map getPerksMap() { - return perksMap; - } - - public String getVersion() { - return version; - } - - public Map getIdToStringMap() { - return idToStringMap; - } - - public Map getBookIndexes() { - return bookIndexes; - } - - public Map getDyeIndexes() { - return dyeIndexes; - } - - public ArrayList getSkillNames() { - return skillNames; - } - - public ArrayList getSkillNamesWithGlobal() { - return skillNamesWithGlobal; - } -} diff --git a/src/main/java/mc/carlton/freerpg/guiEvents/ConfigurationGUIClick.java b/src/main/java/mc/carlton/freerpg/guiEvents/ConfigurationGUIClick.java deleted file mode 100644 index 7662040..0000000 --- a/src/main/java/mc/carlton/freerpg/guiEvents/ConfigurationGUIClick.java +++ /dev/null @@ -1,142 +0,0 @@ -package mc.carlton.freerpg.guiEvents; - -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.globalVariables.StringsAndOtherData; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryType; - -import java.util.*; - -public class ConfigurationGUIClick implements Listener { - @EventHandler - public void clickEvent(InventoryClickEvent e) { - boolean proceed = true; - try { - InventoryType invType = e.getClickedInventory().getType(); - } catch (Exception except) { - proceed = false; - return; - } - if (e.getView().getTitle().equalsIgnoreCase("Configuration Window")) { - if (e.getClickedInventory().getType() == InventoryType.PLAYER) { - e.setCancelled(true); - return; - } - if (e.getClick() != ClickType.LEFT) { - e.setCancelled(true); - } - if (e.getCursor().getType() != Material.AIR) { - e.setCancelled(true); - } - Player p = (Player) e.getWhoClicked(); - LanguageSelector lang = new LanguageSelector(p); - PlayerStats pStatClass = new PlayerStats(p); - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - Map>> statAll = pStatClass.getData(); - Map> pStat = pStatClass.getPlayerData(); - Map bookIndexes = stringsAndOtherData.getBookIndexes(); - Map dyeIndexes = stringsAndOtherData.getDyeIndexes(); - if (e.getCurrentItem() != null) { - PlayerStats languageChange = new PlayerStats(p); - for (int index : bookIndexes.keySet()){ - if (e.getRawSlot() == index) { - String languageCode = bookIndexes.get(index); - switch (languageCode) { - case "enUs": - break; - default: - p.sendMessage(ChatColor.GOLD + lang.getString("translators") + ChatColor.GRAY + ": " + - ChatColor.WHITE + lang.getString("translationCredit",languageCode)); - break; - } - e.setCancelled(true); - return; - } - } - for (int index : dyeIndexes.keySet()) { - if (e.getRawSlot() == index) { - String languageCode = dyeIndexes.get(index); - languageChange.setPlayerLanguage(languageCode); - p.performCommand("frpg configurationGUI"); - e.setCancelled(true); - return; - } - } - switch (e.getRawSlot()) { - case 10: - if ((int)pStat.get("global").get(21) > 0) { - pStat.get("global").set(21, 0); - } - else { - pStat.get("global").set(21, 1); - } - statAll.put(p.getUniqueId(), pStat); - pStatClass.setData(statAll); - p.performCommand("frpg configurationGUI"); - break; - case 11: - if ((int)pStat.get("global").get(22) > 0) { - pStat.get("global").set(22, 0); - } - else { - pStat.get("global").set(22, 1); - } - statAll.put(p.getUniqueId(), pStat); - pStatClass.setData(statAll); - p.performCommand("frpg configurationGUI"); - break; - case 12: - if ((int)pStat.get("global").get(24) > 0) { - pStat.get("global").set(24, 0); - - } - else { - pStat.get("global").set(24, 1); - } - statAll.put(p.getUniqueId(), pStat); - pStatClass.setData(statAll); - p.performCommand("frpg configurationGUI"); - break; - case 13: - if ((int)pStat.get("global").get(25) > 0) { - pStat.get("global").set(25, 0); - } - else { - pStat.get("global").set(25, 1); - } - statAll.put(p.getUniqueId(), pStat); - pStatClass.setData(statAll); - p.performCommand("frpg configurationGUI"); - break; - case 14: - int numberOfBars = (int)pStat.get("global").get(28); - if (numberOfBars < 3) { - pStat.get("global").set(28, Math.max(numberOfBars+1,0)); - } - else { - pStat.get("global").set(28, 0); - } - statAll.put(p.getUniqueId(), pStat); - pStatClass.setData(statAll); - p.performCommand("frpg configurationGUI"); - break; - case 45: - p.performCommand("frpg skills"); - break; - default: - break; - } - } - - e.setCancelled(true); //So they cant take the items - } - } -} - diff --git a/src/main/java/mc/carlton/freerpg/guiEvents/ConfirmationGUIClick.java b/src/main/java/mc/carlton/freerpg/guiEvents/ConfirmationGUIClick.java deleted file mode 100644 index 31d0243..0000000 --- a/src/main/java/mc/carlton/freerpg/guiEvents/ConfirmationGUIClick.java +++ /dev/null @@ -1,137 +0,0 @@ -package mc.carlton.freerpg.guiEvents; - -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.perksAndAbilities.*; -import mc.carlton.freerpg.playerInfo.ChangeStats; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryType; -import org.bukkit.inventory.Inventory; - -import java.util.*; - -public class ConfirmationGUIClick implements Listener { - @EventHandler - public void clickEvent(InventoryClickEvent e) { - boolean proceed = true; - try { - InventoryType invType = e.getClickedInventory().getType(); - } catch (Exception except) { - proceed = false; - return; - } - if (e.getView().getTitle().equalsIgnoreCase("Confirmation Window")) { - if (e.getClickedInventory().getType() == InventoryType.PLAYER) { - e.setCancelled(true); - return; - } - if (e.getClick() != ClickType.LEFT) { - e.setCancelled(true); - } - if (e.getCursor().getType() != Material.AIR) { - e.setCancelled(true); - } - Player p = (Player) e.getWhoClicked(); - Inventory inv = e.getClickedInventory(); - if (e.getCurrentItem() != null) { - String skillName = ""; - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting","global"}; - String[] mainSkills_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery"}; - List mainSkills = Arrays.asList(mainSkills_0); - Material indicator = inv.getItem(4).getType(); - switch (indicator) { - case IRON_SHOVEL: - skillName = labels_0[0]; - break; - case IRON_AXE: - skillName = labels_0[1]; - break; - case IRON_PICKAXE: - skillName = labels_0[2]; - break; - case IRON_HOE: - skillName = labels_0[3]; - break; - case FISHING_ROD: - skillName = labels_0[4]; - break; - case BOW: - skillName = labels_0[5]; - break; - case BONE: - skillName = labels_0[6]; - break; - case IRON_SWORD: - skillName = labels_0[7]; - break; - case IRON_CHESTPLATE: - skillName = labels_0[8]; - break; - case GOLDEN_AXE: - skillName = labels_0[9]; - break; - case ANVIL: - skillName = labels_0[10]; - break; - case LEATHER_LEGGINGS: - skillName = labels_0[11]; - break; - case POTION: - skillName = labels_0[12]; - break; - case COAL: - skillName = labels_0[13]; - break; - case ENCHANTING_TABLE: - skillName = labels_0[14]; - break; - default: - break; - - } - if (e.getCurrentItem().getType() == Material.LIME_TERRACOTTA) { - UUID uuid = p.getUniqueId(); - ChangeStats refundStat = new ChangeStats(p); - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ConfigLoad loadConfig = new ConfigLoad(); - ArrayList soulsInfo = loadConfig.getSoulsInfo(); - int refundCost = (int) soulsInfo.get(1); - int souls = (int) pStatAll.get("global").get(20); - if (souls >= refundCost) { - - //Refund the skill tree - refundStat.refundSkillTree(skillName); - - //Remove the souls - Global globalClass = new Global(p); - globalClass.loseSouls(refundCost); - } - else { - LanguageSelector langManager = new LanguageSelector(p); - String refundCostString = Integer.toString(refundCost); - p.sendMessage(ChatColor.RED + refundCostString + " " + langManager.getString("requiredSouls")); - } - - p.closeInventory(); - p.performCommand("frpg skillTreeGUI " + skillName); - } - else if (e.getCurrentItem().getType() == Material.RED_TERRACOTTA) { - p.closeInventory(); - p.performCommand("frpg skillTreeGUI " + skillName); - } - } - - e.setCancelled(true); //So they cant take the items - } - } -} - diff --git a/src/main/java/mc/carlton/freerpg/guiEvents/CraftingGUIclick.java b/src/main/java/mc/carlton/freerpg/guiEvents/CraftingGUIclick.java deleted file mode 100644 index 50e8947..0000000 --- a/src/main/java/mc/carlton/freerpg/guiEvents/CraftingGUIclick.java +++ /dev/null @@ -1,61 +0,0 @@ -package mc.carlton.freerpg.guiEvents; - -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryType; -import org.bukkit.inventory.Inventory; - -public class CraftingGUIclick implements Listener { - @EventHandler - public void clickEvent(InventoryClickEvent e) { - boolean proceed = true; - try { - InventoryType invType = e.getClickedInventory().getType(); - } catch (Exception except) { - proceed = false; - return; - } - if (e.getView().getTitle().equalsIgnoreCase("Crafting Recipe")) { - if (e.getClickedInventory().getType() == InventoryType.PLAYER) { - e.setCancelled(true); - return; - } - if (e.getClick() != ClickType.LEFT) { - e.setCancelled(true); - } - if (e.getCursor().getType() != Material.AIR) { - e.setCancelled(true); - } - Player p = (Player) e.getWhoClicked(); - Inventory inv = e.getClickedInventory(); - if (e.getCurrentItem() != null) { - if (e.getCurrentItem().getType() == Material.ARROW) { - switch (inv.getItem(25).getType()) { - case TIPPED_ARROW: - p.performCommand("frpg skillTreeGUI archery"); - break; - case COW_SPAWN_EGG: - case BEE_SPAWN_EGG: - case MOOSHROOM_SPAWN_EGG: - case HORSE_SPAWN_EGG: - case SLIME_SPAWN_EGG: - p.performCommand("frpg skillTreeGUI farming"); - break; - case POTION: - p.performCommand("frpg skillTreeGUI alchemy"); - break; - default: - p.performCommand("frpg skillTreeGUI enchanting"); - break; - } - } - } - - e.setCancelled(true); //So they cant take the items - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/guiEvents/MainGUIclick.java b/src/main/java/mc/carlton/freerpg/guiEvents/MainGUIclick.java deleted file mode 100644 index 954f3d2..0000000 --- a/src/main/java/mc/carlton/freerpg/guiEvents/MainGUIclick.java +++ /dev/null @@ -1,116 +0,0 @@ -package mc.carlton.freerpg.guiEvents; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryType; - -public class MainGUIclick implements Listener { - - @EventHandler - public void clickEvent(InventoryClickEvent e) { - boolean proceed = true; - try { - InventoryType invType = e.getClickedInventory().getType(); - } catch (Exception except) { - proceed = false; - } - //Check to see if its the GUI menu - if (proceed) { - if (e.getView().getTitle().equalsIgnoreCase("Skills")) { - if (e.getClickedInventory().getType() == InventoryType.PLAYER) { - e.setCancelled(true); - return; - } - if (e.getClick() != ClickType.LEFT) { - e.setCancelled(true); - } - if (e.getCursor().getType() != Material.AIR) { - e.setCancelled(true); - } - Player p = (Player) e.getWhoClicked(); - //Determine what they selected and what to do - if (e.getCurrentItem() != null) { - switch (e.getCurrentItem().getType()) { - case NETHER_STAR: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI global"); - break; - case IRON_SHOVEL: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI digging"); - break; - case IRON_AXE: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI woodcutting"); - break; - case IRON_PICKAXE: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI mining"); - break; - case IRON_HOE: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI farming"); - break; - case FISHING_ROD: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI fishing"); - break; - case BOW: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI archery"); - break; - case BONE: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI beastMastery"); - break; - case IRON_SWORD: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI swordsmanship"); - break; - case IRON_CHESTPLATE: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI defense"); - break; - case GOLDEN_AXE: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI axeMastery"); - break; - case ANVIL: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI repair"); - break; - case LEATHER_LEGGINGS: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI agility"); - break; - case POTION: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI alchemy"); - break; - case COAL: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI smelting"); - break; - case ENCHANTING_TABLE: - p.closeInventory(); - p.performCommand("frpg skillTreeGUI enchanting"); - break; - case REDSTONE: - p.closeInventory(); - p.performCommand("frpg configurationGUI"); - break; - default: - break; - } - } - - - e.setCancelled(true); //So they cant take the items - } - - } - } -} \ No newline at end of file diff --git a/src/main/java/mc/carlton/freerpg/guiEvents/MaxPassiveLevels.java b/src/main/java/mc/carlton/freerpg/guiEvents/MaxPassiveLevels.java deleted file mode 100644 index 6652839..0000000 --- a/src/main/java/mc/carlton/freerpg/guiEvents/MaxPassiveLevels.java +++ /dev/null @@ -1,104 +0,0 @@ -package mc.carlton.freerpg.guiEvents; - -public class MaxPassiveLevels { - - public int findMaxLevel(String skillName,int index) { - int maxLevel = Integer.MAX_VALUE; - switch (skillName) { - case "digging": - switch (index) { - case 2: - maxLevel = 2400; - break; - default: - break; - } - break; - case "archery": - case "woodcutting": - switch (index) { - case 2: - maxLevel = 2000; - break; - default: - break; - } - break; - case "mining": - switch (index) { - case 2: - maxLevel = 2000; - break; - case 3: - maxLevel = 10000; - break; - default: - break; - } - break; - case "farming": - case "fishing": - switch (index) { - case 2: - case 3: - maxLevel = 2000; - break; - default: - break; - } - break; - case "beastMastery": - switch (index) { - case 2: - maxLevel = 4000; - break; - default: - break; - } - break; - case "swordsmanship": - switch (index) { - case 2: - maxLevel = 5000; - break; - default: - break; - } - break; - case "defense": - switch (index) { - case 2: - maxLevel = 9900; - break; - case 3: - maxLevel = 2000; - break; - default: - break; - } - break; - case "axeMastery": - switch (index) { - case 2: - maxLevel = 10000; - break; - default: - break; - } - break; - case "agility": - switch (index) { - case 1: - maxLevel = 2000; - break; - default: - break; - } - break; - default: - break; - } - - return maxLevel; - } -} diff --git a/src/main/java/mc/carlton/freerpg/guiEvents/SkillsConfigGUIClick.java b/src/main/java/mc/carlton/freerpg/guiEvents/SkillsConfigGUIClick.java deleted file mode 100644 index 72101e9..0000000 --- a/src/main/java/mc/carlton/freerpg/guiEvents/SkillsConfigGUIClick.java +++ /dev/null @@ -1,132 +0,0 @@ -package mc.carlton.freerpg.guiEvents; - -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryType; -import org.bukkit.inventory.Inventory; - -import java.util.*; - -public class SkillsConfigGUIClick implements Listener { - @EventHandler - public void clickEvent(InventoryClickEvent e) { - boolean proceed = true; - try { - InventoryType invType = e.getClickedInventory().getType(); - } catch (Exception except) { - proceed = false; - return; - } - String[] titles_0 = {"Digging", "Woodcutting", "Mining", "Farming", "Fishing", "Archery", "Beast Mastery", "Swordsmanship", "Defense", "Axe Mastery", "Repair", "Agility", "Alchemy", "Smelting", "Enchanting"}; - String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", "smelting", "enchanting"}; - String[] passiveLabels_0 = {"repair", "agility", "alchemy", "smelting", "enchanting"}; - List labels = Arrays.asList(labels_0); - List skillTitles = Arrays.asList(titles_0); - List passiveLabels = Arrays.asList(passiveLabels_0); - for (String skillTitle : skillTitles) { - if (e.getView().getTitle().equalsIgnoreCase(skillTitle + " Configuration")) { - String skillName = labels.get(skillTitles.indexOf(skillTitle)); - if (e.getClickedInventory().getType() == InventoryType.PLAYER) { - e.setCancelled(true); - return; - } - if (e.getClick() != ClickType.LEFT) { - e.setCancelled(true); - } - if (e.getCursor().getType() != Material.AIR) { - e.setCancelled(true); - } - Player p = (Player) e.getWhoClicked(); - LanguageSelector lang = new LanguageSelector(p); - Inventory inv = e.getClickedInventory(); - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStat = pStatClass.getPlayerData(); - if (e.getCurrentItem() != null) { - PlayerStats languageChange = new PlayerStats(p); - if (e.getCurrentItem().getType().equals(Material.ARROW)) { - p.performCommand("frpg skillTreeGUI " + skillName); - } - else if (e.getRawSlot() == 19) {//Toggle EXPBar for skill - pStatClass.togglePlayerSkillExpBar(skillName); - p.performCommand("frpg skillConfigGUI " + skillName); - } - else if(e.getRawSlot() == 20 && !passiveLabels.contains(skillName)) { //Toggle Ability for skill - pStatClass.togglePlayerSkillAbility(skillName); - p.performCommand("frpg skillConfigGUI " + skillName); - } - else { - switch (skillName) { - case "digging": - if (e.getSlot() == 37) { - p.performCommand("frpg flintToggle"); - p.performCommand("frpg skillConfigGUI " + skillName); - } else if (e.getSlot() == 38) { - p.performCommand("frpg megaDigToggle"); - p.performCommand("frpg skillConfigGUI " + skillName); - } - break; - case "woodcutting": - if (e.getSlot() == 37) { - p.performCommand("frpg leafBlowerToggle"); - p.performCommand("frpg skillConfigGUI " + skillName); - } - break; - case "mining": - if (e.getSlot() == 37) { - p.performCommand("frpg veinMinerToggle"); - p.performCommand("frpg skillConfigGUI " + skillName); - } - break; - case "fishing": - if (e.getSlot() == 37) { - p.performCommand("frpg grappleToggle"); - p.performCommand("frpg skillConfigGUI " + skillName); - } else if (e.getSlot() == 38) { - p.performCommand("frpg hotRodToggle"); - p.performCommand("frpg skillConfigGUI " + skillName); - } - break; - case "axeMastery": - if (e.getSlot() == 37) { - p.performCommand("frpg holyAxeToggle"); - p.performCommand("frpg skillConfigGUI " + skillName); - } - break; - case "agility": - if (e.getSlot() == 37) { - p.performCommand("frpg speedToggle"); - p.performCommand("frpg skillConfigGUI " + skillName); - } - break; - case "alchemy": - if (e.getSlot() == 37) { - p.performCommand("frpg potionToggle"); - p.performCommand("frpg skillConfigGUI " + skillName); - } - break; - case "smelting": - if (e.getSlot() == 37) { - p.performCommand("frpg flamePickToggle"); - p.performCommand("frpg skillConfigGUI " + skillName); - } - break; - default: - break; - } - } - - e.setCancelled(true); //So they cant take the items - } - break; - } - } - } -} - diff --git a/src/main/java/mc/carlton/freerpg/guiEvents/SkillsGUIclick.java b/src/main/java/mc/carlton/freerpg/guiEvents/SkillsGUIclick.java deleted file mode 100644 index 7179d72..0000000 --- a/src/main/java/mc/carlton/freerpg/guiEvents/SkillsGUIclick.java +++ /dev/null @@ -1,442 +0,0 @@ -package mc.carlton.freerpg.guiEvents; -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.perksAndAbilities.*; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryType; - -import java.util.*; - -public class SkillsGUIclick implements Listener { - - @EventHandler - public void clickEvent(InventoryClickEvent e) { - boolean proceed = true; - try { - InventoryType invType = e.getClickedInventory().getType(); - } catch (Exception except) { - proceed = false; - return; - } - - String[] titles_0 = {"Digging", "Woodcutting", "Mining", "Farming", "Fishing", "Archery", "Beast Mastery", "Swordsmanship", "Defense", "Axe Mastery", "Repair", "Agility", "Alchemy", "Smelting", "Enchanting"}; - String[] labels = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", "smelting", "enchanting"}; - List titles = Arrays.asList(titles_0); - String title = e.getView().getTitle(); - int titleIndex = titles.indexOf(title); - //Check to see if its the GUI menu - if (proceed) { - if (titleIndex != -1) { - if (e.getClickedInventory().getType() == InventoryType.PLAYER) { - e.setCancelled(true); - return; - } - if (e.getClick() != ClickType.LEFT) { - e.setCancelled(true); - } - if (e.getCursor().getType() != Material.AIR) { - e.setCancelled(true); - } - Player p = (Player) e.getWhoClicked(); - LanguageSelector langManager = new LanguageSelector(p); - UUID uuid = p.getUniqueId(); - String skillName = labels[titleIndex]; - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ArrayList pStats = pStatAll.get(skillName); - MaxPassiveLevels passiveMax = new MaxPassiveLevels(); - int passiveTokens = pStats.get(2).intValue(); - //Determine what they selected and what to do - if (e.getCurrentItem() != null) { - switch (e.getCurrentItem().getType()) { - case ARROW: - p.closeInventory(); - p.performCommand("frpg skills"); - break; - case COMPOSTER: - if ((int) pStatAll.get("global").get(20) >= 250 && (int) pStatAll.get("global").get(9) > 0) { - p.closeInventory(); - p.performCommand("frpg confirmationGUI " + skillName); - } - else { - if ((int) pStatAll.get("global").get(9) > 0) { - ConfigLoad loadConfig = new ConfigLoad(); - ArrayList soulsInfo = loadConfig.getSoulsInfo(); - String refundCost = Integer.toString(soulsInfo.get(1)); - p.sendMessage(ChatColor.RED + refundCost + " " + langManager.getString("refundSkill")); - } - else { - p.sendMessage(ChatColor.RED + langManager.getString("needToUnlock") + " " + ChatColor.BOLD + langManager.getString("globalPerkTitle7") + ChatColor.RESET + ChatColor.RED.toString() + " " + langManager.getString("refundSkill2")); - } - } - break; - case RED_TERRACOTTA: - if (e.getSlot() == 13 || e.getSlot() == 31 || e.getSlot() == 7 || e.getSlot() == 43 || e.getSlot() == 20 || e.getSlot() == 23) { - p.sendMessage(ChatColor.RED + langManager.getString("perkRequirement")); - } else if (e.getSlot() == 26) { - p.sendMessage(ChatColor.RED + langManager.getString("perkRequirementM")); - } - break; - case PINK_TERRACOTTA: - case YELLOW_TERRACOTTA: - if (pStats.get(3).intValue() > 0) { - pStats.set(3, pStats.get(3).intValue() - 1); - switch (e.getSlot()) { - case 20: - case 11: - pStats.set(7, pStats.get(7).intValue() + 1); - break; - case 29: - pStats.set(8, pStats.get(8).intValue() + 1); - break; - case 23: - case 13: - pStats.set(9, pStats.get(9).intValue() + 1); - break; - case 31: - pStats.set(10, pStats.get(10).intValue() + 1); - break; - case 7: - pStats.set(11, pStats.get(11).intValue() + 1); - break; - case 43: - pStats.set(12, pStats.get(12).intValue() + 1); - break; - case 26: - pStats.set(13, pStats.get(13).intValue() + 1); - if (skillName.equals("farming")) { - pStatAll.put(skillName, pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - Farming farmingClass = new Farming(p); - farmingClass.oneWithNatureStart(); - } - else if (skillName.equals("fishing")) { - pStatAll.put(skillName, pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - Fishing fishingClass = new Fishing(p); - fishingClass.fishPersonStart(); - } - else if (skillName.equals("defense")) { - pStatAll.put(skillName, pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - Defense defenseClass = new Defense(p); - defenseClass.hearty(); - } - else if (skillName.equals("agility")) { - pStatAll.put(skillName, pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - Agility agilityClass = new Agility(p); - agilityClass.gracefulFeetStart(); - } - break; - } - pStatAll.put(skillName, pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - } else { - p.sendMessage(ChatColor.RED + langManager.getString("noSkillTokens")); - } - p.performCommand("frpg skillTreeGUI " + skillName); - break; - - case GREEN_TERRACOTTA: - p.sendMessage(ChatColor.RED + langManager.getString("maxedOutPerk")); - break; - case RED_DYE: - if (passiveTokens > 0) { - upgradePassive(passiveTokens, pStats,e,Integer.MAX_VALUE,1); - pStatAll.put(skillName, pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - } else { - p.sendMessage(ChatColor.RED + langManager.getString("noPassiveTokens")); - } - - p.performCommand("frpg skillTreeGUI " + skillName); - break; - case GREEN_DYE: - int maxLevel2 = passiveMax.findMaxLevel(skillName,2); - int currentLevel2 =pStats.get(5).intValue(); - if (currentLevel2 >= maxLevel2) { - p.sendMessage(ChatColor.RED + langManager.getString("maxedOutPerk")); - } - else { - if (passiveTokens > 0) { - upgradePassive(passiveTokens, pStats,e,maxLevel2,2); - pStatAll.put(skillName, pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - } else { - p.sendMessage(ChatColor.RED + langManager.getString("noPassiveTokens")); - } - } - p.performCommand("frpg skillTreeGUI " + skillName); - break; - case BLUE_DYE: - int maxLevel3 = passiveMax.findMaxLevel(skillName,3); - int currentLevel3 = pStats.get(6).intValue(); - if (currentLevel3 >= maxLevel3) { - p.sendMessage(ChatColor.RED + langManager.getString("maxedOutPerk")); - } - else { - if (passiveTokens > 0) { - upgradePassive(passiveTokens, pStats,e,maxLevel3,3); - pStatAll.put(skillName, pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - } else { - p.sendMessage(ChatColor.RED + langManager.getString("noPassiveTokens")); - } - } - p.performCommand("frpg skillTreeGUI " + skillName); - break; - case REDSTONE: - p.closeInventory(); - p.performCommand("frpg skillConfigGUI " + skillName); - break; - case CRAFTING_TABLE: - if (skillName.equalsIgnoreCase("farming")) { - switch (e.getRawSlot()) { - case 48: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "farming1"); - break; - case 49: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "farming2"); - break; - case 50: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "farming3"); - break; - case 51: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "farming4"); - break; - case 52: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "farming5"); - break; - default: - break; - } - } - else if (skillName.equalsIgnoreCase("archery")) { - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "archery1"); - } - else if (skillName.equalsIgnoreCase("enchanting")) { - switch (e.getRawSlot()) { - case 39: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "enchanting1"); - break; - case 40: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "enchanting2"); - break; - case 41: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "enchanting3"); - break; - case 42: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "enchanting4"); - break; - case 43: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "enchanting5"); - break; - case 48: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "enchanting6"); - break; - case 49: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "enchanting7"); - break; - case 50: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "enchanting8"); - break; - case 51: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "enchanting9"); - break; - case 52: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "enchanting10"); - break; - default: - break; - } - } - if (skillName.equalsIgnoreCase("alchemy")) { - switch (e.getRawSlot()) { - case 48: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "alchemy1"); - break; - case 49: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "alchemy2"); - break; - case 50: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "alchemy3"); - break; - case 51: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "alchemy4"); - break; - case 52: - p.closeInventory(); - p.performCommand("frpg craftingGUI " + "alchemy5"); - break; - } - } - default: - break; - } - e.setCancelled(true); //So they cant take the items - } - } else if (title.equalsIgnoreCase("Global")) { - if (e.getClickedInventory().getType() == InventoryType.PLAYER) { - e.setCancelled(true); - return; - } - if (e.getClick() != ClickType.LEFT) { - e.setCancelled(true); - } - if (e.getCursor().getType() != Material.AIR) { - e.setCancelled(true); - } - Player p = (Player) e.getWhoClicked(); - LanguageSelector langManager = new LanguageSelector(p); - String skillName = "global"; - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(p.getUniqueId()); - ArrayList pStats = pStatAll.get(skillName); - if (e.getCurrentItem() != null && e.getSlot() < 54) { - switch (e.getCurrentItem().getType()) { - case ARROW: - p.closeInventory(); - p.performCommand("frpg skills"); - break; - case RED_TERRACOTTA: - if (e.getSlot() == 3 || e.getSlot() == 21 || e.getSlot() == 39) { - p.sendMessage(ChatColor.RED + langManager.getString("requiredGlobalPerks0")); - } else if (e.getSlot() == 24) { - p.sendMessage(ChatColor.RED + langManager.getString("globalPerkTitle3") + ", " + langManager.getString("globalPerkTitle4") + ", " + langManager.getString("globalPerkTitle5") + " " + langManager.getString("requiredGlobalPerks1")); - } else if (e.getSlot() == 6 || e.getSlot() == 42) { - p.sendMessage(ChatColor.RED + langManager.getString("globalPerkTitle7") + " " + langManager.getString("requiredGlobalPerks2")); - } else if (e.getSlot() == 26) { - p.sendMessage(ChatColor.RED + langManager.getString("requiredGlobalPerks3")); - } - break; - case PINK_TERRACOTTA: - if (pStats.get(1).intValue() > 0) { - pStats.set(1, pStats.get(1).intValue() - 1); - switch (e.getSlot()) { - case 1: - pStats.set(2, pStats.get(2).intValue() + 1); - break; - case 19: - pStats.set(3, pStats.get(3).intValue() + 1); - break; - case 37: - pStats.set(4, pStats.get(4).intValue() + 1); - break; - case 3: - pStats.set(5, pStats.get(5).intValue() + 1); - Global globalClass5 = new Global(p); - globalClass5.skillTokenBoost(5); - break; - case 21: - pStats.set(6, pStats.get(6).intValue() + 1); - Global globalClass6 = new Global(p); - globalClass6.skillTokenBoost(6); - break; - case 39: - pStats.set(7, pStats.get(7).intValue() + 1); - Global globalClass7 = new Global(p); - globalClass7.skillTokenBoost(7); - break; - case 6: - pStats.set(8, pStats.get(8).intValue() + 1); - break; - case 24: - pStats.set(9, pStats.get(9).intValue() + 1); - - /* Old Skill_3b perk - Global globalClass9 = new Global(p); - globalClass9.passiveTokenBoost(); - */ - break; - case 42: - pStats.set(10, pStats.get(10).intValue() + 1); - break; - case 26: - pStats.set(11, pStats.get(11).intValue() + 1); - break; - } - pStatAll.put(skillName, pStats); - statAll.put(p.getUniqueId(), pStatAll); - pStatClass.setData(statAll); - } else { - p.sendMessage(ChatColor.RED + langManager.getString("noSkillTokens")); - } - p.performCommand("frpg skillTreeGUI " + skillName); - break; - - case GREEN_TERRACOTTA: - p.sendMessage(ChatColor.RED + langManager.getString("maxedOutPerk")); - break; - - } - e.setCancelled(true); //So they cant take the items - } - } - } - } - - public void upgradePassive(int passiveTokens, ArrayList pStats, InventoryClickEvent e, int maxPassiveLevel, int passiveSkillIndex) { - ConfigLoad configLoad = new ConfigLoad(); - ArrayList tokensInfo = configLoad.getTokensInfo(); - passiveSkillIndex += 3; //Sets the index to the proper value - int rightClickInvestment = (int) Math.round(tokensInfo.get(9)); - int shiftClickInvestment = (int) Math.round(tokensInfo.get(10)); - int currentPassiveSkillLevel = pStats.get(passiveSkillIndex).intValue(); - int investment = 0; - if (e.isShiftClick() && e.isRightClick() && configLoad.isShiftRightClickInvestAll()) { - investment = passiveTokens; - } - else if (e.isShiftClick()) { - investment = Math.min(passiveTokens,shiftClickInvestment); - } - else if (e.isRightClick()) { - investment = Math.min(passiveTokens,rightClickInvestment); - } - else { - investment = 1; - } - if (investment + currentPassiveSkillLevel > maxPassiveLevel) { - investment = maxPassiveLevel - currentPassiveSkillLevel; - } - pStats.set(2, passiveTokens - investment); - pStats.set(passiveSkillIndex, pStats.get(passiveSkillIndex).intValue() + investment); - } -} diff --git a/src/main/java/mc/carlton/freerpg/guiTools/GuiDisplayStatistic.java b/src/main/java/mc/carlton/freerpg/guiTools/GuiDisplayStatistic.java deleted file mode 100644 index 557e635..0000000 --- a/src/main/java/mc/carlton/freerpg/guiTools/GuiDisplayStatistic.java +++ /dev/null @@ -1,63 +0,0 @@ -package mc.carlton.freerpg.guiTools; - -public class GuiDisplayStatistic { - private String statisticName; - private Object statistic; - private String statisticNameColor; - private String statisticColor; - - /** - * Constructor - * @param statisticName name of the statistic - * @param statistic value of the statistic - * @param statisticNameColor color of the statistic name (ex. ChatColor.BOLD + ChatColor.WHITE.toString()) - * @param statisticColor color of the statistic (ex. ChatColor.ITALIC + ChatColor.GRAY.toString()) - */ - public GuiDisplayStatistic(String statisticName, Object statistic,String statisticNameColor, String statisticColor) { - this.statisticName = statisticName; - this.statistic = statistic; - this.statisticNameColor = statisticNameColor; - this.statisticColor = statisticColor; - } - - /** - * Constructor - * @param statisticName name of the statistic - * @param statistic value of the statistic - */ - public GuiDisplayStatistic(String statisticName, Object statistic) { - this(statisticName,statistic,null,null); - } - - public String getStatisticNameColor() { - return statisticNameColor; - } - - public String getStatisticColor() { - return statisticColor; - } - - public Object getStatistic() { - return statistic; - } - - public String getStatisticName() { - return statisticName; - } - - public void setStatisticNameColor(String statisticNameColor) { - this.statisticNameColor = statisticNameColor; - } - - public void setStatisticColor(String statisticColor) { - this.statisticColor = statisticColor; - } - - public void setStatistic(Object statistic) { - this.statistic = statistic; - } - - public void setStatisticName(String statisticName) { - this.statisticName = statisticName; - } -} diff --git a/src/main/java/mc/carlton/freerpg/guiTools/GuiIconColors.java b/src/main/java/mc/carlton/freerpg/guiTools/GuiIconColors.java deleted file mode 100644 index 341c54b..0000000 --- a/src/main/java/mc/carlton/freerpg/guiTools/GuiIconColors.java +++ /dev/null @@ -1,84 +0,0 @@ -package mc.carlton.freerpg.guiTools; - -import org.bukkit.ChatColor; - -public class GuiIconColors { - private String nameColor; - private String descriptionColor; - private String statisticNamesColor; - private String statisticsColor; - - /** - * Constructor for ThemeColors - * @param nameColor color of gui icon names - * @param descriptionColor color of gui icon descriptions - * @param statisticNameColor color of statistic names on the gui icon - * @param statisticColor color of statistics on the gui icon - */ - public GuiIconColors(String nameColor, String descriptionColor, String statisticNameColor, String statisticColor) { - this.nameColor = nameColor; - this.descriptionColor = descriptionColor; - this.statisticNamesColor = statisticNameColor; - this.statisticsColor = statisticColor; - } - - /** - * Default constructor for ThemeColors - * Sets: - * nameColor <- Bold and white - * descriptionColor <- Gray and italic - * statisticNameColor <- Gray - * StatisticColor <- Gold - */ - public GuiIconColors() { - this(ChatColor.WHITE.toString() + ChatColor.BOLD.toString(),ChatColor.GRAY.toString() + ChatColor.ITALIC.toString(),ChatColor.GRAY.toString(),ChatColor.GOLD.toString()); - } - - public String getDescriptionColor() { - return descriptionColor; - } - - public String getNameColor() { - return nameColor; - } - - public String getStatisticsColor() { - return statisticsColor; - } - - public String getStatisticNamesColor() { - return statisticNamesColor; - } - - public void setDescriptionColor(String descriptionColor) { - this.descriptionColor = descriptionColor; - } - - public void setNameColor(String nameColor) { - this.nameColor = nameColor; - } - - public void setStatisticsColor(String statisticsColor) { - this.statisticsColor = statisticsColor; - } - - public void setStatisticNamesColor(String statisticNamesColor) { - this.statisticNamesColor = statisticNamesColor; - } - - public void setDescriptionColor(ChatColor descriptionColor) { - this.descriptionColor = descriptionColor.toString(); - } - - public void setNameColor(ChatColor nameColor) { - this.nameColor = nameColor.toString(); - } - - public void setStatisticColor(ChatColor statisticColor) { - this.statisticsColor = statisticColor.toString(); - } - - public void setStatisticNameColor(ChatColor statisticNameColor) { - this.statisticNamesColor = statisticNameColor.toString(); - } -} diff --git a/src/main/java/mc/carlton/freerpg/guiTools/GuiItem.java b/src/main/java/mc/carlton/freerpg/guiTools/GuiItem.java deleted file mode 100644 index fbaacbd..0000000 --- a/src/main/java/mc/carlton/freerpg/guiTools/GuiItem.java +++ /dev/null @@ -1,421 +0,0 @@ -package mc.carlton.freerpg.guiTools; - -import mc.carlton.freerpg.globalVariables.StringsAndOtherData; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.attribute.Attribute; -import org.bukkit.attribute.AttributeModifier; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemFlag; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -/* - * This class acts as a wrapper class for an ItemStack to be used in a gui. Appeands additionally information about the item - * And uses tools to make text output neater and easier to implement. - * The GuiItem object is mutable - */ -public class GuiItem { - private int index; - private ItemStack item; - private Inventory gui; - private String name; - private String description; - private GuiIconColors textColors; - private ArrayList statitistics; - private ArrayList specialLoreLines; - private boolean themeExemption; - - /** - * Constructor for GuiItem - * @param item ItemStack to be placed in the GUI - * @param index index at which the ItemStack will be placed in the GUI - * @param gui Inventory that acts as the GUI - */ - public GuiItem(ItemStack item, int index,Inventory gui) { - this(item,index,gui,new GuiIconColors()); - } - - /** - * Constructor for GuiItem - * @param itemType Material of ItemStack to be placed in GUI - * @param index index at which the ItemStack will be placed in the GUI - * @param gui Inventory that acts as the GUI - */ - public GuiItem(Material itemType, int index,Inventory gui) { - this(new ItemStack(itemType),index,gui); - } - - /** - * Constructor for GuiItem - * @param itemType Material of ItemStack to be placed in GUI - * @param index index at which the ItemStack will be placed in the GUI - * @param gui GuiWrapper that acts as the GUI - */ - public GuiItem(Material itemType, int index,GuiWrapper gui) { - this(new ItemStack(itemType),index,gui.getGui()); - } - - /** - * Constructor for GuiItem - * @param item ItemStack to be placed in the GUI - * @param index index at which the itemstack will be placed in the GUI - * @param gui GuiWrapper that acts as the GUI - */ - public GuiItem(ItemStack item, int index,GuiWrapper gui) { - this(item,index,gui.getGui()); - } - - - /** - * Constructor for GuiItem - * @param item ItemStack to be placed in the GUI - * @param index index at which the itemstack will be placed in the GUI - * @param textColors ThemeColor object to determine display colors - * @param gui GuiWrapper that acts as the GUI - */ - public GuiItem(ItemStack item, int index, GuiWrapper gui, GuiIconColors textColors) { - this(item,index,gui.getGui(), textColors); - } - - /** - * Constructor for GuiItem - * @param item ItemStack to be placed in the GUI - * @param index index at which the itemstack will be placed in the GUI - * @param textColors ThemeColor object to determine display colors - * @param gui Inventory that acts as the GUI - */ - public GuiItem(ItemStack item, int index, Inventory gui, GuiIconColors textColors) { - this.item = item; - hideItemInformation(); //Hides things like enchantments, potion info, and attributes - this.gui = gui; - this.textColors = textColors; - this.statitistics = new ArrayList<>(); - this.specialLoreLines = new ArrayList<>(); - if (!isIndexInsideGUI(index)) { - throw(new IllegalArgumentException("Index outside of Inventory size")); - } - this.index = index; - } - - /** - * Setter for item - * @param item ItemStack to be placed in the gui - */ - public void setItem(ItemStack item) { - this.item = item; - } - - /** - * Setter for index - * @param index index at which item is placed - */ - public void setIndex(int index) { - if (!isIndexInsideGUI(index)) { - throw(new IllegalArgumentException("Index outside of Inventory size")); - } - this.index = index; - } - - /** - * Setter for item description color, also changes the item's description to match new color - * @param ColorString string of chat colors (ex. ChatColor.BOLD + ChatColor.WHITE.toString() ) - */ - public void setDescriptionColor(String ColorString) { - textColors.setDescriptionColor(ColorString); - setDescription(this.description); - } - - /** - * Setter for item description color, also changes the item's description to match new color - * @param color a chat color (ex. ChatColor.WHITE) - */ - public void setDescriptionColor(ChatColor color) { - textColors.setDescriptionColor(color); - setDescription(this.description); - } - - /** - * Setter for item name color, also changes the item's name to match new color - * @param ColorString string of chat colors (ex. ChatColor.BOLD + ChatColor.WHITE.toString() ) - */ - public void setNameColor(String ColorString) { - textColors.setNameColor(ColorString); - setName(this.name); - } - - /** - * Setter for item name color, also changes the item's name to match new color - * @param color a chat color (ex. ChatColor.WHITE) - */ - public void setNameColor(ChatColor color) { - textColors.setNameColor(color); - setName(this.name); - } - - /** - * Setter for Statistic name color, changes item's lore to account for color changs - * @param ColorString - */ - public void setStatisticNameColor(String ColorString) { - textColors.setStatisticNamesColor(ColorString); - setStatitistics(this.statitistics); - } - - /** - * Setter for Statistic name color, changes item's lore to account for color changs - * @param color - */ - public void setStatisticNameColor(ChatColor color) { - textColors.setStatisticNameColor(color); - setStatitistics(this.statitistics); - } - - /** - * Setter for Statistic color, changes item's lore to account for color changs - * @param ColorString - */ - public void setStatisticColor(String ColorString) { - textColors.setStatisticsColor(ColorString); - setStatitistics(this.statitistics); - } - - /** - * Setter for Statistic color, changes item's lore to account for color changs - * @param color - */ - public void setStatisticColor(ChatColor color) { - textColors.setStatisticColor(color); - setStatitistics(this.statitistics); - } - - - /** - * Sets the name of the item - * @param name String acting as name - */ - public void setName(String name) { - if (name == null || name.isEmpty()) { - return; //Do nothing for empty name - } - this.name = name; - ItemMeta itemMeta = item.getItemMeta(); - itemMeta.setDisplayName(textColors.getNameColor() + name); - item.setItemMeta(itemMeta); - } - - /** - * Sets the description (description) of the item and updates the item lore - * @param description String acting as description, will be automatically divided into multiple lines if too long. - */ - public void setDescription(String description) { - if (description == null || description.isEmpty()) { - return; //Do nothing for empty description - } - this.description = description; - setLore(); - } - - /** - * Adds a statistic to the item's lore and updates the lore - * @param guiDisplayStatistic - */ - public void addStatistic(GuiDisplayStatistic guiDisplayStatistic) { - this.statitistics.add(guiDisplayStatistic); - setLore(); - } - - /** - * Adds a statistic to the item's lore and updates the lore - * @param statisticName display name of the statistic - * @param statistic value of the statistic to add, can be any object with a toString method. - */ - public void addStatistic(String statisticName, Object statistic) { - this.statitistics.add(new GuiDisplayStatistic(statisticName,statistic)); - setLore(); - } - - /** - * Setter for statistics, adds statistics to item's lore - * @param statitistics - */ - public void setStatitistics(ArrayList statitistics) { - this.statitistics = statitistics; - setLore(); - } - - /** - * Adds a special lore line between statistics and the description, updates the lore - * @param loreLine - */ - public void addSpecialLoreLine(String loreLine) { - this.specialLoreLines.add(loreLine); - setLore(); - } - - /** - * Adds special lore lines between statistics and the description, updates the lore - * @param specialLoreLines - */ - public void setSpecialLoreLines(ArrayList specialLoreLines) { - this.specialLoreLines = specialLoreLines; - setLore(); - } - - /** - * Changes the Material type of the instance variable item - * @param itemType Material that item will be changed to - */ - public void setItemType(Material itemType) { - item.setType(itemType); - } - - /** - * Changes the item amount of the instance variable item - * @param amount amount of item to be displayed - */ - public void setItemAmount(int amount) { - item.setAmount(amount); - } - - /** - * Settter for GUI - * @param gui Inventory that will act as the gui - */ - public void setGui(Inventory gui) { - this.gui = gui; - } - - /** - * Setter for themeExemption - * @param themeExemption set to true to exempt the item from the color theme of GuiWrapper, false otherwise - */ - public void setThemeExemption(boolean themeExemption) { - this.themeExemption = themeExemption; - } - - /** - * Getter for theme exemption - * @return true if this item is exempt from the GuiWrapper color theme, false otherwise - */ - public boolean isThemeExemption() { - return themeExemption; - } - - /** - * Getter for item - * @return the instance variable item - */ - public ItemStack getItem() { - return item; - } - - /** - * Getter for index - * @return the instance variable index - */ - public int getIndex() { - return index; - } - - /** - * Getter for gui - * @return the instance variable gui - */ - public Inventory getGui() { - return gui; - } - - /** - * Adds enchantment glow to the item - */ - public void addEnchantmentGlow() { - item.addUnsafeEnchantment(Enchantment.LOYALTY,1); - } - - /** - * Removes an item flag from the GuiItem - * @param itemFlag item flag to remove (ex. ItemFlag.HIDE_ENCHANTS) - */ - public void showItemFlag(ItemFlag itemFlag) { - ItemMeta itemMeta = item.getItemMeta(); - if (itemMeta.hasItemFlag(itemFlag)) { - itemMeta.removeItemFlags(itemFlag); - } - } - - private boolean isIndexInsideGUI(int index) { - if (index < gui.getSize()) { - return true; - } else { - return false; - } - } - - private void hideItemInformation(){ - ItemMeta itemMeta = item.getItemMeta(); - itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); - itemMeta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); - itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); - item.setItemMeta(itemMeta); - } - - private void setLore() { - ItemMeta itemMeta = item.getItemMeta(); - ArrayList loreLines = new ArrayList<>(); - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - ArrayList splitDescriptionLines = stringsAndOtherData.getStringLines(description); - for (GuiDisplayStatistic guiDisplayStatistic : statitistics) { - loreLines.add(getLoreLineStringFromStatistic(guiDisplayStatistic,false)); - } - for (String specialLoreLine : specialLoreLines) { - loreLines.add(specialLoreLine); - } - for (String descriptionLine : splitDescriptionLines) { - loreLines.add(textColors.getDescriptionColor() + descriptionLine); - } - itemMeta.setLore(loreLines); - item.setItemMeta(itemMeta); - } - - public void refreshLore(boolean forceTheme) { - ItemMeta itemMeta = item.getItemMeta(); - ArrayList loreLines = new ArrayList<>(); - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - ArrayList splitDescriptionLines = stringsAndOtherData.getStringLines(description); - for (GuiDisplayStatistic guiDisplayStatistic : statitistics) { - loreLines.add(getLoreLineStringFromStatistic(guiDisplayStatistic,forceTheme)); - } - for (String specialLoreLine : specialLoreLines) { - loreLines.add(specialLoreLine); - } - for (String descriptionLine : splitDescriptionLines) { - loreLines.add(textColors.getDescriptionColor() + descriptionLine); - } - itemMeta.setLore(loreLines); - item.setItemMeta(itemMeta); - } - - private String getLoreLineStringFromStatistic(GuiDisplayStatistic guiDisplayStatistic, boolean forceTheme) { - String statisticName = guiDisplayStatistic.getStatisticName(); - String statistic = guiDisplayStatistic.getStatistic().toString(); - String loreLine = ""; - if (guiDisplayStatistic.getStatisticNameColor() == null || forceTheme) { - loreLine += textColors.getStatisticNamesColor() + statisticName + ": "; - } else { - loreLine += guiDisplayStatistic.getStatisticNameColor() + statisticName + ": "; - } - if (guiDisplayStatistic.getStatisticColor() == null || forceTheme) { - loreLine += ChatColor.RESET + textColors.getStatisticsColor() + statistic; - } else { - loreLine += ChatColor.RESET + guiDisplayStatistic.getStatisticColor() + statistic; - } - return loreLine; - } -} diff --git a/src/main/java/mc/carlton/freerpg/guiTools/GuiWrapper.java b/src/main/java/mc/carlton/freerpg/guiTools/GuiWrapper.java deleted file mode 100644 index 5e64a87..0000000 --- a/src/main/java/mc/carlton/freerpg/guiTools/GuiWrapper.java +++ /dev/null @@ -1,136 +0,0 @@ -package mc.carlton.freerpg.guiTools; - -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; - -import java.util.HashMap; -import java.util.Map; - -/* -This class acts as a Wrapper for an inventory acting as a gui -It adds additional methods to the inventory and reduces lines of code when implementing a GUI -The GuiWrapper object is mutable - */ -public class GuiWrapper { - private Map items = new HashMap<>(); - private Player p; - private Inventory gui; - private GuiIconColors theme; - - /** - * Constructor for gui - * @param p Player who will see the gui - * @param gui The inventory acting as the gui - */ - public GuiWrapper(Player p, Inventory gui) { - this.gui = gui; - this.p = p; - } - - /** - * Constrcutor for gui - * @param p Player who will see the GUI - * @param guiName GUI display name - * @param guiSize number of item slots in GUI - */ - public GuiWrapper(Player p, String guiName, int guiSize) { - this(p,Bukkit.createInventory(p, guiSize, guiName)); - } - - /** - * Adds item to the GUI, - * @param guiItem a GuiItem to add - */ - public void addItem(GuiItem guiItem) { - items.put(guiItem.getIndex(),guiItem); - setGuiItem(guiItem.getIndex(),guiItem); - } - - /** - * Adds items to the GUI, - * @param guiItems a GuiItem[] array to add - */ - public void addItems(GuiItem[] guiItems) { - for (GuiItem guiItem : guiItems) { - addItem(guiItem); - } - } - - - /** - * Getter for gui - * @return Inventory acting as the gui - */ - public Inventory getGui() { - return gui; - } - - /** - * Returns a pointer to the GuiItem at a given index - * @param index positional index of where the gui item is - * @return a pointer to the guiItem - */ - public GuiItem getItem(int index) { - if (items.containsKey(index)) { - return items.get(index); - } else { - return null; - } - } - - /** - * Sets all itemStachs in items to be displayed in the gui - */ - public void setGui() { - for (Integer index : items.keySet()) { - setGuiItem(index,items.get(index)); - } - } - - /** - * Sets a GuiItem to be displayed in the gui at a given positonal index - * @param index postional index of where the guiItem will be - * @param guiItem a GuiItem - */ - public void setGuiItem(int index, GuiItem guiItem) { - setGuiItemColorsToTheme(guiItem); - gui.setItem(index,guiItem.getItem()); - } - - /** - * setter for theme - * @param theme a String of ChatColors ex (ChatColor.BOLD + ChatColor.WHITE.toString()) - */ - public void setTheme(GuiIconColors theme) { - this.theme = theme; - } - - /** - * Opens the gui for the player - */ - public void displayGuiForPlayer() { - p.openInventory(gui); - } - - private void setGuiItemColorsToTheme(GuiItem guiItem) { - if (theme == null || guiItem.isThemeExemption()) { - return; - } - if (theme.getNameColor() != null) { - guiItem.setNameColor(theme.getNameColor()); - } - if (theme.getDescriptionColor() != null) { - guiItem.setDescriptionColor(theme.getDescriptionColor()); - } - if (theme.getStatisticNamesColor() != null) { - guiItem.setStatisticNameColor(theme.getStatisticNamesColor()); - } - if (theme.getStatisticsColor() != null) { - guiItem.setStatisticColor(theme.getStatisticsColor()); - } - guiItem.refreshLore(true); - } - - -} diff --git a/src/main/java/mc/carlton/freerpg/leaveAndJoin/LoginProcedure.java b/src/main/java/mc/carlton/freerpg/leaveAndJoin/LoginProcedure.java deleted file mode 100644 index e9c5723..0000000 --- a/src/main/java/mc/carlton/freerpg/leaveAndJoin/LoginProcedure.java +++ /dev/null @@ -1,139 +0,0 @@ -package mc.carlton.freerpg.leaveAndJoin; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.BossBarStorage; -import mc.carlton.freerpg.gameTools.FurnaceUserTracker; -import mc.carlton.freerpg.perksAndAbilities.Agility; -import mc.carlton.freerpg.perksAndAbilities.Defense; -import mc.carlton.freerpg.perksAndAbilities.Farming; -import mc.carlton.freerpg.perksAndAbilities.Fishing; -import mc.carlton.freerpg.playerInfo.*; -import mc.carlton.freerpg.serverFileManagement.PlayerStatsFilePreparation; -import org.bukkit.Bukkit; -import org.bukkit.attribute.Attributable; -import org.bukkit.attribute.Attribute; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; - -import java.time.Instant; -import java.util.ArrayList; -import java.util.Map; -import java.util.UUID; - -public class LoginProcedure { - Player p; - private UUID uuid; - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - - - public LoginProcedure(Player p) { - this.p = p; - this.uuid = p.getUniqueId(); - - } - - public LoginProcedure(UUID playerUUID) { - this.p = Bukkit.getPlayer(playerUUID); - this.uuid = playerUUID; - - } - - public void addStatsToPlayerMap(boolean onlinePlayer) { - //Read in player's past stats stats - PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); - long loginTime = loadInPlayer.getLoginTime(); - long playTime = loadInPlayer.getPlayTime(); - String language = loadInPlayer.getPlayerLanguage(); - Map> playerStats0 = loadInPlayer.getPlayerStatsMapFromFile(); - Map playerSkillExpBarToggles = loadInPlayer.getSkillExpBarToggles(); - Map playerSkillAbilityToggles = loadInPlayer.getSkillAbilityToggles(); - - //Combine the player's stats with everyone on the server's - PlayerStats pStatsClass = new PlayerStats(uuid); - Map>> allStats = pStatsClass.getData(); - allStats.put(uuid,playerStats0); - pStatsClass.setData(allStats); - pStatsClass.addPlayerTimes(loginTime,playTime); - pStatsClass.setPlayerLanguage(language); - pStatsClass.addPlayerSkillToggleAbility(playerSkillAbilityToggles); - pStatsClass.addPlayerSkillToggleExpBar(playerSkillExpBarToggles); - pStatsClass.setPlayerAreStatsSaved(!onlinePlayer); - } - - public void updatePlayerLoginTime() { - PlayerStats pStatsClass = new PlayerStats(uuid); - long playTime = pStatsClass.getPlayerPlayTime(); - pStatsClass.addPlayerTimes(Instant.now().getEpochSecond(),playTime); - pStatsClass.setPlayerAreStatsSaved(false); - } - - public void playerLogin() { - PlayerStats playerStats = new PlayerStats(uuid); - if (!playerStats.isPlayerRegistered()) { //If the player is registered, we assume this has already been done - //If the player is new, creates a new stats file for them, - //If the player's stat file is not properly formatted, this also fixes that - PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); - playerStatsFilePreparation.playJoinConditions(p); - - //Read in player's past stats into an the playerStats Class - addStatsToPlayerMap(true); - } - else { - updatePlayerLoginTime(); - } - - //Loads player into leaderboard stat tracking if it's their first time logging in/they have no player profile - Leaderboards leaderboards = new Leaderboards(); - leaderboards.initializeNewPlayer(p); - - //Makes sure the player's stats are consistent with the defined EXP curve - ChangeStats changeStats = new ChangeStats(p); - changeStats.checkPlayerLevelEXPCurveConsistency(); - changeStats.setTotalLevel(); - changeStats.setTotalExperience(); - - //Makes sure player's attack speed is normal - ((Attributable) p).getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(4.0); - - //Initiates player abilities - Integer[] initAbils = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; - AbilityTracker abilitiesClass = new AbilityTracker(p); - Map allAbilities = abilitiesClass.getAbilities(); - allAbilities.put(uuid,initAbils); - abilitiesClass.setAbilities(allAbilities); - - //Initiates player timers - AbilityTimers timersClass = new AbilityTimers(p); - Map allTimers = timersClass.getCooldownTimes(); - if (!allTimers.containsKey(uuid)) { - Integer[] initTimers = {0,0,0,0,0,0,0,0,0,0,0,0}; - allTimers.put(uuid, initTimers); - timersClass.setTimes(allTimers); - } - - //Initiates player abiliyLogoutTracker - AbilityLogoutTracker abilityLogout = new AbilityLogoutTracker(p); - abilityLogout.intiializePlayer(); - - //Initializes Abilities - Farming farmingClass = new Farming(p); - farmingClass.oneWithNatureStart(); - - Fishing fishingClass = new Fishing(p); - fishingClass.fishPersonStart(); - - Agility agilityClass = new Agility(p); - agilityClass.gracefulFeetStart(); - - Defense defenseClass = new Defense(p); - defenseClass.hearty(); - - //Sets up bossbar - BossBarStorage bossBarStorage = new BossBarStorage(); - bossBarStorage.initializeNewPlayer(p); - - //Checks if player recently logged out with active furnaces - FurnaceUserTracker furnaceUserTracker = new FurnaceUserTracker(); - furnaceUserTracker.playerLogin(p); - } -} diff --git a/src/main/java/mc/carlton/freerpg/leaveAndJoin/LogoutProcedure.java b/src/main/java/mc/carlton/freerpg/leaveAndJoin/LogoutProcedure.java deleted file mode 100644 index 3afe059..0000000 --- a/src/main/java/mc/carlton/freerpg/leaveAndJoin/LogoutProcedure.java +++ /dev/null @@ -1,141 +0,0 @@ -package mc.carlton.freerpg.leaveAndJoin; - -import mc.carlton.freerpg.gameTools.*; -import mc.carlton.freerpg.perksAndAbilities.*; -import mc.carlton.freerpg.playerInfo.*; -import mc.carlton.freerpg.serverInfo.RecentLogouts; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - -import java.io.IOException; - -public class LogoutProcedure { - Player p; - private String pName; - - public LogoutProcedure(Player p) { - this.p = p; - this.pName = p.getDisplayName(); - } - - public void playerLogout(boolean disablePlugin) throws IOException { - // The player stats have not been saved yet, so we don't want to remove the player - PlayerStats playerStats = new PlayerStats(p); - playerStats.setPlayerAreStatsSaved(false); - - //Adds player to the list of last n logouts ("n" specified in config) - RecentLogouts recentLogouts = new RecentLogouts(); - recentLogouts.playerLogout(p,disablePlugin); - - //Saves Player Stats to file - PlayerStatsLoadIn saveStats = new PlayerStatsLoadIn(p); - - if (disablePlugin) { //If the plugin is disabled, I don't care about performance (Plus I can't run an async task) - saveStats.setPlayerStatsMap(); - } - else { //If the plugin is not disabled, we async remove the player's stats to not affect performance - saveStats.asyncStatSave(); - } - - //Ensures no items stay permanently altered from abilities - preventLogoutTheft(disablePlugin); - - //Ends all tasks that track players' buffs gained from some skills - Farming farmingClass = new Farming(p); - farmingClass.oneWithNatureEnd(); - Fishing fishingClass = new Fishing(p); - fishingClass.fishPersonEnd(); - Agility agilityClass = new Agility(p); - agilityClass.gracefulFeetEnd(); - - BossBarStorage bossBarStorage = new BossBarStorage(); - bossBarStorage.removePlayer(p); - - //If the plugin has been disabled, the rest will take care of itself. - if (disablePlugin) { - return; - } - - //Removes tracked player data - BrewingStandUserTracker brewDelete = new BrewingStandUserTracker(); - brewDelete.removeAllPlayerStands(p); - FurnaceUserTracker furnaceDelete = new FurnaceUserTracker(); - furnaceDelete.removeAllPlayerfurnaceLocations(p); - BlockFaceTracker blockFaceDelete = new BlockFaceTracker(); - blockFaceDelete.removePlayerBlockFace(p); - - //Removes players stats,abilities,timers,and logout trackers from the hashmaps, all stat information should be saved - - /*Player stats SHOULD be removed by OfflinePlayerStatLoadIn. - PlayerStats deleteStats = new PlayerStats(p); - deleteStats.removePlayer(); - */ - - AbilityTracker deleteAbilities = new AbilityTracker(p); - deleteAbilities.removePlayer(); - - AbilityTimers deleteTimers = new AbilityTimers(p); - deleteTimers.removePlayer(); - - AbilityLogoutTracker deleteLogoutTracked = new AbilityLogoutTracker(p); - deleteLogoutTracked.removePlayer(); - } - - public void preventLogoutTheft(boolean disablePlugin) { - preventLogoutTheftDefense(disablePlugin); - preventLogoutTheftMining(disablePlugin); - preventLogoutTheftDigging(disablePlugin); - preventLogoutTheftSwordsmanship(disablePlugin); - } - - public void preventLogoutTheftMining(boolean disablePlugin) { - AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); - TrackItem trackItem = new TrackItem(); - - NamespacedKey key_mining = logoutTracker.getPlayerKeys().get("mining"); - int taskID_mining = logoutTracker.getPlayerTasks().get("mining"); - ItemStack itemInHand_mining = trackItem.findTrackedItemInInventory(p,key_mining); - - if (itemInHand_mining != null) { - Mining miningClass = new Mining(p); - miningClass.preventLogoutTheft(taskID_mining, itemInHand_mining,key_mining,disablePlugin); - } - } - - public void preventLogoutTheftDigging(boolean disablePlugin) { - AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); - TrackItem trackItem = new TrackItem(); - - NamespacedKey key_digging = logoutTracker.getPlayerKeys().get("digging"); - int taskID_digging = logoutTracker.getPlayerTasks().get("digging"); - ItemStack itemInHand_digging = trackItem.findTrackedItemInInventory(p,key_digging); - - if (itemInHand_digging != null) { - Digging diggingClass = new Digging(p); - diggingClass.preventLogoutTheft(taskID_digging, itemInHand_digging,key_digging,disablePlugin); - } - } - - public void preventLogoutTheftSwordsmanship(boolean disablePlugin) { - AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); - TrackItem trackItem = new TrackItem(); - - NamespacedKey key_swordsmanship = logoutTracker.getPlayerKeys().get("swordsmanship"); - int taskID_swordsmanship = logoutTracker.getPlayerTasks().get("swordsmanship"); - ItemStack itemInHand_swordsmanship = trackItem.findTrackedItemInInventory(p,key_swordsmanship); - - if (itemInHand_swordsmanship != null) { - Swordsmanship swordsmanshipClass = new Swordsmanship(p); - swordsmanshipClass.preventLogoutTheft(taskID_swordsmanship, itemInHand_swordsmanship,key_swordsmanship,disablePlugin); - } - } - - public void preventLogoutTheftDefense(boolean disablePlugin) { - AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); - int taskID_defense = logoutTracker.getPlayerTasks().get("defense"); - - Defense defenseClass = new Defense(p); - defenseClass.preventLogoutTheft(taskID_defense,disablePlugin); - } -} diff --git a/src/main/java/mc/carlton/freerpg/leaveAndJoin/PlayerLeave.java b/src/main/java/mc/carlton/freerpg/leaveAndJoin/PlayerLeave.java deleted file mode 100644 index df470d0..0000000 --- a/src/main/java/mc/carlton/freerpg/leaveAndJoin/PlayerLeave.java +++ /dev/null @@ -1,20 +0,0 @@ -package mc.carlton.freerpg.leaveAndJoin; - -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerQuitEvent; - -import java.io.IOException; - -public class PlayerLeave implements Listener { - @EventHandler(priority = EventPriority.HIGHEST) - void onPlayerLeave(PlayerQuitEvent e) throws IOException { - Player p = e.getPlayer(); - p.leaveVehicle(); - LogoutProcedure logout = new LogoutProcedure(p); - logout.playerLogout(false); - - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/CreatureSpawn.java b/src/main/java/mc/carlton/freerpg/miscEvents/CreatureSpawn.java deleted file mode 100644 index 50cef62..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/CreatureSpawn.java +++ /dev/null @@ -1,31 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.EntityPickedUpItemStorage; -import mc.carlton.freerpg.globalVariables.EntityGroups; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.LivingEntity; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.CreatureSpawnEvent; -import org.bukkit.event.entity.EntitySpawnEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.metadata.FixedMetadataValue; -import org.bukkit.plugin.Plugin; - -import java.util.List; - -public class CreatureSpawn implements Listener { - - @EventHandler(priority = EventPriority.HIGH) - void onEntitySpawn(CreatureSpawnEvent e) { - if (e.isCancelled()) { - return; - } - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - if (e.getSpawnReason().equals(CreatureSpawnEvent.SpawnReason.SPAWNER)) { - e.getEntity().setMetadata("frpgSpawnerMob",new FixedMetadataValue(plugin,"frpg")); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/DispenserDispenseItem.java b/src/main/java/mc/carlton/freerpg/miscEvents/DispenserDispenseItem.java deleted file mode 100644 index ce34687..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/DispenserDispenseItem.java +++ /dev/null @@ -1,31 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.gameTools.EntityPickedUpItemStorage; -import org.bukkit.Location; -import org.bukkit.block.Block; -import org.bukkit.block.data.Directional; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockDispenseEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.util.Vector; - -public class DispenserDispenseItem implements Listener { - - @EventHandler(priority = EventPriority.HIGH) - void onDispenserDispense(BlockDispenseEvent e) { - if (e.isCancelled()) { - return; - } - ItemStack item = e.getItem(); - Block dispenser = e.getBlock(); - if (dispenser.getBlockData() instanceof Directional) { - Directional directional = (Directional) dispenser.getBlockData(); - Vector normalVector = directional.getFacing().getDirection(); - Location location = e.getBlock().getLocation().add(normalVector); - EntityPickedUpItemStorage entityPickedUpItemStorage = new EntityPickedUpItemStorage(); - entityPickedUpItemStorage.addPickedUpItemFromDispenser(item,location); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/EntityPickUpItem.java b/src/main/java/mc/carlton/freerpg/miscEvents/EntityPickUpItem.java deleted file mode 100644 index 522327d..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/EntityPickUpItem.java +++ /dev/null @@ -1,31 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.gameTools.EntityPickedUpItemStorage; -import mc.carlton.freerpg.globalVariables.EntityGroups; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.LivingEntity; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityPickupItemEvent; -import org.bukkit.inventory.ItemStack; - -import java.util.List; - -public class EntityPickUpItem implements Listener { - - @EventHandler(priority = EventPriority.HIGH) - void onEntityPickUpItem(EntityPickupItemEvent e) { - if (e.isCancelled()) { - return; - } - LivingEntity entity= e.getEntity(); - ItemStack item = e.getItem().getItemStack(); - EntityGroups entityGroups = new EntityGroups(); - List hostileMobs = entityGroups.getHostileMobs(); - if (hostileMobs.contains(entity.getType())) { - EntityPickedUpItemStorage entityPickedUpItemStorage = new EntityPickedUpItemStorage(); - entityPickedUpItemStorage.addPickedUpItem(item, entity); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBlockBreak.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBlockBreak.java deleted file mode 100644 index 9c6676e..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBlockBreak.java +++ /dev/null @@ -1,248 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.globalVariables.ExpMaps; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.perksAndAbilities.*; -import mc.carlton.freerpg.playerInfo.*; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.PlacedBlocksManager; -import org.bukkit.*; -import org.bukkit.block.Block; -import org.bukkit.block.data.Ageable; -import org.bukkit.block.data.BlockData; -import org.bukkit.block.data.type.Cocoa; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.inventory.ItemStack; - -import java.util.*; - -public class PlayerBlockBreak implements Listener { - @EventHandler(priority = EventPriority.HIGHEST) - void onblockBreak(BlockBreakEvent e){ - //WorldGuard Check - if (e.isCancelled()) { - return; - } - - Player p = e.getPlayer(); - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - - Block block = e.getBlock(); - Location loc = block.getLocation(); - Material blockType = block.getType(); - World world = e.getBlock().getWorld(); - - ItemGroups itemGroups = new ItemGroups(); - - // Tools and Other - List pickaxes = itemGroups.getPickaxes(); - List axes = itemGroups.getAxes(); - List shovels = itemGroups.getShovels(); - List hoes = itemGroups.getHoes(); - - //Blocks - List tallCrops = itemGroups.getTallCrops(); - List logs = itemGroups.getLogs(); - - //Gets Block-EXP maps - ExpMaps expMaps = new ExpMaps(); - Map diggingEXP = expMaps.getDiggingEXP(); - Map woodcuttingEXP = expMaps.getWoodcuttingEXP(); - Map miningEXP = expMaps.getMiningEXP(); - Map farmingEXP = expMaps.getFarmingEXP(); - Map flamePickEXP = expMaps.getFlamePickEXP(); - - //Config - ConfigLoad configLoad = new ConfigLoad(); - - - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - - - - ChangeStats increaseStats = new ChangeStats(p); - - AbilityTracker abilities = new AbilityTracker(p); - Integer[] pAbilities = abilities.getPlayerAbilities(); - - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - - ItemStack itemInHand = p.getInventory().getItemInMainHand(); - - //Tracked Blocks - PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); - boolean natural = !placedBlocksManager.isBlockTracked(block); - - //EXP drops - if (flamePickEXP.containsKey(blockType) && pickaxes.contains(itemInHand.getType()) && (int) pStat.get("global").get(13) > 0 && (int) pStat.get("smelting").get(13) > 0) { - Object[] flamePickData = flamePickEXP.get(blockType); - if (natural) { - increaseStats.changeEXP((String) flamePickData[0], (int) flamePickData[1]); - } - int veinMinerLevel = (int)pStat.get("mining").get(11); - int veinMinerToggle = (int) pStat.get("global").get(18); - if (itemGroups.getFlamePickOres().contains(blockType)) { - Mining miningClass = new Mining(p); - miningClass.wastelessHaste(blockType); - if (veinMinerLevel > 0 && veinMinerToggle > 0) { - miningClass.veinMiner(block,blockType); - } - else { - Smelting smeltingClass = new Smelting(p); - smeltingClass.flamePick(block, world,blockType,true); - } - } - else { - Smelting smeltingClass = new Smelting(p); - smeltingClass.flamePick(block, world,blockType,true); - } - } - - else if(diggingEXP.containsKey(blockType) &&natural) { - if (!configLoad.getAllowedSkillsMap().get("digging")) { - return; - } - increaseStats.changeEXP("digging", diggingEXP.get(blockType)); - Material[] treasureBlocks0 = {Material.CLAY,Material.GRASS_BLOCK,Material.GRAVEL,Material.MYCELIUM, Material.PODZOL,Material.COARSE_DIRT, - Material.DIRT,Material.RED_SAND,Material.SAND,Material.SOUL_SAND,Material.SNOW_BLOCK}; - List treasureBlocks = Arrays.asList(treasureBlocks0); - Digging diggingClass = new Digging(p); - boolean dropFlint = diggingClass.flintFinder(blockType); - if (dropFlint) { - e.setDropItems(false); - world.dropItemNaturally(loc,new ItemStack(Material.FLINT,1)); - } - if (treasureBlocks.contains(blockType)) { - diggingClass.diggingTreasureDrop(world,loc,blockType); - } - - } - else if(woodcuttingEXP.containsKey(blockType) && natural) { - increaseStats.changeEXP("woodcutting",woodcuttingEXP.get(blockType)); - Woodcutting woodcuttingClass = new Woodcutting(p); - woodcuttingClass.woodcuttingDoubleDrop(block,world); - woodcuttingClass.logXPdrop(block,world); - woodcuttingClass.logBookDrop(block,world); - woodcuttingClass.leafBlower(block); - woodcuttingClass.leavesDrops(block,world,1,1); - woodcuttingClass.timedHaste(block); - - } - else if (miningEXP.containsKey(blockType) && natural) { - increaseStats.changeEXP("mining", miningEXP.get(blockType)); - Mining miningClass = new Mining(p); - miningClass.wastelessHaste(blockType); - miningClass.miningDoubleDrop(block, world); - miningClass.veinMiner(block,blockType); - if (pAbilities[2] == -2) { - //Treasure Drops: - int passive2_mining = (int) pStat.get("mining").get(9); - double treasureDropChance = passive2_mining * 0.01; - miningClass.miningTreasureDrop(treasureDropChance, world, loc); - } - - if (blockType == Material.SPAWNER) { - increaseStats.changeEXP("defense", miningEXP.get(blockType)); - increaseStats.changeEXP("swordsmanship", miningEXP.get(blockType)); - increaseStats.changeEXP("archery", miningEXP.get(blockType)); - increaseStats.changeEXP("axeMastery", miningEXP.get(blockType)); - } - } - else if (configLoad.getVeinMinerBlocks().contains(blockType)) { - Mining miningClass = new Mining(p); - miningClass.veinMiner(block,blockType); - } - else if (farmingEXP.containsKey(blockType) && natural) { - BlockData block_data = block.getBlockData(); - Farming farmingClass = new Farming(p); - if (tallCrops.contains(blockType)) { - farmingClass.tallCrops(block,world); - } - else if (block_data instanceof Ageable) { - Ageable age = (Ageable) block_data; - if (age.getAge() == age.getMaximumAge()) { - increaseStats.changeEXP("farming",farmingEXP.get(blockType)); - if (blockType == Material.NETHER_WART) { - Map expMap = configLoad.getExpMapForSkill("alchemy"); - increaseStats.changeEXP("alchemy",expMap.get("breakNetherWart")); - } - farmingClass.farmingDoubleDropCrop(block,world); - } - } - else if (block_data instanceof Cocoa) { - Cocoa coco = (Cocoa) block_data; - if (coco.getAge() == coco.getMaximumAge()) { - increaseStats.changeEXP("farming",farmingEXP.get(blockType)); - farmingClass.farmingDoubleDropCrop(block,world); - } - } - else { - increaseStats.changeEXP("farming",farmingEXP.get(blockType)); - farmingClass.farmingDoubleDropCrop(block,world); - } - } - - //Abilities - - //Digging - if (shovels.contains(itemInHand.getType()) && diggingEXP.containsKey(blockType)) { - Digging diggingClass = new Digging(p); - if (pAbilities[0] > -1) { - diggingClass.enableAbility(); - } - else if (pAbilities[0] == -2) { - diggingClass.megaDig(block,diggingEXP); - } - } - - //Woodcutting - else if (axes.contains(itemInHand.getType()) && logs.contains(blockType)) { - Woodcutting woodcuttingClass = new Woodcutting(p); - if (pAbilities[1] > -1 && natural) { - woodcuttingClass.enableAbility(); - woodcuttingClass.timber(block); - } - else if (pAbilities[1] == -2 && natural) { - woodcuttingClass.timber(block); - } - } - //Mining - else if (pickaxes.contains(itemInHand.getType()) && pAbilities[2] > -1 && miningEXP.containsKey(blockType)) { - Mining miningClass = new Mining(p); - miningClass.enableAbility(); - } - - //Farming - else if ((hoes.contains(itemInHand.getType()) || axes.contains(itemInHand.getType())) && farmingEXP.containsKey(blockType)) { - Farming farmingClass = new Farming(p); - if (pAbilities[3] > -1 && natural && axes.contains(itemInHand.getType()) && (blockType == Material.MELON || blockType == Material.PUMPKIN)) { - farmingClass.enableAbility(); - farmingClass.naturalRegeneration(block,world); - } - else if (pAbilities[3] == -2 && natural && axes.contains(itemInHand.getType()) && (blockType == Material.MELON || blockType == Material.PUMPKIN)) { - farmingClass.naturalRegeneration(block,world); - } - else if (pAbilities[3] > -1 && natural && (hoes.contains(itemInHand.getType()))) { - farmingClass.enableAbility(); - - } - else if (pAbilities[3] == -2 && natural && (hoes.contains(itemInHand.getType()))) { - farmingClass.naturalRegeneration(block,world); - } - } - - //If the block wasn't natural, now remove it from the list - if (!natural) { - placedBlocksManager.removeBlock(block); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBlockBreakDeveloper.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBlockBreakDeveloper.java deleted file mode 100644 index f4b9c6f..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBlockBreakDeveloper.java +++ /dev/null @@ -1,321 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.globalVariables.ExpMaps; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.perksAndAbilities.*; -import mc.carlton.freerpg.playerInfo.*; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.PlacedBlocksManager; -import mc.carlton.freerpg.serverInfo.RunTimeData; -import org.bukkit.GameMode; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.block.data.Ageable; -import org.bukkit.block.data.BlockData; -import org.bukkit.block.data.type.Cocoa; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.inventory.ItemStack; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -public class PlayerBlockBreakDeveloper implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onblockBreak(BlockBreakEvent e){ - RunTimeData runTimeData = new RunTimeData(); - - //WorldGuard Check - if (e.isCancelled()) { - return; - } - - Player p = e.getPlayer(); - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - - Block block = e.getBlock(); - Location loc = block.getLocation(); - Material blockType = block.getType(); - World world = e.getBlock().getWorld(); - ItemStack itemInHand = p.getInventory().getItemInMainHand(); - - - ItemGroups itemGroups = new ItemGroups(); - - // Tools and Other - List pickaxes = itemGroups.getPickaxes(); - List axes = itemGroups.getAxes(); - List shovels = itemGroups.getShovels(); - List hoes = itemGroups.getHoes(); - - //Blocks - List tallCrops = itemGroups.getTallCrops(); - List logs = itemGroups.getLogs(); - - //Gets Block-EXP maps - ExpMaps expMaps = new ExpMaps(); - Map diggingEXP = expMaps.getDiggingEXP(); - Map woodcuttingEXP = expMaps.getWoodcuttingEXP(); - Map miningEXP = expMaps.getMiningEXP(); - Map farmingEXP = expMaps.getFarmingEXP(); - Map flamePickEXP = expMaps.getFlamePickEXP(); - - //Config - ConfigLoad configLoad = new ConfigLoad(); - - - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - - - ChangeStats increaseStats = new ChangeStats(p); - - AbilityTracker abilities = new AbilityTracker(p); - Integer[] pAbilities = abilities.getPlayerAbilities(); - - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - - - long timer = System.currentTimeMillis(); - //Tracked Blocks - PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); - boolean natural = !placedBlocksManager.isBlockTracked(block); - - long getTrackedBlocks = System.currentTimeMillis() - timer; - runTimeData.addTime(getTrackedBlocks,"BreakBlocktrackedBlocks"); - timer = System.currentTimeMillis(); - - //EXP drops - if (flamePickEXP.containsKey(blockType) && pickaxes.contains(itemInHand.getType()) && (int) pStat.get("global").get(13) > 0 && (int) pStat.get("smelting").get(13) > 0) { - Object[] flamePickData = flamePickEXP.get(blockType); - if (natural) { - increaseStats.changeEXP((String) flamePickData[0], (int) flamePickData[1]); - } - int veinMinerLevel = (int)pStat.get("mining").get(11); - int veinMinerToggle = (int) pStat.get("global").get(18); - if (itemGroups.getFlamePickOres().contains(blockType)) { - Mining miningClass = new Mining(p); - miningClass.wastelessHaste(blockType); - if (veinMinerLevel > 0 && veinMinerToggle > 0) { - miningClass.veinMiner(block,blockType); - } - else { - Smelting smeltingClass = new Smelting(p); - smeltingClass.flamePick(block, world,blockType,true); - } - } - else { - Smelting smeltingClass = new Smelting(p); - smeltingClass.flamePick(block, world,blockType,false); - } - } - - else if(diggingEXP.containsKey(blockType) &&natural) { - if (!configLoad.getAllowedSkillsMap().get("digging")) { - return; - } - long timer1 = System.currentTimeMillis(); - increaseStats.changeEXP("digging",diggingEXP.get(blockType)); - long changeDiggingEXP = System.currentTimeMillis() - timer1; - runTimeData.addTime(changeDiggingEXP,"changeEXP"); - - - Material[] treasureBlocks0 = {Material.CLAY,Material.GRASS_BLOCK,Material.GRAVEL,Material.MYCELIUM, Material.PODZOL,Material.COARSE_DIRT, - Material.DIRT,Material.RED_SAND,Material.SAND,Material.SOUL_SAND,Material.SNOW_BLOCK}; - List treasureBlocks = Arrays.asList(treasureBlocks0); - timer1 = System.currentTimeMillis(); - Digging diggingClass = new Digging(p); - boolean dropFlint = diggingClass.flintFinder(blockType); - if (dropFlint) { - e.setDropItems(false); - world.dropItemNaturally(loc,new ItemStack(Material.FLINT,1)); - } - long flintFinder = System.currentTimeMillis() - timer1; - runTimeData.addTime(flintFinder,"flintFinder"); - - if (treasureBlocks.contains(blockType)) { - long timer2 = System.currentTimeMillis(); - diggingClass.diggingTreasureDrop(world,loc,blockType); - long treasureDropTime = System.currentTimeMillis() - timer2; - runTimeData.addTime(treasureDropTime,"diggingTreasureDrop"); - } - - } - else if(woodcuttingEXP.containsKey(blockType) && natural) { - long timer1 = System.currentTimeMillis(); - increaseStats.changeEXP("woodcutting",woodcuttingEXP.get(blockType)); - long woodcuttingEXPTime = System.currentTimeMillis() - timer1; - runTimeData.addTime(woodcuttingEXPTime,"changeEXP"); - - timer1 = System.currentTimeMillis(); - Woodcutting woodcuttingClass = new Woodcutting(p); - woodcuttingClass.woodcuttingDoubleDrop(block,world); - long woodcuttingDoubleDropTime = System.currentTimeMillis() - timer1; - runTimeData.addTime(woodcuttingDoubleDropTime,"doubleDrop"); - - timer1 = System.currentTimeMillis(); - woodcuttingClass.logXPdrop(block,world); - long logXPDropTime = System.currentTimeMillis() - timer1; - runTimeData.addTime(logXPDropTime,"logXP"); - - timer1 = System.currentTimeMillis();; - woodcuttingClass.logBookDrop(block,world); - long logBookDropTime = System.currentTimeMillis() - timer1; - runTimeData.addTime(logBookDropTime,"logBook"); - - woodcuttingClass.leafBlower(block); - - timer1 = System.currentTimeMillis(); - woodcuttingClass.leavesDrops(block,world,1,1); - long leavesDropTime = System.currentTimeMillis() - timer1; - runTimeData.addTime(leavesDropTime,"leaves"); - - timer1 = System.currentTimeMillis(); - woodcuttingClass.timedHaste(block); - long timedHasteTime = System.currentTimeMillis() - timer1; - runTimeData.addTime(timedHasteTime,"woodcuttingHaste"); - - } - else if (miningEXP.containsKey(blockType) && natural) { - long timer1 = System.currentTimeMillis(); - increaseStats.changeEXP("mining", miningEXP.get(blockType)); - long miningEXPTime = System.currentTimeMillis() - timer1; - runTimeData.addTime(miningEXPTime,"changeEXP"); - - - List ores = itemGroups.getOres(); - Mining miningClass = new Mining(p); - if (pAbilities[2] == -2) { - long timer2 = System.currentTimeMillis(); - //Treasure Drops: - int passive2_mining = (int) pStat.get("mining").get(9); - double treasureDropChance = passive2_mining * 0.01; - miningClass.miningTreasureDrop(treasureDropChance, world, loc); - long miningTreasureDropTime = System.currentTimeMillis() - timer2; - runTimeData.addTime(miningTreasureDropTime,"miningTreasureDrop"); - } - long timer2 = System.currentTimeMillis(); - miningClass.wastelessHaste(blockType); - long miningWastelessHasteTime = System.currentTimeMillis() - timer2; - runTimeData.addTime(miningWastelessHasteTime,"wastelessHaste"); - - timer2 = System.currentTimeMillis(); - miningClass.miningDoubleDrop(block, world); - long miningDoubleDropTime = System.currentTimeMillis() - timer2; - runTimeData.addTime(miningDoubleDropTime,"doubleDrop"); - - timer2 = System.currentTimeMillis(); - miningClass.veinMiner(block,blockType); - long veinMinerTimes = System.currentTimeMillis() - timer2; - runTimeData.addTime(veinMinerTimes,"veinMiner"); - - if (blockType == Material.SPAWNER) { - increaseStats.changeEXP("defense", miningEXP.get(blockType)); - increaseStats.changeEXP("swordsmanship", miningEXP.get(blockType)); - increaseStats.changeEXP("archery", miningEXP.get(blockType)); - increaseStats.changeEXP("axeMastery", miningEXP.get(blockType)); - } - } - else if (configLoad.getVeinMinerBlocks().contains(blockType)) { - Mining miningClass = new Mining(p); - miningClass.veinMiner(block,blockType); - } - else if (farmingEXP.containsKey(blockType) && natural) { - BlockData block_data = block.getBlockData(); - Farming farmingClass = new Farming(p); - if (tallCrops.contains(blockType)) { - farmingClass.tallCrops(block,world); - } - else if (block_data instanceof Ageable) { - Ageable age = (Ageable) block_data; - if (age.getAge() == age.getMaximumAge()) { - increaseStats.changeEXP("farming",farmingEXP.get(blockType)); - if (blockType == Material.NETHER_WART) { - Map expMap = configLoad.getExpMapForSkill("alchemy"); - increaseStats.changeEXP("alchemy",expMap.get("breakNetherWart")); - } - farmingClass.farmingDoubleDropCrop(block,world); - } - } - else if (block_data instanceof Cocoa) { - Cocoa coco = (Cocoa) block_data; - if (coco.getAge() == coco.getMaximumAge()) { - increaseStats.changeEXP("farming",farmingEXP.get(blockType)); - farmingClass.farmingDoubleDropCrop(block,world); - } - } - else { - increaseStats.changeEXP("farming",farmingEXP.get(blockType)); - farmingClass.farmingDoubleDropCrop(block,world); - } - } - - //Abilities - - //Digging - if (shovels.contains(itemInHand.getType()) && diggingEXP.containsKey(blockType)) { - Digging diggingClass = new Digging(p); - if (pAbilities[0] > -1) { - diggingClass.enableAbility(); - } - else if (pAbilities[0] == -2) { - diggingClass.megaDig(block,diggingEXP); - } - } - - //Woodcutting - else if (axes.contains(itemInHand.getType()) && logs.contains(blockType)) { - Woodcutting woodcuttingClass = new Woodcutting(p); - if (pAbilities[1] > -1 && natural) { - woodcuttingClass.enableAbility(); - woodcuttingClass.timber(block); - } - else if (pAbilities[1] == -2 && natural) { - woodcuttingClass.timber(block); - } - } - //Mining - else if (pickaxes.contains(itemInHand.getType()) && pAbilities[2] > -1 && miningEXP.containsKey(blockType)) { - Mining miningClass = new Mining(p); - miningClass.enableAbility(); - } - - //Farming - else if ((hoes.contains(itemInHand.getType()) || axes.contains(itemInHand.getType())) && farmingEXP.containsKey(blockType)) { - Farming farmingClass = new Farming(p); - if (pAbilities[3] > -1 && natural && axes.contains(itemInHand.getType()) && (blockType == Material.MELON || blockType == Material.PUMPKIN)) { - farmingClass.enableAbility(); - farmingClass.naturalRegeneration(block,world); - } - else if (pAbilities[3] == -2 && natural && axes.contains(itemInHand.getType()) && (blockType == Material.MELON || blockType == Material.PUMPKIN)) { - farmingClass.naturalRegeneration(block,world); - } - else if (pAbilities[3] > -1 && natural && (hoes.contains(itemInHand.getType()))) { - farmingClass.enableAbility(); - - } - else if (pAbilities[3] == -2 && natural && (hoes.contains(itemInHand.getType()))) { - farmingClass.naturalRegeneration(block,world); - } - - } - long allConditionals = System.currentTimeMillis() - timer; - runTimeData.addTime(allConditionals,"BreakBlockconditionals"); - - //If the block wasn't natural, now remove it from the list - if (!natural) { - placedBlocksManager.removeBlock(block); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBlockPlace.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBlockPlace.java deleted file mode 100644 index 47d7df1..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBlockPlace.java +++ /dev/null @@ -1,44 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - - -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.serverInfo.PlacedBlocksManager; -import mc.carlton.freerpg.serverInfo.WorldGuardChecks; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockPlaceEvent; - -import java.util.Map; - - -public class PlayerBlockPlace implements Listener { - @EventHandler(priority = EventPriority.HIGHEST) - void onblockPlace(BlockPlaceEvent e){ - Player p = e.getPlayer(); - Block block = e.getBlockPlaced(); - Location loc = block.getLocation(); - - if (e.isCancelled()) { - return; - } - - //WorldGuard Check - WorldGuardChecks BuildingCheck = new WorldGuardChecks(); - if (!BuildingCheck.canBuild(p, loc)) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - Map trackedBlocks = itemGroups.getTrackedBlocks(); - Material blockType = block.getType(); - boolean isTracked = trackedBlocks.containsKey(blockType); - if (isTracked) { - PlacedBlocksManager blockTracker = new PlacedBlocksManager(); - blockTracker.addLocation(loc); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBreedEntity.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBreedEntity.java deleted file mode 100644 index 5becbbb..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerBreedEntity.java +++ /dev/null @@ -1,28 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.perksAndAbilities.BeastMastery; -import mc.carlton.freerpg.perksAndAbilities.Farming; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityBreedEvent; - -public class PlayerBreedEntity implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onPlayerBreed(EntityBreedEvent e){ - if (e.isCancelled()) { - return; - } - if (e.getBreeder() instanceof Player) { - Player p = (Player) e.getBreeder(); - Entity entity = e.getEntity(); - Farming farmingClass = new Farming(p); - farmingClass.breedingEXP(entity); - BeastMastery beastMasteryClass = new BeastMastery(p); - beastMasteryClass.breedingEXP(entity); - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerConsumeItem.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerConsumeItem.java deleted file mode 100644 index 7ada3f3..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerConsumeItem.java +++ /dev/null @@ -1,35 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.perksAndAbilities.Alchemy; -import mc.carlton.freerpg.perksAndAbilities.Farming; -import mc.carlton.freerpg.perksAndAbilities.Fishing; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerItemConsumeEvent; -import org.bukkit.inventory.ItemStack; - -public class PlayerConsumeItem implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onConsumeItem(PlayerItemConsumeEvent e){ - if (e.isCancelled()) { - return; - } - Player p = e.getPlayer(); - ItemStack consumedItem = e.getItem(); - - //Farming - Farming farmingClass = new Farming(p); - farmingClass.eatFarmFood(consumedItem); - - //Fishing - Fishing fishingClass = new Fishing(p); - fishingClass.eatFishFood(consumedItem); - - // - Alchemy alchemyClass = new Alchemy(p); - alchemyClass.drinkPotion(consumedItem); - - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerCraft.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerCraft.java deleted file mode 100644 index 1503be1..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerCraft.java +++ /dev/null @@ -1,323 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.customContainers.collections.OldCustomRecipe; -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.globalVariables.CraftingRecipes; -import mc.carlton.freerpg.newEvents.FrpgPlayerCraftItemEvent; -import mc.carlton.freerpg.perksAndAbilities.Defense; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.ChatColor; -import org.bukkit.Effect; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.CraftItemEvent; -import org.bukkit.inventory.ItemStack; - -import java.util.ArrayList; -import java.util.Map; - -public class PlayerCraft implements Listener { - - private boolean craftingMatch(ArrayList customRecipe, ArrayList crafting) { - if (customRecipe.size() != 9 || crafting.size() != 9) { - return false; - } - CraftingRecipes craftingRecipes = new CraftingRecipes(); - ArrayList> allCustomRecipes = craftingRecipes.getTranslatedVariants(customRecipe); - for (ArrayList customRecipeVariant : allCustomRecipes) { - if (customRecipeVariant.equals(crafting)) { - return true; - } - } - return false; - } - - private int getAmountToBeCrafted(ItemStack[] craftingMatrix) { - int limitingMaterialAmount = Integer.MAX_VALUE; - for (int i=0; i<9;i++) { - if (craftingMatrix[i] != null) { - if (!craftingMatrix[i].getType().equals(Material.AIR)) { - int amountOfMaterial = craftingMatrix[i].getAmount(); - if (amountOfMaterial < limitingMaterialAmount) { - limitingMaterialAmount = amountOfMaterial; - } - } - } - } - return (limitingMaterialAmount == Integer.MAX_VALUE) ? 0 : limitingMaterialAmount; - } - - private ArrayList getRecipeMaterial(ItemStack[] craftingMatrix) { - ArrayList crafting = new ArrayList<>(); - for (int i=0; i<9;i++) { - if (craftingMatrix[i] == null) { - crafting.add(Material.AIR); - } - else { - crafting.add(craftingMatrix[i].getType()); - } - } - return crafting; - } - - @EventHandler(priority = EventPriority.HIGH) - void onFrpgPlayerCraft(FrpgPlayerCraftItemEvent e) { - Defense defenseClass = new Defense(e.getPlayer()); - defenseClass.armorEXP(e.getResult()); - } - - @EventHandler(priority = EventPriority.HIGH) - void onPlayerCraft(CraftItemEvent e) { - Player p = (Player) e.getWhoClicked(); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - LanguageSelector lang = new LanguageSelector(p); - ConfigLoad configLoad = new ConfigLoad(); - - CraftingRecipes craftingRecipes = new CraftingRecipes(); - ItemStack[] craftingMatrix = e.getInventory().getMatrix(); - if (craftingMatrix.length != 9) { - return; - } - ArrayList crafting = getRecipeMaterial(craftingMatrix); - int amountCrafted = getAmountToBeCrafted(craftingMatrix); - - Map craftingRecipeClasses = configLoad.getCraftingRecipes(); - ArrayList cowEgg = craftingRecipes.getCowEggRecipe(); - ArrayList beeEgg = craftingRecipes.getBeeEggRecipe(); - ArrayList mooshroomEgg = craftingRecipes.getMooshroomEggRecipe(); - ArrayList horseEgg = craftingRecipes.getHorseEggRecipe(); - ArrayList slimeEgg = craftingRecipes.getSlimeEggRecipe(); - ArrayList tippedArrow = craftingRecipes.getTippedArrowRecipe(); - ArrayList power = craftingRecipes.getPowerRecipe(); - ArrayList efficiency = craftingRecipes.getEfficiencyRecipe(); - ArrayList sharpness = craftingRecipes.getSharpnessRecipe(); - ArrayList protection = craftingRecipes.getProtectionRecipe(); - ArrayList luck = craftingRecipes.getLuckRecipe(); - ArrayList lure = craftingRecipes.getLureRecipe(); - ArrayList depth = craftingRecipes.getDepthRecipe(); - ArrayList frost = craftingRecipes.getFrostRecipe(); - ArrayList mending = craftingRecipes.getMendingRecipe(); - ArrayList fortune = craftingRecipes.getFortuneRecipe(); - ArrayList waterBreathing = craftingRecipes.getWaterBreathingRecipe(); - ArrayList speed = craftingRecipes.getSpeedRecipe(); - ArrayList fireResistance = craftingRecipes.getFireResistanceRecipe(); - ArrayList healing = craftingRecipes.getHealingRecipe(); - ArrayList strength = craftingRecipes.getStrengthRecipe(); - - - - if (craftingMatch(cowEgg,crafting)) { - if ((int)pStat.get("farming").get(8) < 1 || !configLoad.getAllowedSkillsMap().get("farming")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("farmingPerkTitle1") + " (1/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } - } - else if (craftingMatch(beeEgg,crafting)) { - if ((int)pStat.get("farming").get(8) < 2 || !configLoad.getAllowedSkillsMap().get("farming")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("farmingPerkTitle1") + " (2/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } - } - else if (craftingMatch(mooshroomEgg,crafting)) { - if ((int)pStat.get("farming").get(8) < 3 || !configLoad.getAllowedSkillsMap().get("farming")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("farmingPerkTitle1") + " (3/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } - } - else if (craftingMatch(horseEgg,crafting)) { - if ((int)pStat.get("farming").get(8) < 4 || !configLoad.getAllowedSkillsMap().get("farming")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("farmingPerkTitle1") + " (4/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } - } - else if (craftingMatch(slimeEgg,crafting)) { - if ((int)pStat.get("farming").get(8) < 5 || !configLoad.getAllowedSkillsMap().get("farming")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("farmingPerkTitle1") + " (5/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } - } - else if (craftingMatch(tippedArrow,crafting)) { - if ((int)pStat.get("archery").get(11) < 1 || !configLoad.getAllowedSkillsMap().get("archery")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("archeryPerkTitle4") + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } - } - else if (craftingMatch(power,crafting) || craftingMatch(efficiency,crafting)) { - int xpLevelCost = 0; - if (craftingMatch(power,crafting)) { - xpLevelCost = craftingRecipeClasses.get("enchanting1").getXPcraftCost(); - } else { - xpLevelCost = craftingRecipeClasses.get("enchanting2").getXPcraftCost(); - } - xpLevelCost*= (e.isShiftClick()) ? amountCrafted : 1; - - String xpLevel_Id = "xpLevel"; - if (xpLevelCost != 1) { - xpLevel_Id+="s"; - } - if ((int)pStat.get("enchanting").get(9) < 1 || !configLoad.getAllowedSkillsMap().get("enchanting")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("enchantingPerkTitle1") + " (1/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } else if (p.getLevel() < xpLevelCost) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + lang.getString("craftXPRequirement") + " " + xpLevelCost + " " + lang.getString(xpLevel_Id)); - } else { - p.setLevel(p.getLevel()-xpLevelCost); - p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE,1); - } - } - else if (craftingMatch(sharpness,crafting) || craftingMatch(protection,crafting)) { - int xpLevelCost = 0; - if (craftingMatch(sharpness,crafting)) { - xpLevelCost = craftingRecipeClasses.get("enchanting3").getXPcraftCost(); - } else { - xpLevelCost = craftingRecipeClasses.get("enchanting4").getXPcraftCost(); - } - xpLevelCost*= (e.isShiftClick()) ? amountCrafted : 1; - - String xpLevel_Id = "xpLevel"; - if (xpLevelCost != 1) { - xpLevel_Id+="s"; - } - if ((int)pStat.get("enchanting").get(9) < 2 || !configLoad.getAllowedSkillsMap().get("enchanting")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("enchantingPerkTitle1") + " (2/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } else if (p.getLevel() < xpLevelCost) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + lang.getString("craftXPRequirement") + " " + xpLevelCost + " " + lang.getString(xpLevel_Id)); - } else { - p.setLevel(p.getLevel()-xpLevelCost); - p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE,1); - } - } - else if (craftingMatch(luck,crafting) || craftingMatch(lure,crafting)) { - int xpLevelCost = 0; - if (craftingMatch(luck,crafting)) { - xpLevelCost = craftingRecipeClasses.get("enchanting5").getXPcraftCost(); - } else { - xpLevelCost = craftingRecipeClasses.get("enchanting6").getXPcraftCost(); - } - xpLevelCost*= (e.isShiftClick()) ? amountCrafted : 1; - - String xpLevel_Id = "xpLevel"; - if (xpLevelCost != 1) { - xpLevel_Id+="s"; - } - if ((int)pStat.get("enchanting").get(9) < 3 || !configLoad.getAllowedSkillsMap().get("enchanting")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("enchantingPerkTitle1") + " (3/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } else if (p.getLevel() < xpLevelCost) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + lang.getString("craftXPRequirement") + " " + xpLevelCost + " " + lang.getString(xpLevel_Id)); - } else { - p.setLevel(p.getLevel()-xpLevelCost); - p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE,1); - } - } - else if (craftingMatch(depth,crafting) || craftingMatch(frost,crafting)) { - int xpLevelCost = 0; - if (craftingMatch(frost,crafting)) { - xpLevelCost = craftingRecipeClasses.get("enchanting7").getXPcraftCost(); - } else { - xpLevelCost = craftingRecipeClasses.get("enchanting8").getXPcraftCost(); - } - xpLevelCost*= (e.isShiftClick()) ? amountCrafted : 1; - - String xpLevel_Id = "xpLevel"; - if (xpLevelCost != 1) { - xpLevel_Id+="s"; - } - if ((int)pStat.get("enchanting").get(9) < 4 || !configLoad.getAllowedSkillsMap().get("enchanting")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("enchantingPerkTitle1") + " (4/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } else if (p.getLevel() < xpLevelCost) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + lang.getString("craftXPRequirement") + " " + xpLevelCost + " " + lang.getString(xpLevel_Id)); - } else { - p.setLevel(p.getLevel()-xpLevelCost); - p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE,1); - } - } - else if (craftingMatch(mending,crafting) || craftingMatch(fortune,crafting)) { - int xpLevelCost = 0; - if (craftingMatch(mending,crafting)) { - xpLevelCost = craftingRecipeClasses.get("enchanting9").getXPcraftCost(); - } - else { - xpLevelCost = craftingRecipeClasses.get("enchanting10").getXPcraftCost(); - } - xpLevelCost*= (e.isShiftClick()) ? amountCrafted : 1; - - String xpLevel_Id = "xpLevel"; - if (xpLevelCost != 1) { - xpLevel_Id+="s"; - } - if ((int)pStat.get("enchanting").get(9) < 5 || !configLoad.getAllowedSkillsMap().get("enchanting")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("enchantingPerkTitle1") + " (5/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } else if (p.getLevel() < xpLevelCost) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + lang.getString("craftXPRequirement") + " " + xpLevelCost + " " + lang.getString(xpLevel_Id)); - } else { - p.setLevel(p.getLevel()-xpLevelCost); - p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE,1); - } - } - else if (craftingMatch(waterBreathing,crafting)) { - if ((int)pStat.get("alchemy").get(7) < 1 || !configLoad.getAllowedSkillsMap().get("alchemy")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("alchemyPerkTitle0") + " (1/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } - } - else if (craftingMatch(speed,crafting)) { - if ((int)pStat.get("alchemy").get(7) < 2 || !configLoad.getAllowedSkillsMap().get("alchemy")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("alchemyPerkTitle0") + " (2/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } - } - else if (craftingMatch(fireResistance,crafting)) { - if ((int)pStat.get("alchemy").get(7) < 3 || !configLoad.getAllowedSkillsMap().get("alchemy")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("alchemyPerkTitle0") + " (3/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } - } - else if (craftingMatch(healing,crafting)) { - if ((int)pStat.get("alchemy").get(7) < 4 || !configLoad.getAllowedSkillsMap().get("alchemy")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("alchemyPerkTitle0") + " (4/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } - } - else if (craftingMatch(strength,crafting)) { - if ((int)pStat.get("alchemy").get(7) < 5 || !configLoad.getAllowedSkillsMap().get("alchemy")) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + lang.getString("alchemyPerkTitle0") + " (5/5)" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement")); - } - } - - - - - - /* EXAMPLE FOR CRAFTING PERMS - ItemStack[] TNT2 = {null, new ItemStack(Material.SAND,1), null, - new ItemStack(Material.SAND,1), new ItemStack(Material.GUNPOWDER,1), new ItemStack(Material.SAND,1), - null, new ItemStack(Material.SAND,1), null }; - - //TNT crafting - if (craftingMatch(TNT2,crafting)) { - - if ((int)pStat.get("mining").get(12) < 1) { - e.setCancelled(true); - p.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + "More Bombs" + ChatColor.RESET + ChatColor.RED.toString() + " " + lang.getString("craftRequirement)); - } - } - */ - - } - -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerDismount.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerDismount.java deleted file mode 100644 index cd14b69..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerDismount.java +++ /dev/null @@ -1,25 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.gameTools.HorseRiding; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.spigotmc.event.entity.EntityDismountEvent; - -public class PlayerDismount implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onPlayerTakeDamage(EntityDismountEvent e){ - if (e.isCancelled()) { - return; - } - Entity mount = e.getDismounted(); - HorseRiding horseRiding = new HorseRiding(); - Player p = horseRiding.getPlayerFromMount(mount.getUniqueId()); - if (p!=null){ - horseRiding.deletePlayerData(p); - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerDropItem.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerDropItem.java deleted file mode 100644 index 1c65926..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerDropItem.java +++ /dev/null @@ -1,59 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.perksAndAbilities.Digging; -import mc.carlton.freerpg.perksAndAbilities.Mining; -import mc.carlton.freerpg.perksAndAbilities.Swordsmanship; -import mc.carlton.freerpg.playerInfo.AbilityLogoutTracker; -import mc.carlton.freerpg.playerInfo.AbilityTracker; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerDropItemEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.persistence.PersistentDataType; - -public class PlayerDropItem implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onItemDrop(PlayerDropItemEvent e){ - if (e.isCancelled()) { - return; - } - Player p = (Player) e.getPlayer(); - AbilityTracker abilities = new AbilityTracker(p); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[0] != -1) { - AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); - NamespacedKey key = logoutTracker.getPlayerKeys().get("digging"); - int taskID_digging = logoutTracker.getPlayerTasks().get("digging"); - if (e.getItemDrop().getItemStack().getItemMeta().getPersistentDataContainer().has(key, PersistentDataType.STRING)) { - ItemStack abilityItem = e.getItemDrop().getItemStack(); - Digging diggingClass = new Digging(p); - diggingClass.preventLogoutTheft(taskID_digging,abilityItem,key,false); - } - } - if (pAbilities[2] != -1) { - AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); - NamespacedKey key = logoutTracker.getPlayerKeys().get("mining"); - int taskID_mining = logoutTracker.getPlayerTasks().get("mining"); - if (e.getItemDrop().getItemStack().getItemMeta().getPersistentDataContainer().has(key, PersistentDataType.STRING)) { - ItemStack abilityItem = e.getItemDrop().getItemStack(); - Mining miningClass = new Mining(p); - miningClass.preventLogoutTheft(taskID_mining,abilityItem,key,false); - } - } - - if (pAbilities[7] != -1) { - AbilityLogoutTracker logoutTracker = new AbilityLogoutTracker(p); - NamespacedKey key = logoutTracker.getPlayerKeys().get("swordsmanship"); - int taskID_swordsmanship = logoutTracker.getPlayerTasks().get("swordsmanship"); - if (e.getItemDrop().getItemStack().getItemMeta().getPersistentDataContainer().has(key, PersistentDataType.STRING)) { - ItemStack abilityItem = e.getItemDrop().getItemStack(); - Swordsmanship swordsmanshipClass = new Swordsmanship(p); - swordsmanshipClass.preventLogoutTheft(taskID_swordsmanship,abilityItem,key,false); - } - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerEnterVehicle.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerEnterVehicle.java deleted file mode 100644 index 41faa13..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerEnterVehicle.java +++ /dev/null @@ -1,30 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.perksAndAbilities.Agility; -import mc.carlton.freerpg.perksAndAbilities.BeastMastery; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.vehicle.VehicleEnterEvent; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; -import org.spigotmc.event.entity.EntityMountEvent; - -public class PlayerEnterVehicle implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onEnterVehicle(VehicleEnterEvent e){ - if (e.isCancelled()) { - return; - } - if (e.getEntered() instanceof Player) { - Player p = (Player) e.getEntered(); - Agility agilityClass = new Agility(p); - agilityClass.sprintingEXP(false); - } - - - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerFish.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerFish.java deleted file mode 100644 index 0a1771d..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerFish.java +++ /dev/null @@ -1,83 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.perksAndAbilities.Fishing; -import mc.carlton.freerpg.playerInfo.AbilityTracker; -import org.bukkit.GameMode; -import org.bukkit.World; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerFishEvent; - -public class PlayerFish implements Listener { - - @EventHandler(priority = EventPriority.HIGH) - void onPlayerFish(PlayerFishEvent e) { - Player p = e.getPlayer(); - if (e.isCancelled()) { - return; - } - if (!p.hasPermission("freeRPG.fish")) { - return; - } - if (p.getGameMode() == GameMode.CREATIVE) { - return; - } - - World world = p.getWorld(); - Entity caughtThing = e.getCaught(); - AbilityTracker abilities = new AbilityTracker(p); - Integer[] pAbilities = abilities.getPlayerAbilities(); - - - if (e.getState() == PlayerFishEvent.State.FISHING) { - if (pAbilities[4] > -1) { - Fishing fishingClass = new Fishing(p); - fishingClass.enableAbility(); - } - } - else if (e.getState() == PlayerFishEvent.State.REEL_IN) { - Fishing fishingClass = new Fishing(p); - if (pAbilities[4] == -2) { - fishingClass.superBait(e.getHook(),caughtThing,world); - } - - } - else if (e.getState() == PlayerFishEvent.State.IN_GROUND) { - Fishing fishingClass = new Fishing(p); - fishingClass.grapplingHook(e.getHook(),world); - } - else if (e.getState() == PlayerFishEvent.State.CAUGHT_FISH) { - Fishing fishingClass = new Fishing(p); - if (pAbilities[4] == -2) { - fishingClass.superBait(e.getHook(),caughtThing,world); - } - } - else if (e.getState() == PlayerFishEvent.State.CAUGHT_ENTITY) { - Fishing fishingClass = new Fishing(p); - fishingClass.rob(e.getHook(),e.getCaught(),world); - } - - - - /* - System.out.println(e.getState());; - System.out.println(e.getHook().getLocation().getBlock().getType()); - if (caughtThing == null && e.getState() == PlayerFishEvent.State.REEL_IN) { - double dx = p.getLocation().getX() - e.getHook().getLocation().getX(); - double dy = p.getLocation().getY() - e.getHook().getLocation().getY(); - double dz = p.getLocation().getZ() - e.getHook().getLocation().getZ(); - double distance = Math.sqrt(dx*dx + dy*dy + dz+dz); - double multiplier = 0.08; - Item droppedItem = world.dropItemNaturally(e.getHook().getLocation(),new ItemStack(Material.GOLD_INGOT,1)); - Vector velocity = new Vector(dx*multiplier,dy*multiplier + (double) Math.sqrt(distance)*0.1 ,dz*multiplier); - droppedItem.setVelocity(velocity); - - - } - - */ - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerMount.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerMount.java deleted file mode 100644 index ea9c5df..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerMount.java +++ /dev/null @@ -1,37 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.perksAndAbilities.BeastMastery; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; -import org.spigotmc.event.entity.EntityMountEvent; - -public class PlayerMount implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onPlayerMount(EntityMountEvent e){ - if (e.isCancelled()) { - return; - } - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - new BukkitRunnable() { - @Override - public void run() { - Entity mount = e.getMount(); - for (Entity passenger : e.getMount().getPassengers()) { - if (passenger instanceof Player) { - Player p = (Player) passenger; - BeastMastery beastMasteryClass = new BeastMastery(p); - beastMasteryClass.horseRidingEXP(mount); - } - } - - } - }.runTaskLater(plugin, 1); - - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerPrepareCrafting.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerPrepareCrafting.java deleted file mode 100644 index a1a5b37..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerPrepareCrafting.java +++ /dev/null @@ -1,204 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.PrepareItemCraftEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.potion.PotionData; - -import java.util.ArrayList; -import java.util.Map; - -public class PlayerPrepareCrafting implements Listener { - - @EventHandler - public void craftEvent(PrepareItemCraftEvent event) { - ItemStack[] contents = event.getInventory().getContents(); - ItemStack firstInContents = contents[0]; - Player p = (Player) event.getView().getPlayer(); - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - - if((firstInContents.getType()== Material.TNT) && (firstInContents.getAmount() == 1)) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("mining")) { - return; - } - int moreBombsLevel = (int)pStat.get("mining").get(8); - if (moreBombsLevel > 0) { - firstInContents.setAmount(Math.min(6,moreBombsLevel+1)); - } - } - else if((firstInContents.getType()== Material.ARROW) && (firstInContents.getAmount() < 64)) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("archery")) { - return; - } - if ((int)pStat.get("archery").get(7) > 0) { - firstInContents.setAmount(4+(int)pStat.get("archery").get(7)); - } - } - else if(firstInContents.getType() == Material.TIPPED_ARROW && contents[5].getType() == Material.POTION) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("archery")) { - return; - } - PotionMeta potionMeta = (PotionMeta) contents[5].getItemMeta(); - ItemGroups itemGroups = new ItemGroups(); - ItemStack arrow = new ItemStack(Material.ARROW,1); - PotionData pData = potionMeta.getBasePotionData(); - switch (pData.getType()) { - case LUCK: - arrow = itemGroups.getArrow("luck"); - break; - case JUMP: - arrow = itemGroups.getArrow("leaping"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_leaping"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_leaping"); - } - break; - case REGEN: - arrow = itemGroups.getArrow("regeneration"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_regeneration"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_regeneration"); - } - break; - case SPEED: - arrow = itemGroups.getArrow("swiftness"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_swiftness"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_swiftness"); - } - break; - case POISON: - arrow = itemGroups.getArrow("poison"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_poison"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_poison"); - } - break; - case SLOWNESS: - arrow = itemGroups.getArrow("slowness"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_slowness"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_slowness"); - } - break; - case STRENGTH: - arrow = itemGroups.getArrow("strength"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_strength"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_strength"); - } - break; - case WEAKNESS: - arrow = itemGroups.getArrow("weakness"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_weakness"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_weakness"); - } - break; - case INSTANT_HEAL: - arrow = itemGroups.getArrow("healing"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_healing"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_healing"); - } - break; - case INVISIBILITY: - arrow = itemGroups.getArrow("invisibility"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_invisibility"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_invisibility"); - } - break; - case NIGHT_VISION: - arrow = itemGroups.getArrow("night_vision"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_night_vision"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_night_vision"); - } - break; - case SLOW_FALLING: - arrow = itemGroups.getArrow("slow_falling"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_slow_falling"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_slow_falling"); - } - break; - case TURTLE_MASTER: - arrow = itemGroups.getArrow("turtle_master"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_turtle_master"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_turtle_master"); - } - break; - case INSTANT_DAMAGE: - arrow = itemGroups.getArrow("harming"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_harming"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_harming"); - } - break; - case FIRE_RESISTANCE: - arrow = itemGroups.getArrow("fire_resistance"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_fire_resistance"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_fire_resistance"); - } - break; - case WATER_BREATHING: - arrow = itemGroups.getArrow("water_breathing"); - if (pData.isExtended()) { - arrow = itemGroups.getArrow("long_water_breathing"); - } - if (pData.isUpgraded()) { - arrow = itemGroups.getArrow("strong_water_breathing"); - } - break; - default: - arrow = new ItemStack(Material.AIR); - break; - } - event.getInventory().setResult(arrow); - } - - - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerRespawn.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerRespawn.java deleted file mode 100644 index 9809b4d..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerRespawn.java +++ /dev/null @@ -1,19 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.perksAndAbilities.Global; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerRespawnEvent; -import org.bukkit.plugin.Plugin; - -public class PlayerRespawn implements Listener { - @EventHandler - void onRespawn(PlayerRespawnEvent e){ - Player p = (Player) e.getPlayer(); - Global globalClass = new Global(p); - globalClass.betterResurrectionRespawn(); - - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerShear.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerShear.java deleted file mode 100644 index 2a01326..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerShear.java +++ /dev/null @@ -1,36 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.perksAndAbilities.Farming; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.World; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerShearEntityEvent; - -public class PlayerShear implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onPlayerShear(PlayerShearEntityEvent e){ - if (e.isCancelled()) { - return; - } - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.getAllowedSkillsMap().get("farming")) { - return; - } - Player p = e.getPlayer(); - Entity entity = e.getEntity(); - World world = p.getWorld(); - if (entity.getType().equals(EntityType.SHEEP)) { - e.setCancelled(true); - } - - //Farming - Farming farmingClass = new Farming(p); - farmingClass.shearSheep(entity,world); - - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerToggleSprint.java b/src/main/java/mc/carlton/freerpg/miscEvents/PlayerToggleSprint.java deleted file mode 100644 index 0748fd4..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/PlayerToggleSprint.java +++ /dev/null @@ -1,23 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.perksAndAbilities.Agility; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerToggleSprintEvent; -import org.bukkit.plugin.Plugin; - -public class PlayerToggleSprint implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onSprintToggle(PlayerToggleSprintEvent e){ - if (e.isCancelled()) { - return; - } - Player p = e.getPlayer(); - Agility agilityClass = new Agility(p); - agilityClass.sprintingEXP(e.isSprinting()); - - } -} diff --git a/src/main/java/mc/carlton/freerpg/miscEvents/TameEntityEvent.java b/src/main/java/mc/carlton/freerpg/miscEvents/TameEntityEvent.java deleted file mode 100644 index dc7d4ab..0000000 --- a/src/main/java/mc/carlton/freerpg/miscEvents/TameEntityEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -package mc.carlton.freerpg.miscEvents; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.perksAndAbilities.BeastMastery; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityTameEvent; -import org.bukkit.plugin.Plugin; - -public class TameEntityEvent implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onEntityTame(EntityTameEvent e){ - if (e.isCancelled()) { - return; - } - Entity entity = e.getEntity(); - Player p = (Player) e.getOwner(); - BeastMastery beastMasteryClass = new BeastMastery(p); - beastMasteryClass.tamingEXP(entity); - - } -} diff --git a/src/main/java/mc/carlton/freerpg/newEvents/FrpgAbilityItemMovedEvent.java b/src/main/java/mc/carlton/freerpg/newEvents/FrpgAbilityItemMovedEvent.java deleted file mode 100644 index f6e1928..0000000 --- a/src/main/java/mc/carlton/freerpg/newEvents/FrpgAbilityItemMovedEvent.java +++ /dev/null @@ -1,112 +0,0 @@ -package mc.carlton.freerpg.newEvents; - -import org.bukkit.entity.Player; -import org.bukkit.event.*; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryDragEvent; -import org.bukkit.event.player.PlayerInteractEntityEvent; -import org.bukkit.inventory.ItemStack; -import org.jetbrains.annotations.NotNull; - -/* - * This event constitutes multiple event in the case that an ability item is moved - */ -public class FrpgAbilityItemMovedEvent extends Event implements Cancellable { - private static final HandlerList handlers = new HandlerList(); - private boolean cancelled; - private Event event; - private Player player; - private ItemStack abilityItem; - - private FrpgAbilityItemMovedEvent(ItemStack abilityItem, Event event) { - this.event = event; - this.abilityItem = abilityItem; - if (event instanceof Cancellable) { - this.cancelled = ((Cancellable) event).isCancelled(); - } - } - - /** - * Class constructor - * @param event InventoryClickEvent - * @param abilityItem Item that has active ability on it - */ - public FrpgAbilityItemMovedEvent(InventoryClickEvent event, ItemStack abilityItem) { - this(abilityItem,event); - this.player = (Player) event.getWhoClicked(); - } - /** - * Class constructor - * @param event InventoryDragEvent - * @param abilityItem Item that has active ability on it - */ - public FrpgAbilityItemMovedEvent(InventoryDragEvent event, ItemStack abilityItem) { - this(abilityItem,event); - this.player = (Player) event.getWhoClicked(); - } - /** - * Class constructor - * @param event FrpgPlayerRightClickEvent - * @param abilityItem Item that has active ability on it - */ - public FrpgAbilityItemMovedEvent(FrpgPlayerRightClickEvent event, ItemStack abilityItem) { - this(abilityItem,event); - this.player = event.getPlayer(); - } - - /** - * Class constructor - * @param event FrpgPlayerRightClickEvent - * @param abilityItem Item that has active ability on it - */ - public FrpgAbilityItemMovedEvent(PlayerInteractEntityEvent event, ItemStack abilityItem) { - this(abilityItem,event); - this.player = event.getPlayer(); - } - - /** - * Getter for the player - * @return Player who moved the ability item - */ - public Player getPlayer() { - return player; - } - - /** - * getter for abilityItem - * @return The resulting itemstack that is an ability item - */ - public ItemStack getAbilityItem() { - return abilityItem; - } - - /** - * Getter for cancelled - * @return true if the associated event is cancelled - */ - @Override - public boolean isCancelled() { - return cancelled; - } - - /** - * Setter for cancrlled, also cancels the event - * @param cancel true if the event is to be cancelled - */ - @Override - public void setCancelled(boolean cancel) { - if (event instanceof Cancellable) { - ((Cancellable) event).setCancelled(cancel); - } - this.cancelled = cancel; - } - - @Override - public @NotNull HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } -} diff --git a/src/main/java/mc/carlton/freerpg/newEvents/FrpgPlayerCraftItemEvent.java b/src/main/java/mc/carlton/freerpg/newEvents/FrpgPlayerCraftItemEvent.java deleted file mode 100644 index 2c8aa13..0000000 --- a/src/main/java/mc/carlton/freerpg/newEvents/FrpgPlayerCraftItemEvent.java +++ /dev/null @@ -1,84 +0,0 @@ -package mc.carlton.freerpg.newEvents; - -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; -import org.bukkit.event.Event; -import org.bukkit.event.HandlerList; -import org.bukkit.event.inventory.CraftItemEvent; -import org.bukkit.inventory.ItemStack; - -/* -* A more specific case of the CraftItemEvent that only fires if the item is actually crafted -* (Spigot's version will fire event if the item is not actually crafted) - */ -public class FrpgPlayerCraftItemEvent extends Event implements Cancellable { - private static final HandlerList handlers = new HandlerList(); - private boolean cancelled; - private CraftItemEvent craftItemEvent; - private Player player; - private ItemStack result; - - /** - * Constructor for the event - * @param event The wrapped craftItemEvent - * @param p Player who crafted the recipe - */ - public FrpgPlayerCraftItemEvent(CraftItemEvent event, Player p) { - this.craftItemEvent = event; - this.player = p; - this.result = event.getRecipe().getResult(); - this.cancelled = event.isCancelled(); - } - - /** - * getter for result - * @return The resulting itemstack crafted - */ - public ItemStack getResult() { - return result; - } - - /** - * Getter for the craft item event - * @return the CraftItemEvent associated with this event - */ - public CraftItemEvent getCraftItemEvent() { - return craftItemEvent; - } - - /** - * Getter for the player - * @return Player who crafted the item - */ - public Player getPlayer() { - return player; - } - - /** - * Getter for cancelled - * @return whether or not the event has been cancelled - */ - @Override - public boolean isCancelled() { - return cancelled; - } - - /** - * Setter for cancelled, cancels the assocaited craftItemEvent - * @param cancel true if event is to be cancelled, false otherwise - */ - @Override - public void setCancelled(boolean cancel) { - this.craftItemEvent.setCancelled(true); //Cancels the wrapped event - cancelled = cancel; - } - - @Override - public HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } -} diff --git a/src/main/java/mc/carlton/freerpg/newEvents/FrpgPlayerRightClickEvent.java b/src/main/java/mc/carlton/freerpg/newEvents/FrpgPlayerRightClickEvent.java deleted file mode 100644 index c87eeef..0000000 --- a/src/main/java/mc/carlton/freerpg/newEvents/FrpgPlayerRightClickEvent.java +++ /dev/null @@ -1,92 +0,0 @@ -package mc.carlton.freerpg.newEvents; - -import org.bukkit.entity.Player; -import org.bukkit.event.Cancellable; -import org.bukkit.event.Event; -import org.bukkit.event.HandlerList; -import org.bukkit.event.block.Action; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryDragEvent; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.EquipmentSlot; -import org.bukkit.inventory.ItemStack; -import org.jetbrains.annotations.NotNull; - - -/* - * An event that wraps PlayerInteractEvent, but only fires if the interaction type is a right click - */ -public class FrpgPlayerRightClickEvent extends Event implements Cancellable { - private static final HandlerList handlers = new HandlerList(); - private boolean cancelled; - private PlayerInteractEvent playerInteractEvent; - private boolean isClickAir; - private boolean isOffHand; - - public FrpgPlayerRightClickEvent(PlayerInteractEvent event) { - this.playerInteractEvent = event; - this.isClickAir = event.getAction().equals(Action.RIGHT_CLICK_AIR); - this.isOffHand = event.getHand().equals(EquipmentSlot.OFF_HAND); - } - - /** - * Getter for the playerInteractEvent - * @return the associated PlayerInteractEvent - */ - public PlayerInteractEvent getPlayerInteractEvent() { - return playerInteractEvent; - } - - /** - * Getter for the player - * @return the player associated PlayerInteractEvent (player who right clicked) - */ - public Player getPlayer() { - return playerInteractEvent.getPlayer(); - } - - /** - * Getter for isClickAir - * @return true if the right click was on an air block, false otherwise - */ - public boolean isClickAir() { - return isClickAir; - } - - /** - * Getter for isOffHand - * @return true if the right click was made using an offhand item, false otherwise - */ - public boolean isOffHand() { - return isOffHand; - } - - - /** - * Getter for cancelled - * @return false (always because the associated PlayerInteractEvent has two cancelled states) - */ - @Override - public boolean isCancelled() { - return cancelled; - } - - /** - * Setter for cancelled - * @param cancel true if the associated PlayerInteractEvent is to be cancelled - */ - @Override - public void setCancelled(boolean cancel) { - playerInteractEvent.setCancelled(true); - this.cancelled = cancel; - } - - @Override - public @NotNull HandlerList getHandlers() { - return handlers; - } - - public static HandlerList getHandlerList() { - return handlers; - } -} diff --git a/src/main/java/mc/carlton/freerpg/newEvents/eventCallers/FrpgAbilityItemMovedEventCaller.java b/src/main/java/mc/carlton/freerpg/newEvents/eventCallers/FrpgAbilityItemMovedEventCaller.java deleted file mode 100644 index fcca196..0000000 --- a/src/main/java/mc/carlton/freerpg/newEvents/eventCallers/FrpgAbilityItemMovedEventCaller.java +++ /dev/null @@ -1,149 +0,0 @@ -package mc.carlton.freerpg.newEvents.eventCallers; - -import mc.carlton.freerpg.gameTools.TrackItem; -import mc.carlton.freerpg.newEvents.FrpgAbilityItemMovedEvent; -import mc.carlton.freerpg.newEvents.FrpgPlayerCraftItemEvent; -import mc.carlton.freerpg.newEvents.FrpgPlayerRightClickEvent; -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.ItemFrame; -import org.bukkit.entity.Player; -import org.bukkit.event.Event; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.event.inventory.InventoryDragEvent; -import org.bukkit.event.inventory.InventoryType; -import org.bukkit.event.player.PlayerInteractEntityEvent; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.EquipmentSlot; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.persistence.PersistentDataContainer; -import org.bukkit.persistence.PersistentDataType; -import org.bukkit.plugin.PluginManager; - -public class FrpgAbilityItemMovedEventCaller implements Listener { - - @EventHandler - public void inventoryClickAbilityItem(InventoryClickEvent e) { - Player p; - - Inventory clickedInventory; - InventoryType clickedInventoryType; - try { - p = (Player) e.getWhoClicked(); - clickedInventory = e.getClickedInventory(); - clickedInventoryType = clickedInventory.getType(); - } catch (Exception except) { - return; - } - if (e.getClick().equals(ClickType.NUMBER_KEY)) { - if (!clickedInventoryType.equals(InventoryType.PLAYER)) { - ItemStack itemToBeMoved = p.getInventory().getItem(e.getHotbarButton()); - callEventIfItemIsTracked(itemToBeMoved,p,e); //Calls event - } - } - else if (e.getClick().equals(ClickType.SWAP_OFFHAND)) { - ItemStack itemInOffhand = p.getInventory().getItemInOffHand(); - if (itemInOffhand != null) { - callEventIfItemIsTracked(itemInOffhand,p,e); //Calls event - } - } - else if (e.isShiftClick()) { - ItemStack clickedItem = e.getCurrentItem(); - callEventIfItemIsTracked(clickedItem,p,e); //Calls event - } - else if (e.getCursor() != null) { - if (!e.getCursor().getType().equals(Material.AIR)) { - if (!clickedInventoryType.equals(InventoryType.PLAYER)) { - ItemStack clickedItem = e.getCursor(); - callEventIfItemIsTracked(clickedItem,p,e); //Calls event - } - } - } - } - - @EventHandler - public void inventoryDragAbilityItem(InventoryDragEvent e) { - Player p; - - Inventory clickedInventory; - InventoryType clickedInventoryType; - try { - p = (Player) e.getWhoClicked(); - clickedInventory = e.getInventory(); - clickedInventoryType = clickedInventory.getType(); - } catch (Exception except) { - return; - } - if (e.getOldCursor() != null) { - if (!e.getOldCursor().getType().equals(Material.AIR)) { - ItemStack clickedItem = e.getOldCursor(); - callEventIfItemIsTracked(clickedItem,p,e); //Calls event - } - } - } - - @EventHandler - public void itemFrameRightClickAbilityItem(PlayerInteractEntityEvent e){ - if (!(e.getRightClicked() instanceof ItemFrame)) { - return; - } - ItemStack clickedItem; - Player p = e.getPlayer(); - if (e.getHand().equals(EquipmentSlot.HAND)) { - clickedItem = p.getInventory().getItemInMainHand(); - } else { - clickedItem = p.getInventory().getItemInOffHand(); - } - callEventIfItemIsTracked(clickedItem,p,e); //Calls event - } - - private void createAndCallAbilityItemMovedEvent(ItemStack itemStack, Event event) { - FrpgAbilityItemMovedEvent abilityItemMovedEvent = null; - if (event instanceof PlayerInteractEntityEvent) { - abilityItemMovedEvent = new FrpgAbilityItemMovedEvent((PlayerInteractEntityEvent) event,itemStack); - } else if (event instanceof InventoryDragEvent) { - abilityItemMovedEvent = new FrpgAbilityItemMovedEvent((InventoryDragEvent) event,itemStack); - } else if (event instanceof InventoryClickEvent) { - abilityItemMovedEvent = new FrpgAbilityItemMovedEvent((InventoryClickEvent) event,itemStack); - } - if (abilityItemMovedEvent != null) { - PluginManager pluginManager = Bukkit.getServer().getPluginManager(); - pluginManager.callEvent(abilityItemMovedEvent); //Call event - } - } - - private void callEventIfItemIsTracked(ItemStack itemStack, Player p, Event event){ - TrackItem trackItem = new TrackItem(); - NamespacedKey key = trackItem.getFreeRPGItemKey(itemStack,p); - if (key != null) { - createAndCallAbilityItemMovedEvent(itemStack,event); - } - - /* - Below is a more specific version of the same method - */ - /* - TrackItem trackItem = new TrackItem(); - NamespacedKey key = trackItem.getFreeRPGItemKey(clickedItem,p); - if (key != null) { - ItemMeta itemMeta = clickedItem.getItemMeta(); - PersistentDataContainer container = itemMeta.getPersistentDataContainer(); - String specialItemType = container.get(key, PersistentDataType.STRING); - if (specialItemType == null) { - return; - } - if (specialItemType.equalsIgnoreCase("frpg-digging") || specialItemType.equalsIgnoreCase("frpg-mining") - || specialItemType.equalsIgnoreCase("frpg-swordsmanship")) { - FrpgAbilityItemMovedEvent abilityItemMovedEvent = new FrpgAbilityItemMovedEvent(e,clickedItem); - pluginManager.callEvent(abilityItemMovedEvent); //Call event - } - } - */ - } -} diff --git a/src/main/java/mc/carlton/freerpg/newEvents/eventCallers/FrpgPlayerCraftItemEventCaller.java b/src/main/java/mc/carlton/freerpg/newEvents/eventCallers/FrpgPlayerCraftItemEventCaller.java deleted file mode 100644 index 0cfc2f5..0000000 --- a/src/main/java/mc/carlton/freerpg/newEvents/eventCallers/FrpgPlayerCraftItemEventCaller.java +++ /dev/null @@ -1,62 +0,0 @@ -package mc.carlton.freerpg.newEvents.eventCallers; - -import mc.carlton.freerpg.newEvents.FrpgPlayerCraftItemEvent; -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.inventory.ClickType; -import org.bukkit.event.inventory.CraftItemEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.PluginManager; - -public class FrpgPlayerCraftItemEventCaller implements Listener { - - @EventHandler(priority = EventPriority.HIGH) - void onPlayerCraft(CraftItemEvent e) { - Player p = (Player) e.getWhoClicked(); - FrpgPlayerCraftItemEvent playerCraftItemEvent = new FrpgPlayerCraftItemEvent(e,p); - PluginManager pluginManager = Bukkit.getServer().getPluginManager(); - if (e.getClick().equals(ClickType.MIDDLE) || e.getClick().equals(ClickType.UNKNOWN) || - e.getClick().equals(ClickType.WINDOW_BORDER_LEFT) || e.getClick().equals(ClickType.WINDOW_BORDER_RIGHT)) { - return; - } - else if (e.getClick().equals(ClickType.SWAP_OFFHAND)) { - ItemStack itemInOffhand = p.getInventory().getItemInOffHand(); - if (itemInOffhand != null) { - if (!itemInOffhand.getType().equals(Material.AIR)) { - return; - } - } - pluginManager.callEvent(playerCraftItemEvent); //Call event - } - else if (e.getClick().equals(ClickType.SHIFT_RIGHT) || e.getClick().equals(ClickType.SHIFT_LEFT) || - e.getClick().equals(ClickType.LEFT) || e.getClick().equals(ClickType.RIGHT) || - e.getClick().equals(ClickType.NUMBER_KEY)) { - /* - Only god knows what I was thinking when I wrote these nested conditionals, but it works. - */ - if (e.getCursor() != null) { //Should never be the case, but just to prevent errors - if (e.getCursor().getType().equals(Material.AIR) || e.isShiftClick()) { //User must click with empty cursor (or shift click) - if (e.getHotbarButton() != -1 || e.isShiftClick()) { //User used number key or shift clicked - if (p.getInventory().firstEmpty() != -1) { //Inventory is not full - if (e.getHotbarButton() != -1) { //Hotbar button click case - if (p.getInventory().getItem(e.getHotbarButton()) == null) { //Null case, same as the "else if" (to be safe, should never occur) - pluginManager.callEvent(playerCraftItemEvent); //Call event - } else if (p.getInventory().getItem(e.getHotbarButton()).getType().equals(Material.AIR)) { //Reward EXP if the hotbar slot is empty (item crafted) - pluginManager.callEvent(playerCraftItemEvent); //Call event - } - } else { //Shift click case - pluginManager.callEvent(playerCraftItemEvent); //Call event - } - } - } else { //If user clicked with empty cursor - pluginManager.callEvent(playerCraftItemEvent); //Call event - } - } - } - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/newEvents/eventCallers/FrpgPlayerRightClickEventCaller.java b/src/main/java/mc/carlton/freerpg/newEvents/eventCallers/FrpgPlayerRightClickEventCaller.java deleted file mode 100644 index ff16f6e..0000000 --- a/src/main/java/mc/carlton/freerpg/newEvents/eventCallers/FrpgPlayerRightClickEventCaller.java +++ /dev/null @@ -1,30 +0,0 @@ -package mc.carlton.freerpg.newEvents.eventCallers; - -import mc.carlton.freerpg.newEvents.FrpgPlayerCraftItemEvent; -import mc.carlton.freerpg.newEvents.FrpgPlayerRightClickEvent; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.Bukkit; -import org.bukkit.GameMode; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.inventory.EquipmentSlot; -import org.bukkit.plugin.PluginManager; - -public class FrpgPlayerRightClickEventCaller implements Listener { - - @EventHandler - void onRightClick(PlayerInteractEvent e) { - Action a = e.getAction(); - if (e.getHand() == EquipmentSlot.OFF_HAND) { - return; - } - if ((a.equals(Action.RIGHT_CLICK_AIR)) || (a.equals(Action.RIGHT_CLICK_BLOCK))) { - FrpgPlayerRightClickEvent playerRightClickEvent = new FrpgPlayerRightClickEvent(e); - PluginManager pluginManager = Bukkit.getServer().getPluginManager(); - pluginManager.callEvent(playerRightClickEvent); //Call event - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Agility.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Agility.java deleted file mode 100644 index 1544231..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Agility.java +++ /dev/null @@ -1,158 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.entity.Player; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; - -public class Agility extends Skill{ - - private String skillName = "agility"; - static Map gracefulFeetMap = new HashMap<>(); - static Map playerSprintMap = new HashMap<>(); - - Random rand = new Random(); //Random class Import - - private boolean runMethods; - - - public Agility(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - public double roll(double finalDamage) { - if (!runMethods) { - return 1.0; - } - Map> pStat = pStatClass.getPlayerData(); - int rollLevel = (int) pStat.get(skillName).get(4); - int steelBonesLevel = (int) pStat.get(skillName).get(9); - double multiplier = 1; - if (rollLevel*0.0005 > rand.nextDouble()) { - multiplier = 0.5 - steelBonesLevel*0.1; - increaseStats.changeEXP(skillName, expMap.get("rollBaseEXP") + (int) Math.round(finalDamage*expMap.get("roll_EXPperFallDamagePoint"))); - actionMessage.sendMessage(ChatColor.GREEN + ">>>" + lang.getString("roll") + "<<<"); - } - else { - if (finalDamage < p.getHealth()) { - increaseStats.changeEXP(skillName, (int) Math.round(finalDamage*expMap.get("roll_EXPperFallDamagePoint"))); - } - } - return multiplier; - } - - public boolean dodge(double finalDamage) { - if (!runMethods) { - return false; - } - Map> pStat = pStatClass.getPlayerData(); - int dodgeLevel = (int) pStat.get(skillName).get(7); - double dodgeChance = Math.min(0.2,dodgeLevel*0.04); - if (dodgeChance > rand.nextDouble()) { - increaseStats.changeEXP(skillName,(int) Math.round(expMap.get("dodge_EXPperDamagePointAvoided")*finalDamage)); - actionMessage.sendMessage(ChatColor.GREEN + ">>>"+lang.getString("dodge")+"<<<"); - return true; - } - else { - return false; - } - } - - public void gracefulFeetStart() { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int gracefulFeetLevel = (int) pStat.get(skillName).get(13); - int gracefulFeetToggle = (int) pStat.get("global").get(14); - if (gracefulFeetLevel > 0 && gracefulFeetToggle > 0) { - if (p.getPotionEffect(PotionEffectType.SPEED) == null) { - p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 20 * 60 * 20, 0)); - } - int natureID = new BukkitRunnable() { - @Override - public void run() { - if (p.getPotionEffect(PotionEffectType.SPEED) == null) { - p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,20*60*20,0)); - new BukkitRunnable() { - @Override - public void run() { - if (p.isOnline()) { - if (p.getPotionEffect(PotionEffectType.SPEED) == null) { - p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 20 * 60 * 20, 0)); - } - } - } - }.runTaskLater(plugin,20*60*20 + 1); - } - } - }.runTaskTimer(plugin, 200,200).getTaskId(); - gracefulFeetMap.put(p,natureID); - } - } - public void gracefulFeetEnd(){ - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int gracefulFeetLevel = (int) pStat.get(skillName).get(13); - if (gracefulFeetLevel > 0) { - if (gracefulFeetMap.containsKey(p)) { - if (p.isOnline()) { - if (p.hasPotionEffect(PotionEffectType.SPEED)) { - if (p.getPotionEffect(PotionEffectType.SPEED).getAmplifier() < 1) { - p.removePotionEffect(PotionEffectType.SPEED); - } - } - } - Bukkit.getScheduler().cancelTask(gracefulFeetMap.get(p)); - gracefulFeetMap.remove(p); - } - } - - } - - public void sprintingEXP(boolean beginSprint) { - if (!runMethods) { - return; - } - if (beginSprint) { - playerSprintMap.put(p,(new java.util.Date()).getTime()); - } - else if (!playerSprintMap.containsKey(p)) { //Somehow never began sprinting - return; - } - else { - try { - if (p.isFlying()) { - return; - } - ConfigLoad configLoad = new ConfigLoad(); - double timeThreshold = configLoad.getAgilityMinSprintTimeForExperience(); - long oldTime = playerSprintMap.get(p); - playerSprintMap.remove(p); - long newTime = (new java.util.Date()).getTime(); - long timeSprint = newTime-oldTime; - double timeSprintInSeconds = (timeSprint/1000.0); - if (timeSprintInSeconds >= timeThreshold) { - int expToGive = (int) Math.round(timeSprintInSeconds* expMap.get("sprint_EXPperSecondSprinted")); - increaseStats.changeEXP(skillName, expToGive); - } - } - catch (Exception e) { //This is terrible practice and I forgot why I did it - - } - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Alchemy.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Alchemy.java deleted file mode 100644 index 205bf76..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Alchemy.java +++ /dev/null @@ -1,569 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.ChatColor; -import org.bukkit.Effect; -import org.bukkit.Material; -import org.bukkit.World; -import org.bukkit.block.BrewingStand; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.BrewerInventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.potion.PotionData; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.potion.PotionType; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.*; - -public class Alchemy extends Skill{ - private String skillName = "alchemy"; - - private static Map counter = new HashMap<>(); - private static Map failSafe = new HashMap<>(); - private boolean runMethods; - - - public Alchemy(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill("alchemy"); - } - - public void startBrewing(BrewerInventory inventory, ItemStack output, ItemStack input) { - if (!runMethods) { - return; - } - if (counter.containsKey(inventory)) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - //int speedBrewingLevel = (int) pStat.get(skillName).get(7); - int time = 400; - BrewingStand stand = inventory.getHolder(); - World world = stand.getWorld(); - ItemStack[] originalContents = {inventory.getItem(0), inventory.getItem(1), inventory.getItem(2), inventory.getItem(3), inventory.getItem(4)}; - counter.put(inventory, time); - failSafe.put(inventory, time + 2); - stand.setBrewingTime(time); - if (stand.getFuelLevel() == 0) { - return; - } - stand.update(); - new BukkitRunnable() { - @Override - public void run() { - failSafe.put(inventory, failSafe.get(inventory) - 1); - if (failSafe.get(inventory) < 0) { - failSafe.remove(inventory); - counter.remove(inventory); - cancel(); - } - int timer = counter.get(inventory); - - if (timer == 0) //Finished brewing item changes - { - originalContents[3].setAmount(originalContents[3].getAmount() - 1); - stand.getSnapshotInventory().setItem(3, originalContents[3]); - PotionMeta outputMeta = (PotionMeta) output.getItemMeta(); - PotionEffect oldEffect = outputMeta.getCustomEffects().get(0); - String normalName = outputMeta.getDisplayName(); - for (int i = 0; i < 3; i++) { - if (inventory.getItem(i) == null || inventory.getItem(i).getType() == Material.AIR) { - continue; - } - - if (inventory.getItem(i).getType() == Material.SPLASH_POTION) { - output.setType(Material.SPLASH_POTION); - outputMeta.setDisplayName(ChatColor.RESET + ChatColor.WHITE.toString() + "Splash " + normalName); - output.setItemMeta(outputMeta); - } else if (inventory.getItem(i).getType() == Material.LINGERING_POTION) { - output.setType(Material.LINGERING_POTION); - outputMeta.setDisplayName(ChatColor.RESET + ChatColor.WHITE.toString() + "Lingering " + normalName); - PotionEffectType effect = outputMeta.getCustomEffects().get(0).getType(); - int newLength = (int) Math.round(outputMeta.getCustomEffects().get(0).getDuration() / 4.0); - outputMeta.addCustomEffect(new PotionEffect(effect, newLength, 0), true); - output.setItemMeta(outputMeta); - } else { - output.setType(Material.POTION); - outputMeta.setDisplayName(ChatColor.RESET + ChatColor.WHITE.toString() + normalName); - output.setItemMeta(outputMeta); - } - inventory.setItem(i, output); - stand.getSnapshotInventory().setItem(i, output); - outputMeta.addCustomEffect(oldEffect, true); - increaseStats.changeEXP(skillName,expMap.get("brewCustomPotion")); - - } - - stand.setFuelLevel(stand.getFuelLevel() - 1); - stand.update(); - world.playEffect(stand.getLocation(), Effect.BREWING_STAND_BREW, 1); - counter.remove(inventory); - failSafe.remove(inventory); - cancel(); - return; - } - - // ingredient removed checks - if (inventory.getIngredient() == null) { - counter.remove(inventory); - failSafe.remove(inventory); - cancel(); - return; - } - if (inventory.getIngredient().getType() != input.getType()) { - counter.remove(inventory); - failSafe.remove(inventory); - cancel(); - return; - } - - // water bottles removed check - boolean[] bottles = {false, false, false}; - for (int i = 0; i < 3; i++) { - if (inventory.getItem(i) != null && inventory.getItem(i).getType() != Material.AIR) { - bottles[i] = true; - } - } - if (!bottles[0] && !bottles[1] && !bottles[2]) { - counter.remove(inventory); - failSafe.remove(inventory); - cancel(); - return; - } - //Update counter progress - counter.put(inventory, timer - 1); - stand.setBrewingTime(timer - 1); - for (int i = 0; i < 5; i++) { - if (inventory.getItem(i) == null && originalContents[i] == null) { - continue; - } else if (inventory.getItem(i) == null) { - stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); - originalContents[i] = inventory.getItem(i); - } else if (originalContents[i] == null) { - stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); - originalContents[i] = inventory.getItem(i); - } else if (!inventory.getItem(i).equals(originalContents[i])) { - stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); - originalContents[i] = inventory.getItem(i); - } - } - stand.update(); - - } - }.runTaskTimer(plugin, 1, 1); - } - - public void upgradeBrewing(BrewerInventory inventory, ItemStack input, boolean[] slotsToCheck) { - if (!runMethods) { - return; - } - if (input.getType() != Material.REDSTONE && input.getType() != Material.GLOWSTONE_DUST) { - return; - } - double durationMultiplier = 1; - int potency = 0; - if (input.getType() == Material.REDSTONE) { - durationMultiplier = 8.0 / 3.0; - } else if (input.getType() == Material.GLOWSTONE_DUST) { - potency = 1; - durationMultiplier = 0.5; - } - if (counter.containsKey(inventory)) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - //int speedBrewingLevel = (int) pStat.get(skillName).get(7); - int time = 400; //(int) Math.round((1 - speedBrewingLevel * 0.15) * 400); - BrewingStand stand = inventory.getHolder(); - World world = stand.getWorld(); - ItemStack[] originalContents = {inventory.getItem(0), inventory.getItem(1), inventory.getItem(2), inventory.getItem(3), inventory.getItem(4)}; - counter.put(inventory, time); - failSafe.put(inventory, time + 2); - stand.setBrewingTime(time); - if (stand.getFuelLevel() == 0) { - return; - } - stand.update(); - double finalDurationMultiplier = durationMultiplier; - int finalPotency = potency; - new BukkitRunnable() { - @Override - public void run() { - failSafe.put(inventory, failSafe.get(inventory) - 1); - if (failSafe.get(inventory) < 0) { - failSafe.remove(inventory); - counter.remove(inventory); - cancel(); - } - int timer = counter.get(inventory); - - if (timer == 0) //Finished brewing item changes - { - originalContents[3].setAmount(originalContents[3].getAmount() - 1); - stand.getSnapshotInventory().setItem(3, originalContents[3]); - for (int i = 0; i < 3; i++) { - if (!slotsToCheck[i]) { - continue; - } - if (inventory.getItem(i) == null || inventory.getItem(i).getType() == Material.AIR) { - continue; - } - ItemStack potion = inventory.getItem(i); - PotionMeta potionMeta = (PotionMeta) potion.getItemMeta(); - PotionEffectType effect = potionMeta.getCustomEffects().get(0).getType(); - int newLength = (int) Math.round(potionMeta.getCustomEffects().get(0).getDuration() * finalDurationMultiplier); - potionMeta.addCustomEffect(new PotionEffect(effect, newLength, finalPotency), true); - if (finalPotency == 1) { //Glowstone - potionMeta.setDisplayName(potionMeta.getDisplayName() + " II"); - } - potionMeta.removeEnchant(Enchantment.LOYALTY); - potionMeta.addEnchant(Enchantment.DURABILITY,1,true); - potion.setItemMeta(potionMeta); - stand.getSnapshotInventory().setItem(i, potion); - increaseStats.changeEXP(skillName,expMap.get("upgradeCustomPotion")); - } - - stand.setFuelLevel(stand.getFuelLevel() - 1); - stand.update(); - world.playEffect(stand.getLocation(), Effect.BREWING_STAND_BREW, 1); - counter.remove(inventory); - failSafe.remove(inventory); - cancel(); - return; - } - - // ingredient removed checks - if (inventory.getIngredient() == null) { - counter.remove(inventory); - failSafe.remove(inventory); - cancel(); - return; - } - if (inventory.getIngredient().getType() != input.getType()) { - counter.remove(inventory); - failSafe.remove(inventory); - cancel(); - return; - } - - // water bottles removed check - boolean[] bottles = {false, false, false}; - for (int i = 0; i < 3; i++) { - if (inventory.getItem(i) != null && inventory.getItem(i).getType() != Material.AIR) { - bottles[i] = true; - } - } - if (!bottles[0] && !bottles[1] && !bottles[2]) { - counter.remove(inventory); - failSafe.remove(inventory); - cancel(); - return; - } - //Update counter progress - counter.put(inventory, timer - 1); - stand.setBrewingTime(timer - 1); - - //Check for item changes - for (int i = 0; i < 5; i++) { - if (inventory.getItem(i) == null && originalContents[i] == null) { - continue; - } else if (inventory.getItem(i) == null) { - stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); - originalContents[i] = inventory.getItem(i); - } else if (originalContents[i] == null) { - stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); - originalContents[i] = inventory.getItem(i); - } else if (!(inventory.getItem(i).equals(originalContents[i]))) { - stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); - originalContents[i] = inventory.getItem(i); - } - } - stand.update(); - - } - }.runTaskTimer(plugin, 1, 1); - } - - public boolean comparePotionEffects(ItemStack p1, ItemStack p2) { - if (!runMethods) { - return false; - } - if (p1 == null || p2 == null) { - return false; - } - if (p1.getType() == Material.AIR || p2.getType() == Material.AIR) { - return false; - } - - if (!(p1.getItemMeta() instanceof PotionMeta) || !(p2.getItemMeta() instanceof PotionMeta)) { - return false; - } - PotionType p1Type = ((PotionMeta) p1.getItemMeta()).getBasePotionData().getType(); - PotionType p2Type = ((PotionMeta) p2.getItemMeta()).getBasePotionData().getType(); - if (p1Type == p2Type) { - return true; - } - return false; - } - - - public void drinkPotion(ItemStack potion) { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int lengthBoostLevel = (int) pStat.get(skillName).get(4); - double durationMultiplier = 1.0 + 0.001 * lengthBoostLevel; - int potionMasterLevel = (int) Math.min((int) pStat.get(skillName).get(13), 1); - if ((int) pStat.get("global").get(15) != 1) { - potionMasterLevel = 0; - } - if (potion.getType() != Material.POTION) { - return; - } - if (potion.getItemMeta() instanceof PotionMeta) { - PotionType[] noEXPPots0 = {PotionType.MUNDANE,PotionType.WATER,PotionType.AWKWARD,PotionType.THICK,PotionType.UNCRAFTABLE}; - List noEXPPots = Arrays.asList(noEXPPots0); - if (!noEXPPots.contains( ((PotionMeta) potion.getItemMeta()).getBasePotionData().getType() ) ) { - if ( ((PotionMeta) potion.getItemMeta()).getBasePotionData().isUpgraded() ) { - increaseStats.changeEXP(skillName, expMap.get("drinkUpgradedPotion")); - } - else if ( ((PotionMeta) potion.getItemMeta()).getBasePotionData().isExtended() ) { - increaseStats.changeEXP(skillName, expMap.get("drinkExtendedPotion")); - } - else { - increaseStats.changeEXP(skillName, expMap.get("drinkPotion")); - } - } - - - if (((PotionMeta) potion.getItemMeta()).hasCustomEffects()) { - PotionMeta potionMeta = (PotionMeta) potion.getItemMeta(); - increaseStats.changeEXP(skillName, expMap.get("drinkCustomPotion")); - for (PotionEffect effect : potionMeta.getCustomEffects()) { - p.addPotionEffect(new PotionEffect(effect.getType(), (int) Math.round(effect.getDuration() * durationMultiplier), effect.getAmplifier() + potionMasterLevel), true); - } - } else { - PotionMeta potionMeta = (PotionMeta) potion.getItemMeta(); - PotionData potionData = potionMeta.getBasePotionData(); - PotionEffect pEffect = potionToEffect(potionData); - if (!pEffect.getType().equals(PotionEffectType.BAD_OMEN)) { - p.addPotionEffect(pEffect, true); - } - - } - } - } - - public PotionEffect potionToEffect(PotionData potionData) { - PotionEffect pEffect = new PotionEffect(PotionEffectType.BAD_OMEN, 1, 1); - Map> pStat = pStatClass.getPlayerData(); - int lengthBoostLevel = (int) pStat.get(skillName).get(4); - double durationMultiplier = 1.0 + 0.001 * lengthBoostLevel; - int potionMasterLevel = (int) Math.min((int) pStat.get(skillName).get(13), 1); - switch (potionData.getType()) { - case WEAKNESS: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.WEAKNESS, (int) Math.round(20 * 60 * 4 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.WEAKNESS, (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.WEAKNESS, (int) Math.round(20 * 90 * durationMultiplier), potionMasterLevel); - } - break; - case POISON: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.POISON, (int) Math.round(20 * 90 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.POISON, (int) Math.round(20 * 21 * durationMultiplier), 1 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.POISON, (int) Math.round(20 * 45 * durationMultiplier), potionMasterLevel); - } - break; - case JUMP: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.JUMP, (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.JUMP, (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.JUMP, (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); - } - break; - case SPEED: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.SPEED, (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.SPEED, (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.SPEED, (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); - } - break; - case WATER_BREATHING: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.WATER_BREATHING, (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.WATER_BREATHING, (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.WATER_BREATHING, (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); - } - break; - case FIRE_RESISTANCE: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.FIRE_RESISTANCE, (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.FIRE_RESISTANCE, (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.FIRE_RESISTANCE, (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); - } - break; - case INSTANT_DAMAGE: - if (potionMasterLevel > 0) { //damages an additional 3(?) hearts - pEffect = new PotionEffect(PotionEffectType.HARM, 1, 0); - } - break; - case SLOW_FALLING: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.SLOW_FALLING, (int) Math.round(20 * 4 * 60 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.SLOW_FALLING, (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.SLOW_FALLING, (int) Math.round(20 * 90 * durationMultiplier), potionMasterLevel); - } - break; - case NIGHT_VISION: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.NIGHT_VISION, (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.NIGHT_VISION, (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.NIGHT_VISION, (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); - } - break; - case INVISIBILITY: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.INVISIBILITY, (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.INVISIBILITY, (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.INVISIBILITY, (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); - } - break; - case INSTANT_HEAL: - if (potionMasterLevel > 0) { //heals an additional 2 hearts - pEffect = new PotionEffect(PotionEffectType.HEAL, 1, 0); - } - break; - case STRENGTH: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.INCREASE_DAMAGE, (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.INCREASE_DAMAGE, (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.INCREASE_DAMAGE, (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); - } - break; - case SLOWNESS: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.SLOW, (int) Math.round(20 * 4 * 60 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.SLOW, (int) Math.round(20 * 20 * durationMultiplier), 3 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.SLOW, (int) Math.round(20 * 90 * durationMultiplier), potionMasterLevel); - } - break; - case REGEN: - if (potionData.isExtended()) { - pEffect = new PotionEffect(PotionEffectType.REGENERATION, (int) Math.round(20 * 90 * durationMultiplier), potionMasterLevel); - } else if (potionData.isUpgraded()) { - pEffect = new PotionEffect(PotionEffectType.REGENERATION, (int) Math.round(20 * 22 * durationMultiplier), 1 + potionMasterLevel); - } else { - pEffect = new PotionEffect(PotionEffectType.REGENERATION, (int) Math.round(20 * 45 * durationMultiplier), potionMasterLevel); - } - break; - default: - break; - } - return pEffect; - } - - public void giveBrewingEXP(ItemStack ingredient, ItemStack[] slots) { - if (!runMethods) { - return; - } - int brewedPotions = 0; - for (int i = 0; i < 3; i++) { - if (slots[i] != null) { - if (slots[i].getType() != Material.AIR) { - brewedPotions += 1; - } - } - } - int expToGive = 0; - switch (ingredient.getType()) { - case SUGAR: - expToGive = expMap.get("brewSpeedPotion"); - break; - case RABBIT_FOOT: - expToGive = expMap.get("brewJumpPotion"); - break; - case BLAZE_POWDER: - expToGive = expMap.get("brewStrengthPotion"); - break; - case GLISTERING_MELON_SLICE: - expToGive = expMap.get("brewHealingPotion"); - break; - case SPIDER_EYE: - expToGive = expMap.get("brewPoisonPotion"); - break; - case GHAST_TEAR: - expToGive = expMap.get("brewRegenerationPotion"); - break; - case MAGMA_CREAM: - expToGive = expMap.get("brewFireResistancePotion"); - break; - case PUFFERFISH: - expToGive = expMap.get("brewWaterBreathingPotion"); - break; - case GOLDEN_CARROT: - expToGive = expMap.get("brewNightVisionPotion"); - break; - case TURTLE_HELMET: - expToGive = expMap.get("brewPotionOfTurtleMaster"); - break; - case PHANTOM_MEMBRANE: - expToGive = expMap.get("brewPotionOfSlowFalling"); - break; - case FERMENTED_SPIDER_EYE: - expToGive = expMap.get("brewPotionOfWeakness"); - break; - case NETHER_WART: - expToGive = expMap.get("brewAwkwardPotion"); - break; - case GUNPOWDER: - expToGive = expMap.get("brewSplashPotion"); - break; - case DRAGON_BREATH: - expToGive = expMap.get("brewLingeringPotion"); - break; - case GLOWSTONE: - expToGive = expMap.get("upgradePotion"); - break; - case REDSTONE: - expToGive = expMap.get("extendPotion"); - break; - default: - expToGive = expMap.get("brewAnythingElse"); - break; - - } - increaseStats.changeEXP(skillName,expToGive*brewedPotions); - - - } -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Archery.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Archery.java deleted file mode 100644 index 1c14ea8..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Archery.java +++ /dev/null @@ -1,287 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.gameTools.ExpFarmTracker; -import mc.carlton.freerpg.globalVariables.EntityGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.*; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.*; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.CrossbowMeta; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.util.Vector; - -import java.util.*; - -public class Archery extends Skill{ - private static ArrayList arrowsToRemove = new ArrayList<>(); - private static HashMap multishotCount = new HashMap<>(); - private String skillName = "archery"; - - Random rand = new Random(); //Random class Import - - private boolean runMethods; - - public Archery(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - public void initiateAbility() { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.archeryAbility")) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[5] == -1) { - int cooldown = timers.getPlayerCooldownTime(skillName); - if (cooldown < 1) { - int prepMessages = (int) pStatClass.getPlayerData().get("global").get(22); //Toggle for preparation messages - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("bow") + "...<<<"); - } - int taskID = new BukkitRunnable() { - @Override - public void run() { - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " +lang.getString("bow") + "<<<"); - } - try { - abilities.setPlayerAbility( skillName, -1); - } - catch (Exception e) { - - } - } - }.runTaskLater(plugin, 20 * 4).getTaskId(); - abilities.setPlayerAbility( skillName, taskID); - } else { - actionMessage.sendMessage(ChatColor.RED +lang.getString("rapidFire") + " " + lang.getString("cooldown") + ": " + ChatColor.WHITE + cooldown+ ChatColor.RED + "s"); - } - } - } - - public void enableAbility() { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - actionMessage.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("rapidFire") + " " + lang.getString("activated") + "<<<"); - int durationLevel = (int) pStat.get(skillName).get(4); - double duration0 = Math.ceil(durationLevel * 0.4) + 40; - long duration = (long) duration0; - Bukkit.getScheduler().cancelTask(pAbilities[5]); - abilities.setPlayerAbility( skillName, -2); - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("rapidFire") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("rapidFire") + " " + lang.getString("ended") + "<<<"; - timers.abilityDurationTimer(skillName,duration,endMessage,coolDownEndMessage); - } - - public void rapidFire(Entity projectile,ItemStack bow) { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - int sniperLevel = (int) pStat.get(skillName).get(8); - double sniperMultiplier = sniperLevel * 0.02 + 1; - if (pAbilities[5] == -2) { - Vector velocity = projectile.getVelocity(); - Vector zero = new Vector(0, 0, 0); - double speed = velocity.distance(zero); - double multiplier = (3.05 / speed) * sniperMultiplier; - if (bow.getType() == Material.CROSSBOW) { - multiplier = (3.15 / speed) * sniperMultiplier; - } - Vector newVelocity = velocity.multiply(multiplier); - projectile.setVelocity(newVelocity); - } - } - - public void sniper(Entity projectile) { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - if (pAbilities[5] != -2) { - int sniperLevel = (int) pStat.get(skillName).get(8); - double sniperMultiplier = sniperLevel * 0.02 + 1; - Vector velocity = projectile.getVelocity(); - Vector newVelocity = velocity.multiply(sniperMultiplier); - projectile.setVelocity(newVelocity); - } - } - - public boolean isFirstMultishot() { - if (!multishotCount.containsKey(p.getUniqueId())) { //First mulitshot (player not in hashmap) - multishotCount.put(p.getUniqueId(),1); //Set "shot number" to 1 - return true; //This is the the first shot - } - else { - if (multishotCount.get(p.getUniqueId()).equals(1)) { //If "shot number" is 1 - multishotCount.put(p.getUniqueId(),2); //Set the "shot number" to 2 - return false; //This is the second shot - } - else { //If "shot number" is 2 (or not 1) - multishotCount.remove(p.getUniqueId()); //Remove the player until they shoot another multishot - return false; //This is the third shot - } - } - } - - public void retrieval(Entity projectile,ItemStack bow) { - if (!runMethods) { - return; - } - if (bow.getEnchantments().containsKey(Enchantment.ARROW_INFINITE)) { - return; - } - if (bow.getEnchantments().containsKey(Enchantment.MULTISHOT)) { - if (!isFirstMultishot()) { //The first (middle) multishot is always the one that's able to be picked up - return; - } - } - Map> pStat = pStatClass.getPlayerData(); - int retrievalLevel = (int) pStat.get(skillName).get(5); - double retrievalChance = retrievalLevel * 0.0005; - if (retrievalChance > rand.nextDouble()) { - if (projectile instanceof Arrow || projectile instanceof SpectralArrow) { - ItemStack arrow = new ItemStack(Material.ARROW, 1); - ItemStack arrow0 = new ItemStack(Material.ARROW, 1); - int closest = 50; - int arrowIndex = p.getInventory().first(Material.ARROW); - int arrowIndex_s = p.getInventory().first(Material.SPECTRAL_ARROW); - int arrowIndex_t = p.getInventory().first(Material.TIPPED_ARROW); - if (arrowIndex < closest && arrowIndex != -1) { - arrow0 = p.getInventory().getItem(arrowIndex); - closest = arrowIndex; - } - if (arrowIndex_s < closest && arrowIndex_s != -1) { - arrow0 = p.getInventory().getItem(arrowIndex_s); - closest = arrowIndex_s; - } - if (arrowIndex_t < closest && arrowIndex_t != -1) { - arrow0 = p.getInventory().getItem(arrowIndex_t); - closest = arrowIndex_t; - } - arrow.setType(arrow0.getType()); - arrow.setItemMeta(arrow0.getItemMeta()); - arrow.setAmount(1); - new BukkitRunnable() { - @Override - public void run() { - p.getInventory().addItem(arrow); - } - }.runTaskLater(plugin, 2); - arrowsToRemove.add(projectile); - } - } - } - - public void retrievalRemoval(Entity projectile){ - if (!runMethods) { - return; - } - if (arrowsToRemove.contains(projectile)) { - arrowsToRemove.remove(projectile); - projectile.remove(); - } - } - - public void explosiveArrows(Entity projectile, Location loc) { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int explosiveLevel = (int) pStat.get(skillName).get(10); - double explosionChance = explosiveLevel * 0.01; - if (explosionChance > rand.nextDouble()) { - World world = projectile.getWorld(); - world.createExplosion(loc, 3, false, false); - increaseStats.changeEXP(skillName,expMap.get("explosiveArrowEXP")); - } - } - - public Material getArrowType() { - int closest = 50; - int arrowIndex = p.getInventory().first(Material.ARROW); - int arrowIndex_s = p.getInventory().first(Material.SPECTRAL_ARROW); - int arrowIndex_t = p.getInventory().first(Material.TIPPED_ARROW); - Material arrowType = Material.AIR; - if (arrowIndex < closest && arrowIndex != -1) { - closest = arrowIndex; - arrowType = Material.ARROW; - } - if (arrowIndex_s < closest && arrowIndex_s != -1) { - closest = arrowIndex_s; - arrowType = Material.SPECTRAL_ARROW; - } - if (arrowIndex_t < closest && arrowIndex_t != -1) { - closest = arrowIndex_t; - arrowType = Material.TIPPED_ARROW; - } - return arrowType; - } - - public void crossbowAbility() { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[5] != -2) { - return; - } - ItemStack crossbow = itemInHand; - CrossbowMeta crossbowMeta = (CrossbowMeta) crossbow.getItemMeta(); - if (!crossbowMeta.hasChargedProjectiles()) { - if (pAbilities[12] > -1) { - Bukkit.getScheduler().cancelTask(pAbilities[12]); - } - int taskID = new BukkitRunnable() { - @Override - public void run() { - Material arrowType = getArrowType(); - if (arrowType != Material.AIR) { - int arrowIndex = p.getInventory().first(arrowType); - crossbowMeta.addChargedProjectile(new ItemStack(arrowType, 1)); - crossbow.setItemMeta(crossbowMeta); - ItemStack arrow = p.getInventory().getItem(arrowIndex); - if (arrow.getType() == arrowType) { - arrow.setAmount(arrow.getAmount() - 1); - } - } - } - }.runTaskLater(plugin, 3).getTaskId(); - abilities.setPlayerAbility( "archeryCrossbow", taskID); - } - } - - public void giveHitEXP(double finalDamage,Entity entity) { - if (!runMethods || entity.getType().equals(EntityType.ARMOR_STAND)) { - return; - } - ExpFarmTracker expFarmTracker = new ExpFarmTracker(); - double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity,skillName); - increaseStats.changeEXP(skillName, (int) Math.round((finalDamage *expMap.get("arrowDamage_EXPperDamagePointDone")+expMap.get("hitArrow"))*multiplier)); - } - - public void giveKillEXP(Entity entity) { - if (!runMethods) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - entityGroups.killEntity(entity,skillName,expMap,increaseStats); - } - - -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/AxeMastery.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/AxeMastery.java deleted file mode 100644 index e852506..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/AxeMastery.java +++ /dev/null @@ -1,252 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.gameTools.ExpFarmTracker; -import mc.carlton.freerpg.globalVariables.EntityGroups; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.*; -import org.bukkit.attribute.Attributable; -import org.bukkit.attribute.Attribute; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.*; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.*; - -public class AxeMastery extends Skill{ - private String skillName = "axeMastery"; - - - Random rand = new Random(); //Random class Import - - private boolean runMethods; - - - public AxeMastery(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - public void initiateAbility() { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.axeMasteryAbility") || !pStatClass.isPlayerSkillAbilityOn(skillName)) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { - return; - } - Integer[] pTimers = timers.getPlayerCooldownTimes(); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[9] == -1) { - int cooldown = pTimers[9]; - if (cooldown < 1) { - int prepMessages = (int) pStatClass.getPlayerData().get("global").get(22); //Toggle for preparation messages - if (pAbilities[1] != -1 && pTimers[1] >= 1 && prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("axe") + "...<<<"); - } - int taskID = new BukkitRunnable() { - @Override - public void run() { - try { - Integer[] pTimers2 = timers.getPlayerCooldownTimes(); - Integer[] pAbilities2 = abilities.getPlayerAbilities(); - int prepMessages = (int) pStatClass.getPlayerData().get("global").get(22); //Toggle for preparation messages - if (pAbilities2[1] != -1 && pTimers2[1] >= 1 && prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " +lang.getString("axe") + "<<<"); - } - abilities.setPlayerAbility( skillName, -1); - } - catch (Exception e) { - - } - } - }.runTaskLater(plugin, 20 * 4).getTaskId(); - abilities.setPlayerAbility( skillName, taskID); - } else { - actionMessage.sendMessage(ChatColor.RED +lang.getString("greatAxe") + " " + lang.getString("cooldown") + ": " + ChatColor.WHITE + cooldown+ ChatColor.RED + "s"); - } - } - } - public void enableAbility() { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - actionMessage.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("greatAxe") + " " + lang.getString("activated") + "<<<"); - int durationLevel = (int) pStat.get(skillName).get(4); - double duration0 = Math.ceil(durationLevel*0.4) + 40; - long duration = (long) duration0; - Bukkit.getScheduler().cancelTask(pAbilities[9]); - abilities.setPlayerAbility( skillName, -2); - String cooldownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("greatAxe") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("greatAxe") + " " + lang.getString("ended") + "<<<"; - timers.abilityDurationTimer(skillName,duration,endMessage,cooldownEndMessage); - } - - public void greaterAxe(Entity entity, World world,double finalDamage) { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - if (pAbilities[9] == -2) { - int greaterAxeLevel = (int) pStat.get(skillName).get(7); - double radius = 2 + 0.5*greaterAxeLevel; - if ((int) pStat.get(skillName).get(11) > 0) { - finalDamage = finalDamage*2; - } - - Location location = entity.getLocation(); - Block blockAboveGround = location.getBlock().getRelative(BlockFace.DOWN).getRelative(0,1,0); - Collection entities = world.getNearbyEntities(location,radius,2,radius); - for (Entity mob : entities) { - if (mob instanceof LivingEntity) { - if (mob instanceof Player) { - if (((Player) mob).getDisplayName().equalsIgnoreCase(p.getDisplayName())) { - continue; - } - } - ((LivingEntity) mob).damage(finalDamage*0.25); - increaseStats.changeEXP(skillName,(int) Math.round(finalDamage*0.25*expMap.get("greaterAxeAEO_EXPperDamagePointDone"))); - } - } - for (int x = -1*(int)Math.ceil(radius/2.0); x <= (int)Math.ceil(radius/2.0); x++ ) { - for (int z = -1*(int)Math.ceil(radius/2.0); z <= (int)Math.ceil(radius/2.0); z++ ) { - Block b = blockAboveGround.getRelative(x,0,z); - Block below = b.getRelative(0,-1,0); - Material blockType = below.getType(); - if (blockType != Material.AIR) { - if (blockType == Material.WATER) { - world.spawnParticle(Particle.WATER_SPLASH,b.getLocation(),50); - } - else { - if (blockType.isBlock()) { - world.spawnParticle(Particle.BLOCK_CRACK, b.getLocation(), 50, below.getBlockData()); - } - } - } - } - } - - - } - - } - - public boolean[] buffCheckerStrength( int buffLevel, int duration) { - boolean addEffect = true; - boolean hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.INCREASE_DAMAGE)) { - hasEffect = true; - if ( (effect.getDuration() > duration && effect.getAmplifier() >= buffLevel) || (effect.getAmplifier() > buffLevel && effect.getDuration() > 40) ) { - addEffect = false; - } - break potionEffectLoop; - } - } - - boolean[] returnThis = {addEffect,hasEffect}; - return returnThis; - } - - public double divineCritical() { - if (!runMethods) { - return 1.0; - } - double multiplier = 1; - Map> pStat = pStatClass.getPlayerData(); - int divineCriticalsLevel = (int) pStat.get(skillName).get(5); - int betterCritsLevel = (int) pStat.get(skillName).get(12); - if (divineCriticalsLevel*0.0001 < rand.nextDouble()) { - return multiplier; - } - multiplier = 1.25 + 0.35*betterCritsLevel; - return multiplier; - } - - public void revitalized() { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int revitalizedLevel = (int) pStat.get(skillName).get(9); - if (revitalizedLevel*0.01 > rand.nextDouble()) { - double maxHP = ((Attributable) p).getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue(); - p.setHealth(maxHP); - increaseStats.changeEXP(skillName,expMap.get("revitalizedActivateEXP")); - } - } - - public void warriorBlood() { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int warriorBloodLevel = (int) pStat.get(skillName).get(10); - if (warriorBloodLevel < 1) { - return; - } - int duration = 20*3*warriorBloodLevel; - boolean[] strengthChecks = buffCheckerStrength(0,duration); - if (strengthChecks[0]) { - if (strengthChecks[1]) { - p.removePotionEffect(PotionEffectType.INCREASE_DAMAGE); - } - p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,(int)duration,0)); - } - } - - public void holyAxe(Entity entity,World world,double finalDamage) { - if (!runMethods) { - return; - } - if (entity instanceof LivingEntity) { - if (((LivingEntity) entity).getHealth() < finalDamage) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int)pStat.get("global").get(27) < 1) { //Holy axe Toggle - return; - } - int holyAxeLevel = (int) pStat.get(skillName).get(8); - if (holyAxeLevel*0.02 > rand.nextDouble()) { - world.strikeLightning(entity.getLocation()); - increaseStats.changeEXP(skillName,expMap.get("holyAxeActivateEXP")); - } - } - } - - public void giveHitEXP(double finalDamage,Entity entity) { - if (!runMethods || entity.getType().equals(EntityType.ARMOR_STAND)) { - return; - } - ExpFarmTracker expFarmTracker = new ExpFarmTracker(); - double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity,skillName); - increaseStats.changeEXP(skillName, (int) Math.round((finalDamage * expMap.get("axeDamage_EXPperDamagePointDone")+expMap.get("dealAxeDamage"))*multiplier)); - } - - public void giveKillEXP(Entity entity) { - if (!runMethods) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - List axes = itemGroups.getAxes(); - if (!(axes.contains(itemInHand.getType()))) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - entityGroups.killEntity(entity,skillName,expMap,increaseStats); - } - -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/BeastMastery.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/BeastMastery.java deleted file mode 100644 index 2eb4677..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/BeastMastery.java +++ /dev/null @@ -1,302 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.gameTools.ExpFarmTracker; -import mc.carlton.freerpg.gameTools.HorseRiding; -import mc.carlton.freerpg.globalVariables.EntityGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.*; -import org.bukkit.attribute.Attributable; -import org.bukkit.attribute.Attribute; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.*; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.*; - -public class BeastMastery extends Skill{ - private String skillName = "beastMastery"; - - private boolean runMethods; - - - public BeastMastery(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - public void initiateAbility() { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.beastMasteryAbility")) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { - return; - } - Integer[] pTimers = timers.getPlayerCooldownTimes(); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[6] == -1) { - int cooldown = pTimers[6]; - if (cooldown < 1) { - int prepMessages = (int) pStatClass.getPlayerData().get("global").get(22); //Toggle for preparation messages - if (prepMessages >0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("leg") + "...<<<"); - } - int taskID = new BukkitRunnable() { - @Override - public void run() { - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " +lang.getString("leg") + "<<<"); - } - try { - abilities.setPlayerAbility( skillName, -1); - } - catch (Exception e) { - - } - } - }.runTaskLater(plugin, 20 * 4).getTaskId(); - abilities.setPlayerAbility( skillName, taskID); - } else { - actionMessage.sendMessage(ChatColor.RED +lang.getString("spurKick") + " " + lang.getString("cooldown") + ": " + ChatColor.WHITE + cooldown+ ChatColor.RED + "s"); - } - } - } - - public void enableAbility() { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - int durationLevel = (int) pStat.get(skillName).get(4); - double duration0 = Math.ceil(durationLevel * 0.4) + 40; - long duration = (long) duration0; - int level = (int) pStat.get(skillName).get(13); - Entity horse0 = p.getVehicle(); - if (horse0.getType() == EntityType.HORSE || horse0.getType() == EntityType.DONKEY || horse0.getType() == EntityType.MULE) { - LivingEntity horse = (LivingEntity) horse0; - for (PotionEffect potionEffect : horse.getActivePotionEffects()) { - if ((potionEffect.getType() == PotionEffectType.SPEED && potionEffect.getDuration() > duration) || (potionEffect.getType() == PotionEffectType.SPEED && potionEffect.getAmplifier() > level)) { - actionMessage.sendMessage(ChatColor.RED + ">>>" +lang.getString("hyperHorse") + "<<<"); - return; - } - - } - for (PotionEffect potionEffect : horse.getActivePotionEffects()) { - if (potionEffect.getType() == PotionEffectType.SPEED) { - horse.removePotionEffect(PotionEffectType.SPEED); - } - } - horse.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, (int) duration, level+1)); - } - else { - return; - } - - actionMessage.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("spurKick") + " " + lang.getString("activated") + "<<<"); - Bukkit.getScheduler().cancelTask(pAbilities[6]); - abilities.setPlayerAbility( skillName, -2); - String cooldownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("spurKick") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("spurKick") + " " + lang.getString("ended") + "<<<"; - timers.abilityDurationTimer(skillName,duration,endMessage,cooldownEndMessage); - } - - public void getHorseStats(Entity entity) { - if (!runMethods) { - return; - } - if (itemInHand.getType() != Material.COMPASS) { - return; - } - if (entity.getType() == EntityType.HORSE || entity.getType() == EntityType.DONKEY || entity.getType() == EntityType.MULE) { - Entity animal = entity; - if (entity.getType() == EntityType.HORSE) { - animal = (Horse) entity; - } else if (entity.getType() == EntityType.DONKEY) { - animal = (Donkey) entity; - } else if (entity.getType() == EntityType.MULE) { - animal = (Mule) entity; - } - Map> pStat = pStatClass.getPlayerData(); - int identifyLevel = (int) pStat.get(skillName).get(12); - if (identifyLevel > 0) { - double maxHealth = ((Attributable) animal).getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue(); - double speed = ((Attributable) animal).getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getBaseValue(); - double jump = ((Attributable) animal).getAttribute(Attribute.HORSE_JUMP_STRENGTH).getBaseValue(); - - double healthReadable = Math.round((maxHealth / 2.0d) * 10) / 10.0d; - double speedReadable = Math.round(speed * 431.1111) / 10.0d; - double jumpReadable = Math.round((3.31 * jump * jump + 2.38 * jump - 0.40) * 100) / 100.0d; - - double healthPercentage = (healthReadable - 7.5d) / 7.5d; - double speedPercentage = (speedReadable - 4.85d) / (14.55d - 4.85d); - double jumpPercentage = (jumpReadable - 1.086d) / (5.293d - 1.086d); - - String healthRead = ""; - String speedRead = ""; - String jumpRead = ""; - - if (healthPercentage < 0.25) { - healthRead = ChatColor.DARK_RED + Double.toString(healthReadable); - } else if (healthPercentage < 0.75) { - healthRead = ChatColor.YELLOW + Double.toString(healthReadable); - } else { - healthRead = ChatColor.DARK_GREEN + Double.toString(healthReadable); - } - - if (speedPercentage < 0.25) { - speedRead = ChatColor.DARK_RED + Double.toString(speedReadable); - } else if (speedPercentage < 0.75) { - speedRead = ChatColor.YELLOW + Double.toString(speedReadable); - } else { - speedRead = ChatColor.DARK_GREEN + Double.toString(speedReadable); - } - - if (jumpPercentage < 0.25) { - jumpRead = ChatColor.DARK_RED + Double.toString(jumpReadable); - } else if (jumpPercentage < 0.75) { - jumpRead = ChatColor.YELLOW + Double.toString(jumpReadable); - } else { - jumpRead = ChatColor.DARK_GREEN + Double.toString(jumpReadable); - } - - String bars = ChatColor.GREEN + "-------------------------------------------------"; - String title = ChatColor.GOLD + ChatColor.BOLD.toString() + " Horse Stats "; - String health = ChatColor.AQUA + "HP: " + healthRead + ChatColor.WHITE + "/15.0 hearts"; - String maxSpeed = ChatColor.AQUA + "Speed: " + speedRead + ChatColor.WHITE + "/14.6 blocks per second"; - String jumpHeight = ChatColor.AQUA + "Jump Height: " + jumpRead + ChatColor.WHITE + "/5.30 blocks"; - p.sendMessage(bars); - p.sendMessage(title); - p.sendMessage(health); - p.sendMessage(maxSpeed); - p.sendMessage(jumpHeight); - p.sendMessage(bars); - } - } else if (entity.getType() == EntityType.WOLF) { - Tameable dog = (Tameable) entity; - if (dog.isTamed()) { - LivingEntity livingDog = (LivingEntity) dog; - Map> pStat = pStatClass.getPlayerData(); - int sharpTeethLevel = (int) pStat.get(skillName).get(8); - double damageBoost = sharpTeethLevel * 2 / 10.0d + 2.0; - String damageRead = ChatColor.YELLOW + Double.toString(damageBoost); - - double healthRemaining = ((LivingEntity) dog).getHealth(); - double healthReadable = Math.round((healthRemaining / 2.0d) * 10) / 10.0d; - double healthPercentage = (healthReadable) / 10.0d; - String healthRead = ""; - if (healthPercentage < 0.26) { - healthRead = ChatColor.DARK_RED + Double.toString(healthReadable); - } else if (healthPercentage < 0.74) { - healthRead = ChatColor.YELLOW + Double.toString(healthReadable); - } else { - healthRead = ChatColor.DARK_GREEN + Double.toString(healthReadable); - } - - String health = ChatColor.AQUA + "Max Health: " + healthRead + ChatColor.WHITE + "/10.0 hearts"; - String damage = ChatColor.AQUA + "Damage: " + damageRead + ChatColor.WHITE + "/3.0 hearts"; - String bars = ChatColor.GREEN + "------------------------------------------------"; - String title = ChatColor.GOLD + ChatColor.BOLD.toString() + " Wolf Stats "; - p.sendMessage(bars); - p.sendMessage(title); - p.sendMessage(health); - p.sendMessage(damage); - p.sendMessage(bars); - - } - } - } - - public void tamingEXP(Entity entity){ - if (!runMethods) { - return; - } - if (entity.getType() == EntityType.HORSE || entity.getType() == EntityType.DONKEY || entity.getType() == EntityType.MULE || entity.getType() == EntityType.LLAMA) { - increaseStats.changeEXP(skillName, expMap.get("tameHorse")); - } else if (entity.getType() == EntityType.WOLF) { - increaseStats.changeEXP(skillName, expMap.get("tameWolf")); - } else if (entity.getType() == EntityType.CAT) { - increaseStats.changeEXP(skillName, expMap.get("tameCat")); - } else if (entity.getType() == EntityType.PARROT) { - increaseStats.changeEXP(skillName, expMap.get("tameParrot")); - } - } - - public void horseRidingEXP(Entity entity) { - if (!runMethods) { - return; - } - List mounts = Arrays.asList(new EntityType[]{EntityType.HORSE,EntityType.DONKEY,EntityType.MULE,EntityType.LLAMA,EntityType.ZOMBIE_HORSE,EntityType.SKELETON_HORSE}); - if (mounts.contains(entity.getType())) { - Entity mount = entity; - HorseRiding data_set = new HorseRiding(); - int taskID = new BukkitRunnable() { - @Override - public void run() { - if (p.isInsideVehicle()) { - if (p.getVehicle().equals(entity)) { - HorseRiding data = new HorseRiding(); - Location oldLocation = data.getOldLocation(p); - Location currentLocation = p.getLocation(); - if (oldLocation.getWorld().equals(currentLocation.getWorld())) { - int dx = oldLocation.getBlockX() - currentLocation.getBlockX(); - int dy = oldLocation.getBlockY() - currentLocation.getBlockY(); - int dz = oldLocation.getBlockZ() - currentLocation.getBlockZ(); - double distance = Math.sqrt(dx * dx + dy * dy + dz * dz); - data.setPlayerLocationMap(p); - if (distance > 5 && distance < 200) { //Moved far enough, but also not teleportation - Block waterCheck1 = currentLocation.getBlock().getRelative(BlockFace.DOWN); - Block waterCheck2 = currentLocation.getBlock(); - if (waterCheck1.getType() != Material.WATER && waterCheck2.getType() != Material.WATER) { //Prevents water afk machines - increaseStats.changeEXP(skillName, expMap.get("horseRiding_EXPperSecondMoving") * 5); - } - } - } - } - } - } - }.runTaskTimer(plugin, 100,100).getTaskId(); - data_set.setTaskMap(taskID,p); - data_set.setPlayerLocationMap(p); - data_set.setMountPlayerMap(entity.getUniqueId(),p); - } - } - public void breedingEXP(Entity entity) { - if (!runMethods) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - List breedingAnimals = entityGroups.getBreedingAnimals(); - if (breedingAnimals.contains(entity.getType())) { - increaseStats.changeEXP(skillName,expMap.get("breedTameableAnimal")); - } - } - - public void dogKillEntity(Entity entity) { - if (!runMethods) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - entityGroups.killEntity(entity,skillName,expMap,increaseStats); - - } - - public void giveHitEXP(double finalDamage,Entity entity) { - if (!runMethods || entity.getType().equals(EntityType.ARMOR_STAND)) { - return; - } - ExpFarmTracker expFarmTracker = new ExpFarmTracker(); - double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity,skillName); - increaseStats.changeEXP(skillName, (int) Math.round((finalDamage * expMap.get("dogDamage_EXPperDamagePointDone")+expMap.get("dogDealDamage"))*multiplier)); - } - - -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Defense.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Defense.java deleted file mode 100644 index 054f034..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Defense.java +++ /dev/null @@ -1,445 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.gameTools.EntityPickedUpItemStorage; -import mc.carlton.freerpg.gameTools.ExpFarmTracker; -import mc.carlton.freerpg.globalVariables.EntityGroups; -import mc.carlton.freerpg.playerInfo.ChangeStats; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.MinecraftVersion; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.World; -import org.bukkit.attribute.Attributable; -import org.bukkit.attribute.Attribute; -import org.bukkit.entity.*; -import org.bukkit.inventory.ItemStack; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.*; - -public class Defense extends Skill{ - private String skillName = "defense"; - - Random rand = new Random(); //Random class Import - - private boolean runMethods; - - - public Defense(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - public void initiateAbility() { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.defenseAbility")) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { - return; - } - Integer[] pTimers = timers.getPlayerCooldownTimes(); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[8] == -1) { - int cooldown = pTimers[8]; - if (cooldown < 1) { - int prepMessages = (int) pStatClass.getPlayerData().get("global").get(22); //Toggle for preparation messages - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("yourself") + "...<<<"); - } - int taskID = new BukkitRunnable() { - @Override - public void run() { - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " +lang.getString("yourself") + "<<<"); - } - try { - abilities.setPlayerAbility( skillName, -1); - } - catch (Exception e) { - - } - } - }.runTaskLater(plugin, 20 * 4).getTaskId(); - abilities.setPlayerAbility( skillName, taskID); - } else { - actionMessage.sendMessage(ChatColor.RED +lang.getString("stoneSoldier") + " " + lang.getString("cooldown") + ": " + ChatColor.WHITE + cooldown+ ChatColor.RED + "s"); - } - } - } - - public void enableAbility() { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - actionMessage.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("stoneSoldier") + " " + lang.getString("activated") + "<<<"); - int durationLevel = (int) pStat.get(skillName).get(4); - double duration0 = Math.ceil(durationLevel * 0.4) + 40; - long duration = (long) duration0; - int strongerLegsLevel = (int) pStat.get(skillName).get(12); - int giftFromAboveLevel = (int) pStat.get(skillName).get(11); - boolean[] absorptionChecks = {false,false}; - boolean[] slownessChecks = {true,true}; - if (strongerLegsLevel > 0) { - slownessChecks = buffCheckerSlowness(0,(int) duration); - } - else { - slownessChecks = buffCheckerSlowness(3,(int) duration); - } - if (giftFromAboveLevel > 0) { - absorptionChecks = buffCheckerAbsorption(1, (int) duration + 1200); - } - boolean[] resistanceChecks = buffCheckerResistance(2,(int) duration); - - if (absorptionChecks[0]) { - if (absorptionChecks[1]) { - p.removePotionEffect(PotionEffectType.ABSORPTION); - } - p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,(int)duration +1200,1)); - } - - if (slownessChecks[0]) { - if (slownessChecks[1]) { - p.removePotionEffect(PotionEffectType.SLOW); - } - if (strongerLegsLevel > 0) { - p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, (int) duration, 0)); - } - else { - p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, (int) duration, 3)); - } - } - - if (resistanceChecks[0]) { - if (resistanceChecks[1]) { - p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); - } - p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,(int)duration,2)); - } - - Bukkit.getScheduler().cancelTask(pAbilities[8]); - abilities.setPlayerAbility( skillName, -2); - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("stoneSoldier") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("stoneSoldier") + " " + lang.getString("ended") + "<<<"; - timers.abilityDurationTimer(skillName,duration,endMessage,coolDownEndMessage); - } - - public void preventLogoutTheft(int taskID_defense,boolean pluginDisabled) { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[8] == -2) { - Map> pStat = pStatClass.getPlayerData(); - int durationLevel = (int) pStat.get(skillName).get(4); - double duration0 = Math.ceil(durationLevel * 0.4) + 40; - long duration = (long) duration0; - int strongerLegsLevel = (int) pStat.get(skillName).get(12); - int giftFromAboveLevel = (int) pStat.get(skillName).get(11); - int slowBuff = 3; - boolean hasAbsorption = false; - if (strongerLegsLevel > 0) { - slowBuff = 0; - } - if (giftFromAboveLevel > 0) { - hasAbsorption = true; - } - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.DAMAGE_RESISTANCE) && effect.getDuration() <= duration && effect.getAmplifier() == 2) { - p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); - } - else if (effect.getType().equals(PotionEffectType.SLOW) && effect.getDuration() <= duration && effect.getAmplifier() == slowBuff) { - p.removePotionEffect(PotionEffectType.SLOW); - } - else if (effect.getType().equals(PotionEffectType.ABSORPTION)) { - if (hasAbsorption) { - if (effect.getDuration() <= duration + 1200 && effect.getAmplifier() == 1) { - p.removePotionEffect(PotionEffectType.ABSORPTION); - p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION,1200,1)); - } - } - } - - } - Bukkit.getScheduler().cancelTask(taskID_defense); - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("stoneSoldier") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("stoneSoldier") + " " + lang.getString("ended") + "<<<"; - timers.endAbility(skillName,endMessage,coolDownEndMessage,pluginDisabled); - } - } - - public boolean[] buffCheckerResistance(int buffLevel, int duration) { - boolean addEffect = true; - boolean hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.DAMAGE_RESISTANCE)) { - hasEffect = true; - if ( (effect.getDuration() > duration && effect.getAmplifier() >= buffLevel) || (effect.getAmplifier() > buffLevel && effect.getDuration() > 40)) { - addEffect = false; - } - break potionEffectLoop; - } - } - - boolean[] returnThis = {addEffect,hasEffect}; - return returnThis; - } - - public boolean[] buffCheckerSlowness( int buffLevel, int duration) { - boolean addEffect = true; - boolean hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.SLOW)) { - hasEffect = true; - if ( (effect.getDuration() > duration && effect.getAmplifier() >= buffLevel) ) { - addEffect = false; - } - break potionEffectLoop; - } - } - - boolean[] returnThis = {addEffect,hasEffect}; - return returnThis; - } - - public boolean[] buffCheckerAbsorption( int buffLevel, int duration) { - boolean addEffect = true; - boolean hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.ABSORPTION)) { - hasEffect = true; - if ( (effect.getDuration() > duration && effect.getAmplifier() >= buffLevel) || (effect.getAmplifier() > buffLevel && effect.getDuration() > 40) ) { - addEffect = false; - } - break potionEffectLoop; - } - } - - boolean[] returnThis = {addEffect,hasEffect}; - return returnThis; - } - - public boolean[] buffCheckerRegeneration( int buffLevel, int duration) { - boolean addEffect = true; - boolean hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.REGENERATION)) { - hasEffect = true; - if ( (effect.getDuration() > duration && effect.getAmplifier() >= buffLevel) || (effect.getAmplifier() > buffLevel && effect.getDuration() > 40) ) { - addEffect = false; - } - break potionEffectLoop; - } - } - - boolean[] returnThis = {addEffect,hasEffect}; - return returnThis; - } - - public double hardBody() { - if (!runMethods) { - return 1.0; - } - Map> pStat = pStatClass.getPlayerData(); - int hardBodyLevel = (int) pStat.get(skillName).get(5); - int hardHeadedLevel = (int) pStat.get(skillName).get(9); - double chance = 0.01 + 0.0001*hardBodyLevel; - if (chance > rand.nextDouble()) { - double multiplier = Math.max((1- .33 - .06666*hardHeadedLevel),0); - increaseStats.changeEXP(skillName, expMap.get("hardBodyActivate")); - return multiplier; - } - return 1; - } - - public void reactions(double finalDamage) { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int reactionsLevel_I = (int) pStat.get(skillName).get(8); - int reactionsLevel_II = (int) pStat.get(skillName).get(10); - if (finalDamage < 1.0) { - return; - } - if (reactionsLevel_II*0.02 > rand.nextDouble()) { - boolean[] resistanceChecks = buffCheckerResistance(1,100); - if (resistanceChecks[0]) { - if (resistanceChecks[1]) { - p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); - } - p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 100,1)); - } - increaseStats.changeEXP(skillName, expMap.get("reactionsLevel2Activate")); - - } - else if (reactionsLevel_I*0.02 > rand.nextDouble()) { - boolean[] resistanceChecks = buffCheckerResistance(0,100); - if (resistanceChecks[0]) { - if (resistanceChecks[1]) { - p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); - } - p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 100,0)); - } - increaseStats.changeEXP(skillName, expMap.get("reactionsLevel1Activate")); - } - } - - public void hearty() { - Map> pStat = pStatClass.getPlayerData(); - int heartyToggle = (int) pStat.get("global").get(30); - int heartyLevel = (int) pStat.get(skillName).get(13); - if (!runMethods) { - toggleHearty(0,heartyToggle); //Toggle hearty with level not high enough to be active (can only be turned off if it was on) - return; - } - toggleHearty(heartyLevel,heartyToggle); - } - - public void toggleHearty(int heartyLevel, int heartyToggle) { - /* - * The idea here: - * If hearty is allowed to be on, we turn it on (if it was off) - * If hearty is not allowed to be on, we turn it off (if it was on) - */ - double HP = ((Attributable) p).getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue(); - ChangeStats changeStats = new ChangeStats(p); - if (heartyLevel < 1) { //Hearty level not high enough to be active - if (heartyToggle > 0) { //Hearty was somehow on - ((Attributable) p).getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(HP - 4.0); - changeStats.setStat("global",30,0); - } - //Otherwise, hearty was off and we do nothing - } - else { //Hearty level is high enough to be active - if (heartyToggle < 1) { //Hearty was off - ((Attributable) p).getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(HP + 4.0); - changeStats.setStat("global",30,1); - } - //Otherwise, hearty was on so we do nothing - } - - } - - public void doubleDrops(LivingEntity entity, List drops, World world) { - if (!runMethods) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - List hostileMobs = entityGroups.getHostileMobs(); - if (hostileMobs.contains(entity.getType())) { - Map> pStat = pStatClass.getPlayerData(); - int doubleDropsLevel = (int) pStat.get(skillName).get(6); - EntityPickedUpItemStorage entityPickedUpItemStorage = new EntityPickedUpItemStorage(); - if (doubleDropsLevel*0.0005 > rand.nextDouble()) { - for (ItemStack drop : drops) { - if (!entityPickedUpItemStorage.wasItemPickedUp(drop,entity)) { - dropItemNaturally(entity.getLocation().add(0, 0.5, 0), drop); - } - } - } - } - - } - - public void healer() { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int healerLevel = (int) pStat.get(skillName).get(7); - if (healerLevel < 1) { - return; - } - int duration = 20*Math.min(3*healerLevel,9); - boolean[] regenerationChecks = buffCheckerRegeneration(0,duration); - if (regenerationChecks[0]) { - if (regenerationChecks[1]) { - p.removePotionEffect(PotionEffectType.REGENERATION); - } - p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,(int)duration,0)); - } - increaseStats.changeEXP(skillName, expMap.get("healerRegenActivate")); - if (healerLevel < 4) { - return; - } - double maxHP = ((Attributable) p).getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue(); - int HP_to_add = (healerLevel-3); - p.setHealth(Math.min(maxHP,p.getHealth()+HP_to_add)); - increaseStats.changeEXP(skillName, expMap.get("healerHealActivate")); - } - - public void giveHitEXP(double damage,Entity entity) { - if (!runMethods || entity.getType().equals(EntityType.ARMOR_STAND)) { - return; - } - ExpFarmTracker expFarmTracker = new ExpFarmTracker(); - double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity,skillName); - if (p.isBlocking()) { - ConfigLoad configLoad = new ConfigLoad(); - multiplier *= configLoad.getSpecialMultiplier().get("blockingEXPMultiplier"); - } - double expToReward = (damage * expMap.get("takeDamage_EXPperDamagePointDone") + expMap.get("takeDamage"))*multiplier; - increaseStats.changeEXP(skillName, (int) Math.round(expToReward)); - } - - public void giveKillEXP(Entity entity) { - if (!runMethods) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - entityGroups.killEntity(entity,skillName,expMap,increaseStats); - } - - public void armorEXP(ItemStack armor) { - if (!runMethods) { - return; - } - Map armorEXP = new HashMap<>(); - armorEXP.put(Material.LEATHER_BOOTS,200*3); - armorEXP.put(Material.LEATHER_LEGGINGS,350*3); - armorEXP.put(Material.LEATHER_CHESTPLATE,400*3); - armorEXP.put(Material.LEATHER_HELMET,250*3); - - armorEXP.put(Material.IRON_BOOTS,200*5); - armorEXP.put(Material.IRON_LEGGINGS,350*5); - armorEXP.put(Material.IRON_CHESTPLATE,400*5); - armorEXP.put(Material.IRON_HELMET,250*5); - - armorEXP.put(Material.GOLDEN_BOOTS,200*7); - armorEXP.put(Material.GOLDEN_LEGGINGS,350*7); - armorEXP.put(Material.GOLDEN_CHESTPLATE,400*7); - armorEXP.put(Material.GOLDEN_HELMET,250*7); - - armorEXP.put(Material.DIAMOND_BOOTS,200*10); - armorEXP.put(Material.DIAMOND_LEGGINGS,350*10); - armorEXP.put(Material.DIAMOND_CHESTPLATE,400*10); - armorEXP.put(Material.DIAMOND_HELMET,250*10); - - MinecraftVersion minecraftVersion = new MinecraftVersion(); - if (minecraftVersion.getMinecraftVersion_Double() >=1.16) { - armorEXP.put(Material.NETHERITE_BOOTS, 200 * 15); - armorEXP.put(Material.NETHERITE_LEGGINGS, 350 * 15); - armorEXP.put(Material.NETHERITE_CHESTPLATE, 400 * 15); - armorEXP.put(Material.NETHERITE_HELMET, 250 * 15); - } - - if (armorEXP.keySet().contains(armor.getType())) { - increaseStats.changeEXP(skillName,armorEXP.get(armor.getType())); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Digging.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Digging.java deleted file mode 100644 index 6ee85d4..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Digging.java +++ /dev/null @@ -1,552 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.gameTools.BlockFaceTracker; -import mc.carlton.freerpg.gameTools.TrackItem; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.WorldGuardChecks; -import org.bukkit.*; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.EnchantmentStorageMeta; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.persistence.PersistentDataType; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.util.Vector; - -import java.time.Instant; -import java.util.*; - -public class Digging extends Skill{ - private String skillName = "digging"; - - private boolean runMethods; - - Random rand = new Random(); //Random class Import - - public Digging(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - - public void initiateAbility() { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.diggingAbility")) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { - return; - } - Integer[] pTimers = timers.getPlayerCooldownTimes(); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[0] == -1) { - int cooldown = pTimers[0]; - if (cooldown < 1) { - int prepMessages = (int) pStatClass.getPlayerData().get("global").get(22); //Toggle for preparation messages - if (prepMessages >0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("shovel") + "...<<<"); - } - int taskID = new BukkitRunnable() { - @Override - public void run() { - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " +lang.getString("shovel") + "<<<"); - } - try { - abilities.setPlayerAbility( skillName, -1); - } - catch (Exception e) { - - } - } - }.runTaskLater(plugin, 20 * 4).getTaskId(); - abilities.setPlayerAbility( skillName, taskID); - } else { - actionMessage.sendMessage(ChatColor.RED +lang.getString("bigDig") + " " + lang.getString("cooldown") + ": " + ChatColor.WHITE + cooldown+ ChatColor.RED + "s"); - } - } - } - - public void enableAbility() { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - actionMessage.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("bigDig") + " " + lang.getString("activated") + "<<<"); - int effLevel = itemInHand.getEnchantmentLevel(Enchantment.DIG_SPEED); - itemInHand.removeEnchantment(Enchantment.DIG_SPEED); - itemInHand.addUnsafeEnchantment(Enchantment.DIG_SPEED,effLevel+5); - - //Mark the item - long unixTime = Instant.now().getEpochSecond(); - String keyName = p.getUniqueId().toString() + "-frpg-" + skillName + "-" + String.valueOf(unixTime); - NamespacedKey key = new NamespacedKey(plugin,keyName); - ItemMeta itemMeta = itemInHand.getItemMeta(); - itemMeta.getPersistentDataContainer().set(key, PersistentDataType.STRING,"frpg-digging"); - itemInHand.setItemMeta(itemMeta); - - int durationLevel = (int) pStat.get(skillName).get(4); - double duration0 = Math.ceil(durationLevel*0.4) + 40; - long duration = (long) duration0; - Bukkit.getScheduler().cancelTask(pAbilities[0]); - abilities.setPlayerAbility( skillName, -2); - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("bigDig") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("bigDig") + " " + lang.getString("ended") + "<<<"; - timers.abilityDurationTimer(skillName,duration,endMessage,coolDownEndMessage,key,itemInHand,effLevel,0); - } - - public void storeBlockFace(BlockFace blockFace) { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int megaDigLevel = (int) pStat.get(skillName).get(13); - if (megaDigLevel > 0) { - BlockFaceTracker blockFaceTracker = new BlockFaceTracker(); - blockFaceTracker.addBlockFace(blockFace,p); - } - } - - public void megaDig(Block block, Map diggingEXP) { - if (!runMethods) { - return; - } - WorldGuardChecks BuildingCheck = new WorldGuardChecks(); - World world = p.getWorld(); - Map> pStat = pStatClass.getPlayerData(); - int megaDigLevel = (int) pStat.get(skillName).get(13); - if (megaDigLevel < 1) { - return; - } - int megaDigToggle = (int) pStat.get("global").get(19); - if (megaDigToggle < 1) { - return; - } - BlockFaceTracker blockFaceTracker = new BlockFaceTracker(); - BlockFace blockFace = blockFaceTracker.getBlockface(p); - Vector normalVector = blockFace.getDirection(); - ConfigLoad configLoad = new ConfigLoad(); - for (int x = -1; x <= 1; x++) { - for (int y = -1; y <= 1; y++) { - for (int z = -1; z <= 1; z++) { - if (x==0 && y==0 && z==0) { - continue; - } - Vector relativeVector = new Vector(x, y, z); - if (relativeVector.dot(normalVector) == 0) { - Block planeBlock = block.getRelative(x, y, z); - Material blockType = planeBlock.getType(); - Location blockLocation = planeBlock.getLocation(); - if (!BuildingCheck.canBuild(p, blockLocation)) { - continue; - } - if (diggingEXP.containsKey(blockType)) { - damageTool(configLoad.getDurabilityModifiers().get("megaDig")); - increaseStats.changeEXP(skillName,(int) Math.round(diggingEXP.get(blockType)*configLoad.getSpecialMultiplier().get("megaDigEXPMultiplier"))); - Collection drops = planeBlock.getDrops(itemInHand); - for (ItemStack stack : drops) { - dropItemNaturally(blockLocation, stack); - } - diggingTreasureDrop(world,blockLocation,blockType); - planeBlock.setType(Material.AIR); - } - } - } - } - } - } - - public void diggingTreasureDrop(World world, Location loc,Material blockType) { - if (!runMethods) { - return; - } - ConfigLoad loadConfig = new ConfigLoad(); - ArrayList treasureData = loadConfig.getDiggingInfo(); - double randomNum = rand.nextDouble(); - double randomNum2 = 0; - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - int treasureRoll = (int) pStat.get(skillName).get(5); - int soulStealing = (int) pStat.get(skillName).get(10); - double treasureChance = treasureRoll * 0.00005 + 0.01; - if (soulStealing > 0 && blockType == Material.SOUL_SAND) { - treasureChance = treasureChance*(1+0.05*soulStealing); - } - if (treasureChance < randomNum) { - return; - } - - int rolls = 1; - int megaDig = (int) pStat.get(skillName).get(13); - int doubleTreasure = (int) pStat.get(skillName).get(8); - int dropLevel_I = (int) pStat.get(skillName).get(7); - int dropLevel_II = (int) pStat.get(skillName).get(9); - double[] rates = {0, 0, 0, 0, 0, 0, 0, 0, 0, (double)treasureData.get(20), (double)treasureData.get(23), - (double)treasureData.get(26), (double)treasureData.get(29), (double)treasureData.get(32), (double)treasureData.get(35)}; - - if (megaDig > 0 && pAbilities[0] == -2) { - for (int i = 0; i < rates.length; i++) { - rates[i] = rates[i] * 0.2; - } - } - - /* Old Treasure Magnet Perk, Replaced with Mega Dig - int treasureMagnet = (int) pStat.get(skillName).get(13); - if (treasureMagnet > 0 && pAbilities[0] == -2) { - for (int i = 0; i < rates.length; i++) { - rates[i] = rates[i] * 1.5; - } - } - - */ - //Set unobtained drops to 0 - switch (dropLevel_II) { - case 0: - rates[14] = 0; - rates[13] = 0; - rates[12] = 0; - rates[11] = 0; - rates[10] = 0; - break; - case 1: - rates[14] = 0; - rates[13] = 0; - rates[12] = 0; - rates[11] = 0; - break; - case 2: - rates[14] = 0; - rates[13] = 0; - rates[12] = 0; - break; - case 3: - rates[14] = 0; - rates[13] = 0; - break; - case 4: - rates[14] = 0; - break; - default: - break; - } - if (dropLevel_I < 5) { - rates[9] = 0; - } - - //Get total static drop chances, used to determine other drop chances - double total = 0.0; - for (int i = 0; i < rates.length; i++) { - total += rates[i]; - } - double remaining = 1 - total; - - //distributes remaining possible drops chance such that the sum is 1 - double dropLevel_1_double = dropLevel_I; - for (int i = 0; i < 5; i++) { - rates[i] = (4.0 / 5.0) * (remaining / 5.0); - } - if (dropLevel_I > 3) { - for (int i = 0; i < 4; i++) { - rates[i + 5] = (1.0 / 5.0) * (remaining / 4.0); - } - } else { - for (int i = 0; i < dropLevel_I; i++) { - rates[i + 5] = (1.0 / 5.0) * (remaining / dropLevel_1_double); - } - } - - //Creates list of running sums, highest value should be 1, duplicates occur when an item is impossible and should be sequential. - double[] rateSums = {rates[0], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - for (int i = 1; i < rates.length; i++) { - rateSums[i] = rateSums[i - 1] + rates[i]; - } - - Material[] music_discs = {Material.MUSIC_DISC_11, Material.MUSIC_DISC_13, Material.MUSIC_DISC_BLOCKS, Material.MUSIC_DISC_CAT, - Material.MUSIC_DISC_CHIRP, Material.MUSIC_DISC_FAR, Material.MUSIC_DISC_MALL, Material.MUSIC_DISC_MELLOHI, - Material.MUSIC_DISC_STAL, Material.MUSIC_DISC_STRAD, Material.MUSIC_DISC_WAIT, Material.MUSIC_DISC_WARD}; - Material[] horse_armor = {Material.LEATHER_HORSE_ARMOR, Material.IRON_HORSE_ARMOR, Material.GOLDEN_HORSE_ARMOR, Material.DIAMOND_HORSE_ARMOR}; - - - for (int i = 0; i < rolls; i++) { - //Double drop roll - double doubleTreasureChance = doubleTreasure * 0.05; - randomNum = rand.nextDouble(); - randomNum2 = rand.nextDouble(); - - boolean doubleDrop = false; - if (doubleTreasureChance > randomNum2) { - doubleDrop = true; - } - - if (randomNum < rateSums[0]) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(0) == null) { - drop.setType(Material.GLOWSTONE_DUST); - } - else { - drop.setType((Material)treasureData.get(0)); - drop.setAmount((int) treasureData.get(1)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop1EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[1]) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(2) == null) { - drop.setType(Material.GOLD_NUGGET); - } - else { - drop.setType((Material)treasureData.get(2)); - drop.setAmount((int) treasureData.get(3)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop2EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[2]) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(4) == null) { - drop.setType(Material.STRING); - } - else { - drop.setType((Material)treasureData.get(4)); - drop.setAmount((int) treasureData.get(5)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop3EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[3]) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(6) == null) { - drop.setType(Material.IRON_NUGGET); - } - else { - drop.setType((Material)treasureData.get(6)); - drop.setAmount((int) treasureData.get(7)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop4EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[4]) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(8) == null) { - drop.setType(Material.COBWEB); - } - else { - drop.setType((Material)treasureData.get(8)); - drop.setAmount((int) treasureData.get(9)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop5EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[5] && dropLevel_I >= 1) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(10) == null) { - drop.setType(Material.GOLD_INGOT); - } - else { - drop.setType((Material)treasureData.get(10)); - drop.setAmount((int) treasureData.get(11)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop6EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[6] && dropLevel_I >= 2) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(12) == null) { - drop.setType(Material.NAME_TAG); - } - else { - drop.setType((Material)treasureData.get(12)); - drop.setAmount((int) treasureData.get(13)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop7EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[7] && dropLevel_I >= 3) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(14) == null) { - drop.setType(music_discs[rand.nextInt(music_discs.length)]); - } - else { - drop.setType((Material)treasureData.get(14)); - drop.setAmount((int) treasureData.get(15)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop8EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[8] && dropLevel_I >= 4) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(16) == null) { - drop.setType(horse_armor[rand.nextInt(horse_armor.length)]); - } - else { - drop.setType((Material)treasureData.get(16)); - drop.setAmount((int) treasureData.get(17)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop9EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[9] && dropLevel_I >= 5) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(18) == null) { - drop.setType(Material.DIAMOND); - } - else { - drop.setType((Material)treasureData.get(18)); - drop.setAmount((int) treasureData.get(19)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop10EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[10] && dropLevel_II >= 1) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(21) == null) { - drop.setType(Material.EMERALD); - } - else { - drop.setType((Material)treasureData.get(21)); - drop.setAmount((int) treasureData.get(22)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop11EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[11] && dropLevel_II >= 2) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(24) == null || (treasureData.get(24)).equals(Material.ENCHANTED_BOOK)) { - ItemGroups itemGroups = new ItemGroups(); - Map enchantmentLevelMap = itemGroups.getEnchantmentLevelMap(); - drop.setType(Material.ENCHANTED_BOOK); - List keysAsArray = new ArrayList(enchantmentLevelMap.keySet()); - Enchantment randomEnchant = keysAsArray.get(rand.nextInt(keysAsArray.size())); - int randomLevel = rand.nextInt(enchantmentLevelMap.get(randomEnchant)) + 1; - EnchantmentStorageMeta meta = ((EnchantmentStorageMeta) drop.getItemMeta()); - meta.addStoredEnchant(randomEnchant,randomLevel,true); - drop.setItemMeta(meta); - if (randomEnchant == Enchantment.BINDING_CURSE || randomEnchant == Enchantment.VANISHING_CURSE) { - Map enchantmentLevelMapGood = enchantmentLevelMap; - enchantmentLevelMapGood.remove(Enchantment.BINDING_CURSE); - enchantmentLevelMapGood.remove(Enchantment.VANISHING_CURSE); - keysAsArray = new ArrayList(enchantmentLevelMapGood.keySet()); - randomEnchant = keysAsArray.get(rand.nextInt(keysAsArray.size())); - meta.addStoredEnchant(randomEnchant,randomLevel,true); - drop.setItemMeta(meta); - } - } - else { - drop.setType((Material)treasureData.get(24)); - drop.setAmount((int) treasureData.get(25)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop12EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[12] && dropLevel_II >= 3) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(27) == null) { - drop.setType(Material.DRAGON_BREATH); - } - else { - drop.setType((Material)treasureData.get(27)); - drop.setAmount((int) treasureData.get(28)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop13EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[13] && dropLevel_II >= 4) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(30) == null) { - drop.setType(Material.TOTEM_OF_UNDYING); - } - else { - drop.setType((Material)treasureData.get(30)); - drop.setAmount((int) treasureData.get(31)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop14EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } else if (randomNum < rateSums[14] && dropLevel_II >= 5) { - ItemStack drop = new ItemStack(Material.DIRT,1); - if (treasureData.get(33) == null) { - drop.setType(Material.NETHER_STAR); - } - else { - drop.setType((Material)treasureData.get(33)); - drop.setAmount((int) treasureData.get(34)); - } - world.dropItemNaturally(loc, drop); - increaseStats.changeEXP(skillName, expMap.get("drop15EXP")); - if (doubleDrop) { - world.dropItemNaturally(loc, drop); - } - } - } - } - - public boolean flintFinder(Material blockType) { - if (!runMethods) { - return false; - } - if (blockType == Material.GRAVEL) { - Map> pStat = pStatClass.getPlayerData(); - int flintFinderLevel = (int) pStat.get(skillName).get(11); - int flintFinderToggle = (int) pStat.get("global").get(12); - if (flintFinderLevel > 0 && flintFinderToggle > 0) { - return true; - } - } - return false; - } - - public void preventLogoutTheft(int taskID_digging, ItemStack itemInHand_digging,NamespacedKey key,boolean pluginDisabled){ - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[0] == -2) { - Bukkit.getScheduler().cancelTask(taskID_digging); - int effLevel = itemInHand_digging.getEnchantmentLevel(Enchantment.DIG_SPEED)-5; - String endMessage = ChatColor.RED+ChatColor.BOLD.toString() + ">>>" + lang.getString("magicForce") + "<<<"; - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("bigDig") + " " + lang.getString("readyToUse") + "<<<"; - timers.endAbility(skillName,endMessage,coolDownEndMessage,key,itemInHand_digging,effLevel,0,pluginDisabled); - TrackItem trackItem = new TrackItem(); - trackItem.removeItemKey(itemInHand_digging,key); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Enchanting.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Enchanting.java deleted file mode 100644 index 0653bf3..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Enchanting.java +++ /dev/null @@ -1,108 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.gameTools.PsuedoEnchanting; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.enchantments.EnchantmentOffer; -import org.bukkit.entity.Player; -import org.bukkit.inventory.EnchantingInventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.EnchantmentStorageMeta; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; - -public class Enchanting extends Skill{ - private String skillName = "enchanting"; - Random rand = new Random(); //Random class Import - static Map offersHolder = new HashMap(); - - private boolean runMethods; - - - - public Enchanting(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - public int xpIncrease(int oldAmount) { - if (!runMethods) { - return oldAmount; - } - Map> pStat = pStatClass.getPlayerData(); - int expBuffLevel = (int) pStat.get(skillName).get(4); - double multiplier = 1 + expBuffLevel*0.002; - int newAmount = (int) Math.floor(oldAmount*multiplier); - double roundUpChance = oldAmount*multiplier - Math.floor(oldAmount*multiplier); - if (roundUpChance > rand.nextDouble()) { - newAmount += 1; - } - return newAmount; - } - - public EnchantmentOffer[] enchantmentDiscount(EnchantmentOffer[] oldOffers) { - if (!runMethods) { - return oldOffers; - } - if (oldOffers.length == 0) { - return oldOffers; - } - offersHolder.put(p,oldOffers.clone()); - Map> pStat = pStatClass.getPlayerData(); - int levelSubtract = (int) pStat.get(skillName).get(7); - for (EnchantmentOffer offer : oldOffers) { - if (offer != null) { - int newCost = Math.max(offer.getCost() - levelSubtract, 1); - offer.setCost(newCost); - } - } - return oldOffers; - } - - public void enchantItem(ItemStack enchantedItem, int buttonClicked, EnchantingInventory enchantingInventory) { - if (!runMethods) { - return; - } - EnchantmentOffer[] originalOffers = offersHolder.get(p); - Enchantment enchant0 = originalOffers[buttonClicked].getEnchantment(); - int level0 = originalOffers[buttonClicked].getEnchantmentLevel(); - int cost0 = originalOffers[buttonClicked].getCost(); - increaseStats.changeEXP(skillName,expMap.get("enchantItem_EXPperLevelOfCost")*cost0); - new BukkitRunnable() { - @Override - public void run() { - if (enchantedItem.getType() != Material.BOOK) { - for (Enchantment enchant : enchantedItem.getEnchantments().keySet()) { - enchantedItem.removeEnchantment(enchant); - } - enchantedItem.addUnsafeEnchantment(enchant0, level0); - PsuedoEnchanting fakeEnchant = new PsuedoEnchanting(); - fakeEnchant.addEnchant(enchantedItem, cost0,false); - } - else { - ItemStack newBook = new ItemStack(Material.ENCHANTED_BOOK,1); - EnchantmentStorageMeta bookMeta = (EnchantmentStorageMeta) newBook.getItemMeta(); - bookMeta.addStoredEnchant(enchant0,level0,false); - newBook.setItemMeta(bookMeta); - PsuedoEnchanting fakeEnchant = new PsuedoEnchanting(); - fakeEnchant.addEnchant(newBook, cost0,false); - enchantingInventory.setItem(newBook); - } - - } - }.runTaskLater(plugin, 1); - - } - - public void giveEXP(int exp) { - increaseStats.changeEXP(skillName, expMap.get("EXPperMinecraftXPGained") * exp); - } - -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Farming.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Farming.java deleted file mode 100644 index dfbc95d..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Farming.java +++ /dev/null @@ -1,670 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.globalVariables.EntityGroups; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.PlacedBlocksManager; -import org.bukkit.*; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.block.data.Ageable; -import org.bukkit.block.data.BlockData; -import org.bukkit.block.data.Levelled; -import org.bukkit.block.data.type.Cocoa; -import org.bukkit.entity.*; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.Damageable; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.*; - -public class Farming extends Skill{ - private String skillName = "farming"; - static Map oneWithNatureMap = new HashMap<>(); - static Map oneWithNatureCounters = new HashMap<>(); - - Random rand = new Random(); //Random class Import - - private boolean runMethods; - - - - public Farming(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - public void initiateAbility() { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.farmingAbility")) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { - return; - } - Integer[] pTimers = timers.getPlayerCooldownTimes(); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[3] == -1) { - int cooldown = pTimers[3]; - if (cooldown < 1) { - int prepMessages = (int) pStatClass.getPlayerData().get("global").get(22); //Toggle for preparation messages - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("hoe") + "...<<<"); - } - int taskID = new BukkitRunnable() { - @Override - public void run() { - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " +lang.getString("hoe") + "<<<"); - } - try { - abilities.setPlayerAbility( skillName, -1); - } - catch (Exception e) { - - } - } - }.runTaskLater(plugin, 20 * 4).getTaskId(); - abilities.setPlayerAbility( skillName, taskID); - } else { - actionMessage.sendMessage(ChatColor.RED +lang.getString("naturalRegeneration") + " " + lang.getString("cooldown") + ": " + ChatColor.WHITE + cooldown+ ChatColor.RED + "s"); - } - } - } - - public void enableAbility() { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - actionMessage.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("naturalRegeneration") + " " + lang.getString("activated") + "<<<"); - int durationLevel = (int) pStat.get(skillName).get(4); - double duration0 = Math.ceil(durationLevel * 0.4) + 40; - long duration = (long) duration0; - Bukkit.getScheduler().cancelTask(pAbilities[3]); - abilities.setPlayerAbility( skillName, -2); - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("naturalRegeneration") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("naturalRegeneration") + " " + lang.getString("ended") + "<<<"; - timers.abilityDurationTimer(skillName,duration,endMessage,coolDownEndMessage); - } - - public void killFarmAnimalEXP(Entity animal) { - if (!runMethods) { - return; - } - Map farmAnimalsEXP = new HashMap<>(); - farmAnimalsEXP.put(EntityType.SHEEP,expMap.get("killSheep")); - farmAnimalsEXP.put(EntityType.COW,expMap.get("killCow")); - farmAnimalsEXP.put(EntityType.CHICKEN,expMap.get("killChicken")); - farmAnimalsEXP.put(EntityType.PIG,expMap.get("killPig")); - farmAnimalsEXP.put(EntityType.HORSE,expMap.get("killHorse")); - farmAnimalsEXP.put(EntityType.RABBIT,expMap.get("killRabbit")); - farmAnimalsEXP.put(EntityType.LLAMA,expMap.get("killLlama")); - farmAnimalsEXP.put(EntityType.TURTLE,expMap.get("killTurtle")); - if (farmAnimalsEXP.containsKey(animal.getType())) { - increaseStats.changeEXP(skillName,farmAnimalsEXP.get(animal.getType())); - } - } - - public int getRandomAge(int maximumAge, int greenThumbLevel) { - if (!runMethods) { - return 0; - } - int age = 0; - ArrayList pDist = new ArrayList<>(); - ArrayList pMass = new ArrayList<>(); - double sum = 0; - if (greenThumbLevel > 0) { - if (maximumAge == 0) { - if (rand.nextDouble() > 0.5) { - return 1; - } - else { - return 0; - } - } - else { - double c = -0.06; - for (int i = 0; i <= maximumAge; i++) { - pDist.add(0.0); - pMass.add(0.0); - } - for (int i = 0; i <= maximumAge; i++) { - double unNormalizedProb = Math.exp(c*i); - pDist.set(i,unNormalizedProb); - sum+= unNormalizedProb; - } - for (int i = 0; i <= maximumAge; i++) { - pDist.set(i,pDist.get(i)/sum); - } - for (int i = 0; i <= maximumAge; i++) { - if (i==0) { - pMass.set(i,pDist.get(i)); - } - else { - pMass.set(i,pMass.get(i-1)+pDist.get(i)); - } - } - double randomNum = rand.nextDouble(); - randomAgeLoop: - for (int i = 0; i <= maximumAge; i++) { - if (randomNum < pMass.get(i)){ - age = i; - break randomAgeLoop; - } - } - - } - } - else { - if (maximumAge == 0) { - return 0; - } - else { - double c = -0.2; - for (int i = 0; i < maximumAge; i++) { - pDist.add(0.0); - pMass.add(0.0); - } - for (int i = 0; i < maximumAge; i++) { - double unNormalizedProb = Math.exp(c*i); - pDist.set(i,unNormalizedProb); - sum+= unNormalizedProb; - } - for (int i = 0; i < maximumAge; i++) { - pDist.set(i,pDist.get(i)/sum); - } - for (int i = 0; i < maximumAge; i++) { - if (i==0) { - pMass.set(i,pDist.get(i)); - } - else { - pMass.set(i,pMass.get(i-1)+pDist.get(i)); - } - } - double randomNum = rand.nextDouble(); - randomAgeLoop: - for (int i = 0; i < maximumAge; i++) { - if (randomNum < pMass.get(i)){ - age = i; - break randomAgeLoop; - } - } - - } - } - - return age; - } - - public void naturalRegeneration(Block block, World world) { - if (!runMethods) { - return; - } - BlockData block_data = block.getBlockData(); - Material blockType = block.getType(); - ItemGroups itemGroups = new ItemGroups(); - List tallCrops = itemGroups.getTallCrops(); - if (tallCrops.contains(blockType)) { - return; - } - - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - int greenThumbLevel = (int)pStat.get(skillName).get(11); - if (pAbilities[3] == -2) { - ItemMeta toolMeta = itemInHand.getItemMeta(); - if (toolMeta instanceof Damageable) { - ((Damageable) toolMeta).setDamage(((Damageable) toolMeta).getDamage()+1); - itemInHand.setItemMeta(toolMeta); - if (((Damageable) toolMeta).getDamage() > itemInHand.getType().getMaxDurability()) { - itemInHand.setAmount(0); - p.getWorld().playEffect(p.getLocation(), Effect.STEP_SOUND, 1); - } - } - if (block_data instanceof Ageable) { - Ageable age = (Ageable) block_data; - if (age.getAge() != age.getMaximumAge()) { - block.setType(Material.AIR); - } - int randomAge = getRandomAge(age.getMaximumAge(),greenThumbLevel); - new BukkitRunnable() { - @Override - public void run() { - block.setType(blockType); - ((Ageable) block_data).setAge(randomAge); - block.setBlockData(block_data); - } - }.runTaskLater(plugin, 5); - } else if (block_data instanceof Cocoa) { - Cocoa coco = (Cocoa) block_data; - if (coco.getAge() != coco.getMaximumAge()) { - block.setType(Material.AIR); - } - int randomAge = getRandomAge(coco.getMaximumAge(),greenThumbLevel); - new BukkitRunnable() { - @Override - public void run() { - block.setType(blockType); - ((Cocoa) block_data).setAge(randomAge); - block.setBlockData(block_data); - } - }.runTaskLater(plugin, 5); - } else { - int randomAge = getRandomAge(0,greenThumbLevel); - if (randomAge == 1) { - new BukkitRunnable() { - @Override - public void run() { - block.setType(blockType); - } - }.runTaskLater(plugin, 1); - } - } - } - } - - public void animalDoubleDrops(Entity entity, World world,List drops) { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int doubleDropsAnimals = (int) pStat.get(skillName).get(6); - double doubleDropChance = doubleDropsAnimals*0.0005; - if (doubleDropChance < rand.nextDouble()) { - return; - } - List blackListedDrops = Arrays.asList(new Material[]{Material.SADDLE,Material.DIAMOND_HORSE_ARMOR,Material.GOLDEN_HORSE_ARMOR,Material.IRON_HORSE_ARMOR,Material.LEATHER_HORSE_ARMOR}); - EntityGroups entityGroups = new EntityGroups(); - List animals = entityGroups.getAnimals(); - if (animals.contains(entity.getType())) { - for (ItemStack drop : drops) { - if (blackListedDrops.contains(drop.getType())) { - continue; - } - if (entity instanceof ChestedHorse) { - if (!Arrays.asList( ((ChestedHorse) entity).getInventory().getContents()).contains(drop)) { - continue; - } - } - dropItemNaturally(entity.getLocation().add(0, 0.25, 0), drop); - } - } - } - - public void farmingDoubleDropCrop(Block block, World world) { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int doubleDropsCrop = (int) pStat.get(skillName).get(5); - - double doubleDropChance = doubleDropsCrop*0.0005; - if (doubleDropChance < rand.nextDouble()) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - List crops = itemGroups.getCrops(); - if (crops.contains(block.getType())) { - Collection drops = block.getDrops(itemInHand); - for (ItemStack drop : drops) { - dropItemNaturally(block.getLocation(), drop); - } - } - } - - public ArrayList getTallCropsBlocks(Block b_0, World world) { - ArrayList tallCropBlocks = new ArrayList<>(); - Block b_i = b_0; - while (b_0.getType() == b_i.getType()) { - tallCropBlocks.add(b_i); - b_i = b_i.getRelative(0,1,0); - } - return tallCropBlocks; - } - - public void tallCrops(Block block, World world) { - if (!runMethods) { - return; - } - ArrayList tallCropBlocks = getTallCropsBlocks(block,world); - - Map> pStat = pStatClass.getPlayerData(); - int doubleDropsCrop = (int) pStat.get(skillName).get(5); - - double doubleDropChance = doubleDropsCrop*0.0005; - int totalNatural = 0; - for (Block b : tallCropBlocks) { - //Checks if any of the blocks weren't natural - PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); - boolean natural = !placedBlocksManager.isBlockTracked(block); - if (!natural) { - placedBlocksManager.removeBlock(block); - } - if (natural) { - totalNatural+=1; - double randomNum = rand.nextDouble(); - if (doubleDropChance > randomNum) { - for (ItemStack item : b.getDrops(itemInHand)) { - dropItemNaturally(b.getLocation(),item); - } - } - } - } - switch (block.getType()) { - case CACTUS: - increaseStats.changeEXP(skillName,expMap.get("breakCactus")); - case SUGAR_CANE: - increaseStats.changeEXP(skillName,expMap.get("breakSugarCane")*totalNatural); - break; - case BAMBOO: - increaseStats.changeEXP(skillName,expMap.get("breakBamboo")*totalNatural); - break; - case KELP: - case KELP_PLANT: - increaseStats.changeEXP(skillName,expMap.get("breakKelp")*totalNatural); - break; - default: - break; - } - } - - public void eatFarmFood(ItemStack food) { - if (!runMethods) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - Map farmFood = itemGroups.getFarmFood(); - Map meatFood = itemGroups.getMeatFood(); - if (!(farmFood.containsKey(food.getType()) || meatFood.containsKey(food.getType()))) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int farmDietLevel = (int) pStat.get(skillName).get(9); - int meatEaterLevel = (int) pStat.get(skillName).get(10); - if (farmDietLevel < 1 && meatEaterLevel < 1) { - return; - } - Material foodType = food.getType(); - if (farmFood.containsKey(food.getType())) { - double foodMultiplier = farmDietLevel*0.2; - Map farmFoodSaturation = itemGroups.getFarmFoodSaturation(); - p.setFoodLevel((int)Math.min(20,p.getFoodLevel() + Math.round(foodMultiplier * farmFood.get(foodType)) )); - p.setSaturation((float)Math.min(p.getFoodLevel(),p.getSaturation()+(foodMultiplier*farmFoodSaturation.get(foodType)) )); - } - else if (meatFood.containsKey(food.getType())) { - double foodMultiplier = meatEaterLevel*0.2; - Map meatFoodSaturation = itemGroups.getMeatFoodSaturation(); - p.setFoodLevel((int)Math.min(20, p.getFoodLevel()+Math.round(foodMultiplier*meatFood.get(foodType)) )); - p.setSaturation((float)Math.min(p.getFoodLevel(),p.getSaturation()+(foodMultiplier*meatFoodSaturation.get(foodType)) )); - } - } - - public void babyAnimalGrow(Entity entity) { - if (!runMethods) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - List babyAnimals = entityGroups.getBabyAnimals(); - if (babyAnimals.contains(entity.getType())) { - if (entity instanceof org.bukkit.entity.Ageable) { - boolean isAdult = ((org.bukkit.entity.Ageable) entity).isAdult(); - if (isAdult) { - return; - } - if (itemInHand.getType() == Material.SUGAR) { - Map> pStat = pStatClass.getPlayerData(); - int growthHormonesLevel = (int) pStat.get(skillName).get(12); - if (growthHormonesLevel > 0) { - ((org.bukkit.entity.Ageable) entity).setAdult(); - int numSugar = itemInHand.getAmount(); - itemInHand.setAmount(numSugar-1); - } - } - } - } - } - public void fertilizerSave(Block block) { - if (!runMethods) { - return; - } - int amount = itemInHand.getAmount(); - new BukkitRunnable() { - @Override - public void run() { - int newAmount = itemInHand.getAmount(); - if (amount > newAmount) { - increaseStats.changeEXP("farming", expMap.get("useBonemeal")); - Map> pStat = pStatClass.getPlayerData(); - int betterFertilizerLevel = (int) pStat.get(skillName).get(7); - double refundChance = betterFertilizerLevel*0.1; - if (refundChance > rand.nextDouble()) { - itemInHand.setAmount(itemInHand.getAmount() + 1); - } - } - } - }.runTaskLater(plugin, 1); - } - public void composterEXP(Block block) { - if (!runMethods) { - return; - } - if (block.getType() == Material.COMPOSTER) { - BlockData data = block.getBlockData(); - int level = ((Levelled) data).getLevel(); - int maxLevel = ((Levelled) data).getMaximumLevel(); - if (level == maxLevel) { - increaseStats.changeEXP(skillName,expMap.get("useComposter")); - } - else { - new BukkitRunnable() { - @Override - public void run() { - BlockData newData = block.getBlockData(); - int newLevel = ((Levelled) newData).getLevel(); - if (newLevel > level) { - increaseStats.changeEXP(skillName,expMap.get("maximizeComposter")); - } - } - }.runTaskLater(plugin, 3); - } - } - } - public void oneWithNatureStart() { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int oneWithNatureLevel = (int) pStat.get(skillName).get(13); - if (oneWithNatureLevel > 0) { - int natureID = new BukkitRunnable() { - @Override - public void run() { - oneWithNatureCounters.put(p,0); - Block blockBelow = p.getLocation().getBlock().getRelative(BlockFace.DOWN); - int counter = 0; - if (blockBelow.getType() == Material.GRASS_BLOCK) { - for (int i = 1; i <= 20; i++) { - new BukkitRunnable() { - @Override - public void run() { - int count = 0; - try { - count = oneWithNatureCounters.get(p); - } - catch (NullPointerException playerLeft) { - return; - } - if (p.getLocation().getBlock().getRelative(BlockFace.DOWN).equals(blockBelow)) { - count += 1; - oneWithNatureCounters.put(p,count); - } - if (count == 20) { - boolean addEffect = true; - boolean hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.REGENERATION)) { - hasEffect = true; - if (effect.getDuration() > 2*20) { - addEffect = false; - } - break potionEffectLoop; - } - } - if (addEffect) { - if (hasEffect){ - p.removePotionEffect(PotionEffectType.REGENERATION); - } - p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 3 * 20, 0)); - } - } - } - }.runTaskLater(plugin,i); - } - } - } - }.runTaskTimer(plugin, 40,40).getTaskId(); - oneWithNatureMap.put(p,natureID); - oneWithNatureCounters.put(p,0); - } - } - public void oneWithNatureEnd(){ - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int oneWithNatureLevel = (int) pStat.get(skillName).get(13); - if (oneWithNatureLevel > 0) { - Bukkit.getScheduler().cancelTask(oneWithNatureMap.get(p)); - oneWithNatureMap.remove(p); - oneWithNatureCounters.remove(p); - } - - } - - public void shearSheep(Entity entity,World world) { - if (!runMethods) { - return; - } - if (!(entity instanceof Sheep)) { - return; - } - increaseStats.changeEXP(skillName,expMap.get("shearSheep")); - Location dropLoc = entity.getLocation().add(0,0.5,0); - Map> pStat = pStatClass.getPlayerData(); - DyeColor color = ((Sheep) entity).getColor(); - ((Sheep) entity).setSheared(true); - ItemStack wool = new ItemStack(Material.WHITE_WOOL,1); - switch (color) { - case ORANGE: - wool.setType(Material.ORANGE_WOOL); - break; - case MAGENTA: - wool.setType(Material.MAGENTA_WOOL); - break; - case LIGHT_BLUE: - wool.setType(Material.LIGHT_BLUE_WOOL); - break; - case YELLOW: - wool.setType(Material.YELLOW_WOOL); - break; - case LIME: - wool.setType(Material.LIME_WOOL); - break; - case PINK: - wool.setType(Material.PINK_WOOL); - break; - case GRAY: - wool.setType(Material.GRAY_WOOL); - break; - case LIGHT_GRAY: - wool.setType(Material.LIGHT_GRAY_WOOL); - break; - case CYAN: - wool.setType(Material.CYAN_WOOL); - break; - case PURPLE: - wool.setType(Material.PURPLE_WOOL); - break; - case BLUE: - wool.setType(Material.BLUE_WOOL); - break; - case BROWN: - wool.setType(Material.BROWN_WOOL); - break; - case GREEN: - wool.setType(Material.GREEN_WOOL); - break; - case RED: - wool.setType(Material.RED_WOOL); - break; - case BLACK: - wool.setType(Material.BLACK_WOOL); - break; - default: - break; - } - int animalDoubleDrop = (int) pStat.get(skillName).get(6); - double doubleDropChance = animalDoubleDrop*0.0005; - int dropMultiplier = 1; - if (doubleDropChance > rand.nextDouble()) { - dropMultiplier = 2; - } - wool.setAmount(dropMultiplier); - double woolRoll = rand.nextDouble(); - if (woolRoll < 0.3333) { - world.dropItemNaturally(dropLoc,wool); - } - else if (woolRoll < 0.6666) { - wool.setAmount(wool.getAmount()*2); - world.dropItemNaturally(dropLoc,wool); - } - else { - wool.setAmount(wool.getAmount()*3); - world.dropItemNaturally(dropLoc,wool); - } - } - - public void milkingEXP(Entity entity) { - if (!runMethods) { - return; - } - if (entity.getType() == EntityType.COW || entity.getType() == EntityType.MUSHROOM_COW) { - if (itemInHand.getType() == Material.BUCKET) { - new BukkitRunnable() { - @Override - public void run() { - ItemStack newItem = p.getInventory().getItemInMainHand(); - if (newItem.getType() == Material.MILK_BUCKET) { - increaseStats.changeEXP(skillName, expMap.get("milkAnimal")); - } - } - }.runTaskLater(plugin, 1); - } - } - } - - public void breedingEXP(Entity entity) { - if (!runMethods) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - List breedingAnimals = entityGroups.getBreedingAnimalsFarming(); - if (breedingAnimals.contains(entity.getType())) { - increaseStats.changeEXP(skillName,expMap.get("breedFarmAnimal")); - } - } - - -} - diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Fishing.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Fishing.java deleted file mode 100644 index 2b999f9..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Fishing.java +++ /dev/null @@ -1,1548 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.gameTools.PsuedoEnchanting; -import mc.carlton.freerpg.globalVariables.EntityGroups; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.MinecraftVersion; -import org.bukkit.*; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.*; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.Damageable; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.util.Vector; - -import java.util.*; - -public class Fishing extends Skill{ - private String skillName = "fishing"; - static Map fishPersonMap = new HashMap<>(); - static Map fishPersonCounters = new HashMap<>(); - - - Random rand = new Random(); //Random class Import - - static HashSet superBaitBlock = new HashSet<>(); - - private boolean runMethods; - - - - public Fishing(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - - public void initiateAbility() { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.fishingAbility")) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { - return; - } - Integer[] pTimers = timers.getPlayerCooldownTimes(); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[4] == -1) { - int cooldown = pTimers[4]; - if (cooldown < 1) { - int prepMessages = (int) pStatClass.getPlayerData().get("global").get(22); //Toggle for preparation messages - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("fishingRod") + "...<<<"); - } - int taskID = new BukkitRunnable() { - @Override - public void run() { - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " +lang.getString("fishingRod") + "<<<"); - } - try { - abilities.setPlayerAbility( skillName, -1); - } - catch (Exception e) { - - } - } - }.runTaskLater(plugin, 20 * 4).getTaskId(); - abilities.setPlayerAbility( skillName, taskID); - } else { - actionMessage.sendMessage(ChatColor.RED +lang.getString("superBait") + " " + lang.getString("cooldown") + ": " + ChatColor.WHITE + cooldown+ ChatColor.RED + "s"); - } - } - } - - public void enableAbility() { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - actionMessage.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("superBait") + " " + lang.getString("activated") + "<<<"); - int durationLevel = (int) pStat.get(skillName).get(4); - double duration0 = Math.ceil(durationLevel * 0.2) + 20; - long duration = (long) duration0; - Bukkit.getScheduler().cancelTask(pAbilities[4]); - abilities.setPlayerAbility( skillName, -2); - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("superBait") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("superBait") + " " + lang.getString("ended") + "<<<"; - timers.abilityDurationTimer(skillName,duration,endMessage,coolDownEndMessage); - } - - public void killFishEXP(Entity fish) { - if (!runMethods) { - return; - } - Map fishMap = new HashMap<>(); - fishMap.put(EntityType.COD,expMap.get("killCod")); - fishMap.put(EntityType.SALMON,expMap.get("killSalmon")); - fishMap.put(EntityType.PUFFERFISH,expMap.get("killPufferfish")); - fishMap.put(EntityType.TROPICAL_FISH,expMap.get("killTropical_Fish")); - if (fishMap.containsKey(fish.getType())) { - increaseStats.changeEXP(skillName,fishMap.get(fish.getType())); - } - } - - /* Old Perk - public void waterBreather() { - Map> pStat = pStatClass.getPlayerData(); - int waterBreatherLevel = (int) pStat.get(skillName).get(11); - if (waterBreatherLevel > 0) { - boolean addEffect = true; - boolean hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.WATER_BREATHING)) { - hasEffect = true; - if (effect.getDuration() > 89 * 20) { - addEffect = false; - } - break potionEffectLoop; - } - } - if (addEffect) { - if (hasEffect) { - p.removePotionEffect(PotionEffectType.WATER_BREATHING); - } - p.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 20 * 90, 0)); - } - } - } - - */ - - public void grapplingHook(FishHook fishhook,World world) { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int grapplingHookLevel = (int) pStat.get(skillName).get(11); - int grappleToggle = (int) pStat.get("global").get(16); - if (grapplingHookLevel < 1) { - return; - } - if (grappleToggle < 1) { - return; - } - Location location = fishhook.getLocation(); - double dx = location.getX() - p.getLocation().getX(); - double dy = location.getY() - p.getLocation().getY(); - double dz = location.getZ() - p.getLocation().getZ(); - double distance = Math.sqrt((dx * dx) + (dy * dy) + (dz * dz)); - double multiplier = 0.200; - Vector velocity = new Vector(dx * multiplier, (dy * multiplier) + (double) Math.sqrt(distance) * 0.10, dz * multiplier); - p.setVelocity(velocity); - } - - public void superBait(FishHook fishhook, Entity hookedEntity,World world) { - if (!runMethods) { - return; - } - if (hookedEntity instanceof Item) { - ((Item) hookedEntity).setItemStack(new ItemStack(Material.DIRT,0)); - ItemStack drop = dropTable(false); - ((Item) hookedEntity).setItemStack(drop); - } - if (hookedEntity == null) { - Location location = fishhook.getLocation(); - if (world.getBlockAt(location).getType() == Material.WATER) { - if (!superBaitBlock.contains(p.getUniqueId())) { - double dx = p.getLocation().getX() - location.getX(); - double dy = p.getLocation().getY() - location.getY(); - double dz = p.getLocation().getZ() - location.getZ(); - double distance = Math.sqrt((dx * dx) + (dy * dy) + (dz * dz)); - double multiplier = 0.08; - ItemStack drop = dropTable(true); - Item droppedItem = world.dropItemNaturally(location, drop); - Vector velocity = new Vector(dx * multiplier, (dy * multiplier) + (double) Math.sqrt(distance) * 0.1, dz * multiplier); - droppedItem.setVelocity(velocity); - ((ExperienceOrb) world.spawn(p.getLocation(), ExperienceOrb.class)).setExperience(rand.nextInt(6) + 1); - ItemMeta toolMeta = itemInHand.getItemMeta(); - if (toolMeta instanceof Damageable) { - ((Damageable) toolMeta).setDamage(((Damageable) toolMeta).getDamage()+1); - itemInHand.setItemMeta(toolMeta); - if (((Damageable) toolMeta).getDamage() > itemInHand.getType().getMaxDurability()) { - itemInHand.setAmount(0); - p.getWorld().playEffect(p.getLocation(), Effect.STEP_SOUND, 1); - } - } - ConfigLoad configLoad = new ConfigLoad(); - int superBaitcooldown = configLoad.getSuperBaitCooldown(); - if (superBaitcooldown > 0) { - superBaitBlock.add(p.getUniqueId()); - new BukkitRunnable() { - @Override - public void run() { - if (superBaitBlock.contains(p.getUniqueId())) { - superBaitBlock.remove(p.getUniqueId()); - } - } - }.runTaskLater(plugin, superBaitcooldown); - } - } - - } - } - - } - - public void fishPersonStart() { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int fishPersonLevel = (int) pStat.get(skillName).get(13); - if (fishPersonLevel > 0) { - int fishID = new BukkitRunnable() { - @Override - public void run() { - fishPersonCounters.put(p,0); - Block block = p.getLocation().getBlock(); - Block blockBelow = block.getRelative(BlockFace.DOWN); - if (block.getType() == Material.WATER || blockBelow.getType() == Material.WATER) { - for (int i = 1; i <= 20; i++) { - new BukkitRunnable() { - @Override - public void run() { - int count = 0; - try { - count = fishPersonCounters.get(p); - } - catch (NullPointerException playerLeft) { - return; - } - if (p.getLocation().getBlock().getType() == Material.WATER) { - count += 1; - fishPersonCounters.put(p,count); - } - - if (count == 20) { - boolean addEffect = true; - boolean hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.DOLPHINS_GRACE)) { - hasEffect = true; - if (effect.getDuration() > 12*20) { - addEffect = false; - } - break potionEffectLoop; - } - } - if (addEffect) { - if (hasEffect){ - p.removePotionEffect(PotionEffectType.DOLPHINS_GRACE); - } - p.addPotionEffect(new PotionEffect(PotionEffectType.DOLPHINS_GRACE, 15 * 20, 0)); - } - - boolean addEffect2 = true; - boolean hasEffect2 = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.NIGHT_VISION)) { - hasEffect2 = true; - if (effect.getDuration() > 12*20) { - addEffect2 = false; - } - break potionEffectLoop; - } - } - if (addEffect2) { - if (hasEffect2){ - p.removePotionEffect(PotionEffectType.NIGHT_VISION); - } - p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 15 * 20, 0)); - } - } - } - }.runTaskLater(plugin,i); - } - } - } - }.runTaskTimer(plugin, 40,40).getTaskId(); - fishPersonMap.put(p,fishID); - fishPersonCounters.put(p,0); - } - } - - public void fishPersonEnd(){ - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int fishPersonLevel = (int) pStat.get(skillName).get(13); - if (fishPersonLevel > 0) { - Bukkit.getScheduler().cancelTask(fishPersonMap.get(p)); - fishPersonMap.remove(p); - fishPersonCounters.remove(p); - } - - } - - public void eatFishFood(ItemStack food) { - if (!runMethods) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - Map fishFood = itemGroups.getFishFood(); - if (!(fishFood.containsKey(food.getType()) )) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int fishDietLevel = (int) pStat.get(skillName).get(9); - if (fishDietLevel < 1) { - return; - } - Material foodType = food.getType(); - if (fishFood.containsKey(food.getType())) { - double foodMultiplier = fishDietLevel*0.2; - Map fishFoodSaturation = itemGroups.getFishFoodSaturation(); - p.setFoodLevel((int)Math.min(20,p.getFoodLevel() + Math.round(foodMultiplier * fishFood.get(foodType)) )); - p.setSaturation((float)Math.min(p.getFoodLevel(),p.getSaturation()+(foodMultiplier*fishFoodSaturation.get(foodType)) )); - } - - } - - - public void rob(FishHook fishhook, Entity hookedEntity,World world) { - if (!runMethods) { - return; - } - if (hookedEntity == null) { - return; - } - MinecraftVersion minecraftVersion = new MinecraftVersion(); - Integer[] pTimers = timers.getPlayerCooldownTimes(); - EntityGroups entityGroups = new EntityGroups(); - List hookableEntities = entityGroups.getHookableEntities(); - if (!hookableEntities.contains(hookedEntity.getType())) { - return; - } - if (pTimers[11] > 0) { - actionMessage.sendMessage(ChatColor.RED + lang.getString("rob") + " " + lang.getString("cooldown") + ": " + pTimers[11].toString() + "s"); - return; - } - Map> pStat = pStatClass.getPlayerData(); - int robLevel = (int) pStat.get(skillName).get(7); - if (robLevel * .15 < rand.nextDouble()) { - return; - } - ItemStack drop = new ItemStack(Material.DIRT, 1); - if (hookedEntity.getType() == EntityType.BLAZE) { - drop.setType(Material.BLAZE_ROD); - increaseStats.changeEXP(skillName,expMap.get("robBlaze")); - } else if (hookedEntity.getType() == EntityType.GHAST) { - double randomNum = rand.nextDouble(); - if (randomNum < .5) { - drop.setType(Material.GHAST_TEAR); - } else { - drop.setType(Material.GUNPOWDER); - } - increaseStats.changeEXP(skillName,expMap.get("robGhast")); - } else if (hookedEntity.getType() == EntityType.ZOMBIE) { - double randomNum = rand.nextDouble(); - if (randomNum < .98) { - drop.setType(Material.ROTTEN_FLESH); - } else { - drop.setType(Material.ZOMBIE_HEAD); - } - increaseStats.changeEXP(skillName,expMap.get("robZombie")); - } else if (hookedEntity.getType() == EntityType.SPIDER) { - double randomNum = rand.nextDouble(); - if (randomNum < .5) { - drop.setType(Material.STRING); - } else { - drop.setType(Material.SPIDER_EYE); - } - increaseStats.changeEXP(skillName,expMap.get("robSpider")); - } else if (hookedEntity.getType() == EntityType.CAVE_SPIDER) { - double randomNum = rand.nextDouble(); - if (randomNum < .49) { - drop.setType(Material.STRING); - } else if (randomNum < .98) { - drop.setType(Material.SPIDER_EYE); - } else if (randomNum < .99) { - drop.setType(Material.SPLASH_POTION); - PotionMeta pm = (PotionMeta) drop.getItemMeta(); - assert pm != null; - pm.addCustomEffect(new PotionEffect(PotionEffectType.POISON, 15, 0), false); - pm.setDisplayName(ChatColor.YELLOW + "Splash Potion of Poison"); - drop.setItemMeta(pm); - - } else { - drop.setType(Material.COBWEB); - } - increaseStats.changeEXP(skillName,expMap.get("robCave_Spider")); - } else if (hookedEntity.getType() == EntityType.PIG) { - drop.setType(Material.PORKCHOP); - increaseStats.changeEXP(skillName,expMap.get("robPig")); - } else if (hookedEntity.getType() == EntityType.CHICKEN) { - double randomNum = rand.nextDouble(); - if (randomNum < .33) { - drop.setType(Material.EGG); - } else if (randomNum > .66) { - drop.setType(Material.CHICKEN); - } else { - drop.setType(Material.FEATHER); - } - increaseStats.changeEXP(skillName,expMap.get("robChicken")); - } else if (hookedEntity.getType() == EntityType.CREEPER) { - double randomNum = rand.nextDouble(); - if (randomNum < .99) { - drop.setType(Material.GUNPOWDER); - } else { - drop.setType(Material.CREEPER_HEAD); - } - increaseStats.changeEXP(skillName,expMap.get("robCreeper")); - } else if (hookedEntity.getType() == EntityType.SKELETON) { - double randomNum = rand.nextDouble(); - if (randomNum < .49) { - drop.setType(Material.BONE); - } else if (randomNum < .98) { - drop.setType(Material.ARROW); - drop.setAmount(rand.nextInt(3) + 1); - } else { - drop.setType(Material.SKELETON_SKULL); - } - increaseStats.changeEXP(skillName,expMap.get("robSkeleton")); - } else if (hookedEntity.getType() == EntityType.WITHER_SKELETON) { - double randomNum = rand.nextDouble(); - if (randomNum < .50) { - drop.setType(Material.BONE); - } else if (randomNum < .99) { - drop.setType(Material.COAL); - drop.setAmount(rand.nextInt(3) + 1); - } else { - drop.setType(Material.WITHER_SKELETON_SKULL); - } - increaseStats.changeEXP(skillName,expMap.get("robWither_Skeleton")); - } else if (hookedEntity.getType() == EntityType.SLIME) { - drop.setType(Material.SLIME_BALL); - increaseStats.changeEXP(skillName,expMap.get("robSlime")); - } else if (hookedEntity.getType() == EntityType.MAGMA_CUBE) { - drop.setType(Material.MAGMA_CREAM); - increaseStats.changeEXP(skillName,expMap.get("robMagma_Cube")); - } else if (hookedEntity.getType() == EntityType.COW) { - double randomNum = rand.nextDouble(); - if (randomNum < .49) { - drop.setType(Material.LEATHER); - } else if (randomNum < .98) { - drop.setType(Material.BEEF); - } else { - drop.setType(Material.MILK_BUCKET); - } - increaseStats.changeEXP(skillName,expMap.get("robCow")); - } else if (hookedEntity.getType() == EntityType.MUSHROOM_COW) { - double randomNum = rand.nextDouble(); - if (randomNum < .05) { - drop.setType(Material.MILK_BUCKET); - } else if (randomNum < 0.10) { - drop.setType(Material.MUSHROOM_STEW); - } else if (randomNum < 0.40) { - drop.setType(Material.LEATHER); - } else if (randomNum < 0.70) { - drop.setType(Material.BEEF); - } else { - drop.setType(Material.RED_MUSHROOM); - drop.setAmount(rand.nextInt(3) + 1); - } - increaseStats.changeEXP(skillName,expMap.get("robMooshroom")); - } else if (hookedEntity.getType() == EntityType.ENDERMAN) { - drop.setType(Material.ENDER_PEARL); - increaseStats.changeEXP(skillName,expMap.get("robEnderman")); - } else if (hookedEntity.getType() == EntityType.SHEEP) { - drop.setType(Material.WHITE_WOOL); - increaseStats.changeEXP(skillName,expMap.get("robSheep")); - } else if (hookedEntity.getType() == EntityType.IRON_GOLEM) { - double randomNum = rand.nextDouble(); - if (randomNum < .03) { - drop.setType(Material.PUMPKIN); - } else if (randomNum < 0.15) { - drop.setType(Material.IRON_INGOT); - } else { - drop.setType(Material.POPPY); - } - increaseStats.changeEXP(skillName,expMap.get("robIron_Golem")); - } else if (hookedEntity.getType() == EntityType.SNOWMAN) { - double randomNum = rand.nextDouble(); - if (randomNum < .03) { - drop.setType(Material.PUMPKIN); - } else { - drop.setType(Material.SNOWBALL); - } - increaseStats.changeEXP(skillName,expMap.get("robSnowman")); - } else if (hookedEntity.getType() == EntityType.WITCH) { - double randomNum = rand.nextDouble(); - if (randomNum < 0.01) { - drop.setType(Material.SPLASH_POTION); - PotionMeta pm = (PotionMeta) drop.getItemMeta(); - assert pm != null; - pm.addCustomEffect(new PotionEffect(PotionEffectType.HEAL, 15, 0), false); - pm.setDisplayName(ChatColor.YELLOW + "Splash Potion of Healing"); - drop.setItemMeta(pm); - } else if (randomNum < 0.02) { - drop.setType(Material.SPLASH_POTION); - PotionMeta pm = (PotionMeta) drop.getItemMeta(); - assert pm != null; - pm.addCustomEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 15, 0), false); - pm.setDisplayName(ChatColor.YELLOW + "Splash Potion of Fire Resistance"); - drop.setItemMeta(pm); - } else if (randomNum < 0.03) { - drop.setType(Material.SPLASH_POTION); - PotionMeta pm = (PotionMeta) drop.getItemMeta(); - assert pm != null; - pm.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 15, 0), false); - pm.setDisplayName(ChatColor.YELLOW + "Splash Potion of Speed"); - drop.setItemMeta(pm); - } else if (randomNum < 0.12) { - drop.setType(Material.GLASS_BOTTLE); - } else if (randomNum < 0.24) { - drop.setType(Material.SUGAR); - } else if (randomNum < 0.36) { - drop.setType(Material.SPIDER_EYE); - } else if (randomNum < 0.48) { - drop.setType(Material.GUNPOWDER); - } else if (randomNum < 0.61) { - drop.setType(Material.FERMENTED_SPIDER_EYE); - } else if (randomNum < 0.74) { - drop.setType(Material.GLOWSTONE_DUST); - } else if (randomNum < 0.87) { - drop.setType(Material.REDSTONE); - } else { - drop.setType(Material.STICK); - } - increaseStats.changeEXP(skillName,expMap.get("robWitch")); - } else if (hookedEntity.getType() == EntityType.SHULKER) { - double randomNum = rand.nextDouble(); - if (randomNum < .25) { - drop.setType(Material.SHULKER_SHELL); - } else { - drop.setType(Material.PURPUR_BLOCK); - } - increaseStats.changeEXP(skillName,expMap.get("robShulker")); - } else if (minecraftVersion.getMinecraftVersion_Double() >= 1.16) { - if (hookedEntity.getType() == EntityType.ZOMBIFIED_PIGLIN) { - double randomNum = rand.nextDouble(); - if (randomNum < .5) { - drop.setType(Material.ROTTEN_FLESH); - } else { - drop.setType(Material.GOLD_NUGGET); - } - increaseStats.changeEXP(skillName, expMap.get("robZombie_Pigman")); - } - } - - Location location = hookedEntity.getLocation(); - double dx = p.getLocation().getX() - location.getX(); - double dy = p.getLocation().getY() - location.getY(); - double dz = p.getLocation().getZ() - location.getZ(); - double distance = Math.sqrt((dx * dx) + (dy * dy) + (dz * dz)); - double multiplier = 0.08; - Item droppedItem = world.dropItemNaturally(location, drop); - Vector velocity = new Vector(dx * multiplier, (dy * multiplier) + (double) Math.sqrt(distance) * 0.1, dz * multiplier); - droppedItem.setVelocity(velocity); - - ConfigLoad configLoad = new ConfigLoad(); - int cooldownTime = configLoad.getAbilityCooldowns().get("robCooldown"); - timers.setPlayerCooldownTime( "fishingRob", cooldownTime); - for (int i = 1; i <= cooldownTime; i++) { - int timeRemaining = cooldownTime - i; - new BukkitRunnable() { - @Override - public void run() { - timers.setPlayerCooldownTime( "fishingRob", timeRemaining); - if (timeRemaining == 0 && !p.isOnline()) { - timers.removePlayer(); - } - } - }.runTaskLater(plugin, 20 * i); - } - - } - - - public ItemStack dropTable(boolean superBaitOn) { - Map> pStat = pStatClass.getPlayerData(); - int doubleFishLevel = (int) pStat.get(skillName).get(5); - int treasureFinderLevel = (int) pStat.get(skillName).get(6); - int scavengerLevel = (int) pStat.get(skillName).get(8); - int filtrationLevel = (int) pStat.get(skillName).get(10); - int hotRodLevel = (int) pStat.get(skillName).get(12); - int hotRodToggle = (int) pStat.get("global").get(17); - int hotRod = 0; - double expMultiplier = 1.0; - if (superBaitOn) { - ConfigLoad configLoad = new ConfigLoad(); - expMultiplier = configLoad.getSpecialMultiplier().get("superBaitEXPMultiplier"); - } - if (hotRodLevel > 0 && hotRodToggle > 0) { - hotRod = 1; - } - double roll = rand.nextDouble(); - ItemStack item = new ItemStack(Material.COD, 1); - - //Load Fishing config - ConfigLoad loadConfig = new ConfigLoad(); - ArrayList fishingInfo = loadConfig.getFishingInfo1(); - ArrayList fishingInfoBaseChances = loadConfig.getFishingInfo2(); - ArrayList fishingInfoHotRod = loadConfig.getFishingInfo3(); - ArrayList fishingInfoEnchants = loadConfig.getFishingInfo4(); - - //Initialize Sorted Arrays - ArrayList baseChances = new ArrayList<>(); - ArrayList itemNames = new ArrayList<>(); - ArrayList dropAmounts = new ArrayList<>(); - ArrayList dropRandomness = new ArrayList<>(); - ArrayList itemNames_hotRod = new ArrayList<>(); - ArrayList dropAmounts_hotRod = new ArrayList<>(); - ArrayList dropRandomness_hotRod = new ArrayList<>(); - ArrayList dropEnchantedItems = new ArrayList<>(); - - //Organize Fishing config - for (Object chance : fishingInfoBaseChances) { - baseChances.add((double)chance); - } - for (int i =0; i < fishingInfo.size(); i++) { - if (i % 3 == 0) { - itemNames.add((Material)fishingInfo.get(i)); - } - else if (i % 3 == 1) { - dropAmounts.add((int)fishingInfo.get(i)); - } - else { - dropRandomness.add((int)fishingInfo.get(i)); - } - } - for (Object entry : fishingInfoHotRod) { - int i = fishingInfoHotRod.indexOf(entry); - if (i % 3 == 0) { - itemNames_hotRod.add((Material)entry); - } - else if (i % 3 == 1) { - dropAmounts_hotRod.add((int)entry); - } - else { - dropRandomness_hotRod.add((int)entry); - } - } - for (Object enchantInfo : fishingInfoEnchants) { - if ((int)enchantInfo > 0) { - dropEnchantedItems.add(true); - } - else { - dropEnchantedItems.add(false); - } - } - - //Luck of the sea level - int luckOfTheSeaLevel = 0; - if (itemInHand != null) { - ItemMeta rodMeta = itemInHand.getItemMeta(); - if (rodMeta != null) { - if (rodMeta.getEnchants() != null) { - if (rodMeta.getEnchants().containsKey(Enchantment.LUCK)) { - luckOfTheSeaLevel = rodMeta.getEnchantLevel(Enchantment.LUCK); - } - } - } - } - - double[] tierChances = {Math.max(0.100 - 0.02*luckOfTheSeaLevel,0), Math.min(0.050 + 0.2*luckOfTheSeaLevel,0.15), - baseChances.get(0),baseChances.get(1),baseChances.get(2),baseChances.get(3),baseChances.get(4)}; - double[] junkToTreasurePortion = {0,0,0,0,0,0,0}; - - //Determine if chance to roll into tier unlocked - //Also determines the portion of junkToTreasure chances -> each treasure bracket - switch (scavengerLevel) { - case 0: - tierChances[2] = 0; - tierChances[3] = 0; - tierChances[4] = 0; - tierChances[5] = 0; - tierChances[6] = 0; - junkToTreasurePortion[1] = 1; - break; - case 1: - tierChances[3] = 0; - tierChances[4] = 0; - tierChances[5] = 0; - tierChances[6] = 0; - junkToTreasurePortion[1] = 0.5; - junkToTreasurePortion[2] = 0.5; - break; - case 2: - tierChances[4] = 0; - tierChances[5] = 0; - tierChances[6] = 0; - junkToTreasurePortion[1] = 0.334; - junkToTreasurePortion[2] = 0.333; - junkToTreasurePortion[3] = 0.333; - break; - case 3: - tierChances[5] = 0; - tierChances[6] = 0; - junkToTreasurePortion[1] = 0.3; - junkToTreasurePortion[2] = 0.3; - junkToTreasurePortion[3] = 0.3; - junkToTreasurePortion[4] = 0.1; - junkToTreasurePortion[5] = 0; - junkToTreasurePortion[6] = 0; - break; - case 4: - tierChances[6] = 0; - junkToTreasurePortion[1] = 0.267; - junkToTreasurePortion[2] = 0.267; - junkToTreasurePortion[3] = 0.266; - junkToTreasurePortion[4] = 0.1; - junkToTreasurePortion[5] = 0.1; - break; - case 5: - junkToTreasurePortion[1] = 0.25; - junkToTreasurePortion[2] = 0.25; - junkToTreasurePortion[3] = 0.25; - junkToTreasurePortion[4] = 0.1; - junkToTreasurePortion[5] = 0.1; - junkToTreasurePortion[6] = 0.05; - break; - default: - break; - } - - //Alters brackets chances based on filtrationLevel - if (filtrationLevel <= 2 && filtrationLevel >0) { - double total = 0; - for (int i = 3; i <= 6; i++) { - if (tierChances[i] != 0) { - switch(i) { - case 3: - tierChances[i] += 0.005*filtrationLevel; - total += 0.005*filtrationLevel; - break; - case 4: - case 5: - tierChances[i] += 0.002*filtrationLevel; - total += 0.002*filtrationLevel; - break; - case 6: - tierChances[i] += 0.001*filtrationLevel; - total += 0.001*filtrationLevel; - break; - default: - break; - } - } - } - tierChances[2] -= total; - } - else if (filtrationLevel > 2) { - double total = 0.01; - tierChances[3] += 0.01; - for (int i = 4; i <= 6; i++) { - if (tierChances[i] != 0) { - switch(i) { - case 4: - case 5: - tierChances[i] += 0.002*filtrationLevel; - total += 0.002*filtrationLevel; - break; - case 6: - tierChances[i] += 0.001*filtrationLevel; - total += 0.001*filtrationLevel; - break; - default: - break; - } - } - } - tierChances[2] -= total; - } - - //removes junk chance in accordance to treasureFinder Perk - double junkSubtract = Math.min(0.1,treasureFinderLevel*0.00005); - tierChances[0] = Math.max(tierChances[0]-junkSubtract,0); - for (int i = 1; i <= 6; i++) { - tierChances[i] += junkSubtract*junkToTreasurePortion[i]; - } - - /* Old "Lucky Catch" Perk - - //Adds treasure chance in accordance to luckyCatch perk - if (luckyCatchLevel > 0 && pAbilities[4] == -2) { - for (int i = 1; i <= 6; i++) { - tierChances[i] += 0.05 * junkToTreasurePortion[i]; - } - } - - */ - - /* - System.out.println(Double.toString(tierChances[0]) + " " + Double.toString(tierChances[1]) + " " + Double.toString(tierChances[2]) + " " + - Double.toString(tierChances[3]) + " " + Double.toString(tierChances[4]) + " " + Double.toString(tierChances[5]) + " " + - Double.toString(tierChances[6])); - - */ - - //Sets brackets for random number roll - double[] rollBrackets = {tierChances[0],0,0,0,0,0,0}; - for (int i = 1; i <= 6; i++) { - if (!superBaitOn) { - rollBrackets[i] = rollBrackets[i - 1] + tierChances[i]; - } - else { - rollBrackets[i] = rollBrackets[i - 1] + (2.0/4.0)*tierChances[i]; - } - } - - Material[] music_discs = {Material.MUSIC_DISC_11, Material.MUSIC_DISC_13, Material.MUSIC_DISC_BLOCKS, Material.MUSIC_DISC_CAT, - Material.MUSIC_DISC_CHIRP, Material.MUSIC_DISC_FAR, Material.MUSIC_DISC_MALL, Material.MUSIC_DISC_MELLOHI, - Material.MUSIC_DISC_STAL, Material.MUSIC_DISC_STRAD, Material.MUSIC_DISC_WAIT, Material.MUSIC_DISC_WARD}; - Material[] chainmail = {Material.CHAINMAIL_BOOTS,Material.CHAINMAIL_CHESTPLATE,Material.CHAINMAIL_HELMET,Material.CHAINMAIL_LEGGINGS}; - PsuedoEnchanting enchant = new PsuedoEnchanting(); - - if (roll < rollBrackets[0]) { //Junk Tier (-1) - double roll2 = rand.nextDouble(); - double[] naturalJunkBrackets = {0.12,0.144,0.264,0.384,0.504,0.564,0.624,0.744,0.864,0.878,1}; //Altered a bit due to rounding error - ItemStack junkRod = new ItemStack(Material.FISHING_ROD,1); - ItemMeta junkRodMeta = junkRod.getItemMeta(); - if (junkRodMeta instanceof Damageable) { - ((Damageable) junkRodMeta).setDamage(rand.nextInt(57)+7); - } - junkRod.setItemMeta(junkRodMeta); - - ItemStack junkBoots = new ItemStack(Material.LEATHER_BOOTS,1); - ItemMeta junkBootsMeta = junkBoots.getItemMeta(); - if (junkBoots instanceof Damageable) { - ((Damageable) junkBoots).setDamage(rand.nextInt(56)+7); - } - junkBoots.setItemMeta(junkBootsMeta); - ItemStack junkInk = new ItemStack(Material.INK_SAC,10); - - ItemStack[] junkItems = {new ItemStack(Material.BOWL,1),junkRod,new ItemStack(Material.LEATHER,1),junkBoots, - new ItemStack(Material.ROTTEN_FLESH,1),new ItemStack(Material.STICK,1),new ItemStack(Material.STRING,1), - new ItemStack(Material.GLASS_BOTTLE,1),new ItemStack(Material.BONE,1), junkInk, new ItemStack(Material.TRIPWIRE_HOOK,1)}; - for (int i=0; i < naturalJunkBrackets.length;i++) { - if (roll2 < naturalJunkBrackets[i]) { - increaseStats.changeEXP(skillName,(int) Math.round(expMultiplier*expMap.get("catchJunk"))); - return junkItems[i]; - } - } - } - else if (roll < rollBrackets[1]) { //Natural Tier (0) - double roll2 = rand.nextDouble(); - double[] naturalRareBrackets = {0.143,0.283,0.429,0.572,0.715,0.858,1}; //Altered a bit due to rounding error - ItemStack rareRod = new ItemStack(Material.FISHING_ROD,1); - rareRod = enchant.enchantItem(rareRod,rand.nextInt(9)+22,true); - ItemMeta rareRodItemMeta = rareRod.getItemMeta(); - if (rareRodItemMeta instanceof Damageable) { - ((Damageable) rareRodItemMeta).setDamage(rand.nextInt(10)+54); - } - rareRod.setItemMeta(rareRodItemMeta); - - ItemStack rareBow = new ItemStack(Material.BOW,1); - rareBow = enchant.enchantItem(rareBow,rand.nextInt(9)+22,true); - ItemMeta rareBowItemMeta = rareBow.getItemMeta(); - if (rareBowItemMeta instanceof Damageable) { - ((Damageable) rareBowItemMeta).setDamage(rand.nextInt(40)+343); - } - rareBow.setItemMeta(rareBowItemMeta); - - ItemStack enchantedBook = new ItemStack(Material.ENCHANTED_BOOK,1); - enchantedBook = enchant.enchantItem(enchantedBook,30,true); - - ItemStack[] items = {rareBow,rareRod,enchantedBook,new ItemStack(Material.NAME_TAG,1), new ItemStack(Material.NAUTILUS_SHELL,1),new ItemStack(Material.SADDLE,1), new ItemStack(Material.LILY_PAD,1)}; - for (int i=0; i < naturalRareBrackets.length;i++) { - if (roll2 < naturalRareBrackets[i]) { - increaseStats.changeEXP(skillName,(int) Math.round(expMultiplier*expMap.get("catchTier0"))); - return items[i]; - } - } - - - } - else if (roll < rollBrackets[2]) { //Common Tier (1) - double roll2 = rand.nextDouble(); - if (roll2 < 0.2) { - if (itemNames.get(0) == null) { - item.setType(Material.ENDER_PEARL); - if (hotRod > 0) { - item.setType(Material.FIRE_CHARGE); - item.setAmount(item.getAmount() * 3); - } - } - else { - if (hotRod > 0) { - item.setType(itemNames_hotRod.get(0)); - item.setAmount(dropAmounts_hotRod.get(0) + rand.nextInt(dropRandomness_hotRod.get(0)+1)); - } - else { - item.setType(itemNames.get(0)); - item.setAmount(dropAmounts.get(0) + rand.nextInt(dropRandomness.get(0)+1)); - } - } - } - else if (roll2 < 0.4) { - if (itemNames.get(1) == null) { - item.setType(Material.GHAST_TEAR); - if (hotRod > 0) { - item.setType(Material.BLAZE_POWDER); - } - } - else { - if (hotRod > 0) { - item.setType(itemNames_hotRod.get(1)); - item.setAmount(dropAmounts_hotRod.get(1) + rand.nextInt(dropRandomness_hotRod.get(1)+1)); - } - else { - item.setType(itemNames.get(1)); - item.setAmount(dropAmounts.get(1) + rand.nextInt(dropRandomness.get(1)+1)); - } - } - } - else if (roll2 < 0.6) { - if (itemNames.get(2) == null) { - item.setType(Material.GOLD_INGOT); - } - else { - item.setType(itemNames.get(2)); - item.setAmount(dropAmounts.get(2)+rand.nextInt(dropRandomness.get(2)+1)); - } - } - else if (roll2 < 0.8) { - if (itemNames.get(3) == null) { - item.setType(Material.IRON_INGOT); - } - else { - item.setType(itemNames.get(3)); - item.setAmount(dropAmounts.get(3)+rand.nextInt(dropRandomness.get(3)+1)); - } - } - else { - if (dropEnchantedItems.get(0)) { - item = getTieredLoot(1); - } - } - increaseStats.changeEXP(skillName,(int) Math.round(expMultiplier*expMap.get("catchTier1"))); - } - else if (roll < rollBrackets[3]) { //Uncommon Tier (2) - double roll2 = rand.nextDouble(); - if (roll2 < 0.2) { - if (itemNames.get(4) == null) { - item.setType(Material.WET_SPONGE); - if (hotRod > 0) { - item.setType(Material.SPONGE); - } - } - else { - if (hotRod > 0) { - item.setType(itemNames_hotRod.get(2)); - item.setAmount(dropAmounts_hotRod.get(2) + rand.nextInt(dropRandomness_hotRod.get(2)+1)); - } - else { - item.setType(itemNames.get(4)); - item.setAmount(dropAmounts.get(4) + rand.nextInt(dropRandomness.get(4)+1)); - } - } - } - else if (roll2 < 0.4) { - if (itemNames.get(5) == null) { - item.setType(Material.EMERALD); - } - else { - item.setType(itemNames.get(5)); - item.setAmount(dropAmounts.get(5)+rand.nextInt(dropRandomness.get(5)+1)); - } - } - else if (roll2 < 0.6) { - if (itemNames.get(6) == null) { - item.setType(Material.SLIME_BALL); - int roll3 = rand.nextInt(3)+1; - item.setAmount(roll3); - if (hotRod > 0) { - item.setType(Material.MAGMA_CREAM); - } - } - else { - if (hotRod > 0) { - item.setType(itemNames_hotRod.get(3)); - item.setAmount(dropAmounts_hotRod.get(3) + rand.nextInt(dropRandomness_hotRod.get(3)+1)); - } - else { - item.setType(itemNames.get(6)); - item.setAmount(dropAmounts.get(6) + rand.nextInt(dropRandomness.get(6)+1)); - } - } - } - else if (roll2 < 0.8) { - if (itemNames.get(7) == null) { - item.setType(Material.ENDER_PEARL); - int roll3 = rand.nextInt(4)+2; - item.setAmount(roll3); - if (hotRod > 0) { - item.setType(Material.FIRE_CHARGE); - item.setAmount(item.getAmount()*3); - } - } - else { - if (hotRod > 0) { - item.setType(itemNames_hotRod.get(4)); - item.setAmount(dropAmounts_hotRod.get(4) + rand.nextInt(dropRandomness_hotRod.get(4)+1)); - } - else { - item.setType(itemNames.get(7)); - item.setAmount(dropAmounts.get(7) + rand.nextInt(dropRandomness.get(7)+1)); - } - } - } - else { - if (dropEnchantedItems.get(1)) { - item = getTieredLoot(2); - } - } - increaseStats.changeEXP(skillName,(int) Math.round(expMultiplier*expMap.get("catchTier2"))); - } - else if (roll < rollBrackets[4]) { //Rare Tier (3) - double roll2 = rand.nextDouble(); - if (roll2 < 0.2) { - if (itemNames.get(8) == null) { - item.setType(music_discs[rand.nextInt(music_discs.length)]); - } - else { - item.setType(itemNames.get(8)); - item.setAmount(dropAmounts.get(8)+rand.nextInt(dropRandomness.get(8)+1)); - } - } - else if (roll2 < 0.4) { - if (itemNames.get(9) == null) { - item.setType(Material.SPECTRAL_ARROW); - int roll3 = rand.nextInt(11)+5; - item.setAmount(roll3); - } - else { - item.setType(itemNames.get(9)); - item.setAmount(dropAmounts.get(9)+rand.nextInt(dropRandomness.get(9)+1)); - } - } - else if (roll2 < 0.6) { - if (itemNames.get(10) == null) { - item.setType(chainmail[rand.nextInt(chainmail.length)]); - } - else { - item.setType(itemNames.get(10)); - item.setAmount(dropAmounts.get(10)+rand.nextInt(dropRandomness.get(10)+1)); - } - } - else if (roll2 < 0.8) { - if (itemNames.get(11) == null) { - item.setType(Material.TRIDENT); - } - else { - item.setType(itemNames.get(11)); - item.setAmount(dropAmounts.get(11)+rand.nextInt(dropRandomness.get(11)+1)); - } - } - else { - if (dropEnchantedItems.get(2)) { - item = getTieredLoot(3); - } - } - increaseStats.changeEXP(skillName,(int) Math.round(expMultiplier*expMap.get("catchTier3"))); - } - else if (roll < rollBrackets[5]) { //Very Rare Tier (4) - double roll2 = rand.nextDouble(); - if (roll2 < 0.233) { - if (itemNames.get(12) == null) { - item.setType(Material.DIAMOND); - } - else { - item.setType(itemNames.get(12)); - item.setAmount(dropAmounts.get(12)+rand.nextInt(dropRandomness.get(12)+1)); - } - } - else if (roll2 < 0.466) { - if (itemNames.get(13) == null) { - item.setType(Material.NAUTILUS_SHELL); - int roll3 = rand.nextInt(3)+2; - item.setAmount(roll3); - } - else { - item.setType(itemNames.get(13)); - item.setAmount(dropAmounts.get(13)+rand.nextInt(dropRandomness.get(13)+1)); - } - } - else if (roll2 < 0.7) { - if (itemNames.get(14) == null) { - item.setType(Material.EMERALD); - int roll3 = rand.nextInt(6)+3; - item.setAmount(roll3); - } - else { - item.setType(itemNames.get(14)); - item.setAmount(dropAmounts.get(14)+rand.nextInt(dropRandomness.get(14)+1)); - } - } - else if (roll2 < 0.85) { - if (itemNames.get(15) == null) { - item.setType(Material.CROSSBOW); - item = enchant.enchantItem(item,28+rand.nextInt(3),true); - } - else { - item.setType(itemNames.get(15)); - item.setAmount(dropAmounts.get(15)+rand.nextInt(dropRandomness.get(15)+1)); - } - } - else { - if (dropEnchantedItems.get(3)) { - item = getTieredLoot(4); - } - } - increaseStats.changeEXP(skillName,(int) Math.round(expMultiplier*expMap.get("catchTier4"))); - } - else if (roll < rollBrackets[6]) { //Legendary Tier (5) - double roll2 = rand.nextDouble(); - if (roll2 < 0.1) { - if (itemNames.get(16) == null) { - item.setType(Material.ELYTRA); - } - else { - item.setType(itemNames.get(16)); - item.setAmount(dropAmounts.get(16)+rand.nextInt(dropRandomness.get(16)+1)); - } - } - else if (roll2 < 0.4) { - if (itemNames.get(17) == null) { - item.setType(Material.HEART_OF_THE_SEA); - } - else { - item.setType(itemNames.get(17)); - item.setAmount(dropAmounts.get(17)+rand.nextInt(dropRandomness.get(17)+1)); - } - } - else if (roll2 < 0.6) { - if (itemNames.get(18) == null) { - item.setType(Material.TOTEM_OF_UNDYING); - } - else { - item.setType(itemNames.get(18)); - item.setAmount(dropAmounts.get(18)+rand.nextInt(dropRandomness.get(18)+1)); - } - } - else if (roll2 < 0.9) { - if (itemNames.get(19) == null) { - item.setType(Material.DIAMOND); - int roll3 = rand.nextInt(4)+2; - item.setAmount(roll3); - } - else { - item.setType(itemNames.get(19)); - item.setAmount(dropAmounts.get(19)+rand.nextInt(dropRandomness.get(19)+1)); - } - } - else { - if (dropEnchantedItems.get(4)) { - item = getTieredLoot(5); - } - } - increaseStats.changeEXP(skillName,(int) Math.round(expMultiplier*expMap.get("catchTier5"))); - } - else { //fish roll - double roll2 = rand.nextDouble(); - if (roll2 < .6) { - item.setType(Material.COD); - if (hotRod > 0) { - item.setType(Material.COOKED_COD); - } - } - else if (roll2 < 0.85) { - item.setType(Material.SALMON); - if (hotRod > 0) { - item.setType(Material.COOKED_SALMON); - } - } - else if (roll2 < 0.87) { - item.setType(Material.TROPICAL_FISH); - } - else { - item.setType(Material.PUFFERFISH); - } - double roll3 = rand.nextDouble(); - if (doubleFishLevel*0.0005 > roll3) { - item.setAmount(2); - } - increaseStats.changeEXP(skillName,(int) Math.round(expMultiplier*expMap.get("catchFish"))); - return item; - } - - return item; - - } - - public ItemStack getTieredLoot(int tier) { - Map lootChanceMap = new HashMap<>(); - Map possibleDrops = new HashMap<>(); - ItemStack drop = new ItemStack(Material.COD,1); - switch (tier) { - case 2: - lootChanceMap.put(Material.STONE_SHOVEL,5); - lootChanceMap.put(Material.STONE_SWORD,5); - lootChanceMap.put(Material.STONE_AXE,5); - lootChanceMap.put(Material.STONE_PICKAXE,5); - lootChanceMap.put(Material.LEATHER_BOOTS,5); - lootChanceMap.put(Material.LEATHER_LEGGINGS,5); - lootChanceMap.put(Material.LEATHER_CHESTPLATE,5); - lootChanceMap.put(Material.LEATHER_HELMET,5); - - lootChanceMap.put(Material.IRON_SHOVEL,3); - lootChanceMap.put(Material.IRON_SWORD,3); - lootChanceMap.put(Material.IRON_AXE,3); - lootChanceMap.put(Material.IRON_PICKAXE,3); - lootChanceMap.put(Material.IRON_BOOTS,3); - lootChanceMap.put(Material.IRON_LEGGINGS,2); - lootChanceMap.put(Material.IRON_CHESTPLATE,2); - lootChanceMap.put(Material.IRON_HELMET,3); - - lootChanceMap.put(Material.GOLDEN_SHOVEL,0); - lootChanceMap.put(Material.GOLDEN_SWORD,0); - lootChanceMap.put(Material.GOLDEN_AXE,0); - lootChanceMap.put(Material.GOLDEN_PICKAXE,0); - lootChanceMap.put(Material.GOLDEN_BOOTS,1); - lootChanceMap.put(Material.GOLDEN_LEGGINGS,1); - lootChanceMap.put(Material.GOLDEN_CHESTPLATE,1); - lootChanceMap.put(Material.GOLDEN_HELMET,1); - - lootChanceMap.put(Material.DIAMOND_SHOVEL,0); - lootChanceMap.put(Material.DIAMOND_SWORD,0); - lootChanceMap.put(Material.DIAMOND_AXE,0); - lootChanceMap.put(Material.DIAMOND_PICKAXE,0); - lootChanceMap.put(Material.DIAMOND_BOOTS,0); - lootChanceMap.put(Material.DIAMOND_LEGGINGS,0); - lootChanceMap.put(Material.DIAMOND_CHESTPLATE,0); - lootChanceMap.put(Material.DIAMOND_HELMET,0); - - case 3: - lootChanceMap.put(Material.STONE_SHOVEL,1); - lootChanceMap.put(Material.STONE_SWORD,1); - lootChanceMap.put(Material.STONE_AXE,1); - lootChanceMap.put(Material.STONE_PICKAXE,1); - lootChanceMap.put(Material.LEATHER_BOOTS,1); - lootChanceMap.put(Material.LEATHER_LEGGINGS,1); - lootChanceMap.put(Material.LEATHER_CHESTPLATE,1); - lootChanceMap.put(Material.LEATHER_HELMET,1); - - lootChanceMap.put(Material.IRON_SHOVEL,7); - lootChanceMap.put(Material.IRON_SWORD,7); - lootChanceMap.put(Material.IRON_AXE,7); - lootChanceMap.put(Material.IRON_PICKAXE,7); - lootChanceMap.put(Material.IRON_BOOTS,8); - lootChanceMap.put(Material.IRON_LEGGINGS,6); - lootChanceMap.put(Material.IRON_CHESTPLATE,6); - lootChanceMap.put(Material.IRON_HELMET,8); - - lootChanceMap.put(Material.GOLDEN_SHOVEL,2); - lootChanceMap.put(Material.GOLDEN_SWORD,2); - lootChanceMap.put(Material.GOLDEN_AXE,2); - lootChanceMap.put(Material.GOLDEN_PICKAXE,2); - lootChanceMap.put(Material.GOLDEN_BOOTS,4); - lootChanceMap.put(Material.GOLDEN_LEGGINGS,2); - lootChanceMap.put(Material.GOLDEN_CHESTPLATE,2); - lootChanceMap.put(Material.GOLDEN_HELMET,4); - - lootChanceMap.put(Material.DIAMOND_SHOVEL,0); - lootChanceMap.put(Material.DIAMOND_SWORD,0); - lootChanceMap.put(Material.DIAMOND_AXE,0); - lootChanceMap.put(Material.DIAMOND_PICKAXE,0); - lootChanceMap.put(Material.DIAMOND_BOOTS,0); - lootChanceMap.put(Material.DIAMOND_LEGGINGS,0); - lootChanceMap.put(Material.DIAMOND_CHESTPLATE,0); - lootChanceMap.put(Material.DIAMOND_HELMET,0); - break; - case 4: - lootChanceMap.put(Material.STONE_SHOVEL,0); - lootChanceMap.put(Material.STONE_SWORD,0); - lootChanceMap.put(Material.STONE_AXE,0); - lootChanceMap.put(Material.STONE_PICKAXE,0); - lootChanceMap.put(Material.LEATHER_BOOTS,0); - lootChanceMap.put(Material.LEATHER_LEGGINGS,0); - lootChanceMap.put(Material.LEATHER_CHESTPLATE,0); - lootChanceMap.put(Material.LEATHER_HELMET,0); - - lootChanceMap.put(Material.IRON_SHOVEL,10); - lootChanceMap.put(Material.IRON_SWORD,10); - lootChanceMap.put(Material.IRON_AXE,10); - lootChanceMap.put(Material.IRON_PICKAXE,10); - lootChanceMap.put(Material.IRON_BOOTS,10); - lootChanceMap.put(Material.IRON_LEGGINGS,9); - lootChanceMap.put(Material.IRON_CHESTPLATE,8); - lootChanceMap.put(Material.IRON_HELMET,10); - - lootChanceMap.put(Material.GOLDEN_SHOVEL,0); - lootChanceMap.put(Material.GOLDEN_SWORD,0); - lootChanceMap.put(Material.GOLDEN_AXE,0); - lootChanceMap.put(Material.GOLDEN_PICKAXE,0); - lootChanceMap.put(Material.GOLDEN_BOOTS,0); - lootChanceMap.put(Material.GOLDEN_LEGGINGS,0); - lootChanceMap.put(Material.GOLDEN_CHESTPLATE,0); - lootChanceMap.put(Material.GOLDEN_HELMET,0); - - lootChanceMap.put(Material.DIAMOND_SHOVEL,1); - lootChanceMap.put(Material.DIAMOND_SWORD,1); - lootChanceMap.put(Material.DIAMOND_AXE,1); - lootChanceMap.put(Material.DIAMOND_PICKAXE,1); - lootChanceMap.put(Material.DIAMOND_BOOTS,1); - lootChanceMap.put(Material.DIAMOND_LEGGINGS,0); - lootChanceMap.put(Material.DIAMOND_CHESTPLATE,0); - lootChanceMap.put(Material.DIAMOND_HELMET,1); - break; - case 5: - lootChanceMap.put(Material.STONE_SHOVEL,0); - lootChanceMap.put(Material.STONE_SWORD,0); - lootChanceMap.put(Material.STONE_AXE,0); - lootChanceMap.put(Material.STONE_PICKAXE,0); - lootChanceMap.put(Material.LEATHER_BOOTS,0); - lootChanceMap.put(Material.LEATHER_LEGGINGS,0); - lootChanceMap.put(Material.LEATHER_CHESTPLATE,0); - lootChanceMap.put(Material.LEATHER_HELMET,0); - - lootChanceMap.put(Material.IRON_SHOVEL,2); - lootChanceMap.put(Material.IRON_SWORD,2); - lootChanceMap.put(Material.IRON_AXE,2); - lootChanceMap.put(Material.IRON_PICKAXE,2); - lootChanceMap.put(Material.IRON_BOOTS,2); - lootChanceMap.put(Material.IRON_LEGGINGS,1); - lootChanceMap.put(Material.IRON_CHESTPLATE,1); - lootChanceMap.put(Material.IRON_HELMET,2); - - lootChanceMap.put(Material.GOLDEN_SHOVEL,0); - lootChanceMap.put(Material.GOLDEN_SWORD,0); - lootChanceMap.put(Material.GOLDEN_AXE,0); - lootChanceMap.put(Material.GOLDEN_PICKAXE,0); - lootChanceMap.put(Material.GOLDEN_BOOTS,0); - lootChanceMap.put(Material.GOLDEN_LEGGINGS,0); - lootChanceMap.put(Material.GOLDEN_CHESTPLATE,0); - lootChanceMap.put(Material.GOLDEN_HELMET,0); - - lootChanceMap.put(Material.DIAMOND_SHOVEL,10); - lootChanceMap.put(Material.DIAMOND_SWORD,10); - lootChanceMap.put(Material.DIAMOND_AXE,10); - lootChanceMap.put(Material.DIAMOND_PICKAXE,10); - lootChanceMap.put(Material.DIAMOND_BOOTS,10); - lootChanceMap.put(Material.DIAMOND_LEGGINGS,9); - lootChanceMap.put(Material.DIAMOND_CHESTPLATE,8); - lootChanceMap.put(Material.DIAMOND_HELMET,10); - break; - case 1: - default: - lootChanceMap.put(Material.STONE_SHOVEL,10); - lootChanceMap.put(Material.STONE_SWORD,10); - lootChanceMap.put(Material.STONE_AXE,10); - lootChanceMap.put(Material.STONE_PICKAXE,10); - lootChanceMap.put(Material.LEATHER_BOOTS,10); - lootChanceMap.put(Material.LEATHER_LEGGINGS,10); - lootChanceMap.put(Material.LEATHER_CHESTPLATE,10); - lootChanceMap.put(Material.LEATHER_HELMET,10); - - lootChanceMap.put(Material.IRON_SHOVEL,3); - lootChanceMap.put(Material.IRON_SWORD,3); - lootChanceMap.put(Material.IRON_AXE,3); - lootChanceMap.put(Material.IRON_PICKAXE,3); - lootChanceMap.put(Material.IRON_BOOTS,3); - lootChanceMap.put(Material.IRON_LEGGINGS,2); - lootChanceMap.put(Material.IRON_CHESTPLATE,2); - lootChanceMap.put(Material.IRON_HELMET,3); - - lootChanceMap.put(Material.GOLDEN_SHOVEL,0); - lootChanceMap.put(Material.GOLDEN_SWORD,0); - lootChanceMap.put(Material.GOLDEN_AXE,0); - lootChanceMap.put(Material.GOLDEN_PICKAXE,0); - lootChanceMap.put(Material.GOLDEN_BOOTS,0); - lootChanceMap.put(Material.GOLDEN_LEGGINGS,0); - lootChanceMap.put(Material.GOLDEN_CHESTPLATE,0); - lootChanceMap.put(Material.GOLDEN_HELMET,0); - - lootChanceMap.put(Material.DIAMOND_SHOVEL,0); - lootChanceMap.put(Material.DIAMOND_SWORD,0); - lootChanceMap.put(Material.DIAMOND_AXE,0); - lootChanceMap.put(Material.DIAMOND_PICKAXE,0); - lootChanceMap.put(Material.DIAMOND_BOOTS,0); - lootChanceMap.put(Material.DIAMOND_LEGGINGS,0); - lootChanceMap.put(Material.DIAMOND_CHESTPLATE,0); - lootChanceMap.put(Material.DIAMOND_HELMET,0); - break; - } - Material[] tools0 = {Material.DIAMOND_PICKAXE,Material.IRON_PICKAXE,Material.DIAMOND_SHOVEL,Material.IRON_SHOVEL,Material.DIAMOND_AXE,Material.IRON_AXE}; - List tools = Arrays.asList(tools0); - Material[] swords0 = {Material.DIAMOND_SWORD,Material.IRON_SWORD}; - List swords = Arrays.asList(swords0); - Material[] helmet0 = {Material.DIAMOND_HELMET,Material.IRON_HELMET}; - List helmet = Arrays.asList(helmet0); - Material[] chestplate0 = {Material.DIAMOND_CHESTPLATE,Material.IRON_CHESTPLATE}; - List chestplate = Arrays.asList(chestplate0); - Material[] leggings0 = {Material.DIAMOND_LEGGINGS,Material.IRON_LEGGINGS}; - List leggings = Arrays.asList(leggings0); - Material[] boots0 = {Material.DIAMOND_BOOTS,Material.IRON_BOOTS}; - List boots = Arrays.asList(boots0); - - int T = 0; - for (Material itemType : lootChanceMap.keySet()) { - int weight = lootChanceMap.get(itemType); - T+= weight; - if (weight > 0) { - possibleDrops.put(itemType,weight); - } - - } - int w = rand.nextInt(T); - for (Material itemType : possibleDrops.keySet()) { - w = w - possibleDrops.get(itemType); - if ( w < 0) { - drop.setType(itemType); - break; - } - } - - PsuedoEnchanting enchant = new PsuedoEnchanting(); - switch (tier) { - case 2: - drop = enchant.enchantItem(drop,rand.nextInt(10)+10,true); - break; - case 3: - drop = enchant.enchantItem(drop,rand.nextInt(10)+19,true); - break; - case 4: - drop = enchant.enchantItem(drop,rand.nextInt(3)+28,true); - break; - case 5: - if (tools.contains(drop)) { - int roll = rand.nextInt(2); - if (roll == 1) { - drop.addUnsafeEnchantment(Enchantment.DIG_SPEED, 5); - } - else { - drop.addUnsafeEnchantment(Enchantment.MENDING, 1); - } - drop = enchant.addEnchant(drop,30,true); - } - else if (swords.contains(drop)) { - int roll = rand.nextInt(5); - if (roll == 1) { - drop.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 5); - } - else if (roll == 2) { - drop.addUnsafeEnchantment(Enchantment.FIRE_ASPECT, 2); - } - else if (roll == 3) { - drop.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 3); - } - else if (roll == 4) { - drop.addUnsafeEnchantment(Enchantment.SWEEPING_EDGE, 3); - } - else { - drop.addUnsafeEnchantment(Enchantment.MENDING, 1); - } - drop = enchant.addEnchant(drop,30,true); - } - else if (boots.contains(drop)) { - int roll = rand.nextInt(5); - if (roll == 1) { - drop.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4); - } - else if (roll == 2) { - drop.addUnsafeEnchantment(Enchantment.FROST_WALKER, 2); - } - else if (roll == 3) { - drop.addUnsafeEnchantment(Enchantment.DEPTH_STRIDER, 2); - } - else if (roll == 4) { - drop.addUnsafeEnchantment(Enchantment.PROTECTION_FALL, 4); - } - else { - drop.addUnsafeEnchantment(Enchantment.MENDING, 1); - } - drop = enchant.addEnchant(drop,30,true); - } - else if (chestplate.contains(drop)) { - int roll = rand.nextInt(3); - if (roll == 1) { - drop.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4); - } - else if (roll == 2) { - drop.addUnsafeEnchantment(Enchantment.THORNS, 3); - } - else { - drop.addUnsafeEnchantment(Enchantment.MENDING, 1); - } - drop = enchant.addEnchant(drop,30,true); - } - else if (leggings.contains(drop)) { - int roll = rand.nextInt(2); - if (roll == 1) { - drop.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4); - } - else { - drop.addUnsafeEnchantment(Enchantment.MENDING, 1); - } - drop = enchant.addEnchant(drop,30,true); - - } - else if (helmet.contains(drop)) { - int roll = rand.nextInt(4); - if (roll == 1) { - drop.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4); - } - else if (roll == 2) { - drop.addUnsafeEnchantment(Enchantment.OXYGEN, 3); - } - else if (roll == 3) { - drop.addUnsafeEnchantment(Enchantment.WATER_WORKER, 1); - } - else { - drop.addUnsafeEnchantment(Enchantment.MENDING, 1); - } - drop = enchant.addEnchant(drop,30,true); - } - break; - case 1: - default: - drop = enchant.enchantItem(drop,rand.nextInt(3)+1,true); - break; - } - ItemMeta dropMeta = drop.getItemMeta(); - if (dropMeta instanceof Damageable) { - ((Damageable) dropMeta).setDamage((int) Math.round(drop.getType().getMaxDurability()*(0.85*rand.nextDouble()) + 1)); - } - drop.setItemMeta(dropMeta); - return drop; - } -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Global.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Global.java deleted file mode 100644 index fe080ec..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Global.java +++ /dev/null @@ -1,214 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.globalVariables.EntityGroups; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.Material; -import org.bukkit.entity.*; -import org.bukkit.inventory.ItemStack; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; - -import java.util.*; - -public class Global extends Skill{ - private static Map> playerSavedDrops = new HashMap<>(); - - Random rand = new Random(); //Random class Import - - private boolean runMethods; - - - - public Global(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get("global"); - } - - public double expBoost(String skillName) { - if (!runMethods) { - return 1.0; - } - double boost = 1.0; - Map> pStat = pStatClass.getPlayerData(); - String[] gatherer0 = {"digging","woodcutting","mining","farming","fishing"}; - String[] scholar0 = {"repair","agility","alchemy","smelting","enchanting"}; - String[] fighter0 = {"archery","beastMastery","swordsmanship","defense","axeMastery"}; - List gatherer = Arrays.asList(gatherer0); - List scholar = Arrays.asList(scholar0); - List fighter = Arrays.asList(fighter0); - if (gatherer.contains(skillName) && (int) pStat.get("global").get(2) > 0 ) { - boost = 1.2; - } - else if (scholar.contains(skillName) && (int) pStat.get("global").get(3) > 0 ) { - boost = 1.2; - } - else if (fighter.contains(skillName) && (int) pStat.get("global").get(4) > 0 ) { - boost = 1.2; - } - - return boost; - } - - public void skillTokenBoost(int type) { - if (!runMethods) { - return; - } - String[] gatherer0 = {"digging","woodcutting","mining","farming","fishing"}; - String[] scholar0 = {"repair","agility","alchemy","smelting","enchanting"}; - String[] fighter0 = {"archery","beastMastery","swordsmanship","defense","axeMastery"}; - List gatherer = Arrays.asList(gatherer0); - List scholar = Arrays.asList(scholar0); - List fighter = Arrays.asList(fighter0); - switch (type) { - case 5: - for (String skillName : gatherer) { - increaseStats.increaseTokens(skillName,"skill",1); - } - break; - case 6: - for (String skillName : scholar) { - increaseStats.increaseTokens(skillName,"skill",1); - } - break; - case 7: - for (String skillName : fighter) { - increaseStats.increaseTokens(skillName,"skill",1); - } - break; - default: - break; - } - } - - public void passiveTokenBoost() { //Old skill_3b perk - String[] abilities0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", "beastMastery", "swordsmanship", "defense", "axeMastery"}; - String[] nonAbilities0 = {"repair", "agility", "alchemy", "smelting", "enchanting"}; - List abilities = Arrays.asList(abilities0); - List nonAbilities = Arrays.asList(nonAbilities0); - for (String skillName : abilities) { - increaseStats.increaseTokens(skillName, "passive", 50); - } - for (String skillName : nonAbilities) { - increaseStats.changeStat(skillName, 4, 50); - } - } - - public void gainSoul(Entity entity) { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.getSouls")) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - List hostileMobs = entityGroups.getHostileMobs(); - EntityType entityType = entity.getType(); - if (hostileMobs.contains(entityType)) { - int amountGained = 1; - switch (entityType) { - case WITHER: - amountGained = 100; - break; - case ENDER_DRAGON: - amountGained = 200; - break; - default: - break; - } - UUID uuid = p.getUniqueId(); - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - int soulHarvestLevel = (int) pStatAll.get("global").get(9); - if (soulHarvestLevel > 0) { - int souls = (int) pStatAll.get("global").get(20); - pStatAll.get("global").set(20, souls + amountGained); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - } - } - } - - public void loseSouls(int amountLost) { - if (!runMethods) { - return; - } - UUID uuid = p.getUniqueId(); - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - int souls = (int) pStatAll.get("global").get(20); - pStatAll.get("global").set(20,souls-amountLost); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - } - - public void betterResurrectionDeath(List drops) { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(8) > 0) { - ArrayList savedDrops = new ArrayList<>(); - ItemGroups itemGroups = new ItemGroups(); - List valuableItems = itemGroups.getValuableItems(); - for (ItemStack drop : drops) { - if (drop.getEnchantments().size() != 0 || valuableItems.contains(drop.getType())) { - double randomNum = rand.nextDouble(); - int initialAmount = drop.getAmount(); - if (0.5 < randomNum) { - if (initialAmount == 1) { - ItemStack dropCopy = drop.clone(); - savedDrops.add(dropCopy); - drop.setAmount(0); - } - else if (initialAmount > 1) { - int savedAmount = (int) Math.round(initialAmount*randomNum); - ItemStack dropCopy = drop.clone(); - drop.setAmount(initialAmount-savedAmount); - dropCopy.setAmount(savedAmount); - savedDrops.add(dropCopy); - } - } - } - } - playerSavedDrops.put(p.getUniqueId(),savedDrops); - } - } - - public void betterResurrectionRespawn() { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(8) > 0 && playerSavedDrops.containsKey(p.getUniqueId())) { - ArrayList savedDrops = playerSavedDrops.get(p.getUniqueId()); - for (ItemStack savedDrop : savedDrops) { - p.getInventory().addItem(savedDrop); - } - playerSavedDrops.remove(p.getUniqueId()); - } - } - - public void avatar(){ - if (!runMethods) { - return; - } - PotionEffectType[] positiveEffects0 = {PotionEffectType.DOLPHINS_GRACE,PotionEffectType.LUCK,PotionEffectType.INVISIBILITY,PotionEffectType.NIGHT_VISION, - PotionEffectType.FIRE_RESISTANCE,PotionEffectType.WATER_BREATHING,PotionEffectType.SPEED,PotionEffectType.JUMP, - PotionEffectType.ABSORPTION,PotionEffectType.CONDUIT_POWER,PotionEffectType.DAMAGE_RESISTANCE,PotionEffectType.FAST_DIGGING, - PotionEffectType.HEAL,PotionEffectType.HEALTH_BOOST,PotionEffectType.INCREASE_DAMAGE,PotionEffectType.REGENERATION, - PotionEffectType.SATURATION}; - List positiveEffects = Arrays.asList(positiveEffects0); - for (PotionEffectType effect : positiveEffects) { - p.addPotionEffect(new PotionEffect(effect,10*20,0)); - } - } - - - - -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Mining.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Mining.java deleted file mode 100644 index 16d0cf9..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Mining.java +++ /dev/null @@ -1,506 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.gameTools.TrackItem; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.MinecraftVersion; -import mc.carlton.freerpg.serverInfo.PlacedBlocksManager; -import mc.carlton.freerpg.serverInfo.WorldGuardChecks; -import org.bukkit.*; -import org.bukkit.block.Block; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.entity.TNTPrimed; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.persistence.PersistentDataType; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.util.Vector; - -import java.time.Instant; -import java.util.*; - -public class Mining extends Skill{ - private String skillName = "mining"; - - Random rand = new Random(); //Random class Import - ArrayList veinOres = new ArrayList(); - - private boolean runMethods; - - public Mining(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - public void initiateAbility() { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.miningAbility")) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { - return; - } - Integer[] pTimers = timers.getPlayerCooldownTimes(); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[2] == -1) { - int cooldown = pTimers[2]; - if (cooldown < 1) { - int prepMessages = (int) pStatClass.getPlayerData().get("global").get(22); //Toggle for preparation messages - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("pickaxe") + "...<<<"); - } - int taskID = new BukkitRunnable() { - @Override - public void run() { - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " +lang.getString("pickaxe") + "<<<"); - } - try { - abilities.setPlayerAbility( skillName, -1); - } - catch (Exception e) { - - } - } - }.runTaskLater(plugin, 20 * 4).getTaskId(); - abilities.setPlayerAbility( skillName, taskID); - } else { - actionMessage.sendMessage(ChatColor.RED +lang.getString("berserkPick") + " " + lang.getString("cooldown") + ": " + ChatColor.WHITE + cooldown+ ChatColor.RED + "s"); - } - } - } - - public void enableAbility() { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - actionMessage.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("berserkPick") + " " + lang.getString("activated") + "<<<"); - int effLevel = itemInHand.getEnchantmentLevel(Enchantment.DIG_SPEED); - itemInHand.removeEnchantment(Enchantment.DIG_SPEED); - itemInHand.addUnsafeEnchantment(Enchantment.DIG_SPEED, effLevel + 5); - - //Mark the item - long unixTime = Instant.now().getEpochSecond(); - String keyName = p.getUniqueId().toString() + "-frpg-" + skillName + "-" + String.valueOf(unixTime); - NamespacedKey key = new NamespacedKey(plugin,keyName); - ItemMeta itemMeta = itemInHand.getItemMeta(); - itemMeta.getPersistentDataContainer().set(key, PersistentDataType.STRING,"frpg-mining"); - itemInHand.setItemMeta(itemMeta); - - - int durationLevel = (int) pStat.get(skillName).get(4); - double duration0 = Math.ceil(durationLevel * 0.4) + 40; - long duration = (long) duration0; - Bukkit.getScheduler().cancelTask(pAbilities[2]); - abilities.setPlayerAbility( skillName, -2); - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("berserkPick") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("berserkPick") + " " + lang.getString("ended") + "<<<"; - timers.abilityDurationTimer(skillName,duration,endMessage,coolDownEndMessage,key,itemInHand,effLevel,0); - } - - public void tntExplode(Block blockLit) { - if (!runMethods) { - return; - } - WorldGuardChecks BuildingCheck = new WorldGuardChecks(); - Map> pStat = pStatClass.getPlayerData(); - blockLit.setType(Material.AIR); - World world = p.getWorld(); - TNTPrimed tnt = world.spawn(blockLit.getLocation().add(0, 0.25, 0), TNTPrimed.class); - int blastRadiusLevel = (int) pStat.get(skillName).get(10); - double power0 = 4 + blastRadiusLevel * 0.5; - float power = (float) power0; - tnt.setFuseTicks(41); - Bukkit.getScheduler().runTaskLater(plugin, new Runnable() { - @Override - public void run() { - Location tntLoc = tnt.getLocation(); - int x0 = tntLoc.getBlockX(); - int y0 = tntLoc.getBlockY(); - int z0 = tntLoc.getBlockZ(); - boolean causeExplosion = true; - outerLoop: - for (int x = -5; x < 6; x++) { - for (int y = -5; y < 6; y++) { - for (int z = -5; z < 6; z++) { - Location newLoc = new Location(world,x+x0,y+y0,z+z0); - boolean canExplode = BuildingCheck.canExplode(p,newLoc); - boolean canBuild = BuildingCheck.canBuild(p,newLoc); - if (!canBuild || !canExplode) { - causeExplosion = false; - break outerLoop; - } - } - } - } - - if (causeExplosion) { - Map location_block = new HashMap<>(); - Map location_blockType = new HashMap<>(); - Block center = world.getBlockAt(tntLoc); - for (int x = -2; x < 3; x++) { - for (int y = -2; y < 3; y++) { - for (int z = -2; z < 3; z++) { - location_block.put(new org.bukkit.util.Vector(x,y,z),center.getRelative(x,y,z)); - location_blockType.put(new org.bukkit.util.Vector(x,y,z),center.getRelative(x,y,z).getType()); - } - } - } - tnt.getWorld().createExplosion(tntLoc, power, false, true); - tnt.remove(); - //Check blocks around the tnt, see if they even will explode - Bukkit.getScheduler().runTaskLater(plugin, new Runnable() { - @Override - public void run() { - int changedBlocks = 0; - for (Vector vector : location_block.keySet()) { - if (location_block.get(vector).getType() != location_blockType.get(vector)) { - changedBlocks+=1; - } - } - if (changedBlocks > 3) { - increaseStats.changeEXP(skillName, expMap.get("explodeTNT")); - int passive3_mining = (int) pStat.get(skillName).get(6); - double explosionDrop = passive3_mining * 0.0001; - for (int i = 0; i < (int) Math.floor(changedBlocks/2.0); i++) { - Mining miningClass = new Mining(p); - miningClass.miningTreasureDrop(explosionDrop, world, tntLoc); - } - } - } - }, 2L); - - } - } - }, 40L); - } - - public void miningTreasureDrop(double treasureChance, World world, Location loc) { - if (!runMethods) { - return; - } - double randomNum = rand.nextDouble(); - if (treasureChance > randomNum) { - double randomNum2 = rand.nextDouble(); - if (randomNum2 < 0.5) { - world.dropItemNaturally(loc, new ItemStack(Material.COAL,1)); - increaseStats.changeEXP(skillName,expMap.get("breakCoal_Ore")); - } - else if (randomNum2 < 0.7) { - world.dropItemNaturally(loc, new ItemStack(Material.IRON_ORE,1)); - increaseStats.changeEXP(skillName,expMap.get("breakIron_Ore")); - } - else if (randomNum2 < 0.8) { - world.dropItemNaturally(loc, new ItemStack(Material.GOLD_ORE,1)); - increaseStats.changeEXP(skillName,expMap.get("breakGold_Ore")); - } - else if (randomNum2 < 0.85) { - world.dropItemNaturally(loc, new ItemStack(Material.LAPIS_LAZULI,1)); - increaseStats.changeEXP(skillName,expMap.get("breakLapis_Ore")); - } - else if (randomNum2 < 0.90) { - world.dropItemNaturally(loc, new ItemStack(Material.EMERALD,1)); - increaseStats.changeEXP(skillName,expMap.get("breakEmerald_Ore")); - } - else if (randomNum2 < 0.99) { - world.dropItemNaturally(loc, new ItemStack(Material.REDSTONE,1)); - increaseStats.changeEXP(skillName,expMap.get("breakRedstone_Ore")); - } - else if (randomNum2 < 0.999){ - world.dropItemNaturally(loc, new ItemStack(Material.DIAMOND,1)); - increaseStats.changeEXP(skillName,expMap.get("breakDiamond_Ore")); - } - else { - MinecraftVersion minecraftVersion = new MinecraftVersion(); - if (minecraftVersion.getMinecraftVersion_Double() >= 1.16) { - world.dropItemNaturally(loc, new ItemStack(Material.NETHERITE_SCRAP, 1)); - increaseStats.changeEXP(skillName, expMap.get("breakAncient_Debris")); - } - else{ - world.dropItemNaturally(loc, new ItemStack(Material.DIAMOND,1)); - increaseStats.changeEXP(skillName,expMap.get("breakDiamond_Ore")); - } - } - } - } - - public void wastelessHaste(Material blockType) { - if (!runMethods) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - List ores = itemGroups.getOres(); - if (!(ores.contains(blockType))) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int hasteSeconds = 0; - int wastelessHasteLevel = (int) pStat.get(skillName).get(7); - switch(wastelessHasteLevel) { - case 1: - hasteSeconds = 2; - break; - case 2: - hasteSeconds = 5; - break; - case 3: - case 4: - case 5: - hasteSeconds = 10; - break; - default: - break; - } - if (p.hasPotionEffect(PotionEffectType.FAST_DIGGING)) { - if (p.getPotionEffect(PotionEffectType.FAST_DIGGING).getDuration() > 20*hasteSeconds + 20) { - return; - } - } - if (hasteSeconds > 1) { - switch (wastelessHasteLevel) { - case 4: //Half of haste is haste 2, second half is haste 1 - p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 10 * hasteSeconds, 1)); - int finalHasteSeconds = hasteSeconds; - new BukkitRunnable() { - @Override - public void run() { - if (p.isOnline()) { - p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 10 * finalHasteSeconds, 0)); - } - } - }.runTaskLater(plugin, 10 * hasteSeconds+2); - break; - case 5: //All of buff is haste 2 - p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 20 * hasteSeconds, 1)); - break; - default: //All of buff is haste 1 - p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 20 * hasteSeconds, 0)); - break; - } - } - } - - public void miningDoubleDrop(Block block, World world) { - ItemGroups itemGroups = new ItemGroups(); - List ores = itemGroups.getOres(); - if (!(ores.contains(block.getType()))) { - return; - } - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - - int doubleDropLevel = (int) pStat.get(skillName).get(5); - double chance = 0.0005*doubleDropLevel; - double randomNum = rand.nextDouble(); - if (chance > randomNum) { - for (ItemStack stack : block.getDrops(itemInHand)) { - dropItemNaturally(block.getLocation(), stack); - if ((int) pStat.get(skillName).get(13) > 0) { - dropItemNaturally(block.getLocation(), stack); - } - } - } - } - - public void preventLogoutTheft(int taskID_mining,ItemStack itemInHand_mining, NamespacedKey key,boolean isDisabling) { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[2] == -2) { - Bukkit.getScheduler().cancelTask(taskID_mining); - int effLevel = itemInHand_mining.getEnchantmentLevel(Enchantment.DIG_SPEED)-5; - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("berserkPick") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED+ChatColor.BOLD.toString() + ">>>" + lang.getString("magicForce"); - timers.endAbility(skillName,endMessage,coolDownEndMessage,key,itemInHand_mining,effLevel,0,isDisabling); - TrackItem trackItem = new TrackItem(); - trackItem.removeItemKey(itemInHand_mining,key); - } - } - - public void getVeinOres(Block b1,final int x1, final int y1, final int z1,Material oreType,int maxSize) { - if (!runMethods) { - return; - } - WorldGuardChecks BuildingCheck = new WorldGuardChecks(); - int searchCubeSize = 7; - if (veinOres.size() >= maxSize) { - return; - } - for (int x = -1; x <= 1; x++) { //These 3 for loops check a 3x3x3 cube around the block in question - for (int y = -1; y <= 1; y++) { - for (int z = -1; z <= 1; z++) { - if (x == 0 && y == 0 && z == 0) { //We can skip the 0,0,0 case because that is the block in question - continue; - } - Block b2 = b1.getRelative(x, y, z); - int blockX = b2.getX(); - int blockY = b2.getY(); - int blockZ = b2.getZ(); - if (blockX == x1 && blockY == y1 && blockZ == z1) { //Makes sure the original block is never added to veinOres - continue; - } - if (b2.getType().equals(oreType)) { - if (blockX > x1 + searchCubeSize || blockX < x1 - searchCubeSize || blockY > y1 + searchCubeSize || blockY < y1 - searchCubeSize || blockZ > z1 + searchCubeSize || blockZ < z1 - searchCubeSize) { - break; - } - else if (!(veinOres.contains(b2))) { - if (veinOres.size() >= maxSize) { - return; - } - if (BuildingCheck.canBuild(p, b2.getLocation())) { - veinOres.add(b2); - this.getVeinOres(b2, x1, y1, z1,oreType,maxSize); - } - } - } - } - } - } - } - - public void vanillaVeinMiner(Block initialBlock) { - ConfigLoad configLoad = new ConfigLoad(); - int maxBreakSize = configLoad.getVeinMinerMaxBreakSize(); - getVeinOres(initialBlock,initialBlock.getX(),initialBlock.getY(),initialBlock.getZ(),initialBlock.getType(),maxBreakSize); //Get Ores in Vein - int numOres = veinOres.size(); - World world = initialBlock.getWorld(); - damageTool(numOres,configLoad.getDurabilityModifiers().get("veinMiner")); - for (Block block : veinOres) { - Location blockLoc = block.getLocation(); - PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); - if (placedBlocksManager.isBlockTracked(block)) { - placedBlocksManager.removeBlock(block); - } - Collection drops = block.getDrops(itemInHand); - block.setType(Material.AIR); - for (ItemStack drop : drops) { - dropItemNaturally(blockLoc, drop); - } - } - - } - - public void veinMiner(Block initialBlock,Material blockType) { - if (!runMethods) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - HashSet veinMinerBlocks = itemGroups.getVeinMinerBlocks(); - if (!veinMinerBlocks.contains(blockType)) { - return; - } - World world = initialBlock.getWorld(); - Map> pStat = pStatClass.getPlayerData(); - int veinMinerLevel = (int)pStat.get(skillName).get(11); - if (veinMinerLevel < 1) { - return; - } - int veinMinerToggle = (int) pStat.get("global").get(18); - if (veinMinerToggle < 1) { - return; - } - HashSet ores = itemGroups.getVeinMinerBlocks(); - ConfigLoad configLoad = new ConfigLoad(); - int maxBreakSize = configLoad.getVeinMinerMaxBreakSize(); - veinOres.add(initialBlock); - getVeinOres(initialBlock,initialBlock.getX(),initialBlock.getY(),initialBlock.getZ(),initialBlock.getType(),maxBreakSize); //Get Ores in Vein - int numOres = veinOres.size(); - int doubleDropsLevel = (int)pStat.get(skillName).get(5); - double chance = 0.0005*doubleDropsLevel; - - damageTool(numOres,configLoad.getDurabilityModifiers().get("veinMiner")); - - boolean didRun = false; - Smelting smeltingClass = new Smelting(p); - for (Block block : veinOres) { - Location blockLoc = block.getLocation(); - //Checks if any of the blocks weren't natural - PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); - boolean natural = !placedBlocksManager.isBlockTracked(block); - if (!natural) { - placedBlocksManager.removeBlock(block); - numOres -= 1; - } - //Flame Pick Conditional - didRun = smeltingClass.flamePick(block,world,blockType,false); - //Not Flame Pick - if (!didRun && ores.contains(blockType)) { - Collection drops = block.getDrops(itemInHand); - block.setType(Material.AIR); - for (ItemStack drop : drops) { - dropItemNaturally(blockLoc, drop); - } - if (chance > rand.nextDouble() && natural) { - for (ItemStack drop : drops) { - dropItemNaturally(blockLoc, drop); - if ((int) pStat.get(skillName).get(13) > 0) { - dropItemNaturally(blockLoc, drop); - } - } - } - } - - } - //Give EXP - if (didRun) { - increaseStats.changeEXP(skillName,numOres*smeltingClass.getEXP(itemGroups.getSmeltableItemsMap().get(blockType))); - } - increaseStats.changeEXP(skillName,getEXP(blockType)*numOres); - } - - public int getEXP(Material brokenOre) { - if (!runMethods) { - return 0; - } - MinecraftVersion minecraftVersion = new MinecraftVersion(); - int EXP = 0; - if(brokenOre.equals(Material.COAL_ORE)) { - EXP = expMap.get("breakCoal_Ore"); - } - else if(brokenOre.equals(Material.NETHER_QUARTZ_ORE)) { - EXP = expMap.get("breakNether_Quartz_Ore"); - } - else if(brokenOre.equals(Material.IRON_ORE)) { - EXP = expMap.get("breakIron_Ore"); - } - else if(brokenOre.equals(Material.GOLD_ORE)) { - EXP = expMap.get("breakGold_Ore"); - } - else if(brokenOre.equals(Material.EMERALD_ORE)) { - EXP = expMap.get("breakEmerald_Ore"); - } - else if(brokenOre.equals(Material.REDSTONE_ORE)) { - EXP = expMap.get("breakRedstone_Ore"); - } - else if(brokenOre.equals(Material.LAPIS_ORE)) { - EXP = expMap.get("breakLapis_Ore"); - } - else if(brokenOre.equals(Material.DIAMOND_ORE)) { - EXP = expMap.get("breakDiamond_Ore"); - } - else if (minecraftVersion.getMinecraftVersion_Double() >= 1.16) { - if (brokenOre.equals(Material.ANCIENT_DEBRIS)) { - EXP = expMap.get("breakAncient_Debris"); - } else if (brokenOre.equals(Material.GILDED_BLACKSTONE)) { - EXP = expMap.get("breakGilded_Blackstone"); - } else if (brokenOre.equals(Material.NETHER_GOLD_ORE)) { - EXP = expMap.get("breakNether_Gold_Ore"); - } - } - return EXP; - } -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Repair.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Repair.java deleted file mode 100644 index 36f6835..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Repair.java +++ /dev/null @@ -1,637 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.MinecraftVersion; -import org.bukkit.*; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.Damageable; -import org.bukkit.inventory.meta.EnchantmentStorageMeta; -import org.bukkit.inventory.meta.ItemMeta; - -import java.util.*; - -public class Repair extends Skill{ - private String skillName = "repair"; - - Random rand = new Random(); //Random class Import - - private boolean runMethods; - - public Repair(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - - } - - public boolean repairItem() { - if (!runMethods) { - return false; - } - if (!p.hasPermission("freeRPG.canRepair")) { - return false; - } - if (!isItemVanilla(itemInHand)) { - ConfigLoad configLoad = new ConfigLoad(); - if (configLoad.isPreventUnsafeRepair()) { - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(ChatColor.RED +lang.getString("repairUnsafeEnchant")); - return false; - } - } - Material toolType = itemInHand.getType(); - boolean repaired = false; - boolean foundItem = true; - ItemGroups itemGroups = new ItemGroups(); - Map repairItems = itemGroups.getRepairItems(); - if (repairItems.containsKey(toolType)) { - Material mats = repairItems.get(itemInHand.getType()); - if (p.getInventory().contains(mats)) { - Map> pStat = pStatClass.getPlayerData(); - int repairLevel = (int) pStat.get(skillName).get(4); - int resourcefulLevel = (int) pStat.get(skillName).get(9); - double keepMatsChance = resourcefulLevel*0.1; - double repairBonus = repairLevel*0.002; - double repairPercentage = 0; - int expToGive = 0; - int expRepairMultiplier = 0; - repaired = true; - double a = 1.0; - MinecraftVersion minecraftVersion = new MinecraftVersion(); - double MCversion = minecraftVersion.getMinecraftVersion_Double(); - if (toolType.equals(Material.WOODEN_AXE)) { - repairPercentage = (0.9 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("wooden_baseEXP"); - expRepairMultiplier = expMap.get("wooden_EXPMultiplier"); - } - else if(toolType.equals(Material.WOODEN_HOE)) { - repairPercentage = (0.9 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("wooden_baseEXP"); - expRepairMultiplier = expMap.get("wooden_EXPMultiplier"); - } - else if(toolType.equals(Material.WOODEN_PICKAXE)) { - repairPercentage = (0.9 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("wooden_baseEXP"); - expRepairMultiplier = expMap.get("wooden_EXPMultiplier"); - } - else if(toolType.equals(Material.WOODEN_SHOVEL)) { - repairPercentage = (0.9 + repairBonus) / 1.0; - a = 1.0; - expToGive += expMap.get("wooden_baseEXP"); - expRepairMultiplier = expMap.get("wooden_EXPMultiplier"); - } - else if(toolType.equals(Material.WOODEN_SWORD)) { - repairPercentage = (0.9 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("wooden_baseEXP"); - expRepairMultiplier = expMap.get("wooden_EXPMultiplier"); - } - else if(toolType.equals(Material.LEATHER_HELMET)) { - repairPercentage = (0.9 + repairBonus) / 5.0; - a = 5.0; - expToGive += expMap.get("leather_baseEXP"); - expRepairMultiplier = expMap.get("leather_EXPMultiplier"); - } - else if(toolType.equals(Material.LEATHER_CHESTPLATE)) { - repairPercentage = (0.9 + repairBonus) / 8.0; - a = 8.0; - expToGive += expMap.get("leather_baseEXP"); - expRepairMultiplier = expMap.get("leather_EXPMultiplier"); - } - else if(toolType.equals(Material.LEATHER_LEGGINGS)) { - repairPercentage = (0.9 + repairBonus) / 7.0; - a = 7.0; - expToGive += expMap.get("leather_baseEXP"); - expRepairMultiplier = expMap.get("leather_EXPMultiplier"); - } - else if(toolType.equals(Material.LEATHER_BOOTS)) { - repairPercentage = (0.9 + repairBonus) / 4.0; - a = 4.0; - expToGive += expMap.get("leather_baseEXP"); - expRepairMultiplier = expMap.get("leather_EXPMultiplier"); - } - else if(toolType.equals(Material.STONE_AXE)) { - repairPercentage = (0.8 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("stone_baseEXP"); - expRepairMultiplier = expMap.get("stone_EXPMultiplier"); - } - else if(toolType.equals(Material.STONE_HOE)) { - repairPercentage = (0.8 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("stone_baseEXP"); - expRepairMultiplier = expMap.get("stone_EXPMultiplier"); - } - else if(toolType.equals(Material.STONE_PICKAXE)) { - repairPercentage = (0.8 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("stone_baseEXP"); - expRepairMultiplier = expMap.get("stone_EXPMultiplier"); - } - else if(toolType.equals(Material.STONE_SHOVEL)) { - repairPercentage = (0.8 + repairBonus) / 1.0; - a = 1.0; - expToGive += expMap.get("stone_baseEXP"); - expRepairMultiplier = expMap.get("stone_EXPMultiplier"); - } - else if(toolType.equals(Material.STONE_SWORD)) { - repairPercentage = (0.8 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("stone_baseEXP"); - expRepairMultiplier = expMap.get("stone_EXPMultiplier"); - } - else if(toolType.equals(Material.CHAINMAIL_HELMET)) { - repairPercentage = (0.11 + repairBonus) / 5.0; - a = 5.0; - expToGive += expMap.get("chainmail_baseEXP"); - expRepairMultiplier = expMap.get("chainmail_EXPMultiplier"); - } - else if(toolType.equals(Material.CHAINMAIL_CHESTPLATE)) { - repairPercentage = (0.11 + repairBonus) / 8.0; - a = 8.0; - expToGive += expMap.get("chainmail_baseEXP"); - expRepairMultiplier = expMap.get("chainmail_EXPMultiplier"); - } - else if(toolType.equals(Material.CHAINMAIL_LEGGINGS)) { - repairPercentage = (0.11 + repairBonus) / 11.0; - a = 11.0; - expToGive += expMap.get("chainmail_baseEXP"); - expRepairMultiplier = expMap.get("chainmail_EXPMultiplier"); - } - else if(toolType.equals(Material.CHAINMAIL_BOOTS)) { - repairPercentage = (0.11 + repairBonus) / 4.0; - a = 4.0; - expToGive += expMap.get("chainmail_baseEXP"); - expRepairMultiplier = expMap.get("chainmail_EXPMultiplier"); - } - else if(toolType.equals(Material.GOLDEN_AXE)) { - repairPercentage = (0.7 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("gold_baseEXP"); - expRepairMultiplier = expMap.get("gold_EXPMultiplier"); - } - else if(toolType.equals(Material.GOLDEN_HOE)) { - repairPercentage = (0.7 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("gold_baseEXP"); - expRepairMultiplier = expMap.get("gold_EXPMultiplier"); - } - else if(toolType.equals(Material.GOLDEN_PICKAXE)) { - repairPercentage = (0.7 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("gold_baseEXP"); - expRepairMultiplier = expMap.get("gold_EXPMultiplier"); - } - else if(toolType.equals(Material.GOLDEN_SHOVEL)) { - repairPercentage = (0.7 + repairBonus) / 1.0; - a = 1.0; - expToGive += expMap.get("gold_baseEXP"); - expRepairMultiplier = expMap.get("gold_EXPMultiplier"); - } - else if(toolType.equals(Material.GOLDEN_SWORD)) { - repairPercentage = (0.7 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("gold_baseEXP"); - expRepairMultiplier = expMap.get("gold_EXPMultiplier"); - } - else if(toolType.equals(Material.GOLDEN_HELMET)) { - repairPercentage = (0.7 + repairBonus) / 5.0; - a = 5.0; - expToGive += expMap.get("gold_baseEXP"); - expRepairMultiplier = expMap.get("gold_EXPMultiplier"); - } - else if(toolType.equals(Material.GOLDEN_CHESTPLATE)) { - repairPercentage = (0.7 + repairBonus) / 8.0; - a = 8.0; - expToGive += expMap.get("gold_baseEXP"); - expRepairMultiplier = expMap.get("gold_EXPMultiplier"); - } - else if(toolType.equals(Material.GOLDEN_LEGGINGS)) { - repairPercentage = (0.7 + repairBonus) / 7.0; - a = 7.0; - expToGive += expMap.get("gold_baseEXP"); - expRepairMultiplier = expMap.get("gold_EXPMultiplier"); - } - else if(toolType.equals(Material.GOLDEN_BOOTS)) { - repairPercentage = (0.7 + repairBonus) / 4.0; - a = 4.0; - expToGive += expMap.get("gold_baseEXP"); - expRepairMultiplier = expMap.get("gold_EXPMultiplier"); - } - else if(toolType.equals(Material.IRON_AXE)) { - repairPercentage = (0.5 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("iron_baseEXP"); - expRepairMultiplier = expMap.get("iron_EXPMultiplier"); - } - else if(toolType.equals(Material.IRON_HOE)) { - repairPercentage = (0.5 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("iron_baseEXP"); - expRepairMultiplier = expMap.get("iron_EXPMultiplier"); - } - else if(toolType.equals(Material.IRON_PICKAXE)) { - repairPercentage = (0.5 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("iron_baseEXP"); - expRepairMultiplier = expMap.get("iron_EXPMultiplier"); - } - else if(toolType.equals(Material.IRON_SHOVEL)) { - repairPercentage = (0.5 + repairBonus) / 1.0; - a = 1.0; - expToGive += expMap.get("iron_baseEXP"); - expRepairMultiplier = expMap.get("iron_EXPMultiplier"); - } - else if(toolType.equals(Material.IRON_SWORD)) { - repairPercentage = (0.5 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("iron_baseEXP"); - expRepairMultiplier = expMap.get("iron_EXPMultiplier"); - } - else if(toolType.equals(Material.IRON_HELMET)) { - repairPercentage = (0.5 + repairBonus) / 5.0; - a = 5.0; - expToGive += expMap.get("iron_baseEXP"); - expRepairMultiplier = expMap.get("iron_EXPMultiplier"); - } - else if(toolType.equals(Material.IRON_CHESTPLATE)) { - repairPercentage = (0.5 + repairBonus) / 8.0; - a = 8.0; - expToGive += expMap.get("iron_baseEXP"); - expRepairMultiplier = expMap.get("iron_EXPMultiplier"); - } - else if(toolType.equals(Material.IRON_LEGGINGS)) { - repairPercentage = (0.5 + repairBonus) / 7.0; - a = 7.0; - expToGive += expMap.get("iron_baseEXP"); - expRepairMultiplier = expMap.get("iron_EXPMultiplier"); - } - else if(toolType.equals(Material.IRON_BOOTS)) { - repairPercentage = (0.5 + repairBonus) / 4.0; - a = 4.0; - expToGive += expMap.get("iron_baseEXP"); - expRepairMultiplier = expMap.get("iron_EXPMultiplier"); - } - else if(toolType.equals(Material.DIAMOND_AXE)) { - repairPercentage = (0.00 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("diamond_baseEXP"); - expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); - } - else if(toolType.equals(Material.DIAMOND_HOE)) { - repairPercentage = (0.00 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("diamond_baseEXP"); - expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); - } - else if(toolType.equals(Material.DIAMOND_PICKAXE)) { - repairPercentage = (0.00 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("diamond_baseEXP"); - expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); - } - else if(toolType.equals(Material.DIAMOND_SHOVEL)) { - repairPercentage = (0.00 + repairBonus) / 1.0; - a = 1.0; - expToGive += expMap.get("diamond_baseEXP"); - expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); - } - else if(toolType.equals(Material.DIAMOND_SWORD)) { - repairPercentage = (0.00 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("diamond_baseEXP"); - expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); - } - else if(toolType.equals(Material.DIAMOND_HELMET)) { - repairPercentage = (0.00 + repairBonus) / 5.0; - a = 5.0; - expToGive += expMap.get("diamond_baseEXP"); - expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); - } - else if(toolType.equals(Material.DIAMOND_CHESTPLATE)) { - repairPercentage = (0.00 + repairBonus) / 8.0; - a = 8.0; - expToGive += expMap.get("diamond_baseEXP"); - expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); - } - else if(toolType.equals(Material.DIAMOND_LEGGINGS)) { - repairPercentage = (0.00 + repairBonus) / 7.0; - a = 7.0; - expToGive += expMap.get("diamond_baseEXP"); - expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); - } - else if(toolType.equals(Material.DIAMOND_BOOTS)) { - repairPercentage = (0.0 + repairBonus) / 4.0; - a = 4.0; - expToGive += expMap.get("diamond_baseEXP"); - expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); - } - else if(toolType.equals(Material.SHEARS)) { - repairPercentage = (0.5 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("shears_baseEXP"); - expRepairMultiplier = expMap.get("shear_expMultiplier"); - } - else if(toolType.equals(Material.FISHING_ROD)) { - repairPercentage = (0.5 + repairBonus) / 2.0; - a = 2.0; - expToGive += expMap.get("fishingRod_baseEXP"); - expRepairMultiplier = expMap.get("fishingRod_expMultiplier"); - } - else if(toolType.equals(Material.CARROT_ON_A_STICK)) { - repairPercentage = (0.8 + repairBonus) / 1.0; - a = 1.0; - expToGive += expMap.get("carrotOnAStick_baseEXP"); - expRepairMultiplier = expMap.get("carrotOnAStick_expMultiplier"); - } - else if(toolType.equals(Material.FLINT_AND_STEEL)) { - repairPercentage = (0.8 + repairBonus) / 1.0; - a = 1.0; - expToGive += expMap.get("flintAndSteel_baseEXP"); - expRepairMultiplier = expMap.get("flintAndSteel_expMultiplier"); - } - else if(toolType.equals(Material.BOW)) { - repairPercentage = (0.8 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("bow_baseEXP"); - expRepairMultiplier = expMap.get("bow_expMultiplier"); - } - else if(toolType.equals(Material.TRIDENT)) { - repairPercentage = (0.8 + repairBonus) / 3.0; - a = 1.0; - expToGive += expMap.get("trident_baseEXP"); - expRepairMultiplier = expMap.get("trident_expMultiplier"); - } - else if(toolType.equals(Material.ELYTRA)) { - repairPercentage = (0.8 + repairBonus) / 3.0; - a = 1.0; - expToGive += expMap.get("elytra_baseEXP"); - expRepairMultiplier = expMap.get("elytra_expMultiplier"); - } - else if(toolType.equals(Material.SHIELD)) { - repairPercentage = (0.8 + repairBonus) / 3.0; - a = 1.0; - expToGive += expMap.get("shield_baseEXP"); - expRepairMultiplier = expMap.get("shield_expMultiplier"); - } - else if(toolType.equals(Material.CROSSBOW)) { - repairPercentage = (0.8 + repairBonus) / 3.0; - a = 3.0; - expToGive += expMap.get("crossbow_baseEXP"); - expRepairMultiplier = expMap.get("crossbow_expMultiplier"); - } - else if(MCversion >= 1.16) { - if (toolType.equals(Material.NETHERITE_AXE)) { - repairPercentage = (0.00 + repairBonus * 0.5) / 3.0; - a = 4.0; - expToGive += expMap.get("netherite_baseEXP"); - expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); - } else if (toolType.equals(Material.NETHERITE_HOE)) { - repairPercentage = (0.00 + repairBonus * 0.5) / 2.0; - a = 4.0; - expToGive += expMap.get("netherite_baseEXP"); - expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); - } else if (toolType.equals(Material.NETHERITE_PICKAXE)) { - repairPercentage = (0.00 + repairBonus * 0.5) / 3.0; - a = 4.0; - expToGive += expMap.get("netherite_baseEXP"); - expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); - } else if (toolType.equals(Material.NETHERITE_SHOVEL)) { - repairPercentage = (0.00 + repairBonus * 0.5) / 1.0; - a = 4.0; - expToGive += expMap.get("netherite_baseEXP"); - expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); - } else if (toolType.equals(Material.NETHERITE_SWORD)) { - repairPercentage = (0.00 + repairBonus * 0.5) / 2.0; - a = 4.0; - expToGive += expMap.get("netherite_baseEXP"); - expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); - } else if (toolType.equals(Material.NETHERITE_HELMET)) { - repairPercentage = (0.00 + repairBonus * 0.5) / 5.0; - a = 4.0; - expToGive += expMap.get("netherite_baseEXP"); - expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); - } else if (toolType.equals(Material.NETHERITE_CHESTPLATE)) { - repairPercentage = (0.00 + repairBonus * 0.5) / 8.0; - a = 4.0; - expToGive += expMap.get("netherite_baseEXP"); - expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); - } else if (toolType.equals(Material.NETHERITE_LEGGINGS)) { - repairPercentage = (0.00 + repairBonus * 0.5) / 7.0; - a = 4.0; - expToGive += expMap.get("netherite_baseEXP"); - expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); - } else if (toolType.equals(Material.NETHERITE_BOOTS)) { - repairPercentage = (0.0 + repairBonus * 0.5) / 4.0; - a = 4.0; - expToGive += expMap.get("netherite_baseEXP"); - expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); - } - } - ItemMeta itemInHandMeta = itemInHand.getItemMeta(); - if (repairPercentage*a < 0.2) { - actionMessage.sendMessage(ChatColor.RED + lang.getString("repairFail0")); - repaired = false; - } - else { - if (itemInHandMeta instanceof Damageable) { - int currentDamage = ((Damageable) itemInHandMeta).getDamage(); - if (currentDamage == 0) { - return false; - } - int mats_index = p.getInventory().first(mats); - int mats_amount = p.getInventory().getItem(mats_index).getAmount(); - if (keepMatsChance < rand.nextDouble()) { - p.getInventory().getItem(mats_index).setAmount(mats_amount - 1); - } - int maxDamage = itemInHand.getType().getMaxDurability(); - int repairedDamage = (int) Math.round(maxDamage*repairPercentage); - int expDamage = (int) a*Math.min(repairedDamage,currentDamage); - ((Damageable) itemInHandMeta).setDamage(Math.max(0,currentDamage-repairedDamage)); - itemInHand.setItemMeta(itemInHandMeta); - int enchantEXP = magicRepair(); - increaseStats.changeEXP(skillName,enchantEXP+expToGive+(expRepairMultiplier*expDamage)); - p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE,1); - } - } - } - } - return repaired; - } - - public void salvaging() { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.canSalvage")) { - return; - } - if (!isItemVanilla(itemInHand)) { - ConfigLoad configLoad = new ConfigLoad(); - if (configLoad.isPreventUnsafeSalvage()) { - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(ChatColor.RED +lang.getString("salvageUnsafeEnchant")); - return; - } - } - Map> pStat = pStatClass.getPlayerData(); - int salvageLevel = (int) pStat.get(skillName).get(7); - ItemGroups itemGroups = new ItemGroups(); - Map repairItemsAmount = itemGroups.getRepairItemsAmount(); - if (repairItemsAmount.containsKey(itemInHand.getType())) { - p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE,1); - ItemMeta itemInHandMeta = itemInHand.getItemMeta(); - Material itemType = itemInHand.getType(); - int amount = repairItemsAmount.get(itemType); - Map repairItems = itemGroups.getRepairItems(); - Material type = repairItems.get(itemType); - p.getInventory().getItemInMainHand().setAmount(0); - double multiplier = 0.1*salvageLevel + (1 - 0.1*salvageLevel)*rand.nextDouble(); - double currentDamage = ((Damageable) itemInHandMeta).getDamage(); - double maxDamage = itemType.getMaxDurability(); - double percentDurability = (1 - (currentDamage/maxDamage)); - MinecraftVersion minecraftVersion = new MinecraftVersion(); - double mcVersion = minecraftVersion.getMinecraftVersion_Double(); - - double amountToReturn_pre = amount*percentDurability*multiplier; - double roundUpChance = (amountToReturn_pre-Math.floor(amountToReturn_pre)); - int amountToReturn = (int) Math.floor(amountToReturn_pre); - if (roundUpChance > rand.nextDouble()) { //Round up if a random number is bigger than the excess - amountToReturn += 1; - } - if (amountToReturn == 0){ - if (amountToReturn_pre > rand.nextDouble()) { - p.getInventory().addItem(new ItemStack(type,1)); - } - else { - actionMessage.sendMessage(ChatColor.RED + lang.getString("repairFail1")); - } - } - else { - if (!type.equals(Material.NETHERITE_SCRAP)) { - p.getInventory().addItem(new ItemStack(type, amountToReturn)); - } - else { - double multiplier1 = 0.1*salvageLevel + (1 - 0.1*salvageLevel)*rand.nextDouble(); - double multiplier2 = 0.1*salvageLevel + (1 - 0.1*salvageLevel)*rand.nextDouble(); - double amountToReturnGold_pre = 4*percentDurability*multiplier1; - int amountToReturnGold = (int) Math.round(amountToReturnGold_pre); - double amountToReturnScrap_pre = 4*percentDurability*multiplier2; - int amountToReturnScrap = (int) Math.round(amountToReturnScrap_pre); - p.getInventory().addItem(new ItemStack(Material.DIAMOND, amountToReturn)); - if (p.getInventory().firstEmpty() == -1) { - World world = p.getWorld(); - world.dropItemNaturally(p.getLocation().add(0,0.5,0),new ItemStack(Material.GOLD_INGOT,amountToReturnGold)); - world.dropItemNaturally(p.getLocation().add(0,0.5,0),new ItemStack(Material.NETHERITE_SCRAP,amountToReturnScrap)); - } - else { - p.getInventory().addItem(new ItemStack(Material.GOLD_INGOT,amountToReturnGold)); - if (p.getInventory().firstEmpty() == -1) { - World world = p.getWorld(); - world.dropItemNaturally(p.getLocation().add(0,0.5,0),new ItemStack(Material.NETHERITE_SCRAP,amountToReturnScrap)); - } - else { - p.getInventory().addItem(new ItemStack(Material.NETHERITE_SCRAP,amountToReturnScrap)); - } - } - } - } - if (salvageLevel >= 5) { - if (itemInHandMeta.hasEnchants()) { - ItemStack enchantedBook = new ItemStack(Material.ENCHANTED_BOOK,1); - EnchantmentStorageMeta meta = ((EnchantmentStorageMeta) enchantedBook.getItemMeta()); - Map enchants = itemInHandMeta.getEnchants(); - for (Enchantment enchant : enchants.keySet()) { - meta.addStoredEnchant(enchant,enchants.get(enchant),true); - } - enchantedBook.setItemMeta(meta); - if (p.getInventory().firstEmpty() == -1) { - World world = p.getWorld(); - world.dropItemNaturally(p.getLocation().add(0,0.5,0),enchantedBook); - } - else { - p.getInventory().addItem(enchantedBook); - } - } - } - if (type.equals(Material.STICK)) { - increaseStats.changeEXP(skillName, expMap.get("salvageStick")); - } - else if (type.equals(Material.LEATHER)) { - increaseStats.changeEXP(skillName, expMap.get("salvageLeather")); - } - else if (type.equals(Material.COBBLESTONE)) { - increaseStats.changeEXP(skillName, expMap.get("salvageCobblestone")); - } - else if (type.equals(Material.IRON_INGOT)) { - increaseStats.changeEXP(skillName, expMap.get("salvageIron_Ingot")); - } - else if (type.equals(Material.GOLD_INGOT)) { - increaseStats.changeEXP(skillName, expMap.get("salvageGold_Ingot")); - } - else if (type.equals(Material.STRING)) { - increaseStats.changeEXP(skillName, expMap.get("salvageString")); - } - else if (type.equals(Material.PHANTOM_MEMBRANE)) { - increaseStats.changeEXP(skillName, expMap.get("salvagePhantom_Membrane")); - } - else if (type.equals(Material.DIAMOND)) { - increaseStats.changeEXP(skillName, expMap.get("salvageDiamond")); - } - else if(mcVersion >= 1.16) { - if (type.equals(Material.NETHERITE_SCRAP)) { - increaseStats.changeEXP(skillName, expMap.get("salvageNetherite_Ingot")); - } - } - } - } - - public int magicRepair() { - if (!runMethods) { - return 0; - } - if (itemInHand.getEnchantments().size() == 0) { - return 0; - } - Map> pStat = pStatClass.getPlayerData(); - double sucessChance = 0; - if ((int) pStat.get(skillName).get(13) > 0) { - sucessChance = 1; - } - if (sucessChance < rand.nextDouble()) { - actionMessage.sendMessage(ChatColor.RED + lang.getString("repairFail2")); - Map enchantments = itemInHand.getEnchantments(); - for (Enchantment enchantment : enchantments.keySet()) { - int level = enchantments.get(enchantment); - itemInHand.removeEnchantment(enchantment); - if (level > 1) { - itemInHand.addEnchantment(enchantment,level-1); - } - } - } - else { - return 1000; - } - return 0; - } - - public boolean isItemVanilla(ItemStack itemStack) { - ItemMeta itemMeta = itemStack.getItemMeta(); - Map itemEnchants = itemMeta.getEnchants(); - try {//Try to create a safe item with those enchants, if it fails, we know the item is not vanilla - new ItemStack(itemStack.getType(),itemStack.getAmount()).addEnchantments(itemEnchants); - } - catch (IllegalArgumentException e) { - return false; - } - return true; - } -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Skill.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Skill.java deleted file mode 100644 index 59ffa63..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Skill.java +++ /dev/null @@ -1,115 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.ActionBarMessages; -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.playerInfo.AbilityTimers; -import mc.carlton.freerpg.playerInfo.AbilityTracker; -import mc.carlton.freerpg.playerInfo.ChangeStats; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import org.bukkit.Effect; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.World; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.Damageable; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.plugin.Plugin; - -import java.util.Map; -import java.util.Random; - - -public class Skill { - Plugin plugin; - protected Player p; - protected String pName; - protected ItemStack itemInHand; - Map expMap; - ChangeStats increaseStats; //Changing Stats - - AbilityTracker abilities; //Abilities class - // GET ABILITY STATUSES LIKE THIS: Integer[] pAbilities = abilities.getPlayerAbilities(p); - - AbilityTimers timers; //Ability Timers class - //GET TIMERS LIKE THIS: Integer[] pTimers = timers.getPlayerTimers(p); - - PlayerStats pStatClass; - //GET PLAYER STATS LIKE THIS: Map> pStat = pStatClass.getPlayerData(p); - - ActionBarMessages actionMessage; - LanguageSelector lang; - - - public Skill(Player p) { - this.p = p; - this.pName = p.getDisplayName(); - this.itemInHand = p.getInventory().getItemInMainHand(); - this.increaseStats = new ChangeStats(p); - this.abilities = new AbilityTracker(p); - this.timers = new AbilityTimers(p); - this.pStatClass= new PlayerStats(p); - this.actionMessage = new ActionBarMessages(p); - this.lang = new LanguageSelector(p); - this.plugin = FreeRPG.getPlugin(FreeRPG.class); - } - - public void dropItemNaturally(Location location, ItemStack item) { //Won't try to drop air, like world.dropItemNaturally does - if (item != null){ - if (!item.getType().equals(Material.AIR) && !item.getType().equals(Material.CAVE_AIR) && !item.getType().equals(Material.VOID_AIR)) { - World world = location.getWorld(); - world.dropItemNaturally(location,item); - } - } - } - - public void damageTool() { //Overspecified because I'm lazy - damageTool(1,1.0); - } - public void damageTool(double modifier) { - damageTool(1,modifier); - } - public void damageTool(int damage,double modifier) { - if (itemInHand.getItemMeta().isUnbreakable()) { - return; - } - ItemMeta toolMeta = itemInHand.getItemMeta(); - - //Unnbreaking checks - int unbreakingLevel = 0; - if (toolMeta.hasEnchant(Enchantment.DURABILITY)) { - unbreakingLevel = toolMeta.getEnchantLevel(Enchantment.DURABILITY); - } - if (unbreakingLevel > 0) { - double chanceToSaveDurability = 1.0 - (1.0/(unbreakingLevel+1)); - for (int i = 0; i < damage; i++) { //Roll an unbreaking check for each damage point dealt - Random rand = new Random(); - if (rand.nextDouble() < chanceToSaveDurability) { //Reduce damage dealt - damage = damage - 1; - } - } - } - - //Damage Modifier - if (modifier != 1.0) { //Randomly sets damage so the expected value of the durability taken = damage*modifier - double damageDouble = damage * modifier; - damage = (int) Math.floor(damageDouble); //Round damage down - double excessDamage = damageDouble-damage; - Random rand = new Random(); - if (rand.nextDouble() < excessDamage) { //Round up if a random number is less than the excessDamage - damage+=1; - } - } - - if (toolMeta instanceof Damageable) { - ((Damageable) toolMeta).setDamage(((Damageable) toolMeta).getDamage()+damage); - itemInHand.setItemMeta(toolMeta); - if (((Damageable) toolMeta).getDamage() > itemInHand.getType().getMaxDurability()) { - itemInHand.setAmount(0); - p.getWorld().playEffect(p.getLocation(), Effect.STEP_SOUND, 1); - } - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Smelting.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Smelting.java deleted file mode 100644 index 4160244..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Smelting.java +++ /dev/null @@ -1,378 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.gameTools.FurnaceUserTracker; -import mc.carlton.freerpg.globalVariables.ExpMaps; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.MinecraftVersion; -import org.bukkit.*; -import org.bukkit.block.Block; -import org.bukkit.block.Furnace; -import org.bukkit.entity.ExperienceOrb; -import org.bukkit.entity.Player; -import org.bukkit.inventory.FurnaceInventory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Map; -import java.util.Random; - -public class Smelting extends Skill{ - private String skillName = "smelting"; - - Random rand = new Random(); //Random class Import - - private boolean runMethods; - - public Smelting(Player p) { - super(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - public void speedUpFurnace(Furnace furnace,boolean isBlastFurnace) { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int fastFuelLevel = (int) pStat.get(skillName).get(4); - int doubleSmeltLevel = (int) pStat.get(skillName).get(9); - boolean doubleSmelt = false; - if (doubleSmeltLevel*0.05 > rand.nextDouble()) { - doubleSmelt = true; - } - double defaultCookTime = 200.0; - if (isBlastFurnace) { - defaultCookTime = 100.0; - } - double speedUpFactor = 1 + fastFuelLevel*0.002; - - - World world =furnace.getWorld(); - Location furnaceLoc = furnace.getLocation(); - Material smeltingMaterial = furnace.getInventory().getSmelting().getType(); - double finalDefaultCookTime = defaultCookTime; - boolean finalDoubleSmelt = doubleSmelt; - - int waitTicks = 1; - FurnaceUserTracker furnaceUserTracker = new FurnaceUserTracker(); - if (furnaceUserTracker.getWaitingOnTask(furnaceLoc)) { - waitTicks = 2; - } - furnaceUserTracker.setWaitingOnTaskMap(true,furnaceLoc); - - //Stat Increase - ItemGroups itemGroups = new ItemGroups(); - Map smeltingMap = itemGroups.getSmeltableItemsMap(); - if (smeltingMap.containsKey(smeltingMaterial)) { - increaseStats.changeEXP(skillName, getEXP(smeltingMap.get(smeltingMaterial))); - } - else { - increaseStats.changeEXP(skillName, expMap.get("smeltAnythingElse")); - } - - new BukkitRunnable() { - @Override - public void run() { - if (checkIfBlockIsFurnace(world, furnaceLoc)) { - Furnace FurnaceOneTickLater = (Furnace) world.getBlockAt(furnaceLoc).getState(); - FurnaceInventory furnaceInventory = FurnaceOneTickLater.getSnapshotInventory(); - FurnaceOneTickLater.setCookTimeTotal((int) Math.round(finalDefaultCookTime / speedUpFactor)); - if (furnaceInventory.getResult() != null) { - ItemStack result = furnaceInventory.getResult(); - if (finalDoubleSmelt) { - int resultAmount = result.getAmount(); - result.setAmount(Math.min(64,resultAmount + 1)); - } - furnaceInventory.setResult(result); - } - FurnaceOneTickLater.update(); - } - furnaceUserTracker.removeWaitingOnTaskMap(furnaceLoc); - } - }.runTaskLater(plugin, waitTicks); - - - } - public void printContents(ItemStack[] contents) { - ArrayList newContents = new ArrayList<>(Arrays.asList(contents)); - System.out.println(newContents); - } - - public boolean checkIfBlockIsFurnace(World world,Location location) { - Block block =world.getBlockAt(location); - if (block.getState() instanceof Furnace) { - return true; - } - else { - return false; - } - } - - public void fuelBurn(Furnace furnace,boolean isBlastFurnace) { - if (!runMethods) { - return; - } - World world = furnace.getWorld(); - Map> pStat = pStatClass.getPlayerData(); - int fastFuelLevel = (int) pStat.get(skillName).get(4); - int fuelEfficiencyLevel = (int) pStat.get(skillName).get(7); - double defaultCookTime = 200.0; - if (isBlastFurnace) { - defaultCookTime = 100.0; - } - double speedUpFactor = 1 + fastFuelLevel * 0.002; - double burnLengthMultiplier = 1 + fuelEfficiencyLevel * 0.2; - Location furnaceLoc = furnace.getLocation(); - int cookTimeTotal = (int) Math.floor(defaultCookTime / speedUpFactor); - int cookTimeSoFar = (int) furnace.getCookTime(); - int newCookTime = Math.min(cookTimeSoFar, cookTimeTotal - 1); - - - //Set furnace data - furnace.setCookTimeTotal(cookTimeTotal); - furnace.setCookTime((short) newCookTime); - ItemStack fuel = furnace.getSnapshotInventory().getFuel(); - fuel.setAmount(fuel.getAmount() - 1); - furnace.getSnapshotInventory().setFuel(fuel); - furnace.update(); - - int waitTicks = 1; - FurnaceUserTracker furnaceUserTracker = new FurnaceUserTracker(); - if (furnaceUserTracker.getWaitingOnTask(furnaceLoc)) { - waitTicks = 2; - } - furnaceUserTracker.setWaitingOnTaskMap(true, furnaceLoc); - - new BukkitRunnable() { - @Override - public void run() { - if (checkIfBlockIsFurnace(world, furnaceLoc)) { - Furnace runningFurnace = (Furnace) world.getBlockAt(furnaceLoc).getState(); - double defaultBurnTime = runningFurnace.getBurnTime(); - runningFurnace.setBurnTime((short) Math.ceil(3 + (burnLengthMultiplier * defaultBurnTime / speedUpFactor))); - runningFurnace.update(); - furnaceUserTracker.removeWaitingOnTaskMap(furnaceLoc); - } - } - }.runTaskLater(plugin, waitTicks); - } - - public boolean flamePick(Block block,World world,Material blockType,boolean giveEXP) { - if (!runMethods) { - return false; - } - ExpMaps expMaps = new ExpMaps(); - if (!expMaps.getFlamePickEXP().containsKey(blockType)) { - return false; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(13) < 1 || (int) pStat.get("smelting").get(13) < 1) { - return false; - } - ItemGroups itemGroups = new ItemGroups(); - int doubleDropLevel = (int) pStat.get("mining").get(5); - int doubleDropWoodcuttingLevel = (int) pStat.get("woodcutting").get(5); - int doubleSmeltLevel = (int) pStat.get(skillName).get(9); - double chanceDoubleOreDrop = 0.0005*doubleDropLevel; - double chanceDoubleSmelt = doubleSmeltLevel*0.05; - double chanceDoubleLogDrop = 0.0005*doubleDropWoodcuttingLevel; - int dropAmount = 1; - if (chanceDoubleSmelt > rand.nextDouble()) { - dropAmount *= 2; - } - world.spawnParticle(Particle.FLAME, block.getLocation(), 5); - block.setType(Material.AIR); - ConfigLoad configLoad = new ConfigLoad(); - damageTool(configLoad.getDurabilityModifiers().get("flamePick")); - if (giveEXP) { - increaseStats.changeEXP(skillName, getEXP(blockType)); - } - dropXP(itemGroups.getSmeltingXPMap().get(blockType),block.getLocation()); - if (itemGroups.getOres().contains(blockType)) { - if (chanceDoubleOreDrop > rand.nextDouble()) { - if ((int) pStat.get("mining").get(13) > 0) { - dropAmount *= 3; - } - else { - dropAmount *= 2; - } - } - } - else if (itemGroups.getAllLogs().contains(blockType)) { - if (chanceDoubleLogDrop > rand.nextDouble()) { - dropAmount *= 2; - } - } - for (int i = 0; i < dropAmount; i++) { - if (chanceDoubleSmelt > rand.nextDouble()) { - dropAmount += 1; - } - } - world.dropItemNaturally(block.getLocation(),new ItemStack(itemGroups.getSmeltableItemsMap().get(blockType),dropAmount)); - return true; - - } - - public void dropXP(double avgEXP,Location loc) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.isFlamePickGiveXP()) { - return; - } - World world = loc.getWorld(); - int minXPDrop = (int) Math.floor(avgEXP); - double chanceToRoundUp = avgEXP - minXPDrop; - if (chanceToRoundUp > rand.nextDouble()) { - ((ExperienceOrb) world.spawn(loc, ExperienceOrb.class)).setExperience(minXPDrop+1); - } - else { - ((ExperienceOrb) world.spawn(loc, ExperienceOrb.class)).setExperience(minXPDrop); - } - } - - public int getEXP(Material smeltedMaterial) { - if (!runMethods) { - return 0; - } - int EXP = 0; - switch (smeltedMaterial) { - case COOKED_BEEF: - EXP = expMap.get("smeltBeef"); - break; - case COOKED_CHICKEN: - EXP = expMap.get("smeltChicken"); - break; - case COOKED_MUTTON: - EXP = expMap.get("smeltMutton"); - break; - case COOKED_RABBIT: - EXP = expMap.get("smeltRabbit"); - break; - case COOKED_PORKCHOP: - EXP = expMap.get("smeltPorkchop"); - break; - case GREEN_DYE: - EXP = expMap.get("smeltGreen_Dye"); - break; - case LIME_DYE: - EXP = expMap.get("smeltLime_Dye"); - break; - case COOKED_COD: - EXP = expMap.get("smeltCod"); - break; - case COOKED_SALMON: - EXP = expMap.get("smeltSalmon"); - break; - case POPPED_CHORUS_FRUIT: - EXP = expMap.get("smeltPopped_Chorus_Fruit"); - break; - case DRIED_KELP: - EXP = expMap.get("smeltDried_Kelp"); - break; - case GLASS: - EXP = expMap.get("smeltGlass"); - break; - case BRICK: - EXP = expMap.get("smeltBrick"); - break; - case NETHER_BRICK: - EXP = expMap.get("smeltNether_Brick"); - break; - case STONE: - EXP = expMap.get("smeltStone"); - break; - case SMOOTH_SANDSTONE: - EXP = expMap.get("smeltSmooth_Sandstone"); - break; - case BAKED_POTATO: - EXP = expMap.get("smeltBakedPotato"); - break; - case SMOOTH_RED_SANDSTONE: - EXP = expMap.get("smeltSmooth_Red_Sandstone"); - break; - case SMOOTH_STONE: - EXP = expMap.get("smeltSmooth_Stone"); - break; - case SMOOTH_QUARTZ: - EXP = expMap.get("smeltSmoothQuartz"); - break; - case TERRACOTTA: - EXP = expMap.get("smeltTerracotta"); - break; - case GRAY_GLAZED_TERRACOTTA: - case BLACK_GLAZED_TERRACOTTA: - case GREEN_GLAZED_TERRACOTTA: - case BLUE_GLAZED_TERRACOTTA: - case BROWN_GLAZED_TERRACOTTA: - case CYAN_GLAZED_TERRACOTTA: - case LIGHT_BLUE_GLAZED_TERRACOTTA: - case LIGHT_GRAY_GLAZED_TERRACOTTA: - case LIME_GLAZED_TERRACOTTA: - case MAGENTA_GLAZED_TERRACOTTA: - case ORANGE_GLAZED_TERRACOTTA: - case PINK_GLAZED_TERRACOTTA: - case PURPLE_GLAZED_TERRACOTTA: - case RED_GLAZED_TERRACOTTA: - case WHITE_GLAZED_TERRACOTTA: - case YELLOW_GLAZED_TERRACOTTA: - EXP = expMap.get("smeltGlazed_Terracotta"); - break; - case CHARCOAL: - EXP = expMap.get("smeltCharcoal"); - break; - case IRON_INGOT: - EXP = expMap.get("smeltIronIngot"); - break; - case GOLD_INGOT: - EXP = expMap.get("smeltGoldIngot"); - break; - case DIAMOND: - EXP = expMap.get("smeltDiamond"); - break; - case LAPIS_LAZULI: - EXP = expMap.get("smeltLapis_Lazuli"); - break; - case EMERALD: - EXP = expMap.get("smeltEmerald"); - break; - case REDSTONE: - EXP = expMap.get("smeltRedstone"); - break; - case QUARTZ: - EXP = expMap.get("smeltQuartz"); - break; - case SPONGE: - EXP = expMap.get("smeltSponge"); - break; - case IRON_NUGGET: - EXP = expMap.get("smeltIron_Nugget"); - break; - case GOLD_NUGGET: - EXP = expMap.get("smeltGold_Nugget"); - break; - case CRACKED_STONE_BRICKS: - EXP = expMap.get("smeltCracked_Stone_Bricks"); - break; - default: - EXP = expMap.get("smeltAnythingElse"); - break; - } - MinecraftVersion minecraftVersion = new MinecraftVersion(); - if (minecraftVersion.getMinecraftVersion_Double() >= 1.16 && EXP != expMap.get("smeltAnythingElse")) { - if (smeltedMaterial.equals(Material.NETHERITE_SCRAP)) { - EXP = expMap.get("smeltNetherite_Scrap"); - } - if (smeltedMaterial.equals(Material.CRACKED_NETHER_BRICKS)) { - EXP = expMap.get("smeltCracked_Nether_Bricks"); - } - } - return EXP; - } - - - - -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Swordsmanship.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Swordsmanship.java deleted file mode 100644 index ef108d4..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Swordsmanship.java +++ /dev/null @@ -1,369 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.gameTools.ActionBarMessages; -import mc.carlton.freerpg.gameTools.ExpFarmTracker; -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.gameTools.TrackItem; -import mc.carlton.freerpg.globalVariables.EntityGroups; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.playerInfo.*; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.attribute.Attributable; -import org.bukkit.attribute.Attribute; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.*; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.persistence.PersistentDataType; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.util.Vector; - -import java.time.Instant; -import java.util.*; - -public class Swordsmanship extends Skill{ - private String skillName = "swordsmanship"; - - Random rand = new Random(); //Random class Import - - private boolean runMethods; - - public Swordsmanship(Player p) { - super(p); - this.p = p; - this.pName = p.getDisplayName(); - this.itemInHand = p.getInventory().getItemInMainHand(); - this.increaseStats = new ChangeStats(p); - this.abilities = new AbilityTracker(p); - this.timers = new AbilityTimers(p); - this.pStatClass = new PlayerStats(p); - this.actionMessage = new ActionBarMessages(p); - this.lang = new LanguageSelector(p); - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - public void initiateAbility() { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.swordsmanshipAbility")) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { - return; - } - Integer[] pTimers = timers.getPlayerCooldownTimes(); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[7] == -1) { - int cooldown = pTimers[7]; - if (cooldown < 1) { - int prepMessages = (int) pStatClass.getPlayerData().get("global").get(22); //Toggle for preparation messages - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("sword") + "...<<<"); - } - int taskID = new BukkitRunnable() { - @Override - public void run() { - if (prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " +lang.getString("sword") + "<<<"); - } - try { - abilities.setPlayerAbility( skillName, -1); - } - catch (Exception e) { - - } - } - }.runTaskLater(plugin, 20 * 4).getTaskId(); - abilities.setPlayerAbility( skillName, taskID); - } else { - actionMessage.sendMessage(ChatColor.RED +lang.getString("swiftStrikes") + " " + lang.getString("cooldown") + ": " + ChatColor.WHITE + cooldown+ ChatColor.RED + "s"); - } - } - } - - public void enableAbility() { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - actionMessage.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("swiftStrikes") + " " + lang.getString("activated") + "<<<"); - int durationLevel = (int) pStat.get(skillName).get(4); - double duration0 = Math.ceil(durationLevel * 0.4) + 40; - long duration = (long) duration0; - int sharperLevel = (int) pStat.get(skillName).get(12); - int sharpLevel = itemInHand.getEnchantmentLevel(Enchantment.DAMAGE_ALL); - if (sharperLevel > 0) { - itemInHand.removeEnchantment(Enchantment.DAMAGE_ALL); - itemInHand.addUnsafeEnchantment(Enchantment.DAMAGE_ALL,sharpLevel+1); - } - - //Mark the item - long unixTime = Instant.now().getEpochSecond(); - String keyName = p.getUniqueId().toString() + "-frpg-" + skillName + "-" + String.valueOf(unixTime); - NamespacedKey key = new NamespacedKey(plugin,keyName); - ItemMeta itemMeta = itemInHand.getItemMeta(); - itemMeta.getPersistentDataContainer().set(key, PersistentDataType.STRING,"frpg-swordsmanship"); - itemInHand.setItemMeta(itemMeta); - - ((Attributable) p).getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(1024.0); - Bukkit.getScheduler().cancelTask(pAbilities[7]); - abilities.setPlayerAbility( skillName, -2); - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("swiftStrikes") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("swiftStrikes") + " " + lang.getString("ended") + "<<<"; - timers.abilityDurationTimer(skillName,duration,endMessage,coolDownEndMessage,key,itemInHand,sharpLevel,sharperLevel); - } - - public void preventLogoutTheft(int taskID_swordsmanship,ItemStack itemInHand_swords,NamespacedKey key,boolean isDisabling) { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - int sharperLevel = (int) pStat.get(skillName).get(12); - ((Attributable) p).getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(4.0); - - if (sharperLevel > 0) { - if (pAbilities[7] == -2) { - Bukkit.getScheduler().cancelTask(taskID_swordsmanship); - int sharpLevel = itemInHand_swords.getEnchantmentLevel(Enchantment.DAMAGE_ALL)-1; - String endMessage = ChatColor.RED+ChatColor.BOLD.toString() + ">>>"+lang.getString("magicForce")+"<<<"; - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("swiftStrikes") + " " + lang.getString("readyToUse") + "<<<"; - timers.endAbility(skillName,endMessage,coolDownEndMessage,key,itemInHand_swords,sharpLevel,sharperLevel,isDisabling); - TrackItem trackItem = new TrackItem(); - trackItem.removeItemKey(itemInHand_swords,key); - } - } - } - - public void thirstForBlood(Entity entity) { - if (!runMethods) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - List thirstMobs = entityGroups.getThirstMobs(); - if ( !(thirstMobs.contains(entity.getType())) ) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - List swords = itemGroups.getSwords(); - if ( !(swords.contains(itemInHand.getType())) ) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get(skillName).get(11) < 1) { - return; - } - int foodLevel = p.getFoodLevel(); - float saturation = p.getSaturation(); - p.setFoodLevel(Math.min(foodLevel+2,20)); - p.setSaturation(Math.min(saturation+2,p.getFoodLevel())); - increaseStats.changeEXP(skillName, expMap.get("thirstForBloodActivate")); - } - - public void doubleHit(Entity entity, double damage) { - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int doubleHitLevel = (int) pStat.get(skillName).get(5); - if (!(entity instanceof LivingEntity)) { - return; - } - if (doubleHitLevel * 0.0002 > rand.nextDouble()) { - new BukkitRunnable() { - @Override - public void run() { - if (!entity.isDead()) { - LivingEntity aliveEntity = (LivingEntity) entity; - double hpRemaining = aliveEntity.getHealth(); - Vector knockback = aliveEntity.getVelocity(); - aliveEntity.setNoDamageTicks(0); - if (aliveEntity instanceof Player) { - aliveEntity.damage(2); - increaseStats.changeEXP(skillName, expMap.get("doubleHitActivate")); - } - else { - aliveEntity.damage(Math.min(damage * 0.5,hpRemaining-1)); - increaseStats.changeEXP(skillName, (int) Math.round(damage * expMap.get("doubleHit_EXPperDamagePointDone"))); - } - double multiplier; - if (knockback.length() > 0.1) { - double newKnockback = Math.min(knockback.length() * 2, 80.0); - multiplier = newKnockback / knockback.length(); - } - else { - multiplier = 2.0; - } - aliveEntity.setVelocity(knockback.multiply(multiplier)); - aliveEntity.setNoDamageTicks(20); - - } - } - }.runTaskLater(plugin, 4); - } - } - - public void killBuffs(Entity entity) { //This is written very inefficiently and is very messy - if (!runMethods) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - List hostileMobs = entityGroups.getHostileMobs(); - if ( !(hostileMobs.contains(entity.getType())) ) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - List swords = itemGroups.getSwords(); - if ( !(swords.contains(itemInHand.getType())) ) { - return; - } - - Map> pStat = pStatClass.getPlayerData(); - int adrenaline1Level = Math.min((int) pStat.get(skillName).get(7), 5); - int adrenaline2Level = Math.min((int) pStat.get(skillName).get(9), 5); - int killingSpree1Level = Math.min((int) pStat.get(skillName).get(8), 5); - int kilingSpree2Level = Math.min((int) pStat.get(skillName).get(10), 5); - int totalSpeedTime = adrenaline1Level * 2 * 20; - int totalStrengthtime = killingSpree1Level * 2 * 20; - int speedIItime = (int) Math.round(totalSpeedTime * adrenaline2Level * 0.2); - int strengthIItime = (int) Math.round(totalStrengthtime * kilingSpree2Level * 0.2); - int speedItime = totalSpeedTime - speedIItime; - int strengthItime = totalStrengthtime - strengthIItime; - - if (totalStrengthtime == 0 && totalSpeedTime == 0) { - return; - } - - - //Speed - boolean addEffect = true; - boolean hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.SPEED)) { - hasEffect = true; - if ((effect.getDuration() > totalSpeedTime) || (effect.getAmplifier() > 1 && effect.getDuration() > totalSpeedTime * 0.2) || (effect.getAmplifier() == 1 && effect.getDuration() > speedIItime && effect.getDuration() > totalSpeedTime * 0.2) || totalSpeedTime == 0) { - addEffect = false; - } - break potionEffectLoop; - } - } - - if (addEffect) { - if (hasEffect) { - p.removePotionEffect(PotionEffectType.SPEED); - } - if (speedIItime == 0) { - p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, totalSpeedTime, 0)); - } else { - p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, speedIItime+2, 1)); - int taskID = new BukkitRunnable() { - @Override - public void run() { - boolean addEffect = true; - boolean hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.SPEED)) { - hasEffect = true; - if ((effect.getDuration() > totalSpeedTime) || (effect.getAmplifier() > 1 && effect.getDuration() > speedItime * 0.2)) { - addEffect = false; - } - break potionEffectLoop; - } - } - if (addEffect && hasEffect) { - p.removePotionEffect(PotionEffectType.SPEED); - p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, speedItime, 0)); - } - - } - }.runTaskLater(plugin, speedIItime).getTaskId(); - } - } - - //Strength - addEffect = true; - hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.INCREASE_DAMAGE)) { - hasEffect = true; - if ((effect.getDuration() > totalStrengthtime) || (effect.getAmplifier() > 1 && effect.getDuration() > totalStrengthtime * 0.2) || (effect.getAmplifier() == 1 && effect.getDuration() > strengthIItime && effect.getDuration() > totalStrengthtime * 0.2) || totalStrengthtime == 0) { - addEffect = false; - } - break potionEffectLoop; - } - } - - if (addEffect) { - if (hasEffect) { - p.removePotionEffect(PotionEffectType.INCREASE_DAMAGE); - } - if (strengthIItime == 0) { - p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, totalStrengthtime, 0)); - } else { - p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, strengthIItime+2, 1)); - int taskID = new BukkitRunnable() { - @Override - public void run() { - boolean addEffect = true; - boolean hasEffect = false; - potionEffectLoop: - for (PotionEffect effect : p.getActivePotionEffects()) { - if (effect.getType().equals(PotionEffectType.INCREASE_DAMAGE)) { - hasEffect = true; - if ((effect.getDuration() > totalStrengthtime) || (effect.getAmplifier() > 1 && effect.getDuration() > strengthItime * 0.2)) { - addEffect = false; - } - break potionEffectLoop; - } - } - if (addEffect && hasEffect) { - p.removePotionEffect(PotionEffectType.INCREASE_DAMAGE); - p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, strengthItime, 0)); - } - - } - }.runTaskLater(plugin, strengthIItime).getTaskId(); - } - - } - - } - - public void giveHitEXP(double finalDamage,Entity entity) { - if (!runMethods || entity.getType().equals(EntityType.ARMOR_STAND)) { - return; - } - ExpFarmTracker expFarmTracker = new ExpFarmTracker(); - double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity,skillName); - increaseStats.changeEXP(skillName, (int) Math.round( (finalDamage * expMap.get("dealDamage_EXPperDamagePointDone") + expMap.get("dealDamage"))*multiplier) ); - } - - public void giveKillEXP(Entity entity) { - if (!runMethods) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - List swords = itemGroups.getSwords(); - if (!(swords.contains(itemInHand.getType()))) { - return; - } - EntityGroups entityGroups = new EntityGroups(); - entityGroups.killEntity(entity,skillName,expMap,increaseStats); - } - - -} diff --git a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Woodcutting.java b/src/main/java/mc/carlton/freerpg/perksAndAbilities/Woodcutting.java deleted file mode 100644 index f9b977b..0000000 --- a/src/main/java/mc/carlton/freerpg/perksAndAbilities/Woodcutting.java +++ /dev/null @@ -1,597 +0,0 @@ -package mc.carlton.freerpg.perksAndAbilities; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.ActionBarMessages; -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.globalVariables.ExpMaps; -import mc.carlton.freerpg.globalVariables.ItemGroups; -import mc.carlton.freerpg.playerInfo.*; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverInfo.PlacedBlocksManager; -import mc.carlton.freerpg.serverInfo.WorldGuardChecks; -import org.bukkit.*; -import org.bukkit.block.Block; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.ExperienceOrb; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.EnchantmentStorageMeta; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.*; - -public class Woodcutting extends Skill{ - private String skillName = "woodcutting"; - Map woodcuttingEXP; - - Random rand = new Random(); //Random class Import - - List logs; - List leaves; - - - ArrayList timberLogs = new ArrayList(); - ArrayList treeLeaves = new ArrayList(); - - private boolean runMethods; - - public Woodcutting(Player p) { - super(p); - this.pName = p.getDisplayName(); - this.itemInHand = p.getInventory().getItemInMainHand(); - this.increaseStats = new ChangeStats(p); - this.abilities = new AbilityTracker(p); - this.timers = new AbilityTimers(p); - this.pStatClass= new PlayerStats(p); - this.actionMessage = new ActionBarMessages(p); - this.lang = new LanguageSelector(p); - - ItemGroups itemGroups = new ItemGroups(); - this.logs = itemGroups.getLogs(); - this.leaves = itemGroups.getLeaves(); - - ExpMaps expMaps = new ExpMaps(); - this.woodcuttingEXP = expMaps.getWoodcuttingEXP(); - - ConfigLoad configLoad = new ConfigLoad(); - this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); - expMap = configLoad.getExpMapForSkill(skillName); - } - - public void initiateAbility() { - if (!runMethods) { - return; - } - if (!p.hasPermission("freeRPG.woodcuttingAbility")) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { - return; - } - Integer[] pTimers = timers.getPlayerCooldownTimes(); - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[1] == -1) { - int cooldown = pTimers[1]; - if (cooldown < 1) { - int prepMessages = (int) pStatClass.getPlayerData().get("global").get(22); //Toggle for preparation messages - if (pAbilities[9] != -2 && prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("axe") + "...<<<"); - } - int taskID = new BukkitRunnable() { - @Override - public void run() { - try { - Integer[] pAbilities2 = abilities.getPlayerAbilities(); - if (pAbilities2[9] != -2 && prepMessages > 0) { - actionMessage.sendMessage(ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " +lang.getString("axe") + "<<<"); - } - abilities.setPlayerAbility( skillName, -1); - } - catch (Exception e) { - - } - } - }.runTaskLater(plugin, 20 * 4).getTaskId(); - abilities.setPlayerAbility( skillName, taskID); - } else { - actionMessage.sendMessage(ChatColor.RED +lang.getString("timber") + " " + lang.getString("cooldown") + ": " + ChatColor.WHITE + cooldown+ ChatColor.RED + "s"); - } - } - } - public void enableAbility() { - if (!runMethods) { - return; - } - Integer[] pAbilities = abilities.getPlayerAbilities(); - Map> pStat = pStatClass.getPlayerData(); - actionMessage.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("timber") + " " + lang.getString("activated") + "<<<"); - int durationLevel = (int) pStat.get(skillName).get(4); - double duration0 = Math.ceil(durationLevel*0.4) + 40; - long duration = (long) duration0; - Bukkit.getScheduler().cancelTask(pAbilities[1]); - abilities.setPlayerAbility( skillName, -2); - String coolDownEndMessage = ChatColor.GREEN + ">>>" + lang.getString("timber") + " " + lang.getString("readyToUse") + "<<<"; - String endMessage = ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("timber") + " " + lang.getString("ended") + "<<<"; - timers.abilityDurationTimer(skillName,duration,endMessage,coolDownEndMessage); - } - public void getTimberLogs(Block b1, final int x1, final int y1, final int z1) { - if (!runMethods) { - return; - } - WorldGuardChecks BuildingCheck = new WorldGuardChecks(); - int searchSquareSize = 7; - for (int x = -1; x <= 1; x++) { - for (int y = 0; y <= 1; y++) { - for (int z = -1; z <= 1; z++) { - if (x == 0 && y == 0 && z == 0) { - continue; - } - Block b2 = b1.getRelative(x, y, z); - int blockX = b2.getX(); - int blockY = b2.getY(); - int blockZ = b2.getZ(); - if (blockX == x1 && blockY == y1 && blockZ == z1) { //Makes sure the original block is never added to timberLogs - continue; - } - if (logs.contains(b2.getType())) { - if (b2.getX() > x1 + searchSquareSize || b2.getX() < x1 - searchSquareSize || b2.getZ() > z1 + searchSquareSize || b2.getZ() < z1 - searchSquareSize) { - break; - } - else if (!(timberLogs.contains(b2))) { - if (BuildingCheck.canBuild(p, b2.getLocation())) { - timberLogs.add(b2); - this.getTimberLogs(b2, x1, y1, z1); - } - } - } - } - } - } - } - - public void timber(Block initialBlock) { - if (!runMethods) { - return; - } - if (!(logs.contains(initialBlock.getType()))) { - return; - } - World world = initialBlock.getWorld(); - Map> pStat = pStatClass.getPlayerData(); - int doubleDropsLevel = (int)pStat.get(skillName).get(5); - int timber_plus = (int)pStat.get(skillName).get(11); - int able_axe = (int)pStat.get(skillName).get(13); - getTimberLogs(initialBlock,initialBlock.getX(),initialBlock.getY(),initialBlock.getZ()); - int numLogs = timberLogs.size(); - ConfigLoad configLoad =new ConfigLoad(); - ArrayList timberLimits = configLoad.getTimberBreakLimits(); - if (timber_plus < 1) { - if (numLogs > timberLimits.get(0)) { - actionMessage.sendMessage(ChatColor.RED + lang.getString("treeTooBig0")); - return; - } - } - else { - if (numLogs > timberLimits.get(1)) { - actionMessage.sendMessage(ChatColor.RED + lang.getString("treeTooBig1")); - return; - } - } - damageTool(numLogs,configLoad.getDurabilityModifiers().get("timber")); - for (Block block : timberLogs) { - Location blockLoc = block.getLocation(); - //Checks if any of the blocks weren't natural - PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); - boolean natural = !placedBlocksManager.isBlockTracked(block); - if (!natural) { - placedBlocksManager.removeBlock(block); - numLogs -= 1; - } - - Collection drops = block.getDrops(itemInHand); - block.setType(Material.AIR); - for (ItemStack drop : drops) { - dropItemNaturally(blockLoc, drop); - } - if (able_axe > 0 && natural) { - double randomNum = rand.nextDouble(); - double doubleDropChance = doubleDropsLevel * 0.00025; - if (doubleDropChance > randomNum) { - for (ItemStack drop : drops) { - dropItemNaturally(blockLoc, drop); - } - } - //Book spawns - double rollBookDropChance = 0.5; //50% chance to roll for a book, book then has 0-1% chance of being rolled. - if (rollBookDropChance > rand.nextDouble()) { - logBookDrop(block,world); - } - } - } - if (able_axe > 0) { - //XP all in one go - int zealousRootsLevel = (int) pStat.get(skillName).get(7); - double xpDrop0 = zealousRootsLevel*0.1*numLogs; - int xpDrop = 0; - double roundChance = xpDrop0 - Math.floor(xpDrop0); - double randomNum = rand.nextDouble(); - if (roundChance > randomNum) { - xpDrop = (int) Math.ceil(xpDrop0); - } - else { - xpDrop = (int) Math.floor(xpDrop0); - } - ((ExperienceOrb)world.spawn(initialBlock.getLocation(), ExperienceOrb.class)).setExperience(xpDrop); - - } - increaseStats.changeEXP(skillName, (int) Math.round(woodcuttingEXP.get(initialBlock.getType()) * numLogs * configLoad.getSpecialMultiplier().get("timberEXPMultiplier"))); - timberLogs.clear(); - - } - public void woodcuttingDoubleDrop(Block block, World world) { - if (!runMethods) { - return; - } - Material[] planks0 = {Material.ACACIA_PLANKS,Material.BIRCH_PLANKS,Material.DARK_OAK_PLANKS,Material.JUNGLE_PLANKS,Material.OAK_PLANKS,Material.SPRUCE_PLANKS}; - List planks = Arrays.asList(planks0); - if (planks.contains(block.getType())) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int doubleDropLevel = (int) pStat.get(skillName).get(5); - double chance = 0.0005*doubleDropLevel; - double randomNum = rand.nextDouble(); - if (chance > randomNum) { - for (ItemStack stack : block.getDrops(itemInHand)) { - dropItemNaturally(block.getLocation(),stack); - } - } - } - - public void logXPdrop(Block block,World world) { - if (!runMethods) { - return; - } - if (logs.contains(block.getType())) { - Map> pStat = pStatClass.getPlayerData(); - int zealousRootsLevel = (int) pStat.get(skillName).get(7); - double xpChance = zealousRootsLevel*0.2; - double randomNum = rand.nextDouble(); - if (xpChance > randomNum) { - ((ExperienceOrb)world.spawn(block.getLocation(), ExperienceOrb.class)).setExperience(1); - } - } - } - public void logBookDrop(Block block, World world) { - if (!runMethods) { - return; - } - if (logs.contains(block.getType())) { - Map> pStat = pStatClass.getPlayerData(); - int hiddenKnowledgeLevel = (int) pStat.get(skillName).get(9); - double bookChance = hiddenKnowledgeLevel*0.002; - double randomNum = rand.nextDouble(); - if (bookChance > randomNum) { - //Get enchant Map - ItemGroups itemGroups = new ItemGroups(); - Map enchantmentLevelMap = itemGroups.getEnchantmentLevelMap(); - - int choppingInt = 0; - if (hiddenKnowledgeLevel >= 5) { - choppingInt = 1; - } - - //Get random enchant - List keysAsArray = new ArrayList(enchantmentLevelMap.keySet()); - int randInt = rand.nextInt(keysAsArray.size() + choppingInt); - Enchantment randomEnchant; - if (randInt < keysAsArray.size()) { - randomEnchant = keysAsArray.get(randInt); - } - else { //Enchantment will be chopping - randomEnchant = Enchantment.getByKey(new NamespacedKey(FreeRPG.getPlugin(FreeRPG.class),"chopping")); - } - - int randomLevel = rand.nextInt(enchantmentLevelMap.get(randomEnchant)) + 1; - ItemStack enchantedBook = new ItemStack(Material.ENCHANTED_BOOK, 1); - EnchantmentStorageMeta meta = ((EnchantmentStorageMeta) enchantedBook.getItemMeta()); - meta.addStoredEnchant(randomEnchant,randomLevel,true); - enchantedBook.setItemMeta(meta); - if (randomEnchant == Enchantment.BINDING_CURSE || randomEnchant == Enchantment.VANISHING_CURSE) { - Map enchantmentLevelMapGood = enchantmentLevelMap; - enchantmentLevelMapGood.remove(Enchantment.BINDING_CURSE); - enchantmentLevelMapGood.remove(Enchantment.VANISHING_CURSE); - keysAsArray = new ArrayList(enchantmentLevelMapGood.keySet()); - randomEnchant = keysAsArray.get(rand.nextInt(keysAsArray.size())); - randomLevel = rand.nextInt(enchantmentLevelMap.get(randomEnchant)) + 1; - meta.addStoredEnchant(randomEnchant,randomLevel,true); - enchantedBook.setItemMeta(meta); - } - dropItemNaturally(block.getLocation(), enchantedBook); - } - - } - - } - public void leavesDrops(Block block, World world,double probMultiplier,double expMultiplier) { - if (!runMethods) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - List leaves = itemGroups.getLeaves(); - if (leaves.contains(block.getType()) && itemInHand.getType() != Material.SHEARS) { - Map> pStat = pStatClass.getPlayerData(); - ConfigLoad loadConfig = new ConfigLoad(); - ArrayList leafDropData = loadConfig.getWoodcuttingInfo(); - int leafLevel = (int) pStat.get(skillName).get(10); - double randomNum = rand.nextDouble(); - Double[] prob = {(double)leafDropData.get(2),(double)leafDropData.get(5),(double)leafDropData.get(8),(double)leafDropData.get(11),(double)leafDropData.get(14)}; - for (int i = 0; i < prob.length ; i++) { - prob[i] = prob[i]*probMultiplier; - } - Double[] dropChanceSums = {prob[0],prob[0]+prob[1],prob[0]+prob[1]+prob[2],prob[0]+prob[1]+prob[2]+prob[3], - prob[0]+prob[1]+prob[2]+prob[3]+prob[4]}; - if (randomNum < dropChanceSums[0] && leafLevel >= 1) { - ItemStack drop = new ItemStack(Material.DIRT, 1); - if (leafDropData.get(0) == null) { - drop.setType(Material.FEATHER); - } - else { - drop.setType((Material)leafDropData.get(0)); - drop.setAmount((int)leafDropData.get(1)); - } - dropItemNaturally(block.getLocation(), drop); - increaseStats.changeEXP(skillName, (int) Math.round(expMap.get("leafDrop1")*expMultiplier)); - } - else if (randomNum < dropChanceSums[1] && leafLevel >= 2) { - ItemStack drop = new ItemStack(Material.DIRT, 1); - if (leafDropData.get(3) == null) { - drop.setType(Material.GOLD_NUGGET); - } - else { - drop.setType((Material)leafDropData.get(3)); - drop.setAmount((int)leafDropData.get(4)); - } - dropItemNaturally(block.getLocation(), drop); - increaseStats.changeEXP(skillName, (int) Math.round(expMap.get("leafDrop2")*expMultiplier)); - } - else if (randomNum < dropChanceSums[2] && leafLevel >= 3) { - ItemStack drop = new ItemStack(Material.DIRT, 1); - if (leafDropData.get(6) == null) { - drop.setType(Material.GOLDEN_APPLE); - } - else { - drop.setType((Material)leafDropData.get(6)); - drop.setAmount((int)leafDropData.get(7)); - } - dropItemNaturally(block.getLocation(), drop); - increaseStats.changeEXP(skillName, (int) Math.round(expMap.get("leafDrop3")*expMultiplier)); - } - else if (randomNum < dropChanceSums[3] && leafLevel >= 4) { - ItemStack drop = new ItemStack(Material.DIRT, 1); - if (leafDropData.get(9) == null) { - drop.setType(Material.EXPERIENCE_BOTTLE); - } - else { - drop.setType((Material)leafDropData.get(9)); - drop.setAmount((int)leafDropData.get(10)); - } - dropItemNaturally(block.getLocation(), drop); - increaseStats.changeEXP(skillName, (int) Math.round(expMap.get("leafDrop4")*expMultiplier)); - } - else if (randomNum < dropChanceSums[4] && leafLevel >= 5) { - ItemStack drop = new ItemStack(Material.DIRT, 1); - if (leafDropData.get(12) == null) { - drop.setType(Material.ENCHANTED_GOLDEN_APPLE); - } - else { - drop.setType((Material)leafDropData.get(12)); - drop.setAmount((int)leafDropData.get(13)); - } - dropItemNaturally(block.getLocation(), drop); - increaseStats.changeEXP(skillName, (int) Math.round(expMap.get("leafDrop5")*expMultiplier)); - } - } - - } - - public void getTreeLeaves(Block b1,final int x1, final int y1, final int z1,Material leafType) { - if (!runMethods) { - return; - } - WorldGuardChecks BuildingCheck = new WorldGuardChecks(); - int searchCubeSize = 7; - if (treeLeaves.size() > 63) { - return; - } - for (int x = -1; x <= 1; x++) { - for (int y = -1; y <= 1; y++) { - for (int z = -1; z <= 1; z++) { - if (x == 0 && y == 0 && z == 0) { - continue; - } - Block b2 = b1.getRelative(x, y, z); - int blockX = b2.getX(); - int blockY = b2.getY(); - int blockZ = b2.getZ(); - if (blockX == x1 && blockY == y1 && blockZ == z1) { //Makes sure the original block is never added to treeLeaves - continue; - } - if (b2.getType().equals(leafType)) { - if (blockX > x1 + searchCubeSize || blockX < x1 - searchCubeSize || blockY > y1 + searchCubeSize || blockY < y1 - searchCubeSize || blockZ > z1 + searchCubeSize || blockZ < z1 - searchCubeSize) { - break; - } - else if (!(treeLeaves.contains(b2))) { - if (treeLeaves.size() > 63) { - return; - } - if (BuildingCheck.canBuild(p, b2.getLocation())) { - treeLeaves.add(b2); - this.getTreeLeaves(b2, x1, y1, z1,leafType); - } - } - } - } - } - } - } - - public void leafBlower(Block initialBlock) { - if (!runMethods) { - return; - } - if (!(leaves.contains(initialBlock.getType()))) { //Block must be a leaf - return; - } - if (!(new ItemGroups().getAxes().contains(itemInHand.getType()))) { //Must be holding an axe - return; - } - Map> pStat = pStatClass.getPlayerData(); - int leafBlowerLevel = (int)pStat.get(skillName).get(12); - if (leafBlowerLevel < 1 || (int)pStat.get("global").get(26) < 1) { //Must have high enough level and have leaf blower toggled on - return; - } - getTreeLeaves(initialBlock,initialBlock.getX(),initialBlock.getY(),initialBlock.getZ(),initialBlock.getType()); //Get Leaves in tree leaf chunk - int numLeaves = treeLeaves.size(); - World world = initialBlock.getWorld(); - ConfigLoad configLoad = new ConfigLoad(); - damageTool(numLeaves,configLoad.getDurabilityModifiers().get("leafBlower")); - PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); - for (Block block : treeLeaves) { - Location blockLoc = block.getLocation(); - if (placedBlocksManager.isBlockTracked(block)) { - placedBlocksManager.removeBlock(block); - numLeaves -= 1; //Less EXP rewarded for nonnatural broken leaves - } - else{ - leavesDrops(block,world,0.2,0.4); //Nerfed drop rates are EXP from special drops - } - Collection drops = block.getDrops(itemInHand); - block.setType(Material.AIR); - for (ItemStack drop : drops) { //Drop whatever that leaf would have dropped normally - dropItemNaturally(blockLoc, drop); - } - } - increaseStats.changeEXP(skillName,numLeaves*expMap.get("useLeafBlower")); //Gives all EXP - - } - - /* OLD leaf blower skill - public void leafBlower(Block block, World world) { - if (!runMethods) { - return; - } - ItemGroups itemGroups = new ItemGroups(); - List leaves = itemGroups.getLeaves(); - List axes = itemGroups.getAxes(); - if (leaves.contains(block.getType()) && axes.contains(itemInHand.getType())) { - WorldGuardChecks BuildingCheck = new WorldGuardChecks(); - if (!BuildingCheck.canBuild(p, block.getLocation())) { - return; - } - increaseStats.changeEXP(skillName,expMap.get("useLeafBlower")); - Map> pStat = pStatClass.getPlayerData(); - int leafLevel = (int) pStat.get(skillName).get(12); - if (leafLevel > 0) { - leavesDrops(block,world); - block.setType(Material.AIR); - ItemMeta toolMeta = itemInHand.getItemMeta(); - if (toolMeta instanceof Damageable) { - ((Damageable) toolMeta).setDamage(((Damageable) toolMeta).getDamage()+1); - itemInHand.setItemMeta(toolMeta); - if (((Damageable) toolMeta).getDamage() > itemInHand.getType().getMaxDurability()) { - itemInHand.setAmount(0); - p.getWorld().playEffect(p.getLocation(), Effect.STEP_SOUND, 1); - } - } - - double randomNum1 = rand.nextDouble(); - if (randomNum1 < 0.05) { - double randomNum2 = rand.nextDouble(); - if (randomNum2 < 0.5) { - switch (block.getType()) { - case ACACIA_LEAVES: - dropItemNaturally(block.getLocation(), new ItemStack(Material.ACACIA_SAPLING,1)); - break; - case BIRCH_LEAVES: - dropItemNaturally(block.getLocation(), new ItemStack(Material.BIRCH_SAPLING,1)); - break; - case DARK_OAK_LEAVES: - dropItemNaturally(block.getLocation(), new ItemStack(Material.DARK_OAK_SAPLING,1)); - break; - case JUNGLE_LEAVES: - dropItemNaturally(block.getLocation(), new ItemStack(Material.JUNGLE_SAPLING,1)); - break; - case SPRUCE_LEAVES: - dropItemNaturally(block.getLocation(), new ItemStack(Material.SPRUCE_SAPLING,1)); - break; - case OAK_LEAVES: - dropItemNaturally(block.getLocation(), new ItemStack(Material.OAK_SAPLING,1)); - break; - default: - break; - } - - } - else if (randomNum2 < 0.75) { - dropItemNaturally(block.getLocation(), new ItemStack(Material.STICK,1)); - } - else { - dropItemNaturally(block.getLocation(), new ItemStack(Material.STICK,2)); - } - } - double randomNum3 = rand.nextDouble(); - if (randomNum3 < 0.005 && (block.getType() == Material.OAK_LEAVES || block.getType() == Material.DARK_OAK_LEAVES)) { - dropItemNaturally(block.getLocation(), new ItemStack(Material.APPLE,1)); - } - } - } - } - */ - - public void timedHaste(Block block){ - if (!runMethods) { - return; - } - Map> pStat = pStatClass.getPlayerData(); - int freshArmsLevel = (int) pStat.get(skillName).get(8); - if (logs.contains(block.getType()) && freshArmsLevel > 0) { - Integer[] pAbilities = abilities.getPlayerAbilities(); - if (pAbilities[10] == -1) { - p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 20*12 * freshArmsLevel, 0)); - int taskID = new BukkitRunnable() { - @Override - public void run() { - abilities.setPlayerAbility( "woodcuttingHaste", -1); - } - }.runTaskLater(plugin, 20 * 300).getTaskId(); - abilities.setPlayerAbility( "woodcuttingHaste", taskID); - } else { - Bukkit.getScheduler().cancelTask(pAbilities[10]); - int taskID = new BukkitRunnable() { - @Override - public void run() { - abilities.setPlayerAbility( "woodcuttingHaste", -1); - } - }.runTaskLater(plugin, 20 * 300).getTaskId(); - } - } - } - - public boolean blacklistedBlock(Block block) { - if (!runMethods) { - return false; - } - boolean isBlacklisted = false; - Material blockType = block.getType(); - ItemGroups itemGroups = new ItemGroups(); - List strippedLogs = itemGroups.getStrippedLogs(); - if (logs.contains(blockType) || strippedLogs.contains(blockType)) { - isBlacklisted = true; - } - return isBlacklisted; - } -} diff --git a/src/main/java/mc/carlton/freerpg/pistonEvents/PistonEvents.java b/src/main/java/mc/carlton/freerpg/pistonEvents/PistonEvents.java deleted file mode 100644 index 3c17fa1..0000000 --- a/src/main/java/mc/carlton/freerpg/pistonEvents/PistonEvents.java +++ /dev/null @@ -1,81 +0,0 @@ -package mc.carlton.freerpg.pistonEvents; - -import mc.carlton.freerpg.serverInfo.PlacedBlocksManager; -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.event.Event; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockPistonEvent; -import org.bukkit.event.block.BlockPistonExtendEvent; -import org.bukkit.event.block.BlockPistonRetractEvent; -import org.bukkit.util.Vector; - -import java.util.ArrayList; -import java.util.List; - -public class PistonEvents implements Listener { - @EventHandler(priority = EventPriority.HIGH) - void onPistonExtend(BlockPistonExtendEvent e) { - pistonChangeBlockLocation(e); - } - @EventHandler(priority = EventPriority.HIGH) - void onPistonRetract(BlockPistonRetractEvent e) { - pistonChangeBlockLocation(e); - } - - private void pistonChangeBlockLocation(BlockPistonExtendEvent e) { - if (e.isCancelled()) { - return; - } - List blocks = e.getBlocks(); - PlacedBlocksManager blockTracker = new PlacedBlocksManager(); - if (blocks.size() != 0) { - ArrayList trackedLocations = new ArrayList<>(); - World world = blocks.get(0).getWorld(); - Vector dir = e.getDirection().getDirection(); - for (Block block : blocks) { - boolean natural = !blockTracker.isBlockTracked(block); - if (natural == false) { - trackedLocations.add(block.getLocation()); - blockTracker.removeBlock(block); - } - } - for (Location loc : trackedLocations) { - int newX = loc.getBlockX()+dir.getBlockX(); - int newY = loc.getBlockY()+dir.getBlockY(); - int newZ = loc.getBlockZ()+dir.getBlockZ(); - blockTracker.addLocation(new Location(world,newX,newY,newZ)); - } - } - } - - private void pistonChangeBlockLocation(BlockPistonRetractEvent e) { - if (e.isCancelled()) { - return; - } - List blocks = e.getBlocks(); - PlacedBlocksManager blockTracker = new PlacedBlocksManager(); - if (blocks.size() != 0) { - ArrayList trackedLocations = new ArrayList<>(); - World world = blocks.get(0).getWorld(); - Vector dir = e.getDirection().getDirection(); - for (Block block : blocks) { - boolean natural = !blockTracker.isBlockTracked(block); - if (natural == false) { - trackedLocations.add(block.getLocation()); - blockTracker.removeBlock(block); - } - } - for (Location loc : trackedLocations) { - int newX = loc.getBlockX()+dir.getBlockX(); - int newY = loc.getBlockY()+dir.getBlockY(); - int newZ = loc.getBlockZ()+dir.getBlockZ(); - blockTracker.addLocation(new Location(world,newX,newY,newZ)); - } - } - } - -} diff --git a/src/main/java/mc/carlton/freerpg/pistonEvents/PistonRetract.java b/src/main/java/mc/carlton/freerpg/pistonEvents/PistonRetract.java deleted file mode 100644 index 4f55a22..0000000 --- a/src/main/java/mc/carlton/freerpg/pistonEvents/PistonRetract.java +++ /dev/null @@ -1,18 +0,0 @@ -package mc.carlton.freerpg.pistonEvents; - -import mc.carlton.freerpg.serverInfo.PlacedBlocksManager; -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockPistonRetractEvent; -import org.bukkit.util.Vector; - -import java.util.ArrayList; -import java.util.List; - -public class PistonRetract implements Listener { - -} diff --git a/src/main/java/mc/carlton/freerpg/playerInfo/AbilityLogoutTracker.java b/src/main/java/mc/carlton/freerpg/playerInfo/AbilityLogoutTracker.java deleted file mode 100644 index 2235a97..0000000 --- a/src/main/java/mc/carlton/freerpg/playerInfo/AbilityLogoutTracker.java +++ /dev/null @@ -1,79 +0,0 @@ -package mc.carlton.freerpg.playerInfo; - -import mc.carlton.freerpg.FreeRPG; -import org.bukkit.NamespacedKey; -import org.bukkit.entity.Player; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -public class AbilityLogoutTracker { - private Player p; - private UUID playerUUID; - static Map> playerTasks = new HashMap<>(); - static Map> playerKeys = new HashMap<>(); - - public AbilityLogoutTracker(Player p) { - this.p = p; - this.playerUUID = p.getUniqueId(); - } - public Map> getTasks() { - return playerTasks; - } - - - public Map getPlayerTasks() { - return playerTasks.get(playerUUID); - } - public Map> getKeys() { - return playerKeys; - } - public Map getPlayerKeys() { - return playerKeys.get(playerUUID); - } - public void setTasks(Map> player_tasks) { - playerTasks = player_tasks; - } - public void setItems(Map> player_keys) { - playerKeys = player_keys; - } - - public void setPlayerTasks(Map tasks) { - playerTasks.put(playerUUID,tasks); - } - public void setPlayerItems(Map items) { - playerKeys.put(playerUUID,items); - } - public void setPlayerTask(String ability,int taskID) { - Map pTasks = playerTasks.get(playerUUID); - pTasks.put(ability,taskID); - playerTasks.put(playerUUID, pTasks); - } - - public void setPlayerItem(String ability,NamespacedKey key) { - if (!playerKeys.containsKey(playerUUID)) { //Assures player is initialized - intiializePlayer(); - } - Map pItems = playerKeys.get(playerUUID); - pItems.put(ability,key); - playerKeys.put(playerUUID, pItems); - } - public void removePlayer() { - playerTasks.remove(playerUUID); - playerKeys.remove(playerUUID); - } - - public void intiializePlayer() { - String[] names = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense", - "axeMastery","woodcuttingHaste","swordSpeed","swordStrength"}; - Map player_Tasks = new HashMap<>(); - Map player_Keys = new HashMap<>(); - for (String name : names) { - player_Tasks.put(name,-1); - player_Keys.put(name,new NamespacedKey(FreeRPG.getPlugin(FreeRPG.class),"x")); - } - playerTasks.put(playerUUID,player_Tasks); - playerKeys.put(playerUUID,player_Keys); - } -} diff --git a/src/main/java/mc/carlton/freerpg/playerInfo/AbilityTimers.java b/src/main/java/mc/carlton/freerpg/playerInfo/AbilityTimers.java deleted file mode 100644 index 5fad8e2..0000000 --- a/src/main/java/mc/carlton/freerpg/playerInfo/AbilityTimers.java +++ /dev/null @@ -1,452 +0,0 @@ -package mc.carlton.freerpg.playerInfo; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.ActionBarMessages; -import mc.carlton.freerpg.gameTools.BossBarStorage; -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.gameTools.TrackItem; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.NamespacedKey; -import org.bukkit.attribute.Attributable; -import org.bukkit.attribute.Attribute; -import org.bukkit.boss.BossBar; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.scheduler.BukkitScheduler; - -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - -public class AbilityTimers { - private Player player; - private UUID uuid; - static Map cooldownTimes = new ConcurrentHashMap<>(); - static Map cooldownTaskIds = new ConcurrentHashMap<>(); - static Map abilityDurationTaskIds = new ConcurrentHashMap<>(); - static Map> abilityDurationTimes = new ConcurrentHashMap<>(); - static Map> abilityDurationBossBar = new ConcurrentHashMap<>(); - ItemStack itemInHand; - - public AbilityTimers(Player p) { - this.player = p; - this.uuid = player.getUniqueId(); - } - - public Integer[] getPlayerCooldownTimes() { - if (!cooldownTimes.containsKey(uuid)) { - Integer[] initTimers = {0,0,0,0,0,0,0,0,0,0,0,0}; - cooldownTimes.put(uuid,initTimers); - } - return cooldownTimes.get(uuid); - } - public Map getCooldownTimes() { - if (!cooldownTimes.containsKey(uuid)) { - Integer[] initTimers = {0,0,0,0,0,0,0,0,0,0,0,0}; - cooldownTimes.put(uuid,initTimers); - } - return cooldownTimes; - } - - public void setPlayerCooldownTime(String ability, int timeRemaining) { - Integer[] pTimes = cooldownTimes.get(uuid); - switch(ability) { - case "digging": - pTimes[0] = timeRemaining; - break; - case "woodcutting": - pTimes[1] = timeRemaining; - break; - case "mining": - pTimes[2] = timeRemaining; - break; - case "farming": - pTimes[3] = timeRemaining; - break; - case "fishing": - pTimes[4] = timeRemaining; - break; - case "archery": - pTimes[5] = timeRemaining; - break; - case "beastMastery": - pTimes[6] = timeRemaining; - break; - case "swordsmanship": - pTimes[7] = timeRemaining; - break; - case "defense": - pTimes[8] = timeRemaining; - break; - case "axeMastery": - pTimes[9] = timeRemaining; - break; - case "woodcuttingHaste": - pTimes[10] = timeRemaining; - break; - case "fishingRob": - pTimes[11] = timeRemaining; - default: - break; - } - cooldownTimes.put(uuid,pTimes); - } - - public int getPlayerCooldownTime(String ability) { - if (!cooldownTimes.containsKey(uuid)) { - Integer[] initTimers = {0,0,0,0,0,0,0,0,0,0,0,0}; - cooldownTimes.put(uuid,initTimers); - } - Integer[] pTimes = cooldownTimes.get(uuid); - switch(ability) { - case "digging": - return pTimes[0]; - case "woodcutting": - return pTimes[1]; - case "mining": - return pTimes[2]; - case "farming": - return pTimes[3]; - case "fishing": - return pTimes[4]; - case "archery": - return pTimes[5]; - case "beastMastery": - return pTimes[6]; - case "swordsmanship": - return pTimes[7]; - case "defense": - return pTimes[8]; - case "axeMastery": - return pTimes[9]; - case "woodcuttingHaste": - return pTimes[10]; - case "fishingRob": - return pTimes[11]; - default: - return 0; - } - } - public void setTimes(Map timers) { - this.cooldownTimes = timers; - } - public void removePlayer() { - Integer[] pTimers = getPlayerCooldownTimes(); - boolean allZero = true; - for (int i : pTimers) { - if (i > 0){ - allZero = false; - break; - } - } - if (allZero) { - cooldownTimes.remove(uuid); - abilityDurationTimes.remove(uuid); - abilityDurationBossBar.remove(uuid); - } - } - - public void killCooldownTask(UUID taskUUID) { - int taskId = cooldownTaskIds.get(taskUUID); - Bukkit.getScheduler().cancelTask(taskId); - cooldownTaskIds.remove(taskUUID); - } - - public void initializeCooldownTimer(String skillName) { //Used to make sure the cooldown if the player logs out before it starts - setPlayerCooldownTime(skillName,1); - } - - public void cooldownTimer(String skillName,String cooldownCompleteMessage) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - PlayerStats pStatClass = new PlayerStats(player); - Map> pStat = pStatClass.getPlayerData(); - ConfigLoad configLoad = new ConfigLoad(); - int cooldown = configLoad.getAbilityCooldowns().get(skillName); - if ((int) pStat.get("global").get(11) > 0) { - cooldown = (int) Math.round(cooldown*2.0/3.0); - } - setPlayerCooldownTime( skillName, cooldown); - UUID taskUUID = UUID.randomUUID(); - int taskId = new BukkitRunnable() { - @Override - public void run() { - int timeRemaining = getPlayerCooldownTime(skillName)-1; - if (timeRemaining <= 0) { - setPlayerCooldownTime(skillName,timeRemaining); - if (!player.isOnline()) { - removePlayer(); - } - else { - ActionBarMessages actionMessage = new ActionBarMessages(player); - actionMessage.sendMessage(cooldownCompleteMessage); - } - killCooldownTask(taskUUID); - } - else { - setPlayerCooldownTime(skillName,timeRemaining); - } - } - }.runTaskTimer(plugin, 20,20).getTaskId(); - cooldownTaskIds.put(taskUUID,taskId); - } - - public void abilityDurationTimer(String skillName,long duration,String endMessage,String cooldownEndMessage) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - initializeCooldownTimer(skillName); - setAbilityDurationTime(skillName,(int) duration); - int refreshTicks = 2; - UUID taskUUID = UUID.randomUUID(); - int taskID = new BukkitRunnable() { //The outer task is used for Ability time remaining bars and is accurate to 0.1 seconds on default - @Override - public void run() { - int timeRemaining = getPlayerDurationTime(skillName)-refreshTicks; - durationBarUpdate(skillName,timeRemaining,duration); - if (timeRemaining < refreshTicks) { - new BukkitRunnable() { - @Override - public void run() { - endAbility(skillName,endMessage,cooldownEndMessage,false); - } - }.runTaskLater(plugin,timeRemaining); - killDurationTask(taskUUID); //Kill this task as soon as the new task is scheduled - } - else { - setAbilityDurationTime(skillName,timeRemaining); - } - } - }.runTaskTimer(plugin,refreshTicks,refreshTicks).getTaskId(); - abilityDurationTaskIds.put(taskUUID,taskID); - AbilityLogoutTracker incaseLogout = new AbilityLogoutTracker(player); - incaseLogout.setPlayerTask(skillName,taskID); - } - - public void abilityDurationTimer(String skillName, long duration, String endMessage, String cooldownEndMessage, NamespacedKey key, ItemStack itemHeldInHand,int enchantLevel, int levelReqLevel) { //OverSpecified for Mining/Digging/Swordsmanship - this.itemInHand = itemHeldInHand; - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - initializeCooldownTimer(skillName); - setAbilityDurationTime(skillName,(int) duration); - int refreshTicks = 2; - UUID taskUUID = UUID.randomUUID(); - int taskID = new BukkitRunnable() { //The outer task is used for Ability time remaining bars and is accurate to 0.1 seconds on default - @Override - public void run() { - int timeRemaining = getPlayerDurationTime(skillName)-refreshTicks; - durationBarUpdate(skillName,timeRemaining,duration); - if (timeRemaining < refreshTicks) { - new BukkitRunnable() { - @Override - public void run() { - endAbility(skillName, endMessage, cooldownEndMessage, key, itemHeldInHand, enchantLevel, levelReqLevel,false); - } - }.runTaskLater(plugin,timeRemaining); - killDurationTask(taskUUID); //Kill this task as soon as the new task is scheduled - } - else { - setAbilityDurationTime(skillName,timeRemaining); - } - } - }.runTaskTimer(plugin,refreshTicks,refreshTicks).getTaskId(); - abilityDurationTaskIds.put(taskUUID,taskID); - AbilityLogoutTracker incaseLogout = new AbilityLogoutTracker(player); - incaseLogout.setPlayerItem(skillName,key); - incaseLogout.setPlayerTask(skillName,taskID); - } - - public void endAbility(String skillName,String endMessage,String cooldownEndMessage,boolean isDisabling) { - ActionBarMessages actionMessage = new ActionBarMessages(player); - AbilityTracker abilities = new AbilityTracker(player); - if (player.isOnline()) { - actionMessage.sendMessage(endMessage); - } - abilities.setPlayerAbility(skillName, -1); - durationBarUpdate(skillName,0,1); //The total duration doesn't matter here, the bar should be removed - if (!isDisabling) { - cooldownTimer(skillName, cooldownEndMessage); - } - } - - public void endAbility(String skillName,String endMessage, String cooldownEndMessage,NamespacedKey key,ItemStack itemHeldInHand, int enchantLevel, int levelReqLevel,boolean isDisabling) { - ActionBarMessages actionMessage = new ActionBarMessages(player); - AbilityTracker abilities = new AbilityTracker(player); - if (player.isOnline()) { - actionMessage.sendMessage(endMessage); - } - abilities.setPlayerAbility(skillName, -1); - durationBarUpdate(skillName,0,1); //The total duration doesn't matter here, the bar should be removed - if (skillName.equalsIgnoreCase("digging") || skillName.equalsIgnoreCase("mining")) { - TrackItem trackItem = new TrackItem(); - ItemStack potentialAbilityItem = trackItem.findTrackedItemInInventory(player,key); - if (potentialAbilityItem != null) { - itemHeldInHand = potentialAbilityItem; - } - itemHeldInHand.removeEnchantment(Enchantment.DIG_SPEED); - if (enchantLevel != 0) { - itemHeldInHand.addUnsafeEnchantment(Enchantment.DIG_SPEED, enchantLevel); - } - } - else if (skillName.equalsIgnoreCase("swordsmanship")) { - TrackItem trackItem = new TrackItem(); - ItemStack potentialAbilityItem = trackItem.findTrackedItemInInventory(player,key); - if (potentialAbilityItem != null) { - itemHeldInHand = potentialAbilityItem; - } - ((Attributable) player).getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(4.0); - if (levelReqLevel > 0) { - if (enchantLevel > 0) { - itemHeldInHand.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, enchantLevel); - } - else { - itemHeldInHand.removeEnchantment(Enchantment.DAMAGE_ALL); - } - } - } - if (!isDisabling) { - cooldownTimer(skillName, cooldownEndMessage); - } - } - - - public void killDurationTask(UUID taskID) { - int taskId = abilityDurationTaskIds.get(taskID); - Bukkit.getScheduler().cancelTask(taskId); - abilityDurationTaskIds.remove(taskID); - } - - public void setAbilityDurationTime(String skillName, int duration) { - initializeAbilityDurationTimes(); - Map playerAbilityDurations = abilityDurationTimes.get(uuid); - playerAbilityDurations.put(skillName,duration); - abilityDurationTimes.put(uuid,playerAbilityDurations); - } - - public void initializeAbilityDurationTimes() { - Map skillTimes = new ConcurrentHashMap<>(); - abilityDurationTimes.putIfAbsent(uuid,skillTimes); - } - - public int getPlayerDurationTime(String skillName) { - if (abilityDurationTimes.containsKey(uuid)) { - if (abilityDurationTimes.get(uuid).containsKey(skillName)) { - return abilityDurationTimes.get(uuid).get(skillName); - } - } - return 0; - } - - public void durationBarUpdate(String skillName,long timeRemaining,long totalDuration) { - BossBarStorage bossBarStorage = new BossBarStorage(); - PlayerStats playerStats = new PlayerStats(player); - int numberOfBossBarsAllowed = (int) playerStats.getPlayerData().get("global").get(28); - - if (!player.isOnline()) { //If the player is offline, the bossbar is gone, but we still want the task to run - return; - } - - //Get the bossbar object - BossBar durationBar = getPlayerBossBar(skillName); - if (durationBar == null) { //If the bossbar hasn't been stored yet, get it from the bossbarstorage class - int numberOfActiveBars = bossBarStorage.numberOfActiveDurationBars(player); - if (numberOfBossBarsAllowed <= numberOfActiveBars) { //If there's already too many ability bars running, don't add a new one - return; - } - else { - durationBar = bossBarStorage.getLowestUnoccupiedBar(player); - setPlayerBossBar(skillName, durationBar); - } - } - - - if (timeRemaining <= 0) { //If there's no time left, just remove the boss bar and set it to invisible/unused - durationBar.setVisible(false); - removeDurationBar(skillName); - return; - } - - //Set the bossbar for player viewing - LanguageSelector lang = new LanguageSelector(player); - double totalTime = (double) totalDuration; - double timeLeft = (double) timeRemaining; - double percentageTimeRemaining = timeLeft/totalTime; - double integerMultiple = 0.2; - double timeRemainingInSeconds = round((timeLeft/20.0),integerMultiple); - int roundingPlace = 0; - String integerMultipleString = String.valueOf(integerMultiple); - if (integerMultipleString.contains(".")) { - String[] splitter = integerMultipleString.split("\\."); - roundingPlace = splitter[1].length(); - } - String formatString = "%."+roundingPlace+"f"; - String timeRemainingInSecondsString = String.format(formatString, timeRemainingInSeconds); - durationBar.setProgress(percentageTimeRemaining); - durationBar.setTitle(ChatColor.GRAY + getAbilityName(skillName) + " " + lang.getString("timeRemaining") + ": " + ChatColor.WHITE + timeRemainingInSecondsString + ChatColor.GRAY + "s"); - durationBar.setVisible(true); - - } - - public double round(double num, double integerMultipleOf) { - return Math.round(num/integerMultipleOf)*integerMultipleOf; - } - - public String getAbilityName(String skillName) { - LanguageSelector lang = new LanguageSelector(player); - switch (skillName) { - case "archery": - return lang.getString("rapidFire"); - case "axeMastery": - return lang.getString("greatAxe"); - case "beastMastery": - return lang.getString("spurKick"); - case "defense": - return lang.getString("stoneSoldier"); - case "digging": - return lang.getString("bigDig"); - case "farming": - return lang.getString("naturalRegeneration"); - case "fishing": - return lang.getString("superBait"); - case "mining": - return lang.getString("berserkPick"); - case "swordsmanship": - return lang.getString("swiftStrikes"); - case "woodcutting": - return lang.getString("timber"); - default: - return ""; - - } - } - - public void initializePlayerBossBars() { - Map skillBossBars = new ConcurrentHashMap<>(); - abilityDurationBossBar.putIfAbsent(uuid,skillBossBars); - } - - public BossBar getPlayerBossBar(String skillName) { - if (abilityDurationBossBar.containsKey(uuid)) { - if (abilityDurationBossBar.get(uuid).containsKey(skillName)) { - return abilityDurationBossBar.get(uuid).get(skillName); - } - } - return null; - } - public void setPlayerBossBar(String skillName, BossBar durationBar) { - initializePlayerBossBars(); - Map playerAbilityDurationBars = abilityDurationBossBar.get(uuid); - playerAbilityDurationBars.put(skillName,durationBar); - abilityDurationBossBar.put(uuid,playerAbilityDurationBars); - } - public void removeDurationBar(String skillName) { - if (abilityDurationBossBar.containsKey(uuid)) { - if (abilityDurationBossBar.get(uuid).containsKey(skillName)) { - Map playerAbilityDurationBars = abilityDurationBossBar.get(uuid); - playerAbilityDurationBars.remove(skillName); - abilityDurationBossBar.putIfAbsent(uuid,playerAbilityDurationBars); - } - } - } - -} diff --git a/src/main/java/mc/carlton/freerpg/playerInfo/AbilityTracker.java b/src/main/java/mc/carlton/freerpg/playerInfo/AbilityTracker.java deleted file mode 100644 index 17db562..0000000 --- a/src/main/java/mc/carlton/freerpg/playerInfo/AbilityTracker.java +++ /dev/null @@ -1,141 +0,0 @@ -package mc.carlton.freerpg.playerInfo; - -import org.bukkit.entity.Player; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -public class AbilityTracker { - private Player player; - private UUID uuid; - static Map playerAbilities = new HashMap(); - - public AbilityTracker(Player p) { - this.player = p; - this.uuid = player.getUniqueId(); - } - - public Integer[] getPlayerAbilities() { - if (!playerAbilities.containsKey(uuid)) { - Integer[] initAbils = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; - playerAbilities.put(uuid,initAbils); - } - return playerAbilities.get(uuid); - } - public Map getAbilities() { - if (!playerAbilities.containsKey(uuid)) { - Integer[] initAbils = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; - playerAbilities.put(uuid,initAbils); - } - return playerAbilities; - } - - public void setPlayerAbility(String ability,int taskID) { - if (!playerAbilities.containsKey(uuid)) { - return; - } - Integer[] pAbils = playerAbilities.get(uuid); - switch(ability) { - case "digging": - pAbils[0] = taskID; - break; - case "woodcutting": - pAbils[1] = taskID; - break; - case "mining": - pAbils[2] = taskID; - break; - case "farming": - pAbils[3] = taskID; - break; - case "fishing": - pAbils[4] = taskID; - break; - case "archery": - pAbils[5] = taskID; - break; - case "beastMastery": - pAbils[6] = taskID; - break; - case "swordsmanship": - pAbils[7] = taskID; - break; - case "defense": - pAbils[8] = taskID; - break; - case "axeMastery": - pAbils[9] = taskID; - break; - case "woodcuttingHaste": - pAbils[10] = taskID; - break; - case "diggingToggle": - pAbils[11] = taskID; - break; - case "archeryCrossbow": - pAbils[12] = taskID; - break; - case "swordsSpeed": - pAbils[13] = taskID; - break; - case "swordsStrength": - pAbils[14] = taskID; - break; - default: - break; - } - playerAbilities.put(uuid,pAbils); - } - - public int getPlayerAbility(String ability) { - if (!playerAbilities.containsKey(uuid)) { - Integer[] initAbils = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; - playerAbilities.put(uuid,initAbils); - } - Integer[] pAbils = playerAbilities.get(uuid); - switch(ability) { - case "digging": - return pAbils[0]; - case "woodcutting": - return pAbils[1]; - case "mining": - return pAbils[2]; - case "farming": - return pAbils[3]; - case "fishing": - return pAbils[4]; - case "archery": - return pAbils[5]; - case "beastMastery": - return pAbils[6]; - case "swordsmanship": - return pAbils[7]; - case "defense": - return pAbils[8]; - case "axeMastery": - return pAbils[9]; - case "woodcuttingHaste": - return pAbils[10]; - case "diggingToggle": - return pAbils[11]; - case "archeryCrossbow": - return pAbils[12]; - case "swordsSpeed": - return pAbils[13]; - case "swordsStrength": - return pAbils[14]; - default: - return -1; - } - } - - public void setAbilities(Map abilities) { - this.playerAbilities = abilities; - } - public void removePlayer() { - playerAbilities.remove(uuid); - } - - -} diff --git a/src/main/java/mc/carlton/freerpg/playerInfo/ChangeStats.java b/src/main/java/mc/carlton/freerpg/playerInfo/ChangeStats.java deleted file mode 100644 index e2cab26..0000000 --- a/src/main/java/mc/carlton/freerpg/playerInfo/ChangeStats.java +++ /dev/null @@ -1,849 +0,0 @@ -package mc.carlton.freerpg.playerInfo; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.gameTools.ActionBarMessages; -import mc.carlton.freerpg.gameTools.BossBarStorage; -import mc.carlton.freerpg.gameTools.LanguageSelector; -import mc.carlton.freerpg.guiEvents.MaxPassiveLevels; -import mc.carlton.freerpg.leaveAndJoin.LogoutProcedure; -import mc.carlton.freerpg.perksAndAbilities.*; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.GameMode; -import org.bukkit.Sound; -import org.bukkit.boss.BarColor; -import org.bukkit.boss.BossBar; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - -public class ChangeStats { - private Player p; - private String pName; - private UUID uuid; - private boolean isCommand; - private boolean isSilent; - ArrayList multipliers; - ArrayList tokensInfo; - ArrayList levelingInfo; - Map maxLevels; - ActionBarMessages actionMessage; - static Map isPlayerFlashingText = new ConcurrentHashMap<>(); - static Map playerRemoveEXPBarTaskIdMap = new ConcurrentHashMap<>(); - Map allowedSkillsMap = new HashMap<>(); - Map allowedSkillGainEXPMap = new HashMap<>(); - String beginnerLevelUpMessage; - int maxLevelForBeginnerMessage; - - public ChangeStats(Player p) { - this.p = p; - this.pName = p.getDisplayName(); - this.uuid = p.getUniqueId(); - ConfigLoad loadConfig = new ConfigLoad(); - maxLevels = loadConfig.getMaxLevels(); - multipliers = loadConfig.getMultipliers(); - tokensInfo = loadConfig.getTokensInfo(); - levelingInfo = loadConfig.getLevelingInfo(); - this.isCommand = false; - this.isSilent = false; - this.actionMessage = new ActionBarMessages(p); - this.allowedSkillsMap = loadConfig.getAllowedSkillsMap(); - this.allowedSkillGainEXPMap = loadConfig.getAllowedSkillGainEXPMap(); - this.beginnerLevelUpMessage = loadConfig.getBeginnerLevelUpMessage(); - this.maxLevelForBeginnerMessage = loadConfig.getMaxLevelForBeginnerMessage(); - } - - public void set_isCommand(boolean isFromCommand) { - this.isCommand = isFromCommand; - } - public void set_silent(boolean isSilentExectuion) {this.isSilent = isSilentExectuion;} - public boolean checkPerms(String skillName) { - boolean hasPerms = true; - String perm = "freeRPG." + skillName +"EXP"; - if (!p.hasPermission(perm)) { - hasPerms = false; - } - return hasPerms; - } - - public void changeEXP(String skillName,int expChange) { - boolean hasPerms = checkPerms(skillName); - if (!hasPerms) { - return; - } - if (p.getGameMode() == GameMode.CREATIVE && !isCommand) { - return; - } - if (expChange <= 0) { - return; - } - if (!skillName.equals("global")) { - LanguageSelector lang = new LanguageSelector(p); - String[] titles_0 = {lang.getString("digging"),lang.getString("woodcutting"),lang.getString("mining"),lang.getString("farming"),lang.getString("fishing"),lang.getString("archery"),lang.getString("beastMastery"),lang.getString("swordsmanship"),lang.getString("defense"),lang.getString("axeMastery"),lang.getString("repair"),lang.getString("agility"),lang.getString("alchemy"),lang.getString("smelting"),lang.getString("enchanting"),lang.getString("global")}; - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting","global"}; - List labels_arr = Arrays.asList(labels_0); - String skillTitle = titles_0[labels_arr.indexOf(skillName)]; - - //Check if gaining skill EXP is disabled or the skill is disabled - if (!allowedSkillGainEXPMap.get(skillName) || !allowedSkillsMap.get(skillName)) { - return; - } - - //Get stats - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ArrayList pStats = pStatAll.get(skillName); - ArrayList pGlobalStats = pStatAll.get("global"); - - //Multipliers - if (!isCommand) { - expChange = (int) Math.ceil(expChange * getSkillMultiplier(skillName)); //multiplies exp by all mutlipliers - } - - //Get Corresponding maxLevel - int maxLevel = getMaxLevel(skillName); - - //TokensInfo - double autoPassive = tokensInfo.get(0); - double levelsPerPassive = tokensInfo.get(1); - double levelsPerSkill = tokensInfo.get(2); - double levelsPerGlobal = tokensInfo.get(3); - - // get old stats - int exp = pStats.get(1).intValue(); - int oldLevel = pStats.get(0).intValue(); - int oldGlobalLevel = pGlobalStats.get(0).intValue(); - int tokens_S = (int)pStats.get(3); - int tokens_P = (int)pStats.get(2); - int tokens_G = (int)pGlobalStats.get(1); - - //If currently level is already maxed, do nothing - if (oldLevel >= maxLevel) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.isEarnExperiencePastMaxLevel()) { - return; - } - } - - - // set new stats - exp += expChange; - int totalEXP = (int)pGlobalStats.get(29)+expChange; - int level = 0; - int newTokens_S = 0; - int newTokens_P = 0; - int newTokens_G = 0; - level = getLevelfromEXP(exp); - - //if new level is greater than the max level, set it to the max level - boolean isMaxLevel = false; - if (level >= maxLevel) { - level = maxLevel; - isMaxLevel = true; - } - - - //EXP bar - setupBossBar(exp,oldLevel,level,skillTitle,skillName,expChange,isMaxLevel); - - - int levelChange = level - oldLevel; - int globalLevel = oldGlobalLevel + levelChange; - if (levelChange > 0) { - int oldLevel_s = (int)Math.floor(oldLevel/levelsPerSkill); - int level_s = (int) Math.floor(level/levelsPerSkill); - int oldLevel_g = (int)Math.floor(oldGlobalLevel/levelsPerGlobal); - int level_g = (int) Math.floor(globalLevel/levelsPerGlobal); - newTokens_S = level_s-oldLevel_s; - newTokens_G = level_g-oldLevel_g; - int extraSkillTokens = -100; - int extraGlobalTokens = -100; - boolean gainedGlobalToken = false; - int passiveBoost = 0; - if (newTokens_S > 0) { - extraSkillTokens = areSkillsMaxed(skillName,newTokens_S); - if (extraSkillTokens >= 0) { - newTokens_S -= extraSkillTokens; - } - } - if (newTokens_G > 0) { - gainedGlobalToken = true; - extraGlobalTokens = areGlobalPerksMaxed(newTokens_G); - if (extraGlobalTokens >= 0) { - newTokens_G -= extraGlobalTokens; - ConfigLoad loadConfig = new ConfigLoad(); - double multiplierIncrease = extraGlobalTokens*loadConfig.getTokensInfo().get(8); - changeStat("global",23,multiplierIncrease); - } - } - if (!skillName.equals("repair") && !skillName.equals("agility") && !skillName.equals("alchemy") && !skillName.equals("smelting") && !skillName.equals("enchanting")) { - int oldLevel_p = (int)Math.floor(oldLevel/levelsPerPassive); - int level_p = (int) Math.floor(level/levelsPerPassive); - newTokens_P = level_p-oldLevel_p; - if (extraSkillTokens > 0) { - ConfigLoad loadConfig = new ConfigLoad(); - newTokens_P +=(int) (extraSkillTokens*loadConfig.getTokensInfo().get(7)); - } - } - else { - if (extraSkillTokens > 0) { - ConfigLoad loadConfig = new ConfigLoad(); - passiveBoost += (int) (extraSkillTokens*loadConfig.getTokensInfo().get(7)); - } - } - tokens_S += newTokens_S; - tokens_P += newTokens_P; - tokens_G += newTokens_G; - String bars = "------------------------------------------------"; - String levelUpMessage = skillTitle + " " + lang.getString("level") + " " + level + "!"; - String sbSpace = ""; - int spaces = bars.length() - levelUpMessage.length(); - if (!(spaces % 2 == 0)){ - bars += "-"; - spaces -= 1; - } - for (int i=0; i < spaces/2.0; i++) { - sbSpace += " "; - } - if ((int)pGlobalStats.get(21) > 0 && !isSilent) { //Level Up Message Toggle Conditional - if (gainedGlobalToken) { - p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_HARP, 1, 1); - if (newTokens_G>0 && extraGlobalTokens <= 0) { - p.sendTitle(ChatColor.DARK_PURPLE + lang.getString("globalPassiveTitle0") + " " + "+" + newTokens_G, ChatColor.YELLOW + lang.getString("try0") + " /frpg skillTree global", 5, 40, 20); - } - else { - ConfigLoad loadConfig = new ConfigLoad(); - double multiplierIncrease = extraGlobalTokens*loadConfig.getTokensInfo().get(8); - String percentageIncreaseString = String.valueOf(multiplierIncrease*100)+"%"; - p.sendTitle(ChatColor.DARK_PURPLE + lang.getString("expIncrease") + " +" + percentageIncreaseString,ChatColor.RED + lang.getString("globalPassiveTitle0") + " " + "+" + newTokens_G, 5, 40, 20); - } - } - if (newTokens_S > 0 || oldLevel < 3) { - p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_HARP, 1, 1); - p.sendMessage(bars); - p.sendMessage(ChatColor.GREEN + ChatColor.BOLD.toString() + sbSpace + levelUpMessage); - if (newTokens_P > 0) { - p.sendMessage(ChatColor.LIGHT_PURPLE + "+" + newTokens_P + " " + lang.getString("diggingPassiveTitle0")); - } - if (newTokens_S > 0) { - p.sendMessage(ChatColor.GOLD + "+" + newTokens_S + " " + lang.getString("diggingPassiveTitle2")); - } - if (newTokens_G > 0) { - p.sendMessage(ChatColor.DARK_PURPLE + "+" + newTokens_G + " " + lang.getString("globalPassiveTitle0")); - } - if (oldLevel < maxLevelForBeginnerMessage) { - p.sendMessage(""); - if (!beginnerLevelUpMessage.equalsIgnoreCase("")) { - p.sendMessage(ChatColor.ITALIC + beginnerLevelUpMessage); - } - else { - p.sendMessage(ChatColor.ITALIC + lang.getString("passiveImprove")); - p.sendMessage(ChatColor.ITALIC + lang.getString("try0") + " /frpg skillTree " + skillName); - } - } - p.sendMessage(bars); - } else { - actionMessage.sendMessage(ChatColor.YELLOW + skillTitle + " "+lang.getString("increasedBy")+" " + Integer.toString(levelChange) + ". (" + level + ")"); - } - } - pStats.set(0, level); //Level change - pStats.set(2, tokens_P); //Passive token change - pStats.set(3, tokens_S); //Skill token change - int autoPassivesChange = 0; - int oldLevel_auto_p = (int)Math.floor(oldLevel/autoPassive); - int level_auto_p = (int) Math.floor(level/autoPassive); - autoPassivesChange = level_auto_p-oldLevel_auto_p; - pStats.set(4, (int) pStats.get(4) + autoPassivesChange+passiveBoost); //Duration (passive 1) Boost - MaxPassiveLevels passiveMax = new MaxPassiveLevels(); - int passiveMax2 = passiveMax.findMaxLevel(skillName, 2); - int passiveMax3 = passiveMax.findMaxLevel(skillName, 3); - pStats.set(5, (int) Math.min((int) pStats.get(5) + autoPassivesChange+passiveBoost, passiveMax2)); //Passive 2 Boost - pStats.set(6, (int) Math.min((int) pStats.get(6) + autoPassivesChange+passiveBoost, passiveMax3)); //Passive 3 Boost - pGlobalStats.set(0, globalLevel); //Global level change - pGlobalStats.set(1, tokens_G); //Global token change - } - - pStats.set(1, exp); //Set skill exp - pGlobalStats.set(29,totalEXP); //Set global exp - - // Sets stats - pStatAll.put(skillName, pStats); - pStatAll.put("global", pGlobalStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - - //Update Player Leaderboard - ConfigLoad configLoad = new ConfigLoad(); - if (configLoad.isLeaderboardDyanmicUpdate()) { - Leaderboards leaderboards = new Leaderboards(); - leaderboards.updatePlayerStats(p, skillName, exp, level); //Updates skill - leaderboards.updatePlayerStats(p, "global", globalLevel, totalEXP); //Updates Global - } - } - } - - /* Currently Broken - private int getPassiveTokenIncrease(int oldLevel, int newLevel){ - double levelsPerPassive = tokensInfo.get(1); - int oldLevel_p = (int)Math.floor(oldLevel/levelsPerPassive); - int level_p = (int) Math.floor(newLevel/levelsPerPassive); - int newTokens_P = level_p-oldLevel_p; - return newTokens_P; - } - - */ - - private int getAutomaticPassiveSkillIncrease(String skillName,int oldLevel, int newLevel,int passiveSkillIndex) { - - //Get current passive tokens - ArrayList pStats = getPlayerSkillStats(skillName); - int passiveSkillLevel = (int) pStats.get(3+passiveSkillIndex); //Get the passive skill level - - //Get automatic passive tokens gained - int autoPassivesChange = getAutoPassiveChange(oldLevel,newLevel); - - //Get the max passive skill level - MaxPassiveLevels passiveMax = new MaxPassiveLevels(); - int passiveMaxLevel = passiveMax.findMaxLevel(skillName, passiveSkillIndex); - - //Determine how many tokens to add - int automaticPassiveTokensGained; - if (passiveSkillLevel + autoPassivesChange >= passiveMaxLevel) { - automaticPassiveTokensGained = passiveMaxLevel - passiveSkillLevel; //Reward the player just enough to get them the max - } else { - automaticPassiveTokensGained = autoPassivesChange; //Reward the player the normal amount - } - - return automaticPassiveTokensGained; - } - - private int getAutoPassiveChange(int oldLevel, int newLevel) { - double autoPassive = tokensInfo.get(0); - int oldLevel_auto_p = (int)Math.floor(oldLevel/autoPassive); - int level_auto_p = (int) Math.floor(newLevel/autoPassive); - int autoPassivesChange = level_auto_p-oldLevel_auto_p; - return autoPassivesChange; - } - - /* CURRENTLY BROKEN - private int getSkillTokenIncrease(int oldLevel, int newLevel) { - double levelsPerSkill = tokensInfo.get(2); - int oldLevel_s = (int)Math.floor(oldLevel/levelsPerSkill); - int level_s = (int) Math.floor(newLevel/levelsPerSkill); - int newTokens_S = level_s-oldLevel_s; - return newTokens_S; - } - - */ - - private int getGlobalTokenIncrease(int oldLevel, int newLevel) { - double levelsPerGlobal = tokensInfo.get(3); - int oldLevel_g = (int)Math.floor(oldLevel/levelsPerGlobal); - int level_g = (int) Math.floor(newLevel/levelsPerGlobal); - int newTokens_G = level_g-oldLevel_g; - if (newTokens_G > 0) { - int extraGlobalTokens = areGlobalPerksMaxed(newTokens_G); - if (extraGlobalTokens >= 0) { - newTokens_G = newTokens_G - extraGlobalTokens; - } - } - return newTokens_G; - } - - public double getSkillMultiplier(String skillName) { - PlayerStats pStatClass = new PlayerStats(p); - ArrayList pGlobalStats = pStatClass.getPlayerData().get("global"); - Global globalClass = new Global(p); - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting","global"}; - List labels_arr = Arrays.asList(labels_0); - return ((double)pGlobalStats.get(23) * multipliers.get(0)) * (multipliers.get(labels_arr.indexOf(skillName) + 1)) * (globalClass.expBoost(skillName)); - } - - public void checkPlayerLevelEXPCurveConsistency() { - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - set_silent(true); - set_isCommand(true); - PlayerStats pStatClass = new PlayerStats(p); - Map>> allStats = pStatClass.getData(); - Map> pStats = allStats.get(p.getUniqueId()); - Map expTotalMap = new HashMap<>(); - boolean statsNeedToBeChanged = false; - for (String label : labels_0) { - int maxLevel = getMaxLevel(label); - ArrayList pStat = pStats.get(label); - int exp = (int) pStat.get(1); - expTotalMap.put(label,exp); - int level = (int) pStat.get(0); - int expectedLevel = getLevelfromEXP(exp); - if (level != expectedLevel && level < maxLevel) { - statsNeedToBeChanged = true; - } - } - if (statsNeedToBeChanged) { - resetStat("global"); - String[] labels_1 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - for (String label : labels_1) { - resetStat(label); //Reset all stats - } - for (String label : labels_1) { //Might cause global token errors if done in the same loop - changeEXP(label, expTotalMap.get(label)); //Increase experience for all stats - } - LanguageSelector lang = new LanguageSelector(p); - p.sendMessage(ChatColor.RED + lang.getString("statsUpdated")); - } - } - - public void resetStat(String skillName) { - PlayerStats pStatClass = new PlayerStats(p); - Map>> allStats = pStatClass.getData(); - Map> pStats = allStats.get(p.getUniqueId()); - ArrayList pStat = pStats.get(skillName); - int maxIndex = 13; - if (skillName.equalsIgnoreCase("global")) { - maxIndex = 11; - } - for (int i = 0; i <= maxIndex; i++) { - pStat.set(i, 0); - } - pStats.put(skillName, pStat); - allStats.put(p.getUniqueId(), pStats); - pStatClass.setData(allStats); - setTotalLevel(); - setTotalExperience(); - if (!skillName.equalsIgnoreCase("global")) { - //Currently disabled to prevent accidental infinite skill token gain - //reevaluatedGlobalTree(); - } - } - - public void reevaluatedGlobalTree() { - resetStat("global"); - setTotalLevel(); - ArrayList globalStats = getPlayerSkillStats("global"); - int globalTokens = getGlobalTokenIncrease(0,(int) globalStats.get(0)); - setStat("global",1,globalTokens); - } - - public void refundSkillTree(String skillName) { - endSkillTasks(skillName); //Ends tasks like "Fish Person" and other repeating tasks - resetSkillTokens(skillName); //Refund skill tokens - resetPassiveTokens(skillName); //Refund passive tokens - } - - private void resetSkillTokens(String skillName) { - ArrayList pStats = getPlayerSkillStats(skillName); - //Find Skill Tokens, Refund skill tokens, set skills to 0 - if (!skillName.equalsIgnoreCase("global")) { - int totalSkillTokens = ((int) pStats.get(3) + (int) pStats.get(7) + (int) pStats.get(8) + (int) pStats.get(9) + (int) pStats.get(10) + (int) pStats.get(11) + (int) pStats.get(12) + (int) pStats.get(13)); - setStat(skillName, 3, totalSkillTokens); - setStat(skillName, 7, 0); - setStat(skillName, 8, 0); - setStat(skillName, 9, 0); - setStat(skillName, 10, 0); - setStat(skillName, 11, 0); - setStat(skillName, 12, 0); - setStat(skillName, 13, 0); - } else { - int totalGlobalTokens = ((int) pStats.get(1) + (int) pStats.get(2) + (int) pStats.get(3) + (int) pStats.get(4) - + (int) pStats.get(5) + (int) pStats.get(6) + (int) pStats.get(7) + (int) pStats.get(8) - + (int) pStats.get(9) + (int) pStats.get(10) + (int) pStats.get(11)); - setStat(skillName, 1, totalGlobalTokens); - setStat(skillName, 2, 0); - setStat(skillName, 3, 0); - setStat(skillName, 4, 0); - setStat(skillName, 5, 0); - setStat(skillName, 6, 0); - setStat(skillName, 7, 0); - setStat(skillName, 8, 0); - setStat(skillName, 9, 0); - setStat(skillName, 10, 0); - setStat(skillName, 11, 0); - } - } - - private void resetPassiveTokens(String skillName) { - String[] mainSkills_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery"}; - List mainSkills = Arrays.asList(mainSkills_0); - ArrayList pStats = getPlayerSkillStats(skillName); - if (mainSkills.contains(skillName)) { - int level = (int) pStats.get(0); - int automaticPassiveTokens = getAutoPassiveChange(0,level); - - // Set new passive tokens to spend - // passive tokens to spend = Total current tokens + investments into 3 passive skills - automatic tokens gained in 3 passive skills - int totalPassiveTokens = (int) pStats.get(2) + //Current passive tokens - Math.max((int) pStats.get(4) - automaticPassiveTokens,0) + //Tokens invested into passive 1 - Math.max((int) pStats.get(5) - automaticPassiveTokens,0) + //Tokens invested into passive 2 - Math.max((int) pStats.get(6) - automaticPassiveTokens,0); //Tokens invested into passive 3 - setStat(skillName, 2, totalPassiveTokens); - - //Get maximum passive skill levels - MaxPassiveLevels maxPassiveLevels = new MaxPassiveLevels(); - - //Set passive skills to what they would have been if no skill points were invested - setStat(skillName, 4, Math.min(automaticPassiveTokens,maxPassiveLevels.findMaxLevel(skillName,1))); - setStat(skillName, 5, Math.min(automaticPassiveTokens,maxPassiveLevels.findMaxLevel(skillName,2))); - setStat(skillName, 6, Math.min(automaticPassiveTokens,maxPassiveLevels.findMaxLevel(skillName,3))); - } - } - - private void endSkillTasks(String skillName){ - ArrayList pStats = getPlayerSkillStats(skillName); - - //We use some methods from logoutProcedure - LogoutProcedure logoutProcedure = new LogoutProcedure(p); - if (skillName.equalsIgnoreCase("swordsmanship")) { - logoutProcedure.preventLogoutTheftSwordsmanship(false); - } else if (skillName.equalsIgnoreCase("defense")) { - logoutProcedure.preventLogoutTheftDefense(false); - } else if (skillName.equalsIgnoreCase("mining")) { - logoutProcedure.preventLogoutTheftMining(false); - } else if (skillName.equalsIgnoreCase("digging")) { - logoutProcedure.preventLogoutTheftDigging(false); - } - - //Ends all tasks that track players' buffs gained from some skills - if (skillName.equals("farming") && (int) pStats.get(13) > 0) { - Farming farmingClass = new Farming(p); - farmingClass.oneWithNatureEnd(); - } else if (skillName.equals("fishing") && (int) pStats.get(13) > 0) { - Fishing fishingClass = new Fishing(p); - fishingClass.fishPersonEnd(); - } else if (skillName.equals("agility") && (int) pStats.get(13) > 0) { - Agility agilityClass = new Agility(p); - agilityClass.gracefulFeetEnd(); - } else if (skillName.equals("defense") && (int) pStats.get(13) > 0) { - Defense defenseClass = new Defense(p); - defenseClass.toggleHearty(0,(int) getPlayerSkillStats("global").get(30)); - } - } - - private ArrayList getPlayerSkillStats(String skillName) { - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ArrayList pStats = pStatAll.get(skillName); - return pStats; - } - - public int areSkillsMaxed(String skillName,int skillTokensGained){ - String[] passive_skills_0 = {"repair","agility","alchemy","smelting","enchanting"}; - List passiveSkills = Arrays.asList(passive_skills_0); - int maxSkillTokens = 23; - int currentSkillTotal = 0; - if (passiveSkills.contains(skillName)) { - maxSkillTokens = 11; - } - - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ArrayList pStats = pStatAll.get(skillName); - currentSkillTotal = (int) pStats.get(3) + (int) pStats.get(7) + (int) pStats.get(8) + (int) pStats.get(9) + (int) pStats.get(10) + (int) pStats.get(11) + (int) pStats.get(12) + (int) pStats.get(13); - currentSkillTotal += skillTokensGained; - return currentSkillTotal-maxSkillTokens; - } - - public int areGlobalPerksMaxed(int globalTokensGained) { - int maxGlobalTotal = 10; - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ArrayList pStats = pStatAll.get("global"); - int currentGlobalTotal = globalTokensGained + (int) pStats.get(1) + (int) pStats.get(2) + (int) pStats.get(3) + (int) pStats.get(4) + (int) pStats.get(5) + (int) pStats.get(6) + (int) pStats.get(7) + (int) pStats.get(8) +(int) pStats.get(9) +(int) pStats.get(10) +(int) pStats.get(11); - return currentGlobalTotal - maxGlobalTotal; - } - - public int getMaxLevel(String skillName) { - int maxLevel = (int) maxLevels.get(skillName); - if (maxLevel == -1) { - maxLevel = maxLevels.get("global"); - if (maxLevel == - 1) { - maxLevel = Integer.MAX_VALUE; - } - } - return maxLevel; - } - - public int getEXPfromLevel(int level) { - double B = levelingInfo.get(1); - int referenceLevel = (int) Math.round(levelingInfo.get(2)); - int referenceEXP = (int) Math.round(levelingInfo.get(3)); - int linearStartingLevel = (int) Math.round(levelingInfo.get(4)); - int linearEXP = (int) Math.round(levelingInfo.get(5)); - int EXP = 0; - if (level > linearStartingLevel) { - int exponentialMaxEXP = getEXPfromLevel(linearStartingLevel); - EXP = exponentialMaxEXP + linearEXP*(level-linearStartingLevel); - } - else { - EXP = (int) Math.floor(referenceEXP * ((Math.pow(B, level) - 1) / (Math.pow(B, referenceLevel) - 1))); - } - return EXP; - } - - public int getLevelfromEXP(int exp) { - double B = levelingInfo.get(1); - int referenceLevel = (int) Math.round(levelingInfo.get(2)); - int referenceEXP = (int) Math.round(levelingInfo.get(3)); - int linearStartingLevel = (int) Math.round(levelingInfo.get(4)); - int linearEXP = (int) Math.round(levelingInfo.get(5)); - int exponentialMaxEXP = getEXPfromLevel(linearStartingLevel); - int level = 0; - if (exp <= exponentialMaxEXP) { - level = (int) Math.floor(((Math.log( (exp*(1.0/referenceEXP)*(Math.pow(B, referenceLevel)-1)) +1) / Math.log(B)))); - } - else { - level = (int) Math.floor((exp-exponentialMaxEXP)/linearEXP) + linearStartingLevel; - } - return level; - } - - public void increaseTokens(String skillName,String type,int amount) { - //Get stats - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ArrayList pStats = pStatAll.get(skillName); - ArrayList pGlobalStats = pStatAll.get("global"); - switch (type) { - case "global": - int tokens_G = (int) pGlobalStats.get(1); - int extraGlobalTokens = areGlobalPerksMaxed(amount); - if (extraGlobalTokens > 0) { - amount -= extraGlobalTokens; - ConfigLoad loadConfig = new ConfigLoad(); - double multiplierIncrease = extraGlobalTokens*loadConfig.getTokensInfo().get(8); - changeStat("global",23,multiplierIncrease); - } - pGlobalStats.set(1, tokens_G + amount); - break; - case "passive": - int tokens_P = (int) pStats.get(2); - pStats.set(2, tokens_P+amount); - break; - case "skill": - int tokens_S = (int) pStats.get(3); - int extraSkillTokens = areSkillsMaxed(skillName,amount); - if (extraSkillTokens > 0) { - amount -= extraSkillTokens; - if (!skillName.equals("repair") && !skillName.equals("agility") && !skillName.equals("alchemy") && !skillName.equals("smelting") && !skillName.equals("enchanting")) { - int newTokens_P = 0; - if (extraSkillTokens > 0) { - ConfigLoad loadConfig = new ConfigLoad(); - newTokens_P += (int) (extraSkillTokens * loadConfig.getTokensInfo().get(7)); - } - pStats.set(2, (int) pStats.get(2) + newTokens_P); - } else { - int passiveBoost = 0; - if (extraSkillTokens > 0) { - ConfigLoad loadConfig = new ConfigLoad(); - passiveBoost += (int) (extraSkillTokens * loadConfig.getTokensInfo().get(7)); - } - pStats.set(4, (int) pStats.get(4) + passiveBoost); - } - } - pStats.set(3, tokens_S+amount); - break; - default: - break; - } - - // Sets stats - pStatAll.put(skillName, pStats); - pStatAll.put("global", pGlobalStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - } - - public void changeStat(String skillName,int statIndex, Number valueChange) { - //Get stats - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ArrayList pStats = pStatAll.get(skillName); - - //change stat - if (skillName.equalsIgnoreCase("global") && statIndex == 23) { - double originalValue = (double) pStats.get(statIndex); - double valueChangeDouble = (double) valueChange; - pStats.set(statIndex, Math.round((originalValue + valueChangeDouble)*100000.0)/100000.0); - } - else { - int originalValue = (int) pStats.get(statIndex); - int valueChangeInt = (int) valueChange; - pStats.set(statIndex, originalValue + valueChangeInt); - } - - // Sets stats - pStatAll.put(skillName, pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - } - - public void setStat(String skillName,int statIndex, Number newValue ) { - //Get stats - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ArrayList pStats = pStatAll.get(skillName); - - //change stat - if (skillName.equalsIgnoreCase("global") && statIndex == 23) { - double newValueDouble = (double) newValue; - pStats.set(statIndex, newValueDouble); - } - else { - int newValueInt = (int) newValue; - pStats.set(statIndex, newValueInt); - } - - // Sets stats - pStatAll.put(skillName, pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - } - - public int setTotalLevel() { - int totalLevel = 0; - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - //Get stats - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ArrayList pStats = pStatAll.get("global"); - - //Calculate total Level - for (String skillName : labels_0) { - totalLevel += (int) pStatAll.get(skillName).get(0); - } - - //set total Level - pStats.set(0,totalLevel); - pStatAll.put("global", pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - - return totalLevel; - } - - public int setTotalExperience() { - int totalExperience = 0; - String[] labels_0 = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - //Get stats - PlayerStats pStatClass = new PlayerStats(p); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ArrayList pStats = pStatAll.get("global"); - - //Calculate total Level - for (String skillName : labels_0) { - totalExperience += (int) pStatAll.get(skillName).get(1); - } - - //set total Level - pStats.set(29,totalExperience); - pStatAll.put("global", pStats); - statAll.put(uuid, pStatAll); - pStatClass.setData(statAll); - - return totalExperience; - } - - public void setupBossBar(int exp, int oldLevel,int newLevel,String skillTitle,String skillName,int expChange,boolean isMaxed){ - PlayerStats pStatClass = new PlayerStats(p); - Map> pStat = pStatClass.getPlayerData(); - if ((int)pStat.get("global").get(25) < 1 || !pStatClass.isPlayerSkillExpBarOn(skillName)) { - return; - } - if (isPlayerFlashingText.containsKey(p)) { - if (isPlayerFlashingText.get(p)) { - return; - } - } - LanguageSelector lang = new LanguageSelector(p); - if (newLevel > oldLevel) { - BossBarStorage bossBarStorage = new BossBarStorage(); - BossBar expBar = bossBarStorage.getPlayerExpBar(p); - expBar.setProgress(1.0); - String message = skillTitle.toUpperCase() + " " + lang.getString("level").toUpperCase() + " " + newLevel + "!"; - expBar.setVisible(true); - flashEXPBarText(message,ChatColor.GOLD,ChatColor.DARK_PURPLE,expBar); - removeEXPBar(expBar); - } - else { - if (isMaxed) { - oldLevel = getLevelfromEXP(exp); - } - int lastLevelEXP = getEXPfromLevel(oldLevel); - int nextLevelEXP = getEXPfromLevel(oldLevel+1); - double progressEXP = Math.max(exp - lastLevelEXP,0); - double neededEXP = nextLevelEXP-lastLevelEXP; - double percentProgress = Math.min(progressEXP/neededEXP,1.0); - BossBarStorage bossBarStorage = new BossBarStorage(); - BossBar expBar = bossBarStorage.getPlayerExpBar(p); - expBar.setProgress(percentProgress); - if (!isMaxed) { - expBar.setColor(BarColor.GREEN); - expBar.setTitle(ChatColor.GRAY + skillTitle + ChatColor.GOLD + " " + lang.getString("lvl") + " " + newLevel + - ChatColor.YELLOW + " (+" + expChange + " " + lang.getString("exp") + ")"); - } - else { - expBar.setColor(BarColor.BLUE); - expBar.setTitle(ChatColor.LIGHT_PURPLE + "("+lang.getString("virtual")+") " + ChatColor.GRAY + skillTitle + ChatColor.GOLD + " " + lang.getString("lvl") + " " + oldLevel + - ChatColor.YELLOW + " (+" + expChange + " " + lang.getString("exp") + ")"); - } - expBar.setVisible(true); - removeEXPBar(expBar); - } - - } - - public void flashEXPBarText(String message,ChatColor color1,ChatColor color2,BossBar expBar){ - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - expBar.setProgress(1.0); - isPlayerFlashingText.put(p,true); - //Sets up 6 flashes - for (int i = 0; i<=5;i++) { - int finalI = i; - new BukkitRunnable() { - @Override - public void run() { - if (p.isOnline()) { - if (finalI % 2 == 0) { - expBar.setTitle(color1 + message); - } else { - expBar.setTitle(color2 + message); - } - } - if (finalI == 5) { - isPlayerFlashingText.remove(p); - } - } - }.runTaskLater(plugin, 10*i); - } - } - - public void removeEXPBar(BossBar expBar) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - if (playerRemoveEXPBarTaskIdMap.containsKey(p)) { - Bukkit.getScheduler().cancelTask(playerRemoveEXPBarTaskIdMap.get(p)); - } - int taskId = new BukkitRunnable() { - @Override - public void run() { - expBar.setVisible(false); - if (playerRemoveEXPBarTaskIdMap.containsKey(p)) { - playerRemoveEXPBarTaskIdMap.remove(p); - } - } - }.runTaskLater(plugin,60).getTaskId(); - playerRemoveEXPBarTaskIdMap.put(p,taskId); - } - -} diff --git a/src/main/java/mc/carlton/freerpg/playerInfo/Leaderboards.java b/src/main/java/mc/carlton/freerpg/playerInfo/Leaderboards.java deleted file mode 100644 index fd5ae7c..0000000 --- a/src/main/java/mc/carlton/freerpg/playerInfo/Leaderboards.java +++ /dev/null @@ -1,431 +0,0 @@ -package mc.carlton.freerpg.playerInfo; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.globalVariables.StringsAndOtherData; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - -public class Leaderboards { - static Map> leaderboards = new ConcurrentHashMap<>(); - static Map> playerUUID_to_personalSkillLeaderboards = new ConcurrentHashMap<>(); - static Map> playerName_to_personalSkillLeaderboards = new ConcurrentHashMap<>(); - static boolean leaderboardsLoaded; - static List leaderboardNames = new ArrayList<>(); - static boolean leaderboardUpdating; - - public boolean isLeaderboardsLoaded() { - return leaderboardsLoaded; - } - - public void setLeaderboardsLoaded(boolean isLeaderboardsLoaded) { - Leaderboards.leaderboardsLoaded = isLeaderboardsLoaded; - } - - public List getLeaderboardNames(){ - return leaderboardNames; - } - - public void initializeLeaderboards(){ - leaderboardUpdating = false; - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - ArrayList skillNames = stringsAndOtherData.getSkillNames(); - leaderboardNames.add("playTime"); - leaderboardNames.add("global"); - for (String skillName : skillNames) { - leaderboardNames.add(skillName); - } - for (String leaderboardName : leaderboardNames) { - leaderboards.put(leaderboardName,new ArrayList<>()); - } - asyncUpdateLeaderBoards(); - } - - public void initializeNewPlayer(Player p) { - UUID playerUUID = p.getUniqueId(); - if (playerUUID_to_personalSkillLeaderboards.containsKey(playerUUID)) { //Player is already loaded in (i.e not new) - updatePlayerName(p); //Updates the player's username if it has changed - return; - } - if (leaderboardUpdating) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - new BukkitRunnable() { - @Override - public void run() { - initializeNewPlayer(p); - } - }.runTaskLater(plugin,20); - return; - } - PlayerStats playerStats = new PlayerStats(p); - for (String leaderBoardName : leaderboardNames) { - PlayerLeaderboardStat player; - if (leaderBoardName.equalsIgnoreCase("global")) { - int level = (int) playerStats.getPlayerData().get(leaderBoardName).get(0); - int totalExperience = (int) playerStats.getPlayerData().get(leaderBoardName).get(29); - player = new PlayerLeaderboardStat(playerUUID,p.getName(),level,totalExperience); - - } - else if (leaderBoardName.equalsIgnoreCase("playTime")) { - long playTime = playerStats.getPlayerPlayTime(); - player = new PlayerLeaderboardStat(playerUUID,p.getName(),playTime); - } - else { - int exp = (int) playerStats.getPlayerData().get(leaderBoardName).get(1); - player = new PlayerLeaderboardStat(playerUUID,p.getName(),exp); - } - ArrayList leaderboard = leaderboards.get(leaderBoardName); - leaderboard.add(player); - leaderboards.put(leaderBoardName,leaderboard); - addPlayerLeaderboardProfilePointer(playerUUID,p.getName(),leaderBoardName,player); - } - } - - public void addPlayerSkillStat(UUID playerUUID, String playerName, int experience, String skillName) { - PlayerLeaderboardStat player = new PlayerLeaderboardStat(playerUUID,playerName,experience); - ArrayList leaderboard = leaderboards.get(skillName); - leaderboard.add(player); - leaderboards.put(skillName,leaderboard); - addPlayerLeaderboardProfilePointer(playerUUID,playerName,skillName,player); - - } - public void addPlayerGlobalStat(UUID playerUUID, String playerName, int totalLevel, int totalExperience) { - PlayerLeaderboardStat player = new PlayerLeaderboardStat(playerUUID,playerName,totalLevel,totalExperience); - ArrayList leaderboard = leaderboards.get("global"); - leaderboard.add(player); - leaderboards.put("global",leaderboard); - addPlayerLeaderboardProfilePointer(playerUUID,playerName,"global",player); - } - public void addPlayerTimeStat(UUID playerUUID, String playerName, long timePlayed) { - PlayerLeaderboardStat player = new PlayerLeaderboardStat(playerUUID,playerName,timePlayed); - ArrayList leaderboard = leaderboards.get("playTime"); - leaderboard.add(player); - leaderboards.put("playTime",leaderboard); - addPlayerLeaderboardProfilePointer(playerUUID,playerName,"playTime",player); - } - - public void sortAllLeaderBoards(){ - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.isLeaderboardDyanmicUpdate()) { - return; - } - for (String leaderBoardName : leaderboardNames) { - sortLeaderBoard(leaderBoardName); - } - } - public void sortAllLeaderBoards(boolean forceSort){ - if (!forceSort) { - sortAllLeaderBoards(); - } - for (String leaderBoardName : leaderboardNames) { - sortLeaderBoard(leaderBoardName,forceSort); - } - } - - public void sortLeaderBoard(String skillName) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.isLeaderboardDyanmicUpdate()) { - return; - } - if (skillName.equalsIgnoreCase("playTime")) { //PlayTime doesn't update dynamically like the others, - updateLeaderboard("playTime"); - } - ArrayList leaderboard = leaderboards.get(skillName); - leaderboard.sort(new Comparator() { - @Override - public int compare(PlayerLeaderboardStat o1, PlayerLeaderboardStat o2) { - if (o1.get_sortedStat().doubleValue() < o2.get_sortedStat().doubleValue()) { - return 1; - } else { - return -1; - } - } - }); - leaderboards.put(skillName,leaderboard); - } - public void sortLeaderBoard(String skillName, boolean forceSort) { - if (!forceSort) { - sortLeaderBoard(skillName); - } - if (skillName.equalsIgnoreCase("playTime")) { //PlayTime doesn't update dynamically like the others, - updateLeaderboard("playTime"); - } - ArrayList leaderboard = leaderboards.get(skillName); - leaderboard.sort(new Comparator() { - @Override - public int compare(PlayerLeaderboardStat o1, PlayerLeaderboardStat o2) { - if ( o1.get_sortedStat().doubleValue() < o2.get_sortedStat().doubleValue()) { - return 1; - } else { - return -1; - } - } - }); - } - - public void updateAllLeaderboards() { - for (UUID playerUUID : playerUUID_to_personalSkillLeaderboards.keySet()) { - if (Bukkit.getPlayer(playerUUID) != null) { - if (Bukkit.getPlayer(playerUUID).isOnline()) { - PlayerStats playerStats = new PlayerStats(playerUUID); - Map> pStats = playerStats.getPlayerData(); - for (String leaderboardName : leaderboardNames) { - if (leaderboardName.equalsIgnoreCase("global")) { - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_sortedStat(pStats.get(leaderboardName).get(0)); - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_stat2(pStats.get(leaderboardName).get(29)); - } - else if (leaderboardName.equalsIgnoreCase("playTime")) { - long playTime = playerStats.getNewPlayTime(); - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_sortedStat(playTime); - } - else { - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_stat2(pStats.get(leaderboardName).get(0)); - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_sortedStat(pStats.get(leaderboardName).get(1)); - } - } - } - } - } - } - - public void updateLeaderboard(String leaderboardName) { - ConfigLoad configLoad = new ConfigLoad(); - if (!configLoad.isLeaderboardDyanmicUpdate()) { - return; - } - for (UUID playerUUID : playerUUID_to_personalSkillLeaderboards.keySet()) { - if (Bukkit.getPlayer(playerUUID) != null) { - if (Bukkit.getPlayer(playerUUID).isOnline()) { - PlayerStats playerStats = new PlayerStats(playerUUID); - Map> pStats = playerStats.getPlayerData(); - if (leaderboardName.equalsIgnoreCase("global")) { - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_sortedStat(pStats.get(leaderboardName).get(0)); - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_stat2(pStats.get(leaderboardName).get(29)); - } else if (leaderboardName.equalsIgnoreCase("playTime")) { - long playTime = playerStats.getNewPlayTime(); - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_sortedStat(playTime); - } else { - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_stat2(pStats.get(leaderboardName).get(0)); - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_sortedStat(pStats.get(leaderboardName).get(1)); - } - } - } - } - } - - public void updateLeaderboard(String leaderboardName, boolean forceUpdate){ - if (!forceUpdate) { - updateLeaderboard(leaderboardName); - } - for (UUID playerUUID : playerUUID_to_personalSkillLeaderboards.keySet()) { - if (Bukkit.getPlayer(playerUUID) != null) { - if (Bukkit.getPlayer(playerUUID).isOnline()) { - PlayerStats playerStats = new PlayerStats(playerUUID); - Map> pStats = playerStats.getPlayerData(); - if (leaderboardName.equalsIgnoreCase("global")) { - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_sortedStat(pStats.get(leaderboardName).get(0)); - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_stat2(pStats.get(leaderboardName).get(29)); - } - else if (leaderboardName.equalsIgnoreCase("playTime")) { - long playTime = playerStats.getNewPlayTime(); - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_sortedStat(playTime); - } - else { - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_stat2(pStats.get(leaderboardName).get(0)); - playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName).set_sortedStat(pStats.get(leaderboardName).get(1)); - } - } - } - } - } - - public void asyncUpdateLeaderBoards() { - ConfigLoad configLoad = new ConfigLoad(); - if (configLoad.isLeaderboardDyanmicUpdate()) { - return; - } - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - int ticksWait = 20*configLoad.getLeaderboardUpdateTimer(); - new BukkitRunnable() { - @Override - public void run() { - if (leaderboardsLoaded) { - leaderboardUpdating = true; - updateAllLeaderboards(); - - sortAllLeaderBoards(true); - leaderboardUpdating = false; - } - } - }.runTaskTimerAsynchronously(plugin,ticksWait,ticksWait); - } - - public ArrayList getLeaderboard(String skillName) { - return leaderboards.get(skillName); - } - - public Map> getLeaderboards() { - return leaderboards; - } - - public void addPlayerLeaderboardProfilePointer(UUID playerUUID,String playerName, String skillName, PlayerLeaderboardStat player) { - if (!playerUUID_to_personalSkillLeaderboards.containsKey(playerUUID)) { - Map initialMap = new ConcurrentHashMap<>(); - initialMap.put(skillName,player); - playerUUID_to_personalSkillLeaderboards.put(playerUUID,initialMap); - } - else { - Map map = playerUUID_to_personalSkillLeaderboards.get(playerUUID); - map.put(skillName,player); - playerUUID_to_personalSkillLeaderboards.put(playerUUID,map); - } - if (!playerName_to_personalSkillLeaderboards.containsKey(playerName)) { - Map initialMap = new ConcurrentHashMap<>(); - initialMap.put(skillName,player); - playerName_to_personalSkillLeaderboards.put(playerName,initialMap); - } - else { - Map map = playerName_to_personalSkillLeaderboards.get(playerName); - map.put(skillName,player); - playerName_to_personalSkillLeaderboards.put(playerName,map); - } - } - - public void removeForbiddenUUIDs(HashSet allPlayerUUIDs) { - for (String skillName : leaderboards.keySet()) { - ArrayList forbiddenLeaderBoardStats = new ArrayList<>(); - ArrayList players = leaderboards.get(skillName); - for (PlayerLeaderboardStat player : players) { - if (!allPlayerUUIDs.contains(player.get_playerUUID())) { - forbiddenLeaderBoardStats.add(player); - } - } - players.removeAll(forbiddenLeaderBoardStats); - leaderboards.put(skillName,players); - } - } - - public void updatePlayerStats(Player p, String skillName, Number sortedStat, Object stat2) { - UUID playerUUID = p.getUniqueId(); - updatePlayerStats(playerUUID,skillName,sortedStat,stat2); - } - - public void updatePlayerStats(UUID playerUUID, String skillName, Number sortedStat, Object stat2) { - PlayerLeaderboardStat player = playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(skillName); - player.updateStats(sortedStat,stat2); - } - - public PlayerLeaderboardStat getPlayerStatAtLeaderBoardPosition(String leaderboardName, int position) { - if (!leaderboards.containsKey(leaderboardName)) { - return null; - } - sortLeaderBoard(leaderboardName); - ArrayList leaderboard = leaderboards.get(leaderboardName); - - if (position < 1) { - position = 1; - } - else if (position > leaderboard.size()) { - position = leaderboard.size(); - } - return leaderboard.get(position-1); - } - - public int getLeaderboardPosition(Player p,String leaderboardName) { - UUID playerUUID = p.getUniqueId(); - return getLeaderboardPosition(playerUUID,leaderboardName); - } - - public int getLeaderboardPosition(UUID playerUUID,String leaderboardName) { - sortLeaderBoard(leaderboardName); - if (!leaderboards.containsKey(leaderboardName)) { - return -1; - } - PlayerLeaderboardStat playerStat = playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName); - int position = leaderboards.get(leaderboardName).indexOf(playerStat) + 1; - return position; - } - public int getLeaderboardPosition(String playerName,String leaderboardName) { - sortLeaderBoard(leaderboardName); - if (!leaderboards.containsKey(leaderboardName)) { - return -1; - } - PlayerLeaderboardStat playerStat = playerName_to_personalSkillLeaderboards.get(playerName).get(leaderboardName); - int position = leaderboards.get(leaderboardName).indexOf(playerStat) + 1; - return position; - } - - public int getLeaderboardSize(String leaderboardName) { - if (!leaderboards.containsKey(leaderboardName)) { - return -1; - } - return leaderboards.get(leaderboardName).size(); - } - - public PlayerLeaderboardStat getPlayerStat(String playerName,String leaderboardName) { - if (playerName_to_personalSkillLeaderboards.containsKey(playerName)) { - return playerName_to_personalSkillLeaderboards.get(playerName).get(leaderboardName); - } - else { - return null; - } - } - - public PlayerLeaderboardStat getPlayerStat(UUID playerUUID,String leaderboardName) { - if (playerUUID_to_personalSkillLeaderboards.containsKey(playerUUID)) { - return playerUUID_to_personalSkillLeaderboards.get(playerUUID).get(leaderboardName); - } - else { - return null; - } - } - - public boolean isPlayerOnLeaderboards(String playerName) { - if (playerName_to_personalSkillLeaderboards.containsKey(playerName)) { - return true; - } - else { - return false; - } - } - - private void updatePlayerName(Player p) { - /* - * This method uses a general approach. I.e it does not make some assumptions that should be true. - * Notably, it does NOT assume that each PlayerLeaderBoardStat Object in the playerLeaderboardStats has the same player Name. (this should be true) - * However, it does assume that each PlayerLeaderBoardStat Object in the playerLeaderboardStats does indeed belond to the player UUID. - */ - UUID playerUUID = p.getUniqueId(); - if (playerUUID_to_personalSkillLeaderboards.containsKey(playerUUID)) { //Player is already loaded in (i.e not new) - String currentName = p.getName(); - String oldName = currentName; - Map playerLeaderboardStats = playerUUID_to_personalSkillLeaderboards.get(playerUUID); - for (String leaderboadName : playerLeaderboardStats.keySet()) { - PlayerLeaderboardStat playerLeaderboardStat = playerLeaderboardStats.get(leaderboadName); - if (!playerLeaderboardStat.get_pName().equals(currentName)) { //Name associated with this leaderboard stat does not correspond with player's current name - if (!playerLeaderboardStat.get_pName().equals(oldName)) { //This name has not been removed from playerName_to_personalSkillLeaderboards yet - /* - * This conditional should always be met for the first playerLeaderBoard stat with an incorrect name, because currentName == oldName initialially - * The username is removed from playerName_to_personalSkillLeaderboards and oldName is updated. - * It SHOULD be true that every stat in playerLeaderboardStats shares the same old name, so this conditional should not fire again - * I use a general approach here to be safe, and assume that playerLeaderboardStats could contain stats with many different names. If this is the case, - * then these wrong names will be removed from playerName_to_personalSkillLeaderboards as well (if they are in the map) - */ - playerName_to_personalSkillLeaderboards.remove(oldName); //Removes old name key, if present - oldName = playerLeaderboardStat.get_pName(); //Updates oldName - } - playerLeaderboardStat.set_pName(currentName); //Updates pName to the current name. This is the name that will be saved to leaderboards.yml and displayed on /frpg top {skillName} - } - } - playerName_to_personalSkillLeaderboards.put(currentName,playerLeaderboardStats); //finally, we change playerName_to_personalSkillLeaderboards so it contains the new player name - } - } - - - -} diff --git a/src/main/java/mc/carlton/freerpg/playerInfo/OfflinePlayerStatLoadIn.java b/src/main/java/mc/carlton/freerpg/playerInfo/OfflinePlayerStatLoadIn.java deleted file mode 100644 index f1dae62..0000000 --- a/src/main/java/mc/carlton/freerpg/playerInfo/OfflinePlayerStatLoadIn.java +++ /dev/null @@ -1,110 +0,0 @@ -package mc.carlton.freerpg.playerInfo; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.leaveAndJoin.LoginProcedure; -import mc.carlton.freerpg.serverFileManagement.PlayerStatsFilePreparation; -import mc.carlton.freerpg.serverInfo.RecentLogouts; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.io.File; -import java.util.*; - -public class OfflinePlayerStatLoadIn { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - private int safeDeleteTaskID; - - public void loadInOfflinePlayers() { - RecentLogouts recentLogouts = new RecentLogouts(); - ArrayList playersToLoadIn = recentLogouts.getLastLogouts(); - new BukkitRunnable() { - @Override - public void run() { - for (UUID pUUID : playersToLoadIn) { - PlayerStats playerStats = new PlayerStats(pUUID); - if (playerStats.isPlayerRegistered()) { - continue; - } - PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); - playerStatsFilePreparation.preparePlayerFile(null, pUUID, false); - LoginProcedure loginProcedure = new LoginProcedure(pUUID); - loginProcedure.addStatsToPlayerMap(false); - } - } - }.runTaskAsynchronously(plugin); - } - - public void loadInAllOfflinePlayers() { - new BukkitRunnable() { - @Override - public void run() { - File userdata = new File(Bukkit.getServer().getPluginManager().getPlugin("FreeRPG").getDataFolder(), File.separator + "PlayerDatabase"); - File[] allUsers = userdata.listFiles(); - HashSet times = new HashSet<>(); - double N = 0; - for (File f : allUsers) { - UUID pUUID = UUID.fromString(f.getName().replace(".yml","")); - PlayerStats playerStats = new PlayerStats(pUUID); - if (playerStats.isPlayerRegistered()) { - continue; - } - long time = System.currentTimeMillis(); - PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); - playerStatsFilePreparation.preparePlayerFile(null,pUUID,false); - LoginProcedure loginProcedure = new LoginProcedure(pUUID); - loginProcedure.addStatsToPlayerMap(false); - times.add(System.currentTimeMillis()-time); - N+=1.0; - } - long sum = 0; - for (long time : times) { - sum += time; - } - double avg = Math.round((sum/N)*100)/100.0; - System.out.println("Total time Taken: " + sum + " ms"); - System.out.println("Average time Taken: " + avg + " ms"); - } - }.runTaskAsynchronously(plugin); - - } - - public void unloadAllOfflinePlayers() { - //One of the rare cases we need to access the playerStats class without a player, so we use a random UUID - PlayerStats allStats = new PlayerStats(UUID.randomUUID()); - for (UUID playerUUID : allStats.getData().keySet()) { - unloadOfflinePlayer(playerUUID); - } - } - - public void unloadOfflinePlayer(UUID playerUUID) { - safeRemovePlayer(playerUUID); - } - - public void safeRemovePlayer(UUID playerUUID){ - int taskID = new BukkitRunnable() { - @Override - public void run() { - PlayerStats playerStats = new PlayerStats(playerUUID); - if (isPlayerOnline(playerUUID)) { //We don't want to remove the stats of an online player - Bukkit.getScheduler().cancelTask(safeDeleteTaskID); - } - else if (playerStats.arePlayerStatsSaved()) { - playerStats.removePlayer(); - Bukkit.getScheduler().cancelTask(safeDeleteTaskID); - } - } - }.runTaskTimer(plugin,1,50).getTaskId(); - safeDeleteTaskID = taskID; - } - - public boolean isPlayerOnline(UUID playerUUID) { - if (Bukkit.getPlayer(playerUUID) != null) { - if (Bukkit.getPlayer(playerUUID).isOnline()) { - return true; - } - } - return false; - } -} diff --git a/src/main/java/mc/carlton/freerpg/playerInfo/PlayerLeaderboardStat.java b/src/main/java/mc/carlton/freerpg/playerInfo/PlayerLeaderboardStat.java deleted file mode 100644 index c14e207..0000000 --- a/src/main/java/mc/carlton/freerpg/playerInfo/PlayerLeaderboardStat.java +++ /dev/null @@ -1,135 +0,0 @@ -package mc.carlton.freerpg.playerInfo; - -import mc.carlton.freerpg.configStorage.ConfigLoad; - -import java.util.ArrayList; -import java.util.UUID; - -public class PlayerLeaderboardStat { - String pName; - UUID playerUUID; - Number sortedStat; - Object stat2; - - //This is used for all skills - public PlayerLeaderboardStat(UUID playerUUID, String pName, int experience) { //By default, levelSupplied = false - super(); - this.playerUUID = playerUUID; - this.pName = pName; - this.sortedStat = experience; - this.stat2 = getLevelfromEXP(experience); - } - - public PlayerLeaderboardStat(UUID playerUUID, String pName, Number sortedStat, Object stat2) { //Used for global stats - super(); - this.playerUUID = playerUUID; - this.pName = pName; - this.sortedStat = sortedStat; - this.stat2 = stat2; - } - - public PlayerLeaderboardStat(UUID playerUUID, String pName, Number sortedStat) { //By default, levelSupplied = false - super(); - this.playerUUID = playerUUID; - this.pName = pName; - this.sortedStat = sortedStat; - } - - - public void updateStats(Number sortedStat, Object stat2) { - this.sortedStat = sortedStat; - this.stat2 = stat2; - } - - public void updateStats(Number sortedStat) { - this.sortedStat = sortedStat; - } - - - public void set_pName(String pName) { - this.pName = pName; - } - public void set_playerUUID(UUID playerUUID) {this.playerUUID = playerUUID;} - public void set_sortedStat(Number sortedStat){this.sortedStat = sortedStat;} - public void set_stat2(Object stat2){this.stat2 = stat2;} - public String get_pName() { - return this.pName; - } - public UUID get_playerUUID() {return this.playerUUID;} - public Number get_sortedStat(){return this.sortedStat;} - public Object get_stat2(){return this.stat2; } - public String get_playTimeString(){ - if (sortedStat instanceof Integer || sortedStat instanceof Long) { - return getPlayerPlayTimeString(sortedStat.intValue()); - } - else { - return null; - } - } - - public int getLevelfromEXP(int exp) { - ConfigLoad loadConfig = new ConfigLoad(); - ArrayList levelingInfo = loadConfig.getLevelingInfo(); - double B = levelingInfo.get(1); - int referenceLevel = (int) Math.round(levelingInfo.get(2)); - int referenceEXP = (int) Math.round(levelingInfo.get(3)); - int linearStartingLevel = (int) Math.round(levelingInfo.get(4)); - int linearEXP = (int) Math.round(levelingInfo.get(5)); - int exponentialMaxEXP = getEXPfromLevel(linearStartingLevel); - int level = 0; - if (exp <= exponentialMaxEXP) { - level = (int) Math.floor(((Math.log( (exp*(1.0/referenceEXP)*(Math.pow(B, referenceLevel)-1)) +1) / Math.log(B)))); - } - else { - level = (int) Math.floor((exp-exponentialMaxEXP)/linearEXP) + linearStartingLevel; - } - return level; - } - - public int getEXPfromLevel(int level) { - ConfigLoad loadConfig = new ConfigLoad(); - ArrayList levelingInfo = loadConfig.getLevelingInfo(); - double B = levelingInfo.get(1); - int referenceLevel = (int) Math.round(levelingInfo.get(2)); - int referenceEXP = (int) Math.round(levelingInfo.get(3)); - int linearStartingLevel = (int) Math.round(levelingInfo.get(4)); - int linearEXP = (int) Math.round(levelingInfo.get(5)); - int EXP = 0; - if (level > linearStartingLevel) { - int exponentialMaxEXP = getEXPfromLevel(linearStartingLevel); - EXP = exponentialMaxEXP + linearEXP*(level-linearStartingLevel); - } - else { - EXP = (int) Math.floor(referenceEXP * ((Math.pow(B, level) - 1) / (Math.pow(B, referenceLevel) - 1))); - } - return EXP; - } - public String getPlayerPlayTimeString(int playTime) { - String playTime_string = ""; - int hours = (int) Math.floor(playTime/3600.0); - int minutes = (int) Math.floor( (playTime-(hours*3600))/60.0 ); - int seconds = (int) Math.floor((playTime - (hours*3600) - (minutes*60))); - String hoursString = Integer.toString(hours); - if (hoursString.length() < 2) { - hoursString = "0"+hoursString; - } - String minutesString = Integer.toString(minutes); - if (minutesString.length() < 2) { - minutesString = "0"+minutesString; - } - String secondsString = Integer.toString(seconds); - if (secondsString.length() < 2) { - secondsString = "0"+secondsString; - } - playTime_string = hoursString + ":" + minutesString + ":" + secondsString; - return playTime_string; - } - - @Override - public String toString() { - return "PlayerLeaderboardStats [username="+pName+", sortedStat="+sortedStat+", stat2="+stat2+"]"; - } - - - -} diff --git a/src/main/java/mc/carlton/freerpg/playerInfo/PlayerStats.java b/src/main/java/mc/carlton/freerpg/playerInfo/PlayerStats.java deleted file mode 100644 index 4ec37f5..0000000 --- a/src/main/java/mc/carlton/freerpg/playerInfo/PlayerStats.java +++ /dev/null @@ -1,222 +0,0 @@ -package mc.carlton.freerpg.playerInfo; - -import org.bukkit.entity.Player; - -import java.time.Instant; -import java.util.*; - -public class PlayerStats { - //This class is very messy, it would be better if I created a class to store all these stats for each player, - // And used a hashmap to assign that class to a UUID, but that would take major restructuring - private UUID uuid; - static Map>> player_statsMap = new HashMap>>(); - static Map player_LoginTime = new HashMap<>(); - static Map player_playTime = new HashMap<>(); - static Map player_language = new HashMap<>(); - static Map> playerSkillToggleEXPBar = new HashMap<>(); - static Map> playerSkillToggleAbility = new HashMap<>(); - static Map playerAreStatsSaved = new HashMap<>(); - - public PlayerStats(Player p) { - this.uuid = p.getUniqueId(); - } - public PlayerStats(UUID playerUUID) { - this.uuid = playerUUID; - } - - //Common boolean questions asked - public boolean isPlayerRegistered() { - if (player_statsMap.containsKey(uuid)) { - return true; - } - else { - return false; - } - } - - //Getters and setters for entire playerbase map - public void setData(Map>> playerStatsMap) { - this.player_statsMap = playerStatsMap; - } - - public Map>> getData() { - if (!player_statsMap.containsKey(uuid)) { - PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); - Map> playerStats0 = loadInPlayer.getPlayerStatsMapFromFile(); - player_statsMap.put(uuid,playerStats0); - } - return player_statsMap; - } - - //Getters and setters for single player stats - public Map> getPlayerData() { - if (!player_statsMap.containsKey(uuid)) { - PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); - Map> playerStats0 = loadInPlayer.getPlayerStatsMapFromFile(); - player_statsMap.put(uuid,playerStats0); - } - return player_statsMap.get(uuid); - } - - //Getters and setters for if they player's data has been saved - public void setPlayerAreStatsSaved(boolean areStatsSaved) { - playerAreStatsSaved.put(uuid,areStatsSaved); - } - - public boolean arePlayerStatsSaved(){ - if (playerAreStatsSaved.containsKey(uuid)){ - return playerAreStatsSaved.get(uuid); - } - else { - return true; - } - } - - //Getters and setters for player times - public void addPlayerTimes(long loginTime,long playTime) { - player_LoginTime.put(uuid,loginTime); - player_playTime.put(uuid,playTime); - } - - public long getPlayerLoginTime() { - if (!player_LoginTime.containsKey(uuid)) { - PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); - long loginTime = loadInPlayer.getLoginTime(); - player_LoginTime.put(uuid,loginTime); - } - return (long) player_LoginTime.get(uuid); - } - public long getPlayerPlayTime() { - if (!player_playTime.containsKey(uuid)) { - PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); - long playTime = loadInPlayer.getPlayTime(); - player_playTime.put(uuid,playTime); - } - return (long) player_playTime.get(uuid); - } - - //Turns player play time to a string - public String getPlayerPlayTimeString() { - String playTime_string = ""; - long newPlayTime = getNewPlayTime(); - int hours = (int) Math.floor(newPlayTime/3600.0); - int minutes = (int) Math.floor( (newPlayTime-(hours*3600))/60.0 ); - int seconds = (int) Math.floor((newPlayTime - (hours*3600) - (minutes*60))); - String hoursString = Integer.toString(hours); - if (hoursString.length() < 2) { - hoursString = "0"+hoursString; - } - String minutesString = Integer.toString(minutes); - if (minutesString.length() < 2) { - minutesString = "0"+minutesString; - } - String secondsString = Integer.toString(seconds); - if (secondsString.length() < 2) { - secondsString = "0"+secondsString; - } - playTime_string = hoursString + ":" + minutesString + ":" + secondsString; - return playTime_string; - } - - public long getNewPlayTime(){ - long loginTime = getPlayerLoginTime(); - long playTime = getPlayerPlayTime(); - long currentTime = Instant.now().getEpochSecond(); - long newPlayTime = playTime + (currentTime-loginTime); - return newPlayTime; - } - - //Getters and setters for player language - public void setPlayerLanguage(String language) { - player_language.put(uuid,language); - } - public String getPlayerLanguage() { - if (!player_language.containsKey(uuid)) { - PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); - String language = loadInPlayer.getPlayerLanguage(); - player_language.put(uuid,language); - } - return player_language.get(uuid); - } - - //Getters and setters for toggle ability/exp bar - public void addPlayerSkillToggleExpBar(Map skillToggles){ - playerSkillToggleEXPBar.put(uuid,skillToggles); - } - public void addPlayerSkillToggleAbility(Map skillToggles){ - playerSkillToggleAbility.put(uuid,skillToggles); - } - public Map getSkillToggleExpBar(){ - if (!playerSkillToggleEXPBar.containsKey(uuid)) { - PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); - Map playerStats0 = loadInPlayer.getSkillExpBarToggles(); - playerSkillToggleEXPBar.put(uuid,playerStats0); - } - return playerSkillToggleEXPBar.get(uuid); - } - public Map getSkillToggleAbility(){ - if (!playerSkillToggleAbility.containsKey(uuid)) { - PlayerStatsLoadIn loadInPlayer = new PlayerStatsLoadIn(uuid); - Map playerStats0 = loadInPlayer.getSkillAbilityToggles(); - playerSkillToggleAbility.put(uuid,playerStats0); - } - return playerSkillToggleAbility.get(uuid); - } - - //expbar/skillability boolean information - public boolean isPlayerSkillExpBarOn(String skillName) { - int expBarOn = getSkillToggleExpBar().get(skillName); - if (expBarOn == 1) { - return true; - } - else { - return false; - } - } - public boolean isPlayerSkillAbilityOn(String skillName){ - int abilityOn = getSkillToggleAbility().get(skillName); - if (abilityOn == 1) { - return true; - } - else { - return false; - } - } - - //Methods to toggle expbar/skillability - public void togglePlayerSkillExpBar(String skillName) { - Map playerSkillEXPBarMap = getSkillToggleExpBar(); - int expBarOn = playerSkillEXPBarMap.get(skillName); - if (expBarOn == 1) { - playerSkillEXPBarMap.put(skillName,0); - } - else { - playerSkillEXPBarMap.put(skillName,1); - } - playerSkillToggleEXPBar.put(uuid,playerSkillEXPBarMap); - } - public void togglePlayerSkillAbility(String skillName) { - Map playerSkillAbiliytMap = getSkillToggleAbility(); - int abilityOn = playerSkillAbiliytMap.get(skillName); - if (abilityOn == 1) { - playerSkillAbiliytMap.put(skillName,0); - } - else { - playerSkillAbiliytMap.put(skillName,1); - } - playerSkillToggleAbility.put(uuid,playerSkillAbiliytMap); - } - - - //Used to delete all player data from memory - public void removePlayer() { - player_statsMap.remove(uuid); - player_LoginTime.remove(uuid); - player_playTime.remove(uuid); - player_language.remove(uuid); - playerSkillToggleEXPBar.remove(uuid); - playerSkillToggleAbility.remove(uuid); - playerAreStatsSaved.remove(uuid); - } - -} diff --git a/src/main/java/mc/carlton/freerpg/playerInfo/PlayerStatsLoadIn.java b/src/main/java/mc/carlton/freerpg/playerInfo/PlayerStatsLoadIn.java deleted file mode 100644 index 49d0bfe..0000000 --- a/src/main/java/mc/carlton/freerpg/playerInfo/PlayerStatsLoadIn.java +++ /dev/null @@ -1,308 +0,0 @@ -package mc.carlton.freerpg.playerInfo; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import mc.carlton.freerpg.serverFileManagement.PlayerFilesManager; -import org.bukkit.Bukkit; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.io.File; -import java.io.IOException; -import java.time.Instant; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -public class PlayerStatsLoadIn { - private Player p; - Map> statsMap = new HashMap>(); - File f; - UUID pUUID; - FileConfiguration playerData; - - public PlayerStatsLoadIn(Player player) { - PlayerFilesManager playerFilesManager = new PlayerFilesManager(); - this.p = player; - this.pUUID = p.getUniqueId(); - this.f = playerFilesManager.getPlayerFile(p); - this.playerData = YamlConfiguration.loadConfiguration(f); - } - - public PlayerStatsLoadIn(UUID pUUID) { - PlayerFilesManager playerFilesManager = new PlayerFilesManager(); - if (Bukkit.getPlayer(pUUID) != null) { - this.p = Bukkit.getPlayer(pUUID); - } - this.pUUID = pUUID; - this.f = playerFilesManager.getPlayerFile(pUUID); - this.playerData = YamlConfiguration.loadConfiguration(f); - } - - public long getLoginTime() { - long loginTime = 0; - if (f.exists()) { - long unixTime = Instant.now().getEpochSecond(); - loginTime = Long.valueOf(getStat("general.lastLogin",unixTime).toString()); - return loginTime; - } - return Instant.now().getEpochSecond(); - } - - public long getPlayTime() { - long playTime = 0; - if (f.exists()) { - playTime = Long.valueOf(getStat("general.playTime",0L).toString()); - return playTime; - } - return Instant.now().getEpochSecond(); - } - - public String getPlayerLanguage() { - String language = "enUs"; - if (f.exists()) { - String defaultLanguage = new ConfigLoad().getDefaultLanguage(); - language = String.valueOf(getInformation("general.language",defaultLanguage)); - return language; - } - return language; - } - - public Map getSkillExpBarToggles(){ - Map skillExpBarToggleMap = new HashMap<>(); - String[] labels = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - for (String label : labels) { - skillExpBarToggleMap.put(label,(Integer) getStat(label + ".showEXPBarToggle",1)); - } - return skillExpBarToggleMap; - } - public Map getSkillAbilityToggles(){ - Map skillAbilityToggleMap = new HashMap<>(); - String[] labels = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - for (String label : labels) { - skillAbilityToggleMap.put(label,(Integer) getStat(label + ".triggerAbilityToggle",1)); - } - return skillAbilityToggleMap; - } - - public Map> getPlayerStatsMapFromFile() { - readInPlayerStats(); - - /* - - // There might be some problems in the future, so I'm keeping this block of code - - if(f.exists()) { - - } - else { //If for some reason, the player file doesn't exist, we still want the stat map. - if (p != null) { - PlayerFilesManager playerFilesManager = new PlayerFilesManager(); - this.f = playerFilesManager.getPlayerFile(pUUID); - this.playerData = YamlConfiguration.loadConfiguration(f); - PlayerStatsFilePreparation playerStatsFilePreparation = new PlayerStatsFilePreparation(); - playerStatsFilePreparation.preparePlayerFile(p.getName(),pUUID,true); - return getPlayerStatsMapFromFile(); - } - } - - */ - - return statsMap; - } - - public void readInPlayerStats() { - String[] labels = {"digging","woodcutting","mining","farming","fishing","archery","beastMastery","swordsmanship","defense","axeMastery","repair","agility","alchemy","smelting","enchanting"}; - ArrayList globalStats = new ArrayList(); - addStat(globalStats,"globalStats.totalLevel",0); //0 - addStat(globalStats,"globalStats.globalTokens",0); //1 - addStat(globalStats,"globalStats.skill_1a",0); //2 - addStat(globalStats,"globalStats.skill_1b",0); //3 - addStat(globalStats,"globalStats.skill_1c",0); //4 - addStat(globalStats,"globalStats.skill_2a",0); //5 - addStat(globalStats,"globalStats.skill_2b",0); //6 - addStat(globalStats,"globalStats.skill_2c",0); //7 - addStat(globalStats,"globalStats.skill_3a",0); //8 - addStat(globalStats,"globalStats.skill_3b",0); //9 - addStat(globalStats,"globalStats.skill_3c",0); //10 - addStat(globalStats,"globalStats.skill_M",0); //11 - addStat(globalStats,"globalStats.flintToggle",1); //12 - addStat(globalStats,"globalStats.oreToggle",1); //13 - addStat(globalStats,"globalStats.speedToggle",1); //14 - addStat(globalStats,"globalStats.potionToggle",1); //15 - addStat(globalStats,"globalStats.grappleToggle",1); //16 - addStat(globalStats,"globalStats.hotRodToggle",1); //17 - addStat(globalStats,"globalStats.veinMinerToggle",1); //18 - addStat(globalStats,"globalStats.megaDigToggle",1); //19 - addStat(globalStats,"globalStats.souls",0); //20 - addStat(globalStats,"globalStats.levelUpMessageToggle",1); //21 - addStat(globalStats,"globalStats.abilityPrepareMessageToggle",1); //22 - addStat(globalStats,"globalStats.personalEXPMultiplier",1.0); //23 - addStat(globalStats,"globalStats.triggerAbilitiesToggle",1); //24 - addStat(globalStats,"globalStats.showEXPBarToggle",1); //25 - addStat(globalStats,"globalStats.leafBlowerToggle",1); //26 - addStat(globalStats,"globalStats.holyAxeToggle",1); //27 - addStat(globalStats,"globalStats.numberOfCooldownBars",1); //28 - addStat(globalStats,"globalStats.totalExperience",0); //29 - addStat(globalStats,"globalStats.heartyToggle",0); //30 - - statsMap.put("global", globalStats); - - for (int i = 0; i < labels.length; i++) { - String skillName = labels[i]; - ArrayList skillStats = new ArrayList(); - addStat(skillStats,labels[i] + ".level",0); //0 - addStat(skillStats,labels[i] + ".experience",0); //1 - addStat(skillStats,labels[i] + ".passiveTokens",0); //2 - addStat(skillStats,labels[i] + ".skillTokens",0); //3 - addStat(skillStats,labels[i] + ".passive1",0); //4 - addStat(skillStats,labels[i] + ".passive2",0); //5 - addStat(skillStats,labels[i] + ".passive3",0); //6 - addStat(skillStats,labels[i] + ".skill_1a",0); //7 - addStat(skillStats,labels[i] + ".skill_1b",0); //8 - addStat(skillStats,labels[i] + ".skill_2a",0); //9 - addStat(skillStats,labels[i] + ".skill_2b",0); //10 - addStat(skillStats,labels[i] + ".skill_3a",0); //11 - addStat(skillStats,labels[i] + ".skill_3b",0); //12 - addStat(skillStats,labels[i] + ".skill_M",0); //13 - statsMap.put(skillName, skillStats); - } - } - - private void addStat(ArrayList statList, String path, Number defaultValue) { //This exists because I am dumb - statList.add(getStat(path,defaultValue)); - } - - private Number getStat(String path, Number defaultValue) { - if (playerData.contains(path)) { - return (Number) playerData.get(path); - } else { - return defaultValue; - } - } - - private Object getInformation(String path, Object defaultValue) { //General version of getStat - if (playerData.contains(path)) { - return playerData.get(path); - } else { - return defaultValue; - } - } - - public void setPlayerStatsMap() throws IOException { - setPlayerStatsMap(true); - } - public void setPlayerStatsMap(boolean savePlayTime) throws IOException { - PlayerStats pStatClass = new PlayerStats(pUUID); - Map> pStatAll = pStatClass.getPlayerData(); - Map expBarToggles = pStatClass.getSkillToggleExpBar(); - Map abilityToggles = pStatClass.getSkillToggleAbility(); - String pName; - if (p != null) { - pName = p.getName(); - } - else { - pName = null; - } - long unixTime = Instant.now().getEpochSecond(); - if(f.exists()) { - if (pName != null) { - playerData.set("general.username", pName); - } - - //Setting playTime in seconds - if (savePlayTime) { - playerData.set("general.lastLogout", unixTime); - long lastLoginTime = pStatClass.getPlayerLoginTime(); - long playTime = unixTime - lastLoginTime; - playerData.set("general.playTime", playTime); - } - - //Setting player Language - String playerLanguage = pStatClass.getPlayerLanguage(); - playerData.set("general.language",playerLanguage); - - - for (String i : pStatAll.keySet()) { - if (i.equalsIgnoreCase("global")) { - playerData.set("globalStats.totalLevel",pStatAll.get(i).get(0)); - playerData.set("globalStats.globalTokens",pStatAll.get(i).get(1)); - playerData.set("globalStats.skill_1a",pStatAll.get(i).get(2)); - playerData.set("globalStats.skill_1b",pStatAll.get(i).get(3)); - playerData.set("globalStats.skill_1c",pStatAll.get(i).get(4)); - playerData.set("globalStats.skill_2a",pStatAll.get(i).get(5)); - playerData.set("globalStats.skill_2b",pStatAll.get(i).get(6)); - playerData.set("globalStats.skill_2c",pStatAll.get(i).get(7)); - playerData.set("globalStats.skill_3a",pStatAll.get(i).get(8)); - playerData.set("globalStats.skill_3b",pStatAll.get(i).get(9)); - playerData.set("globalStats.skill_3c",pStatAll.get(i).get(10)); - playerData.set("globalStats.skill_M",pStatAll.get(i).get(11)); - playerData.set("globalStats.flintToggle",pStatAll.get(i).get(12)); - playerData.set("globalStats.oreToggle",pStatAll.get(i).get(13)); - playerData.set("globalStats.speedToggle",pStatAll.get(i).get(14)); - playerData.set("globalStats.potionToggle",pStatAll.get(i).get(15)); - playerData.set("globalStats.grappleToggle",pStatAll.get(i).get(16)); - playerData.set("globalStats.hotRodToggle",pStatAll.get(i).get(17)); - playerData.set("globalStats.veinMinerToggle",pStatAll.get(i).get(18)); - playerData.set("globalStats.megaDigToggle",pStatAll.get(i).get(19)); - playerData.set("globalStats.souls",pStatAll.get(i).get(20)); - playerData.set("globalStats.levelUpMessageToggle",pStatAll.get(i).get(21)); - playerData.set("globalStats.abilityPrepareMessageToggle",pStatAll.get(i).get(22)); - playerData.set("globalStats.personalEXPMultiplier",pStatAll.get(i).get(23)); - playerData.set("globalStats.triggerAbilitiesToggle",pStatAll.get(i).get(24)); - playerData.set("globalStats.showEXPBarToggle",pStatAll.get(i).get(25)); - playerData.set("globalStats.leafBlowerToggle",pStatAll.get(i).get(26)); - playerData.set("globalStats.holyAxeToggle",pStatAll.get(i).get(27)); - playerData.set("globalStats.numberOfCooldownBars",pStatAll.get(i).get(28)); - playerData.set("globalStats.totalExperience",pStatAll.get(i).get(29)); - playerData.set("globalStats.heartyToggle",pStatAll.get(i).get(30)); - } - else { - playerData.set(i+".level",pStatAll.get(i).get(0)); - playerData.set(i+".experience",pStatAll.get(i).get(1)); - playerData.set(i+".passiveTokens",pStatAll.get(i).get(2)); - playerData.set(i+".skillTokens",pStatAll.get(i).get(3)); - playerData.set(i+".passive1",pStatAll.get(i).get(4)); - playerData.set(i+".passive2",pStatAll.get(i).get(5)); - playerData.set(i+".passive3",pStatAll.get(i).get(6)); - playerData.set(i+".skill_1a",pStatAll.get(i).get(7)); - playerData.set(i+".skill_1b",pStatAll.get(i).get(8)); - playerData.set(i+".skill_2a",pStatAll.get(i).get(9)); - playerData.set(i+".skill_2b",pStatAll.get(i).get(10)); - playerData.set(i+".skill_3a",pStatAll.get(i).get(11)); - playerData.set(i+".skill_3b",pStatAll.get(i).get(12)); - playerData.set(i+".skill_M",pStatAll.get(i).get(13)); - playerData.set(i+".triggerAbilityToggle",expBarToggles.get(i)); - playerData.set(i+".showEXPBarToggle",abilityToggles.get(i)); - } - } - playerData.save(f); - PlayerStats playerStats = new PlayerStats(pUUID); - playerStats.setPlayerAreStatsSaved(true); - if (pName != null) { - System.out.println("[FreeRPG] Saved " + pName + " stats successfully"); - } - else { - System.out.println("[FreeRPG] Saved player UUID " + pUUID.toString() + " stats successfully"); - } - } - } - - public void asyncStatSave(){ - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - new BukkitRunnable() { - @Override - public void run() { - try { - setPlayerStatsMap(); - } catch (IOException e) { - e.printStackTrace(); - } - } - }.runTaskAsynchronously(plugin); - } -} diff --git a/src/main/java/mc/carlton/freerpg/serverFileManagement/LeaderBoardFilesManager.java b/src/main/java/mc/carlton/freerpg/serverFileManagement/LeaderBoardFilesManager.java deleted file mode 100644 index 04671b6..0000000 --- a/src/main/java/mc/carlton/freerpg/serverFileManagement/LeaderBoardFilesManager.java +++ /dev/null @@ -1,270 +0,0 @@ -package mc.carlton.freerpg.serverFileManagement; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.globalVariables.StringsAndOtherData; -import mc.carlton.freerpg.playerInfo.Leaderboards; -import mc.carlton.freerpg.playerInfo.PlayerLeaderboardStat; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.plugin.Plugin; - -import java.io.File; -import java.io.IOException; -import java.util.*; - -public class LeaderBoardFilesManager { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - static File leaderBoardsYML; - - - public void initializePlayerFile(){ - File serverData = new File(plugin.getDataFolder(), File.separator + "ServerData"); - File f = new File(serverData,"leaderboards.yml"); - f.setReadable(true,false); - f.setWritable(true,false); - leaderBoardsYML = f; - } - - public void writeOutPlayerLeaderBoardFile() { - //Each time we write the leaderboard file, we want to make the yaml config from scratch so we don't include - //Player's whose files have been deleted. They could linger and mess up rankings order (probably not, but let's be safe, - // as it costs no extra computation) - YamlConfiguration newYamlConfiguration = new YamlConfiguration(); - HashSet allPlayerUUIDs = getHashSetOfAllPlayerUUIDs(); - Leaderboards leaderboards = new Leaderboards(); - leaderboards.removeForbiddenUUIDs(allPlayerUUIDs); //Get rid of players no longer stored in player files - Map> allLeaderboards = leaderboards.getLeaderboards(); - for (String skillName : allLeaderboards.keySet()) { - ArrayList leaderboard = (ArrayList) allLeaderboards.get(skillName).clone(); //We clone here to avoid concurrent modification exception - newYamlConfiguration.createSection(skillName); - if (skillName.equalsIgnoreCase("global")) { - for (int i = 0; i < leaderboard.size(); i++) { - PlayerLeaderboardStat player = leaderboard.get(i); - String section = skillName+"."+i; - newYamlConfiguration.createSection(section); - newYamlConfiguration.set(section+".UUID",player.get_playerUUID().toString()); - newYamlConfiguration.set(section+".playerName",player.get_pName()); - newYamlConfiguration.set(section+".level",player.get_sortedStat()); - newYamlConfiguration.set(section+".totalExperience",player.get_stat2()); - } - } - else if (skillName.equalsIgnoreCase("playTime")) { - for (int i = 0; i < leaderboard.size(); i++) { - PlayerLeaderboardStat player = leaderboard.get(i); - String section = skillName+"."+i; - newYamlConfiguration.createSection(section); - newYamlConfiguration.set(section+".UUID",player.get_playerUUID().toString()); - newYamlConfiguration.set(section+".playerName",player.get_pName()); - newYamlConfiguration.set(section+".totalPlayTime",player.get_sortedStat()); - } - } - else { - for (int i = 0; i < leaderboard.size(); i++) { - PlayerLeaderboardStat player = leaderboard.get(i); - String section = skillName+"."+i; - newYamlConfiguration.createSection(section); - newYamlConfiguration.set(section+".UUID",player.get_playerUUID().toString()); - newYamlConfiguration.set(section+".playerName",player.get_pName()); - newYamlConfiguration.set(section+".experience",player.get_sortedStat()); - } - } - } - try { - newYamlConfiguration.save(leaderBoardsYML); - } - catch (IOException e) { - e.printStackTrace(); - } - } - - public HashSet getHashSetOfAllPlayerUUIDs(){ - // ATTENTION - // THIS NEEDS TO BE CHANGED WHEN MYSQL SUPPORT IS ADDED - // OTHERWISE, LEADERBOARD STATS WILL NOT SAVE PROPERLY - File userdata = new File(plugin.getDataFolder(), File.separator + "PlayerDatabase"); - File[] allUsers = userdata.listFiles(); - HashSet allPlayerUUIDs = new HashSet<>(); - for (File userFile : allUsers) { - UUID playerUUID = UUID.fromString(userFile.getName().substring(0,36)); - allPlayerUUIDs.add(playerUUID); - } - return allPlayerUUIDs; - } - - public void readInLeaderBoardFile() { - YamlConfiguration leaderboardsConfig = YamlConfiguration.loadConfiguration(leaderBoardsYML); - Leaderboards leaderboards = new Leaderboards(); - for (String skillName : leaderboardsConfig.getKeys(false)) { - for (String playerRank : leaderboardsConfig.getConfigurationSection(skillName).getKeys(false)) { - String rankKey = skillName+"."+playerRank; - if (skillName.equalsIgnoreCase("global")) { - UUID playerUUID = UUID.fromString(leaderboardsConfig.getString(rankKey+".UUID")); - String playerName = leaderboardsConfig.getString(rankKey+".playerName"); - int level = leaderboardsConfig.getInt(rankKey+".level"); - int totalExperience = leaderboardsConfig.getInt(rankKey+".totalExperience"); - leaderboards.addPlayerGlobalStat(playerUUID,playerName,level,totalExperience); - } - else if (skillName.equalsIgnoreCase("playTime")){ - UUID playerUUID = UUID.fromString(leaderboardsConfig.getString(rankKey+".UUID")); - String playerName = leaderboardsConfig.getString(rankKey+".playerName"); - long totalPlayTime = leaderboardsConfig.getLong(rankKey+".totalPlayTime"); - leaderboards.addPlayerTimeStat(playerUUID,playerName,totalPlayTime); - } - else { - UUID playerUUID = UUID.fromString(leaderboardsConfig.getString(rankKey+".UUID")); - String playerName = leaderboardsConfig.getString(rankKey+".playerName"); - int experience = leaderboardsConfig.getInt(rankKey+".experience"); - leaderboards.addPlayerSkillStat(playerUUID,playerName,experience,skillName); - } - } - } - leaderboards.sortAllLeaderBoards(true); //Sorts all leaderboards - leaderboards.setLeaderboardsLoaded(true); - } - - public void deleteAbsentPlayersFromFile() { //This is likely best run aysnc - deleteLeaderBoardFile(); - PeriodicSaving periodicSaving = new PeriodicSaving(); - periodicSaving.saveAllStats(false); - createLeaderBoardFile(true); //We just recreate the file, it will only include players in the directory - } - - public void deleteLeaderBoardFile() { - leaderBoardsYML.delete(); - } - - public boolean createLeaderBoardFile(boolean forceCreate){ //This creates a leaderboard file using every player's file on the server, it may take a while to execute - initializePlayerFile(); - if (!leaderBoardsYML.exists() || forceCreate) { - System.out.println("[FreeRPG] Creating Leaderboard File, this may take a while..."); - //Load playerLeaderBoard class and set it to false (since this will likely be done async) - Leaderboards leaderboards = new Leaderboards(); - leaderboards.setLeaderboardsLoaded(false); - - File userdata = new File(plugin.getDataFolder(), File.separator + "PlayerDatabase"); - File[] allUsers = userdata.listFiles(); - YamlConfiguration leaderboardConfig = YamlConfiguration.loadConfiguration(leaderBoardsYML); - List leaderboardNames = leaderboards.getLeaderboardNames(); - - - for (String skillName : leaderboardNames) { - leaderboardConfig.createSection(skillName); - } - for (File userFile : allUsers) { //First we must get the stats of all users and create an arraylist "leaderboard" - Object[] outputOfPlayerDataLoad = loadPlayerDataFromFile(userFile); - YamlConfiguration playerData = (YamlConfiguration) outputOfPlayerDataLoad[0]; - UUID playerUUID = (UUID) outputOfPlayerDataLoad[1]; - for (String skillName : leaderboardNames) { - if (skillName.equalsIgnoreCase("global")) { - String playerName = playerData.getString("general.username"); - int level = playerData.getInt("globalStats.totalLevel"); - int totalExperience = playerData.getInt("globalStats.totalExperience"); - leaderboards.addPlayerGlobalStat(playerUUID,playerName,level,totalExperience); - - } - else if (skillName.equalsIgnoreCase("playTime")) { - String playerName = playerData.getString("general.username"); - long playTime = playerData.getLong("general.playTime"); - leaderboards.addPlayerTimeStat(playerUUID,playerName,playTime); - } - else { - String playerName = playerData.getString("general.username"); - int experience = playerData.getInt(skillName+".experience"); - leaderboards.addPlayerSkillStat(playerUUID,playerName,experience,skillName); - } - } - } - //Now that all the player's information is added to the PlayerLeaderboardClass, we can sort the data - addDataToFile(leaderBoardsYML,leaderboardConfig); //Adds data to leaderboards yaml configuration and saves - leaderboards.setLeaderboardsLoaded(true); - System.out.println("[FreeRPG] leaderboards.yml created successfully!"); - return true; - } - return false; - - } - - public void addDataToFile( File f,YamlConfiguration leaderboardsConfig) { - Leaderboards leaderboards = new Leaderboards(); - List leaderboardNames = leaderboards.getLeaderboardNames(); - leaderboards.sortAllLeaderBoards(true); - //Once it's sorted, we can iterate through every leaderboard - for (String skillName : leaderboardNames) { - ArrayList leaderboard = leaderboards.getLeaderboard(skillName); - if (skillName.equalsIgnoreCase("global")) { - for (int i = 0; i < leaderboard.size(); i++) { //Index each leaderboard player - addPlayerSkillStatsToLeaderBoardGlobal(leaderboardsConfig,i,leaderboard); - } - } - else if (skillName.equalsIgnoreCase("playTime")) { - for (int i = 0; i < leaderboard.size(); i++) { //Index each leaderboard player - addPlayerSkillStatsToLeaderBoardTime(leaderboardsConfig,i,leaderboard); - } - } - else { - for (int i = 0; i < leaderboard.size(); i++) { //Index each leaderboard player - addPlayerSkillStatsToLeaderBoard(leaderboardsConfig,skillName,i,leaderboard); - } - } - } - try { - leaderboardsConfig.save(f); - } - catch (IOException e) { - e.printStackTrace(); - } - } - - - public void addPlayerSkillStatsToLeaderBoard(YamlConfiguration leaderBoardYAML,String skillName, int position,ArrayList leaderboard){ - PlayerLeaderboardStat player = leaderboard.get(position); - UUID playerUUID = player.get_playerUUID(); - String playerName = player.get_pName(); - int experience = (int)player.get_sortedStat(); - String section = skillName+"."+position; - if (!leaderBoardYAML.contains(section)) { - leaderBoardYAML.createSection(section); - } - leaderBoardYAML.set(section+".UUID",playerUUID.toString()); - leaderBoardYAML.set(section+".playerName",playerName); - leaderBoardYAML.set(section+".experience",experience); - } - - public void addPlayerSkillStatsToLeaderBoardGlobal(YamlConfiguration leaderBoardYAML, int position,ArrayList leaderboard){ - PlayerLeaderboardStat player = leaderboard.get(position); - UUID playerUUID = player.get_playerUUID(); - String playerName = player.get_pName(); - int level = (int)player.get_sortedStat(); - int totalExperience = (int)player.get_stat2(); - String section = "global"+"."+position; - if (!leaderBoardYAML.contains(section)) { - leaderBoardYAML.createSection(section); - } - leaderBoardYAML.set(section+".UUID",playerUUID.toString()); - leaderBoardYAML.set(section+".playerName",playerName); - leaderBoardYAML.set(section+".level",level); - leaderBoardYAML.set(section+".totalExperience",totalExperience); - } - - public void addPlayerSkillStatsToLeaderBoardTime(YamlConfiguration leaderBoardYAML, int position,ArrayList leaderboard){ - PlayerLeaderboardStat player = leaderboard.get(position); - UUID playerUUID = player.get_playerUUID(); - String playerName = player.get_pName(); - long playTime = (long)player.get_sortedStat(); - String section = "playTime"+"."+position; - if (!leaderBoardYAML.contains(section)) { - leaderBoardYAML.createSection(section); - } - leaderBoardYAML.set(section+".UUID",playerUUID.toString()); - leaderBoardYAML.set(section+".playerName",playerName); - leaderBoardYAML.set(section+".totalPlayTime",playTime); - } - - public Object[] loadPlayerDataFromFile(File userFile) { - PlayerFilesManager playerFilesManager = new PlayerFilesManager(); - UUID playerUUID = UUID.fromString(userFile.getName().substring(0,36)); - File f1 = playerFilesManager.getPlayerFile(playerUUID); - YamlConfiguration playerData = YamlConfiguration.loadConfiguration(f1); - return new Object[]{playerData, playerUUID}; - } - -} diff --git a/src/main/java/mc/carlton/freerpg/serverFileManagement/PeriodicSaving.java b/src/main/java/mc/carlton/freerpg/serverFileManagement/PeriodicSaving.java deleted file mode 100644 index 99d30b1..0000000 --- a/src/main/java/mc/carlton/freerpg/serverFileManagement/PeriodicSaving.java +++ /dev/null @@ -1,96 +0,0 @@ -package mc.carlton.freerpg.serverFileManagement; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import mc.carlton.freerpg.playerInfo.PlayerStatsLoadIn; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.io.IOException; -import java.util.*; - -public class PeriodicSaving { - public void periodicallySaveStats() { - int secondsWait; - ConfigLoad loadConfig = new ConfigLoad(); - secondsWait = loadConfig.getSaveStatsTimer(); - if (secondsWait < 1) { - return; - } - int ticksWait = secondsWait*20; - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - new BukkitRunnable() { - @Override - public void run() { - saveAllStats(false); - } - }.runTaskTimerAsynchronously(plugin,ticksWait,ticksWait); - } - - public void saveAllStats(boolean thoroughSave) { - if (thoroughSave) { - //A random UUID is used here for the rare occasion where we the need the full players' stats map without a player - PlayerStats playerStats = new PlayerStats(UUID.randomUUID()); - Map>> player_statsMap = playerStats.getData(); - HashSet times = new HashSet<>(); - double N = 0; - for (UUID pUUId : player_statsMap.keySet()) { - long time = System.currentTimeMillis(); - savePlayer(pUUId); - times.add(System.currentTimeMillis()-time); - N+=1.0; - } - long sum = 0; - for (long time : times) { - sum += time; - } - double avg = Math.round((sum/N)*100)/100.0; - System.out.println("[FreeRPG] Total time Taken: " + sum + " ms"); - System.out.println("[FreeRPG] Average time Taken: " + avg + " ms"); - - } - else { - for (Player p : Bukkit.getOnlinePlayers()) { - savePlayer(p); - } - } - RecentPlayersFileManager recentPlayersFileManager = new RecentPlayersFileManager(); - recentPlayersFileManager.writeRecentPlayers(); - LeaderBoardFilesManager leaderBoardFilesManager = new LeaderBoardFilesManager(); - leaderBoardFilesManager.writeOutPlayerLeaderBoardFile(); - PlacedBlockFileManager saveBlocks = new PlacedBlockFileManager(); - saveBlocks.writePlacedBlocks(); - } - - public void savePlayer(Player p) { - try { - PlayerStatsLoadIn loadIn = new PlayerStatsLoadIn(p); - loadIn.setPlayerStatsMap(); - } - catch (IOException e) { - System.out.println("[FreeRPG] FAILED TO SAVE STATS OF PLAYER: " + p.getDisplayName()); - } - } - - public void savePlayer(UUID playerUUID) { - try { - PlayerStatsLoadIn loadIn = new PlayerStatsLoadIn(playerUUID); - loadIn.setPlayerStatsMap(isPlayerOnline(playerUUID)); - } - catch (IOException e) { - System.out.println("[FreeRPG] FAILED TO SAVE STATS OF PLAYER UUID:" + playerUUID.toString()); - } - } - - public boolean isPlayerOnline(UUID playerUUID) { - if (Bukkit.getPlayer(playerUUID) != null) { - if (Bukkit.getPlayer(playerUUID).isOnline()) { - return true; - } - } - return false; - } -} diff --git a/src/main/java/mc/carlton/freerpg/serverFileManagement/PlacedBlockFileManager.java b/src/main/java/mc/carlton/freerpg/serverFileManagement/PlacedBlockFileManager.java deleted file mode 100644 index bf57582..0000000 --- a/src/main/java/mc/carlton/freerpg/serverFileManagement/PlacedBlockFileManager.java +++ /dev/null @@ -1,98 +0,0 @@ -package mc.carlton.freerpg.serverFileManagement; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.serverInfo.PlacedBlocksManager; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.plugin.Plugin; - -import java.io.*; -import java.util.HashSet; - -public class PlacedBlockFileManager { - static File placedBlocksDat; - - - public void initializePlacedBlocks(){ - PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); - HashSet blocks = placedBlocksManager.getBlocks(); - File f = placedBlocksDat; - String path = f.getPath(); - if (f.exists()) { - try (BufferedReader fileReader = new BufferedReader(new FileReader(path))) { - String line = fileReader.readLine(); - while (line != null) { - String[] coords_string = line.split(","); - String worldName = coords_string[0]; - double x = Integer.parseInt(coords_string[1]); - double y = Integer.parseInt(coords_string[2]); - double z = Integer.parseInt(coords_string[3]); - World world = Bukkit.getWorld(worldName); - Location location = new Location(world,x,y,z); - blocks.add(location); - line = fileReader.readLine(); - } - placedBlocksManager.setBlocksMap(blocks); - } catch (IOException error) { - error.printStackTrace(); - } - } - } - - public void writePlacedBlocks() { - File f = placedBlocksDat; - PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); - HashSet blocks = placedBlocksManager.getBlocks(); - String path = f.getPath(); - if (f.exists()) { - try (BufferedWriter fileWriter = new BufferedWriter(new FileWriter(path,false))) { - for (Location location : blocks) { - if (!location.isWorldLoaded()) { //If a world is unloaded, location.getWorld() doesn't work. Will fix later - continue; - } - World world = location.getWorld(); - if (world != null) { - String worldName = world.getName(); - String x = Integer.toString(location.getBlockX()); - String y = Integer.toString(location.getBlockY()); - String z = Integer.toString(location.getBlockZ()); - fileWriter.write(worldName + "," + x + "," + y + "," + z); - fileWriter.write("\n"); - } - } - } catch (IOException error) { - error.printStackTrace(); - } - } - } - - public void initializePlacedBlocksFile(){ - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - File serverData = new File(plugin.getDataFolder(), File.separator + "ServerData"); - File f = new File(serverData,"blockLocations.dat"); - f.setReadable(true,false); - f.setWritable(true,false); - placedBlocksDat = f; - String path = f.getPath(); - World world = Bukkit.getServer().getWorlds().get(0); - String worldName = world.getName(); - //When BlocksPlacedData file is created for the first time... - try { - if (!f.exists()) { - f.createNewFile(); - try (FileWriter fileWriter = new FileWriter(path)) { - fileWriter.write(worldName + ",0,0,0"); - fileWriter.write("\n"); - fileWriter.write(worldName + ",1,1,1"); - } catch (IOException exception) { - exception.printStackTrace(); - } - } - } - catch (IOException error) { - error.printStackTrace(); - } - - } -} diff --git a/src/main/java/mc/carlton/freerpg/serverFileManagement/PlayerFilesManager.java b/src/main/java/mc/carlton/freerpg/serverFileManagement/PlayerFilesManager.java deleted file mode 100644 index 85da151..0000000 --- a/src/main/java/mc/carlton/freerpg/serverFileManagement/PlayerFilesManager.java +++ /dev/null @@ -1,68 +0,0 @@ -package mc.carlton.freerpg.serverFileManagement; - -import mc.carlton.freerpg.FreeRPG; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; - -import java.io.File; -import java.util.Map; -import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; - -public class PlayerFilesManager { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - static Map playerFiles = new ConcurrentHashMap<>(); - - public void addPlayerFile(Player p, File file) { - UUID uuid = p.getUniqueId(); - playerFiles.put(uuid,file); - } - public void addPlayerFile(UUID playerUUID, File file) { - playerFiles.put(playerUUID,file); - } - - public File getPlayerFile(Player p) { - UUID uuid = p.getUniqueId(); - if (playerFiles.containsKey(uuid)) { - return playerFiles.get(uuid); - } - else { - return loadPlayerFile(p); - } - } - public File getPlayerFile(UUID playerUUID) { - if (playerFiles.containsKey(playerUUID)) { - return playerFiles.get(playerUUID); - } - else { - return loadPlayerFile(playerUUID); - } - } - - public File loadPlayerFile(Player p) { - return loadPlayerFile(p.getUniqueId()); - } - - public File loadPlayerFile(UUID playerUUID) { - File f = new File(plugin.getDataFolder(), File.separator + "PlayerDatabase" + File.separator + playerUUID.toString() + ".yml"); - f.setReadable(true,false); - f.setWritable(true,false); - addPlayerFile(playerUUID,f); - return f; - } - - public void removePlayerFile(Player p) { - UUID playerUUID = p.getUniqueId(); - if (playerFiles.containsKey(playerUUID)) { - playerFiles.remove(playerUUID); - } - } - - public void removePlayerFile(UUID playerUUID) { - if (playerFiles.containsKey(playerUUID)) { - playerFiles.remove(playerUUID); - } - } - - -} diff --git a/src/main/java/mc/carlton/freerpg/serverFileManagement/PlayerStatsFilePreparation.java b/src/main/java/mc/carlton/freerpg/serverFileManagement/PlayerStatsFilePreparation.java deleted file mode 100644 index 2b9cc29..0000000 --- a/src/main/java/mc/carlton/freerpg/serverFileManagement/PlayerStatsFilePreparation.java +++ /dev/null @@ -1,276 +0,0 @@ -package mc.carlton.freerpg.serverFileManagement; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - - -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.time.Instant; -import java.util.ArrayList; -import java.util.Date; -import java.util.UUID; - - -public class PlayerStatsFilePreparation { - FileConfiguration playerData; - - public void initializePlayerDataBase() { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - File userdata = new File(plugin.getDataFolder(), File.separator + "PlayerDatabase"); - if(!userdata.exists()){ - userdata.mkdir(); - } - } - - public void playJoinConditions(Player p) { - String pName = p.getName(); - UUID pUUID = p.getUniqueId(); - preparePlayerFile(pName,pUUID,true); - } - - public void preparePlayerFile(String pName, UUID playerUUID,boolean isRealLogin) { - //When player file is created for the first time... - PlayerFilesManager playerFilesManager = new PlayerFilesManager(); - File f = playerFilesManager.getPlayerFile(playerUUID); - if(!f.exists()){ - asyncCreatePlayerFile(f,pName); - } - else { //If the player's file already exists - asyncUpdatePlayerFile(f,pName,isRealLogin); - } - - } - - public void addIfMissing(String key,Object value) { - if (!playerData.contains(key)) { - playerData.set(key, value); - } - } - - public void createPlayerYAML(String pName) { - //Load some file creation config - ConfigLoad loadConfig = new ConfigLoad(); - String defaultLanguage = loadConfig.getDefaultLanguage(); - ArrayList tokensInfo = loadConfig.getTokensInfo(); - ArrayList soulsInfo = loadConfig.getSoulsInfo(); - int passiveTokens0 = (int) Math.round(tokensInfo.get(4)); - int skillTokens0 = (int) Math.round(tokensInfo.get(5)); - int globalTokens0 = (int) Math.round(tokensInfo.get(6)); - int souls0 = (int) soulsInfo.get(0); - String[] labels = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", "smelting", "enchanting"}; - long unixTime = Instant.now().getEpochSecond(); - Date now = new Date(); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); - - //General Player information - playerData.createSection("general"); - playerData.set("general.username", pName); - playerData.set("general.firstLogin", "\"" + simpleDateFormat.format(now) + "\""); - playerData.set("general.lastLogin", unixTime); - playerData.set("general.lastLogout", unixTime); - playerData.set("general.playTime", 0); - playerData.set("general.language", defaultLanguage); - - //Global stats data - playerData.createSection("globalStats"); - playerData.set("globalStats.totalLevel", 0); - playerData.set("globalStats.globalTokens", globalTokens0); - playerData.set("globalStats.skill_1a", 0); - playerData.set("globalStats.skill_1b", 0); - playerData.set("globalStats.skill_1c", 0); - playerData.set("globalStats.skill_2a", 0); - playerData.set("globalStats.skill_2b", 0); - playerData.set("globalStats.skill_2c", 0); - playerData.set("globalStats.skill_3a", 0); - playerData.set("globalStats.skill_3b", 0); - playerData.set("globalStats.skill_3c", 0); - playerData.set("globalStats.skill_M", 0); - playerData.set("globalStats.flintToggle", 1); - playerData.set("globalStats.oreToggle", 1); - playerData.set("globalStats.speedToggle", 1); - playerData.set("globalStats.potionToggle", 1); - playerData.set("globalStats.grappleToggle", 1); - playerData.set("globalStats.hotRodToggle", 1); - playerData.set("globalStats.veinMinerToggle", 1); - playerData.set("globalStats.megaDigToggle", 1); - playerData.set("globalStats.souls", souls0); - playerData.set("globalStats.levelUpMessageToggle", 1); - playerData.set("globalStats.abilityPrepareMessageToggle", 1); - playerData.set("globalStats.personalEXPMultiplier", 1.0); - playerData.set("globalStats.triggerAbilitiesToggle", 1); - playerData.set("globalStats.showEXPBarToggle", 1); - playerData.set("globalStats.leafBlowerToggle", 1); - playerData.set("globalStats.holyAxeToggle", 1); - playerData.set("globalStats.numberOfCooldownBars", 1); - playerData.set("globalStats.totalExperience", 0); - playerData.set("globalStats.heartyToggle", 0); - - // Skill Type Data - for (int i = 0; i < labels.length; i++) { - playerData.createSection(labels[i] + ""); - playerData.set(labels[i] + ".level", 0); - playerData.set(labels[i] + ".experience", 0); - playerData.set(labels[i] + ".passiveTokens", passiveTokens0); - playerData.set(labels[i] + ".skillTokens", skillTokens0); - playerData.set(labels[i] + ".passive1", 0); - playerData.set(labels[i] + ".passive2", 0); - playerData.set(labels[i] + ".passive3", 0); - playerData.set(labels[i] + ".skill_1a", 0); - playerData.set(labels[i] + ".skill_1b", 0); - playerData.set(labels[i] + ".skill_2a", 0); - playerData.set(labels[i] + ".skill_2b", 0); - playerData.set(labels[i] + ".skill_3a", 0); - playerData.set(labels[i] + ".skill_3b", 0); - playerData.set(labels[i] + ".skill_M", 0); - playerData.set(labels[i] + ".triggerAbilityToggle", 1); - playerData.set(labels[i] + ".showEXPBarToggle", 1); - } - } - - public void updatePlayerYAML(String pName, boolean isRealLogin) { - String[] labels = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", "smelting", "enchanting"}; - long unixTime = Instant.now().getEpochSecond(); - Date now = new Date(); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); - //General Player information - if (!playerData.contains("general")) { - playerData.createSection("general"); - } - if (!playerData.contains("general.username")) { - playerData.set("general.username", pName); - } - else { - if (isRealLogin) { - String registeredName = playerData.getString("general.username"); - if (!registeredName.equalsIgnoreCase(pName)) { - playerData.set("general.username", pName); - } - } - } - addIfMissing("general.firstLogin","\"" + simpleDateFormat.format(now)+ "\""); - - //Whether it exists or not, the last login will be set to the current unix timestamp - if (isRealLogin) { - playerData.set("general.lastLogin", unixTime); - } - else { - addIfMissing("general.lastLogin",unixTime); - } - - addIfMissing("general.lastLogout",unixTime); - addIfMissing("general.playTime",0); - - if (!playerData.contains("general.language")) { - ConfigLoad loadConfig = new ConfigLoad(); - String defaultLanguage = loadConfig.getDefaultLanguage(); - playerData.set("general.language", defaultLanguage); - } - - //Global stats data - if (!playerData.contains("globalStats")) { - playerData.createSection("globalStats"); - } - addIfMissing("globalStats.totalLevel",0); - addIfMissing("globalStats.globalTokens",0); - addIfMissing("globalStats.skill_1a",0); - addIfMissing("globalStats.skill_1b",0); - addIfMissing("globalStats.skill_1c",0); - addIfMissing("globalStats.skill_2a",0); - addIfMissing("globalStats.skill_2b",0); - addIfMissing("globalStats.skill_2c",0); - addIfMissing("globalStats.skill_3a",0); - addIfMissing("globalStats.skill_3b",0); - addIfMissing("globalStats.skill_3c", 0); - addIfMissing("globalStats.skill_M", 0); - addIfMissing("globalStats.flintToggle", 1); - addIfMissing("globalStats.oreToggle", 1); - addIfMissing("globalStats.speedToggle", 1); - addIfMissing("globalStats.potionToggle", 1); - addIfMissing("globalStats.grappleToggle", 1); - addIfMissing("globalStats.hotRodToggle", 1); - addIfMissing("globalStats.veinMinerToggle", 1); - addIfMissing("globalStats.megaDigToggle", 1); - addIfMissing("globalStats.souls", 0); - addIfMissing("globalStats.levelUpMessageToggle", 1); - addIfMissing("globalStats.abilityPrepareMessageToggle", 1); - addIfMissing("globalStats.personalEXPMultiplier", 1.0); - addIfMissing("globalStats.triggerAbilitiesToggle", 1); - addIfMissing("globalStats.showEXPBarToggle", 1); - addIfMissing("globalStats.leafBlowerToggle",1); - addIfMissing("globalStats.holyAxeToggle",1); - addIfMissing("globalStats.numberOfCooldownBars",1); - addIfMissing("globalStats.totalExperience",0); - addIfMissing("globalStats.heartyToggle",0); - - - // Skill Type Data - for (int i = 0; i < labels.length; i++) { - if (!playerData.contains(labels[i] + "")) { - playerData.createSection(labels[i] + ""); - } - addIfMissing(labels[i] + ".level", 0); - addIfMissing(labels[i] + ".experience", 0); - addIfMissing(labels[i] + ".passiveTokens", 0); - addIfMissing(labels[i] + ".skillTokens", 0); - addIfMissing(labels[i] + ".passive1", 0); - addIfMissing(labels[i] + ".passive2", 0); - addIfMissing(labels[i] + ".passive3", 0); - addIfMissing(labels[i] + ".skill_1a", 0); - addIfMissing(labels[i] + ".skill_1b", 0); - addIfMissing(labels[i] + ".skill_2a", 0); - addIfMissing(labels[i] + ".skill_2b", 0); - addIfMissing(labels[i] + ".skill_3a", 0); - addIfMissing(labels[i] + ".skill_3b", 0); - addIfMissing(labels[i] + ".skill_M", 0); - addIfMissing(labels[i] + ".triggerAbilityToggle", 1); - addIfMissing(labels[i] + ".showEXPBarToggle", 1); - } - } - - public void createPlayerFile(File f, String pName) { - try { - playerData = YamlConfiguration.loadConfiguration(f); - createPlayerYAML(pName); - playerData.save(f); - } catch (IOException exception){ - exception.printStackTrace(); - } - } - - public void updatePlayerFile(File f, String pName, boolean isRealLogin) { - try { - playerData = YamlConfiguration.loadConfiguration(f); - updatePlayerYAML(pName,isRealLogin); - playerData.save(f); - } catch (IOException exception){ - exception.printStackTrace(); - } - } - - public void asyncCreatePlayerFile(File f, String pName) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - new BukkitRunnable() { - @Override - public void run() { - createPlayerFile(f, pName); - } - }.runTaskAsynchronously(plugin); - } - - public void asyncUpdatePlayerFile(File f, String pName, boolean isRealLogin) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - new BukkitRunnable() { - @Override - public void run() { - updatePlayerFile(f, pName,isRealLogin); - } - }.runTaskAsynchronously(plugin); - } -} diff --git a/src/main/java/mc/carlton/freerpg/serverFileManagement/RecentPlayersFileManager.java b/src/main/java/mc/carlton/freerpg/serverFileManagement/RecentPlayersFileManager.java deleted file mode 100644 index 9a06fa9..0000000 --- a/src/main/java/mc/carlton/freerpg/serverFileManagement/RecentPlayersFileManager.java +++ /dev/null @@ -1,70 +0,0 @@ -package mc.carlton.freerpg.serverFileManagement; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.serverInfo.RecentLogouts; -import org.bukkit.plugin.Plugin; - -import java.io.*; -import java.util.ArrayList; -import java.util.UUID; - -public class RecentPlayersFileManager { - static File recentPlayersDat; - - public void initializeRecentPlayers(){ - RecentLogouts recentLogouts = new RecentLogouts(); - ArrayList lastLogoutUUIDs = recentLogouts.getLastLogouts(); - File f = recentPlayersDat; - String path = f.getPath(); - if (f.exists()) { - try (BufferedReader fileReader = new BufferedReader(new FileReader(path))) { - String line = fileReader.readLine(); - while (line != null) { - UUID playerUUID = UUID.fromString(line); - lastLogoutUUIDs.add(playerUUID); - line = fileReader.readLine(); - } - recentLogouts.setLastLogouts(lastLogoutUUIDs); - } catch (IOException error) { - error.printStackTrace(); - } - } - } - - public void writeRecentPlayers() { - File f = recentPlayersDat; - RecentLogouts recentLogouts = new RecentLogouts(); - ArrayList lastLogouts = (ArrayList)recentLogouts.getLastLogouts().clone(); //We clone here to avoid concurrent modification exception - String path = f.getPath(); - if (f.exists()) { - try (BufferedWriter fileWriter = new BufferedWriter(new FileWriter(path,false))) { - for (UUID playerUUID : lastLogouts) { - fileWriter.write(playerUUID.toString()); - fileWriter.write("\n"); - } - } catch (IOException error) { - error.printStackTrace(); - } - } - } - - public void initializeRecentPlayersFile(){ - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - File serverData = new File(plugin.getDataFolder(), File.separator + "ServerData"); - File f = new File(serverData,"recentPlayers.dat"); - f.setReadable(true,false); - f.setWritable(true,false); - recentPlayersDat = f; - //When file is created for the first time... - try { - if (!f.exists()) { - f.createNewFile(); - } - } - catch (IOException error) { - error.printStackTrace(); - } - - } - -} diff --git a/src/main/java/mc/carlton/freerpg/serverFileManagement/ServerDataFolderPreparation.java b/src/main/java/mc/carlton/freerpg/serverFileManagement/ServerDataFolderPreparation.java deleted file mode 100644 index fd36dc0..0000000 --- a/src/main/java/mc/carlton/freerpg/serverFileManagement/ServerDataFolderPreparation.java +++ /dev/null @@ -1,33 +0,0 @@ -package mc.carlton.freerpg.serverFileManagement; - -import mc.carlton.freerpg.FreeRPG; -import org.bukkit.Bukkit; -import org.bukkit.World; -import org.bukkit.plugin.Plugin; -import org.bukkit.util.FileUtil; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Arrays; - -public class ServerDataFolderPreparation { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - - public void initializeServerDataFolder(){ - File serverData = new File(plugin.getDataFolder(), File.separator + "ServerData"); - if (!serverData.exists()) { - serverData.mkdir(); - } - moveFile("blockLocations.dat",serverData); - } - - public void moveFile(String fName,File serverData) { - File f = new File(plugin.getDataFolder(), fName); - if (Arrays.asList(plugin.getDataFolder().listFiles()).contains(f)) { - File newF = new File(serverData, fName); - FileUtil.copy(f,newF); - f.delete(); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/serverFileManagement/YMLManager.java b/src/main/java/mc/carlton/freerpg/serverFileManagement/YMLManager.java deleted file mode 100644 index 485942c..0000000 --- a/src/main/java/mc/carlton/freerpg/serverFileManagement/YMLManager.java +++ /dev/null @@ -1,223 +0,0 @@ -package mc.carlton.freerpg.serverFileManagement; - -import mc.carlton.freerpg.FreeRPG; -import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; -import org.bukkit.plugin.Plugin; -import org.bukkit.util.FileUtil; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; -import java.util.ArrayList; - -public class YMLManager { - - public void updateCheckYML(String fileName) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - File f0 = new File(plugin.getDataFolder(),"config.yml"); - f0.setReadable(true,false); - f0.setWritable(true,false); - FileConfiguration config = YamlConfiguration.loadConfiguration(f0); - if (fileName.equalsIgnoreCase("config.yml") || fileName.equalsIgnoreCase("advancedConfig.yml") || fileName.equalsIgnoreCase("perkConfig.yml") ) { - if (config.contains("general.autoUpdateConfig")) { - if (!config.getBoolean("general.autoUpdateConfig")) { - return; - } - } - } - else if(fileName.equalsIgnoreCase("languages.yml")) { - if (config.contains("general.autoUpdateLanguages")) { - if (!config.getBoolean("general.autoUpdateLanguages")) { - return; - } - } - } - File f = new File(plugin.getDataFolder(),fileName); - f.setReadable(true,false); - f.setWritable(true,false); - FileConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(f); - File f1 = inputStreamToFile(plugin.getResource(fileName),"TEMP_"+fileName); - f1.setReadable(true,false); - f1.setWritable(true,false); - FileConfiguration yamlConfigurationTrue = YamlConfiguration.loadConfiguration(f1); - if (!yamlConfiguration.getKeys(true).equals(yamlConfigurationTrue.getKeys(true))) { - if (fileName.equalsIgnoreCase("languages.yml")) { - updateLanguagesYML(fileName); - } - else { - updateYML(fileName); - } - } - f1.delete(); - } - - public void storeOldFile(String fileName) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - File f = new File(plugin.getDataFolder(),fileName); - f.setReadable(true,false); - f.setWritable(true,false); - File oldLanguagesYMLFolder = new File(plugin.getDataFolder(), File.separator + "OutdatedYMLFiles"); - if(!oldLanguagesYMLFolder.exists()){ - oldLanguagesYMLFolder.mkdir(); - } - File newF = new File(oldLanguagesYMLFolder,"OUTDATED_"+fileName); - FileUtil.copy(f,newF); - } - - public File inputStreamToFile(InputStream inputStream,String fileName) { - try { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - Path outputPath = Paths.get(plugin.getDataFolder().getPath() + "/" + fileName); - Files.copy(inputStream, outputPath, StandardCopyOption.REPLACE_EXISTING); - return new File(plugin.getDataFolder().getPath(),fileName); - } - catch (IOException e) { - e.printStackTrace(); - return null; - } - - } - public ArrayList getAllLastLevelKeys(FileConfiguration configuration) { - ArrayList lastLevelKeys = new ArrayList<>(); - for (String key : configuration.getKeys(true)) { - if (configuration.getConfigurationSection(key) == null) { - lastLevelKeys.add(key); - } - } - return lastLevelKeys; - } - - public void updateLanguagesYML(String fileName) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - System.out.println("[FreeRPG] "+fileName+" keys mismatch the current version's keys. The file may be updated... "); - storeOldFile(fileName); - System.out.println("[FreeRPG] Old "+fileName+" stored in /.../FreeRPG/OutdatedYMLFiles"); - - plugin.saveResource(fileName,true); //Saves default file (with comments) - - File f = new File(plugin.getDataFolder(),fileName); - f.setReadable(true,false); - f.setWritable(true,false); - File outdatedYAML = new File(plugin.getDataFolder(),File.separator + "OutdatedYMLFiles"); - File f2 = new File(outdatedYAML,"OUTDATED_"+fileName); - f2.setReadable(true,false); - f2.setWritable(true,false); - FileConfiguration oldYAML = YamlConfiguration.loadConfiguration(f2); - File f3 = new File(plugin.getDataFolder(),"TEMP_"+fileName); - f3.setReadable(true,false); - f3.setWritable(true,false); - FileConfiguration newYAML = YamlConfiguration.loadConfiguration(f3); - boolean needToSave = false; - boolean addedLines = false; - boolean overWroteData = false; - for (String key : oldYAML.getConfigurationSection("lang").getKeys(false)) { //Checks all languages in the old file - if (!newYAML.contains("lang." + key) || key.equalsIgnoreCase("custom")) { //Checks for new languages in the old file - if (!key.equalsIgnoreCase("custom")) { //If there is a new language, add it to the new file - newYAML.createSection("lang." + key); //Creates new language section - needToSave = true; - } - for (String lastLevelKey : newYAML.getConfigurationSection("lang.enUs").getKeys(false)) { //For every key... - String customKey = "lang." + key + "." + lastLevelKey; - String enUsKey = "lang.enUs." + lastLevelKey; - if (oldYAML.contains(customKey)) { - newYAML.set(customKey, oldYAML.get(customKey)); //Add the custom language's key to the new file - } else { - newYAML.set(customKey, newYAML.get(enUsKey)); //Set the custom language's missing key to the new file - addedLines = true; - needToSave = true; - } - } - } else { //Checks other languages to see if they were changed, overwrites any changes - for (String lastLevelKey : newYAML.getConfigurationSection("lang."+key).getKeys(false)) { //for all language keys - String fullKey = "lang." + key + "." + lastLevelKey; - if (oldYAML.contains(fullKey)) { //if the old file has this key - if (!(oldYAML.get(fullKey).equals(newYAML.get(fullKey))) ) { //and that key is different from the resource file's key - overWroteData = true; //This line tells the plugin what to output - needToSave = true; //This line tells the plugin it must be saved over - } - } else { //If oldYAML is completely missing the key - overWroteData = true; //This line tells the plugin what to output - needToSave = true; //This line tells the plugin it must be saved over - addedLines = true; //Keys were added - } - } - } - } - - - if (needToSave) { - try { - newYAML.save(f); //Changes file (comments are lost) - if (addedLines) { - System.out.println("[FreeRPG] " + fileName + " updated to include new keys."); - } - else { - System.out.println("[FreeRPG] " + fileName + " no new keys were added."); - } - if (overWroteData) { - System.out.println("[FreeRPG] Overwrote some data in " + fileName + " (You may not edit previously defined languages)."); - } - else { - System.out.println("[FreeRPG] No data was overwritten in " + fileName); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - public void updateYML(String fileName) { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - System.out.println("[FreeRPG] "+fileName+" keys mismatch the current version's keys. The file may be updated... "); - storeOldFile(fileName); - System.out.println("[FreeRPG] Old "+fileName+" stored in /.../FreeRPG/OutdatedYMLFiles"); - - plugin.saveResource(fileName,true); //Saves default file (with comments) - - //Loads the new files - File f = new File(plugin.getDataFolder(),fileName); - f.setReadable(true,false); - f.setWritable(true,false); - File outdatedYAML = new File(plugin.getDataFolder(),File.separator + "OutdatedYMLFiles"); - File f2 = new File(outdatedYAML,"OUTDATED_"+fileName); - f2.setReadable(true,false); - f2.setWritable(true,false); - FileConfiguration oldYAML = YamlConfiguration.loadConfiguration(f2); - File f3 = new File(plugin.getDataFolder(),"TEMP_"+fileName); - f3.setReadable(true,false); - f3.setWritable(true,false); - FileConfiguration newYAML = YamlConfiguration.loadConfiguration(f3); - boolean changeMade = false; - ArrayList lastLevelKeys = getAllLastLevelKeys(newYAML); - for (String key : lastLevelKeys) { - if (oldYAML.contains(key) && newYAML.contains(key)) { - if (!oldYAML.get(key).equals(newYAML.get(key))) { - newYAML.set(key, oldYAML.get(key)); //Sets the new config to whatever data was in the old config - changeMade = true; - } - } - } - - - if (fileName.equalsIgnoreCase("languages.yml")) { - - } - - if (changeMade) { - try { - newYAML.save(f); //Changes file (comments are lost) - System.out.println("[FreeRPG] " + fileName + " updated to include new keys."); - } catch (IOException e) { - e.printStackTrace(); - } - } - else { - System.out.println("[FreeRPG] "+fileName+" updated to default version successfully! (If you previously made changes to " + fileName + " this is an error)"); - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/serverInfo/FreeRPGPlaceHolders.java b/src/main/java/mc/carlton/freerpg/serverInfo/FreeRPGPlaceHolders.java deleted file mode 100644 index b1098b1..0000000 --- a/src/main/java/mc/carlton/freerpg/serverInfo/FreeRPGPlaceHolders.java +++ /dev/null @@ -1,285 +0,0 @@ -package mc.carlton.freerpg.serverInfo; - -import mc.carlton.freerpg.globalVariables.StringsAndOtherData; -import mc.carlton.freerpg.playerInfo.ChangeStats; -import mc.carlton.freerpg.playerInfo.Leaderboards; -import mc.carlton.freerpg.playerInfo.PlayerLeaderboardStat; -import mc.carlton.freerpg.playerInfo.PlayerStats; -import me.clip.placeholderapi.expansion.PlaceholderExpansion; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; - -import java.util.*; - -/** - * This class will automatically register as a placeholder expansion - * when a jar including this class is added to the /plugins/placeholderapi/expansions/ folder - * - */ -public class FreeRPGPlaceHolders extends PlaceholderExpansion { - private Plugin freeRPG; - - public FreeRPGPlaceHolders(Plugin plugin) { - this.freeRPG = plugin; - } - /** - * Because this is an internal class, - * you must override this method to let PlaceholderAPI know to not unregister your expansion class when - * PlaceholderAPI is reloaded - * - * @return true to persist through reloads - */ - @Override - public boolean persist(){ - return true; - } - - /** - * This method should always return true unless we - * have a dependency we need to make sure is on the server - * for our placeholders to work! - * This expansion does not require a dependency so we will always return true - */ - @Override - public boolean canRegister() { - return true; - } - - /** - * The name of the person who created this expansion should go here - */ - /** - * The name of the person who created this expansion should go here. - *
For convienience do we return the author from the plugin.yml - * - * @return The name of the author as a String. - */ - @Override - public String getAuthor(){ - return freeRPG.getDescription().getAuthors().toString(); - } - - /** - * The placeholder identifier should go here - * This is what tells PlaceholderAPI to call our onPlaceholderRequest method to obtain - * a value if a placeholder starts with our identifier. - * This must be unique and can not contain % or _ - */ - @Override - public String getIdentifier() { - return "freeRPG"; - } - - /** - * This is the version of this expansion - */ - @Override - public String getVersion(){ - return freeRPG.getDescription().getVersion(); - } - - /** - * This is the method called when a placeholder with our identifier - * is found and needs a value. - *
We specify the value identifier in this method. - *
Since version 2.9.1 can you use OfflinePlayers in your requests. - * - * @param p - * Player - * @param identifier - * A String containing the identifier/value. - * - * @return possibly-null String of the requested identifier. - */ - @Override - public String onPlaceholderRequest(Player p, String identifier) { - String[] identifierParts = identifier.split("_"); - - //Checks if the request is a leaderboard request - if (identifierParts.length >= 4 && identifierParts[0].equalsIgnoreCase("leaderboard")) { //Required for any leaderboard request - Leaderboards leaderboards = new Leaderboards(); - List leaderboardNames = leaderboards.getLeaderboardNames(); - String leaderboardName = ""; - for (String leaderboardTypeName : leaderboardNames) { //Is the first - if (identifierParts[1].equalsIgnoreCase(leaderboardTypeName)) { - leaderboardName = leaderboardTypeName; - } - } - if (!leaderboardName.equalsIgnoreCase("")) { - int position = 0; - try { - position = Integer.valueOf(identifierParts[2]); - } - catch (NumberFormatException e) { - return null; - } - PlayerLeaderboardStat playerStatFromLeaderboard = leaderboards.getPlayerStatAtLeaderBoardPosition(leaderboardName,position); - String stat = identifierParts[3]; - ArrayList leaderboardIdentifiers = getLeaderboardIdentifiers(leaderboardName); - if (stat.equalsIgnoreCase(leaderboardIdentifiers.get(0))) { - return playerStatFromLeaderboard.get_playerUUID().toString(); - } - else if (stat.equalsIgnoreCase(leaderboardIdentifiers.get(1)) || stat.equalsIgnoreCase("username")) { - return playerStatFromLeaderboard.get_pName(); - } - else if (stat.equalsIgnoreCase(leaderboardIdentifiers.get(2)) || stat.equalsIgnoreCase("sortedStat")) { - if (leaderboardName.equalsIgnoreCase("playTime")) { - if (identifierParts.length > 4) { - if (identifierParts[4].equalsIgnoreCase("formatted")) { - return playerStatFromLeaderboard.get_playTimeString(); - } - } - return String.valueOf(playerStatFromLeaderboard.get_sortedStat()); - } - else { - return formatOutput(identifierParts,playerStatFromLeaderboard.get_sortedStat(),4); - } - } - else if (stat.equalsIgnoreCase(leaderboardIdentifiers.get(3)) || stat.equalsIgnoreCase("stat2")) { - if (playerStatFromLeaderboard.get_stat2() != null) { - return formatOutput(identifierParts,playerStatFromLeaderboard.get_stat2(),4); - } - else { - return null; - } - } - } - } - - if(p == null){ - return ""; - } - StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); - ArrayList skillNames = stringsAndOtherData.getSkillNames(); - - PlayerStats playerStats = new PlayerStats(p); - Map> pStats = playerStats.getPlayerData(); - - - //Global Parameters (The else-ifs aren't really necessary, but it helps me organize) - if (identifierParts[0].equalsIgnoreCase("globalLevel")) { - return formatOutput(identifierParts,pStats.get("global").get(0),1); - - } - else if (identifierParts[0].equalsIgnoreCase("globalTokens")) { - return formatOutput(identifierParts,pStats.get("global").get(1),1); - } - else if (identifierParts[0].equalsIgnoreCase("personalMultiplier")) { - return formatOutput(identifierParts,pStats.get("global").get(23),1); - } - else if (identifierParts[0].equalsIgnoreCase("totalSkillTokens")) { - int totalSkilTokens = 0; - for (String skillName : pStats.keySet()){ - if (!skillName.equalsIgnoreCase("global")){ - totalSkilTokens += pStats.get(skillName).get(3).intValue(); - } - } - return formatOutput(identifierParts,totalSkilTokens,1); - } - else if (identifierParts[0].equalsIgnoreCase("totalPassiveTokens")) { - int totalPassiveTokens = 0; - for (String skillName : pStats.keySet()){ - if (!skillName.equalsIgnoreCase("global")){ - totalPassiveTokens += pStats.get(skillName).get(2).intValue(); - } - } - return formatOutput(identifierParts,totalPassiveTokens,1); - } - else if (identifierParts[0].equalsIgnoreCase("souls")) { - return formatOutput(identifierParts,pStats.get("global").get(20),1); - } - else if (identifierParts[0].equalsIgnoreCase("totalEXP") || identifier.equalsIgnoreCase("totalExperience") ) { - return formatOutput(identifierParts,pStats.get("global").get(29),1); - } - else if (identifierParts[0].equalsIgnoreCase("playTime")) { - if (identifierParts.length > 1) { - if (identifierParts[1].equalsIgnoreCase("formatted")) { - return playerStats.getPlayerPlayTimeString(); - } - } - return String.valueOf(playerStats.getNewPlayTime()); - } - else if (identifierParts[0].equalsIgnoreCase("globalLevelRank")) { - Leaderboards leaderboards = new Leaderboards(); - return String.valueOf(leaderboards.getLeaderboardPosition(p,"global")); //Total play time (with FreeRPG installed) - } - else if (identifierParts[0].equalsIgnoreCase("playTimeRank")) { - Leaderboards leaderboards = new Leaderboards(); - return String.valueOf(leaderboards.getLeaderboardPosition(p,"playTime")); //Total play time (with FreeRPG installed) - } - - // Check if the request contains a skill name - boolean potentialSkillSpecificRequest = false; - String skillName = ""; - for (String sName : skillNames) { - if (identifierParts[0].toLowerCase().equalsIgnoreCase(sName)) { - potentialSkillSpecificRequest = true; - skillName = sName; - } - } - - //All skill specific requests - if (potentialSkillSpecificRequest) { //We know identifierParts[0] is a skillName - if (identifierParts[1].equalsIgnoreCase("Level")) { //Level - return formatOutput(identifierParts,pStats.get(skillName).get(0),2); - } - else if (identifierParts[1].equalsIgnoreCase("EXP") || identifier.equalsIgnoreCase(skillName+"experience")) { //Experience - return formatOutput(identifierParts,pStats.get(skillName).get(1),2); - } - else if (identifierParts[1].equalsIgnoreCase("passiveTokens")) { //Passive Tokens - return formatOutput(identifierParts,pStats.get(skillName).get(2),2); - } - else if (identifierParts[1].equalsIgnoreCase("skillTokens")) { //Skill Tokens - return formatOutput(identifierParts,pStats.get(skillName).get(3),2); - } - else if (identifierParts[1].equalsIgnoreCase("Multiplier")) { //Skill Multiplier - ChangeStats changeStats = new ChangeStats(p); - return String.valueOf(changeStats.getSkillMultiplier(skillName)); - } - else if (identifierParts[1].equalsIgnoreCase("EXPtoNext")) { //Skill EXP to next - int EXP = pStats.get(skillName).get(1).intValue(); - int level = pStats.get(skillName).get(0).intValue(); - ChangeStats getEXP = new ChangeStats(p); - int nextEXP = getEXP.getEXPfromLevel(level+1); - int EXPtoNext = nextEXP - EXP; - return formatOutput(identifierParts,EXPtoNext,2); - } - else if (identifierParts[1].equalsIgnoreCase("rank")) { - Leaderboards leaderboards = new Leaderboards(); - return String.valueOf(leaderboards.getLeaderboardPosition(p,skillName)); //Total play time (with FreeRPG installed) - } - } - - - return null; - } - - public ArrayList getLeaderboardIdentifiers(String leaderboardName){ - ArrayList identifiers = new ArrayList<>(); - identifiers.add("UUID"); - identifiers.add("playerName"); - if (leaderboardName.equalsIgnoreCase("global")) { - identifiers.add("totalLevel"); - identifiers.add("totalEXP"); - } - else if (leaderboardName.equalsIgnoreCase("playTime")) { - identifiers.add("totalTimePlayed"); - identifiers.add("null"); - } - else { - identifiers.add("exp"); - identifiers.add("level"); - } - return identifiers; - } - - public String formatOutput(String[] identifierParts,Object value,int formatIdentifierLocation) { - if (identifierParts.length > formatIdentifierLocation) { - if (identifierParts[formatIdentifierLocation].equalsIgnoreCase("formatted")) { - return String.format("%,d", value); - } - } - return String.valueOf(value); - } - -} diff --git a/src/main/java/mc/carlton/freerpg/serverInfo/MinecraftVersion.java b/src/main/java/mc/carlton/freerpg/serverInfo/MinecraftVersion.java deleted file mode 100644 index fa4c9b1..0000000 --- a/src/main/java/mc/carlton/freerpg/serverInfo/MinecraftVersion.java +++ /dev/null @@ -1,51 +0,0 @@ -package mc.carlton.freerpg.serverInfo; - -import org.bukkit.Bukkit; - -public class MinecraftVersion { - public static String minecraftVersion; - public static double minecraftVersion_Double; - - public void initializeVersion() { - minecraftVersion = Bukkit.getVersion(); - if (minecraftVersion.contains("1.8")){ - minecraftVersion_Double = 1.8; - } - else if (minecraftVersion.contains("1.9")){ - minecraftVersion_Double = 1.9; - } - else if (minecraftVersion.contains("1.10")){ - minecraftVersion_Double = 1.10; - } - else if (minecraftVersion.contains("1.11")){ - minecraftVersion_Double = 1.11; - } - else if (minecraftVersion.contains("1.12")){ - minecraftVersion_Double = 1.12; - } - else if (minecraftVersion.contains("1.13")){ - minecraftVersion_Double = 1.13; - } - else if (minecraftVersion.contains("1.14")){ - minecraftVersion_Double = 1.14; - } - else if (minecraftVersion.contains("1.15")){ - minecraftVersion_Double = 1.15; - } - else if (minecraftVersion.contains("1.16")){ - minecraftVersion_Double = 1.16; - } - else { - minecraftVersion_Double = 1.16; - System.out.println("[FreeRPG] Could not determine minecraft verison, Assuming 1.16..."); - } - } - - public double getMinecraftVersion_Double(){ - return minecraftVersion_Double; - } - public String getMinecraftVersion(){ - return minecraftVersion; - } - -} diff --git a/src/main/java/mc/carlton/freerpg/serverInfo/PlacedBlocksManager.java b/src/main/java/mc/carlton/freerpg/serverInfo/PlacedBlocksManager.java deleted file mode 100644 index 5177564..0000000 --- a/src/main/java/mc/carlton/freerpg/serverInfo/PlacedBlocksManager.java +++ /dev/null @@ -1,87 +0,0 @@ -package mc.carlton.freerpg.serverInfo; - -import mc.carlton.freerpg.FreeRPG; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.World; -import org.bukkit.block.Block; -import org.bukkit.plugin.Plugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.io.*; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -public class PlacedBlocksManager { - private static HashSet blocks = new HashSet<>(); //The set of all tracked blocks on the server - private static HashSet temporaryBlocks = new HashSet<>(); //Temporary blocks to be added to blocks later, but are still checked to see if tracked - private static boolean isFileMangerMakingCopy = false; - private static int copiesBeingMade = 0; - - - public boolean isBlockTracked(Block block) { - Location location = block.getLocation(); - return isLocationTracked(location); - } - public boolean isLocationTracked(Location location) { - return blocks.contains(location) || temporaryBlocks.contains(location); //If it is in EITHER list - } - - public HashSet getBlocks() { - isFileMangerMakingCopy = true; //Let all classes know a copy is being made - copiesBeingMade += 1; //Add to to total number of copies currently being made - HashSet blocksCopy = new HashSet<>(blocks); - copiesBeingMade -= 1; //Copy is made, reduce the number of total copies currently being made by one - if (copiesBeingMade <= 0) { //If there are no copies being made (It can be the case that multiple calls to getBlocksMap() were made around the same time - isFileMangerMakingCopy = false; // we can say tell all classes that no copies are being made - } - return blocksCopy; - } - - public void setBlocksMap(HashSet newblocks) { - this.blocks = newblocks; - } - - public void addBlock(Block block) { - Location location = block.getLocation(); - addLocation(location); - } - - public void addLocation(Location location) { - temporaryBlocks.add(location); //Adds the location to a temporary list (NEVER saved to file or iterated through) - if (!isFileMangerMakingCopy) { //If we are making a copy - blocks.add(location); //add the location to the main list of block - temporaryBlocks.remove(location); //Remove from the secondary list - } else { //If we're not making a copy - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - new BukkitRunnable() { //Try again in 1 tick (0.05 s) - @Override - public void run() { - addLocation(location); - } - }.runTaskLater(plugin, 1).getTaskId(); - } - } - public void removeBlock(Block block) { - Location location = block.getLocation(); - removeLocation(location); - } - public void removeLocation(Location location) { - if (!isFileMangerMakingCopy) { //If we are not currently making a copy, remove the block - if (blocks.contains(location)) { - blocks.remove(location); - } - } else { //If we are currently making a copy, wait a tick to try to remove the location again - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - new BukkitRunnable() { - @Override - public void run() { - removeLocation(location); - } - }.runTaskLater(plugin, 1).getTaskId(); - } - } - -} diff --git a/src/main/java/mc/carlton/freerpg/serverInfo/RecentLogouts.java b/src/main/java/mc/carlton/freerpg/serverInfo/RecentLogouts.java deleted file mode 100644 index 3829bcd..0000000 --- a/src/main/java/mc/carlton/freerpg/serverInfo/RecentLogouts.java +++ /dev/null @@ -1,80 +0,0 @@ -package mc.carlton.freerpg.serverInfo; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.playerInfo.OfflinePlayerStatLoadIn; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; - -import java.io.File; -import java.util.ArrayList; -import java.util.UUID; - -public class RecentLogouts { - static ArrayList lastLogouts = new ArrayList<>(); - private int maxPlayersStored; - - public RecentLogouts() { - ConfigLoad configLoad = new ConfigLoad(); - maxPlayersStored = configLoad.getPlayerStatFilesLoadedInOnStartup(); - } - - public void setLastLogouts(ArrayList lastLogouts) { - RecentLogouts.lastLogouts = lastLogouts; - if (lastLogouts.size() < maxPlayersStored) { - fillLastLogoutSlots(); - } - else if (lastLogouts.size() > maxPlayersStored) { - removeLastEntries(false); - } - } - - public ArrayList getLastLogouts() { - return lastLogouts; - } - - public void playerLogout(Player p,boolean disablePlugin) { - UUID playerUUID = p.getUniqueId(); - if (lastLogouts.contains(playerUUID)) { //If a player logs out while they were already in the list of recent logouts, remove them - lastLogouts.remove(playerUUID); - } - removeLastEntries(disablePlugin); //Ensure the recent logout list never exceeds a specified limit (maxPlayerStored) - lastLogouts.add(0,playerUUID); //Adds this player as the most recent logout - } - - public void removeLastEntries(boolean disablePlugin) { - int playersStored = lastLogouts.size(); - if (playersStored >= maxPlayersStored ) { //We are about to add a person, so if the list is full we need to remove the last person on this list - OfflinePlayerStatLoadIn offlinePlayerStatLoadIn = new OfflinePlayerStatLoadIn(); - for (int i = 0; i <= (playersStored-maxPlayersStored); i++) { - if (lastLogouts.isEmpty()) { - return; - } - UUID removedPlayerUUID = lastLogouts.get(lastLogouts.size()-1); - if (!disablePlugin) { //They will be removed anyway if the plugin is disabling - offlinePlayerStatLoadIn.unloadOfflinePlayer(removedPlayerUUID); //Unloads the players stats ONLY if they're offline - } - lastLogouts.remove(lastLogouts.size()-1); //Removes the player's stats from the queue. - //At this point the player is either online and will be added to lastLogouts soon - //Or they are too inactive for their stats to be preloaded with the server. - } - } - } - - public void fillLastLogoutSlots(){ - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - File userdata = new File(plugin.getDataFolder(), File.separator + "PlayerDatabase"); - File[] allUsers = userdata.listFiles(); - for (File f : allUsers) { - UUID playerUUID = UUID.fromString(f.getName().replace(".yml","")); - if (!lastLogouts.contains(playerUUID)) { - lastLogouts.add(playerUUID); - } - if (lastLogouts.size() >= maxPlayersStored) { - break; - } - } - } - - -} diff --git a/src/main/java/mc/carlton/freerpg/serverInfo/RunTimeData.java b/src/main/java/mc/carlton/freerpg/serverInfo/RunTimeData.java deleted file mode 100644 index 511a787..0000000 --- a/src/main/java/mc/carlton/freerpg/serverInfo/RunTimeData.java +++ /dev/null @@ -1,260 +0,0 @@ -package mc.carlton.freerpg.serverInfo; - -import mc.carlton.freerpg.FreeRPG; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.plugin.Plugin; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -public class RunTimeData { - static ArrayList breakBlockTrackedBlockCheckTimes = new ArrayList<>(); - static ArrayList breakBlockConditionalsTimes = new ArrayList<>(); - static ArrayList leftCLickConditionalsTimes = new ArrayList<>(); - static ArrayList changeEXPTimes = new ArrayList<>(); - static ArrayList flintFinderTimes = new ArrayList<>(); - static ArrayList diggingTreasureDropTimes = new ArrayList<>(); - static ArrayList doubleDropTimes = new ArrayList<>(); - static ArrayList logXPDropTimes = new ArrayList<>(); - static ArrayList logBookDropTimes = new ArrayList<>(); - static ArrayList leavesDropTimes = new ArrayList<>(); - static ArrayList timedHasteTimes = new ArrayList<>(); - static ArrayList miningTreasureDropTimes = new ArrayList<>(); - static ArrayList miningWastelessHasteTimes = new ArrayList<>(); - static ArrayList veinMinerTimes = new ArrayList<>(); - static ArrayList leafBlowerTimes = new ArrayList<>(); - static ArrayList storeBlockFaceTimes = new ArrayList<>(); - - - public void logRunTimeData() { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - File runTimeDataFolder = new File(plugin.getDataFolder(), File.separator + "RunTimes"); - if(!runTimeDataFolder.exists()){ - runTimeDataFolder.mkdir(); - } - SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");//dd/MM/yyyy - Date now = new Date(); - String strDate0 = sdfDate.format(now); - String strDate = strDate0.replaceAll(" ","_"); - File f = new File(runTimeDataFolder, "RunTimeData_"+strDate+".dat"); - f.setReadable(true,false); - f.setWritable(true,false); - String path = f.getPath(); - try { - if (!f.exists()) { - f.createNewFile(); - try (FileWriter fileWriter = new FileWriter(path)) { - ArrayList> allData = getAllData(); - for (int i = 0; i < allData.size(); i++) { - writeHeader(fileWriter,i); - writeBody(fileWriter,allData.get(i)); - } - - } catch (IOException exception) { - exception.printStackTrace(); - } - } - } - catch (IOException error) { - error.printStackTrace(); - } - } - - public void addTime(long time, String timeGroup) { - double timeInSeconds = (double) time/1000.0; - if (timeGroup.equalsIgnoreCase("BreakBlocktrackedBlocks")) { - breakBlockTrackedBlockCheckTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("BreakBlockconditionals")) { - breakBlockConditionalsTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("leftClickConditionals")) { - leftCLickConditionalsTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("changeEXP")) { - changeEXPTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("flintFinder")) { - flintFinderTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("diggingTreasureDrop")) { - diggingTreasureDropTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("doubleDrop")) { - doubleDropTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("logXP")) { - logXPDropTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("logBook")) { - logBookDropTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("leaves")) { - leavesDropTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("woodcuttingHaste")) { - timedHasteTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("miningTreasureDrop")) { - miningTreasureDropTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("wastelessHaste")) { - miningWastelessHasteTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("veinMiner")) { - veinMinerTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("leafBlower")) { - leafBlowerTimes.add(timeInSeconds); - } - else if (timeGroup.equalsIgnoreCase("blockFace")) { - storeBlockFaceTimes.add(timeInSeconds); - } - } - - public Map getTimesStatistics(ArrayList times) { - if (times.isEmpty()) { - return null; - } - double sum = 0; - double max = times.get(0); - double min = times.get(0); - for (double time : times) { - sum +=time; - if (time > max) { - max = time; - } - else if (time < min) { - min = time; - } - } - double average = sum/times.size(); - double sqAvgDiff = 0; - for (double time : times) { - sqAvgDiff += (time-average)*(time-average); - } - double var = sqAvgDiff/times.size(); - double stDev = Math.sqrt(var); - Map data = new HashMap<>(); - data.put("total",Double.valueOf(times.size())); - data.put("sum",roundThreePlaces(sum)); - data.put("max",roundThreePlaces(max)); - data.put("min",roundThreePlaces(min)); - data.put("avg",roundThreePlaces(average)); - data.put("stDev",roundThreePlaces(stDev)); - return data; - - } - - public double roundThreePlaces(double number) { - return Math.round(number*1000)/1000.0; - } - - public ArrayList> getAllData(){ - ArrayList> allData = new ArrayList<>(); - allData.add(breakBlockTrackedBlockCheckTimes); - allData.add(breakBlockConditionalsTimes); - allData.add(leftCLickConditionalsTimes); - allData.add(changeEXPTimes); - allData.add(flintFinderTimes); - allData.add(diggingTreasureDropTimes); - allData.add(doubleDropTimes); - allData.add(logXPDropTimes); - allData.add(logBookDropTimes); - allData.add(leavesDropTimes); - allData.add(timedHasteTimes); - allData.add(miningTreasureDropTimes); - allData.add(miningWastelessHasteTimes); - allData.add(veinMinerTimes); - allData.add(leafBlowerTimes); - allData.add(storeBlockFaceTimes); - return allData; - } - - public void writeHeader(FileWriter fileWriter,int i) throws IOException { - String horizontalLine = "---------------------------------------------------------------"+"\n"; - fileWriter.write(horizontalLine); - switch (i) { - case 0: - fileWriter.write("Break Block Tracked Blocks Check"+"\n"); - break; - case 1: - fileWriter.write("Break Block Conditionals"+"\n"); - break; - case 2: - fileWriter.write("Left Click Conditionals"+"\n"); - break; - case 3: - fileWriter.write("Change EXP"+"\n"); - break; - case 4: - fileWriter.write("Flint Finder"+"\n"); - break; - case 5: - fileWriter.write("Digging Treasure Drop"+"\n"); - break; - case 6: - fileWriter.write("Double Drop"+"\n"); - break; - case 7: - fileWriter.write("Log XP Drop"+"\n"); - break; - case 8: - fileWriter.write("Log Book Drop"+"\n"); - break; - case 9: - fileWriter.write("Leaves Drop"+"\n"); - break; - case 10: - fileWriter.write("Woodcutting Timed Haste"+"\n"); - break; - case 11: - fileWriter.write("Mining Treasure Drop"+"\n"); - break; - case 12: - fileWriter.write("Mining Wasteless Haste"+"\n"); - break; - case 13: - fileWriter.write("Vein Miner"+"\n"); - break; - case 14: - fileWriter.write("Leaf Blower"+"\n"); - break; - case 15: - fileWriter.write("Store Block Face"+"\n"); - break; - default: - break; - } - fileWriter.write(horizontalLine); - } - - public void writeBody(FileWriter fileWriter,ArrayList data) throws IOException { - String horizontalBreak = "><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><"+"\n"; - Map statistics = getTimesStatistics(data); - if (statistics != null) { - fileWriter.write("Total # of Times: " + ((int) Math.round(statistics.get("total"))) + "\n"); - fileWriter.write("Total Time Taken: " + (statistics.get("sum")) + " s"+"\n"); - fileWriter.write("Maximum Time Taken: " + (statistics.get("max")) + " s"+"\n"); - fileWriter.write("Minimum Time Taken: " + (statistics.get("min")) + " s"+"\n"); - fileWriter.write("Average Time Taken: " + (statistics.get("avg")) + " s"+"\n"); - fileWriter.write("Standard Deviation: " + (statistics.get("stDev")) + " s"+"\n"); - fileWriter.write(horizontalBreak); - } - ConfigLoad configLoad = new ConfigLoad(); - if (configLoad.isVerboseRunTimeData()) { - for (int i = 0; i < data.size(); i++) { - fileWriter.write(i + ": " + data.get(i) + " s" + "\n"); - } - } - fileWriter.write("\n"); - fileWriter.write("\n"); - - } -} diff --git a/src/main/java/mc/carlton/freerpg/serverInfo/WorldGuardChecks.java b/src/main/java/mc/carlton/freerpg/serverInfo/WorldGuardChecks.java deleted file mode 100644 index a1853cf..0000000 --- a/src/main/java/mc/carlton/freerpg/serverInfo/WorldGuardChecks.java +++ /dev/null @@ -1,115 +0,0 @@ -package mc.carlton.freerpg.serverInfo; - -import com.sk89q.worldedit.bukkit.BukkitAdapter; -import com.sk89q.worldguard.LocalPlayer; -import com.sk89q.worldguard.WorldGuard; -import com.sk89q.worldguard.bukkit.WorldGuardPlugin; -import com.sk89q.worldguard.protection.ApplicableRegionSet; -import com.sk89q.worldguard.protection.flags.Flags; -import com.sk89q.worldguard.protection.regions.RegionContainer; -import com.sk89q.worldguard.protection.regions.RegionQuery; -import mc.carlton.freerpg.configStorage.ConfigLoad; -import org.bukkit.Location; -import org.bukkit.entity.Player; - -public class WorldGuardChecks { - static boolean worldGuardPresent; - - public void initializeWorldGuardPresent() { - worldGuardPresent = true; - try { - WorldGuard.getInstance(); - } catch (NoClassDefFoundError e) { - worldGuardPresent = false; - } - } - - public boolean canBuild(Player p, Location l) { - if (!worldGuardPresent) { - return true; - } - if (!inRegion(l)) { - ConfigLoad loadConfig = new ConfigLoad(); - return loadConfig.isAllowBuild(); - } - RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery(); - LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(p); - com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(l); - if (!hasBypass(localPlayer)) { - return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(p), Flags.BUILD); - }else { - return true; - } - } - - public boolean canPvP(Player p, Location l) { - if (!worldGuardPresent) { - return true; - } - if (!inRegion(l)) { - ConfigLoad loadConfig = new ConfigLoad(); - return loadConfig.isAllowPvP(); - } - RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery(); - LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(p); - com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(l); - if (!hasBypass(localPlayer)) { - return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(p), Flags.PVP); - }else { - return true; - } - } - - public boolean canDamageEntities(Player p, Location l) { - if (!worldGuardPresent) { - return true; - } - if (!inRegion(l)) { - ConfigLoad loadConfig = new ConfigLoad(); - return loadConfig.isAllowHurtAnimals(); - } - RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery(); - LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(p); - com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(l); - if (!hasBypass(localPlayer)) { - return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(p), Flags.DAMAGE_ANIMALS); - }else { - return true; - } - } - - public boolean canExplode(Player p, Location l) { - if (!worldGuardPresent) { - return true; - } - if (!inRegion(l)) { - ConfigLoad loadConfig = new ConfigLoad(); - return loadConfig.isAllowExplosions(); - } - RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery(); - LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(p); - com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(l); - if (!hasBypass(localPlayer)) { - return query.testState(loc, WorldGuardPlugin.inst().wrapPlayer(p), Flags.OTHER_EXPLOSION); - }else { - return true; - } - } - - - public boolean hasBypass(LocalPlayer localPlayer) { - return WorldGuard.getInstance().getPlatform().getSessionManager().hasBypass(localPlayer, localPlayer.getWorld()); - } - - public boolean inRegion(Location l) { - boolean inRegion = false; - com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(l); - RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer(); - RegionQuery query = container.createQuery(); - ApplicableRegionSet set = query.getApplicableRegions(loc); - if (!set.getRegions().isEmpty()) { - inRegion = true; - } - return inRegion; - } -} diff --git a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/LowestLevelInfo.java b/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/LowestLevelInfo.java deleted file mode 100644 index 6762106..0000000 --- a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/LowestLevelInfo.java +++ /dev/null @@ -1,14 +0,0 @@ -package mc.carlton.freerpg.skillAndPerkInfo; - -import java.util.Map; - -public interface LowestLevelInfo { - - Map getAllInfo(); - - Object getInfo(String identifier); - - void setInfo(Map skillPerkLevelInfo); - - void addInfo(String identifier, Object information); -} diff --git a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/PassivePerkInfo.java b/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/PassivePerkInfo.java deleted file mode 100644 index 4991d63..0000000 --- a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/PassivePerkInfo.java +++ /dev/null @@ -1,35 +0,0 @@ -package mc.carlton.freerpg.skillAndPerkInfo; - -import java.util.HashMap; -import java.util.Map; - -public class PassivePerkInfo extends PerkInfo implements LowestLevelInfo { - private Map passivePerkInfo = new HashMap<>(); - - public PassivePerkInfo(Map passivePerkInfo) { - this.passivePerkInfo =passivePerkInfo; - } - - public PassivePerkInfo() { - this(new HashMap<>()); - } - - public Map getAllInfo() { - return passivePerkInfo; - } - - public Object getInfo(String identifier) { - if (passivePerkInfo.containsKey(identifier)) { - return passivePerkInfo; - } - return null; - } - - public void setInfo(Map skillPerkLevelInfo) { - this.passivePerkInfo = skillPerkLevelInfo; - } - - public void addInfo(String identifier, Object information) { - passivePerkInfo.put(identifier,information); - } -} diff --git a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/PerkInfo.java b/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/PerkInfo.java deleted file mode 100644 index 1e31495..0000000 --- a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/PerkInfo.java +++ /dev/null @@ -1,49 +0,0 @@ -package mc.carlton.freerpg.skillAndPerkInfo; - -public class PerkInfo { - private boolean enabled = true; - private int minLevel = -1; - private int maxLevel = -1; - private String perkId; - private String descriptionTemplateId; - - public int getMaxLevel() { - return maxLevel; - } - - public void setMaxLevel(int maxLevel) { - this.maxLevel = maxLevel; - } - - public int getMinLevel() { - return minLevel; - } - - public void setMinLevel(int minLevel) { - this.minLevel = minLevel; - } - - public String getDescriptionTemplateId() { - return descriptionTemplateId; - } - - public void setDescriptionTemplateId(String descriptionTemplateId) { - this.descriptionTemplateId = descriptionTemplateId; - } - - public String getPerkId() { - return perkId; - } - - public void setPerkId(String perkId) { - this.perkId = perkId; - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } -} diff --git a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/SkillPerkInfo.java b/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/SkillPerkInfo.java deleted file mode 100644 index 0c0ff83..0000000 --- a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/SkillPerkInfo.java +++ /dev/null @@ -1,32 +0,0 @@ -package mc.carlton.freerpg.skillAndPerkInfo; - -import java.util.HashMap; -import java.util.Map; - -public class SkillPerkInfo extends PerkInfo { - private Map skillPerkInfo = new HashMap<>(); - - public SkillPerkInfo(Map skillPerkInfo) { - this.skillPerkInfo = skillPerkInfo; - } - - public SkillPerkInfo() { - this(new HashMap<>()); - } - - public Map getSkillPerkInfo() { - return skillPerkInfo; - } - - public void setSkillPerkInfo(Map skillPerkInfo) { - this.skillPerkInfo = skillPerkInfo; - } - - public void addSkillPerkInfo(int level, SkillPerkLevelInfo skillPerkLevelInfo) { - this.skillPerkInfo.put(level, skillPerkLevelInfo); - } - - public void addSkillPerkInfo(int level, Map skillPerkLevelInfo) { - this.skillPerkInfo.put(level,new SkillPerkLevelInfo(level,skillPerkLevelInfo)); - } -} diff --git a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/SkillPerkLevelInfo.java b/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/SkillPerkLevelInfo.java deleted file mode 100644 index 0dda1be..0000000 --- a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/SkillPerkLevelInfo.java +++ /dev/null @@ -1,46 +0,0 @@ -package mc.carlton.freerpg.skillAndPerkInfo; - -import java.util.HashMap; -import java.util.Map; - -public class SkillPerkLevelInfo implements LowestLevelInfo { - private Map skillPerkLevelInfo = new HashMap<>(); - private int level = 0; - - public SkillPerkLevelInfo(int level, Map skillPerkLevelInfo) { - this.level = level; - this.skillPerkLevelInfo =skillPerkLevelInfo; - } - - public SkillPerkLevelInfo(int level) { - this(level,new HashMap<>()); - } - - - public Map getAllInfo() { - return skillPerkLevelInfo; - } - - public Object getInfo(String identifier) { - if (skillPerkLevelInfo.containsKey(identifier)) { - return skillPerkLevelInfo; - } - return null; - } - - public void setInfo(Map skillPerkLevelInfo) { - this.skillPerkLevelInfo = skillPerkLevelInfo; - } - - public void addInfo(String identifier, Object information) { - skillPerkLevelInfo.put(identifier,information); - } - - public int getLevel() { - return level; - } - - public void setLevel(int level) { - this.level = level; - } -} diff --git a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/SkillTreeInfo.java b/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/SkillTreeInfo.java deleted file mode 100644 index e0b5ab3..0000000 --- a/src/main/java/mc/carlton/freerpg/skillAndPerkInfo/SkillTreeInfo.java +++ /dev/null @@ -1,42 +0,0 @@ -package mc.carlton.freerpg.skillAndPerkInfo; - -import mc.carlton.freerpg.skills.SkillName; - -import java.util.HashMap; -import java.util.Map; - -public class SkillTreeInfo { - SkillName skillName; - private Map skillTreeInfo; - - public SkillTreeInfo(SkillName skillName) { - this.skillName = skillName; - skillTreeInfo = new HashMap<>(); - } - - public void addPerkInfo(String perkId, PerkInfo perkInfo) { - skillTreeInfo.put(perkId,perkInfo); - } - - public void removePerkInfo(String perkId) { - if (skillTreeInfo.containsKey(perkId)) { - skillTreeInfo.remove(perkId); - } - } - - public PerkInfo getPerkInfo(String perkId) { - if (skillTreeInfo.containsKey(perkId)) { - return skillTreeInfo.get(perkId); - } - return null; - } - - - public void setSkillName(SkillName skillName) { - this.skillName = skillName; - } - - public SkillName getSkillName() { - return skillName; - } -} diff --git a/src/main/java/mc/carlton/freerpg/skills/SkillName.java b/src/main/java/mc/carlton/freerpg/skills/SkillName.java index 8d6b639..40657c5 100644 --- a/src/main/java/mc/carlton/freerpg/skills/SkillName.java +++ b/src/main/java/mc/carlton/freerpg/skills/SkillName.java @@ -1,127 +1,135 @@ package mc.carlton.freerpg.skills; -import mc.carlton.freerpg.utilities.UtilityMethods; - import java.util.ArrayList; import java.util.Arrays; +import mc.carlton.freerpg.utils.UtilityMethods; public enum SkillName { - DIGGING, - WOODCUTTING, - MINING, - FARMING, - FISHING, - ARCHERY, - BEAST_MASTERY, - SWORDSMANSHIP, - DEFENSE, - AXE_MASTERY, - REPAIR, - AGILITY, - ALCHEMY, - SMELTING, - ENCHANTING, - GLOBAL; + DIGGING, + WOODCUTTING, + MINING, + FARMING, + FISHING, + ARCHERY, + BEAST_MASTERY, + SWORDSMANSHIP, + DEFENSE, + AXE_MASTERY, + REPAIR, + AGILITY, + ALCHEMY, + SMELTING, + ENCHANTING, + GLOBAL; - /** - * Attempts to match a string to a SkillName enum - * @param skillName string representation of skillName - * @return Enum if matched, null otherwise - */ - public static SkillName matchSkillName(String skillName) { - String convertedSkillName = UtilityMethods.camelCaseToSpacedString(skillName).replace(" ","_").toUpperCase(); - try { - return SkillName.valueOf(convertedSkillName); - } catch (NullPointerException exception) { - return null; //We don't want an exception if user input is messed up, and if we really did we can just throw one. - } + /** + * Attempts to match a string to a SkillName enum + * + * @param skillName string representation of skillName + * @return Enum if matched, null otherwise + */ + public static SkillName matchSkillName(String skillName) { + String convertedSkillName = UtilityMethods.camelCaseToSpacedString(skillName).replace(" ", "_") + .toUpperCase(); + try { + return SkillName.valueOf(convertedSkillName); + } catch (NullPointerException exception) { + return null; //We don't want an exception if user input is messed up, and if we really did we can just throw one. } + } - /** - * Gets values in ArrayList representation - * @return ArrayList representation of all enum - */ - public static ArrayList getValues() { - return new ArrayList<>(Arrays.asList(SkillName.values())); - } + /** + * Gets values in ArrayList representation + * + * @return ArrayList representation of all enum + */ + public static ArrayList getValues() { + return new ArrayList<>(Arrays.asList(SkillName.values())); + } - /** - * Gets Main skill enums in ArrayList representation - * @return ArrayList representation of all main skill enum - */ - public static ArrayList getMainSkillValues() { - return new ArrayList<>(Arrays.asList(SkillName.mainSkillValues())); - } + /** + * Gets Main skill enums in ArrayList representation + * + * @return ArrayList representation of all main skill enum + */ + public static ArrayList getMainSkillValues() { + return new ArrayList<>(Arrays.asList(SkillName.mainSkillValues())); + } - /** - * Gets Passive skill enums in ArrayList representation - * @return ArrayList representation of all passive skill enum - */ - public static ArrayList getPassiveSkillValues() { - return new ArrayList<>(Arrays.asList(SkillName.passiveSkillValues())); - } + /** + * Gets Passive skill enums in ArrayList representation + * + * @return ArrayList representation of all passive skill enum + */ + public static ArrayList getPassiveSkillValues() { + return new ArrayList<>(Arrays.asList(SkillName.passiveSkillValues())); + } - /** - * Gets all enums (except global) in ArrayList representation - * @return ArrayList representation of all enum (except GLOBAL) - */ - public static ArrayList getValuesWithoutGlobal() { - return new ArrayList<>(Arrays.asList(SkillName.valuesWithoutGlobal())); - } + /** + * Gets all enums (except global) in ArrayList representation + * + * @return ArrayList representation of all enum (except GLOBAL) + */ + public static ArrayList getValuesWithoutGlobal() { + return new ArrayList<>(Arrays.asList(SkillName.valuesWithoutGlobal())); + } - /** - * Gets main skill enum - * @return array of main skill enum - */ - public static SkillName[] mainSkillValues() { - return new SkillName[]{ - DIGGING, - WOODCUTTING, - MINING, - FARMING, - FISHING, - ARCHERY, - BEAST_MASTERY, - SWORDSMANSHIP, - DEFENSE, - AXE_MASTERY}; - } + /** + * Gets main skill enum + * + * @return array of main skill enum + */ + public static SkillName[] mainSkillValues() { + return new SkillName[]{ + DIGGING, + WOODCUTTING, + MINING, + FARMING, + FISHING, + ARCHERY, + BEAST_MASTERY, + SWORDSMANSHIP, + DEFENSE, + AXE_MASTERY}; + } - /** - * Gets passive skill enum - * @return array of passive skill enum - */ - public static SkillName[] passiveSkillValues() { - return new SkillName[]{ - REPAIR, - AGILITY, - ALCHEMY, - SMELTING, - ENCHANTING,}; - } + /** + * Gets passive skill enum + * + * @return array of passive skill enum + */ + public static SkillName[] passiveSkillValues() { + return new SkillName[]{ + REPAIR, + AGILITY, + ALCHEMY, + SMELTING, + ENCHANTING,}; + } - /** - * Gets all enum except GLOBAL - * @return array of all enum except GLOBAL - */ - public static SkillName[] valuesWithoutGlobal() { - return new SkillName[] { - DIGGING, - WOODCUTTING, - MINING, - FARMING, - FISHING, - ARCHERY, - BEAST_MASTERY, - SWORDSMANSHIP, - DEFENSE, - AXE_MASTERY, - REPAIR, - AGILITY, - ALCHEMY, - SMELTING, - ENCHANTING, - }; - } + /** + * Gets all enum except GLOBAL + * + * @return array of all enum except GLOBAL + */ + public static SkillName[] valuesWithoutGlobal() { + return new SkillName[]{ + DIGGING, + WOODCUTTING, + MINING, + FARMING, + FISHING, + ARCHERY, + BEAST_MASTERY, + SWORDSMANSHIP, + DEFENSE, + AXE_MASTERY, + REPAIR, + AGILITY, + ALCHEMY, + SMELTING, + ENCHANTING, + }; + } } diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Agility.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Agility.java new file mode 100644 index 0000000..2b678d4 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Agility.java @@ -0,0 +1,157 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import org.apache.logging.log4j.Level; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +public class Agility extends Skill { + + static Map gracefulFeetMap = new HashMap<>(); + static Map playerSprintMap = new HashMap<>(); + Random rand = new Random(); //Random class Import + private String skillName = "agility"; + private boolean runMethods; + + + public Agility(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + public double roll(double finalDamage) { + if (!runMethods) { + return 1.0; + } + Map> pStat = pStatClass.getPlayerData(); + int rollLevel = (int) pStat.get(skillName).get(4); + int steelBonesLevel = (int) pStat.get(skillName).get(9); + double multiplier = 1; + if (rollLevel * 0.0005 > rand.nextDouble()) { + multiplier = 0.5 - steelBonesLevel * 0.1; + increaseStats.changeEXP(skillName, expMap.get("rollBaseEXP") + (int) Math.round( + finalDamage * expMap.get("roll_EXPperFallDamagePoint"))); + actionMessage.sendMessage(ChatColor.GREEN + ">>>" + lang.getString("roll") + "<<<"); + } else { + if (finalDamage < p.getHealth()) { + increaseStats.changeEXP(skillName, + (int) Math.round(finalDamage * expMap.get("roll_EXPperFallDamagePoint"))); + } + } + return multiplier; + } + + public boolean dodge(double finalDamage) { + if (!runMethods) { + return false; + } + Map> pStat = pStatClass.getPlayerData(); + int dodgeLevel = (int) pStat.get(skillName).get(7); + double dodgeChance = Math.min(0.2, dodgeLevel * 0.04); + if (dodgeChance > rand.nextDouble()) { + increaseStats.changeEXP(skillName, + (int) Math.round(expMap.get("dodge_EXPperDamagePointAvoided") * finalDamage)); + actionMessage.sendMessage(ChatColor.GREEN + ">>>" + lang.getString("dodge") + "<<<"); + return true; + } else { + return false; + } + } + + public void gracefulFeetStart() { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int gracefulFeetLevel = (int) pStat.get(skillName).get(13); + int gracefulFeetToggle = (int) pStat.get("global").get(14); + if (gracefulFeetLevel > 0 && gracefulFeetToggle > 0) { + if (p.getPotionEffect(PotionEffectType.SPEED) == null) { + p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 20 * 60 * 20, 0)); + } + int natureID = new BukkitRunnable() { + @Override + public void run() { + if (p.getPotionEffect(PotionEffectType.SPEED) == null) { + p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 20 * 60 * 20, 0)); + new BukkitRunnable() { + @Override + public void run() { + if (p.isOnline()) { + if (p.getPotionEffect(PotionEffectType.SPEED) == null) { + p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 20 * 60 * 20, 0)); + } + } + } + }.runTaskLater(plugin, 20 * 60 * 20 + 1); + } + } + }.runTaskTimer(plugin, 200, 200).getTaskId(); + gracefulFeetMap.put(p, natureID); + } + } + + public void gracefulFeetEnd() { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int gracefulFeetLevel = (int) pStat.get(skillName).get(13); + if (gracefulFeetLevel > 0) { + if (gracefulFeetMap.containsKey(p)) { + if (p.isOnline()) { + if (p.hasPotionEffect(PotionEffectType.SPEED)) { + if (p.getPotionEffect(PotionEffectType.SPEED).getAmplifier() < 1) { + p.removePotionEffect(PotionEffectType.SPEED); + } + } + } + Bukkit.getScheduler().cancelTask(gracefulFeetMap.get(p)); + gracefulFeetMap.remove(p); + } + } + + } + + public void sprintingEXP(boolean beginSprint) { + if (!runMethods) { + return; + } + if (beginSprint) { + playerSprintMap.put(p, (new java.util.Date()).getTime()); + } else if (!playerSprintMap.containsKey(p)) { //Somehow never began sprinting + return; + } else { + try { + if (p.isFlying()) { + return; + } + ConfigLoad configLoad = new ConfigLoad(); + double timeThreshold = configLoad.getAgilityMinSprintTimeForExperience(); + long oldTime = playerSprintMap.get(p); + playerSprintMap.remove(p); + long newTime = (new java.util.Date()).getTime(); + long timeSprint = newTime - oldTime; + double timeSprintInSeconds = (timeSprint / 1000.0); + if (timeSprintInSeconds >= timeThreshold) { + int expToGive = (int) Math.round( + timeSprintInSeconds * expMap.get("sprint_EXPperSecondSprinted")); + increaseStats.changeEXP(skillName, expToGive); + } + } catch (Exception e) { + FreeRPG.log(Level.ERROR, e.getMessage()); + } + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Alchemy.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Alchemy.java new file mode 100644 index 0000000..9db4fe5 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Alchemy.java @@ -0,0 +1,614 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import org.bukkit.ChatColor; +import org.bukkit.Effect; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.block.BrewingStand; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.BrewerInventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.potion.PotionData; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.potion.PotionType; +import org.bukkit.scheduler.BukkitRunnable; + +public class Alchemy extends Skill { + + private static Map counter = new HashMap<>(); + private static Map failSafe = new HashMap<>(); + private String skillName = "alchemy"; + private boolean runMethods; + + + public Alchemy(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill("alchemy"); + } + + public void startBrewing(BrewerInventory inventory, ItemStack output, ItemStack input) { + if (!runMethods) { + return; + } + if (counter.containsKey(inventory)) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + //int speedBrewingLevel = (int) pStat.get(skillName).get(7); + int time = 400; + BrewingStand stand = inventory.getHolder(); + World world = stand.getWorld(); + ItemStack[] originalContents = {inventory.getItem(0), inventory.getItem(1), + inventory.getItem(2), inventory.getItem(3), inventory.getItem(4)}; + counter.put(inventory, time); + failSafe.put(inventory, time + 2); + stand.setBrewingTime(time); + if (stand.getFuelLevel() == 0) { + return; + } + stand.update(); + new BukkitRunnable() { + @Override + public void run() { + failSafe.put(inventory, failSafe.get(inventory) - 1); + if (failSafe.get(inventory) < 0) { + failSafe.remove(inventory); + counter.remove(inventory); + cancel(); + } + int timer = counter.get(inventory); + + if (timer == 0) //Finished brewing item changes + { + originalContents[3].setAmount(originalContents[3].getAmount() - 1); + stand.getSnapshotInventory().setItem(3, originalContents[3]); + PotionMeta outputMeta = (PotionMeta) output.getItemMeta(); + PotionEffect oldEffect = outputMeta.getCustomEffects().get(0); + String normalName = outputMeta.getDisplayName(); + for (int i = 0; i < 3; i++) { + if (inventory.getItem(i) == null || inventory.getItem(i).getType() == Material.AIR) { + continue; + } + + if (inventory.getItem(i).getType() == Material.SPLASH_POTION) { + output.setType(Material.SPLASH_POTION); + outputMeta.setDisplayName( + ChatColor.RESET + ChatColor.WHITE.toString() + "Splash " + normalName); + output.setItemMeta(outputMeta); + } else if (inventory.getItem(i).getType() == Material.LINGERING_POTION) { + output.setType(Material.LINGERING_POTION); + outputMeta.setDisplayName( + ChatColor.RESET + ChatColor.WHITE.toString() + "Lingering " + normalName); + PotionEffectType effect = outputMeta.getCustomEffects().get(0).getType(); + int newLength = (int) Math.round( + outputMeta.getCustomEffects().get(0).getDuration() / 4.0); + outputMeta.addCustomEffect(new PotionEffect(effect, newLength, 0), true); + output.setItemMeta(outputMeta); + } else { + output.setType(Material.POTION); + outputMeta.setDisplayName(ChatColor.RESET + ChatColor.WHITE.toString() + normalName); + output.setItemMeta(outputMeta); + } + inventory.setItem(i, output); + stand.getSnapshotInventory().setItem(i, output); + outputMeta.addCustomEffect(oldEffect, true); + increaseStats.changeEXP(skillName, expMap.get("brewCustomPotion")); + + } + + stand.setFuelLevel(stand.getFuelLevel() - 1); + stand.update(); + world.playEffect(stand.getLocation(), Effect.BREWING_STAND_BREW, 1); + counter.remove(inventory); + failSafe.remove(inventory); + cancel(); + return; + } + + // ingredient removed checks + if (inventory.getIngredient() == null) { + counter.remove(inventory); + failSafe.remove(inventory); + cancel(); + return; + } + if (inventory.getIngredient().getType() != input.getType()) { + counter.remove(inventory); + failSafe.remove(inventory); + cancel(); + return; + } + + // water bottles removed check + boolean[] bottles = {false, false, false}; + for (int i = 0; i < 3; i++) { + if (inventory.getItem(i) != null && inventory.getItem(i).getType() != Material.AIR) { + bottles[i] = true; + } + } + if (!bottles[0] && !bottles[1] && !bottles[2]) { + counter.remove(inventory); + failSafe.remove(inventory); + cancel(); + return; + } + //Update counter progress + counter.put(inventory, timer - 1); + stand.setBrewingTime(timer - 1); + for (int i = 0; i < 5; i++) { + if (inventory.getItem(i) == null && originalContents[i] == null) { + continue; + } else if (inventory.getItem(i) == null) { + stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); + originalContents[i] = inventory.getItem(i); + } else if (originalContents[i] == null) { + stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); + originalContents[i] = inventory.getItem(i); + } else if (!inventory.getItem(i).equals(originalContents[i])) { + stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); + originalContents[i] = inventory.getItem(i); + } + } + stand.update(); + + } + }.runTaskTimer(plugin, 1, 1); + } + + public void upgradeBrewing(BrewerInventory inventory, ItemStack input, boolean[] slotsToCheck) { + if (!runMethods) { + return; + } + if (input.getType() != Material.REDSTONE && input.getType() != Material.GLOWSTONE_DUST) { + return; + } + double durationMultiplier = 1; + int potency = 0; + if (input.getType() == Material.REDSTONE) { + durationMultiplier = 8.0 / 3.0; + } else if (input.getType() == Material.GLOWSTONE_DUST) { + potency = 1; + durationMultiplier = 0.5; + } + if (counter.containsKey(inventory)) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + //int speedBrewingLevel = (int) pStat.get(skillName).get(7); + int time = 400; //(int) Math.round((1 - speedBrewingLevel * 0.15) * 400); + BrewingStand stand = inventory.getHolder(); + World world = stand.getWorld(); + ItemStack[] originalContents = {inventory.getItem(0), inventory.getItem(1), + inventory.getItem(2), inventory.getItem(3), inventory.getItem(4)}; + counter.put(inventory, time); + failSafe.put(inventory, time + 2); + stand.setBrewingTime(time); + if (stand.getFuelLevel() == 0) { + return; + } + stand.update(); + double finalDurationMultiplier = durationMultiplier; + int finalPotency = potency; + new BukkitRunnable() { + @Override + public void run() { + failSafe.put(inventory, failSafe.get(inventory) - 1); + if (failSafe.get(inventory) < 0) { + failSafe.remove(inventory); + counter.remove(inventory); + cancel(); + } + int timer = counter.get(inventory); + + if (timer == 0) //Finished brewing item changes + { + originalContents[3].setAmount(originalContents[3].getAmount() - 1); + stand.getSnapshotInventory().setItem(3, originalContents[3]); + for (int i = 0; i < 3; i++) { + if (!slotsToCheck[i]) { + continue; + } + if (inventory.getItem(i) == null || inventory.getItem(i).getType() == Material.AIR) { + continue; + } + ItemStack potion = inventory.getItem(i); + PotionMeta potionMeta = (PotionMeta) potion.getItemMeta(); + PotionEffectType effect = potionMeta.getCustomEffects().get(0).getType(); + int newLength = (int) Math.round( + potionMeta.getCustomEffects().get(0).getDuration() * finalDurationMultiplier); + potionMeta.addCustomEffect(new PotionEffect(effect, newLength, finalPotency), true); + if (finalPotency == 1) { //Glowstone + potionMeta.setDisplayName(potionMeta.getDisplayName() + " II"); + } + potionMeta.removeEnchant(Enchantment.LOYALTY); + potionMeta.addEnchant(Enchantment.DURABILITY, 1, true); + potion.setItemMeta(potionMeta); + stand.getSnapshotInventory().setItem(i, potion); + increaseStats.changeEXP(skillName, expMap.get("upgradeCustomPotion")); + } + + stand.setFuelLevel(stand.getFuelLevel() - 1); + stand.update(); + world.playEffect(stand.getLocation(), Effect.BREWING_STAND_BREW, 1); + counter.remove(inventory); + failSafe.remove(inventory); + cancel(); + return; + } + + // ingredient removed checks + if (inventory.getIngredient() == null) { + counter.remove(inventory); + failSafe.remove(inventory); + cancel(); + return; + } + if (inventory.getIngredient().getType() != input.getType()) { + counter.remove(inventory); + failSafe.remove(inventory); + cancel(); + return; + } + + // water bottles removed check + boolean[] bottles = {false, false, false}; + for (int i = 0; i < 3; i++) { + if (inventory.getItem(i) != null && inventory.getItem(i).getType() != Material.AIR) { + bottles[i] = true; + } + } + if (!bottles[0] && !bottles[1] && !bottles[2]) { + counter.remove(inventory); + failSafe.remove(inventory); + cancel(); + return; + } + //Update counter progress + counter.put(inventory, timer - 1); + stand.setBrewingTime(timer - 1); + + //Check for item changes + for (int i = 0; i < 5; i++) { + if (inventory.getItem(i) == null && originalContents[i] == null) { + continue; + } else if (inventory.getItem(i) == null) { + stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); + originalContents[i] = inventory.getItem(i); + } else if (originalContents[i] == null) { + stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); + originalContents[i] = inventory.getItem(i); + } else if (!(inventory.getItem(i).equals(originalContents[i]))) { + stand.getSnapshotInventory().setItem(i, inventory.getItem(i)); + originalContents[i] = inventory.getItem(i); + } + } + stand.update(); + + } + }.runTaskTimer(plugin, 1, 1); + } + + public boolean comparePotionEffects(ItemStack p1, ItemStack p2) { + if (!runMethods) { + return false; + } + if (p1 == null || p2 == null) { + return false; + } + if (p1.getType() == Material.AIR || p2.getType() == Material.AIR) { + return false; + } + + if (!(p1.getItemMeta() instanceof PotionMeta) || !(p2.getItemMeta() instanceof PotionMeta)) { + return false; + } + PotionType p1Type = ((PotionMeta) p1.getItemMeta()).getBasePotionData().getType(); + PotionType p2Type = ((PotionMeta) p2.getItemMeta()).getBasePotionData().getType(); + if (p1Type == p2Type) { + return true; + } + return false; + } + + + public void drinkPotion(ItemStack potion) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int lengthBoostLevel = (int) pStat.get(skillName).get(4); + double durationMultiplier = 1.0 + 0.001 * lengthBoostLevel; + int potionMasterLevel = (int) Math.min((int) pStat.get(skillName).get(13), 1); + if ((int) pStat.get("global").get(15) != 1) { + potionMasterLevel = 0; + } + if (potion.getType() != Material.POTION) { + return; + } + if (potion.getItemMeta() instanceof PotionMeta) { + PotionType[] noEXPPots0 = {PotionType.MUNDANE, PotionType.WATER, PotionType.AWKWARD, + PotionType.THICK, PotionType.UNCRAFTABLE}; + List noEXPPots = Arrays.asList(noEXPPots0); + if (!noEXPPots.contains(((PotionMeta) potion.getItemMeta()).getBasePotionData().getType())) { + if (((PotionMeta) potion.getItemMeta()).getBasePotionData().isUpgraded()) { + increaseStats.changeEXP(skillName, expMap.get("drinkUpgradedPotion")); + } else if (((PotionMeta) potion.getItemMeta()).getBasePotionData().isExtended()) { + increaseStats.changeEXP(skillName, expMap.get("drinkExtendedPotion")); + } else { + increaseStats.changeEXP(skillName, expMap.get("drinkPotion")); + } + } + + if (((PotionMeta) potion.getItemMeta()).hasCustomEffects()) { + PotionMeta potionMeta = (PotionMeta) potion.getItemMeta(); + increaseStats.changeEXP(skillName, expMap.get("drinkCustomPotion")); + for (PotionEffect effect : potionMeta.getCustomEffects()) { + p.addPotionEffect(new PotionEffect(effect.getType(), + (int) Math.round(effect.getDuration() * durationMultiplier), + effect.getAmplifier() + potionMasterLevel), true); + } + } else { + PotionMeta potionMeta = (PotionMeta) potion.getItemMeta(); + PotionData potionData = potionMeta.getBasePotionData(); + PotionEffect pEffect = potionToEffect(potionData); + if (!pEffect.getType().equals(PotionEffectType.BAD_OMEN)) { + p.addPotionEffect(pEffect, true); + } + + } + } + } + + public PotionEffect potionToEffect(PotionData potionData) { + PotionEffect pEffect = new PotionEffect(PotionEffectType.BAD_OMEN, 1, 1); + Map> pStat = pStatClass.getPlayerData(); + int lengthBoostLevel = (int) pStat.get(skillName).get(4); + double durationMultiplier = 1.0 + 0.001 * lengthBoostLevel; + int potionMasterLevel = (int) Math.min((int) pStat.get(skillName).get(13), 1); + switch (potionData.getType()) { + case WEAKNESS: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.WEAKNESS, + (int) Math.round(20 * 60 * 4 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.WEAKNESS, + (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.WEAKNESS, + (int) Math.round(20 * 90 * durationMultiplier), potionMasterLevel); + } + break; + case POISON: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.POISON, + (int) Math.round(20 * 90 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.POISON, + (int) Math.round(20 * 21 * durationMultiplier), 1 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.POISON, + (int) Math.round(20 * 45 * durationMultiplier), potionMasterLevel); + } + break; + case JUMP: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.JUMP, + (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.JUMP, + (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.JUMP, + (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); + } + break; + case SPEED: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.SPEED, + (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.SPEED, + (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.SPEED, + (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); + } + break; + case WATER_BREATHING: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.WATER_BREATHING, + (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.WATER_BREATHING, + (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.WATER_BREATHING, + (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); + } + break; + case FIRE_RESISTANCE: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.FIRE_RESISTANCE, + (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.FIRE_RESISTANCE, + (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.FIRE_RESISTANCE, + (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); + } + break; + case INSTANT_DAMAGE: + if (potionMasterLevel > 0) { //damages an additional 3(?) hearts + pEffect = new PotionEffect(PotionEffectType.HARM, 1, 0); + } + break; + case SLOW_FALLING: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.SLOW_FALLING, + (int) Math.round(20 * 4 * 60 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.SLOW_FALLING, + (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.SLOW_FALLING, + (int) Math.round(20 * 90 * durationMultiplier), potionMasterLevel); + } + break; + case NIGHT_VISION: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.NIGHT_VISION, + (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.NIGHT_VISION, + (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.NIGHT_VISION, + (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); + } + break; + case INVISIBILITY: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.INVISIBILITY, + (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.INVISIBILITY, + (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.INVISIBILITY, + (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); + } + break; + case INSTANT_HEAL: + if (potionMasterLevel > 0) { //heals an additional 2 hearts + pEffect = new PotionEffect(PotionEffectType.HEAL, 1, 0); + } + break; + case STRENGTH: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.INCREASE_DAMAGE, + (int) Math.round(20 * 8 * 60 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.INCREASE_DAMAGE, + (int) Math.round(20 * 90 * durationMultiplier), 1 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.INCREASE_DAMAGE, + (int) Math.round(20 * 180 * durationMultiplier), potionMasterLevel); + } + break; + case SLOWNESS: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.SLOW, + (int) Math.round(20 * 4 * 60 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.SLOW, + (int) Math.round(20 * 20 * durationMultiplier), 3 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.SLOW, + (int) Math.round(20 * 90 * durationMultiplier), potionMasterLevel); + } + break; + case REGEN: + if (potionData.isExtended()) { + pEffect = new PotionEffect(PotionEffectType.REGENERATION, + (int) Math.round(20 * 90 * durationMultiplier), potionMasterLevel); + } else if (potionData.isUpgraded()) { + pEffect = new PotionEffect(PotionEffectType.REGENERATION, + (int) Math.round(20 * 22 * durationMultiplier), 1 + potionMasterLevel); + } else { + pEffect = new PotionEffect(PotionEffectType.REGENERATION, + (int) Math.round(20 * 45 * durationMultiplier), potionMasterLevel); + } + break; + default: + break; + } + return pEffect; + } + + public void giveBrewingEXP(ItemStack ingredient, ItemStack[] slots) { + if (!runMethods) { + return; + } + int brewedPotions = 0; + for (int i = 0; i < 3; i++) { + if (slots[i] != null) { + if (slots[i].getType() != Material.AIR) { + brewedPotions += 1; + } + } + } + int expToGive = 0; + switch (ingredient.getType()) { + case SUGAR: + expToGive = expMap.get("brewSpeedPotion"); + break; + case RABBIT_FOOT: + expToGive = expMap.get("brewJumpPotion"); + break; + case BLAZE_POWDER: + expToGive = expMap.get("brewStrengthPotion"); + break; + case GLISTERING_MELON_SLICE: + expToGive = expMap.get("brewHealingPotion"); + break; + case SPIDER_EYE: + expToGive = expMap.get("brewPoisonPotion"); + break; + case GHAST_TEAR: + expToGive = expMap.get("brewRegenerationPotion"); + break; + case MAGMA_CREAM: + expToGive = expMap.get("brewFireResistancePotion"); + break; + case PUFFERFISH: + expToGive = expMap.get("brewWaterBreathingPotion"); + break; + case GOLDEN_CARROT: + expToGive = expMap.get("brewNightVisionPotion"); + break; + case TURTLE_HELMET: + expToGive = expMap.get("brewPotionOfTurtleMaster"); + break; + case PHANTOM_MEMBRANE: + expToGive = expMap.get("brewPotionOfSlowFalling"); + break; + case FERMENTED_SPIDER_EYE: + expToGive = expMap.get("brewPotionOfWeakness"); + break; + case NETHER_WART: + expToGive = expMap.get("brewAwkwardPotion"); + break; + case GUNPOWDER: + expToGive = expMap.get("brewSplashPotion"); + break; + case DRAGON_BREATH: + expToGive = expMap.get("brewLingeringPotion"); + break; + case GLOWSTONE: + expToGive = expMap.get("upgradePotion"); + break; + case REDSTONE: + expToGive = expMap.get("extendPotion"); + break; + default: + expToGive = expMap.get("brewAnythingElse"); + break; + + } + increaseStats.changeEXP(skillName, expToGive * brewedPotions); + + + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Archery.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Archery.java new file mode 100644 index 0000000..bb83b91 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Archery.java @@ -0,0 +1,310 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; +import java.util.UUID; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.utils.game.ExpFarmTracker; +import mc.carlton.freerpg.utils.globalVariables.EntityGroups; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.entity.SpectralArrow; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.CrossbowMeta; +import org.bukkit.scheduler.BukkitRunnable; +import org.bukkit.util.Vector; + +public class Archery extends Skill { + + private static ArrayList arrowsToRemove = new ArrayList<>(); + private static HashMap multishotCount = new HashMap<>(); + Random rand = new Random(); //Random class Import + private String skillName = "archery"; + private boolean runMethods; + + public Archery(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + public void initiateAbility() { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.archeryAbility")) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[5] == -1) { + int cooldown = timers.getPlayerCooldownTime(skillName); + if (cooldown < 1) { + int prepMessages = (int) pStatClass.getPlayerData().get("global") + .get(22); //Toggle for preparation messages + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("bow") + + "...<<<"); + } + int taskID = new BukkitRunnable() { + @Override + public void run() { + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " + lang.getString("bow") + + "<<<"); + } + try { + abilities.setPlayerAbility(skillName, -1); + } catch (Exception e) { + + } + } + }.runTaskLater(plugin, 20 * 4).getTaskId(); + abilities.setPlayerAbility(skillName, taskID); + } else { + actionMessage.sendMessage( + ChatColor.RED + lang.getString("rapidFire") + " " + lang.getString("cooldown") + ": " + + ChatColor.WHITE + cooldown + ChatColor.RED + "s"); + } + } + } + + public void enableAbility() { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + actionMessage.sendMessage( + ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("rapidFire") + " " + + lang.getString("activated") + "<<<"); + int durationLevel = (int) pStat.get(skillName).get(4); + double duration0 = Math.ceil(durationLevel * 0.4) + 40; + long duration = (long) duration0; + Bukkit.getScheduler().cancelTask(pAbilities[5]); + abilities.setPlayerAbility(skillName, -2); + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("rapidFire") + " " + lang.getString("readyToUse") + + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("rapidFire") + " " + + lang.getString("ended") + "<<<"; + timers.abilityDurationTimer(skillName, duration, endMessage, coolDownEndMessage); + } + + public void rapidFire(Entity projectile, ItemStack bow) { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + int sniperLevel = (int) pStat.get(skillName).get(8); + double sniperMultiplier = sniperLevel * 0.02 + 1; + if (pAbilities[5] == -2) { + Vector velocity = projectile.getVelocity(); + Vector zero = new Vector(0, 0, 0); + double speed = velocity.distance(zero); + double multiplier = (3.05 / speed) * sniperMultiplier; + if (bow.getType() == Material.CROSSBOW) { + multiplier = (3.15 / speed) * sniperMultiplier; + } + Vector newVelocity = velocity.multiply(multiplier); + projectile.setVelocity(newVelocity); + } + } + + public void sniper(Entity projectile) { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + if (pAbilities[5] != -2) { + int sniperLevel = (int) pStat.get(skillName).get(8); + double sniperMultiplier = sniperLevel * 0.02 + 1; + Vector velocity = projectile.getVelocity(); + Vector newVelocity = velocity.multiply(sniperMultiplier); + projectile.setVelocity(newVelocity); + } + } + + public boolean isFirstMultishot() { + if (!multishotCount.containsKey(p.getUniqueId())) { //First mulitshot (player not in hashmap) + multishotCount.put(p.getUniqueId(), 1); //Set "shot number" to 1 + return true; //This is the the first shot + } else { + if (multishotCount.get(p.getUniqueId()).equals(1)) { //If "shot number" is 1 + multishotCount.put(p.getUniqueId(), 2); //Set the "shot number" to 2 + return false; //This is the second shot + } else { //If "shot number" is 2 (or not 1) + multishotCount.remove( + p.getUniqueId()); //Remove the player until they shoot another multishot + return false; //This is the third shot + } + } + } + + public void retrieval(Entity projectile, ItemStack bow) { + if (!runMethods) { + return; + } + if (bow.getEnchantments().containsKey(Enchantment.ARROW_INFINITE)) { + return; + } + if (bow.getEnchantments().containsKey(Enchantment.MULTISHOT)) { + if (!isFirstMultishot()) { //The first (middle) multishot is always the one that's able to be picked up + return; + } + } + Map> pStat = pStatClass.getPlayerData(); + int retrievalLevel = (int) pStat.get(skillName).get(5); + double retrievalChance = retrievalLevel * 0.0005; + if (retrievalChance > rand.nextDouble()) { + if (projectile instanceof Arrow || projectile instanceof SpectralArrow) { + ItemStack arrow = new ItemStack(Material.ARROW, 1); + ItemStack arrow0 = new ItemStack(Material.ARROW, 1); + int closest = 50; + int arrowIndex = p.getInventory().first(Material.ARROW); + int arrowIndex_s = p.getInventory().first(Material.SPECTRAL_ARROW); + int arrowIndex_t = p.getInventory().first(Material.TIPPED_ARROW); + if (arrowIndex < closest && arrowIndex != -1) { + arrow0 = p.getInventory().getItem(arrowIndex); + closest = arrowIndex; + } + if (arrowIndex_s < closest && arrowIndex_s != -1) { + arrow0 = p.getInventory().getItem(arrowIndex_s); + closest = arrowIndex_s; + } + if (arrowIndex_t < closest && arrowIndex_t != -1) { + arrow0 = p.getInventory().getItem(arrowIndex_t); + closest = arrowIndex_t; + } + arrow.setType(arrow0.getType()); + arrow.setItemMeta(arrow0.getItemMeta()); + arrow.setAmount(1); + new BukkitRunnable() { + @Override + public void run() { + p.getInventory().addItem(arrow); + } + }.runTaskLater(plugin, 2); + arrowsToRemove.add(projectile); + } + } + } + + public void retrievalRemoval(Entity projectile) { + if (!runMethods) { + return; + } + if (arrowsToRemove.contains(projectile)) { + arrowsToRemove.remove(projectile); + projectile.remove(); + } + } + + public void explosiveArrows(Entity projectile, Location loc) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int explosiveLevel = (int) pStat.get(skillName).get(10); + double explosionChance = explosiveLevel * 0.01; + if (explosionChance > rand.nextDouble()) { + World world = projectile.getWorld(); + world.createExplosion(loc, 3, false, false); + increaseStats.changeEXP(skillName, expMap.get("explosiveArrowEXP")); + } + } + + public Material getArrowType() { + int closest = 50; + int arrowIndex = p.getInventory().first(Material.ARROW); + int arrowIndex_s = p.getInventory().first(Material.SPECTRAL_ARROW); + int arrowIndex_t = p.getInventory().first(Material.TIPPED_ARROW); + Material arrowType = Material.AIR; + if (arrowIndex < closest && arrowIndex != -1) { + closest = arrowIndex; + arrowType = Material.ARROW; + } + if (arrowIndex_s < closest && arrowIndex_s != -1) { + closest = arrowIndex_s; + arrowType = Material.SPECTRAL_ARROW; + } + if (arrowIndex_t < closest && arrowIndex_t != -1) { + closest = arrowIndex_t; + arrowType = Material.TIPPED_ARROW; + } + return arrowType; + } + + public void crossbowAbility() { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[5] != -2) { + return; + } + ItemStack crossbow = itemInHand; + CrossbowMeta crossbowMeta = (CrossbowMeta) crossbow.getItemMeta(); + if (!crossbowMeta.hasChargedProjectiles()) { + if (pAbilities[12] > -1) { + Bukkit.getScheduler().cancelTask(pAbilities[12]); + } + int taskID = new BukkitRunnable() { + @Override + public void run() { + Material arrowType = getArrowType(); + if (arrowType != Material.AIR) { + int arrowIndex = p.getInventory().first(arrowType); + crossbowMeta.addChargedProjectile(new ItemStack(arrowType, 1)); + crossbow.setItemMeta(crossbowMeta); + ItemStack arrow = p.getInventory().getItem(arrowIndex); + if (arrow.getType() == arrowType) { + arrow.setAmount(arrow.getAmount() - 1); + } + } + } + }.runTaskLater(plugin, 3).getTaskId(); + abilities.setPlayerAbility("archeryCrossbow", taskID); + } + } + + public void giveHitEXP(double finalDamage, Entity entity) { + if (!runMethods || entity.getType().equals(EntityType.ARMOR_STAND)) { + return; + } + ExpFarmTracker expFarmTracker = new ExpFarmTracker(); + double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity, skillName); + increaseStats.changeEXP(skillName, (int) Math.round( + (finalDamage * expMap.get("arrowDamage_EXPperDamagePointDone") + expMap.get("hitArrow")) + * multiplier)); + } + + public void giveKillEXP(Entity entity) { + if (!runMethods) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + entityGroups.killEntity(entity, skillName, expMap, increaseStats); + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/AxeMastery.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/AxeMastery.java new file mode 100644 index 0000000..31e65a7 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/AxeMastery.java @@ -0,0 +1,280 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.utils.game.ExpFarmTracker; +import mc.carlton.freerpg.utils.globalVariables.EntityGroups; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.World; +import org.bukkit.attribute.Attributable; +import org.bukkit.attribute.Attribute; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +public class AxeMastery extends Skill { + + Random rand = new Random(); //Random class Import + private String skillName = "axeMastery"; + private boolean runMethods; + + + public AxeMastery(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + public void initiateAbility() { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.axeMasteryAbility") || !pStatClass.isPlayerSkillAbilityOn( + skillName)) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { + return; + } + Integer[] pTimers = timers.getPlayerCooldownTimes(); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[9] == -1) { + int cooldown = pTimers[9]; + if (cooldown < 1) { + int prepMessages = (int) pStatClass.getPlayerData().get("global") + .get(22); //Toggle for preparation messages + if (pAbilities[1] != -1 && pTimers[1] >= 1 && prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("axe") + + "...<<<"); + } + int taskID = new BukkitRunnable() { + @Override + public void run() { + try { + Integer[] pTimers2 = timers.getPlayerCooldownTimes(); + Integer[] pAbilities2 = abilities.getPlayerAbilities(); + int prepMessages = (int) pStatClass.getPlayerData().get("global") + .get(22); //Toggle for preparation messages + if (pAbilities2[1] != -1 && pTimers2[1] >= 1 && prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " + lang.getString("axe") + + "<<<"); + } + abilities.setPlayerAbility(skillName, -1); + } catch (Exception e) { + + } + } + }.runTaskLater(plugin, 20 * 4).getTaskId(); + abilities.setPlayerAbility(skillName, taskID); + } else { + actionMessage.sendMessage( + ChatColor.RED + lang.getString("greatAxe") + " " + lang.getString("cooldown") + ": " + + ChatColor.WHITE + cooldown + ChatColor.RED + "s"); + } + } + } + + public void enableAbility() { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + actionMessage.sendMessage( + ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("greatAxe") + " " + + lang.getString("activated") + "<<<"); + int durationLevel = (int) pStat.get(skillName).get(4); + double duration0 = Math.ceil(durationLevel * 0.4) + 40; + long duration = (long) duration0; + Bukkit.getScheduler().cancelTask(pAbilities[9]); + abilities.setPlayerAbility(skillName, -2); + String cooldownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("greatAxe") + " " + lang.getString("readyToUse") + + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("greatAxe") + " " + + lang.getString("ended") + "<<<"; + timers.abilityDurationTimer(skillName, duration, endMessage, cooldownEndMessage); + } + + public void greaterAxe(Entity entity, World world, double finalDamage) { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + if (pAbilities[9] == -2) { + int greaterAxeLevel = (int) pStat.get(skillName).get(7); + double radius = 2 + 0.5 * greaterAxeLevel; + if ((int) pStat.get(skillName).get(11) > 0) { + finalDamage = finalDamage * 2; + } + + Location location = entity.getLocation(); + Block blockAboveGround = location.getBlock().getRelative(BlockFace.DOWN).getRelative(0, 1, 0); + Collection entities = world.getNearbyEntities(location, radius, 2, radius); + for (Entity mob : entities) { + if (mob instanceof LivingEntity) { + if (mob instanceof Player) { + if (((Player) mob).getDisplayName().equalsIgnoreCase(p.getDisplayName())) { + continue; + } + } + ((LivingEntity) mob).damage(finalDamage * 0.25); + increaseStats.changeEXP(skillName, (int) Math.round( + finalDamage * 0.25 * expMap.get("greaterAxeAEO_EXPperDamagePointDone"))); + } + } + for (int x = -1 * (int) Math.ceil(radius / 2.0); x <= (int) Math.ceil(radius / 2.0); x++) { + for (int z = -1 * (int) Math.ceil(radius / 2.0); z <= (int) Math.ceil(radius / 2.0); z++) { + Block b = blockAboveGround.getRelative(x, 0, z); + Block below = b.getRelative(0, -1, 0); + Material blockType = below.getType(); + if (blockType != Material.AIR) { + if (blockType == Material.WATER) { + world.spawnParticle(Particle.WATER_SPLASH, b.getLocation(), 50); + } else { + if (blockType.isBlock()) { + world.spawnParticle(Particle.BLOCK_CRACK, b.getLocation(), 50, + below.getBlockData()); + } + } + } + } + } + + + } + + } + + public boolean[] buffCheckerStrength(int buffLevel, int duration) { + boolean addEffect = true; + boolean hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.INCREASE_DAMAGE)) { + hasEffect = true; + if ((effect.getDuration() > duration && effect.getAmplifier() >= buffLevel) || ( + effect.getAmplifier() > buffLevel && effect.getDuration() > 40)) { + addEffect = false; + } + break potionEffectLoop; + } + } + + boolean[] returnThis = {addEffect, hasEffect}; + return returnThis; + } + + public double divineCritical() { + if (!runMethods) { + return 1.0; + } + double multiplier = 1; + Map> pStat = pStatClass.getPlayerData(); + int divineCriticalsLevel = (int) pStat.get(skillName).get(5); + int betterCritsLevel = (int) pStat.get(skillName).get(12); + if (divineCriticalsLevel * 0.0001 < rand.nextDouble()) { + return multiplier; + } + multiplier = 1.25 + 0.35 * betterCritsLevel; + return multiplier; + } + + public void revitalized() { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int revitalizedLevel = (int) pStat.get(skillName).get(9); + if (revitalizedLevel * 0.01 > rand.nextDouble()) { + double maxHP = ((Attributable) p).getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue(); + p.setHealth(maxHP); + increaseStats.changeEXP(skillName, expMap.get("revitalizedActivateEXP")); + } + } + + public void warriorBlood() { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int warriorBloodLevel = (int) pStat.get(skillName).get(10); + if (warriorBloodLevel < 1) { + return; + } + int duration = 20 * 3 * warriorBloodLevel; + boolean[] strengthChecks = buffCheckerStrength(0, duration); + if (strengthChecks[0]) { + if (strengthChecks[1]) { + p.removePotionEffect(PotionEffectType.INCREASE_DAMAGE); + } + p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, (int) duration, 0)); + } + } + + public void holyAxe(Entity entity, World world, double finalDamage) { + if (!runMethods) { + return; + } + if (entity instanceof LivingEntity) { + if (((LivingEntity) entity).getHealth() < finalDamage) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(27) < 1) { //Holy axe Toggle + return; + } + int holyAxeLevel = (int) pStat.get(skillName).get(8); + if (holyAxeLevel * 0.02 > rand.nextDouble()) { + world.strikeLightning(entity.getLocation()); + increaseStats.changeEXP(skillName, expMap.get("holyAxeActivateEXP")); + } + } + } + + public void giveHitEXP(double finalDamage, Entity entity) { + if (!runMethods || entity.getType().equals(EntityType.ARMOR_STAND)) { + return; + } + ExpFarmTracker expFarmTracker = new ExpFarmTracker(); + double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity, skillName); + increaseStats.changeEXP(skillName, (int) Math.round( + (finalDamage * expMap.get("axeDamage_EXPperDamagePointDone") + expMap.get("dealAxeDamage")) + * multiplier)); + } + + public void giveKillEXP(Entity entity) { + if (!runMethods) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + List axes = itemGroups.getAxes(); + if (!(axes.contains(itemInHand.getType()))) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + entityGroups.killEntity(entity, skillName, expMap, increaseStats); + } + +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/BeastMastery.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/BeastMastery.java new file mode 100644 index 0000000..d69a819 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/BeastMastery.java @@ -0,0 +1,347 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.utils.game.ExpFarmTracker; +import mc.carlton.freerpg.utils.game.HorseRiding; +import mc.carlton.freerpg.utils.globalVariables.EntityGroups; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.attribute.Attributable; +import org.bukkit.attribute.Attribute; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Donkey; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Horse; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Mule; +import org.bukkit.entity.Player; +import org.bukkit.entity.Tameable; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +public class BeastMastery extends Skill { + + private String skillName = "beastMastery"; + + private boolean runMethods; + + + public BeastMastery(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + public void initiateAbility() { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.beastMasteryAbility")) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { + return; + } + Integer[] pTimers = timers.getPlayerCooldownTimes(); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[6] == -1) { + int cooldown = pTimers[6]; + if (cooldown < 1) { + int prepMessages = (int) pStatClass.getPlayerData().get("global") + .get(22); //Toggle for preparation messages + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("leg") + + "...<<<"); + } + int taskID = new BukkitRunnable() { + @Override + public void run() { + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " + lang.getString("leg") + + "<<<"); + } + try { + abilities.setPlayerAbility(skillName, -1); + } catch (Exception e) { + + } + } + }.runTaskLater(plugin, 20 * 4).getTaskId(); + abilities.setPlayerAbility(skillName, taskID); + } else { + actionMessage.sendMessage( + ChatColor.RED + lang.getString("spurKick") + " " + lang.getString("cooldown") + ": " + + ChatColor.WHITE + cooldown + ChatColor.RED + "s"); + } + } + } + + public void enableAbility() { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + int durationLevel = (int) pStat.get(skillName).get(4); + double duration0 = Math.ceil(durationLevel * 0.4) + 40; + long duration = (long) duration0; + int level = (int) pStat.get(skillName).get(13); + Entity horse0 = p.getVehicle(); + if (horse0.getType() == EntityType.HORSE || horse0.getType() == EntityType.DONKEY + || horse0.getType() == EntityType.MULE) { + LivingEntity horse = (LivingEntity) horse0; + for (PotionEffect potionEffect : horse.getActivePotionEffects()) { + if ((potionEffect.getType() == PotionEffectType.SPEED + && potionEffect.getDuration() > duration) || ( + potionEffect.getType() == PotionEffectType.SPEED + && potionEffect.getAmplifier() > level)) { + actionMessage.sendMessage(ChatColor.RED + ">>>" + lang.getString("hyperHorse") + "<<<"); + return; + } + + } + for (PotionEffect potionEffect : horse.getActivePotionEffects()) { + if (potionEffect.getType() == PotionEffectType.SPEED) { + horse.removePotionEffect(PotionEffectType.SPEED); + } + } + horse.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, (int) duration, level + 1)); + } else { + return; + } + + actionMessage.sendMessage( + ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("spurKick") + " " + + lang.getString("activated") + "<<<"); + Bukkit.getScheduler().cancelTask(pAbilities[6]); + abilities.setPlayerAbility(skillName, -2); + String cooldownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("spurKick") + " " + lang.getString("readyToUse") + + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("spurKick") + " " + + lang.getString("ended") + "<<<"; + timers.abilityDurationTimer(skillName, duration, endMessage, cooldownEndMessage); + } + + public void getHorseStats(Entity entity) { + if (!runMethods) { + return; + } + if (itemInHand.getType() != Material.COMPASS) { + return; + } + if (entity.getType() == EntityType.HORSE || entity.getType() == EntityType.DONKEY + || entity.getType() == EntityType.MULE) { + Entity animal = entity; + if (entity.getType() == EntityType.HORSE) { + animal = (Horse) entity; + } else if (entity.getType() == EntityType.DONKEY) { + animal = (Donkey) entity; + } else if (entity.getType() == EntityType.MULE) { + animal = (Mule) entity; + } + Map> pStat = pStatClass.getPlayerData(); + int identifyLevel = (int) pStat.get(skillName).get(12); + if (identifyLevel > 0) { + double maxHealth = ((Attributable) animal).getAttribute(Attribute.GENERIC_MAX_HEALTH) + .getBaseValue(); + double speed = ((Attributable) animal).getAttribute(Attribute.GENERIC_MOVEMENT_SPEED) + .getBaseValue(); + double jump = ((Attributable) animal).getAttribute(Attribute.HORSE_JUMP_STRENGTH) + .getBaseValue(); + + double healthReadable = Math.round((maxHealth / 2.0d) * 10) / 10.0d; + double speedReadable = Math.round(speed * 431.1111) / 10.0d; + double jumpReadable = Math.round((3.31 * jump * jump + 2.38 * jump - 0.40) * 100) / 100.0d; + + double healthPercentage = (healthReadable - 7.5d) / 7.5d; + double speedPercentage = (speedReadable - 4.85d) / (14.55d - 4.85d); + double jumpPercentage = (jumpReadable - 1.086d) / (5.293d - 1.086d); + + String healthRead = ""; + String speedRead = ""; + String jumpRead = ""; + + if (healthPercentage < 0.25) { + healthRead = ChatColor.DARK_RED + Double.toString(healthReadable); + } else if (healthPercentage < 0.75) { + healthRead = ChatColor.YELLOW + Double.toString(healthReadable); + } else { + healthRead = ChatColor.DARK_GREEN + Double.toString(healthReadable); + } + + if (speedPercentage < 0.25) { + speedRead = ChatColor.DARK_RED + Double.toString(speedReadable); + } else if (speedPercentage < 0.75) { + speedRead = ChatColor.YELLOW + Double.toString(speedReadable); + } else { + speedRead = ChatColor.DARK_GREEN + Double.toString(speedReadable); + } + + if (jumpPercentage < 0.25) { + jumpRead = ChatColor.DARK_RED + Double.toString(jumpReadable); + } else if (jumpPercentage < 0.75) { + jumpRead = ChatColor.YELLOW + Double.toString(jumpReadable); + } else { + jumpRead = ChatColor.DARK_GREEN + Double.toString(jumpReadable); + } + + String bars = ChatColor.GREEN + "-------------------------------------------------"; + String title = ChatColor.GOLD + ChatColor.BOLD.toString() + + " Horse Stats "; + String health = ChatColor.AQUA + "HP: " + healthRead + ChatColor.WHITE + "/15.0 hearts"; + String maxSpeed = + ChatColor.AQUA + "Speed: " + speedRead + ChatColor.WHITE + "/14.6 blocks per second"; + String jumpHeight = + ChatColor.AQUA + "Jump Height: " + jumpRead + ChatColor.WHITE + "/5.30 blocks"; + p.sendMessage(bars); + p.sendMessage(title); + p.sendMessage(health); + p.sendMessage(maxSpeed); + p.sendMessage(jumpHeight); + p.sendMessage(bars); + } + } else if (entity.getType() == EntityType.WOLF) { + Tameable dog = (Tameable) entity; + if (dog.isTamed()) { + LivingEntity livingDog = (LivingEntity) dog; + Map> pStat = pStatClass.getPlayerData(); + int sharpTeethLevel = (int) pStat.get(skillName).get(8); + double damageBoost = sharpTeethLevel * 2 / 10.0d + 2.0; + String damageRead = ChatColor.YELLOW + Double.toString(damageBoost); + + double healthRemaining = ((LivingEntity) dog).getHealth(); + double healthReadable = Math.round((healthRemaining / 2.0d) * 10) / 10.0d; + double healthPercentage = (healthReadable) / 10.0d; + String healthRead = ""; + if (healthPercentage < 0.26) { + healthRead = ChatColor.DARK_RED + Double.toString(healthReadable); + } else if (healthPercentage < 0.74) { + healthRead = ChatColor.YELLOW + Double.toString(healthReadable); + } else { + healthRead = ChatColor.DARK_GREEN + Double.toString(healthReadable); + } + + String health = + ChatColor.AQUA + "Max Health: " + healthRead + ChatColor.WHITE + "/10.0 hearts"; + String damage = ChatColor.AQUA + "Damage: " + damageRead + ChatColor.WHITE + "/3.0 hearts"; + String bars = ChatColor.GREEN + "------------------------------------------------"; + String title = ChatColor.GOLD + ChatColor.BOLD.toString() + + " Wolf Stats "; + p.sendMessage(bars); + p.sendMessage(title); + p.sendMessage(health); + p.sendMessage(damage); + p.sendMessage(bars); + + } + } + } + + public void tamingEXP(Entity entity) { + if (!runMethods) { + return; + } + if (entity.getType() == EntityType.HORSE || entity.getType() == EntityType.DONKEY + || entity.getType() == EntityType.MULE || entity.getType() == EntityType.LLAMA) { + increaseStats.changeEXP(skillName, expMap.get("tameHorse")); + } else if (entity.getType() == EntityType.WOLF) { + increaseStats.changeEXP(skillName, expMap.get("tameWolf")); + } else if (entity.getType() == EntityType.CAT) { + increaseStats.changeEXP(skillName, expMap.get("tameCat")); + } else if (entity.getType() == EntityType.PARROT) { + increaseStats.changeEXP(skillName, expMap.get("tameParrot")); + } + } + + public void horseRidingEXP(Entity entity) { + if (!runMethods) { + return; + } + List mounts = Arrays.asList( + new EntityType[]{EntityType.HORSE, EntityType.DONKEY, EntityType.MULE, EntityType.LLAMA, + EntityType.ZOMBIE_HORSE, EntityType.SKELETON_HORSE}); + if (mounts.contains(entity.getType())) { + Entity mount = entity; + HorseRiding data_set = new HorseRiding(); + int taskID = new BukkitRunnable() { + @Override + public void run() { + if (p.isInsideVehicle()) { + if (p.getVehicle().equals(entity)) { + HorseRiding data = new HorseRiding(); + Location oldLocation = data.getOldLocation(p); + Location currentLocation = p.getLocation(); + if (oldLocation.getWorld().equals(currentLocation.getWorld())) { + int dx = oldLocation.getBlockX() - currentLocation.getBlockX(); + int dy = oldLocation.getBlockY() - currentLocation.getBlockY(); + int dz = oldLocation.getBlockZ() - currentLocation.getBlockZ(); + double distance = Math.sqrt(dx * dx + dy * dy + dz * dz); + data.setPlayerLocationMap(p); + if (distance > 5 && distance < 200) { //Moved far enough, but also not teleportation + Block waterCheck1 = currentLocation.getBlock().getRelative(BlockFace.DOWN); + Block waterCheck2 = currentLocation.getBlock(); + if (waterCheck1.getType() != Material.WATER + && waterCheck2.getType() != Material.WATER) { //Prevents water afk machines + increaseStats.changeEXP(skillName, + expMap.get("horseRiding_EXPperSecondMoving") * 5); + } + } + } + } + } + } + }.runTaskTimer(plugin, 100, 100).getTaskId(); + data_set.setTaskMap(taskID, p); + data_set.setPlayerLocationMap(p); + data_set.setMountPlayerMap(entity.getUniqueId(), p); + } + } + + public void breedingEXP(Entity entity) { + if (!runMethods) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + List breedingAnimals = entityGroups.getBreedingAnimals(); + if (breedingAnimals.contains(entity.getType())) { + increaseStats.changeEXP(skillName, expMap.get("breedTameableAnimal")); + } + } + + public void dogKillEntity(Entity entity) { + if (!runMethods) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + entityGroups.killEntity(entity, skillName, expMap, increaseStats); + + } + + public void giveHitEXP(double finalDamage, Entity entity) { + if (!runMethods || entity.getType().equals(EntityType.ARMOR_STAND)) { + return; + } + ExpFarmTracker expFarmTracker = new ExpFarmTracker(); + double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity, skillName); + increaseStats.changeEXP(skillName, (int) Math.round( + (finalDamage * expMap.get("dogDamage_EXPperDamagePointDone") + expMap.get("dogDealDamage")) + * multiplier)); + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Defense.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Defense.java new file mode 100644 index 0000000..fc55937 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Defense.java @@ -0,0 +1,468 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.server.MinecraftVersion; +import mc.carlton.freerpg.utils.game.EntityPickedUpItemStorage; +import mc.carlton.freerpg.utils.game.ExpFarmTracker; +import mc.carlton.freerpg.utils.globalVariables.EntityGroups; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.attribute.Attributable; +import org.bukkit.attribute.Attribute; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +public class Defense extends Skill { + + Random rand = new Random(); //Random class Import + private String skillName = "defense"; + private boolean runMethods; + + + public Defense(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + public void initiateAbility() { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.defenseAbility")) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { + return; + } + Integer[] pTimers = timers.getPlayerCooldownTimes(); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[8] == -1) { + int cooldown = pTimers[8]; + if (cooldown < 1) { + int prepMessages = (int) pStatClass.getPlayerData().get("global") + .get(22); //Toggle for preparation messages + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("yourself") + + "...<<<"); + } + int taskID = new BukkitRunnable() { + @Override + public void run() { + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " + lang.getString( + "yourself") + "<<<"); + } + try { + abilities.setPlayerAbility(skillName, -1); + } catch (Exception e) { + + } + } + }.runTaskLater(plugin, 20 * 4).getTaskId(); + abilities.setPlayerAbility(skillName, taskID); + } else { + actionMessage.sendMessage( + ChatColor.RED + lang.getString("stoneSoldier") + " " + lang.getString("cooldown") + ": " + + ChatColor.WHITE + cooldown + ChatColor.RED + "s"); + } + } + } + + public void enableAbility() { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + actionMessage.sendMessage( + ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("stoneSoldier") + " " + + lang.getString("activated") + "<<<"); + int durationLevel = (int) pStat.get(skillName).get(4); + double duration0 = Math.ceil(durationLevel * 0.4) + 40; + long duration = (long) duration0; + int strongerLegsLevel = (int) pStat.get(skillName).get(12); + int giftFromAboveLevel = (int) pStat.get(skillName).get(11); + boolean[] absorptionChecks = {false, false}; + boolean[] slownessChecks = {true, true}; + if (strongerLegsLevel > 0) { + slownessChecks = buffCheckerSlowness(0, (int) duration); + } else { + slownessChecks = buffCheckerSlowness(3, (int) duration); + } + if (giftFromAboveLevel > 0) { + absorptionChecks = buffCheckerAbsorption(1, (int) duration + 1200); + } + boolean[] resistanceChecks = buffCheckerResistance(2, (int) duration); + + if (absorptionChecks[0]) { + if (absorptionChecks[1]) { + p.removePotionEffect(PotionEffectType.ABSORPTION); + } + p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION, (int) duration + 1200, 1)); + } + + if (slownessChecks[0]) { + if (slownessChecks[1]) { + p.removePotionEffect(PotionEffectType.SLOW); + } + if (strongerLegsLevel > 0) { + p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, (int) duration, 0)); + } else { + p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, (int) duration, 3)); + } + } + + if (resistanceChecks[0]) { + if (resistanceChecks[1]) { + p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); + } + p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, (int) duration, 2)); + } + + Bukkit.getScheduler().cancelTask(pAbilities[8]); + abilities.setPlayerAbility(skillName, -2); + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("stoneSoldier") + " " + lang.getString( + "readyToUse") + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("stoneSoldier") + " " + + lang.getString("ended") + "<<<"; + timers.abilityDurationTimer(skillName, duration, endMessage, coolDownEndMessage); + } + + public void preventLogoutTheft(int taskID_defense, boolean pluginDisabled) { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[8] == -2) { + Map> pStat = pStatClass.getPlayerData(); + int durationLevel = (int) pStat.get(skillName).get(4); + double duration0 = Math.ceil(durationLevel * 0.4) + 40; + long duration = (long) duration0; + int strongerLegsLevel = (int) pStat.get(skillName).get(12); + int giftFromAboveLevel = (int) pStat.get(skillName).get(11); + int slowBuff = 3; + boolean hasAbsorption = false; + if (strongerLegsLevel > 0) { + slowBuff = 0; + } + if (giftFromAboveLevel > 0) { + hasAbsorption = true; + } + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.DAMAGE_RESISTANCE) + && effect.getDuration() <= duration && effect.getAmplifier() == 2) { + p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); + } else if (effect.getType().equals(PotionEffectType.SLOW) + && effect.getDuration() <= duration && effect.getAmplifier() == slowBuff) { + p.removePotionEffect(PotionEffectType.SLOW); + } else if (effect.getType().equals(PotionEffectType.ABSORPTION)) { + if (hasAbsorption) { + if (effect.getDuration() <= duration + 1200 && effect.getAmplifier() == 1) { + p.removePotionEffect(PotionEffectType.ABSORPTION); + p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION, 1200, 1)); + } + } + } + + } + Bukkit.getScheduler().cancelTask(taskID_defense); + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("stoneSoldier") + " " + lang.getString( + "readyToUse") + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("stoneSoldier") + " " + + lang.getString("ended") + "<<<"; + timers.endAbility(skillName, endMessage, coolDownEndMessage, pluginDisabled); + } + } + + public boolean[] buffCheckerResistance(int buffLevel, int duration) { + boolean addEffect = true; + boolean hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.DAMAGE_RESISTANCE)) { + hasEffect = true; + if ((effect.getDuration() > duration && effect.getAmplifier() >= buffLevel) || ( + effect.getAmplifier() > buffLevel && effect.getDuration() > 40)) { + addEffect = false; + } + break potionEffectLoop; + } + } + + boolean[] returnThis = {addEffect, hasEffect}; + return returnThis; + } + + public boolean[] buffCheckerSlowness(int buffLevel, int duration) { + boolean addEffect = true; + boolean hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.SLOW)) { + hasEffect = true; + if ((effect.getDuration() > duration && effect.getAmplifier() >= buffLevel)) { + addEffect = false; + } + break potionEffectLoop; + } + } + + boolean[] returnThis = {addEffect, hasEffect}; + return returnThis; + } + + public boolean[] buffCheckerAbsorption(int buffLevel, int duration) { + boolean addEffect = true; + boolean hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.ABSORPTION)) { + hasEffect = true; + if ((effect.getDuration() > duration && effect.getAmplifier() >= buffLevel) || ( + effect.getAmplifier() > buffLevel && effect.getDuration() > 40)) { + addEffect = false; + } + break potionEffectLoop; + } + } + + boolean[] returnThis = {addEffect, hasEffect}; + return returnThis; + } + + public boolean[] buffCheckerRegeneration(int buffLevel, int duration) { + boolean addEffect = true; + boolean hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.REGENERATION)) { + hasEffect = true; + if ((effect.getDuration() > duration && effect.getAmplifier() >= buffLevel) || ( + effect.getAmplifier() > buffLevel && effect.getDuration() > 40)) { + addEffect = false; + } + break potionEffectLoop; + } + } + + boolean[] returnThis = {addEffect, hasEffect}; + return returnThis; + } + + public double hardBody() { + if (!runMethods) { + return 1.0; + } + Map> pStat = pStatClass.getPlayerData(); + int hardBodyLevel = (int) pStat.get(skillName).get(5); + int hardHeadedLevel = (int) pStat.get(skillName).get(9); + double chance = 0.01 + 0.0001 * hardBodyLevel; + if (chance > rand.nextDouble()) { + double multiplier = Math.max((1 - .33 - .06666 * hardHeadedLevel), 0); + increaseStats.changeEXP(skillName, expMap.get("hardBodyActivate")); + return multiplier; + } + return 1; + } + + public void reactions(double finalDamage) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int reactionsLevel_I = (int) pStat.get(skillName).get(8); + int reactionsLevel_II = (int) pStat.get(skillName).get(10); + if (finalDamage < 1.0) { + return; + } + if (reactionsLevel_II * 0.02 > rand.nextDouble()) { + boolean[] resistanceChecks = buffCheckerResistance(1, 100); + if (resistanceChecks[0]) { + if (resistanceChecks[1]) { + p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); + } + p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 100, 1)); + } + increaseStats.changeEXP(skillName, expMap.get("reactionsLevel2Activate")); + + } else if (reactionsLevel_I * 0.02 > rand.nextDouble()) { + boolean[] resistanceChecks = buffCheckerResistance(0, 100); + if (resistanceChecks[0]) { + if (resistanceChecks[1]) { + p.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE); + } + p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 100, 0)); + } + increaseStats.changeEXP(skillName, expMap.get("reactionsLevel1Activate")); + } + } + + public void hearty() { + Map> pStat = pStatClass.getPlayerData(); + int heartyToggle = (int) pStat.get("global").get(30); + int heartyLevel = (int) pStat.get(skillName).get(13); + if (!runMethods) { + toggleHearty(0, + heartyToggle); //Toggle hearty with level not high enough to be active (can only be turned off if it was on) + return; + } + toggleHearty(heartyLevel, heartyToggle); + } + + public void toggleHearty(int heartyLevel, int heartyToggle) { + /* + * The idea here: + * If hearty is allowed to be on, we turn it on (if it was off) + * If hearty is not allowed to be on, we turn it off (if it was on) + */ + double HP = ((Attributable) p).getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue(); + ChangeStats changeStats = new ChangeStats(p); + if (heartyLevel < 1) { //Hearty level not high enough to be active + if (heartyToggle > 0) { //Hearty was somehow on + ((Attributable) p).getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(HP - 4.0); + changeStats.setStat("global", 30, 0); + } + //Otherwise, hearty was off and we do nothing + } else { //Hearty level is high enough to be active + if (heartyToggle < 1) { //Hearty was off + ((Attributable) p).getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(HP + 4.0); + changeStats.setStat("global", 30, 1); + } + //Otherwise, hearty was on so we do nothing + } + + } + + public void doubleDrops(LivingEntity entity, List drops, World world) { + if (!runMethods) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + List hostileMobs = entityGroups.getHostileMobs(); + if (hostileMobs.contains(entity.getType())) { + Map> pStat = pStatClass.getPlayerData(); + int doubleDropsLevel = (int) pStat.get(skillName).get(6); + EntityPickedUpItemStorage entityPickedUpItemStorage = new EntityPickedUpItemStorage(); + if (doubleDropsLevel * 0.0005 > rand.nextDouble()) { + for (ItemStack drop : drops) { + if (!entityPickedUpItemStorage.wasItemPickedUp(drop, entity)) { + dropItemNaturally(entity.getLocation().add(0, 0.5, 0), drop); + } + } + } + } + + } + + public void healer() { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int healerLevel = (int) pStat.get(skillName).get(7); + if (healerLevel < 1) { + return; + } + int duration = 20 * Math.min(3 * healerLevel, 9); + boolean[] regenerationChecks = buffCheckerRegeneration(0, duration); + if (regenerationChecks[0]) { + if (regenerationChecks[1]) { + p.removePotionEffect(PotionEffectType.REGENERATION); + } + p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, (int) duration, 0)); + } + increaseStats.changeEXP(skillName, expMap.get("healerRegenActivate")); + if (healerLevel < 4) { + return; + } + double maxHP = ((Attributable) p).getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue(); + int HP_to_add = (healerLevel - 3); + p.setHealth(Math.min(maxHP, p.getHealth() + HP_to_add)); + increaseStats.changeEXP(skillName, expMap.get("healerHealActivate")); + } + + public void giveHitEXP(double damage, Entity entity) { + if (!runMethods || entity.getType().equals(EntityType.ARMOR_STAND)) { + return; + } + ExpFarmTracker expFarmTracker = new ExpFarmTracker(); + double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity, skillName); + if (p.isBlocking()) { + ConfigLoad configLoad = new ConfigLoad(); + multiplier *= configLoad.getSpecialMultiplier().get("blockingEXPMultiplier"); + } + double expToReward = + (damage * expMap.get("takeDamage_EXPperDamagePointDone") + expMap.get("takeDamage")) + * multiplier; + increaseStats.changeEXP(skillName, (int) Math.round(expToReward)); + } + + public void giveKillEXP(Entity entity) { + if (!runMethods) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + entityGroups.killEntity(entity, skillName, expMap, increaseStats); + } + + public void armorEXP(ItemStack armor) { + if (!runMethods) { + return; + } + Map armorEXP = new HashMap<>(); + armorEXP.put(Material.LEATHER_BOOTS, 200 * 3); + armorEXP.put(Material.LEATHER_LEGGINGS, 350 * 3); + armorEXP.put(Material.LEATHER_CHESTPLATE, 400 * 3); + armorEXP.put(Material.LEATHER_HELMET, 250 * 3); + + armorEXP.put(Material.IRON_BOOTS, 200 * 5); + armorEXP.put(Material.IRON_LEGGINGS, 350 * 5); + armorEXP.put(Material.IRON_CHESTPLATE, 400 * 5); + armorEXP.put(Material.IRON_HELMET, 250 * 5); + + armorEXP.put(Material.GOLDEN_BOOTS, 200 * 7); + armorEXP.put(Material.GOLDEN_LEGGINGS, 350 * 7); + armorEXP.put(Material.GOLDEN_CHESTPLATE, 400 * 7); + armorEXP.put(Material.GOLDEN_HELMET, 250 * 7); + + armorEXP.put(Material.DIAMOND_BOOTS, 200 * 10); + armorEXP.put(Material.DIAMOND_LEGGINGS, 350 * 10); + armorEXP.put(Material.DIAMOND_CHESTPLATE, 400 * 10); + armorEXP.put(Material.DIAMOND_HELMET, 250 * 10); + + MinecraftVersion minecraftVersion = new MinecraftVersion(); + if (minecraftVersion.getMinecraftVersionAsDouble() >= 1.16) { + armorEXP.put(Material.NETHERITE_BOOTS, 200 * 15); + armorEXP.put(Material.NETHERITE_LEGGINGS, 350 * 15); + armorEXP.put(Material.NETHERITE_CHESTPLATE, 400 * 15); + armorEXP.put(Material.NETHERITE_HELMET, 250 * 15); + } + + if (armorEXP.keySet().contains(armor.getType())) { + increaseStats.changeEXP(skillName, armorEXP.get(armor.getType())); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Digging.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Digging.java new file mode 100644 index 0000000..0de4ba9 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Digging.java @@ -0,0 +1,572 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.server.WorldGuardChecks; +import mc.carlton.freerpg.utils.game.BlockFaceTracker; +import mc.carlton.freerpg.utils.game.TrackItem; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.EnchantmentStorageMeta; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.persistence.PersistentDataType; +import org.bukkit.scheduler.BukkitRunnable; +import org.bukkit.util.Vector; + +public class Digging extends Skill { + + Random rand = new Random(); //Random class Import + private String skillName = "digging"; + private boolean runMethods; + + public Digging(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + + public void initiateAbility() { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.diggingAbility")) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { + return; + } + Integer[] pTimers = timers.getPlayerCooldownTimes(); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[0] == -1) { + int cooldown = pTimers[0]; + if (cooldown < 1) { + int prepMessages = (int) pStatClass.getPlayerData().get("global") + .get(22); //Toggle for preparation messages + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("shovel") + + "...<<<"); + } + int taskID = new BukkitRunnable() { + @Override + public void run() { + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " + lang.getString( + "shovel") + "<<<"); + } + try { + abilities.setPlayerAbility(skillName, -1); + } catch (Exception e) { + + } + } + }.runTaskLater(plugin, 20 * 4).getTaskId(); + abilities.setPlayerAbility(skillName, taskID); + } else { + actionMessage.sendMessage( + ChatColor.RED + lang.getString("bigDig") + " " + lang.getString("cooldown") + ": " + + ChatColor.WHITE + cooldown + ChatColor.RED + "s"); + } + } + } + + public void enableAbility() { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + actionMessage.sendMessage( + ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("bigDig") + " " + + lang.getString("activated") + "<<<"); + int effLevel = itemInHand.getEnchantmentLevel(Enchantment.DIG_SPEED); + itemInHand.removeEnchantment(Enchantment.DIG_SPEED); + itemInHand.addUnsafeEnchantment(Enchantment.DIG_SPEED, effLevel + 5); + + //Mark the item + long unixTime = Instant.now().getEpochSecond(); + String keyName = + p.getUniqueId().toString() + "-frpg-" + skillName + "-" + String.valueOf(unixTime); + NamespacedKey key = new NamespacedKey(plugin, keyName); + ItemMeta itemMeta = itemInHand.getItemMeta(); + itemMeta.getPersistentDataContainer().set(key, PersistentDataType.STRING, "frpg-digging"); + itemInHand.setItemMeta(itemMeta); + + int durationLevel = (int) pStat.get(skillName).get(4); + double duration0 = Math.ceil(durationLevel * 0.4) + 40; + long duration = (long) duration0; + Bukkit.getScheduler().cancelTask(pAbilities[0]); + abilities.setPlayerAbility(skillName, -2); + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("bigDig") + " " + lang.getString("readyToUse") + + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("bigDig") + " " + + lang.getString("ended") + "<<<"; + timers.abilityDurationTimer(skillName, duration, endMessage, coolDownEndMessage, key, + itemInHand, effLevel, 0); + } + + public void storeBlockFace(BlockFace blockFace) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int megaDigLevel = (int) pStat.get(skillName).get(13); + if (megaDigLevel > 0) { + BlockFaceTracker blockFaceTracker = new BlockFaceTracker(); + blockFaceTracker.addBlockFace(blockFace, p); + } + } + + public void megaDig(Block block, Map diggingEXP) { + if (!runMethods) { + return; + } + WorldGuardChecks BuildingCheck = new WorldGuardChecks(); + World world = p.getWorld(); + Map> pStat = pStatClass.getPlayerData(); + int megaDigLevel = (int) pStat.get(skillName).get(13); + if (megaDigLevel < 1) { + return; + } + int megaDigToggle = (int) pStat.get("global").get(19); + if (megaDigToggle < 1) { + return; + } + BlockFaceTracker blockFaceTracker = new BlockFaceTracker(); + BlockFace blockFace = blockFaceTracker.getBlockface(p); + Vector normalVector = blockFace.getDirection(); + ConfigLoad configLoad = new ConfigLoad(); + for (int x = -1; x <= 1; x++) { + for (int y = -1; y <= 1; y++) { + for (int z = -1; z <= 1; z++) { + if (x == 0 && y == 0 && z == 0) { + continue; + } + Vector relativeVector = new Vector(x, y, z); + if (relativeVector.dot(normalVector) == 0) { + Block planeBlock = block.getRelative(x, y, z); + Material blockType = planeBlock.getType(); + Location blockLocation = planeBlock.getLocation(); + if (!BuildingCheck.canBuild(p, blockLocation)) { + continue; + } + if (diggingEXP.containsKey(blockType)) { + damageTool(configLoad.getDurabilityModifiers().get("megaDig")); + increaseStats.changeEXP(skillName, (int) Math.round( + diggingEXP.get(blockType) * configLoad.getSpecialMultiplier() + .get("megaDigEXPMultiplier"))); + Collection drops = planeBlock.getDrops(itemInHand); + for (ItemStack stack : drops) { + dropItemNaturally(blockLocation, stack); + } + diggingTreasureDrop(world, blockLocation, blockType); + planeBlock.setType(Material.AIR); + } + } + } + } + } + } + + public void diggingTreasureDrop(World world, Location loc, Material blockType) { + if (!runMethods) { + return; + } + ConfigLoad loadConfig = new ConfigLoad(); + ArrayList treasureData = loadConfig.getDiggingInfo(); + double randomNum = rand.nextDouble(); + double randomNum2 = 0; + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + int treasureRoll = (int) pStat.get(skillName).get(5); + int soulStealing = (int) pStat.get(skillName).get(10); + double treasureChance = treasureRoll * 0.00005 + 0.01; + if (soulStealing > 0 && blockType == Material.SOUL_SAND) { + treasureChance = treasureChance * (1 + 0.05 * soulStealing); + } + if (treasureChance < randomNum) { + return; + } + + int rolls = 1; + int megaDig = (int) pStat.get(skillName).get(13); + int doubleTreasure = (int) pStat.get(skillName).get(8); + int dropLevel_I = (int) pStat.get(skillName).get(7); + int dropLevel_II = (int) pStat.get(skillName).get(9); + double[] rates = {0, 0, 0, 0, 0, 0, 0, 0, 0, (double) treasureData.get(20), + (double) treasureData.get(23), + (double) treasureData.get(26), (double) treasureData.get(29), (double) treasureData.get(32), + (double) treasureData.get(35)}; + + if (megaDig > 0 && pAbilities[0] == -2) { + for (int i = 0; i < rates.length; i++) { + rates[i] = rates[i] * 0.2; + } + } + + /* Old Treasure Magnet Perk, Replaced with Mega Dig + int treasureMagnet = (int) pStat.get(skillName).get(13); + if (treasureMagnet > 0 && pAbilities[0] == -2) { + for (int i = 0; i < rates.length; i++) { + rates[i] = rates[i] * 1.5; + } + } + + */ + //Set unobtained drops to 0 + switch (dropLevel_II) { + case 0: + rates[14] = 0; + rates[13] = 0; + rates[12] = 0; + rates[11] = 0; + rates[10] = 0; + break; + case 1: + rates[14] = 0; + rates[13] = 0; + rates[12] = 0; + rates[11] = 0; + break; + case 2: + rates[14] = 0; + rates[13] = 0; + rates[12] = 0; + break; + case 3: + rates[14] = 0; + rates[13] = 0; + break; + case 4: + rates[14] = 0; + break; + default: + break; + } + if (dropLevel_I < 5) { + rates[9] = 0; + } + + //Get total static drop chances, used to determine other drop chances + double total = 0.0; + for (int i = 0; i < rates.length; i++) { + total += rates[i]; + } + double remaining = 1 - total; + + //distributes remaining possible drops chance such that the sum is 1 + double dropLevel_1_double = dropLevel_I; + for (int i = 0; i < 5; i++) { + rates[i] = (4.0 / 5.0) * (remaining / 5.0); + } + if (dropLevel_I > 3) { + for (int i = 0; i < 4; i++) { + rates[i + 5] = (1.0 / 5.0) * (remaining / 4.0); + } + } else { + for (int i = 0; i < dropLevel_I; i++) { + rates[i + 5] = (1.0 / 5.0) * (remaining / dropLevel_1_double); + } + } + + //Creates list of running sums, highest value should be 1, duplicates occur when an item is impossible and should be sequential. + double[] rateSums = {rates[0], 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + for (int i = 1; i < rates.length; i++) { + rateSums[i] = rateSums[i - 1] + rates[i]; + } + + Material[] music_discs = {Material.MUSIC_DISC_11, Material.MUSIC_DISC_13, + Material.MUSIC_DISC_BLOCKS, Material.MUSIC_DISC_CAT, + Material.MUSIC_DISC_CHIRP, Material.MUSIC_DISC_FAR, Material.MUSIC_DISC_MALL, + Material.MUSIC_DISC_MELLOHI, + Material.MUSIC_DISC_STAL, Material.MUSIC_DISC_STRAD, Material.MUSIC_DISC_WAIT, + Material.MUSIC_DISC_WARD}; // TODO Maybe add new discs! + Material[] horse_armor = {Material.LEATHER_HORSE_ARMOR, Material.IRON_HORSE_ARMOR, + Material.GOLDEN_HORSE_ARMOR, Material.DIAMOND_HORSE_ARMOR}; + + for (int i = 0; i < rolls; i++) { + //Double drop roll + double doubleTreasureChance = doubleTreasure * 0.05; + randomNum = rand.nextDouble(); + randomNum2 = rand.nextDouble(); + + boolean doubleDrop = false; + if (doubleTreasureChance > randomNum2) { + doubleDrop = true; + } + + if (randomNum < rateSums[0]) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(0) == null) { + drop.setType(Material.GLOWSTONE_DUST); + } else { + drop.setType((Material) treasureData.get(0)); + drop.setAmount((int) treasureData.get(1)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop1EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[1]) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(2) == null) { + drop.setType(Material.GOLD_NUGGET); + } else { + drop.setType((Material) treasureData.get(2)); + drop.setAmount((int) treasureData.get(3)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop2EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[2]) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(4) == null) { + drop.setType(Material.STRING); + } else { + drop.setType((Material) treasureData.get(4)); + drop.setAmount((int) treasureData.get(5)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop3EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[3]) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(6) == null) { + drop.setType(Material.IRON_NUGGET); + } else { + drop.setType((Material) treasureData.get(6)); + drop.setAmount((int) treasureData.get(7)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop4EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[4]) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(8) == null) { + drop.setType(Material.COBWEB); + } else { + drop.setType((Material) treasureData.get(8)); + drop.setAmount((int) treasureData.get(9)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop5EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[5] && dropLevel_I >= 1) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(10) == null) { + drop.setType(Material.GOLD_INGOT); + } else { + drop.setType((Material) treasureData.get(10)); + drop.setAmount((int) treasureData.get(11)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop6EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[6] && dropLevel_I >= 2) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(12) == null) { + drop.setType(Material.NAME_TAG); + } else { + drop.setType((Material) treasureData.get(12)); + drop.setAmount((int) treasureData.get(13)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop7EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[7] && dropLevel_I >= 3) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(14) == null) { + drop.setType(music_discs[rand.nextInt(music_discs.length)]); + } else { + drop.setType((Material) treasureData.get(14)); + drop.setAmount((int) treasureData.get(15)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop8EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[8] && dropLevel_I >= 4) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(16) == null) { + drop.setType(horse_armor[rand.nextInt(horse_armor.length)]); + } else { + drop.setType((Material) treasureData.get(16)); + drop.setAmount((int) treasureData.get(17)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop9EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[9] && dropLevel_I >= 5) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(18) == null) { + drop.setType(Material.DIAMOND); + } else { + drop.setType((Material) treasureData.get(18)); + drop.setAmount((int) treasureData.get(19)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop10EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[10] && dropLevel_II >= 1) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(21) == null) { + drop.setType(Material.EMERALD); + } else { + drop.setType((Material) treasureData.get(21)); + drop.setAmount((int) treasureData.get(22)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop11EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[11] && dropLevel_II >= 2) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(24) == null || (treasureData.get(24)).equals( + Material.ENCHANTED_BOOK)) { + ItemGroups itemGroups = new ItemGroups(); + Map enchantmentLevelMap = itemGroups.getEnchantmentLevelMap(); + drop.setType(Material.ENCHANTED_BOOK); + List keysAsArray = new ArrayList(enchantmentLevelMap.keySet()); + Enchantment randomEnchant = keysAsArray.get(rand.nextInt(keysAsArray.size())); + int randomLevel = rand.nextInt(enchantmentLevelMap.get(randomEnchant)) + 1; + EnchantmentStorageMeta meta = ((EnchantmentStorageMeta) drop.getItemMeta()); + meta.addStoredEnchant(randomEnchant, randomLevel, true); + drop.setItemMeta(meta); + if (randomEnchant == Enchantment.BINDING_CURSE + || randomEnchant == Enchantment.VANISHING_CURSE) { + Map enchantmentLevelMapGood = enchantmentLevelMap; + enchantmentLevelMapGood.remove(Enchantment.BINDING_CURSE); + enchantmentLevelMapGood.remove(Enchantment.VANISHING_CURSE); + keysAsArray = new ArrayList(enchantmentLevelMapGood.keySet()); + randomEnchant = keysAsArray.get(rand.nextInt(keysAsArray.size())); + meta.addStoredEnchant(randomEnchant, randomLevel, true); + drop.setItemMeta(meta); + } + } else { + drop.setType((Material) treasureData.get(24)); + drop.setAmount((int) treasureData.get(25)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop12EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[12] && dropLevel_II >= 3) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(27) == null) { + drop.setType(Material.DRAGON_BREATH); + } else { + drop.setType((Material) treasureData.get(27)); + drop.setAmount((int) treasureData.get(28)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop13EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[13] && dropLevel_II >= 4) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(30) == null) { + drop.setType(Material.TOTEM_OF_UNDYING); + } else { + drop.setType((Material) treasureData.get(30)); + drop.setAmount((int) treasureData.get(31)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop14EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } else if (randomNum < rateSums[14] && dropLevel_II >= 5) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (treasureData.get(33) == null) { + drop.setType(Material.NETHER_STAR); + } else { + drop.setType((Material) treasureData.get(33)); + drop.setAmount((int) treasureData.get(34)); + } + world.dropItemNaturally(loc, drop); + increaseStats.changeEXP(skillName, expMap.get("drop15EXP")); + if (doubleDrop) { + world.dropItemNaturally(loc, drop); + } + } + } + } + + public boolean flintFinder(Material blockType) { + if (!runMethods) { + return false; + } + if (blockType == Material.GRAVEL) { + Map> pStat = pStatClass.getPlayerData(); + int flintFinderLevel = (int) pStat.get(skillName).get(11); + int flintFinderToggle = (int) pStat.get("global").get(12); + if (flintFinderLevel > 0 && flintFinderToggle > 0) { + return true; + } + } + return false; + } + + public void preventLogoutTheft(int taskID_digging, ItemStack itemInHand_digging, + NamespacedKey key, boolean pluginDisabled) { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[0] == -2) { + Bukkit.getScheduler().cancelTask(taskID_digging); + int effLevel = itemInHand_digging.getEnchantmentLevel(Enchantment.DIG_SPEED) - 5; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("magicForce") + "<<<"; + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("bigDig") + " " + lang.getString("readyToUse") + + "<<<"; + timers.endAbility(skillName, endMessage, coolDownEndMessage, key, itemInHand_digging, + effLevel, 0, pluginDisabled); + TrackItem trackItem = new TrackItem(); + trackItem.removeItemKey(itemInHand_digging, key); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Enchanting.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Enchanting.java new file mode 100644 index 0000000..9418383 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Enchanting.java @@ -0,0 +1,106 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.utils.game.PsuedoEnchanting; +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.enchantments.EnchantmentOffer; +import org.bukkit.entity.Player; +import org.bukkit.inventory.EnchantingInventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.EnchantmentStorageMeta; +import org.bukkit.scheduler.BukkitRunnable; + +public class Enchanting extends Skill { + + static Map offersHolder = new HashMap(); + Random rand = new Random(); //Random class Import + private String skillName = "enchanting"; + private boolean runMethods; + + + public Enchanting(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + public int xpIncrease(int oldAmount) { + if (!runMethods) { + return oldAmount; + } + Map> pStat = pStatClass.getPlayerData(); + int expBuffLevel = (int) pStat.get(skillName).get(4); + double multiplier = 1 + expBuffLevel * 0.002; + int newAmount = (int) Math.floor(oldAmount * multiplier); + double roundUpChance = oldAmount * multiplier - Math.floor(oldAmount * multiplier); + if (roundUpChance > rand.nextDouble()) { + newAmount += 1; + } + return newAmount; + } + + public EnchantmentOffer[] enchantmentDiscount(EnchantmentOffer[] oldOffers) { + if (!runMethods) { + return oldOffers; + } + if (oldOffers.length == 0) { + return oldOffers; + } + offersHolder.put(p, oldOffers.clone()); + Map> pStat = pStatClass.getPlayerData(); + int levelSubtract = (int) pStat.get(skillName).get(7); + for (EnchantmentOffer offer : oldOffers) { + if (offer != null) { + int newCost = Math.max(offer.getCost() - levelSubtract, 1); + offer.setCost(newCost); + } + } + return oldOffers; + } + + public void enchantItem(ItemStack enchantedItem, int buttonClicked, + EnchantingInventory enchantingInventory) { + if (!runMethods) { + return; + } + EnchantmentOffer[] originalOffers = offersHolder.get(p); + Enchantment enchant0 = originalOffers[buttonClicked].getEnchantment(); + int level0 = originalOffers[buttonClicked].getEnchantmentLevel(); + int cost0 = originalOffers[buttonClicked].getCost(); + increaseStats.changeEXP(skillName, expMap.get("enchantItem_EXPperLevelOfCost") * cost0); + new BukkitRunnable() { + @Override + public void run() { + if (enchantedItem.getType() != Material.BOOK) { + for (Enchantment enchant : enchantedItem.getEnchantments().keySet()) { + enchantedItem.removeEnchantment(enchant); + } + enchantedItem.addUnsafeEnchantment(enchant0, level0); + PsuedoEnchanting fakeEnchant = new PsuedoEnchanting(); + fakeEnchant.addEnchant(enchantedItem, cost0, false); + } else { + ItemStack newBook = new ItemStack(Material.ENCHANTED_BOOK, 1); + EnchantmentStorageMeta bookMeta = (EnchantmentStorageMeta) newBook.getItemMeta(); + bookMeta.addStoredEnchant(enchant0, level0, false); + newBook.setItemMeta(bookMeta); + PsuedoEnchanting fakeEnchant = new PsuedoEnchanting(); + fakeEnchant.addEnchant(newBook, cost0, false); + enchantingInventory.setItem(newBook); + } + + } + }.runTaskLater(plugin, 1); + + } + + public void giveEXP(int exp) { + increaseStats.changeEXP(skillName, expMap.get("EXPperMinecraftXPGained") * exp); + } + +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Farming.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Farming.java new file mode 100644 index 0000000..577117d --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Farming.java @@ -0,0 +1,694 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.server.PlacedBlocksManager; +import mc.carlton.freerpg.utils.globalVariables.EntityGroups; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.DyeColor; +import org.bukkit.Effect; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.block.data.Ageable; +import org.bukkit.block.data.BlockData; +import org.bukkit.block.data.Levelled; +import org.bukkit.block.data.type.Cocoa; +import org.bukkit.entity.ChestedHorse; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.entity.Sheep; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.Damageable; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +public class Farming extends Skill { + + static Map oneWithNatureMap = new HashMap<>(); + static Map oneWithNatureCounters = new HashMap<>(); + Random rand = new Random(); //Random class Import + private String skillName = "farming"; + private boolean runMethods; + + + public Farming(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + public void initiateAbility() { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.farmingAbility")) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { + return; + } + Integer[] pTimers = timers.getPlayerCooldownTimes(); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[3] == -1) { + int cooldown = pTimers[3]; + if (cooldown < 1) { + int prepMessages = (int) pStatClass.getPlayerData().get("global") + .get(22); //Toggle for preparation messages + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("hoe") + + "...<<<"); + } + int taskID = new BukkitRunnable() { + @Override + public void run() { + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " + lang.getString("hoe") + + "<<<"); + } + try { + abilities.setPlayerAbility(skillName, -1); + } catch (Exception e) { + + } + } + }.runTaskLater(plugin, 20 * 4).getTaskId(); + abilities.setPlayerAbility(skillName, taskID); + } else { + actionMessage.sendMessage( + ChatColor.RED + lang.getString("naturalRegeneration") + " " + lang.getString("cooldown") + + ": " + ChatColor.WHITE + cooldown + ChatColor.RED + "s"); + } + } + } + + public void enableAbility() { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + actionMessage.sendMessage( + ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("naturalRegeneration") + + " " + lang.getString("activated") + "<<<"); + int durationLevel = (int) pStat.get(skillName).get(4); + double duration0 = Math.ceil(durationLevel * 0.4) + 40; + long duration = (long) duration0; + Bukkit.getScheduler().cancelTask(pAbilities[3]); + abilities.setPlayerAbility(skillName, -2); + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("naturalRegeneration") + " " + lang.getString( + "readyToUse") + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("naturalRegeneration") + + " " + lang.getString("ended") + "<<<"; + timers.abilityDurationTimer(skillName, duration, endMessage, coolDownEndMessage); + } + + public void killFarmAnimalEXP(Entity animal) { + if (!runMethods) { + return; + } + Map farmAnimalsEXP = new HashMap<>(); + farmAnimalsEXP.put(EntityType.SHEEP, expMap.get("killSheep")); + farmAnimalsEXP.put(EntityType.COW, expMap.get("killCow")); + farmAnimalsEXP.put(EntityType.CHICKEN, expMap.get("killChicken")); + farmAnimalsEXP.put(EntityType.PIG, expMap.get("killPig")); + farmAnimalsEXP.put(EntityType.HORSE, expMap.get("killHorse")); + farmAnimalsEXP.put(EntityType.RABBIT, expMap.get("killRabbit")); + farmAnimalsEXP.put(EntityType.LLAMA, expMap.get("killLlama")); + farmAnimalsEXP.put(EntityType.TURTLE, expMap.get("killTurtle")); + if (farmAnimalsEXP.containsKey(animal.getType())) { + increaseStats.changeEXP(skillName, farmAnimalsEXP.get(animal.getType())); + } + } + + public int getRandomAge(int maximumAge, int greenThumbLevel) { + if (!runMethods) { + return 0; + } + int age = 0; + ArrayList pDist = new ArrayList<>(); + ArrayList pMass = new ArrayList<>(); + double sum = 0; + if (greenThumbLevel > 0) { + if (maximumAge == 0) { + if (rand.nextDouble() > 0.5) { + return 1; + } else { + return 0; + } + } else { + double c = -0.06; + for (int i = 0; i <= maximumAge; i++) { + pDist.add(0.0); + pMass.add(0.0); + } + for (int i = 0; i <= maximumAge; i++) { + double unNormalizedProb = Math.exp(c * i); + pDist.set(i, unNormalizedProb); + sum += unNormalizedProb; + } + for (int i = 0; i <= maximumAge; i++) { + pDist.set(i, pDist.get(i) / sum); + } + for (int i = 0; i <= maximumAge; i++) { + if (i == 0) { + pMass.set(i, pDist.get(i)); + } else { + pMass.set(i, pMass.get(i - 1) + pDist.get(i)); + } + } + double randomNum = rand.nextDouble(); + randomAgeLoop: + for (int i = 0; i <= maximumAge; i++) { + if (randomNum < pMass.get(i)) { + age = i; + break randomAgeLoop; + } + } + + } + } else { + if (maximumAge == 0) { + return 0; + } else { + double c = -0.2; + for (int i = 0; i < maximumAge; i++) { + pDist.add(0.0); + pMass.add(0.0); + } + for (int i = 0; i < maximumAge; i++) { + double unNormalizedProb = Math.exp(c * i); + pDist.set(i, unNormalizedProb); + sum += unNormalizedProb; + } + for (int i = 0; i < maximumAge; i++) { + pDist.set(i, pDist.get(i) / sum); + } + for (int i = 0; i < maximumAge; i++) { + if (i == 0) { + pMass.set(i, pDist.get(i)); + } else { + pMass.set(i, pMass.get(i - 1) + pDist.get(i)); + } + } + double randomNum = rand.nextDouble(); + randomAgeLoop: + for (int i = 0; i < maximumAge; i++) { + if (randomNum < pMass.get(i)) { + age = i; + break randomAgeLoop; + } + } + + } + } + + return age; + } + + public void naturalRegeneration(Block block, World world) { + if (!runMethods) { + return; + } + BlockData block_data = block.getBlockData(); + Material blockType = block.getType(); + ItemGroups itemGroups = new ItemGroups(); + List tallCrops = itemGroups.getTallCrops(); + if (tallCrops.contains(blockType)) { + return; + } + + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + int greenThumbLevel = (int) pStat.get(skillName).get(11); + if (pAbilities[3] == -2) { + ItemMeta toolMeta = itemInHand.getItemMeta(); + if (toolMeta instanceof Damageable) { + ((Damageable) toolMeta).setDamage(((Damageable) toolMeta).getDamage() + 1); + itemInHand.setItemMeta(toolMeta); + if (((Damageable) toolMeta).getDamage() > itemInHand.getType().getMaxDurability()) { + itemInHand.setAmount(0); + p.getWorld().playEffect(p.getLocation(), Effect.STEP_SOUND, 1); + } + } + if (block_data instanceof Ageable) { + Ageable age = (Ageable) block_data; + if (age.getAge() != age.getMaximumAge()) { + block.setType(Material.AIR); + } + int randomAge = getRandomAge(age.getMaximumAge(), greenThumbLevel); + new BukkitRunnable() { + @Override + public void run() { + block.setType(blockType); + ((Ageable) block_data).setAge(randomAge); + block.setBlockData(block_data); + } + }.runTaskLater(plugin, 5); + } else if (block_data instanceof Cocoa) { + Cocoa coco = (Cocoa) block_data; + if (coco.getAge() != coco.getMaximumAge()) { + block.setType(Material.AIR); + } + int randomAge = getRandomAge(coco.getMaximumAge(), greenThumbLevel); + new BukkitRunnable() { + @Override + public void run() { + block.setType(blockType); + ((Cocoa) block_data).setAge(randomAge); + block.setBlockData(block_data); + } + }.runTaskLater(plugin, 5); + } else { + int randomAge = getRandomAge(0, greenThumbLevel); + if (randomAge == 1) { + new BukkitRunnable() { + @Override + public void run() { + block.setType(blockType); + } + }.runTaskLater(plugin, 1); + } + } + } + } + + public void animalDoubleDrops(Entity entity, World world, List drops) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int doubleDropsAnimals = (int) pStat.get(skillName).get(6); + double doubleDropChance = doubleDropsAnimals * 0.0005; + if (doubleDropChance < rand.nextDouble()) { + return; + } + List blackListedDrops = Arrays.asList( + new Material[]{Material.SADDLE, Material.DIAMOND_HORSE_ARMOR, Material.GOLDEN_HORSE_ARMOR, + Material.IRON_HORSE_ARMOR, Material.LEATHER_HORSE_ARMOR}); + EntityGroups entityGroups = new EntityGroups(); + List animals = entityGroups.getAnimals(); + if (animals.contains(entity.getType())) { + for (ItemStack drop : drops) { + if (blackListedDrops.contains(drop.getType())) { + continue; + } + if (entity instanceof ChestedHorse) { + if (!Arrays.asList(((ChestedHorse) entity).getInventory().getContents()).contains(drop)) { + continue; + } + } + dropItemNaturally(entity.getLocation().add(0, 0.25, 0), drop); + } + } + } + + public void farmingDoubleDropCrop(Block block, World world) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int doubleDropsCrop = (int) pStat.get(skillName).get(5); + + double doubleDropChance = doubleDropsCrop * 0.0005; + if (doubleDropChance < rand.nextDouble()) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + List crops = itemGroups.getCrops(); + if (crops.contains(block.getType())) { + Collection drops = block.getDrops(itemInHand); + for (ItemStack drop : drops) { + dropItemNaturally(block.getLocation(), drop); + } + } + } + + public ArrayList getTallCropsBlocks(Block b_0, World world) { + ArrayList tallCropBlocks = new ArrayList<>(); + Block b_i = b_0; + while (b_0.getType() == b_i.getType()) { + tallCropBlocks.add(b_i); + b_i = b_i.getRelative(0, 1, 0); + } + return tallCropBlocks; + } + + public void tallCrops(Block block, World world) { + if (!runMethods) { + return; + } + ArrayList tallCropBlocks = getTallCropsBlocks(block, world); + + Map> pStat = pStatClass.getPlayerData(); + int doubleDropsCrop = (int) pStat.get(skillName).get(5); + + double doubleDropChance = doubleDropsCrop * 0.0005; + int totalNatural = 0; + for (Block b : tallCropBlocks) { + //Checks if any of the blocks weren't natural + PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); + boolean natural = !placedBlocksManager.isBlockTracked(block); + if (!natural) { + placedBlocksManager.removeBlock(block); + } + if (natural) { + totalNatural += 1; + double randomNum = rand.nextDouble(); + if (doubleDropChance > randomNum) { + for (ItemStack item : b.getDrops(itemInHand)) { + dropItemNaturally(b.getLocation(), item); + } + } + } + } + switch (block.getType()) { + case CACTUS: + increaseStats.changeEXP(skillName, expMap.get("breakCactus")); + case SUGAR_CANE: + increaseStats.changeEXP(skillName, expMap.get("breakSugarCane") * totalNatural); + break; + case BAMBOO: + increaseStats.changeEXP(skillName, expMap.get("breakBamboo") * totalNatural); + break; + case KELP: + case KELP_PLANT: + increaseStats.changeEXP(skillName, expMap.get("breakKelp") * totalNatural); + break; + default: + break; + } + } + + public void eatFarmFood(ItemStack food) { + if (!runMethods) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + Map farmFood = itemGroups.getFarmFood(); + Map meatFood = itemGroups.getMeatFood(); + if (!(farmFood.containsKey(food.getType()) || meatFood.containsKey(food.getType()))) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int farmDietLevel = (int) pStat.get(skillName).get(9); + int meatEaterLevel = (int) pStat.get(skillName).get(10); + if (farmDietLevel < 1 && meatEaterLevel < 1) { + return; + } + Material foodType = food.getType(); + if (farmFood.containsKey(food.getType())) { + double foodMultiplier = farmDietLevel * 0.2; + Map farmFoodSaturation = itemGroups.getFarmFoodSaturation(); + p.setFoodLevel((int) Math.min(20, + p.getFoodLevel() + Math.round(foodMultiplier * farmFood.get(foodType)))); + p.setSaturation((float) Math.min(p.getFoodLevel(), + p.getSaturation() + (foodMultiplier * farmFoodSaturation.get(foodType)))); + } else if (meatFood.containsKey(food.getType())) { + double foodMultiplier = meatEaterLevel * 0.2; + Map meatFoodSaturation = itemGroups.getMeatFoodSaturation(); + p.setFoodLevel((int) Math.min(20, + p.getFoodLevel() + Math.round(foodMultiplier * meatFood.get(foodType)))); + p.setSaturation((float) Math.min(p.getFoodLevel(), + p.getSaturation() + (foodMultiplier * meatFoodSaturation.get(foodType)))); + } + } + + public void babyAnimalGrow(Entity entity) { + if (!runMethods) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + List babyAnimals = entityGroups.getBabyAnimals(); + if (babyAnimals.contains(entity.getType())) { + if (entity instanceof org.bukkit.entity.Ageable) { + boolean isAdult = ((org.bukkit.entity.Ageable) entity).isAdult(); + if (isAdult) { + return; + } + if (itemInHand.getType() == Material.SUGAR) { + Map> pStat = pStatClass.getPlayerData(); + int growthHormonesLevel = (int) pStat.get(skillName).get(12); + if (growthHormonesLevel > 0) { + ((org.bukkit.entity.Ageable) entity).setAdult(); + int numSugar = itemInHand.getAmount(); + itemInHand.setAmount(numSugar - 1); + } + } + } + } + } + + public void fertilizerSave(Block block) { + if (!runMethods) { + return; + } + int amount = itemInHand.getAmount(); + new BukkitRunnable() { + @Override + public void run() { + int newAmount = itemInHand.getAmount(); + if (amount > newAmount) { + increaseStats.changeEXP("farming", expMap.get("useBonemeal")); + Map> pStat = pStatClass.getPlayerData(); + int betterFertilizerLevel = (int) pStat.get(skillName).get(7); + double refundChance = betterFertilizerLevel * 0.1; + if (refundChance > rand.nextDouble()) { + itemInHand.setAmount(itemInHand.getAmount() + 1); + } + } + } + }.runTaskLater(plugin, 1); + } + + public void composterEXP(Block block) { + if (!runMethods) { + return; + } + if (block.getType() == Material.COMPOSTER) { + BlockData data = block.getBlockData(); + int level = ((Levelled) data).getLevel(); + int maxLevel = ((Levelled) data).getMaximumLevel(); + if (level == maxLevel) { + increaseStats.changeEXP(skillName, expMap.get("useComposter")); + } else { + new BukkitRunnable() { + @Override + public void run() { + BlockData newData = block.getBlockData(); + int newLevel = ((Levelled) newData).getLevel(); + if (newLevel > level) { + increaseStats.changeEXP(skillName, expMap.get("maximizeComposter")); + } + } + }.runTaskLater(plugin, 3); + } + } + } + + public void oneWithNatureStart() { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int oneWithNatureLevel = (int) pStat.get(skillName).get(13); + if (oneWithNatureLevel > 0) { + int natureID = new BukkitRunnable() { + @Override + public void run() { + oneWithNatureCounters.put(p, 0); + Block blockBelow = p.getLocation().getBlock().getRelative(BlockFace.DOWN); + int counter = 0; + if (blockBelow.getType() == Material.GRASS_BLOCK) { + for (int i = 1; i <= 20; i++) { + new BukkitRunnable() { + @Override + public void run() { + int count = 0; + try { + count = oneWithNatureCounters.get(p); + } catch (NullPointerException playerLeft) { + return; + } + if (p.getLocation().getBlock().getRelative(BlockFace.DOWN).equals(blockBelow)) { + count += 1; + oneWithNatureCounters.put(p, count); + } + if (count == 20) { + boolean addEffect = true; + boolean hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.REGENERATION)) { + hasEffect = true; + if (effect.getDuration() > 2 * 20) { + addEffect = false; + } + break potionEffectLoop; + } + } + if (addEffect) { + if (hasEffect) { + p.removePotionEffect(PotionEffectType.REGENERATION); + } + p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 3 * 20, 0)); + } + } + } + }.runTaskLater(plugin, i); + } + } + } + }.runTaskTimer(plugin, 40, 40).getTaskId(); + oneWithNatureMap.put(p, natureID); + oneWithNatureCounters.put(p, 0); + } + } + + public void oneWithNatureEnd() { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int oneWithNatureLevel = (int) pStat.get(skillName).get(13); + if (oneWithNatureLevel > 0) { + Bukkit.getScheduler().cancelTask(oneWithNatureMap.get(p)); + oneWithNatureMap.remove(p); + oneWithNatureCounters.remove(p); + } + + } + + public void shearSheep(Entity entity, World world) { + if (!runMethods) { + return; + } + if (!(entity instanceof Sheep)) { + return; + } + increaseStats.changeEXP(skillName, expMap.get("shearSheep")); + Location dropLoc = entity.getLocation().add(0, 0.5, 0); + Map> pStat = pStatClass.getPlayerData(); + DyeColor color = ((Sheep) entity).getColor(); + ((Sheep) entity).setSheared(true); + ItemStack wool = new ItemStack(Material.WHITE_WOOL, 1); + switch (color) { + case ORANGE: + wool.setType(Material.ORANGE_WOOL); + break; + case MAGENTA: + wool.setType(Material.MAGENTA_WOOL); + break; + case LIGHT_BLUE: + wool.setType(Material.LIGHT_BLUE_WOOL); + break; + case YELLOW: + wool.setType(Material.YELLOW_WOOL); + break; + case LIME: + wool.setType(Material.LIME_WOOL); + break; + case PINK: + wool.setType(Material.PINK_WOOL); + break; + case GRAY: + wool.setType(Material.GRAY_WOOL); + break; + case LIGHT_GRAY: + wool.setType(Material.LIGHT_GRAY_WOOL); + break; + case CYAN: + wool.setType(Material.CYAN_WOOL); + break; + case PURPLE: + wool.setType(Material.PURPLE_WOOL); + break; + case BLUE: + wool.setType(Material.BLUE_WOOL); + break; + case BROWN: + wool.setType(Material.BROWN_WOOL); + break; + case GREEN: + wool.setType(Material.GREEN_WOOL); + break; + case RED: + wool.setType(Material.RED_WOOL); + break; + case BLACK: + wool.setType(Material.BLACK_WOOL); + break; + default: + break; + } + int animalDoubleDrop = (int) pStat.get(skillName).get(6); + double doubleDropChance = animalDoubleDrop * 0.0005; + int dropMultiplier = 1; + if (doubleDropChance > rand.nextDouble()) { + dropMultiplier = 2; + } + wool.setAmount(dropMultiplier); + double woolRoll = rand.nextDouble(); + if (woolRoll < 0.3333) { + world.dropItemNaturally(dropLoc, wool); + } else if (woolRoll < 0.6666) { + wool.setAmount(wool.getAmount() * 2); + world.dropItemNaturally(dropLoc, wool); + } else { + wool.setAmount(wool.getAmount() * 3); + world.dropItemNaturally(dropLoc, wool); + } + } + + public void milkingEXP(Entity entity) { + if (!runMethods) { + return; + } + if (entity.getType() == EntityType.COW || entity.getType() == EntityType.MUSHROOM_COW) { + if (itemInHand.getType() == Material.BUCKET) { + new BukkitRunnable() { + @Override + public void run() { + ItemStack newItem = p.getInventory().getItemInMainHand(); + if (newItem.getType() == Material.MILK_BUCKET) { + increaseStats.changeEXP(skillName, expMap.get("milkAnimal")); + } + } + }.runTaskLater(plugin, 1); + } + } + } + + public void breedingEXP(Entity entity) { + if (!runMethods) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + List breedingAnimals = entityGroups.getBreedingAnimalsFarming(); + if (breedingAnimals.contains(entity.getType())) { + increaseStats.changeEXP(skillName, expMap.get("breedFarmAnimal")); + } + } + + +} + diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Fishing.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Fishing.java new file mode 100644 index 0000000..ac11dab --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Fishing.java @@ -0,0 +1,1526 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.UUID; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.server.MinecraftVersion; +import mc.carlton.freerpg.utils.game.PsuedoEnchanting; +import mc.carlton.freerpg.utils.globalVariables.EntityGroups; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Effect; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.ExperienceOrb; +import org.bukkit.entity.FishHook; +import org.bukkit.entity.Item; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.Damageable; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; +import org.bukkit.util.Vector; + +public class Fishing extends Skill { + + static Map fishPersonMap = new HashMap<>(); + static Map fishPersonCounters = new HashMap<>(); + static HashSet superBaitBlock = new HashSet<>(); + Random rand = new Random(); //Random class Import + private String skillName = "fishing"; + private boolean runMethods; + + + public Fishing(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + + public void initiateAbility() { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.fishingAbility")) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { + return; + } + Integer[] pTimers = timers.getPlayerCooldownTimes(); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[4] == -1) { + int cooldown = pTimers[4]; + if (cooldown < 1) { + int prepMessages = (int) pStatClass.getPlayerData().get("global") + .get(22); //Toggle for preparation messages + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString( + "fishingRod") + "...<<<"); + } + int taskID = new BukkitRunnable() { + @Override + public void run() { + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " + lang.getString( + "fishingRod") + "<<<"); + } + try { + abilities.setPlayerAbility(skillName, -1); + } catch (Exception e) { + + } + } + }.runTaskLater(plugin, 20 * 4).getTaskId(); + abilities.setPlayerAbility(skillName, taskID); + } else { + actionMessage.sendMessage( + ChatColor.RED + lang.getString("superBait") + " " + lang.getString("cooldown") + ": " + + ChatColor.WHITE + cooldown + ChatColor.RED + "s"); + } + } + } + + public void enableAbility() { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + actionMessage.sendMessage( + ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("superBait") + " " + + lang.getString("activated") + "<<<"); + int durationLevel = (int) pStat.get(skillName).get(4); + double duration0 = Math.ceil(durationLevel * 0.2) + 20; + long duration = (long) duration0; + Bukkit.getScheduler().cancelTask(pAbilities[4]); + abilities.setPlayerAbility(skillName, -2); + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("superBait") + " " + lang.getString("readyToUse") + + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("superBait") + " " + + lang.getString("ended") + "<<<"; + timers.abilityDurationTimer(skillName, duration, endMessage, coolDownEndMessage); + } + + public void killFishEXP(Entity fish) { + if (!runMethods) { + return; + } + Map fishMap = new HashMap<>(); + fishMap.put(EntityType.COD, expMap.get("killCod")); + fishMap.put(EntityType.SALMON, expMap.get("killSalmon")); + fishMap.put(EntityType.PUFFERFISH, expMap.get("killPufferfish")); + fishMap.put(EntityType.TROPICAL_FISH, expMap.get("killTropical_Fish")); + if (fishMap.containsKey(fish.getType())) { + increaseStats.changeEXP(skillName, fishMap.get(fish.getType())); + } + } + + /* Old Perk + public void waterBreather() { + Map> pStat = pStatClass.getPlayerData(); + int waterBreatherLevel = (int) pStat.get(skillName).get(11); + if (waterBreatherLevel > 0) { + boolean addEffect = true; + boolean hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.WATER_BREATHING)) { + hasEffect = true; + if (effect.getDuration() > 89 * 20) { + addEffect = false; + } + break potionEffectLoop; + } + } + if (addEffect) { + if (hasEffect) { + p.removePotionEffect(PotionEffectType.WATER_BREATHING); + } + p.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 20 * 90, 0)); + } + } + } + + */ + + public void grapplingHook(FishHook fishhook, World world) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int grapplingHookLevel = (int) pStat.get(skillName).get(11); + int grappleToggle = (int) pStat.get("global").get(16); + if (grapplingHookLevel < 1) { + return; + } + if (grappleToggle < 1) { + return; + } + Location location = fishhook.getLocation(); + double dx = location.getX() - p.getLocation().getX(); + double dy = location.getY() - p.getLocation().getY(); + double dz = location.getZ() - p.getLocation().getZ(); + double distance = Math.sqrt((dx * dx) + (dy * dy) + (dz * dz)); + double multiplier = 0.200; + Vector velocity = new Vector(dx * multiplier, + (dy * multiplier) + (double) Math.sqrt(distance) * 0.10, dz * multiplier); + p.setVelocity(velocity); + } + + public void superBait(FishHook fishhook, Entity hookedEntity, World world) { + if (!runMethods) { + return; + } + if (hookedEntity instanceof Item) { + ((Item) hookedEntity).setItemStack(new ItemStack(Material.DIRT, 0)); + ItemStack drop = dropTable(false); + ((Item) hookedEntity).setItemStack(drop); + } + if (hookedEntity == null) { + Location location = fishhook.getLocation(); + if (world.getBlockAt(location).getType() == Material.WATER) { + if (!superBaitBlock.contains(p.getUniqueId())) { + double dx = p.getLocation().getX() - location.getX(); + double dy = p.getLocation().getY() - location.getY(); + double dz = p.getLocation().getZ() - location.getZ(); + double distance = Math.sqrt((dx * dx) + (dy * dy) + (dz * dz)); + double multiplier = 0.08; + ItemStack drop = dropTable(true); + Item droppedItem = world.dropItemNaturally(location, drop); + Vector velocity = new Vector(dx * multiplier, + (dy * multiplier) + (double) Math.sqrt(distance) * 0.1, dz * multiplier); + droppedItem.setVelocity(velocity); + ((ExperienceOrb) world.spawn(p.getLocation(), ExperienceOrb.class)).setExperience( + rand.nextInt(6) + 1); + ItemMeta toolMeta = itemInHand.getItemMeta(); + if (toolMeta instanceof Damageable) { + ((Damageable) toolMeta).setDamage(((Damageable) toolMeta).getDamage() + 1); + itemInHand.setItemMeta(toolMeta); + if (((Damageable) toolMeta).getDamage() > itemInHand.getType().getMaxDurability()) { + itemInHand.setAmount(0); + p.getWorld().playEffect(p.getLocation(), Effect.STEP_SOUND, 1); + } + } + ConfigLoad configLoad = new ConfigLoad(); + int superBaitcooldown = configLoad.getSuperBaitCooldown(); + if (superBaitcooldown > 0) { + superBaitBlock.add(p.getUniqueId()); + new BukkitRunnable() { + @Override + public void run() { + if (superBaitBlock.contains(p.getUniqueId())) { + superBaitBlock.remove(p.getUniqueId()); + } + } + }.runTaskLater(plugin, superBaitcooldown); + } + } + + } + } + + } + + public void fishPersonStart() { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int fishPersonLevel = (int) pStat.get(skillName).get(13); + if (fishPersonLevel > 0) { + int fishID = new BukkitRunnable() { + @Override + public void run() { + fishPersonCounters.put(p, 0); + Block block = p.getLocation().getBlock(); + Block blockBelow = block.getRelative(BlockFace.DOWN); + if (block.getType() == Material.WATER || blockBelow.getType() == Material.WATER) { + for (int i = 1; i <= 20; i++) { + new BukkitRunnable() { + @Override + public void run() { + int count = 0; + try { + count = fishPersonCounters.get(p); + } catch (NullPointerException playerLeft) { + return; + } + if (p.getLocation().getBlock().getType() == Material.WATER) { + count += 1; + fishPersonCounters.put(p, count); + } + + if (count == 20) { + boolean addEffect = true; + boolean hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.DOLPHINS_GRACE)) { + hasEffect = true; + if (effect.getDuration() > 12 * 20) { + addEffect = false; + } + break potionEffectLoop; + } + } + if (addEffect) { + if (hasEffect) { + p.removePotionEffect(PotionEffectType.DOLPHINS_GRACE); + } + p.addPotionEffect( + new PotionEffect(PotionEffectType.DOLPHINS_GRACE, 15 * 20, 0)); + } + + boolean addEffect2 = true; + boolean hasEffect2 = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.NIGHT_VISION)) { + hasEffect2 = true; + if (effect.getDuration() > 12 * 20) { + addEffect2 = false; + } + break potionEffectLoop; + } + } + if (addEffect2) { + if (hasEffect2) { + p.removePotionEffect(PotionEffectType.NIGHT_VISION); + } + p.addPotionEffect( + new PotionEffect(PotionEffectType.NIGHT_VISION, 15 * 20, 0)); + } + } + } + }.runTaskLater(plugin, i); + } + } + } + }.runTaskTimer(plugin, 40, 40).getTaskId(); + fishPersonMap.put(p, fishID); + fishPersonCounters.put(p, 0); + } + } + + public void fishPersonEnd() { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int fishPersonLevel = (int) pStat.get(skillName).get(13); + if (fishPersonLevel > 0) { + Bukkit.getScheduler().cancelTask(fishPersonMap.get(p)); + fishPersonMap.remove(p); + fishPersonCounters.remove(p); + } + + } + + public void eatFishFood(ItemStack food) { + if (!runMethods) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + Map fishFood = itemGroups.getFishFood(); + if (!(fishFood.containsKey(food.getType()))) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int fishDietLevel = (int) pStat.get(skillName).get(9); + if (fishDietLevel < 1) { + return; + } + Material foodType = food.getType(); + if (fishFood.containsKey(food.getType())) { + double foodMultiplier = fishDietLevel * 0.2; + Map fishFoodSaturation = itemGroups.getFishFoodSaturation(); + p.setFoodLevel((int) Math.min(20, + p.getFoodLevel() + Math.round(foodMultiplier * fishFood.get(foodType)))); + p.setSaturation((float) Math.min(p.getFoodLevel(), + p.getSaturation() + (foodMultiplier * fishFoodSaturation.get(foodType)))); + } + + } + + + public void rob(FishHook fishhook, Entity hookedEntity, World world) { + if (!runMethods) { + return; + } + if (hookedEntity == null) { + return; + } + MinecraftVersion minecraftVersion = new MinecraftVersion(); + Integer[] pTimers = timers.getPlayerCooldownTimes(); + EntityGroups entityGroups = new EntityGroups(); + List hookableEntities = entityGroups.getHookableEntities(); + if (!hookableEntities.contains(hookedEntity.getType())) { + return; + } + if (pTimers[11] > 0) { + actionMessage.sendMessage( + ChatColor.RED + lang.getString("rob") + " " + lang.getString("cooldown") + ": " + + pTimers[11].toString() + "s"); + return; + } + Map> pStat = pStatClass.getPlayerData(); + int robLevel = (int) pStat.get(skillName).get(7); + if (robLevel * .15 < rand.nextDouble()) { + return; + } + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (hookedEntity.getType() == EntityType.BLAZE) { + drop.setType(Material.BLAZE_ROD); + increaseStats.changeEXP(skillName, expMap.get("robBlaze")); + } else if (hookedEntity.getType() == EntityType.GHAST) { + double randomNum = rand.nextDouble(); + if (randomNum < .5) { + drop.setType(Material.GHAST_TEAR); + } else { + drop.setType(Material.GUNPOWDER); + } + increaseStats.changeEXP(skillName, expMap.get("robGhast")); + } else if (hookedEntity.getType() == EntityType.ZOMBIE) { + double randomNum = rand.nextDouble(); + if (randomNum < .98) { + drop.setType(Material.ROTTEN_FLESH); + } else { + drop.setType(Material.ZOMBIE_HEAD); + } + increaseStats.changeEXP(skillName, expMap.get("robZombie")); + } else if (hookedEntity.getType() == EntityType.SPIDER) { + double randomNum = rand.nextDouble(); + if (randomNum < .5) { + drop.setType(Material.STRING); + } else { + drop.setType(Material.SPIDER_EYE); + } + increaseStats.changeEXP(skillName, expMap.get("robSpider")); + } else if (hookedEntity.getType() == EntityType.CAVE_SPIDER) { + double randomNum = rand.nextDouble(); + if (randomNum < .49) { + drop.setType(Material.STRING); + } else if (randomNum < .98) { + drop.setType(Material.SPIDER_EYE); + } else if (randomNum < .99) { + drop.setType(Material.SPLASH_POTION); + PotionMeta pm = (PotionMeta) drop.getItemMeta(); + assert pm != null; + pm.addCustomEffect(new PotionEffect(PotionEffectType.POISON, 15, 0), false); + pm.setDisplayName(ChatColor.YELLOW + "Splash Potion of Poison"); + drop.setItemMeta(pm); + + } else { + drop.setType(Material.COBWEB); + } + increaseStats.changeEXP(skillName, expMap.get("robCave_Spider")); + } else if (hookedEntity.getType() == EntityType.PIG) { + drop.setType(Material.PORKCHOP); + increaseStats.changeEXP(skillName, expMap.get("robPig")); + } else if (hookedEntity.getType() == EntityType.CHICKEN) { + double randomNum = rand.nextDouble(); + if (randomNum < .33) { + drop.setType(Material.EGG); + } else if (randomNum > .66) { + drop.setType(Material.CHICKEN); + } else { + drop.setType(Material.FEATHER); + } + increaseStats.changeEXP(skillName, expMap.get("robChicken")); + } else if (hookedEntity.getType() == EntityType.CREEPER) { + double randomNum = rand.nextDouble(); + if (randomNum < .99) { + drop.setType(Material.GUNPOWDER); + } else { + drop.setType(Material.CREEPER_HEAD); + } + increaseStats.changeEXP(skillName, expMap.get("robCreeper")); + } else if (hookedEntity.getType() == EntityType.SKELETON) { + double randomNum = rand.nextDouble(); + if (randomNum < .49) { + drop.setType(Material.BONE); + } else if (randomNum < .98) { + drop.setType(Material.ARROW); + drop.setAmount(rand.nextInt(3) + 1); + } else { + drop.setType(Material.SKELETON_SKULL); + } + increaseStats.changeEXP(skillName, expMap.get("robSkeleton")); + } else if (hookedEntity.getType() == EntityType.WITHER_SKELETON) { + double randomNum = rand.nextDouble(); + if (randomNum < .50) { + drop.setType(Material.BONE); + } else if (randomNum < .99) { + drop.setType(Material.COAL); + drop.setAmount(rand.nextInt(3) + 1); + } else { + drop.setType(Material.WITHER_SKELETON_SKULL); + } + increaseStats.changeEXP(skillName, expMap.get("robWither_Skeleton")); + } else if (hookedEntity.getType() == EntityType.SLIME) { + drop.setType(Material.SLIME_BALL); + increaseStats.changeEXP(skillName, expMap.get("robSlime")); + } else if (hookedEntity.getType() == EntityType.MAGMA_CUBE) { + drop.setType(Material.MAGMA_CREAM); + increaseStats.changeEXP(skillName, expMap.get("robMagma_Cube")); + } else if (hookedEntity.getType() == EntityType.COW) { + double randomNum = rand.nextDouble(); + if (randomNum < .49) { + drop.setType(Material.LEATHER); + } else if (randomNum < .98) { + drop.setType(Material.BEEF); + } else { + drop.setType(Material.MILK_BUCKET); + } + increaseStats.changeEXP(skillName, expMap.get("robCow")); + } else if (hookedEntity.getType() == EntityType.MUSHROOM_COW) { + double randomNum = rand.nextDouble(); + if (randomNum < .05) { + drop.setType(Material.MILK_BUCKET); + } else if (randomNum < 0.10) { + drop.setType(Material.MUSHROOM_STEW); + } else if (randomNum < 0.40) { + drop.setType(Material.LEATHER); + } else if (randomNum < 0.70) { + drop.setType(Material.BEEF); + } else { + drop.setType(Material.RED_MUSHROOM); + drop.setAmount(rand.nextInt(3) + 1); + } + increaseStats.changeEXP(skillName, expMap.get("robMooshroom")); + } else if (hookedEntity.getType() == EntityType.ENDERMAN) { + drop.setType(Material.ENDER_PEARL); + increaseStats.changeEXP(skillName, expMap.get("robEnderman")); + } else if (hookedEntity.getType() == EntityType.SHEEP) { + drop.setType(Material.WHITE_WOOL); + increaseStats.changeEXP(skillName, expMap.get("robSheep")); + } else if (hookedEntity.getType() == EntityType.IRON_GOLEM) { + double randomNum = rand.nextDouble(); + if (randomNum < .03) { + drop.setType(Material.PUMPKIN); + } else if (randomNum < 0.15) { + drop.setType(Material.IRON_INGOT); + } else { + drop.setType(Material.POPPY); + } + increaseStats.changeEXP(skillName, expMap.get("robIron_Golem")); + } else if (hookedEntity.getType() == EntityType.SNOWMAN) { + double randomNum = rand.nextDouble(); + if (randomNum < .03) { + drop.setType(Material.PUMPKIN); + } else { + drop.setType(Material.SNOWBALL); + } + increaseStats.changeEXP(skillName, expMap.get("robSnowman")); + } else if (hookedEntity.getType() == EntityType.WITCH) { + double randomNum = rand.nextDouble(); + if (randomNum < 0.01) { + drop.setType(Material.SPLASH_POTION); + PotionMeta pm = (PotionMeta) drop.getItemMeta(); + assert pm != null; + pm.addCustomEffect(new PotionEffect(PotionEffectType.HEAL, 15, 0), false); + pm.setDisplayName(ChatColor.YELLOW + "Splash Potion of Healing"); + drop.setItemMeta(pm); + } else if (randomNum < 0.02) { + drop.setType(Material.SPLASH_POTION); + PotionMeta pm = (PotionMeta) drop.getItemMeta(); + assert pm != null; + pm.addCustomEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 15, 0), false); + pm.setDisplayName(ChatColor.YELLOW + "Splash Potion of Fire Resistance"); + drop.setItemMeta(pm); + } else if (randomNum < 0.03) { + drop.setType(Material.SPLASH_POTION); + PotionMeta pm = (PotionMeta) drop.getItemMeta(); + assert pm != null; + pm.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 15, 0), false); + pm.setDisplayName(ChatColor.YELLOW + "Splash Potion of Speed"); + drop.setItemMeta(pm); + } else if (randomNum < 0.12) { + drop.setType(Material.GLASS_BOTTLE); + } else if (randomNum < 0.24) { + drop.setType(Material.SUGAR); + } else if (randomNum < 0.36) { + drop.setType(Material.SPIDER_EYE); + } else if (randomNum < 0.48) { + drop.setType(Material.GUNPOWDER); + } else if (randomNum < 0.61) { + drop.setType(Material.FERMENTED_SPIDER_EYE); + } else if (randomNum < 0.74) { + drop.setType(Material.GLOWSTONE_DUST); + } else if (randomNum < 0.87) { + drop.setType(Material.REDSTONE); + } else { + drop.setType(Material.STICK); + } + increaseStats.changeEXP(skillName, expMap.get("robWitch")); + } else if (hookedEntity.getType() == EntityType.SHULKER) { + double randomNum = rand.nextDouble(); + if (randomNum < .25) { + drop.setType(Material.SHULKER_SHELL); + } else { + drop.setType(Material.PURPUR_BLOCK); + } + increaseStats.changeEXP(skillName, expMap.get("robShulker")); + } else if (minecraftVersion.getMinecraftVersionAsDouble() >= 1.16) { + if (hookedEntity.getType() == EntityType.ZOMBIFIED_PIGLIN) { + double randomNum = rand.nextDouble(); + if (randomNum < .5) { + drop.setType(Material.ROTTEN_FLESH); + } else { + drop.setType(Material.GOLD_NUGGET); + } + increaseStats.changeEXP(skillName, expMap.get("robZombie_Pigman")); + } + } + + Location location = hookedEntity.getLocation(); + double dx = p.getLocation().getX() - location.getX(); + double dy = p.getLocation().getY() - location.getY(); + double dz = p.getLocation().getZ() - location.getZ(); + double distance = Math.sqrt((dx * dx) + (dy * dy) + (dz * dz)); + double multiplier = 0.08; + Item droppedItem = world.dropItemNaturally(location, drop); + Vector velocity = new Vector(dx * multiplier, + (dy * multiplier) + (double) Math.sqrt(distance) * 0.1, dz * multiplier); + droppedItem.setVelocity(velocity); + + ConfigLoad configLoad = new ConfigLoad(); + int cooldownTime = configLoad.getAbilityCooldowns().get("robCooldown"); + timers.setPlayerCooldownTime("fishingRob", cooldownTime); + for (int i = 1; i <= cooldownTime; i++) { + int timeRemaining = cooldownTime - i; + new BukkitRunnable() { + @Override + public void run() { + timers.setPlayerCooldownTime("fishingRob", timeRemaining); + if (timeRemaining == 0 && !p.isOnline()) { + timers.removePlayer(); + } + } + }.runTaskLater(plugin, 20 * i); + } + + } + + + public ItemStack dropTable(boolean superBaitOn) { + Map> pStat = pStatClass.getPlayerData(); + int doubleFishLevel = (int) pStat.get(skillName).get(5); + int treasureFinderLevel = (int) pStat.get(skillName).get(6); + int scavengerLevel = (int) pStat.get(skillName).get(8); + int filtrationLevel = (int) pStat.get(skillName).get(10); + int hotRodLevel = (int) pStat.get(skillName).get(12); + int hotRodToggle = (int) pStat.get("global").get(17); + int hotRod = 0; + double expMultiplier = 1.0; + if (superBaitOn) { + ConfigLoad configLoad = new ConfigLoad(); + expMultiplier = configLoad.getSpecialMultiplier().get("superBaitEXPMultiplier"); + } + if (hotRodLevel > 0 && hotRodToggle > 0) { + hotRod = 1; + } + double roll = rand.nextDouble(); + ItemStack item = new ItemStack(Material.COD, 1); + + //Load Fishing config + ConfigLoad loadConfig = new ConfigLoad(); + ArrayList fishingInfo = loadConfig.getFishingInfo1(); + ArrayList fishingInfoBaseChances = loadConfig.getFishingInfo2(); + ArrayList fishingInfoHotRod = loadConfig.getFishingInfo3(); + ArrayList fishingInfoEnchants = loadConfig.getFishingInfo4(); + + //Initialize Sorted Arrays + ArrayList baseChances = new ArrayList<>(); + ArrayList itemNames = new ArrayList<>(); + ArrayList dropAmounts = new ArrayList<>(); + ArrayList dropRandomness = new ArrayList<>(); + ArrayList itemNames_hotRod = new ArrayList<>(); + ArrayList dropAmounts_hotRod = new ArrayList<>(); + ArrayList dropRandomness_hotRod = new ArrayList<>(); + ArrayList dropEnchantedItems = new ArrayList<>(); + + //Organize Fishing config + for (Object chance : fishingInfoBaseChances) { + baseChances.add((double) chance); + } + for (int i = 0; i < fishingInfo.size(); i++) { + if (i % 3 == 0) { + itemNames.add((Material) fishingInfo.get(i)); + } else if (i % 3 == 1) { + dropAmounts.add((int) fishingInfo.get(i)); + } else { + dropRandomness.add((int) fishingInfo.get(i)); + } + } + for (Object entry : fishingInfoHotRod) { + int i = fishingInfoHotRod.indexOf(entry); + if (i % 3 == 0) { + itemNames_hotRod.add((Material) entry); + } else if (i % 3 == 1) { + dropAmounts_hotRod.add((int) entry); + } else { + dropRandomness_hotRod.add((int) entry); + } + } + for (Object enchantInfo : fishingInfoEnchants) { + if ((int) enchantInfo > 0) { + dropEnchantedItems.add(true); + } else { + dropEnchantedItems.add(false); + } + } + + //Luck of the sea level + int luckOfTheSeaLevel = 0; + if (itemInHand != null) { + ItemMeta rodMeta = itemInHand.getItemMeta(); + if (rodMeta != null) { + if (rodMeta.getEnchants() != null) { + if (rodMeta.getEnchants().containsKey(Enchantment.LUCK)) { + luckOfTheSeaLevel = rodMeta.getEnchantLevel(Enchantment.LUCK); + } + } + } + } + + double[] tierChances = {Math.max(0.100 - 0.02 * luckOfTheSeaLevel, 0), + Math.min(0.050 + 0.2 * luckOfTheSeaLevel, 0.15), + baseChances.get(0), baseChances.get(1), baseChances.get(2), baseChances.get(3), + baseChances.get(4)}; + double[] junkToTreasurePortion = {0, 0, 0, 0, 0, 0, 0}; + + //Determine if chance to roll into tier unlocked + //Also determines the portion of junkToTreasure chances -> each treasure bracket + switch (scavengerLevel) { + case 0: + tierChances[2] = 0; + tierChances[3] = 0; + tierChances[4] = 0; + tierChances[5] = 0; + tierChances[6] = 0; + junkToTreasurePortion[1] = 1; + break; + case 1: + tierChances[3] = 0; + tierChances[4] = 0; + tierChances[5] = 0; + tierChances[6] = 0; + junkToTreasurePortion[1] = 0.5; + junkToTreasurePortion[2] = 0.5; + break; + case 2: + tierChances[4] = 0; + tierChances[5] = 0; + tierChances[6] = 0; + junkToTreasurePortion[1] = 0.334; + junkToTreasurePortion[2] = 0.333; + junkToTreasurePortion[3] = 0.333; + break; + case 3: + tierChances[5] = 0; + tierChances[6] = 0; + junkToTreasurePortion[1] = 0.3; + junkToTreasurePortion[2] = 0.3; + junkToTreasurePortion[3] = 0.3; + junkToTreasurePortion[4] = 0.1; + junkToTreasurePortion[5] = 0; + junkToTreasurePortion[6] = 0; + break; + case 4: + tierChances[6] = 0; + junkToTreasurePortion[1] = 0.267; + junkToTreasurePortion[2] = 0.267; + junkToTreasurePortion[3] = 0.266; + junkToTreasurePortion[4] = 0.1; + junkToTreasurePortion[5] = 0.1; + break; + case 5: + junkToTreasurePortion[1] = 0.25; + junkToTreasurePortion[2] = 0.25; + junkToTreasurePortion[3] = 0.25; + junkToTreasurePortion[4] = 0.1; + junkToTreasurePortion[5] = 0.1; + junkToTreasurePortion[6] = 0.05; + break; + default: + break; + } + + //Alters brackets chances based on filtrationLevel + if (filtrationLevel <= 2 && filtrationLevel > 0) { + double total = 0; + for (int i = 3; i <= 6; i++) { + if (tierChances[i] != 0) { + switch (i) { + case 3: + tierChances[i] += 0.005 * filtrationLevel; + total += 0.005 * filtrationLevel; + break; + case 4: + case 5: + tierChances[i] += 0.002 * filtrationLevel; + total += 0.002 * filtrationLevel; + break; + case 6: + tierChances[i] += 0.001 * filtrationLevel; + total += 0.001 * filtrationLevel; + break; + default: + break; + } + } + } + tierChances[2] -= total; + } else if (filtrationLevel > 2) { + double total = 0.01; + tierChances[3] += 0.01; + for (int i = 4; i <= 6; i++) { + if (tierChances[i] != 0) { + switch (i) { + case 4: + case 5: + tierChances[i] += 0.002 * filtrationLevel; + total += 0.002 * filtrationLevel; + break; + case 6: + tierChances[i] += 0.001 * filtrationLevel; + total += 0.001 * filtrationLevel; + break; + default: + break; + } + } + } + tierChances[2] -= total; + } + + //removes junk chance in accordance to treasureFinder Perk + double junkSubtract = Math.min(0.1, treasureFinderLevel * 0.00005); + tierChances[0] = Math.max(tierChances[0] - junkSubtract, 0); + for (int i = 1; i <= 6; i++) { + tierChances[i] += junkSubtract * junkToTreasurePortion[i]; + } + + /* Old "Lucky Catch" Perk + + //Adds treasure chance in accordance to luckyCatch perk + if (luckyCatchLevel > 0 && pAbilities[4] == -2) { + for (int i = 1; i <= 6; i++) { + tierChances[i] += 0.05 * junkToTreasurePortion[i]; + } + } + + */ + + /* + System.out.println(Double.toString(tierChances[0]) + " " + Double.toString(tierChances[1]) + " " + Double.toString(tierChances[2]) + " " + + Double.toString(tierChances[3]) + " " + Double.toString(tierChances[4]) + " " + Double.toString(tierChances[5]) + " " + + Double.toString(tierChances[6])); + + */ + + //Sets brackets for random number roll + double[] rollBrackets = {tierChances[0], 0, 0, 0, 0, 0, 0}; + for (int i = 1; i <= 6; i++) { + if (!superBaitOn) { + rollBrackets[i] = rollBrackets[i - 1] + tierChances[i]; + } else { + rollBrackets[i] = rollBrackets[i - 1] + (2.0 / 4.0) * tierChances[i]; + } + } + + Material[] music_discs = {Material.MUSIC_DISC_11, Material.MUSIC_DISC_13, + Material.MUSIC_DISC_BLOCKS, Material.MUSIC_DISC_CAT, + Material.MUSIC_DISC_CHIRP, Material.MUSIC_DISC_FAR, Material.MUSIC_DISC_MALL, + Material.MUSIC_DISC_MELLOHI, + Material.MUSIC_DISC_STAL, Material.MUSIC_DISC_STRAD, Material.MUSIC_DISC_WAIT, + Material.MUSIC_DISC_WARD}; + Material[] chainmail = {Material.CHAINMAIL_BOOTS, Material.CHAINMAIL_CHESTPLATE, + Material.CHAINMAIL_HELMET, Material.CHAINMAIL_LEGGINGS}; + PsuedoEnchanting enchant = new PsuedoEnchanting(); + + if (roll < rollBrackets[0]) { //Junk Tier (-1) + double roll2 = rand.nextDouble(); + double[] naturalJunkBrackets = {0.12, 0.144, 0.264, 0.384, 0.504, 0.564, 0.624, 0.744, 0.864, + 0.878, 1}; //Altered a bit due to rounding error + ItemStack junkRod = new ItemStack(Material.FISHING_ROD, 1); + ItemMeta junkRodMeta = junkRod.getItemMeta(); + if (junkRodMeta instanceof Damageable) { + ((Damageable) junkRodMeta).setDamage(rand.nextInt(57) + 7); + } + junkRod.setItemMeta(junkRodMeta); + + ItemStack junkBoots = new ItemStack(Material.LEATHER_BOOTS, 1); + ItemMeta junkBootsMeta = junkBoots.getItemMeta(); + if (junkBoots instanceof Damageable) { + ((Damageable) junkBoots).setDamage(rand.nextInt(56) + 7); + } + junkBoots.setItemMeta(junkBootsMeta); + ItemStack junkInk = new ItemStack(Material.INK_SAC, 10); + + ItemStack[] junkItems = {new ItemStack(Material.BOWL, 1), junkRod, + new ItemStack(Material.LEATHER, 1), junkBoots, + new ItemStack(Material.ROTTEN_FLESH, 1), new ItemStack(Material.STICK, 1), + new ItemStack(Material.STRING, 1), + new ItemStack(Material.GLASS_BOTTLE, 1), new ItemStack(Material.BONE, 1), junkInk, + new ItemStack(Material.TRIPWIRE_HOOK, 1)}; + for (int i = 0; i < naturalJunkBrackets.length; i++) { + if (roll2 < naturalJunkBrackets[i]) { + increaseStats.changeEXP(skillName, + (int) Math.round(expMultiplier * expMap.get("catchJunk"))); + return junkItems[i]; + } + } + } else if (roll < rollBrackets[1]) { //Natural Tier (0) + double roll2 = rand.nextDouble(); + double[] naturalRareBrackets = {0.143, 0.283, 0.429, 0.572, 0.715, 0.858, + 1}; //Altered a bit due to rounding error + ItemStack rareRod = new ItemStack(Material.FISHING_ROD, 1); + rareRod = enchant.enchantItem(rareRod, rand.nextInt(9) + 22, true); + ItemMeta rareRodItemMeta = rareRod.getItemMeta(); + if (rareRodItemMeta instanceof Damageable) { + ((Damageable) rareRodItemMeta).setDamage(rand.nextInt(10) + 54); + } + rareRod.setItemMeta(rareRodItemMeta); + + ItemStack rareBow = new ItemStack(Material.BOW, 1); + rareBow = enchant.enchantItem(rareBow, rand.nextInt(9) + 22, true); + ItemMeta rareBowItemMeta = rareBow.getItemMeta(); + if (rareBowItemMeta instanceof Damageable) { + ((Damageable) rareBowItemMeta).setDamage(rand.nextInt(40) + 343); + } + rareBow.setItemMeta(rareBowItemMeta); + + ItemStack enchantedBook = new ItemStack(Material.ENCHANTED_BOOK, 1); + enchantedBook = enchant.enchantItem(enchantedBook, 30, true); + + ItemStack[] items = {rareBow, rareRod, enchantedBook, new ItemStack(Material.NAME_TAG, 1), + new ItemStack(Material.NAUTILUS_SHELL, 1), new ItemStack(Material.SADDLE, 1), + new ItemStack(Material.LILY_PAD, 1)}; + for (int i = 0; i < naturalRareBrackets.length; i++) { + if (roll2 < naturalRareBrackets[i]) { + increaseStats.changeEXP(skillName, + (int) Math.round(expMultiplier * expMap.get("catchTier0"))); + return items[i]; + } + } + + + } else if (roll < rollBrackets[2]) { //Common Tier (1) + double roll2 = rand.nextDouble(); + if (roll2 < 0.2) { + if (itemNames.get(0) == null) { + item.setType(Material.ENDER_PEARL); + if (hotRod > 0) { + item.setType(Material.FIRE_CHARGE); + item.setAmount(item.getAmount() * 3); + } + } else { + if (hotRod > 0) { + item.setType(itemNames_hotRod.get(0)); + item.setAmount( + dropAmounts_hotRod.get(0) + rand.nextInt(dropRandomness_hotRod.get(0) + 1)); + } else { + item.setType(itemNames.get(0)); + item.setAmount(dropAmounts.get(0) + rand.nextInt(dropRandomness.get(0) + 1)); + } + } + } else if (roll2 < 0.4) { + if (itemNames.get(1) == null) { + item.setType(Material.GHAST_TEAR); + if (hotRod > 0) { + item.setType(Material.BLAZE_POWDER); + } + } else { + if (hotRod > 0) { + item.setType(itemNames_hotRod.get(1)); + item.setAmount( + dropAmounts_hotRod.get(1) + rand.nextInt(dropRandomness_hotRod.get(1) + 1)); + } else { + item.setType(itemNames.get(1)); + item.setAmount(dropAmounts.get(1) + rand.nextInt(dropRandomness.get(1) + 1)); + } + } + } else if (roll2 < 0.6) { + if (itemNames.get(2) == null) { + item.setType(Material.GOLD_INGOT); + } else { + item.setType(itemNames.get(2)); + item.setAmount(dropAmounts.get(2) + rand.nextInt(dropRandomness.get(2) + 1)); + } + } else if (roll2 < 0.8) { + if (itemNames.get(3) == null) { + item.setType(Material.IRON_INGOT); + } else { + item.setType(itemNames.get(3)); + item.setAmount(dropAmounts.get(3) + rand.nextInt(dropRandomness.get(3) + 1)); + } + } else { + if (dropEnchantedItems.get(0)) { + item = getTieredLoot(1); + } + } + increaseStats.changeEXP(skillName, + (int) Math.round(expMultiplier * expMap.get("catchTier1"))); + } else if (roll < rollBrackets[3]) { //Uncommon Tier (2) + double roll2 = rand.nextDouble(); + if (roll2 < 0.2) { + if (itemNames.get(4) == null) { + item.setType(Material.WET_SPONGE); + if (hotRod > 0) { + item.setType(Material.SPONGE); + } + } else { + if (hotRod > 0) { + item.setType(itemNames_hotRod.get(2)); + item.setAmount( + dropAmounts_hotRod.get(2) + rand.nextInt(dropRandomness_hotRod.get(2) + 1)); + } else { + item.setType(itemNames.get(4)); + item.setAmount(dropAmounts.get(4) + rand.nextInt(dropRandomness.get(4) + 1)); + } + } + } else if (roll2 < 0.4) { + if (itemNames.get(5) == null) { + item.setType(Material.EMERALD); + } else { + item.setType(itemNames.get(5)); + item.setAmount(dropAmounts.get(5) + rand.nextInt(dropRandomness.get(5) + 1)); + } + } else if (roll2 < 0.6) { + if (itemNames.get(6) == null) { + item.setType(Material.SLIME_BALL); + int roll3 = rand.nextInt(3) + 1; + item.setAmount(roll3); + if (hotRod > 0) { + item.setType(Material.MAGMA_CREAM); + } + } else { + if (hotRod > 0) { + item.setType(itemNames_hotRod.get(3)); + item.setAmount( + dropAmounts_hotRod.get(3) + rand.nextInt(dropRandomness_hotRod.get(3) + 1)); + } else { + item.setType(itemNames.get(6)); + item.setAmount(dropAmounts.get(6) + rand.nextInt(dropRandomness.get(6) + 1)); + } + } + } else if (roll2 < 0.8) { + if (itemNames.get(7) == null) { + item.setType(Material.ENDER_PEARL); + int roll3 = rand.nextInt(4) + 2; + item.setAmount(roll3); + if (hotRod > 0) { + item.setType(Material.FIRE_CHARGE); + item.setAmount(item.getAmount() * 3); + } + } else { + if (hotRod > 0) { + item.setType(itemNames_hotRod.get(4)); + item.setAmount( + dropAmounts_hotRod.get(4) + rand.nextInt(dropRandomness_hotRod.get(4) + 1)); + } else { + item.setType(itemNames.get(7)); + item.setAmount(dropAmounts.get(7) + rand.nextInt(dropRandomness.get(7) + 1)); + } + } + } else { + if (dropEnchantedItems.get(1)) { + item = getTieredLoot(2); + } + } + increaseStats.changeEXP(skillName, + (int) Math.round(expMultiplier * expMap.get("catchTier2"))); + } else if (roll < rollBrackets[4]) { //Rare Tier (3) + double roll2 = rand.nextDouble(); + if (roll2 < 0.2) { + if (itemNames.get(8) == null) { + item.setType(music_discs[rand.nextInt(music_discs.length)]); + } else { + item.setType(itemNames.get(8)); + item.setAmount(dropAmounts.get(8) + rand.nextInt(dropRandomness.get(8) + 1)); + } + } else if (roll2 < 0.4) { + if (itemNames.get(9) == null) { + item.setType(Material.SPECTRAL_ARROW); + int roll3 = rand.nextInt(11) + 5; + item.setAmount(roll3); + } else { + item.setType(itemNames.get(9)); + item.setAmount(dropAmounts.get(9) + rand.nextInt(dropRandomness.get(9) + 1)); + } + } else if (roll2 < 0.6) { + if (itemNames.get(10) == null) { + item.setType(chainmail[rand.nextInt(chainmail.length)]); + } else { + item.setType(itemNames.get(10)); + item.setAmount(dropAmounts.get(10) + rand.nextInt(dropRandomness.get(10) + 1)); + } + } else if (roll2 < 0.8) { + if (itemNames.get(11) == null) { + item.setType(Material.TRIDENT); + } else { + item.setType(itemNames.get(11)); + item.setAmount(dropAmounts.get(11) + rand.nextInt(dropRandomness.get(11) + 1)); + } + } else { + if (dropEnchantedItems.get(2)) { + item = getTieredLoot(3); + } + } + increaseStats.changeEXP(skillName, + (int) Math.round(expMultiplier * expMap.get("catchTier3"))); + } else if (roll < rollBrackets[5]) { //Very Rare Tier (4) + double roll2 = rand.nextDouble(); + if (roll2 < 0.233) { + if (itemNames.get(12) == null) { + item.setType(Material.DIAMOND); + } else { + item.setType(itemNames.get(12)); + item.setAmount(dropAmounts.get(12) + rand.nextInt(dropRandomness.get(12) + 1)); + } + } else if (roll2 < 0.466) { + if (itemNames.get(13) == null) { + item.setType(Material.NAUTILUS_SHELL); + int roll3 = rand.nextInt(3) + 2; + item.setAmount(roll3); + } else { + item.setType(itemNames.get(13)); + item.setAmount(dropAmounts.get(13) + rand.nextInt(dropRandomness.get(13) + 1)); + } + } else if (roll2 < 0.7) { + if (itemNames.get(14) == null) { + item.setType(Material.EMERALD); + int roll3 = rand.nextInt(6) + 3; + item.setAmount(roll3); + } else { + item.setType(itemNames.get(14)); + item.setAmount(dropAmounts.get(14) + rand.nextInt(dropRandomness.get(14) + 1)); + } + } else if (roll2 < 0.85) { + if (itemNames.get(15) == null) { + item.setType(Material.CROSSBOW); + item = enchant.enchantItem(item, 28 + rand.nextInt(3), true); + } else { + item.setType(itemNames.get(15)); + item.setAmount(dropAmounts.get(15) + rand.nextInt(dropRandomness.get(15) + 1)); + } + } else { + if (dropEnchantedItems.get(3)) { + item = getTieredLoot(4); + } + } + increaseStats.changeEXP(skillName, + (int) Math.round(expMultiplier * expMap.get("catchTier4"))); + } else if (roll < rollBrackets[6]) { //Legendary Tier (5) + double roll2 = rand.nextDouble(); + if (roll2 < 0.1) { + if (itemNames.get(16) == null) { + item.setType(Material.ELYTRA); + } else { + item.setType(itemNames.get(16)); + item.setAmount(dropAmounts.get(16) + rand.nextInt(dropRandomness.get(16) + 1)); + } + } else if (roll2 < 0.4) { + if (itemNames.get(17) == null) { + item.setType(Material.HEART_OF_THE_SEA); + } else { + item.setType(itemNames.get(17)); + item.setAmount(dropAmounts.get(17) + rand.nextInt(dropRandomness.get(17) + 1)); + } + } else if (roll2 < 0.6) { + if (itemNames.get(18) == null) { + item.setType(Material.TOTEM_OF_UNDYING); + } else { + item.setType(itemNames.get(18)); + item.setAmount(dropAmounts.get(18) + rand.nextInt(dropRandomness.get(18) + 1)); + } + } else if (roll2 < 0.9) { + if (itemNames.get(19) == null) { + item.setType(Material.DIAMOND); + int roll3 = rand.nextInt(4) + 2; + item.setAmount(roll3); + } else { + item.setType(itemNames.get(19)); + item.setAmount(dropAmounts.get(19) + rand.nextInt(dropRandomness.get(19) + 1)); + } + } else { + if (dropEnchantedItems.get(4)) { + item = getTieredLoot(5); + } + } + increaseStats.changeEXP(skillName, + (int) Math.round(expMultiplier * expMap.get("catchTier5"))); + } else { //fish roll + double roll2 = rand.nextDouble(); + if (roll2 < .6) { + item.setType(Material.COD); + if (hotRod > 0) { + item.setType(Material.COOKED_COD); + } + } else if (roll2 < 0.85) { + item.setType(Material.SALMON); + if (hotRod > 0) { + item.setType(Material.COOKED_SALMON); + } + } else if (roll2 < 0.87) { + item.setType(Material.TROPICAL_FISH); + } else { + item.setType(Material.PUFFERFISH); + } + double roll3 = rand.nextDouble(); + if (doubleFishLevel * 0.0005 > roll3) { + item.setAmount(2); + } + increaseStats.changeEXP(skillName, (int) Math.round(expMultiplier * expMap.get("catchFish"))); + return item; + } + + return item; + + } + + public ItemStack getTieredLoot(int tier) { + Map lootChanceMap = new HashMap<>(); + Map possibleDrops = new HashMap<>(); + ItemStack drop = new ItemStack(Material.COD, 1); + switch (tier) { + case 2: + lootChanceMap.put(Material.STONE_SHOVEL, 5); + lootChanceMap.put(Material.STONE_SWORD, 5); + lootChanceMap.put(Material.STONE_AXE, 5); + lootChanceMap.put(Material.STONE_PICKAXE, 5); + lootChanceMap.put(Material.LEATHER_BOOTS, 5); + lootChanceMap.put(Material.LEATHER_LEGGINGS, 5); + lootChanceMap.put(Material.LEATHER_CHESTPLATE, 5); + lootChanceMap.put(Material.LEATHER_HELMET, 5); + + lootChanceMap.put(Material.IRON_SHOVEL, 3); + lootChanceMap.put(Material.IRON_SWORD, 3); + lootChanceMap.put(Material.IRON_AXE, 3); + lootChanceMap.put(Material.IRON_PICKAXE, 3); + lootChanceMap.put(Material.IRON_BOOTS, 3); + lootChanceMap.put(Material.IRON_LEGGINGS, 2); + lootChanceMap.put(Material.IRON_CHESTPLATE, 2); + lootChanceMap.put(Material.IRON_HELMET, 3); + + lootChanceMap.put(Material.GOLDEN_SHOVEL, 0); + lootChanceMap.put(Material.GOLDEN_SWORD, 0); + lootChanceMap.put(Material.GOLDEN_AXE, 0); + lootChanceMap.put(Material.GOLDEN_PICKAXE, 0); + lootChanceMap.put(Material.GOLDEN_BOOTS, 1); + lootChanceMap.put(Material.GOLDEN_LEGGINGS, 1); + lootChanceMap.put(Material.GOLDEN_CHESTPLATE, 1); + lootChanceMap.put(Material.GOLDEN_HELMET, 1); + + lootChanceMap.put(Material.DIAMOND_SHOVEL, 0); + lootChanceMap.put(Material.DIAMOND_SWORD, 0); + lootChanceMap.put(Material.DIAMOND_AXE, 0); + lootChanceMap.put(Material.DIAMOND_PICKAXE, 0); + lootChanceMap.put(Material.DIAMOND_BOOTS, 0); + lootChanceMap.put(Material.DIAMOND_LEGGINGS, 0); + lootChanceMap.put(Material.DIAMOND_CHESTPLATE, 0); + lootChanceMap.put(Material.DIAMOND_HELMET, 0); + + case 3: + lootChanceMap.put(Material.STONE_SHOVEL, 1); + lootChanceMap.put(Material.STONE_SWORD, 1); + lootChanceMap.put(Material.STONE_AXE, 1); + lootChanceMap.put(Material.STONE_PICKAXE, 1); + lootChanceMap.put(Material.LEATHER_BOOTS, 1); + lootChanceMap.put(Material.LEATHER_LEGGINGS, 1); + lootChanceMap.put(Material.LEATHER_CHESTPLATE, 1); + lootChanceMap.put(Material.LEATHER_HELMET, 1); + + lootChanceMap.put(Material.IRON_SHOVEL, 7); + lootChanceMap.put(Material.IRON_SWORD, 7); + lootChanceMap.put(Material.IRON_AXE, 7); + lootChanceMap.put(Material.IRON_PICKAXE, 7); + lootChanceMap.put(Material.IRON_BOOTS, 8); + lootChanceMap.put(Material.IRON_LEGGINGS, 6); + lootChanceMap.put(Material.IRON_CHESTPLATE, 6); + lootChanceMap.put(Material.IRON_HELMET, 8); + + lootChanceMap.put(Material.GOLDEN_SHOVEL, 2); + lootChanceMap.put(Material.GOLDEN_SWORD, 2); + lootChanceMap.put(Material.GOLDEN_AXE, 2); + lootChanceMap.put(Material.GOLDEN_PICKAXE, 2); + lootChanceMap.put(Material.GOLDEN_BOOTS, 4); + lootChanceMap.put(Material.GOLDEN_LEGGINGS, 2); + lootChanceMap.put(Material.GOLDEN_CHESTPLATE, 2); + lootChanceMap.put(Material.GOLDEN_HELMET, 4); + + lootChanceMap.put(Material.DIAMOND_SHOVEL, 0); + lootChanceMap.put(Material.DIAMOND_SWORD, 0); + lootChanceMap.put(Material.DIAMOND_AXE, 0); + lootChanceMap.put(Material.DIAMOND_PICKAXE, 0); + lootChanceMap.put(Material.DIAMOND_BOOTS, 0); + lootChanceMap.put(Material.DIAMOND_LEGGINGS, 0); + lootChanceMap.put(Material.DIAMOND_CHESTPLATE, 0); + lootChanceMap.put(Material.DIAMOND_HELMET, 0); + break; + case 4: + lootChanceMap.put(Material.STONE_SHOVEL, 0); + lootChanceMap.put(Material.STONE_SWORD, 0); + lootChanceMap.put(Material.STONE_AXE, 0); + lootChanceMap.put(Material.STONE_PICKAXE, 0); + lootChanceMap.put(Material.LEATHER_BOOTS, 0); + lootChanceMap.put(Material.LEATHER_LEGGINGS, 0); + lootChanceMap.put(Material.LEATHER_CHESTPLATE, 0); + lootChanceMap.put(Material.LEATHER_HELMET, 0); + + lootChanceMap.put(Material.IRON_SHOVEL, 10); + lootChanceMap.put(Material.IRON_SWORD, 10); + lootChanceMap.put(Material.IRON_AXE, 10); + lootChanceMap.put(Material.IRON_PICKAXE, 10); + lootChanceMap.put(Material.IRON_BOOTS, 10); + lootChanceMap.put(Material.IRON_LEGGINGS, 9); + lootChanceMap.put(Material.IRON_CHESTPLATE, 8); + lootChanceMap.put(Material.IRON_HELMET, 10); + + lootChanceMap.put(Material.GOLDEN_SHOVEL, 0); + lootChanceMap.put(Material.GOLDEN_SWORD, 0); + lootChanceMap.put(Material.GOLDEN_AXE, 0); + lootChanceMap.put(Material.GOLDEN_PICKAXE, 0); + lootChanceMap.put(Material.GOLDEN_BOOTS, 0); + lootChanceMap.put(Material.GOLDEN_LEGGINGS, 0); + lootChanceMap.put(Material.GOLDEN_CHESTPLATE, 0); + lootChanceMap.put(Material.GOLDEN_HELMET, 0); + + lootChanceMap.put(Material.DIAMOND_SHOVEL, 1); + lootChanceMap.put(Material.DIAMOND_SWORD, 1); + lootChanceMap.put(Material.DIAMOND_AXE, 1); + lootChanceMap.put(Material.DIAMOND_PICKAXE, 1); + lootChanceMap.put(Material.DIAMOND_BOOTS, 1); + lootChanceMap.put(Material.DIAMOND_LEGGINGS, 0); + lootChanceMap.put(Material.DIAMOND_CHESTPLATE, 0); + lootChanceMap.put(Material.DIAMOND_HELMET, 1); + break; + case 5: + lootChanceMap.put(Material.STONE_SHOVEL, 0); + lootChanceMap.put(Material.STONE_SWORD, 0); + lootChanceMap.put(Material.STONE_AXE, 0); + lootChanceMap.put(Material.STONE_PICKAXE, 0); + lootChanceMap.put(Material.LEATHER_BOOTS, 0); + lootChanceMap.put(Material.LEATHER_LEGGINGS, 0); + lootChanceMap.put(Material.LEATHER_CHESTPLATE, 0); + lootChanceMap.put(Material.LEATHER_HELMET, 0); + + lootChanceMap.put(Material.IRON_SHOVEL, 2); + lootChanceMap.put(Material.IRON_SWORD, 2); + lootChanceMap.put(Material.IRON_AXE, 2); + lootChanceMap.put(Material.IRON_PICKAXE, 2); + lootChanceMap.put(Material.IRON_BOOTS, 2); + lootChanceMap.put(Material.IRON_LEGGINGS, 1); + lootChanceMap.put(Material.IRON_CHESTPLATE, 1); + lootChanceMap.put(Material.IRON_HELMET, 2); + + lootChanceMap.put(Material.GOLDEN_SHOVEL, 0); + lootChanceMap.put(Material.GOLDEN_SWORD, 0); + lootChanceMap.put(Material.GOLDEN_AXE, 0); + lootChanceMap.put(Material.GOLDEN_PICKAXE, 0); + lootChanceMap.put(Material.GOLDEN_BOOTS, 0); + lootChanceMap.put(Material.GOLDEN_LEGGINGS, 0); + lootChanceMap.put(Material.GOLDEN_CHESTPLATE, 0); + lootChanceMap.put(Material.GOLDEN_HELMET, 0); + + lootChanceMap.put(Material.DIAMOND_SHOVEL, 10); + lootChanceMap.put(Material.DIAMOND_SWORD, 10); + lootChanceMap.put(Material.DIAMOND_AXE, 10); + lootChanceMap.put(Material.DIAMOND_PICKAXE, 10); + lootChanceMap.put(Material.DIAMOND_BOOTS, 10); + lootChanceMap.put(Material.DIAMOND_LEGGINGS, 9); + lootChanceMap.put(Material.DIAMOND_CHESTPLATE, 8); + lootChanceMap.put(Material.DIAMOND_HELMET, 10); + break; + case 1: + default: + lootChanceMap.put(Material.STONE_SHOVEL, 10); + lootChanceMap.put(Material.STONE_SWORD, 10); + lootChanceMap.put(Material.STONE_AXE, 10); + lootChanceMap.put(Material.STONE_PICKAXE, 10); + lootChanceMap.put(Material.LEATHER_BOOTS, 10); + lootChanceMap.put(Material.LEATHER_LEGGINGS, 10); + lootChanceMap.put(Material.LEATHER_CHESTPLATE, 10); + lootChanceMap.put(Material.LEATHER_HELMET, 10); + + lootChanceMap.put(Material.IRON_SHOVEL, 3); + lootChanceMap.put(Material.IRON_SWORD, 3); + lootChanceMap.put(Material.IRON_AXE, 3); + lootChanceMap.put(Material.IRON_PICKAXE, 3); + lootChanceMap.put(Material.IRON_BOOTS, 3); + lootChanceMap.put(Material.IRON_LEGGINGS, 2); + lootChanceMap.put(Material.IRON_CHESTPLATE, 2); + lootChanceMap.put(Material.IRON_HELMET, 3); + + lootChanceMap.put(Material.GOLDEN_SHOVEL, 0); + lootChanceMap.put(Material.GOLDEN_SWORD, 0); + lootChanceMap.put(Material.GOLDEN_AXE, 0); + lootChanceMap.put(Material.GOLDEN_PICKAXE, 0); + lootChanceMap.put(Material.GOLDEN_BOOTS, 0); + lootChanceMap.put(Material.GOLDEN_LEGGINGS, 0); + lootChanceMap.put(Material.GOLDEN_CHESTPLATE, 0); + lootChanceMap.put(Material.GOLDEN_HELMET, 0); + + lootChanceMap.put(Material.DIAMOND_SHOVEL, 0); + lootChanceMap.put(Material.DIAMOND_SWORD, 0); + lootChanceMap.put(Material.DIAMOND_AXE, 0); + lootChanceMap.put(Material.DIAMOND_PICKAXE, 0); + lootChanceMap.put(Material.DIAMOND_BOOTS, 0); + lootChanceMap.put(Material.DIAMOND_LEGGINGS, 0); + lootChanceMap.put(Material.DIAMOND_CHESTPLATE, 0); + lootChanceMap.put(Material.DIAMOND_HELMET, 0); + break; + } + Material[] tools0 = {Material.DIAMOND_PICKAXE, Material.IRON_PICKAXE, Material.DIAMOND_SHOVEL, + Material.IRON_SHOVEL, Material.DIAMOND_AXE, Material.IRON_AXE}; + List tools = Arrays.asList(tools0); + Material[] swords0 = {Material.DIAMOND_SWORD, Material.IRON_SWORD}; + List swords = Arrays.asList(swords0); + Material[] helmet0 = {Material.DIAMOND_HELMET, Material.IRON_HELMET}; + List helmet = Arrays.asList(helmet0); + Material[] chestplate0 = {Material.DIAMOND_CHESTPLATE, Material.IRON_CHESTPLATE}; + List chestplate = Arrays.asList(chestplate0); + Material[] leggings0 = {Material.DIAMOND_LEGGINGS, Material.IRON_LEGGINGS}; + List leggings = Arrays.asList(leggings0); + Material[] boots0 = {Material.DIAMOND_BOOTS, Material.IRON_BOOTS}; + List boots = Arrays.asList(boots0); + + int T = 0; + for (Material itemType : lootChanceMap.keySet()) { + int weight = lootChanceMap.get(itemType); + T += weight; + if (weight > 0) { + possibleDrops.put(itemType, weight); + } + + } + int w = rand.nextInt(T); + for (Material itemType : possibleDrops.keySet()) { + w = w - possibleDrops.get(itemType); + if (w < 0) { + drop.setType(itemType); + break; + } + } + + PsuedoEnchanting enchant = new PsuedoEnchanting(); + switch (tier) { + case 2: + drop = enchant.enchantItem(drop, rand.nextInt(10) + 10, true); + break; + case 3: + drop = enchant.enchantItem(drop, rand.nextInt(10) + 19, true); + break; + case 4: + drop = enchant.enchantItem(drop, rand.nextInt(3) + 28, true); + break; + case 5: + if (tools.contains(drop)) { + int roll = rand.nextInt(2); + if (roll == 1) { + drop.addUnsafeEnchantment(Enchantment.DIG_SPEED, 5); + } else { + drop.addUnsafeEnchantment(Enchantment.MENDING, 1); + } + drop = enchant.addEnchant(drop, 30, true); + } else if (swords.contains(drop)) { + int roll = rand.nextInt(5); + if (roll == 1) { + drop.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 5); + } else if (roll == 2) { + drop.addUnsafeEnchantment(Enchantment.FIRE_ASPECT, 2); + } else if (roll == 3) { + drop.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 3); + } else if (roll == 4) { + drop.addUnsafeEnchantment(Enchantment.SWEEPING_EDGE, 3); + } else { + drop.addUnsafeEnchantment(Enchantment.MENDING, 1); + } + drop = enchant.addEnchant(drop, 30, true); + } else if (boots.contains(drop)) { + int roll = rand.nextInt(5); + if (roll == 1) { + drop.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4); + } else if (roll == 2) { + drop.addUnsafeEnchantment(Enchantment.FROST_WALKER, 2); + } else if (roll == 3) { + drop.addUnsafeEnchantment(Enchantment.DEPTH_STRIDER, 2); + } else if (roll == 4) { + drop.addUnsafeEnchantment(Enchantment.PROTECTION_FALL, 4); + } else { + drop.addUnsafeEnchantment(Enchantment.MENDING, 1); + } + drop = enchant.addEnchant(drop, 30, true); + } else if (chestplate.contains(drop)) { + int roll = rand.nextInt(3); + if (roll == 1) { + drop.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4); + } else if (roll == 2) { + drop.addUnsafeEnchantment(Enchantment.THORNS, 3); + } else { + drop.addUnsafeEnchantment(Enchantment.MENDING, 1); + } + drop = enchant.addEnchant(drop, 30, true); + } else if (leggings.contains(drop)) { + int roll = rand.nextInt(2); + if (roll == 1) { + drop.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4); + } else { + drop.addUnsafeEnchantment(Enchantment.MENDING, 1); + } + drop = enchant.addEnchant(drop, 30, true); + + } else if (helmet.contains(drop)) { + int roll = rand.nextInt(4); + if (roll == 1) { + drop.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4); + } else if (roll == 2) { + drop.addUnsafeEnchantment(Enchantment.OXYGEN, 3); + } else if (roll == 3) { + drop.addUnsafeEnchantment(Enchantment.WATER_WORKER, 1); + } else { + drop.addUnsafeEnchantment(Enchantment.MENDING, 1); + } + drop = enchant.addEnchant(drop, 30, true); + } + break; + case 1: + default: + drop = enchant.enchantItem(drop, rand.nextInt(3) + 1, true); + break; + } + ItemMeta dropMeta = drop.getItemMeta(); + if (dropMeta instanceof Damageable) { + ((Damageable) dropMeta).setDamage( + (int) Math.round(drop.getType().getMaxDurability() * (0.85 * rand.nextDouble()) + 1)); + } + drop.setItemMeta(dropMeta); + return drop; + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Global.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Global.java new file mode 100644 index 0000000..e0f3444 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Global.java @@ -0,0 +1,221 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.UUID; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.utils.globalVariables.EntityGroups; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.Material; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +public class Global extends Skill { + + private static Map> playerSavedDrops = new HashMap<>(); + + Random rand = new Random(); //Random class Import + + private boolean runMethods; + + + public Global(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get("global"); + } + + public double expBoost(String skillName) { + if (!runMethods) { + return 1.0; + } + double boost = 1.0; + Map> pStat = pStatClass.getPlayerData(); + String[] gatherer0 = {"digging", "woodcutting", "mining", "farming", "fishing"}; + String[] scholar0 = {"repair", "agility", "alchemy", "smelting", "enchanting"}; + String[] fighter0 = {"archery", "beastMastery", "swordsmanship", "defense", "axeMastery"}; + List gatherer = Arrays.asList(gatherer0); + List scholar = Arrays.asList(scholar0); + List fighter = Arrays.asList(fighter0); + if (gatherer.contains(skillName) && (int) pStat.get("global").get(2) > 0) { + boost = 1.2; + } else if (scholar.contains(skillName) && (int) pStat.get("global").get(3) > 0) { + boost = 1.2; + } else if (fighter.contains(skillName) && (int) pStat.get("global").get(4) > 0) { + boost = 1.2; + } + + return boost; + } + + public void skillTokenBoost(int type) { + if (!runMethods) { + return; + } + String[] gatherer0 = {"digging", "woodcutting", "mining", "farming", "fishing"}; + String[] scholar0 = {"repair", "agility", "alchemy", "smelting", "enchanting"}; + String[] fighter0 = {"archery", "beastMastery", "swordsmanship", "defense", "axeMastery"}; + List gatherer = Arrays.asList(gatherer0); + List scholar = Arrays.asList(scholar0); + List fighter = Arrays.asList(fighter0); + switch (type) { + case 5: + for (String skillName : gatherer) { + increaseStats.increaseTokens(skillName, "skill", 1); + } + break; + case 6: + for (String skillName : scholar) { + increaseStats.increaseTokens(skillName, "skill", 1); + } + break; + case 7: + for (String skillName : fighter) { + increaseStats.increaseTokens(skillName, "skill", 1); + } + break; + default: + break; + } + } + + public void passiveTokenBoost() { //Old skill_3b perk + String[] abilities0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery"}; + String[] nonAbilities0 = {"repair", "agility", "alchemy", "smelting", "enchanting"}; + List abilities = Arrays.asList(abilities0); + List nonAbilities = Arrays.asList(nonAbilities0); + for (String skillName : abilities) { + increaseStats.increaseTokens(skillName, "passive", 50); + } + for (String skillName : nonAbilities) { + increaseStats.changeStat(skillName, 4, 50); + } + } + + public void gainSoul(Entity entity) { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.getSouls")) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + List hostileMobs = entityGroups.getHostileMobs(); + EntityType entityType = entity.getType(); + if (hostileMobs.contains(entityType)) { + int amountGained = 1; + switch (entityType) { + case WITHER: + amountGained = 100; + break; + case ENDER_DRAGON: + amountGained = 200; + break; + default: + break; + } + UUID uuid = p.getUniqueId(); + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + int soulHarvestLevel = (int) pStatAll.get("global").get(9); + if (soulHarvestLevel > 0) { + int souls = (int) pStatAll.get("global").get(20); + pStatAll.get("global").set(20, souls + amountGained); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + } + } + } + + public void loseSouls(int amountLost) { + if (!runMethods) { + return; + } + UUID uuid = p.getUniqueId(); + PlayerStats pStatClass = new PlayerStats(p); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + int souls = (int) pStatAll.get("global").get(20); + pStatAll.get("global").set(20, souls - amountLost); + statAll.put(uuid, pStatAll); + pStatClass.setData(statAll); + } + + public void betterResurrectionDeath(List drops) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(8) > 0) { + ArrayList savedDrops = new ArrayList<>(); + ItemGroups itemGroups = new ItemGroups(); + List valuableItems = itemGroups.getValuableItems(); + for (ItemStack drop : drops) { + if (drop.getEnchantments().size() != 0 || valuableItems.contains(drop.getType())) { + double randomNum = rand.nextDouble(); + int initialAmount = drop.getAmount(); + if (0.5 < randomNum) { + if (initialAmount == 1) { + ItemStack dropCopy = drop.clone(); + savedDrops.add(dropCopy); + drop.setAmount(0); + } else if (initialAmount > 1) { + int savedAmount = (int) Math.round(initialAmount * randomNum); + ItemStack dropCopy = drop.clone(); + drop.setAmount(initialAmount - savedAmount); + dropCopy.setAmount(savedAmount); + savedDrops.add(dropCopy); + } + } + } + } + playerSavedDrops.put(p.getUniqueId(), savedDrops); + } + } + + public void betterResurrectionRespawn() { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(8) > 0 && playerSavedDrops.containsKey(p.getUniqueId())) { + ArrayList savedDrops = playerSavedDrops.get(p.getUniqueId()); + for (ItemStack savedDrop : savedDrops) { + p.getInventory().addItem(savedDrop); + } + playerSavedDrops.remove(p.getUniqueId()); + } + } + + public void avatar() { + if (!runMethods) { + return; + } + PotionEffectType[] positiveEffects0 = {PotionEffectType.DOLPHINS_GRACE, PotionEffectType.LUCK, + PotionEffectType.INVISIBILITY, PotionEffectType.NIGHT_VISION, + PotionEffectType.FIRE_RESISTANCE, PotionEffectType.WATER_BREATHING, PotionEffectType.SPEED, + PotionEffectType.JUMP, + PotionEffectType.ABSORPTION, PotionEffectType.CONDUIT_POWER, + PotionEffectType.DAMAGE_RESISTANCE, PotionEffectType.FAST_DIGGING, + PotionEffectType.HEAL, PotionEffectType.HEALTH_BOOST, PotionEffectType.INCREASE_DAMAGE, + PotionEffectType.REGENERATION, + PotionEffectType.SATURATION}; + List positiveEffects = Arrays.asList(positiveEffects0); + for (PotionEffectType effect : positiveEffects) { + p.addPotionEffect(new PotionEffect(effect, 10 * 20, 0)); + } + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Mining.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Mining.java new file mode 100644 index 0000000..8fe4722 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Mining.java @@ -0,0 +1,546 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.server.MinecraftVersion; +import mc.carlton.freerpg.core.info.server.PlacedBlocksManager; +import mc.carlton.freerpg.core.info.server.WorldGuardChecks; +import mc.carlton.freerpg.utils.game.TrackItem; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.entity.TNTPrimed; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.persistence.PersistentDataType; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; +import org.bukkit.util.Vector; + +public class Mining extends Skill { + + Random rand = new Random(); //Random class Import + ArrayList veinOres = new ArrayList(); + private String skillName = "mining"; + private boolean runMethods; + + public Mining(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + public void initiateAbility() { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.miningAbility")) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { + return; + } + Integer[] pTimers = timers.getPlayerCooldownTimes(); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[2] == -1) { + int cooldown = pTimers[2]; + if (cooldown < 1) { + int prepMessages = (int) pStatClass.getPlayerData().get("global") + .get(22); //Toggle for preparation messages + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("pickaxe") + + "...<<<"); + } + int taskID = new BukkitRunnable() { + @Override + public void run() { + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " + lang.getString( + "pickaxe") + "<<<"); + } + try { + abilities.setPlayerAbility(skillName, -1); + } catch (Exception e) { + + } + } + }.runTaskLater(plugin, 20 * 4).getTaskId(); + abilities.setPlayerAbility(skillName, taskID); + } else { + actionMessage.sendMessage( + ChatColor.RED + lang.getString("berserkPick") + " " + lang.getString("cooldown") + ": " + + ChatColor.WHITE + cooldown + ChatColor.RED + "s"); + } + } + } + + public void enableAbility() { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + actionMessage.sendMessage( + ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("berserkPick") + " " + + lang.getString("activated") + "<<<"); + int effLevel = itemInHand.getEnchantmentLevel(Enchantment.DIG_SPEED); + itemInHand.removeEnchantment(Enchantment.DIG_SPEED); + itemInHand.addUnsafeEnchantment(Enchantment.DIG_SPEED, effLevel + 5); + + //Mark the item + long unixTime = Instant.now().getEpochSecond(); + String keyName = + p.getUniqueId().toString() + "-frpg-" + skillName + "-" + String.valueOf(unixTime); + NamespacedKey key = new NamespacedKey(plugin, keyName); + ItemMeta itemMeta = itemInHand.getItemMeta(); + itemMeta.getPersistentDataContainer().set(key, PersistentDataType.STRING, "frpg-mining"); + itemInHand.setItemMeta(itemMeta); + + int durationLevel = (int) pStat.get(skillName).get(4); + double duration0 = Math.ceil(durationLevel * 0.4) + 40; + long duration = (long) duration0; + Bukkit.getScheduler().cancelTask(pAbilities[2]); + abilities.setPlayerAbility(skillName, -2); + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("berserkPick") + " " + lang.getString("readyToUse") + + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("berserkPick") + " " + + lang.getString("ended") + "<<<"; + timers.abilityDurationTimer(skillName, duration, endMessage, coolDownEndMessage, key, + itemInHand, effLevel, 0); + } + + public void tntExplode(Block blockLit) { + if (!runMethods) { + return; + } + WorldGuardChecks BuildingCheck = new WorldGuardChecks(); + Map> pStat = pStatClass.getPlayerData(); + blockLit.setType(Material.AIR); + World world = p.getWorld(); + TNTPrimed tnt = world.spawn(blockLit.getLocation().add(0, 0.25, 0), TNTPrimed.class); + int blastRadiusLevel = (int) pStat.get(skillName).get(10); + double power0 = 4 + blastRadiusLevel * 0.5; + float power = (float) power0; + tnt.setFuseTicks(41); + Bukkit.getScheduler().runTaskLater(plugin, new Runnable() { + @Override + public void run() { + Location tntLoc = tnt.getLocation(); + int x0 = tntLoc.getBlockX(); + int y0 = tntLoc.getBlockY(); + int z0 = tntLoc.getBlockZ(); + boolean causeExplosion = true; + outerLoop: + for (int x = -5; x < 6; x++) { + for (int y = -5; y < 6; y++) { + for (int z = -5; z < 6; z++) { + Location newLoc = new Location(world, x + x0, y + y0, z + z0); + boolean canExplode = BuildingCheck.canExplode(p, newLoc); + boolean canBuild = BuildingCheck.canBuild(p, newLoc); + if (!canBuild || !canExplode) { + causeExplosion = false; + break outerLoop; + } + } + } + } + + if (causeExplosion) { + Map location_block = new HashMap<>(); + Map location_blockType = new HashMap<>(); + Block center = world.getBlockAt(tntLoc); + for (int x = -2; x < 3; x++) { + for (int y = -2; y < 3; y++) { + for (int z = -2; z < 3; z++) { + location_block.put(new org.bukkit.util.Vector(x, y, z), + center.getRelative(x, y, z)); + location_blockType.put(new org.bukkit.util.Vector(x, y, z), + center.getRelative(x, y, z).getType()); + } + } + } + tnt.getWorld().createExplosion(tntLoc, power, false, true); + tnt.remove(); + //Check blocks around the tnt, see if they even will explode + Bukkit.getScheduler().runTaskLater(plugin, new Runnable() { + @Override + public void run() { + int changedBlocks = 0; + for (Vector vector : location_block.keySet()) { + if (location_block.get(vector).getType() != location_blockType.get(vector)) { + changedBlocks += 1; + } + } + if (changedBlocks > 3) { + increaseStats.changeEXP(skillName, expMap.get("explodeTNT")); + int passive3_mining = (int) pStat.get(skillName).get(6); + double explosionDrop = passive3_mining * 0.0001; + for (int i = 0; i < (int) Math.floor(changedBlocks / 2.0); i++) { + Mining miningClass = new Mining(p); + miningClass.miningTreasureDrop(explosionDrop, world, tntLoc); + } + } + } + }, 2L); + + } + } + }, 40L); + } + + public void miningTreasureDrop(double treasureChance, World world, Location loc) { + if (!runMethods) { + return; + } + double randomNum = rand.nextDouble(); + if (treasureChance > randomNum) { + double randomNum2 = rand.nextDouble(); + if (randomNum2 < 0.5) { + world.dropItemNaturally(loc, new ItemStack(Material.COAL, 1)); + increaseStats.changeEXP(skillName, expMap.get("breakCoal_Ore")); + } else if (randomNum2 < 0.7) { + world.dropItemNaturally(loc, new ItemStack(Material.IRON_ORE, 1)); + increaseStats.changeEXP(skillName, expMap.get("breakIron_Ore")); + } else if (randomNum2 < 0.8) { + world.dropItemNaturally(loc, new ItemStack(Material.GOLD_ORE, 1)); + increaseStats.changeEXP(skillName, expMap.get("breakGold_Ore")); + } else if (randomNum2 < 0.85) { + world.dropItemNaturally(loc, new ItemStack(Material.LAPIS_LAZULI, 1)); + increaseStats.changeEXP(skillName, expMap.get("breakLapis_Ore")); + } else if (randomNum2 < 0.90) { + world.dropItemNaturally(loc, new ItemStack(Material.EMERALD, 1)); + increaseStats.changeEXP(skillName, expMap.get("breakEmerald_Ore")); + } else if (randomNum2 < 0.99) { + world.dropItemNaturally(loc, new ItemStack(Material.REDSTONE, 1)); + increaseStats.changeEXP(skillName, expMap.get("breakRedstone_Ore")); + } else if (randomNum2 < 0.999) { + world.dropItemNaturally(loc, new ItemStack(Material.DIAMOND, 1)); + increaseStats.changeEXP(skillName, expMap.get("breakDiamond_Ore")); + } else { + MinecraftVersion minecraftVersion = new MinecraftVersion(); + if (minecraftVersion.getMinecraftVersionAsDouble() >= 1.16) { + world.dropItemNaturally(loc, new ItemStack(Material.NETHERITE_SCRAP, 1)); + increaseStats.changeEXP(skillName, expMap.get("breakAncient_Debris")); + } else { + world.dropItemNaturally(loc, new ItemStack(Material.DIAMOND, 1)); + increaseStats.changeEXP(skillName, expMap.get("breakDiamond_Ore")); + } + } + } + } + + public void wastelessHaste(Material blockType) { + if (!runMethods) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + List ores = itemGroups.getOres(); + if (!(ores.contains(blockType))) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int hasteSeconds = 0; + int wastelessHasteLevel = (int) pStat.get(skillName).get(7); + switch (wastelessHasteLevel) { + case 1: + hasteSeconds = 2; + break; + case 2: + hasteSeconds = 5; + break; + case 3: + case 4: + case 5: + hasteSeconds = 10; + break; + default: + break; + } + if (p.hasPotionEffect(PotionEffectType.FAST_DIGGING)) { + if (p.getPotionEffect(PotionEffectType.FAST_DIGGING).getDuration() > 20 * hasteSeconds + 20) { + return; + } + } + if (hasteSeconds > 1) { + switch (wastelessHasteLevel) { + case 4: //Half of haste is haste 2, second half is haste 1 + p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 10 * hasteSeconds, 1)); + int finalHasteSeconds = hasteSeconds; + new BukkitRunnable() { + @Override + public void run() { + if (p.isOnline()) { + p.addPotionEffect( + new PotionEffect(PotionEffectType.FAST_DIGGING, 10 * finalHasteSeconds, 0)); + } + } + }.runTaskLater(plugin, 10 * hasteSeconds + 2); + break; + case 5: //All of buff is haste 2 + p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 20 * hasteSeconds, 1)); + break; + default: //All of buff is haste 1 + p.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 20 * hasteSeconds, 0)); + break; + } + } + } + + public void miningDoubleDrop(Block block, World world) { + ItemGroups itemGroups = new ItemGroups(); + List ores = itemGroups.getOres(); + if (!(ores.contains(block.getType()))) { + return; + } + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + + int doubleDropLevel = (int) pStat.get(skillName).get(5); + double chance = 0.0005 * doubleDropLevel; + double randomNum = rand.nextDouble(); + if (chance > randomNum) { + for (ItemStack stack : block.getDrops(itemInHand)) { + dropItemNaturally(block.getLocation(), stack); + if ((int) pStat.get(skillName).get(13) > 0) { + dropItemNaturally(block.getLocation(), stack); + } + } + } + } + + public void preventLogoutTheft(int taskID_mining, ItemStack itemInHand_mining, NamespacedKey key, + boolean isDisabling) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[2] == -2) { + Bukkit.getScheduler().cancelTask(taskID_mining); + int effLevel = itemInHand_mining.getEnchantmentLevel(Enchantment.DIG_SPEED) - 5; + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("berserkPick") + " " + lang.getString( + "readyToUse") + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("magicForce"); + timers.endAbility(skillName, endMessage, coolDownEndMessage, key, itemInHand_mining, effLevel, + 0, isDisabling); + TrackItem trackItem = new TrackItem(); + trackItem.removeItemKey(itemInHand_mining, key); + } + } + + public void getVeinOres(Block b1, final int x1, final int y1, final int z1, Material oreType, + int maxSize) { + if (!runMethods) { + return; + } + WorldGuardChecks BuildingCheck = new WorldGuardChecks(); + int searchCubeSize = 7; + if (veinOres.size() >= maxSize) { + return; + } + for (int x = -1; x <= 1; + x++) { //These 3 for loops check a 3x3x3 cube around the block in question + for (int y = -1; y <= 1; y++) { + for (int z = -1; z <= 1; z++) { + if (x == 0 && y == 0 + && z == 0) { //We can skip the 0,0,0 case because that is the block in question + continue; + } + Block b2 = b1.getRelative(x, y, z); + int blockX = b2.getX(); + int blockY = b2.getY(); + int blockZ = b2.getZ(); + if (blockX == x1 && blockY == y1 + && blockZ == z1) { //Makes sure the original block is never added to veinOres + continue; + } + if (b2.getType().equals(oreType)) { + if (blockX > x1 + searchCubeSize || blockX < x1 - searchCubeSize + || blockY > y1 + searchCubeSize || blockY < y1 - searchCubeSize + || blockZ > z1 + searchCubeSize || blockZ < z1 - searchCubeSize) { + break; + } else if (!(veinOres.contains(b2))) { + if (veinOres.size() >= maxSize) { + return; + } + if (BuildingCheck.canBuild(p, b2.getLocation())) { + veinOres.add(b2); + this.getVeinOres(b2, x1, y1, z1, oreType, maxSize); + } + } + } + } + } + } + } + + public void vanillaVeinMiner(Block initialBlock) { + ConfigLoad configLoad = new ConfigLoad(); + int maxBreakSize = configLoad.getVeinMinerMaxBreakSize(); + getVeinOres(initialBlock, initialBlock.getX(), initialBlock.getY(), initialBlock.getZ(), + initialBlock.getType(), maxBreakSize); //Get Ores in Vein + int numOres = veinOres.size(); + World world = initialBlock.getWorld(); + damageTool(numOres, configLoad.getDurabilityModifiers().get("veinMiner")); + for (Block block : veinOres) { + Location blockLoc = block.getLocation(); + PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); + if (placedBlocksManager.isBlockTracked(block)) { + placedBlocksManager.removeBlock(block); + } + Collection drops = block.getDrops(itemInHand); + block.setType(Material.AIR); + for (ItemStack drop : drops) { + dropItemNaturally(blockLoc, drop); + } + } + + } + + public void veinMiner(Block initialBlock, Material blockType) { + if (!runMethods) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + HashSet veinMinerBlocks = itemGroups.getVeinMinerBlocks(); + if (!veinMinerBlocks.contains(blockType)) { + return; + } + World world = initialBlock.getWorld(); + Map> pStat = pStatClass.getPlayerData(); + int veinMinerLevel = (int) pStat.get(skillName).get(11); + if (veinMinerLevel < 1) { + return; + } + int veinMinerToggle = (int) pStat.get("global").get(18); + if (veinMinerToggle < 1) { + return; + } + HashSet ores = itemGroups.getVeinMinerBlocks(); + ConfigLoad configLoad = new ConfigLoad(); + int maxBreakSize = configLoad.getVeinMinerMaxBreakSize(); + veinOres.add(initialBlock); + getVeinOres(initialBlock, initialBlock.getX(), initialBlock.getY(), initialBlock.getZ(), + initialBlock.getType(), maxBreakSize); //Get Ores in Vein + int numOres = veinOres.size(); + int doubleDropsLevel = (int) pStat.get(skillName).get(5); + double chance = 0.0005 * doubleDropsLevel; + + damageTool(numOres, configLoad.getDurabilityModifiers().get("veinMiner")); + + boolean didRun = false; + Smelting smeltingClass = new Smelting(p); + for (Block block : veinOres) { + Location blockLoc = block.getLocation(); + //Checks if any of the blocks weren't natural + PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); + boolean natural = !placedBlocksManager.isBlockTracked(block); + if (!natural) { + placedBlocksManager.removeBlock(block); + numOres -= 1; + } + //Flame Pick Conditional + didRun = smeltingClass.flamePick(block, world, blockType, false); + //Not Flame Pick + if (!didRun && ores.contains(blockType)) { + Collection drops = block.getDrops(itemInHand); + block.setType(Material.AIR); + for (ItemStack drop : drops) { + dropItemNaturally(blockLoc, drop); + } + if (chance > rand.nextDouble() && natural) { + for (ItemStack drop : drops) { + dropItemNaturally(blockLoc, drop); + if ((int) pStat.get(skillName).get(13) > 0) { + dropItemNaturally(blockLoc, drop); + } + } + } + } + + } + //Give EXP + if (didRun) { + increaseStats.changeEXP(skillName, + numOres * smeltingClass.getEXP(itemGroups.getSmeltableItemsMap().get(blockType))); + } + increaseStats.changeEXP(skillName, getEXP(blockType) * numOres); + } + + public int getEXP(Material brokenOre) { + if (!runMethods) { + return 0; + } + MinecraftVersion minecraftVersion = new MinecraftVersion(); + int EXP = 0; + if (brokenOre.equals(Material.COAL_ORE)) { + EXP = expMap.get("breakCoal_Ore"); + } else if (brokenOre.equals(Material.NETHER_QUARTZ_ORE)) { + EXP = expMap.get("breakNether_Quartz_Ore"); + } else if (brokenOre.equals(Material.IRON_ORE)) { + EXP = expMap.get("breakIron_Ore"); + } else if (brokenOre.equals(Material.GOLD_ORE)) { + EXP = expMap.get("breakGold_Ore"); + } else if (brokenOre.equals(Material.EMERALD_ORE)) { + EXP = expMap.get("breakEmerald_Ore"); + } else if (brokenOre.equals(Material.REDSTONE_ORE)) { + EXP = expMap.get("breakRedstone_Ore"); + } else if (brokenOre.equals(Material.LAPIS_ORE)) { + EXP = expMap.get("breakLapis_Ore"); + } else if (brokenOre.equals(Material.DIAMOND_ORE)) { + EXP = expMap.get("breakDiamond_Ore"); + } else if (minecraftVersion.getMinecraftVersionAsDouble() >= 1.16) { + if (brokenOre.equals(Material.ANCIENT_DEBRIS)) { + EXP = expMap.get("breakAncient_Debris"); + } else if (brokenOre.equals(Material.GILDED_BLACKSTONE)) { + EXP = expMap.get("breakGilded_Blackstone"); + } else if (brokenOre.equals(Material.NETHER_GOLD_ORE)) { + EXP = expMap.get("breakNether_Gold_Ore"); + } + } else if (minecraftVersion.getMinecraftVersionAsDouble() >= 1.17) { + if (brokenOre.equals(Material.DEEPSLATE_COAL_ORE)) { + EXP = expMap.get("breakDeepslate_Coal_Ore"); + } else if (brokenOre.equals(Material.DEEPSLATE_COPPER_ORE)) { + EXP = expMap.get("breakDeepslate_Copper_Ore"); + } else if (brokenOre.equals(Material.DEEPSLATE_DIAMOND_ORE)) { + EXP = expMap.get("breakDeepslate_Diamond_Ore"); + } else if (brokenOre.equals(Material.DEEPSLATE_EMERALD_ORE)) { + EXP = expMap.get("breakDeepslate_Emerald_Ore"); + } else if (brokenOre.equals(Material.DEEPSLATE_GOLD_ORE)) { + EXP = expMap.get("breakDeepslate_Gold_Ore"); + } else if (brokenOre.equals(Material.DEEPSLATE_IRON_ORE)) { + EXP = expMap.get("breakDeepslate_Iron_Ore"); + } else if (brokenOre.equals(Material.DEEPSLATE_LAPIS_ORE)) { + EXP = expMap.get("breakDeepslate_Lapis_Ore"); + } else if (brokenOre.equals(Material.DEEPSLATE_REDSTONE_ORE)) { + EXP = expMap.get("breakDeepslate_Redstone_Ore"); + } + } + return EXP; + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Repair.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Repair.java new file mode 100644 index 0000000..ec578bb --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Repair.java @@ -0,0 +1,576 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.server.MinecraftVersion; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.ChatColor; +import org.bukkit.Effect; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.Damageable; +import org.bukkit.inventory.meta.EnchantmentStorageMeta; +import org.bukkit.inventory.meta.ItemMeta; + +public class Repair extends Skill { + + Random rand = new Random(); //Random class Import + private String skillName = "repair"; + private boolean runMethods; + + public Repair(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + + } + + public boolean repairItem() { + if (!runMethods) { + return false; + } + if (!p.hasPermission("freeRPG.canRepair")) { + return false; + } + if (!isItemVanilla(itemInHand)) { + ConfigLoad configLoad = new ConfigLoad(); + if (configLoad.isPreventUnsafeRepair()) { + LanguageSelector lang = new LanguageSelector(p); + p.sendMessage(ChatColor.RED + lang.getString("repairUnsafeEnchant")); + return false; + } + } + Material toolType = itemInHand.getType(); + boolean repaired = false; + boolean foundItem = true; + ItemGroups itemGroups = new ItemGroups(); + Map repairItems = itemGroups.getRepairItems(); + if (repairItems.containsKey(toolType)) { + Material mats = repairItems.get(itemInHand.getType()); + if (p.getInventory().contains(mats)) { + Map> pStat = pStatClass.getPlayerData(); + int repairLevel = (int) pStat.get(skillName).get(4); + int resourcefulLevel = (int) pStat.get(skillName).get(9); + double keepMatsChance = resourcefulLevel * 0.1; + double repairBonus = repairLevel * 0.002; + double repairPercentage = 0; + int expToGive = 0; + int expRepairMultiplier = 0; + repaired = true; + double a = 1.0; + MinecraftVersion minecraftVersion = new MinecraftVersion(); + double MCversion = minecraftVersion.getMinecraftVersionAsDouble(); + // TODO check if code in if statements can be extracted to separate methode + if (toolType.equals(Material.WOODEN_AXE)) { + repairPercentage = (0.9 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("wooden_baseEXP"); + expRepairMultiplier = expMap.get("wooden_EXPMultiplier"); + } else if (toolType.equals(Material.WOODEN_HOE)) { + repairPercentage = (0.9 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("wooden_baseEXP"); + expRepairMultiplier = expMap.get("wooden_EXPMultiplier"); + } else if (toolType.equals(Material.WOODEN_PICKAXE)) { + repairPercentage = (0.9 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("wooden_baseEXP"); + expRepairMultiplier = expMap.get("wooden_EXPMultiplier"); + } else if (toolType.equals(Material.WOODEN_SHOVEL)) { + repairPercentage = (0.9 + repairBonus) / 1.0; + a = 1.0; + expToGive += expMap.get("wooden_baseEXP"); + expRepairMultiplier = expMap.get("wooden_EXPMultiplier"); + } else if (toolType.equals(Material.WOODEN_SWORD)) { + repairPercentage = (0.9 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("wooden_baseEXP"); + expRepairMultiplier = expMap.get("wooden_EXPMultiplier"); + } else if (toolType.equals(Material.LEATHER_HELMET)) { + repairPercentage = (0.9 + repairBonus) / 5.0; + a = 5.0; + expToGive += expMap.get("leather_baseEXP"); + expRepairMultiplier = expMap.get("leather_EXPMultiplier"); + } else if (toolType.equals(Material.LEATHER_CHESTPLATE)) { + repairPercentage = (0.9 + repairBonus) / 8.0; + a = 8.0; + expToGive += expMap.get("leather_baseEXP"); + expRepairMultiplier = expMap.get("leather_EXPMultiplier"); + } else if (toolType.equals(Material.LEATHER_LEGGINGS)) { + repairPercentage = (0.9 + repairBonus) / 7.0; + a = 7.0; + expToGive += expMap.get("leather_baseEXP"); + expRepairMultiplier = expMap.get("leather_EXPMultiplier"); + } else if (toolType.equals(Material.LEATHER_BOOTS)) { + repairPercentage = (0.9 + repairBonus) / 4.0; + a = 4.0; + expToGive += expMap.get("leather_baseEXP"); + expRepairMultiplier = expMap.get("leather_EXPMultiplier"); + } else if (toolType.equals(Material.STONE_AXE)) { + repairPercentage = (0.8 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("stone_baseEXP"); + expRepairMultiplier = expMap.get("stone_EXPMultiplier"); + } else if (toolType.equals(Material.STONE_HOE)) { + repairPercentage = (0.8 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("stone_baseEXP"); + expRepairMultiplier = expMap.get("stone_EXPMultiplier"); + } else if (toolType.equals(Material.STONE_PICKAXE)) { + repairPercentage = (0.8 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("stone_baseEXP"); + expRepairMultiplier = expMap.get("stone_EXPMultiplier"); + } else if (toolType.equals(Material.STONE_SHOVEL)) { + repairPercentage = (0.8 + repairBonus) / 1.0; + a = 1.0; + expToGive += expMap.get("stone_baseEXP"); + expRepairMultiplier = expMap.get("stone_EXPMultiplier"); + } else if (toolType.equals(Material.STONE_SWORD)) { + repairPercentage = (0.8 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("stone_baseEXP"); + expRepairMultiplier = expMap.get("stone_EXPMultiplier"); + } else if (toolType.equals(Material.CHAINMAIL_HELMET)) { + repairPercentage = (0.11 + repairBonus) / 5.0; + a = 5.0; + expToGive += expMap.get("chainmail_baseEXP"); + expRepairMultiplier = expMap.get("chainmail_EXPMultiplier"); + } else if (toolType.equals(Material.CHAINMAIL_CHESTPLATE)) { + repairPercentage = (0.11 + repairBonus) / 8.0; + a = 8.0; + expToGive += expMap.get("chainmail_baseEXP"); + expRepairMultiplier = expMap.get("chainmail_EXPMultiplier"); + } else if (toolType.equals(Material.CHAINMAIL_LEGGINGS)) { + repairPercentage = (0.11 + repairBonus) / 11.0; + a = 11.0; + expToGive += expMap.get("chainmail_baseEXP"); + expRepairMultiplier = expMap.get("chainmail_EXPMultiplier"); + } else if (toolType.equals(Material.CHAINMAIL_BOOTS)) { + repairPercentage = (0.11 + repairBonus) / 4.0; + a = 4.0; + expToGive += expMap.get("chainmail_baseEXP"); + expRepairMultiplier = expMap.get("chainmail_EXPMultiplier"); + } else if (toolType.equals(Material.GOLDEN_AXE)) { + repairPercentage = (0.7 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("gold_baseEXP"); + expRepairMultiplier = expMap.get("gold_EXPMultiplier"); + } else if (toolType.equals(Material.GOLDEN_HOE)) { + repairPercentage = (0.7 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("gold_baseEXP"); + expRepairMultiplier = expMap.get("gold_EXPMultiplier"); + } else if (toolType.equals(Material.GOLDEN_PICKAXE)) { + repairPercentage = (0.7 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("gold_baseEXP"); + expRepairMultiplier = expMap.get("gold_EXPMultiplier"); + } else if (toolType.equals(Material.GOLDEN_SHOVEL)) { + repairPercentage = (0.7 + repairBonus) / 1.0; + a = 1.0; + expToGive += expMap.get("gold_baseEXP"); + expRepairMultiplier = expMap.get("gold_EXPMultiplier"); + } else if (toolType.equals(Material.GOLDEN_SWORD)) { + repairPercentage = (0.7 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("gold_baseEXP"); + expRepairMultiplier = expMap.get("gold_EXPMultiplier"); + } else if (toolType.equals(Material.GOLDEN_HELMET)) { + repairPercentage = (0.7 + repairBonus) / 5.0; + a = 5.0; + expToGive += expMap.get("gold_baseEXP"); + expRepairMultiplier = expMap.get("gold_EXPMultiplier"); + } else if (toolType.equals(Material.GOLDEN_CHESTPLATE)) { + repairPercentage = (0.7 + repairBonus) / 8.0; + a = 8.0; + expToGive += expMap.get("gold_baseEXP"); + expRepairMultiplier = expMap.get("gold_EXPMultiplier"); + } else if (toolType.equals(Material.GOLDEN_LEGGINGS)) { + repairPercentage = (0.7 + repairBonus) / 7.0; + a = 7.0; + expToGive += expMap.get("gold_baseEXP"); + expRepairMultiplier = expMap.get("gold_EXPMultiplier"); + } else if (toolType.equals(Material.GOLDEN_BOOTS)) { + repairPercentage = (0.7 + repairBonus) / 4.0; + a = 4.0; + expToGive += expMap.get("gold_baseEXP"); + expRepairMultiplier = expMap.get("gold_EXPMultiplier"); + } else if (toolType.equals(Material.IRON_AXE)) { + repairPercentage = (0.5 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("iron_baseEXP"); + expRepairMultiplier = expMap.get("iron_EXPMultiplier"); + } else if (toolType.equals(Material.IRON_HOE)) { + repairPercentage = (0.5 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("iron_baseEXP"); + expRepairMultiplier = expMap.get("iron_EXPMultiplier"); + } else if (toolType.equals(Material.IRON_PICKAXE)) { + repairPercentage = (0.5 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("iron_baseEXP"); + expRepairMultiplier = expMap.get("iron_EXPMultiplier"); + } else if (toolType.equals(Material.IRON_SHOVEL)) { + repairPercentage = (0.5 + repairBonus) / 1.0; + a = 1.0; + expToGive += expMap.get("iron_baseEXP"); + expRepairMultiplier = expMap.get("iron_EXPMultiplier"); + } else if (toolType.equals(Material.IRON_SWORD)) { + repairPercentage = (0.5 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("iron_baseEXP"); + expRepairMultiplier = expMap.get("iron_EXPMultiplier"); + } else if (toolType.equals(Material.IRON_HELMET)) { + repairPercentage = (0.5 + repairBonus) / 5.0; + a = 5.0; + expToGive += expMap.get("iron_baseEXP"); + expRepairMultiplier = expMap.get("iron_EXPMultiplier"); + } else if (toolType.equals(Material.IRON_CHESTPLATE)) { + repairPercentage = (0.5 + repairBonus) / 8.0; + a = 8.0; + expToGive += expMap.get("iron_baseEXP"); + expRepairMultiplier = expMap.get("iron_EXPMultiplier"); + } else if (toolType.equals(Material.IRON_LEGGINGS)) { + repairPercentage = (0.5 + repairBonus) / 7.0; + a = 7.0; + expToGive += expMap.get("iron_baseEXP"); + expRepairMultiplier = expMap.get("iron_EXPMultiplier"); + } else if (toolType.equals(Material.IRON_BOOTS)) { + repairPercentage = (0.5 + repairBonus) / 4.0; + a = 4.0; + expToGive += expMap.get("iron_baseEXP"); + expRepairMultiplier = expMap.get("iron_EXPMultiplier"); + } else if (toolType.equals(Material.DIAMOND_AXE)) { + repairPercentage = (0.00 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("diamond_baseEXP"); + expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); + } else if (toolType.equals(Material.DIAMOND_HOE)) { + repairPercentage = (0.00 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("diamond_baseEXP"); + expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); + } else if (toolType.equals(Material.DIAMOND_PICKAXE)) { + repairPercentage = (0.00 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("diamond_baseEXP"); + expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); + } else if (toolType.equals(Material.DIAMOND_SHOVEL)) { + repairPercentage = (0.00 + repairBonus) / 1.0; + a = 1.0; + expToGive += expMap.get("diamond_baseEXP"); + expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); + } else if (toolType.equals(Material.DIAMOND_SWORD)) { + repairPercentage = (0.00 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("diamond_baseEXP"); + expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); + } else if (toolType.equals(Material.DIAMOND_HELMET)) { + repairPercentage = (0.00 + repairBonus) / 5.0; + a = 5.0; + expToGive += expMap.get("diamond_baseEXP"); + expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); + } else if (toolType.equals(Material.DIAMOND_CHESTPLATE)) { + repairPercentage = (0.00 + repairBonus) / 8.0; + a = 8.0; + expToGive += expMap.get("diamond_baseEXP"); + expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); + } else if (toolType.equals(Material.DIAMOND_LEGGINGS)) { + repairPercentage = (0.00 + repairBonus) / 7.0; + a = 7.0; + expToGive += expMap.get("diamond_baseEXP"); + expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); + } else if (toolType.equals(Material.DIAMOND_BOOTS)) { + repairPercentage = (0.0 + repairBonus) / 4.0; + a = 4.0; + expToGive += expMap.get("diamond_baseEXP"); + expRepairMultiplier = expMap.get("diamond_EXPMultiplier"); + } else if (toolType.equals(Material.SHEARS)) { + repairPercentage = (0.5 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("shears_baseEXP"); + expRepairMultiplier = expMap.get("shear_expMultiplier"); + } else if (toolType.equals(Material.FISHING_ROD)) { + repairPercentage = (0.5 + repairBonus) / 2.0; + a = 2.0; + expToGive += expMap.get("fishingRod_baseEXP"); + expRepairMultiplier = expMap.get("fishingRod_expMultiplier"); + } else if (toolType.equals(Material.CARROT_ON_A_STICK)) { + repairPercentage = (0.8 + repairBonus) / 1.0; + a = 1.0; + expToGive += expMap.get("carrotOnAStick_baseEXP"); + expRepairMultiplier = expMap.get("carrotOnAStick_expMultiplier"); + } else if (toolType.equals(Material.FLINT_AND_STEEL)) { + repairPercentage = (0.8 + repairBonus) / 1.0; + a = 1.0; + expToGive += expMap.get("flintAndSteel_baseEXP"); + expRepairMultiplier = expMap.get("flintAndSteel_expMultiplier"); + } else if (toolType.equals(Material.BOW)) { + repairPercentage = (0.8 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("bow_baseEXP"); + expRepairMultiplier = expMap.get("bow_expMultiplier"); + } else if (toolType.equals(Material.TRIDENT)) { + repairPercentage = (0.8 + repairBonus) / 3.0; + a = 1.0; + expToGive += expMap.get("trident_baseEXP"); + expRepairMultiplier = expMap.get("trident_expMultiplier"); + } else if (toolType.equals(Material.ELYTRA)) { + repairPercentage = (0.8 + repairBonus) / 3.0; + a = 1.0; + expToGive += expMap.get("elytra_baseEXP"); + expRepairMultiplier = expMap.get("elytra_expMultiplier"); + } else if (toolType.equals(Material.SHIELD)) { + repairPercentage = (0.8 + repairBonus) / 3.0; + a = 1.0; + expToGive += expMap.get("shield_baseEXP"); + expRepairMultiplier = expMap.get("shield_expMultiplier"); + } else if (toolType.equals(Material.CROSSBOW)) { + repairPercentage = (0.8 + repairBonus) / 3.0; + a = 3.0; + expToGive += expMap.get("crossbow_baseEXP"); + expRepairMultiplier = expMap.get("crossbow_expMultiplier"); + } else if (MCversion >= 1.16) { + if (toolType.equals(Material.NETHERITE_AXE)) { + repairPercentage = (0.00 + repairBonus * 0.5) / 3.0; + a = 4.0; + expToGive += expMap.get("netherite_baseEXP"); + expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); + } else if (toolType.equals(Material.NETHERITE_HOE)) { + repairPercentage = (0.00 + repairBonus * 0.5) / 2.0; + a = 4.0; + expToGive += expMap.get("netherite_baseEXP"); + expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); + } else if (toolType.equals(Material.NETHERITE_PICKAXE)) { + repairPercentage = (0.00 + repairBonus * 0.5) / 3.0; + a = 4.0; + expToGive += expMap.get("netherite_baseEXP"); + expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); + } else if (toolType.equals(Material.NETHERITE_SHOVEL)) { + repairPercentage = (0.00 + repairBonus * 0.5) / 1.0; + a = 4.0; + expToGive += expMap.get("netherite_baseEXP"); + expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); + } else if (toolType.equals(Material.NETHERITE_SWORD)) { + repairPercentage = (0.00 + repairBonus * 0.5) / 2.0; + a = 4.0; + expToGive += expMap.get("netherite_baseEXP"); + expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); + } else if (toolType.equals(Material.NETHERITE_HELMET)) { + repairPercentage = (0.00 + repairBonus * 0.5) / 5.0; + a = 4.0; + expToGive += expMap.get("netherite_baseEXP"); + expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); + } else if (toolType.equals(Material.NETHERITE_CHESTPLATE)) { + repairPercentage = (0.00 + repairBonus * 0.5) / 8.0; + a = 4.0; + expToGive += expMap.get("netherite_baseEXP"); + expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); + } else if (toolType.equals(Material.NETHERITE_LEGGINGS)) { + repairPercentage = (0.00 + repairBonus * 0.5) / 7.0; + a = 4.0; + expToGive += expMap.get("netherite_baseEXP"); + expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); + } else if (toolType.equals(Material.NETHERITE_BOOTS)) { + repairPercentage = (0.0 + repairBonus * 0.5) / 4.0; + a = 4.0; + expToGive += expMap.get("netherite_baseEXP"); + expRepairMultiplier = expMap.get("netherite_EXPMultiplier"); + } + } + ItemMeta itemInHandMeta = itemInHand.getItemMeta(); + if (repairPercentage * a < 0.2) { + actionMessage.sendMessage(ChatColor.RED + lang.getString("repairFail0")); + repaired = false; + } else { + if (itemInHandMeta instanceof Damageable) { + int currentDamage = ((Damageable) itemInHandMeta).getDamage(); + if (currentDamage == 0) { + return false; + } + int mats_index = p.getInventory().first(mats); + int mats_amount = p.getInventory().getItem(mats_index).getAmount(); + if (keepMatsChance < rand.nextDouble()) { + p.getInventory().getItem(mats_index).setAmount(mats_amount - 1); + } + int maxDamage = itemInHand.getType().getMaxDurability(); + int repairedDamage = (int) Math.round(maxDamage * repairPercentage); + int expDamage = (int) a * Math.min(repairedDamage, currentDamage); + ((Damageable) itemInHandMeta).setDamage(Math.max(0, currentDamage - repairedDamage)); + itemInHand.setItemMeta(itemInHandMeta); + int enchantEXP = magicRepair(); + increaseStats.changeEXP(skillName, + enchantEXP + expToGive + (expRepairMultiplier * expDamage)); + p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE, 1); + } + } + } + } + return repaired; + } + + public void salvaging() { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.canSalvage")) { + return; + } + if (!isItemVanilla(itemInHand)) { + ConfigLoad configLoad = new ConfigLoad(); + if (configLoad.isPreventUnsafeSalvage()) { + LanguageSelector lang = new LanguageSelector(p); + p.sendMessage(ChatColor.RED + lang.getString("salvageUnsafeEnchant")); + return; + } + } + Map> pStat = pStatClass.getPlayerData(); + int salvageLevel = (int) pStat.get(skillName).get(7); + ItemGroups itemGroups = new ItemGroups(); + Map repairItemsAmount = itemGroups.getRepairItemsAmount(); + if (repairItemsAmount.containsKey(itemInHand.getType())) { + p.getWorld().playEffect(p.getLocation(), Effect.ANVIL_USE, 1); + ItemMeta itemInHandMeta = itemInHand.getItemMeta(); + Material itemType = itemInHand.getType(); + int amount = repairItemsAmount.get(itemType); + Map repairItems = itemGroups.getRepairItems(); + Material type = repairItems.get(itemType); + p.getInventory().getItemInMainHand().setAmount(0); + double multiplier = 0.1 * salvageLevel + (1 - 0.1 * salvageLevel) * rand.nextDouble(); + double currentDamage = ((Damageable) itemInHandMeta).getDamage(); + double maxDamage = itemType.getMaxDurability(); + double percentDurability = (1 - (currentDamage / maxDamage)); + MinecraftVersion minecraftVersion = new MinecraftVersion(); + double mcVersion = minecraftVersion.getMinecraftVersionAsDouble(); + + double amountToReturn_pre = amount * percentDurability * multiplier; + double roundUpChance = (amountToReturn_pre - Math.floor(amountToReturn_pre)); + int amountToReturn = (int) Math.floor(amountToReturn_pre); + if (roundUpChance + > rand.nextDouble()) { //Round up if a random number is bigger than the excess + amountToReturn += 1; + } + if (amountToReturn == 0) { + if (amountToReturn_pre > rand.nextDouble()) { + p.getInventory().addItem(new ItemStack(type, 1)); + } else { + actionMessage.sendMessage(ChatColor.RED + lang.getString("repairFail1")); + } + } else { + if (!type.equals(Material.NETHERITE_SCRAP)) { + p.getInventory().addItem(new ItemStack(type, amountToReturn)); + } else { + double multiplier1 = 0.1 * salvageLevel + (1 - 0.1 * salvageLevel) * rand.nextDouble(); + double multiplier2 = 0.1 * salvageLevel + (1 - 0.1 * salvageLevel) * rand.nextDouble(); + double amountToReturnGold_pre = 4 * percentDurability * multiplier1; + int amountToReturnGold = (int) Math.round(amountToReturnGold_pre); + double amountToReturnScrap_pre = 4 * percentDurability * multiplier2; + int amountToReturnScrap = (int) Math.round(amountToReturnScrap_pre); + p.getInventory().addItem(new ItemStack(Material.DIAMOND, amountToReturn)); + if (p.getInventory().firstEmpty() == -1) { + World world = p.getWorld(); + world.dropItemNaturally(p.getLocation().add(0, 0.5, 0), + new ItemStack(Material.GOLD_INGOT, amountToReturnGold)); + world.dropItemNaturally(p.getLocation().add(0, 0.5, 0), + new ItemStack(Material.NETHERITE_SCRAP, amountToReturnScrap)); + } else { + p.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, amountToReturnGold)); + if (p.getInventory().firstEmpty() == -1) { + World world = p.getWorld(); + world.dropItemNaturally(p.getLocation().add(0, 0.5, 0), + new ItemStack(Material.NETHERITE_SCRAP, amountToReturnScrap)); + } else { + p.getInventory() + .addItem(new ItemStack(Material.NETHERITE_SCRAP, amountToReturnScrap)); + } + } + } + } + if (salvageLevel >= 5) { + if (itemInHandMeta.hasEnchants()) { + ItemStack enchantedBook = new ItemStack(Material.ENCHANTED_BOOK, 1); + EnchantmentStorageMeta meta = ((EnchantmentStorageMeta) enchantedBook.getItemMeta()); + Map enchants = itemInHandMeta.getEnchants(); + for (Enchantment enchant : enchants.keySet()) { + meta.addStoredEnchant(enchant, enchants.get(enchant), true); + } + enchantedBook.setItemMeta(meta); + if (p.getInventory().firstEmpty() == -1) { + World world = p.getWorld(); + world.dropItemNaturally(p.getLocation().add(0, 0.5, 0), enchantedBook); + } else { + p.getInventory().addItem(enchantedBook); + } + } + } + if (type.equals(Material.STICK)) { + increaseStats.changeEXP(skillName, expMap.get("salvageStick")); + } else if (type.equals(Material.LEATHER)) { + increaseStats.changeEXP(skillName, expMap.get("salvageLeather")); + } else if (type.equals(Material.COBBLESTONE)) { + increaseStats.changeEXP(skillName, expMap.get("salvageCobblestone")); + } else if (type.equals(Material.IRON_INGOT)) { + increaseStats.changeEXP(skillName, expMap.get("salvageIron_Ingot")); + } else if (type.equals(Material.GOLD_INGOT)) { + increaseStats.changeEXP(skillName, expMap.get("salvageGold_Ingot")); + } else if (type.equals(Material.STRING)) { + increaseStats.changeEXP(skillName, expMap.get("salvageString")); + } else if (type.equals(Material.PHANTOM_MEMBRANE)) { + increaseStats.changeEXP(skillName, expMap.get("salvagePhantom_Membrane")); + } else if (type.equals(Material.DIAMOND)) { + increaseStats.changeEXP(skillName, expMap.get("salvageDiamond")); + } else if (mcVersion >= 1.16) { + if (type.equals(Material.NETHERITE_SCRAP)) { + increaseStats.changeEXP(skillName, expMap.get("salvageNetherite_Ingot")); + } + } + } + } + + public int magicRepair() { + if (!runMethods) { + return 0; + } + if (itemInHand.getEnchantments().size() == 0) { + return 0; + } + Map> pStat = pStatClass.getPlayerData(); + double sucessChance = 0; + if ((int) pStat.get(skillName).get(13) > 0) { + sucessChance = 1; + } + if (sucessChance < rand.nextDouble()) { + actionMessage.sendMessage(ChatColor.RED + lang.getString("repairFail2")); + Map enchantments = itemInHand.getEnchantments(); + for (Enchantment enchantment : enchantments.keySet()) { + int level = enchantments.get(enchantment); + itemInHand.removeEnchantment(enchantment); + if (level > 1) { + itemInHand.addEnchantment(enchantment, level - 1); + } + } + } else { + return 1000; + } + return 0; + } + + public boolean isItemVanilla(ItemStack itemStack) { + ItemMeta itemMeta = itemStack.getItemMeta(); + Map itemEnchants = itemMeta.getEnchants(); + try {//Try to create a safe item with those enchants, if it fails, we know the item is not vanilla + new ItemStack(itemStack.getType(), itemStack.getAmount()).addEnchantments(itemEnchants); + } catch (IllegalArgumentException e) { + return false; + } + return true; + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Skill.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Skill.java new file mode 100644 index 0000000..15578be --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Skill.java @@ -0,0 +1,121 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.core.info.player.AbilityTimers; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.utils.game.ActionBarMessages; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import org.bukkit.Effect; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.Damageable; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.plugin.Plugin; + + +public class Skill { + + protected Player p; + protected String pName; + protected ItemStack itemInHand; + Plugin plugin; + Map expMap; + ChangeStats increaseStats; //Changing Stats + + AbilityTracker abilities; //Abilities class + // GET ABILITY STATUSES LIKE THIS: Integer[] pAbilities = abilities.getPlayerAbilities(p); + + AbilityTimers timers; //Ability Timers class + //GET TIMERS LIKE THIS: Integer[] pTimers = timers.getPlayerTimers(p); + + PlayerStats pStatClass; + //GET PLAYER STATS LIKE THIS: Map> pStat = pStatClass.getPlayerData(p); + + ActionBarMessages actionMessage; + LanguageSelector lang; + + + public Skill(Player p) { + this.p = p; + this.pName = p.getDisplayName(); + this.itemInHand = p.getInventory().getItemInMainHand(); + this.increaseStats = new ChangeStats(p); + this.abilities = new AbilityTracker(p); + this.timers = new AbilityTimers(p); + this.pStatClass = new PlayerStats(p); + this.actionMessage = new ActionBarMessages(p); + this.lang = new LanguageSelector(p); + this.plugin = FreeRPG.getPlugin(FreeRPG.class); + } + + public void dropItemNaturally(Location location, + ItemStack item) { //Won't try to drop air, like world.dropItemNaturally does + if (item != null) { + if (!item.getType().equals(Material.AIR) && !item.getType().equals(Material.CAVE_AIR) + && !item.getType().equals(Material.VOID_AIR)) { + World world = location.getWorld(); + world.dropItemNaturally(location, item); + } + } + } + + public void damageTool() { //Overspecified because I'm lazy + damageTool(1, 1.0); + } + + public void damageTool(double modifier) { + damageTool(1, modifier); + } + + public void damageTool(int damage, double modifier) { + if (itemInHand.getItemMeta().isUnbreakable()) { + return; + } + ItemMeta toolMeta = itemInHand.getItemMeta(); + + //Unnbreaking checks + int unbreakingLevel = 0; + if (toolMeta.hasEnchant(Enchantment.DURABILITY)) { + unbreakingLevel = toolMeta.getEnchantLevel(Enchantment.DURABILITY); + } + if (unbreakingLevel > 0) { + double chanceToSaveDurability = 1.0 - (1.0 / (unbreakingLevel + 1)); + for (int i = 0; i < damage; i++) { //Roll an unbreaking check for each damage point dealt + Random rand = new Random(); + if (rand.nextDouble() < chanceToSaveDurability) { //Reduce damage dealt + damage = damage - 1; + } + } + } + + //Damage Modifier + if (modifier + != 1.0) { //Randomly sets damage so the expected value of the durability taken = damage*modifier + double damageDouble = damage * modifier; + damage = (int) Math.floor(damageDouble); //Round damage down + double excessDamage = damageDouble - damage; + Random rand = new Random(); + if (rand.nextDouble() + < excessDamage) { //Round up if a random number is less than the excessDamage + damage += 1; + } + } + + if (toolMeta instanceof Damageable) { + ((Damageable) toolMeta).setDamage(((Damageable) toolMeta).getDamage() + damage); + itemInHand.setItemMeta(toolMeta); + if (((Damageable) toolMeta).getDamage() > itemInHand.getType().getMaxDurability()) { + itemInHand.setAmount(0); + p.getWorld().playEffect(p.getLocation(), Effect.STEP_SOUND, 1); + } + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Smelting.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Smelting.java new file mode 100644 index 0000000..996d5d6 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Smelting.java @@ -0,0 +1,378 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.server.MinecraftVersion; +import mc.carlton.freerpg.utils.game.FurnaceUserTracker; +import mc.carlton.freerpg.utils.globalVariables.ExpMaps; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.apache.logging.log4j.Level; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.Particle; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.block.Furnace; +import org.bukkit.entity.ExperienceOrb; +import org.bukkit.entity.Player; +import org.bukkit.inventory.FurnaceInventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.scheduler.BukkitRunnable; + +public class Smelting extends Skill { + + Random rand = new Random(); //Random class Import + private String skillName = "smelting"; + private boolean runMethods; + + public Smelting(Player p) { + super(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + public void speedUpFurnace(Furnace furnace, boolean isBlastFurnace) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int fastFuelLevel = (int) pStat.get(skillName).get(4); + int doubleSmeltLevel = (int) pStat.get(skillName).get(9); + boolean doubleSmelt = false; + if (doubleSmeltLevel * 0.05 > rand.nextDouble()) { + doubleSmelt = true; + } + double defaultCookTime = 200.0; + if (isBlastFurnace) { + defaultCookTime = 100.0; + } + double speedUpFactor = 1 + fastFuelLevel * 0.002; + + World world = furnace.getWorld(); + Location furnaceLoc = furnace.getLocation(); + Material smeltingMaterial = furnace.getInventory().getSmelting().getType(); + double finalDefaultCookTime = defaultCookTime; + boolean finalDoubleSmelt = doubleSmelt; + + int waitTicks = 1; + FurnaceUserTracker furnaceUserTracker = new FurnaceUserTracker(); + if (furnaceUserTracker.getWaitingOnTask(furnaceLoc)) { + waitTicks = 2; + } + furnaceUserTracker.setWaitingOnTaskMap(true, furnaceLoc); + + //Stat Increase + ItemGroups itemGroups = new ItemGroups(); + Map smeltingMap = itemGroups.getSmeltableItemsMap(); + if (smeltingMap.containsKey(smeltingMaterial)) { + increaseStats.changeEXP(skillName, getEXP(smeltingMap.get(smeltingMaterial))); + } else { + increaseStats.changeEXP(skillName, expMap.get("smeltAnythingElse")); + } + + new BukkitRunnable() { + @Override + public void run() { + if (checkIfBlockIsFurnace(world, furnaceLoc)) { + Furnace FurnaceOneTickLater = (Furnace) world.getBlockAt(furnaceLoc).getState(); + FurnaceInventory furnaceInventory = FurnaceOneTickLater.getSnapshotInventory(); + FurnaceOneTickLater.setCookTimeTotal( + (int) Math.round(finalDefaultCookTime / speedUpFactor)); + if (furnaceInventory.getResult() != null) { + ItemStack result = furnaceInventory.getResult(); + if (finalDoubleSmelt) { + int resultAmount = result.getAmount(); + result.setAmount(Math.min(64, resultAmount + 1)); + } + furnaceInventory.setResult(result); + } + FurnaceOneTickLater.update(); + } + furnaceUserTracker.removeWaitingOnTaskMap(furnaceLoc); + } + }.runTaskLater(plugin, waitTicks); + + + } + + public void printContents(ItemStack[] contents) { + ArrayList newContents = new ArrayList<>(Arrays.asList(contents)); + FreeRPG.log(Level.INFO, String.valueOf(newContents)); + } + + public boolean checkIfBlockIsFurnace(World world, Location location) { + Block block = world.getBlockAt(location); + if (block.getState() instanceof Furnace) { + return true; + } else { + return false; + } + } + + public void fuelBurn(Furnace furnace, boolean isBlastFurnace) { + if (!runMethods) { + return; + } + World world = furnace.getWorld(); + Map> pStat = pStatClass.getPlayerData(); + int fastFuelLevel = (int) pStat.get(skillName).get(4); + int fuelEfficiencyLevel = (int) pStat.get(skillName).get(7); + double defaultCookTime = 200.0; + if (isBlastFurnace) { + defaultCookTime = 100.0; + } + double speedUpFactor = 1 + fastFuelLevel * 0.002; + double burnLengthMultiplier = 1 + fuelEfficiencyLevel * 0.2; + Location furnaceLoc = furnace.getLocation(); + int cookTimeTotal = (int) Math.floor(defaultCookTime / speedUpFactor); + int cookTimeSoFar = (int) furnace.getCookTime(); + int newCookTime = Math.min(cookTimeSoFar, cookTimeTotal - 1); + + //Set furnace data + furnace.setCookTimeTotal(cookTimeTotal); + furnace.setCookTime((short) newCookTime); + ItemStack fuel = furnace.getSnapshotInventory().getFuel(); + fuel.setAmount(fuel.getAmount() - 1); + furnace.getSnapshotInventory().setFuel(fuel); + furnace.update(); + + int waitTicks = 1; + FurnaceUserTracker furnaceUserTracker = new FurnaceUserTracker(); + if (furnaceUserTracker.getWaitingOnTask(furnaceLoc)) { + waitTicks = 2; + } + furnaceUserTracker.setWaitingOnTaskMap(true, furnaceLoc); + + new BukkitRunnable() { + @Override + public void run() { + if (checkIfBlockIsFurnace(world, furnaceLoc)) { + Furnace runningFurnace = (Furnace) world.getBlockAt(furnaceLoc).getState(); + double defaultBurnTime = runningFurnace.getBurnTime(); + runningFurnace.setBurnTime( + (short) Math.ceil(3 + (burnLengthMultiplier * defaultBurnTime / speedUpFactor))); + runningFurnace.update(); + furnaceUserTracker.removeWaitingOnTaskMap(furnaceLoc); + } + } + }.runTaskLater(plugin, waitTicks); + } + + public boolean flamePick(Block block, World world, Material blockType, boolean giveEXP) { + if (!runMethods) { + return false; + } + ExpMaps expMaps = new ExpMaps(); + if (!expMaps.getFlamePickEXP().containsKey(blockType)) { + return false; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(13) < 1 || (int) pStat.get("smelting").get(13) < 1) { + return false; + } + ItemGroups itemGroups = new ItemGroups(); + int doubleDropLevel = (int) pStat.get("mining").get(5); + int doubleDropWoodcuttingLevel = (int) pStat.get("woodcutting").get(5); + int doubleSmeltLevel = (int) pStat.get(skillName).get(9); + double chanceDoubleOreDrop = 0.0005 * doubleDropLevel; + double chanceDoubleSmelt = doubleSmeltLevel * 0.05; + double chanceDoubleLogDrop = 0.0005 * doubleDropWoodcuttingLevel; + int dropAmount = 1; + if (chanceDoubleSmelt > rand.nextDouble()) { + dropAmount *= 2; + } + world.spawnParticle(Particle.FLAME, block.getLocation(), 5); + block.setType(Material.AIR); + ConfigLoad configLoad = new ConfigLoad(); + damageTool(configLoad.getDurabilityModifiers().get("flamePick")); + if (giveEXP) { + increaseStats.changeEXP(skillName, getEXP(blockType)); + } + dropXP(itemGroups.getSmeltingXPMap().get(blockType), block.getLocation()); + if (itemGroups.getOres().contains(blockType)) { + if (chanceDoubleOreDrop > rand.nextDouble()) { + if ((int) pStat.get("mining").get(13) > 0) { + dropAmount *= 3; + } else { + dropAmount *= 2; + } + } + } else if (itemGroups.getAllLogs().contains(blockType)) { + if (chanceDoubleLogDrop > rand.nextDouble()) { + dropAmount *= 2; + } + } + for (int i = 0; i < dropAmount; i++) { + if (chanceDoubleSmelt > rand.nextDouble()) { + dropAmount += 1; + } + } + world.dropItemNaturally(block.getLocation(), + new ItemStack(itemGroups.getSmeltableItemsMap().get(blockType), dropAmount)); + return true; + + } + + public void dropXP(double avgEXP, Location loc) { + ConfigLoad configLoad = new ConfigLoad(); + if (!configLoad.isFlamePickGiveXP()) { + return; + } + World world = loc.getWorld(); + int minXPDrop = (int) Math.floor(avgEXP); + double chanceToRoundUp = avgEXP - minXPDrop; + if (chanceToRoundUp > rand.nextDouble()) { + ((ExperienceOrb) world.spawn(loc, ExperienceOrb.class)).setExperience(minXPDrop + 1); + } else { + ((ExperienceOrb) world.spawn(loc, ExperienceOrb.class)).setExperience(minXPDrop); + } + } + + public int getEXP(Material smeltedMaterial) { + if (!runMethods) { + return 0; + } + int EXP = 0; + switch (smeltedMaterial) { + case COOKED_BEEF: + EXP = expMap.get("smeltBeef"); + break; + case COOKED_CHICKEN: + EXP = expMap.get("smeltChicken"); + break; + case COOKED_MUTTON: + EXP = expMap.get("smeltMutton"); + break; + case COOKED_RABBIT: + EXP = expMap.get("smeltRabbit"); + break; + case COOKED_PORKCHOP: + EXP = expMap.get("smeltPorkchop"); + break; + case GREEN_DYE: + EXP = expMap.get("smeltGreen_Dye"); + break; + case LIME_DYE: + EXP = expMap.get("smeltLime_Dye"); + break; + case COOKED_COD: + EXP = expMap.get("smeltCod"); + break; + case COOKED_SALMON: + EXP = expMap.get("smeltSalmon"); + break; + case POPPED_CHORUS_FRUIT: + EXP = expMap.get("smeltPopped_Chorus_Fruit"); + break; + case DRIED_KELP: + EXP = expMap.get("smeltDried_Kelp"); + break; + case GLASS: + EXP = expMap.get("smeltGlass"); + break; + case BRICK: + EXP = expMap.get("smeltBrick"); + break; + case NETHER_BRICK: + EXP = expMap.get("smeltNether_Brick"); + break; + case STONE: + EXP = expMap.get("smeltStone"); + break; + case SMOOTH_SANDSTONE: + EXP = expMap.get("smeltSmooth_Sandstone"); + break; + case BAKED_POTATO: + EXP = expMap.get("smeltBakedPotato"); + break; + case SMOOTH_RED_SANDSTONE: + EXP = expMap.get("smeltSmooth_Red_Sandstone"); + break; + case SMOOTH_STONE: + EXP = expMap.get("smeltSmooth_Stone"); + break; + case SMOOTH_QUARTZ: + EXP = expMap.get("smeltSmoothQuartz"); + break; + case TERRACOTTA: + EXP = expMap.get("smeltTerracotta"); + break; + case GRAY_GLAZED_TERRACOTTA: + case BLACK_GLAZED_TERRACOTTA: + case GREEN_GLAZED_TERRACOTTA: + case BLUE_GLAZED_TERRACOTTA: + case BROWN_GLAZED_TERRACOTTA: + case CYAN_GLAZED_TERRACOTTA: + case LIGHT_BLUE_GLAZED_TERRACOTTA: + case LIGHT_GRAY_GLAZED_TERRACOTTA: + case LIME_GLAZED_TERRACOTTA: + case MAGENTA_GLAZED_TERRACOTTA: + case ORANGE_GLAZED_TERRACOTTA: + case PINK_GLAZED_TERRACOTTA: + case PURPLE_GLAZED_TERRACOTTA: + case RED_GLAZED_TERRACOTTA: + case WHITE_GLAZED_TERRACOTTA: + case YELLOW_GLAZED_TERRACOTTA: + EXP = expMap.get("smeltGlazed_Terracotta"); + break; + case CHARCOAL: + EXP = expMap.get("smeltCharcoal"); + break; + case IRON_INGOT: + EXP = expMap.get("smeltIronIngot"); + break; + case GOLD_INGOT: + EXP = expMap.get("smeltGoldIngot"); + break; + case DIAMOND: + EXP = expMap.get("smeltDiamond"); + break; + case LAPIS_LAZULI: + EXP = expMap.get("smeltLapis_Lazuli"); + break; + case EMERALD: + EXP = expMap.get("smeltEmerald"); + break; + case REDSTONE: + EXP = expMap.get("smeltRedstone"); + break; + case QUARTZ: + EXP = expMap.get("smeltQuartz"); + break; + case SPONGE: + EXP = expMap.get("smeltSponge"); + break; + case IRON_NUGGET: + EXP = expMap.get("smeltIron_Nugget"); + break; + case GOLD_NUGGET: + EXP = expMap.get("smeltGold_Nugget"); + break; + case CRACKED_STONE_BRICKS: + EXP = expMap.get("smeltCracked_Stone_Bricks"); + break; + default: + EXP = expMap.get("smeltAnythingElse"); + break; + } + MinecraftVersion minecraftVersion = new MinecraftVersion(); + if (minecraftVersion.getMinecraftVersionAsDouble() >= 1.16 && EXP != expMap.get( + "smeltAnythingElse")) { + if (smeltedMaterial.equals(Material.NETHERITE_SCRAP)) { + EXP = expMap.get("smeltNetherite_Scrap"); + } + if (smeltedMaterial.equals(Material.CRACKED_NETHER_BRICKS)) { + EXP = expMap.get("smeltCracked_Nether_Bricks"); + } + } + // TODO add 1.17 items + return EXP; + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Swordsmanship.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Swordsmanship.java new file mode 100644 index 0000000..4d261d5 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Swordsmanship.java @@ -0,0 +1,406 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.AbilityTimers; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.utils.game.ActionBarMessages; +import mc.carlton.freerpg.utils.game.ExpFarmTracker; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import mc.carlton.freerpg.utils.game.TrackItem; +import mc.carlton.freerpg.utils.globalVariables.EntityGroups; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.attribute.Attributable; +import org.bukkit.attribute.Attribute; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.persistence.PersistentDataType; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; +import org.bukkit.util.Vector; + +public class Swordsmanship extends Skill { + + Random rand = new Random(); //Random class Import + private String skillName = "swordsmanship"; + private boolean runMethods; + + public Swordsmanship(Player p) { + super(p); + this.p = p; + this.pName = p.getDisplayName(); + this.itemInHand = p.getInventory().getItemInMainHand(); + this.increaseStats = new ChangeStats(p); + this.abilities = new AbilityTracker(p); + this.timers = new AbilityTimers(p); + this.pStatClass = new PlayerStats(p); + this.actionMessage = new ActionBarMessages(p); + this.lang = new LanguageSelector(p); + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + public void initiateAbility() { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.swordsmanshipAbility")) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { + return; + } + Integer[] pTimers = timers.getPlayerCooldownTimes(); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[7] == -1) { + int cooldown = pTimers[7]; + if (cooldown < 1) { + int prepMessages = (int) pStatClass.getPlayerData().get("global") + .get(22); //Toggle for preparation messages + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("sword") + + "...<<<"); + } + int taskID = new BukkitRunnable() { + @Override + public void run() { + if (prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " + lang.getString("sword") + + "<<<"); + } + try { + abilities.setPlayerAbility(skillName, -1); + } catch (Exception e) { + + } + } + }.runTaskLater(plugin, 20 * 4).getTaskId(); + abilities.setPlayerAbility(skillName, taskID); + } else { + actionMessage.sendMessage( + ChatColor.RED + lang.getString("swiftStrikes") + " " + lang.getString("cooldown") + ": " + + ChatColor.WHITE + cooldown + ChatColor.RED + "s"); + } + } + } + + public void enableAbility() { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + actionMessage.sendMessage( + ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("swiftStrikes") + " " + + lang.getString("activated") + "<<<"); + int durationLevel = (int) pStat.get(skillName).get(4); + double duration0 = Math.ceil(durationLevel * 0.4) + 40; + long duration = (long) duration0; + int sharperLevel = (int) pStat.get(skillName).get(12); + int sharpLevel = itemInHand.getEnchantmentLevel(Enchantment.DAMAGE_ALL); + if (sharperLevel > 0) { + itemInHand.removeEnchantment(Enchantment.DAMAGE_ALL); + itemInHand.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, sharpLevel + 1); + } + + //Mark the item + long unixTime = Instant.now().getEpochSecond(); + String keyName = + p.getUniqueId().toString() + "-frpg-" + skillName + "-" + String.valueOf(unixTime); + NamespacedKey key = new NamespacedKey(plugin, keyName); + ItemMeta itemMeta = itemInHand.getItemMeta(); + itemMeta.getPersistentDataContainer().set(key, PersistentDataType.STRING, "frpg-swordsmanship"); + itemInHand.setItemMeta(itemMeta); + + ((Attributable) p).getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(1024.0); + Bukkit.getScheduler().cancelTask(pAbilities[7]); + abilities.setPlayerAbility(skillName, -2); + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("swiftStrikes") + " " + lang.getString( + "readyToUse") + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("swiftStrikes") + " " + + lang.getString("ended") + "<<<"; + timers.abilityDurationTimer(skillName, duration, endMessage, coolDownEndMessage, key, + itemInHand, sharpLevel, sharperLevel); + } + + public void preventLogoutTheft(int taskID_swordsmanship, ItemStack itemInHand_swords, + NamespacedKey key, boolean isDisabling) { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + int sharperLevel = (int) pStat.get(skillName).get(12); + ((Attributable) p).getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(4.0); + + if (sharperLevel > 0) { + if (pAbilities[7] == -2) { + Bukkit.getScheduler().cancelTask(taskID_swordsmanship); + int sharpLevel = itemInHand_swords.getEnchantmentLevel(Enchantment.DAMAGE_ALL) - 1; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("magicForce") + + "<<<"; + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("swiftStrikes") + " " + lang.getString( + "readyToUse") + "<<<"; + timers.endAbility(skillName, endMessage, coolDownEndMessage, key, itemInHand_swords, + sharpLevel, sharperLevel, isDisabling); + TrackItem trackItem = new TrackItem(); + trackItem.removeItemKey(itemInHand_swords, key); + } + } + } + + public void thirstForBlood(Entity entity) { + if (!runMethods) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + List thirstMobs = entityGroups.getThirstMobs(); + if (!(thirstMobs.contains(entity.getType()))) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + List swords = itemGroups.getSwords(); + if (!(swords.contains(itemInHand.getType()))) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get(skillName).get(11) < 1) { + return; + } + int foodLevel = p.getFoodLevel(); + float saturation = p.getSaturation(); + p.setFoodLevel(Math.min(foodLevel + 2, 20)); + p.setSaturation(Math.min(saturation + 2, p.getFoodLevel())); + increaseStats.changeEXP(skillName, expMap.get("thirstForBloodActivate")); + } + + public void doubleHit(Entity entity, double damage) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int doubleHitLevel = (int) pStat.get(skillName).get(5); + if (!(entity instanceof LivingEntity)) { + return; + } + if (doubleHitLevel * 0.0002 > rand.nextDouble()) { + new BukkitRunnable() { + @Override + public void run() { + if (!entity.isDead()) { + LivingEntity aliveEntity = (LivingEntity) entity; + double hpRemaining = aliveEntity.getHealth(); + Vector knockback = aliveEntity.getVelocity(); + aliveEntity.setNoDamageTicks(0); + if (aliveEntity instanceof Player) { + aliveEntity.damage(2); + increaseStats.changeEXP(skillName, expMap.get("doubleHitActivate")); + } else { + aliveEntity.damage(Math.min(damage * 0.5, hpRemaining - 1)); + increaseStats.changeEXP(skillName, + (int) Math.round(damage * expMap.get("doubleHit_EXPperDamagePointDone"))); + } + double multiplier; + if (knockback.length() > 0.1) { + double newKnockback = Math.min(knockback.length() * 2, 80.0); + multiplier = newKnockback / knockback.length(); + } else { + multiplier = 2.0; + } + aliveEntity.setVelocity(knockback.multiply(multiplier)); + aliveEntity.setNoDamageTicks(20); + + } + } + }.runTaskLater(plugin, 4); + } + } + + public void killBuffs(Entity entity) { //This is written very inefficiently and is very messy + if (!runMethods) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + List hostileMobs = entityGroups.getHostileMobs(); + if (!(hostileMobs.contains(entity.getType()))) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + List swords = itemGroups.getSwords(); + if (!(swords.contains(itemInHand.getType()))) { + return; + } + + Map> pStat = pStatClass.getPlayerData(); + int adrenaline1Level = Math.min((int) pStat.get(skillName).get(7), 5); + int adrenaline2Level = Math.min((int) pStat.get(skillName).get(9), 5); + int killingSpree1Level = Math.min((int) pStat.get(skillName).get(8), 5); + int kilingSpree2Level = Math.min((int) pStat.get(skillName).get(10), 5); + int totalSpeedTime = adrenaline1Level * 2 * 20; + int totalStrengthtime = killingSpree1Level * 2 * 20; + int speedIItime = (int) Math.round(totalSpeedTime * adrenaline2Level * 0.2); + int strengthIItime = (int) Math.round(totalStrengthtime * kilingSpree2Level * 0.2); + int speedItime = totalSpeedTime - speedIItime; + int strengthItime = totalStrengthtime - strengthIItime; + + if (totalStrengthtime == 0 && totalSpeedTime == 0) { + return; + } + + //Speed + boolean addEffect = true; + boolean hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.SPEED)) { + hasEffect = true; + if ((effect.getDuration() > totalSpeedTime) || (effect.getAmplifier() > 1 + && effect.getDuration() > totalSpeedTime * 0.2) || (effect.getAmplifier() == 1 + && effect.getDuration() > speedIItime && effect.getDuration() > totalSpeedTime * 0.2) + || totalSpeedTime == 0) { + addEffect = false; + } + break potionEffectLoop; + } + } + // TODO check for code duplication, check if code can be extracted to separate method + if (addEffect) { + if (hasEffect) { + p.removePotionEffect(PotionEffectType.SPEED); + } + if (speedIItime == 0) { + p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, totalSpeedTime, 0)); + } else { + p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, speedIItime + 2, 1)); + int taskID = new BukkitRunnable() { + @Override + public void run() { + boolean addEffect = true; + boolean hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.SPEED)) { + hasEffect = true; + if ((effect.getDuration() > totalSpeedTime) || (effect.getAmplifier() > 1 + && effect.getDuration() > speedItime * 0.2)) { + addEffect = false; + } + break potionEffectLoop; + } + } + if (addEffect && hasEffect) { + p.removePotionEffect(PotionEffectType.SPEED); + p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, speedItime, 0)); + } + + } + }.runTaskLater(plugin, speedIItime).getTaskId(); + } + } + + //Strength + addEffect = true; + hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.INCREASE_DAMAGE)) { + hasEffect = true; + if ((effect.getDuration() > totalStrengthtime) || (effect.getAmplifier() > 1 + && effect.getDuration() > totalStrengthtime * 0.2) || (effect.getAmplifier() == 1 + && effect.getDuration() > strengthIItime + && effect.getDuration() > totalStrengthtime * 0.2) || totalStrengthtime == 0) { + addEffect = false; + } + break potionEffectLoop; + } + } + // TODO check for code duplication, check if code can be extracted to separate method + if (addEffect) { + if (hasEffect) { + p.removePotionEffect(PotionEffectType.INCREASE_DAMAGE); + } + if (strengthIItime == 0) { + p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, totalStrengthtime, 0)); + } else { + p.addPotionEffect( + new PotionEffect(PotionEffectType.INCREASE_DAMAGE, strengthIItime + 2, 1)); + int taskID = new BukkitRunnable() { + @Override + public void run() { + boolean addEffect = true; + boolean hasEffect = false; + potionEffectLoop: + for (PotionEffect effect : p.getActivePotionEffects()) { + if (effect.getType().equals(PotionEffectType.INCREASE_DAMAGE)) { + hasEffect = true; + if ((effect.getDuration() > totalStrengthtime) || (effect.getAmplifier() > 1 + && effect.getDuration() > strengthItime * 0.2)) { + addEffect = false; + } + break potionEffectLoop; + } + } + if (addEffect && hasEffect) { + p.removePotionEffect(PotionEffectType.INCREASE_DAMAGE); + p.addPotionEffect( + new PotionEffect(PotionEffectType.INCREASE_DAMAGE, strengthItime, 0)); + } + + } + }.runTaskLater(plugin, strengthIItime).getTaskId(); + } + + } + + } + + public void giveHitEXP(double finalDamage, Entity entity) { + if (!runMethods || entity.getType().equals(EntityType.ARMOR_STAND)) { + return; + } + ExpFarmTracker expFarmTracker = new ExpFarmTracker(); + double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity, skillName); + increaseStats.changeEXP(skillName, (int) Math.round( + (finalDamage * expMap.get("dealDamage_EXPperDamagePointDone") + expMap.get("dealDamage")) + * multiplier)); + } + + public void giveKillEXP(Entity entity) { + if (!runMethods) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + List swords = itemGroups.getSwords(); + if (!(swords.contains(itemInHand.getType()))) { + return; + } + EntityGroups entityGroups = new EntityGroups(); + entityGroups.killEntity(entity, skillName, expMap, increaseStats); + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Woodcutting.java b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Woodcutting.java new file mode 100644 index 0000000..ad064e5 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/perksAndAbilities/Woodcutting.java @@ -0,0 +1,630 @@ +package mc.carlton.freerpg.skills.perksAndAbilities; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.AbilityTimers; +import mc.carlton.freerpg.core.info.player.AbilityTracker; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.core.info.server.PlacedBlocksManager; +import mc.carlton.freerpg.core.info.server.WorldGuardChecks; +import mc.carlton.freerpg.utils.game.ActionBarMessages; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import mc.carlton.freerpg.utils.globalVariables.ExpMaps; +import mc.carlton.freerpg.utils.globalVariables.ItemGroups; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.World; +import org.bukkit.block.Block; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.ExperienceOrb; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.EnchantmentStorageMeta; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.scheduler.BukkitRunnable; + +public class Woodcutting extends Skill { + + Map woodcuttingEXP; + Random rand = new Random(); //Random class Import + List logs; + List leaves; + ArrayList timberLogs = new ArrayList(); + ArrayList treeLeaves = new ArrayList(); + private String skillName = "woodcutting"; + private boolean runMethods; + + public Woodcutting(Player p) { + super(p); + this.pName = p.getDisplayName(); + this.itemInHand = p.getInventory().getItemInMainHand(); + this.increaseStats = new ChangeStats(p); + this.abilities = new AbilityTracker(p); + this.timers = new AbilityTimers(p); + this.pStatClass = new PlayerStats(p); + this.actionMessage = new ActionBarMessages(p); + this.lang = new LanguageSelector(p); + + ItemGroups itemGroups = new ItemGroups(); + this.logs = itemGroups.getLogs(); + this.leaves = itemGroups.getLeaves(); + + ExpMaps expMaps = new ExpMaps(); + this.woodcuttingEXP = expMaps.getWoodcuttingEXP(); + + ConfigLoad configLoad = new ConfigLoad(); + this.runMethods = configLoad.getAllowedSkillsMap().get(skillName); + expMap = configLoad.getExpMapForSkill(skillName); + } + + public void initiateAbility() { + if (!runMethods) { + return; + } + if (!p.hasPermission("freeRPG.woodcuttingAbility")) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + if ((int) pStat.get("global").get(24) < 1 || !pStatClass.isPlayerSkillAbilityOn(skillName)) { + return; + } + Integer[] pTimers = timers.getPlayerCooldownTimes(); + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[1] == -1) { + int cooldown = pTimers[1]; + if (cooldown < 1) { + int prepMessages = (int) pStatClass.getPlayerData().get("global") + .get(22); //Toggle for preparation messages + if (pAbilities[9] != -2 && prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>" + lang.getString("prepare") + " " + lang.getString("axe") + + "...<<<"); + } + int taskID = new BukkitRunnable() { + @Override + public void run() { + try { + Integer[] pAbilities2 = abilities.getPlayerAbilities(); + if (pAbilities2[9] != -2 && prepMessages > 0) { + actionMessage.sendMessage( + ChatColor.GRAY + ">>>..." + lang.getString("rest") + " " + lang.getString("axe") + + "<<<"); + } + abilities.setPlayerAbility(skillName, -1); + } catch (Exception e) { + + } + } + }.runTaskLater(plugin, 20 * 4).getTaskId(); + abilities.setPlayerAbility(skillName, taskID); + } else { + actionMessage.sendMessage( + ChatColor.RED + lang.getString("timber") + " " + lang.getString("cooldown") + ": " + + ChatColor.WHITE + cooldown + ChatColor.RED + "s"); + } + } + } + + public void enableAbility() { + if (!runMethods) { + return; + } + Integer[] pAbilities = abilities.getPlayerAbilities(); + Map> pStat = pStatClass.getPlayerData(); + actionMessage.sendMessage( + ChatColor.GREEN + ChatColor.BOLD.toString() + ">>>" + lang.getString("timber") + " " + + lang.getString("activated") + "<<<"); + int durationLevel = (int) pStat.get(skillName).get(4); + double duration0 = Math.ceil(durationLevel * 0.4) + 40; + long duration = (long) duration0; + Bukkit.getScheduler().cancelTask(pAbilities[1]); + abilities.setPlayerAbility(skillName, -2); + String coolDownEndMessage = + ChatColor.GREEN + ">>>" + lang.getString("timber") + " " + lang.getString("readyToUse") + + "<<<"; + String endMessage = + ChatColor.RED + ChatColor.BOLD.toString() + ">>>" + lang.getString("timber") + " " + + lang.getString("ended") + "<<<"; + timers.abilityDurationTimer(skillName, duration, endMessage, coolDownEndMessage); + } + + public void getTimberLogs(Block b1, final int x1, final int y1, final int z1) { + if (!runMethods) { + return; + } + WorldGuardChecks BuildingCheck = new WorldGuardChecks(); + int searchSquareSize = 7; + for (int x = -1; x <= 1; x++) { + for (int y = 0; y <= 1; y++) { + for (int z = -1; z <= 1; z++) { + if (x == 0 && y == 0 && z == 0) { + continue; + } + Block b2 = b1.getRelative(x, y, z); + int blockX = b2.getX(); + int blockY = b2.getY(); + int blockZ = b2.getZ(); + if (blockX == x1 && blockY == y1 + && blockZ == z1) { //Makes sure the original block is never added to timberLogs + continue; + } + if (logs.contains(b2.getType())) { + if (b2.getX() > x1 + searchSquareSize || b2.getX() < x1 - searchSquareSize + || b2.getZ() > z1 + searchSquareSize || b2.getZ() < z1 - searchSquareSize) { + break; + } else if (!(timberLogs.contains(b2))) { + if (BuildingCheck.canBuild(p, b2.getLocation())) { + timberLogs.add(b2); + this.getTimberLogs(b2, x1, y1, z1); + } + } + } + } + } + } + } + + public void timber(Block initialBlock) { + if (!runMethods) { + return; + } + if (!(logs.contains(initialBlock.getType()))) { + return; + } + World world = initialBlock.getWorld(); + Map> pStat = pStatClass.getPlayerData(); + int doubleDropsLevel = (int) pStat.get(skillName).get(5); + int timber_plus = (int) pStat.get(skillName).get(11); + int able_axe = (int) pStat.get(skillName).get(13); + getTimberLogs(initialBlock, initialBlock.getX(), initialBlock.getY(), initialBlock.getZ()); + int numLogs = timberLogs.size(); + ConfigLoad configLoad = new ConfigLoad(); + ArrayList timberLimits = configLoad.getTimberBreakLimits(); + if (timber_plus < 1) { + if (numLogs > timberLimits.get(0)) { + actionMessage.sendMessage(ChatColor.RED + lang.getString("treeTooBig0")); + return; + } + } else { + if (numLogs > timberLimits.get(1)) { + actionMessage.sendMessage(ChatColor.RED + lang.getString("treeTooBig1")); + return; + } + } + damageTool(numLogs, configLoad.getDurabilityModifiers().get("timber")); + for (Block block : timberLogs) { + Location blockLoc = block.getLocation(); + //Checks if any of the blocks weren't natural + PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); + boolean natural = !placedBlocksManager.isBlockTracked(block); + if (!natural) { + placedBlocksManager.removeBlock(block); + numLogs -= 1; + } + + Collection drops = block.getDrops(itemInHand); + block.setType(Material.AIR); + for (ItemStack drop : drops) { + dropItemNaturally(blockLoc, drop); + } + if (able_axe > 0 && natural) { + double randomNum = rand.nextDouble(); + double doubleDropChance = doubleDropsLevel * 0.00025; + if (doubleDropChance > randomNum) { + for (ItemStack drop : drops) { + dropItemNaturally(blockLoc, drop); + } + } + //Book spawns + double rollBookDropChance = 0.5; //50% chance to roll for a book, book then has 0-1% chance of being rolled. + if (rollBookDropChance > rand.nextDouble()) { + logBookDrop(block, world); + } + } + } + if (able_axe > 0) { + //XP all in one go + int zealousRootsLevel = (int) pStat.get(skillName).get(7); + double xpDrop0 = zealousRootsLevel * 0.1 * numLogs; + int xpDrop = 0; + double roundChance = xpDrop0 - Math.floor(xpDrop0); + double randomNum = rand.nextDouble(); + if (roundChance > randomNum) { + xpDrop = (int) Math.ceil(xpDrop0); + } else { + xpDrop = (int) Math.floor(xpDrop0); + } + ((ExperienceOrb) world.spawn(initialBlock.getLocation(), ExperienceOrb.class)).setExperience( + xpDrop); + + } + increaseStats.changeEXP(skillName, (int) Math.round( + woodcuttingEXP.get(initialBlock.getType()) * numLogs * configLoad.getSpecialMultiplier() + .get("timberEXPMultiplier"))); + timberLogs.clear(); + + } + + public void woodcuttingDoubleDrop(Block block, World world) { + if (!runMethods) { + return; + } + Material[] planks0 = {Material.ACACIA_PLANKS, Material.BIRCH_PLANKS, Material.DARK_OAK_PLANKS, + Material.JUNGLE_PLANKS, Material.OAK_PLANKS, Material.SPRUCE_PLANKS}; + List planks = Arrays.asList(planks0); + if (planks.contains(block.getType())) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int doubleDropLevel = (int) pStat.get(skillName).get(5); + double chance = 0.0005 * doubleDropLevel; + double randomNum = rand.nextDouble(); + if (chance > randomNum) { + for (ItemStack stack : block.getDrops(itemInHand)) { + dropItemNaturally(block.getLocation(), stack); + } + } + } + + public void logXPdrop(Block block, World world) { + if (!runMethods) { + return; + } + if (logs.contains(block.getType())) { + Map> pStat = pStatClass.getPlayerData(); + int zealousRootsLevel = (int) pStat.get(skillName).get(7); + double xpChance = zealousRootsLevel * 0.2; + double randomNum = rand.nextDouble(); + if (xpChance > randomNum) { + ((ExperienceOrb) world.spawn(block.getLocation(), ExperienceOrb.class)).setExperience(1); + } + } + } + + public void logBookDrop(Block block, World world) { + if (!runMethods) { + return; + } + if (logs.contains(block.getType())) { + Map> pStat = pStatClass.getPlayerData(); + int hiddenKnowledgeLevel = (int) pStat.get(skillName).get(9); + double bookChance = hiddenKnowledgeLevel * 0.002; + double randomNum = rand.nextDouble(); + if (bookChance > randomNum) { + //Get enchant Map + ItemGroups itemGroups = new ItemGroups(); + Map enchantmentLevelMap = itemGroups.getEnchantmentLevelMap(); + + int choppingInt = 0; + if (hiddenKnowledgeLevel >= 5) { + choppingInt = 1; + } + + //Get random enchant + List keysAsArray = new ArrayList(enchantmentLevelMap.keySet()); + int randInt = rand.nextInt(keysAsArray.size() + choppingInt); + Enchantment randomEnchant; + if (randInt < keysAsArray.size()) { + randomEnchant = keysAsArray.get(randInt); + } else { //Enchantment will be chopping + randomEnchant = Enchantment.getByKey( + new NamespacedKey(FreeRPG.getPlugin(FreeRPG.class), "chopping")); + } + + int randomLevel = rand.nextInt(enchantmentLevelMap.get(randomEnchant)) + 1; + ItemStack enchantedBook = new ItemStack(Material.ENCHANTED_BOOK, 1); + EnchantmentStorageMeta meta = ((EnchantmentStorageMeta) enchantedBook.getItemMeta()); + meta.addStoredEnchant(randomEnchant, randomLevel, true); + enchantedBook.setItemMeta(meta); + if (randomEnchant == Enchantment.BINDING_CURSE + || randomEnchant == Enchantment.VANISHING_CURSE) { + Map enchantmentLevelMapGood = enchantmentLevelMap; + enchantmentLevelMapGood.remove(Enchantment.BINDING_CURSE); + enchantmentLevelMapGood.remove(Enchantment.VANISHING_CURSE); + keysAsArray = new ArrayList(enchantmentLevelMapGood.keySet()); + randomEnchant = keysAsArray.get(rand.nextInt(keysAsArray.size())); + randomLevel = rand.nextInt(enchantmentLevelMap.get(randomEnchant)) + 1; + meta.addStoredEnchant(randomEnchant, randomLevel, true); + enchantedBook.setItemMeta(meta); + } + dropItemNaturally(block.getLocation(), enchantedBook); + } + + } + + } + + public void leavesDrops(Block block, World world, double probMultiplier, double expMultiplier) { + if (!runMethods) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + List leaves = itemGroups.getLeaves(); + if (leaves.contains(block.getType()) && itemInHand.getType() != Material.SHEARS) { + Map> pStat = pStatClass.getPlayerData(); + ConfigLoad loadConfig = new ConfigLoad(); + ArrayList leafDropData = loadConfig.getWoodcuttingInfo(); + int leafLevel = (int) pStat.get(skillName).get(10); + double randomNum = rand.nextDouble(); + Double[] prob = {(double) leafDropData.get(2), (double) leafDropData.get(5), + (double) leafDropData.get(8), (double) leafDropData.get(11), + (double) leafDropData.get(14)}; + for (int i = 0; i < prob.length; i++) { + prob[i] = prob[i] * probMultiplier; + } + Double[] dropChanceSums = {prob[0], prob[0] + prob[1], prob[0] + prob[1] + prob[2], + prob[0] + prob[1] + prob[2] + prob[3], + prob[0] + prob[1] + prob[2] + prob[3] + prob[4]}; + if (randomNum < dropChanceSums[0] && leafLevel >= 1) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (leafDropData.get(0) == null) { + drop.setType(Material.FEATHER); + } else { + drop.setType((Material) leafDropData.get(0)); + drop.setAmount((int) leafDropData.get(1)); + } + dropItemNaturally(block.getLocation(), drop); + increaseStats.changeEXP(skillName, + (int) Math.round(expMap.get("leafDrop1") * expMultiplier)); + } else if (randomNum < dropChanceSums[1] && leafLevel >= 2) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (leafDropData.get(3) == null) { + drop.setType(Material.GOLD_NUGGET); + } else { + drop.setType((Material) leafDropData.get(3)); + drop.setAmount((int) leafDropData.get(4)); + } + dropItemNaturally(block.getLocation(), drop); + increaseStats.changeEXP(skillName, + (int) Math.round(expMap.get("leafDrop2") * expMultiplier)); + } else if (randomNum < dropChanceSums[2] && leafLevel >= 3) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (leafDropData.get(6) == null) { + drop.setType(Material.GOLDEN_APPLE); + } else { + drop.setType((Material) leafDropData.get(6)); + drop.setAmount((int) leafDropData.get(7)); + } + dropItemNaturally(block.getLocation(), drop); + increaseStats.changeEXP(skillName, + (int) Math.round(expMap.get("leafDrop3") * expMultiplier)); + } else if (randomNum < dropChanceSums[3] && leafLevel >= 4) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (leafDropData.get(9) == null) { + drop.setType(Material.EXPERIENCE_BOTTLE); + } else { + drop.setType((Material) leafDropData.get(9)); + drop.setAmount((int) leafDropData.get(10)); + } + dropItemNaturally(block.getLocation(), drop); + increaseStats.changeEXP(skillName, + (int) Math.round(expMap.get("leafDrop4") * expMultiplier)); + } else if (randomNum < dropChanceSums[4] && leafLevel >= 5) { + ItemStack drop = new ItemStack(Material.DIRT, 1); + if (leafDropData.get(12) == null) { + drop.setType(Material.ENCHANTED_GOLDEN_APPLE); + } else { + drop.setType((Material) leafDropData.get(12)); + drop.setAmount((int) leafDropData.get(13)); + } + dropItemNaturally(block.getLocation(), drop); + increaseStats.changeEXP(skillName, + (int) Math.round(expMap.get("leafDrop5") * expMultiplier)); + } + } + + } + + public void getTreeLeaves(Block b1, final int x1, final int y1, final int z1, Material leafType) { + if (!runMethods) { + return; + } + WorldGuardChecks BuildingCheck = new WorldGuardChecks(); + int searchCubeSize = 7; + if (treeLeaves.size() > 63) { + return; + } + for (int x = -1; x <= 1; x++) { + for (int y = -1; y <= 1; y++) { + for (int z = -1; z <= 1; z++) { + if (x == 0 && y == 0 && z == 0) { + continue; + } + Block b2 = b1.getRelative(x, y, z); + int blockX = b2.getX(); + int blockY = b2.getY(); + int blockZ = b2.getZ(); + if (blockX == x1 && blockY == y1 + && blockZ == z1) { //Makes sure the original block is never added to treeLeaves + continue; + } + if (b2.getType().equals(leafType)) { + if (blockX > x1 + searchCubeSize || blockX < x1 - searchCubeSize + || blockY > y1 + searchCubeSize || blockY < y1 - searchCubeSize + || blockZ > z1 + searchCubeSize || blockZ < z1 - searchCubeSize) { + break; + } else if (!(treeLeaves.contains(b2))) { + if (treeLeaves.size() > 63) { + return; + } + if (BuildingCheck.canBuild(p, b2.getLocation())) { + treeLeaves.add(b2); + this.getTreeLeaves(b2, x1, y1, z1, leafType); + } + } + } + } + } + } + } + + public void leafBlower(Block initialBlock) { + if (!runMethods) { + return; + } + if (!(leaves.contains(initialBlock.getType()))) { //Block must be a leaf + return; + } + if (!(new ItemGroups().getAxes().contains(itemInHand.getType()))) { //Must be holding an axe + return; + } + Map> pStat = pStatClass.getPlayerData(); + int leafBlowerLevel = (int) pStat.get(skillName).get(12); + if (leafBlowerLevel < 1 || (int) pStat.get("global").get(26) + < 1) { //Must have high enough level and have leaf blower toggled on + return; + } + getTreeLeaves(initialBlock, initialBlock.getX(), initialBlock.getY(), initialBlock.getZ(), + initialBlock.getType()); //Get Leaves in tree leaf chunk + int numLeaves = treeLeaves.size(); + World world = initialBlock.getWorld(); + ConfigLoad configLoad = new ConfigLoad(); + damageTool(numLeaves, configLoad.getDurabilityModifiers().get("leafBlower")); + PlacedBlocksManager placedBlocksManager = new PlacedBlocksManager(); + for (Block block : treeLeaves) { + Location blockLoc = block.getLocation(); + if (placedBlocksManager.isBlockTracked(block)) { + placedBlocksManager.removeBlock(block); + numLeaves -= 1; //Less EXP rewarded for nonnatural broken leaves + } else { + leavesDrops(block, world, 0.2, 0.4); //Nerfed drop rates are EXP from special drops + } + Collection drops = block.getDrops(itemInHand); + block.setType(Material.AIR); + for (ItemStack drop : drops) { //Drop whatever that leaf would have dropped normally + dropItemNaturally(blockLoc, drop); + } + } + increaseStats.changeEXP(skillName, numLeaves * expMap.get("useLeafBlower")); //Gives all EXP + + } + + // TODO remove dead code + /* OLD leaf blower skill + public void leafBlower(Block block, World world) { + if (!runMethods) { + return; + } + ItemGroups itemGroups = new ItemGroups(); + List leaves = itemGroups.getLeaves(); + List axes = itemGroups.getAxes(); + if (leaves.contains(block.getType()) && axes.contains(itemInHand.getType())) { + WorldGuardChecks BuildingCheck = new WorldGuardChecks(); + if (!BuildingCheck.canBuild(p, block.getLocation())) { + return; + } + increaseStats.changeEXP(skillName,expMap.get("useLeafBlower")); + Map> pStat = pStatClass.getPlayerData(); + int leafLevel = (int) pStat.get(skillName).get(12); + if (leafLevel > 0) { + leavesDrops(block,world); + block.setType(Material.AIR); + ItemMeta toolMeta = itemInHand.getItemMeta(); + if (toolMeta instanceof Damageable) { + ((Damageable) toolMeta).setDamage(((Damageable) toolMeta).getDamage()+1); + itemInHand.setItemMeta(toolMeta); + if (((Damageable) toolMeta).getDamage() > itemInHand.getType().getMaxDurability()) { + itemInHand.setAmount(0); + p.getWorld().playEffect(p.getLocation(), Effect.STEP_SOUND, 1); + } + } + + double randomNum1 = rand.nextDouble(); + if (randomNum1 < 0.05) { + double randomNum2 = rand.nextDouble(); + if (randomNum2 < 0.5) { + switch (block.getType()) { + case ACACIA_LEAVES: + dropItemNaturally(block.getLocation(), new ItemStack(Material.ACACIA_SAPLING,1)); + break; + case BIRCH_LEAVES: + dropItemNaturally(block.getLocation(), new ItemStack(Material.BIRCH_SAPLING,1)); + break; + case DARK_OAK_LEAVES: + dropItemNaturally(block.getLocation(), new ItemStack(Material.DARK_OAK_SAPLING,1)); + break; + case JUNGLE_LEAVES: + dropItemNaturally(block.getLocation(), new ItemStack(Material.JUNGLE_SAPLING,1)); + break; + case SPRUCE_LEAVES: + dropItemNaturally(block.getLocation(), new ItemStack(Material.SPRUCE_SAPLING,1)); + break; + case OAK_LEAVES: + dropItemNaturally(block.getLocation(), new ItemStack(Material.OAK_SAPLING,1)); + break; + default: + break; + } + + } + else if (randomNum2 < 0.75) { + dropItemNaturally(block.getLocation(), new ItemStack(Material.STICK,1)); + } + else { + dropItemNaturally(block.getLocation(), new ItemStack(Material.STICK,2)); + } + } + double randomNum3 = rand.nextDouble(); + if (randomNum3 < 0.005 && (block.getType() == Material.OAK_LEAVES || block.getType() == Material.DARK_OAK_LEAVES)) { + dropItemNaturally(block.getLocation(), new ItemStack(Material.APPLE,1)); + } + } + } + } + */ + + public void timedHaste(Block block) { + if (!runMethods) { + return; + } + Map> pStat = pStatClass.getPlayerData(); + int freshArmsLevel = (int) pStat.get(skillName).get(8); + if (logs.contains(block.getType()) && freshArmsLevel > 0) { + Integer[] pAbilities = abilities.getPlayerAbilities(); + if (pAbilities[10] == -1) { + p.addPotionEffect( + new PotionEffect(PotionEffectType.FAST_DIGGING, 20 * 12 * freshArmsLevel, 0)); + int taskID = new BukkitRunnable() { + @Override + public void run() { + abilities.setPlayerAbility("woodcuttingHaste", -1); + } + }.runTaskLater(plugin, 20 * 300).getTaskId(); + abilities.setPlayerAbility("woodcuttingHaste", taskID); + } else { + Bukkit.getScheduler().cancelTask(pAbilities[10]); + int taskID = new BukkitRunnable() { + @Override + public void run() { + abilities.setPlayerAbility("woodcuttingHaste", -1); + } + }.runTaskLater(plugin, 20 * 300).getTaskId(); + } + } + } + + public boolean blacklistedBlock(Block block) { + if (!runMethods) { + return false; + } + boolean isBlacklisted = false; + Material blockType = block.getType(); + ItemGroups itemGroups = new ItemGroups(); + List strippedLogs = itemGroups.getStrippedLogs(); + if (logs.contains(blockType) || strippedLogs.contains(blockType)) { + isBlacklisted = true; + } + return isBlacklisted; + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/LowestLevelInfo.java b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/LowestLevelInfo.java new file mode 100644 index 0000000..66f50a9 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/LowestLevelInfo.java @@ -0,0 +1,14 @@ +package mc.carlton.freerpg.skills.skillAndPerkInfo; + +import java.util.Map; + +public interface LowestLevelInfo { + + Map getAllInfo(); + + Object getInfo(String identifier); + + void setInfo(Map skillPerkLevelInfo); + + void addInfo(String identifier, Object information); +} diff --git a/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/PassivePerkInfo.java b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/PassivePerkInfo.java new file mode 100644 index 0000000..30eef68 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/PassivePerkInfo.java @@ -0,0 +1,36 @@ +package mc.carlton.freerpg.skills.skillAndPerkInfo; + +import java.util.HashMap; +import java.util.Map; + +public class PassivePerkInfo extends PerkInfo implements LowestLevelInfo { + + private Map passivePerkInfo = new HashMap<>(); + + public PassivePerkInfo(Map passivePerkInfo) { + this.passivePerkInfo = passivePerkInfo; + } + + public PassivePerkInfo() { + this(new HashMap<>()); + } + + public Map getAllInfo() { + return passivePerkInfo; + } + + public Object getInfo(String identifier) { + if (passivePerkInfo.containsKey(identifier)) { + return passivePerkInfo; + } + return null; + } + + public void setInfo(Map skillPerkLevelInfo) { + this.passivePerkInfo = skillPerkLevelInfo; + } + + public void addInfo(String identifier, Object information) { + passivePerkInfo.put(identifier, information); + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/PerkInfo.java b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/PerkInfo.java new file mode 100644 index 0000000..e314451 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/PerkInfo.java @@ -0,0 +1,50 @@ +package mc.carlton.freerpg.skills.skillAndPerkInfo; + +public class PerkInfo { + + private boolean enabled = true; + private int minLevel = -1; + private int maxLevel = -1; + private String perkId; + private String descriptionTemplateId; + + public int getMaxLevel() { + return maxLevel; + } + + public void setMaxLevel(int maxLevel) { + this.maxLevel = maxLevel; + } + + public int getMinLevel() { + return minLevel; + } + + public void setMinLevel(int minLevel) { + this.minLevel = minLevel; + } + + public String getDescriptionTemplateId() { + return descriptionTemplateId; + } + + public void setDescriptionTemplateId(String descriptionTemplateId) { + this.descriptionTemplateId = descriptionTemplateId; + } + + public String getPerkId() { + return perkId; + } + + public void setPerkId(String perkId) { + this.perkId = perkId; + } + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/SkillPerkInfo.java b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/SkillPerkInfo.java new file mode 100644 index 0000000..c04997d --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/SkillPerkInfo.java @@ -0,0 +1,33 @@ +package mc.carlton.freerpg.skills.skillAndPerkInfo; + +import java.util.HashMap; +import java.util.Map; + +public class SkillPerkInfo extends PerkInfo { + + private Map skillPerkInfo = new HashMap<>(); + + public SkillPerkInfo(Map skillPerkInfo) { + this.skillPerkInfo = skillPerkInfo; + } + + public SkillPerkInfo() { + this(new HashMap<>()); + } + + public Map getSkillPerkInfo() { + return skillPerkInfo; + } + + public void setSkillPerkInfo(Map skillPerkInfo) { + this.skillPerkInfo = skillPerkInfo; + } + + public void addSkillPerkInfo(int level, SkillPerkLevelInfo skillPerkLevelInfo) { + this.skillPerkInfo.put(level, skillPerkLevelInfo); + } + + public void addSkillPerkInfo(int level, Map skillPerkLevelInfo) { + this.skillPerkInfo.put(level, new SkillPerkLevelInfo(level, skillPerkLevelInfo)); + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/SkillPerkLevelInfo.java b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/SkillPerkLevelInfo.java new file mode 100644 index 0000000..fcf2e21 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/SkillPerkLevelInfo.java @@ -0,0 +1,47 @@ +package mc.carlton.freerpg.skills.skillAndPerkInfo; + +import java.util.HashMap; +import java.util.Map; + +public class SkillPerkLevelInfo implements LowestLevelInfo { + + private Map skillPerkLevelInfo = new HashMap<>(); + private int level = 0; + + public SkillPerkLevelInfo(int level, Map skillPerkLevelInfo) { + this.level = level; + this.skillPerkLevelInfo = skillPerkLevelInfo; + } + + public SkillPerkLevelInfo(int level) { + this(level, new HashMap<>()); + } + + + public Map getAllInfo() { + return skillPerkLevelInfo; + } + + public Object getInfo(String identifier) { + if (skillPerkLevelInfo.containsKey(identifier)) { + return skillPerkLevelInfo; + } + return null; + } + + public void setInfo(Map skillPerkLevelInfo) { + this.skillPerkLevelInfo = skillPerkLevelInfo; + } + + public void addInfo(String identifier, Object information) { + skillPerkLevelInfo.put(identifier, information); + } + + public int getLevel() { + return level; + } + + public void setLevel(int level) { + this.level = level; + } +} diff --git a/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/SkillTreeInfo.java b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/SkillTreeInfo.java new file mode 100644 index 0000000..995cffc --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/skills/skillAndPerkInfo/SkillTreeInfo.java @@ -0,0 +1,41 @@ +package mc.carlton.freerpg.skills.skillAndPerkInfo; + +import java.util.HashMap; +import java.util.Map; +import mc.carlton.freerpg.skills.SkillName; + +public class SkillTreeInfo { + + SkillName skillName; + private Map skillTreeInfo; + + public SkillTreeInfo(SkillName skillName) { + this.skillName = skillName; + skillTreeInfo = new HashMap<>(); + } + + public void addPerkInfo(String perkId, PerkInfo perkInfo) { + skillTreeInfo.put(perkId, perkInfo); + } + + public void removePerkInfo(String perkId) { + if (skillTreeInfo.containsKey(perkId)) { + skillTreeInfo.remove(perkId); + } + } + + public PerkInfo getPerkInfo(String perkId) { + if (skillTreeInfo.containsKey(perkId)) { + return skillTreeInfo.get(perkId); + } + return null; + } + + public SkillName getSkillName() { + return skillName; + } + + public void setSkillName(SkillName skillName) { + this.skillName = skillName; + } +} diff --git a/src/main/java/mc/carlton/freerpg/utilities/FrpgPrint.java b/src/main/java/mc/carlton/freerpg/utilities/FrpgPrint.java deleted file mode 100644 index 1dbbe42..0000000 --- a/src/main/java/mc/carlton/freerpg/utilities/FrpgPrint.java +++ /dev/null @@ -1,7 +0,0 @@ -package mc.carlton.freerpg.utilities; - -public class FrpgPrint { - public static void print(String message) { - System.out.println("[FreeRPG] " + message); - } -} diff --git a/src/main/java/mc/carlton/freerpg/utilities/UtilityMethods.java b/src/main/java/mc/carlton/freerpg/utilities/UtilityMethods.java deleted file mode 100644 index c7c08be..0000000 --- a/src/main/java/mc/carlton/freerpg/utilities/UtilityMethods.java +++ /dev/null @@ -1,135 +0,0 @@ -package mc.carlton.freerpg.utilities; - -import org.bukkit.Color; -import org.bukkit.entity.EntityType; -import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.potion.PotionType; - -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -public class UtilityMethods { - public static String capitalizeString(String string) { - if (string.length() == 0) { - return string; - } - else if (string.length() == 1) { - return string.toUpperCase(); - } - else { - return string.substring(0,1).toUpperCase() + string.substring(1); - } - } - public static boolean stringCollectionContainsIgnoreCase(Collection colection, String inputString) { - for (String string : colection) { - if (inputString.equalsIgnoreCase(string)) { - return true; - } - } - return false; - } - public static String convertStringToListCasing(List list,String inputString) { - for (String string : list) { - if (inputString.equalsIgnoreCase(string)) { - return string; - } - } - return inputString; - } - public static String intToRankingString(int rank) { - String suffix = "th"; - int lastTwoDigits = rank % 100; - int lastDigit = rank % 10; - if (!(lastTwoDigits >= 10 && lastTwoDigits <= 19) ) { - if (lastDigit == 1) { - suffix = "st"; - } else if (lastDigit == 2) { - suffix = "nd"; - } else if (lastDigit == 3) { - suffix = "rd"; - } - } - return (String.valueOf(rank) + suffix); - } - public static boolean collectionOnlyContainsOneClass(Collection collection,Class tClass ) { - for (E item : collection) { - if (!tClass.isInstance(item)) { - return false; - } - } - return true; - } - public static Color getColorFromString(String colorString) { - colorString = colorString.substring(1,colorString.length()-1); - List RGB = Arrays.asList(colorString.trim().split(",")); - int red = 0; - int green = 0; - int blue = 0; - if (RGB.size() == 3) { - red = Integer.parseInt(RGB.get(0)); - green = Integer.parseInt(RGB.get(1)); - blue = Integer.parseInt(RGB.get(2)); - } - return Color.fromRGB(red,green,blue); - } - public static String camelCaseToSpacedString(String camelCaseString) { - return camelCaseString.replaceAll("([^_])([A-Z])", "$1 $2"); - } - public static EntityType matchEntityType(String entityTypeString) { - String convertedString = entityTypeString.replace(" ", "_").toUpperCase(); - for (EntityType entityType : EntityType.values()) { - if (entityType.toString().equalsIgnoreCase(convertedString)) { - return entityType; - } - } - return null; - } - public static PotionType matchPotionType(String potionTypeString) { - String convertedString = potionTypeString.replace(" ", "_").toUpperCase(); - for (PotionType potionType : PotionType.values()) { - if (potionType.toString().equalsIgnoreCase(convertedString)) { - return potionType; - } - } - return null; - } - public static EntityDamageEvent.DamageCause matchDamageCause(String damageCauseString) { - String convertedString = damageCauseString.replace(" ", "_").toUpperCase(); - for (EntityDamageEvent.DamageCause damageCause : EntityDamageEvent.DamageCause.values()) { - if (damageCause.toString().equalsIgnoreCase(convertedString)) { - return damageCause; - } - } - return null; - } - public static boolean stringContainsIgnoreCase(String string, String containedString) { - if (string.toLowerCase().contains(containedString.toLowerCase())) { - return true; - } else { - return false; - } - } - public static boolean stringContainsIgnoreCase(String string, Collection containedStringOptions) { - for (String containedString : containedStringOptions) { - if (stringContainsIgnoreCase(string,containedString)){ - return true; - } - } - return false; - } - public static String toAlphabetic(int i) { - if( i<0 ) { - return "-"+toAlphabetic(-i-1); - } - - int quot = i/26; - int rem = i%26; - char letter = (char)((int)'A' + rem); - if( quot == 0 ) { - return ""+letter; - } else { - return toAlphabetic(quot-1) + letter; - } - } -} diff --git a/src/main/java/mc/carlton/freerpg/utils/UtilityMethods.java b/src/main/java/mc/carlton/freerpg/utils/UtilityMethods.java new file mode 100644 index 0000000..0d05dbf --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/UtilityMethods.java @@ -0,0 +1,148 @@ +package mc.carlton.freerpg.utils; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import org.bukkit.Color; +import org.bukkit.entity.EntityType; +import org.bukkit.event.entity.EntityDamageEvent; +import org.bukkit.potion.PotionType; + +public class UtilityMethods { + + public static String capitalizeString(String string) { + if (string.length() == 0) { + return string; + } else if (string.length() == 1) { + return string.toUpperCase(); + } else { + return string.substring(0, 1).toUpperCase() + string.substring(1); + } + } + + public static boolean stringCollectionContainsIgnoreCase(Collection colection, + String inputString) { + for (String string : colection) { + if (inputString.equalsIgnoreCase(string)) { + return true; + } + } + return false; + } + + public static String convertStringToListCasing(List list, String inputString) { + for (String string : list) { + if (inputString.equalsIgnoreCase(string)) { + return string; + } + } + return inputString; + } + + public static String intToRankingString(int rank) { + String suffix = "th"; + int lastTwoDigits = rank % 100; + int lastDigit = rank % 10; + if (!(lastTwoDigits >= 10 && lastTwoDigits <= 19)) { + if (lastDigit == 1) { + suffix = "st"; + } else if (lastDigit == 2) { + suffix = "nd"; + } else if (lastDigit == 3) { + suffix = "rd"; + } + } + return (String.valueOf(rank) + suffix); + } + + public static boolean collectionOnlyContainsOneClass(Collection collection, + Class tClass) { + for (E item : collection) { + if (!tClass.isInstance(item)) { + return false; + } + } + return true; + } + + public static Color getColorFromString(String colorString) { + colorString = colorString.substring(1, colorString.length() - 1); + List RGB = Arrays.asList(colorString.trim().split(",")); + int red = 0; + int green = 0; + int blue = 0; + if (RGB.size() == 3) { + red = Integer.parseInt(RGB.get(0)); + green = Integer.parseInt(RGB.get(1)); + blue = Integer.parseInt(RGB.get(2)); + } + return Color.fromRGB(red, green, blue); + } + + public static String camelCaseToSpacedString(String camelCaseString) { + return camelCaseString.replaceAll("([^_])([A-Z])", "$1 $2"); + } + + public static EntityType matchEntityType(String entityTypeString) { + String convertedString = entityTypeString.replace(" ", "_").toUpperCase(); + for (EntityType entityType : EntityType.values()) { + if (entityType.toString().equalsIgnoreCase(convertedString)) { + return entityType; + } + } + return null; + } + + public static PotionType matchPotionType(String potionTypeString) { + String convertedString = potionTypeString.replace(" ", "_").toUpperCase(); + for (PotionType potionType : PotionType.values()) { + if (potionType.toString().equalsIgnoreCase(convertedString)) { + return potionType; + } + } + return null; + } + + public static EntityDamageEvent.DamageCause matchDamageCause(String damageCauseString) { + String convertedString = damageCauseString.replace(" ", "_").toUpperCase(); + for (EntityDamageEvent.DamageCause damageCause : EntityDamageEvent.DamageCause.values()) { + if (damageCause.toString().equalsIgnoreCase(convertedString)) { + return damageCause; + } + } + return null; + } + + public static boolean stringContainsIgnoreCase(String string, String containedString) { + if (string.toLowerCase().contains(containedString.toLowerCase())) { + return true; + } else { + return false; + } + } + + public static boolean stringContainsIgnoreCase(String string, + Collection containedStringOptions) { + for (String containedString : containedStringOptions) { + if (stringContainsIgnoreCase(string, containedString)) { + return true; + } + } + return false; + } + + public static String toAlphabetic(int i) { + if (i < 0) { + return "-" + toAlphabetic(-i - 1); + } + + int quot = i / 26; + int rem = i % 26; + char letter = (char) ((int) 'A' + rem); + if (quot == 0) { + return "" + letter; + } else { + return toAlphabetic(quot - 1) + letter; + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/ActionBarMessages.java b/src/main/java/mc/carlton/freerpg/utils/game/ActionBarMessages.java new file mode 100644 index 0000000..3c60556 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/ActionBarMessages.java @@ -0,0 +1,22 @@ +package mc.carlton.freerpg.utils.game; + +import net.md_5.bungee.api.ChatMessageType; +import net.md_5.bungee.api.chat.TextComponent; +import org.bukkit.entity.Player; + +public class ActionBarMessages { + + private Player p; + + public ActionBarMessages(Player p) { + this.p = p; + } + + public void sendMessage(String message) { + try { + p.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message)); + } catch (NoSuchMethodError e) { //This occurs when using craft bukkit + p.sendMessage(message); //In this case, we'll just send the player the message + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/BlockFaceTracker.java b/src/main/java/mc/carlton/freerpg/utils/game/BlockFaceTracker.java new file mode 100644 index 0000000..befe44d --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/BlockFaceTracker.java @@ -0,0 +1,26 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Player; + +public class BlockFaceTracker { + + static Map blockFacePlayerMap = new ConcurrentHashMap<>(); + + public void addBlockFace(BlockFace blockface, Player player) { + blockFacePlayerMap.put(player, blockface); + } + + public BlockFace getBlockface(Player player) { + if (blockFacePlayerMap.containsKey(player)) { + return blockFacePlayerMap.get(player); + } + return null; + } + + public void removePlayerBlockFace(Player player) { + blockFacePlayerMap.remove(player); + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/BossBarStorage.java b/src/main/java/mc/carlton/freerpg/utils/game/BossBarStorage.java new file mode 100644 index 0000000..255bf7e --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/BossBarStorage.java @@ -0,0 +1,134 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import mc.carlton.freerpg.FreeRPG; +import org.bukkit.Bukkit; +import org.bukkit.NamespacedKey; +import org.bukkit.boss.BarColor; +import org.bukkit.boss.BarStyle; +import org.bukkit.boss.BossBar; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; + +public class BossBarStorage { + + static Map playerExpBarMap = new ConcurrentHashMap<>(); + static Map playerAbilityDurationMap_Slot1 = new ConcurrentHashMap<>(); + static Map playerAbilityDurationMap_Slot2 = new ConcurrentHashMap<>(); + static Map playerAbilityDurationMap_Slot3 = new ConcurrentHashMap<>(); + + public void initializeNewPlayer(Player p) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + BossBar expBar = Bukkit.createBossBar(new NamespacedKey(plugin, p.getUniqueId().toString()), + p.getDisplayName() + "'s EXP Bar", BarColor.GREEN, BarStyle.SOLID); + expBar.setVisible(false); + expBar.addPlayer(p); + BossBar abilityDurationBar1 = Bukkit.createBossBar( + new NamespacedKey(plugin, p.getUniqueId().toString()), + p.getDisplayName() + "'s Ability Duration Bar 1", BarColor.YELLOW, BarStyle.SOLID); + abilityDurationBar1.setVisible(false); + abilityDurationBar1.addPlayer(p); + BossBar abilityDurationBar2 = Bukkit.createBossBar( + new NamespacedKey(plugin, p.getUniqueId().toString()), + p.getDisplayName() + "'s Ability Duration Bar 1", BarColor.YELLOW, BarStyle.SOLID); + abilityDurationBar2.setVisible(false); + abilityDurationBar2.addPlayer(p); + BossBar abilityDurationBar3 = Bukkit.createBossBar( + new NamespacedKey(plugin, p.getUniqueId().toString()), + p.getDisplayName() + "'s Ability Duration Bar 1", BarColor.YELLOW, BarStyle.SOLID); + abilityDurationBar3.setVisible(false); + abilityDurationBar3.addPlayer(p); + playerExpBarMap.putIfAbsent(p, expBar); + playerAbilityDurationMap_Slot1.putIfAbsent(p, abilityDurationBar1); + playerAbilityDurationMap_Slot2.putIfAbsent(p, abilityDurationBar2); + playerAbilityDurationMap_Slot3.putIfAbsent(p, abilityDurationBar3); + } + + public BossBar getPlayerExpBar(Player p) { + if (!playerExpBarMap.containsKey(p)) { + initializeNewPlayer(p); + } + return playerExpBarMap.get(p); + } + + public BossBar getPlayerDurationBar1(Player p) { + if (!playerAbilityDurationMap_Slot1.containsKey(p)) { + initializeNewPlayer(p); + } + return playerAbilityDurationMap_Slot1.get(p); + } + + public BossBar getPlayerDurationBar2(Player p) { + if (!playerAbilityDurationMap_Slot2.containsKey(p)) { + initializeNewPlayer(p); + } + return playerAbilityDurationMap_Slot2.get(p); + } + + public BossBar getPlayerDurationBar3(Player p) { + if (!playerAbilityDurationMap_Slot3.containsKey(p)) { + initializeNewPlayer(p); + } + return playerAbilityDurationMap_Slot3.get(p); + } + + public void removePlayer(Player p) { + if (playerExpBarMap.containsKey(p)) { + playerExpBarMap.get(p).removePlayer(p); + playerExpBarMap.remove(p); + } + if (playerAbilityDurationMap_Slot1.containsKey(p)) { + playerAbilityDurationMap_Slot1.get(p).removePlayer(p); + playerAbilityDurationMap_Slot1.remove(p); + } + if (playerAbilityDurationMap_Slot2.containsKey(p)) { + playerAbilityDurationMap_Slot2.get(p).removePlayer(p); + playerAbilityDurationMap_Slot2.remove(p); + } + if (playerAbilityDurationMap_Slot3.containsKey(p)) { + playerAbilityDurationMap_Slot3.get(p).removePlayer(p); + playerAbilityDurationMap_Slot3.remove(p); + } + } + + public boolean isDurationBarActive(Player p, int number) { + BossBar bossBar; + if (number == 1) { + bossBar = getPlayerDurationBar1(p); + } else if (number == 2) { + bossBar = getPlayerDurationBar2(p); + } else { + bossBar = getPlayerDurationBar3(p); + } + if (bossBar.isVisible()) { + return true; + } else { + return false; + } + } + + public int numberOfActiveDurationBars(Player p) { + int numberOfBarsActive = 0; + for (int i = 1; i < 4; i++) { + if (isDurationBarActive(p, i)) { + numberOfBarsActive += 1; + } + } + return numberOfBarsActive; + } + + public BossBar getLowestUnoccupiedBar(Player p) { + if (!isDurationBarActive(p, 1)) { + return getPlayerDurationBar1(p); + } else if (!isDurationBarActive(p, 2)) { + return getPlayerDurationBar2(p); + } else if (!isDurationBarActive(p, 3)) { + return getPlayerDurationBar3(p); + } + return null; + + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/BrewingStandUserTracker.java b/src/main/java/mc/carlton/freerpg/utils/game/BrewingStandUserTracker.java new file mode 100644 index 0000000..9dc70e0 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/BrewingStandUserTracker.java @@ -0,0 +1,38 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import org.bukkit.block.BrewingStand; +import org.bukkit.entity.Player; + +public class BrewingStandUserTracker { + + static Map standPlayerMap = new ConcurrentHashMap<>(); + + public void addstand(BrewingStand stand, Player player) { + if (stand instanceof BrewingStand) { + standPlayerMap.put(stand, player); + } + } + + public Player getPlayer(BrewingStand stand) { + if (stand instanceof BrewingStand) { + if (standPlayerMap.containsKey(stand)) { + return standPlayerMap.get(stand); + } + } + return null; + } + + public void removeStand(BrewingStand stand) { + standPlayerMap.remove(stand); + } + + public void removeAllPlayerStands(Player p) { + for (BrewingStand stand : standPlayerMap.keySet()) { + if (standPlayerMap.get(stand) == p) { + standPlayerMap.remove(stand); + } + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/EntityPickedUpItemStorage.java b/src/main/java/mc/carlton/freerpg/utils/game/EntityPickedUpItemStorage.java new file mode 100644 index 0000000..8d7bd86 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/EntityPickedUpItemStorage.java @@ -0,0 +1,96 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.utils.globalVariables.EntityGroups; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.inventory.EntityEquipment; +import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class EntityPickedUpItemStorage { + + public static Map> entityPickedUpItemsMap = new ConcurrentHashMap<>(); + + public void addEntity(LivingEntity entity) { + entityPickedUpItemsMap.putIfAbsent(entity, new HashSet<>()); + } + + public void addPickedUpItem(ItemStack itemStack, LivingEntity entity) { + Material material = itemStack.getType(); + addEntity(entity); + HashSet currentItemsPickedUp = entityPickedUpItemsMap.get(entity); + currentItemsPickedUp.add(material); + entityPickedUpItemsMap.put(entity, currentItemsPickedUp); + } + + public boolean wasItemPickedUp(ItemStack itemStack, LivingEntity entity) { + if (entityPickedUpItemsMap.containsKey(entity)) { + if (entityPickedUpItemsMap.get(entity).contains(itemStack.getType())) { + return true; + } + } + return false; + } + + public void removeEntity(LivingEntity entity) { + if (entityPickedUpItemsMap.containsKey(entity)) { + entityPickedUpItemsMap.remove(entity); + } + } + + public void addPickedUpItemFromDispenser(ItemStack item, Location location) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + EntityGroups entityGroups = new EntityGroups(); + List hostileMobs = entityGroups.getHostileMobs(); + Map> entity_EquipmentMap = new HashMap<>(); + for (Entity entity : location.getWorld().getNearbyEntities(location, 1, 1, 1)) { + if (hostileMobs.contains(entity.getType())) { + LivingEntity hostileMob = (LivingEntity) entity; + List equipment = getEntityEquipment(hostileMob); + entity_EquipmentMap.put(hostileMob, equipment); + } + } + if (entity_EquipmentMap.isEmpty()) { + return; + } + new BukkitRunnable() { + @Override + public void run() { + for (LivingEntity entity : entity_EquipmentMap.keySet()) { + List equipment = entity_EquipmentMap.get(entity); + List newEquipment = getEntityEquipment(entity); + for (int i = 0; i < equipment.size(); i++) { + if (!equipment.get(i).equals(newEquipment.get(i))) { + addPickedUpItem(item, entity); + break; + } + } + + } + } + }.runTaskLater(plugin, 1); + } + + public List getEntityEquipment(LivingEntity entity) { + EntityEquipment equipment = entity.getEquipment(); + List equipmentItems = new ArrayList<>(); + equipmentItems.add(equipment.getItemInMainHand()); + equipmentItems.add(equipment.getItemInOffHand()); + equipmentItems.add(equipment.getHelmet()); + equipmentItems.add(equipment.getChestplate()); + equipmentItems.add(equipment.getLeggings()); + equipmentItems.add(equipment.getBoots()); + return equipmentItems; + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/ExpFarmTracker.java b/src/main/java/mc/carlton/freerpg/utils/game/ExpFarmTracker.java new file mode 100644 index 0000000..e11d089 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/ExpFarmTracker.java @@ -0,0 +1,75 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import org.bukkit.Location; +import org.bukkit.World; +import org.bukkit.attribute.Attributable; +import org.bukkit.attribute.Attribute; +import org.bukkit.entity.Creature; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Golem; +import org.bukkit.entity.Monster; + +public class ExpFarmTracker { + + static HashSet expFarmLocations = new HashSet<>(); + + public double getExpFarmAndSpawnerCombinedMultiplier(Entity entity, String skillName) { + ConfigLoad configLoad = new ConfigLoad(); + Map spawnerEXPMultipliers = configLoad.getSpawnerEXPMultipliers(); + Map mobFarmEXPMultipliers = configLoad.getMobFarmEXPMultipliers(); + double multiplier = 1.0; + if (spawnerEXPMultipliers.containsKey(skillName)) { + if (entity.hasMetadata("frpgSpawnerMob")) { + multiplier *= spawnerEXPMultipliers.get(skillName); + } + } + if (mobFarmEXPMultipliers.containsKey(skillName)) { + if (isExpFarm(entity)) { + multiplier *= mobFarmEXPMultipliers.get(skillName); + } + } + return multiplier; + } + + + public boolean isExpFarm(Entity entity) { + Location location = entity.getLocation(); + World world = location.getWorld(); + for (Location expFarmLocation : expFarmLocations) { + if (world.equals(expFarmLocation.getWorld())) { + if (expFarmLocation.distance(location) < 3.0) { + return true; + } + } + } + return checkSurroundingMobs(world, location, entity); + } + + public boolean checkSurroundingMobs(World world, Location location, Entity entity) { + if (!(entity instanceof Monster) && !(entity instanceof Golem)) { + return false; + } + Collection nearbyEntities = world.getNearbyEntities(location, 1, 1, 1); + double HP = ((Attributable) entity).getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue(); + int numberOfLowHPEntitiesOfSameType = 0; + for (Entity surroundingEntity : nearbyEntities) { + if (surroundingEntity.getType().equals(entity.getType())) { + if (((Creature) surroundingEntity).getHealth() < HP * 0.2) { + numberOfLowHPEntitiesOfSameType += 1; + } + } + if (numberOfLowHPEntitiesOfSameType >= 5) { + break; + } + } + if (numberOfLowHPEntitiesOfSameType >= 5) { + expFarmLocations.add(location); + return true; + } + return false; + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/ExperienceBottleTracking.java b/src/main/java/mc/carlton/freerpg/utils/game/ExperienceBottleTracking.java new file mode 100644 index 0000000..8387a79 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/ExperienceBottleTracking.java @@ -0,0 +1,88 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import mc.carlton.freerpg.FreeRPG; +import org.bukkit.Location; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.ExperienceOrb; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class ExperienceBottleTracking { + + static Map trackedEXPOrbs = new ConcurrentHashMap<>(); + + public void addLocation(Location location) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + removeDeadEntities(); + trackedEXPOrbs.putIfAbsent(location, false); + new BukkitRunnable() { + @Override + public void run() { + for (Entity entity : location.getWorld().getNearbyEntities(location, 1, 1, 1)) { + if (entity.getType().equals(EntityType.EXPERIENCE_ORB)) { + trackedEXPOrbs.put(location, entity); + } + } + } + }.runTaskLater(plugin, 1); + } + + + public boolean fromEnchantingBottle( + Entity entity) { //Bug: False true for first exp picked up after throwing 2+(?) enchanting bottles and not collecting exp + Location orbLoc = entity.getLocation(); + for (Location originLocation : trackedEXPOrbs.keySet()) { + if (originLocation.getWorld().equals(orbLoc.getWorld())) { + if (originLocation.distance(orbLoc) <= 0.5) { + removeCloseOriginLocations(originLocation); + removeDeadEntities(); + return true; + } else if (!(trackedEXPOrbs.get(originLocation) instanceof Boolean)) { + if (entity.equals(trackedEXPOrbs.get(originLocation))) { + removeCloseOriginLocations(originLocation); + removeDeadEntities(); + return true; + } + } + } + } + removeDeadEntities(); + return false; + /* + boolean fromBottle = false; + for (ExperienceOrb experienceOrb : trackedEXPOrbs.keySet()) { + if (experienceOrb.isDead()) { + trackedEXPOrbs.remove(experienceOrb); + fromBottle = true; + } + } + return fromBottle; + + */ + } + + public void removeCloseOriginLocations(Location location) { + for (Location originLocation : trackedEXPOrbs.keySet()) { + if (originLocation.getWorld().equals(location.getWorld())) { + if (location.distance(originLocation) <= 1) { + trackedEXPOrbs.remove(originLocation); + } + } + } + } + + public void removeDeadEntities() { + for (Location originLocation : trackedEXPOrbs.keySet()) { + Object trackedObject = trackedEXPOrbs.get(originLocation); + if (trackedObject instanceof Entity) { + if (((ExperienceOrb) trackedObject).isDead()) { + trackedEXPOrbs.remove(originLocation); + } + } + } + } + +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/FireworkShotByPlayerTracker.java b/src/main/java/mc/carlton/freerpg/utils/game/FireworkShotByPlayerTracker.java new file mode 100644 index 0000000..82bab37 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/FireworkShotByPlayerTracker.java @@ -0,0 +1,32 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Firework; +import org.bukkit.entity.Player; + +public class FireworkShotByPlayerTracker { + + static Map fireWorkPlayerMap = new ConcurrentHashMap<>(); + + public void addFirework(Entity firework, Player player) { + if (firework instanceof Firework) { + fireWorkPlayerMap.put(firework.getUniqueId(), player); + } + } + + public Player getPlayer(Entity firework) { + if (firework instanceof Firework) { + if (fireWorkPlayerMap.containsKey(firework.getUniqueId())) { + return fireWorkPlayerMap.get(firework.getUniqueId()); + } + } + return null; + } + + public void removeFireWork(Entity firework) { + fireWorkPlayerMap.remove(firework); + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/FurnaceUserTracker.java b/src/main/java/mc/carlton/freerpg/utils/game/FurnaceUserTracker.java new file mode 100644 index 0000000..ad3eb7c --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/FurnaceUserTracker.java @@ -0,0 +1,84 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.bukkit.scheduler.BukkitRunnable; + +public class FurnaceUserTracker { + + static Map furnaceLocationPlayerMap = new ConcurrentHashMap<>(); + static Map playerRemoveFurnacesTaskIdMap = new ConcurrentHashMap<>(); + static Map waitingOnTaskMap = new ConcurrentHashMap<>(); + + public void addfurnaceLocation(Location furnaceLocation, Player player) { + if (furnaceLocation instanceof Location && player instanceof Player) { + furnaceLocationPlayerMap.put(furnaceLocation, player); + } + } + + public Player getPlayer(Location furnaceLocation) { + if (furnaceLocation instanceof Location) { + if (furnaceLocationPlayerMap.containsKey(furnaceLocation)) { + return furnaceLocationPlayerMap.get(furnaceLocation); + } + } + return null; + } + + public boolean getWaitingOnTask(Location furnaceLoc) { + if (waitingOnTaskMap.containsKey(furnaceLoc)) { + return waitingOnTaskMap.get(furnaceLoc); + } else { + return false; + } + } + + public void setWaitingOnTaskMap(boolean isWaiting, Location furnaceLoc) { + waitingOnTaskMap.put(furnaceLoc, isWaiting); + } + + public void removeWaitingOnTaskMap(Location furnaceLoc) { + if (waitingOnTaskMap.containsKey(furnaceLoc)) { + waitingOnTaskMap.remove(furnaceLoc); + } + } + + public void removefurnaceLocation(Location furnaceLocation) { + furnaceLocationPlayerMap.remove(furnaceLocation); + } + + public void removeAllPlayerfurnaceLocations(Player p) { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + ConfigLoad configLoad = new ConfigLoad(); + int removeFurnaceTimer = 20 * configLoad.getFurnaceDeleteTimer(); + int taskID = new BukkitRunnable() { + @Override + public void run() { + for (Location furnaceLocation : furnaceLocationPlayerMap.keySet()) { + if (furnaceLocationPlayerMap.get(furnaceLocation) == p) { + furnaceLocationPlayerMap.remove(furnaceLocation); + } + } + if (playerRemoveFurnacesTaskIdMap.containsKey(p.getUniqueId())) { + playerRemoveFurnacesTaskIdMap.remove(p.getUniqueId()); + } + } + }.runTaskLater(plugin, removeFurnaceTimer).getTaskId(); + playerRemoveFurnacesTaskIdMap.put(p.getUniqueId(), taskID); + + } + + public void playerLogin(Player p) { + if (playerRemoveFurnacesTaskIdMap.containsKey(p.getUniqueId())) { + int taskID = (int) playerRemoveFurnacesTaskIdMap.get(p.getUniqueId()); + Bukkit.getScheduler().cancelTask(taskID); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/HorseRiding.java b/src/main/java/mc/carlton/freerpg/utils/game/HorseRiding.java new file mode 100644 index 0000000..e87aeef --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/HorseRiding.java @@ -0,0 +1,61 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.entity.Player; + +public class HorseRiding { + + static Map taskMap = new ConcurrentHashMap<>(); + static Map mountPlayerMap = new ConcurrentHashMap<>(); + static Map playerLocationMap = new ConcurrentHashMap<>(); + + public void setTaskMap(int taskID, Player p) { + taskMap.put(p, taskID); + } + + public void setMountPlayerMap(UUID entityUUID, Player p) { + mountPlayerMap.put(entityUUID, p); + } + + public void setPlayerLocationMap(Player p) { + playerLocationMap.put(p, p.getLocation()); + } + + public Integer getTask(Player p) { + return taskMap.get(p); + } + + public Player getPlayerFromMount(UUID mountUUID) { + if (mountPlayerMap.containsKey(mountUUID)) { + Player toReturn = mountPlayerMap.get(mountUUID); + mountPlayerMap.remove(mountUUID); + return toReturn; + } + return null; + + } + + public Location getOldLocation(Player p) { + return playerLocationMap.get(p); + } + + public void deletePlayerData(Player p) { + if (taskMap.containsKey(p)) { + Bukkit.getScheduler().cancelTask(taskMap.get(p)); + taskMap.remove(p); + } + if (playerLocationMap.containsKey(p)) { + playerLocationMap.remove(p); + } + for (UUID i : mountPlayerMap.keySet()) { + if (mountPlayerMap.get(i) == p) { + mountPlayerMap.remove(i); + } + } + } + +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/LanguageSelector.java b/src/main/java/mc/carlton/freerpg/utils/game/LanguageSelector.java new file mode 100644 index 0000000..3d968ef --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/LanguageSelector.java @@ -0,0 +1,94 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.player.PlayerStats; +import mc.carlton.freerpg.utils.globalVariables.StringsAndOtherData; +import org.bukkit.entity.Player; + +public class LanguageSelector { + + Player p; + String playerLanguage; + + + public LanguageSelector(Player player) { + if (player != null) { + this.p = player; + PlayerStats languageStat = new PlayerStats(p); + ConfigLoad configLoad = new ConfigLoad(); + if (configLoad.isForceLanguage()) { + this.playerLanguage = configLoad.getDefaultLanguage(); + } else { + this.playerLanguage = languageStat.getPlayerLanguage(); + } + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + } + } + + /** + * Translates a string into english assuming pieces identified by ::translateable;: are a id + * + * @param message a String that may contain identifier for parts of string to be translated + * Example: "/frpg help [::page::]" --> "/frpg help [page]" + * @return + */ + public static String getEnglishMessage(String message) { + return translateMessage(message, "enUs"); + } + + /** + * @param message a String that may contain identifier for parts of string to be translated + * Example: "/frpg help [$:page:$]" --> "/frpg help [page]" + * @param languageCode a valid language identifier found in languages.yml + * @return + */ + public static String translateMessage(String message, String languageCode) { + String[] splitString = message.split("::"); + String translatedMessage = ""; + for (int i = 0; i < splitString.length; i++) { + if (i % 2 == 0) { //Even indicies are never translated + translatedMessage += splitString[i]; + } else { //Odd indicies are always translated + translatedMessage += getString(splitString[i], languageCode); + } + } + return translatedMessage; + } + + public static String getString(String id, + String languageCode) { //Used if we want to ignore the player's language choice + String text = ""; + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + Map idToStringMap = stringsAndOtherData.getIdToStringMap(); + Object text0 = idToStringMap.get(languageCode + "." + id); + if (text0 != null) { + text = text0.toString(); + } else { + text = id; //If the text isn't found, the next best thing is the identifier + } + return text; + } + + public String getLanguage() { + return playerLanguage; + } + + public String getString(String id) { + return getString(id, playerLanguage); + } + + /** + * Translates a string into the player's preffered language assuming pieces identified by + * $:translateable;$ are a id + * + * @param message a String that may contain identifier for parts of string to be translated + * Example: "/frpg help [$:page:$]" --> "/frpg help [page]" + * @return + */ + public String translateMessage(String message) { + return translateMessage(message, playerLanguage); + } + + +} diff --git a/src/main/java/mc/carlton/freerpg/utils/game/PsuedoEnchanting.java b/src/main/java/mc/carlton/freerpg/utils/game/PsuedoEnchanting.java new file mode 100644 index 0000000..f85fae2 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/PsuedoEnchanting.java @@ -0,0 +1,502 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.core.info.server.MinecraftVersion; +import org.apache.logging.log4j.Level; +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.EnchantmentStorageMeta; +import org.bukkit.inventory.meta.ItemMeta; + +public class PsuedoEnchanting { + + Map toolEnchantMap = new HashMap<>(); + Map itemEnchantTypeMap = new HashMap<>(); + Map enchantmentWeightMap = new HashMap<>(); + Map enchantmentBracketMap = new HashMap<>(); + + Random rand = new Random(); + + public PsuedoEnchanting() { + //toolEnchantMao + MinecraftVersion minecraftVersion = new MinecraftVersion(); + double mcVersion = minecraftVersion.getMinecraftVersionAsDouble(); + + toolEnchantMap.put("chestplate", + new Enchantment[]{Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.VANISHING_CURSE, + Enchantment.PROTECTION_ENVIRONMENTAL, Enchantment.PROTECTION_EXPLOSIONS, + Enchantment.PROTECTION_FIRE, Enchantment.PROTECTION_PROJECTILE, Enchantment.THORNS, + Enchantment.BINDING_CURSE}); + toolEnchantMap.put("leggings", + new Enchantment[]{Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.VANISHING_CURSE, + Enchantment.PROTECTION_ENVIRONMENTAL, Enchantment.PROTECTION_EXPLOSIONS, + Enchantment.PROTECTION_FIRE, Enchantment.PROTECTION_PROJECTILE, + Enchantment.BINDING_CURSE}); + toolEnchantMap.put("boots", + new Enchantment[]{Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.VANISHING_CURSE, + Enchantment.PROTECTION_ENVIRONMENTAL, Enchantment.PROTECTION_EXPLOSIONS, + Enchantment.PROTECTION_FIRE, Enchantment.PROTECTION_PROJECTILE, + Enchantment.BINDING_CURSE, Enchantment.DEPTH_STRIDER, Enchantment.FROST_WALKER, + Enchantment.PROTECTION_FALL}); + toolEnchantMap.put("helmet", + new Enchantment[]{Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.VANISHING_CURSE, + Enchantment.PROTECTION_ENVIRONMENTAL, Enchantment.PROTECTION_EXPLOSIONS, + Enchantment.PROTECTION_FIRE, Enchantment.PROTECTION_PROJECTILE, + Enchantment.BINDING_CURSE, Enchantment.WATER_WORKER, Enchantment.OXYGEN}); + toolEnchantMap.put("sword", + new Enchantment[]{Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.VANISHING_CURSE, + Enchantment.DAMAGE_ALL, Enchantment.DAMAGE_ARTHROPODS, Enchantment.DAMAGE_UNDEAD, + Enchantment.KNOCKBACK, Enchantment.FIRE_ASPECT, Enchantment.LOOT_BONUS_MOBS, + Enchantment.SWEEPING_EDGE}); + toolEnchantMap.put("tool", + new Enchantment[]{Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.VANISHING_CURSE, + Enchantment.DIG_SPEED, Enchantment.LOOT_BONUS_BLOCKS, Enchantment.SILK_TOUCH}); + toolEnchantMap.put("bow", + new Enchantment[]{Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.VANISHING_CURSE, + Enchantment.ARROW_DAMAGE, Enchantment.ARROW_FIRE, Enchantment.ARROW_INFINITE, + Enchantment.ARROW_KNOCKBACK}); + toolEnchantMap.put("rod", + new Enchantment[]{Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.VANISHING_CURSE, + Enchantment.LUCK, Enchantment.LURE}); + toolEnchantMap.put("trident", + new Enchantment[]{Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.VANISHING_CURSE, + Enchantment.LOYALTY, Enchantment.IMPALING, Enchantment.RIPTIDE, + Enchantment.CHANNELING}); + toolEnchantMap.put("crossbow", + new Enchantment[]{Enchantment.DURABILITY, Enchantment.MENDING, Enchantment.VANISHING_CURSE, + Enchantment.QUICK_CHARGE, Enchantment.MULTISHOT, Enchantment.PIERCING}); + Enchantment[] holder = new Enchantment[]{Enchantment.DURABILITY, Enchantment.MENDING, + Enchantment.VANISHING_CURSE, Enchantment.PIERCING, Enchantment.MULTISHOT, + Enchantment.QUICK_CHARGE, Enchantment.CHANNELING, Enchantment.RIPTIDE, Enchantment.IMPALING, + Enchantment.LOYALTY, Enchantment.LURE, Enchantment.LUCK, + Enchantment.ARROW_INFINITE, Enchantment.ARROW_KNOCKBACK, Enchantment.ARROW_FIRE, + Enchantment.ARROW_DAMAGE, Enchantment.SILK_TOUCH, Enchantment.LOOT_BONUS_BLOCKS, + Enchantment.DIG_SPEED, Enchantment.SWEEPING_EDGE, Enchantment.LOOT_BONUS_MOBS, + Enchantment.FIRE_ASPECT, + Enchantment.DAMAGE_UNDEAD, Enchantment.KNOCKBACK, Enchantment.DAMAGE_ARTHROPODS, + Enchantment.DAMAGE_ALL, Enchantment.BINDING_CURSE, Enchantment.THORNS, + Enchantment.FROST_WALKER, Enchantment.DEPTH_STRIDER, Enchantment.OXYGEN, + Enchantment.PROTECTION_EXPLOSIONS, + Enchantment.WATER_WORKER, Enchantment.PROTECTION_PROJECTILE, Enchantment.PROTECTION_FIRE, + Enchantment.PROTECTION_FALL, Enchantment.PROTECTION_ENVIRONMENTAL}; + toolEnchantMap.put("book", holder); + + //itemEnchantMap + + itemEnchantTypeMap.put(Material.DIAMOND_SWORD, new Object[]{"sword", 10}); + itemEnchantTypeMap.put(Material.STONE_SWORD, new Object[]{"sword", 5}); + itemEnchantTypeMap.put(Material.GOLDEN_SWORD, new Object[]{"sword", 22}); + itemEnchantTypeMap.put(Material.IRON_SWORD, new Object[]{"sword", 14}); + itemEnchantTypeMap.put(Material.WOODEN_SWORD, new Object[]{"sword", 15}); + itemEnchantTypeMap.put(Material.DIAMOND_AXE, new Object[]{"tool", 10}); + itemEnchantTypeMap.put(Material.STONE_AXE, new Object[]{"tool", 5}); + itemEnchantTypeMap.put(Material.GOLDEN_AXE, new Object[]{"tool", 22}); + itemEnchantTypeMap.put(Material.IRON_AXE, new Object[]{"tool", 14}); + itemEnchantTypeMap.put(Material.WOODEN_AXE, new Object[]{"tool", 15}); + itemEnchantTypeMap.put(Material.DIAMOND_PICKAXE, new Object[]{"tool", 10}); + itemEnchantTypeMap.put(Material.STONE_PICKAXE, new Object[]{"tool", 5}); + itemEnchantTypeMap.put(Material.GOLDEN_PICKAXE, new Object[]{"tool", 22}); + itemEnchantTypeMap.put(Material.IRON_PICKAXE, new Object[]{"tool", 14}); + itemEnchantTypeMap.put(Material.WOODEN_PICKAXE, new Object[]{"tool", 15}); + itemEnchantTypeMap.put(Material.DIAMOND_SHOVEL, new Object[]{"tool", 10}); + itemEnchantTypeMap.put(Material.STONE_SHOVEL, new Object[]{"tool", 5}); + itemEnchantTypeMap.put(Material.GOLDEN_SHOVEL, new Object[]{"tool", 22}); + itemEnchantTypeMap.put(Material.IRON_SHOVEL, new Object[]{"tool", 14}); + itemEnchantTypeMap.put(Material.WOODEN_SHOVEL, new Object[]{"tool", 15}); + itemEnchantTypeMap.put(Material.BOW, new Object[]{"bow", 1}); + itemEnchantTypeMap.put(Material.ENCHANTED_BOOK, new Object[]{"book", 1}); + itemEnchantTypeMap.put(Material.BOOK, new Object[]{"book", 1}); + itemEnchantTypeMap.put(Material.FISHING_ROD, new Object[]{"rod", 1}); + itemEnchantTypeMap.put(Material.TRIDENT, new Object[]{"trident", 1}); + itemEnchantTypeMap.put(Material.CROSSBOW, new Object[]{"crossbow", 1}); + itemEnchantTypeMap.put(Material.CHAINMAIL_HELMET, new Object[]{"helmet", 12}); + itemEnchantTypeMap.put(Material.DIAMOND_HELMET, new Object[]{"helmet", 10}); + itemEnchantTypeMap.put(Material.GOLDEN_HELMET, new Object[]{"helmet", 25}); + itemEnchantTypeMap.put(Material.IRON_HELMET, new Object[]{"helmet", 9}); + itemEnchantTypeMap.put(Material.LEATHER_HELMET, new Object[]{"helmet", 15}); + itemEnchantTypeMap.put(Material.TURTLE_HELMET, new Object[]{"helmet", 1}); + itemEnchantTypeMap.put(Material.CHAINMAIL_CHESTPLATE, new Object[]{"chestplate", 12}); + itemEnchantTypeMap.put(Material.DIAMOND_CHESTPLATE, new Object[]{"chestplate", 10}); + itemEnchantTypeMap.put(Material.GOLDEN_CHESTPLATE, new Object[]{"chestplate", 25}); + itemEnchantTypeMap.put(Material.IRON_CHESTPLATE, new Object[]{"chestplate", 9}); + itemEnchantTypeMap.put(Material.LEATHER_CHESTPLATE, new Object[]{"chestplate", 15}); + itemEnchantTypeMap.put(Material.LEATHER_LEGGINGS, new Object[]{"leggings", 15}); + itemEnchantTypeMap.put(Material.CHAINMAIL_LEGGINGS, new Object[]{"leggings", 12}); + itemEnchantTypeMap.put(Material.DIAMOND_LEGGINGS, new Object[]{"leggings", 10}); + itemEnchantTypeMap.put(Material.GOLDEN_LEGGINGS, new Object[]{"leggings", 25}); + itemEnchantTypeMap.put(Material.IRON_LEGGINGS, new Object[]{"leggings", 9}); + itemEnchantTypeMap.put(Material.CHAINMAIL_BOOTS, new Object[]{"boots", 12}); + itemEnchantTypeMap.put(Material.DIAMOND_BOOTS, new Object[]{"boots", 10}); + itemEnchantTypeMap.put(Material.GOLDEN_BOOTS, new Object[]{"boots", 25}); + itemEnchantTypeMap.put(Material.IRON_BOOTS, new Object[]{"boots", 9}); + itemEnchantTypeMap.put(Material.LEATHER_BOOTS, new Object[]{"boots", 15}); + + if (mcVersion >= 1.16) { + itemEnchantTypeMap.put(Material.NETHERITE_SWORD, new Object[]{"sword", 15}); + itemEnchantTypeMap.put(Material.NETHERITE_AXE, new Object[]{"tool", 15}); + itemEnchantTypeMap.put(Material.NETHERITE_PICKAXE, new Object[]{"tool", 15}); + itemEnchantTypeMap.put(Material.NETHERITE_SHOVEL, new Object[]{"tool", 15}); + itemEnchantTypeMap.put(Material.NETHERITE_HELMET, new Object[]{"helmet", 15}); + itemEnchantTypeMap.put(Material.NETHERITE_CHESTPLATE, new Object[]{"chestplate", 15}); + itemEnchantTypeMap.put(Material.NETHERITE_LEGGINGS, new Object[]{"leggings", 15}); + itemEnchantTypeMap.put(Material.NETHERITE_BOOTS, new Object[]{"boots", 15}); + } + + enchantmentWeightMap.put(Enchantment.PROTECTION_ENVIRONMENTAL, 10); + enchantmentWeightMap.put(Enchantment.PROTECTION_FALL, 5); + enchantmentWeightMap.put(Enchantment.PROTECTION_FIRE, 5); + enchantmentWeightMap.put(Enchantment.PROTECTION_PROJECTILE, 5); + enchantmentWeightMap.put(Enchantment.WATER_WORKER, 2); + enchantmentWeightMap.put(Enchantment.PROTECTION_EXPLOSIONS, 2); + enchantmentWeightMap.put(Enchantment.OXYGEN, 2); + enchantmentWeightMap.put(Enchantment.DEPTH_STRIDER, 2); + enchantmentWeightMap.put(Enchantment.FROST_WALKER, 2); + enchantmentWeightMap.put(Enchantment.THORNS, 1); + enchantmentWeightMap.put(Enchantment.BINDING_CURSE, 1); + enchantmentWeightMap.put(Enchantment.DAMAGE_ALL, 10); + enchantmentWeightMap.put(Enchantment.DAMAGE_ARTHROPODS, 5); + enchantmentWeightMap.put(Enchantment.KNOCKBACK, 5); + enchantmentWeightMap.put(Enchantment.DAMAGE_UNDEAD, 5); + enchantmentWeightMap.put(Enchantment.FIRE_ASPECT, 2); + enchantmentWeightMap.put(Enchantment.LOOT_BONUS_MOBS, 2); + enchantmentWeightMap.put(Enchantment.SWEEPING_EDGE, 2); + enchantmentWeightMap.put(Enchantment.DIG_SPEED, 10); + enchantmentWeightMap.put(Enchantment.LOOT_BONUS_BLOCKS, 2); + enchantmentWeightMap.put(Enchantment.SILK_TOUCH, 2); + enchantmentWeightMap.put(Enchantment.ARROW_DAMAGE, 10); + enchantmentWeightMap.put(Enchantment.ARROW_FIRE, 2); + enchantmentWeightMap.put(Enchantment.ARROW_KNOCKBACK, 2); + enchantmentWeightMap.put(Enchantment.ARROW_INFINITE, 1); + enchantmentWeightMap.put(Enchantment.LUCK, 2); + enchantmentWeightMap.put(Enchantment.LURE, 2); + enchantmentWeightMap.put(Enchantment.LOYALTY, 5); + enchantmentWeightMap.put(Enchantment.IMPALING, 2); + enchantmentWeightMap.put(Enchantment.RIPTIDE, 2); + enchantmentWeightMap.put(Enchantment.CHANNELING, 1); + enchantmentWeightMap.put(Enchantment.QUICK_CHARGE, 10); + enchantmentWeightMap.put(Enchantment.MULTISHOT, 3); + enchantmentWeightMap.put(Enchantment.PIERCING, 30); + enchantmentWeightMap.put(Enchantment.DURABILITY, 5); + enchantmentWeightMap.put(Enchantment.MENDING, 2); + enchantmentWeightMap.put(Enchantment.VANISHING_CURSE, 1); + + enchantmentBracketMap.put(Enchantment.PROTECTION_ENVIRONMENTAL, + new Integer[]{1, 12, 12, 23, 23, 34, 34, 45}); + enchantmentBracketMap.put(Enchantment.PROTECTION_FALL, + new Integer[]{5, 11, 11, 17, 17, 23, 23, 29}); + enchantmentBracketMap.put(Enchantment.PROTECTION_FIRE, + new Integer[]{10, 18, 18, 26, 26, 34, 34, 42}); + enchantmentBracketMap.put(Enchantment.PROTECTION_PROJECTILE, + new Integer[]{3, 9, 9, 15, 15, 21, 21, 27}); + enchantmentBracketMap.put(Enchantment.WATER_WORKER, new Integer[]{1, 41}); + enchantmentBracketMap.put(Enchantment.PROTECTION_EXPLOSIONS, + new Integer[]{5, 13, 13, 21, 21, 29, 29, 37}); + enchantmentBracketMap.put(Enchantment.OXYGEN, new Integer[]{10, 40, 20, 50, 30, 60}); + enchantmentBracketMap.put(Enchantment.DEPTH_STRIDER, new Integer[]{10, 25, 20, 35, 30, 45}); + enchantmentBracketMap.put(Enchantment.FROST_WALKER, new Integer[]{10, 25}); + enchantmentBracketMap.put(Enchantment.THORNS, new Integer[]{10, 61, 30, 71, 50, 81}); + enchantmentBracketMap.put(Enchantment.BINDING_CURSE, new Integer[]{25, 50}); + enchantmentBracketMap.put(Enchantment.DAMAGE_ALL, + new Integer[]{1, 21, 12, 32, 23, 43, 34, 54, 45, 65}); + enchantmentBracketMap.put(Enchantment.DAMAGE_ARTHROPODS, + new Integer[]{5, 12, 13, 33, 21, 41, 29, 49, 37, 57}); + enchantmentBracketMap.put(Enchantment.KNOCKBACK, new Integer[]{5, 61, 25, 71}); + enchantmentBracketMap.put(Enchantment.DAMAGE_UNDEAD, + new Integer[]{5, 12, 13, 33, 21, 41, 29, 49, 37, 57}); + enchantmentBracketMap.put(Enchantment.FIRE_ASPECT, new Integer[]{10, 61, 30, 71}); + enchantmentBracketMap.put(Enchantment.LOOT_BONUS_MOBS, new Integer[]{15, 61, 24, 71, 33, 81}); + enchantmentBracketMap.put(Enchantment.SWEEPING_EDGE, new Integer[]{5, 20, 14, 29, 23, 38}); + enchantmentBracketMap.put(Enchantment.DIG_SPEED, + new Integer[]{1, 61, 11, 71, 21, 81, 31, 91, 41, 101}); + enchantmentBracketMap.put(Enchantment.LOOT_BONUS_BLOCKS, new Integer[]{15, 61, 24, 71, 33, 81}); + enchantmentBracketMap.put(Enchantment.SILK_TOUCH, new Integer[]{15, 81}); + enchantmentBracketMap.put(Enchantment.ARROW_DAMAGE, + new Integer[]{1, 16, 11, 26, 21, 36, 31, 46, 41, 56}); + enchantmentBracketMap.put(Enchantment.ARROW_FIRE, new Integer[]{20, 50}); + enchantmentBracketMap.put(Enchantment.ARROW_KNOCKBACK, new Integer[]{12, 37, 32, 57}); + enchantmentBracketMap.put(Enchantment.ARROW_INFINITE, new Integer[]{20, 50}); + enchantmentBracketMap.put(Enchantment.LUCK, new Integer[]{15, 61, 24, 71, 33, 81}); + enchantmentBracketMap.put(Enchantment.LURE, new Integer[]{15, 61, 24, 71, 33, 81}); + enchantmentBracketMap.put(Enchantment.LOYALTY, new Integer[]{12, 50, 19, 50, 26, 50}); + enchantmentBracketMap.put(Enchantment.IMPALING, + new Integer[]{1, 21, 9, 29, 17, 37, 25, 45, 33, 53}); + enchantmentBracketMap.put(Enchantment.RIPTIDE, new Integer[]{17, 50, 24, 50, 31, 50}); + enchantmentBracketMap.put(Enchantment.CHANNELING, new Integer[]{25, 50}); + enchantmentBracketMap.put(Enchantment.QUICK_CHARGE, new Integer[]{12, 50, 32, 50, 42, 50}); + enchantmentBracketMap.put(Enchantment.MULTISHOT, new Integer[]{20, 50}); + enchantmentBracketMap.put(Enchantment.PIERCING, new Integer[]{1, 50, 11, 50, 21, 50, 31, 50}); + enchantmentBracketMap.put(Enchantment.DURABILITY, new Integer[]{5, 61, 13, 71, 21, 81}); + enchantmentBracketMap.put(Enchantment.MENDING, new Integer[]{25, 75}); + enchantmentBracketMap.put(Enchantment.VANISHING_CURSE, new Integer[]{25, 50}); + } + + public void printInfo() { + for (Enchantment enchant : enchantmentWeightMap.keySet()) { + FreeRPG.log(Level.INFO, String.valueOf(enchant.getKey())); + } + } + + public ItemStack enchantItem(ItemStack item, int level, boolean isTreasure) { + //Getting data + Material itemType = item.getType(); + if (!itemEnchantTypeMap.containsKey(itemType)) { + return item; //Does not enchant the item if it is not contained + } + int enchantability = (int) itemEnchantTypeMap.get(itemType)[1]; + Enchantment[] possibleEnchants0 = toolEnchantMap.get( + (String) itemEnchantTypeMap.get(itemType)[0]); + Map enchantment_level = new HashMap<>(); + ItemStack enchantedItem = item; + ItemMeta meta = enchantedItem.getItemMeta(); + + ArrayList possibleEnchants = new ArrayList<>(Arrays.asList(possibleEnchants0)); + if (!isTreasure) { + if (possibleEnchants.contains(Enchantment.BINDING_CURSE)) { + possibleEnchants.remove(Enchantment.BINDING_CURSE); + } + if (possibleEnchants.contains(Enchantment.VANISHING_CURSE)) { + possibleEnchants.remove(Enchantment.VANISHING_CURSE); + } + if (possibleEnchants.contains(Enchantment.MENDING)) { + possibleEnchants.remove(Enchantment.MENDING); + } + } + + //Determining modified level + int rand_enchantability = 1 + rand.nextInt(Math.round(enchantability / 4 + 1)) + rand.nextInt( + Math.round(enchantability / 4 + 1)); + + int k = level + rand_enchantability; + + double rand_bonus_percent = 1 + (rand.nextDouble() + rand.nextDouble() - 1) * 0.15; + + int modifiedLevel = (int) Math.round(k * rand_bonus_percent); + if (modifiedLevel < 1) { + modifiedLevel = 1; + } + + //Finding possible enchants + int T = 0; + for (Enchantment enchant : possibleEnchants) { + Integer[] brackets = enchantmentBracketMap.get(enchant); + int power = brackets.length / 2; + for (int i = 0; i < power; i++) { + if (brackets[2 * i] <= modifiedLevel && brackets[2 * i + 1] >= modifiedLevel) { + if (enchantment_level.containsKey(enchant)) { + enchantment_level.put(enchant, i + 1); + } else { + enchantment_level.put(enchant, i + 1); + T += enchantmentWeightMap.get(enchant); + } + } + } + } + if (T < 1) { + T = 1; + } + + //Picking enchantment + int w = rand.nextInt(T); + for (Enchantment enchant : enchantment_level.keySet()) { + w = w - enchantmentWeightMap.get(enchant); + if (w < 0) { + if (enchantedItem.getType() == Material.BOOK + || enchantedItem.getType() == Material.ENCHANTED_BOOK) { + ((EnchantmentStorageMeta) meta).addStoredEnchant(enchant, enchantment_level.get(enchant), + false); + enchantedItem.setItemMeta(meta); + } else { + enchantedItem.addUnsafeEnchantment(enchant, enchantment_level.get(enchant)); + } + break; + } + } + + return moreEnchants(enchantedItem, (int) Math.round(modifiedLevel), enchantment_level); + + + } + + public ItemStack moreEnchants(ItemStack enchanted_Item, int modifiedLevel, + Map possibleEnchants) { + ItemStack enchantedItem = enchanted_Item; + ItemMeta meta = enchantedItem.getItemMeta(); + Map enchants = enchanted_Item.getEnchantments(); + if (enchantedItem.getType() == Material.BOOK + && enchantedItem.getType() == Material.ENCHANTED_BOOK) { + enchants = ((EnchantmentStorageMeta) meta).getStoredEnchants(); + } + double prob = (modifiedLevel + 1) / 50.0; + if (prob < rand.nextDouble()) { + return enchantedItem; + } + for (Enchantment enchantment : enchants.keySet()) { + if (enchantment.equals(Enchantment.DAMAGE_ALL) || enchantment.equals( + Enchantment.DAMAGE_ARTHROPODS) || enchantment.equals(Enchantment.DAMAGE_UNDEAD)) { + if (possibleEnchants.containsKey(Enchantment.DAMAGE_ALL)) { + possibleEnchants.remove(Enchantment.DAMAGE_ALL); + } + if (possibleEnchants.containsKey(Enchantment.DAMAGE_ARTHROPODS)) { + possibleEnchants.remove(Enchantment.DAMAGE_ARTHROPODS); + } + if (possibleEnchants.containsKey(Enchantment.DAMAGE_UNDEAD)) { + possibleEnchants.remove(Enchantment.DAMAGE_UNDEAD); + } + } else if (enchantment.equals(Enchantment.PROTECTION_ENVIRONMENTAL) || enchantment.equals( + Enchantment.PROTECTION_EXPLOSIONS) || enchantment.equals(Enchantment.PROTECTION_FIRE) + || enchantment.equals(Enchantment.PROTECTION_PROJECTILE)) { + if (possibleEnchants.containsKey(Enchantment.PROTECTION_ENVIRONMENTAL)) { + possibleEnchants.remove(Enchantment.PROTECTION_ENVIRONMENTAL); + } + if (possibleEnchants.containsKey(Enchantment.PROTECTION_EXPLOSIONS)) { + possibleEnchants.remove(Enchantment.PROTECTION_EXPLOSIONS); + } + if (possibleEnchants.containsKey(Enchantment.PROTECTION_PROJECTILE)) { + possibleEnchants.remove(Enchantment.PROTECTION_PROJECTILE); + } + if (possibleEnchants.containsKey(Enchantment.PROTECTION_FIRE)) { + possibleEnchants.remove(Enchantment.PROTECTION_FIRE); + } + } else if (enchantment.equals(Enchantment.SILK_TOUCH) || enchantment.equals( + Enchantment.LOOT_BONUS_BLOCKS)) { + if (possibleEnchants.containsKey(Enchantment.SILK_TOUCH)) { + possibleEnchants.remove(Enchantment.SILK_TOUCH); + } + if (possibleEnchants.containsKey(Enchantment.LOOT_BONUS_BLOCKS)) { + possibleEnchants.remove(Enchantment.LOOT_BONUS_BLOCKS); + } + } else if (enchantment.equals(Enchantment.DEPTH_STRIDER) || enchantment.equals( + Enchantment.FROST_WALKER)) { + if (possibleEnchants.containsKey(Enchantment.DEPTH_STRIDER)) { + possibleEnchants.remove(Enchantment.DEPTH_STRIDER); + } + if (possibleEnchants.containsKey(Enchantment.FROST_WALKER)) { + possibleEnchants.remove(Enchantment.FROST_WALKER); + } + } else if (enchantment.equals(Enchantment.MENDING) || enchantment.equals( + Enchantment.ARROW_INFINITE)) { + if (possibleEnchants.containsKey(Enchantment.MENDING)) { + possibleEnchants.remove(Enchantment.MENDING); + } + if (possibleEnchants.containsKey(Enchantment.ARROW_INFINITE)) { + possibleEnchants.remove(Enchantment.ARROW_INFINITE); + } + } else if (enchantment.equals(Enchantment.RIPTIDE)) { + if (possibleEnchants.containsKey(Enchantment.LOYALTY)) { + possibleEnchants.remove(Enchantment.LOYALTY); + } + if (possibleEnchants.containsKey(Enchantment.RIPTIDE)) { + possibleEnchants.remove(Enchantment.RIPTIDE); + } + if (possibleEnchants.containsKey(Enchantment.CHANNELING)) { + possibleEnchants.remove(Enchantment.CHANNELING); + } + } else if (enchantment.equals(Enchantment.CHANNELING) || enchantment.equals( + Enchantment.LOYALTY)) { + if (possibleEnchants.containsKey(Enchantment.RIPTIDE)) { + possibleEnchants.remove(Enchantment.RIPTIDE); + } + } else if (enchantment.equals(Enchantment.MULTISHOT) || enchantment.equals( + Enchantment.PIERCING)) { + if (possibleEnchants.containsKey(Enchantment.MULTISHOT)) { + possibleEnchants.remove(Enchantment.MULTISHOT); + } + if (possibleEnchants.containsKey(Enchantment.PIERCING)) { + possibleEnchants.remove(Enchantment.PIERCING); + } + } + if (possibleEnchants.containsKey(enchantment)) { + possibleEnchants.remove(enchantment); + } + } + int T = 0; + for (Enchantment enchantment : possibleEnchants.keySet()) { + T += enchantmentWeightMap.get(enchantment); + } + if (T < 1) { + T = 1; + } + + int w = rand.nextInt(T); + for (Enchantment enchant : possibleEnchants.keySet()) { + w = w - enchantmentWeightMap.get(enchant); + if (w < 0) { + if (enchantedItem.getType() == Material.BOOK + || enchantedItem.getType() == Material.ENCHANTED_BOOK) { + ((EnchantmentStorageMeta) meta).addStoredEnchant(enchant, possibleEnchants.get(enchant), + false); + enchantedItem.setItemMeta(meta); + } else { + enchantedItem.addUnsafeEnchantment(enchant, possibleEnchants.get(enchant)); + } + break; + } + } + + return moreEnchants(enchantedItem, (int) Math.round(modifiedLevel / 2), possibleEnchants); + } + + public ItemStack addEnchant(ItemStack preEnchantedItem, int level, boolean isTreasure) { + //Getting data + Material itemType = preEnchantedItem.getType(); + if (!itemEnchantTypeMap.containsKey(itemType)) { + return preEnchantedItem; //Does not enchant the item if it is not contained + } + int enchantAbility = (int) itemEnchantTypeMap.get(itemType)[1]; + Enchantment[] possibleEnchants0 = toolEnchantMap.get( + (String) itemEnchantTypeMap.get(itemType)[0]); + Map enchantment_level = new HashMap<>(); + ItemStack enchantedItem = preEnchantedItem; + + ArrayList possibleEnchants = new ArrayList<>(Arrays.asList(possibleEnchants0)); + if (!isTreasure) { + if (possibleEnchants.contains(Enchantment.BINDING_CURSE)) { + possibleEnchants.remove(Enchantment.BINDING_CURSE); + } + if (possibleEnchants.contains(Enchantment.VANISHING_CURSE)) { + possibleEnchants.remove(Enchantment.VANISHING_CURSE); + } + if (possibleEnchants.contains(Enchantment.MENDING)) { + possibleEnchants.remove(Enchantment.MENDING); + } + } + + //Determining modified level + int rand_enchantability = 1 + rand.nextInt(Math.round(enchantAbility / 4 + 1)) + rand.nextInt( + Math.round(enchantAbility / 4 + 1)); + + int k = level + rand_enchantability; + + double rand_bonus_percent = 1 + (rand.nextDouble() + rand.nextDouble() - 1) * 0.15; + + int modifiedLevel = (int) Math.round(k * rand_bonus_percent); + if (modifiedLevel < 1) { + modifiedLevel = 1; + } + + //Finding possible enchants + int T = 0; + for (Enchantment enchant : possibleEnchants) { + Integer[] brackets = enchantmentBracketMap.get(enchant); + int power = brackets.length / 2; + for (int i = 0; i < power; i++) { + if (brackets[2 * i] <= modifiedLevel && brackets[2 * i + 1] >= modifiedLevel) { + if (enchantment_level.containsKey(enchant)) { + enchantment_level.put(enchant, i + 1); + } else { + enchantment_level.put(enchant, i + 1); + T += enchantmentWeightMap.get(enchant); + } + } + } + } + + return moreEnchants(enchantedItem, (int) Math.round(modifiedLevel), enchantment_level); + } +} diff --git a/src/main/java/mc/carlton/freerpg/gameTools/ScoreboardOperations.java b/src/main/java/mc/carlton/freerpg/utils/game/ScoreboardOperations.java similarity index 56% rename from src/main/java/mc/carlton/freerpg/gameTools/ScoreboardOperations.java rename to src/main/java/mc/carlton/freerpg/utils/game/ScoreboardOperations.java index 3398d12..ddacdb4 100644 --- a/src/main/java/mc/carlton/freerpg/gameTools/ScoreboardOperations.java +++ b/src/main/java/mc/carlton/freerpg/utils/game/ScoreboardOperations.java @@ -1,6 +1,9 @@ -package mc.carlton.freerpg.gameTools; +package mc.carlton.freerpg.utils.game; -import mc.carlton.freerpg.playerInfo.PlayerStats; +import java.util.ArrayList; +import java.util.Map; +import java.util.UUID; +import mc.carlton.freerpg.core.info.player.PlayerStats; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.scoreboard.DisplaySlot; @@ -8,12 +11,8 @@ import org.bukkit.scoreboard.Score; import org.bukkit.scoreboard.Scoreboard; -import java.util.ArrayList; -import java.util.Map; -import java.util.UUID; - public class ScoreboardOperations { - + // TODO remove dead code! /* public void setPlayerPowerLevel(Player p) { //Checks if a scoreboard exists already, if not, it makes its own @@ -56,33 +55,33 @@ public void setAllPlayersScore(Objective obj) { */ - public void setPlayerPowerLevel(Player p) { - //Get the global level - PlayerStats pStatClass = new PlayerStats(p); - UUID uuid = p.getUniqueId(); - Map>> statAll = pStatClass.getData(); - Map> pStatAll = statAll.get(uuid); - ArrayList pStats = pStatAll.get("global"); - int globalLevel = (int) pStats.get(0); - String pName = p.getName(); - for (Player otherPlayer : Bukkit.getOnlinePlayers()) { - //Gets all other players scoreboards - Scoreboard board = otherPlayer.getScoreboard(); - if (board == null || board == Bukkit.getScoreboardManager().getMainScoreboard()) { - board = Bukkit.getScoreboardManager().getNewScoreboard(); - } + public void setPlayerPowerLevel(Player p) { + //Get the global level + PlayerStats pStatClass = new PlayerStats(p); + UUID uuid = p.getUniqueId(); + Map>> statAll = pStatClass.getData(); + Map> pStatAll = statAll.get(uuid); + ArrayList pStats = pStatAll.get("global"); + int globalLevel = (int) pStats.get(0); + String pName = p.getName(); + for (Player otherPlayer : Bukkit.getOnlinePlayers()) { + //Gets all other players scoreboards + Scoreboard board = otherPlayer.getScoreboard(); + if (board == null || board == Bukkit.getScoreboardManager().getMainScoreboard()) { + board = Bukkit.getScoreboardManager().getNewScoreboard(); + } - //sets the score for all other players - Objective obj = board.getObjective(DisplaySlot.BELOW_NAME); - if (obj == null) { - String displayName = otherPlayer.getDisplayName(); - int takenLength = (int) Math.min(displayName.length(),11); - String name = displayName.substring(0,takenLength) + "-frpg"; - obj = board.registerNewObjective(name,"dummy","test"); - } - Score score = obj.getScore(pName); - score.setScore(globalLevel); - otherPlayer.setScoreboard(board); - } + //sets the score for all other players + Objective obj = board.getObjective(DisplaySlot.BELOW_NAME); + if (obj == null) { + String displayName = otherPlayer.getDisplayName(); + int takenLength = (int) Math.min(displayName.length(), 11); + String name = displayName.substring(0, takenLength) + "-frpg"; + obj = board.registerNewObjective(name, "dummy", "test"); + } + Score score = obj.getScore(pName); + score.setScore(globalLevel); + otherPlayer.setScoreboard(board); } + } } diff --git a/src/main/java/mc/carlton/freerpg/utils/game/TrackItem.java b/src/main/java/mc/carlton/freerpg/utils/game/TrackItem.java new file mode 100644 index 0000000..93a9230 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/game/TrackItem.java @@ -0,0 +1,79 @@ +package mc.carlton.freerpg.utils.game; + +import java.util.Map; +import mc.carlton.freerpg.core.info.player.AbilityLogoutTracker; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.persistence.PersistentDataContainer; +import org.bukkit.persistence.PersistentDataType; + +public class TrackItem { + + public ItemStack findTrackedItemInInventory(Player p, NamespacedKey key) { + for (ItemStack item : p.getInventory().getContents()) { + if (doesItemHaveKey(item, key)) { + removeItemKey(item, key); + return item; + } + } + ItemStack cursorItem = p.getItemOnCursor(); + if (doesItemHaveKey(cursorItem, key)) { + removeItemKey(cursorItem, key); + return cursorItem; + } + return null; + } + + public boolean doesItemHaveKey(ItemStack item, NamespacedKey key) { + if (item == null) { + return false; + } + if (item.getType() == Material.AIR) { + return false; + } + ItemMeta itemMeta = item.getItemMeta(); + PersistentDataContainer container = itemMeta.getPersistentDataContainer(); + if (container.has(key, PersistentDataType.STRING)) { + return true; + } + return false; + } + + public NamespacedKey getFreeRPGItemKey(ItemStack item, + Player p) { //This assumes there is only one NamespacedKey per item (which should be a safe assumption) + if (item == null) { + return null; + } + if (item.getType() == Material.AIR) { + return null; + } + AbilityLogoutTracker abilityLogoutTracker = new AbilityLogoutTracker(p); + Map allPlayerKeys = abilityLogoutTracker.getPlayerKeys(); + ItemMeta itemMeta = item.getItemMeta(); + PersistentDataContainer container = itemMeta.getPersistentDataContainer(); + for (String name : allPlayerKeys.keySet()) { + NamespacedKey key = allPlayerKeys.get(name); + if (container.has(key, PersistentDataType.STRING)) { + if (key.getKey().contains("frpg")) { + return key; + } + } + } + return null; + } + + public void removeItemKey(ItemStack item, NamespacedKey key) { + if (key == null) { + return; + } + ItemMeta itemMeta = item.getItemMeta(); + PersistentDataContainer container = itemMeta.getPersistentDataContainer(); + if (container.has(key, PersistentDataType.STRING)) { + container.remove(key); + item.setItemMeta(itemMeta); + } + } +} diff --git a/src/main/java/mc/carlton/freerpg/globalVariables/CraftingRecipes.java b/src/main/java/mc/carlton/freerpg/utils/globalVariables/CraftingRecipes.java similarity index 52% rename from src/main/java/mc/carlton/freerpg/globalVariables/CraftingRecipes.java rename to src/main/java/mc/carlton/freerpg/utils/globalVariables/CraftingRecipes.java index 24eb061..586e685 100644 --- a/src/main/java/mc/carlton/freerpg/globalVariables/CraftingRecipes.java +++ b/src/main/java/mc/carlton/freerpg/utils/globalVariables/CraftingRecipes.java @@ -1,8 +1,12 @@ -package mc.carlton.freerpg.globalVariables; +package mc.carlton.freerpg.utils.globalVariables; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; import mc.carlton.freerpg.customContainers.collections.OldCustomRecipe; -import mc.carlton.freerpg.configStorage.ConfigLoad; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -10,331 +14,331 @@ import org.bukkit.inventory.ShapedRecipe; import org.bukkit.plugin.Plugin; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - public class CraftingRecipes { - Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); - static Map> identifierRecipeMap = new HashMap<>(); - static ArrayList tippedArrow; - static ArrayList cowEgg; - static ArrayList beeEgg; - static ArrayList mooshroomEgg; - static ArrayList horseEgg; - static ArrayList slimeEgg; - static ArrayList power; - static ArrayList efficiency; - static ArrayList sharpness; - static ArrayList protection; - static ArrayList luck; - static ArrayList lure; - static ArrayList frost; - static ArrayList depth; - static ArrayList mending; - static ArrayList fortune; - static ArrayList waterBreathing; - static ArrayList speed; - static ArrayList fireResistance; - static ArrayList healing; - static ArrayList strength; - - public void initializeAllCraftingRecipes() { - initializeCraftingRecipes(); - //Recipes - dragonLessArrows(); - farmingRecipes(); - enchantingRecipes(); - alchemyRecipes(); - } - - public void initializeCraftingRecipes() { - ConfigLoad configLoad = new ConfigLoad(); - Map craftingRecipes = configLoad.getCraftingRecipes(); - Material[] tippedArrow0 = {Material.ARROW,Material.ARROW,Material.ARROW, - Material.ARROW,Material.POTION,Material.ARROW, - Material.ARROW,Material.ARROW,Material.ARROW}; - tippedArrow = new ArrayList<>(Arrays.asList(tippedArrow0)); - cowEgg = craftingRecipes.get("farming1").getRecipe(); - beeEgg = craftingRecipes.get("farming2").getRecipe(); - mooshroomEgg = craftingRecipes.get("farming3").getRecipe(); - horseEgg = craftingRecipes.get("farming4").getRecipe(); - slimeEgg = craftingRecipes.get("farming5").getRecipe(); - power = craftingRecipes.get("enchanting1").getRecipe(); - efficiency = craftingRecipes.get("enchanting2").getRecipe(); - sharpness = craftingRecipes.get("enchanting3").getRecipe(); - protection = craftingRecipes.get("enchanting4").getRecipe(); - luck = craftingRecipes.get("enchanting5").getRecipe(); - lure = craftingRecipes.get("enchanting6").getRecipe(); - frost = craftingRecipes.get("enchanting7").getRecipe(); - depth = craftingRecipes.get("enchanting8").getRecipe(); - mending = craftingRecipes.get("enchanting9").getRecipe(); - fortune = craftingRecipes.get("enchanting10").getRecipe(); - waterBreathing = craftingRecipes.get("alchemy1").getRecipe(); - speed = craftingRecipes.get("alchemy2").getRecipe(); - fireResistance = craftingRecipes.get("alchemy3").getRecipe(); - healing = craftingRecipes.get("alchemy4").getRecipe(); - strength = craftingRecipes.get("alchemy5").getRecipe(); - - } - - public int getShiftedCraftingIndex(int originalIndex,int vertShift,int horzShift) { - //Convert original index to row/column - int row = Math.floorDiv(originalIndex,3); - int column = originalIndex % 3; - //Add the shift - int newRow = row+vertShift; - int newColumn = column+horzShift; - //Determine if the shift yeilds a new recipe still inside the crafting grid - if (newRow < 0 || newRow > 2) { - return -1; + static Map> identifierRecipeMap = new HashMap<>(); + static ArrayList tippedArrow; + static ArrayList cowEgg; + static ArrayList beeEgg; + static ArrayList mooshroomEgg; + static ArrayList horseEgg; + static ArrayList slimeEgg; + static ArrayList power; + static ArrayList efficiency; + static ArrayList sharpness; + static ArrayList protection; + static ArrayList luck; + static ArrayList lure; + static ArrayList frost; + static ArrayList depth; + static ArrayList mending; + static ArrayList fortune; + static ArrayList waterBreathing; + static ArrayList speed; + static ArrayList fireResistance; + static ArrayList healing; + static ArrayList strength; + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + + public void initializeAllCraftingRecipes() { + initializeCraftingRecipes(); + //Recipes + dragonLessArrows(); + farmingRecipes(); + enchantingRecipes(); + alchemyRecipes(); + } + + public void initializeCraftingRecipes() { + ConfigLoad configLoad = new ConfigLoad(); + Map craftingRecipes = configLoad.getCraftingRecipes(); + Material[] tippedArrow0 = {Material.ARROW, Material.ARROW, Material.ARROW, + Material.ARROW, Material.POTION, Material.ARROW, + Material.ARROW, Material.ARROW, Material.ARROW}; + tippedArrow = new ArrayList<>(Arrays.asList(tippedArrow0)); + cowEgg = craftingRecipes.get("farming1").getRecipe(); + beeEgg = craftingRecipes.get("farming2").getRecipe(); + mooshroomEgg = craftingRecipes.get("farming3").getRecipe(); + horseEgg = craftingRecipes.get("farming4").getRecipe(); + slimeEgg = craftingRecipes.get("farming5").getRecipe(); + power = craftingRecipes.get("enchanting1").getRecipe(); + efficiency = craftingRecipes.get("enchanting2").getRecipe(); + sharpness = craftingRecipes.get("enchanting3").getRecipe(); + protection = craftingRecipes.get("enchanting4").getRecipe(); + luck = craftingRecipes.get("enchanting5").getRecipe(); + lure = craftingRecipes.get("enchanting6").getRecipe(); + frost = craftingRecipes.get("enchanting7").getRecipe(); + depth = craftingRecipes.get("enchanting8").getRecipe(); + mending = craftingRecipes.get("enchanting9").getRecipe(); + fortune = craftingRecipes.get("enchanting10").getRecipe(); + waterBreathing = craftingRecipes.get("alchemy1").getRecipe(); + speed = craftingRecipes.get("alchemy2").getRecipe(); + fireResistance = craftingRecipes.get("alchemy3").getRecipe(); + healing = craftingRecipes.get("alchemy4").getRecipe(); + strength = craftingRecipes.get("alchemy5").getRecipe(); + + + } + + public int getShiftedCraftingIndex(int originalIndex, int vertShift, int horzShift) { + //Convert original index to row/column + int row = Math.floorDiv(originalIndex, 3); + int column = originalIndex % 3; + //Add the shift + int newRow = row + vertShift; + int newColumn = column + horzShift; + //Determine if the shift yeilds a new recipe still inside the crafting grid + if (newRow < 0 || newRow > 2) { + return -1; + } + if (newColumn < 0 || newColumn > 2) { + return -1; + } + return newRow * 3 + newColumn; + + } + + public ArrayList> getTranslatedVariants(ArrayList initialRecipe) { + ArrayList> translatedVariants = new ArrayList<>(); + ArrayList indices = getOccupiedIndicesInRecipe(initialRecipe); + + if (indices.size() + >= 7) { //If there are 7 unique items in the grid, there is never a possible shift + translatedVariants.add(initialRecipe); + return translatedVariants; + } + + for (int i = -2; i <= 2; i++) { //Up and down shifting + for (int j = -2; j <= 2; j++) { //Left and right shifting + //create shifted indices + boolean possibleFormat = true; + ArrayList shiftedIndices = new ArrayList<>(); + shiftedIndicesLoop: + for (int index : indices) { + int newIndex = getShiftedCraftingIndex(index, i, j); + if (newIndex == -1) { + possibleFormat = false; + break shiftedIndicesLoop; + } else { + shiftedIndices.add(newIndex); + } } - if (newColumn <0 || newColumn > 2) { - return -1; - } - return newRow*3 + newColumn; - - } - public ArrayList> getTranslatedVariants(ArrayList initialRecipe) { - ArrayList> translatedVariants = new ArrayList<>(); - ArrayList indices = getOccupiedIndicesInRecipe(initialRecipe); - - if (indices.size() >= 7) { //If there are 7 unique items in the grid, there is never a possible shift - translatedVariants.add(initialRecipe); - return translatedVariants; - } - - for (int i = -2; i <= 2 ; i++) { //Up and down shifting - for (int j = -2; j <= 2; j++) { //Left and right shifting - //create shifted indices - boolean possibleFormat = true; - ArrayList shiftedIndices = new ArrayList<>(); - shiftedIndicesLoop: - for (int index : indices) { - int newIndex = getShiftedCraftingIndex(index,i,j); - if (newIndex == -1) { - possibleFormat = false; - break shiftedIndicesLoop; - } - else{ - shiftedIndices.add(newIndex); - } - } - - //If all shifted indices are possible, add it to the list of possible recipes - if (possibleFormat) { - ArrayList possibleRecipe = getTransformedRecipe(initialRecipe,shiftedIndices); - translatedVariants.add(possibleRecipe); - } - } + //If all shifted indices are possible, add it to the list of possible recipes + if (possibleFormat) { + ArrayList possibleRecipe = getTransformedRecipe(initialRecipe, shiftedIndices); + translatedVariants.add(possibleRecipe); } - return translatedVariants; - } - - public ArrayList getOccupiedIndicesInRecipe(ArrayList recipe){ - ArrayList indices = new ArrayList<>(); - for (int i=0; i< recipe.size();i++) { - if (!recipe.get(i).equals(Material.AIR) && !recipe.get(i).equals(Material.CAVE_AIR) && !recipe.get(i).equals(Material.VOID_AIR) && recipe.get(i) != null) { - indices.add(i); - } + } + } + return translatedVariants; + } + + public ArrayList getOccupiedIndicesInRecipe(ArrayList recipe) { + ArrayList indices = new ArrayList<>(); + for (int i = 0; i < recipe.size(); i++) { + if (!recipe.get(i).equals(Material.AIR) && !recipe.get(i).equals(Material.CAVE_AIR) + && !recipe.get(i).equals(Material.VOID_AIR) && recipe.get(i) != null) { + indices.add(i); + } + } + return indices; + } + + public ArrayList getTransformedRecipe(ArrayList initialRecipe, + ArrayList newIndices) { + ArrayList indices = getOccupiedIndicesInRecipe(initialRecipe); + Map transformationMap = new HashMap<>(); + for (int i = 0; i < indices.size(); i++) { + transformationMap.put(indices.get(i), newIndices.get(i)); + } + ArrayList newRecipe = new ArrayList<>(); + for (int i = 0; i < 9; i++) { + newRecipe.add(Material.AIR); + } + for (int index : transformationMap.keySet()) { + int newIndex = transformationMap.get(index); + newRecipe.set(newIndex, initialRecipe.get(index)); + } + return newRecipe; + } + + public Map getItemToCharacterMap(ArrayList recipe) { + String[] letters = {"A", "B", "C", "D", "E", "F", "G", "H", "I"}; + Map recipeLettersMap = new HashMap<>(); + for (int i = 0; i < 9; i++) { + if (!recipe.get(i).equals(Material.AIR) && !recipe.get(i).equals(Material.CAVE_AIR) + && !recipe.get(i).equals(Material.VOID_AIR) && recipe.get(i) != null) { + recipeLettersMap.put(i, letters[i]); + } else { + recipeLettersMap.put(i, " "); + } + } + return recipeLettersMap; + } + + + public ArrayList getShapedRecipeLines(Map recipeLettersMap) { + String line1 = recipeLettersMap.get(0) + recipeLettersMap.get(1) + recipeLettersMap.get(2); + String line2 = recipeLettersMap.get(3) + recipeLettersMap.get(4) + recipeLettersMap.get(5); + String line3 = recipeLettersMap.get(6) + recipeLettersMap.get(7) + recipeLettersMap.get(8); + ArrayList craftingLines = new ArrayList<>(); + craftingLines.add(line1); + craftingLines.add(line2); + craftingLines.add(line3); + return craftingLines; + } + + public void setShapedRecipe(String id) { + ConfigLoad configLoad = new ConfigLoad(); + OldCustomRecipe recipeInfo = configLoad.getCraftingRecipes().get(id); + ArrayList recipeItems = recipeInfo.getRecipe(); + ItemStack item = recipeInfo.getItemStack(); + + ArrayList> allPossibleRecipes = getTranslatedVariants(recipeItems); + int recipeVariantNumber = 0; + for (ArrayList recipeVariant : allPossibleRecipes) { + String keyString = "frpg_" + id + "_" + recipeVariantNumber; + NamespacedKey key = new NamespacedKey(plugin, keyString); + ShapedRecipe recipe = new ShapedRecipe(key, item); + Map recipeLettersMap = getItemToCharacterMap(recipeVariant); + ArrayList shapeLines = getShapedRecipeLines(recipeLettersMap); + recipe.shape(shapeLines.get(0), shapeLines.get(1), shapeLines.get(2)); + for (int index : recipeLettersMap.keySet()) { + String character = recipeLettersMap.get(index); + if (!character.equalsIgnoreCase(" ")) { + recipe.setIngredient(character.charAt(0), recipeVariant.get(index)); } - return indices; - } - - public ArrayList getTransformedRecipe(ArrayList initialRecipe,ArrayList newIndices) { - ArrayList indices = getOccupiedIndicesInRecipe(initialRecipe); - Map transformationMap = new HashMap<>(); - for (int i = 0; i < indices.size(); i++) { - transformationMap.put(indices.get(i),newIndices.get(i)); - } - ArrayList newRecipe = new ArrayList<>(); - for (int i = 0; i < 9; i++) { - newRecipe.add(Material.AIR); - } - for (int index : transformationMap.keySet()) { - int newIndex = transformationMap.get(index); - newRecipe.set(newIndex,initialRecipe.get(index)); - } - return newRecipe; - } - - public Map getItemToCharacterMap(ArrayList recipe){ - String[] letters = {"A","B","C","D","E","F","G","H","I"}; - Map recipeLettersMap = new HashMap<>(); - for (int i = 0; i < 9; i++) { - if (!recipe.get(i).equals(Material.AIR) && !recipe.get(i).equals(Material.CAVE_AIR) && !recipe.get(i).equals(Material.VOID_AIR) && recipe.get(i) != null) { - recipeLettersMap.put(i,letters[i]); - } - else { - recipeLettersMap.put(i," "); - } - } - return recipeLettersMap; - } - - - public ArrayList getShapedRecipeLines(Map recipeLettersMap){ - String line1 = recipeLettersMap.get(0) + recipeLettersMap.get(1) + recipeLettersMap.get(2); - String line2 = recipeLettersMap.get(3) + recipeLettersMap.get(4) + recipeLettersMap.get(5); - String line3 = recipeLettersMap.get(6) + recipeLettersMap.get(7) + recipeLettersMap.get(8); - ArrayList craftingLines = new ArrayList<>(); - craftingLines.add(line1); - craftingLines.add(line2); - craftingLines.add(line3); - return craftingLines; - } - - public void setShapedRecipe(String id){ - ConfigLoad configLoad = new ConfigLoad(); - OldCustomRecipe recipeInfo = configLoad.getCraftingRecipes().get(id); - ArrayList recipeItems = recipeInfo.getRecipe(); - ItemStack item = recipeInfo.getItemStack(); - - ArrayList> allPossibleRecipes = getTranslatedVariants(recipeItems); - int recipeVariantNumber = 0; - for (ArrayList recipeVariant : allPossibleRecipes) { - String keyString = "frpg_" + id + "_" + recipeVariantNumber; - NamespacedKey key = new NamespacedKey(plugin, keyString); - ShapedRecipe recipe = new ShapedRecipe(key, item); - Map recipeLettersMap = getItemToCharacterMap(recipeVariant); - ArrayList shapeLines = getShapedRecipeLines(recipeLettersMap); - recipe.shape(shapeLines.get(0), shapeLines.get(1), shapeLines.get(2)); - for (int index : recipeLettersMap.keySet()) { - String character = recipeLettersMap.get(index); - if (!character.equalsIgnoreCase(" ")) { - recipe.setIngredient(character.charAt(0), recipeVariant.get(index)); - } - } - Bukkit.addRecipe(recipe); - recipeVariantNumber += 1; - } - } - - //Recipe methods - public void dragonLessArrows() { - ItemStack item = new ItemStack(Material.TIPPED_ARROW, 8); - NamespacedKey key = new NamespacedKey(plugin, "frpgTippedArrows"); - ShapedRecipe recipe = new ShapedRecipe(key, item); - recipe.shape("AAA", "APA", "AAA"); - recipe.setIngredient('A', Material.ARROW); - recipe.setIngredient('P', Material.POTION); - Bukkit.addRecipe(recipe); - } - - public void farmingRecipes() { - setShapedRecipe("farming1"); - setShapedRecipe("farming2"); - setShapedRecipe("farming3"); - setShapedRecipe("farming4"); - setShapedRecipe("farming5"); - } - public void enchantingRecipes() { - setShapedRecipe("enchanting1"); - setShapedRecipe("enchanting2"); - setShapedRecipe("enchanting3"); - setShapedRecipe("enchanting4"); - setShapedRecipe("enchanting5"); - setShapedRecipe("enchanting6"); - setShapedRecipe("enchanting7"); - setShapedRecipe("enchanting8"); - setShapedRecipe("enchanting9"); - setShapedRecipe("enchanting10"); - } - public void alchemyRecipes() { - setShapedRecipe("alchemy1"); - setShapedRecipe("alchemy2"); - setShapedRecipe("alchemy3"); - setShapedRecipe("alchemy4"); - setShapedRecipe("alchemy5"); - } - - public ArrayList getBeeEggRecipe() { - return beeEgg; - } - - public ArrayList getCowEggRecipe() { - return cowEgg; - } - - public ArrayList getDepthRecipe() { - return depth; - } - - public ArrayList getEfficiencyRecipe() { - return efficiency; - } - - public ArrayList getFireResistanceRecipe() { - return fireResistance; - } - - public ArrayList getFortuneRecipe() { - return fortune; - } - - public ArrayList getFrostRecipe() { - return frost; - } - - public ArrayList getHealingRecipe() { - return healing; - } - - public ArrayList getHorseEggRecipe() { - return horseEgg; - } - - public ArrayList getLuckRecipe() { - return luck; - } - - public ArrayList getLureRecipe() { - return lure; - } - - public ArrayList getMendingRecipe() { - return mending; - } - - public ArrayList getMooshroomEggRecipe() { - return mooshroomEgg; - } - - public ArrayList getPowerRecipe() { - return power; - } - - public ArrayList getProtectionRecipe() { - return protection; - } - - public ArrayList getSharpnessRecipe() { - return sharpness; - } - - public ArrayList getSlimeEggRecipe() { - return slimeEgg; - } - - public ArrayList getSpeedRecipe() { - return speed; - } - - public ArrayList getStrengthRecipe() { - return strength; - } - - public ArrayList getTippedArrowRecipe() { - return tippedArrow; - } - - public ArrayList getWaterBreathingRecipe() { - return waterBreathing; - } - + } + Bukkit.addRecipe(recipe); + recipeVariantNumber += 1; + } + } + + //Recipe methods + public void dragonLessArrows() { + ItemStack item = new ItemStack(Material.TIPPED_ARROW, 8); + NamespacedKey key = new NamespacedKey(plugin, "frpgTippedArrows"); + ShapedRecipe recipe = new ShapedRecipe(key, item); + recipe.shape("AAA", "APA", "AAA"); + recipe.setIngredient('A', Material.ARROW); + recipe.setIngredient('P', Material.POTION); + Bukkit.addRecipe(recipe); + } + + public void farmingRecipes() { + setShapedRecipe("farming1"); + setShapedRecipe("farming2"); + setShapedRecipe("farming3"); + setShapedRecipe("farming4"); + setShapedRecipe("farming5"); + } + + public void enchantingRecipes() { + setShapedRecipe("enchanting1"); + setShapedRecipe("enchanting2"); + setShapedRecipe("enchanting3"); + setShapedRecipe("enchanting4"); + setShapedRecipe("enchanting5"); + setShapedRecipe("enchanting6"); + setShapedRecipe("enchanting7"); + setShapedRecipe("enchanting8"); + setShapedRecipe("enchanting9"); + setShapedRecipe("enchanting10"); + } + + public void alchemyRecipes() { + setShapedRecipe("alchemy1"); + setShapedRecipe("alchemy2"); + setShapedRecipe("alchemy3"); + setShapedRecipe("alchemy4"); + setShapedRecipe("alchemy5"); + } + + public ArrayList getBeeEggRecipe() { + return beeEgg; + } + + public ArrayList getCowEggRecipe() { + return cowEgg; + } + + public ArrayList getDepthRecipe() { + return depth; + } + + public ArrayList getEfficiencyRecipe() { + return efficiency; + } + + public ArrayList getFireResistanceRecipe() { + return fireResistance; + } + + public ArrayList getFortuneRecipe() { + return fortune; + } + + public ArrayList getFrostRecipe() { + return frost; + } + + public ArrayList getHealingRecipe() { + return healing; + } + + public ArrayList getHorseEggRecipe() { + return horseEgg; + } + + public ArrayList getLuckRecipe() { + return luck; + } + + public ArrayList getLureRecipe() { + return lure; + } + + public ArrayList getMendingRecipe() { + return mending; + } + + public ArrayList getMooshroomEggRecipe() { + return mooshroomEgg; + } + + public ArrayList getPowerRecipe() { + return power; + } + + public ArrayList getProtectionRecipe() { + return protection; + } + + public ArrayList getSharpnessRecipe() { + return sharpness; + } + + public ArrayList getSlimeEggRecipe() { + return slimeEgg; + } + + public ArrayList getSpeedRecipe() { + return speed; + } + + public ArrayList getStrengthRecipe() { + return strength; + } + + public ArrayList getTippedArrowRecipe() { + return tippedArrow; + } + + public ArrayList getWaterBreathingRecipe() { + return waterBreathing; + } + // TODO remove dead code! /* public void beeEgg() { ItemStack item = new ItemStack(Material.BEE_SPAWN_EGG, 1); diff --git a/src/main/java/mc/carlton/freerpg/utils/globalVariables/EntityGroups.java b/src/main/java/mc/carlton/freerpg/utils/globalVariables/EntityGroups.java new file mode 100644 index 0000000..9c61d3a --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/globalVariables/EntityGroups.java @@ -0,0 +1,296 @@ +package mc.carlton.freerpg.utils.globalVariables; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.core.info.player.ChangeStats; +import mc.carlton.freerpg.core.info.server.MinecraftVersion; +import mc.carlton.freerpg.utils.game.ExpFarmTracker; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Mob; + +public class EntityGroups { + + static List hostileMobs; + static List breedingAnimals; + static List animals; + static List babyAnimals; + static List breedingAnimalsFarming; + static List thirstMobs; + static List hookableEntities; + private MinecraftVersion minecraftVersion = new MinecraftVersion(); + private double mcVersion = minecraftVersion.getMinecraftVersionAsDouble(); + + public void initializeAllEntityGroups() { + initializeHostileMobs(); + initializeTameableAnimals(); + initializeFarmingAnimals(); + initializeThirstMobs(); + initializeHookableMobs(); + } + + public void initializeHookableMobs() { + EntityType[] hookableEntities0 = {EntityType.BLAZE, EntityType.GHAST, EntityType.ZOMBIE, + EntityType.SPIDER, + EntityType.CAVE_SPIDER, EntityType.PIG, EntityType.CREEPER, EntityType.WITCH, + EntityType.CHICKEN, + EntityType.SKELETON, EntityType.WITHER_SKELETON, EntityType.MAGMA_CUBE, EntityType.COW, + EntityType.MUSHROOM_COW, + EntityType.ENDERMAN, EntityType.SHEEP, EntityType.IRON_GOLEM, EntityType.SNOWMAN, + EntityType.SHULKER}; + hookableEntities = new LinkedList<>(Arrays.asList(hookableEntities0)); + if (mcVersion >= 1.16) { + hookableEntities.add(EntityType.ZOMBIFIED_PIGLIN); + } + } + + public void initializeHostileMobs() { + EntityType[] hostileMobs0 = {EntityType.SPIDER, EntityType.CAVE_SPIDER, EntityType.ENDERMAN, + EntityType.BLAZE, EntityType.CREEPER, EntityType.DROWNED, EntityType.ELDER_GUARDIAN, + EntityType.ENDERMITE, EntityType.EVOKER, EntityType.GHAST, EntityType.GUARDIAN, + EntityType.HUSK, EntityType.MAGMA_CUBE, EntityType.PHANTOM, EntityType.PILLAGER, + EntityType.RAVAGER, EntityType.SHULKER, EntityType.SKELETON, EntityType.SLIME, + EntityType.STRAY, EntityType.VEX, EntityType.VINDICATOR, EntityType.WITCH, + EntityType.WITHER_SKELETON, EntityType.ZOMBIE, EntityType.ZOMBIE_VILLAGER}; + hostileMobs = new LinkedList<>(Arrays.asList(hostileMobs0)); + if (mcVersion >= 1.16) { + hostileMobs.add(EntityType.HOGLIN); + hostileMobs.add(EntityType.PIGLIN); + hostileMobs.add(EntityType.ZOMBIFIED_PIGLIN); + hostileMobs.add(EntityType.ZOGLIN); + } + } + + public void initializeTameableAnimals() { + EntityType[] breedingAnimals0 = {EntityType.HORSE, EntityType.WOLF, EntityType.CAT, + EntityType.OCELOT, EntityType.PARROT}; + breedingAnimals = Arrays.asList(breedingAnimals0); + } + + public void initializeFarmingAnimals() { + EntityType[] animals0 = {EntityType.CHICKEN, EntityType.COW, EntityType.DONKEY, EntityType.FOX, + EntityType.HORSE, EntityType.MUSHROOM_COW, + EntityType.MULE, EntityType.PARROT, EntityType.PIG, EntityType.RABBIT, EntityType.SHEEP, + EntityType.SQUID, + EntityType.SKELETON_HORSE, EntityType.TURTLE, EntityType.GOAT}; + animals = Arrays.asList(animals0); + EntityType[] babyAnimals0 = {EntityType.MUSHROOM_COW, EntityType.COW, EntityType.SHEEP, + EntityType.PIG, EntityType.CHICKEN, EntityType.RABBIT, + EntityType.WOLF, EntityType.CAT, EntityType.OCELOT, EntityType.LLAMA, EntityType.POLAR_BEAR, + EntityType.HORSE, EntityType.DONKEY, EntityType.MULE, EntityType.SKELETON_HORSE, + EntityType.TURTLE, + EntityType.PANDA, EntityType.FOX, EntityType.BEE, EntityType.GOAT}; + babyAnimals = Arrays.asList(babyAnimals0); + EntityType[] breedingAnimals0 = {EntityType.MUSHROOM_COW, EntityType.COW, EntityType.SHEEP, + EntityType.PIG, EntityType.CHICKEN, EntityType.RABBIT, + EntityType.TURTLE, EntityType.PANDA, EntityType.FOX, EntityType.BEE, EntityType.GOAT}; + breedingAnimalsFarming = Arrays.asList(breedingAnimals0); + } + + public void initializeThirstMobs() { + EntityType[] thirstMobs0 = {EntityType.DROWNED, EntityType.ELDER_GUARDIAN, EntityType.EVOKER, + EntityType.GUARDIAN, + EntityType.HUSK, EntityType.PILLAGER, EntityType.RAVAGER, EntityType.VINDICATOR, + EntityType.WITCH, EntityType.ZOMBIE, EntityType.ZOMBIE_VILLAGER}; + thirstMobs = new LinkedList<>(Arrays.asList(thirstMobs0)); + if (mcVersion >= 1.16) { + thirstMobs.add(EntityType.HOGLIN); + thirstMobs.add(EntityType.PIGLIN); + thirstMobs.add(EntityType.ZOMBIFIED_PIGLIN); + thirstMobs.add(EntityType.ZOGLIN); + } + } + + public void killEntity(Entity entity, String skillName, Map expMap, + ChangeStats increaseStats) { + if (entity instanceof LivingEntity) { + if (entity instanceof Mob) { + Mob mob = (Mob) entity; + EntityType type = mob.getType(); + int expReward = expMap.get("killAnythingElse"); + if (type.equals(EntityType.BAT)) { + expReward = expMap.get("killBat"); + } else if (type.equals(EntityType.CAT)) { + expReward = expMap.get("killCat"); + } else if (type.equals(EntityType.CHICKEN)) { + expReward = expMap.get("killChicken"); + } else if (type.equals(EntityType.COD)) { + expReward = expMap.get("killCod"); + } else if (type.equals(EntityType.COW)) { + expReward = expMap.get("killCow"); + } else if (type.equals(EntityType.DONKEY)) { + expReward = expMap.get("killDonkey"); + } else if (type.equals(EntityType.FOX)) { + expReward = expMap.get("killFox"); + } else if (type.equals(EntityType.HORSE)) { + expReward = expMap.get("killHorse"); + } else if (type.equals(EntityType.POLAR_BEAR)) { + expReward = expMap.get("killPolarBear"); + } else if (type.equals(EntityType.MUSHROOM_COW)) { + expReward = expMap.get("killMooshroom"); + } else if (type.equals(EntityType.MULE)) { + expReward = expMap.get("killMule"); + } else if (type.equals(EntityType.OCELOT)) { + expReward = expMap.get("killOcelot"); + } else if (type.equals(EntityType.PARROT)) { + expReward = expMap.get("killParrot"); + } else if (type.equals(EntityType.PIG)) { + expReward = expMap.get("killPig"); + } else if (type.equals(EntityType.RABBIT)) { + expReward = expMap.get("killRabbit"); + } else if (type.equals(EntityType.SALMON)) { + expReward = expMap.get("killSalmon"); + } else if (type.equals(EntityType.SHEEP)) { + expReward = expMap.get("killSheep"); + } else if (type.equals(EntityType.SKELETON_HORSE)) { + expReward = expMap.get("killSkeleton_Horse"); + } else if (type.equals(EntityType.SNOWMAN)) { + expReward = expMap.get("killSnowman"); + } else if (type.equals(EntityType.SQUID)) { + expReward = expMap.get("killSquid"); + } else if (type.equals(EntityType.TROPICAL_FISH)) { + expReward = expMap.get("killTropical_Fish"); + } else if (type.equals(EntityType.TURTLE)) { + expReward = expMap.get("killTurtle"); + } else if (type.equals(EntityType.VILLAGER)) { + expReward = expMap.get("killVillager"); + } else if (type.equals(EntityType.WANDERING_TRADER)) { + expReward = expMap.get("killWandering_Trader"); + } else if (type.equals(EntityType.BEE)) { + expReward = expMap.get("killBee"); + } else if (type.equals(EntityType.CAVE_SPIDER)) { + expReward = expMap.get("killCaveSpider"); + } else if (type.equals(EntityType.DOLPHIN)) { + expReward = expMap.get("killDolphin"); + } else if (type.equals(EntityType.ENDERMAN)) { + expReward = expMap.get("killEnderman"); + } else if (type.equals(EntityType.IRON_GOLEM)) { + expReward = expMap.get("killIron_Golem"); + } else if (type.equals(EntityType.LLAMA)) { + expReward = expMap.get("killLlama"); + } else if (type.equals(EntityType.PANDA)) { + expReward = expMap.get("killPanda"); + } else if (type.equals(EntityType.PUFFERFISH)) { + expReward = expMap.get("killPufferfish"); + } else if (type.equals(EntityType.SPIDER)) { + expReward = expMap.get("killSpider"); + } else if (type.equals(EntityType.WOLF)) { + expReward = expMap.get("killWolf"); + } else if (type.equals(EntityType.BLAZE)) { + expReward = expMap.get("killBlaze"); + } else if (type.equals(EntityType.CREEPER)) { + expReward = expMap.get("killCreeper"); + } else if (type.equals(EntityType.DROWNED)) { + expReward = expMap.get("killDrowned"); + } else if (type.equals(EntityType.ELDER_GUARDIAN)) { + expReward = expMap.get("killElder_Guardian"); + } else if (type.equals(EntityType.ENDERMITE)) { + expReward = expMap.get("killEndermite"); + } else if (type.equals(EntityType.EVOKER)) { + expReward = expMap.get("killEvoker"); + } else if (type.equals(EntityType.GHAST)) { + expReward = expMap.get("killGhast"); + } else if (type.equals(EntityType.GUARDIAN)) { + expReward = expMap.get("killGuardian"); + } else if (type.equals(EntityType.HUSK)) { + expReward = expMap.get("killHusk"); + } else if (type.equals(EntityType.MAGMA_CUBE)) { + expReward = expMap.get("killMagma_Cube"); + } else if (type.equals(EntityType.PHANTOM)) { + expReward = expMap.get("killPhantom"); + } else if (type.equals(EntityType.PILLAGER)) { + expReward = expMap.get("killPillager"); + } else if (type.equals(EntityType.RAVAGER)) { + expReward = expMap.get("killRavager"); + } else if (type.equals(EntityType.SHULKER)) { + expReward = expMap.get("killShulker"); + } else if (type.equals(EntityType.SILVERFISH)) { + expReward = expMap.get("killSilverfish"); + } else if (type.equals(EntityType.SKELETON)) { + expReward = expMap.get("killSkeleton"); + } else if (type.equals(EntityType.SLIME)) { + expReward = expMap.get("killSlime"); + } else if (type.equals(EntityType.STRAY)) { + expReward = expMap.get("killStray"); + } else if (type.equals(EntityType.VEX)) { + expReward = expMap.get("killVex"); + } else if (type.equals(EntityType.VINDICATOR)) { + expReward = expMap.get("killVindicator"); + } else if (type.equals(EntityType.WITCH)) { + expReward = expMap.get("killWitch"); + } else if (type.equals(EntityType.WITHER_SKELETON)) { + expReward = expMap.get("killWitherSkeleton"); + } else if (type.equals(EntityType.ZOMBIE)) { + expReward = expMap.get("killZombie"); + } else if (type.equals(EntityType.ZOMBIE_VILLAGER)) { + expReward = expMap.get("killZombie_Villager"); + } else if (type.equals(EntityType.ENDER_DRAGON)) { + expReward = expMap.get("killEnder_Dragon"); + } else if (type.equals(EntityType.WITHER)) { + expReward = expMap.get("killWither"); + } else if (type.equals(EntityType.ZOMBIE_HORSE)) { + expReward = expMap.get("killZombie_Horse"); + } else if (type.equals(EntityType.ILLUSIONER)) { + expReward = expMap.get("killIllusioner"); + } else if (type.equals(EntityType.GIANT)) { + expReward = expMap.get("killGiant"); + } + if (mcVersion >= 1.16) { + if (type.equals(EntityType.PIGLIN)) { + expReward = expMap.get("killPiglin"); + } else if (type.equals(EntityType.ZOGLIN)) { + expReward = expMap.get("killZoglin"); + } else if (type.equals(EntityType.HOGLIN)) { + expReward = expMap.get("killHoglin"); + } else if (type.equals(EntityType.ZOMBIFIED_PIGLIN)) { + expReward = expMap.get("killZombie_Pigman"); + } else if (type.equals(EntityType.STRIDER)) { + expReward = expMap.get("killStrider"); + } + } + if (mcVersion >= 1.17) { + if (type.equals(EntityType.GLOW_SQUID)) { + expReward = expMap.get("killGlow_Squid"); + } else if (type.equals(EntityType.GOAT)) { + expReward = expMap.get("killGoat"); + } + } + ExpFarmTracker expFarmTracker = new ExpFarmTracker(); + double multiplier = expFarmTracker.getExpFarmAndSpawnerCombinedMultiplier(entity, + skillName); + increaseStats.changeEXP(skillName, (int) Math.round(expReward * multiplier)); + } + } + } + + public List getBreedingAnimals() { + return breedingAnimals; + } + + public List getHostileMobs() { + return hostileMobs; + } + + public List getAnimals() { + return animals; + } + + public List getBabyAnimals() { + return babyAnimals; + } + + public List getBreedingAnimalsFarming() { + return breedingAnimalsFarming; + } + + public List getThirstMobs() { + return thirstMobs; + } + + public List getHookableEntities() { + return hookableEntities; + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/globalVariables/ExpMaps.java b/src/main/java/mc/carlton/freerpg/utils/globalVariables/ExpMaps.java new file mode 100644 index 0000000..4c9450d --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/globalVariables/ExpMaps.java @@ -0,0 +1,327 @@ +package mc.carlton.freerpg.utils.globalVariables; + +import java.util.HashMap; +import java.util.Map; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.server.MinecraftVersion; +import org.bukkit.Material; + +public class ExpMaps { + + static Map diggingEXP = new HashMap<>(); + static Map woodcuttingEXP = new HashMap<>(); + static Map miningEXP = new HashMap<>(); + static Map farmingEXP = new HashMap<>(); + static Map flamePickEXP = new HashMap<>(); + private final MinecraftVersion minecraftVersion = new MinecraftVersion(); + private final double mcVersion = minecraftVersion.getMinecraftVersionAsDouble(); + + /** + * Initializes all experience + */ + public void initializeAllExpMaps() { + initializeDiggingEXP(); + initializeWoodcuttingEXP(); + initializeMiningEXP(); + initializeFarmingEXP(); + initializeFlamePickEXP(); + } + + public void initializeDiggingEXP() { + ConfigLoad configLoad = new ConfigLoad(); + Map expMap = configLoad.getExpMapForSkill("digging"); + diggingEXP.put(Material.CLAY, expMap.get("breakClay")); + diggingEXP.put(Material.FARMLAND, expMap.get("breakFarmland")); + diggingEXP.put(Material.GRASS_BLOCK, expMap.get("breakGrassBlock")); + diggingEXP.put(Material.DIRT_PATH, expMap.get("breakGrassPath")); + diggingEXP.put(Material.GRAVEL, expMap.get("breakGravel")); + diggingEXP.put(Material.MYCELIUM, expMap.get("breakMycelium")); + diggingEXP.put(Material.PODZOL, expMap.get("breakPodzol")); + diggingEXP.put(Material.COARSE_DIRT, expMap.get("breakCoarse_Dirt")); + diggingEXP.put(Material.DIRT, expMap.get("breakDirt")); + diggingEXP.put(Material.RED_SAND, expMap.get("breakRed_Sand")); + diggingEXP.put(Material.SAND, expMap.get("breakSand")); + diggingEXP.put(Material.SOUL_SAND, expMap.get("breakSoulSand")); + diggingEXP.put(Material.SNOW_BLOCK, expMap.get("breakSnowBlock")); + diggingEXP.put(Material.SNOW, expMap.get("breakSnow")); + diggingEXP.put(Material.WHITE_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.ORANGE_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.MAGENTA_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.LIGHT_BLUE_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.YELLOW_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.LIME_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.PINK_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.GRAY_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.LIGHT_GRAY_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.CYAN_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.PURPLE_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.BLUE_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.BROWN_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.GREEN_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.RED_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + diggingEXP.put(Material.BLACK_CONCRETE_POWDER, expMap.get("breakConcretePowder")); + if (mcVersion >= 1.16) { + diggingEXP.put(Material.SOUL_SOIL, expMap.get("breakSoulSoil")); + } else if (mcVersion >= 1.17) { + diggingEXP.put(Material.ROOTED_DIRT, expMap.get("breakRooted_Dirt")); + } + } + + public void initializeWoodcuttingEXP() { + ConfigLoad configLoad = new ConfigLoad(); + Map expMap = configLoad.getExpMapForSkill("woodcutting"); + woodcuttingEXP.put(Material.ACACIA_LOG, expMap.get("breakAcacia_Log")); + woodcuttingEXP.put(Material.BIRCH_LOG, expMap.get("breakBirch_Log")); + woodcuttingEXP.put(Material.DARK_OAK_LOG, expMap.get("breakDark_Oak_Log")); + woodcuttingEXP.put(Material.OAK_LOG, expMap.get("breakOak_Log")); + woodcuttingEXP.put(Material.SPRUCE_LOG, expMap.get("breakSpruce_Log")); + woodcuttingEXP.put(Material.JUNGLE_LOG, expMap.get("breakJungle_Log")); + woodcuttingEXP.put(Material.STRIPPED_ACACIA_LOG, expMap.get("breakAcacia_Log")); + woodcuttingEXP.put(Material.STRIPPED_BIRCH_LOG, expMap.get("breakBirch_Log")); + woodcuttingEXP.put(Material.STRIPPED_DARK_OAK_LOG, expMap.get("breakDark_Oak_Log")); + woodcuttingEXP.put(Material.STRIPPED_OAK_LOG, expMap.get("breakOak_Log")); + woodcuttingEXP.put(Material.STRIPPED_SPRUCE_LOG, expMap.get("breakSpruce_Log")); + woodcuttingEXP.put(Material.STRIPPED_JUNGLE_LOG, expMap.get("breakJungle_Log")); + woodcuttingEXP.put(Material.ACACIA_WOOD, expMap.get("breakAcacia_Log")); + woodcuttingEXP.put(Material.BIRCH_WOOD, expMap.get("breakBirch_Log")); + woodcuttingEXP.put(Material.DARK_OAK_WOOD, expMap.get("breakDark_Oak_Log")); + woodcuttingEXP.put(Material.OAK_WOOD, expMap.get("breakOak_Log")); + woodcuttingEXP.put(Material.SPRUCE_WOOD, expMap.get("breakSpruce_Log")); + woodcuttingEXP.put(Material.JUNGLE_WOOD, expMap.get("breakJungle_Log")); + woodcuttingEXP.put(Material.STRIPPED_ACACIA_WOOD, expMap.get("breakAcacia_Log")); + woodcuttingEXP.put(Material.STRIPPED_BIRCH_WOOD, expMap.get("breakBirch_Log")); + woodcuttingEXP.put(Material.STRIPPED_DARK_OAK_WOOD, expMap.get("breakDark_Oak_Log")); + woodcuttingEXP.put(Material.STRIPPED_OAK_WOOD, expMap.get("breakOak_Log")); + woodcuttingEXP.put(Material.STRIPPED_SPRUCE_WOOD, expMap.get("breakSpruce_Log")); + woodcuttingEXP.put(Material.STRIPPED_JUNGLE_WOOD, expMap.get("breakJungle_Log")); + woodcuttingEXP.put(Material.ACACIA_PLANKS, expMap.get("breakAcacia_Plank")); + woodcuttingEXP.put(Material.BIRCH_PLANKS, expMap.get("breakBirch_Plank")); + woodcuttingEXP.put(Material.DARK_OAK_PLANKS, expMap.get("breakDark_Oak_Plank")); + woodcuttingEXP.put(Material.OAK_PLANKS, expMap.get("breakOak_Plank")); + woodcuttingEXP.put(Material.SPRUCE_PLANKS, expMap.get("breakSpruce_Plank")); + woodcuttingEXP.put(Material.JUNGLE_PLANKS, expMap.get("breakJungle_Plank")); + woodcuttingEXP.put(Material.ACACIA_LEAVES, expMap.get("breakAcacia_Leaves")); + woodcuttingEXP.put(Material.BIRCH_LEAVES, expMap.get("breakBirch_Leaves")); + woodcuttingEXP.put(Material.DARK_OAK_LEAVES, expMap.get("breakDark_Oak_Leaves")); + woodcuttingEXP.put(Material.OAK_LEAVES, expMap.get("breakOak_Leaves")); + woodcuttingEXP.put(Material.SPRUCE_LEAVES, expMap.get("breakSpruce_Leaves")); + woodcuttingEXP.put(Material.JUNGLE_LEAVES, expMap.get("breakJungle_Leaves")); + woodcuttingEXP.put(Material.BROWN_MUSHROOM_BLOCK, expMap.get("breakBrown_Mushroom_Block")); + woodcuttingEXP.put(Material.RED_MUSHROOM_BLOCK, expMap.get("breakRed_Mushroom_Block")); + //1.16 Blocks, EXP subject to change + if (mcVersion >= 1.16) { + woodcuttingEXP.put(Material.CRIMSON_STEM, expMap.get("breakCrimson_Stem")); + woodcuttingEXP.put(Material.WARPED_STEM, expMap.get("breakWarped_Stem")); + woodcuttingEXP.put(Material.STRIPPED_CRIMSON_STEM, expMap.get("breakCrimson_Stem")); + woodcuttingEXP.put(Material.STRIPPED_WARPED_STEM, expMap.get("breakWarped_Stem")); + woodcuttingEXP.put(Material.WARPED_PLANKS, expMap.get("breakCrimson_Planks")); + woodcuttingEXP.put(Material.CRIMSON_PLANKS, expMap.get("breakWarped_Planks")); + } else if (mcVersion >= 1.17) { + woodcuttingEXP.put(Material.FLOWERING_AZALEA_LEAVES, + expMap.get("breakFlowering_Azalea_Leaves")); + } + } + + public void initializeMiningEXP() { + ConfigLoad configLoad = new ConfigLoad(); + Map expMap = configLoad.getExpMapForSkill("mining"); + miningEXP.put(Material.ICE, expMap.get("breakIce")); + miningEXP.put(Material.BLUE_ICE, expMap.get("breakBlue_Ice")); + miningEXP.put(Material.PACKED_ICE, expMap.get("breakPacked_Ice")); + miningEXP.put(Material.FROSTED_ICE, expMap.get("breakFrosted_Ice")); + miningEXP.put(Material.ANDESITE, expMap.get("breakAndesite")); + miningEXP.put(Material.COAL_ORE, expMap.get("breakCoal_Ore")); + miningEXP.put(Material.DIORITE, expMap.get("breakDiorite")); + miningEXP.put(Material.END_STONE, expMap.get("breakEnd_Stone")); + miningEXP.put(Material.GRANITE, expMap.get("breakGranite")); + miningEXP.put(Material.NETHERRACK, expMap.get("breakNetherrack")); + miningEXP.put(Material.NETHER_QUARTZ_ORE, expMap.get("breakNether_Quartz_Ore")); + miningEXP.put(Material.MOSSY_COBBLESTONE, expMap.get("breakMossy_Cobblestone")); + miningEXP.put(Material.SANDSTONE, expMap.get("breakSandstone")); + miningEXP.put(Material.RED_SANDSTONE, expMap.get("breakRed_Sandstone")); + miningEXP.put(Material.SPAWNER, expMap.get("breakSpawner")); + miningEXP.put(Material.STONE, expMap.get("breakStone")); + miningEXP.put(Material.TERRACOTTA, expMap.get("breakTerracotta")); + miningEXP.put(Material.RED_TERRACOTTA, expMap.get("breakTerracotta")); + miningEXP.put(Material.ORANGE_TERRACOTTA, expMap.get("breakTerracotta")); + miningEXP.put(Material.YELLOW_TERRACOTTA, expMap.get("breakTerracotta")); + miningEXP.put(Material.BROWN_TERRACOTTA, expMap.get("breakTerracotta")); + miningEXP.put(Material.WHITE_TERRACOTTA, expMap.get("breakTerracotta")); + miningEXP.put(Material.LIGHT_GRAY_TERRACOTTA, expMap.get("breakTerracotta")); + miningEXP.put(Material.IRON_ORE, expMap.get("breakIron_Ore")); + miningEXP.put(Material.REDSTONE_ORE, expMap.get("breakRedstone_Ore")); + miningEXP.put(Material.LAPIS_ORE, expMap.get("breakLapis_Ore")); + miningEXP.put(Material.DIAMOND_ORE, expMap.get("breakDiamond_Ore")); + miningEXP.put(Material.GOLD_ORE, expMap.get("breakGold_Ore")); + miningEXP.put(Material.EMERALD_ORE, expMap.get("breakEmerald_Ore")); + miningEXP.put(Material.OBSIDIAN, expMap.get("breakObsidian")); + miningEXP.put(Material.GLOWSTONE, 0); + if (mcVersion >= 1.16) { + miningEXP.put(Material.ANCIENT_DEBRIS, expMap.get("breakAncient_Debris")); + miningEXP.put(Material.NETHER_GOLD_ORE, expMap.get("breakNether_Gold_Ore")); + miningEXP.put(Material.BASALT, expMap.get("breakBasalt")); + miningEXP.put(Material.BLACKSTONE, expMap.get("breakBlackstone")); + miningEXP.put(Material.CRYING_OBSIDIAN, expMap.get("breakCrying_Obsidian")); + miningEXP.put(Material.CRIMSON_NYLIUM, expMap.get("breakCrimson_Nylium")); + miningEXP.put(Material.WARPED_NYLIUM, expMap.get("breakWarped_Nylium")); + miningEXP.put(Material.GILDED_BLACKSTONE, expMap.get("breakGilded_Blackstone")); + } + if (mcVersion >= 1.17) { + miningEXP.put(Material.AMETHYST_CLUSTER, expMap.get("breakAmethyst_Cluster")); + miningEXP.put(Material.AMETHYST_BLOCK, expMap.get("breakAmethyst_Block")); + miningEXP.put(Material.RAW_COPPER_BLOCK, expMap.get("breakRaw_Copper_Block")); + miningEXP.put(Material.RAW_IRON_BLOCK, expMap.get("breakRaw_Iron_Block")); + miningEXP.put(Material.CALCITE, expMap.get("breakCalcite")); + miningEXP.put(Material.DEEPSLATE, expMap.get("breakDeepslate")); + miningEXP.put(Material.COPPER_ORE, expMap.get("breakCopper_Ore")); + miningEXP.put(Material.DEEPSLATE_COAL_ORE, expMap.get("breakDeepslate_Coal_Ore")); + miningEXP.put(Material.DEEPSLATE_COPPER_ORE, expMap.get("breakDeepslate_Copper_Ore")); + miningEXP.put(Material.DEEPSLATE_DIAMOND_ORE, expMap.get("breakDeepslate_Diamond_Ore")); + miningEXP.put(Material.DEEPSLATE_EMERALD_ORE, expMap.get("breakDeepslate_Emerald_Ore")); + miningEXP.put(Material.DEEPSLATE_GOLD_ORE, expMap.get("breakDeepslate_Gold_Ore")); + miningEXP.put(Material.DEEPSLATE_IRON_ORE, expMap.get("breakDeepslate_Iron_Ore")); + miningEXP.put(Material.DEEPSLATE_LAPIS_ORE, expMap.get("breakDeepslate_Lapis_Ore")); + miningEXP.put(Material.DEEPSLATE_REDSTONE_ORE, expMap.get("breakDeepslate_Redstone_Ore")); + miningEXP.put(Material.DRIPSTONE_BLOCK, expMap.get("breakDripstone_Block")); + miningEXP.put(Material.POINTED_DRIPSTONE, expMap.get("breakPointed_Dripstone")); + miningEXP.put(Material.TUFF, expMap.get("breakTuff")); + } + } + + public void initializeFarmingEXP() { + ConfigLoad configLoad = new ConfigLoad(); + Map expMap = configLoad.getExpMapForSkill("farming"); + farmingEXP.put(Material.WHEAT, expMap.get("breakWheat")); + farmingEXP.put(Material.BEETROOTS, expMap.get("breakBeatRoots")); + farmingEXP.put(Material.CARROTS, expMap.get("breakCarrots")); + farmingEXP.put(Material.POTATOES, expMap.get("breakPotatoes")); + farmingEXP.put(Material.MELON, expMap.get("breakMelon")); + farmingEXP.put(Material.PUMPKIN, expMap.get("breakPumpkin")); + farmingEXP.put(Material.BAMBOO, expMap.get("breakBamboo")); + farmingEXP.put(Material.COCOA, expMap.get("breakCocoa")); + farmingEXP.put(Material.SUGAR_CANE, expMap.get("breakSugarCane")); + farmingEXP.put(Material.CACTUS, expMap.get("breakCactus")); + farmingEXP.put(Material.RED_MUSHROOM, expMap.get("breakRed_Mushroom")); + farmingEXP.put(Material.BROWN_MUSHROOM, expMap.get("breakBrown_Mushroom")); + farmingEXP.put(Material.SWEET_BERRIES, expMap.get("breakSweetBerries")); + farmingEXP.put(Material.KELP, expMap.get("breakKelp")); + farmingEXP.put(Material.SEA_PICKLE, expMap.get("breakSea_Pickle")); + farmingEXP.put(Material.NETHER_WART, expMap.get("breakNether_Wart")); + farmingEXP.put(Material.CHORUS_PLANT, expMap.get("breakChorusPlant")); + if (mcVersion >= 1.17) { + farmingEXP.put(Material.AZALEA, expMap.get("breakAzalea")); + farmingEXP.put(Material.FLOWERING_AZALEA, expMap.get("breakFlowering_Aealea")); + farmingEXP.put(Material.CAVE_VINES, expMap.get("breakCave_Vines")); + farmingEXP.put(Material.SMALL_DRIPLEAF, expMap.get("breakSmall_Dripleaf")); + farmingEXP.put(Material.GLOW_LICHEN, expMap.get("breakGlow_Lichen")); + farmingEXP.put(Material.HANGING_ROOTS, expMap.get("breakHanging_Roots")); + farmingEXP.put(Material.MOSS_BLOCK, expMap.get("breakMoos_block")); + farmingEXP.put(Material.SPORE_BLOSSOM, expMap.get("breakSpore_Blossom")); + // Not sure if this is a great idea + farmingEXP.put(Material.BIG_DRIPLEAF, expMap.get("breakBig_Dripleaf")); + farmingEXP.put(Material.BIG_DRIPLEAF_STEM, expMap.get("breakBig_Dripleaf")); + } + } + + public void initializeFlamePickEXP() { + ConfigLoad configLoad = new ConfigLoad(); + Map> expMap = configLoad.getExpMap(); + flamePickEXP.put(Material.IRON_ORE, + new Object[]{"mining", expMap.get("mining").get("breakIron_Ore")}); + flamePickEXP.put(Material.GOLD_ORE, + new Object[]{"mining", expMap.get("mining").get("breakGold_Ore")}); + flamePickEXP.put(Material.COBBLESTONE, new Object[]{"mining", 0}); + flamePickEXP.put(Material.STONE, + new Object[]{"mining", expMap.get("mining").get("breakStone")}); + flamePickEXP.put(Material.SANDSTONE, + new Object[]{"mining", expMap.get("mining").get("breakSandstone")}); + flamePickEXP.put(Material.RED_SANDSTONE, + new Object[]{"mining", expMap.get("mining").get("breakRed_Sandstone")}); + flamePickEXP.put(Material.SAND, + new Object[]{"digging", expMap.get("digging").get("breakSand")}); + flamePickEXP.put(Material.QUARTZ_BLOCK, new Object[]{"mining", 0}); + flamePickEXP.put(Material.NETHERRACK, + new Object[]{"mining", expMap.get("mining").get("breakNetherrack")}); + flamePickEXP.put(Material.CLAY, + new Object[]{"digging", expMap.get("digging").get("breakClay")}); + flamePickEXP.put(Material.STONE_BRICKS, new Object[]{"mining", 0}); + flamePickEXP.put(Material.WET_SPONGE, new Object[]{"mining", 0}); + flamePickEXP.put(Material.CACTUS, + new Object[]{"farming", expMap.get("farming").get("breakCactus")}); + flamePickEXP.put(Material.JUNGLE_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakJungle_Log")}); + flamePickEXP.put(Material.SPRUCE_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakSpruce_Log")}); + flamePickEXP.put(Material.OAK_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakOak_Log")}); + flamePickEXP.put(Material.DARK_OAK_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakDark_Oak_Log")}); + flamePickEXP.put(Material.BIRCH_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakBirch_Log")}); + flamePickEXP.put(Material.ACACIA_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakAcacia_Log")}); + flamePickEXP.put(Material.STRIPPED_JUNGLE_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakJungle_Log")}); + flamePickEXP.put(Material.STRIPPED_SPRUCE_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakSpruce_Log")}); + flamePickEXP.put(Material.STRIPPED_OAK_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakOak_Log")}); + flamePickEXP.put(Material.STRIPPED_DARK_OAK_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakDark_Oak_Log")}); + flamePickEXP.put(Material.STRIPPED_BIRCH_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakBirch_Log")}); + flamePickEXP.put(Material.STRIPPED_ACACIA_LOG, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakAcacia_Log")}); + flamePickEXP.put(Material.JUNGLE_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakJungle_Log")}); + flamePickEXP.put(Material.SPRUCE_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakSpruce_Log")}); + flamePickEXP.put(Material.OAK_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakOak_Log")}); + flamePickEXP.put(Material.DARK_OAK_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakDark_Oak_Log")}); + flamePickEXP.put(Material.BIRCH_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakBirch_Log")}); + flamePickEXP.put(Material.ACACIA_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakAcacia_Log")}); + flamePickEXP.put(Material.STRIPPED_JUNGLE_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakJungle_Log")}); + flamePickEXP.put(Material.STRIPPED_SPRUCE_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakSpruce_Log")}); + flamePickEXP.put(Material.STRIPPED_OAK_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakOak_Log")}); + flamePickEXP.put(Material.STRIPPED_DARK_OAK_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakDark_Oak_Log")}); + flamePickEXP.put(Material.STRIPPED_BIRCH_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakBirch_Log")}); + flamePickEXP.put(Material.STRIPPED_ACACIA_WOOD, + new Object[]{"woodcutting", expMap.get("woodcutting").get("breakAcacia_Log")}); + if (mcVersion >= 1.16) { + flamePickEXP.put(Material.NETHER_GOLD_ORE, + new Object[]{"mining", expMap.get("mining").get("breakNether_Gold_Ore")}); + flamePickEXP.put(Material.ANCIENT_DEBRIS, + new Object[]{"mining", expMap.get("mining").get("breakAncient_Debris")}); + } + } + + + public Map getDiggingEXP() { + return diggingEXP; + } + + public Map getWoodcuttingEXP() { + return woodcuttingEXP; + } + + public Map getMiningEXP() { + return miningEXP; + } + + public Map getFarmingEXP() { + return farmingEXP; + } + + public Map getFlamePickEXP() { + return flamePickEXP; + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/globalVariables/ItemGroups.java b/src/main/java/mc/carlton/freerpg/utils/globalVariables/ItemGroups.java new file mode 100644 index 0000000..f02e3d5 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/globalVariables/ItemGroups.java @@ -0,0 +1,1086 @@ +package mc.carlton.freerpg.utils.globalVariables; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.core.info.server.MinecraftVersion; +import mc.carlton.freerpg.customContainers.OldCustomPotion; +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.potion.PotionData; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.potion.PotionType; + +/** + * ItemGroups initializes all items and blocks tracked by the plugin + */ +public class ItemGroups { + + static List newIngredients = new ArrayList<>(); + static List oldIngredients = new ArrayList<>(); + static ItemStack hastePotion; + static ItemStack fatiguePotion; + static ItemStack heroPotion; + static ItemStack decayPotion; + static ItemStack resistancePotion; + static List leftClickItems; + static List pickaxes; + static List axes; + static List shovels; + static List hoes; + static List swords; + static List noRightClick; + static List actionableBlocks; + static List harmfulEffects; + static List logs; + static List tallCrops; + static Map trackedBlocks = new ConcurrentHashMap<>(); + static Map enchantmentLevelMap = new HashMap<>(); + static List crops; + static Map farmFood = new HashMap(); + static Map meatFood = new HashMap(); + static Map farmFoodSaturation = new HashMap(); + static Map meatFoodSaturation = new HashMap(); + static Map fishFood = new HashMap(); + static Map fishFoodSaturation = new HashMap(); + static List valuableItems; + static List ores; + static List flamePickOres; + static HashSet veinMinerBlocks = new HashSet<>(); + static Map repairItems = new HashMap<>(); + static Map repairItemsAmount = new HashMap<>(); + static List strippedLogs; + static List wood; + static List strippedWood; + static ArrayList allLogs = new ArrayList<>(); + static List leaves; + static Map effectArrows = new HashMap<>(); + static Map smeltableItemsMap = new HashMap<>(); + static Map smeltingXPMap = new HashMap<>(); + private MinecraftVersion minecraftVersion = new MinecraftVersion(); + private double mcVersion = minecraftVersion.getMinecraftVersionAsDouble(); + + public static ArrayList getAllLogs() { + return allLogs; + } + + public void initializeItemGroups() { + initializeRepairItems(); + initializeIngredients(); + initializeCustomPostions(); + initializeLeftClickItems(); + initializeTools(); + initializeActionItems(); + initializeHarmfulPotions(); + initializeBlocks(); + initializeEnchantmentLevelMap(); + initializeFoodMaps(); + initializeValuableItems(); + initalizeArrows(); + initializeSmeltableItemsMap(); + initializeSmeltingXPMap(); + initializeTrackedBlocks(); + } + + public void initializeEnchantmentLevelMap() { + enchantmentLevelMap.put(Enchantment.ARROW_KNOCKBACK, 2); + enchantmentLevelMap.put(Enchantment.ARROW_DAMAGE, 5); + enchantmentLevelMap.put(Enchantment.ARROW_FIRE, 1); + enchantmentLevelMap.put(Enchantment.ARROW_INFINITE, 1); + enchantmentLevelMap.put(Enchantment.BINDING_CURSE, 1); + enchantmentLevelMap.put(Enchantment.CHANNELING, 1); + enchantmentLevelMap.put(Enchantment.DAMAGE_ALL, 4); + enchantmentLevelMap.put(Enchantment.DAMAGE_ARTHROPODS, 4); + enchantmentLevelMap.put(Enchantment.DAMAGE_UNDEAD, 4); + enchantmentLevelMap.put(Enchantment.DEPTH_STRIDER, 2); + enchantmentLevelMap.put(Enchantment.DIG_SPEED, 4); + enchantmentLevelMap.put(Enchantment.DURABILITY, 3); + enchantmentLevelMap.put(Enchantment.FIRE_ASPECT, 2); + enchantmentLevelMap.put(Enchantment.FROST_WALKER, 2); + enchantmentLevelMap.put(Enchantment.IMPALING, 4); + enchantmentLevelMap.put(Enchantment.KNOCKBACK, 2); + enchantmentLevelMap.put(Enchantment.LOOT_BONUS_BLOCKS, 3); + enchantmentLevelMap.put(Enchantment.LUCK, 3); + enchantmentLevelMap.put(Enchantment.LOOT_BONUS_MOBS, 3); + enchantmentLevelMap.put(Enchantment.LOYALTY, 3); + enchantmentLevelMap.put(Enchantment.LURE, 3); + enchantmentLevelMap.put(Enchantment.MENDING, 1); + enchantmentLevelMap.put(Enchantment.MULTISHOT, 1); + enchantmentLevelMap.put(Enchantment.OXYGEN, 3); + enchantmentLevelMap.put(Enchantment.PIERCING, 4); + enchantmentLevelMap.put(Enchantment.PROTECTION_ENVIRONMENTAL, 4); + enchantmentLevelMap.put(Enchantment.PROTECTION_EXPLOSIONS, 4); + enchantmentLevelMap.put(Enchantment.PROTECTION_FALL, 4); + enchantmentLevelMap.put(Enchantment.PROTECTION_FIRE, 4); + enchantmentLevelMap.put(Enchantment.PROTECTION_PROJECTILE, 4); + enchantmentLevelMap.put(Enchantment.QUICK_CHARGE, 3); + enchantmentLevelMap.put(Enchantment.RIPTIDE, 3); + enchantmentLevelMap.put(Enchantment.SILK_TOUCH, 1); + enchantmentLevelMap.put(Enchantment.SWEEPING_EDGE, 3); + enchantmentLevelMap.put(Enchantment.THORNS, 3); + enchantmentLevelMap.put(Enchantment.VANISHING_CURSE, 1); + enchantmentLevelMap.put(Enchantment.WATER_WORKER, 1); + } + + // TODO Comment what for the blocks are tracked + public void initializeTrackedBlocks() { + Material[] trackedBlocks0 = new Material[]{Material.ACACIA_LOG, Material.ACACIA_LEAVES, + Material.BIRCH_LOG, Material.BIRCH_LEAVES, + Material.DARK_OAK_LOG, Material.DARK_OAK_LEAVES, Material.JUNGLE_LOG, + Material.JUNGLE_LEAVES, + Material.OAK_LOG, Material.OAK_LEAVES, Material.SPRUCE_LOG, Material.SPRUCE_LEAVES, + Material.COAL_ORE, Material.DIAMOND_ORE, Material.EMERALD_ORE, Material.GOLD_ORE, + Material.IRON_ORE, Material.LAPIS_ORE, Material.NETHER_QUARTZ_ORE, Material.REDSTONE_ORE, + Material.SUGAR_CANE, Material.MELON, Material.PUMPKIN, Material.RED_MUSHROOM, + Material.BROWN_MUSHROOM, + Material.BAMBOO, Material.CACTUS, Material.SPAWNER}; + List trackedBlocks1 = new LinkedList<>(Arrays.asList(trackedBlocks0)); + if (mcVersion >= 1.16) { + Material[] trackedBlocks_v1_16 = {Material.ANCIENT_DEBRIS, Material.NETHER_GOLD_ORE, + Material.WARPED_STEM, + Material.CRIMSON_STEM, Material.GILDED_BLACKSTONE}; + List trackedBlocks_append = Arrays.asList(trackedBlocks_v1_16); + trackedBlocks1.addAll(trackedBlocks_append); + } + if (mcVersion >= 1.17) { + Material[] trackedBlocks_v1_17 = {Material.DEEPSLATE_COAL_ORE, Material.DEEPSLATE_DIAMOND_ORE, + Material.DEEPSLATE_COPPER_ORE, Material.DEEPSLATE_EMERALD_ORE, + Material.DEEPSLATE_IRON_ORE, + Material.DEEPSLATE_GOLD_ORE, Material.DEEPSLATE_LAPIS_ORE, + Material.DEEPSLATE_REDSTONE_ORE}; + List trackedBlocks_append = Arrays.asList(trackedBlocks_v1_17); + trackedBlocks1.addAll(trackedBlocks_append); + } + for (Material mat : trackedBlocks1) { + trackedBlocks.putIfAbsent(mat, true); + } + ConfigLoad configLoad = new ConfigLoad(); + ExpMaps expMaps = new ExpMaps(); + + // Sets the exp for the blocks + if (!configLoad.isTrackFewerBlocks()) { + for (Material mat : expMaps.getWoodcuttingEXP().keySet()) { + trackedBlocks.putIfAbsent(mat, true); + } + for (Material mat : expMaps.getDiggingEXP().keySet()) { + trackedBlocks.putIfAbsent(mat, true); + } + for (Material mat : expMaps.getFlamePickEXP().keySet()) { + trackedBlocks.putIfAbsent(mat, true); + } + for (Material mat : expMaps.getMiningEXP().keySet()) { + trackedBlocks.putIfAbsent(mat, true); + } + } + } + + public void initializeBlocks() { + Material[] tallCrops0 = {Material.SUGAR_CANE, Material.BAMBOO, Material.CACTUS, Material.KELP, + Material.KELP_PLANT}; + tallCrops = Arrays.asList(tallCrops0); + Material[] logs0 = {Material.ACACIA_LOG, Material.BIRCH_LOG, Material.DARK_OAK_LOG, + Material.OAK_LOG, + Material.SPRUCE_LOG, Material.JUNGLE_LOG, Material.STRIPPED_ACACIA_LOG, + Material.STRIPPED_BIRCH_LOG, + Material.STRIPPED_DARK_OAK_LOG, Material.STRIPPED_JUNGLE_LOG, Material.STRIPPED_OAK_LOG, + Material.STRIPPED_SPRUCE_LOG}; + logs = new LinkedList<>(Arrays.asList(logs0)); + if (mcVersion >= 1.16) { + Material[] logs_append0 = {Material.CRIMSON_STEM, Material.WARPED_STEM, + Material.STRIPPED_CRIMSON_STEM, + Material.STRIPPED_WARPED_STEM}; + List logs_append = Arrays.asList(logs_append0); + logs.addAll(logs_append); + } + // TODO What is the reason why Material.MELON is missing below and pumkin is not? + Material[] crops0 = {Material.WHEAT, Material.BEETROOTS, Material.CARROTS, + Material.CHORUS_FLOWER, + Material.MELON_STEM, Material.MELON, Material.NETHER_WART, Material.POTATOES, + Material.PUMPKIN_STEM, + Material.PUMPKIN, Material.SWEET_BERRY_BUSH, Material.COCOA, Material.CAVE_VINES}; + /* + TODO exp of cave_vines only apply to the lowest part of the cave_vines, otherwise they don't give exp + Its better to only give exp if the cave_vines with blockstate berries=true are broken! + */ + crops = Arrays.asList(crops0); + // adds ore to list + Material[] ores0 = {Material.REDSTONE_ORE, Material.NETHER_QUARTZ_ORE, Material.LAPIS_ORE, + Material.IRON_ORE, + Material.GOLD_ORE, Material.EMERALD_ORE, Material.DIAMOND_ORE, Material.COAL_ORE}; + ores = new LinkedList<>(Arrays.asList(ores0)); + // appends new 1.16 ores to LinkedList ores + if (mcVersion >= 1.16) { + Material[] ores_append_v1_16 = {Material.NETHER_GOLD_ORE, Material.ANCIENT_DEBRIS, + Material.GILDED_BLACKSTONE}; + List ores_append = Arrays.asList(ores_append_v1_16); + ores.addAll(ores_append); + } + // appends new 1.17 ores to LinkedList ores + if (mcVersion >= 1.17) { + Material[] ores_append_v1_17 = {Material.DEEPSLATE_COAL_ORE, Material.DEEPSLATE_DIAMOND_ORE, + Material.DEEPSLATE_COPPER_ORE, Material.DEEPSLATE_EMERALD_ORE, + Material.DEEPSLATE_IRON_ORE, + Material.DEEPSLATE_GOLD_ORE, Material.DEEPSLATE_LAPIS_ORE, + Material.DEEPSLATE_REDSTONE_ORE}; + List ores_append = Arrays.asList(ores_append_v1_17); + ores.addAll(ores_append); + } + // adds all ores which can be smelted to LinkedList flamePickOres + // TODO What exactly is flamePickOres, maybe needs comment to describe it! + // TODO Might need a rework due to ore changes in 1.18, so that code is backwards compatible to older versions + Material[] flamePickOres0 = {Material.IRON_ORE, Material.GOLD_ORE}; + flamePickOres = new LinkedList<>(Arrays.asList(flamePickOres0)); + // appends new 1.16 ores + if (mcVersion >= 1.16) { + Material[] flamePickOres_append_v1_16 = {Material.NETHER_GOLD_ORE, Material.ANCIENT_DEBRIS}; + List flamePickOres_append = Arrays.asList(flamePickOres_append_v1_16); + flamePickOres.addAll(flamePickOres_append); + } + Material[] strippedLogs0 = {Material.STRIPPED_SPRUCE_LOG, Material.STRIPPED_OAK_LOG, + Material.STRIPPED_JUNGLE_LOG, + Material.STRIPPED_DARK_OAK_LOG, Material.STRIPPED_BIRCH_LOG, Material.STRIPPED_ACACIA_LOG}; + strippedLogs = Arrays.asList(strippedLogs0); + Material[] wood0 = {Material.SPRUCE_WOOD, Material.OAK_WOOD, Material.JUNGLE_WOOD, + Material.DARK_OAK_WOOD, + Material.BIRCH_WOOD, Material.ACACIA_WOOD}; + wood = Arrays.asList(wood0); + Material[] strippedWood0 = {Material.STRIPPED_SPRUCE_WOOD, Material.STRIPPED_OAK_WOOD, + Material.STRIPPED_JUNGLE_WOOD, + Material.STRIPPED_DARK_OAK_WOOD, Material.STRIPPED_BIRCH_WOOD, + Material.STRIPPED_ACACIA_WOOD}; + strippedWood = Arrays.asList(strippedWood0); + allLogs.addAll(logs); + allLogs.addAll(strippedLogs); + allLogs.addAll(wood); + allLogs.addAll(strippedWood); + Material[] leaves0 = {Material.ACACIA_LEAVES, Material.BIRCH_LEAVES, Material.DARK_OAK_LEAVES, + Material.OAK_LEAVES, + Material.SPRUCE_LEAVES, Material.JUNGLE_LEAVES}; + leaves = new LinkedList<>(Arrays.asList(leaves0)); + // TODO Do the leaves of all the nether trees count as well? Might need to be added + // appends new 1.17 leaves + if (mcVersion >= 1.17) { + Material[] leaves_append_v1_17 = {Material.AZALEA_LEAVES, Material.FLOWERING_AZALEA_LEAVES}; + List leaves_append = Arrays.asList(leaves_append_v1_17); + leaves.addAll(leaves_append); + } + + ConfigLoad configLoad = new ConfigLoad(); + veinMinerBlocks = configLoad.getVeinMinerBlocks(); + } + + public void initializeHarmfulPotions() { + PotionEffectType[] harmfulEffects0 = {PotionEffectType.WEAKNESS, PotionEffectType.POISON, + PotionEffectType.BLINDNESS, PotionEffectType.HUNGER, + PotionEffectType.HARM, PotionEffectType.SLOW_DIGGING, PotionEffectType.SLOW, + PotionEffectType.WEAKNESS, PotionEffectType.WITHER}; + harmfulEffects = Arrays.asList(harmfulEffects0); + } + + public void initializeActionItems() { + Material[] noRightClick0 = {Material.AIR, Material.ARROW, Material.SPECTRAL_ARROW, + Material.TIPPED_ARROW, Material.BLAZE_POWDER, + Material.BLAZE_ROD, Material.BONE, Material.BOOK, Material.BOWL, Material.CHARCOAL, + Material.COAL, Material.CLAY, Material.BRICK, Material.COMPASS, + Material.DIAMOND_HORSE_ARMOR, Material.DRAGON_BREATH, + Material.MAP, Material.ENCHANTED_BOOK, Material.FEATHER, Material.FERMENTED_SPIDER_EYE, + Material.FIREWORK_STAR, + Material.FLINT, Material.GHAST_TEAR, Material.GLISTERING_MELON_SLICE, + Material.GLOWSTONE_DUST, Material.GOLDEN_HORSE_ARMOR, + Material.GOLD_NUGGET, Material.GOLD_INGOT, Material.GUNPOWDER, Material.INK_SAC, + Material.IRON_HORSE_ARMOR, + Material.MAGMA_CREAM, Material.NETHER_BRICK, Material.NETHER_WART, Material.PAPER, + Material.PRISMARINE_SHARD, Material.PRISMARINE_CRYSTALS, + Material.RABBIT_HIDE, Material.LEATHER, Material.LEATHER_HORSE_ARMOR, Material.RABBIT_FOOT, + Material.SADDLE, Material.SHEARS, + Material.SLIME_BALL, Material.SHULKER_SHELL, Material.SPIDER_EYE, Material.STICK, + Material.STRING, Material.TOTEM_OF_UNDYING, + Material.CLOCK, Material.WRITTEN_BOOK}; + noRightClick = Arrays.asList(noRightClick0); + Material[] actionableBlocks0 = {Material.ANVIL, Material.BLACK_BED, Material.BLUE_BED, + Material.BROWN_BED, Material.CYAN_BED, Material.GRAY_BED, + Material.GREEN_BED, Material.LIGHT_BLUE_BED, Material.LIGHT_GRAY_BED, Material.LIME_BED, + Material.MAGENTA_BED, + Material.ORANGE_BED, Material.PINK_BED, Material.PURPLE_BED, Material.RED_BED, + Material.WHITE_BED, Material.YELLOW_BED, + Material.BELL, Material.BLAST_FURNACE, Material.BREWING_STAND, Material.CARTOGRAPHY_TABLE, + Material.CHEST, Material.COMPOSTER, + Material.CRAFTING_TABLE, Material.ACACIA_DOOR, Material.BIRCH_DOOR, Material.DARK_OAK_DOOR, + Material.IRON_DOOR, Material.JUNGLE_DOOR, + Material.OAK_DOOR, Material.SPRUCE_DOOR, Material.ENCHANTING_TABLE, + Material.ACACIA_FENCE_GATE, Material.BIRCH_FENCE_GATE, + Material.DARK_OAK_FENCE_GATE, Material.JUNGLE_FENCE_GATE, Material.OAK_FENCE_GATE, + Material.SPRUCE_FENCE_GATE, Material.FURNACE, + Material.GRINDSTONE, Material.JUKEBOX, Material.LECTERN, Material.LOOM, Material.NOTE_BLOCK, + Material.SMOKER, Material.STONECUTTER, + Material.TRAPPED_CHEST, Material.ACACIA_TRAPDOOR, Material.BIRCH_TRAPDOOR, + Material.DARK_OAK_TRAPDOOR, Material.IRON_TRAPDOOR, + Material.JUNGLE_TRAPDOOR, Material.OAK_TRAPDOOR, Material.SPRUCE_TRAPDOOR, Material.BARREL, + Material.ACACIA_BUTTON, Material.BIRCH_BUTTON, + Material.DARK_OAK_BUTTON, Material.OAK_BUTTON, Material.JUNGLE_BUTTON, + Material.SPRUCE_BUTTON, Material.STONE_BUTTON, Material.REPEATER, + Material.COMPARATOR, Material.HOPPER, Material.HOPPER_MINECART, Material.DAYLIGHT_DETECTOR, + Material.LEVER, Material.FURNACE_MINECART, + Material.DISPENSER, Material.DROPPER, Material.CHIPPED_ANVIL, Material.DAMAGED_ANVIL, + Material.SHULKER_BOX, Material.ENDER_CHEST, Material.BLACK_SHULKER_BOX, + Material.BLUE_SHULKER_BOX, Material.BROWN_SHULKER_BOX, Material.CYAN_SHULKER_BOX, + Material.GRAY_SHULKER_BOX, Material.GREEN_SHULKER_BOX, Material.LIGHT_BLUE_SHULKER_BOX, + Material.LIGHT_GRAY_SHULKER_BOX, Material.LIME_SHULKER_BOX, Material.MAGENTA_SHULKER_BOX, + Material.RED_SHULKER_BOX, Material.WHITE_SHULKER_BOX, Material.YELLOW_SHULKER_BOX, + Material.ORANGE_SHULKER_BOX, Material.PURPLE_SHULKER_BOX, Material.PINK_SHULKER_BOX}; + actionableBlocks = Arrays.asList(actionableBlocks0); + } + + public void initializeTools() { + Material[] pickaxes0 = {Material.DIAMOND_PICKAXE, Material.GOLDEN_PICKAXE, + Material.IRON_PICKAXE, Material.STONE_PICKAXE, Material.WOODEN_PICKAXE}; + pickaxes = new LinkedList<>(Arrays.asList(pickaxes0)); + Material[] axes0 = {Material.DIAMOND_AXE, Material.GOLDEN_AXE, Material.IRON_AXE, + Material.STONE_AXE, Material.WOODEN_AXE}; + axes = new LinkedList<>(Arrays.asList(axes0)); + Material[] shovels0 = {Material.DIAMOND_SHOVEL, Material.GOLDEN_SHOVEL, Material.IRON_SHOVEL, + Material.STONE_SHOVEL, Material.WOODEN_SHOVEL}; + shovels = new LinkedList<>(Arrays.asList(shovels0)); + Material[] hoes0 = {Material.DIAMOND_HOE, Material.GOLDEN_HOE, Material.IRON_HOE, + Material.STONE_HOE, Material.WOODEN_HOE}; + hoes = new LinkedList<>(Arrays.asList(hoes0)); + Material[] swords0 = {Material.WOODEN_SWORD, Material.STONE_SWORD, Material.GOLDEN_SWORD, + Material.DIAMOND_SWORD, Material.IRON_SWORD}; + swords = new LinkedList<>(Arrays.asList(swords0)); + if (mcVersion >= 1.16) { + pickaxes.add(Material.NETHERITE_PICKAXE); + axes.add(Material.NETHERITE_AXE); + shovels.add(Material.NETHERITE_SHOVEL); + hoes.add(Material.NETHERITE_HOE); + swords.add(Material.NETHERITE_SWORD); + } + } + + public void initializeLeftClickItems() { + Material[] leftClickItems0 = {Material.IRON_SWORD, Material.DIAMOND_SWORD, + Material.GOLDEN_SWORD, Material.STONE_SWORD, Material.WOODEN_SWORD, + Material.IRON_PICKAXE, Material.DIAMOND_PICKAXE, Material.STONE_PICKAXE, + Material.GOLDEN_PICKAXE, Material.WOODEN_PICKAXE, + Material.IRON_SHOVEL, Material.DIAMOND_SHOVEL, Material.GOLDEN_SHOVEL, + Material.STONE_SHOVEL, Material.WOODEN_SHOVEL, + Material.IRON_AXE, Material.DIAMOND_AXE, Material.GOLDEN_AXE, Material.STONE_AXE, + Material.WOODEN_AXE, + Material.BOW, Material.CROSSBOW}; + leftClickItems = new LinkedList<>(Arrays.asList(leftClickItems0)); + if (mcVersion >= 1.16) { + Material[] leftClickItems_append0 = {Material.NETHERITE_SWORD, Material.NETHERITE_SHOVEL, + Material.NETHERITE_AXE, Material.NETHERITE_PICKAXE}; + List leftClickItems_append = Arrays.asList(leftClickItems_append0); + leftClickItems.addAll(leftClickItems_append); + } + } + + public void initializeIngredients() { + ConfigLoad configLoad = new ConfigLoad(); + Map alchemyInfo = configLoad.getAlchemyInfo(); + Material[] newIngredients0 = {alchemyInfo.get("customPotion1").getIngredient(), + alchemyInfo.get("customPotion2").getIngredient(), + alchemyInfo.get("customPotion3").getIngredient(), + alchemyInfo.get("customPotion4").getIngredient(), + alchemyInfo.get("customPotion5").getIngredient()}; + newIngredients = Arrays.asList(newIngredients0); + Material[] oldIngredients0 = {Material.NETHER_WART, Material.GUNPOWDER, Material.GLOWSTONE_DUST, + Material.SPIDER_EYE, Material.GHAST_TEAR, + Material.RABBIT_FOOT, Material.BLAZE_POWDER, Material.GLISTERING_MELON_SLICE, + Material.SUGAR, Material.MAGMA_CREAM, + Material.REDSTONE, Material.PUFFERFISH, Material.GOLDEN_CARROT, Material.TURTLE_HELMET, + Material.PHANTOM_MEMBRANE, + Material.FERMENTED_SPIDER_EYE}; + oldIngredients = Arrays.asList(oldIngredients0); + } + + public void initializeCustomPostions() { + ConfigLoad configLoad = new ConfigLoad(); + Map alchemyInfo = configLoad.getAlchemyInfo(); + + //Hero Potion + heroPotion = alchemyInfo.get("customPotion1").getPotionItemStack(); + + //Mining Fatigue Potion + fatiguePotion = alchemyInfo.get("customPotion2").getPotionItemStack(); + + //Haste Potion + hastePotion = alchemyInfo.get("customPotion3").getPotionItemStack(); + + //decay Potion + decayPotion = alchemyInfo.get("customPotion4").getPotionItemStack(); + + //resistance Potion + resistancePotion = alchemyInfo.get("customPotion5").getPotionItemStack(); + } + + public void initializeFoodMaps() { + farmFood.put(Material.GOLDEN_APPLE, 4); + farmFoodSaturation.put(Material.GOLDEN_APPLE, 13.6); + farmFood.put(Material.GOLDEN_CARROT, 6); + farmFoodSaturation.put(Material.GOLDEN_CARROT, 14.4); + farmFood.put(Material.BAKED_POTATO, 5); + farmFoodSaturation.put(Material.BAKED_POTATO, 6.0); + farmFood.put(Material.BEETROOT, 1); + farmFoodSaturation.put(Material.BEETROOT, 1.2); + farmFood.put(Material.BEETROOT_SOUP, 6); + farmFoodSaturation.put(Material.BEETROOT_SOUP, 7.2); + farmFood.put(Material.BREAD, 5); + farmFoodSaturation.put(Material.BREAD, 6.0); + farmFood.put(Material.CARROT, 3); + farmFoodSaturation.put(Material.CARROT, 3.6); + farmFood.put(Material.MUSHROOM_STEW, 6); + farmFoodSaturation.put(Material.MUSHROOM_STEW, 13.2); + farmFood.put(Material.APPLE, 4); + farmFoodSaturation.put(Material.APPLE, 2.4); + farmFood.put(Material.CHORUS_FRUIT, 4); + farmFoodSaturation.put(Material.CHORUS_FRUIT, 2.4); + farmFood.put(Material.DRIED_KELP, 1); + farmFoodSaturation.put(Material.DRIED_KELP, 0.6); + farmFood.put(Material.MELON_SLICE, 2); + farmFoodSaturation.put(Material.MELON_SLICE, 1.2); + farmFood.put(Material.POTATO, 1); + farmFoodSaturation.put(Material.POTATO, 0.6); + farmFood.put(Material.PUMPKIN_PIE, 8); + farmFoodSaturation.put(Material.PUMPKIN_PIE, 4.8); + farmFood.put(Material.CAKE, 2); + farmFoodSaturation.put(Material.CAKE, 0.4); + farmFood.put(Material.COOKIE, 2); + farmFoodSaturation.put(Material.COOKIE, 0.4); + farmFood.put(Material.HONEY_BOTTLE, 6); + farmFoodSaturation.put(Material.HONEY_BOTTLE, 1.2); + farmFood.put(Material.SWEET_BERRIES, 2); + farmFoodSaturation.put(Material.SWEET_BERRIES, 0.4); + if (mcVersion >= 1.17) { + // TODO check if values are valid! + farmFood.put(Material.GLOW_BERRIES, 2); + farmFoodSaturation.put(Material.GLOW_BERRIES, 0.4); + } + + meatFood.put(Material.COOKED_MUTTON, 6); + meatFoodSaturation.put(Material.COOKED_MUTTON, 9.6); + meatFood.put(Material.COOKED_PORKCHOP, 8); + meatFoodSaturation.put(Material.COOKED_PORKCHOP, 12.8); + meatFood.put(Material.COOKED_BEEF, 8); + meatFoodSaturation.put(Material.COOKED_BEEF, 12.8); + meatFood.put(Material.COOKED_CHICKEN, 6); + meatFoodSaturation.put(Material.COOKED_CHICKEN, 7.2); + meatFood.put(Material.COOKED_RABBIT, 5); + meatFoodSaturation.put(Material.COOKED_RABBIT, 6.0); + meatFood.put(Material.RABBIT_STEW, 10); + meatFoodSaturation.put(Material.RABBIT_STEW, 12.0); + meatFood.put(Material.BEEF, 3); + meatFoodSaturation.put(Material.BEEF, 1.8); + meatFood.put(Material.MUTTON, 2); + meatFoodSaturation.put(Material.MUTTON, 1.2); + meatFood.put(Material.PORKCHOP, 3); + meatFoodSaturation.put(Material.PORKCHOP, 1.8); + meatFood.put(Material.RABBIT, 3); + meatFoodSaturation.put(Material.RABBIT, 1.8); + meatFood.put(Material.CHICKEN, 2); + meatFoodSaturation.put(Material.CHICKEN, 1.2); + meatFood.put(Material.ROTTEN_FLESH, 4); + meatFoodSaturation.put(Material.ROTTEN_FLESH, 0.8); + + fishFood.put(Material.COOKED_SALMON, 6); + fishFoodSaturation.put(Material.COOKED_SALMON, 1.6); + fishFood.put(Material.COOKED_COD, 5); + fishFoodSaturation.put(Material.COOKED_COD, 1.2); + fishFood.put(Material.COD, 2); + fishFoodSaturation.put(Material.COD, 0.4); + fishFood.put(Material.SALMON, 2); + fishFoodSaturation.put(Material.SALMON, 0.4); + fishFood.put(Material.TROPICAL_FISH, 1); + fishFoodSaturation.put(Material.TROPICAL_FISH, 0.2); + fishFood.put(Material.PUFFERFISH, 1); + fishFoodSaturation.put(Material.PUFFERFISH, 0.2); + fishFood.put(Material.DRIED_KELP, 1); + fishFoodSaturation.put(Material.DRIED_KELP, 0.6); + } + + public void initializeValuableItems() { + Material[] valuableItems0 = {Material.IRON_ORE, Material.GOLD_ORE, Material.DIAMOND_ORE, + Material.EMERALD_ORE, Material.REDSTONE_ORE, Material.LAPIS_ORE, + Material.IRON_BLOCK, Material.GOLD_BLOCK, Material.DIAMOND_BLOCK, Material.EMERALD_BLOCK, + Material.REDSTONE_BLOCK, Material.LAPIS_BLOCK, + Material.SLIME_BLOCK, Material.SPONGE, Material.NETHER_QUARTZ_ORE, + Material.NETHER_WART_BLOCK, Material.DRAGON_EGG, Material.SHULKER_BOX, + Material.ENCHANTING_TABLE, Material.ANVIL, Material.BEACON, Material.BREWING_STAND, + Material.CAKE, Material.JUKEBOX, + Material.TNT, Material.CREEPER_HEAD, Material.DRAGON_HEAD, Material.PLAYER_HEAD, + Material.ZOMBIE_HEAD, Material.SKELETON_SKULL, Material.WITHER_SKELETON_SKULL, + Material.ENDER_EYE, Material.ENDER_PEARL, Material.FIREWORK_ROCKET, Material.FIRE_CHARGE, + Material.POTION, Material.SPLASH_POTION, Material.LINGERING_POTION, + Material.NETHER_WART, Material.REDSTONE, Material.TRIDENT, Material.DIAMOND_AXE, + Material.DIAMOND_BOOTS, Material.DIAMOND_CHESTPLATE, + Material.DIAMOND_HELMET, Material.DIAMOND_HOE, Material.DIAMOND_LEGGINGS, + Material.DIAMOND_PICKAXE, Material.DIAMOND_SHOVEL, Material.DIAMOND_SWORD, + Material.ELYTRA, Material.ENCHANTED_BOOK, Material.ENCHANTED_GOLDEN_APPLE, + Material.GOLDEN_APPLE, Material.IRON_INGOT, + Material.MUSIC_DISC_11, Material.MUSIC_DISC_13, Material.MUSIC_DISC_BLOCKS, + Material.MUSIC_DISC_CAT, + Material.MUSIC_DISC_CHIRP, Material.MUSIC_DISC_FAR, Material.MUSIC_DISC_MALL, + Material.MUSIC_DISC_MELLOHI, + Material.MUSIC_DISC_STAL, Material.MUSIC_DISC_STRAD, Material.MUSIC_DISC_WAIT, + Material.MUSIC_DISC_WARD, + Material.NAME_TAG, Material.TIPPED_ARROW, Material.TOTEM_OF_UNDYING, + Material.SPECTRAL_ARROW, Material.DIAMOND, Material.GOLD_INGOT, + Material.HEART_OF_THE_SEA, Material.DRAGON_BREATH, Material.EMERALD, + Material.NAUTILUS_SHELL, Material.NETHER_STAR, Material.SLIME_BALL, + Material.RABBIT_FOOT}; + valuableItems = new LinkedList<>(Arrays.asList(valuableItems0)); + if (mcVersion >= 1.16) { + Material[] valuableItems_append0 = {Material.NETHERITE_SWORD, Material.NETHERITE_HOE, + Material.NETHERITE_SHOVEL, Material.NETHERITE_AXE, Material.NETHERITE_PICKAXE, + Material.NETHER_GOLD_ORE, + Material.NETHERITE_BLOCK, Material.NETHERITE_BOOTS, Material.NETHERITE_CHESTPLATE, + Material.NETHERITE_HELMET, Material.NETHERITE_INGOT, Material.NETHERITE_LEGGINGS, + Material.NETHERITE_SCRAP, Material.ANCIENT_DEBRIS}; + List valueableItems_append = Arrays.asList(valuableItems_append0); + valuableItems.addAll(valueableItems_append); + // TODO might need to add 1.17 items + } + } + + public void initializeRepairItems() { + repairItems.put(Material.WOODEN_AXE, Material.STICK); + repairItems.put(Material.WOODEN_HOE, Material.STICK); + repairItems.put(Material.WOODEN_PICKAXE, Material.STICK); + repairItems.put(Material.WOODEN_SWORD, Material.STICK); + repairItems.put(Material.WOODEN_SHOVEL, Material.STICK); + repairItems.put(Material.LEATHER_HELMET, Material.LEATHER); + repairItems.put(Material.LEATHER_CHESTPLATE, Material.LEATHER); + repairItems.put(Material.LEATHER_LEGGINGS, Material.LEATHER); + repairItems.put(Material.LEATHER_BOOTS, Material.LEATHER); + repairItems.put(Material.IRON_AXE, Material.IRON_INGOT); + repairItems.put(Material.IRON_HOE, Material.IRON_INGOT); + repairItems.put(Material.IRON_PICKAXE, Material.IRON_INGOT); + repairItems.put(Material.IRON_SWORD, Material.IRON_INGOT); + repairItems.put(Material.IRON_SHOVEL, Material.IRON_INGOT); + repairItems.put(Material.IRON_HELMET, Material.IRON_INGOT); + repairItems.put(Material.IRON_CHESTPLATE, Material.IRON_INGOT); + repairItems.put(Material.IRON_LEGGINGS, Material.IRON_INGOT); + repairItems.put(Material.IRON_BOOTS, Material.IRON_INGOT); + repairItems.put(Material.GOLDEN_AXE, Material.GOLD_INGOT); + repairItems.put(Material.GOLDEN_HOE, Material.GOLD_INGOT); + repairItems.put(Material.GOLDEN_PICKAXE, Material.GOLD_INGOT); + repairItems.put(Material.GOLDEN_SWORD, Material.GOLD_INGOT); + repairItems.put(Material.GOLDEN_SHOVEL, Material.GOLD_INGOT); + repairItems.put(Material.GOLDEN_HELMET, Material.GOLD_INGOT); + repairItems.put(Material.GOLDEN_CHESTPLATE, Material.GOLD_INGOT); + repairItems.put(Material.GOLDEN_LEGGINGS, Material.GOLD_INGOT); + repairItems.put(Material.GOLDEN_BOOTS, Material.GOLD_INGOT); + repairItems.put(Material.STONE_AXE, Material.COBBLESTONE); + repairItems.put(Material.STONE_HOE, Material.COBBLESTONE); + repairItems.put(Material.STONE_PICKAXE, Material.COBBLESTONE); + repairItems.put(Material.STONE_SWORD, Material.COBBLESTONE); + repairItems.put(Material.STONE_SHOVEL, Material.COBBLESTONE); + repairItems.put(Material.CHAINMAIL_HELMET, Material.IRON_INGOT); + repairItems.put(Material.CHAINMAIL_CHESTPLATE, Material.IRON_INGOT); + repairItems.put(Material.CHAINMAIL_LEGGINGS, Material.IRON_INGOT); + repairItems.put(Material.CHAINMAIL_BOOTS, Material.IRON_INGOT); + repairItems.put(Material.DIAMOND_AXE, Material.DIAMOND); + repairItems.put(Material.DIAMOND_HOE, Material.DIAMOND); + repairItems.put(Material.DIAMOND_PICKAXE, Material.DIAMOND); + repairItems.put(Material.DIAMOND_SWORD, Material.DIAMOND); + repairItems.put(Material.DIAMOND_SHOVEL, Material.DIAMOND); + repairItems.put(Material.DIAMOND_HELMET, Material.DIAMOND); + repairItems.put(Material.DIAMOND_CHESTPLATE, Material.DIAMOND); + repairItems.put(Material.DIAMOND_LEGGINGS, Material.DIAMOND); + repairItems.put(Material.DIAMOND_BOOTS, Material.DIAMOND); + repairItems.put(Material.SHEARS, Material.IRON_INGOT); + repairItems.put(Material.FISHING_ROD, Material.STRING); + repairItems.put(Material.CARROT_ON_A_STICK, Material.CARROT); + repairItems.put(Material.FLINT_AND_STEEL, Material.FLINT); + repairItems.put(Material.BOW, Material.STRING); + repairItems.put(Material.TRIDENT, Material.PRISMARINE_BRICKS); + repairItems.put(Material.ELYTRA, Material.PHANTOM_MEMBRANE); + repairItems.put(Material.SHIELD, Material.IRON_INGOT); + repairItems.put(Material.CROSSBOW, Material.STRING); + if (mcVersion >= 1.16) { + repairItems.put(Material.NETHERITE_AXE, Material.NETHERITE_SCRAP); + repairItems.put(Material.NETHERITE_HOE, Material.NETHERITE_SCRAP); + repairItems.put(Material.NETHERITE_PICKAXE, Material.NETHERITE_SCRAP); + repairItems.put(Material.NETHERITE_SWORD, Material.NETHERITE_SCRAP); + repairItems.put(Material.NETHERITE_SHOVEL, Material.NETHERITE_SCRAP); + repairItems.put(Material.NETHERITE_HELMET, Material.NETHERITE_SCRAP); + repairItems.put(Material.NETHERITE_CHESTPLATE, Material.NETHERITE_SCRAP); + repairItems.put(Material.NETHERITE_LEGGINGS, Material.NETHERITE_SCRAP); + repairItems.put(Material.NETHERITE_BOOTS, Material.NETHERITE_SCRAP); + } + + repairItemsAmount.put(Material.WOODEN_AXE, 3); + repairItemsAmount.put(Material.WOODEN_HOE, 2); + repairItemsAmount.put(Material.WOODEN_PICKAXE, 3); + repairItemsAmount.put(Material.WOODEN_SWORD, 2); + repairItemsAmount.put(Material.WOODEN_SHOVEL, 1); + repairItemsAmount.put(Material.LEATHER_HELMET, 5); + repairItemsAmount.put(Material.LEATHER_CHESTPLATE, 8); + repairItemsAmount.put(Material.LEATHER_LEGGINGS, 7); + repairItemsAmount.put(Material.LEATHER_BOOTS, 4); + repairItemsAmount.put(Material.IRON_AXE, 3); + repairItemsAmount.put(Material.IRON_HOE, 2); + repairItemsAmount.put(Material.IRON_PICKAXE, 3); + repairItemsAmount.put(Material.IRON_SWORD, 2); + repairItemsAmount.put(Material.IRON_SHOVEL, 1); + repairItemsAmount.put(Material.IRON_HELMET, 5); + repairItemsAmount.put(Material.IRON_CHESTPLATE, 8); + repairItemsAmount.put(Material.IRON_LEGGINGS, 7); + repairItemsAmount.put(Material.IRON_BOOTS, 4); + repairItemsAmount.put(Material.GOLDEN_AXE, 3); + repairItemsAmount.put(Material.GOLDEN_HOE, 2); + repairItemsAmount.put(Material.GOLDEN_PICKAXE, 3); + repairItemsAmount.put(Material.GOLDEN_SWORD, 2); + repairItemsAmount.put(Material.GOLDEN_SHOVEL, 1); + repairItemsAmount.put(Material.GOLDEN_HELMET, 5); + repairItemsAmount.put(Material.GOLDEN_CHESTPLATE, 8); + repairItemsAmount.put(Material.GOLDEN_LEGGINGS, 7); + repairItemsAmount.put(Material.GOLDEN_BOOTS, 4); + repairItemsAmount.put(Material.STONE_AXE, 3); + repairItemsAmount.put(Material.STONE_HOE, 3); + repairItemsAmount.put(Material.STONE_PICKAXE, 3); + repairItemsAmount.put(Material.STONE_SWORD, 2); + repairItemsAmount.put(Material.STONE_SHOVEL, 1); + repairItemsAmount.put(Material.CHAINMAIL_HELMET, 5); + repairItemsAmount.put(Material.CHAINMAIL_CHESTPLATE, 8); + repairItemsAmount.put(Material.CHAINMAIL_LEGGINGS, 7); + repairItemsAmount.put(Material.CHAINMAIL_BOOTS, 4); + repairItemsAmount.put(Material.DIAMOND_AXE, 3); + repairItemsAmount.put(Material.DIAMOND_HOE, 2); + repairItemsAmount.put(Material.DIAMOND_PICKAXE, 3); + repairItemsAmount.put(Material.DIAMOND_SWORD, 2); + repairItemsAmount.put(Material.DIAMOND_SHOVEL, 1); + repairItemsAmount.put(Material.DIAMOND_HELMET, 5); + repairItemsAmount.put(Material.DIAMOND_CHESTPLATE, 8); + repairItemsAmount.put(Material.DIAMOND_LEGGINGS, 7); + repairItemsAmount.put(Material.DIAMOND_BOOTS, 4); + repairItemsAmount.put(Material.SHEARS, 2); + repairItemsAmount.put(Material.FISHING_ROD, 2); + if (mcVersion >= 1.16) { + repairItemsAmount.put(Material.NETHERITE_AXE, 3); + repairItemsAmount.put(Material.NETHERITE_HOE, 2); + repairItemsAmount.put(Material.NETHERITE_PICKAXE, 3); + repairItemsAmount.put(Material.NETHERITE_SWORD, 2); + repairItemsAmount.put(Material.NETHERITE_SHOVEL, 1); + repairItemsAmount.put(Material.NETHERITE_HELMET, 5); + repairItemsAmount.put(Material.NETHERITE_CHESTPLATE, 8); + repairItemsAmount.put(Material.NETHERITE_LEGGINGS, 7); + repairItemsAmount.put(Material.NETHERITE_BOOTS, 4); + } + + repairItemsAmount.put(Material.BOW, 3); + + repairItemsAmount.put(Material.ELYTRA, 10); + repairItemsAmount.put(Material.SHIELD, 1); + repairItemsAmount.put(Material.CROSSBOW, 2); + } + + public void initalizeArrows() { + PotionType[] potionType = {PotionType.WATER, PotionType.MUNDANE, PotionType.THICK, + PotionType.AWKWARD, PotionType.NIGHT_VISION, + PotionType.INVISIBILITY, PotionType.JUMP, PotionType.FIRE_RESISTANCE, PotionType.SPEED, + PotionType.SLOWNESS, + PotionType.WATER_BREATHING, PotionType.INSTANT_HEAL, PotionType.INSTANT_DAMAGE, + PotionType.POISON, + PotionType.REGEN, PotionType.STRENGTH, PotionType.WEAKNESS, PotionType.LUCK, + PotionType.TURTLE_MASTER, PotionType.SLOW_FALLING}; + String[] labels = {"water", "mundane", "thick", "awkward", "night_vision", "invisibility", + "leaping", "fire_resistance", "swiftness", "slowness", + "breathing_water", "healing", "harming", "poison", "regeneration", "strength", "weakness", + "luck", "turtle_master", "slow_falling"}; + String[] modifiers = {"", "long_", "strong_"}; + for (int i = 0; i < labels.length; i++) { + for (String modifier : modifiers) { + if (modifier.equalsIgnoreCase("")) { + ItemStack arrow = new ItemStack(Material.TIPPED_ARROW, 8); + PotionMeta arrowMeta = (PotionMeta) arrow.getItemMeta(); + arrowMeta.setBasePotionData(new PotionData(potionType[i], false, false)); + arrow.setItemMeta(arrowMeta); + effectArrows.put(modifier + labels[i], arrow); + } else if (modifier.equalsIgnoreCase("long_")) { + if (potionType[i].isExtendable()) { + ItemStack arrow = new ItemStack(Material.TIPPED_ARROW, 8); + PotionMeta arrowMeta = (PotionMeta) arrow.getItemMeta(); + arrowMeta.setBasePotionData(new PotionData(potionType[i], true, false)); + arrow.setItemMeta(arrowMeta); + effectArrows.put(modifier + labels[i], arrow); + } + } else { + if (potionType[i].isUpgradeable()) { + ItemStack arrow = new ItemStack(Material.TIPPED_ARROW, 8); + PotionMeta arrowMeta = (PotionMeta) arrow.getItemMeta(); + arrowMeta.setBasePotionData(new PotionData(potionType[i], false, true)); + arrow.setItemMeta(arrowMeta); + effectArrows.put(modifier + labels[i], arrow); + } + } + } + } + + } + + public void initializeSmeltableItemsMap() { + smeltableItemsMap.put(Material.BEEF, Material.COOKED_BEEF); + smeltableItemsMap.put(Material.CHICKEN, Material.COOKED_CHICKEN); + smeltableItemsMap.put(Material.COD, Material.COOKED_COD); + smeltableItemsMap.put(Material.SALMON, Material.COOKED_SALMON); + smeltableItemsMap.put(Material.POTATO, Material.BAKED_POTATO); + smeltableItemsMap.put(Material.MUTTON, Material.COOKED_MUTTON); + smeltableItemsMap.put(Material.RABBIT, Material.COOKED_RABBIT); + smeltableItemsMap.put(Material.KELP, Material.DRIED_KELP); + smeltableItemsMap.put(Material.IRON_ORE, Material.IRON_INGOT); + smeltableItemsMap.put(Material.GOLD_ORE, Material.GOLD_INGOT); + smeltableItemsMap.put(Material.SAND, Material.GLASS); + smeltableItemsMap.put(Material.RED_SAND, Material.GLASS); + smeltableItemsMap.put(Material.COBBLESTONE, Material.STONE); + smeltableItemsMap.put(Material.SANDSTONE, Material.SMOOTH_SANDSTONE); + smeltableItemsMap.put(Material.RED_SANDSTONE, Material.SMOOTH_RED_SANDSTONE); + smeltableItemsMap.put(Material.STONE, Material.SMOOTH_STONE); + smeltableItemsMap.put(Material.QUARTZ_BLOCK, Material.SMOOTH_QUARTZ); + smeltableItemsMap.put(Material.CLAY_BALL, Material.BRICK); + smeltableItemsMap.put(Material.NETHERRACK, Material.NETHER_BRICK); + smeltableItemsMap.put(Material.CLAY, Material.TERRACOTTA); + smeltableItemsMap.put(Material.STONE_BRICKS, Material.CRACKED_STONE_BRICKS); + smeltableItemsMap.put(Material.BLACK_TERRACOTTA, Material.BLACK_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.WHITE_TERRACOTTA, Material.WHITE_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.LIGHT_GRAY_TERRACOTTA, Material.LIGHT_GRAY_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.GRAY_TERRACOTTA, Material.LIGHT_GRAY_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.BROWN_TERRACOTTA, Material.BROWN_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.RED_TERRACOTTA, Material.RED_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.ORANGE_TERRACOTTA, Material.ORANGE_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.YELLOW_TERRACOTTA, Material.YELLOW_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.LIME_TERRACOTTA, Material.LIME_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.GREEN_TERRACOTTA, Material.GREEN_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.CYAN_TERRACOTTA, Material.CYAN_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.LIGHT_BLUE_TERRACOTTA, Material.LIGHT_BLUE_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.BLUE_TERRACOTTA, Material.BLUE_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.PURPLE_TERRACOTTA, Material.PURPLE_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.MAGENTA_TERRACOTTA, Material.MAGENTA_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.PINK_TERRACOTTA, Material.PINK_GLAZED_TERRACOTTA); + smeltableItemsMap.put(Material.CACTUS, Material.GREEN_DYE); + for (Material log : logs) { + smeltableItemsMap.put(log, Material.CHARCOAL); + } + for (Material strippedLog : strippedLogs) { + smeltableItemsMap.put(strippedLog, Material.CHARCOAL); + } + for (Material strippedLog : wood) { + smeltableItemsMap.put(strippedLog, Material.CHARCOAL); + } + for (Material strippedLog : strippedWood) { + smeltableItemsMap.put(strippedLog, Material.CHARCOAL); + } + smeltableItemsMap.put(Material.CHORUS_FRUIT, Material.POPPED_CHORUS_FRUIT); + smeltableItemsMap.put(Material.WET_SPONGE, Material.SPONGE); + smeltableItemsMap.put(Material.SEA_PICKLE, Material.LIME_DYE); + smeltableItemsMap.put(Material.DIAMOND_ORE, Material.DIAMOND); + smeltableItemsMap.put(Material.LAPIS_ORE, Material.LAPIS_LAZULI); + smeltableItemsMap.put(Material.REDSTONE_ORE, Material.REDSTONE); + smeltableItemsMap.put(Material.COAL_ORE, Material.COAL); + smeltableItemsMap.put(Material.EMERALD_ORE, Material.EMERALD); + smeltableItemsMap.put(Material.NETHER_QUARTZ_ORE, Material.QUARTZ); + + smeltableItemsMap.put(Material.IRON_SWORD, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.IRON_PICKAXE, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.IRON_AXE, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.IRON_SHOVEL, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.IRON_HOE, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.CHAINMAIL_HELMET, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.CHAINMAIL_CHESTPLATE, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.CHAINMAIL_LEGGINGS, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.CHAINMAIL_BOOTS, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.IRON_HELMET, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.IRON_CHESTPLATE, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.IRON_LEGGINGS, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.IRON_BOOTS, Material.IRON_NUGGET); + smeltableItemsMap.put(Material.IRON_HORSE_ARMOR, Material.IRON_NUGGET); + + smeltableItemsMap.put(Material.GOLDEN_SWORD, Material.GOLD_NUGGET); + smeltableItemsMap.put(Material.GOLDEN_PICKAXE, Material.GOLD_NUGGET); + smeltableItemsMap.put(Material.GOLDEN_AXE, Material.GOLD_NUGGET); + smeltableItemsMap.put(Material.GOLDEN_SHOVEL, Material.GOLD_NUGGET); + smeltableItemsMap.put(Material.GOLDEN_HOE, Material.GOLD_NUGGET); + smeltableItemsMap.put(Material.GOLDEN_HELMET, Material.GOLD_NUGGET); + smeltableItemsMap.put(Material.GOLDEN_CHESTPLATE, Material.GOLD_NUGGET); + smeltableItemsMap.put(Material.GOLDEN_LEGGINGS, Material.GOLD_NUGGET); + smeltableItemsMap.put(Material.GOLDEN_BOOTS, Material.GOLD_NUGGET); + smeltableItemsMap.put(Material.GOLDEN_HORSE_ARMOR, Material.GOLD_NUGGET); + + if (mcVersion >= 1.16) { + smeltableItemsMap.put(Material.ANCIENT_DEBRIS, Material.NETHERITE_SCRAP); + smeltableItemsMap.put(Material.NETHER_GOLD_ORE, Material.GOLD_INGOT); + smeltableItemsMap.put(Material.NETHER_BRICK, Material.CRACKED_NETHER_BRICKS); + } + if (mcVersion >= 1.17) { + smeltableItemsMap.put(Material.RAW_IRON, Material.RAW_IRON); + smeltableItemsMap.put(Material.RAW_COPPER, Material.RAW_COPPER); + smeltableItemsMap.put(Material.RAW_GOLD, Material.RAW_GOLD); + } + + } + + public void initializeSmeltingXPMap() { + smeltingXPMap.put(Material.BEEF, 0.35); + smeltingXPMap.put(Material.CHICKEN, 0.35); + smeltingXPMap.put(Material.COD, 0.35); + smeltingXPMap.put(Material.SALMON, 0.35); + smeltingXPMap.put(Material.POTATO, 0.35); + smeltingXPMap.put(Material.MUTTON, 0.35); + smeltingXPMap.put(Material.RABBIT, 0.35); + smeltingXPMap.put(Material.KELP, 0.35); + + smeltingXPMap.put(Material.IRON_ORE, 0.7); + smeltingXPMap.put(Material.GOLD_ORE, 1.0); + smeltingXPMap.put(Material.SAND, 0.1); + smeltingXPMap.put(Material.RED_SAND, 0.1); + smeltingXPMap.put(Material.COBBLESTONE, 0.1); + smeltingXPMap.put(Material.SANDSTONE, 0.1); + smeltingXPMap.put(Material.RED_SANDSTONE, 0.1); + smeltingXPMap.put(Material.STONE, 0.1); + smeltingXPMap.put(Material.CLAY_BALL, 0.3); + smeltingXPMap.put(Material.NETHERRACK, 0.1); + smeltingXPMap.put(Material.CLAY, 0.35); + smeltingXPMap.put(Material.STONE_BRICKS, 0.1); + smeltingXPMap.put(Material.BLACK_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.WHITE_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.LIGHT_GRAY_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.GRAY_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.BROWN_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.RED_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.ORANGE_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.YELLOW_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.LIME_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.GREEN_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.CYAN_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.LIGHT_BLUE_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.BLUE_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.PURPLE_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.MAGENTA_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.PINK_TERRACOTTA, 0.1); + smeltingXPMap.put(Material.CACTUS, 1.0); + for (Material log : logs) { + smeltingXPMap.put(log, 0.15); + } + for (Material strippedLog : strippedLogs) { + smeltingXPMap.put(strippedLog, 0.15); + } + for (Material strippedLog : wood) { + smeltingXPMap.put(strippedLog, 0.15); + } + for (Material strippedLog : strippedWood) { + smeltingXPMap.put(strippedLog, 0.15); + } + smeltingXPMap.put(Material.CHORUS_FRUIT, 0.1); + smeltingXPMap.put(Material.WET_SPONGE, 0.15); + smeltingXPMap.put(Material.SEA_PICKLE, 0.1); + smeltingXPMap.put(Material.DIAMOND_ORE, 1.0); + smeltingXPMap.put(Material.LAPIS_ORE, 0.2); + smeltingXPMap.put(Material.REDSTONE_ORE, 0.3); + smeltingXPMap.put(Material.COAL_ORE, 0.1); + smeltingXPMap.put(Material.EMERALD_ORE, 1.0); + smeltingXPMap.put(Material.NETHER_QUARTZ_ORE, 0.2); + + smeltingXPMap.put(Material.IRON_SWORD, 0.1); + smeltingXPMap.put(Material.IRON_PICKAXE, 0.1); + smeltingXPMap.put(Material.IRON_AXE, 0.1); + smeltingXPMap.put(Material.IRON_SHOVEL, 0.1); + smeltingXPMap.put(Material.IRON_HOE, 0.1); + smeltingXPMap.put(Material.CHAINMAIL_HELMET, 0.1); + smeltingXPMap.put(Material.CHAINMAIL_CHESTPLATE, 0.1); + smeltingXPMap.put(Material.CHAINMAIL_LEGGINGS, 0.1); + smeltingXPMap.put(Material.CHAINMAIL_BOOTS, 0.1); + smeltingXPMap.put(Material.IRON_HELMET, 0.1); + smeltingXPMap.put(Material.IRON_CHESTPLATE, 0.1); + smeltingXPMap.put(Material.IRON_LEGGINGS, 0.1); + smeltingXPMap.put(Material.IRON_BOOTS, 0.1); + smeltingXPMap.put(Material.IRON_HORSE_ARMOR, 0.1); + + smeltingXPMap.put(Material.GOLDEN_SWORD, 0.1); + smeltingXPMap.put(Material.GOLDEN_PICKAXE, 0.1); + smeltingXPMap.put(Material.GOLDEN_AXE, 0.1); + smeltingXPMap.put(Material.GOLDEN_SHOVEL, 0.1); + smeltingXPMap.put(Material.GOLDEN_HOE, 0.1); + smeltingXPMap.put(Material.GOLDEN_HELMET, 0.1); + smeltingXPMap.put(Material.GOLDEN_CHESTPLATE, 0.1); + smeltingXPMap.put(Material.GOLDEN_LEGGINGS, 0.1); + smeltingXPMap.put(Material.GOLDEN_BOOTS, 0.1); + smeltingXPMap.put(Material.GOLDEN_HORSE_ARMOR, 0.1); + + if (mcVersion >= 1.16) { + smeltingXPMap.put(Material.ANCIENT_DEBRIS, 2.0); + smeltingXPMap.put(Material.NETHER_GOLD_ORE, 1.0); + smeltingXPMap.put(Material.NETHER_BRICK, 0.1); + } + if (mcVersion >= 1.17) { + smeltingXPMap.put(Material.RAW_IRON, 0.7); + smeltingXPMap.put(Material.RAW_GOLD, 1.0); + smeltingXPMap.put(Material.RAW_COPPER, 0.7); + } + + } + + //Getters + public List getNewIngredients() { + return newIngredients; + } + + public List getOldIngredients() { + return oldIngredients; + } + + public ItemStack getHastePotion() { + return hastePotion; + } + + public ItemStack getFatiguePotion() { + return fatiguePotion; + } + + public ItemStack getHeroPotion() { + return heroPotion; + } + + public ItemStack getDecayPotion() { + return decayPotion; + } + + public ItemStack getResistancePotion() { + return resistancePotion; + } + + public List getLeftClickItems() { + return leftClickItems; + } + + public List getPickaxes() { + return pickaxes; + } + + public List getAxes() { + return axes; + } + + public List getShovels() { + return shovels; + } + + public List getHoes() { + return hoes; + } + + public List getSwords() { + return swords; + } + + public List getNoRightClick() { + return noRightClick; + } + + public List getActionableBlocks() { + return actionableBlocks; + } + + public List getHarmfulEffects() { + return harmfulEffects; + } + + public List getLogs() { + return logs; + } + + public List getTallCrops() { + return tallCrops; + } + + public Map getTrackedBlocks() { + return trackedBlocks; + } + + public Map getEnchantmentLevelMap() { + return enchantmentLevelMap; + } + + public List getCrops() { + return crops; + } + + public Map getFarmFoodSaturation() { + return farmFoodSaturation; + } + + public Map getMeatFoodSaturation() { + return meatFoodSaturation; + } + + public Map getFarmFood() { + return farmFood; + } + + public Map getMeatFood() { + return meatFood; + } + + public Map getFishFoodSaturation() { + return fishFoodSaturation; + } + + public Map getFishFood() { + return fishFood; + } + + public List getValuableItems() { + return valuableItems; + } + + public List getOres() { + return ores; + } + + public Map getRepairItemsAmount() { + return repairItemsAmount; + } + + public Map getRepairItems() { + return repairItems; + } + + public List getLeaves() { + return leaves; + } + + public List getStrippedLogs() { + return strippedLogs; + } + + public Map getSmeltableItemsMap() { + return smeltableItemsMap; + } + + public ItemStack getArrow(String type) { + if (effectArrows.containsKey(type)) { + effectArrows.get(type).setAmount(8); + return effectArrows.get(type); + } + return new ItemStack(Material.ARROW, 8); + } + + public Map getSmeltingXPMap() { + return smeltingXPMap; + } + + public HashSet getVeinMinerBlocks() { + return veinMinerBlocks; + } + + public List getFlamePickOres() { + return flamePickOres; + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/globalVariables/StringsAndOtherData.java b/src/main/java/mc/carlton/freerpg/utils/globalVariables/StringsAndOtherData.java new file mode 100644 index 0000000..477317c --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/globalVariables/StringsAndOtherData.java @@ -0,0 +1,920 @@ +package mc.carlton.freerpg.utils.globalVariables; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import mc.carlton.freerpg.FreeRPG; +import mc.carlton.freerpg.config.ConfigLoad; +import mc.carlton.freerpg.customContainers.OldCustomPotion; +import mc.carlton.freerpg.customContainers.collections.OldCustomRecipe; +import mc.carlton.freerpg.utils.UtilityMethods; +import mc.carlton.freerpg.utils.game.LanguageSelector; +import org.apache.logging.log4j.Level; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.plugin.Plugin; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.potion.PotionType; + +/** + * Placeholder for global variables + */ +public class StringsAndOtherData { + + static public String version; + static ArrayList skillNames = new ArrayList<>(); + static ArrayList skillNamesWithGlobal = new ArrayList<>(); + static Map perksMap = new HashMap<>(); + static Map descriptionsMap = new HashMap<>(); + static Map passivePerksMap = new HashMap<>(); + static Map passiveDescriptionsMap = new HashMap<>(); + static Map idToStringMap = new HashMap<>(); + static Map languageProgress = new HashMap<>(); + static ArrayList languageCodes = new ArrayList<>(); + static Map bookIndexes = new HashMap<>(); + static Map dyeIndexes = new HashMap<>(); + + ArrayList levelingInfo; + + public StringsAndOtherData() { + ConfigLoad configLoad = new ConfigLoad(); + levelingInfo = configLoad.getLevelingInfo(); + } + + public void initializeData() { + initializeSkillNames(); + initializeSkillDescriptions(); + initializeVersion(); + initializeLanguagesData(); + initializeConfigGUIIndexInfo(); + initializeLanguageCompletions(); + } + + public void initializeSkillNames() { + String[] labels_0 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting", "global"}; + List labels_arr = Arrays.asList(labels_0); + skillNamesWithGlobal = new ArrayList<>(labels_arr); + String[] labels_1 = {"digging", "woodcutting", "mining", "farming", "fishing", "archery", + "beastMastery", "swordsmanship", "defense", "axeMastery", "repair", "agility", "alchemy", + "smelting", "enchanting"}; + List labels_arr1 = Arrays.asList(labels_1); + skillNames = new ArrayList<>(labels_arr1); + } + + + public void initializeLanguagesData() { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + File languagesYML = new File(plugin.getDataFolder() + "/languages.yml"); + languagesYML.setReadable(true, false); + languagesYML.setWritable(true, false); + FileConfiguration languages = YamlConfiguration.loadConfiguration(languagesYML); + for (String language : languages.getConfigurationSection("lang").getKeys(false)) { + languageCodes.add(language); + for (String id : languages.getConfigurationSection("lang." + language).getKeys(false)) { + String fullId = language + "." + id; + idToStringMap.put(fullId, languages.getString("lang." + language + "." + id)); + } + } + if (languageCodes.size() > 14) { + FreeRPG.log(Level.WARN, "[FreeRPG] WARNING: Player configuration currently only " + + "supports the first 12 language options!"); + } + ConfigLoad configLoad = new ConfigLoad(); + String newDefaultLanguageCode = UtilityMethods.convertStringToListCasing(languageCodes, + configLoad.getDefaultLanguage()); + configLoad.setDefaultLanguage(newDefaultLanguageCode); + } + + public void initializeConfigGUIIndexInfo() { + ConfigLoad configLoad = new ConfigLoad(); + if (configLoad.isForceLanguage()) { + return; + } + int totalIndexes = Math.min(languageCodes.size(), 14); + int[] possibleBookIndexes = {19, 20, 21, 22, 23, 24, 25, 37, 38, 39, 40, 41, 42, 43}; + int[] possibleDyeIndexes = {28, 29, 30, 31, 32, 33, 34, 46, 47, 48, 49, 50, 51, 52}; + for (int i = 0; i < totalIndexes; i++) { + bookIndexes.put(possibleBookIndexes[i], languageCodes.get(i)); + dyeIndexes.put(possibleDyeIndexes[i], languageCodes.get(i)); + } + } + + public void initializeLanguageCompletions() { + if (!languageCodes.contains("enUs")) { + FreeRPG.log(Level.WARN, + "[FreeRPG] Languages.yml is missing enUs! Some features may be broken"); + for (String language : languageCodes) { + languageProgress.put(language, 1.0); + } + return; + } + languageProgress.put("enUs", 1.0); + Map totalLanguageString = new HashMap<>(); + Map totalIncompleteLanguageString = new HashMap<>(); + for (String language : languageCodes) { + totalLanguageString.put(language, 0); + totalIncompleteLanguageString.put(language, 0); + } + for (String partialYamlKey : idToStringMap.keySet()) { + languagesLoop: + for (String language : languageCodes) { + if (language.equalsIgnoreCase("enUs")) { + continue; + } + if (partialYamlKey.contains(language)) { + int indexOfDot = partialYamlKey.indexOf("."); + String englishKey = "enUs" + partialYamlKey.substring(indexOfDot); + totalLanguageString.put(language, totalLanguageString.get(language) + 1); + if (idToStringMap.get(partialYamlKey).equalsIgnoreCase(idToStringMap.get(englishKey))) { + totalIncompleteLanguageString.put(language, + totalIncompleteLanguageString.get(language) + 1); + } + break languagesLoop; + } + } + } + for (String language : languageCodes) { + if (language.equalsIgnoreCase("enUs")) { + continue; + } + double totalStrings = totalLanguageString.get(language); + double totalIncomplete = totalIncompleteLanguageString.get(language); + languageProgress.put(language, (totalStrings - totalIncomplete) / totalStrings); + } + } + + public void initializeSkillDescriptions() { + String s_Name = ""; + String[] perks = {}; + String[] descriptions = {}; + String[] passivePerks = {}; + String[] passiveDescriptions = {}; + + //digging + s_Name = "digging"; + perks = new String[]{"Mo' drops", "Double Treasure", "Rarer Drops", "Soul Stealer", + "Flint Finder", "Shovel Knight", "Mega Dig"}; + descriptions = new String[]{"Expands treasure drop table by 1 item per level", + "+5% chance of receiving double treasure drop per level (when treasure is rolled)", + "Further expands drop table by item per level", + "Soul sand is +5% more likely to drop treasure per level", + "Gravel has 100% flint drop rate (toggleable by /flintToggle)", "Shovels do double damage", + "When using ability, you now break a 3x3 block section (20% of normal treasure rate when active)"}; + passivePerks = new String[]{"Passive Tokens", "Back", "Skill Tokens", "Big Dig Duration", + "Treasure Chance"}; + passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)", + "Takes you back to the main skills menu", "Tokens to invest in skill tree", + "Increases duration of Big Dig by 0.02 s", + "Increases chance of digging up treasure by 0.005%"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //woodcutting + s_Name = "woodcutting"; + perks = new String[]{"Zealous Roots", "Fresh Arms", "Hidden Knowledge", "Leaf Scavenger", + "Timber+", "Leaf Blower", "Able Axe"}; + descriptions = new String[]{"+20% chance for logs to drop 1 XP per level", + "+12 s per level of Haste I after first log broken in 5 minutes", + "Logs have a +0.2% chance per level to drop an enchanted book", + "Leaves have a 1% chance to drop +1 treasure item per level", + "Timber break limit increased from 64 to 128", + "Instantly break leaves by holding left click with an axe", + "Double drops, Zealous Roots, and Hidden Knowledge all now apply to timber (at half effectiveness)"}; + passivePerks = new String[]{"Passive Tokens", "Back", "Skill Tokens", "Timber Duration", + "Double Drops"}; + passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)", + "Takes you back to the main skills menu", "Tokens to invest in skill tree", + "Increases duration of Timber by 0.02 s", + "Increases chance to receive a double drop by 0.05%"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //mining + s_Name = "mining"; + perks = new String[]{"Wasteless Haste", "More Bombs", "Treasure Seeker", "Bomb-boyage", + "Vein Miner", "Demolition Man", "Triple Trouble"}; + descriptions = new String[]{"Gain haste after mining ores for each level", + "The crafting recipe for TNT produces +1 TNT block per level", + "When using ability on stones, +1% per level chance for an ore to drop (extra exp is earned from dropped ores)", + "Increases TNT blast radius (when lit by flint and steel) each level", + "Ore veins are instantly mined upon breaking one block (toggle-able)", + "No damage is taken from TNT explosions", "Double drops are now triple drops"}; + passivePerks = new String[]{"Passive Tokens", "Back", "Skill Tokens", "Berserk Pick Duration", + "Double Drops", "Blast Mining"}; + passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)", + "Takes you back to the main skills menu", "Tokens to invest in skill tree", + "Increases duration of Berserk Pick by 0.02s", + "Increases chance to receive a double drop from ores by 0.05%", + "Increases chances for ore to be created from TNT explosions by 0.01% (rolled 10 times per explosion)"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //farming + s_Name = "farming"; + perks = new String[]{"Better Fertilizer", "Animal Farm", "Farmer's Diet", "Carnivore", + "Green Thumb", "Growth Hormones", "One with Nature"}; + descriptions = new String[]{"+10% chance to not consume bonemeal on use", + "Can craft an additional spawn egg per level", + "Farm food is +20% more effective at restoring hunger and saturation per level", + "Meat is +20% more effective at restoring hunger and saturation per level", + "Ability may replant crops fully grown with higher chance of replanting in later growth stages; ability now effects Melons and Pumpkins", + "Sugar can be used on baby animals to make them grow instantly", + "Gain Regeneration I when standing still on grass"}; + passivePerks = new String[]{"Passive Tokens", "Back", "Skill Tokens", + "Natural Regeneration Duration", "Double Drops (Crops)", "Double Drops (Animals)"}; + passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)", + "Takes you back to the main skills menu", "Tokens to invest in skill tree", + "Increases duration of Natural Regeneration by 0.02s", + "Increases chance to receive a double drop from crops by 0.05%", + "Increases chance to receive a double drop from most passive animals by 0.05%"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //fishing + s_Name = "fishing"; + perks = new String[]{"Rob", "Scavenger", "Fisherman's Diet", "Filtration", "Grappling Hook", + "Hot Rod", "Fish Person"}; + descriptions = new String[]{"+15% chance to pull item off a mob per level", + "Unlocks new tier of fishing treasure", "Fish restore +20% hunger per level", + "Higher tier (II-V) loot becomes more common, lower tier (I) becomes less common", + "Fishing rod now acts as a grappling hook (toggleable with /grappleToggle )", + "Fish are now cooked when caught, some fishing treasures are changed (toggleable with /hotRodToggle)", + "Infinite night vision when underwater, infinite dolphin's grace when in the water"}; + passivePerks = new String[]{"Passive Tokens", "Back", "Skill Tokens", "Super Bait Duration", + "Double catches", "Treasure Finder"}; + passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)", + "Takes you back to the main skills menu", "Tokens to invest in skill tree", + "Increases duration of Super Bait by 0.01s", + "Increases chance to receive a double drop by 0.05%", + "Decreases chance of finding junk by 0.005%, increases chance of finding treasure by 0.005%"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //archery + s_Name = "archery"; + perks = new String[]{"Extra Arrows", "Sniper", "Arrow of Light", "Explosive Arrows", + "Dragon-less Arrows", "Crossbow Rapid Load", "Deadly Strike"}; + descriptions = new String[]{"+1 arrow gained from crafting per level", + "Arrow speed increases by +2% per level (~4% damage increase/level)", + "Spectral arrows get a +5% damage boost per level", + "Arrows have a +1% of creating an explosion on hit", + "Allows crafting all tipped arrows with regular potions instead of lingering potions", + "Ability can now be used with crossbows, making all shots load instantly", + "Fireworks shot from crossbows do double damage (up to 16 hearts of damage)"}; + passivePerks = new String[]{"Passive Tokens", "Back", "Skill Tokens", "Rapid Fire Duration", + "Retrieval"}; + passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)", + "Takes you back to the main skills menu", "Tokens to invest in skill tree", + "Increases duration of Rapid Fire by 0.02s", + "Increases chance for arrow shot to not consume arrow by 0.05% per level"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //beastMastery + s_Name = "beastMastery"; + perks = new String[]{"Thick Fur", "Sharp Teeth", "Healthy Bites", "Keep Away", "Acro-Dog", + "Identify", "Adrenaline Boost"}; + descriptions = new String[]{"Dogs take -10% damage per level", + "Dogs do +10% more damage per level", "Dogs heal +1/2 heart per level from killing", + "Dogs have gain +5% chance of knocking back foes", "Dogs do not take fall damage", + "Using a compass on a horse or wolf now shows their stats", + "Spur kick buff is now speed III"}; + passivePerks = new String[]{"Passive Tokens", "Back", "Skill Tokens", "Spur Kick Duration", + "Critical Bite"}; + passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)", + "Takes you back to the main skills menu", "Tokens to invest in skill tree", + "Increases duration of Spur Kick by 0.02s", + "Increases chance for a dog to have a critical hit by 0.025%"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //swordsmanship + s_Name = "swordsmanship"; + perks = new String[]{"Adrenaline", "Killing Dpree", "Adrenaline+", "Killing Frenzy", + "Thirst for Blood", "Sharper!", "Sword Mastery"}; + descriptions = new String[]{ + "Killing hostile mobs with a sword provides +2 s of speed per level", + "Killing hostile mobs with a sword provides +2 s of strength per level", + "+20% of speed I buff from Adrenaline is now speed II", + "+20% of strength I buff from Killing Spree is now strength II", + "Killing certain aggressive mobs with a sword restores hunger", + "Swift strikes now adds a level of sharpness to your sword", + "Swords permanently do +1 heart of damage"}; + passivePerks = new String[]{"Passive Tokens", "Back", "Skill Tokens", "Swift Strikes Duration", + "Double Hit"}; + passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)", + "Takes you back to the main skills menu", "Tokens to invest in skill tree", + "Increases duration of Swift Strikes by 0.02s", + "Increases chance to hit mob twice (second hit does 50% damage) by 0.02%"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //defense + s_Name = "defense"; + perks = new String[]{"Healer", "Stiffen", "Hard Headed", "Stiffen+", "Gift From Above", + "Stronger Legs", "Hearty"}; + descriptions = new String[]{"Gain +3s of regen per level on kill", + "+2% chance to gain resistance I for 5s when hit", + "Hard Body decreases damage by an additional 6.6% per level", + "+2% chance to gain resistance II for 5s when hit", + "Stone Solid now grants 4 absorption hearts for ability length +1 minute", + "Stone Solid now gives slowness I instead of slowness IV", "+2 hearts permanently"}; + passivePerks = new String[]{"Passive Tokens", "Back", "Skill Tokens", "Stone Solid Duration", + "Hard Body", "Double Drops (Hostile Mobs)"}; + passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)", + "Takes you back to the main skills menu", "Tokens to invest in skill tree", + "Increases duration of Stone Solid by 0.02s", + "Increases chance to take reduced (base -33%) damage by 0.01% per level", + "Increases chance to receive double drops from aggressive mobs by 0.05%"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //axeMastery + s_Name = "axeMastery"; + perks = new String[]{"Greater Axe", "Holy Axe", "Revitalized", "Warrior Blood", "Earthquake", + "Better Crits", "Axe Man"}; + descriptions = new String[]{"Great Axe damage radius increases by 1 block per level", + "+2% chance for lighting to strike mobs on axe hit", + "+1% chance for full heal on kill per level", + "+3 s per level of Strength I on kills with an axe", + "Ability's AOE damage is doubled (25% -> 50% of damage)", + "Divine Crits now have 1.6x multiplier instead of 1.25x", + "Axes permanently do +1 heart of damage"}; + passivePerks = new String[]{"Passive Tokens", "Back", "Skill Tokens", "Great Axe Duration", + "Divine Crits"}; + passiveDescriptions = new String[]{"Tokens to invest in passive skills (dyes)", + "Takes you back to the main skills menu", "Tokens to invest in skill tree", + "Increases duration of Great Axe by 0.02s", + "Increases random crit chance (base 1.25x damage) by 0.01%"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //Repair + s_Name = "repair"; + perks = new String[]{"Salvaging", "Resourceful", "Magic Repair Mastery"}; + descriptions = new String[]{"Get more materials on average from salvaging", + "+10% chance of keeping material used when repairing", + "Guarenteed to keep enchants on repair"}; + passivePerks = new String[]{"Back", "Skill Tokens", "Proficiency"}; + passiveDescriptions = new String[]{"Takes you back to the main skills menu", + "Tokens to invest in skill tree", "Materials restore more durability on repair"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //Agility + s_Name = "agility"; + perks = new String[]{"Dodge", "Steel Bones", "Graceful Feet"}; + descriptions = new String[]{"+4% chance to dodge attacks per level", + "-10% fall damage per level", "Permanent speed I buff (toggleable by /speedToggle)"}; + passivePerks = new String[]{"Back", "Skill Tokens", "Roll"}; + passiveDescriptions = new String[]{"Takes you back to the main skills menu", + "Tokens to invest in skill tree", "Chance to roll and take reduced fall damage"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //Alchemy + s_Name = "alchemy"; + perks = new String[]{"Alchemical Summoning", "Ancient Knowledge", "Potion Master"}; + descriptions = new String[]{"Allows crafting of some potions without a brewing stand", + "Unlocks ability to brew new potions", + "All used potions are increased in level by 1 (toggleable with /togglePotion)"}; + passivePerks = new String[]{"Back", "Skill Tokens", "Half-life+"}; + passiveDescriptions = new String[]{"Takes you back to the main skills menu", + "Tokens to invest in skill tree", "Increase in duration of potions when used"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //Smelting + s_Name = "smelting"; + perks = new String[]{"Fuel Efficiency", "Double Smelt", "Flame Pickaxe"}; + descriptions = new String[]{"Fuel last +20% longer per level", + "+5% chance for smelted ore to be doubled per level", + "Mined ores are instantly smelted (toggleable with /toggleFlamePick)"}; + passivePerks = new String[]{"Back", "Skill Tokens", "Fuel Speed"}; + passiveDescriptions = new String[]{"Takes you back to the main skills menu", + "Tokens to invest in skill tree", "Increasing cooking speed"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //Enchanting + s_Name = "enchanting"; + perks = new String[]{"Efficient Enchanting", "Booksmart", "Immortal Experience"}; + descriptions = new String[]{ + "Levels needed to enchant -1 per level, anvil repair costs -1 (minimum of 2) XP levels per level", + "Unlocks crafting recipes for some enchanted books", "Keep xp on death"}; + passivePerks = new String[]{"Back", "Skill Tokens", "Quicker Development"}; + passiveDescriptions = new String[]{"Takes you back to the main skills menu", + "Tokens to invest in skill tree", "All xp received increased"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + + //Enchanting + s_Name = "global"; + perks = new String[]{"Gatherer", "Scholar", "Fighter", "Hard Work", "Research", "Training", + "Reincarnation+", "Soul Harvesting", "Avatar", "Master of the Arts"}; + descriptions = new String[]{ + "+20% exp gained in Digging, Woodcutting, Mining, Farming, and Fishing", + "+20% exp gained in Repair, Agility, Brewing, Smelting, and Enchanting", + "+20% exp gained in Archery, Beast Mastery, Swordsmanship, Defense, and Axe Mastery", + "+1 skill token in all Gatherer skills", "+1 skill token in all Scholar skills", + "+1 skill token in all Fighter skills", + "On death, 50% chance to keep some of each valuable item in your inventory", + "You now harvest souls from killing aggressive mobs, which can be used to refund skill trees", + "10% chance to take no damage and gain all in-game buffs for 10s on a hit that would normallu kill you", + "Ability cooldowns decreased by 33%"}; + passivePerks = new String[]{"Global Tokens", "Back"}; + passiveDescriptions = new String[]{"Tokens to invest in skill tree", + "Takes you back to the main skills menu"}; + perksMap.put(s_Name, perks); + descriptionsMap.put(s_Name, descriptions); + passivePerksMap.put(s_Name, passivePerks); + passiveDescriptionsMap.put(s_Name, passiveDescriptions); + } + + public void initializeVersion() { + Plugin plugin = FreeRPG.getPlugin(FreeRPG.class); + version = plugin.getDescription().getVersion(); + } + + public String replaceIfPresent(String initialString, String searchFor, String replaceWith) { + if (initialString.contains(searchFor)) { + return initialString.replace(searchFor, replaceWith); + } else { + return initialString; + } + } + + public ArrayList getStringLines(String string) { + if (string == null) { + return new ArrayList<>(); + } + ArrayList splitDescs = new ArrayList<>(); + splitDescs.add(string); + int iter = 0; + while (splitDescs.get(splitDescs.size() - 1).length() > 30) { + int lastIndex = splitDescs.size() - 1; + boolean foundSpace = false; + int counter = 30; + while (foundSpace == false && counter > 0) { + if (splitDescs.get(lastIndex).charAt(counter) == ' ') { + splitDescs.add(splitDescs.get(lastIndex).substring(0, counter)); + splitDescs.add(splitDescs.get(lastIndex).substring(counter + 1)); + splitDescs.remove(iter); + iter += 1; + foundSpace = true; + } else if (counter == 1) { + splitDescs.add(splitDescs.get(lastIndex).substring(0, 30) + "-"); + splitDescs.add(splitDescs.get(lastIndex).substring(30 + 1)); + splitDescs.remove(iter); + iter += 1; + foundSpace = true; + } + counter = counter - 1; + } + if (iter > 20) { + break; + } + } + return splitDescs; + } + + public String camelCaseToTitle(String string) { + String newString = ""; + ArrayList splitIndexes = new ArrayList<>(); + splitIndexes.add(0); + for (int i = 0; i < string.length(); i++) { + char c = string.charAt(i); + if (Character.isUpperCase(c)) { + splitIndexes.add(i); + } + } + splitIndexes.add(string.length() - 1); + if (splitIndexes.size() == 2) { + return string.substring(0, 1).toUpperCase() + string.substring(1); + } + for (int i = 0; i < splitIndexes.size() - 1; i++) { + int begin = splitIndexes.get(i); + int end = splitIndexes.get(i + 1); + newString += + string.substring(begin, begin + 1).toUpperCase() + string.substring(begin + 1, end) + " "; + } + return newString; + } + + public String cleanUpTitleString(String string) { + String cleanString = string.toLowerCase(); + cleanString = cleanString.replaceAll("\\[", ""); + cleanString = cleanString.replaceAll("]", ""); + cleanString = cleanString.replaceAll("_", " "); + String[] cleanStringPieces = cleanString.split(" "); + cleanString = ""; + for (int i = 0; i < cleanStringPieces.length; i++) { + String piece = cleanStringPieces[i]; + String capitalizedPiece = piece.substring(0, 1).toUpperCase() + piece.substring(1); + if ((i + 1) == cleanStringPieces.length) { + cleanString += capitalizedPiece; + } else { + cleanString += capitalizedPiece + " "; + } + } + cleanString = replaceNumberInStringWithRomanNumeralUptoTen( + cleanString); //Roman Numeral Business + return cleanString; + } + + public String replaceNumberInStringWithRomanNumeralUptoTen(String string) { + string = string.replaceAll("10", "X"); + string = string.replaceAll("9", "IX"); + string = string.replaceAll("8", "VIII"); + string = string.replaceAll("7", "VII"); + string = string.replaceAll("6", "VI"); + string = string.replaceAll("5", "V"); + string = string.replaceAll("4", "IV"); + string = string.replaceAll("3", "III"); + string = string.replaceAll("2", "II"); + string = string.replaceAll("1", "I"); + return string; + } + + public String[] getEnchantingCraftingNames(Player p) { + LanguageSelector lang = new LanguageSelector(p); + String[] craftingNames = {lang.getString("enchantingCraft0"), + lang.getString("enchantingCraft1"), + lang.getString("enchantingCraft2"), lang.getString("enchantingCraft3"), + lang.getString("enchantingCraft4"), + lang.getString("enchantingCraft5"), lang.getString("enchantingCraft6"), + lang.getString("enchantingCraft7"), + lang.getString("enchantingCraft8"), lang.getString("enchantingCraft9")}; + ConfigLoad configLoad = new ConfigLoad(); + Map customRecipeMap = configLoad.getCraftingRecipes(); + Enchantment[] defaultEnchants = {Enchantment.ARROW_DAMAGE, Enchantment.DIG_SPEED, + Enchantment.DAMAGE_ALL, Enchantment.PROTECTION_ENVIRONMENTAL, Enchantment.LUCK, + Enchantment.LURE, Enchantment.FROST_WALKER, Enchantment.DEPTH_STRIDER, Enchantment.MENDING, + Enchantment.LOOT_BONUS_BLOCKS}; + for (int i = 0; i < craftingNames.length; i++) { + int stringIndex = i + 1; + OldCustomRecipe oldCustomRecipe = customRecipeMap.get("enchanting" + stringIndex); + Material output = oldCustomRecipe.getOutput(); + if (oldCustomRecipe.outputIsEnchanted()) { + Enchantment enchantment = oldCustomRecipe.getEnchantment(); + if (!enchantment.equals(defaultEnchants[i]) || !output.equals(Material.ENCHANTED_BOOK)) { + craftingNames[i] = cleanUpTitleString( + getBetterEnchantmentString(enchantment.toString()) + " " + + oldCustomRecipe.getEnchantmentLevel() + " " + output.toString()); + } + } else { + craftingNames[i] = cleanUpTitleString(output.toString()); + } + } + return craftingNames; + } + + public String getBetterEnchantmentString(String enchantmentString) { + int i = enchantmentString.indexOf(":"); + int j = enchantmentString.indexOf(","); + if (j == -1) { + j = enchantmentString.length(); + } + return enchantmentString.substring(i + 1, j); + } + + public String getEnchantmentPerkDescString(int level, Player p) { + ConfigLoad configLoad = new ConfigLoad(); + Map customRecipeMap = configLoad.getCraftingRecipes(); + String[] craftingNames = getEnchantingCraftingNames(p); + LanguageSelector lang = new LanguageSelector(p); + int index1 = 2 * (level - 1); + int index2 = 2 * (level - 1) + 1; + String name1 = craftingNames[index1]; + String name2 = craftingNames[index2]; + if (name1.equalsIgnoreCase(lang.getString("enchantingCraft" + index1)) + && name2.equalsIgnoreCase(lang.getString("enchantingCraft" + index2))) { + return lang.getString("enchantingPerkDesc1_" + level); + } else { + index1 += 1; + index2 += 1; + OldCustomRecipe oldCustomRecipe1 = customRecipeMap.get("enchanting" + index1); + OldCustomRecipe oldCustomRecipe2 = customRecipeMap.get("enchanting" + index2); + String newString = ""; + int cost1 = oldCustomRecipe1.getXPcraftCost(); + int cost2 = oldCustomRecipe2.getXPcraftCost(); + String id1 = "xpLevel"; + String id2 = "xpLevel"; + if (cost1 != 1) { + id1 += "s"; + } + if (cost2 != 1) { + id2 += "s"; + } + + newString = + name1 + " (" + lang.getString("costs") + " " + cost1 + " " + lang.getString(id1) + ")" + + " & " + name2 + " (" + lang.getString("costs") + " " + cost2 + " " + lang.getString( + id2) + ")"; + return newString; + } + } + + public String getPotionEffectTypeString(int level, Player p) { + ConfigLoad configLoad = new ConfigLoad(); + Map alchemyInfo = configLoad.getAlchemyInfo(); + String name = getPotionNameFromEffect( + alchemyInfo.get("customPotion" + level).getPotionEffectType()); + String effectType = ""; + if (!name.equalsIgnoreCase("Potion")) { + LanguageSelector lang = new LanguageSelector(p); + String id = "potion" + name.substring(10).replace(" ", ""); + effectType = lang.getString(id); + } + return effectType; + } + + public void setLanguageItems(Player p, Inventory gui) { + ConfigLoad configLoad = new ConfigLoad(); + if (configLoad.isForceLanguage()) { + return; + } + int[] indexes = {19, 20, 21, 22, 23, 24, 25, 37, 38, 39, 40, 41, 42, 43}; + int maxIndex = Math.min(indexes.length, languageCodes.size()); + for (int i = 0; i < maxIndex; i++) { + String languageCode = languageCodes.get(i); + String nativeNameKey = languageCode + "." + "languageName"; + String englishNameKey = languageCode + "." + "englishLanguageName"; + String nativeName = ""; + String englishName = ""; + if (idToStringMap.containsKey(nativeNameKey)) { + nativeName = idToStringMap.get(nativeNameKey); + } + if (idToStringMap.containsKey(englishNameKey)) { + englishName = idToStringMap.get(englishNameKey); + } + double progress = languageProgress.get(languageCode); + String progressString = + (int) Math.floor(progress * 100) + "%"; //Turn progress double into string + ChatColor color = ChatColor.GREEN; + if (0.7 <= progress && progress < 0.9) { + color = ChatColor.YELLOW; + } + if (0.5 <= progress && progress < 0.7) { + color = ChatColor.RED; + } + if (0.2 <= progress && progress < 0.5) { + color = ChatColor.DARK_RED; + } + if (progress < 0.2) { + color = ChatColor.DARK_GRAY; + } + LanguageSelector lang = new LanguageSelector(p); + String language = lang.getLanguage(); + ItemStack langItem = new ItemStack(Material.BOOK); + ItemMeta langItemMeta = langItem.getItemMeta(); + langItemMeta.setDisplayName(ChatColor.WHITE + ChatColor.BOLD.toString() + nativeName); + ArrayList langItemLore = new ArrayList<>(); + langItemLore.add(ChatColor.ITALIC + ChatColor.GRAY.toString() + "(" + englishName + ")"); + langItemLore.add( + ChatColor.ITALIC + ChatColor.GRAY.toString() + lang.getString("status") + ": " + + ChatColor.RESET + color + progressString + " " + lang.getString("complete")); + langItemMeta.setLore(langItemLore); + langItem.setItemMeta(langItemMeta); + gui.setItem(indexes[i], langItem); + + ItemStack langItemToggle = new ItemStack(Material.LIME_DYE); + ItemMeta langItemToggleMeta = langItemToggle.getItemMeta(); + if (language.equalsIgnoreCase(languageCode)) { + langItemToggleMeta.setDisplayName( + ChatColor.BOLD + ChatColor.GREEN.toString() + lang.getString("on0")); + } else { + langItemToggle.setType(Material.GRAY_DYE); + langItemToggleMeta.setDisplayName( + ChatColor.BOLD + ChatColor.RED.toString() + lang.getString("off0")); + } + langItemToggle.setItemMeta(langItemToggleMeta); + gui.setItem(indexes[i] + 9, langItemToggle); + } + } + + public String getPotionTypeString(int level, Player p) { + String effectType = ""; + LanguageSelector lang = new LanguageSelector(p); + ConfigLoad configLoad = new ConfigLoad(); + Map customRecipeMap = configLoad.getCraftingRecipes(); + OldCustomRecipe oldCustomRecipe = customRecipeMap.get("alchemy" + level); + if (oldCustomRecipe.outputIsPotion()) { + String id = getPotionNameIDFromPotionType(oldCustomRecipe.getPotionType()); + effectType = lang.getString(id); + } else { + effectType = cleanUpTitleString(oldCustomRecipe.getOutput().toString()); + } + return effectType; + } + + public String getPotionNameIDFromPotionType(PotionType potionType) { + switch (potionType) { + case AWKWARD: + return "potionAwkward"; + case UNCRAFTABLE: + return "potionUncraftable"; + case MUNDANE: + return "potionMundane"; + case TURTLE_MASTER: + return "potionTurtleMaster"; + case THICK: + return "potionThick"; + case WATER: + return "potionWater"; + default: + String tempName = getPotionNameFromEffect(potionType.getEffectType()); + String id = "potion" + tempName.substring(10).replace(" ", ""); + return id; + } + + } + + public String getPotionNameFromEffect(PotionEffectType potionEffectType) { + String name = "Potion"; + switch (potionEffectType.getName()) { + case "ABSORPTION": + name = "Potion of Absorption"; + break; + case "BAD_OMEN": + name = "Potion of Bad Omen"; + break; + case "BLINDNESS": + name = "Potion of Blindness"; + break; + case "CONDUIT_POWER": + name = "Potion of Conduit Power"; + break; + case "CONFUSION": + name = "Potion of Confusion"; + break; + case "DAMAGE_RESISTANCE": + name = "Potion of Resistance"; + break; + case "DOLPHINS_GRACE": + name = "Potion of Dolphin's Grace"; + break; + case "FAST_DIGGING": + name = "Potion of Haste"; + break; + case "FIRE_RESISTANCE": + name = "Potion of Fire Resistance"; + break; + case "GLOWING": + name = "Potion of Glowing"; + break; + case "HARM": + name = "Potion of Harm"; + break; + case "HEAL": + name = "Potion of Healing"; + break; + case "HEALTH_BOOST": + name = "Potion of Health Boost"; + break; + case "HERO_OF_THE_VILLAGE": + name = "Potion of the Hero"; + break; + case "HUNGER": + name = "Potion of Hunger"; + break; + case "INCREASE_DAMAGE": + name = "Potion of Strength"; + break; + case "INVISIBILITY": + name = "Potion of Invisibility"; + break; + case "JUMP": + name = "Potion of Jump"; + break; + case "LEVITATION": + name = "Potion of Levitation"; + break; + case "LUCK": + name = "Potion of Luck"; + break; + case "NIGHT_VISION": + name = "Potion of Night Vision"; + break; + case "POISON": + name = "Potion of Night Vision"; + break; + case "REGENERATION": + name = "Potion of Regeneration"; + break; + case "SATURATION": + name = "Potion of Saturation"; + break; + case "SLOW": + name = "Potion of Slowness"; + break; + case "SLOW_DIGGING": + name = "Potion of Fatigue"; + break; + case "SLOW_FALLING": + name = "Potion of Slow Falling"; + break; + case "SPEED": + name = "Potion of Speed"; + break; + case "UNLUCK": + name = "Potion of Bad Luck"; + break; + case "WATER_BREATHING": + name = "Potion of Water Breathing"; + break; + case "WEAKNESS": + name = "Potion of Weakness"; + break; + case "WITHER": + name = "Potion of Decay"; + break; + default: + break; + + } + return name; + } + + public Map getDescriptionsMap() { + return descriptionsMap; + } + + public Map getPassiveDescriptionsMap() { + return passiveDescriptionsMap; + } + + public Map getPassivePerksMap() { + return passivePerksMap; + } + + public Map getPerksMap() { + return perksMap; + } + + public String getVersion() { + return version; + } + + public Map getIdToStringMap() { + return idToStringMap; + } + + public Map getBookIndexes() { + return bookIndexes; + } + + public Map getDyeIndexes() { + return dyeIndexes; + } + + public ArrayList getSkillNames() { + return skillNames; + } + + public ArrayList getSkillNamesWithGlobal() { + return skillNamesWithGlobal; + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/gui/GuiDisplayStatistic.java b/src/main/java/mc/carlton/freerpg/utils/gui/GuiDisplayStatistic.java new file mode 100644 index 0000000..a46388e --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/gui/GuiDisplayStatistic.java @@ -0,0 +1,68 @@ +package mc.carlton.freerpg.utils.gui; + +public class GuiDisplayStatistic { + + private String statisticName; + private Object statistic; + private String statisticNameColor; + private String statisticColor; + + /** + * Constructor + * + * @param statisticName name of the statistic + * @param statistic value of the statistic + * @param statisticNameColor color of the statistic name (ex. ChatColor.BOLD + + * ChatColor.WHITE.toString()) + * @param statisticColor color of the statistic (ex. ChatColor.ITALIC + ChatColor.GRAY.toString()) + */ + public GuiDisplayStatistic(String statisticName, Object statistic, String statisticNameColor, + String statisticColor) { + this.statisticName = statisticName; + this.statistic = statistic; + this.statisticNameColor = statisticNameColor; + this.statisticColor = statisticColor; + } + + /** + * Constructor + * + * @param statisticName name of the statistic + * @param statistic value of the statistic + */ + public GuiDisplayStatistic(String statisticName, Object statistic) { + this(statisticName, statistic, null, null); + } + + public String getStatisticNameColor() { + return statisticNameColor; + } + + public void setStatisticNameColor(String statisticNameColor) { + this.statisticNameColor = statisticNameColor; + } + + public String getStatisticColor() { + return statisticColor; + } + + public void setStatisticColor(String statisticColor) { + this.statisticColor = statisticColor; + } + + public Object getStatistic() { + return statistic; + } + + public void setStatistic(Object statistic) { + this.statistic = statistic; + } + + public String getStatisticName() { + return statisticName; + } + + public void setStatisticName(String statisticName) { + this.statisticName = statisticName; + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/gui/GuiIconColors.java b/src/main/java/mc/carlton/freerpg/utils/gui/GuiIconColors.java new file mode 100644 index 0000000..6cea9c1 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/gui/GuiIconColors.java @@ -0,0 +1,85 @@ +package mc.carlton.freerpg.utils.gui; + +import org.bukkit.ChatColor; + +public class GuiIconColors { + + private String nameColor; + private String descriptionColor; + private String statisticNamesColor; + private String statisticsColor; + + /** + * Constructor for ThemeColors + * + * @param nameColor color of gui icon names + * @param descriptionColor color of gui icon descriptions + * @param statisticNameColor color of statistic names on the gui icon + * @param statisticColor color of statistics on the gui icon + */ + public GuiIconColors(String nameColor, String descriptionColor, String statisticNameColor, + String statisticColor) { + this.nameColor = nameColor; + this.descriptionColor = descriptionColor; + this.statisticNamesColor = statisticNameColor; + this.statisticsColor = statisticColor; + } + + /** + * Default constructor for ThemeColors Sets: nameColor <- Bold and white descriptionColor <- Gray + * and italic statisticNameColor <- Gray StatisticColor <- Gold + */ + public GuiIconColors() { + this(ChatColor.WHITE.toString() + ChatColor.BOLD.toString(), + ChatColor.GRAY.toString() + ChatColor.ITALIC.toString(), ChatColor.GRAY.toString(), + ChatColor.GOLD.toString()); + } + + public String getDescriptionColor() { + return descriptionColor; + } + + public void setDescriptionColor(String descriptionColor) { + this.descriptionColor = descriptionColor; + } + + public void setDescriptionColor(ChatColor descriptionColor) { + this.descriptionColor = descriptionColor.toString(); + } + + public String getNameColor() { + return nameColor; + } + + public void setNameColor(String nameColor) { + this.nameColor = nameColor; + } + + public void setNameColor(ChatColor nameColor) { + this.nameColor = nameColor.toString(); + } + + public String getStatisticsColor() { + return statisticsColor; + } + + public void setStatisticsColor(String statisticsColor) { + this.statisticsColor = statisticsColor; + } + + public String getStatisticNamesColor() { + return statisticNamesColor; + } + + public void setStatisticNamesColor(String statisticNamesColor) { + this.statisticNamesColor = statisticNamesColor; + } + + public void setStatisticColor(ChatColor statisticColor) { + this.statisticsColor = statisticColor.toString(); + } + + public void setStatisticNameColor(ChatColor statisticNameColor) { + this.statisticNamesColor = statisticNameColor.toString(); + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/gui/GuiItem.java b/src/main/java/mc/carlton/freerpg/utils/gui/GuiItem.java new file mode 100644 index 0000000..47e3564 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/gui/GuiItem.java @@ -0,0 +1,453 @@ +package mc.carlton.freerpg.utils.gui; + +import java.util.ArrayList; +import mc.carlton.freerpg.utils.globalVariables.StringsAndOtherData; +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemFlag; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +/** + * This class acts as a wrapper class for an ItemStack to be used in a gui. Appends additionally + * information about the item And uses tools to make text output neater and easier to implement. The + * GuiItem object is mutable + */ +public class GuiItem { + + private int index; + private ItemStack item; + private Inventory gui; + private String name; + private String description; + private GuiIconColors textColors; + private ArrayList statistics; + private ArrayList specialLoreLines; + private boolean themeExemption; + + /** + * Constructor for GuiItem + * + * @param item ItemStack to be placed in the GUI + * @param index index at which the ItemStack will be placed in the GUI + * @param gui Inventory that acts as the GUI + */ + public GuiItem(ItemStack item, int index, Inventory gui) { + this(item, index, gui, new GuiIconColors()); + } + + /** + * Constructor for GuiItem + * + * @param itemType Material of ItemStack to be placed in GUI + * @param index index at which the ItemStack will be placed in the GUI + * @param gui Inventory that acts as the GUI + */ + public GuiItem(Material itemType, int index, Inventory gui) { + this(new ItemStack(itemType), index, gui); + } + + /** + * Constructor for GuiItem + * + * @param itemType Material of ItemStack to be placed in GUI + * @param index index at which the ItemStack will be placed in the GUI + * @param gui GuiWrapper that acts as the GUI + */ + public GuiItem(Material itemType, int index, GuiWrapper gui) { + this(new ItemStack(itemType), index, gui.getGui()); + } + + /** + * Constructor for GuiItem + * + * @param item ItemStack to be placed in the GUI + * @param index index at which the itemstack will be placed in the GUI + * @param gui GuiWrapper that acts as the GUI + */ + public GuiItem(ItemStack item, int index, GuiWrapper gui) { + this(item, index, gui.getGui()); + } + + + /** + * Constructor for GuiItem + * + * @param item ItemStack to be placed in the GUI + * @param index index at which the itemstack will be placed in the GUI + * @param textColors ThemeColor object to determine display colors + * @param gui GuiWrapper that acts as the GUI + */ + public GuiItem(ItemStack item, int index, GuiWrapper gui, GuiIconColors textColors) { + this(item, index, gui.getGui(), textColors); + } + + /** + * Constructor for GuiItem + * + * @param item ItemStack to be placed in the GUI + * @param index index at which the itemstack will be placed in the GUI + * @param textColors ThemeColor object to determine display colors + * @param gui Inventory that acts as the GUI + */ + public GuiItem(ItemStack item, int index, Inventory gui, GuiIconColors textColors) { + this.item = item; + hideItemInformation(); //Hides things like enchantments, potion info, and attributes + this.gui = gui; + this.textColors = textColors; + this.statistics = new ArrayList<>(); + this.specialLoreLines = new ArrayList<>(); + if (!isIndexInsideGUI(index)) { + throw (new IllegalArgumentException("Index outside of Inventory size")); + } + this.index = index; + } + + /** + * Setter for item description color, also changes the item's description to match new color + * + * @param ColorString string of chat colors (ex. ChatColor.BOLD + ChatColor.WHITE.toString() ) + */ + public void setDescriptionColor(String ColorString) { + textColors.setDescriptionColor(ColorString); + setDescription(this.description); + } + + /** + * Setter for item description color, also changes the item's description to match new color + * + * @param color a chat color (ex. ChatColor.WHITE) + */ + public void setDescriptionColor(ChatColor color) { + textColors.setDescriptionColor(color); + setDescription(this.description); + } + + /** + * Setter for item name color, also changes the item's name to match new color + * + * @param ColorString string of chat colors (ex. ChatColor.BOLD + ChatColor.WHITE.toString() ) + */ + public void setNameColor(String ColorString) { + textColors.setNameColor(ColorString); + setName(this.name); + } + + /** + * Setter for item name color, also changes the item's name to match new color + * + * @param color a chat color (ex. ChatColor.WHITE) + */ + public void setNameColor(ChatColor color) { + textColors.setNameColor(color); + setName(this.name); + } + + /** + * Setter for Statistic name color, changes item's lore to account for color changs + * + * @param ColorString + */ + public void setStatisticNameColor(String ColorString) { + textColors.setStatisticNamesColor(ColorString); + setStatistics(this.statistics); + } + + /** + * Setter for Statistic name color, changes item's lore to account for color changs + * + * @param color + */ + public void setStatisticNameColor(ChatColor color) { + textColors.setStatisticNameColor(color); + setStatistics(this.statistics); + } + + /** + * Setter for Statistic color, changes item's lore to account for color changs + * + * @param ColorString + */ + public void setStatisticColor(String ColorString) { + textColors.setStatisticsColor(ColorString); + setStatistics(this.statistics); + } + + /** + * Setter for Statistic color, changes item's lore to account for color changs + * + * @param color + */ + public void setStatisticColor(ChatColor color) { + textColors.setStatisticColor(color); + setStatistics(this.statistics); + } + + /** + * Sets the name of the item + * + * @param name String acting as name + */ + public void setName(String name) { + if (name == null || name.isEmpty()) { + return; //Do nothing for empty name + } + this.name = name; + ItemMeta itemMeta = item.getItemMeta(); + itemMeta.setDisplayName(textColors.getNameColor() + name); + item.setItemMeta(itemMeta); + } + + /** + * Sets the description (description) of the item and updates the item lore + * + * @param description String acting as description, will be automatically divided into multiple + * lines if too long. + */ + public void setDescription(String description) { + if (description == null || description.isEmpty()) { + return; //Do nothing for empty description + } + this.description = description; + setLore(); + } + + /** + * Adds a statistic to the item's lore and updates the lore + * + * @param guiDisplayStatistic + */ + public void addStatistic(GuiDisplayStatistic guiDisplayStatistic) { + this.statistics.add(guiDisplayStatistic); + setLore(); + } + + /** + * Adds a statistic to the item's lore and updates the lore + * + * @param statisticName display name of the statistic + * @param statistic value of the statistic to add, can be any object with a toString method. + */ + public void addStatistic(String statisticName, Object statistic) { + this.statistics.add(new GuiDisplayStatistic(statisticName, statistic)); + setLore(); + } + + /** + * Setter for statistics, adds statistics to item's lore + * + * @param statistics + */ + public void setStatistics(ArrayList statistics) { + this.statistics = statistics; + setLore(); + } + + /** + * Adds a special lore line between statistics and the description, updates the lore + * + * @param loreLine + */ + public void addSpecialLoreLine(String loreLine) { + this.specialLoreLines.add(loreLine); + setLore(); + } + + /** + * Adds special lore lines between statistics and the description, updates the lore + * + * @param specialLoreLines + */ + public void setSpecialLoreLines(ArrayList specialLoreLines) { + this.specialLoreLines = specialLoreLines; + setLore(); + } + + /** + * Changes the Material type of the instance variable item + * + * @param itemType Material that item will be changed to + */ + public void setItemType(Material itemType) { + item.setType(itemType); + } + + /** + * Changes the item amount of the instance variable item + * + * @param amount amount of item to be displayed + */ + public void setItemAmount(int amount) { + item.setAmount(amount); + } + + /** + * Getter for theme exemption + * + * @return true if this item is exempt from the GuiWrapper color theme, false otherwise + */ + public boolean isThemeExemption() { + return themeExemption; + } + + /** + * Setter for themeExemption + * + * @param themeExemption set to true to exempt the item from the color theme of GuiWrapper, false + * otherwise + */ + public void setThemeExemption(boolean themeExemption) { + this.themeExemption = themeExemption; + } + + /** + * Getter for item + * + * @return the instance variable item + */ + public ItemStack getItem() { + return item; + } + + /** + * Setter for item + * + * @param item ItemStack to be placed in the gui + */ + public void setItem(ItemStack item) { + this.item = item; + } + + /** + * Getter for index + * + * @return the instance variable index + */ + public int getIndex() { + return index; + } + + /** + * Setter for index + * + * @param index index at which item is placed + */ + public void setIndex(int index) { + if (!isIndexInsideGUI(index)) { + throw (new IllegalArgumentException("Index outside of Inventory size")); + } + this.index = index; + } + + /** + * Getter for gui + * + * @return the instance variable gui + */ + public Inventory getGui() { + return gui; + } + + /** + * Setter for GUI + * + * @param gui Inventory that will act as the gui + */ + public void setGui(Inventory gui) { + this.gui = gui; + } + + /** + * Adds enchantment glow to the item + */ + public void addEnchantmentGlow() { + item.addUnsafeEnchantment(Enchantment.LOYALTY, 1); + } + + /** + * Removes an item flag from the GuiItem + * + * @param itemFlag item flag to remove (ex. ItemFlag.HIDE_ENCHANTS) + */ + public void showItemFlag(ItemFlag itemFlag) { + ItemMeta itemMeta = item.getItemMeta(); + if (itemMeta.hasItemFlag(itemFlag)) { + itemMeta.removeItemFlags(itemFlag); + } + } + + private boolean isIndexInsideGUI(int index) { + if (index < gui.getSize()) { + return true; + } else { + return false; + } + } + + /** + * Hides the information about the items in the GUI + */ + private void hideItemInformation() { + ItemMeta itemMeta = item.getItemMeta(); + itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); + itemMeta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); + itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); + item.setItemMeta(itemMeta); + } + + private void setLore() { + ItemMeta itemMeta = item.getItemMeta(); + ArrayList loreLines = new ArrayList<>(); + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + ArrayList splitDescriptionLines = stringsAndOtherData.getStringLines(description); + for (GuiDisplayStatistic guiDisplayStatistic : statistics) { + loreLines.add(getLoreLineStringFromStatistic(guiDisplayStatistic, false)); + } + for (String specialLoreLine : specialLoreLines) { + loreLines.add(specialLoreLine); + } + for (String descriptionLine : splitDescriptionLines) { + loreLines.add(textColors.getDescriptionColor() + descriptionLine); + } + itemMeta.setLore(loreLines); + item.setItemMeta(itemMeta); + } + + public void refreshLore(boolean forceTheme) { + ItemMeta itemMeta = item.getItemMeta(); + ArrayList loreLines = new ArrayList<>(); + StringsAndOtherData stringsAndOtherData = new StringsAndOtherData(); + ArrayList splitDescriptionLines = stringsAndOtherData.getStringLines(description); + for (GuiDisplayStatistic guiDisplayStatistic : statistics) { + loreLines.add(getLoreLineStringFromStatistic(guiDisplayStatistic, forceTheme)); + } + for (String specialLoreLine : specialLoreLines) { + loreLines.add(specialLoreLine); + } + for (String descriptionLine : splitDescriptionLines) { + loreLines.add(textColors.getDescriptionColor() + descriptionLine); + } + itemMeta.setLore(loreLines); + item.setItemMeta(itemMeta); + } + + private String getLoreLineStringFromStatistic(GuiDisplayStatistic guiDisplayStatistic, + boolean forceTheme) { + String statisticName = guiDisplayStatistic.getStatisticName(); + String statistic = guiDisplayStatistic.getStatistic().toString(); + String loreLine = ""; + if (guiDisplayStatistic.getStatisticNameColor() == null || forceTheme) { + loreLine += textColors.getStatisticNamesColor() + statisticName + ": "; + } else { + loreLine += guiDisplayStatistic.getStatisticNameColor() + statisticName + ": "; + } + if (guiDisplayStatistic.getStatisticColor() == null || forceTheme) { + loreLine += ChatColor.RESET + textColors.getStatisticsColor() + statistic; + } else { + loreLine += ChatColor.RESET + guiDisplayStatistic.getStatisticColor() + statistic; + } + return loreLine; + } +} diff --git a/src/main/java/mc/carlton/freerpg/utils/gui/GuiWrapper.java b/src/main/java/mc/carlton/freerpg/utils/gui/GuiWrapper.java new file mode 100644 index 0000000..e84ac73 --- /dev/null +++ b/src/main/java/mc/carlton/freerpg/utils/gui/GuiWrapper.java @@ -0,0 +1,141 @@ +package mc.carlton.freerpg.utils.gui; + +import java.util.HashMap; +import java.util.Map; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.inventory.Inventory; + +/** + * This class acts as a Wrapper for an inventory acting as a gui It adds additional methods to the + * inventory and reduces lines of code when implementing a GUI The GuiWrapper object is mutable + */ +public class GuiWrapper { + + private Map items = new HashMap<>(); + private Player p; + private Inventory gui; + private GuiIconColors theme; + + /** + * Constructor for gui + * + * @param p Player who will see the gui + * @param gui The inventory acting as the gui + */ + public GuiWrapper(Player p, Inventory gui) { + this.gui = gui; + this.p = p; + } + + /** + * Constrcutor for gui + * + * @param p Player who will see the GUI + * @param guiName GUI display name + * @param guiSize number of item slots in GUI + */ + public GuiWrapper(Player p, String guiName, int guiSize) { + this(p, Bukkit.createInventory(p, guiSize, guiName)); + } + + /** + * Adds item to the GUI, + * + * @param guiItem a GuiItem to add + */ + public void addItem(GuiItem guiItem) { + items.put(guiItem.getIndex(), guiItem); + setGuiItem(guiItem.getIndex(), guiItem); + } + + /** + * Adds items to the GUI, + * + * @param guiItems a GuiItem[] array to add + */ + public void addItems(GuiItem[] guiItems) { + for (GuiItem guiItem : guiItems) { + addItem(guiItem); + } + } + + + /** + * Getter for gui + * + * @return Inventory acting as the gui + */ + public Inventory getGui() { + return gui; + } + + /** + * Returns a pointer to the GuiItem at a given index + * + * @param index positional index of where the gui item is + * @return a pointer to the guiItem + */ + public GuiItem getItem(int index) { + if (items.containsKey(index)) { + return items.get(index); + } else { + return null; + } + } + + /** + * Sets all itemStachs in items to be displayed in the gui + */ + public void setGui() { + for (Integer index : items.keySet()) { + setGuiItem(index, items.get(index)); + } + } + + /** + * Sets a GuiItem to be displayed in the gui at a given positional index + * + * @param index positional index of where the guiItem will be + * @param guiItem a GuiItem + */ + public void setGuiItem(int index, GuiItem guiItem) { + setGuiItemColorsToTheme(guiItem); + gui.setItem(index, guiItem.getItem()); + } + + /** + * Setter for theme + * + * @param theme a String of ChatColors ex (ChatColor.BOLD + ChatColor.WHITE.toString()) + */ + public void setTheme(GuiIconColors theme) { + this.theme = theme; + } + + /** + * Opens the GUI for the player + */ + public void displayGuiForPlayer() { + p.openInventory(gui); + } + + private void setGuiItemColorsToTheme(GuiItem guiItem) { + if (theme == null || guiItem.isThemeExemption()) { + return; + } + if (theme.getNameColor() != null) { + guiItem.setNameColor(theme.getNameColor()); + } + if (theme.getDescriptionColor() != null) { + guiItem.setDescriptionColor(theme.getDescriptionColor()); + } + if (theme.getStatisticNamesColor() != null) { + guiItem.setStatisticNameColor(theme.getStatisticNamesColor()); + } + if (theme.getStatisticsColor() != null) { + guiItem.setStatisticColor(theme.getStatisticsColor()); + } + guiItem.refreshLore(true); + } +} diff --git a/src/main/resources/advancedConfig.yml b/src/main/resources/advancedConfig.yml index 25891b9..1b373cb 100644 --- a/src/main/resources/advancedConfig.yml +++ b/src/main/resources/advancedConfig.yml @@ -149,6 +149,8 @@ digging: breakSnowBlock: 22 breakSnow: 4 breakConcretePowder: 20 + # added since 1.16.5 + breakRooted_Dirt: 100 woodcutting: timberEXPMultiplier: 0.4 #EXP nerf when using the Timber skill timberMaxBreakInitial: 64 #Max number of logs that can be broken with the without Timber+ @@ -203,9 +205,14 @@ woodcutting: breakWarped_Stem: 125 breakCrimson_Planks: 28 breakWarped_Planks: 28 + # added since 1.16.5 + breakFlowering_Azalea_Leaves: 13 mining: # All Blocks affected by the Vein Miner perk. Putting something like "DIRT" will break your server if maximum blocks broken is very high or -1. - veinMinerBlocks: [REDSTONE_ORE,NETHER_QUARTZ_ORE,LAPIS_ORE,IRON_ORE,GOLD_ORE,EMERALD_ORE,DIAMOND_ORE,COAL_ORE,GLOWSTONE,NETHER_GOLD_ORE,ANCIENT_DEBRIS,GILDED_BLACKSTONE] + veinMinerBlocks: [ REDSTONE_ORE,NETHER_QUARTZ_ORE,LAPIS_ORE,IRON_ORE,GOLD_ORE,EMERALD_ORE,DIAMOND_ORE,COAL_ORE, + GLOWSTONE,NETHER_GOLD_ORE,ANCIENT_DEBRIS,GILDED_BLACKSTONE,COPPER_ORE,DEEPSLATE_COAL_ORE,DEEPSLATE_COPPER_ORE, + DEEPSLATE_DIAMOND_ORE,DEEPSLATE_EMERALD_ORE,DEEPSLATE_GOLD_ORE,DEEPSLATE_IRON_ORE, + DEEPSLATE_LAPIS_ORE,DEEPSLATE_REDSTONE_ORE ] veinMinerMaximumBlocksBroken: 30 #Set to -1 for no limit (not recommended) veinMinerDurabilityModifier: 1.0 #Average durability points of damaged removed per block broken (without unbreaking) expDrops: @@ -243,6 +250,25 @@ mining: breakCrimson_Nylium: 15 breakWarped_Nylium: 15 breakGilded_Blackstone: 500 + # added since 1.16.5 + breakAmethyst_Cluster: 850 + breakAmethyst_Block: 250 + breakRaw_Copper_Block: 4500 + breakRaw_Iron_Block: 4500 + breakCalcite: 25 + breakDeepslate: 30 + breakCopper_Ore: 350 + breakDeepslate_Coal_Ore: 400 + breakDeepslate_Copper_Ore: 700 + breakDeepslate_Diamond_Ore: 2000 + breakDeepslate_Emerald_Ore: 2500 + breakDeepslate_Gold_Ore: 1000 + breakDeepslate_Iron_Ore: 700 + breakDeepslate_Lapis_Ore: 1400 + breakDeepslate_Redstone_Ore: 1000 + breakDripstone_Block: 45 + breakPointed_Dripstone: 95 + breakTuff: 30 farming: expDrops: enableEXPDrops: true @@ -278,6 +304,16 @@ farming: breakSea_Pickle: 100 breakNether_Wart: 58 breakChorusPlant: 60 + # added since 1.16.5 + breakAzalea: 75 + breakFlowering_Aealea: 75 + breakCave_Vines: 85 + breakSmall_Dripleaf: 70 + breakGlow_Lichen: 70 + breakHanging_Roots: 250 + breakMoos_block: 15 + breakSpore_Blossom: 200 + breakBig_Dripleaf: 70 crafting: #Animal Farm Perks # recipes are a list of ingredients formatted as such: # - (1) top left @@ -292,19 +328,19 @@ farming: # Use "AIR" to represent blank entries recipeOutput1: COW_SPAWN_EGG recipeOutputAmount1: 1 - recipe1: [LEATHER,BEEF,LEATHER,BEEF,BONE,BEEF,LEATHER,BEEF,LEATHER] + recipe1: [ LEATHER,BEEF,LEATHER,BEEF,BONE,BEEF,LEATHER,BEEF,LEATHER ] recipeOutput2: BEE_SPAWN_EGG recipeOutputAmount2: 1 - recipe2: [AIR,OXEYE_DAISY,AIR,DANDELION,HONEY_BOTTLE,POPPY,AIR,AZURE_BLUET,AIR] + recipe2: [ AIR,OXEYE_DAISY,AIR,DANDELION,HONEY_BOTTLE,POPPY,AIR,AZURE_BLUET,AIR ] recipeOutput3: MOOSHROOM_SPAWN_EGG recipeOutputAmount3: 1 - recipe3: [LEATHER,RED_MUSHROOM,LEATHER,BEEF,BONE,BEEF,LEATHER,BEEF,LEATHER] + recipe3: [ LEATHER,RED_MUSHROOM,LEATHER,BEEF,BONE,BEEF,LEATHER,BEEF,LEATHER ] recipeOutput4: HORSE_SPAWN_EGG recipeOutputAmount4: 1 - recipe4: [LEATHER,SADDLE,LEATHER,LEATHER,BONE,LEATHER,HAY_BLOCK,HAY_BLOCK,HAY_BLOCK] + recipe4: [ LEATHER,SADDLE,LEATHER,LEATHER,BONE,LEATHER,HAY_BLOCK,HAY_BLOCK,HAY_BLOCK ] recipeOutput5: SLIME_SPAWN_EGG recipeOutputAmount5: 1 - recipe5: [AIR,AIR,AIR,AIR,SLIME_BALL,SLIME_BALL,AIR,SLIME_BALL,SLIME_BALL] + recipe5: [ AIR,AIR,AIR,AIR,SLIME_BALL,SLIME_BALL,AIR,SLIME_BALL,SLIME_BALL ] fishing: superBaitEXPMultiplier: 1.0 #EXP nerf when using the Super Bait skill robCooldown: 10 #Time in seconds a player must wait between using rob twice @@ -509,6 +545,9 @@ archery: killIllusioner: 125 killGiant: 125 killAnythingElse: 30 #If you are using 1.15 this is the value used for zombie pigmen + # added since 1.16.5 + killAxolotl: 50 + killGoat: 40 beastMastery: spawnerMobsEXPMultiplier: 1.0 #Nerfs EXP recieved from mobs that spawned from a spawner #mobFarmEXPMutliplier is circumventable as it relies on mob density. It does stack with spawnerMobsEXPMultiplier @@ -593,6 +632,9 @@ beastMastery: killIllusioner: 750 killGiant: 750 killAnythingElse: 300 #If you are using 1.15 this is the value used for zombie pigmen + # added since 1.16.5 + killAxolotl: 50 + killGoat: 40 swordsmanship: spawnerMobsEXPMultiplier: 1.0 #Nerfs EXP recieved from mobs that spawned from a spawner #mobFarmEXPMutliplier is circumventable as it relies on mob density. It does stack with spawnerMobsEXPMultiplier @@ -673,6 +715,9 @@ swordsmanship: killIllusioner: 125 killGiant: 125 killAnythingElse: 30 #If you are using 1.15 this is the value used for zombie pigmen + # added since 1.16.5 + killAxolotl: 50 + killGoat: 40 defense: spawnerMobsEXPMultiplier: 1.0 #Nerfs EXP recieved from mobs that spawned from a spawner #mobFarmEXPMutliplier is circumventable as it relies on mob density. In other words, it's not surefire but should not hurt normal EXP gain @@ -756,6 +801,9 @@ defense: killIllusioner: 125 killGiant: 125 killAnythingElse: 30 #If you are using 1.15 this is the value used for zombie pigmen + # added since 1.16.5 + killAxolotl: 50 + killGoat: 40 axeMastery: spawnerMobsEXPMultiplier: 1.0 #Nerfs EXP recieved from mobs that spawned from a spawner #mobFarmEXPMutliplier is circumventable as it relies on mob density. It does stack with spawnerMobsEXPMultiplier @@ -836,6 +884,9 @@ axeMastery: killIllusioner: 125 killGiant: 125 killAnythingElse: 30 #If you are using 1.15 this is the value used for zombie pigmen + # added since 1.16.5 + killAxolotl: 50 + killGoat: 40 repair: preventRepairOfItemsWithUnsafeEnchantments: true #Prevents items with non-vanilla enchants from being repaired when true preventSalvageOfItemsWithUnsafeEnchantments: true #Prevents items with non-vanilla enchants from being salvaged when true @@ -951,31 +1002,31 @@ alchemy: recipePotionType1: WATER_BREATHING recipePotionExtended1: false recipePotionUpgraded1: false - recipe1: [AIR,PUFFERFISH,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR] + recipe1: [ AIR,PUFFERFISH,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR ] recipeOutput2: POTION recipeOutputAmount2: 1 recipePotionType2: SPEED recipePotionExtended2: false recipePotionUpgraded2: false - recipe2: [AIR,SUGAR,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR] + recipe2: [ AIR,SUGAR,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR ] recipeOutput3: POTION recipeOutputAmount3: 1 recipePotionType3: FIRE_RESISTANCE recipePotionExtended3: false recipePotionUpgraded3: false - recipe3: [AIR,MAGMA_CREAM,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR] + recipe3: [ AIR,MAGMA_CREAM,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR ] recipeOutput4: POTION recipeOutputAmount4: 1 recipePotionType4: INSTANT_HEAL recipePotionExtended4: false recipePotionUpgraded4: false - recipe4: [AIR,GLISTERING_MELON_SLICE,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR] + recipe4: [ AIR,GLISTERING_MELON_SLICE,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR ] recipeOutput5: POTION recipeOutputAmount5: 1 recipePotionType5: STRENGTH recipePotionExtended5: false recipePotionUpgraded5: false - recipe5: [AIR,BLAZE_POWDER,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR] + recipe5: [ AIR,BLAZE_POWDER,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR ] expDrops: enableEXPDrops: true breakNetherWart: 100 @@ -1082,59 +1133,59 @@ enchanting: recipeEnchant1: power recipeEnchantLevel1: 1 XPcostToCraft1: 1 - recipe1: [AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,BOW] + recipe1: [ AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,BOW ] recipeOutput2: ENCHANTED_BOOK recipeOutputAmount2: 1 recipeEnchant2: efficiency recipeEnchantLevel2: 1 XPcostToCraft2: 1 - recipe2: [AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,IRON_PICKAXE] + recipe2: [ AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,IRON_PICKAXE ] recipeOutput3: ENCHANTED_BOOK recipeOutputAmount3: 1 recipeEnchant3: sharpness recipeEnchantLevel3: 1 XPcostToCraft3: 1 - recipe3: [IRON_INGOT,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,IRON_SWORD] + recipe3: [ IRON_INGOT,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,IRON_SWORD ] recipeOutput4: ENCHANTED_BOOK recipeOutputAmount4: 1 recipeEnchant4: protection recipeEnchantLevel4: 1 XPcostToCraft4: 1 - recipe4: [AIR,IRON_INGOT,AIR,IRON_INGOT,PAPER,PAPER,AIR,PAPER,IRON_INGOT] + recipe4: [ AIR,IRON_INGOT,AIR,IRON_INGOT,PAPER,PAPER,AIR,PAPER,IRON_INGOT ] recipeOutput5: ENCHANTED_BOOK recipeOutputAmount5: 1 recipeEnchant5: luck_of_the_sea recipeEnchantLevel5: 1 XPcostToCraft5: 1 - recipe5: [RABBIT_FOOT,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,FISHING_ROD] + recipe5: [ RABBIT_FOOT,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,FISHING_ROD ] recipeOutput6: ENCHANTED_BOOK recipeOutputAmount6: 1 recipeEnchant6: lure recipeEnchantLevel6: 1 XPcostToCraft6: 1 - recipe6: [COD_BUCKET,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,FISHING_ROD] + recipe6: [ COD_BUCKET,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,FISHING_ROD ] recipeOutput7: ENCHANTED_BOOK recipeOutputAmount7: 1 recipeEnchant7: frost_walker recipeEnchantLevel7: 1 XPcostToCraft7: 2 - recipe7: [ICE,PACKED_ICE,PACKED_ICE,PACKED_ICE,PAPER,PAPER,PACKED_ICE,PAPER,BLUE_ICE] + recipe7: [ ICE,PACKED_ICE,PACKED_ICE,PACKED_ICE,PAPER,PAPER,PACKED_ICE,PAPER,BLUE_ICE ] recipeOutput8: ENCHANTED_BOOK recipeOutputAmount8: 1 recipeEnchant8: depth_strider recipeEnchantLevel8: 1 XPcostToCraft8: 2 - recipe8: [AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,NAUTILUS_SHELL] + recipe8: [ AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,NAUTILUS_SHELL ] recipeOutput9: ENCHANTED_BOOK recipeOutputAmount9: 1 recipeEnchant9: mending recipeEnchantLevel9: 1 XPcostToCraft9: 10 - recipe9: [AIR,DIAMOND_BLOCK,AIR,DIAMOND_BLOCK,PAPER,PAPER,AIR,PAPER,DIAMOND_BLOCK] + recipe9: [ AIR,DIAMOND_BLOCK,AIR,DIAMOND_BLOCK,PAPER,PAPER,AIR,PAPER,DIAMOND_BLOCK ] recipeOutput10: ENCHANTED_BOOK recipeOutputAmount10: 1 recipeEnchant10: fortune recipeEnchantLevel10: 1 XPcostToCraft10: 2 - recipe10: [AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,GOLD_BLOCK] + recipe10: [ AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,GOLD_BLOCK ] diff --git a/src/main/resources/config2.yml b/src/main/resources/config2.yml index 62c3b77..c9339dd 100644 --- a/src/main/resources/config2.yml +++ b/src/main/resources/config2.yml @@ -105,30 +105,30 @@ fishing: # Fill the drop table with custom items # Please refer to the custom item information in the comments of perkConfig.yml dropTable: - - [drop: LILY_PAD, amount: 1, exp: 1000, weight: 17] - - [drop: BOWL, amount: 1, exp: 1000, weight: 10] - - [drop: FISHING_ROD, amount: 1, exp: 1000, weight: 2, durability: [lower: 0.10, upper: 1.00]] - - [drop: LEATHER, amount: 1, exp: 1000, weight: 10] - - [drop: LEATHER_BOOTS, amount: 1, exp: 1000, weight: 10, durability: [lower: 0.10, upper: 1.00]] - - [drop: ROTTEN FLESH, amount: 1, exp: 1000, weight: 10] - - [drop: STICK, amount: 1, exp: 1000, weight: 5 ] - - [drop: STRING, amount: 1, exp: 1000, weight: 5 ] - - [drop: BOTTLE, amount: 1, exp: 1000, weight: 10, potion: [effect: WATER] ] - - [drop: BONE, amount: 1, exp: 1000, weight: 10] - - [drop: INK_SAC, amount: 1, exp: 1000, weight: 1 ] - - [drop: TRIPWIRE_HOOK, amount: 1, exp: 1000, weight: 10] + - [ drop: LILY_PAD, amount: 1, exp: 1000, weight: 17 ] + - [ drop: BOWL, amount: 1, exp: 1000, weight: 10 ] + - [ drop: FISHING_ROD, amount: 1, exp: 1000, weight: 2, durability: [ lower: 0.10, upper: 1.00 ] ] + - [ drop: LEATHER, amount: 1, exp: 1000, weight: 10 ] + - [ drop: LEATHER_BOOTS, amount: 1, exp: 1000, weight: 10, durability: [ lower: 0.10, upper: 1.00 ] ] + - [ drop: ROTTEN FLESH, amount: 1, exp: 1000, weight: 10 ] + - [ drop: STICK, amount: 1, exp: 1000, weight: 5 ] + - [ drop: STRING, amount: 1, exp: 1000, weight: 5 ] + - [ drop: BOTTLE, amount: 1, exp: 1000, weight: 10, potion: [ effect: WATER ] ] + - [ drop: BONE, amount: 1, exp: 1000, weight: 10 ] + - [ drop: INK_SAC, amount: 1, exp: 1000, weight: 1 ] + - [ drop: TRIPWIRE_HOOK, amount: 1, exp: 1000, weight: 10 ] treasureCatches: baseChance: 0.050 #Base probability of tier being rolled (from any catch) # Fill the drop table with custom items # Please refer to the custom item information in the comments of perkConfig.yml dropTable: - - [drop: BOW, amount: 1, exp: 2000, weight: 1, durability: [lower: 0, upper: 0.18], enchantmentBounds: [lower: 22,upper: 30, isTreasure: true] ] - - [drop: ENCHANTED_BOOK, amount: 1, exp: 2000, weight: 1, enchantmentBounds: [lower: 22,upper: 30, isTreasure: true] ] - - [drop: FISHING_ROD, amount: 1, exp: 2000, weight: 1, durability: [lower: 0, upper: 0.18], enchantmentBounds: [lower: 22,upper: 30, isTreasure: true] ] - - [drop: NAME_TAG, amount: 1, exp: 2000, weight: 1] - - [drop: NAUTILUS_SHELL, amount: 1, exp: 2000, weight: 1] - - [drop: ROTTEN SADDLE, amount: 1, exp: 2000, weight: 1] + - [ drop: BOW, amount: 1, exp: 2000, weight: 1, durability: [ lower: 0, upper: 0.18 ], enchantmentBounds: [ lower: 22,upper: 30, isTreasure: true ] ] + - [ drop: ENCHANTED_BOOK, amount: 1, exp: 2000, weight: 1, enchantmentBounds: [ lower: 22,upper: 30, isTreasure: true ] ] + - [ drop: FISHING_ROD, amount: 1, exp: 2000, weight: 1, durability: [ lower: 0, upper: 0.18 ], enchantmentBounds: [ lower: 22,upper: 30, isTreasure: true ] ] + - [ drop: NAME_TAG, amount: 1, exp: 2000, weight: 1 ] + - [ drop: NAUTILUS_SHELL, amount: 1, exp: 2000, weight: 1 ] + - [ drop: ROTTEN SADDLE, amount: 1, exp: 2000, weight: 1 ] archery: enabled: true #Setting this to false disables all skill features and EXP drops. startingSkillTokens: 0 #number of skill tokens each player starts with in this skill diff --git a/src/main/resources/experienceConfig.yml b/src/main/resources/experienceConfig.yml index 35b1c24..099a178 100644 --- a/src/main/resources/experienceConfig.yml +++ b/src/main/resources/experienceConfig.yml @@ -119,66 +119,70 @@ digging: exp: # Blocks broken that give experience. See comments at the top of the page for more information. blocks: - - [block: CLAY, breakExp: 60, natural: true ] - - [block: FARMLAND , breakExp: 20, natural: true ] - - [block: GRASS_BLOCK, breakExp: 20, natural: true ] - - [block: GRASS_PATH, breakExp: 20, natural: true ] - - [block: MYCELIUM, breakExp: 22, natural: true ] - - [block: PODZOL, breakExp: 22, natural: true ] - - [block: COARSE_DIRT, breakExp: 22, natural: true ] - - [block: DIRT, breakExp: 20, natural: true ] - - [block: RED_SAND, breakExp: 22, natural: true ] - - [block: SAND, breakExp: 20, natural: true ] - - [block: SOUL_SAND, breakExp: 30, natural: true ] - - [block: SOUL_SOIL, breakExp: 25, natural: true ] - - [block: SNOW_BLOCK, breakExp: 22, natural: true ] - - [block: SNOW, breakExp: 4, natural: true ] - - [block: BLACK_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: BLUE_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: BROWN_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: CYAN_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: GRAY_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: GREEN_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: LIGHT_BLUE_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: LIGHT_GRAY_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: LIME_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: MAGENTA_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: ORANGE_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: PINK_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: PURPLE_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: RED_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: WHITE_CONCRETE_POWDER, breakExp: 20, natural: false] - - [block: YELLOW_CONCRETE_POWDER, breakExp: 20, natural: false] + - [ block: CLAY, breakExp: 60, natural: true ] + - [ block: FARMLAND , breakExp: 20, natural: true ] + - [ block: GRASS_BLOCK, breakExp: 20, natural: true ] + - [ block: GRASS_PATH, breakExp: 20, natural: true ] + - [ block: MYCELIUM, breakExp: 22, natural: true ] + - [ block: PODZOL, breakExp: 22, natural: true ] + - [ block: COARSE_DIRT, breakExp: 22, natural: true ] + - [ block: DIRT, breakExp: 20, natural: true ] + - [ block: RED_SAND, breakExp: 22, natural: true ] + - [ block: SAND, breakExp: 20, natural: true ] + - [ block: SOUL_SAND, breakExp: 30, natural: true ] + - [ block: SOUL_SOIL, breakExp: 25, natural: true ] + - [ block: SNOW_BLOCK, breakExp: 22, natural: true ] + - [ block: SNOW, breakExp: 4, natural: true ] + - [ block: BLACK_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: BLUE_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: BROWN_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: CYAN_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: GRAY_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: GREEN_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: LIGHT_BLUE_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: LIGHT_GRAY_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: LIME_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: MAGENTA_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: ORANGE_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: PINK_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: PURPLE_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: RED_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: WHITE_CONCRETE_POWDER, breakExp: 20, natural: false ] + - [ block: YELLOW_CONCRETE_POWDER, breakExp: 20, natural: false ] + # added since 1.16.5 + - [ block: ROOTED_DIRT, breakExp: 100, natural: true ] wooductting: maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit EXP_Multiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier exp: # Blocks broken that give experience. See comments at the top of the page for more information. blocks: - - [block: ACACIA_LOG, breakExp: 100, natural: true ] - - [block: BIRCH_LOG, breakExp: 100, natural: true ] - - [block: DARK_OAK_LOG, breakExp: 100, natural: true ] - - [block: OAK_LOG, breakExp: 100, natural: true ] - - [block: SPRUCE_LOG, breakExp: 100, natural: true ] - - [block: JUNGLE_LOG, breakExp: 100, natural: true ] - - [block: ACACIA_PLANKS, breakExp: 25, natural: false] - - [block: BIRCH_PLANKS, breakExp: 25, natural: false] - - [block: DARK_OAK_PLANKS, breakExp: 25, natural: false] - - [block: OAK_PLANKS, breakExp: 25, natural: false] - - [block: SPRUCE_PLANKS, breakExp: 25, natural: false] - - [block: JUNGLE_PLANKS, breakExp: 25, natural: false] - - [block: ACACIA_LEAVES, breakExp: 13, natural: true ] - - [block: BIRCH_LEAVES, breakExp: 13, natural: true ] - - [block: DARK_OAK_LEAVES, breakExp: 13, natural: true ] - - [block: OAK_LEAVES, breakExp: 13, natural: true ] - - [block: SPRUCE_LEAVES, breakExp: 13, natural: true ] - - [block: JUNGLE_LEAVES, breakExp: 13, natural: true ] - - [block: BROWN_MUSHROOM_BLOCK, breakExp: 125, natural: true ] - - [block: RED_MUSHROOM_BLOCK, breakExp: 125, natural: true ] - - [block: CRIMSON_STEM, breakExp: 125, natural: true ] - - [block: WARPED_STEM, breakExp: 125, natural: true ] - - [block: CRIMSON_PLANKS, breakExp: 28, natural: false] - - [block: WARPED_PLANKS, breakExp: 28, natural: false] + - [ block: ACACIA_LOG, breakExp: 100, natural: true ] + - [ block: BIRCH_LOG, breakExp: 100, natural: true ] + - [ block: DARK_OAK_LOG, breakExp: 100, natural: true ] + - [ block: OAK_LOG, breakExp: 100, natural: true ] + - [ block: SPRUCE_LOG, breakExp: 100, natural: true ] + - [ block: JUNGLE_LOG, breakExp: 100, natural: true ] + - [ block: ACACIA_PLANKS, breakExp: 25, natural: false ] + - [ block: BIRCH_PLANKS, breakExp: 25, natural: false ] + - [ block: DARK_OAK_PLANKS, breakExp: 25, natural: false ] + - [ block: OAK_PLANKS, breakExp: 25, natural: false ] + - [ block: SPRUCE_PLANKS, breakExp: 25, natural: false ] + - [ block: JUNGLE_PLANKS, breakExp: 25, natural: false ] + - [ block: ACACIA_LEAVES, breakExp: 13, natural: true ] + - [ block: BIRCH_LEAVES, breakExp: 13, natural: true ] + - [ block: DARK_OAK_LEAVES, breakExp: 13, natural: true ] + - [ block: OAK_LEAVES, breakExp: 13, natural: true ] + - [ block: SPRUCE_LEAVES, breakExp: 13, natural: true ] + - [ block: JUNGLE_LEAVES, breakExp: 13, natural: true ] + - [ block: BROWN_MUSHROOM_BLOCK, breakExp: 125, natural: true ] + - [ block: RED_MUSHROOM_BLOCK, breakExp: 125, natural: true ] + - [ block: CRIMSON_STEM, breakExp: 125, natural: true ] + - [ block: WARPED_STEM, breakExp: 125, natural: true ] + - [ block: CRIMSON_PLANKS, breakExp: 28, natural: false ] + - [ block: WARPED_PLANKS, breakExp: 28, natural: false ] + # added since 1.16.5 + - [ block: FLOWERING_AZALEA_LEAVES,breakExp: 13,natural: true ] mining: maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier @@ -186,53 +190,77 @@ mining: explodeTNT: 200 #Experience rewarded for exploding TNT # Blocks broken that give experience. See comments at the top of the page for more information. blocks: - - [block: ICE, breakExp: 20, natural: true ] - - [block: BLUE_ICE, breakExp: 25, natural: true ] - - [block: PACKED_ICE, breakExp: 25, natural: true ] - - [block: FROSTED_ICE, breakExp: 25, natural: true ] - - [block: ANDESITE, breakExp: 20, natural: true ] - - [block: COAL_ORE, breakExp: 200, natural: true ] - - [block: DIORITE, breakExp: 20, natural: true ] - - [block: END_STONE, breakExp: 20, natural: true ] - - [block: GRANITE, breakExp: 20, natural: true ] - - [block: NETHERRACK, breakExp: 8, natural: true ] - - [block: NETHER_QUARTZ_ORE, breakExp: 250, natural: true ] - - [block: MOSSY_COBBLESTONE, breakExp: 35, natural: true ] - - [block: SANDSTONE, breakExp: 20, natural: true ] - - [block: RED_SANDSTONE, breakExp: 10, natural: true ] - - [block: SPAWNER, breakExp: 5000, natural: true ] - - [block: STONE, breakExp: 15, natural: true ] - - [block: IRON_ORE, breakExp: 350, natural: true ] - - [block: REDSTONE_ORE, breakExp: 500, natural: true ] - - [block: LAPIS_ORE, breakExp: 700, natural: true ] - - [block: GOLD_ORE, breakExp: 500, natural: true ] - - [block: DIAMOND_ORE, breakExp: 1000, natural: true ] - - [block: EMERALD_ORE, breakExp: 1250, natural: true ] - - [block: OBSIDIAN, breakExp: 100, natural: true ] - - [block: ANCIENT_DEBRIS, breakExp: 1500, natural: true ] - - [block: NETHER_GOLD_ORE, breakExp: 475, natural: true ] - - [block: BASALT, breakExp: 25, natural: true ] - - [block: BLACKSTONE, breakExp: 30, natural: true ] - - [block: CRYING_OBSIDIAN, breakExp: 150, natural: true ] - - [block: CRIMSON_NYLIUM, breakExp: 15, natural: true ] - - [block: WARPED_NYLIUM, breakExp: 15, natural: true ] - - [block: GILDED_BLACKSTONE, breakExp: 500, natural: true ] - - [block: WHITE_TERRACOTTA, breakExp: 25, natural: false] - - [block: ORANGE_TERRACOTTA, breakExp: 25, natural: false] - - [block: MAGENTA_TERRACOTTA, breakExp: 25, natural: false] - - [block: LIGHT_BLUE_TERRACOTTA, breakExp: 25, natural: false] - - [block: YELLOW_TERRACOTTA, breakExp: 25, natural: false] - - [block: LIME_TERRACOTTA, breakExp: 25, natural: false] - - [block: PINK_TERRACOTTA, breakExp: 25, natural: false] - - [block: GRAY_TERRACOTTA, breakExp: 25, natural: false] - - [block: LIGHT_GRAY_TERRACOTTA, breakExp: 25, natural: false] - - [block: PURPLE_TERRACOTTA, breakExp: 25, natural: false] - - [block: BLUE_TERRACOTTA, breakExp: 25, natural: false] - - [block: BROWN_TERRACOTTA, breakExp: 25, natural: false] - - [block: GREEN_TERRACOTTA, breakExp: 25, natural: false] - - [block: RED_TERRACOTTA, breakExp: 25, natural: false] - - [block: BLACK_TERRACOTTA, breakExp: 25, natural: false] - - [block: TERRACOTTA, breakExp: 25, natural: false] + - [ block: ICE, breakExp: 20, natural: true ] + - [ block: BLUE_ICE, breakExp: 25, natural: true ] + - [ block: PACKED_ICE, breakExp: 25, natural: true ] + - [ block: FROSTED_ICE, breakExp: 25, natural: true ] + - [ block: ANDESITE, breakExp: 20, natural: true ] + - [ block: COAL_ORE, breakExp: 200, natural: true ] + - [ block: DIORITE, breakExp: 20, natural: true ] + - [ block: END_STONE, breakExp: 20, natural: true ] + - [ block: GRANITE, breakExp: 20, natural: true ] + - [ block: NETHERRACK, breakExp: 8, natural: true ] + - [ block: NETHER_QUARTZ_ORE, breakExp: 250, natural: true ] + - [ block: MOSSY_COBBLESTONE, breakExp: 35, natural: true ] + - [ block: SANDSTONE, breakExp: 20, natural: true ] + - [ block: RED_SANDSTONE, breakExp: 10, natural: true ] + - [ block: SPAWNER, breakExp: 5000, natural: true ] + - [ block: STONE, breakExp: 15, natural: true ] + - [ block: IRON_ORE, breakExp: 350, natural: true ] + - [ block: REDSTONE_ORE, breakExp: 500, natural: true ] + - [ block: LAPIS_ORE, breakExp: 700, natural: true ] + - [ block: GOLD_ORE, breakExp: 500, natural: true ] + - [ block: DIAMOND_ORE, breakExp: 1000, natural: true ] + - [ block: EMERALD_ORE, breakExp: 1250, natural: true ] + - [ block: OBSIDIAN, breakExp: 100, natural: true ] + - [ block: ANCIENT_DEBRIS, breakExp: 1500, natural: true ] + - [ block: NETHER_GOLD_ORE, breakExp: 475, natural: true ] + - [ block: BASALT, breakExp: 25, natural: true ] + - [ block: BLACKSTONE, breakExp: 30, natural: true ] + - [ block: CRYING_OBSIDIAN, breakExp: 150, natural: true ] + - [ block: CRIMSON_NYLIUM, breakExp: 15, natural: true ] + - [ block: WARPED_NYLIUM, breakExp: 15, natural: true ] + - [ block: GILDED_BLACKSTONE, breakExp: 500, natural: true ] + - [ block: WHITE_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: ORANGE_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: MAGENTA_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: LIGHT_BLUE_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: YELLOW_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: LIME_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: PINK_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: GRAY_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: LIGHT_GRAY_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: PURPLE_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: BLUE_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: BROWN_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: GREEN_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: RED_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: BLACK_TERRACOTTA, breakExp: 25, natural: false ] + - [ block: TERRACOTTA, breakExp: 25, natural: false ] + # added since 1.16.5 + - [ block: AMETHYST_CLUSTER, breakExp: 850, natural: true ] + - [ block: AMETHYST_BLOCK, breakExp: 250, natural: true ] + - [ block: RAW_COPPER_BLOCK, breakExp: 4500, natural: true ] + - [ block: RAW_IRON_BLOCK, breakExp: 4500, natural: true ] + - [ block: CALCITE, breakExp: 25, natural: true ] + - [ block: DEEPSLATE, breakExp: 30, natural: true ] + - [ block: COPPER_ORE, breakExp: 350, natural: true ] + # double amount of exp so mining in the deepslate is more attractive due to hardness of deepslate + - [ block: DEEPSLATE_COAL_ORE, breakExp: 400, natural: true ] + - [ block: DEEPSLATE_COPPER_ORE, breakExp: 700, natural: true ] + - [ block: DEEPSLATE_DIAMOND_ORE, breakExp: 2000, natural: true ] + - [ block: DEEPSLATE_EMERALD_ORE, breakExp: 2500, natural: true ] + - [ block: DEEPSLATE_IRON_ORE, breakExp: 700, natural: true ] + - [ block: DEEPSLATE_LAPIS_ORE, breakExp: 1400, natural: true ] + - [ block: DEEPSLATE_REDSTONE_ORE,breakExp: 1000, natural: true ] + - [ block: DRIPSTONE_BLOCK, breakExp: 45, natural: true ] + - [ block: POINTED_DRIPSTONE, breakExp: 95, natural: true ] + - [ block: TUFF, breakExp: 30, natural: true ] + # is natural generated false + - [ block: COPPER_BLOCK, breakExp: 75, natural: false ] + - [ block: RAW_COPPER_BLOCK, breakExp: 25, natural: false ] + - [ block: RAW_GOLD_BLOCK, breakExp: 25, natural: false ] + - [ block: RAW_IRON_BLOCK, breakExp: 25, natural: false ] farming: maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier @@ -247,39 +275,53 @@ farming: # Mobs that give experience for various actions. See comments at the top of the page for more information. mobs: - - [mob: MUSHROOM_COW, breedExp: 150, killExp: 100] - - [mob: COW, breedExp: 150, killExp: 100] - - [mob: SHEEP, breedExp: 125, killExp: 100] - - [mob: PIG, breedExp: 125, killExp: 100] - - [mob: CHICKEN, breedExp: 125, killExp: 40 ] - - [mob: RABBIT, breedExp: 175, killExp: 125] - - [mob: TURTLE, breedExp: 175, killExp: 50 ] - - [mob: PANDA, breedExp: 175, killExp: 0 ] - - [mob: FOX, breedExp: 200, killExp: 0 ] - - [mob: BEE, breedExp: 200, killExp: 0 ] - - [mob: HORSE, breedExp: 0, killExp: 100] - - [mob: LLAMA, breedExp: 0, killExp: 25 ] + - [ mob: MUSHROOM_COW, breedExp: 150, killExp: 100 ] + - [ mob: COW, breedExp: 150, killExp: 100 ] + - [ mob: SHEEP, breedExp: 125, killExp: 100 ] + - [ mob: PIG, breedExp: 125, killExp: 100 ] + - [ mob: CHICKEN, breedExp: 125, killExp: 40 ] + - [ mob: RABBIT, breedExp: 175, killExp: 125 ] + - [ mob: TURTLE, breedExp: 175, killExp: 50 ] + - [ mob: PANDA, breedExp: 175, killExp: 0 ] + - [ mob: FOX, breedExp: 200, killExp: 0 ] + - [ mob: BEE, breedExp: 200, killExp: 0 ] + - [ mob: HORSE, breedExp: 0, killExp: 100 ] + - [ mob: LLAMA, breedExp: 0, killExp: 25 ] + # added since 1.16.5 + - [ mob: AXOLOTL, breedExp: 200, killExp: 0 ] + - [ mob: GOAT, breedExp: 175, killExp: 100 ] # Blocks broken that give experience. See comments at the top of the page for more information. blocks: - - [block: WHEAT, breakExp: 50, natural: true ] - - [block: BEATROOTS , breakExp: 50, natural: true ] - - [block: CARROTS, breakExp: 50, natural: true ] - - [block: POTATOES, breakExp: 50, natural: true ] - - [block: MELON, breakExp: 85, natural: true ] - - [block: PUMPKIN, breakExp: 85, natural: true ] - - [block: BAMBOO, breakExp: 15, natural: true ] #This exp is rewarded for each (natural) block tha falls if a tower is broken - - [block: COCOA, breakExp: 70, natural: true ] - - [block: SUGAR_CANE, breakExp: 70, natural: true ] #This exp is rewarded for each (natural) block tha falls if a tower is broken - - [block: CACTUS, breakExp: 38, natural: true ] #This exp is rewarded for each (natural) block tha falls if a tower is broken - - [block: RED_MUSHROOM, breakExp: 85, natural: true ] - - [block: BROWN_MUSHROOM, breakExp: 85, natural: true ] - - [block: SWEET_BERRY_BUSH, breakExp: 75, natural: true ] - - [block: KELP, breakExp: 5, natural: true ] #This exp is rewarded for each (natural) block tha falls if a tower is broken - - [block: SEA_PICKLE, breakExp: 100, natural: true ] - - [block: NETHER_WART, breakExp: 58, natural: true ] - - [block: CHORUS_PLANT, breakExp: 60, natural: true ] - - [block: CHORUS_FLOWER, breakExp: 60, natural: true ] + - [ block: WHEAT, breakExp: 50, natural: true ] + - [ block: BEATROOTS , breakExp: 50, natural: true ] + - [ block: CARROTS, breakExp: 50, natural: true ] + - [ block: POTATOES, breakExp: 50, natural: true ] + - [ block: MELON, breakExp: 85, natural: true ] + - [ block: PUMPKIN, breakExp: 85, natural: true ] + - [ block: BAMBOO, breakExp: 15, natural: true ] #This exp is rewarded for each (natural) block tha falls if a tower is broken + - [ block: COCOA, breakExp: 70, natural: true ] + - [ block: SUGAR_CANE, breakExp: 70, natural: true ] #This exp is rewarded for each (natural) block tha falls if a tower is broken + - [ block: CACTUS, breakExp: 38, natural: true ] #This exp is rewarded for each (natural) block tha falls if a tower is broken + - [ block: RED_MUSHROOM, breakExp: 85, natural: true ] + - [ block: BROWN_MUSHROOM, breakExp: 85, natural: true ] + - [ block: SWEET_BERRY_BUSH, breakExp: 75, natural: true ] + - [ block: KELP, breakExp: 5, natural: true ] #This exp is rewarded for each (natural) block tha falls if a tower is broken + - [ block: SEA_PICKLE, breakExp: 100, natural: true ] + - [ block: NETHER_WART, breakExp: 58, natural: true ] + - [ block: CHORUS_PLANT, breakExp: 60, natural: true ] + - [ block: CHORUS_FLOWER, breakExp: 60, natural: true ] + # added since 1.16.5 + - [ block: AZALEA, breakExp: 75, natural: true ] + - [ block: FLOWERING_AZALEA, breakExp: 75, natural: true ] + - [ block: CAVE_VINES, breakExp: 85, natural: true ] + - [ block: SMALL_DRIPLEAF, breakExp: 70, natural: true ] + - [ block: GLOW_LICHEN, breakExp: 70, natural: true ] + - [ block: HANGING_ROOTS, breakExp: 250, natural: true ] + - [ block: MOSS_BLOCK, breakExp: 15, natural: true ] + # breakExp: 200 might be too high, but to get players discovering the underground it might be just right + - [ block: SPORE_BLOSSOM, breakExp: 200, natural: true ] + - [ block: BIG_DRIPLEAF, breakExp: 70, natural: true ] fishing: maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier @@ -289,10 +331,10 @@ fishing: # Mobs that give experience for various actions. See comments at the top of the page for more information. mobs: - - [mob: COD, killExp: 250] - - [mob: SALMON, killExp: 250] - - [mob: TROPICAL_FISH, killExp: 300] - - [mob: PUFFERFISH, killExp: 500] + - [ mob: COD, killExp: 250 ] + - [ mob: SALMON, killExp: 250 ] + - [ mob: TROPICAL_FISH, killExp: 300 ] + - [ mob: PUFFERFISH, killExp: 500 ] archery: maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier @@ -311,75 +353,78 @@ archery: # hitExp is experience given when the mob is hit, regardless of damage # damageEXP is the experience given for each damage point done to the mob mobs: - - [mob: BAT, killExp: 15, hitExp: 20, damageExp: 16] - - [mob: CAT, killExp: 25, hitExp: 20, damageExp: 16] - - [mob: CHICKEN, killExp: 30, hitExp: 20, damageExp: 16] - - [mob: COD, killExp: 30, hitExp: 20, damageExp: 16] - - [mob: COW, killExp: 30, hitExp: 20, damageExp: 16] - - [mob: DONKEY, killExp: 40, hitExp: 20, damageExp: 16] - - [mob: FOX, killExp: 50, hitExp: 20, damageExp: 16] - - [mob: HORSE, killExp: 40, hitExp: 20, damageExp: 16] - - [mob: POLAR_BEAR, killExp: 75, hitExp: 20, damageExp: 16] - - [mob: MUSHROOM_COW, killExp: 40, hitExp: 20, damageExp: 16] - - [mob: MULE, killExp: 40, hitExp: 20, damageExp: 16] - - [mob: OCELOT, killExp: 30, hitExp: 20, damageExp: 16] - - [mob: PARROT, killExp: 25, hitExp: 20, damageExp: 16] - - [mob: PIG, killExp: 30, hitExp: 20, damageExp: 16] - - [mob: RABBIT, killExp: 30, hitExp: 20, damageExp: 16] - - [mob: SALMON, killExp: 30, hitExp: 20, damageExp: 16] - - [mob: SHEEP, killExp: 30, hitExp: 20, damageExp: 16] - - [mob: SKELETON_HORSE, killExp: 75, hitExp: 20, damageExp: 16] - - [mob: SNOWMAN, killExp: 10, hitExp: 20, damageExp: 16] - - [mob: SQUID, killExp: 30, hitExp: 20, damageExp: 16] - - [mob: TROPICAL_FISH, killExp: 30, hitExp: 20, damageExp: 16] - - [mob: TURTLE, killExp: 30, hitExp: 20, damageExp: 16] - - [mob: VILLAGER, killExp: 25, hitExp: 20, damageExp: 16] - - [mob: WANDERING_TRADER, killExp: 500, hitExp: 20, damageExp: 16] - - [mob: BEE, killExp: 55, hitExp: 20, damageExp: 16] - - [mob: CAVE_SPIDER, killExp: 85, hitExp: 20, damageExp: 16] - - [mob: DOLPHIN, killExp: 70, hitExp: 20, damageExp: 16] - - [mob: ENDERMAN, killExp: 80, hitExp: 20, damageExp: 16] - - [mob: IRON_GOLEM, killExp: 125, hitExp: 20, damageExp: 16] - - [mob: LLAMA, killExp: 55, hitExp: 20, damageExp: 16] - - [mob: PANDA, killExp: 55, hitExp: 20, damageExp: 16] - - [mob: PUFFERFISH, killExp: 60, hitExp: 20, damageExp: 16] - - [mob: SPIDER, killExp: 75, hitExp: 20, damageExp: 16] - - [mob: WOLF, killExp: 75, hitExp: 20, damageExp: 16] - - [mob: BLAZE, killExp: 85, hitExp: 20, damageExp: 16] - - [mob: CREEPER, killExp: 85, hitExp: 20, damageExp: 16] - - [mob: DROWNED, killExp: 90, hitExp: 20, damageExp: 16] - - [mob: ELDER_GUARDIAN, killExp: 7500, hitExp: 20, damageExp: 16] - - [mob: ENDERMITE, killExp: 60, hitExp: 20, damageExp: 16] - - [mob: EVOKER, killExp: 80, hitExp: 20, damageExp: 16] - - [mob: GHAST, killExp: 90, hitExp: 20, damageExp: 16] - - [mob: GUARDIAN, killExp: 60, hitExp: 20, damageExp: 16] - - [mob: HUSK, killExp: 75, hitExp: 20, damageExp: 16] - - [mob: MAGMA_CUBE, killExp: 45, hitExp: 20, damageExp: 16] - - [mob: PHANTOM, killExp: 70, hitExp: 20, damageExp: 16] - - [mob: PILLAGER, killExp: 80, hitExp: 20, damageExp: 16] - - [mob: RAVAGER, killExp: 100, hitExp: 20, damageExp: 16] - - [mob: SHULKER, killExp: 85, hitExp: 20, damageExp: 16] - - [mob: SILVERFISH, killExp: 90, hitExp: 20, damageExp: 16] - - [mob: SKELETON, killExp: 80, hitExp: 20, damageExp: 16] - - [mob: SLIME, killExp: 40, hitExp: 20, damageExp: 16] - - [mob: STRAY, killExp: 75, hitExp: 20, damageExp: 16] - - [mob: VEX, killExp: 90, hitExp: 20, damageExp: 16] - - [mob: VINDICATOR, killExp: 85, hitExp: 20, damageExp: 16] - - [mob: WITCH, killExp: 90, hitExp: 20, damageExp: 16] - - [mob: WITHER_SKELETON, killExp: 95, hitExp: 20, damageExp: 16] - - [mob: ZOMBIE, killExp: 75, hitExp: 20, damageExp: 16] - - [mob: ZOMBIE_VILLAGER, killExp: 75, hitExp: 20, damageExp: 16] - - [mob: ENDER_DRAGON, killExp: 20000, hitExp: 20, damageExp: 16] - - [mob: WITHER, killExp: 12500, hitExp: 20, damageExp: 16] - - [mob: ZOMBIE_HORSE, killExp: 75, hitExp: 20, damageExp: 16] - - [mob: ILLUSIONER, killExp: 125, hitExp: 20, damageExp: 16] - - [mob: GIANT, killExp: 125, hitExp: 20, damageExp: 16] - - [mob: PIGLIN, killExp: 75, hitExp: 20, damageExp: 16] - - [mob: ZOGLIN, killExp: 110, hitExp: 20, damageExp: 16] - - [mob: HOGLIN, killExp: 100, hitExp: 20, damageExp: 16] - - [mob: ZOMBIFIED_PIGLIN, killExp: 85, hitExp: 20, damageExp: 16] - - [mob: PIG_ZOMBIE, killExp: 75, hitExp: 20, damageExp: 16] #1.15 zombie pigman (may not work) - - [mob: STRIDER, killExp: 80, hitExp: 20, damageExp: 16] + - [ mob: BAT, killExp: 15, hitExp: 20, damageExp: 16 ] # why not even higher, so it makes sense to kill them + - [ mob: CAT, killExp: 25, hitExp: 20, damageExp: 16 ] + - [ mob: CHICKEN, killExp: 30, hitExp: 20, damageExp: 16 ] + - [ mob: COD, killExp: 30, hitExp: 20, damageExp: 16 ] + - [ mob: COW, killExp: 30, hitExp: 20, damageExp: 16 ] + - [ mob: DONKEY, killExp: 40, hitExp: 20, damageExp: 16 ] + - [ mob: FOX, killExp: 50, hitExp: 20, damageExp: 16 ] + - [ mob: HORSE, killExp: 40, hitExp: 20, damageExp: 16 ] + - [ mob: POLAR_BEAR, killExp: 75, hitExp: 20, damageExp: 16 ] + - [ mob: MUSHROOM_COW, killExp: 40, hitExp: 20, damageExp: 16 ] + - [ mob: MULE, killExp: 40, hitExp: 20, damageExp: 16 ] + - [ mob: OCELOT, killExp: 30, hitExp: 20, damageExp: 16 ] + - [ mob: PARROT, killExp: 25, hitExp: 20, damageExp: 16 ] + - [ mob: PIG, killExp: 30, hitExp: 20, damageExp: 16 ] + - [ mob: RABBIT, killExp: 30, hitExp: 20, damageExp: 16 ] + - [ mob: SALMON, killExp: 30, hitExp: 20, damageExp: 16 ] + - [ mob: SHEEP, killExp: 30, hitExp: 20, damageExp: 16 ] + - [ mob: SKELETON_HORSE, killExp: 75, hitExp: 20, damageExp: 16 ] + - [ mob: SNOWMAN, killExp: 10, hitExp: 20, damageExp: 16 ] + - [ mob: SQUID, killExp: 30, hitExp: 20, damageExp: 16 ] + - [ mob: TROPICAL_FISH, killExp: 30, hitExp: 20, damageExp: 16 ] + - [ mob: TURTLE, killExp: 30, hitExp: 20, damageExp: 16 ] + - [ mob: VILLAGER, killExp: 25, hitExp: 20, damageExp: 16 ] + - [ mob: WANDERING_TRADER, killExp: 500, hitExp: 20, damageExp: 16 ] # needs to be higher ;) + - [ mob: BEE, killExp: 55, hitExp: 20, damageExp: 16 ] + - [ mob: CAVE_SPIDER, killExp: 85, hitExp: 20, damageExp: 16 ] + - [ mob: DOLPHIN, killExp: 70, hitExp: 20, damageExp: 16 ] + - [ mob: ENDERMAN, killExp: 80, hitExp: 20, damageExp: 16 ] + - [ mob: IRON_GOLEM, killExp: 125, hitExp: 20, damageExp: 16 ] + - [ mob: LLAMA, killExp: 55, hitExp: 20, damageExp: 16 ] + - [ mob: PANDA, killExp: 55, hitExp: 20, damageExp: 16 ] + - [ mob: PUFFERFISH, killExp: 60, hitExp: 20, damageExp: 16 ] + - [ mob: SPIDER, killExp: 75, hitExp: 20, damageExp: 16 ] + - [ mob: WOLF, killExp: 75, hitExp: 20, damageExp: 16 ] + - [ mob: BLAZE, killExp: 85, hitExp: 20, damageExp: 16 ] + - [ mob: CREEPER, killExp: 85, hitExp: 20, damageExp: 16 ] + - [ mob: DROWNED, killExp: 90, hitExp: 20, damageExp: 16 ] + - [ mob: ELDER_GUARDIAN, killExp: 7500, hitExp: 20, damageExp: 16 ] + - [ mob: ENDERMITE, killExp: 60, hitExp: 20, damageExp: 16 ] + - [ mob: EVOKER, killExp: 80, hitExp: 20, damageExp: 16 ] + - [ mob: GHAST, killExp: 90, hitExp: 20, damageExp: 16 ] + - [ mob: GUARDIAN, killExp: 60, hitExp: 20, damageExp: 16 ] + - [ mob: HUSK, killExp: 75, hitExp: 20, damageExp: 16 ] + - [ mob: MAGMA_CUBE, killExp: 45, hitExp: 20, damageExp: 16 ] + - [ mob: PHANTOM, killExp: 70, hitExp: 20, damageExp: 16 ] + - [ mob: PILLAGER, killExp: 80, hitExp: 20, damageExp: 16 ] + - [ mob: RAVAGER, killExp: 100, hitExp: 20, damageExp: 16 ] + - [ mob: SHULKER, killExp: 85, hitExp: 20, damageExp: 16 ] + - [ mob: SILVERFISH, killExp: 90, hitExp: 20, damageExp: 16 ] + - [ mob: SKELETON, killExp: 80, hitExp: 20, damageExp: 16 ] + - [ mob: SLIME, killExp: 40, hitExp: 20, damageExp: 16 ] + - [ mob: STRAY, killExp: 75, hitExp: 20, damageExp: 16 ] + - [ mob: VEX, killExp: 90, hitExp: 20, damageExp: 16 ] + - [ mob: VINDICATOR, killExp: 85, hitExp: 20, damageExp: 16 ] + - [ mob: WITCH, killExp: 90, hitExp: 20, damageExp: 16 ] + - [ mob: WITHER_SKELETON, killExp: 95, hitExp: 20, damageExp: 16 ] + - [ mob: ZOMBIE, killExp: 75, hitExp: 20, damageExp: 16 ] + - [ mob: ZOMBIE_VILLAGER, killExp: 75, hitExp: 20, damageExp: 16 ] + - [ mob: ENDER_DRAGON, killExp: 20000, hitExp: 20, damageExp: 16 ] + - [ mob: WITHER, killExp: 12500, hitExp: 20, damageExp: 16 ] + - [ mob: ZOMBIE_HORSE, killExp: 75, hitExp: 20, damageExp: 16 ] + - [ mob: ILLUSIONER, killExp: 125, hitExp: 20, damageExp: 16 ] + - [ mob: GIANT, killExp: 125, hitExp: 20, damageExp: 16 ] + - [ mob: PIGLIN, killExp: 75, hitExp: 20, damageExp: 16 ] + - [ mob: ZOGLIN, killExp: 110, hitExp: 20, damageExp: 16 ] + - [ mob: HOGLIN, killExp: 100, hitExp: 20, damageExp: 16 ] + - [ mob: ZOMBIFIED_PIGLIN, killExp: 85, hitExp: 20, damageExp: 16 ] + - [ mob: PIG_ZOMBIE, killExp: 75, hitExp: 20, damageExp: 16 ] #1.15 zombie pigman (may not work) + - [ mob: STRIDER, killExp: 80, hitExp: 20, damageExp: 16 ] + # added since 1.16.5 + - [ mob: GLOW_SQUID, killExp: 80, hitExp: 20, damageExp: 16 ] + - [ mob: GOAT, killExp: 80, hitExp: 20, damageExp: 16 ] beastMastery: maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier @@ -393,75 +438,78 @@ beastMastery: # Mobs that give experience for various actions. See comments at the top of the page for more information. mobs: - - [mob: BAT, killExp: 200, hitExp: 50, damageExp: 40] - - [mob: CAT, killExp: 400, hitExp: 50, damageExp: 40, tameExp: 1750, breedExp: 1450] - - [mob: CHICKEN, killExp: 450, hitExp: 50, damageExp: 40] - - [mob: COD, killExp: 450, hitExp: 50, damageExp: 40] - - [mob: COW, killExp: 550, hitExp: 50, damageExp: 40] - - [mob: DONKEY, killExp: 600, hitExp: 50, damageExp: 40] - - [mob: FOX, killExp: 600, hitExp: 50, damageExp: 40] - - [mob: HORSE, killExp: 600, hitExp: 50, damageExp: 40, tameExp: 1500, breedExp: 1250] - - [mob: POLAR_BEAR, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: MUSHROOM_COW, killExp: 550, hitExp: 50, damageExp: 40] - - [mob: MULE, killExp: 600, hitExp: 50, damageExp: 40] - - [mob: OCELOT, killExp: 500, hitExp: 50, damageExp: 40] - - [mob: PARROT, killExp: 450, hitExp: 50, damageExp: 40, tameExp: 1750, breedExp: 1450] - - [mob: PIG, killExp: 450, hitExp: 50, damageExp: 40] - - [mob: RABBIT, killExp: 400, hitExp: 50, damageExp: 40] - - [mob: SALMON, killExp: 450, hitExp: 50, damageExp: 40] - - [mob: SHEEP, killExp: 450, hitExp: 50, damageExp: 40] - - [mob: SKELETON_HORSE, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: SNOWMAN, killExp: 100, hitExp: 50, damageExp: 40] - - [mob: SQUID, killExp: 450, hitExp: 50, damageExp: 40] - - [mob: TROPICAL_FISH, killExp: 450, hitExp: 50, damageExp: 40] - - [mob: TURTLE, killExp: 450, hitExp: 50, damageExp: 40] - - [mob: VILLAGER, killExp: 450, hitExp: 50, damageExp: 40] - - [mob: WANDERING_TRADER, killExp: 700, hitExp: 50, damageExp: 40] - - [mob: BEE, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: CAVE_SPIDER, killExp: 800, hitExp: 50, damageExp: 40] - - [mob: DOLPHIN, killExp: 700, hitExp: 50, damageExp: 40] - - [mob: ENDERMAN, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: IRON_GOLEM, killExp: 1500, hitExp: 50, damageExp: 40] - - [mob: LLAMA, killExp: 650, hitExp: 50, damageExp: 40] - - [mob: PANDA, killExp: 650, hitExp: 50, damageExp: 40] - - [mob: PUFFERFISH, killExp: 550, hitExp: 50, damageExp: 40] - - [mob: SPIDER, killExp: 770, hitExp: 50, damageExp: 40] - - [mob: WOLF, killExp: 500, hitExp: 50, damageExp: 40, tameExp: 1600, breedExp: 1350] - - [mob: BLAZE, killExp: 900, hitExp: 50, damageExp: 40] - - [mob: CREEPER, killExp: 1100, hitExp: 50, damageExp: 40] - - [mob: DROWNED, killExp: 1050, hitExp: 50, damageExp: 40] - - [mob: ELDER_GUARDIAN, killExp: 10000, hitExp: 50, damageExp: 40] - - [mob: ENDERMITE, killExp: 550, hitExp: 50, damageExp: 40] - - [mob: EVOKER, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: GHAST, killExp: 1500, hitExp: 50, damageExp: 40] - - [mob: GUARDIAN, killExp: 800, hitExp: 50, damageExp: 40] - - [mob: HUSK, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: MAGMA_CUBE, killExp: 500, hitExp: 50, damageExp: 40] - - [mob: PHANTOM, killExp: 800, hitExp: 50, damageExp: 40] - - [mob: PILLAGER, killExp: 800, hitExp: 50, damageExp: 40] - - [mob: RAVAGER, killExp: 1000, hitExp: 50, damageExp: 40] - - [mob: SHULKER, killExp: 550, hitExp: 50, damageExp: 40] - - [mob: SILVERFISH, killExp: 500, hitExp: 50, damageExp: 40] - - [mob: SKELETON, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: SLIME, killExp: 500, hitExp: 50, damageExp: 40] - - [mob: STRAY, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: VEX, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: VINDICATOR, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: WITCH, killExp: 800, hitExp: 50, damageExp: 40] - - [mob: WITHER_SKELETON, killExp: 900, hitExp: 50, damageExp: 40] - - [mob: ZOMBIE, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: ZOMBIE_VILLAGER, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: ENDER_DRAGON, killExp: 50000, hitExp: 50, damageExp: 40] - - [mob: WITHER, killExp: 25000, hitExp: 50, damageExp: 40] - - [mob: ZOMBIE_HORSE, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: ILLUSIONER, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: GIANT, killExp: 750, hitExp: 50, damageExp: 40] - - [mob: PIGLIN, killExp: 500, hitExp: 50, damageExp: 40] - - [mob: ZOGLIN, killExp: 900, hitExp: 50, damageExp: 40] - - [mob: HOGLIN, killExp: 800, hitExp: 50, damageExp: 40] - - [mob: ZOMBIFIED_PIGLIN, killExp: 600, hitExp: 50, damageExp: 40] - - [mob: PIG_ZOMBIE, killExp: 600, hitExp: 50, damageExp: 40] #1.15 zombie pigman (may not work) - - [mob: STRIDER, killExp: 500, hitExp: 50, damageExp: 40] + - [ mob: BAT, killExp: 200, hitExp: 50, damageExp: 40 ] + - [ mob: CAT, killExp: 400, hitExp: 50, damageExp: 40, tameExp: 1750, breedExp: 1450 ] + - [ mob: CHICKEN, killExp: 450, hitExp: 50, damageExp: 40 ] + - [ mob: COD, killExp: 450, hitExp: 50, damageExp: 40 ] + - [ mob: COW, killExp: 550, hitExp: 50, damageExp: 40 ] + - [ mob: DONKEY, killExp: 600, hitExp: 50, damageExp: 40 ] + - [ mob: FOX, killExp: 600, hitExp: 50, damageExp: 40 ] + - [ mob: HORSE, killExp: 600, hitExp: 50, damageExp: 40, tameExp: 1500, breedExp: 1250 ] + - [ mob: POLAR_BEAR, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: MUSHROOM_COW, killExp: 550, hitExp: 50, damageExp: 40 ] + - [ mob: MULE, killExp: 600, hitExp: 50, damageExp: 40 ] + - [ mob: OCELOT, killExp: 500, hitExp: 50, damageExp: 40 ] + - [ mob: PARROT, killExp: 450, hitExp: 50, damageExp: 40, tameExp: 1750, breedExp: 1450 ] + - [ mob: PIG, killExp: 450, hitExp: 50, damageExp: 40 ] + - [ mob: RABBIT, killExp: 400, hitExp: 50, damageExp: 40 ] + - [ mob: SALMON, killExp: 450, hitExp: 50, damageExp: 40 ] + - [ mob: SHEEP, killExp: 450, hitExp: 50, damageExp: 40 ] + - [ mob: SKELETON_HORSE, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: SNOWMAN, killExp: 100, hitExp: 50, damageExp: 40 ] + - [ mob: SQUID, killExp: 450, hitExp: 50, damageExp: 40 ] + - [ mob: TROPICAL_FISH, killExp: 450, hitExp: 50, damageExp: 40 ] + - [ mob: TURTLE, killExp: 450, hitExp: 50, damageExp: 40 ] + - [ mob: VILLAGER, killExp: 450, hitExp: 50, damageExp: 40 ] + - [ mob: WANDERING_TRADER, killExp: 700, hitExp: 50, damageExp: 40 ] + - [ mob: BEE, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: CAVE_SPIDER, killExp: 800, hitExp: 50, damageExp: 40 ] + - [ mob: DOLPHIN, killExp: 700, hitExp: 50, damageExp: 40 ] + - [ mob: ENDERMAN, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: IRON_GOLEM, killExp: 1500, hitExp: 50, damageExp: 40 ] + - [ mob: LLAMA, killExp: 650, hitExp: 50, damageExp: 40 ] + - [ mob: PANDA, killExp: 650, hitExp: 50, damageExp: 40 ] + - [ mob: PUFFERFISH, killExp: 550, hitExp: 50, damageExp: 40 ] + - [ mob: SPIDER, killExp: 770, hitExp: 50, damageExp: 40 ] + - [ mob: WOLF, killExp: 500, hitExp: 50, damageExp: 40, tameExp: 1600, breedExp: 1350 ] + - [ mob: BLAZE, killExp: 900, hitExp: 50, damageExp: 40 ] + - [ mob: CREEPER, killExp: 1100, hitExp: 50, damageExp: 40 ] + - [ mob: DROWNED, killExp: 1050, hitExp: 50, damageExp: 40 ] + - [ mob: ELDER_GUARDIAN, killExp: 10000, hitExp: 50, damageExp: 40 ] + - [ mob: ENDERMITE, killExp: 550, hitExp: 50, damageExp: 40 ] + - [ mob: EVOKER, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: GHAST, killExp: 1500, hitExp: 50, damageExp: 40 ] + - [ mob: GUARDIAN, killExp: 800, hitExp: 50, damageExp: 40 ] + - [ mob: HUSK, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: MAGMA_CUBE, killExp: 500, hitExp: 50, damageExp: 40 ] + - [ mob: PHANTOM, killExp: 800, hitExp: 50, damageExp: 40 ] + - [ mob: PILLAGER, killExp: 800, hitExp: 50, damageExp: 40 ] + - [ mob: RAVAGER, killExp: 1000, hitExp: 50, damageExp: 40 ] + - [ mob: SHULKER, killExp: 550, hitExp: 50, damageExp: 40 ] + - [ mob: SILVERFISH, killExp: 500, hitExp: 50, damageExp: 40 ] + - [ mob: SKELETON, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: SLIME, killExp: 500, hitExp: 50, damageExp: 40 ] + - [ mob: STRAY, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: VEX, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: VINDICATOR, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: WITCH, killExp: 800, hitExp: 50, damageExp: 40 ] + - [ mob: WITHER_SKELETON, killExp: 900, hitExp: 50, damageExp: 40 ] + - [ mob: ZOMBIE, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: ZOMBIE_VILLAGER, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: ENDER_DRAGON, killExp: 50000, hitExp: 50, damageExp: 40 ] + - [ mob: WITHER, killExp: 25000, hitExp: 50, damageExp: 40 ] + - [ mob: ZOMBIE_HORSE, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: ILLUSIONER, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: GIANT, killExp: 750, hitExp: 50, damageExp: 40 ] + - [ mob: PIGLIN, killExp: 500, hitExp: 50, damageExp: 40 ] + - [ mob: ZOGLIN, killExp: 900, hitExp: 50, damageExp: 40 ] + - [ mob: HOGLIN, killExp: 800, hitExp: 50, damageExp: 40 ] + - [ mob: ZOMBIFIED_PIGLIN, killExp: 600, hitExp: 50, damageExp: 40 ] + - [ mob: PIG_ZOMBIE, killExp: 600, hitExp: 50, damageExp: 40 ] #1.15 zombie pigman (may not work) + - [ mob: STRIDER, killExp: 500, hitExp: 50, damageExp: 40 ] + # added since 1.16.5 + - [ mob: GLOW_SQUID, killExp: 450, hitExp: 50, damageExp: 40 ] + - [ mob: GOAT, killExp: 550, hitExp: 50, damageExp: 40 ] swordsmanship: maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier @@ -476,75 +524,78 @@ swordsmanship: # Mobs that give experience for various actions. See comments at the top of the page for more information. mobs: - - [mob: BAT, killExp: 15, hitExp: 15, damageExp: 12] - - [mob: CAT, killExp: 25, hitExp: 15, damageExp: 12] - - [mob: CHICKEN, killExp: 30, hitExp: 15, damageExp: 12] - - [mob: COD, killExp: 30, hitExp: 15, damageExp: 12] - - [mob: COW, killExp: 30, hitExp: 15, damageExp: 12] - - [mob: DONKEY, killExp: 40, hitExp: 15, damageExp: 12] - - [mob: FOX, killExp: 50, hitExp: 15, damageExp: 12] - - [mob: HORSE, killExp: 40, hitExp: 15, damageExp: 12] - - [mob: POLAR_BEAR, killExp: 75, hitExp: 15, damageExp: 12] - - [mob: MUSHROOM_COW, killExp: 40, hitExp: 15, damageExp: 12] - - [mob: MULE, killExp: 40, hitExp: 15, damageExp: 12] - - [mob: OCELOT, killExp: 30, hitExp: 15, damageExp: 12] - - [mob: PARROT, killExp: 25, hitExp: 15, damageExp: 12] - - [mob: PIG, killExp: 30, hitExp: 15, damageExp: 12] - - [mob: RABBIT, killExp: 30, hitExp: 15, damageExp: 12] - - [mob: SALMON, killExp: 30, hitExp: 15, damageExp: 12] - - [mob: SHEEP, killExp: 30, hitExp: 15, damageExp: 12] - - [mob: SKELETON_HORSE, killExp: 75, hitExp: 15, damageExp: 12] - - [mob: SNOWMAN, killExp: 10, hitExp: 15, damageExp: 12] - - [mob: SQUID, killExp: 30, hitExp: 15, damageExp: 12] - - [mob: TROPICAL_FISH, killExp: 30, hitExp: 15, damageExp: 12] - - [mob: TURTLE, killExp: 30, hitExp: 15, damageExp: 12] - - [mob: VILLAGER, killExp: 25, hitExp: 15, damageExp: 12] - - [mob: WANDERING_TRADER, killExp: 500, hitExp: 15, damageExp: 12] - - [mob: BEE, killExp: 55, hitExp: 15, damageExp: 12] - - [mob: CAVE_SPIDER, killExp: 85, hitExp: 15, damageExp: 12] - - [mob: DOLPHIN, killExp: 70, hitExp: 15, damageExp: 12] - - [mob: ENDERMAN, killExp: 80, hitExp: 15, damageExp: 12] - - [mob: IRON_GOLEM, killExp: 125, hitExp: 15, damageExp: 12] - - [mob: LLAMA, killExp: 55, hitExp: 15, damageExp: 12] - - [mob: PANDA, killExp: 55, hitExp: 15, damageExp: 12] - - [mob: PUFFERFISH, killExp: 60, hitExp: 15, damageExp: 12] - - [mob: SPIDER, killExp: 75, hitExp: 15, damageExp: 12] - - [mob: WOLF, killExp: 75, hitExp: 15, damageExp: 12] - - [mob: BLAZE, killExp: 85, hitExp: 15, damageExp: 12] - - [mob: CREEPER, killExp: 85, hitExp: 15, damageExp: 12] - - [mob: DROWNED, killExp: 90, hitExp: 15, damageExp: 12] - - [mob: ELDER_GUARDIAN, killExp: 7500, hitExp: 15, damageExp: 12] - - [mob: ENDERMITE, killExp: 60, hitExp: 15, damageExp: 12] - - [mob: EVOKER, killExp: 80, hitExp: 15, damageExp: 12] - - [mob: GHAST, killExp: 90, hitExp: 15, damageExp: 12] - - [mob: GUARDIAN, killExp: 60, hitExp: 15, damageExp: 12] - - [mob: HUSK, killExp: 75, hitExp: 15, damageExp: 12] - - [mob: MAGMA_CUBE, killExp: 45, hitExp: 15, damageExp: 12] - - [mob: PHANTOM, killExp: 70, hitExp: 15, damageExp: 12] - - [mob: PILLAGER, killExp: 80, hitExp: 15, damageExp: 12] - - [mob: RAVAGER, killExp: 100, hitExp: 15, damageExp: 12] - - [mob: SHULKER, killExp: 85, hitExp: 15, damageExp: 12] - - [mob: SILVERFISH, killExp: 90, hitExp: 15, damageExp: 12] - - [mob: SKELETON, killExp: 80, hitExp: 15, damageExp: 12] - - [mob: SLIME, killExp: 40, hitExp: 15, damageExp: 12] - - [mob: STRAY, killExp: 75, hitExp: 15, damageExp: 12] - - [mob: VEX, killExp: 90, hitExp: 15, damageExp: 12] - - [mob: VINDICATOR, killExp: 85, hitExp: 15, damageExp: 12] - - [mob: WITCH, killExp: 90, hitExp: 15, damageExp: 12] - - [mob: WITHER_SKELETON, killExp: 95, hitExp: 15, damageExp: 12] - - [mob: ZOMBIE, killExp: 75, hitExp: 15, damageExp: 12] - - [mob: ZOMBIE_VILLAGER, killExp: 75, hitExp: 15, damageExp: 12] - - [mob: ENDER_DRAGON, killExp: 20000, hitExp: 15, damageExp: 12] - - [mob: WITHER, killExp: 12500, hitExp: 15, damageExp: 12] - - [mob: ZOMBIE_HORSE, killExp: 75, hitExp: 15, damageExp: 12] - - [mob: ILLUSIONER, killExp: 125, hitExp: 15, damageExp: 12] - - [mob: GIANT, killExp: 125, hitExp: 15, damageExp: 12] - - [mob: PIGLIN, killExp: 75, hitExp: 15, damageExp: 12] - - [mob: ZOGLIN, killExp: 110, hitExp: 15, damageExp: 12] - - [mob: HOGLIN, killExp: 100, hitExp: 15, damageExp: 12] - - [mob: ZOMBIFIED_PIGLIN, killExp: 85, hitExp: 15, damageExp: 12] - - [mob: PIG_ZOMBIE, killExp: 75, hitExp: 15, damageExp: 12] #1.15 zombie pigman (may not work) - - [mob: STRIDER, killExp: 80, hitExp: 15, damageExp: 12] + - [ mob: BAT, killExp: 15, hitExp: 15, damageExp: 12 ] + - [ mob: CAT, killExp: 25, hitExp: 15, damageExp: 12 ] + - [ mob: CHICKEN, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: COD, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: COW, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: DONKEY, killExp: 40, hitExp: 15, damageExp: 12 ] + - [ mob: FOX, killExp: 50, hitExp: 15, damageExp: 12 ] + - [ mob: HORSE, killExp: 40, hitExp: 15, damageExp: 12 ] + - [ mob: POLAR_BEAR, killExp: 75, hitExp: 15, damageExp: 12 ] + - [ mob: MUSHROOM_COW, killExp: 40, hitExp: 15, damageExp: 12 ] + - [ mob: MULE, killExp: 40, hitExp: 15, damageExp: 12 ] + - [ mob: OCELOT, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: PARROT, killExp: 25, hitExp: 15, damageExp: 12 ] + - [ mob: PIG, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: RABBIT, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: SALMON, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: SHEEP, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: SKELETON_HORSE, killExp: 75, hitExp: 15, damageExp: 12 ] + - [ mob: SNOWMAN, killExp: 10, hitExp: 15, damageExp: 12 ] + - [ mob: SQUID, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: TROPICAL_FISH, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: TURTLE, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: VILLAGER, killExp: 25, hitExp: 15, damageExp: 12 ] + - [ mob: WANDERING_TRADER, killExp: 500, hitExp: 15, damageExp: 12 ] + - [ mob: BEE, killExp: 55, hitExp: 15, damageExp: 12 ] + - [ mob: CAVE_SPIDER, killExp: 85, hitExp: 15, damageExp: 12 ] + - [ mob: DOLPHIN, killExp: 70, hitExp: 15, damageExp: 12 ] + - [ mob: ENDERMAN, killExp: 80, hitExp: 15, damageExp: 12 ] + - [ mob: IRON_GOLEM, killExp: 125, hitExp: 15, damageExp: 12 ] + - [ mob: LLAMA, killExp: 55, hitExp: 15, damageExp: 12 ] + - [ mob: PANDA, killExp: 55, hitExp: 15, damageExp: 12 ] + - [ mob: PUFFERFISH, killExp: 60, hitExp: 15, damageExp: 12 ] + - [ mob: SPIDER, killExp: 75, hitExp: 15, damageExp: 12 ] + - [ mob: WOLF, killExp: 75, hitExp: 15, damageExp: 12 ] + - [ mob: BLAZE, killExp: 85, hitExp: 15, damageExp: 12 ] + - [ mob: CREEPER, killExp: 85, hitExp: 15, damageExp: 12 ] + - [ mob: DROWNED, killExp: 90, hitExp: 15, damageExp: 12 ] + - [ mob: ELDER_GUARDIAN, killExp: 7500, hitExp: 15, damageExp: 12 ] + - [ mob: ENDERMITE, killExp: 60, hitExp: 15, damageExp: 12 ] + - [ mob: EVOKER, killExp: 80, hitExp: 15, damageExp: 12 ] + - [ mob: GHAST, killExp: 90, hitExp: 15, damageExp: 12 ] + - [ mob: GUARDIAN, killExp: 60, hitExp: 15, damageExp: 12 ] + - [ mob: HUSK, killExp: 75, hitExp: 15, damageExp: 12 ] + - [ mob: MAGMA_CUBE, killExp: 45, hitExp: 15, damageExp: 12 ] + - [ mob: PHANTOM, killExp: 70, hitExp: 15, damageExp: 12 ] + - [ mob: PILLAGER, killExp: 80, hitExp: 15, damageExp: 12 ] + - [ mob: RAVAGER, killExp: 100, hitExp: 15, damageExp: 12 ] + - [ mob: SHULKER, killExp: 85, hitExp: 15, damageExp: 12 ] + - [ mob: SILVERFISH, killExp: 90, hitExp: 15, damageExp: 12 ] + - [ mob: SKELETON, killExp: 80, hitExp: 15, damageExp: 12 ] + - [ mob: SLIME, killExp: 40, hitExp: 15, damageExp: 12 ] + - [ mob: STRAY, killExp: 75, hitExp: 15, damageExp: 12 ] + - [ mob: VEX, killExp: 90, hitExp: 15, damageExp: 12 ] + - [ mob: VINDICATOR, killExp: 85, hitExp: 15, damageExp: 12 ] + - [ mob: WITCH, killExp: 90, hitExp: 15, damageExp: 12 ] + - [ mob: WITHER_SKELETON, killExp: 95, hitExp: 15, damageExp: 12 ] + - [ mob: ZOMBIE, killExp: 75, hitExp: 15, damageExp: 12 ] + - [ mob: ZOMBIE_VILLAGER, killExp: 75, hitExp: 15, damageExp: 12 ] + - [ mob: ENDER_DRAGON, killExp: 20000, hitExp: 15, damageExp: 12 ] + - [ mob: WITHER, killExp: 12500, hitExp: 15, damageExp: 12 ] + - [ mob: ZOMBIE_HORSE, killExp: 75, hitExp: 15, damageExp: 12 ] + - [ mob: ILLUSIONER, killExp: 125, hitExp: 15, damageExp: 12 ] + - [ mob: GIANT, killExp: 125, hitExp: 15, damageExp: 12 ] + - [ mob: PIGLIN, killExp: 75, hitExp: 15, damageExp: 12 ] + - [ mob: ZOGLIN, killExp: 110, hitExp: 15, damageExp: 12 ] + - [ mob: HOGLIN, killExp: 100, hitExp: 15, damageExp: 12 ] + - [ mob: ZOMBIFIED_PIGLIN, killExp: 85, hitExp: 15, damageExp: 12 ] + - [ mob: PIG_ZOMBIE, killExp: 75, hitExp: 15, damageExp: 12 ] #1.15 zombie pigman (may not work) + - [ mob: STRIDER, killExp: 80, hitExp: 15, damageExp: 12 ] + # added since 1.16.5 + - [ mob: GLOW_SQUID, killExp: 30, hitExp: 15, damageExp: 12 ] + - [ mob: GOAT, killExp: 45, hitExp: 15, damageExp: 12 ] defense: maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier @@ -565,91 +616,94 @@ defense: # hitExp is the experience rewarded whenever the player takes damage from the damage cause, regardless of the damage done # damageExp is the experience rewarded for each point of damage done to the player by the damage source damageCause: - - [cause: BLOCK_EXPLOSION, takeHitExp: 15, takeDamageExp: 20] - - [cause: DRAGON_BREATH, takeHitExp: 15, takeDamageExp: 20] - - [cause: ENTITY_EXPLOSION, takeHitExp: 15, takeDamageExp: 20] - - [cause: ENTITY_SWEEP_ATTACK, takeHitExp: 15, takeDamageExp: 20] - - [cause: FALL, takeHitExp: 15, takeDamageExp: 20] - - [cause: FLY_INTO_WALL, takeHitExp: 15, takeDamageExp: 20] - - [cause: LAVA, takeHitExp: 15, takeDamageExp: 20] - - [cause: LIGHTNING, takeHitExp: 15, takeDamageExp: 20] - - [cause: MAGIC, takeHitExp: 15, takeDamageExp: 20] - - [cause: PROJECTILE, takeHitExp: 15, takeDamageExp: 20] - - [cause: THORNS, takeHitExp: 15, takeDamageExp: 20] + - [ cause: BLOCK_EXPLOSION, takeHitExp: 15, takeDamageExp: 20 ] + - [ cause: DRAGON_BREATH, takeHitExp: 15, takeDamageExp: 20 ] + - [ cause: ENTITY_EXPLOSION, takeHitExp: 15, takeDamageExp: 20 ] + - [ cause: ENTITY_SWEEP_ATTACK, takeHitExp: 15, takeDamageExp: 20 ] + - [ cause: FALL, takeHitExp: 15, takeDamageExp: 20 ] + - [ cause: FLY_INTO_WALL, takeHitExp: 15, takeDamageExp: 20 ] + - [ cause: LAVA, takeHitExp: 15, takeDamageExp: 20 ] + - [ cause: LIGHTNING, takeHitExp: 15, takeDamageExp: 20 ] + - [ cause: MAGIC, takeHitExp: 15, takeDamageExp: 20 ] + - [ cause: PROJECTILE, takeHitExp: 15, takeDamageExp: 20 ] + - [ cause: THORNS, takeHitExp: 15, takeDamageExp: 20 ] # - [cause: ENTITY_ATTACK, takeHitExp: 15, takeDamageExp: 20] This is covered by hitMobExp # Mobs that give experience for various actions. See comments at the top of the page for more information. mobs: - - [mob: BAT, killExp: 15, takeHitExp: 15, takeDamageExp: 20] - - [mob: CAT, killExp: 25, takeHitExp: 15, takeDamageExp: 20] - - [mob: CHICKEN, killExp: 30, takeHitExp: 15, takeDamageExp: 20] - - [mob: COD, killExp: 30, takeHitExp: 15, takeDamageExp: 20] - - [mob: COW, killExp: 30, takeHitExp: 15, takeDamageExp: 20] - - [mob: DONKEY, killExp: 40, takeHitExp: 15, takeDamageExp: 20] - - [mob: FOX, killExp: 50, takeHitExp: 15, takeDamageExp: 20] - - [mob: HORSE, killExp: 40, takeHitExp: 15, takeDamageExp: 20] - - [mob: POLAR_BEAR, killExp: 75, takeHitExp: 15, takeDamageExp: 20] - - [mob: MUSHROOM_COW, killExp: 40, takeHitExp: 15, takeDamageExp: 20] - - [mob: MULE, killExp: 40, takeHitExp: 15, takeDamageExp: 20] - - [mob: OCELOT, killExp: 30, takeHitExp: 15, takeDamageExp: 20] - - [mob: PARROT, killExp: 25, takeHitExp: 15, takeDamageExp: 20] - - [mob: PIG, killExp: 30, takeHitExp: 15, takeDamageExp: 20] - - [mob: RABBIT, killExp: 30, takeHitExp: 15, takeDamageExp: 20] - - [mob: SALMON, killExp: 30, takeHitExp: 15, takeDamageExp: 20] - - [mob: SHEEP, killExp: 30, takeHitExp: 15, takeDamageExp: 20] - - [mob: SKELETON_HORSE, killExp: 75, takeHitExp: 15, takeDamageExp: 20] - - [mob: SNOWMAN, killExp: 10, takeHitExp: 15, takeDamageExp: 20] - - [mob: SQUID, killExp: 30, takeHitExp: 15, takeDamageExp: 20] - - [mob: TROPICAL_FISH, killExp: 30, takeHitExp: 15, takeDamageExp: 20] - - [mob: TURTLE, killExp: 30, takeHitExp: 15, takeDamageExp: 20] - - [mob: VILLAGER, killExp: 25, takeHitExp: 15, takeDamageExp: 20] - - [mob: WANDERING_TRADER, killExp: 500, takeHitExp: 15, takeDamageExp: 20] - - [mob: BEE, killExp: 55, takeHitExp: 15, takeDamageExp: 20] - - [mob: CAVE_SPIDER, killExp: 85, takeHitExp: 15, takeDamageExp: 20] - - [mob: DOLPHIN, killExp: 70, takeHitExp: 15, takeDamageExp: 20] - - [mob: ENDERMAN, killExp: 80, takeHitExp: 15, takeDamageExp: 20] - - [mob: IRON_GOLEM, killExp: 125, takeHitExp: 15, takeDamageExp: 20] - - [mob: LLAMA, killExp: 55, takeHitExp: 15, takeDamageExp: 20] - - [mob: PANDA, killExp: 55, takeHitExp: 15, takeDamageExp: 20] - - [mob: PUFFERFISH, killExp: 60, takeHitExp: 15, takeDamageExp: 20] - - [mob: SPIDER, killExp: 75, takeHitExp: 15, takeDamageExp: 20] - - [mob: WOLF, killExp: 75, takeHitExp: 15, takeDamageExp: 20] - - [mob: BLAZE, killExp: 85, takeHitExp: 15, takeDamageExp: 20] - - [mob: CREEPER, killExp: 85, takeHitExp: 15, takeDamageExp: 20] - - [mob: DROWNED, killExp: 90, takeHitExp: 15, takeDamageExp: 20] - - [mob: ELDER_GUARDIAN, killExp: 7500, takeHitExp: 15, takeDamageExp: 20] - - [mob: ENDERMITE, killExp: 60, takeHitExp: 15, takeDamageExp: 20] - - [mob: EVOKER, killExp: 80, takeHitExp: 15, takeDamageExp: 20] - - [mob: GHAST, killExp: 90, takeHitExp: 15, takeDamageExp: 20] - - [mob: GUARDIAN, killExp: 60, takeHitExp: 15, takeDamageExp: 20] - - [mob: HUSK, killExp: 75, takeHitExp: 15, takeDamageExp: 20] - - [mob: MAGMA_CUBE, killExp: 45, takeHitExp: 15, takeDamageExp: 20] - - [mob: PHANTOM, killExp: 70, takeHitExp: 15, takeDamageExp: 20] - - [mob: PILLAGER, killExp: 80, takeHitExp: 15, takeDamageExp: 20] - - [mob: RAVAGER, killExp: 100, takeHitExp: 15, takeDamageExp: 20] - - [mob: SHULKER, killExp: 85, takeHitExp: 15, takeDamageExp: 20] - - [mob: SILVERFISH, killExp: 90, takeHitExp: 15, takeDamageExp: 20] - - [mob: SKELETON, killExp: 80, takeHitExp: 15, takeDamageExp: 20] - - [mob: SLIME, killExp: 40, takeHitExp: 15, takeDamageExp: 20] - - [mob: STRAY, killExp: 75, takeHitExp: 15, takeDamageExp: 20] - - [mob: VEX, killExp: 90, takeHitExp: 15, takeDamageExp: 20] - - [mob: VINDICATOR, killExp: 85, takeHitExp: 15, takeDamageExp: 20] - - [mob: WITCH, killExp: 90, takeHitExp: 15, takeDamageExp: 20] - - [mob: WITHER_SKELETON, killExp: 95, takeHitExp: 15, takeDamageExp: 20] - - [mob: ZOMBIE, killExp: 75, takeHitExp: 15, takeDamageExp: 20] - - [mob: ZOMBIE_VILLAGER, killExp: 75, takeHitExp: 15, takeDamageExp: 20] - - [mob: ENDER_DRAGON, killExp: 20000, takeHitExp: 15, takeDamageExp: 20] - - [mob: WITHER, killExp: 12500, takeHitExp: 15, takeDamageExp: 20] - - [mob: ZOMBIE_HORSE, killExp: 75, takeHitExp: 15, takeDamageExp: 20] - - [mob: ILLUSIONER, killExp: 125, takeHitExp: 15, takeDamageExp: 20] - - [mob: GIANT, killExp: 125, takeHitExp: 15, takeDamageExp: 20] - - [mob: PIGLIN, killExp: 75, takeHitExp: 15, takeDamageExp: 20] - - [mob: ZOGLIN, killExp: 110, takeHitExp: 15, takeDamageExp: 20] - - [mob: HOGLIN, killExp: 100, takeHitExp: 15, takeDamageExp: 20] - - [mob: ZOMBIFIED_PIGLIN, killExp: 85, takeHitExp: 15, takeDamageExp: 20] - - [mob: PIG_ZOMBIE, killExp: 75, takeHitExp: 15, takeDamageExp: 20] #1.15 zombie pigman (may not work) - - [mob: STRIDER, killExp: 80, takeHitExp: 15, takeDamageExp: 20] + - [ mob: BAT, killExp: 15, takeHitExp: 15, takeDamageExp: 20 ] # more exp? + - [ mob: CAT, killExp: 25, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: CHICKEN, killExp: 30, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: COD, killExp: 30, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: COW, killExp: 30, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: DONKEY, killExp: 40, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: FOX, killExp: 50, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: HORSE, killExp: 40, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: POLAR_BEAR, killExp: 75, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: MUSHROOM_COW, killExp: 40, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: MULE, killExp: 40, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: OCELOT, killExp: 30, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: PARROT, killExp: 25, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: PIG, killExp: 30, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: RABBIT, killExp: 30, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: SALMON, killExp: 30, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: SHEEP, killExp: 30, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: SKELETON_HORSE, killExp: 75, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: SNOWMAN, killExp: 10, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: SQUID, killExp: 30, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: TROPICAL_FISH, killExp: 30, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: TURTLE, killExp: 30, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: VILLAGER, killExp: 25, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: WANDERING_TRADER, killExp: 500, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: BEE, killExp: 55, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: CAVE_SPIDER, killExp: 85, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: DOLPHIN, killExp: 70, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: ENDERMAN, killExp: 80, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: IRON_GOLEM, killExp: 125, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: LLAMA, killExp: 55, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: PANDA, killExp: 55, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: PUFFERFISH, killExp: 60, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: SPIDER, killExp: 75, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: WOLF, killExp: 75, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: BLAZE, killExp: 85, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: CREEPER, killExp: 85, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: DROWNED, killExp: 90, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: ELDER_GUARDIAN, killExp: 7500, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: ENDERMITE, killExp: 60, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: EVOKER, killExp: 80, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: GHAST, killExp: 90, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: GUARDIAN, killExp: 60, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: HUSK, killExp: 75, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: MAGMA_CUBE, killExp: 45, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: PHANTOM, killExp: 70, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: PILLAGER, killExp: 80, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: RAVAGER, killExp: 100, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: SHULKER, killExp: 85, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: SILVERFISH, killExp: 90, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: SKELETON, killExp: 80, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: SLIME, killExp: 40, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: STRAY, killExp: 75, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: VEX, killExp: 90, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: VINDICATOR, killExp: 85, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: WITCH, killExp: 90, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: WITHER_SKELETON, killExp: 95, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: ZOMBIE, killExp: 75, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: ZOMBIE_VILLAGER, killExp: 75, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: ENDER_DRAGON, killExp: 20000, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: WITHER, killExp: 12500, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: ZOMBIE_HORSE, killExp: 75, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: ILLUSIONER, killExp: 125, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: GIANT, killExp: 125, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: PIGLIN, killExp: 75, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: ZOGLIN, killExp: 110, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: HOGLIN, killExp: 100, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: ZOMBIFIED_PIGLIN, killExp: 85, takeHitExp: 15, takeDamageExp: 20 ] + - [ mob: PIG_ZOMBIE, killExp: 75, takeHitExp: 15, takeDamageExp: 20 ] #1.15 zombie pigman (may not work) + - [ mob: STRIDER, killExp: 80, takeHitExp: 15, takeDamageExp: 20 ] + # added since 1.16.5 + - [ mob: GLOW_SQUID, killExp: 30, takeHitExp: 15, takeDamageExp: 12 ] + - [ mob: GOAT, killExp: 45, takeHitExp: 15, takeDamageExp: 12 ] axeMastery: maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier @@ -664,75 +718,78 @@ axeMastery: # Mobs that give experience for various actions. See comments at the top of the page for more information. mob: - - [mob: BAT, killExp: 15, hitExp: 20, damageExp: 14] - - [mob: CAT, killExp: 25, hitExp: 20, damageExp: 14] - - [mob: CHICKEN, killExp: 30, hitExp: 20, damageExp: 14] - - [mob: COD, killExp: 30, hitExp: 20, damageExp: 14] - - [mob: COW, killExp: 30, hitExp: 20, damageExp: 14] - - [mob: DONKEY, killExp: 40, hitExp: 20, damageExp: 14] - - [mob: FOX, killExp: 50, hitExp: 20, damageExp: 14] - - [mob: HORSE, killExp: 40, hitExp: 20, damageExp: 14] - - [mob: POLAR_BEAR, killExp: 75, hitExp: 20, damageExp: 14] - - [mob: MUSHROOM_COW, killExp: 40, hitExp: 20, damageExp: 14] - - [mob: MULE, killExp: 40, hitExp: 20, damageExp: 14] - - [mob: OCELOT, killExp: 30, hitExp: 20, damageExp: 14] - - [mob: PARROT, killExp: 25, hitExp: 20, damageExp: 14] - - [mob: PIG, killExp: 30, hitExp: 20, damageExp: 14] - - [mob: RABBIT, killExp: 30, hitExp: 20, damageExp: 14] - - [mob: SALMON, killExp: 30, hitExp: 20, damageExp: 14] - - [mob: SHEEP, killExp: 30, hitExp: 20, damageExp: 14] - - [mob: SKELETON_HORSE, killExp: 75, hitExp: 20, damageExp: 14] - - [mob: SNOWMAN, killExp: 10, hitExp: 20, damageExp: 14] - - [mob: SQUID, killExp: 30, hitExp: 20, damageExp: 14] - - [mob: TROPICAL_FISH, killExp: 30, hitExp: 20, damageExp: 14] - - [mob: TURTLE, killExp: 30, hitExp: 20, damageExp: 14] - - [mob: VILLAGER, killExp: 25, hitExp: 20, damageExp: 14] - - [mob: WANDERING_TRADER, killExp: 500, hitExp: 20, damageExp: 14] - - [mob: BEE, killExp: 55, hitExp: 20, damageExp: 14] - - [mob: CAVE_SPIDER, killExp: 85, hitExp: 20, damageExp: 14] - - [mob: DOLPHIN, killExp: 70, hitExp: 20, damageExp: 14] - - [mob: ENDERMAN, killExp: 80, hitExp: 20, damageExp: 14] - - [mob: IRON_GOLEM, killExp: 125, hitExp: 20, damageExp: 14] - - [mob: LLAMA, killExp: 55, hitExp: 20, damageExp: 14] - - [mob: PANDA, killExp: 55, hitExp: 20, damageExp: 14] - - [mob: PUFFERFISH, killExp: 60, hitExp: 20, damageExp: 14] - - [mob: SPIDER, killExp: 75, hitExp: 20, damageExp: 14] - - [mob: WOLF, killExp: 75, hitExp: 20, damageExp: 14] - - [mob: BLAZE, killExp: 85, hitExp: 20, damageExp: 14] - - [mob: CREEPER, killExp: 85, hitExp: 20, damageExp: 14] - - [mob: DROWNED, killExp: 90, hitExp: 20, damageExp: 14] - - [mob: ELDER_GUARDIAN, killExp: 7500, hitExp: 20, damageExp: 14] - - [mob: ENDERMITE, killExp: 60, hitExp: 20, damageExp: 14] - - [mob: EVOKER, killExp: 80, hitExp: 20, damageExp: 14] - - [mob: GHAST, killExp: 90, hitExp: 20, damageExp: 14] - - [mob: GUARDIAN, killExp: 60, hitExp: 20, damageExp: 14] - - [mob: HUSK, killExp: 75, hitExp: 20, damageExp: 14] - - [mob: MAGMA_CUBE, killExp: 45, hitExp: 20, damageExp: 14] - - [mob: PHANTOM, killExp: 70, hitExp: 20, damageExp: 14] - - [mob: PILLAGER, killExp: 80, hitExp: 20, damageExp: 14] - - [mob: RAVAGER, killExp: 100, hitExp: 20, damageExp: 14] - - [mob: SHULKER, killExp: 85, hitExp: 20, damageExp: 14] - - [mob: SILVERFISH, killExp: 90, hitExp: 20, damageExp: 14] - - [mob: SKELETON, killExp: 80, hitExp: 20, damageExp: 14] - - [mob: SLIME, killExp: 40, hitExp: 20, damageExp: 14] - - [mob: STRAY, killExp: 75, hitExp: 20, damageExp: 14] - - [mob: VEX, killExp: 90, hitExp: 20, damageExp: 14] - - [mob: VINDICATOR, killExp: 85, hitExp: 20, damageExp: 14] - - [mob: WITCH, killExp: 90, hitExp: 20, damageExp: 14] - - [mob: WITHER_SKELETON, killExp: 95, hitExp: 20, damageExp: 14] - - [mob: ZOMBIE, killExp: 75, hitExp: 20, damageExp: 14] - - [mob: ZOMBIE_VILLAGER, killExp: 75, hitExp: 20, damageExp: 14] - - [mob: ENDER_DRAGON, killExp: 20000, hitExp: 20, damageExp: 14] - - [mob: WITHER, killExp: 12500, hitExp: 20, damageExp: 14] - - [mob: ZOMBIE_HORSE, killExp: 75, hitExp: 20, damageExp: 14] - - [mob: ILLUSIONER, killExp: 125, hitExp: 20, damageExp: 14] - - [mob: GIANT, killExp: 125, hitExp: 20, damageExp: 14] - - [mob: PIGLIN, killExp: 75, hitExp: 20, damageExp: 14] - - [mob: ZOGLIN, killExp: 110, hitExp: 20, damageExp: 14] - - [mob: HOGLIN, killExp: 100, hitExp: 20, damageExp: 14] - - [mob: ZOMBIFIED_PIGLIN, killExp: 85, hitExp: 20, damageExp: 14] - - [mob: PIG_ZOMBIE, killExp: 75, hitExp: 20, damageExp: 14] #1.15 zombie pigman (may not work) - - [mob: STRIDER, killExp: 80, hitExp: 20, damageExp: 14] + - [ mob: BAT, killExp: 15, hitExp: 20, damageExp: 14 ] + - [ mob: CAT, killExp: 25, hitExp: 20, damageExp: 14 ] + - [ mob: CHICKEN, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: COD, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: COW, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: DONKEY, killExp: 40, hitExp: 20, damageExp: 14 ] + - [ mob: FOX, killExp: 50, hitExp: 20, damageExp: 14 ] + - [ mob: HORSE, killExp: 40, hitExp: 20, damageExp: 14 ] + - [ mob: POLAR_BEAR, killExp: 75, hitExp: 20, damageExp: 14 ] + - [ mob: MUSHROOM_COW, killExp: 40, hitExp: 20, damageExp: 14 ] + - [ mob: MULE, killExp: 40, hitExp: 20, damageExp: 14 ] + - [ mob: OCELOT, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: PARROT, killExp: 25, hitExp: 20, damageExp: 14 ] + - [ mob: PIG, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: RABBIT, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: SALMON, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: SHEEP, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: SKELETON_HORSE, killExp: 75, hitExp: 20, damageExp: 14 ] + - [ mob: SNOWMAN, killExp: 10, hitExp: 20, damageExp: 14 ] + - [ mob: SQUID, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: TROPICAL_FISH, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: TURTLE, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: VILLAGER, killExp: 25, hitExp: 20, damageExp: 14 ] + - [ mob: WANDERING_TRADER, killExp: 500, hitExp: 20, damageExp: 14 ] + - [ mob: BEE, killExp: 55, hitExp: 20, damageExp: 14 ] + - [ mob: CAVE_SPIDER, killExp: 85, hitExp: 20, damageExp: 14 ] + - [ mob: DOLPHIN, killExp: 70, hitExp: 20, damageExp: 14 ] + - [ mob: ENDERMAN, killExp: 80, hitExp: 20, damageExp: 14 ] + - [ mob: IRON_GOLEM, killExp: 125, hitExp: 20, damageExp: 14 ] + - [ mob: LLAMA, killExp: 55, hitExp: 20, damageExp: 14 ] + - [ mob: PANDA, killExp: 55, hitExp: 20, damageExp: 14 ] + - [ mob: PUFFERFISH, killExp: 60, hitExp: 20, damageExp: 14 ] + - [ mob: SPIDER, killExp: 75, hitExp: 20, damageExp: 14 ] + - [ mob: WOLF, killExp: 75, hitExp: 20, damageExp: 14 ] + - [ mob: BLAZE, killExp: 85, hitExp: 20, damageExp: 14 ] + - [ mob: CREEPER, killExp: 85, hitExp: 20, damageExp: 14 ] + - [ mob: DROWNED, killExp: 90, hitExp: 20, damageExp: 14 ] + - [ mob: ELDER_GUARDIAN, killExp: 7500, hitExp: 20, damageExp: 14 ] + - [ mob: ENDERMITE, killExp: 60, hitExp: 20, damageExp: 14 ] + - [ mob: EVOKER, killExp: 80, hitExp: 20, damageExp: 14 ] + - [ mob: GHAST, killExp: 90, hitExp: 20, damageExp: 14 ] + - [ mob: GUARDIAN, killExp: 60, hitExp: 20, damageExp: 14 ] + - [ mob: HUSK, killExp: 75, hitExp: 20, damageExp: 14 ] + - [ mob: MAGMA_CUBE, killExp: 45, hitExp: 20, damageExp: 14 ] + - [ mob: PHANTOM, killExp: 70, hitExp: 20, damageExp: 14 ] + - [ mob: PILLAGER, killExp: 80, hitExp: 20, damageExp: 14 ] + - [ mob: RAVAGER, killExp: 100, hitExp: 20, damageExp: 14 ] + - [ mob: SHULKER, killExp: 85, hitExp: 20, damageExp: 14 ] + - [ mob: SILVERFISH, killExp: 90, hitExp: 20, damageExp: 14 ] + - [ mob: SKELETON, killExp: 80, hitExp: 20, damageExp: 14 ] + - [ mob: SLIME, killExp: 40, hitExp: 20, damageExp: 14 ] + - [ mob: STRAY, killExp: 75, hitExp: 20, damageExp: 14 ] + - [ mob: VEX, killExp: 90, hitExp: 20, damageExp: 14 ] + - [ mob: VINDICATOR, killExp: 85, hitExp: 20, damageExp: 14 ] + - [ mob: WITCH, killExp: 90, hitExp: 20, damageExp: 14 ] + - [ mob: WITHER_SKELETON, killExp: 95, hitExp: 20, damageExp: 14 ] + - [ mob: ZOMBIE, killExp: 75, hitExp: 20, damageExp: 14 ] + - [ mob: ZOMBIE_VILLAGER, killExp: 75, hitExp: 20, damageExp: 14 ] + - [ mob: ENDER_DRAGON, killExp: 20000, hitExp: 20, damageExp: 14 ] + - [ mob: WITHER, killExp: 12500, hitExp: 20, damageExp: 14 ] + - [ mob: ZOMBIE_HORSE, killExp: 75, hitExp: 20, damageExp: 14 ] + - [ mob: ILLUSIONER, killExp: 125, hitExp: 20, damageExp: 14 ] + - [ mob: GIANT, killExp: 125, hitExp: 20, damageExp: 14 ] + - [ mob: PIGLIN, killExp: 75, hitExp: 20, damageExp: 14 ] + - [ mob: ZOGLIN, killExp: 110, hitExp: 20, damageExp: 14 ] + - [ mob: HOGLIN, killExp: 100, hitExp: 20, damageExp: 14 ] + - [ mob: ZOMBIFIED_PIGLIN, killExp: 85, hitExp: 20, damageExp: 14 ] + - [ mob: PIG_ZOMBIE, killExp: 75, hitExp: 20, damageExp: 14 ] #1.15 zombie pigman (may not work) + - [ mob: STRIDER, killExp: 80, hitExp: 20, damageExp: 14 ] + # added since 1.16.5 + - [ mob: GLOW_SQUID, killExp: 30, hitExp: 20, damageExp: 14 ] + - [ mob: GOAT, killExp: 45, hitExp: 20, damageExp: 14 ] repair: maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier @@ -755,93 +812,93 @@ alchemy: # Blocks broken that give experience. See comments at the top of the page for more information. blocks: - - [block: NETHER_WART, breakExp: 100, natural: true ] + - [ block: NETHER_WART, breakExp: 100, natural: true ] # Potions that will give experience when brewed # format: [{Potion Type], {brew exp}, {brew extended exp}, {brew upgraded exp}, {drink exp}, {drink extended exp}, {drink upgraded exp}, {throw exp}, {throw extended exp}, {throw upgraded exp}] # Potion Types can be found here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionType.html brewPotion: - - [potionType: WATER, brewExp: 0, brewExtendedExp: 0, brewUpgradedExp: 0, drinkExp: 0, drinkExtendedExp: 0, drinkUpgradedExp: 0, throwExp: 0, throwExtendedExp: 0, throwUpgradedExp: 0 ] - - [potionType: AWKWARD, brewExp: 250, brewExtendedExp: 0, brewUpgradedExp: 0, drinkExp: 0, drinkExtendedExp: 0, drinkUpgradedExp: 0, throwExp: 0, throwExtendedExp: 0, throwUpgradedExp: 0 ] - - [potionType: FIRE_RESISTANCE, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: INSTANT_DAMAGE, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: INSTANT_HEAL, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: INVISIBILITY, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: JUMP, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: LUCK, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: MUNDANE, brewExp: 200, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: NIGHT_VISION, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: POISON, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: REGEN, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: SLOW_FALLING, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: SLOWNESS, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: SPEED, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: STRENGTH, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: THICK, brewExp: 200, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: TURTLE_MASTER, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: WATER_BREATHING, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500] - - [potionType: WEAKNESS, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 -smelting: - maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit - expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier - exp: - # Smelted items that yield exp. - # Format: [{Smelting output name}, {exp reward}]] - # Item names can be found here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html - smelt: - - [output: COOKED_BEEF, smeltExp: 100] - - [output: COOKED_CHICKEN, smeltExp: 100] - - [output: COOKED_COD, smeltExp: 110] - - [output: COOKED_MUTTON, smeltExp: 100] - - [output: COOKED_PORKCHOP, smeltExp: 100] - - [output: COOKED_RABBIT, smeltExp: 100] - - [output: COOKED_SALMON, smeltExp: 110] - - [output: GREEN_DYE, smeltExp: 100] - - [output: LIME_DYE, smeltExp: 100] - - [output: DRIED_KELP, smeltExp: 60 ] - - [output: GLASS, smeltExp: 60 ] - - [output: BRICK, smeltExp: 60 ] - - [output: NETHER_BRICK, smeltExp: 60 ] - - [output: STONE, smeltExp: 85 ] - - [output: SMOOTH_STONE, smeltExp: 85 ] - - [output: SMOOTH_QUARTZ, smeltExp: 85 ] - - [output: TERRACOTTA, smeltExp: 85 ] - - [output: WHITE_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: ORANGE_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: MAGENTA_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: LIGHT_BLUE_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: YELLOW_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: LIME_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: PINK_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: GRAY_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: LIGHT_GRAY_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: CYAN_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: PURPLE_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: BLUE_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: BROWN_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: GREEN_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: RED_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: BLACK_GLAZED_TERRACOTTA, smeltExp: 90 ] - - [output: CHARCOAL, smeltExp: 85 ] - - [output: IRON_INGOT, smeltExp: 150] - - [output: GOLD_INGOT, smeltExp: 200] - - [output: DIAMOND, smeltExp: 450] - - [output: LAPIS_LAZULI, smeltExp: 320] - - [output: EMERALD, smeltExp: 500] - - [output: REDSTONE, smeltExp: 160] - - [output: QUARTZ, smeltExp: 100] - - [output: SPONGE, smeltExp: 140] - - [output: IRON_NUGGET, smeltExp: 230] - - [output: GOLD_NUGGET, smeltExp: 290] - - [output: NETHERITE_SCRAP, smeltExp: 350] - - [output: CRACKED_NETHER_BRICKS, smeltExp: 95 ] - - [output: CRACKED_STONE_BRICKS, smeltExp: 95 ] - - [output: CRACKED_POLISHED_BLACKSTONE_BRICKS, smeltExp: 95 ] -enchanting: - maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit - expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier - gainEXPfromEnchantingBottles: false #Disables gaining FreeRPG EXP from xp bottles and xp boost from xp bottles when set to false - exp: - spendLevelOnAnvil: 500 #Experience rewarded for each level used on an anvil - enchantItem: 250 #Experience rewarded for for each level of the "cost" of an enchantment, where the cost in the level on the right side of the encahntment offer, NOT the XP levels used. - gainMinecraftXP: 25 #FreeRPG experience given for each minecraft XP gained \ No newline at end of file + - [ potionType: WATER, brewExp: 0, brewExtendedExp: 0, brewUpgradedExp: 0, drinkExp: 0, drinkExtendedExp: 0, drinkUpgradedExp: 0, throwExp: 0, throwExtendedExp: 0, throwUpgradedExp: 0 ] + - [ potionType: AWKWARD, brewExp: 250, brewExtendedExp: 0, brewUpgradedExp: 0, drinkExp: 0, drinkExtendedExp: 0, drinkUpgradedExp: 0, throwExp: 0, throwExtendedExp: 0, throwUpgradedExp: 0 ] + - [ potionType: FIRE_RESISTANCE, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: INSTANT_DAMAGE, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: INSTANT_HEAL, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: INVISIBILITY, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: JUMP, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: LUCK, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: MUNDANE, brewExp: 200, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: NIGHT_VISION, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: POISON, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: REGEN, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: SLOW_FALLING, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: SLOWNESS, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: SPEED, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: STRENGTH, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: THICK, brewExp: 200, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: TURTLE_MASTER, brewExp: 550, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: WATER_BREATHING, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 ] + - [ potionType: WEAKNESS, brewExp: 500, brewExtendedExp: 300, brewUpgradedExp: 300, drinkExp: 1000, drinkExtendedExp: 1500, drinkUpgradedExp: 1500, throwExp: 1000, throwExtendedExp: 1500, throwUpgradedExp: 1500 + smelting: + maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit + expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier + exp: + # Smelted items that yield exp. + # Format: [{Smelting output name}, {exp reward}]] + # Item names can be found here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html + smelt: + - [ output: COOKED_BEEF, smeltExp: 100 ] + - [ output: COOKED_CHICKEN, smeltExp: 100 ] + - [ output: COOKED_COD, smeltExp: 110 ] + - [ output: COOKED_MUTTON, smeltExp: 100 ] + - [ output: COOKED_PORKCHOP, smeltExp: 100 ] + - [ output: COOKED_RABBIT, smeltExp: 100 ] + - [ output: COOKED_SALMON, smeltExp: 110 ] + - [ output: GREEN_DYE, smeltExp: 100 ] + - [ output: LIME_DYE, smeltExp: 100 ] + - [ output: DRIED_KELP, smeltExp: 60 ] + - [ output: GLASS, smeltExp: 60 ] + - [ output: BRICK, smeltExp: 60 ] + - [ output: NETHER_BRICK, smeltExp: 60 ] + - [ output: STONE, smeltExp: 85 ] + - [ output: SMOOTH_STONE, smeltExp: 85 ] + - [ output: SMOOTH_QUARTZ, smeltExp: 85 ] + - [ output: TERRACOTTA, smeltExp: 85 ] + - [ output: WHITE_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: ORANGE_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: MAGENTA_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: LIGHT_BLUE_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: YELLOW_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: LIME_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: PINK_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: GRAY_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: LIGHT_GRAY_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: CYAN_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: PURPLE_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: BLUE_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: BROWN_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: GREEN_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: RED_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: BLACK_GLAZED_TERRACOTTA, smeltExp: 90 ] + - [ output: CHARCOAL, smeltExp: 85 ] + - [ output: IRON_INGOT, smeltExp: 150 ] + - [ output: GOLD_INGOT, smeltExp: 200 ] + - [ output: DIAMOND, smeltExp: 450 ] + - [ output: LAPIS_LAZULI, smeltExp: 320 ] + - [ output: EMERALD, smeltExp: 500 ] + - [ output: REDSTONE, smeltExp: 160 ] + - [ output: QUARTZ, smeltExp: 100 ] + - [ output: SPONGE, smeltExp: 140 ] + - [ output: IRON_NUGGET, smeltExp: 230 ] + - [ output: GOLD_NUGGET, smeltExp: 290 ] + - [ output: NETHERITE_SCRAP, smeltExp: 350 ] + - [ output: CRACKED_NETHER_BRICKS, smeltExp: 95 ] + - [ output: CRACKED_STONE_BRICKS, smeltExp: 95 ] + - [ output: CRACKED_POLISHED_BLACKSTONE_BRICKS, smeltExp: 95 ] + enchanting: + maxLevel: -1 #The maximum level allowed for this skill, set to -1 for no limit + expMultiplier: 1.0 #Multiplier for all experience drops in this skill, STACKS with global.EXP_Multiplier + gainEXPfromEnchantingBottles: false #Disables gaining FreeRPG EXP from xp bottles and xp boost from xp bottles when set to false + exp: + spendLevelOnAnvil: 500 #Experience rewarded for each level used on an anvil + enchantItem: 250 #Experience rewarded for for each level of the "cost" of an enchantment, where the cost in the level on the right side of the encahntment offer, NOT the XP levels used. + gainMinecraftXP: 25 #FreeRPG experience given for each minecraft XP gained \ No newline at end of file diff --git a/src/main/resources/languages.yml b/src/main/resources/languages.yml index 3b4373c..10361b8 100644 --- a/src/main/resources/languages.yml +++ b/src/main/resources/languages.yml @@ -1,6859 +1,6859 @@ #If you want to edit this file, either make a new key, or edit the custom key # Changing any of the other keys will result in the plugin overwriting your work! - lang: - enUs: - languageName: English - englishLanguageName: American English - translationCredit: suppusmac - global: Global - digging: Digging - woodcutting: Woodcutting - mining: Mining - farming: Farming - fishing: Fishing - archery: Archery - beastMastery: Beast Mastery - swordsmanship: Swordsmanship - defense: Defense - axeMastery: Axe Mastery - repair: Repair - alchemy: Alchemy - agility: Agility - smelting: Smelting - enchanting: Enchanting - information: Information - configuration: Configuration - level: Level - experience: Experience - toNext: to next - total: Total - diggingPerkTitle0: Mo' drops - diggingPerkTitle1: Double Treasure - diggingPerkTitle2: Rarer Drops - diggingPerkTitle3: Soul Stealer - diggingPerkTitle4: Flint Finder - diggingPerkTitle5: Shovel Knight - diggingPerkTitle6: Mega Dig - diggingPerkDesc0: Expands treasure drop table by 1 item per level - diggingPerkDesc1: +5% chance of receiving double treasure drop per level (when - treasure is rolled) - diggingPerkDesc2: Further expands drop table by item per level - diggingPerkDesc3: Soul sand is +5% more likely to drop treasure per level - diggingPerkDesc4: Gravel has 100% flint drop rate (toggleable by /flintToggle) - diggingPerkDesc5: Shovels do double damage - diggingPerkDesc6: When using ability, you now break a 3x3 block section (20% of - normal treasure rate when active) - diggingPassiveTitle0: Passive Tokens - diggingPassiveTitle1: Back - diggingPassiveTitle2: Skill Tokens - diggingPassiveTitle3: Big Dig Duration - diggingPassiveTitle4: Treasure Chance - diggingPassiveDesc0: Tokens to invest in passive skills (dyes) - diggingPassiveDesc1: Takes you back to the main skills menu - diggingPassiveDesc2: Tokens to invest in skill tree - diggingPassiveDesc3: Increases duration of Big Dig by 0.02 s - diggingPassiveDesc4: Increases chance of digging up treasure by 0.005% - woodcuttingPerkTitle0: Zealous Roots - woodcuttingPerkTitle1: Fresh Arms - woodcuttingPerkTitle2: Hidden Knowledge - woodcuttingPerkTitle3: Leaf Scavenger - woodcuttingPerkTitle4: Timber+ - woodcuttingPerkTitle5: Leaf Blower - woodcuttingPerkTitle6: Able Axe - woodcuttingPerkDesc0: +20% chance for logs to drop 1 XP per level - woodcuttingPerkDesc1: +12 s per level of Haste I after first log broken in 5 minutes - woodcuttingPerkDesc2: Logs have a +0.2% chance per level to drop an enchanted - book - woodcuttingPerkDesc3: Leaves have a 1% chance to drop +1 treasure item per level - woodcuttingPerkDesc4: Timber break limit increased from 64 to 128 - woodcuttingPerkDesc5: Break a large section of leaves using an axe (toggleable with /leafBlowerToggle) - woodcuttingPerkDesc6: Double drops, Zealous Roots, and Hidden Knowledge all now - apply to timber (at half effectiveness) - woodcuttingPassiveTitle0: Passive Tokens - woodcuttingPassiveTitle1: Back - woodcuttingPassiveTitle2: Skill Tokens - woodcuttingPassiveTitle3: Timber Duration - woodcuttingPassiveTitle4: Double Drops - woodcuttingPassiveDesc0: Tokens to invest in passive skills (dyes) - woodcuttingPassiveDesc1: Takes you back to the main skills menu - woodcuttingPassiveDesc2: Tokens to invest in skill tree - woodcuttingPassiveDesc3: Increases duration of Timber by 0.02 s - woodcuttingPassiveDesc4: Increases chance to receive a double drop by 0.05% - miningPerkTitle0: Wasteless Haste - miningPerkTitle1: More Bombs - miningPerkTitle2: Treasure Seeker - miningPerkTitle3: Bomb-boyage - miningPerkTitle4: Vein Miner - miningPerkTitle5: Demolition Man - miningPerkTitle6: Triple Trouble - miningPerkDesc0: Gain haste after mining ores for each level - miningPerkDesc1: The crafting recipe for TNT produces +1 TNT block per level - miningPerkDesc2: When using ability on stones, +1% per level chance for an ore - to drop (extra exp is earned from dropped ores) - miningPerkDesc3: Increases TNT blast radius (when lit by flint and steel) each - level - miningPerkDesc4: Ore veins are instantly mined upon breaking one block (toggle-able) - miningPerkDesc5: No damage is taken from TNT explosions - miningPerkDesc6: Double drops are now triple drops - miningPassiveTitle0: Passive Tokens - miningPassiveTitle1: Back - miningPassiveTitle2: Skill Tokens - miningPassiveTitle3: Berserk Pick Duration - miningPassiveTitle4: Double Drops - miningPassiveTitle5: Blast Mining - miningPassiveDesc0: Tokens to invest in passive skills (dyes) - miningPassiveDesc1: Takes you back to the main skills menu - miningPassiveDesc2: Tokens to invest in skill tree - miningPassiveDesc3: Increases duration of Berserk Pick by 0.02s - miningPassiveDesc4: Increases chance to receive a double drop from ores by 0.05% - miningPassiveDesc5: Increases chances for ore to be created from TNT explosions - by 0.01% (More blocks broken = More treasure rolls) - farmingPerkTitle0: Better Fertilizer - farmingPerkTitle1: Animal Farm - farmingPerkTitle2: Farmer's Diet - farmingPerkTitle3: Carnivore - farmingPerkTitle4: Green Thumb - farmingPerkTitle5: Growth Hormones - farmingPerkTitle6: One with Nature - farmingPerkDesc0: +10% chance to not consume bonemeal on use - farmingPerkDesc1: Can craft an additional spawn egg per level - farmingPerkDesc2: Farm food is +20% more effective at restoring hunger and saturation - per level - farmingPerkDesc3: Meat is +20% more effective at restoring hunger and saturation - per level - farmingPerkDesc4: Ability may replant crops fully grown with higher chance of - replanting in later growth stages; ability now effects Melons and Pumpkins - farmingPerkDesc5: Sugar can be used on baby animals to make them grow instantly - farmingPerkDesc6: Gain Regeneration I when standing still on grass - farmingPassiveTitle0: Passive Tokens - farmingPassiveTitle1: Back - farmingPassiveTitle2: Skill Tokens - farmingPassiveTitle3: Natural Regeneration Duration - farmingPassiveTitle4: Double Drops (Crops) - farmingPassiveTitle5: Double Drops (Animals) - farmingPassiveDesc0: Tokens to invest in passive skills (dyes) - farmingPassiveDesc1: Takes you back to the main skills menu - farmingPassiveDesc2: Tokens to invest in skill tree - farmingPassiveDesc3: Increases duration of Natural Regeneration by 0.02s - farmingPassiveDesc4: Increases chance to receive a double drop from crops by 0.05% - farmingPassiveDesc5: Increases chance to receive a double drop from most passive - animals by 0.05% - fishingPerkTitle0: Rob - fishingPerkTitle1: Scavenger - fishingPerkTitle2: Fisherman's Diet - fishingPerkTitle3: Filtration - fishingPerkTitle4: Grappling Hook - fishingPerkTitle5: Hot Rod - fishingPerkTitle6: Fish Person - fishingPerkDesc0: +15% chance to pull item off a mob per level - fishingPerkDesc1: Unlocks new tier of fishing treasure - fishingPerkDesc2: Fish restore +20% hunger per level - fishingPerkDesc3: Higher tier (II-V) loot becomes more common, lower tier (I) - becomes less common - fishingPerkDesc4: Fishing rod now acts as a grappling hook (toggleable with /grappleToggle - ) - fishingPerkDesc5: Fish are now cooked when caught, some fishing treasures are - changed (toggleable with /hotRodToggle) - fishingPerkDesc6: Infinite night vision when underwater, infinite dolphin's grace - when in the water - fishingPassiveTitle0: Passive Tokens - fishingPassiveTitle1: Back - fishingPassiveTitle2: Skill Tokens - fishingPassiveTitle3: Super Bait Duration - fishingPassiveTitle4: Double catches - fishingPassiveTitle5: Treasure Finder - fishingPassiveDesc0: Tokens to invest in passive skills (dyes) - fishingPassiveDesc1: Takes you back to the main skills menu - fishingPassiveDesc2: Tokens to invest in skill tree - fishingPassiveDesc3: Increases duration of Super Bait by 0.01s - fishingPassiveDesc4: Increases chance to receive a double drop by 0.05% - fishingPassiveDesc5: Decreases chance of finding junk by 0.005%, increases chance - of finding treasure by 0.005% - archeryPerkTitle0: Extra Arrows - archeryPerkTitle1: Sniper - archeryPerkTitle2: Arrow of Light - archeryPerkTitle3: Explosive Arrows - archeryPerkTitle4: Dragon-less Arrows - archeryPerkTitle5: Crossbow Rapid Load - archeryPerkTitle6: Deadly Strike - archeryPerkDesc0: +1 arrow gained from crafting per level - archeryPerkDesc1: Arrow speed increases by +2% per level (~4% damage increase/level) - archeryPerkDesc2: Spectral arrows get a +5% damage boost per level - archeryPerkDesc3: Arrows have a +1% of creating an explosion on hit - archeryPerkDesc4: Allows crafting all tipped arrows with regular potions instead - of lingering potions - archeryPerkDesc5: Ability can now be used with crossbows, making all shots load - instantly - archeryPerkDesc6: Fireworks shot from crossbows do double damage (up to 16 hearts - of damage) - archeryPassiveTitle0: Passive Tokens - archeryPassiveTitle1: Back - archeryPassiveTitle2: Skill Tokens - archeryPassiveTitle3: Rapid Fire Duration - archeryPassiveTitle4: Retrieval - archeryPassiveDesc0: Tokens to invest in passive skills (dyes) - archeryPassiveDesc1: Takes you back to the main skills menu - archeryPassiveDesc2: Tokens to invest in skill tree - archeryPassiveDesc3: Increases duration of Rapid Fire by 0.02s - archeryPassiveDesc4: Increases chance for arrow shot to not consume arrow by 0.05% - per level - beastMasteryPerkTitle0: Thick Fur - beastMasteryPerkTitle1: Sharp Teeth - beastMasteryPerkTitle2: Healthy Bites - beastMasteryPerkTitle3: Keep Away - beastMasteryPerkTitle4: Acro-Dog - beastMasteryPerkTitle5: Identify - beastMasteryPerkTitle6: Adrenaline Boost - beastMasteryPerkDesc0: Dogs take -10% damage per level - beastMasteryPerkDesc1: Dogs do +10% more damage per level - beastMasteryPerkDesc2: Dogs heal +1/2 heart per level from killing - beastMasteryPerkDesc3: Dogs have gain +5% chance of knocking back foes - beastMasteryPerkDesc4: Dogs do not take fall damage - beastMasteryPerkDesc5: Using a compass on a horse or wolf now shows their stats - beastMasteryPerkDesc6: Spur kick buff is now speed III - beastMasteryPassiveTitle0: Passive Tokens - beastMasteryPassiveTitle1: Back - beastMasteryPassiveTitle2: Skill Tokens - beastMasteryPassiveTitle3: Spur Kick Duration - beastMasteryPassiveTitle4: Critical Bite - beastMasteryPassiveDesc0: Tokens to invest in passive skills (dyes) - beastMasteryPassiveDesc1: Takes you back to the main skills menu - beastMasteryPassiveDesc2: Tokens to invest in skill tree - beastMasteryPassiveDesc3: Increases duration of Spur Kick by 0.02s - beastMasteryPassiveDesc4: Increases chance for a dog to have a critical hit by - 0.025% - swordsmanshipPerkTitle0: Adrenaline - swordsmanshipPerkTitle1: Killing Spree - swordsmanshipPerkTitle2: Adrenaline+ - swordsmanshipPerkTitle3: Killing Frenzy - swordsmanshipPerkTitle4: Thirst for Blood - swordsmanshipPerkTitle5: Sharper! - swordsmanshipPerkTitle6: Sword Mastery - swordsmanshipPerkDesc0: Killing hostile mobs with a sword provides +2 s of speed - per level - swordsmanshipPerkDesc1: Killing hostile mobs with a sword provides +2 s of strength - per level - swordsmanshipPerkDesc2: +20% of speed I buff from Adrenaline is now speed II - swordsmanshipPerkDesc3: +20% of strength I buff from Killing Spree is now strength - II - swordsmanshipPerkDesc4: Killing certain aggressive mobs with a sword restores - hunger - swordsmanshipPerkDesc5: Swift strikes now adds a level of sharpness to your sword - swordsmanshipPerkDesc6: Swords permanently do +1 heart of damage - swordsmanshipPassiveTitle0: Passive Tokens - swordsmanshipPassiveTitle1: Back - swordsmanshipPassiveTitle2: Skill Tokens - swordsmanshipPassiveTitle3: Swift Strikes Duration - swordsmanshipPassiveTitle4: Double Hit - swordsmanshipPassiveDesc0: Tokens to invest in passive skills (dyes) - swordsmanshipPassiveDesc1: Takes you back to the main skills menu - swordsmanshipPassiveDesc2: Tokens to invest in skill tree - swordsmanshipPassiveDesc3: Increases duration of Swift Strikes by 0.02s - swordsmanshipPassiveDesc4: Increases chance to hit mob twice (second hit does - 50% damage) by 0.02% - defensePerkTitle0: Healer - defensePerkTitle1: Stiffen - defensePerkTitle2: Hard Headed - defensePerkTitle3: Stiffen+ - defensePerkTitle4: Gift From Above - defensePerkTitle5: Stronger Legs - defensePerkTitle6: Hearty - defensePerkDesc0: Gain +3s of regen per level on kill - defensePerkDesc1: +2% chance to gain resistance I for 5s when hit - defensePerkDesc2: Hard Body decreases damage by an additional 6.6% per level - defensePerkDesc3: +2% chance to gain resistance II for 5s when hit - defensePerkDesc4: Stone Solid now grants 4 absorption hearts for ability length - +1 minute - defensePerkDesc5: Stone Solid now gives slowness I instead of slowness IV - defensePerkDesc6: +2 hearts permanently - defensePassiveTitle0: Passive Tokens - defensePassiveTitle1: Back - defensePassiveTitle2: Skill Tokens - defensePassiveTitle3: Stone Solid Duration - defensePassiveTitle4: Hard Body - defensePassiveTitle5: Double Drops (Hostile Mobs) - defensePassiveDesc0: Tokens to invest in passive skills (dyes) - defensePassiveDesc1: Takes you back to the main skills menu - defensePassiveDesc2: Tokens to invest in skill tree - defensePassiveDesc3: Increases duration of Stone Solid by 0.02s - defensePassiveDesc4: Increases chance to take reduced (base -33%) damage by 0.01% - per level - defensePassiveDesc5: Increases chance to receive double drops from aggressive - mobs by 0.05% - axeMasteryPerkTitle0: Greater Axe - axeMasteryPerkTitle1: Holy Axe - axeMasteryPerkTitle2: Revitalized - axeMasteryPerkTitle3: Warrior Blood - axeMasteryPerkTitle4: Earthquake - axeMasteryPerkTitle5: Better Crits - axeMasteryPerkTitle6: Axe Man - axeMasteryPerkDesc0: Great Axe damage radius increases by 1 block per level - axeMasteryPerkDesc1: +2% chance for lighting to strike mobs on axe hit - axeMasteryPerkDesc2: +1% chance for full heal on kill per level - axeMasteryPerkDesc3: +3 s per level of Strength I on kills with an axe - axeMasteryPerkDesc4: Ability's AOE damage is doubled (25% -> 50% of damage) - axeMasteryPerkDesc5: Divine Crits now have 1.6x multiplier instead of 1.25x - axeMasteryPerkDesc6: Axes permanently do +1 heart of damage - axeMasteryPassiveTitle0: Passive Tokens - axeMasteryPassiveTitle1: Back - axeMasteryPassiveTitle2: Skill Tokens - axeMasteryPassiveTitle3: Great Axe Duration - axeMasteryPassiveTitle4: Divine Crits - axeMasteryPassiveDesc0: Tokens to invest in passive skills (dyes) - axeMasteryPassiveDesc1: Takes you back to the main skills menu - axeMasteryPassiveDesc2: Tokens to invest in skill tree - axeMasteryPassiveDesc3: Increases duration of Great Axe by 0.02s - axeMasteryPassiveDesc4: Increases random crit chance (base 1.25x damage) by 0.01% - repairPerkTitle0: Salvaging - repairPerkTitle1: Resourceful - repairPerkTitle2: Magic Repair Mastery - repairPerkDesc0: Get more materials on average from salvaging - repairPerkDesc1: +10% chance of keeping material used when repairing - repairPerkDesc2: Guarenteed to keep enchants on repair - repairPassiveTitle0: Back - repairPassiveTitle1: Skill Tokens - repairPassiveTitle2: Proficiency - repairPassiveDesc0: Takes you back to the main skills menu - repairPassiveDesc1: Tokens to invest in skill tree - repairPassiveDesc2: Materials restore more durability on repair - agilityPerkTitle0: Dodge - agilityPerkTitle1: Steel Bones - agilityPerkTitle2: Graceful Feet - agilityPerkDesc0: +4% chance to dodge attacks per level - agilityPerkDesc1: -10% fall damage per level - agilityPerkDesc2: Permanent speed I buff (toggleable by /speedToggle) - agilityPassiveTitle0: Back - agilityPassiveTitle1: Skill Tokens - agilityPassiveTitle2: Roll - agilityPassiveDesc0: Takes you back to the main skills menu - agilityPassiveDesc1: Tokens to invest in skill tree - agilityPassiveDesc2: Chance to roll and take reduced fall damage - alchemyPerkTitle0: Alchemical Summoning - alchemyPerkTitle1: Ancient Knowledge - alchemyPerkTitle2: Potion Master - alchemyPerkDesc0: Allows crafting of some potions without a brewing stand - alchemyPerkDesc1: Unlocks ability to brew new potions - alchemyPerkDesc2: All used potions are increased in level by 1 (toggleable with - /togglePotion) - alchemyPassiveTitle0: Back - alchemyPassiveTitle1: Skill Tokens - alchemyPassiveTitle2: Half-life+ - alchemyPassiveDesc0: Takes you back to the main skills menu - alchemyPassiveDesc1: Tokens to invest in skill tree - alchemyPassiveDesc2: Increase in duration of potions when used - smeltingPerkTitle0: Fuel Efficiency - smeltingPerkTitle1: Double Smelt - smeltingPerkTitle2: Flame Pickaxe - smeltingPerkDesc0: Fuel last +20% longer per level - smeltingPerkDesc1: +5% chance for smelted ore to be doubled per level - smeltingPerkDesc2: Mined ores are instantly smelted (toggleable with /toggleFlamePick) - smeltingPassiveTitle0: Back - smeltingPassiveTitle1: Skill Tokens - smeltingPassiveTitle2: Fuel Speed - smeltingPassiveDesc0: Takes you back to the main skills menu - smeltingPassiveDesc1: Tokens to invest in skill tree - smeltingPassiveDesc2: Increasing cooking speed - enchantingPerkTitle0: Efficient Enchanting - enchantingPerkTitle1: Booksmart - enchantingPerkTitle2: Immortal Experience - enchantingPerkDesc0: Levels needed to enchant -1 per level, anvil repair costs - -1 (minimum of 2) XP levels per level - enchantingPerkDesc1: Unlocks crafting recipes for some enchanted books - enchantingPerkDesc2: Keep xp on death - enchantingPassiveTitle0: Back - enchantingPassiveTitle1: Skill Tokens - enchantingPassiveTitle2: Quicker Development - enchantingPassiveDesc0: Takes you back to the main skills menu - enchantingPassiveDesc1: Tokens to invest in skill tree - enchantingPassiveDesc2: All xp received increased - globalPerkTitle0: Gatherer - globalPerkTitle1: Scholar - globalPerkTitle2: Fighter - globalPerkTitle3: Hard Work - globalPerkTitle4: Research - globalPerkTitle5: Training - globalPerkTitle6: Reincarnation+ - globalPerkTitle7: Soul Harvesting - globalPerkTitle8: Avatar - globalPerkTitle9: Master of the Arts - globalPerkDesc0: +20% exp gained in Digging, Woodcutting, Mining, Farming, and - Fishing - globalPerkDesc1: +20% exp gained in Repair, Agility, Brewing, Smelting, and Enchanting - globalPerkDesc2: +20% exp gained in Archery, Beast Mastery, Swordsmanship, Defense, - and Axe Mastery - globalPerkDesc3: +1 skill token in all Gatherer skills - globalPerkDesc4: +1 skill token in all Scholar skills - globalPerkDesc5: +1 skill token in all Fighter skills - globalPerkDesc6: On death, 50% chance to keep some of each valuable item in your - inventory - globalPerkDesc7: You now harvest souls from killing aggressive mobs, which can - be used to refund skill trees - globalPerkDesc8: 10% chance to take no damage and gain all in-game buffs for 10s - on a hit that would normally kill you - globalPerkDesc9: Ability cooldowns decreased by 33% - globalPassiveTitle0: Global Tokens - globalPassiveTitle1: Back - globalPassiveDesc0: Tokens to invest in skill tree - globalPassiveDesc1: Takes you back to the main skills menu - cannotRepair: You cannot repair while this ability is active! - cannotSalvage: You cannot salvage while this ability is active! - spite: Everything good is made of spite - refundSkill: are required to refund a skill tree - refundSkill2: in order to refund a skill tree - needToUnlock: You need to unlock - perkRequirement: You need at least 2 skill tokens invested in the previous perks to unlock this perk - perkRequirementM: You need at least 10 total skill tokens invested in the skill tree to unlock this mastery perk - noSkillTokens: You do not have any skill tokens - noPassiveTokens: You do not have any passive tokens - maxedOutPerk: You have already maxed out this perk! - requiredGlobalPerks0: You need the previous perk to unlock this perk - requiredGlobalPerks1: are required to unlock this perk - requiredGlobalPerks2: is required to unlock this perk - requiredGlobalPerks3: You need every global perk to unlock this perk - craftRequirement: is required to craft this recipe! - roll: ROLL - dodge: DODGE - prepare: You prepare your - rest: You rest your - activated: activated! - ended: has ended - readyToUse: is ready to use again - cooldown: cooldown - rapidFire: Rapid Fire - bow: bow - greatAxe: Great Axe - axe: axe - spurKick: Spur Kick - leg: leg - stoneSoldier: Stone Soldier - yourself: yourself - bigDig: Big Dig - shovel: shovel - naturalRegeneration: Natural Regeneration - hoe: hoe - superBait: Super Bait - fishingRod: fishing rod - berserkPick: Berserk Pick - pickaxe: pickaxe - swiftStrikes: Swift Strikes - sword: sword - timber: Timber - hyperHorse: This horse is already hyper! - magicForce: A magic force ends your ability - rob: Rob - repairFail0: You are not skilled enough to adequately repair this item - repairFail1: You failed to salavage any materials - repairFail2: You failed to retain the item's enchantment power - treeTooBig0: This tree is too big for you to chop in one go!" - treeTooBig1: This tree can never be chopped in one go like this... - noPermission: You do not have permission to use this command! - improperArguments: Improper Arguments, try - totalPlayTime: Total Play Time - clickForOptions: Click for options - unknownCommand: Unknown command - expToLevel: EXP to next level - playerName: playerName - skillName: skillName (in English) - page: page - on0: "ON" - off0: "OFF" - onOrOff: ON/OFF - manuallyToggles: Manually toggles - commandDesc0: Opens the main GUI with all skills - commandDesc1: Opens a skill tree GUI of choice - commandDesc2: Opens the configuration GUI - commandDesc3: Gives a player of choice EXP in a specified skill - commandDesc4: Sets a given player's level in a specified skill - commandDesc5: Resets a player's stats in a specified skill (does not refund stats) - commandDesc6: Displays a leaderboard for a specified stat - commandDesc7: Provides a link to a plugin information page - commandDesc8: Attempts to enchant an item in the users hand at a specified level - informationURL: Information URL (Google Docs) - click: CLICK - levelArgument: Level argument must be less than 40 - leaderboard: Leaderboard - playerOffline: That player is not online - onlyIncrease: Please only increase exp with this command, otherwise, use /frpg statReset then /frpg giveEXP - amount: amount - unlockToggle: To use this command you must unlock - levelUpNotif: Level Up Notifications - abilityPreparationNotif: Ability Preparation Notifications - yes0: "YES" - no0: "NO" - warning: WARNING - souls: souls - refundSkillTree0: Refunding a skill tree costs - refundSkillTree1: and is not reversible, are you sure you want to - refundSkillTree2: refund the - skill: skill - backToSkillTree: Takes you back to the skill tree - miningPerkDesc0_1: 2 seconds of Haste I after mining any ore - miningPerkDesc0_2: 5 seconds of Haste I after mining any ore - miningPerkDesc0_3: 10 seconds of Haste I after mining any ore - miningPerkDesc0_4: 5 seconds of Haste II after mining any ore, followed by 5 seconds of Haste I - miningPerkDesc0_5: 10 seconds of Haste II after mining any ore - woodcuttingPerkDesc3_1: Leaves may now drop a - common: common - uncommon: uncommon - rare: rare - veryRare: very rare - legendary: legendary - fishingPerkDesc1_1: Unlocks treasure tier - farmingPerkDesc1_1: Gain the ability to craft - cowSpawnEgg: cow spawn egg - beeSpawnEgg: bee spawn egg - mooshroomSpawnEgg: mooshroom spawn egg - horseSpawnEgg: horse spawn egg - slimeSpawnEgg: slime spawn egg - diggingPerkDesc0_1: You may now dig up a - defensePerkDesc0_1: Gain +3 s of regen per level on kills - defensePerkDesc0_2: Gain +0.5 hearts per level instantly on kills - duration: Duration - likelihood: Likelihood - junkChance: Junk Chance - locked: LOCKED - unlocked: UNLOCKED - cowEgg: Cow Egg - beeEgg: Bee Egg - mooshroomEgg: Mooshroom Egg - horseEgg: Horse Egg - slimeEgg: Slime Egg - tippedArrows: Tipped Arrows - toggle: Toggle - refundSkillTitle: Refund Skill - refundSkillTreeDesc: Click to refund this skill tree - enchantingPerkDesc1_0: Unlocks ability to craft - enchantingPerkDesc1_1: Power I and Efficiency I enchanted books (costs 1 level to craft) - enchantingPerkDesc1_2: Sharpness I and Protection I enchanted books (costs 1 level to craft) - enchantingPerkDesc1_3: Luck of the Sea I and Lure I enchanted books (costs 1 level to craft) - enchantingPerkDesc1_4: Depth Strider I and Frost Walker I enchanted books (costs 1 level to craft) - enchantingPerkDesc1_5: Mending (costs 10 levels to craft) and Fortune I (costs 2 levels to craft) enchanted books - repairPerkDesc0_1: Gain more materials from salvaging on average - repairPerkDesc0_2: Gain more materials from salvaging on average, salvaging now stores item enchants in a book - xpBoost: XP Boost - speedBoost: Speed Boost - timeExtension: Time Extension - enchantingCraft0: Power I Book - enchantingCraft1: Efficiency I Book - enchantingCraft2: Sharpness I Book - enchantingCraft3: Protection I Book - enchantingCraft4: Luck of the Sea I Book - enchantingCraft5: Lure I Book - enchantingCraft6: Frost Walker I Book - enchantingCraft7: Depth Strider I Book - enchantingCraft8: Mending Book - enchantingCraft9: Fortune I Book - commandDesc9: Sets the souls for a specified player - commandDesc10: Sets the skill or passive tokens in specified skill for a specified player - commandDesc11: Sets the global tokens for a specified player - commandDesc12: Saves stats of all players or a specified player - status: STATUS - complete: COMPLETE - incomplete: INCOMPLETE - try0: "try" - passiveImprove: Your passive perks improve every level! - increasedBy: increased by - expIncrease: EXP Multiplier - personalMultiplier: Personal Multiplier - translators: Translators - commandDesc13: Sets the personal multiplier for a specified player - abilityDescription: Ability Description - abilityDescription_digging: Temporarily adds 5 levels of effiency to your shovel. Activated by right-clicking a shovel then breaking a block. - abilityDescription_woodcutting: Temporarily makes axes break an entire tree with one block break. Activated by right-clicking an axe then breaking a log. - abilityDescription_mining: Temporarily adds 5 levels of effiency to your pickaxe. Activated by right-clicking a pickaxe then breaking block. - abilityDescription_farming: Temporarily makes crops broken with a hoe automatically replant. Activated by right-clicking a hoe then breaking a crop. - abilityDescription_fishing: Temporarily makes fishing rods instantly catch a fish. Activated by left-clicking a fishing rod then fishing in water. - abilityDescription_archery: Temporarily makes all arrows fired at max speed. Activated by left-clicking a bow then shooting an arrow. - abilityDescription_beastMastery: Temporarily gives your horse a speed buff. Activated by right-clicking while on a horse then left-clicking. - abilityDescription_swordsmanship: Temporarily removes swinging cooldown on swords. Activated by right-clicking a sword then hitting a mob. - abilityDescription_defense: Temporarily gives the user Resistance and Slowness effects. Activated by right-clicking with an empty hand then hitting a mob. - abilityDescription_axeMastery: Temporarily makes axes do damage to all mobs in a certain radius. Activated by right-clicking an axe then hitting a mob. - alchemyPerkDesc1_0: Unlocks ability to brew - alchemyPerkDesc0_0: A crafting table can be used to craft - triggerAbilities: Trigger Abilities - showEXPBar: Show EXP Bar - disabledSkill: This skill is disabled - skillConfigDesc: Takes you to configuration menu for this skill - lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" - exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" - potionAbsorption: Potion of Absorption - potionBadOmen: Potion of Bad Omen - potionBlindess: Potion of Blindess - potionConduitPower: Potion of Conduit Power - potionResistance: Potion of Resistance - potionDolphinsGrace: Potion of Dolphins Grace - potionHaste: Potion of Haste - potionFireResistance: Potion of Fire Resistance - potionGlowing: Potion of Glowing - potionHarm: Potion of Harm - potionHealing: Potion of Healing - potionHealthBoost: Potion of Health Boost - potiontheHero: Potion of the Hero - potionHunger: Potion of Hunger - potionStrength: Potion of Strength - potionInvsibility: Potion of Invsibility - potionJump: Potion of Jump - potionLuck: Potion of Luck - potionNightVision: Potion of Night Vision - potionRegeneration: Potion of Regeneration - potionSaturation: Potion of Saturation - potionSlowness: Potion of Slowness - potionFatigue: Potion of Fatigue - potionSlowFalling: Potion of Slow Falling - potionSpeed: Potion of Speed - potionBadLuck: Potion of Bad Luck - potionWaterBreathing: Potion of Water Breathing - potionWeakness: Potion of Weakness - potionDecay: Potion of Decay - potionAwkward: Awkward Potion - potionUncraftable: Uncraftable Potion - potionMundane: Mundane Potion - potionTurtleMaster: Potion of the Turtle Master - potionThick: Thick Potion - potionWater: Water Bottle - ingredient: Ingredient - usedToBrew: Is used to brew - costs: costs - xpLevel: Minecraft XP Level - xpLevels: Minecraft XP Levels - craftXPRequirement: This recipe requires at least - bedGUI: You cannot use this command while in bed! - statsUpdated: Your stats were changed to be consistent with a new EXP curve. - All skill trees and passive perks have been reset. All tokens must be re-invested. - timeRemaining: Time Remaining - numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed - commandDesc14: Resets the cooldown period for a skill to 0 seconds - commandDesc15: Looks up a player's FreeRPG stats - repairUnsafeEnchant: This item is too powerful to be repaired - salvageUnsafeEnchant: This item is too powerful to be salvaged - rank: Rank - stats: stats - outOf: out of - playerNotInLeaderboard: That player is not on any leaderboards - virtual: Virtual - commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) +lang: + enUs: + languageName: English + englishLanguageName: American English + translationCredit: suppusmac + global: Global + digging: Digging + woodcutting: Woodcutting + mining: Mining + farming: Farming + fishing: Fishing + archery: Archery + beastMastery: Beast Mastery + swordsmanship: Swordsmanship + defense: Defense + axeMastery: Axe Mastery + repair: Repair + alchemy: Alchemy + agility: Agility + smelting: Smelting + enchanting: Enchanting + information: Information + configuration: Configuration + level: Level + experience: Experience + toNext: to next + total: Total + diggingPerkTitle0: Mo' drops + diggingPerkTitle1: Double Treasure + diggingPerkTitle2: Rarer Drops + diggingPerkTitle3: Soul Stealer + diggingPerkTitle4: Flint Finder + diggingPerkTitle5: Shovel Knight + diggingPerkTitle6: Mega Dig + diggingPerkDesc0: Expands treasure drop table by 1 item per level + diggingPerkDesc1: +5% chance of receiving double treasure drop per level (when + treasure is rolled) + diggingPerkDesc2: Further expands drop table by item per level + diggingPerkDesc3: Soul sand is +5% more likely to drop treasure per level + diggingPerkDesc4: Gravel has 100% flint drop rate (toggleable by /flintToggle) + diggingPerkDesc5: Shovels do double damage + diggingPerkDesc6: When using ability, you now break a 3x3 block section (20% of + normal treasure rate when active) + diggingPassiveTitle0: Passive Tokens + diggingPassiveTitle1: Back + diggingPassiveTitle2: Skill Tokens + diggingPassiveTitle3: Big Dig Duration + diggingPassiveTitle4: Treasure Chance + diggingPassiveDesc0: Tokens to invest in passive skills (dyes) + diggingPassiveDesc1: Takes you back to the main skills menu + diggingPassiveDesc2: Tokens to invest in skill tree + diggingPassiveDesc3: Increases duration of Big Dig by 0.02 s + diggingPassiveDesc4: Increases chance of digging up treasure by 0.005% + woodcuttingPerkTitle0: Zealous Roots + woodcuttingPerkTitle1: Fresh Arms + woodcuttingPerkTitle2: Hidden Knowledge + woodcuttingPerkTitle3: Leaf Scavenger + woodcuttingPerkTitle4: Timber+ + woodcuttingPerkTitle5: Leaf Blower + woodcuttingPerkTitle6: Able Axe + woodcuttingPerkDesc0: +20% chance for logs to drop 1 XP per level + woodcuttingPerkDesc1: +12 s per level of Haste I after first log broken in 5 minutes + woodcuttingPerkDesc2: Logs have a +0.2% chance per level to drop an enchanted + book + woodcuttingPerkDesc3: Leaves have a 1% chance to drop +1 treasure item per level + woodcuttingPerkDesc4: Timber break limit increased from 64 to 128 + woodcuttingPerkDesc5: Break a large section of leaves using an axe (toggleable with /leafBlowerToggle) + woodcuttingPerkDesc6: Double drops, Zealous Roots, and Hidden Knowledge all now + apply to timber (at half effectiveness) + woodcuttingPassiveTitle0: Passive Tokens + woodcuttingPassiveTitle1: Back + woodcuttingPassiveTitle2: Skill Tokens + woodcuttingPassiveTitle3: Timber Duration + woodcuttingPassiveTitle4: Double Drops + woodcuttingPassiveDesc0: Tokens to invest in passive skills (dyes) + woodcuttingPassiveDesc1: Takes you back to the main skills menu + woodcuttingPassiveDesc2: Tokens to invest in skill tree + woodcuttingPassiveDesc3: Increases duration of Timber by 0.02 s + woodcuttingPassiveDesc4: Increases chance to receive a double drop by 0.05% + miningPerkTitle0: Wasteless Haste + miningPerkTitle1: More Bombs + miningPerkTitle2: Treasure Seeker + miningPerkTitle3: Bomb-boyage + miningPerkTitle4: Vein Miner + miningPerkTitle5: Demolition Man + miningPerkTitle6: Triple Trouble + miningPerkDesc0: Gain haste after mining ores for each level + miningPerkDesc1: The crafting recipe for TNT produces +1 TNT block per level + miningPerkDesc2: When using ability on stones, +1% per level chance for an ore + to drop (extra exp is earned from dropped ores) + miningPerkDesc3: Increases TNT blast radius (when lit by flint and steel) each + level + miningPerkDesc4: Ore veins are instantly mined upon breaking one block (toggle-able) + miningPerkDesc5: No damage is taken from TNT explosions + miningPerkDesc6: Double drops are now triple drops + miningPassiveTitle0: Passive Tokens + miningPassiveTitle1: Back + miningPassiveTitle2: Skill Tokens + miningPassiveTitle3: Berserk Pick Duration + miningPassiveTitle4: Double Drops + miningPassiveTitle5: Blast Mining + miningPassiveDesc0: Tokens to invest in passive skills (dyes) + miningPassiveDesc1: Takes you back to the main skills menu + miningPassiveDesc2: Tokens to invest in skill tree + miningPassiveDesc3: Increases duration of Berserk Pick by 0.02s + miningPassiveDesc4: Increases chance to receive a double drop from ores by 0.05% + miningPassiveDesc5: Increases chances for ore to be created from TNT explosions + by 0.01% (More blocks broken = More treasure rolls) + farmingPerkTitle0: Better Fertilizer + farmingPerkTitle1: Animal Farm + farmingPerkTitle2: Farmer's Diet + farmingPerkTitle3: Carnivore + farmingPerkTitle4: Green Thumb + farmingPerkTitle5: Growth Hormones + farmingPerkTitle6: One with Nature + farmingPerkDesc0: +10% chance to not consume bonemeal on use + farmingPerkDesc1: Can craft an additional spawn egg per level + farmingPerkDesc2: Farm food is +20% more effective at restoring hunger and saturation + per level + farmingPerkDesc3: Meat is +20% more effective at restoring hunger and saturation + per level + farmingPerkDesc4: Ability may replant crops fully grown with higher chance of + replanting in later growth stages; ability now effects Melons and Pumpkins + farmingPerkDesc5: Sugar can be used on baby animals to make them grow instantly + farmingPerkDesc6: Gain Regeneration I when standing still on grass + farmingPassiveTitle0: Passive Tokens + farmingPassiveTitle1: Back + farmingPassiveTitle2: Skill Tokens + farmingPassiveTitle3: Natural Regeneration Duration + farmingPassiveTitle4: Double Drops (Crops) + farmingPassiveTitle5: Double Drops (Animals) + farmingPassiveDesc0: Tokens to invest in passive skills (dyes) + farmingPassiveDesc1: Takes you back to the main skills menu + farmingPassiveDesc2: Tokens to invest in skill tree + farmingPassiveDesc3: Increases duration of Natural Regeneration by 0.02s + farmingPassiveDesc4: Increases chance to receive a double drop from crops by 0.05% + farmingPassiveDesc5: Increases chance to receive a double drop from most passive + animals by 0.05% + fishingPerkTitle0: Rob + fishingPerkTitle1: Scavenger + fishingPerkTitle2: Fisherman's Diet + fishingPerkTitle3: Filtration + fishingPerkTitle4: Grappling Hook + fishingPerkTitle5: Hot Rod + fishingPerkTitle6: Fish Person + fishingPerkDesc0: +15% chance to pull item off a mob per level + fishingPerkDesc1: Unlocks new tier of fishing treasure + fishingPerkDesc2: Fish restore +20% hunger per level + fishingPerkDesc3: Higher tier (II-V) loot becomes more common, lower tier (I) + becomes less common + fishingPerkDesc4: Fishing rod now acts as a grappling hook (toggleable with /grappleToggle + ) + fishingPerkDesc5: Fish are now cooked when caught, some fishing treasures are + changed (toggleable with /hotRodToggle) + fishingPerkDesc6: Infinite night vision when underwater, infinite dolphin's grace + when in the water + fishingPassiveTitle0: Passive Tokens + fishingPassiveTitle1: Back + fishingPassiveTitle2: Skill Tokens + fishingPassiveTitle3: Super Bait Duration + fishingPassiveTitle4: Double catches + fishingPassiveTitle5: Treasure Finder + fishingPassiveDesc0: Tokens to invest in passive skills (dyes) + fishingPassiveDesc1: Takes you back to the main skills menu + fishingPassiveDesc2: Tokens to invest in skill tree + fishingPassiveDesc3: Increases duration of Super Bait by 0.01s + fishingPassiveDesc4: Increases chance to receive a double drop by 0.05% + fishingPassiveDesc5: Decreases chance of finding junk by 0.005%, increases chance + of finding treasure by 0.005% + archeryPerkTitle0: Extra Arrows + archeryPerkTitle1: Sniper + archeryPerkTitle2: Arrow of Light + archeryPerkTitle3: Explosive Arrows + archeryPerkTitle4: Dragon-less Arrows + archeryPerkTitle5: Crossbow Rapid Load + archeryPerkTitle6: Deadly Strike + archeryPerkDesc0: +1 arrow gained from crafting per level + archeryPerkDesc1: Arrow speed increases by +2% per level (~4% damage increase/level) + archeryPerkDesc2: Spectral arrows get a +5% damage boost per level + archeryPerkDesc3: Arrows have a +1% of creating an explosion on hit + archeryPerkDesc4: Allows crafting all tipped arrows with regular potions instead + of lingering potions + archeryPerkDesc5: Ability can now be used with crossbows, making all shots load + instantly + archeryPerkDesc6: Fireworks shot from crossbows do double damage (up to 16 hearts + of damage) + archeryPassiveTitle0: Passive Tokens + archeryPassiveTitle1: Back + archeryPassiveTitle2: Skill Tokens + archeryPassiveTitle3: Rapid Fire Duration + archeryPassiveTitle4: Retrieval + archeryPassiveDesc0: Tokens to invest in passive skills (dyes) + archeryPassiveDesc1: Takes you back to the main skills menu + archeryPassiveDesc2: Tokens to invest in skill tree + archeryPassiveDesc3: Increases duration of Rapid Fire by 0.02s + archeryPassiveDesc4: Increases chance for arrow shot to not consume arrow by 0.05% + per level + beastMasteryPerkTitle0: Thick Fur + beastMasteryPerkTitle1: Sharp Teeth + beastMasteryPerkTitle2: Healthy Bites + beastMasteryPerkTitle3: Keep Away + beastMasteryPerkTitle4: Acro-Dog + beastMasteryPerkTitle5: Identify + beastMasteryPerkTitle6: Adrenaline Boost + beastMasteryPerkDesc0: Dogs take -10% damage per level + beastMasteryPerkDesc1: Dogs do +10% more damage per level + beastMasteryPerkDesc2: Dogs heal +1/2 heart per level from killing + beastMasteryPerkDesc3: Dogs have gain +5% chance of knocking back foes + beastMasteryPerkDesc4: Dogs do not take fall damage + beastMasteryPerkDesc5: Using a compass on a horse or wolf now shows their stats + beastMasteryPerkDesc6: Spur kick buff is now speed III + beastMasteryPassiveTitle0: Passive Tokens + beastMasteryPassiveTitle1: Back + beastMasteryPassiveTitle2: Skill Tokens + beastMasteryPassiveTitle3: Spur Kick Duration + beastMasteryPassiveTitle4: Critical Bite + beastMasteryPassiveDesc0: Tokens to invest in passive skills (dyes) + beastMasteryPassiveDesc1: Takes you back to the main skills menu + beastMasteryPassiveDesc2: Tokens to invest in skill tree + beastMasteryPassiveDesc3: Increases duration of Spur Kick by 0.02s + beastMasteryPassiveDesc4: Increases chance for a dog to have a critical hit by + 0.025% + swordsmanshipPerkTitle0: Adrenaline + swordsmanshipPerkTitle1: Killing Spree + swordsmanshipPerkTitle2: Adrenaline+ + swordsmanshipPerkTitle3: Killing Frenzy + swordsmanshipPerkTitle4: Thirst for Blood + swordsmanshipPerkTitle5: Sharper! + swordsmanshipPerkTitle6: Sword Mastery + swordsmanshipPerkDesc0: Killing hostile mobs with a sword provides +2 s of speed + per level + swordsmanshipPerkDesc1: Killing hostile mobs with a sword provides +2 s of strength + per level + swordsmanshipPerkDesc2: +20% of speed I buff from Adrenaline is now speed II + swordsmanshipPerkDesc3: +20% of strength I buff from Killing Spree is now strength + II + swordsmanshipPerkDesc4: Killing certain aggressive mobs with a sword restores + hunger + swordsmanshipPerkDesc5: Swift strikes now adds a level of sharpness to your sword + swordsmanshipPerkDesc6: Swords permanently do +1 heart of damage + swordsmanshipPassiveTitle0: Passive Tokens + swordsmanshipPassiveTitle1: Back + swordsmanshipPassiveTitle2: Skill Tokens + swordsmanshipPassiveTitle3: Swift Strikes Duration + swordsmanshipPassiveTitle4: Double Hit + swordsmanshipPassiveDesc0: Tokens to invest in passive skills (dyes) + swordsmanshipPassiveDesc1: Takes you back to the main skills menu + swordsmanshipPassiveDesc2: Tokens to invest in skill tree + swordsmanshipPassiveDesc3: Increases duration of Swift Strikes by 0.02s + swordsmanshipPassiveDesc4: Increases chance to hit mob twice (second hit does + 50% damage) by 0.02% + defensePerkTitle0: Healer + defensePerkTitle1: Stiffen + defensePerkTitle2: Hard Headed + defensePerkTitle3: Stiffen+ + defensePerkTitle4: Gift From Above + defensePerkTitle5: Stronger Legs + defensePerkTitle6: Hearty + defensePerkDesc0: Gain +3s of regen per level on kill + defensePerkDesc1: +2% chance to gain resistance I for 5s when hit + defensePerkDesc2: Hard Body decreases damage by an additional 6.6% per level + defensePerkDesc3: +2% chance to gain resistance II for 5s when hit + defensePerkDesc4: Stone Solid now grants 4 absorption hearts for ability length + +1 minute + defensePerkDesc5: Stone Solid now gives slowness I instead of slowness IV + defensePerkDesc6: +2 hearts permanently + defensePassiveTitle0: Passive Tokens + defensePassiveTitle1: Back + defensePassiveTitle2: Skill Tokens + defensePassiveTitle3: Stone Solid Duration + defensePassiveTitle4: Hard Body + defensePassiveTitle5: Double Drops (Hostile Mobs) + defensePassiveDesc0: Tokens to invest in passive skills (dyes) + defensePassiveDesc1: Takes you back to the main skills menu + defensePassiveDesc2: Tokens to invest in skill tree + defensePassiveDesc3: Increases duration of Stone Solid by 0.02s + defensePassiveDesc4: Increases chance to take reduced (base -33%) damage by 0.01% + per level + defensePassiveDesc5: Increases chance to receive double drops from aggressive + mobs by 0.05% + axeMasteryPerkTitle0: Greater Axe + axeMasteryPerkTitle1: Holy Axe + axeMasteryPerkTitle2: Revitalized + axeMasteryPerkTitle3: Warrior Blood + axeMasteryPerkTitle4: Earthquake + axeMasteryPerkTitle5: Better Crits + axeMasteryPerkTitle6: Axe Man + axeMasteryPerkDesc0: Great Axe damage radius increases by 1 block per level + axeMasteryPerkDesc1: +2% chance for lighting to strike mobs on axe hit + axeMasteryPerkDesc2: +1% chance for full heal on kill per level + axeMasteryPerkDesc3: +3 s per level of Strength I on kills with an axe + axeMasteryPerkDesc4: Ability's AOE damage is doubled (25% -> 50% of damage) + axeMasteryPerkDesc5: Divine Crits now have 1.6x multiplier instead of 1.25x + axeMasteryPerkDesc6: Axes permanently do +1 heart of damage + axeMasteryPassiveTitle0: Passive Tokens + axeMasteryPassiveTitle1: Back + axeMasteryPassiveTitle2: Skill Tokens + axeMasteryPassiveTitle3: Great Axe Duration + axeMasteryPassiveTitle4: Divine Crits + axeMasteryPassiveDesc0: Tokens to invest in passive skills (dyes) + axeMasteryPassiveDesc1: Takes you back to the main skills menu + axeMasteryPassiveDesc2: Tokens to invest in skill tree + axeMasteryPassiveDesc3: Increases duration of Great Axe by 0.02s + axeMasteryPassiveDesc4: Increases random crit chance (base 1.25x damage) by 0.01% + repairPerkTitle0: Salvaging + repairPerkTitle1: Resourceful + repairPerkTitle2: Magic Repair Mastery + repairPerkDesc0: Get more materials on average from salvaging + repairPerkDesc1: +10% chance of keeping material used when repairing + repairPerkDesc2: Guarenteed to keep enchants on repair + repairPassiveTitle0: Back + repairPassiveTitle1: Skill Tokens + repairPassiveTitle2: Proficiency + repairPassiveDesc0: Takes you back to the main skills menu + repairPassiveDesc1: Tokens to invest in skill tree + repairPassiveDesc2: Materials restore more durability on repair + agilityPerkTitle0: Dodge + agilityPerkTitle1: Steel Bones + agilityPerkTitle2: Graceful Feet + agilityPerkDesc0: +4% chance to dodge attacks per level + agilityPerkDesc1: -10% fall damage per level + agilityPerkDesc2: Permanent speed I buff (toggleable by /speedToggle) + agilityPassiveTitle0: Back + agilityPassiveTitle1: Skill Tokens + agilityPassiveTitle2: Roll + agilityPassiveDesc0: Takes you back to the main skills menu + agilityPassiveDesc1: Tokens to invest in skill tree + agilityPassiveDesc2: Chance to roll and take reduced fall damage + alchemyPerkTitle0: Alchemical Summoning + alchemyPerkTitle1: Ancient Knowledge + alchemyPerkTitle2: Potion Master + alchemyPerkDesc0: Allows crafting of some potions without a brewing stand + alchemyPerkDesc1: Unlocks ability to brew new potions + alchemyPerkDesc2: All used potions are increased in level by 1 (toggleable with + /togglePotion) + alchemyPassiveTitle0: Back + alchemyPassiveTitle1: Skill Tokens + alchemyPassiveTitle2: Half-life+ + alchemyPassiveDesc0: Takes you back to the main skills menu + alchemyPassiveDesc1: Tokens to invest in skill tree + alchemyPassiveDesc2: Increase in duration of potions when used + smeltingPerkTitle0: Fuel Efficiency + smeltingPerkTitle1: Double Smelt + smeltingPerkTitle2: Flame Pickaxe + smeltingPerkDesc0: Fuel last +20% longer per level + smeltingPerkDesc1: +5% chance for smelted ore to be doubled per level + smeltingPerkDesc2: Mined ores are instantly smelted (toggleable with /toggleFlamePick) + smeltingPassiveTitle0: Back + smeltingPassiveTitle1: Skill Tokens + smeltingPassiveTitle2: Fuel Speed + smeltingPassiveDesc0: Takes you back to the main skills menu + smeltingPassiveDesc1: Tokens to invest in skill tree + smeltingPassiveDesc2: Increasing cooking speed + enchantingPerkTitle0: Efficient Enchanting + enchantingPerkTitle1: Booksmart + enchantingPerkTitle2: Immortal Experience + enchantingPerkDesc0: Levels needed to enchant -1 per level, anvil repair costs + -1 (minimum of 2) XP levels per level + enchantingPerkDesc1: Unlocks crafting recipes for some enchanted books + enchantingPerkDesc2: Keep xp on death + enchantingPassiveTitle0: Back + enchantingPassiveTitle1: Skill Tokens + enchantingPassiveTitle2: Quicker Development + enchantingPassiveDesc0: Takes you back to the main skills menu + enchantingPassiveDesc1: Tokens to invest in skill tree + enchantingPassiveDesc2: All xp received increased + globalPerkTitle0: Gatherer + globalPerkTitle1: Scholar + globalPerkTitle2: Fighter + globalPerkTitle3: Hard Work + globalPerkTitle4: Research + globalPerkTitle5: Training + globalPerkTitle6: Reincarnation+ + globalPerkTitle7: Soul Harvesting + globalPerkTitle8: Avatar + globalPerkTitle9: Master of the Arts + globalPerkDesc0: +20% exp gained in Digging, Woodcutting, Mining, Farming, and + Fishing + globalPerkDesc1: +20% exp gained in Repair, Agility, Brewing, Smelting, and Enchanting + globalPerkDesc2: +20% exp gained in Archery, Beast Mastery, Swordsmanship, Defense, + and Axe Mastery + globalPerkDesc3: +1 skill token in all Gatherer skills + globalPerkDesc4: +1 skill token in all Scholar skills + globalPerkDesc5: +1 skill token in all Fighter skills + globalPerkDesc6: On death, 50% chance to keep some of each valuable item in your + inventory + globalPerkDesc7: You now harvest souls from killing aggressive mobs, which can + be used to refund skill trees + globalPerkDesc8: 10% chance to take no damage and gain all in-game buffs for 10s + on a hit that would normally kill you + globalPerkDesc9: Ability cooldowns decreased by 33% + globalPassiveTitle0: Global Tokens + globalPassiveTitle1: Back + globalPassiveDesc0: Tokens to invest in skill tree + globalPassiveDesc1: Takes you back to the main skills menu + cannotRepair: You cannot repair while this ability is active! + cannotSalvage: You cannot salvage while this ability is active! + spite: Everything good is made of spite + refundSkill: are required to refund a skill tree + refundSkill2: in order to refund a skill tree + needToUnlock: You need to unlock + perkRequirement: You need at least 2 skill tokens invested in the previous perks to unlock this perk + perkRequirementM: You need at least 10 total skill tokens invested in the skill tree to unlock this mastery perk + noSkillTokens: You do not have any skill tokens + noPassiveTokens: You do not have any passive tokens + maxedOutPerk: You have already maxed out this perk! + requiredGlobalPerks0: You need the previous perk to unlock this perk + requiredGlobalPerks1: are required to unlock this perk + requiredGlobalPerks2: is required to unlock this perk + requiredGlobalPerks3: You need every global perk to unlock this perk + craftRequirement: is required to craft this recipe! + roll: ROLL + dodge: DODGE + prepare: You prepare your + rest: You rest your + activated: activated! + ended: has ended + readyToUse: is ready to use again + cooldown: cooldown + rapidFire: Rapid Fire + bow: bow + greatAxe: Great Axe + axe: axe + spurKick: Spur Kick + leg: leg + stoneSoldier: Stone Soldier + yourself: yourself + bigDig: Big Dig + shovel: shovel + naturalRegeneration: Natural Regeneration + hoe: hoe + superBait: Super Bait + fishingRod: fishing rod + berserkPick: Berserk Pick + pickaxe: pickaxe + swiftStrikes: Swift Strikes + sword: sword + timber: Timber + hyperHorse: This horse is already hyper! + magicForce: A magic force ends your ability + rob: Rob + repairFail0: You are not skilled enough to adequately repair this item + repairFail1: You failed to salavage any materials + repairFail2: You failed to retain the item's enchantment power + treeTooBig0: This tree is too big for you to chop in one go!" + treeTooBig1: This tree can never be chopped in one go like this... + noPermission: You do not have permission to use this command! + improperArguments: Improper Arguments, try + totalPlayTime: Total Play Time + clickForOptions: Click for options + unknownCommand: Unknown command + expToLevel: EXP to next level + playerName: playerName + skillName: skillName (in English) + page: page + on0: "ON" + off0: "OFF" + onOrOff: ON/OFF + manuallyToggles: Manually toggles + commandDesc0: Opens the main GUI with all skills + commandDesc1: Opens a skill tree GUI of choice + commandDesc2: Opens the configuration GUI + commandDesc3: Gives a player of choice EXP in a specified skill + commandDesc4: Sets a given player's level in a specified skill + commandDesc5: Resets a player's stats in a specified skill (does not refund stats) + commandDesc6: Displays a leaderboard for a specified stat + commandDesc7: Provides a link to a plugin information page + commandDesc8: Attempts to enchant an item in the users hand at a specified level + informationURL: Information URL (Google Docs) + click: CLICK + levelArgument: Level argument must be less than 40 + leaderboard: Leaderboard + playerOffline: That player is not online + onlyIncrease: Please only increase exp with this command, otherwise, use /frpg statReset then /frpg giveEXP + amount: amount + unlockToggle: To use this command you must unlock + levelUpNotif: Level Up Notifications + abilityPreparationNotif: Ability Preparation Notifications + yes0: "YES" + no0: "NO" + warning: WARNING + souls: souls + refundSkillTree0: Refunding a skill tree costs + refundSkillTree1: and is not reversible, are you sure you want to + refundSkillTree2: refund the + skill: skill + backToSkillTree: Takes you back to the skill tree + miningPerkDesc0_1: 2 seconds of Haste I after mining any ore + miningPerkDesc0_2: 5 seconds of Haste I after mining any ore + miningPerkDesc0_3: 10 seconds of Haste I after mining any ore + miningPerkDesc0_4: 5 seconds of Haste II after mining any ore, followed by 5 seconds of Haste I + miningPerkDesc0_5: 10 seconds of Haste II after mining any ore + woodcuttingPerkDesc3_1: Leaves may now drop a + common: common + uncommon: uncommon + rare: rare + veryRare: very rare + legendary: legendary + fishingPerkDesc1_1: Unlocks treasure tier + farmingPerkDesc1_1: Gain the ability to craft + cowSpawnEgg: cow spawn egg + beeSpawnEgg: bee spawn egg + mooshroomSpawnEgg: mooshroom spawn egg + horseSpawnEgg: horse spawn egg + slimeSpawnEgg: slime spawn egg + diggingPerkDesc0_1: You may now dig up a + defensePerkDesc0_1: Gain +3 s of regen per level on kills + defensePerkDesc0_2: Gain +0.5 hearts per level instantly on kills + duration: Duration + likelihood: Likelihood + junkChance: Junk Chance + locked: LOCKED + unlocked: UNLOCKED + cowEgg: Cow Egg + beeEgg: Bee Egg + mooshroomEgg: Mooshroom Egg + horseEgg: Horse Egg + slimeEgg: Slime Egg + tippedArrows: Tipped Arrows + toggle: Toggle + refundSkillTitle: Refund Skill + refundSkillTreeDesc: Click to refund this skill tree + enchantingPerkDesc1_0: Unlocks ability to craft + enchantingPerkDesc1_1: Power I and Efficiency I enchanted books (costs 1 level to craft) + enchantingPerkDesc1_2: Sharpness I and Protection I enchanted books (costs 1 level to craft) + enchantingPerkDesc1_3: Luck of the Sea I and Lure I enchanted books (costs 1 level to craft) + enchantingPerkDesc1_4: Depth Strider I and Frost Walker I enchanted books (costs 1 level to craft) + enchantingPerkDesc1_5: Mending (costs 10 levels to craft) and Fortune I (costs 2 levels to craft) enchanted books + repairPerkDesc0_1: Gain more materials from salvaging on average + repairPerkDesc0_2: Gain more materials from salvaging on average, salvaging now stores item enchants in a book + xpBoost: XP Boost + speedBoost: Speed Boost + timeExtension: Time Extension + enchantingCraft0: Power I Book + enchantingCraft1: Efficiency I Book + enchantingCraft2: Sharpness I Book + enchantingCraft3: Protection I Book + enchantingCraft4: Luck of the Sea I Book + enchantingCraft5: Lure I Book + enchantingCraft6: Frost Walker I Book + enchantingCraft7: Depth Strider I Book + enchantingCraft8: Mending Book + enchantingCraft9: Fortune I Book + commandDesc9: Sets the souls for a specified player + commandDesc10: Sets the skill or passive tokens in specified skill for a specified player + commandDesc11: Sets the global tokens for a specified player + commandDesc12: Saves stats of all players or a specified player + status: STATUS + complete: COMPLETE + incomplete: INCOMPLETE + try0: "try" + passiveImprove: Your passive perks improve every level! + increasedBy: increased by + expIncrease: EXP Multiplier + personalMultiplier: Personal Multiplier + translators: Translators + commandDesc13: Sets the personal multiplier for a specified player + abilityDescription: Ability Description + abilityDescription_digging: Temporarily adds 5 levels of effiency to your shovel. Activated by right-clicking a shovel then breaking a block. + abilityDescription_woodcutting: Temporarily makes axes break an entire tree with one block break. Activated by right-clicking an axe then breaking a log. + abilityDescription_mining: Temporarily adds 5 levels of effiency to your pickaxe. Activated by right-clicking a pickaxe then breaking block. + abilityDescription_farming: Temporarily makes crops broken with a hoe automatically replant. Activated by right-clicking a hoe then breaking a crop. + abilityDescription_fishing: Temporarily makes fishing rods instantly catch a fish. Activated by left-clicking a fishing rod then fishing in water. + abilityDescription_archery: Temporarily makes all arrows fired at max speed. Activated by left-clicking a bow then shooting an arrow. + abilityDescription_beastMastery: Temporarily gives your horse a speed buff. Activated by right-clicking while on a horse then left-clicking. + abilityDescription_swordsmanship: Temporarily removes swinging cooldown on swords. Activated by right-clicking a sword then hitting a mob. + abilityDescription_defense: Temporarily gives the user Resistance and Slowness effects. Activated by right-clicking with an empty hand then hitting a mob. + abilityDescription_axeMastery: Temporarily makes axes do damage to all mobs in a certain radius. Activated by right-clicking an axe then hitting a mob. + alchemyPerkDesc1_0: Unlocks ability to brew + alchemyPerkDesc0_0: A crafting table can be used to craft + triggerAbilities: Trigger Abilities + showEXPBar: Show EXP Bar + disabledSkill: This skill is disabled + skillConfigDesc: Takes you to configuration menu for this skill + lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" + exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" + potionAbsorption: Potion of Absorption + potionBadOmen: Potion of Bad Omen + potionBlindess: Potion of Blindess + potionConduitPower: Potion of Conduit Power + potionResistance: Potion of Resistance + potionDolphinsGrace: Potion of Dolphins Grace + potionHaste: Potion of Haste + potionFireResistance: Potion of Fire Resistance + potionGlowing: Potion of Glowing + potionHarm: Potion of Harm + potionHealing: Potion of Healing + potionHealthBoost: Potion of Health Boost + potiontheHero: Potion of the Hero + potionHunger: Potion of Hunger + potionStrength: Potion of Strength + potionInvsibility: Potion of Invsibility + potionJump: Potion of Jump + potionLuck: Potion of Luck + potionNightVision: Potion of Night Vision + potionRegeneration: Potion of Regeneration + potionSaturation: Potion of Saturation + potionSlowness: Potion of Slowness + potionFatigue: Potion of Fatigue + potionSlowFalling: Potion of Slow Falling + potionSpeed: Potion of Speed + potionBadLuck: Potion of Bad Luck + potionWaterBreathing: Potion of Water Breathing + potionWeakness: Potion of Weakness + potionDecay: Potion of Decay + potionAwkward: Awkward Potion + potionUncraftable: Uncraftable Potion + potionMundane: Mundane Potion + potionTurtleMaster: Potion of the Turtle Master + potionThick: Thick Potion + potionWater: Water Bottle + ingredient: Ingredient + usedToBrew: Is used to brew + costs: costs + xpLevel: Minecraft XP Level + xpLevels: Minecraft XP Levels + craftXPRequirement: This recipe requires at least + bedGUI: You cannot use this command while in bed! + statsUpdated: Your stats were changed to be consistent with a new EXP curve. + All skill trees and passive perks have been reset. All tokens must be re-invested. + timeRemaining: Time Remaining + numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed + commandDesc14: Resets the cooldown period for a skill to 0 seconds + commandDesc15: Looks up a player's FreeRPG stats + repairUnsafeEnchant: This item is too powerful to be repaired + salvageUnsafeEnchant: This item is too powerful to be salvaged + rank: Rank + stats: stats + outOf: out of + playerNotInLeaderboard: That player is not on any leaderboards + virtual: Virtual + commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) - huHU: #Translated by vERKE - languageName: Magyar Nyelv - englishLanguageName: Hungarian - translationCredit: vERKE - global: Globális - digging: Ásás - woodcutting: Favágás - mining: Bányászat - farming: Földművelés - fishing: Horgászás - archery: Íjászat - beastMastery: Uralom a természet felett - swordsmanship: Kardforgatás - defense: Védelem - axeMastery: Balta ismerete - repair: Javítás - agility: Gyorsaság - alchemy: Aranycsinálás - smelting: Olvasztás - enchanting: Bűvölés - information: Információk - configuration: Beállítások - level: Szint - experience: Tapasztalatpont - toNext: Következő - total: Összesített - diggingPerkTitle0: Több Drop - diggingPerkTitle1: Dupla Kincs - diggingPerkTitle2: Ritkább Droppok - diggingPerkTitle3: Léleklopó - diggingPerkTitle4: Kovakő Kereső - diggingPerkTitle5: Ásás Királya - diggingPerkTitle6: Gödör Készítő - diggingPerkDesc0: Megnöveli a kincsek droppjának értékét szintenként eggyel. - diggingPerkDesc1: Szintenként 5%-kal nagyobb az esélye, hogy dupla annyi értékes tárgyat kapjon a játékos. - diggingPerkDesc2: A drop táblát megnöveli szintenként eggyel. - diggingPerkDesc3: Szintenként 5%-kal nagyobb az esélye, hogy értékes tárgyat dob a Lélekhomok. - diggingPerkDesc4: 100%-os eséllyel dob kovakövet a sóder (/flintToggle paranccsal tudod ki- és bekapcsolni) - diggingPerkDesc5: Az ásó dupla akkorát sebez - diggingPerkDesc6: E képesség használatakor egy 3x3-mas lyukat ás a játékos, és 20%-át kapja meg a dropoknak - diggingPassiveTitle0: Passzív Zsetonok - diggingPassiveTitle1: Vissza - diggingPassiveTitle2: Képesség Zsetonok - diggingPassiveTitle3: Gödör Készítő időtartama - diggingPassiveTitle4: Kincsszerzés esélye - diggingPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) - diggingPassiveDesc1: Visszamész a főmenübe - diggingPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni - diggingPassiveDesc3: Megnöveli a Gödörkészítő időtartamát 0.02 másodperccel - diggingPassiveDesc4: Megnöveli a kincsek kiásásának esélyét 0.05%-kal - woodcuttingPerkTitle0: Buzgó Gyökérzet - woodcuttingPerkTitle1: Üde Kezek - woodcuttingPerkTitle2: Tudatalatti Befolyás - woodcuttingPerkTitle3: Levél Gyűjtögető - woodcuttingPerkTitle4: Favágó+ - woodcuttingPerkTitle5: Levélfúvó - woodcuttingPerkTitle6: Ügyes Baltás - woodcuttingPerkDesc0: +20% az esélye, hogy a nyersfa 1 xp dob szintenként - woodcuttingPerkDesc1: +12 másodpercnyi Sietség 1-et ad, miután a játékos kiütött egy nyersfát - woodcuttingPerkDesc2: +0.2% eséllyel dobhat a nyersfa egy bűvölt könyvet. - woodcuttingPerkDesc3: 1% esély van arra, hogy a falevelek plusz tárgyat droppolnak - woodcuttingPerkDesc4: 64-ről 128-ra ugrik a favágás limitje - woodcuttingPerkDesc5: Break a large section of leaves using an axe (toggleable with /leafBlowerToggle) - woodcuttingPerkDesc6: Dupla droppok, Buzgó Gyökérzet, és a Tudatalatti Befolyás hatnak a favágásra is - woodcuttingPassiveTitle0: Passzív Zsetonok - woodcuttingPassiveTitle1: Vissza - woodcuttingPassiveTitle2: Képesség Zsetonok - woodcuttingPassiveTitle3: Időtartam - woodcuttingPassiveTitle4: Dupla droppok - woodcuttingPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) - woodcuttingPassiveDesc1: Visszamész a főmenübe - woodcuttingPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni - woodcuttingPassiveDesc3: Megnöveli a Favágó képesség időtartamát 0.02 másodperccel - woodcuttingPassiveDesc4: 0.05%-kal nagyobb az esélye, hogy dupla tárgyat kap a játékos - miningPerkTitle0: Fáradhatatlan Bányász - miningPerkTitle1: Több bomba - miningPerkTitle2: Kincsvadász - miningPerkTitle3: Vigyázz, bomba! - miningPerkTitle4: Ügyes bányász - miningPerkTitle5: Tűzszerész - miningPerkTitle6: Triplán szerencsés - miningPerkDesc0: A játékos Sietséget kap, miután kibászáik egy ércet - miningPerkDesc1: +1 TNT-t kap a játékos, amikor barkácsol egyet - miningPerkDesc2: Ha ezt a képességet egy kőn használja a játékos, akkor szintenként +1% esély van arra, hogy egy extra ércet dobjon a kő - miningPerkDesc3: Megnöveli a TNT robbanásának területét, ha szikrapattintóval gyútja be a játékos a TNT-t - miningPerkDesc4: Az összes ércet egy kis területen belül egyszerre kibányássza a játékos (be- és kikapcsolható) - miningPerkDesc5: A játékos nem sebződik a TNT-től - miningPerkDesc6: Dupla droppok helyett, tripla droppot kap a játékos - miningPassiveTitle0: Passzív Zsetonok - miningPassiveTitle1: Vissza - miningPassiveTitle2: Képesség Zsetonok - miningPassiveTitle3: Gyors Csákány Időtartama - miningPassiveTitle4: Dupla Droppok - miningPassiveTitle5: Kirobbanó Bányászat - miningPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) - miningPassiveDesc1: Visszamész a főmenübe - miningPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni - miningPassiveDesc3: Megnöveli a Gyors Csákány időtartamát 0.02 másodperccel - miningPassiveDesc4: Megnöveli 0.05%-kal az esélyét annak, hogy dupla ércet kap a játékos - miningPassiveDesc5: Megnöveli az esélyét, hogy több ércet kap a játékos, amikor TNT-vel bányászik (0.01%-kal, 10 robbanásonként) - farmingPerkTitle0: Trágyázás - farmingPerkTitle1: Állatfarm - farmingPerkTitle2: Vegetáriánus - farmingPerkTitle3: Húsimádó - farmingPerkTitle4: Zöld Kezű - farmingPerkTitle5: Serkentő Hormonok - farmingPerkTitle6: Egy mindenkiért, mindenki a természetért - farmingPerkDesc0: +10% esély arra, hogy a csontliszt nem kerül elhasználásra - farmingPerkDesc1: Szintenként tud a játékos tojásokat barkácsolni - farmingPerkDesc2: Zöldségek és gyümölcsök 20%-kal többet töltenek az ételsávon - per level - farmingPerkDesc3: A húsok 20%-kal többet töltenek az ételsávon - farmingPerkDesc4: A képesség visszaülteti a Zöldségeket és Gyülmöcsöket, és nagy eséllyel olyan státuszban, hogy már teljesen megnőttek, vagy a teljes megnövés közelében járnak. - farmingPerkDesc5: Ha cukorral megeteti a játékos a kisállatokat, akkor rögtön felnőnek - farmingPerkDesc6: Ha egy helyben, füvön áll a játékos, akkor visszatöltődik az életereje - farmingPassiveTitle0: Passzív Zsetonok - farmingPassiveTitle1: Vissza - farmingPassiveTitle2: Képesség Zsetonok - farmingPassiveTitle3: Természetes Regeneráció Időtartama - farmingPassiveTitle4: Dupla Droppok (Zöldség/Gyümölcs) - farmingPassiveTitle5: Dupla Droppok (Állatok) - farmingPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) - farmingPassiveDesc1: Visszamész a főmenübe - farmingPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni - farmingPassiveDesc3: Megnöveli a Természetes Regeneráció Időtartamát 0.02s másodperccel - farmingPassiveDesc4: Megnöveli az esélyét, hogy az aratás során dupla annyi tárgyat kapjon a játékos 0.05%-kal - farmingPassiveDesc5: Megnöveli az esélyét, hogy a passzív állatok megölése során dupla annyi tárgyat kapjon a játékos 0.05%-kal - fishingPerkTitle0: Rabló - fishingPerkTitle1: Gyűjtögető - fishingPerkTitle2: A Halász Ínyencségei - fishingPerkTitle3: Aranykezű Horgász - fishingPerkTitle4: Mászókarom - fishingPerkTitle5: Villámgyors horgászat - fishingPerkTitle6: Halasember - fishingPerkDesc0: +15% eséllyel tud tárgyakat lopni a játékos a szörnyektől - fishingPerkDesc1: Jobb tárgyakat horgászhat ki a játékos - fishingPerkDesc2: A halfélék 20%-kal többel töltik az életsávját a játékosnak. - fishingPerkDesc3: Nagyobb értékű tárgyakat gyakrabban horgászik a játékos, amíg a kisebb értékű tárgyakat kevésbé gyarkan - fishingPerkDesc4: A horgászbotok, ha bekapcsolja a játékos a /grappleToggle paranccsal, akkor mászókaromként is működhetnek - fishingPerkDesc5: A halakat kisütve fogja ki a játékos, hogyha bekapcsolja a képességét a /hotRodToggle paranccsal - fishingPerkDesc6: Végtelen éjjelátó és delfin áldás erősítést kap a játékos a víz alatt. - fishingPassiveTitle0: Passzív Zsetonok - fishingPassiveTitle1: Vissza - fishingPassiveTitle2: Képesség Zsetonok - fishingPassiveTitle3: Szupercsali időtartama - fishingPassiveTitle4: Dupla Fogás - fishingPassiveTitle5: Kincsvadász - fishingPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) - fishingPassiveDesc1: Visszamész a főmenübe - fishingPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni - fishingPassiveDesc3: Megnöveli a Szupercsali időtartamát 0.01 másodperccel - fishingPassiveDesc4: 0.05%-kal megnöveli az esélyét, hogy a játékos dupla annyi tárgyat fog ki - fishingPassiveDesc5: Csökkenti a 0.00%5-kal azt, hogy a játékos szemetet fogjon ki, és megnöveli 0.005%-kal, hogy értékes tárgyra leljen - archeryPerkTitle0: Extra nyilak - archeryPerkTitle1: Mesterlövész - archeryPerkTitle2: A Fény Nyila - archeryPerkTitle3: Robbanó Nyíl - archeryPerkTitle4: Sárkány Nélküli Barkácsolgatás - archeryPerkTitle5: Gyorskezű Íjász - archeryPerkTitle6: Halálos Csapás - archeryPerkDesc0: Minden szinttel plusz egy nyilat kapsz, hogyha barkácsolsz egyet - archeryPerkDesc1: A nyíl sebessége megnő 2%-kal minden szinttel - archeryPerkDesc2: Szintenként 5%-kal többet sebez a Spectral nyíl - archeryPerkDesc3: Szintenként 1%-kkal nő az esélye, hogy robban a nyíl, amit kilő a játékos - archeryPerkDesc4: Egyszerű bájitalokból is tud különleges nyilakat kraftolni a játékos ezzel a képeséggel - archeryPerkDesc5: A számszeríjakat is rögtön felhúzza a játékos ezzel a képességgel - archeryPerkDesc6: A tüzijátékok, amiket számszeríjból lő ki a játékos dupla annyit sebeznek - archeryPassiveTitle0: Passzív Zsetonok - archeryPassiveTitle1: Vissza - archeryPassiveTitle2: Képesség Zsetonok - archeryPassiveTitle3: Gyors Tüzelés időtartama - archeryPassiveTitle4: Varázsnyíl - archeryPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) - archeryPassiveDesc1: Visszamész a főmenübe - archeryPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni - archeryPassiveDesc3: 0.02 másodperccel megnöveli a Gyors Tüzelés képesség időtartamát - archeryPassiveDesc4: 0.05%-kal nő szintenként az esélye annak, hogy nem használódik el a nyíl, amikor íjat használ a játékos - beastMasteryPerkTitle0: Páncélos Kutyus - beastMasteryPerkTitle1: Harcieb - beastMasteryPerkTitle2: Egészséges Falatok - beastMasteryPerkTitle3: Tartsd be a másfél métert - beastMasteryPerkTitle4: Akrobata - beastMasteryPerkTitle5: Jegyzetek - beastMasteryPerkTitle6: Adrenalinbomba - beastMasteryPerkDesc0: 10%-kal kevesebb sebzést kap a játékos kutyái - beastMasteryPerkDesc1: 10%-kal többet sebez a játékos kutyái - beastMasteryPerkDesc2: Kutyák másfél szívet gyógyítanak magukon, hogyha megölnek valamit - beastMasteryPerkDesc3: 5% eséllyel rúgják hátrébb a kutyák az ellenfelet - beastMasteryPerkDesc4: Kutyák nem sebződnek, hogyha leesnek - beastMasteryPerkDesc5: Ha iránytűvel a kezében ránéz a játékos egy kutyára, vagy lóra, akkor meg tudja nézni a statisztikáit - beastMasteryPerkDesc6: Sarkanytús Rúgás mostmár Gyorsaság III erősítést ad - beastMasteryPassiveTitle0: Passzív Zsetonok - beastMasteryPassiveTitle1: Vissza - beastMasteryPassiveTitle2: Képesség Zsetonok - beastMasteryPassiveTitle3: Sarkanytús Rúgás időtartama - beastMasteryPassiveTitle4: Kritikus Harapás - beastMasteryPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) - beastMasteryPassiveDesc1: Visszamész a főmenübe - beastMasteryPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni - beastMasteryPassiveDesc3: 0.02 másodperccel megnöveli a Sarkanytús Rúgás időtartamát - beastMasteryPassiveDesc4: 0.025%-kal megnöveli az esélyét annak, hogy a kutya kritikus sebzést ejt - swordsmanshipPerkTitle0: Adrenalin - swordsmanshipPerkTitle1: Megállíthatatlan - swordsmanshipPerkTitle2: Adrenalin+ - swordsmanshipPerkTitle3: Tényleg Megállíthatatlan - swordsmanshipPerkTitle4: Vérszomjas - swordsmanshipPerkTitle5: Még élesebb! - swordsmanshipPerkTitle6: Kardmester - swordsmanshipPerkDesc0: Szintenként plusz két másodpercnyi gyorsaság erősítést ad a játékosnak, hogyha megöl egy szörnyet - swordsmanshipPerkDesc1: Szintenként plusz két másodpercnyi erő erősítést ad a játékosnak, hogyha megöl egy szörnyet - swordsmanshipPerkDesc2: Az Adrenalin gyorsaság II erősítést ad - swordsmanshipPerkDesc3: A Megállíthatatlan erő II erősítést ad - swordsmanshipPerkDesc4: Visszatölti a játékos ételsávját, hogyha karddal öl szörnyeket - swordsmanshipPerkDesc5: Gyors Támadás ezentúl ad plusz egy “sharpness” erősítést a játékos kardjára - swordsmanshipPerkDesc6: A kard +1 szívet sebez - swordsmanshipPassiveTitle0: Passzív Zsetonok - swordsmanshipPassiveTitle1: Vissza - swordsmanshipPassiveTitle2: Képesség Zsetonok - swordsmanshipPassiveTitle3: Gyors Támadás időtartama - swordsmanshipPassiveTitle4: Dubla találat - swordsmanshipPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) - swordsmanshipPassiveDesc1: Visszamész a főmenübe - swordsmanshipPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni - swordsmanshipPassiveDesc3: 0.02 másodperccel megnöveli a Gyors Támadás időtartamát - swordsmanshipPassiveDesc4: Megnöveli 0.02%-kal az esélyét, hogy a játékos kétszer üti meg a szörnyet (a második ütés 50%-os sebzést okoz) - defensePerkTitle0: Gyógyító - defensePerkTitle1: Stiffen - defensePerkTitle2: Hard Headed - defensePerkTitle3: Stiffen+ - defensePerkTitle4: Gift From Above - defensePerkTitle5: Stronger Legs - defensePerkTitle6: Hearty - defensePerkDesc0: Gain +3s of regen per level on kill - defensePerkDesc1: +2% chance to gain resistance I for 5s when hit - defensePerkDesc2: Hard Body decreases damage by an additional 6.6% per level - defensePerkDesc3: +2% chance to gain resistance II for 5s when hit - defensePerkDesc4: Stone Solid now grants 4 absorption hearts for ability length - +1 minute - defensePerkDesc5: Stone Solid now gives slowness I instead of slowness IV - defensePerkDesc6: +2 hearts permanently - defensePassiveTitle0: Passzív Zsetonok - defensePassiveTitle1: Vissza - defensePassiveTitle2: Képesség Zsetonok - defensePassiveTitle3: Stone Solid Duration - defensePassiveTitle4: Hard Body - defensePassiveTitle5: Dupla Droppok (Hostile Mobs) - defensePassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) - defensePassiveDesc1: Visszamész a főmenübe - defensePassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni - defensePassiveDesc3: Increases duration of Stone Solid by 0.02s - defensePassiveDesc4: Increases chance to take reduced (base -33%) damage by 0.01% - per level - defensePassiveDesc5: Increases chance to receive double drops from aggressive - mobs by 0.05% - axeMasteryPerkTitle0: Greater Axe - axeMasteryPerkTitle1: Holy Axe - axeMasteryPerkTitle2: Revitalized - axeMasteryPerkTitle3: Warrior Blood - axeMasteryPerkTitle4: Earthquake - axeMasteryPerkTitle5: Better Crits - axeMasteryPerkTitle6: Axe Man - axeMasteryPerkDesc0: Great Axe damage radius increases by 1 block per level - axeMasteryPerkDesc1: +2% chance for lighting to strike mobs on axe hit - axeMasteryPerkDesc2: +1% chance for full heal on kill per level - axeMasteryPerkDesc3: +3 s per level of Strength I on kills with an axe - axeMasteryPerkDesc4: Ability's AOE damage is doubled (25% -> 50% of damage) - axeMasteryPerkDesc5: Divine Crits now have 1.6x multiplier instead of 1.25x - axeMasteryPerkDesc6: Axes permanently do +1 heart of damage - axeMasteryPassiveTitle0: Passzív Zsetonok - axeMasteryPassiveTitle1: Vissza - axeMasteryPassiveTitle2: Képesség Zsetonok - axeMasteryPassiveTitle3: Great Axe Duration - axeMasteryPassiveTitle4: Divine Crits - axeMasteryPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) - axeMasteryPassiveDesc1: Visszamész a főmenübe - axeMasteryPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni - axeMasteryPassiveDesc3: Increases duration of Great Axe by 0.02s - axeMasteryPassiveDesc4: Increases random crit chance (base 1.25x damage) by 0.01% - repairPerkTitle0: Salvaging - repairPerkTitle1: Resourceful - repairPerkTitle2: Magic Repair Mastery - repairPerkDesc0: Get more materials on average from salvaging - repairPerkDesc1: +10% chance of keeping material used when repairing - repairPerkDesc2: Guarenteed to keep enchants on repair - repairPassiveTitle0: Vissza - repairPassiveTitle1: Képesség Zsetonok - repairPassiveTitle2: Proficiency - repairPassiveDesc0: Visszamész a főmenübe - repairPassiveDesc1: Ezeket a Zsetonokat a képesség fában tudod elhasználni - repairPassiveDesc2: Materials restore more durability on repair - agilityPerkTitle0: Dodge - agilityPerkTitle1: Steel Bones - agilityPerkTitle2: Graceful Feet - agilityPerkDesc0: +4% chance to dodge attacks per level - agilityPerkDesc1: -10% fall damage per level - agilityPerkDesc2: Permanent speed I buff (toggleable by /speedToggle) - agilityPassiveTitle0: Vissza - agilityPassiveTitle1: Képesség Zsetonok - agilityPassiveTitle2: Roll - agilityPassiveDesc0: Visszamész a főmenübe - agilityPassiveDesc1: Ezeket a Zsetonokat a képesség fában tudod elhasználni - agilityPassiveDesc2: Chance to roll and take reduced fall damage - alchemyPerkTitle0: Alchemical Summoning - alchemyPerkTitle1: Ancient Knowledge - alchemyPerkTitle2: Potion Master - alchemyPerkDesc0: Allows crafting of some potions without a brewing stand - alchemyPerkDesc1: Unlocks ability to brew new potions - alchemyPerkDesc2: All used potions are increased in level by 1 (toggleable with - /togglePotion) - alchemyPassiveTitle0: Vissza - alchemyPassiveTitle1: Képesség Zsetonok - alchemyPassiveTitle2: Half-life+ - alchemyPassiveDesc0: Visszamész a főmenübe - alchemyPassiveDesc1: Ezeket a Zsetonokat a képesség fában tudod elhasználni - alchemyPassiveDesc2: Increase in duration of potions when used - smeltingPerkTitle0: Fuel Efficiency - smeltingPerkTitle1: Double Smelt - smeltingPerkTitle2: Flame Pickaxe - smeltingPerkDesc0: Fuel last +20% longer per level - smeltingPerkDesc1: +5% chance for smelted ore to be doubled per level - smeltingPerkDesc2: Mined ores are instantly smelted (toggleable with /toggleFlamePick) - smeltingPassiveTitle0: Vissza - smeltingPassiveTitle1: Képesség Zsetonok - smeltingPassiveTitle2: Fuel Speed - smeltingPassiveDesc0: Visszamész a főmenübe - smeltingPassiveDesc1: Ezeket a Zsetonokat a képesség fában tudod elhasználni - smeltingPassiveDesc2: Increasing cooking speed - enchantingPerkTitle0: Okos Bájoló - enchantingPerkTitle1: Könyvmoly - enchantingPerkTitle2: Örök Tudás - enchantingPerkDesc0: Eggyel kevesebb szint kell, hogy bűvölje az eszközét a játékos, és megjavítani is eggyel kevesebb tapasztalat pontba kerül - enchantingPerkDesc1: A játékos ezentúl tud barkácsolni pár bűvölt könyvet - enchantingPerkDesc2: A játékos megtartja a tapasztalat pontját a halála során - enchantingPassiveTitle0: Vissza - enchantingPassiveTitle1: Képesség Zsetonok - enchantingPassiveTitle2: Tartalékolás - enchantingPassiveDesc0: Visszamész a főmenübe - enchantingPassiveDesc1: Ezeket a Zsetonokat a képesség fában tudod elhasználni - enchantingPassiveDesc2: Megnő a tapasztalatpontok száma, amit a játékos szerezhet - globalPerkTitle0: Gyűjtögető - globalPerkTitle1: Diák - globalPerkTitle2: Harcos - globalPerkTitle3: Kemény munkás - globalPerkTitle4: Kutató - globalPerkTitle5: Edző - globalPerkTitle6: Szanitéc - globalPerkTitle7: Léleklopó - globalPerkTitle8: Avatár - globalPerkTitle9: Ezermester - globalPerkDesc0: +20% TP-t kapsz az ásásért, favágásért, bányászásért, földművelésért és horgászásért - globalPerkDesc1: +20% TP-t kapsz a javításért, ugrás és futásért, kotyvasztásért, olvasztásért és a bűvülésért - globalPerkDesc2: +20% TP-t kapsz a íjászatban, kardforgatásban, védelemben, balta használatért és a természet feletti uralomért - globalPerkDesc3: +1 képesség zseton minden Gyűjtögető képességhez - globalPerkDesc4: +1 képesség zseton minden Diák képességhez - globalPerkDesc5: +1 képesség zseton minden Harcos képességhez - globalPerkDesc6: Halál esetén 50% esély van rá, hogy az értékes tárgyakat megtartja a játékos - globalPerkDesc7: A megölt szörnyek lelkét ki tudod szívni, ezzel tudod nullázni a képesség fáid. - globalPerkDesc8: 10% esély van rá, hogy 10 másodpercig minden erősítést megkap a játékos, hogyha egy olyan támadás éri, amitől meghalna - globalPerkDesc9: Minden képesség töltési ideje csökken 33%-kal - globalPassiveTitle0: Globális Zsetonok - globalPassiveTitle1: Vissza - globalPassiveDesc0: Ezeket a Zsetonokat a képesség fában tudod elhasználni - globalPassiveDesc1: Visszamész a főmenübe - cannotRepair: Nem tudsz javítani, amíg a képességed be van kapcsolva! - cannotSalvage: You cannot salvage while this ability is active! - spite: Minden jó valami rosszból származik - refundSkill: szükéges, hogy nullázd a képesség fádat - refundSkill2: hogy nullázd a képesség fádat - needToUnlock: Fel kell oldanod - perkRequirement: Legalább 2 képesség zsetonnak kell lennie az előző képességeknél, hogy felold ezt a képességet - perkRequirementM: Összesen minimun 10 képesség zsetonnak kell a képességfádban lennie, hogy feloldj egy mester képességet - noSkillTokens: Nincsen egy képesség tokened sem - noPassiveTokens: Nincsen egy passzív tokened sem - maxedOutPerk: Már kimaxoltad ezt a képességed! - requiredGlobalPerks0: Fel kell oldanod az előző képességet, hogy ezt felold - requiredGlobalPerks1: képességet fel kell oldanod, hogy aztán ezt is fel tudd - requiredGlobalPerks2: képességre szükség van, hogy ezt is felold - requiredGlobalPerks3: Minden globális képességre szükséged van, hogy ezt is felold - craftRequirement: tudásra is szükséged van, hogy össze tudd barkácsolni ezt - roll: PÖRGETÉS - dodge: KITÉRÉS - prepare: Előkészíted - rest: Pihenteted - activated: aktiválva - ended: véget ért - readyToUse: újra készen áll a használatra - cooldown: újratöltési idő - rapidFire: Gyors Tüzelés - bow: íj - greatAxe: Nagy Balta - axe: balta - spurKick: Sarkanytús Rúgás - leg: láb - stoneSoldier: KőKatona - yourself: saját magad - bigDig: Gödörkészítő - shovel: ásó - naturalRegeneration: Természetes Regenerálódás - hoe: kapa - superBait: Szuper Csali - fishingRod: horgászbot - berserkPick: Gyors Csákány - pickaxe: csákány - swiftStrikes: Gyors Támadás - sword: kard - timber: Favágó - hyperHorse: Ez a ló már fel van gyorsítva! - magicForce: A mágikus erő véget vet a képességednek! - rob: Rablás - repairFail0: Nem vagy elég tapasztalt, hogy meg tudd javítani ezt a tárgyat - repairFail1: Semmilyen értékes alkatrészt sem tudtál kiszedni ebből - repairFail2: Nem sikerült megtartanod az eszközöd bájait - treeTooBig0: Ez a fa túl nagy, hogy egyben kiásd!" - treeTooBig1: Ezt a fát nem tudod kivágni egyben! - noPermission: Ehhez a parancshoz nincs jogod! - improperArguments: Nem megfelelő argumentum! Ezt próbáld meg - totalPlayTime: Összes játszott idő - clickForOptions: Kattints ide, hogy megnézd a beállításokat - unknownCommand: Ismeretlen parancs - expToLevel: EXP to next level - playerName: playerName - skillName: skillName (in English) - page: page - on0: "ON" - off0: "OFF" - onOrOff: ON/OFF - manuallyToggles: Manually toggles - commandDesc0: Opens the main GUI with all skills - commandDesc1: Opens a skill tree GUI of choice - commandDesc2: Opens the configuration GUI - commandDesc3: Gives a player of choice EXP in a specified skill - commandDesc4: Sets a given player's level in a specified skill - commandDesc5: Resets a player's stats in a specified skill (does not refund stats) - commandDesc6: Displays a leaderboard for a specified stat - commandDesc7: Provides a link to a plugin information page - commandDesc8: Attempts to enchant an item in the users hand at a specified level - informationURL: Information URL (Google Docs) - click: CLICK - levelArgument: Level argument must be less than 40 - leaderboard: Leaderboard - playerOffline: That player is not online - onlyIncrease: Please only increase exp with this command, otherwise, use /frpg statReset then /frpg giveEXP - amount: amount - unlockToggle: To use this command you must unlock - levelUpNotif: Level Up Notifications - abilityPreparationNotif: Ability Preparation Notifications - yes0: "YES" - no0: "NO" - warning: WARNING - souls: souls - refundSkillTree0: Refunding a skill tree costs - refundSkillTree1: and is not reversible, are you sure you want to - refundSkillTree2: refund the - skill: skill - backToSkillTree: Takes you back to the skill tree - miningPerkDesc0_1: 2 seconds of Haste I after mining any ore - miningPerkDesc0_2: 5 seconds of Haste I after mining any ore - miningPerkDesc0_3: 10 seconds of Haste I after mining any ore - miningPerkDesc0_4: 5 seconds of Haste II after mining any ore, followed by 5 seconds of Haste I - miningPerkDesc0_5: 10 seconds of Haste II after mining any ore - woodcuttingPerkDesc3_1: Leaves may now drop a - common: common - uncommon: uncommon - rare: rare - veryRare: very rare - legendary: legendary - fishingPerkDesc1_1: Unlocks treasure tier - farmingPerkDesc1_1: Gain the ability to craft - cowSpawnEgg: cow spawn egg - beeSpawnEgg: bee spawn egg - mooshroomSpawnEgg: mooshroom spawn egg - horseSpawnEgg: horse spawn egg - slimeSpawnEgg: slime spawn egg - diggingPerkDesc0_1: You may now dig up a - defensePerkDesc0_1: Gain +3 s of regen per level on kills - defensePerkDesc0_2: Gain +0.5 hearts per level instantly on kills - duration: Duration - likelihood: Likelihood - junkChance: Junk Chance - locked: LOCKED - unlocked: UNLOCKED - cowEgg: Cow Egg - beeEgg: Bee Egg - mooshroomEgg: Mooshroom Egg - horseEgg: Horse Egg - slimeEgg: Slime Egg - tippedArrows: Tipped Arrows - toggle: Toggle - refundSkillTitle: Refund Skill - refundSkillTreeDesc: Click to refund this skill tree - enchantingPerkDesc1_0: Unlocks ability to craft - enchantingPerkDesc1_1: Power I and Efficiency I enchanted books (costs 1 level to craft)" - enchantingPerkDesc1_2: Sharpness I and Protection I enchanted books (costs 1 level to craft) - enchantingPerkDesc1_3: Luck of the Sea I and Lure I enchanted books (costs 1 level to craft) - enchantingPerkDesc1_4: Depth Strider I and Frost Walker I enchanted books (costs 1 level to craft) - enchantingPerkDesc1_5: Mending (costs 10 levels to craft) and Fortune I (costs 2 levels to craft) enchanted books - repairPerkDesc0_1: Gain more materials from salvaging on average - repairPerkDesc0_2: Gain more materials from salvaging on average, salvaging now stores item enchants in a book - xpBoost: XP Boost - speedBoost: Speed Boost - timeExtension: Time Extension - enchantingCraft0: Power I Book - enchantingCraft1: Efficiency I Book - enchantingCraft2: Sharpness I Book - enchantingCraft3: Protection I Book - enchantingCraft4: Luck of the Sea I Book - enchantingCraft5: Lure I Book - enchantingCraft6: Frost Walker I Book - enchantingCraft7: Depth Strider I Book - enchantingCraft8: Mending Book - enchantingCraft9: Fortune I Book - commandDesc9: Sets the souls for a specified player - commandDesc10: Sets the skill or passive tokens in specified skill for a specified player - commandDesc11: Sets the global tokens for a specified player - commandDesc12: Saves stats of all players or a specified player - status: STATUS - complete: COMPLETE - incomplete: INCOMPLETE - try0: "try" - passiveImprove: Your passive perks improve every level! - increasedBy: increased by - expIncrease: All EXP increased by - personalMultiplier: Personal Multiplier - translators: Translators - commandDesc13: Sets the personal multiplier for a specified player - abilityDescription: Ability Description - abilityDescription_digging: Temporarily adds 5 levels of effiency to your shovel. Activated by right-clicking a shovel then breaking a block. - abilityDescription_woodcutting: Temporarily makes axes break an entire tree with one block break. Activated by right-clicking an axe then breaking a log. - abilityDescription_mining: Temporarily adds 5 levels of effiency to your pickaxe. Activated by right-clicking a pickaxe then breaking block. - abilityDescription_farming: Temporarily makes crops broken with a hoe automatically replant. Activated by right-clicking a hoe then breaking a crop. - abilityDescription_fishing: Temporarily makes fishing rods instantly catch a fish. Activated by left-clicking a fishing rod then fishing in water. - abilityDescription_archery: Temporarily makes all arrows fired at max speed. Activated by left-clicking a bow then shooting an arrow. - abilityDescription_beastMastery: Temporarily gives your horse a speed buff. Activated by right-clicking while on a horse then left-clicking. - abilityDescription_swordsmanship: Temporarily removes swinging cooldown on swords. Activated by right-clicking a sword then hitting a mob. - abilityDescription_defense: Temporarily gives the user Resistance and Slowness effects. Activated by right-clicking with an empty hand then hitting a mob. - abilityDescription_axeMastery: Temporarily makes axes do damage to all mobs in a certain radius. Activated by right-clicking an axe then hitting a mob. - alchemyPerkDesc1_0: Unlocks ability to brew - alchemyPerkDesc0_0: A crafting table can be used to craft - triggerAbilities: Trigger Abilities - showEXPBar: Show EXP Bar - disabledSkill: This skill is disabled - skillConfigDesc: Takes you to configuration menu for this skill - lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" - exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" - potionAbsorption: Potion of Absorption - potionBadOmen: Potion of Bad Omen - potionBlindess: Potion of Blindess - potionConduitPower: Potion of Conduit Power - potionResistance: Potion of Resistance - potionDolphinsGrace: Potion of Dolphins Grace - potionHaste: Potion of Haste - potionFireResistance: Potion of Fire Resistance - potionGlowing: Potion of Glowing - potionHarm: Potion of Harm - potionHealing: Potion of Healing - potionHealthBoost: Potion of Health Boost - potiontheHero: Potion of the Hero - potionHunger: Potion of Hunger - potionStrength: Potion of Strength - potionInvsibility: Potion of Invsibility - potionJump: Potion of Jump - potionLuck: Potion of Luck - potionNightVision: Potion of Night Vision - potionRegeneration: Potion of Regeneration - potionSaturation: Potion of Saturation - potionSlowness: Potion of Slowness - potionFatigue: Potion of Fatigue - potionSlowFalling: Potion of Slow Falling - potionSpeed: Potion of Speed - potionBadLuck: Potion of Bad Luck - potionWaterBreathing: Potion of Water Breathing - potionWeakness: Potion of Weakness - potionDecay: Potion of Decay - potionAwkward: Awkward Potion - potionUncraftable: Uncraftable Potion - potionMundane: Mundane Potion - potionTurtleMaster: Potion of the Turtle Master - potionThick: Thick Potion - potionWater: Water Bottle - ingredient: Ingredient - usedToBrew: Is used to brew - costs: costs - xpLevel: Minecraft XP Level - xpLevels: Minecraft XP Levels - craftXPRequirement: This recipe requires at least - bedGUI: You cannot use this command while in bed! - statsUpdated: Your stats were changed to be consistent with a new EXP curve. - All skill trees and passive perks have been reset. All tokens must be re-invested. - timeRemaining: Time Remaining - numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed - commandDesc14: Resets the cooldown period for a skill to 0 seconds - commandDesc15: Looks up a player's FreeRPG stats - repairUnsafeEnchant: This item is too powerful to be repaired - salvageUnsafeEnchant: This item is too powerful to be salvaged - rank: Rank - stats: stats - outOf: out of - playerNotInLeaderboard: That player is not on any leaderboards - virtual: Virtual - commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) + huHU: #Translated by vERKE + languageName: Magyar Nyelv + englishLanguageName: Hungarian + translationCredit: vERKE + global: Globális + digging: Ásás + woodcutting: Favágás + mining: Bányászat + farming: Földművelés + fishing: Horgászás + archery: Íjászat + beastMastery: Uralom a természet felett + swordsmanship: Kardforgatás + defense: Védelem + axeMastery: Balta ismerete + repair: Javítás + agility: Gyorsaság + alchemy: Aranycsinálás + smelting: Olvasztás + enchanting: Bűvölés + information: Információk + configuration: Beállítások + level: Szint + experience: Tapasztalatpont + toNext: Következő + total: Összesített + diggingPerkTitle0: Több Drop + diggingPerkTitle1: Dupla Kincs + diggingPerkTitle2: Ritkább Droppok + diggingPerkTitle3: Léleklopó + diggingPerkTitle4: Kovakő Kereső + diggingPerkTitle5: Ásás Királya + diggingPerkTitle6: Gödör Készítő + diggingPerkDesc0: Megnöveli a kincsek droppjának értékét szintenként eggyel. + diggingPerkDesc1: Szintenként 5%-kal nagyobb az esélye, hogy dupla annyi értékes tárgyat kapjon a játékos. + diggingPerkDesc2: A drop táblát megnöveli szintenként eggyel. + diggingPerkDesc3: Szintenként 5%-kal nagyobb az esélye, hogy értékes tárgyat dob a Lélekhomok. + diggingPerkDesc4: 100%-os eséllyel dob kovakövet a sóder (/flintToggle paranccsal tudod ki- és bekapcsolni) + diggingPerkDesc5: Az ásó dupla akkorát sebez + diggingPerkDesc6: E képesség használatakor egy 3x3-mas lyukat ás a játékos, és 20%-át kapja meg a dropoknak + diggingPassiveTitle0: Passzív Zsetonok + diggingPassiveTitle1: Vissza + diggingPassiveTitle2: Képesség Zsetonok + diggingPassiveTitle3: Gödör Készítő időtartama + diggingPassiveTitle4: Kincsszerzés esélye + diggingPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) + diggingPassiveDesc1: Visszamész a főmenübe + diggingPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni + diggingPassiveDesc3: Megnöveli a Gödörkészítő időtartamát 0.02 másodperccel + diggingPassiveDesc4: Megnöveli a kincsek kiásásának esélyét 0.05%-kal + woodcuttingPerkTitle0: Buzgó Gyökérzet + woodcuttingPerkTitle1: Üde Kezek + woodcuttingPerkTitle2: Tudatalatti Befolyás + woodcuttingPerkTitle3: Levél Gyűjtögető + woodcuttingPerkTitle4: Favágó+ + woodcuttingPerkTitle5: Levélfúvó + woodcuttingPerkTitle6: Ügyes Baltás + woodcuttingPerkDesc0: +20% az esélye, hogy a nyersfa 1 xp dob szintenként + woodcuttingPerkDesc1: +12 másodpercnyi Sietség 1-et ad, miután a játékos kiütött egy nyersfát + woodcuttingPerkDesc2: +0.2% eséllyel dobhat a nyersfa egy bűvölt könyvet. + woodcuttingPerkDesc3: 1% esély van arra, hogy a falevelek plusz tárgyat droppolnak + woodcuttingPerkDesc4: 64-ről 128-ra ugrik a favágás limitje + woodcuttingPerkDesc5: Break a large section of leaves using an axe (toggleable with /leafBlowerToggle) + woodcuttingPerkDesc6: Dupla droppok, Buzgó Gyökérzet, és a Tudatalatti Befolyás hatnak a favágásra is + woodcuttingPassiveTitle0: Passzív Zsetonok + woodcuttingPassiveTitle1: Vissza + woodcuttingPassiveTitle2: Képesség Zsetonok + woodcuttingPassiveTitle3: Időtartam + woodcuttingPassiveTitle4: Dupla droppok + woodcuttingPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) + woodcuttingPassiveDesc1: Visszamész a főmenübe + woodcuttingPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni + woodcuttingPassiveDesc3: Megnöveli a Favágó képesség időtartamát 0.02 másodperccel + woodcuttingPassiveDesc4: 0.05%-kal nagyobb az esélye, hogy dupla tárgyat kap a játékos + miningPerkTitle0: Fáradhatatlan Bányász + miningPerkTitle1: Több bomba + miningPerkTitle2: Kincsvadász + miningPerkTitle3: Vigyázz, bomba! + miningPerkTitle4: Ügyes bányász + miningPerkTitle5: Tűzszerész + miningPerkTitle6: Triplán szerencsés + miningPerkDesc0: A játékos Sietséget kap, miután kibászáik egy ércet + miningPerkDesc1: +1 TNT-t kap a játékos, amikor barkácsol egyet + miningPerkDesc2: Ha ezt a képességet egy kőn használja a játékos, akkor szintenként +1% esély van arra, hogy egy extra ércet dobjon a kő + miningPerkDesc3: Megnöveli a TNT robbanásának területét, ha szikrapattintóval gyútja be a játékos a TNT-t + miningPerkDesc4: Az összes ércet egy kis területen belül egyszerre kibányássza a játékos (be- és kikapcsolható) + miningPerkDesc5: A játékos nem sebződik a TNT-től + miningPerkDesc6: Dupla droppok helyett, tripla droppot kap a játékos + miningPassiveTitle0: Passzív Zsetonok + miningPassiveTitle1: Vissza + miningPassiveTitle2: Képesség Zsetonok + miningPassiveTitle3: Gyors Csákány Időtartama + miningPassiveTitle4: Dupla Droppok + miningPassiveTitle5: Kirobbanó Bányászat + miningPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) + miningPassiveDesc1: Visszamész a főmenübe + miningPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni + miningPassiveDesc3: Megnöveli a Gyors Csákány időtartamát 0.02 másodperccel + miningPassiveDesc4: Megnöveli 0.05%-kal az esélyét annak, hogy dupla ércet kap a játékos + miningPassiveDesc5: Megnöveli az esélyét, hogy több ércet kap a játékos, amikor TNT-vel bányászik (0.01%-kal, 10 robbanásonként) + farmingPerkTitle0: Trágyázás + farmingPerkTitle1: Állatfarm + farmingPerkTitle2: Vegetáriánus + farmingPerkTitle3: Húsimádó + farmingPerkTitle4: Zöld Kezű + farmingPerkTitle5: Serkentő Hormonok + farmingPerkTitle6: Egy mindenkiért, mindenki a természetért + farmingPerkDesc0: +10% esély arra, hogy a csontliszt nem kerül elhasználásra + farmingPerkDesc1: Szintenként tud a játékos tojásokat barkácsolni + farmingPerkDesc2: Zöldségek és gyümölcsök 20%-kal többet töltenek az ételsávon + per level + farmingPerkDesc3: A húsok 20%-kal többet töltenek az ételsávon + farmingPerkDesc4: A képesség visszaülteti a Zöldségeket és Gyülmöcsöket, és nagy eséllyel olyan státuszban, hogy már teljesen megnőttek, vagy a teljes megnövés közelében járnak. + farmingPerkDesc5: Ha cukorral megeteti a játékos a kisállatokat, akkor rögtön felnőnek + farmingPerkDesc6: Ha egy helyben, füvön áll a játékos, akkor visszatöltődik az életereje + farmingPassiveTitle0: Passzív Zsetonok + farmingPassiveTitle1: Vissza + farmingPassiveTitle2: Képesség Zsetonok + farmingPassiveTitle3: Természetes Regeneráció Időtartama + farmingPassiveTitle4: Dupla Droppok (Zöldség/Gyümölcs) + farmingPassiveTitle5: Dupla Droppok (Állatok) + farmingPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) + farmingPassiveDesc1: Visszamész a főmenübe + farmingPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni + farmingPassiveDesc3: Megnöveli a Természetes Regeneráció Időtartamát 0.02s másodperccel + farmingPassiveDesc4: Megnöveli az esélyét, hogy az aratás során dupla annyi tárgyat kapjon a játékos 0.05%-kal + farmingPassiveDesc5: Megnöveli az esélyét, hogy a passzív állatok megölése során dupla annyi tárgyat kapjon a játékos 0.05%-kal + fishingPerkTitle0: Rabló + fishingPerkTitle1: Gyűjtögető + fishingPerkTitle2: A Halász Ínyencségei + fishingPerkTitle3: Aranykezű Horgász + fishingPerkTitle4: Mászókarom + fishingPerkTitle5: Villámgyors horgászat + fishingPerkTitle6: Halasember + fishingPerkDesc0: +15% eséllyel tud tárgyakat lopni a játékos a szörnyektől + fishingPerkDesc1: Jobb tárgyakat horgászhat ki a játékos + fishingPerkDesc2: A halfélék 20%-kal többel töltik az életsávját a játékosnak. + fishingPerkDesc3: Nagyobb értékű tárgyakat gyakrabban horgászik a játékos, amíg a kisebb értékű tárgyakat kevésbé gyarkan + fishingPerkDesc4: A horgászbotok, ha bekapcsolja a játékos a /grappleToggle paranccsal, akkor mászókaromként is működhetnek + fishingPerkDesc5: A halakat kisütve fogja ki a játékos, hogyha bekapcsolja a képességét a /hotRodToggle paranccsal + fishingPerkDesc6: Végtelen éjjelátó és delfin áldás erősítést kap a játékos a víz alatt. + fishingPassiveTitle0: Passzív Zsetonok + fishingPassiveTitle1: Vissza + fishingPassiveTitle2: Képesség Zsetonok + fishingPassiveTitle3: Szupercsali időtartama + fishingPassiveTitle4: Dupla Fogás + fishingPassiveTitle5: Kincsvadász + fishingPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) + fishingPassiveDesc1: Visszamész a főmenübe + fishingPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni + fishingPassiveDesc3: Megnöveli a Szupercsali időtartamát 0.01 másodperccel + fishingPassiveDesc4: 0.05%-kal megnöveli az esélyét, hogy a játékos dupla annyi tárgyat fog ki + fishingPassiveDesc5: Csökkenti a 0.00%5-kal azt, hogy a játékos szemetet fogjon ki, és megnöveli 0.005%-kal, hogy értékes tárgyra leljen + archeryPerkTitle0: Extra nyilak + archeryPerkTitle1: Mesterlövész + archeryPerkTitle2: A Fény Nyila + archeryPerkTitle3: Robbanó Nyíl + archeryPerkTitle4: Sárkány Nélküli Barkácsolgatás + archeryPerkTitle5: Gyorskezű Íjász + archeryPerkTitle6: Halálos Csapás + archeryPerkDesc0: Minden szinttel plusz egy nyilat kapsz, hogyha barkácsolsz egyet + archeryPerkDesc1: A nyíl sebessége megnő 2%-kal minden szinttel + archeryPerkDesc2: Szintenként 5%-kal többet sebez a Spectral nyíl + archeryPerkDesc3: Szintenként 1%-kkal nő az esélye, hogy robban a nyíl, amit kilő a játékos + archeryPerkDesc4: Egyszerű bájitalokból is tud különleges nyilakat kraftolni a játékos ezzel a képeséggel + archeryPerkDesc5: A számszeríjakat is rögtön felhúzza a játékos ezzel a képességgel + archeryPerkDesc6: A tüzijátékok, amiket számszeríjból lő ki a játékos dupla annyit sebeznek + archeryPassiveTitle0: Passzív Zsetonok + archeryPassiveTitle1: Vissza + archeryPassiveTitle2: Képesség Zsetonok + archeryPassiveTitle3: Gyors Tüzelés időtartama + archeryPassiveTitle4: Varázsnyíl + archeryPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) + archeryPassiveDesc1: Visszamész a főmenübe + archeryPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni + archeryPassiveDesc3: 0.02 másodperccel megnöveli a Gyors Tüzelés képesség időtartamát + archeryPassiveDesc4: 0.05%-kal nő szintenként az esélye annak, hogy nem használódik el a nyíl, amikor íjat használ a játékos + beastMasteryPerkTitle0: Páncélos Kutyus + beastMasteryPerkTitle1: Harcieb + beastMasteryPerkTitle2: Egészséges Falatok + beastMasteryPerkTitle3: Tartsd be a másfél métert + beastMasteryPerkTitle4: Akrobata + beastMasteryPerkTitle5: Jegyzetek + beastMasteryPerkTitle6: Adrenalinbomba + beastMasteryPerkDesc0: 10%-kal kevesebb sebzést kap a játékos kutyái + beastMasteryPerkDesc1: 10%-kal többet sebez a játékos kutyái + beastMasteryPerkDesc2: Kutyák másfél szívet gyógyítanak magukon, hogyha megölnek valamit + beastMasteryPerkDesc3: 5% eséllyel rúgják hátrébb a kutyák az ellenfelet + beastMasteryPerkDesc4: Kutyák nem sebződnek, hogyha leesnek + beastMasteryPerkDesc5: Ha iránytűvel a kezében ránéz a játékos egy kutyára, vagy lóra, akkor meg tudja nézni a statisztikáit + beastMasteryPerkDesc6: Sarkanytús Rúgás mostmár Gyorsaság III erősítést ad + beastMasteryPassiveTitle0: Passzív Zsetonok + beastMasteryPassiveTitle1: Vissza + beastMasteryPassiveTitle2: Képesség Zsetonok + beastMasteryPassiveTitle3: Sarkanytús Rúgás időtartama + beastMasteryPassiveTitle4: Kritikus Harapás + beastMasteryPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) + beastMasteryPassiveDesc1: Visszamész a főmenübe + beastMasteryPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni + beastMasteryPassiveDesc3: 0.02 másodperccel megnöveli a Sarkanytús Rúgás időtartamát + beastMasteryPassiveDesc4: 0.025%-kal megnöveli az esélyét annak, hogy a kutya kritikus sebzést ejt + swordsmanshipPerkTitle0: Adrenalin + swordsmanshipPerkTitle1: Megállíthatatlan + swordsmanshipPerkTitle2: Adrenalin+ + swordsmanshipPerkTitle3: Tényleg Megállíthatatlan + swordsmanshipPerkTitle4: Vérszomjas + swordsmanshipPerkTitle5: Még élesebb! + swordsmanshipPerkTitle6: Kardmester + swordsmanshipPerkDesc0: Szintenként plusz két másodpercnyi gyorsaság erősítést ad a játékosnak, hogyha megöl egy szörnyet + swordsmanshipPerkDesc1: Szintenként plusz két másodpercnyi erő erősítést ad a játékosnak, hogyha megöl egy szörnyet + swordsmanshipPerkDesc2: Az Adrenalin gyorsaság II erősítést ad + swordsmanshipPerkDesc3: A Megállíthatatlan erő II erősítést ad + swordsmanshipPerkDesc4: Visszatölti a játékos ételsávját, hogyha karddal öl szörnyeket + swordsmanshipPerkDesc5: Gyors Támadás ezentúl ad plusz egy “sharpness” erősítést a játékos kardjára + swordsmanshipPerkDesc6: A kard +1 szívet sebez + swordsmanshipPassiveTitle0: Passzív Zsetonok + swordsmanshipPassiveTitle1: Vissza + swordsmanshipPassiveTitle2: Képesség Zsetonok + swordsmanshipPassiveTitle3: Gyors Támadás időtartama + swordsmanshipPassiveTitle4: Dubla találat + swordsmanshipPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) + swordsmanshipPassiveDesc1: Visszamész a főmenübe + swordsmanshipPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni + swordsmanshipPassiveDesc3: 0.02 másodperccel megnöveli a Gyors Támadás időtartamát + swordsmanshipPassiveDesc4: Megnöveli 0.02%-kal az esélyét, hogy a játékos kétszer üti meg a szörnyet (a második ütés 50%-os sebzést okoz) + defensePerkTitle0: Gyógyító + defensePerkTitle1: Stiffen + defensePerkTitle2: Hard Headed + defensePerkTitle3: Stiffen+ + defensePerkTitle4: Gift From Above + defensePerkTitle5: Stronger Legs + defensePerkTitle6: Hearty + defensePerkDesc0: Gain +3s of regen per level on kill + defensePerkDesc1: +2% chance to gain resistance I for 5s when hit + defensePerkDesc2: Hard Body decreases damage by an additional 6.6% per level + defensePerkDesc3: +2% chance to gain resistance II for 5s when hit + defensePerkDesc4: Stone Solid now grants 4 absorption hearts for ability length + +1 minute + defensePerkDesc5: Stone Solid now gives slowness I instead of slowness IV + defensePerkDesc6: +2 hearts permanently + defensePassiveTitle0: Passzív Zsetonok + defensePassiveTitle1: Vissza + defensePassiveTitle2: Képesség Zsetonok + defensePassiveTitle3: Stone Solid Duration + defensePassiveTitle4: Hard Body + defensePassiveTitle5: Dupla Droppok (Hostile Mobs) + defensePassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) + defensePassiveDesc1: Visszamész a főmenübe + defensePassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni + defensePassiveDesc3: Increases duration of Stone Solid by 0.02s + defensePassiveDesc4: Increases chance to take reduced (base -33%) damage by 0.01% + per level + defensePassiveDesc5: Increases chance to receive double drops from aggressive + mobs by 0.05% + axeMasteryPerkTitle0: Greater Axe + axeMasteryPerkTitle1: Holy Axe + axeMasteryPerkTitle2: Revitalized + axeMasteryPerkTitle3: Warrior Blood + axeMasteryPerkTitle4: Earthquake + axeMasteryPerkTitle5: Better Crits + axeMasteryPerkTitle6: Axe Man + axeMasteryPerkDesc0: Great Axe damage radius increases by 1 block per level + axeMasteryPerkDesc1: +2% chance for lighting to strike mobs on axe hit + axeMasteryPerkDesc2: +1% chance for full heal on kill per level + axeMasteryPerkDesc3: +3 s per level of Strength I on kills with an axe + axeMasteryPerkDesc4: Ability's AOE damage is doubled (25% -> 50% of damage) + axeMasteryPerkDesc5: Divine Crits now have 1.6x multiplier instead of 1.25x + axeMasteryPerkDesc6: Axes permanently do +1 heart of damage + axeMasteryPassiveTitle0: Passzív Zsetonok + axeMasteryPassiveTitle1: Vissza + axeMasteryPassiveTitle2: Képesség Zsetonok + axeMasteryPassiveTitle3: Great Axe Duration + axeMasteryPassiveTitle4: Divine Crits + axeMasteryPassiveDesc0: Ezeket a Zsetonokat a passzív képességekre tudod elhasználni (színezékek) + axeMasteryPassiveDesc1: Visszamész a főmenübe + axeMasteryPassiveDesc2: Ezeket a Zsetonokat a képesség fában tudod elhasználni + axeMasteryPassiveDesc3: Increases duration of Great Axe by 0.02s + axeMasteryPassiveDesc4: Increases random crit chance (base 1.25x damage) by 0.01% + repairPerkTitle0: Salvaging + repairPerkTitle1: Resourceful + repairPerkTitle2: Magic Repair Mastery + repairPerkDesc0: Get more materials on average from salvaging + repairPerkDesc1: +10% chance of keeping material used when repairing + repairPerkDesc2: Guarenteed to keep enchants on repair + repairPassiveTitle0: Vissza + repairPassiveTitle1: Képesség Zsetonok + repairPassiveTitle2: Proficiency + repairPassiveDesc0: Visszamész a főmenübe + repairPassiveDesc1: Ezeket a Zsetonokat a képesség fában tudod elhasználni + repairPassiveDesc2: Materials restore more durability on repair + agilityPerkTitle0: Dodge + agilityPerkTitle1: Steel Bones + agilityPerkTitle2: Graceful Feet + agilityPerkDesc0: +4% chance to dodge attacks per level + agilityPerkDesc1: -10% fall damage per level + agilityPerkDesc2: Permanent speed I buff (toggleable by /speedToggle) + agilityPassiveTitle0: Vissza + agilityPassiveTitle1: Képesség Zsetonok + agilityPassiveTitle2: Roll + agilityPassiveDesc0: Visszamész a főmenübe + agilityPassiveDesc1: Ezeket a Zsetonokat a képesség fában tudod elhasználni + agilityPassiveDesc2: Chance to roll and take reduced fall damage + alchemyPerkTitle0: Alchemical Summoning + alchemyPerkTitle1: Ancient Knowledge + alchemyPerkTitle2: Potion Master + alchemyPerkDesc0: Allows crafting of some potions without a brewing stand + alchemyPerkDesc1: Unlocks ability to brew new potions + alchemyPerkDesc2: All used potions are increased in level by 1 (toggleable with + /togglePotion) + alchemyPassiveTitle0: Vissza + alchemyPassiveTitle1: Képesség Zsetonok + alchemyPassiveTitle2: Half-life+ + alchemyPassiveDesc0: Visszamész a főmenübe + alchemyPassiveDesc1: Ezeket a Zsetonokat a képesség fában tudod elhasználni + alchemyPassiveDesc2: Increase in duration of potions when used + smeltingPerkTitle0: Fuel Efficiency + smeltingPerkTitle1: Double Smelt + smeltingPerkTitle2: Flame Pickaxe + smeltingPerkDesc0: Fuel last +20% longer per level + smeltingPerkDesc1: +5% chance for smelted ore to be doubled per level + smeltingPerkDesc2: Mined ores are instantly smelted (toggleable with /toggleFlamePick) + smeltingPassiveTitle0: Vissza + smeltingPassiveTitle1: Képesség Zsetonok + smeltingPassiveTitle2: Fuel Speed + smeltingPassiveDesc0: Visszamész a főmenübe + smeltingPassiveDesc1: Ezeket a Zsetonokat a képesség fában tudod elhasználni + smeltingPassiveDesc2: Increasing cooking speed + enchantingPerkTitle0: Okos Bájoló + enchantingPerkTitle1: Könyvmoly + enchantingPerkTitle2: Örök Tudás + enchantingPerkDesc0: Eggyel kevesebb szint kell, hogy bűvölje az eszközét a játékos, és megjavítani is eggyel kevesebb tapasztalat pontba kerül + enchantingPerkDesc1: A játékos ezentúl tud barkácsolni pár bűvölt könyvet + enchantingPerkDesc2: A játékos megtartja a tapasztalat pontját a halála során + enchantingPassiveTitle0: Vissza + enchantingPassiveTitle1: Képesség Zsetonok + enchantingPassiveTitle2: Tartalékolás + enchantingPassiveDesc0: Visszamész a főmenübe + enchantingPassiveDesc1: Ezeket a Zsetonokat a képesség fában tudod elhasználni + enchantingPassiveDesc2: Megnő a tapasztalatpontok száma, amit a játékos szerezhet + globalPerkTitle0: Gyűjtögető + globalPerkTitle1: Diák + globalPerkTitle2: Harcos + globalPerkTitle3: Kemény munkás + globalPerkTitle4: Kutató + globalPerkTitle5: Edző + globalPerkTitle6: Szanitéc + globalPerkTitle7: Léleklopó + globalPerkTitle8: Avatár + globalPerkTitle9: Ezermester + globalPerkDesc0: +20% TP-t kapsz az ásásért, favágásért, bányászásért, földművelésért és horgászásért + globalPerkDesc1: +20% TP-t kapsz a javításért, ugrás és futásért, kotyvasztásért, olvasztásért és a bűvülésért + globalPerkDesc2: +20% TP-t kapsz a íjászatban, kardforgatásban, védelemben, balta használatért és a természet feletti uralomért + globalPerkDesc3: +1 képesség zseton minden Gyűjtögető képességhez + globalPerkDesc4: +1 képesség zseton minden Diák képességhez + globalPerkDesc5: +1 képesség zseton minden Harcos képességhez + globalPerkDesc6: Halál esetén 50% esély van rá, hogy az értékes tárgyakat megtartja a játékos + globalPerkDesc7: A megölt szörnyek lelkét ki tudod szívni, ezzel tudod nullázni a képesség fáid. + globalPerkDesc8: 10% esély van rá, hogy 10 másodpercig minden erősítést megkap a játékos, hogyha egy olyan támadás éri, amitől meghalna + globalPerkDesc9: Minden képesség töltési ideje csökken 33%-kal + globalPassiveTitle0: Globális Zsetonok + globalPassiveTitle1: Vissza + globalPassiveDesc0: Ezeket a Zsetonokat a képesség fában tudod elhasználni + globalPassiveDesc1: Visszamész a főmenübe + cannotRepair: Nem tudsz javítani, amíg a képességed be van kapcsolva! + cannotSalvage: You cannot salvage while this ability is active! + spite: Minden jó valami rosszból származik + refundSkill: szükéges, hogy nullázd a képesség fádat + refundSkill2: hogy nullázd a képesség fádat + needToUnlock: Fel kell oldanod + perkRequirement: Legalább 2 képesség zsetonnak kell lennie az előző képességeknél, hogy felold ezt a képességet + perkRequirementM: Összesen minimun 10 képesség zsetonnak kell a képességfádban lennie, hogy feloldj egy mester képességet + noSkillTokens: Nincsen egy képesség tokened sem + noPassiveTokens: Nincsen egy passzív tokened sem + maxedOutPerk: Már kimaxoltad ezt a képességed! + requiredGlobalPerks0: Fel kell oldanod az előző képességet, hogy ezt felold + requiredGlobalPerks1: képességet fel kell oldanod, hogy aztán ezt is fel tudd + requiredGlobalPerks2: képességre szükség van, hogy ezt is felold + requiredGlobalPerks3: Minden globális képességre szükséged van, hogy ezt is felold + craftRequirement: tudásra is szükséged van, hogy össze tudd barkácsolni ezt + roll: PÖRGETÉS + dodge: KITÉRÉS + prepare: Előkészíted + rest: Pihenteted + activated: aktiválva + ended: véget ért + readyToUse: újra készen áll a használatra + cooldown: újratöltési idő + rapidFire: Gyors Tüzelés + bow: íj + greatAxe: Nagy Balta + axe: balta + spurKick: Sarkanytús Rúgás + leg: láb + stoneSoldier: KőKatona + yourself: saját magad + bigDig: Gödörkészítő + shovel: ásó + naturalRegeneration: Természetes Regenerálódás + hoe: kapa + superBait: Szuper Csali + fishingRod: horgászbot + berserkPick: Gyors Csákány + pickaxe: csákány + swiftStrikes: Gyors Támadás + sword: kard + timber: Favágó + hyperHorse: Ez a ló már fel van gyorsítva! + magicForce: A mágikus erő véget vet a képességednek! + rob: Rablás + repairFail0: Nem vagy elég tapasztalt, hogy meg tudd javítani ezt a tárgyat + repairFail1: Semmilyen értékes alkatrészt sem tudtál kiszedni ebből + repairFail2: Nem sikerült megtartanod az eszközöd bájait + treeTooBig0: Ez a fa túl nagy, hogy egyben kiásd!" + treeTooBig1: Ezt a fát nem tudod kivágni egyben! + noPermission: Ehhez a parancshoz nincs jogod! + improperArguments: Nem megfelelő argumentum! Ezt próbáld meg + totalPlayTime: Összes játszott idő + clickForOptions: Kattints ide, hogy megnézd a beállításokat + unknownCommand: Ismeretlen parancs + expToLevel: EXP to next level + playerName: playerName + skillName: skillName (in English) + page: page + on0: "ON" + off0: "OFF" + onOrOff: ON/OFF + manuallyToggles: Manually toggles + commandDesc0: Opens the main GUI with all skills + commandDesc1: Opens a skill tree GUI of choice + commandDesc2: Opens the configuration GUI + commandDesc3: Gives a player of choice EXP in a specified skill + commandDesc4: Sets a given player's level in a specified skill + commandDesc5: Resets a player's stats in a specified skill (does not refund stats) + commandDesc6: Displays a leaderboard for a specified stat + commandDesc7: Provides a link to a plugin information page + commandDesc8: Attempts to enchant an item in the users hand at a specified level + informationURL: Information URL (Google Docs) + click: CLICK + levelArgument: Level argument must be less than 40 + leaderboard: Leaderboard + playerOffline: That player is not online + onlyIncrease: Please only increase exp with this command, otherwise, use /frpg statReset then /frpg giveEXP + amount: amount + unlockToggle: To use this command you must unlock + levelUpNotif: Level Up Notifications + abilityPreparationNotif: Ability Preparation Notifications + yes0: "YES" + no0: "NO" + warning: WARNING + souls: souls + refundSkillTree0: Refunding a skill tree costs + refundSkillTree1: and is not reversible, are you sure you want to + refundSkillTree2: refund the + skill: skill + backToSkillTree: Takes you back to the skill tree + miningPerkDesc0_1: 2 seconds of Haste I after mining any ore + miningPerkDesc0_2: 5 seconds of Haste I after mining any ore + miningPerkDesc0_3: 10 seconds of Haste I after mining any ore + miningPerkDesc0_4: 5 seconds of Haste II after mining any ore, followed by 5 seconds of Haste I + miningPerkDesc0_5: 10 seconds of Haste II after mining any ore + woodcuttingPerkDesc3_1: Leaves may now drop a + common: common + uncommon: uncommon + rare: rare + veryRare: very rare + legendary: legendary + fishingPerkDesc1_1: Unlocks treasure tier + farmingPerkDesc1_1: Gain the ability to craft + cowSpawnEgg: cow spawn egg + beeSpawnEgg: bee spawn egg + mooshroomSpawnEgg: mooshroom spawn egg + horseSpawnEgg: horse spawn egg + slimeSpawnEgg: slime spawn egg + diggingPerkDesc0_1: You may now dig up a + defensePerkDesc0_1: Gain +3 s of regen per level on kills + defensePerkDesc0_2: Gain +0.5 hearts per level instantly on kills + duration: Duration + likelihood: Likelihood + junkChance: Junk Chance + locked: LOCKED + unlocked: UNLOCKED + cowEgg: Cow Egg + beeEgg: Bee Egg + mooshroomEgg: Mooshroom Egg + horseEgg: Horse Egg + slimeEgg: Slime Egg + tippedArrows: Tipped Arrows + toggle: Toggle + refundSkillTitle: Refund Skill + refundSkillTreeDesc: Click to refund this skill tree + enchantingPerkDesc1_0: Unlocks ability to craft + enchantingPerkDesc1_1: Power I and Efficiency I enchanted books (costs 1 level to craft)" + enchantingPerkDesc1_2: Sharpness I and Protection I enchanted books (costs 1 level to craft) + enchantingPerkDesc1_3: Luck of the Sea I and Lure I enchanted books (costs 1 level to craft) + enchantingPerkDesc1_4: Depth Strider I and Frost Walker I enchanted books (costs 1 level to craft) + enchantingPerkDesc1_5: Mending (costs 10 levels to craft) and Fortune I (costs 2 levels to craft) enchanted books + repairPerkDesc0_1: Gain more materials from salvaging on average + repairPerkDesc0_2: Gain more materials from salvaging on average, salvaging now stores item enchants in a book + xpBoost: XP Boost + speedBoost: Speed Boost + timeExtension: Time Extension + enchantingCraft0: Power I Book + enchantingCraft1: Efficiency I Book + enchantingCraft2: Sharpness I Book + enchantingCraft3: Protection I Book + enchantingCraft4: Luck of the Sea I Book + enchantingCraft5: Lure I Book + enchantingCraft6: Frost Walker I Book + enchantingCraft7: Depth Strider I Book + enchantingCraft8: Mending Book + enchantingCraft9: Fortune I Book + commandDesc9: Sets the souls for a specified player + commandDesc10: Sets the skill or passive tokens in specified skill for a specified player + commandDesc11: Sets the global tokens for a specified player + commandDesc12: Saves stats of all players or a specified player + status: STATUS + complete: COMPLETE + incomplete: INCOMPLETE + try0: "try" + passiveImprove: Your passive perks improve every level! + increasedBy: increased by + expIncrease: All EXP increased by + personalMultiplier: Personal Multiplier + translators: Translators + commandDesc13: Sets the personal multiplier for a specified player + abilityDescription: Ability Description + abilityDescription_digging: Temporarily adds 5 levels of effiency to your shovel. Activated by right-clicking a shovel then breaking a block. + abilityDescription_woodcutting: Temporarily makes axes break an entire tree with one block break. Activated by right-clicking an axe then breaking a log. + abilityDescription_mining: Temporarily adds 5 levels of effiency to your pickaxe. Activated by right-clicking a pickaxe then breaking block. + abilityDescription_farming: Temporarily makes crops broken with a hoe automatically replant. Activated by right-clicking a hoe then breaking a crop. + abilityDescription_fishing: Temporarily makes fishing rods instantly catch a fish. Activated by left-clicking a fishing rod then fishing in water. + abilityDescription_archery: Temporarily makes all arrows fired at max speed. Activated by left-clicking a bow then shooting an arrow. + abilityDescription_beastMastery: Temporarily gives your horse a speed buff. Activated by right-clicking while on a horse then left-clicking. + abilityDescription_swordsmanship: Temporarily removes swinging cooldown on swords. Activated by right-clicking a sword then hitting a mob. + abilityDescription_defense: Temporarily gives the user Resistance and Slowness effects. Activated by right-clicking with an empty hand then hitting a mob. + abilityDescription_axeMastery: Temporarily makes axes do damage to all mobs in a certain radius. Activated by right-clicking an axe then hitting a mob. + alchemyPerkDesc1_0: Unlocks ability to brew + alchemyPerkDesc0_0: A crafting table can be used to craft + triggerAbilities: Trigger Abilities + showEXPBar: Show EXP Bar + disabledSkill: This skill is disabled + skillConfigDesc: Takes you to configuration menu for this skill + lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" + exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" + potionAbsorption: Potion of Absorption + potionBadOmen: Potion of Bad Omen + potionBlindess: Potion of Blindess + potionConduitPower: Potion of Conduit Power + potionResistance: Potion of Resistance + potionDolphinsGrace: Potion of Dolphins Grace + potionHaste: Potion of Haste + potionFireResistance: Potion of Fire Resistance + potionGlowing: Potion of Glowing + potionHarm: Potion of Harm + potionHealing: Potion of Healing + potionHealthBoost: Potion of Health Boost + potiontheHero: Potion of the Hero + potionHunger: Potion of Hunger + potionStrength: Potion of Strength + potionInvsibility: Potion of Invsibility + potionJump: Potion of Jump + potionLuck: Potion of Luck + potionNightVision: Potion of Night Vision + potionRegeneration: Potion of Regeneration + potionSaturation: Potion of Saturation + potionSlowness: Potion of Slowness + potionFatigue: Potion of Fatigue + potionSlowFalling: Potion of Slow Falling + potionSpeed: Potion of Speed + potionBadLuck: Potion of Bad Luck + potionWaterBreathing: Potion of Water Breathing + potionWeakness: Potion of Weakness + potionDecay: Potion of Decay + potionAwkward: Awkward Potion + potionUncraftable: Uncraftable Potion + potionMundane: Mundane Potion + potionTurtleMaster: Potion of the Turtle Master + potionThick: Thick Potion + potionWater: Water Bottle + ingredient: Ingredient + usedToBrew: Is used to brew + costs: costs + xpLevel: Minecraft XP Level + xpLevels: Minecraft XP Levels + craftXPRequirement: This recipe requires at least + bedGUI: You cannot use this command while in bed! + statsUpdated: Your stats were changed to be consistent with a new EXP curve. + All skill trees and passive perks have been reset. All tokens must be re-invested. + timeRemaining: Time Remaining + numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed + commandDesc14: Resets the cooldown period for a skill to 0 seconds + commandDesc15: Looks up a player's FreeRPG stats + repairUnsafeEnchant: This item is too powerful to be repaired + salvageUnsafeEnchant: This item is too powerful to be salvaged + rank: Rank + stats: stats + outOf: out of + playerNotInLeaderboard: That player is not on any leaderboards + virtual: Virtual + commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) - frFR: #Translated by Temuel - languageName: Français - englishLanguageName: French - translationCredit: Temuel - global: Global - digging: Forage - woodcutting: Coupe du bois - mining: Minage - farming: Agriculture - fishing: Pêche - archery: Archerie - beastMastery: Maîtrise des bêtes - swordsmanship: Maniement de l'épée - defense: Défense - axeMastery: Maîtrise de la hache - repair: Réparation - alchemy: Alchemie - agility: Agilité - smelting: Cuisson - enchanting: Enchantement - information: Information - configuration: Configuration - level: Niveau - experience: Experience - toNext: au prochain - total: Total - diggingPerkTitle0: Mo' drops - diggingPerkTitle1: Double loot - diggingPerkTitle2: Drops rares - diggingPerkTitle3: Voleur d'âme - diggingPerkTitle4: Dénicheur de silex - diggingPerkTitle5: Chevalier de la pelle - diggingPerkTitle6: Mega forage - diggingPerkDesc0: Augmente la table des drops de 1 objet par niveau - diggingPerkDesc1: +5% de chances de recevoir un double loot a chaque niveau (lorsqu'un loot doit être reçu) - diggingPerkDesc2: Augmente d'avantage la table des drops des objets par niveau - diggingPerkDesc3: Le sable des âmes a +5% de chances de drop un loot par niveau - diggingPerkDesc4: Le gravier a 100% de chances de drop du silex (Activable avec /flintToggle) - diggingPerkDesc5: Dégâts des pelles x2 - diggingPerkDesc6: Quand vous utilisez cette compétence vous cassez désormais une section de blocs de 3x3 (20% d'avoir des loots quand cette compétence est active) - diggingPassiveTitle0: Jetons passif - diggingPassiveTitle1: Retour - diggingPassiveTitle2: Jetons compétence - diggingPassiveTitle3: Durée de Mega forage - diggingPassiveTitle4: Chances d'obtenir un loot - diggingPassiveDesc0: Jetons a investir dans les passifs (teintures) - diggingPassiveDesc1: Retourner au menu principal des compétences - diggingPassiveDesc2: Jetons a investir dans les compétences - diggingPassiveDesc3: Augmente la durée de Mega forage de 0.02 s - diggingPassiveDesc4: Augmente la chance de trouver un loot en creusant de 0.005% - woodcuttingPerkTitle0: Racines zélées - woodcuttingPerkTitle1: Nouvelles armes - woodcuttingPerkTitle2: Savoir caché - woodcuttingPerkTitle3: Charognard de feuilles - woodcuttingPerkTitle4: Bûcheron+ - woodcuttingPerkTitle5: Souffleur de feuilles - woodcuttingPerkTitle6: Maître Bûcheron - woodcuttingPerkDesc0: +20% de chances que les souches drop 1 XP Minecraft par niveau - woodcuttingPerkDesc1: +12s de Célérité par niveau après la première souche coupée en 5 minutes - woodcuttingPerkDesc2: Les souches ont +0.2% de chances de droper un grimoire enchanté par niveau - woodcuttingPerkDesc3: Les feuilles ont 1% de chances de drop +1 loot par niveau - woodcuttingPerkDesc4: La limite de destruction de Bûcheron passe de 64 a 128 - woodcuttingPerkDesc5: Break a large section of leaves using an axe (toggleable with /leafBlowerToggle) - woodcuttingPerkDesc6: Double drops, Racines zélées, et Savoir caché sont désormais tous actifs avec Bûcheron (leurs effets sont réduits de 50%) - woodcuttingPassiveTitle0: Jetons passif - woodcuttingPassiveTitle1: Retour - woodcuttingPassiveTitle2: Jetons compétence - woodcuttingPassiveTitle3: Durée de Bûcheron - woodcuttingPassiveTitle4: Double Drops - woodcuttingPassiveDesc0: Jetons a investir dans les passifs (teintures) - woodcuttingPassiveDesc1: Retourner au menu principal des compétences - woodcuttingPassiveDesc2: Jetons a investir dans les compétences - woodcuttingPassiveDesc3: Augmente la durée de Bûcheron de 0.02s - woodcuttingPassiveDesc4: Augmente les chances d'obtenir un double drop de 0.05% - miningPerkTitle0: Célérité maitrisée - miningPerkTitle1: Plus de bombes - miningPerkTitle2: Dénicheur de trésor - miningPerkTitle3: Bomb-boyage - miningPerkTitle4: Mineur de gisement - miningPerkTitle5: Demolition Man - miningPerkTitle6: Triple Trouble - miningPerkDesc0: Gain de Célérité après chaque minage de minerai pour chaque niveau - miningPerkDesc1: La recette de fabrication de la TNT produit +1 bloc pour chaque niveau - miningPerkDesc2: Lorsque cette compétence est utilisée sur une pierre, +1% de chance par niveau d'obtenir un minerai (de l'expérience d'compétence est obtenue avec le minerai) - miningPerkDesc3: Augmente le rayon d'explosion de la TNT (quand elle est allumé avec un briquet) pour chaque niveau - miningPerkDesc4: L'intégralité des minerais d'une veine sont instantanément détruits lorsque un bloc est détruit (activable) - miningPerkDesc5: Les explosions de TNT ne vont font plus de dégâts - miningPerkDesc6: Double drops devient triple drops - miningPassiveTitle0: Jetons passif - miningPassiveTitle1: Retour - miningPassiveTitle2: Jetons compétence - miningPassiveTitle3: Durée de Mineur Berserk - miningPassiveTitle4: Double Drops - miningPassiveTitle5: Mineur explosif - miningPassiveDesc0: Jetons a investir dans les passifs (teintures) - miningPassiveDesc1: Retourner au menu principal des compétences - miningPassiveDesc2: Jetons a investir dans les compétences - miningPassiveDesc3: Augmente la durée de Mineur berserk de 0.02s - miningPassiveDesc4: Augmente les chances d'obtenir un double drop sur les minerais de 0.05% - miningPassiveDesc5: Augmente les chances d'obtenir des minerais sur les blocs détruit par de la TNT de 0.01% (Plus de blocs détruits = Plus de chance de drop) - farmingPerkTitle0: Engrais+ - farmingPerkTitle1: Eleveur de bétail - farmingPerkTitle2: Régime de fermier - farmingPerkTitle3: Carnivore - farmingPerkTitle4: Mains vertes - farmingPerkTitle5: Hormones de croissange - farmingPerkTitle6: Faire un avec la nature - farmingPerkDesc0: +10% de chances de ne pas consommer la poudre d'os lorsqu'elle est utilisée - farmingPerkDesc1: Permet de fabriquer des oeufs supplémentaires pour chaque niveau - farmingPerkDesc2: La nourriture que vous produisez est +20% plus efficace à restaurer votre faim pour chaque niveau - farmingPerkDesc3: la viande est +20% plus efficace à restaurer votre faim pour chaque niveau - farmingPerkDesc4: Capacité de replanter des cultures avec une plus grande chance de replanter à des stades de croissance ultérieurs; cette capacité influe maintenant sur les pastèques et les citrouilles - farmingPerkDesc5: Le sucre peut-être utilisé sur les bébés animaux pour les faire grandir instantanément - farmingPerkDesc6: Vous obtenez Regénération lorsque vous restez immobile sur l'herbe - farmingPassiveTitle0: Jetons passif - farmingPassiveTitle1: Retour - farmingPassiveTitle2: Jetons compétence - farmingPassiveTitle3: Durée de Regénération Naturelle - farmingPassiveTitle4: Double Drops (Récoltes) - farmingPassiveTitle5: Double Drops (Animaux) - farmingPassiveDesc0: Jetons a investir dans les passifs (teintures) - farmingPassiveDesc1: Retourner au menu principal des compétences - farmingPassiveDesc2: Jetons a investir dans les compétences - farmingPassiveDesc3: Augmente la durée de Regénération Naturelle de 0.02s - farmingPassiveDesc4: Augmente la chance d'obtenir le double de récoltes de 0.05% - farmingPassiveDesc5: Augmente la chance d'obtenir un double loot sur le bétail de 0.05% - fishingPerkTitle0: Vol - fishingPerkTitle1: Charognard - fishingPerkTitle2: Régime du pêcheur - fishingPerkTitle3: Filtration - fishingPerkTitle4: Grappin - fishingPerkTitle5: Canne en feu - fishingPerkTitle6: Homme poisson - fishingPerkDesc0: +15% de chances d'extraire un objet d'un mob pour chaque niveau - fishingPerkDesc1: Débloque un nouveau tier de loot en pêche - fishingPerkDesc2: Les poissons restaurent +20% de faim pour chaque niveau - fishingPerkDesc3: Les plus haut tiers (II-V) de loot deviennete plus commun, les tiers plus bas (I) deviennent plus rares - fishingPerkDesc4: Les cannes à pêche se comportent désormais comme des grappins(activable avec /grappleToggle) - fishingPerkDesc5: Les poissons sont désormaisa déjà cuisinés lorsqu'ils sont pêchés, certains loots sont changés (toggleable with /hotRodToggle) - fishingPerkDesc6: Vous obtenez le buff vision nocturne sous l'eau et le buff Grâce du dauphin quand vous êtes dans l'eau - fishingPassiveTitle0: Jetons passif - fishingPassiveTitle1: Retour - fishingPassiveTitle2: Jetons compétence - fishingPassiveTitle3: Durée du Super Appât - fishingPassiveTitle4: Coup double - fishingPassiveTitle5: Dénicheur de trésor - fishingPassiveDesc0: Jetons a investir dans les passifs (teintures) - fishingPassiveDesc1: Retourner au menu principal des compétences - fishingPassiveDesc2: Jetons a investir dans les compétences - fishingPassiveDesc3: Augmente la durée du Super Appât de 0.01s - fishingPassiveDesc4: Augmente la chance d'obtenir un double drop de 0.05% - fishingPassiveDesc5: Diminue la chance de pêcher des déchets de 0.005%, augmente la chance d'obtenir un loot de 0.005% - archeryPerkTitle0: Flèches supplémentaires - archeryPerkTitle1: Sniper - archeryPerkTitle2: Flèche de lumière - archeryPerkTitle3: Flèches explosives - archeryPerkTitle4: Flèches magiques - archeryPerkTitle5: Recharge rapide d'arbalète - archeryPerkTitle6: Tir meurtrier - archeryPerkDesc0: +1 flèche obtenue par fabrication pour chaque niveau - archeryPerkDesc1: Augmente la vitesse des flèches de +2% par niveau (augmente les dommages de ~4%/niveau) - archeryPerkDesc2: Augmente les dégâts de Flèche Spectrale de +5% par niveau - archeryPerkDesc3: Les flèches ont +1% de produire une explosion au toucher - archeryPerkDesc4: Permet la fabrication de toutes les flèches à effet avec des potions jetables a la place des potions persistantes - archeryPerkDesc5: L'abilité peut désormais être utilisé avec les arbalettes et permet de faire des tirs instantanés - archeryPerkDesc6: Les dégâts des feux d'artifice tirés avec les flèches sont doublés (jusqu'â 16 coeurs de dégâts) - archeryPassiveTitle0: Jetons passif - archeryPassiveTitle1: Retour - archeryPassiveTitle2: Jetons compétence - archeryPassiveTitle3: Durée de Tir Rapide - archeryPassiveTitle4: Retraite - archeryPassiveDesc0: Jetons a investir dans les passifs (teintures) - archeryPassiveDesc1: Retourner au menu principal des compétences - archeryPassiveDesc2: Jetons a investir dans les compétences - archeryPassiveDesc3: Augmente la durée de Tir Rapide de 0.02s - archeryPassiveDesc4: Augmente les chances de tirer une flèche sans en consommer de 0.05% par niveau - beastMasteryPerkTitle0: Fourrure épaisse - beastMasteryPerkTitle1: Crocs aiguisés - beastMasteryPerkTitle2: Morsure regénérante - beastMasteryPerkTitle3: N'approche pas - beastMasteryPerkTitle4: Loup agile - beastMasteryPerkTitle5: Identification - beastMasteryPerkTitle6: Boost d'adrénaline - beastMasteryPerkDesc0: Les loups prennent -10% de dégâts par niveau - beastMasteryPerkDesc1: Les loups font +10% de dégâts par niveau - beastMasteryPerkDesc2: Les loups gagnent +1/2 coeur(s) en tuant des ennemis pour chaque niveau - beastMasteryPerkDesc3: Les loups ont +5% de chances de repousser les ennemis - beastMasteryPerkDesc4: Les loups ne subissent plus de dégâts de chute - beastMasteryPerkDesc5: Affiche les statistiques des chevaux et des loups lorsque vous utilisez une boussole dessus - beastMasteryPerkDesc6: Le buff Coup d'éperon buff est maintenant Vitesse III - beastMasteryPassiveTitle0: Jetons passif - beastMasteryPassiveTitle1: Retour - beastMasteryPassiveTitle2: Jetons compétence - beastMasteryPassiveTitle3: Coup d'éperon Duration - beastMasteryPassiveTitle4: Morsure sauvage - beastMasteryPassiveDesc0: Jetons à investir dans les passifs (teintures) - beastMasteryPassiveDesc1: Retourner au menu principal des compétences - beastMasteryPassiveDesc2: Jetons à investir dans les compétences - beastMasteryPassiveDesc3: Augmente la durée de Coup d'éperon de 0.02s - beastMasteryPassiveDesc4: Augmente les chances de coup critique des loups de 0.025% - swordsmanshipPerkTitle0: Adrenaline - swordsmanshipPerkTitle1: Massacre - swordsmanshipPerkTitle2: Adrenaline+ - swordsmanshipPerkTitle3: Folie meurtrière - swordsmanshipPerkTitle4: Soif de sang - swordsmanshipPerkTitle5: Tranchant! - swordsmanshipPerkTitle6: Maîtrise de l'épée - swordsmanshipPerkDesc0: Tuer un monstre hostile avec une épée donne +2s de vitesser par niveau - swordsmanshipPerkDesc1: Tuer un monstre hostile avec une épée donne +2s de force par niveau - swordsmanshipPerkDesc2: +20% du buff Vitesse I reçu avec Adrenaline devient Vitesse II - swordsmanshipPerkDesc3: +20% du buff Force I reçu avec Folie meurtrière devient Force II - swordsmanshipPerkDesc4: Restaure la barre de faim en tuant certains monstres avec votre épée - swordsmanshipPerkDesc5: Frappes rapides ajoute désormais un niveau de tranchant a votre épée - swordsmanshipPerkDesc6: Les épées font désormais +1 coeur de dégâts de manière permanente - swordsmanshipPassiveTitle0: Jetons passif - swordsmanshipPassiveTitle1: Retour - swordsmanshipPassiveTitle2: Jetons compétence - swordsmanshipPassiveTitle3: Durée de Frappes Rapides - swordsmanshipPassiveTitle4: Coup double - swordsmanshipPassiveDesc0: Jetons à investir dans les passifs (teintures) - swordsmanshipPassiveDesc1: Retourner au menu principal des compétences - swordsmanshipPassiveDesc2: Jetons à investir dans les compétences - swordsmanshipPassiveDesc3: Augmente la durée de Frappes Rapides de 0.02s - swordsmanshipPassiveDesc4: Augmente les chances de frapper un monstre 2 fois de 0.02% (Les dégats du seconde coup sont de 50%) - defensePerkTitle0: Soigneur - defensePerkTitle1: Carapace - defensePerkTitle2: Tête dure - defensePerkTitle3: Carapace+ - defensePerkTitle4: Cadeau du ciel - defensePerkTitle5: Jambes solides - defensePerkTitle6: Vitalité - defensePerkDesc0: Ajoute +3s de regénération par niveau après avoir tuer un monstre - defensePerkDesc1: +2% de chances d'obtenir le buff Résistance I pendant 5s si vous êtes frappés - defensePerkDesc2: Corps Robuste reduit les dommages de 6.6% supplémentaires par niveau - defensePerkDesc3: +2% de chances d'obtenir le buff Résistance II pendant 5s si vous êtes frappés - defensePerkDesc4: Indestructible accorde désormais un bouclier absorbant de 4 coeurs durant l'aptidtude +1 minute - defensePerkDesc5: Indestructible donne désormais le buff Lenteur I au lieu de Lenteur IV - defensePerkDesc6: +2 coeurs de manière permanente - defensePassiveTitle0: Jetons passif - defensePassiveTitle1: Retour - defensePassiveTitle2: Jetons compétence - defensePassiveTitle3: Durée d'Indestructible - defensePassiveTitle4: Corps Solide - defensePassiveTitle5: Double Drops (monstres hostiles) - defensePassiveDesc0: Jetons à investir dans les passifs (teintures) - defensePassiveDesc1: Retourner au menu principal des compétences - defensePassiveDesc2: Jetons à investir dans les compétences - defensePassiveDesc3: Augmente la durée d'Indestructible de 0.02s - defensePassiveDesc4: Augmente les chances de réduire (-33% de base) les dégâts reçus de 0.01% par niveau - defensePassiveDesc5: Augmente les chances de double drops sur les monstres de 0.05% - axeMasteryPerkTitle0: Hache Suprême - axeMasteryPerkTitle1: Hache Sainte - axeMasteryPerkTitle2: Revitalisé - axeMasteryPerkTitle3: Sang guerrier - axeMasteryPerkTitle4: Séisme - axeMasteryPerkTitle5: Critique+ - axeMasteryPerkTitle6: Hacheur - axeMasteryPerkDesc0: Le rayon des dommages de Hache Suprême est augmenté de 1 bloc par niveau - axeMasteryPerkDesc1: +2% de chances qu'un éclaire frappe le monstre touché par une attaque à la hache - axeMasteryPerkDesc2: +1% de chances par niveau de récupérer toute votre vie en tuant un monstre à la hache - axeMasteryPerkDesc3: +3s par niveau de buff Force I en tuant un monstre à la hache - axeMasteryPerkDesc4: Les dégâts de zone de l'compétence sont doublés (25% -> 50% de dégâts) - axeMasteryPerkDesc5: Crtitiques Divins possède désormais un multiplicateur de 1.6x au lieu de 1.25x - axeMasteryPerkDesc6: Les haches font désormais +1 coeur de dégâts de manière permanente - axeMasteryPassiveTitle0: Jetons passif - axeMasteryPassiveTitle1: Retour - axeMasteryPassiveTitle2: Jetons compétence - axeMasteryPassiveTitle3: Durée de Hache Suprême - axeMasteryPassiveTitle4: Crtiques Divins - axeMasteryPassiveDesc0: Jetons à investir dans les passifs (teintures) - axeMasteryPassiveDesc1: Retourner au menu principal des compétences - axeMasteryPassiveDesc2: Jetons à investir dans les compétences - axeMasteryPassiveDesc3: Augmente la durée de Hache Suprême de 0.02s - axeMasteryPassiveDesc4: Augmente les chances de faire un coup critique (De base, 1.25x dégâts) de 0.01% - repairPerkTitle0: Recyclage - repairPerkTitle1: Débrouillard - repairPerkTitle2: Maître Réparateur - repairPerkDesc0: Vous obtenez plus de matériaux en recyclant - repairPerkDesc1: +10% de chances de garder vos matériaux utilisés pour une réparation - repairPerkDesc2: Les enchantements sont gardés lors d'une réparation - repairPassiveTitle0: Retour - repairPassiveTitle1: Jetons compétence - repairPassiveTitle2: Maîtrise - repairPassiveDesc0: Retourner au menu principal des compétences - repairPassiveDesc1: Jetons à investir dans les compétences - repairPassiveDesc2: Vos matériaux de réparation restaurent plus de solidité - agilityPerkTitle0: Esquive - agilityPerkTitle1: Ossature métallique - agilityPerkTitle2: Pied léger - agilityPerkDesc0: +4% de chances d'esquiver les attaques par niveau - agilityPerkDesc1: -10% de dégâts de chute par niveau - agilityPerkDesc2: Vous obtenez le buff Vitesse I de manière permanente (Activable avec /speedToggle) - agilityPassiveTitle0: Retour - agilityPassiveTitle1: Jetons compétence - agilityPassiveTitle2: Roulade - agilityPassiveDesc0: Retourner au menu principal des compétences - agilityPassiveDesc1: Jetons à investir dans les compétences - agilityPassiveDesc2: Vous avez une chance de faire une roulade et de diminuer les dégâts de chute - alchemyPerkTitle0: Invocation Alchimique - alchemyPerkTitle1: Savoir Ancien - alchemyPerkTitle2: Maître Alchimiste - alchemyPerkDesc0: Permet de créer certaines potions sans alambic - alchemyPerkDesc1: Débloque l'compétence de pouvoir concocter de nouvelles potions - alchemyPerkDesc2: Le niveau des potions utilisées est augmenté de +1 (Activable avec /togglePotion) - alchemyPassiveTitle0: Retour - alchemyPassiveTitle1: Jetons compétence - alchemyPassiveTitle2: Potions+ - alchemyPassiveDesc0: Retourner au menu principal des compétences - alchemyPassiveDesc1: Jetons à investir dans les compétences - alchemyPassiveDesc2: Augmente la durée des potions utilisées - smeltingPerkTitle0: Combustilble efficace - smeltingPerkTitle1: Double cuisson - smeltingPerkTitle2: Pioche enflammée - smeltingPerkDesc0: Les combustibles dure 20% plus longtemps par niveau - smeltingPerkDesc1: +5% de chances de doubler les minerais fondus - smeltingPerkDesc2: Les minerais piochés sont instantanément fondus (Activable avec /toggleFlamePick) - smeltingPassiveTitle0: Retour - smeltingPassiveTitle1: Jetons compétence - smeltingPassiveTitle2: Combustion Rapide - smeltingPassiveDesc0: Retourner au menu principal des compétences - smeltingPassiveDesc1: Jetons à investir dans les compétences - smeltingPassiveDesc2: Augmente la vitesse de cuisson - enchantingPerkTitle0: Enchantement efficace - enchantingPerkTitle1: Erudit - enchantingPerkTitle2: Immortelle expérience - enchantingPerkDesc0: Les enchantements ont besoin d'1 niveau (Minecraft) en moins par niveau per level, les réparations sur l'enclume coutent 1 niveau (Minecraft) de moins (minimum de 2) par niveau - enchantingPerkDesc1: Débloque des recettes pour certains livres d'enchantement - enchantingPerkDesc2: Vous ne perdez plus d'expérience (Minecraft) en mourrant - enchantingPassiveTitle0: Retour - enchantingPassiveTitle1: Jetons compétence - enchantingPassiveTitle2: Développement Rapide - enchantingPassiveDesc0: Retourner au menu principal des compétences - enchantingPassiveDesc1: Jetons à investir dans les compétences - enchantingPassiveDesc2: L'expérience (Minecraft) reçue est augmentée - globalPerkTitle0: Récolteur - globalPerkTitle1: Erudit - globalPerkTitle2: Combattant - globalPerkTitle3: Dur labeur - globalPerkTitle4: Recherche - globalPerkTitle5: Entrainement - globalPerkTitle6: Réincarnation+ - globalPerkTitle7: Récolte d'âme - globalPerkTitle8: Avatar - globalPerkTitle9: Maître des Arts - globalPerkDesc0: +20% d'expérience gagnée en Forage, Bûcheron, Minage, Agriculture et Pêche - globalPerkDesc1: +20% d'expérience gagnée en Réparation, Agilité, Alchimie, Cuisson et Enchantement - globalPerkDesc2: +20% d'expérience gagnée en Archerie, Maitrîse des bêtes, Maniement de l'épée, Défense et Maîtrise de la hache - globalPerkDesc3: +1 Jetons compétence dans toutes les compétences de Récolteur - globalPerkDesc4: +1 Jetons compétence dans toutes les compétences d'Erudit - globalPerkDesc5: +1 Jetons compétence dans toutes les compétences de Combattant - globalPerkDesc6: A votre mort vous avez 50% de chances de garder quelques objets de valeur dans votre inventaire - globalPerkDesc7: Vous récoltez désormais des âmes en tuant des monstres, il est possible de les utiliser pour réinitialiser vos compétences - globalPerkDesc8: Vous avez 10% de chances de devenir invincible et d'obtenir tous les buffs pendant 10s après un coup qui devait vous tuer - globalPerkDesc9: Le délais d'utilisation des compétences est diminué de 33% - globalPassiveTitle0: Jetons globaux - globalPassiveTitle1: Retour - globalPassiveDesc0: Jetons à investir dans les compétences - globalPassiveDesc1: Retourner au menu principal des compétences - cannotRepair: Vous ne pouvez pas réparer lorsque cette compétence est active ! - cannotSalvage: Vous ne pouvez pas recycler lorsque cette compétence est active ! - spite: Tout ce qui est bon est fait de dépit - refundSkill: sont requises pour réinitialiser vos compétences - refundSkill2: pour réinitialiser vos compétences - needToUnlock: Vous devez débloquer - perkRequirement: Vous avez besoin de 2 jetons d'compétence dans l'compétence précédente pour la débloquer - perkRequirementM: Vous devez avoir dépensé 10 jetons compétence dans cette arbre de talent pour débloquer cette compétence ultime - noSkillTokens: Vous n'avez aucun jetons compétence - noPassiveTokens: Vous n'avez aucun jetons passif - maxedOutPerk: Vous avez déjà le niveau maximum ! - requiredGlobalPerks0: Vous avez besoin de la compétence précédente pour débloquer cette compétences - requiredGlobalPerks1: sont requis pour débloquer cette compétence - requiredGlobalPerks2: est requi pour débloquer cette compétence - requiredGlobalPerks3: Vous avez besoin de toutes les compétences globales pour la débloquer - craftRequirement: est requis pour faire cette recette ! - roll: ROULADE - dodge: ESQUIVE - prepare: Vous préparez votre - rest: Vous reposez votre - activated: activé(e) ! - ended: est terminé(e) - readyToUse: est prêt a être utilisé(e) - cooldown: Temps de Recharge - rapidFire: Tir Rapide - bow: arc - greatAxe: Hache Suprême - axe: hache - spurKick: Coup d'éperon - leg: Jambes - stoneSoldier: Soldat de Pierre - yourself: vous-même - bigDig: Mega forage - shovel: pelle - naturalRegeneration: Régénération Naturelle - hoe: houe - superBait: Super Appât - fishingRod: Canne à pêche - berserkPick: Mineur Berserk - pickaxe: pioche - swiftStrikes: Frappes Rapides - sword: épée - timber: Bûcheron - hyperHorse: Ce cheval est déjà boosté ! - magicForce: Une force magique a mis fin a votre capacité - rob: Vol - repairFail0: Vous n'avez pas le niveau nécessaire pour correctement réparer cet objet - repairFail1: Vous avez raté votre recyclage ! - repairFail2: Vous n'avez pas réussi a garde l'enchantement de l'objet ! - treeTooBig0: Cet arbre est trop gros pour être coupé d'un seul coup ! - treeTooBig1: Cet arbre ne pourra jamais être coupé d'un coup comme ca... - noPermission: Vous n'avez pas la permission d'utiliser cette commande ! - improperArguments: Arguments invalides, essayez - totalPlayTime: Temps de jeu total - clickForOptions: Cliquez pour voir les options - unknownCommand: Commande inconnue - expToLevel: EXP pour le prochain niveau - playerName: playerName - skillName: skillName (in English) - page: page - on0: "ON" - off0: "OFF" - onOrOff: ON/OFF - manuallyToggles: Interrupteurs manuel - commandDesc0: Ouvrir l'interface principale des compétences - commandDesc1: Ouvrir l'arbre de compétence de votre choix - commandDesc2: Ouvrir l'interface de configuration - commandDesc3: Donne a un joueur de l'EXP dans une compétence spécifique - commandDesc4: Définit le niveau d’un joueur dans une compétence spécifique - commandDesc5: Réinitialise les statistique d'un joueur dans une compétence spécifique (ne redonne pas les statistiques) - commandDesc6: Afficher un classement d'une statistique spécifique - commandDesc7: Founit un lien vers la page d'information du plugin - commandDesc8: Tentative d'enchantement d'un élément dans la main du joueur à un niveau spécifié - informationURL: URL d'information (Google Docs) - click: CLICK - levelArgument: Argument de niveau doit être en dessous de 40 - leaderboard: classement - playerOffline: Ce joueur est hors ligne - onlyIncrease: S'il vous-plaît augmentez l'EXP seulement avec cette commande, sinon, utilisez /frpg statReset et ensuite /frpg giveEXP - amount: montant - unlockToggle: Pour utilisez cette compétences vous devez débloquer - levelUpNotif: Notifications de niveau - abilityPreparationNotif: Notifications de préparation de compétence - yes0: "OUI" - no0: "NON" - warning: ATTENTION - souls: âmes - refundSkillTree0: Réinitialiser un arbre coûte - refundSkillTree1: cette action est irréversible, êtes vous sur - refundSkillTree2: réinitialiser le - skill: compétence - backToSkillTree: Vous ramène à l’arbre de compétences - miningPerkDesc0_1: 2 secondes de Célérité I après avoir miné un minerai - miningPerkDesc0_2: 5 secondes de Célérité I après avoir miné un minerai - miningPerkDesc0_3: 10 secondes de Célérité I après avoir miné un minerai - miningPerkDesc0_4: 5 secondes de Célérité II après avoir miné un minerai, suivi de 5 secondes de Célérité I - miningPerkDesc0_5: 10 secondes de Célérité II après avoir miné un minerai - woodcuttingPerkDesc3_1: Les feuilles peuvent maintenant drop - common: commun - uncommon: peu commun - rare: rare - veryRare: très rare - legendary: légendaire - fishingPerkDesc1_1: Unlocks treasure tier - farmingPerkDesc1_1: Gagner la compétence de fabrication - cowSpawnEgg: Générateur Oeuf de vache - beeSpawnEgg: Générateur Oeuf d'abeille - mooshroomSpawnEgg: Générateur Oeuf de champimeuh - horseSpawnEgg: Générateur Oeuf de cheval - slimeSpawnEgg: Générateur Oeuf de slime - diggingPerkDesc0_1: Vous pouvez maintenant creuser - defensePerkDesc0_1: Vous gagnez +3s de régénération par niveau après avoir tué un monstre - defensePerkDesc0_2: Vous gagnez +0.5 coeurs instantanément par niveau après avoir tué un monstre - duration: Durée - likelihood: Probabilité - junkChance: Junk Chance - locked: BLOQUE - unlocked: DEBLOQUE - cowEgg: Oeuf de vache - beeEgg: Oeuf d'abeille - mooshroomEgg: Oeuf de champimeuh - horseEgg: Oeuf de cheval - slimeEgg: Oeuf de slime - tippedArrows: Flèches à effet - toggle: Basculer - refundSkillTitle: Réinitialiser aptidtude - refundSkillTreeDesc: Cliquez pour réinitialiser l'arbre de compétence - enchantingPerkDesc1_0: Débloque la capacité de fabriquer - enchantingPerkDesc1_1: Livres enchantés de Puissance I et Efficacité I (Coût de 1 niveau)" - enchantingPerkDesc1_2: Livres enchantés Tranchant I et Protection I (Coût de 1 niveau) - enchantingPerkDesc1_3: Livres enchantés Chance de la mer I et Appât I (Coût de 1 niveau) - enchantingPerkDesc1_4: Livres enchantés Agilité aquatique I et Semelles givrantes I (Coût de 1 niveau) - enchantingPerkDesc1_5: Livres enchantés Raccommodage (Coût de 10 niveaux) et Fortune I (Coût de 2 niveaux) - repairPerkDesc0_1: Gagnez plus de matériaux en recyclant - repairPerkDesc0_2: Gagnez plus de matériaux en recyclant, recycler extrait maintenant l'enchantement de l'objet dans un livre - xpBoost: Boost d'XP - speedBoost: Boost de rapidité - timeExtension: Extension du temps - enchantingCraft0: Livre Puissance I - enchantingCraft1: Livre Efficacité I - enchantingCraft2: Livre Tranchant I - enchantingCraft3: Livre Protection I - enchantingCraft4: Livre Chance de la mer I - enchantingCraft5: Livre Appât I - enchantingCraft6: Livre Semelles givrantes I - enchantingCraft7: Livre Agilité aquatique I - enchantingCraft8: Livre Raccommodage - enchantingCraft9: Livre Fortune I - commandDesc9: Définit le nombre âmes d'un joueur - commandDesc10: Définit la compétence ou les jetons passifs dans la compétence spécifiée d'un joueur - commandDesc11: Définit le nombre de jetons globaux d'un joueur - commandDesc12: Enregistre les statistiques de tous les joueurs ou d’un joueur - status: STATUS - complete: COMPLET - incomplete: INCOMPLET - try0: "try" - passiveImprove: Your passive perks improve every level! - increasedBy: increased by - expIncrease: All EXP increased by - personalMultiplier: Personal Multiplier - translators: Translators - commandDesc13: Sets the personal multiplier for a specified player - abilityDescription: Ability Description - abilityDescription_digging: Temporarily adds 5 levels of effiency to your shovel. Activated by right-clicking a shovel then breaking a block. - abilityDescription_woodcutting: Temporarily makes axes break an entire tree with one block break. Activated by right-clicking an axe then breaking a log. - abilityDescription_mining: Temporarily adds 5 levels of effiency to your pickaxe. Activated by right-clicking a pickaxe then breaking block. - abilityDescription_farming: Temporarily makes crops broken with a hoe automatically replant. Activated by right-clicking a hoe then breaking a crop. - abilityDescription_fishing: Temporarily makes fishing rods instantly catch a fish. Activated by left-clicking a fishing rod then fishing in water. - abilityDescription_archery: Temporarily makes all arrows fired at max speed. Activated by left-clicking a bow then shooting an arrow. - abilityDescription_beastMastery: Temporarily gives your horse a speed buff. Activated by right-clicking while on a horse then left-clicking. - abilityDescription_swordsmanship: Temporarily removes swinging cooldown on swords. Activated by right-clicking a sword then hitting a mob. - abilityDescription_defense: Temporarily gives the user Resistance and Slowness effects. Activated by right-clicking with an empty hand then hitting a mob. - abilityDescription_axeMastery: Temporarily makes axes do damage to all mobs in a certain radius. Activated by right-clicking an axe then hitting a mob. - alchemyPerkDesc1_0: Débloquer la compétence d'Alchimie - alchemyPerkDesc0_0: Un établi peut être utilisé pour fabriquer des potions de - triggerAbilities: Trigger Abilities - showEXPBar: Show EXP Bar - disabledSkill: This skill is disabled - skillConfigDesc: Takes you to configuration menu for this skill - lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" - exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" - potionAbsorption: Potion of Absorption - potionBadOmen: Potion of Bad Omen - potionBlindess: Potion of Blindess - potionConduitPower: Potion of Conduit Power - potionResistance: Potion of Resistance - potionDolphinsGrace: Potion of Dolphins Grace - potionHaste: Potion of Haste - potionFireResistance: Potion of Fire Resistance - potionGlowing: Potion of Glowing - potionHarm: Potion of Harm - potionHealing: Potion of Healing - potionHealthBoost: Potion of Health Boost - potiontheHero: Potion of the Hero - potionHunger: Potion of Hunger - potionStrength: Potion of Strength - potionInvsibility: Potion of Invsibility - potionJump: Potion of Jump - potionLuck: Potion of Luck - potionNightVision: Potion of Night Vision - potionRegeneration: Potion of Regeneration - potionSaturation: Potion of Saturation - potionSlowness: Potion of Slowness - potionFatigue: Potion of Fatigue - potionSlowFalling: Potion of Slow Falling - potionSpeed: Potion of Speed - potionBadLuck: Potion of Bad Luck - potionWaterBreathing: Potion of Water Breathing - potionWeakness: Potion of Weakness - potionDecay: Potion of Decay - potionAwkward: Awkward Potion - potionUncraftable: Uncraftable Potion - potionMundane: Mundane Potion - potionTurtleMaster: Potion of the Turtle Master - potionThick: Thick Potion - potionWater: Water Bottle - ingredient: Ingredient - usedToBrew: Is used to brew - costs: costs - xpLevel: Minecraft XP Level - xpLevels: Minecraft XP Levels - craftXPRequirement: This recipe requires at least - bedGUI: You cannot use this command while in bed! - statsUpdated: Your stats were changed to be consistent with a new EXP curve. - All skill trees and passive perks have been reset. All tokens must be re-invested. - timeRemaining: Time Remaining - numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed - commandDesc14: Resets the cooldown period for a skill to 0 seconds - commandDesc15: Looks up a player's FreeRPG stats - repairUnsafeEnchant: This item is too powerful to be repaired - salvageUnsafeEnchant: This item is too powerful to be salvaged - rank: Rank - stats: stats - outOf: out of - playerNotInLeaderboard: That player is not on any leaderboards - virtual: Virtual - commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) + frFR: #Translated by Temuel + languageName: Français + englishLanguageName: French + translationCredit: Temuel + global: Global + digging: Forage + woodcutting: Coupe du bois + mining: Minage + farming: Agriculture + fishing: Pêche + archery: Archerie + beastMastery: Maîtrise des bêtes + swordsmanship: Maniement de l'épée + defense: Défense + axeMastery: Maîtrise de la hache + repair: Réparation + alchemy: Alchemie + agility: Agilité + smelting: Cuisson + enchanting: Enchantement + information: Information + configuration: Configuration + level: Niveau + experience: Experience + toNext: au prochain + total: Total + diggingPerkTitle0: Mo' drops + diggingPerkTitle1: Double loot + diggingPerkTitle2: Drops rares + diggingPerkTitle3: Voleur d'âme + diggingPerkTitle4: Dénicheur de silex + diggingPerkTitle5: Chevalier de la pelle + diggingPerkTitle6: Mega forage + diggingPerkDesc0: Augmente la table des drops de 1 objet par niveau + diggingPerkDesc1: +5% de chances de recevoir un double loot a chaque niveau (lorsqu'un loot doit être reçu) + diggingPerkDesc2: Augmente d'avantage la table des drops des objets par niveau + diggingPerkDesc3: Le sable des âmes a +5% de chances de drop un loot par niveau + diggingPerkDesc4: Le gravier a 100% de chances de drop du silex (Activable avec /flintToggle) + diggingPerkDesc5: Dégâts des pelles x2 + diggingPerkDesc6: Quand vous utilisez cette compétence vous cassez désormais une section de blocs de 3x3 (20% d'avoir des loots quand cette compétence est active) + diggingPassiveTitle0: Jetons passif + diggingPassiveTitle1: Retour + diggingPassiveTitle2: Jetons compétence + diggingPassiveTitle3: Durée de Mega forage + diggingPassiveTitle4: Chances d'obtenir un loot + diggingPassiveDesc0: Jetons a investir dans les passifs (teintures) + diggingPassiveDesc1: Retourner au menu principal des compétences + diggingPassiveDesc2: Jetons a investir dans les compétences + diggingPassiveDesc3: Augmente la durée de Mega forage de 0.02 s + diggingPassiveDesc4: Augmente la chance de trouver un loot en creusant de 0.005% + woodcuttingPerkTitle0: Racines zélées + woodcuttingPerkTitle1: Nouvelles armes + woodcuttingPerkTitle2: Savoir caché + woodcuttingPerkTitle3: Charognard de feuilles + woodcuttingPerkTitle4: Bûcheron+ + woodcuttingPerkTitle5: Souffleur de feuilles + woodcuttingPerkTitle6: Maître Bûcheron + woodcuttingPerkDesc0: +20% de chances que les souches drop 1 XP Minecraft par niveau + woodcuttingPerkDesc1: +12s de Célérité par niveau après la première souche coupée en 5 minutes + woodcuttingPerkDesc2: Les souches ont +0.2% de chances de droper un grimoire enchanté par niveau + woodcuttingPerkDesc3: Les feuilles ont 1% de chances de drop +1 loot par niveau + woodcuttingPerkDesc4: La limite de destruction de Bûcheron passe de 64 a 128 + woodcuttingPerkDesc5: Break a large section of leaves using an axe (toggleable with /leafBlowerToggle) + woodcuttingPerkDesc6: Double drops, Racines zélées, et Savoir caché sont désormais tous actifs avec Bûcheron (leurs effets sont réduits de 50%) + woodcuttingPassiveTitle0: Jetons passif + woodcuttingPassiveTitle1: Retour + woodcuttingPassiveTitle2: Jetons compétence + woodcuttingPassiveTitle3: Durée de Bûcheron + woodcuttingPassiveTitle4: Double Drops + woodcuttingPassiveDesc0: Jetons a investir dans les passifs (teintures) + woodcuttingPassiveDesc1: Retourner au menu principal des compétences + woodcuttingPassiveDesc2: Jetons a investir dans les compétences + woodcuttingPassiveDesc3: Augmente la durée de Bûcheron de 0.02s + woodcuttingPassiveDesc4: Augmente les chances d'obtenir un double drop de 0.05% + miningPerkTitle0: Célérité maitrisée + miningPerkTitle1: Plus de bombes + miningPerkTitle2: Dénicheur de trésor + miningPerkTitle3: Bomb-boyage + miningPerkTitle4: Mineur de gisement + miningPerkTitle5: Demolition Man + miningPerkTitle6: Triple Trouble + miningPerkDesc0: Gain de Célérité après chaque minage de minerai pour chaque niveau + miningPerkDesc1: La recette de fabrication de la TNT produit +1 bloc pour chaque niveau + miningPerkDesc2: Lorsque cette compétence est utilisée sur une pierre, +1% de chance par niveau d'obtenir un minerai (de l'expérience d'compétence est obtenue avec le minerai) + miningPerkDesc3: Augmente le rayon d'explosion de la TNT (quand elle est allumé avec un briquet) pour chaque niveau + miningPerkDesc4: L'intégralité des minerais d'une veine sont instantanément détruits lorsque un bloc est détruit (activable) + miningPerkDesc5: Les explosions de TNT ne vont font plus de dégâts + miningPerkDesc6: Double drops devient triple drops + miningPassiveTitle0: Jetons passif + miningPassiveTitle1: Retour + miningPassiveTitle2: Jetons compétence + miningPassiveTitle3: Durée de Mineur Berserk + miningPassiveTitle4: Double Drops + miningPassiveTitle5: Mineur explosif + miningPassiveDesc0: Jetons a investir dans les passifs (teintures) + miningPassiveDesc1: Retourner au menu principal des compétences + miningPassiveDesc2: Jetons a investir dans les compétences + miningPassiveDesc3: Augmente la durée de Mineur berserk de 0.02s + miningPassiveDesc4: Augmente les chances d'obtenir un double drop sur les minerais de 0.05% + miningPassiveDesc5: Augmente les chances d'obtenir des minerais sur les blocs détruit par de la TNT de 0.01% (Plus de blocs détruits = Plus de chance de drop) + farmingPerkTitle0: Engrais+ + farmingPerkTitle1: Eleveur de bétail + farmingPerkTitle2: Régime de fermier + farmingPerkTitle3: Carnivore + farmingPerkTitle4: Mains vertes + farmingPerkTitle5: Hormones de croissange + farmingPerkTitle6: Faire un avec la nature + farmingPerkDesc0: +10% de chances de ne pas consommer la poudre d'os lorsqu'elle est utilisée + farmingPerkDesc1: Permet de fabriquer des oeufs supplémentaires pour chaque niveau + farmingPerkDesc2: La nourriture que vous produisez est +20% plus efficace à restaurer votre faim pour chaque niveau + farmingPerkDesc3: la viande est +20% plus efficace à restaurer votre faim pour chaque niveau + farmingPerkDesc4: Capacité de replanter des cultures avec une plus grande chance de replanter à des stades de croissance ultérieurs; cette capacité influe maintenant sur les pastèques et les citrouilles + farmingPerkDesc5: Le sucre peut-être utilisé sur les bébés animaux pour les faire grandir instantanément + farmingPerkDesc6: Vous obtenez Regénération lorsque vous restez immobile sur l'herbe + farmingPassiveTitle0: Jetons passif + farmingPassiveTitle1: Retour + farmingPassiveTitle2: Jetons compétence + farmingPassiveTitle3: Durée de Regénération Naturelle + farmingPassiveTitle4: Double Drops (Récoltes) + farmingPassiveTitle5: Double Drops (Animaux) + farmingPassiveDesc0: Jetons a investir dans les passifs (teintures) + farmingPassiveDesc1: Retourner au menu principal des compétences + farmingPassiveDesc2: Jetons a investir dans les compétences + farmingPassiveDesc3: Augmente la durée de Regénération Naturelle de 0.02s + farmingPassiveDesc4: Augmente la chance d'obtenir le double de récoltes de 0.05% + farmingPassiveDesc5: Augmente la chance d'obtenir un double loot sur le bétail de 0.05% + fishingPerkTitle0: Vol + fishingPerkTitle1: Charognard + fishingPerkTitle2: Régime du pêcheur + fishingPerkTitle3: Filtration + fishingPerkTitle4: Grappin + fishingPerkTitle5: Canne en feu + fishingPerkTitle6: Homme poisson + fishingPerkDesc0: +15% de chances d'extraire un objet d'un mob pour chaque niveau + fishingPerkDesc1: Débloque un nouveau tier de loot en pêche + fishingPerkDesc2: Les poissons restaurent +20% de faim pour chaque niveau + fishingPerkDesc3: Les plus haut tiers (II-V) de loot deviennete plus commun, les tiers plus bas (I) deviennent plus rares + fishingPerkDesc4: Les cannes à pêche se comportent désormais comme des grappins(activable avec /grappleToggle) + fishingPerkDesc5: Les poissons sont désormaisa déjà cuisinés lorsqu'ils sont pêchés, certains loots sont changés (toggleable with /hotRodToggle) + fishingPerkDesc6: Vous obtenez le buff vision nocturne sous l'eau et le buff Grâce du dauphin quand vous êtes dans l'eau + fishingPassiveTitle0: Jetons passif + fishingPassiveTitle1: Retour + fishingPassiveTitle2: Jetons compétence + fishingPassiveTitle3: Durée du Super Appât + fishingPassiveTitle4: Coup double + fishingPassiveTitle5: Dénicheur de trésor + fishingPassiveDesc0: Jetons a investir dans les passifs (teintures) + fishingPassiveDesc1: Retourner au menu principal des compétences + fishingPassiveDesc2: Jetons a investir dans les compétences + fishingPassiveDesc3: Augmente la durée du Super Appât de 0.01s + fishingPassiveDesc4: Augmente la chance d'obtenir un double drop de 0.05% + fishingPassiveDesc5: Diminue la chance de pêcher des déchets de 0.005%, augmente la chance d'obtenir un loot de 0.005% + archeryPerkTitle0: Flèches supplémentaires + archeryPerkTitle1: Sniper + archeryPerkTitle2: Flèche de lumière + archeryPerkTitle3: Flèches explosives + archeryPerkTitle4: Flèches magiques + archeryPerkTitle5: Recharge rapide d'arbalète + archeryPerkTitle6: Tir meurtrier + archeryPerkDesc0: +1 flèche obtenue par fabrication pour chaque niveau + archeryPerkDesc1: Augmente la vitesse des flèches de +2% par niveau (augmente les dommages de ~4%/niveau) + archeryPerkDesc2: Augmente les dégâts de Flèche Spectrale de +5% par niveau + archeryPerkDesc3: Les flèches ont +1% de produire une explosion au toucher + archeryPerkDesc4: Permet la fabrication de toutes les flèches à effet avec des potions jetables a la place des potions persistantes + archeryPerkDesc5: L'abilité peut désormais être utilisé avec les arbalettes et permet de faire des tirs instantanés + archeryPerkDesc6: Les dégâts des feux d'artifice tirés avec les flèches sont doublés (jusqu'â 16 coeurs de dégâts) + archeryPassiveTitle0: Jetons passif + archeryPassiveTitle1: Retour + archeryPassiveTitle2: Jetons compétence + archeryPassiveTitle3: Durée de Tir Rapide + archeryPassiveTitle4: Retraite + archeryPassiveDesc0: Jetons a investir dans les passifs (teintures) + archeryPassiveDesc1: Retourner au menu principal des compétences + archeryPassiveDesc2: Jetons a investir dans les compétences + archeryPassiveDesc3: Augmente la durée de Tir Rapide de 0.02s + archeryPassiveDesc4: Augmente les chances de tirer une flèche sans en consommer de 0.05% par niveau + beastMasteryPerkTitle0: Fourrure épaisse + beastMasteryPerkTitle1: Crocs aiguisés + beastMasteryPerkTitle2: Morsure regénérante + beastMasteryPerkTitle3: N'approche pas + beastMasteryPerkTitle4: Loup agile + beastMasteryPerkTitle5: Identification + beastMasteryPerkTitle6: Boost d'adrénaline + beastMasteryPerkDesc0: Les loups prennent -10% de dégâts par niveau + beastMasteryPerkDesc1: Les loups font +10% de dégâts par niveau + beastMasteryPerkDesc2: Les loups gagnent +1/2 coeur(s) en tuant des ennemis pour chaque niveau + beastMasteryPerkDesc3: Les loups ont +5% de chances de repousser les ennemis + beastMasteryPerkDesc4: Les loups ne subissent plus de dégâts de chute + beastMasteryPerkDesc5: Affiche les statistiques des chevaux et des loups lorsque vous utilisez une boussole dessus + beastMasteryPerkDesc6: Le buff Coup d'éperon buff est maintenant Vitesse III + beastMasteryPassiveTitle0: Jetons passif + beastMasteryPassiveTitle1: Retour + beastMasteryPassiveTitle2: Jetons compétence + beastMasteryPassiveTitle3: Coup d'éperon Duration + beastMasteryPassiveTitle4: Morsure sauvage + beastMasteryPassiveDesc0: Jetons à investir dans les passifs (teintures) + beastMasteryPassiveDesc1: Retourner au menu principal des compétences + beastMasteryPassiveDesc2: Jetons à investir dans les compétences + beastMasteryPassiveDesc3: Augmente la durée de Coup d'éperon de 0.02s + beastMasteryPassiveDesc4: Augmente les chances de coup critique des loups de 0.025% + swordsmanshipPerkTitle0: Adrenaline + swordsmanshipPerkTitle1: Massacre + swordsmanshipPerkTitle2: Adrenaline+ + swordsmanshipPerkTitle3: Folie meurtrière + swordsmanshipPerkTitle4: Soif de sang + swordsmanshipPerkTitle5: Tranchant! + swordsmanshipPerkTitle6: Maîtrise de l'épée + swordsmanshipPerkDesc0: Tuer un monstre hostile avec une épée donne +2s de vitesser par niveau + swordsmanshipPerkDesc1: Tuer un monstre hostile avec une épée donne +2s de force par niveau + swordsmanshipPerkDesc2: +20% du buff Vitesse I reçu avec Adrenaline devient Vitesse II + swordsmanshipPerkDesc3: +20% du buff Force I reçu avec Folie meurtrière devient Force II + swordsmanshipPerkDesc4: Restaure la barre de faim en tuant certains monstres avec votre épée + swordsmanshipPerkDesc5: Frappes rapides ajoute désormais un niveau de tranchant a votre épée + swordsmanshipPerkDesc6: Les épées font désormais +1 coeur de dégâts de manière permanente + swordsmanshipPassiveTitle0: Jetons passif + swordsmanshipPassiveTitle1: Retour + swordsmanshipPassiveTitle2: Jetons compétence + swordsmanshipPassiveTitle3: Durée de Frappes Rapides + swordsmanshipPassiveTitle4: Coup double + swordsmanshipPassiveDesc0: Jetons à investir dans les passifs (teintures) + swordsmanshipPassiveDesc1: Retourner au menu principal des compétences + swordsmanshipPassiveDesc2: Jetons à investir dans les compétences + swordsmanshipPassiveDesc3: Augmente la durée de Frappes Rapides de 0.02s + swordsmanshipPassiveDesc4: Augmente les chances de frapper un monstre 2 fois de 0.02% (Les dégats du seconde coup sont de 50%) + defensePerkTitle0: Soigneur + defensePerkTitle1: Carapace + defensePerkTitle2: Tête dure + defensePerkTitle3: Carapace+ + defensePerkTitle4: Cadeau du ciel + defensePerkTitle5: Jambes solides + defensePerkTitle6: Vitalité + defensePerkDesc0: Ajoute +3s de regénération par niveau après avoir tuer un monstre + defensePerkDesc1: +2% de chances d'obtenir le buff Résistance I pendant 5s si vous êtes frappés + defensePerkDesc2: Corps Robuste reduit les dommages de 6.6% supplémentaires par niveau + defensePerkDesc3: +2% de chances d'obtenir le buff Résistance II pendant 5s si vous êtes frappés + defensePerkDesc4: Indestructible accorde désormais un bouclier absorbant de 4 coeurs durant l'aptidtude +1 minute + defensePerkDesc5: Indestructible donne désormais le buff Lenteur I au lieu de Lenteur IV + defensePerkDesc6: +2 coeurs de manière permanente + defensePassiveTitle0: Jetons passif + defensePassiveTitle1: Retour + defensePassiveTitle2: Jetons compétence + defensePassiveTitle3: Durée d'Indestructible + defensePassiveTitle4: Corps Solide + defensePassiveTitle5: Double Drops (monstres hostiles) + defensePassiveDesc0: Jetons à investir dans les passifs (teintures) + defensePassiveDesc1: Retourner au menu principal des compétences + defensePassiveDesc2: Jetons à investir dans les compétences + defensePassiveDesc3: Augmente la durée d'Indestructible de 0.02s + defensePassiveDesc4: Augmente les chances de réduire (-33% de base) les dégâts reçus de 0.01% par niveau + defensePassiveDesc5: Augmente les chances de double drops sur les monstres de 0.05% + axeMasteryPerkTitle0: Hache Suprême + axeMasteryPerkTitle1: Hache Sainte + axeMasteryPerkTitle2: Revitalisé + axeMasteryPerkTitle3: Sang guerrier + axeMasteryPerkTitle4: Séisme + axeMasteryPerkTitle5: Critique+ + axeMasteryPerkTitle6: Hacheur + axeMasteryPerkDesc0: Le rayon des dommages de Hache Suprême est augmenté de 1 bloc par niveau + axeMasteryPerkDesc1: +2% de chances qu'un éclaire frappe le monstre touché par une attaque à la hache + axeMasteryPerkDesc2: +1% de chances par niveau de récupérer toute votre vie en tuant un monstre à la hache + axeMasteryPerkDesc3: +3s par niveau de buff Force I en tuant un monstre à la hache + axeMasteryPerkDesc4: Les dégâts de zone de l'compétence sont doublés (25% -> 50% de dégâts) + axeMasteryPerkDesc5: Crtitiques Divins possède désormais un multiplicateur de 1.6x au lieu de 1.25x + axeMasteryPerkDesc6: Les haches font désormais +1 coeur de dégâts de manière permanente + axeMasteryPassiveTitle0: Jetons passif + axeMasteryPassiveTitle1: Retour + axeMasteryPassiveTitle2: Jetons compétence + axeMasteryPassiveTitle3: Durée de Hache Suprême + axeMasteryPassiveTitle4: Crtiques Divins + axeMasteryPassiveDesc0: Jetons à investir dans les passifs (teintures) + axeMasteryPassiveDesc1: Retourner au menu principal des compétences + axeMasteryPassiveDesc2: Jetons à investir dans les compétences + axeMasteryPassiveDesc3: Augmente la durée de Hache Suprême de 0.02s + axeMasteryPassiveDesc4: Augmente les chances de faire un coup critique (De base, 1.25x dégâts) de 0.01% + repairPerkTitle0: Recyclage + repairPerkTitle1: Débrouillard + repairPerkTitle2: Maître Réparateur + repairPerkDesc0: Vous obtenez plus de matériaux en recyclant + repairPerkDesc1: +10% de chances de garder vos matériaux utilisés pour une réparation + repairPerkDesc2: Les enchantements sont gardés lors d'une réparation + repairPassiveTitle0: Retour + repairPassiveTitle1: Jetons compétence + repairPassiveTitle2: Maîtrise + repairPassiveDesc0: Retourner au menu principal des compétences + repairPassiveDesc1: Jetons à investir dans les compétences + repairPassiveDesc2: Vos matériaux de réparation restaurent plus de solidité + agilityPerkTitle0: Esquive + agilityPerkTitle1: Ossature métallique + agilityPerkTitle2: Pied léger + agilityPerkDesc0: +4% de chances d'esquiver les attaques par niveau + agilityPerkDesc1: -10% de dégâts de chute par niveau + agilityPerkDesc2: Vous obtenez le buff Vitesse I de manière permanente (Activable avec /speedToggle) + agilityPassiveTitle0: Retour + agilityPassiveTitle1: Jetons compétence + agilityPassiveTitle2: Roulade + agilityPassiveDesc0: Retourner au menu principal des compétences + agilityPassiveDesc1: Jetons à investir dans les compétences + agilityPassiveDesc2: Vous avez une chance de faire une roulade et de diminuer les dégâts de chute + alchemyPerkTitle0: Invocation Alchimique + alchemyPerkTitle1: Savoir Ancien + alchemyPerkTitle2: Maître Alchimiste + alchemyPerkDesc0: Permet de créer certaines potions sans alambic + alchemyPerkDesc1: Débloque l'compétence de pouvoir concocter de nouvelles potions + alchemyPerkDesc2: Le niveau des potions utilisées est augmenté de +1 (Activable avec /togglePotion) + alchemyPassiveTitle0: Retour + alchemyPassiveTitle1: Jetons compétence + alchemyPassiveTitle2: Potions+ + alchemyPassiveDesc0: Retourner au menu principal des compétences + alchemyPassiveDesc1: Jetons à investir dans les compétences + alchemyPassiveDesc2: Augmente la durée des potions utilisées + smeltingPerkTitle0: Combustilble efficace + smeltingPerkTitle1: Double cuisson + smeltingPerkTitle2: Pioche enflammée + smeltingPerkDesc0: Les combustibles dure 20% plus longtemps par niveau + smeltingPerkDesc1: +5% de chances de doubler les minerais fondus + smeltingPerkDesc2: Les minerais piochés sont instantanément fondus (Activable avec /toggleFlamePick) + smeltingPassiveTitle0: Retour + smeltingPassiveTitle1: Jetons compétence + smeltingPassiveTitle2: Combustion Rapide + smeltingPassiveDesc0: Retourner au menu principal des compétences + smeltingPassiveDesc1: Jetons à investir dans les compétences + smeltingPassiveDesc2: Augmente la vitesse de cuisson + enchantingPerkTitle0: Enchantement efficace + enchantingPerkTitle1: Erudit + enchantingPerkTitle2: Immortelle expérience + enchantingPerkDesc0: Les enchantements ont besoin d'1 niveau (Minecraft) en moins par niveau per level, les réparations sur l'enclume coutent 1 niveau (Minecraft) de moins (minimum de 2) par niveau + enchantingPerkDesc1: Débloque des recettes pour certains livres d'enchantement + enchantingPerkDesc2: Vous ne perdez plus d'expérience (Minecraft) en mourrant + enchantingPassiveTitle0: Retour + enchantingPassiveTitle1: Jetons compétence + enchantingPassiveTitle2: Développement Rapide + enchantingPassiveDesc0: Retourner au menu principal des compétences + enchantingPassiveDesc1: Jetons à investir dans les compétences + enchantingPassiveDesc2: L'expérience (Minecraft) reçue est augmentée + globalPerkTitle0: Récolteur + globalPerkTitle1: Erudit + globalPerkTitle2: Combattant + globalPerkTitle3: Dur labeur + globalPerkTitle4: Recherche + globalPerkTitle5: Entrainement + globalPerkTitle6: Réincarnation+ + globalPerkTitle7: Récolte d'âme + globalPerkTitle8: Avatar + globalPerkTitle9: Maître des Arts + globalPerkDesc0: +20% d'expérience gagnée en Forage, Bûcheron, Minage, Agriculture et Pêche + globalPerkDesc1: +20% d'expérience gagnée en Réparation, Agilité, Alchimie, Cuisson et Enchantement + globalPerkDesc2: +20% d'expérience gagnée en Archerie, Maitrîse des bêtes, Maniement de l'épée, Défense et Maîtrise de la hache + globalPerkDesc3: +1 Jetons compétence dans toutes les compétences de Récolteur + globalPerkDesc4: +1 Jetons compétence dans toutes les compétences d'Erudit + globalPerkDesc5: +1 Jetons compétence dans toutes les compétences de Combattant + globalPerkDesc6: A votre mort vous avez 50% de chances de garder quelques objets de valeur dans votre inventaire + globalPerkDesc7: Vous récoltez désormais des âmes en tuant des monstres, il est possible de les utiliser pour réinitialiser vos compétences + globalPerkDesc8: Vous avez 10% de chances de devenir invincible et d'obtenir tous les buffs pendant 10s après un coup qui devait vous tuer + globalPerkDesc9: Le délais d'utilisation des compétences est diminué de 33% + globalPassiveTitle0: Jetons globaux + globalPassiveTitle1: Retour + globalPassiveDesc0: Jetons à investir dans les compétences + globalPassiveDesc1: Retourner au menu principal des compétences + cannotRepair: Vous ne pouvez pas réparer lorsque cette compétence est active ! + cannotSalvage: Vous ne pouvez pas recycler lorsque cette compétence est active ! + spite: Tout ce qui est bon est fait de dépit + refundSkill: sont requises pour réinitialiser vos compétences + refundSkill2: pour réinitialiser vos compétences + needToUnlock: Vous devez débloquer + perkRequirement: Vous avez besoin de 2 jetons d'compétence dans l'compétence précédente pour la débloquer + perkRequirementM: Vous devez avoir dépensé 10 jetons compétence dans cette arbre de talent pour débloquer cette compétence ultime + noSkillTokens: Vous n'avez aucun jetons compétence + noPassiveTokens: Vous n'avez aucun jetons passif + maxedOutPerk: Vous avez déjà le niveau maximum ! + requiredGlobalPerks0: Vous avez besoin de la compétence précédente pour débloquer cette compétences + requiredGlobalPerks1: sont requis pour débloquer cette compétence + requiredGlobalPerks2: est requi pour débloquer cette compétence + requiredGlobalPerks3: Vous avez besoin de toutes les compétences globales pour la débloquer + craftRequirement: est requis pour faire cette recette ! + roll: ROULADE + dodge: ESQUIVE + prepare: Vous préparez votre + rest: Vous reposez votre + activated: activé(e) ! + ended: est terminé(e) + readyToUse: est prêt a être utilisé(e) + cooldown: Temps de Recharge + rapidFire: Tir Rapide + bow: arc + greatAxe: Hache Suprême + axe: hache + spurKick: Coup d'éperon + leg: Jambes + stoneSoldier: Soldat de Pierre + yourself: vous-même + bigDig: Mega forage + shovel: pelle + naturalRegeneration: Régénération Naturelle + hoe: houe + superBait: Super Appât + fishingRod: Canne à pêche + berserkPick: Mineur Berserk + pickaxe: pioche + swiftStrikes: Frappes Rapides + sword: épée + timber: Bûcheron + hyperHorse: Ce cheval est déjà boosté ! + magicForce: Une force magique a mis fin a votre capacité + rob: Vol + repairFail0: Vous n'avez pas le niveau nécessaire pour correctement réparer cet objet + repairFail1: Vous avez raté votre recyclage ! + repairFail2: Vous n'avez pas réussi a garde l'enchantement de l'objet ! + treeTooBig0: Cet arbre est trop gros pour être coupé d'un seul coup ! + treeTooBig1: Cet arbre ne pourra jamais être coupé d'un coup comme ca... + noPermission: Vous n'avez pas la permission d'utiliser cette commande ! + improperArguments: Arguments invalides, essayez + totalPlayTime: Temps de jeu total + clickForOptions: Cliquez pour voir les options + unknownCommand: Commande inconnue + expToLevel: EXP pour le prochain niveau + playerName: playerName + skillName: skillName (in English) + page: page + on0: "ON" + off0: "OFF" + onOrOff: ON/OFF + manuallyToggles: Interrupteurs manuel + commandDesc0: Ouvrir l'interface principale des compétences + commandDesc1: Ouvrir l'arbre de compétence de votre choix + commandDesc2: Ouvrir l'interface de configuration + commandDesc3: Donne a un joueur de l'EXP dans une compétence spécifique + commandDesc4: Définit le niveau d’un joueur dans une compétence spécifique + commandDesc5: Réinitialise les statistique d'un joueur dans une compétence spécifique (ne redonne pas les statistiques) + commandDesc6: Afficher un classement d'une statistique spécifique + commandDesc7: Founit un lien vers la page d'information du plugin + commandDesc8: Tentative d'enchantement d'un élément dans la main du joueur à un niveau spécifié + informationURL: URL d'information (Google Docs) + click: CLICK + levelArgument: Argument de niveau doit être en dessous de 40 + leaderboard: classement + playerOffline: Ce joueur est hors ligne + onlyIncrease: S'il vous-plaît augmentez l'EXP seulement avec cette commande, sinon, utilisez /frpg statReset et ensuite /frpg giveEXP + amount: montant + unlockToggle: Pour utilisez cette compétences vous devez débloquer + levelUpNotif: Notifications de niveau + abilityPreparationNotif: Notifications de préparation de compétence + yes0: "OUI" + no0: "NON" + warning: ATTENTION + souls: âmes + refundSkillTree0: Réinitialiser un arbre coûte + refundSkillTree1: cette action est irréversible, êtes vous sur + refundSkillTree2: réinitialiser le + skill: compétence + backToSkillTree: Vous ramène à l’arbre de compétences + miningPerkDesc0_1: 2 secondes de Célérité I après avoir miné un minerai + miningPerkDesc0_2: 5 secondes de Célérité I après avoir miné un minerai + miningPerkDesc0_3: 10 secondes de Célérité I après avoir miné un minerai + miningPerkDesc0_4: 5 secondes de Célérité II après avoir miné un minerai, suivi de 5 secondes de Célérité I + miningPerkDesc0_5: 10 secondes de Célérité II après avoir miné un minerai + woodcuttingPerkDesc3_1: Les feuilles peuvent maintenant drop + common: commun + uncommon: peu commun + rare: rare + veryRare: très rare + legendary: légendaire + fishingPerkDesc1_1: Unlocks treasure tier + farmingPerkDesc1_1: Gagner la compétence de fabrication + cowSpawnEgg: Générateur Oeuf de vache + beeSpawnEgg: Générateur Oeuf d'abeille + mooshroomSpawnEgg: Générateur Oeuf de champimeuh + horseSpawnEgg: Générateur Oeuf de cheval + slimeSpawnEgg: Générateur Oeuf de slime + diggingPerkDesc0_1: Vous pouvez maintenant creuser + defensePerkDesc0_1: Vous gagnez +3s de régénération par niveau après avoir tué un monstre + defensePerkDesc0_2: Vous gagnez +0.5 coeurs instantanément par niveau après avoir tué un monstre + duration: Durée + likelihood: Probabilité + junkChance: Junk Chance + locked: BLOQUE + unlocked: DEBLOQUE + cowEgg: Oeuf de vache + beeEgg: Oeuf d'abeille + mooshroomEgg: Oeuf de champimeuh + horseEgg: Oeuf de cheval + slimeEgg: Oeuf de slime + tippedArrows: Flèches à effet + toggle: Basculer + refundSkillTitle: Réinitialiser aptidtude + refundSkillTreeDesc: Cliquez pour réinitialiser l'arbre de compétence + enchantingPerkDesc1_0: Débloque la capacité de fabriquer + enchantingPerkDesc1_1: Livres enchantés de Puissance I et Efficacité I (Coût de 1 niveau)" + enchantingPerkDesc1_2: Livres enchantés Tranchant I et Protection I (Coût de 1 niveau) + enchantingPerkDesc1_3: Livres enchantés Chance de la mer I et Appât I (Coût de 1 niveau) + enchantingPerkDesc1_4: Livres enchantés Agilité aquatique I et Semelles givrantes I (Coût de 1 niveau) + enchantingPerkDesc1_5: Livres enchantés Raccommodage (Coût de 10 niveaux) et Fortune I (Coût de 2 niveaux) + repairPerkDesc0_1: Gagnez plus de matériaux en recyclant + repairPerkDesc0_2: Gagnez plus de matériaux en recyclant, recycler extrait maintenant l'enchantement de l'objet dans un livre + xpBoost: Boost d'XP + speedBoost: Boost de rapidité + timeExtension: Extension du temps + enchantingCraft0: Livre Puissance I + enchantingCraft1: Livre Efficacité I + enchantingCraft2: Livre Tranchant I + enchantingCraft3: Livre Protection I + enchantingCraft4: Livre Chance de la mer I + enchantingCraft5: Livre Appât I + enchantingCraft6: Livre Semelles givrantes I + enchantingCraft7: Livre Agilité aquatique I + enchantingCraft8: Livre Raccommodage + enchantingCraft9: Livre Fortune I + commandDesc9: Définit le nombre âmes d'un joueur + commandDesc10: Définit la compétence ou les jetons passifs dans la compétence spécifiée d'un joueur + commandDesc11: Définit le nombre de jetons globaux d'un joueur + commandDesc12: Enregistre les statistiques de tous les joueurs ou d’un joueur + status: STATUS + complete: COMPLET + incomplete: INCOMPLET + try0: "try" + passiveImprove: Your passive perks improve every level! + increasedBy: increased by + expIncrease: All EXP increased by + personalMultiplier: Personal Multiplier + translators: Translators + commandDesc13: Sets the personal multiplier for a specified player + abilityDescription: Ability Description + abilityDescription_digging: Temporarily adds 5 levels of effiency to your shovel. Activated by right-clicking a shovel then breaking a block. + abilityDescription_woodcutting: Temporarily makes axes break an entire tree with one block break. Activated by right-clicking an axe then breaking a log. + abilityDescription_mining: Temporarily adds 5 levels of effiency to your pickaxe. Activated by right-clicking a pickaxe then breaking block. + abilityDescription_farming: Temporarily makes crops broken with a hoe automatically replant. Activated by right-clicking a hoe then breaking a crop. + abilityDescription_fishing: Temporarily makes fishing rods instantly catch a fish. Activated by left-clicking a fishing rod then fishing in water. + abilityDescription_archery: Temporarily makes all arrows fired at max speed. Activated by left-clicking a bow then shooting an arrow. + abilityDescription_beastMastery: Temporarily gives your horse a speed buff. Activated by right-clicking while on a horse then left-clicking. + abilityDescription_swordsmanship: Temporarily removes swinging cooldown on swords. Activated by right-clicking a sword then hitting a mob. + abilityDescription_defense: Temporarily gives the user Resistance and Slowness effects. Activated by right-clicking with an empty hand then hitting a mob. + abilityDescription_axeMastery: Temporarily makes axes do damage to all mobs in a certain radius. Activated by right-clicking an axe then hitting a mob. + alchemyPerkDesc1_0: Débloquer la compétence d'Alchimie + alchemyPerkDesc0_0: Un établi peut être utilisé pour fabriquer des potions de + triggerAbilities: Trigger Abilities + showEXPBar: Show EXP Bar + disabledSkill: This skill is disabled + skillConfigDesc: Takes you to configuration menu for this skill + lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" + exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" + potionAbsorption: Potion of Absorption + potionBadOmen: Potion of Bad Omen + potionBlindess: Potion of Blindess + potionConduitPower: Potion of Conduit Power + potionResistance: Potion of Resistance + potionDolphinsGrace: Potion of Dolphins Grace + potionHaste: Potion of Haste + potionFireResistance: Potion of Fire Resistance + potionGlowing: Potion of Glowing + potionHarm: Potion of Harm + potionHealing: Potion of Healing + potionHealthBoost: Potion of Health Boost + potiontheHero: Potion of the Hero + potionHunger: Potion of Hunger + potionStrength: Potion of Strength + potionInvsibility: Potion of Invsibility + potionJump: Potion of Jump + potionLuck: Potion of Luck + potionNightVision: Potion of Night Vision + potionRegeneration: Potion of Regeneration + potionSaturation: Potion of Saturation + potionSlowness: Potion of Slowness + potionFatigue: Potion of Fatigue + potionSlowFalling: Potion of Slow Falling + potionSpeed: Potion of Speed + potionBadLuck: Potion of Bad Luck + potionWaterBreathing: Potion of Water Breathing + potionWeakness: Potion of Weakness + potionDecay: Potion of Decay + potionAwkward: Awkward Potion + potionUncraftable: Uncraftable Potion + potionMundane: Mundane Potion + potionTurtleMaster: Potion of the Turtle Master + potionThick: Thick Potion + potionWater: Water Bottle + ingredient: Ingredient + usedToBrew: Is used to brew + costs: costs + xpLevel: Minecraft XP Level + xpLevels: Minecraft XP Levels + craftXPRequirement: This recipe requires at least + bedGUI: You cannot use this command while in bed! + statsUpdated: Your stats were changed to be consistent with a new EXP curve. + All skill trees and passive perks have been reset. All tokens must be re-invested. + timeRemaining: Time Remaining + numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed + commandDesc14: Resets the cooldown period for a skill to 0 seconds + commandDesc15: Looks up a player's FreeRPG stats + repairUnsafeEnchant: This item is too powerful to be repaired + salvageUnsafeEnchant: This item is too powerful to be salvaged + rank: Rank + stats: stats + outOf: out of + playerNotInLeaderboard: That player is not on any leaderboards + virtual: Virtual + commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) - deDE: #Translated by KlenerTeufel96 of FruitLab.gg - languageName: Deutsch - englishLanguageName: German - translationCredit: FruitLab.gg - global: Global - digging: Graben - woodcutting: Holzfäller - mining: Bergbau - farming: Ackerbau - fishing: Fischen - archery: Bogenschießen - beastMastery: Tamer - swordsmanship: Schwertkunst - defense: Verteidigung - axeMastery: Axtkämpfer - repair: Reparatur - alchemy: Alchimie - agility: Beweglichkeit - smelting: Schmelzen - enchanting: Verzaubern - information: Information - configuration: Aufbau - level: Level - experience: Erfahrung - toNext: als nächstes - total: Total - diggingPerkTitle0: Mob Drops - diggingPerkTitle1: Doppelter Schatz - diggingPerkTitle2: Seltenere Drops - diggingPerkTitle3: Seelendieb - diggingPerkTitle4: Feuerstein Sucher - diggingPerkTitle5: Schaufelritter - diggingPerkTitle6: Mega Grabung - diggingPerkDesc0: Erweitert die Schatztabelle um 1 Gegenstand pro Level - diggingPerkDesc1: + 5% Chance auf doppelten Schatz Drop pro Level (wenn Schatz gerollt wird) - diggingPerkDesc2: Erweitert die Drop-Tabelle um weitere Items pro Level - diggingPerkDesc3: Seelensand lässt + 5% häufiger Schätze pro Level dropen - diggingPerkDesc4: Kies hat eine Feuerstein-Drop-Rate von 100% (umschaltbar durch /flintToggle) - diggingPerkDesc5: Schaufeln richten doppelten Schaden an - diggingPerkDesc6: Wenn du die Fähigkeit verwendest, bricht jetzt ein 3x3-Blockabschnitt (20% von normale Schatzrate, wenn aktiv) - diggingPassiveTitle0: Passive Token - diggingPassiveTitle1: Zurück - diggingPassiveTitle2: Skill Token - diggingPassiveTitle3: Mega Grabung Dauer - diggingPassiveTitle4: Schatz Chance - diggingPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) - diggingPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills - diggingPassiveDesc2: Token, um in den Skillbaum zu investieren - diggingPassiveDesc3: Erhöht die Dauer von Mega Grabung um 0,02 Sekunden - diggingPassiveDesc4: Erhöht die Chance, Schätze auszugraben, um 0,005% - woodcuttingPerkTitle0: Eifrige Wurzeln - woodcuttingPerkTitle1: Frische Arme - woodcuttingPerkTitle2: Verborgenes Wissen - woodcuttingPerkTitle3: Laubfänger - woodcuttingPerkTitle4: Holz+ - woodcuttingPerkTitle5: Laubbläser - woodcuttingPerkTitle6: Fähige Axt - woodcuttingPerkDesc0: + 20% Chance, dass Stämme 1 EXP pro Level dropen - woodcuttingPerkDesc1: +12 Sekunden pro Level von Eile I nach dem ersten Stamm innerhalb 5 Minuten gefällt wurde - woodcuttingPerkDesc2: Stämme haben eine Chance von + 0,2% pro Level, ein verzaubertes Buch fallen zu lassen - woodcuttingPerkDesc3: Blätter haben eine Chance von 1%, +1 Schatzgegenstand pro Level fallen zu lassen - woodcuttingPerkDesc4: Die Holzbruchgrenze wurde von 64 auf 128 erhöht - woodcuttingPerkDesc5: Baut eine großen Abschnitt von Blättern mit einer Axt ab (umschaltbar mit /leafBlowerToggle) - woodcuttingPerkDesc6: Doppelter Drop, eifrige Wurzeln und verstecktes Wissen wurden auf Holz übertragen (bei halber Wirksamkeit) - woodcuttingPassiveTitle0: Passive Token - woodcuttingPassiveTitle1: Zurück - woodcuttingPassiveTitle2: Skill Token - woodcuttingPassiveTitle3: Timber Dauer - woodcuttingPassiveTitle4: Doppelter Drop - woodcuttingPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) - woodcuttingPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills - woodcuttingPassiveDesc2: Token, um in den Skillbaum zu investieren - woodcuttingPassiveDesc3: Erhöht die Dauer des Timber um 0,02 s - woodcuttingPassiveDesc4: Erhöht die Chance auf doppelten Drop um 0,05% - miningPerkTitle0: Verschwenderische Eile - miningPerkTitle1: Weitere Bomben - miningPerkTitle2: Schatzsucher - miningPerkTitle3: Bomb-Boyage - miningPerkTitle4: Adernbergmann - miningPerkTitle5: Abrissmann - miningPerkTitle6: Triple Trouble - miningPerkDesc0: Gewinne Eile, nachdem du für jedes Level Erze abgebaut hast - miningPerkDesc1: Das Crafting Rezept für TNT erzeugt +1 TNT pro Level - miningPerkDesc2: Bei Verwendung der Fähigkeit auf Steinen + 1% pro Level Chance für ein Erz Drop (zusätzliche Exp wird durch gedropte Erze verdient) - miningPerkDesc3: Erhöht den TNT-Explosionsradius (wenn er durch Feuerstein und Stahl beleuchtet wird) in jedem Level - miningPerkDesc4: Erzadern werden sofort abgebaut, wenn ein Block abbgebaut wird (umschaltbar). - miningPerkDesc5: TNT-Explosionen verursachen keinen Schaden - miningPerkDesc6: Doppelter Drop sind jetzt dreifacher Drop - miningPassiveTitle0: Passive Token - miningPassiveTitle1: Zurück - miningPassiveTitle2: Skill Token - miningPassiveTitle3: Berserker - miningPassiveTitle4: Doppelter Drop - miningPassiveTitle5: Explosionsabbau - miningPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) - miningPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills - miningPassiveDesc2: Token, um in den Skillbaum zu investieren - miningPassiveDesc3: Erhöht die Dauer von Berserker um 0,02 Sekunden - miningPassiveDesc4: Erhöht die Chance, ein doppelten Drop aus Erzen zu erhalten, um 0,05% - miningPassiveDesc5: Erhöht die Wahrscheinlichkeit, dass durch TNT-Explosionen Erze entstehen um 0,01% (Mehr Blöcke abbgebaut = Mehr Schatzwürfe) - farmingPerkTitle0: Besserer Dünger - farmingPerkTitle1: Tierfarm - farmingPerkTitle2: Bauerndiät - farmingPerkTitle3: Fleischfresser - farmingPerkTitle4: Grüner Daumen - farmingPerkTitle5: Wachstumshormone - farmingPerkTitle6: Eins mit der Natur - farmingPerkDesc0: + 10% Chance, bei Gebrauch kein Knochenmehl zu verbrauchen - farmingPerkDesc1: Kann pro Level ein zusätzliches Spawn-Ei herstellen - farmingPerkDesc2: Farm Essen ist + 20% effektiver bei der Wiederherstellung von Hunger und Sättigung pro Level - farmingPerkDesc3: Fleisch ist + 20% effektiver bei der Wiederherstellung von Hunger und Sättigung pro Level - farmingPerkDesc4: Die Fähigkeit kann Pflanzen, die ausgewachsen sind, mit einer höheren Wahrscheinlichkeit einer Wiederbepflanzung in späteren Wachstumsstadien - neu pflanzen. Fähigkeit wirkt sich jetzt auf Melonen und Kürbisse aus - farmingPerkDesc5: Zucker kann bei Tierbabys verwendet werden, damit sie sofort wachsen - farmingPerkDesc6: Erhalte Regeneration I, wenn du auf Gras still stehst - farmingPassiveTitle0: Passive Token - farmingPassiveTitle1: Zurück - farmingPassiveTitle2: Skill Token - farmingPassiveTitle3: Natürliche Regeneration Dauer - farmingPassiveTitle4: Doppelter Drop (Pflanzen) - farmingPassiveTitle5: Doppelter Drop (Tiere) - farmingPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) - farmingPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills - farmingPassiveDesc2: Token, um in den Skillbaum zu investieren - farmingPassiveDesc3: Erhöht die Dauer der natürlichen Regeneration um 0,02 Sekunden - farmingPassiveDesc4: Erhöht die Chance, einen doppelten Drop aus der Ernte zu erhalten, um 0,05% - farmingPassiveDesc5: Erhöht die Chance, von den meisten passiven Tieren einen doppelten Drop zu erhalten, um 0,05% - fishingPerkTitle0: Plündern - fishingPerkTitle1: Assgeier - fishingPerkTitle2: Fischerdiät - fishingPerkTitle3: Filtration - fishingPerkTitle4: Greifhaken - fishingPerkTitle5: Frisierte Angel - fishingPerkTitle6: Fisch Person - fishingPerkDesc0: + 15% Chance, ein Item pro Level von einem Mob abzuziehen - fishingPerkDesc1: Schaltet eine neue Stufe des Fischereischatzes frei - fishingPerkDesc2: Fische stellen + 20% Hunger pro Level wieder her - fishingPerkDesc3: Beute höherer Stufe (II-V) wird häufiger, Beute niedrigerer Stufe (I) wird weniger - fishingPerkDesc4: Angelrute fungiert jetzt als Greifhaken (umschaltbar mit /grappleToggle) - fishingPerkDesc5: Fische werden jetzt gekocht, wenn sie gefangen werden, einige Fischschätze werden geändert (umschaltbar mit /hotRodToggle) - fishingPerkDesc6: Unendliche Nachtsicht unter Wasser, unendliche Delfin Gnade im Wasser - fishingPassiveTitle0: Passive Token - fishingPassiveTitle1: Zurück - fishingPassiveTitle2: Skill Token - fishingPassiveTitle3: Super Köder Dauer - fishingPassiveTitle4: Doppelte Fänge - fishingPassiveTitle5: Schatzsucher - fishingPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) - fishingPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills - fishingPassiveDesc2: Token, um in den Skillbaum zu investieren - fishingPassiveDesc3: Erhöht die Dauer des Superköders um 0,01 Sekunden - fishingPassiveDesc4: Erhöht die Chance auf einen doppelten Drop um 0,05% - fishingPassiveDesc5: Verringert die Wahrscheinlichkeit Müll zu finden um 0,005% und erhöht die Wahrscheinlichkeit einen Schatz zu finden um 0,005% - archeryPerkTitle0: Zusätzliche Pfeile - archeryPerkTitle1: Sniper - archeryPerkTitle2: Pfeil des Lichts - archeryPerkTitle3: Explosive Pfeile - archeryPerkTitle4: Drachenlose Pfeile - archeryPerkTitle5: Armbrust-Schnelllader - archeryPerkTitle6: Tödlicher Schlag - archeryPerkDesc0: +1 Pfeil aus der Herstellung pro Level - archeryPerkDesc1: Die Pfeilgeschwindigkeit erhöht sich um + 2% pro Level (~ 4% Schadenszunahme / Level) - archeryPerkDesc2: Spektralpfeile erhalten pro Level einen Schadensschub von + 5% - archeryPerkDesc3: Pfeile verursachen +1% bei einem Treffer eine Explosion zu erzeugen - archeryPerkDesc4: Ermöglicht die Herstellung aller Pfeile mit normalen Tränken anstelle von verweilenden Tränken - archeryPerkDesc5: Die Fähigkeit kann jetzt mit Armbrüsten verwendet werden, sodass alle Schüsse sofort geladen werden - archeryPerkDesc6: Von Armbrüsten abgefeuerte Feuerwerke verursachen doppelten Schaden (bis zu 16 Herzen Schaden) - archeryPassiveTitle0: Passive Token - archeryPassiveTitle1: Zurück - archeryPassiveTitle2: Skill Token - archeryPassiveTitle3: Schnellfeuer Dauer - archeryPassiveTitle4: Abruf - archeryPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) - archeryPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills - archeryPassiveDesc2: Token, um in den Skillbaum zu investieren - archeryPassiveDesc3: Erhöht die Dauer des Schnellfeuers um 0,02 Sekunden - archeryPassiveDesc4: Erhöht die Wahrscheinlichkeit, dass ein Pfeilschuss keinen Pfeil verbraucht, um 0,05% pro Level - beastMasteryPerkTitle0: Dickes Fell - beastMasteryPerkTitle1: Scharfe Zähne - beastMasteryPerkTitle2: Gesunde Bisse - beastMasteryPerkTitle3: Bleib weg - beastMasteryPerkTitle4: Akro-Hund - beastMasteryPerkTitle5: Identifizieren - beastMasteryPerkTitle6: Adrenalinschub - beastMasteryPerkDesc0: Hunde erleiden pro Level -10% Schaden - beastMasteryPerkDesc1: Hunde verursachen pro Level + 10% mehr Schaden - beastMasteryPerkDesc2: Hunde heilen +1/2 Herz pro Stufe durch Töten - beastMasteryPerkDesc3: Hunde haben eine Chance von + 5% Feinde zurückzustoßen - beastMasteryPerkDesc4: Hunde erleiden keinen Fallschaden - beastMasteryPerkDesc5: Wenn du einen Kompass für ein Pferd oder einen Wolf verwendest, werden jetzt deren Statistiken angezeigt - beastMasteryPerkDesc6: Sporn Kick ist jetzt Geschwindigkeit III - beastMasteryPassiveTitle0: Passive Token - beastMasteryPassiveTitle1: Zurück - beastMasteryPassiveTitle2: Skill Token - beastMasteryPassiveTitle3: Sporn Kick Dauer - beastMasteryPassiveTitle4: Kritischer Biss - beastMasteryPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) - beastMasteryPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills - beastMasteryPassiveDesc2: Token, um in den Skillbaum zu investieren - beastMasteryPassiveDesc3: Erhöht die Dauer von Sporn Kick um 0,02 Sekunden - beastMasteryPassiveDesc4: Erhöht die Chance für einen Hund einen kritischen Treffer zu erzielen um 0,025% - swordsmanshipPerkTitle0: Adrenalin - swordsmanshipPerkTitle1: Blutrausch - swordsmanshipPerkTitle2: Adrenalin+ - swordsmanshipPerkTitle3: Blut Raserei - swordsmanshipPerkTitle4: Blutdurst - swordsmanshipPerkTitle5: Schärfer! - swordsmanshipPerkTitle6: Schwertbeherrschung - swordsmanshipPerkDesc0: Das Töten feindlicher Mobs mit einem Schwert bietet +2 Sekunden Geschwindigkeit pro Level - swordsmanshipPerkDesc1: Das Töten feindlicher Mobs mit einem Schwert bringt +2 Sekunden Stärke pro Level - swordsmanshipPerkDesc2: + 20% des Geschwindigkeits I vom Adrenalin sind jetzt Geschwindigkeit II - swordsmanshipPerkDesc3: + 20% von Stärke I von Blutrausch ist jetzt Stärke II - swordsmanshipPerkDesc4: Das Töten bestimmter aggressiver Mobs mit einem Schwert stellt den Hunger wieder her - swordsmanshipPerkDesc5: Schnelle Schläge verleihen deinem Schwert jetzt eine gewisse Schärfe - swordsmanshipPerkDesc6: Schwerter verursachen dauerhaft +1 Herzschaden - swordsmanshipPassiveTitle0: Passive Token - swordsmanshipPassiveTitle1: Zurück - swordsmanshipPassiveTitle2: Skill Token - swordsmanshipPassiveTitle3: Schneller Schlag Dauer - swordsmanshipPassiveTitle4: Doppelter Treffer - swordsmanshipPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) - swordsmanshipPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills - swordsmanshipPassiveDesc2: Token, um in den Skillbaum zu investieren - swordsmanshipPassiveDesc3: Erhöht die Dauer von Schneller Schlag um 0,02 Sekunden - swordsmanshipPassiveDesc4: Erhöht die Chance den Mob zweimal zu treffen (zweiter Treffer verursacht 50% Schaden) um 0,02% - defensePerkTitle0: Heiler - defensePerkTitle1: Versteifen - defensePerkTitle2: Dickköpfig - defensePerkTitle3: Versteifen+ - defensePerkTitle4: Geschenk von oben - defensePerkTitle5: Stärkere Beine - defensePerkTitle6: Herzhaft - defensePerkDesc0: Erhalte + 3 Sekunden Regeneration pro Level beim Töten - defensePerkDesc1: + 2% Chance, 5 Sekunden lang Widerstand I zu erhalten, wenn er getroffen wird - defensePerkDesc2: Harter Körper verringert den Schaden um zusätzliche 6,6% pro Stufe - defensePerkDesc3: + 2% Chance, bei einem Treffer 5 Sekunden lang Widerstand II zu erhalten - defensePerkDesc4: Stein-hart gewährt jetzt 4 Absorptionsherzen für eine Fähigkeitsdauer von +1 Minute - defensePerkDesc5: Stein-Hart gibt jetzt Langsamkeit I statt Langsamkeit IV - defensePerkDesc6: +2 Herzen dauerhaft - defensePassiveTitle0: Passive Token - defensePassiveTitle1: Zurück - defensePassiveTitle2: Skill Token - defensePassiveTitle3: Stein-Hart Dauer - defensePassiveTitle4: Harter Körper - defensePassiveTitle5: Doppelter Drop (feindliche Mobs) - defensePassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) - defensePassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills - defensePassiveDesc2: Token, um in den Skillbaum zu investieren - defensePassiveDesc3: Erhöht die Dauer von Stein-Hart um 0,02 Sekunden - defensePassiveDesc4: Erhöht die Chance, reduzierten Schaden (Basis -33%) um 0,01% pro Level zu erleiden - defensePassiveDesc5: Erhöht die Chance, doppelten Drop von aggressiven Mobs zu erhalten, um 0,05% - axeMasteryPerkTitle0: Größere Axt - axeMasteryPerkTitle1: Heilige Axt - axeMasteryPerkTitle2: Revitalisiert - axeMasteryPerkTitle3: Kriegerblut - axeMasteryPerkTitle4: Erdbeben - axeMasteryPerkTitle5: Bessere Crits - axeMasteryPerkTitle6: Axe Man - axeMasteryPerkDesc0: Der Schadensradius der Großen Axt erhöht sich um 1 Block pro Level - axeMasteryPerkDesc1: +2% Chance, dass ein Blitz die Mobs bei einem Axtschlag trifft - axeMasteryPerkDesc2: +1% Chance pro Level auf vollständige Heilung beim Töten - axeMasteryPerkDesc3: +3 Sekunden Stärke 1 pro Level mit einer Axt - axeMasteryPerkDesc4: Der AOE-Schaden der Fähigkeit wird verdoppelt (25% -> 50% des Schadens) - axeMasteryPerkDesc5: Göttliche Crits haben jetzt den 1,6-fachen Multiplikator anstelle des 1,25-fachen - axeMasteryPerkDesc6: Äxte verursachen dauerhaft +1 Herzschaden - axeMasteryPassiveTitle0: Passive Token - axeMasteryPassiveTitle1: Zurück - axeMasteryPassiveTitle2: Skill Token - axeMasteryPassiveTitle3: Great Axe Duration - axeMasteryPassiveTitle4: Göttliche Crits - axeMasteryPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) - axeMasteryPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills - axeMasteryPassiveDesc2: Token, um in den Skillbaum zu investieren - axeMasteryPassiveDesc3: Erhöht die Dauer der Großen Axt um 0,02 Sekunden - axeMasteryPassiveDesc4: Erhöht die zufällige Chance auf kritische Treffer (Grundschaden 1,25x) um 0,01% - repairPerkTitle0: Bergung - repairPerkTitle1: Einfallsreich - repairPerkTitle2: Magie-Reparatur-Skill - repairPerkDesc0: Erhalte durchschnittlich mehr Materialien aus der Bergung - repairPerkDesc1: +10% Chance, dass das bei der Reparatur verwendete Material erhalten bleibt - repairPerkDesc2: Garantiert, dass Verzauberungen repariert werden - repairPassiveTitle0: Zurück - repairPassiveTitle1: Skill Token - repairPassiveTitle2: Kompetenz - repairPassiveDesc0: Bringt dich zurück zum Hauptmenü der Skills - repairPassiveDesc1: Token, um in den Skillbaum zu investieren - repairPassiveDesc2: Materialien stellen bei Reparaturen eine längere Haltbarkeit wieder her - agilityPerkTitle0: Ausweichen - agilityPerkTitle1: Stahlknochen - agilityPerkTitle2: Anmutige Füße - agilityPerkDesc0: + 4% Chance pro Level, Angriffen auszuweichen - agilityPerkDesc1: -10% Fallschaden pro Level - agilityPerkDesc2: Permanente Geschwindigkeit I (umschaltbar durch /speedToggle) - agilityPassiveTitle0: Zurück - agilityPassiveTitle1: Skill Token - agilityPassiveTitle2: Rollen - agilityPassiveDesc0: Bringt dich zurück zum Hauptmenü der Skills - agilityPassiveDesc1: Token, um in den Skillbaum zu investieren - agilityPassiveDesc2: Chance sich abzurollen und weniger Fallschaden zu erleiden - alchemyPerkTitle0: Alchemistische Beschwörung - alchemyPerkTitle1: Altes Wissen - alchemyPerkTitle2: Trankmeister - alchemyPerkDesc0: Ermöglicht die Herstellung einiger Tränke ohne Braustand - alchemyPerkDesc1: Schaltet die Fähigkeit frei, neue Tränke zu brauen - alchemyPerkDesc2: Alle verwendeten Tränke werden um 1 erhöht (umschaltbar mit /togglePotion). - alchemyPassiveTitle0: Zurück - alchemyPassiveTitle1: Skill Token - alchemyPassiveTitle2: Halbwertzeit+ - alchemyPassiveDesc0: Bringt dich zurück zum Hauptmenü der Skills - alchemyPassiveDesc1: Token, um in den Skillbaum zu investieren - alchemyPassiveDesc2: Verlängerung der Tränkedauer bei Verwendung - smeltingPerkTitle0: Kraftstoffeffizienz - smeltingPerkTitle1: Doppelschmelze - smeltingPerkTitle2: Flammen-Spitzhacke - smeltingPerkDesc0: Kraftstoff hält + 20% länger pro Stufe - smeltingPerkDesc1: +5% Chance pro Level, dass geschmolzenes Erz verdoppelt wird - smeltingPerkDesc2: Abgebaute Erze werden sofort geschmolzen (umschaltbar mit /toggleFlamePick) - smeltingPassiveTitle0: Zurück - smeltingPassiveTitle1: Skill Token - smeltingPassiveTitle2: Fuel Speed - smeltingPassiveDesc0: Bringt dich zurück zum Hauptmenü der Skills - smeltingPassiveDesc1: Token, um in den Skillbaum zu investieren - smeltingPassiveDesc2: Erhöht die Kochgeschwindigkeit - enchantingPerkTitle0: Effiziente Verzauberung - enchantingPerkTitle1: Buchmacher - enchantingPerkTitle2: Unsterbliche Erfahrung - enchantingPerkDesc0: Level, die zum verzaubern benötigt werden, werden um -1 pro Level gesenkt, Ambossreparaturen kosten -1 XP Level pro Level (mindestens 2) - enchantingPerkDesc1: Schaltet Crafting Rezepte für einige verzauberte Bücher frei - enchantingPerkDesc2: Behalte EXP beim Tod - enchantingPassiveTitle0: Zurück - enchantingPassiveTitle1: Skill Token - enchantingPassiveTitle2: Schnellere Entwicklung - enchantingPassiveDesc0: Bringt dich zurück zum Hauptmenü der Skills - enchantingPassiveDesc1: Token, um in den Skillbaum zu investieren - enchantingPassiveDesc2: Alle erhaltenen EXP erhöht - globalPerkTitle0: Sammler - globalPerkTitle1: Gelehrte - globalPerkTitle2: Kämpfer - globalPerkTitle3: Harte Arbeit - globalPerkTitle4: Forschung - globalPerkTitle5: Training - globalPerkTitle6: Reinkarnation+ - globalPerkTitle7: Seelenernte - globalPerkTitle8: Avatar - globalPerkTitle9: Meister der Künste - globalPerkDesc0: +20% EXP in den Bereichen Graben, Holzhacken, Bergbau, Landwirtschaft und Fischerei - globalPerkDesc1: +20% EXP in Reparatur, Beweglichkeit, Brauen, Schmelzen und Verzaubern - globalPerkDesc2: +20% EXP in Bogenschießen, Bestienbeherrschung, Schwertkunst, Verteidigung und Axtbeherrschung - globalPerkDesc3: +1 Skill Token in allen Sammlerfertigkeiten - globalPerkDesc4: +1 Skill Token in allen Gelehrtenfertigkeiten - globalPerkDesc5: +1 Skill Token in allen Kämpferfertigkeiten - globalPerkDesc6: Bei Tod 50% Chance, einen Teil jedes wertvollen Gegenstands in deinem Inventar zu behalten - globalPerkDesc7: Du erntest jetzt Seelen, indem du aggressive Mobs tötest, mit denen du Skillbäume zurücksetzen kannst - globalPerkDesc8: 10% Chance, keinen Schaden zu erleiden und alle Buffs im Spiel für 10 Sekunden bei einem Treffer zu erhalten, der dich normalerweise töten würde - globalPerkDesc9: Die Abklingzeiten von Fähigkeiten wurden um 33% verringert - globalPassiveTitle0: Globale Token - globalPassiveTitle1: Zurück - globalPassiveDesc0: Token, um in den Skillbaum zu investieren - globalPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills - cannotRepair: Du kannst nicht reparieren, solange diese Fähigkeit aktiv ist! - cannotSalvage: Du kannst nichts retten, solange diese Fähigkeit aktiv ist! - spite: Alles Gute ist aus Trotz gemacht - refundSkill: sind erforderlich, um einen Skillbaum zurückzusetzen - refundSkill2: um einen Fähigkeitsbaum zu zurückzusetzen - needToUnlock: du musst das entsperren - perkRequirement: Du benötigst mindestens 2 Skill Token, die in die vorherigen Vorteile investiert wurden, um diesen Perk freizuschalten - perkRequirementM: Du benötigst mindestens 10 Skill Token, die insgesamt in den Skillbaum investiert wurden, um diesen Meisterschaftsvorteil freizuschalten - noSkillTokens: Du hast keine Skill Token - noPassiveTokens: Du hast keine passiven Token - maxedOutPerk: Du hast diesen Perk bereits voll ausgeschöpft! - requiredGlobalPerks0: Du benötigst den vorherigen Perk, um diesen Perk freizuschalten - requiredGlobalPerks1: sind erforderlich, um diesen Perk freizuschalten - requiredGlobalPerks2: ist erforderlich, um diesen Perk freizuschalten - requiredGlobalPerks3: Du benötigst jeden globalen Perk, um diesen Perk freizuschalten - craftRequirement: wird benötigt, um dieses Rezept herzustellen! - roll: ROLLEN - dodge: AUSWEICHEN - prepare: Du bereitest deine - rest: Du ruhst deine - activated: aktiviert! - ended: ist beendet - readyToUse: ist wieder einsatzbereit - cooldown: Abklingzeit - rapidFire: Schnellfeuer - bow: Bogen - greatAxe: Großaxt - axe: Axt - spurKick: Sporn Kick - leg: Bein - stoneSoldier: Steinsoldat - yourself: du selber - bigDig: Mega Grabung - shovel: Schaufel - naturalRegeneration: Natürliche Regeneration - hoe: Hake - superBait: Super Köder - fishingRod: Angelrute - berserkPick: Berserker - pickaxe: Spitzhacke - swiftStrikes: Schneller Schlag - sword: Schwert - timber: Timber - hyperHorse: Dieses Pferd ist schon Hyper! - magicForce: Eine magische Kraft beendet deine Fähigkeit - rob: Rauben - repairFail0: Du bist nicht qualifiziert genug, um dieses Item angemessen zu reparieren - repairFail1: Du konntest keine Materialien retten - repairFail2: Du konntest die Verzauberungskraft des Items nicht beibehalten - treeTooBig0: Dieser Baum ist zu groß, als dass du ihn auf einmal fällen könntest! - treeTooBig1: Dieser Baum kann niemals auf einmal so gefällt werden... - noPermission: Du hast keine Berechtigung um diesen Befehl zu verwenden! - improperArguments: Falsche Argumente, versuche - totalPlayTime: Gesamtspielzeit - clickForOptions: Klicke für Optionen - unknownCommand: Unbekannter Befehl - expToLevel: EXP zum nächsten Level - playerName: Spielername - skillName: Skill Name (auf Englisch) - page: Seite - on0: AN - off0: AUS - onOrOff: AN/AUS - manuallyToggles: Manuell umschalten - commandDesc0: Öffnet das Hauptmenü mit allen Fähigkeiten - commandDesc1: Öffnet eine Skillbaum Menü deiner Wahl - commandDesc2: Öffnet die Konfigurationsmenü - commandDesc3: Gibt einem Spieler der Wahl EXP in einer bestimmten Fähigkeit - commandDesc4: Legt das Level eines bestimmten Spielers in einer bestimmten Fertigkeit fest - commandDesc5: Setzt die Statistiken eines Spielers in einer bestimmten Fertigkeit zurück (erstattet keine Statistiken) - commandDesc6: Zeigt eine Bestenliste für eine bestimmte Statistik an - commandDesc7: Bietet einen Link zu einer Plugin-Informationsseite - commandDesc8: Versuche, ein Objekt in der Hand des Benutzers auf einer bestimmten Ebene zu verzaubern - informationURL: Informations-URL (Google Docs) - click: KLICKE - levelArgument: Das Level-Argument muss kleiner als 40 sein - leaderboard: Bestenliste - playerOffline: Dieser Spieler ist nicht online - onlyIncrease: Bitte erhöhe deine EXP nur mit diesem Befehl, andernfalls verwende /rpg statReset und dann /frpg giveEXP - amount: Menge - unlockToggle: Um diesen Befehl verwenden zu können, musst du folgendes freischalten - levelUpNotif: Level Up Benachrichtigungen - abilityPreparationNotif: Benachrichtigungen zur Fähigkeitsvorbereitung - yes0: JA - no0: NEIN - warning: WARNUNG - souls: Seelen - refundSkillTree0: Die Rückerstattung eines Skillbaums kostet - refundSkillTree1: und ist nicht umkehrbar, bist du sicher, dass du das willst - refundSkillTree2: erstattet die - skill: Skill - backToSkillTree: Bringt dich zurück zum Skillbaum - miningPerkDesc0_1: 2 Sekunden Eile I nach dem Abbau von Erz - miningPerkDesc0_2: 5 Sekunden Eile I nach dem Bergbau mehr - miningPerkDesc0_3: 10 Sekunden Eile I nach dem Abbau von Erz - miningPerkDesc0_4: 5 Sekunden Eile II nach dem Abbau von Erz, gefolgt von 5 Sekunden Eile I - miningPerkDesc0_5: 10 Sekunden Eile II nach dem Abbau von Erz - woodcuttingPerkDesc3_1: Blätter könnten dies dropen - common: verbreitet - uncommon: ungewöhnlich - rare: selten - veryRare: sehr selten - legendary: legendär - fishingPerkDesc1_1: Schaltet die Schatzstufe frei - farmingPerkDesc1_1: Erhalte die Fähigkeit zu craften - cowSpawnEgg: Kuh Spawnei - beeSpawnEgg: Bienen Spawnei - mooshroomSpawnEgg: Pilzkuh Spawnei - horseSpawnEgg: Pferd Spawnei - slimeSpawnEgg: Schleim Spawnei - diggingPerkDesc0_1: Du kannst nun folgendes ausgraben - defensePerkDesc0_1: Erhalte +3 Sekunden Regeneration pro Level bei Kills - defensePerkDesc0_2: Erhalte sofort +0,5 Herzen pro Level bei Kills - duration: Dauer - likelihood: Wahrscheinlichkeit - junkChance: Müll Chance - locked: GESPERRT - unlocked: FREIGESCHALTET - cowEgg: Kuh Ei - beeEgg: Bienen Ei - mooshroomEgg: Pilzkuh Ei - horseEgg: Pferd Ei - slimeEgg: Schleim Ei - tippedArrows: Pfeile mit Spitze - toggle: Umschalten - refundSkillTitle: Rückerstattungsskill - refundSkillTreeDesc: Klicke hier, um diesen Skillbaum zurückzusetzen - enchantingPerkDesc1_0: Schaltet die Fähigkeit frei, folgendes zu herzustellen - enchantingPerkDesc1_1: Stärke 1 und Effizienz I verzauberte Bücher (kostet 1 Level zum herstellen) - enchantingPerkDesc1_2: Schärfe I und Schutz I verzauberte Bücher (kostet 1 Level zum herstellen) - enchantingPerkDesc1_3: Glück des Meeres I und Köder I verzauberte Bücher (kostet1 Level zum herstellen) - enchantingPerkDesc1_4: Wasserläufer I und Eisläufer I verzauberte Bücher (kostet 1 Level zum herstellen) - enchantingPerkDesc1_5: Reparatur Bücher (kostet 10 Level zum herstellen) und Glück I Bücher (kostet 2 Level zum herstellen) - repairPerkDesc0_1: Gewinne im Durchschnitt mehr Material aus der Bergung - repairPerkDesc0_2: Wenn du im Durchschnitt mehr Materialien aus der Bergung gewinnst, speichert die Bergung jetzt Verzauberungen von Items in einem Buch - xpBoost: EXP Boost - speedBoost: Geschwindigkeitsboost - timeExtension: Zeitverlängerung - enchantingCraft0: Stärke I Buch - enchantingCraft1: Effizienz I Buch - enchantingCraft2: Schärfe I Buch - enchantingCraft3: Schutz I Buch - enchantingCraft4: Glück des Meeres I Buch - enchantingCraft5: Köder I Buch - enchantingCraft6: Eisläufer I Buch - enchantingCraft7: Wasserläufer I Buch - enchantingCraft8: Reparatur Buch - enchantingCraft9: Glück I Buch - commandDesc9: Legt die Seelen für einen bestimmten Spieler fest - commandDesc10: Legt die Fähigkeit oder den passiven Token in der angegebenen Skill für einen bestimmten Spieler fest - commandDesc11: Legt die globalen Token für einen bestimmten Spieler fest - commandDesc12: Speichert Statistiken aller Spieler oder eines bestimmten Spielers - status: STATUS - complete: KOMPLETT - incomplete: UNVOLLSTÄNDIG - try0: versuche - passiveImprove: Deine passiven Perks verbessern sich jedes Level! - increasedBy: erhöht um - expIncrease: EXP Multiplikator - personalMultiplier: Persönlicher Multiplikator - translators: Übersetzer - commandDesc13: Legt den persönlichen Multiplikator für einen bestimmten Spieler fest - abilityDescription: Skill Beschreibung - abilityDescription_digging: Fügt deiner Schaufel vorübergehend 5 Effizienzlevel - hinzu. Aktivierung durch Rechts-Klick auf eine Schaufel und anschließend einen - Block abbauen. - abilityDescription_woodcutting: Lässt vorübergehend Äxte einen ganzen Baum mit - einem Block fällen. Aktivierung durch Rechts-Klick auf eine Axt und anschließend - einen Stamm abbauen. - abilityDescription_mining: Fügt deiner Spitzhacke vorübergehend 5 Effizienzlevel - hinzu. Aktivierung durch Rechts-Klick auf einer Spitzhacke und anschließende - einen Block abbaust. - abilityDescription_farming: Vorübergehend werden mit einer Hacke geerntete Items - automatisch neu gepflanzt. Wird aktiviert, indem du mit einer Hacke Rechts-Klick - auf die Ernte machst. - abilityDescription_fishing: Lässt vorübergehend Angelruten sofort einen Fisch - fangen. Aktivierung durch Links-Klick auf eine Angelrute und anschließendes - Angeln im Wasser. - abilityDescription_archery: Lässt vorübergehend alle Pfeile mit maximaler Geschwindigkeit - abfeuern. Aktivierung durch Links-Klick auf einen Bogen und dann einen Pfeil - abschießen. - abilityDescription_beastMastery: Verleiht deinem Pferd vorübergehend einen Geschwindigkeitsschub. - Aktivierung durch Rechts-Klick auf einem Pferd und anschließendes Klicken mit - der linken Maustaste. - abilityDescription_swordsmanship: Entfernt vorübergehend die schwingende Abklingzeit - von Schwertern. Aktivierung durch Rechts-Klick auf ein Schwert und dann einen - Mob schlagen. - abilityDescription_defense: Gibt dem Spieler vorübergehend Widerstands- und Langsamkeitseffekte. - Aktivierung durch Rechts-Klick mit einer leeren Hand und dann einen Mob schlagen. - abilityDescription_axeMastery: Lässt Äxte vorübergehend alle Mobs in einem bestimmten - Radius beschädigen. Aktivierung durch Rechts-Klick auf eine Axt klicken und - dann einen Mob schlagen. - alchemyPerkDesc1_0: Schaltet die Fähigkeit zum Brauen frei - alchemyPerkDesc0_0: Ein Crafting Table kann verwendet werden, um folgende Tränke - herzustellen - triggerAbilities: Fähigkeiten auslösen - showEXPBar: Zeige EXP Bar - disabledSkill: Dieser Skill ist deaktiviert - skillConfigDesc: Führt dich zum Konfigurationsmenü für diesen Skill - lvl: Lvl. - exp: EXP - potionAbsorption: Trank der Absorption - potionBadOmen: Trank des schlechten Omens - potionBlindess: Trank der Blindheit - potionConduitPower: Trank der Leitungskraft - potionResistance: Trank des Widerstands - potionDolphinsGrace: Trank der Delfine Gnade - potionHaste: Trank der Eile - potionFireResistance: Trank der Feuerresistenz - potionGlowing: Trank des Leuchten - potionHarm: Trank der Schadens - potionHealing: Trank der Heilung - potionHealthBoost: Trank des Gesundheitsschub - potiontheHero: Trank des Heldens - potionHunger: Trank des Hungers - potionStrength: Trank der Stärke - potionInvsibility: Trank der Unsichtbarkeit - potionJump: Trank der Sprungkraft - potionLuck: Trank des Glücks - potionNightVision: Trank der Nachtsicht - potionRegeneration: Trank der Regeneration - potionSaturation: Trank der Sättigung - potionSlowness: Trank der Lngsamskeit - potionFatigue: Trank der Abbaulähmung - potionSlowFalling: Trank des langsamen Fallens - potionSpeed: Trank der Geschwindigkeit - potionBadLuck: Trank des Pechs - potionWaterBreathing: Trank der Unterwasseratmung - potionWeakness: Trank der Schwäche - potionDecay: Trank des Zerfallens - potionAwkward: Komischer Trank - potionUncraftable: Nicht herstellbarer Trank - potionMundane: Mundanischer Trank - potionTurtleMaster: Trank der Schildkrötenmeister - potionThick: Dicker Trank - potionWater: Wasserflasche - ingredient: Zutat - usedToBrew: Wird zum Brauen verwendet - costs: kostet - xpLevel: Minecraft XP Level - xpLevels: Minecraft XP Level - craftXPRequirement: Dieses Rezept benötigt - bedGUI: Du kannst diesen Befehl nicht verwenden während du im Bett liegst! - statsUpdated: Deine Statistiken wurden geändert um mit der neuen EXP-Kurve übereinzustimmen. Alle Skillbäume und passive Fähigkeiten wurden zurückgesetzt. Alle Punkte mussen neu verteilt. - timeRemaining: Verbleibende Zeit - numberOfAbilityTimersDisplayed: Anzahl der angezeigten Fähigkeits-Timer - commandDesc14: Setzt die Abklingzeit für eine Fertigkeit auf 0 Sekunden zurück - commandDesc15: Zeigt die FreeRPG Statistiken eines Spielers - repairUnsafeEnchant: Dieses Item ist zu mächtig um es zu reparieren - salvageUnsafeEnchant: Dieses Item ist zu mächtig um gerettet zu werden - rank: Rang - stats: Statistiken - outOf: zu wenig - playerNotInLeaderboard: Dieser Spieler ist auf keiner Bestenliste - virtual: Virtual - commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) + deDE: #Translated by KlenerTeufel96 of FruitLab.gg + languageName: Deutsch + englishLanguageName: German + translationCredit: FruitLab.gg + global: Global + digging: Graben + woodcutting: Holzfäller + mining: Bergbau + farming: Ackerbau + fishing: Fischen + archery: Bogenschießen + beastMastery: Tamer + swordsmanship: Schwertkunst + defense: Verteidigung + axeMastery: Axtkämpfer + repair: Reparatur + alchemy: Alchimie + agility: Beweglichkeit + smelting: Schmelzen + enchanting: Verzaubern + information: Information + configuration: Aufbau + level: Level + experience: Erfahrung + toNext: als nächstes + total: Total + diggingPerkTitle0: Mob Drops + diggingPerkTitle1: Doppelter Schatz + diggingPerkTitle2: Seltenere Drops + diggingPerkTitle3: Seelendieb + diggingPerkTitle4: Feuerstein Sucher + diggingPerkTitle5: Schaufelritter + diggingPerkTitle6: Mega Grabung + diggingPerkDesc0: Erweitert die Schatztabelle um 1 Gegenstand pro Level + diggingPerkDesc1: + 5% Chance auf doppelten Schatz Drop pro Level (wenn Schatz gerollt wird) + diggingPerkDesc2: Erweitert die Drop-Tabelle um weitere Items pro Level + diggingPerkDesc3: Seelensand lässt + 5% häufiger Schätze pro Level dropen + diggingPerkDesc4: Kies hat eine Feuerstein-Drop-Rate von 100% (umschaltbar durch /flintToggle) + diggingPerkDesc5: Schaufeln richten doppelten Schaden an + diggingPerkDesc6: Wenn du die Fähigkeit verwendest, bricht jetzt ein 3x3-Blockabschnitt (20% von normale Schatzrate, wenn aktiv) + diggingPassiveTitle0: Passive Token + diggingPassiveTitle1: Zurück + diggingPassiveTitle2: Skill Token + diggingPassiveTitle3: Mega Grabung Dauer + diggingPassiveTitle4: Schatz Chance + diggingPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) + diggingPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills + diggingPassiveDesc2: Token, um in den Skillbaum zu investieren + diggingPassiveDesc3: Erhöht die Dauer von Mega Grabung um 0,02 Sekunden + diggingPassiveDesc4: Erhöht die Chance, Schätze auszugraben, um 0,005% + woodcuttingPerkTitle0: Eifrige Wurzeln + woodcuttingPerkTitle1: Frische Arme + woodcuttingPerkTitle2: Verborgenes Wissen + woodcuttingPerkTitle3: Laubfänger + woodcuttingPerkTitle4: Holz+ + woodcuttingPerkTitle5: Laubbläser + woodcuttingPerkTitle6: Fähige Axt + woodcuttingPerkDesc0: + 20% Chance, dass Stämme 1 EXP pro Level dropen + woodcuttingPerkDesc1: +12 Sekunden pro Level von Eile I nach dem ersten Stamm innerhalb 5 Minuten gefällt wurde + woodcuttingPerkDesc2: Stämme haben eine Chance von + 0,2% pro Level, ein verzaubertes Buch fallen zu lassen + woodcuttingPerkDesc3: Blätter haben eine Chance von 1%, +1 Schatzgegenstand pro Level fallen zu lassen + woodcuttingPerkDesc4: Die Holzbruchgrenze wurde von 64 auf 128 erhöht + woodcuttingPerkDesc5: Baut eine großen Abschnitt von Blättern mit einer Axt ab (umschaltbar mit /leafBlowerToggle) + woodcuttingPerkDesc6: Doppelter Drop, eifrige Wurzeln und verstecktes Wissen wurden auf Holz übertragen (bei halber Wirksamkeit) + woodcuttingPassiveTitle0: Passive Token + woodcuttingPassiveTitle1: Zurück + woodcuttingPassiveTitle2: Skill Token + woodcuttingPassiveTitle3: Timber Dauer + woodcuttingPassiveTitle4: Doppelter Drop + woodcuttingPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) + woodcuttingPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills + woodcuttingPassiveDesc2: Token, um in den Skillbaum zu investieren + woodcuttingPassiveDesc3: Erhöht die Dauer des Timber um 0,02 s + woodcuttingPassiveDesc4: Erhöht die Chance auf doppelten Drop um 0,05% + miningPerkTitle0: Verschwenderische Eile + miningPerkTitle1: Weitere Bomben + miningPerkTitle2: Schatzsucher + miningPerkTitle3: Bomb-Boyage + miningPerkTitle4: Adernbergmann + miningPerkTitle5: Abrissmann + miningPerkTitle6: Triple Trouble + miningPerkDesc0: Gewinne Eile, nachdem du für jedes Level Erze abgebaut hast + miningPerkDesc1: Das Crafting Rezept für TNT erzeugt +1 TNT pro Level + miningPerkDesc2: Bei Verwendung der Fähigkeit auf Steinen + 1% pro Level Chance für ein Erz Drop (zusätzliche Exp wird durch gedropte Erze verdient) + miningPerkDesc3: Erhöht den TNT-Explosionsradius (wenn er durch Feuerstein und Stahl beleuchtet wird) in jedem Level + miningPerkDesc4: Erzadern werden sofort abgebaut, wenn ein Block abbgebaut wird (umschaltbar). + miningPerkDesc5: TNT-Explosionen verursachen keinen Schaden + miningPerkDesc6: Doppelter Drop sind jetzt dreifacher Drop + miningPassiveTitle0: Passive Token + miningPassiveTitle1: Zurück + miningPassiveTitle2: Skill Token + miningPassiveTitle3: Berserker + miningPassiveTitle4: Doppelter Drop + miningPassiveTitle5: Explosionsabbau + miningPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) + miningPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills + miningPassiveDesc2: Token, um in den Skillbaum zu investieren + miningPassiveDesc3: Erhöht die Dauer von Berserker um 0,02 Sekunden + miningPassiveDesc4: Erhöht die Chance, ein doppelten Drop aus Erzen zu erhalten, um 0,05% + miningPassiveDesc5: Erhöht die Wahrscheinlichkeit, dass durch TNT-Explosionen Erze entstehen um 0,01% (Mehr Blöcke abbgebaut = Mehr Schatzwürfe) + farmingPerkTitle0: Besserer Dünger + farmingPerkTitle1: Tierfarm + farmingPerkTitle2: Bauerndiät + farmingPerkTitle3: Fleischfresser + farmingPerkTitle4: Grüner Daumen + farmingPerkTitle5: Wachstumshormone + farmingPerkTitle6: Eins mit der Natur + farmingPerkDesc0: + 10% Chance, bei Gebrauch kein Knochenmehl zu verbrauchen + farmingPerkDesc1: Kann pro Level ein zusätzliches Spawn-Ei herstellen + farmingPerkDesc2: Farm Essen ist + 20% effektiver bei der Wiederherstellung von Hunger und Sättigung pro Level + farmingPerkDesc3: Fleisch ist + 20% effektiver bei der Wiederherstellung von Hunger und Sättigung pro Level + farmingPerkDesc4: Die Fähigkeit kann Pflanzen, die ausgewachsen sind, mit einer höheren Wahrscheinlichkeit einer Wiederbepflanzung in späteren Wachstumsstadien + neu pflanzen. Fähigkeit wirkt sich jetzt auf Melonen und Kürbisse aus + farmingPerkDesc5: Zucker kann bei Tierbabys verwendet werden, damit sie sofort wachsen + farmingPerkDesc6: Erhalte Regeneration I, wenn du auf Gras still stehst + farmingPassiveTitle0: Passive Token + farmingPassiveTitle1: Zurück + farmingPassiveTitle2: Skill Token + farmingPassiveTitle3: Natürliche Regeneration Dauer + farmingPassiveTitle4: Doppelter Drop (Pflanzen) + farmingPassiveTitle5: Doppelter Drop (Tiere) + farmingPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) + farmingPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills + farmingPassiveDesc2: Token, um in den Skillbaum zu investieren + farmingPassiveDesc3: Erhöht die Dauer der natürlichen Regeneration um 0,02 Sekunden + farmingPassiveDesc4: Erhöht die Chance, einen doppelten Drop aus der Ernte zu erhalten, um 0,05% + farmingPassiveDesc5: Erhöht die Chance, von den meisten passiven Tieren einen doppelten Drop zu erhalten, um 0,05% + fishingPerkTitle0: Plündern + fishingPerkTitle1: Assgeier + fishingPerkTitle2: Fischerdiät + fishingPerkTitle3: Filtration + fishingPerkTitle4: Greifhaken + fishingPerkTitle5: Frisierte Angel + fishingPerkTitle6: Fisch Person + fishingPerkDesc0: + 15% Chance, ein Item pro Level von einem Mob abzuziehen + fishingPerkDesc1: Schaltet eine neue Stufe des Fischereischatzes frei + fishingPerkDesc2: Fische stellen + 20% Hunger pro Level wieder her + fishingPerkDesc3: Beute höherer Stufe (II-V) wird häufiger, Beute niedrigerer Stufe (I) wird weniger + fishingPerkDesc4: Angelrute fungiert jetzt als Greifhaken (umschaltbar mit /grappleToggle) + fishingPerkDesc5: Fische werden jetzt gekocht, wenn sie gefangen werden, einige Fischschätze werden geändert (umschaltbar mit /hotRodToggle) + fishingPerkDesc6: Unendliche Nachtsicht unter Wasser, unendliche Delfin Gnade im Wasser + fishingPassiveTitle0: Passive Token + fishingPassiveTitle1: Zurück + fishingPassiveTitle2: Skill Token + fishingPassiveTitle3: Super Köder Dauer + fishingPassiveTitle4: Doppelte Fänge + fishingPassiveTitle5: Schatzsucher + fishingPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) + fishingPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills + fishingPassiveDesc2: Token, um in den Skillbaum zu investieren + fishingPassiveDesc3: Erhöht die Dauer des Superköders um 0,01 Sekunden + fishingPassiveDesc4: Erhöht die Chance auf einen doppelten Drop um 0,05% + fishingPassiveDesc5: Verringert die Wahrscheinlichkeit Müll zu finden um 0,005% und erhöht die Wahrscheinlichkeit einen Schatz zu finden um 0,005% + archeryPerkTitle0: Zusätzliche Pfeile + archeryPerkTitle1: Sniper + archeryPerkTitle2: Pfeil des Lichts + archeryPerkTitle3: Explosive Pfeile + archeryPerkTitle4: Drachenlose Pfeile + archeryPerkTitle5: Armbrust-Schnelllader + archeryPerkTitle6: Tödlicher Schlag + archeryPerkDesc0: +1 Pfeil aus der Herstellung pro Level + archeryPerkDesc1: Die Pfeilgeschwindigkeit erhöht sich um + 2% pro Level (~ 4% Schadenszunahme / Level) + archeryPerkDesc2: Spektralpfeile erhalten pro Level einen Schadensschub von + 5% + archeryPerkDesc3: Pfeile verursachen +1% bei einem Treffer eine Explosion zu erzeugen + archeryPerkDesc4: Ermöglicht die Herstellung aller Pfeile mit normalen Tränken anstelle von verweilenden Tränken + archeryPerkDesc5: Die Fähigkeit kann jetzt mit Armbrüsten verwendet werden, sodass alle Schüsse sofort geladen werden + archeryPerkDesc6: Von Armbrüsten abgefeuerte Feuerwerke verursachen doppelten Schaden (bis zu 16 Herzen Schaden) + archeryPassiveTitle0: Passive Token + archeryPassiveTitle1: Zurück + archeryPassiveTitle2: Skill Token + archeryPassiveTitle3: Schnellfeuer Dauer + archeryPassiveTitle4: Abruf + archeryPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) + archeryPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills + archeryPassiveDesc2: Token, um in den Skillbaum zu investieren + archeryPassiveDesc3: Erhöht die Dauer des Schnellfeuers um 0,02 Sekunden + archeryPassiveDesc4: Erhöht die Wahrscheinlichkeit, dass ein Pfeilschuss keinen Pfeil verbraucht, um 0,05% pro Level + beastMasteryPerkTitle0: Dickes Fell + beastMasteryPerkTitle1: Scharfe Zähne + beastMasteryPerkTitle2: Gesunde Bisse + beastMasteryPerkTitle3: Bleib weg + beastMasteryPerkTitle4: Akro-Hund + beastMasteryPerkTitle5: Identifizieren + beastMasteryPerkTitle6: Adrenalinschub + beastMasteryPerkDesc0: Hunde erleiden pro Level -10% Schaden + beastMasteryPerkDesc1: Hunde verursachen pro Level + 10% mehr Schaden + beastMasteryPerkDesc2: Hunde heilen +1/2 Herz pro Stufe durch Töten + beastMasteryPerkDesc3: Hunde haben eine Chance von + 5% Feinde zurückzustoßen + beastMasteryPerkDesc4: Hunde erleiden keinen Fallschaden + beastMasteryPerkDesc5: Wenn du einen Kompass für ein Pferd oder einen Wolf verwendest, werden jetzt deren Statistiken angezeigt + beastMasteryPerkDesc6: Sporn Kick ist jetzt Geschwindigkeit III + beastMasteryPassiveTitle0: Passive Token + beastMasteryPassiveTitle1: Zurück + beastMasteryPassiveTitle2: Skill Token + beastMasteryPassiveTitle3: Sporn Kick Dauer + beastMasteryPassiveTitle4: Kritischer Biss + beastMasteryPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) + beastMasteryPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills + beastMasteryPassiveDesc2: Token, um in den Skillbaum zu investieren + beastMasteryPassiveDesc3: Erhöht die Dauer von Sporn Kick um 0,02 Sekunden + beastMasteryPassiveDesc4: Erhöht die Chance für einen Hund einen kritischen Treffer zu erzielen um 0,025% + swordsmanshipPerkTitle0: Adrenalin + swordsmanshipPerkTitle1: Blutrausch + swordsmanshipPerkTitle2: Adrenalin+ + swordsmanshipPerkTitle3: Blut Raserei + swordsmanshipPerkTitle4: Blutdurst + swordsmanshipPerkTitle5: Schärfer! + swordsmanshipPerkTitle6: Schwertbeherrschung + swordsmanshipPerkDesc0: Das Töten feindlicher Mobs mit einem Schwert bietet +2 Sekunden Geschwindigkeit pro Level + swordsmanshipPerkDesc1: Das Töten feindlicher Mobs mit einem Schwert bringt +2 Sekunden Stärke pro Level + swordsmanshipPerkDesc2: + 20% des Geschwindigkeits I vom Adrenalin sind jetzt Geschwindigkeit II + swordsmanshipPerkDesc3: + 20% von Stärke I von Blutrausch ist jetzt Stärke II + swordsmanshipPerkDesc4: Das Töten bestimmter aggressiver Mobs mit einem Schwert stellt den Hunger wieder her + swordsmanshipPerkDesc5: Schnelle Schläge verleihen deinem Schwert jetzt eine gewisse Schärfe + swordsmanshipPerkDesc6: Schwerter verursachen dauerhaft +1 Herzschaden + swordsmanshipPassiveTitle0: Passive Token + swordsmanshipPassiveTitle1: Zurück + swordsmanshipPassiveTitle2: Skill Token + swordsmanshipPassiveTitle3: Schneller Schlag Dauer + swordsmanshipPassiveTitle4: Doppelter Treffer + swordsmanshipPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) + swordsmanshipPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills + swordsmanshipPassiveDesc2: Token, um in den Skillbaum zu investieren + swordsmanshipPassiveDesc3: Erhöht die Dauer von Schneller Schlag um 0,02 Sekunden + swordsmanshipPassiveDesc4: Erhöht die Chance den Mob zweimal zu treffen (zweiter Treffer verursacht 50% Schaden) um 0,02% + defensePerkTitle0: Heiler + defensePerkTitle1: Versteifen + defensePerkTitle2: Dickköpfig + defensePerkTitle3: Versteifen+ + defensePerkTitle4: Geschenk von oben + defensePerkTitle5: Stärkere Beine + defensePerkTitle6: Herzhaft + defensePerkDesc0: Erhalte + 3 Sekunden Regeneration pro Level beim Töten + defensePerkDesc1: + 2% Chance, 5 Sekunden lang Widerstand I zu erhalten, wenn er getroffen wird + defensePerkDesc2: Harter Körper verringert den Schaden um zusätzliche 6,6% pro Stufe + defensePerkDesc3: + 2% Chance, bei einem Treffer 5 Sekunden lang Widerstand II zu erhalten + defensePerkDesc4: Stein-hart gewährt jetzt 4 Absorptionsherzen für eine Fähigkeitsdauer von +1 Minute + defensePerkDesc5: Stein-Hart gibt jetzt Langsamkeit I statt Langsamkeit IV + defensePerkDesc6: +2 Herzen dauerhaft + defensePassiveTitle0: Passive Token + defensePassiveTitle1: Zurück + defensePassiveTitle2: Skill Token + defensePassiveTitle3: Stein-Hart Dauer + defensePassiveTitle4: Harter Körper + defensePassiveTitle5: Doppelter Drop (feindliche Mobs) + defensePassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) + defensePassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills + defensePassiveDesc2: Token, um in den Skillbaum zu investieren + defensePassiveDesc3: Erhöht die Dauer von Stein-Hart um 0,02 Sekunden + defensePassiveDesc4: Erhöht die Chance, reduzierten Schaden (Basis -33%) um 0,01% pro Level zu erleiden + defensePassiveDesc5: Erhöht die Chance, doppelten Drop von aggressiven Mobs zu erhalten, um 0,05% + axeMasteryPerkTitle0: Größere Axt + axeMasteryPerkTitle1: Heilige Axt + axeMasteryPerkTitle2: Revitalisiert + axeMasteryPerkTitle3: Kriegerblut + axeMasteryPerkTitle4: Erdbeben + axeMasteryPerkTitle5: Bessere Crits + axeMasteryPerkTitle6: Axe Man + axeMasteryPerkDesc0: Der Schadensradius der Großen Axt erhöht sich um 1 Block pro Level + axeMasteryPerkDesc1: +2% Chance, dass ein Blitz die Mobs bei einem Axtschlag trifft + axeMasteryPerkDesc2: +1% Chance pro Level auf vollständige Heilung beim Töten + axeMasteryPerkDesc3: +3 Sekunden Stärke 1 pro Level mit einer Axt + axeMasteryPerkDesc4: Der AOE-Schaden der Fähigkeit wird verdoppelt (25% -> 50% des Schadens) + axeMasteryPerkDesc5: Göttliche Crits haben jetzt den 1,6-fachen Multiplikator anstelle des 1,25-fachen + axeMasteryPerkDesc6: Äxte verursachen dauerhaft +1 Herzschaden + axeMasteryPassiveTitle0: Passive Token + axeMasteryPassiveTitle1: Zurück + axeMasteryPassiveTitle2: Skill Token + axeMasteryPassiveTitle3: Great Axe Duration + axeMasteryPassiveTitle4: Göttliche Crits + axeMasteryPassiveDesc0: Token zur Investition in passive Fähigkeiten (Farbstoffe) + axeMasteryPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills + axeMasteryPassiveDesc2: Token, um in den Skillbaum zu investieren + axeMasteryPassiveDesc3: Erhöht die Dauer der Großen Axt um 0,02 Sekunden + axeMasteryPassiveDesc4: Erhöht die zufällige Chance auf kritische Treffer (Grundschaden 1,25x) um 0,01% + repairPerkTitle0: Bergung + repairPerkTitle1: Einfallsreich + repairPerkTitle2: Magie-Reparatur-Skill + repairPerkDesc0: Erhalte durchschnittlich mehr Materialien aus der Bergung + repairPerkDesc1: +10% Chance, dass das bei der Reparatur verwendete Material erhalten bleibt + repairPerkDesc2: Garantiert, dass Verzauberungen repariert werden + repairPassiveTitle0: Zurück + repairPassiveTitle1: Skill Token + repairPassiveTitle2: Kompetenz + repairPassiveDesc0: Bringt dich zurück zum Hauptmenü der Skills + repairPassiveDesc1: Token, um in den Skillbaum zu investieren + repairPassiveDesc2: Materialien stellen bei Reparaturen eine längere Haltbarkeit wieder her + agilityPerkTitle0: Ausweichen + agilityPerkTitle1: Stahlknochen + agilityPerkTitle2: Anmutige Füße + agilityPerkDesc0: + 4% Chance pro Level, Angriffen auszuweichen + agilityPerkDesc1: -10% Fallschaden pro Level + agilityPerkDesc2: Permanente Geschwindigkeit I (umschaltbar durch /speedToggle) + agilityPassiveTitle0: Zurück + agilityPassiveTitle1: Skill Token + agilityPassiveTitle2: Rollen + agilityPassiveDesc0: Bringt dich zurück zum Hauptmenü der Skills + agilityPassiveDesc1: Token, um in den Skillbaum zu investieren + agilityPassiveDesc2: Chance sich abzurollen und weniger Fallschaden zu erleiden + alchemyPerkTitle0: Alchemistische Beschwörung + alchemyPerkTitle1: Altes Wissen + alchemyPerkTitle2: Trankmeister + alchemyPerkDesc0: Ermöglicht die Herstellung einiger Tränke ohne Braustand + alchemyPerkDesc1: Schaltet die Fähigkeit frei, neue Tränke zu brauen + alchemyPerkDesc2: Alle verwendeten Tränke werden um 1 erhöht (umschaltbar mit /togglePotion). + alchemyPassiveTitle0: Zurück + alchemyPassiveTitle1: Skill Token + alchemyPassiveTitle2: Halbwertzeit+ + alchemyPassiveDesc0: Bringt dich zurück zum Hauptmenü der Skills + alchemyPassiveDesc1: Token, um in den Skillbaum zu investieren + alchemyPassiveDesc2: Verlängerung der Tränkedauer bei Verwendung + smeltingPerkTitle0: Kraftstoffeffizienz + smeltingPerkTitle1: Doppelschmelze + smeltingPerkTitle2: Flammen-Spitzhacke + smeltingPerkDesc0: Kraftstoff hält + 20% länger pro Stufe + smeltingPerkDesc1: +5% Chance pro Level, dass geschmolzenes Erz verdoppelt wird + smeltingPerkDesc2: Abgebaute Erze werden sofort geschmolzen (umschaltbar mit /toggleFlamePick) + smeltingPassiveTitle0: Zurück + smeltingPassiveTitle1: Skill Token + smeltingPassiveTitle2: Fuel Speed + smeltingPassiveDesc0: Bringt dich zurück zum Hauptmenü der Skills + smeltingPassiveDesc1: Token, um in den Skillbaum zu investieren + smeltingPassiveDesc2: Erhöht die Kochgeschwindigkeit + enchantingPerkTitle0: Effiziente Verzauberung + enchantingPerkTitle1: Buchmacher + enchantingPerkTitle2: Unsterbliche Erfahrung + enchantingPerkDesc0: Level, die zum verzaubern benötigt werden, werden um -1 pro Level gesenkt, Ambossreparaturen kosten -1 XP Level pro Level (mindestens 2) + enchantingPerkDesc1: Schaltet Crafting Rezepte für einige verzauberte Bücher frei + enchantingPerkDesc2: Behalte EXP beim Tod + enchantingPassiveTitle0: Zurück + enchantingPassiveTitle1: Skill Token + enchantingPassiveTitle2: Schnellere Entwicklung + enchantingPassiveDesc0: Bringt dich zurück zum Hauptmenü der Skills + enchantingPassiveDesc1: Token, um in den Skillbaum zu investieren + enchantingPassiveDesc2: Alle erhaltenen EXP erhöht + globalPerkTitle0: Sammler + globalPerkTitle1: Gelehrte + globalPerkTitle2: Kämpfer + globalPerkTitle3: Harte Arbeit + globalPerkTitle4: Forschung + globalPerkTitle5: Training + globalPerkTitle6: Reinkarnation+ + globalPerkTitle7: Seelenernte + globalPerkTitle8: Avatar + globalPerkTitle9: Meister der Künste + globalPerkDesc0: +20% EXP in den Bereichen Graben, Holzhacken, Bergbau, Landwirtschaft und Fischerei + globalPerkDesc1: +20% EXP in Reparatur, Beweglichkeit, Brauen, Schmelzen und Verzaubern + globalPerkDesc2: +20% EXP in Bogenschießen, Bestienbeherrschung, Schwertkunst, Verteidigung und Axtbeherrschung + globalPerkDesc3: +1 Skill Token in allen Sammlerfertigkeiten + globalPerkDesc4: +1 Skill Token in allen Gelehrtenfertigkeiten + globalPerkDesc5: +1 Skill Token in allen Kämpferfertigkeiten + globalPerkDesc6: Bei Tod 50% Chance, einen Teil jedes wertvollen Gegenstands in deinem Inventar zu behalten + globalPerkDesc7: Du erntest jetzt Seelen, indem du aggressive Mobs tötest, mit denen du Skillbäume zurücksetzen kannst + globalPerkDesc8: 10% Chance, keinen Schaden zu erleiden und alle Buffs im Spiel für 10 Sekunden bei einem Treffer zu erhalten, der dich normalerweise töten würde + globalPerkDesc9: Die Abklingzeiten von Fähigkeiten wurden um 33% verringert + globalPassiveTitle0: Globale Token + globalPassiveTitle1: Zurück + globalPassiveDesc0: Token, um in den Skillbaum zu investieren + globalPassiveDesc1: Bringt dich zurück zum Hauptmenü der Skills + cannotRepair: Du kannst nicht reparieren, solange diese Fähigkeit aktiv ist! + cannotSalvage: Du kannst nichts retten, solange diese Fähigkeit aktiv ist! + spite: Alles Gute ist aus Trotz gemacht + refundSkill: sind erforderlich, um einen Skillbaum zurückzusetzen + refundSkill2: um einen Fähigkeitsbaum zu zurückzusetzen + needToUnlock: du musst das entsperren + perkRequirement: Du benötigst mindestens 2 Skill Token, die in die vorherigen Vorteile investiert wurden, um diesen Perk freizuschalten + perkRequirementM: Du benötigst mindestens 10 Skill Token, die insgesamt in den Skillbaum investiert wurden, um diesen Meisterschaftsvorteil freizuschalten + noSkillTokens: Du hast keine Skill Token + noPassiveTokens: Du hast keine passiven Token + maxedOutPerk: Du hast diesen Perk bereits voll ausgeschöpft! + requiredGlobalPerks0: Du benötigst den vorherigen Perk, um diesen Perk freizuschalten + requiredGlobalPerks1: sind erforderlich, um diesen Perk freizuschalten + requiredGlobalPerks2: ist erforderlich, um diesen Perk freizuschalten + requiredGlobalPerks3: Du benötigst jeden globalen Perk, um diesen Perk freizuschalten + craftRequirement: wird benötigt, um dieses Rezept herzustellen! + roll: ROLLEN + dodge: AUSWEICHEN + prepare: Du bereitest deine + rest: Du ruhst deine + activated: aktiviert! + ended: ist beendet + readyToUse: ist wieder einsatzbereit + cooldown: Abklingzeit + rapidFire: Schnellfeuer + bow: Bogen + greatAxe: Großaxt + axe: Axt + spurKick: Sporn Kick + leg: Bein + stoneSoldier: Steinsoldat + yourself: du selber + bigDig: Mega Grabung + shovel: Schaufel + naturalRegeneration: Natürliche Regeneration + hoe: Hake + superBait: Super Köder + fishingRod: Angelrute + berserkPick: Berserker + pickaxe: Spitzhacke + swiftStrikes: Schneller Schlag + sword: Schwert + timber: Timber + hyperHorse: Dieses Pferd ist schon Hyper! + magicForce: Eine magische Kraft beendet deine Fähigkeit + rob: Rauben + repairFail0: Du bist nicht qualifiziert genug, um dieses Item angemessen zu reparieren + repairFail1: Du konntest keine Materialien retten + repairFail2: Du konntest die Verzauberungskraft des Items nicht beibehalten + treeTooBig0: Dieser Baum ist zu groß, als dass du ihn auf einmal fällen könntest! + treeTooBig1: Dieser Baum kann niemals auf einmal so gefällt werden... + noPermission: Du hast keine Berechtigung um diesen Befehl zu verwenden! + improperArguments: Falsche Argumente, versuche + totalPlayTime: Gesamtspielzeit + clickForOptions: Klicke für Optionen + unknownCommand: Unbekannter Befehl + expToLevel: EXP zum nächsten Level + playerName: Spielername + skillName: Skill Name (auf Englisch) + page: Seite + on0: AN + off0: AUS + onOrOff: AN/AUS + manuallyToggles: Manuell umschalten + commandDesc0: Öffnet das Hauptmenü mit allen Fähigkeiten + commandDesc1: Öffnet eine Skillbaum Menü deiner Wahl + commandDesc2: Öffnet die Konfigurationsmenü + commandDesc3: Gibt einem Spieler der Wahl EXP in einer bestimmten Fähigkeit + commandDesc4: Legt das Level eines bestimmten Spielers in einer bestimmten Fertigkeit fest + commandDesc5: Setzt die Statistiken eines Spielers in einer bestimmten Fertigkeit zurück (erstattet keine Statistiken) + commandDesc6: Zeigt eine Bestenliste für eine bestimmte Statistik an + commandDesc7: Bietet einen Link zu einer Plugin-Informationsseite + commandDesc8: Versuche, ein Objekt in der Hand des Benutzers auf einer bestimmten Ebene zu verzaubern + informationURL: Informations-URL (Google Docs) + click: KLICKE + levelArgument: Das Level-Argument muss kleiner als 40 sein + leaderboard: Bestenliste + playerOffline: Dieser Spieler ist nicht online + onlyIncrease: Bitte erhöhe deine EXP nur mit diesem Befehl, andernfalls verwende /rpg statReset und dann /frpg giveEXP + amount: Menge + unlockToggle: Um diesen Befehl verwenden zu können, musst du folgendes freischalten + levelUpNotif: Level Up Benachrichtigungen + abilityPreparationNotif: Benachrichtigungen zur Fähigkeitsvorbereitung + yes0: JA + no0: NEIN + warning: WARNUNG + souls: Seelen + refundSkillTree0: Die Rückerstattung eines Skillbaums kostet + refundSkillTree1: und ist nicht umkehrbar, bist du sicher, dass du das willst + refundSkillTree2: erstattet die + skill: Skill + backToSkillTree: Bringt dich zurück zum Skillbaum + miningPerkDesc0_1: 2 Sekunden Eile I nach dem Abbau von Erz + miningPerkDesc0_2: 5 Sekunden Eile I nach dem Bergbau mehr + miningPerkDesc0_3: 10 Sekunden Eile I nach dem Abbau von Erz + miningPerkDesc0_4: 5 Sekunden Eile II nach dem Abbau von Erz, gefolgt von 5 Sekunden Eile I + miningPerkDesc0_5: 10 Sekunden Eile II nach dem Abbau von Erz + woodcuttingPerkDesc3_1: Blätter könnten dies dropen + common: verbreitet + uncommon: ungewöhnlich + rare: selten + veryRare: sehr selten + legendary: legendär + fishingPerkDesc1_1: Schaltet die Schatzstufe frei + farmingPerkDesc1_1: Erhalte die Fähigkeit zu craften + cowSpawnEgg: Kuh Spawnei + beeSpawnEgg: Bienen Spawnei + mooshroomSpawnEgg: Pilzkuh Spawnei + horseSpawnEgg: Pferd Spawnei + slimeSpawnEgg: Schleim Spawnei + diggingPerkDesc0_1: Du kannst nun folgendes ausgraben + defensePerkDesc0_1: Erhalte +3 Sekunden Regeneration pro Level bei Kills + defensePerkDesc0_2: Erhalte sofort +0,5 Herzen pro Level bei Kills + duration: Dauer + likelihood: Wahrscheinlichkeit + junkChance: Müll Chance + locked: GESPERRT + unlocked: FREIGESCHALTET + cowEgg: Kuh Ei + beeEgg: Bienen Ei + mooshroomEgg: Pilzkuh Ei + horseEgg: Pferd Ei + slimeEgg: Schleim Ei + tippedArrows: Pfeile mit Spitze + toggle: Umschalten + refundSkillTitle: Rückerstattungsskill + refundSkillTreeDesc: Klicke hier, um diesen Skillbaum zurückzusetzen + enchantingPerkDesc1_0: Schaltet die Fähigkeit frei, folgendes zu herzustellen + enchantingPerkDesc1_1: Stärke 1 und Effizienz I verzauberte Bücher (kostet 1 Level zum herstellen) + enchantingPerkDesc1_2: Schärfe I und Schutz I verzauberte Bücher (kostet 1 Level zum herstellen) + enchantingPerkDesc1_3: Glück des Meeres I und Köder I verzauberte Bücher (kostet1 Level zum herstellen) + enchantingPerkDesc1_4: Wasserläufer I und Eisläufer I verzauberte Bücher (kostet 1 Level zum herstellen) + enchantingPerkDesc1_5: Reparatur Bücher (kostet 10 Level zum herstellen) und Glück I Bücher (kostet 2 Level zum herstellen) + repairPerkDesc0_1: Gewinne im Durchschnitt mehr Material aus der Bergung + repairPerkDesc0_2: Wenn du im Durchschnitt mehr Materialien aus der Bergung gewinnst, speichert die Bergung jetzt Verzauberungen von Items in einem Buch + xpBoost: EXP Boost + speedBoost: Geschwindigkeitsboost + timeExtension: Zeitverlängerung + enchantingCraft0: Stärke I Buch + enchantingCraft1: Effizienz I Buch + enchantingCraft2: Schärfe I Buch + enchantingCraft3: Schutz I Buch + enchantingCraft4: Glück des Meeres I Buch + enchantingCraft5: Köder I Buch + enchantingCraft6: Eisläufer I Buch + enchantingCraft7: Wasserläufer I Buch + enchantingCraft8: Reparatur Buch + enchantingCraft9: Glück I Buch + commandDesc9: Legt die Seelen für einen bestimmten Spieler fest + commandDesc10: Legt die Fähigkeit oder den passiven Token in der angegebenen Skill für einen bestimmten Spieler fest + commandDesc11: Legt die globalen Token für einen bestimmten Spieler fest + commandDesc12: Speichert Statistiken aller Spieler oder eines bestimmten Spielers + status: STATUS + complete: KOMPLETT + incomplete: UNVOLLSTÄNDIG + try0: versuche + passiveImprove: Deine passiven Perks verbessern sich jedes Level! + increasedBy: erhöht um + expIncrease: EXP Multiplikator + personalMultiplier: Persönlicher Multiplikator + translators: Übersetzer + commandDesc13: Legt den persönlichen Multiplikator für einen bestimmten Spieler fest + abilityDescription: Skill Beschreibung + abilityDescription_digging: Fügt deiner Schaufel vorübergehend 5 Effizienzlevel + hinzu. Aktivierung durch Rechts-Klick auf eine Schaufel und anschließend einen + Block abbauen. + abilityDescription_woodcutting: Lässt vorübergehend Äxte einen ganzen Baum mit + einem Block fällen. Aktivierung durch Rechts-Klick auf eine Axt und anschließend + einen Stamm abbauen. + abilityDescription_mining: Fügt deiner Spitzhacke vorübergehend 5 Effizienzlevel + hinzu. Aktivierung durch Rechts-Klick auf einer Spitzhacke und anschließende + einen Block abbaust. + abilityDescription_farming: Vorübergehend werden mit einer Hacke geerntete Items + automatisch neu gepflanzt. Wird aktiviert, indem du mit einer Hacke Rechts-Klick + auf die Ernte machst. + abilityDescription_fishing: Lässt vorübergehend Angelruten sofort einen Fisch + fangen. Aktivierung durch Links-Klick auf eine Angelrute und anschließendes + Angeln im Wasser. + abilityDescription_archery: Lässt vorübergehend alle Pfeile mit maximaler Geschwindigkeit + abfeuern. Aktivierung durch Links-Klick auf einen Bogen und dann einen Pfeil + abschießen. + abilityDescription_beastMastery: Verleiht deinem Pferd vorübergehend einen Geschwindigkeitsschub. + Aktivierung durch Rechts-Klick auf einem Pferd und anschließendes Klicken mit + der linken Maustaste. + abilityDescription_swordsmanship: Entfernt vorübergehend die schwingende Abklingzeit + von Schwertern. Aktivierung durch Rechts-Klick auf ein Schwert und dann einen + Mob schlagen. + abilityDescription_defense: Gibt dem Spieler vorübergehend Widerstands- und Langsamkeitseffekte. + Aktivierung durch Rechts-Klick mit einer leeren Hand und dann einen Mob schlagen. + abilityDescription_axeMastery: Lässt Äxte vorübergehend alle Mobs in einem bestimmten + Radius beschädigen. Aktivierung durch Rechts-Klick auf eine Axt klicken und + dann einen Mob schlagen. + alchemyPerkDesc1_0: Schaltet die Fähigkeit zum Brauen frei + alchemyPerkDesc0_0: Ein Crafting Table kann verwendet werden, um folgende Tränke + herzustellen + triggerAbilities: Fähigkeiten auslösen + showEXPBar: Zeige EXP Bar + disabledSkill: Dieser Skill ist deaktiviert + skillConfigDesc: Führt dich zum Konfigurationsmenü für diesen Skill + lvl: Lvl. + exp: EXP + potionAbsorption: Trank der Absorption + potionBadOmen: Trank des schlechten Omens + potionBlindess: Trank der Blindheit + potionConduitPower: Trank der Leitungskraft + potionResistance: Trank des Widerstands + potionDolphinsGrace: Trank der Delfine Gnade + potionHaste: Trank der Eile + potionFireResistance: Trank der Feuerresistenz + potionGlowing: Trank des Leuchten + potionHarm: Trank der Schadens + potionHealing: Trank der Heilung + potionHealthBoost: Trank des Gesundheitsschub + potiontheHero: Trank des Heldens + potionHunger: Trank des Hungers + potionStrength: Trank der Stärke + potionInvsibility: Trank der Unsichtbarkeit + potionJump: Trank der Sprungkraft + potionLuck: Trank des Glücks + potionNightVision: Trank der Nachtsicht + potionRegeneration: Trank der Regeneration + potionSaturation: Trank der Sättigung + potionSlowness: Trank der Lngsamskeit + potionFatigue: Trank der Abbaulähmung + potionSlowFalling: Trank des langsamen Fallens + potionSpeed: Trank der Geschwindigkeit + potionBadLuck: Trank des Pechs + potionWaterBreathing: Trank der Unterwasseratmung + potionWeakness: Trank der Schwäche + potionDecay: Trank des Zerfallens + potionAwkward: Komischer Trank + potionUncraftable: Nicht herstellbarer Trank + potionMundane: Mundanischer Trank + potionTurtleMaster: Trank der Schildkrötenmeister + potionThick: Dicker Trank + potionWater: Wasserflasche + ingredient: Zutat + usedToBrew: Wird zum Brauen verwendet + costs: kostet + xpLevel: Minecraft XP Level + xpLevels: Minecraft XP Level + craftXPRequirement: Dieses Rezept benötigt + bedGUI: Du kannst diesen Befehl nicht verwenden während du im Bett liegst! + statsUpdated: Deine Statistiken wurden geändert um mit der neuen EXP-Kurve übereinzustimmen. Alle Skillbäume und passive Fähigkeiten wurden zurückgesetzt. Alle Punkte mussen neu verteilt. + timeRemaining: Verbleibende Zeit + numberOfAbilityTimersDisplayed: Anzahl der angezeigten Fähigkeits-Timer + commandDesc14: Setzt die Abklingzeit für eine Fertigkeit auf 0 Sekunden zurück + commandDesc15: Zeigt die FreeRPG Statistiken eines Spielers + repairUnsafeEnchant: Dieses Item ist zu mächtig um es zu reparieren + salvageUnsafeEnchant: Dieses Item ist zu mächtig um gerettet zu werden + rank: Rang + stats: Statistiken + outOf: zu wenig + playerNotInLeaderboard: Dieser Spieler ist auf keiner Bestenliste + virtual: Virtual + commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) - plPL: #Translated by QuarVey - languageName: Polski - englishLanguageName: Polish - translationCredit: QuarVey - global: Globalny - digging: Kopanie - woodcutting: Ścinanie drzew - mining: Górnictwo - farming: Rolnictwo - fishing: Łowienie ryb - archery: Łucznictwo - beastMastery: Mistrzostwo Bestii - swordsmanship: Mistrzostwo Miecza - defense: Obrona - axeMastery: Mistrzostwo Siekiery - repair: Naprawa - alchemy: Alchemia - agility: Zwinność - smelting: Wytapianie - enchanting: Zaklinanie - information: Informacja - configuration: Konfiguracja - level: Poziom - experience: Doświadczenie - toNext: do nastepnego - total: Całkowity - diggingPerkTitle0: Więcej dropu - diggingPerkTitle1: Podwójny skarb - diggingPerkTitle2: Rzadszy drop - diggingPerkTitle3: Złodziej dusz - diggingPerkTitle4: Poszukiwacz Krzemienia - diggingPerkTitle5: Król łopaty - diggingPerkTitle6: Ultra kopanie - diggingPerkDesc0: Rozszerza tabelę skarbów o 1 przedmiot na poziom - diggingPerkDesc1: + 5% szansy na podwójny drop skarbu na poziom (kiedy - skarb jest wyrzucony) - diggingPerkDesc2: Dalej rozszerza tabele dropu o przedmiot na poziom - diggingPerkDesc3: Piasek duszy ma o 5% większe prawdopodobieństwo upuszczenia skarbu na poziom - diggingPerkDesc4: Żwir ma 100% szansy na wypadanie krzemienia (trzeba włączyć umiejetność Poszukiwacz Krzemienia) - diggingPerkDesc5: Łopaty zadają podwójne obrażenia - diggingPerkDesc6: Używając zdolności, niszczysz teraz sekcję bloku 3x3 (20% normalnego wskaźnik skarbów, gdy jest aktywny) - diggingPassiveTitle0: Tokeny Pasywne - diggingPassiveTitle1: Powrót - diggingPassiveTitle2: Tokeny Umiejętności - diggingPassiveTitle3: Duży Kopacz - diggingPassiveTitle4: Szansa na Skarb - diggingPassiveDesc0: Tokeny do rozwoju umiejętności pasywnych - diggingPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności - diggingPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności - diggingPassiveDesc3: Zwiększa czas trwania umiejętności Duży Kopacz o 0.02 sek - diggingPassiveDesc4: Zwiększa szansę na wykopanie skarbu o 0,005% - woodcuttingPerkTitle0: Gorliwe Korzenie - woodcuttingPerkTitle1: Świerze Ręce - woodcuttingPerkTitle2: Ukryta Wiedza - woodcuttingPerkTitle3: Zmiatacz Liści - woodcuttingPerkTitle4: Niszczyciel Drzew+ - woodcuttingPerkTitle5: Dmuchawa do Liści - woodcuttingPerkTitle6: Zdolny Topornik - woodcuttingPerkDesc0: + 20% szansy, że klocki drewna upuszczą 1 PD na poziom - woodcuttingPerkDesc1: +12 sek co poziom Pośpiechu I oraz pierwszym zniszczonym drzewem w przeciągu 5 minut - woodcuttingPerkDesc2: Drzewa mają +0.2% szansy na wypadnięcie zaklętej księgi - woodcuttingPerkDesc3: Liście mają 1% szansy na upuszczenie +1 skarbu na poziom - woodcuttingPerkDesc4: Zwiększono limit zniszczenia drewna z 64 do 128 - woodcuttingPerkDesc5: Break a large section of leaves using an axe (toggleable with /leafBlowerToggle) - woodcuttingPerkDesc6: Podwaja drop, Gorliwe korzenie i ukryta wiedza są teraz stosowane do drewna z połową skuteczności - woodcuttingPassiveTitle0: Tokeny Pasywne - woodcuttingPassiveTitle1: Powrót - woodcuttingPassiveTitle2: Tokeny Umiejętności - woodcuttingPassiveTitle3: Zdolny Drwal - woodcuttingPassiveTitle4: Podwójny Drop - woodcuttingPassiveDesc0: Tokeny do rozwoju umiejętności pasywnych - woodcuttingPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności - woodcuttingPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności - woodcuttingPassiveDesc3: Zwiększa czas trwania umiejętności Zdolnego Drwala o 0.02 sek - woodcuttingPassiveDesc4: Zwiększa szansę na otrzymanie podwójnego dropu o 0.05% - miningPerkTitle0: Bezużyteczny Pośpiech - miningPerkTitle1: Więcej Bomb - miningPerkTitle2: Poszukiwacz Skarbów - miningPerkTitle3: Bombowa Akcja - miningPerkTitle4: Ekspert Żył - miningPerkTitle5: Człowiek Demolka - miningPerkTitle6: Potrójne kłopoty - miningPerkDesc0: Otrzymujesz premie do przyspieszenia po wydobyciu rud na każdym poziomie - miningPerkDesc1: Przepis na TNT produkuje +1 blok TNT na poziom - miningPerkDesc2: Podczas używania umiejętności na kamieniu + 1% na poziom szansy na drop rudy - (dodatkowe punkty doświadczenia można zdobyć z wydropionych rud) - miningPerkDesc3: Zwiększa promień wybuchu TNT(kiedy jest oświetlony krzemieniem i stalą) z każdym poziomem - miningPerkDesc4: Żyły rudy są natychmiast wydobywane po rozbiciu jednego bloku(możliwość wł/wył) - miningPerkDesc5: Eksplozje TNT nie powodują obrażeń - miningPerkDesc6: Podwójny drop jest teraz potrójny - miningPassiveTitle0: Tokeny umiejętności pasywnych - miningPassiveTitle1: Powrót - miningPassiveTitle2: Tokeny umiejętności - miningPassiveTitle3: Berserker - miningPassiveTitle4: Podwójny Drop - miningPassiveTitle5: Wybuchowe Górnictwo - miningPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne - miningPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności - miningPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności - miningPassiveDesc3: Zwiększa czas trwania Berserkera o 0.02sek - miningPassiveDesc4: Zwiększa szansę na zdobycie podwójnego dropu z rud o 0.05% - miningPassiveDesc5: Zwiększa szanse na powstanie rudy z wybuchów TNT o 0.01% - (Więcej zniszczonych bloków = Więcej wyrzuconych skarbów) - farmingPerkTitle0: Lepszy nawóz - farmingPerkTitle1: Farma zwierząt - farmingPerkTitle2: Dieta rolnika - farmingPerkTitle3: Mięsożerny - farmingPerkTitle4: Zielony kciuk - farmingPerkTitle5: Hormony wzrostu - farmingPerkTitle6: Jedność z naturą - farmingPerkDesc0: +10% szansy, aby nie spożyć mączki kostnej podczas użycia - farmingPerkDesc1: Można stworzyć dodatkowe jajko przyzywające na poziom - farmingPerkDesc2: Karma rolnicza jest o 20% bardziej skuteczna w przywracaniu głodu i sytości - na poziom - farmingPerkDesc3: Mięso jest o 20% bardziej skuteczne w przywracaniu głodu i sytości na poziom - farmingPerkDesc4: Możliwość przesadzania upraw w pełni wyrośniętych z większą szansą na - przesadzanie w późniejszych stadiach wzrostu; umiejętność działa teraz na melony i dynie - farmingPerkDesc5: Cukier może być używany na małych zwierzętach, aby natychmiast rosły - farmingPerkDesc6: Zyskujesz Regenerację I stojąc nieruchomo na trawie - farmingPassiveTitle0: Tokeny umiejętności pasywnych - farmingPassiveTitle1: Powrót - farmingPassiveTitle2: Tokeny umiejętności - farmingPassiveTitle3: Naturalna Regeneracja - farmingPassiveTitle4: Podwójny drop (Uprawy) - farmingPassiveTitle5: Podwójny drop (Zwierzęta) - farmingPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne - farmingPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności - farmingPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności - farmingPassiveDesc3: Zwiększa czas trwania naturalnej regeneracji o 0.02sek - farmingPassiveDesc4: Zwiększa szansę na otrzymanie podwójnego dropu z upraw o 0.05% - farmingPassiveDesc5: Zwiększa szansę na otrzymanie podwójnego dropu z większości umiejętności biernych - biernych Zwierząt o 0.05% - fishingPerkTitle0: Złodziejaszek - fishingPerkTitle1: Padlinożerca - fishingPerkTitle2: Dieta Rybaka - fishingPerkTitle3: Filtrowanie - fishingPerkTitle4: Hak z liną - fishingPerkTitle5: Gorąca Wędka - fishingPerkTitle6: Człowiek Ryba - fishingPerkDesc0: +15% szansy na ściągnięcie przedmiotu z moba na poziom - fishingPerkDesc1: Odblokowuje nowy poziom skarbów wędkarskich - fishingPerkDesc2: Ryby przywracają + 20% głodu na poziom - fishingPerkDesc3: Dropy wyższych poziomów (II-V) stają się bardziej powszechne a niższych poziomów (I) - stają się mniej powszechne - fishingPerkDesc4: Wędka działa teraz jak hak (możliwość wł/wył opcji) - fishingPerkDesc5: Ryby są teraz gotowane po złowieniu, niektóre rybackie skarby ulegają zmianie - (możliwość wł/wył) - fishingPerkDesc6: Nieskończone widzenie w nocy pod wodą, nieskończona łaska delfina - kiedy w wodzie - fishingPassiveTitle0: Tokeny umiejętności pasywnych - fishingPassiveTitle1: Powrót - fishingPassiveTitle2: Tokeny umiejętności - fishingPassiveTitle3: Super Przynęta - fishingPassiveTitle4: Podwójny Chwyt - fishingPassiveTitle5: Poszukiwacz Skarbów - fishingPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne - fishingPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności - fishingPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności - fishingPassiveDesc3: Zwiększa czas trwania Super Przynęty o 0.01sek - fishingPassiveDesc4: Zwiększa szansę na otrzymanie podwójnego dropu o 0.05% - fishingPassiveDesc5: Zmniejsza szansę znalezienia śmieci o 0,005%, zwiększa szansę - znalezienia skarbu o 0,005% - archeryPerkTitle0: Dodatkowe strzały - archeryPerkTitle1: Snajper - archeryPerkTitle2: Strzała światła - archeryPerkTitle3: Wybuchowe Strzały - archeryPerkTitle4: Smocze Strzały - archeryPerkTitle5: Szybkie ładowanie kuszy - archeryPerkTitle6: Śmiertelne uderzenie - archeryPerkDesc0: +1 strzała uzyskana z wytwarzania na poziom - archeryPerkDesc1: Szybkość strzały wzrasta o + 2% na poziom (~ 4% wzrost obrażeń / poziom) - archeryPerkDesc2: Widmowe strzały zwiększają obrażenia o + 5% na poziom - archeryPerkDesc3: Strzały mają + 1% do wywołania eksplozji przy trafieniu - archeryPerkDesc4: Pozwala na tworzenie wszystkich strzał z końcówkami za pomocą zwykłych mikstur - zamiast trwałych mikstur - archeryPerkDesc5: Umiejętności można teraz używać z kuszami, dzięki czemu wszystkie strzały będą się ładować - natychmiast - archeryPerkDesc6: Fajerwerki wystrzeliwane z kuszy zadają podwójne obrażenia (do 16 serc - uszkodzeń) - archeryPassiveTitle0: Tokeny umiejętności pasywnych - archeryPassiveTitle1: Powrót - archeryPassiveTitle2: Tokeny umiejętności - archeryPassiveTitle3: Szybki Ostrzał - archeryPassiveTitle4: Odzyskiwanie - archeryPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne - archeryPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności - archeryPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności - archeryPassiveDesc3: Zwiększa czas trwania Szybkiego Ostrzału o 0.02sek - archeryPassiveDesc4: Zwiększa szansę, że wystrzał strzały nie pochłonie strzały o 0,05% - na poziom - beastMasteryPerkTitle0: Grube futro - beastMasteryPerkTitle1: Ostre zęby - beastMasteryPerkTitle2: Zdrowe ukąszenia - beastMasteryPerkTitle3: Trzymaj się z daleka - beastMasteryPerkTitle4: Pies widmo - beastMasteryPerkTitle5: Zidentyfikować - beastMasteryPerkTitle6: Zwiększenie adrenaliny - beastMasteryPerkDesc0: Psy otrzymują -10% obrażeń na poziom - beastMasteryPerkDesc1: Psy zadają + 10% więcej obrażeń na poziom - beastMasteryPerkDesc2: Psy leczą +1/2 serca na poziom po zabiciu - beastMasteryPerkDesc3: Psy zyskują + 5% szansy na odrzucenie wrogów - beastMasteryPerkDesc4: Psy nie odnoszą obrażeń od upadku - beastMasteryPerkDesc5: Użycie kompasu na koniu lub wilku pokazuje teraz ich statystyki - beastMasteryPerkDesc6: Wzmocnienie kopnięcia ostrogi ma teraz prędkość III - beastMasteryPassiveTitle0: Tokeny umiejętności pasywnych - beastMasteryPassiveTitle1: Powrót - beastMasteryPassiveTitle2: Tokeny umiejętności - beastMasteryPassiveTitle3: Kopnięcie Ostrogą - beastMasteryPassiveTitle4: Krytyczne Ugryzienie - beastMasteryPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne - beastMasteryPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności - beastMasteryPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności - beastMasteryPassiveDesc3: Zwiększa czas trwania Kopnięcia Ostrogą o 0.02sek - beastMasteryPassiveDesc4: Zwiększa szansę na trafienie krytyczne przez psa - 0,025% - swordsmanshipPerkTitle0: Adrenalina - swordsmanshipPerkTitle1: Szał zabijania - swordsmanshipPerkTitle2: Adrenalina+ - swordsmanshipPerkTitle3: Szalony Zabijaka - swordsmanshipPerkTitle4: Pragnienie krwi - swordsmanshipPerkTitle5: Oszust! - swordsmanshipPerkTitle6: Mistrz miecza - swordsmanshipPerkDesc0: Zabijanie wrogich mobów mieczem zapewnia +2 sek szybkości ataku - na poziom - swordsmanshipPerkDesc1: Zabijanie wrogich mobów mieczem zapewnia +2 sek. Siły - na poziom - swordsmanshipPerkDesc2: + 20% wzmocnienia prędkości I z Adrenaliny to teraz prędkość II - swordsmanshipPerkDesc3: + 20% siły, którą wzmocniłeś Szałem zabijania, to teraz siła - II - swordsmanshipPerkDesc4: Zabicie niektórych agresywnych mobów za pomocą miecza przywraca - głód - swordsmanshipPerkDesc5: Szybkie uderzenia dodają teraz poziom ostrości do twojego miecza - swordsmanshipPerkDesc6: Miecze na stałe zadają +1 do serca obrażeń - swordsmanshipPassiveTitle0: Tokeny umiejętności pasywnych - swordsmanshipPassiveTitle1: Powrót - swordsmanshipPassiveTitle2: Tokeny umiejętności - swordsmanshipPassiveTitle3: Szybkie Ciosy - swordsmanshipPassiveTitle4: Podwójne trafienie - swordsmanshipPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne - swordsmanshipPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności - swordsmanshipPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności - swordsmanshipPassiveDesc3: Zwiększa czas trwania Szybkich ciosów o 0.02sek - swordsmanshipPassiveDesc4: Zwiększa szansę na dwukrotne trafienie moba (drugie trafienie zadaje - 50% obrażeń) o 0,02% - defensePerkTitle0: Uzdrowiciel - defensePerkTitle1: Sztywniak - defensePerkTitle2: Twardogłowy - defensePerkTitle3: Sztywniak+ - defensePerkTitle4: Prezent z Góry - defensePerkTitle5: Silne nogi - defensePerkTitle6: Serdeczny - defensePerkDesc0: Zyskujesz + 3sek regeneracji życia na poziom przy zabiciu - defensePerkDesc1: + 2% szansy na uzyskanie odporności I na 5 sek po trafieniu - defensePerkDesc2: Twarde ciało zmniejsza obrażenia o dodatkowe 6,6% na poziom - defensePerkDesc3: + 2% szansy na uzyskanie odporności II na 5 sek po trafieniu - defensePerkDesc4: Twardy jak głaz zapewnia teraz 4 serca absorpcji za długość trwania umiejętności - +1 minuta - defensePerkDesc5: Twardy jak głaz teraz daje spowolnienie I zamiast spowolnienia IV - defensePerkDesc6: +2 serca na stałe - defensePassiveTitle0: Tokeny umiejętności pasywnych - defensePassiveTitle1: Powrót - defensePassiveTitle2: Tokeny umiejętności - defensePassiveTitle3: Twardy jak głaz - defensePassiveTitle4: Twarde Ciało - defensePassiveTitle5: Podwójny drop (Wrogie Moby) - defensePassiveDesc0: Tokeny do inwestowania w umiejętności pasywne - defensePassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności - defensePassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności - defensePassiveDesc3: Zwiększa czas trwania umiejętności Twardy jak głaz o 0.02sek - defensePassiveDesc4: Zwiększa szansę na odniesienie zmniejszonych (bazowych -33%) obrażeń o 0,01% - na poziom - defensePassiveDesc5: Zwiększa szansę na otrzymanie podwójnych dropów od agresywnych - mobów o 0,05% - axeMasteryPerkTitle0: Wspaniała Siekiera - axeMasteryPerkTitle1: Święty Siekiera - axeMasteryPerkTitle2: Ożywiony - axeMasteryPerkTitle3: Krew wojownika - axeMasteryPerkTitle4: Trzęsienie ziemi - axeMasteryPerkTitle5: Lepsze krytycze ciosy - axeMasteryPerkTitle6: Bóg Siekiery - axeMasteryPerkDesc0: Promień obrażeń Wspaniałej Siekiery zwiększa się o 1 blok na poziom - axeMasteryPerkDesc1: +2% szansy na to, że fala światła uderzy w moby przy trafieniu siekierą - axeMasteryPerkDesc2: +1% szansy na pełne uleczenie przy zabiciu na poziom - axeMasteryPerkDesc3: +3sek za każdy poziom Siły I w przypadku zabójstw siekierą - axeMasteryPerkDesc4: Obrażenia obszarowe umiejętności są podwojone (25% -> 50% obrażeń) - axeMasteryPerkDesc5: Boskie trafienia krytyczne mają teraz mnożnik 1,6x zamiast 1,25x - axeMasteryPerkDesc6: Siekiery na stałe zadają +1 obrażeń do serca - axeMasteryPassiveTitle0: Tokeny umiejętności pasywnych - axeMasteryPassiveTitle1: Powrót - axeMasteryPassiveTitle2: Tokeny umiejętności - axeMasteryPassiveTitle3: Wspaniała Siekiera - axeMasteryPassiveTitle4: Boskie trafienie krytyczne - axeMasteryPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne - axeMasteryPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności - axeMasteryPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności - axeMasteryPassiveDesc3: Zwiększa czas trwania Wspaniałej Siekiery o 0.02sek - axeMasteryPassiveDesc4: Zwiększa szansę na losowe trafienie krytyczne (podstawowe 1,25x obrażeń) o 0,01% - repairPerkTitle0: Ratowanie - repairPerkTitle1: Pomysłowy - repairPerkTitle2: Mistrzostwo w naprawach magicznych przedmiotów - repairPerkDesc0: Zdobywasz więcej materiałów z odzysku - repairPerkDesc1: +10% szansy na utrzymanie zużytego materiału podczas naprawy - repairPerkDesc2: Gwarantowane utrzymanie zaklęć w naprawie - repairPassiveTitle0: Powrót - repairPassiveTitle1: Tokeny umiejętności - repairPassiveTitle2: Wprawa - repairPassiveDesc0: Przenosi cię z powrotem do głównego menu umiejętności - repairPassiveDesc1: Tokeny do zainwestowania w drzewko umiejętności - repairPassiveDesc2: Materiały przywracają większą trwałość podczas naprawy - agilityPerkTitle0: Unik - agilityPerkTitle1: Stalowe kości - agilityPerkTitle2: Łaskawe Stopy - agilityPerkDesc0: + 4% szansy na uniknięcie ataków na poziom - agilityPerkDesc1: -10% obrażeń od upadku na poziom - agilityPerkDesc2: Stałe wzmocnienie prędkości I (możliwość wł/wył) - agilityPassiveTitle0: Powrót - agilityPassiveTitle1: Tokeny umiejętności - agilityPassiveTitle2: Przewrót - agilityPassiveDesc0: Przenosi cię z powrotem do głównego menu umiejętności - agilityPassiveDesc1: Tokeny do zainwestowania w drzewko umiejętnośc - agilityPassiveDesc2: Szansa na przewrót i zmniejszenie obrażeń od upadku - alchemyPerkTitle0: Alchemiczne przywołanie - alchemyPerkTitle1: Starożytna Wiedza - alchemyPerkTitle2: Mistrz Eliksirów - alchemyPerkDesc0: Pozwala na tworzenie niektórych mikstur bez stołu alchemicznego - alchemyPerkDesc1: Odblokowuje możliwość warzenia nowych mikstur - alchemyPerkDesc2: Poziom wszystkich użytych mikstur wzrasta o 1 (możliwość wł/wył) - alchemyPassiveTitle0: Powrót - alchemyPassiveTitle1: Tokeny Umiejętności - alchemyPassiveTitle2: Half-life+ - alchemyPassiveDesc0: Przenosi cię z powrotem do głównego menu umiejętności - alchemyPassiveDesc1: Tokeny do zainwestowania w drzewko umiejętności - alchemyPassiveDesc2: Wydłuża czas działania mikstur, gdy są używane - smeltingPerkTitle0: Efektywność Paliw - smeltingPerkTitle1: Podwójne wytapianie - smeltingPerkTitle2: Płomienny kilof - smeltingPerkDesc0: Paliwo trwa o 20% dłużej na poziom - smeltingPerkDesc1: + 5% szansy na podwojenie wytopionej rudy na poziom - smeltingPerkDesc2: Wydobywane rudy są natychmiast wytapiane (możliwość wł/wył) - smeltingPassiveTitle0: Powrót - smeltingPassiveTitle1: Tokeny umiejętności - smeltingPassiveTitle2: Prędkość paliwa - smeltingPassiveDesc0: Przenosi cię z powrotem do głównego menu umiejętności - smeltingPassiveDesc1: Tokeny do zainwestowania w drzewko umiejętności - smeltingPassiveDesc2: Zwiększanie prędkości gotowania - enchantingPerkTitle0: Skuteczne zaklinanie - enchantingPerkTitle1: Mądrala - enchantingPerkTitle2: Nieśmiertelne doświadczenie - enchantingPerkDesc0: Poziomy potrzebne do zaklinania -1 na poziom, koszty naprawy kowadła - -1 (minimum 2) poziomy XP na poziom - enchantingPerkDesc1: Odblokowuje przepisy rzemieślnicze dla niektórych zaklętych ksiąg - enchantingPerkDesc2: Zatrzymaj PD w razie śmierci - enchantingPassiveTitle0: Powrót - enchantingPassiveTitle1: Tokeny umiejętności - enchantingPassiveTitle2: Szybszy rozwój - enchantingPassiveDesc0: Przenosi cię z powrotem do głównego menu umiejętności - enchantingPassiveDesc1: Tokeny do zainwestowania w drzewko umiejętności - enchantingPassiveDesc2: Zwiększone wszystkie otrzymane PD - globalPerkTitle0: Zbieracz - globalPerkTitle1: Uczony - globalPerkTitle2: Wojownik - globalPerkTitle3: Ciężka praca - globalPerkTitle4: Badania - globalPerkTitle5: Trening - globalPerkTitle6: Reinkarnacja+ - globalPerkTitle7: Zbieranie dusz - globalPerkTitle8: Wcielenie - globalPerkTitle9: Sztukmistrz - globalPerkDesc0: + 20% Zwiekszonego doświadczenia w kopaniu, ścinaniu drzew, górnictwie, rolnictwie i - wędkarstwie - globalPerkDesc1: +20% Zwiekszonego doświadczenia w naprawie, zręczności, warzeniu, wytapianiu i zaklinaniu - globalPerkDesc2: +20% Zwiekszonego doświadczenia w Łucznictwie, Mistrzostwie Bestii, Mistrzostwie Miecza, Obronie, - oraz Mistrzostwie Siekiery - globalPerkDesc3: +1 Token umiejętności we wszystkich umiejętnościach Zbieracza - globalPerkDesc4: +1 Token umiejętności we wszystkich umiejętnościach Uczonego - globalPerkDesc5: +1 Token umiejętności we wszystkich umiejętnościach Wojownika - globalPerkDesc6: Po śmierci 50% szansy na zatrzymanie części każdego cennego przedmiotu w twoim - ekwipunku - globalPerkDesc7: Teraz zbierasz dusze zabijając agresywne moby, co może - być używane do zwrotu umiejętności ścinania drzew - globalPerkDesc8: 10% szans na brak obrażeń i uzyskanie wszystkich wzmocnień w grze przez 10 sek - przy trafieniu, które normalnie by cię zabiło - globalPerkDesc9: Skraca czas odnowienia umiejętności o 33% - globalPassiveTitle0: Tokeny Globalne - globalPassiveTitle1: Powrót - globalPassiveDesc0: Tokeny do zainwestowania w drzewko umiejętności - globalPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności - cannotRepair: Nie możesz naprawiać, gdy ta umiejętność jest aktywna! - cannotSalvage: Nie możesz ratować, gdy ta umiejętność jest aktywna! - spite: Wszystko, co dobre, powstaje na złość - refundSkill: są wymagane do cofnięcia drzewka umiejętności - refundSkill2: aby cofnąć drzewko umiejętności - needToUnlock: Musisz odblokować - perkRequirement: Aby odblokować tą zdolność, potrzebujesz co najmniej 2 tokenów umiejętności zainwestowanych w poprzednie zdolności - perkRequirementM: Potrzebujesz co najmniej 10 tokenów umiejętności zainwestowanych w drzewko umiejętności, aby odblokować tą zdolność maestrii - noSkillTokens: Nie masz żadnych tokenów umiejętności - noPassiveTokens: Nie masz żadnych pasywnych tokenów - maxedOutPerk: Już osiągnąłeś maksymalny poziom tej zdolności! - requiredGlobalPerks0: Aby odblokować tą zdolność, potrzebujesz poprzedniej zdolności - requiredGlobalPerks1: są wymagane, aby odblokować tą zdolność - requiredGlobalPerks2: jest wymagany, aby odblokować tą zdolność - requiredGlobalPerks3: Aby odblokować tą zdolność, potrzebujesz każdej globalnej zdolności - craftRequirement: jest wymagany do stworzenia tego przepisu! - roll: PRZEWRÓT - dodge: UNIK - prepare: Przygotowujesz swój - rest: Odkładasz swój - activated: aktywowany! - ended: zakończył się - readyToUse: jest gotowy do ponownego użycia - cooldown: czas odnowienia - rapidFire: Szybki ogień - bow: łuk - greatAxe: Wspaniała Siekiera - axe: siekiera - spurKick: Kopnięcie ostrogi - leg: noga - stoneSoldier: Kamienny żołnierz - yourself: siebie - bigDig: Duży Kopacz - shovel: łopata - naturalRegeneration: Naturalna Regeneracja - hoe: motyka - superBait: Super Przynęta - fishingRod: wędka - berserkPick: Berserker - pickaxe: kilof - swiftStrikes: Szybkie Ciosy - sword: miecz - timber: Drewno - hyperHorse: Ten koń jest już hiper szybki! - magicForce: Magiczna siła kończy twoją zdolność - rob: okradziony - repairFail0: Nie masz wystarczających umiejętności, aby odpowiednio naprawić ten przedmiot - repairFail1: Nie udało ci się uratować żadnych materiałów - repairFail2: Nie udało Ci się zachować mocy zaklęcia przedmiotu - treeTooBig0: To drzewo jest za duże, abyś mógł je posiekać za jednym zamachem! ” - treeTooBig1: Tego drzewa nigdy nie będzie się dało zrąbać za jednym razem... - noPermission: Nie masz uprawnień do używania tej komendy! - improperArguments: Nieprawidłowe argumenty, spróbuj - totalPlayTime: Całkowity czas gry - clickForOptions: Kliknij, aby wyświetlić opcje - unknownCommand: Nieznana komenda - expToLevel: PD do następnego poziomu - playerName: nazwaGracza - skillName: nazwaUmiejętności (in English) - page: strona - on0: "WŁ" - off0: "WYŁ" - onOrOff: WŁ/WYŁ - manuallyToggles: Przełącza ręcznie - commandDesc0: Otwiera główne menu ze wszystkimi umiejętnościami - commandDesc1: Otwiera wybrane menu drzewa umiejętności - commandDesc2: Otwiera menu konfiguracyjne - commandDesc3: Daje wybranemu graczowi PD w określonej umiejętności - commandDesc4: Ustawia poziom danego gracza w określonej umiejętności - commandDesc5: Resetuje statystyki gracza w określonej umiejętności (nie zwraca statystyk) - commandDesc6: Wyświetla tabelę wyników dla określonej statystyki - commandDesc7: Zawiera link do strony z informacjami o wtyczce - commandDesc8: Próbuje zaczarować przedmiot w dłoni użytkownika na określonym poziomie - informationURL: Adres informacji URL (Google Docs) - click: KLIKNIJ - levelArgument: Argument poziomu musi być mniejszy niż 40 - leaderboard: Tablica Wyników - playerOffline: Ten gracz nie jest online - onlyIncrease: Za pomocą tego polecenia zwiększ tylko exp, w przeciwnym razie użyj / frpg statReset, a następnie / frpg giveEXP - amount: ilość - unlockToggle: Aby użyć tego polecenia, musisz odblokować - levelUpNotif: Powiadomienia o wyższym poziomie - abilityPreparationNotif: Powiadomienia o przygotowaniu umiejętności - yes0: "TAK" - no0: "NIE" - warning: UWAGA - souls: dusze - refundSkillTree0: Zwrot kosztów drzewka umiejętności - refundSkillTree1: i jest nieodwracalne, czy na pewno chcesz - refundSkillTree2: zwrócić - skill: umiejętność - backToSkillTree: Przenosi cię z powrotem do drzewa umiejętności - miningPerkDesc0_1: 2 sekundy przyśpieszenia I po wydobyciu dowolnej rudy - miningPerkDesc0_2: 5 sekund przyśpieszenia I po wydobyciu dowolnej rudy - miningPerkDesc0_3: 10 sekund przyśpieszenia I po wydobyciu dowolnej rudy - miningPerkDesc0_4: 5 sekund przyśpieszenia II po wydobyciu dowolnej rudy, a następnie 5 sekund przyspieszenia I. - miningPerkDesc0_5: 10 sekund przyśpieszenia II po wydobyciu dowolnej rudy - woodcuttingPerkDesc3_1: Liście mogą teraz opadać - common: pospolity - uncommon: niezwykły - rare: rzadki - veryRare: bardzo rzadki - legendary: legendarny - fishingPerkDesc1_1: Odblokowuje poziom skarbu - farmingPerkDesc1_1: Zdobądź umiejętność by stworzyć - cowSpawnEgg: jajko przywołania krowę - beeSpawnEgg: jajko przywołania pszczoły - mooshroomSpawnEgg: jajko przywołania grzybowej krowy - horseSpawnEgg: jajko przywołania konia - slimeSpawnEgg: jajko przywołania slime - diggingPerkDesc0_1: Możesz teraz wykopać - defensePerkDesc0_1: Zyskujesz +3 sek regeneracji na poziom przy zabójstwach - defensePerkDesc0_2: Zyskujesz +0,5 serca na poziom natychmiast po zabiciu - duration: Czas trwania - likelihood: Prawdopodobieństwo - junkChance: Szansa na śmieci - locked: ZABLOKOWANY - unlocked: ODBLOKOWANY - cowEgg: Krowie Jajo - beeEgg: Jajko pszczoły - mooshroomEgg: Jajko grzybowej krowy - horseEgg: jajko konia - slimeEgg: jajko slime - tippedArrows: Ostre strzały - toggle: Przełącznik - refundSkillTitle: Zwrot Umiejętności - refundSkillTreeDesc: Kliknij, aby zwrócić to drzewo umiejętności - enchantingPerkDesc1_0: Odblokowuje możliwość tworzenia - enchantingPerkDesc1_1: Zaklęte książki Moc I i Wydajność I (Kosztują 1 poziom aby wytworzyć) " - enchantingPerkDesc1_2: Zaklęte książki Ostrośc I i Ochrona I (Kosztują 1 poziom aby wytworzyć) - enchantingPerkDesc1_3: Zaklęte książki Morska fortuna I i Przynęta I (Kosztują 1 poziom aby wytworzyć) - enchantingPerkDesc1_4: Zaklęte książki Głębinowy wędrowiec I i Mroźny piechur I (Kosztują 1 poziom aby wytworzyć) - enchantingPerkDesc1_5: Zaklęte książki Naprawa (kosztuje 10 poziomów aby wytworzyc) Fortuna I (Kosztuje 2 poziomy aby wytworzyć) - repairPerkDesc0_1: Zdobywa więcej materiałów średnio ze złomu - repairPerkDesc0_2: Zdobywa więcej materiałów średnio ze złomu , ratowanie teraz przechowuje zaklęcia przedmiotów w książce - xpBoost: Zwiększone PD - speedBoost: Zwiększenie prędkości - timeExtension: Przedłużenie czasu - enchantingCraft0: Księga Moc I - enchantingCraft1: Księga Wydajność I - enchantingCraft2: Księga Ostrość I - enchantingCraft3: Księga Ochrona I - enchantingCraft4: Księga Morska fortuna I - enchantingCraft5: Księga Przynęta I - enchantingCraft6: Księga Mroźny piechur I - enchantingCraft7: Księga Głebinowy Wędrowiec I - enchantingCraft8: Księga Naprawa - enchantingCraft9: Księga Fortuna I - commandDesc9: Ustawia dusze dla określonego gracza - commandDesc10: Ustawia tokeny umiejętności lub pasywne w określonej umiejętności dla określonego gracza - commandDesc11: Ustawia globalne tokeny dla określonego gracza - commandDesc12: Zapisuje statystyki wszystkich graczy lub określonego gracza - status: STATUS - complete: KOMPLETNY - incomplete: NIEKOMPLETNY - try0: "próba" - passiveImprove: Twoje pasywne zdolności poprawiają się z każdym poziomem! - increasedBy: wzrosła o - expIncrease: Mnożnik PD - personalMultiplier: Osobisty mnożnik - translators: Tłumacze - commandDesc13: Ustawia osobisty mnożnik dla określonego gracza - abilityDescription: Ability Description - abilityDescription_digging: Temporarily adds 5 levels of effiency to your shovel. Activated by right-clicking a shovel then breaking a block. - abilityDescription_woodcutting: Temporarily makes axes break an entire tree with one block break. Activated by right-clicking an axe then breaking a log. - abilityDescription_mining: Temporarily adds 5 levels of effiency to your pickaxe. Activated by right-clicking a pickaxe then breaking block. - abilityDescription_farming: Temporarily makes crops broken with a hoe automatically replant. Activated by right-clicking a hoe then breaking a crop. - abilityDescription_fishing: Temporarily makes fishing rods instantly catch a fish. Activated by left-clicking a fishing rod then fishing in water. - abilityDescription_archery: Temporarily makes all arrows fired at max speed. Activated by left-clicking a bow then shooting an arrow. - abilityDescription_beastMastery: Temporarily gives your horse a speed buff. Activated by right-clicking while on a horse then left-clicking. - abilityDescription_swordsmanship: Temporarily removes swinging cooldown on swords. Activated by right-clicking a sword then hitting a mob. - abilityDescription_defense: Temporarily gives the user Resistance and Slowness effects. Activated by right-clicking with an empty hand then hitting a mob. - abilityDescription_axeMastery: Temporarily makes axes do damage to all mobs in a certain radius. Activated by right-clicking an axe then hitting a mob. - alchemyPerkDesc1_0: Odblokowuje możliwość warzenia - alchemyPerkDesc0_0: Na stole rzemieślniczym można tworzyć mikstury do - triggerAbilities: Trigger Abilities - showEXPBar: Show EXP Bar - disabledSkill: This skill is disabled - skillConfigDesc: Takes you to configuration menu for this skill - lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" - exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" - potionAbsorption: Potion of Absorption - potionBadOmen: Potion of Bad Omen - potionBlindess: Potion of Blindess - potionConduitPower: Potion of Conduit Power - potionResistance: Potion of Resistance - potionDolphinsGrace: Potion of Dolphins Grace - potionHaste: Potion of Haste - potionFireResistance: Potion of Fire Resistance - potionGlowing: Potion of Glowing - potionHarm: Potion of Harm - potionHealing: Potion of Healing - potionHealthBoost: Potion of Health Boost - potiontheHero: Potion of the Hero - potionHunger: Potion of Hunger - potionStrength: Potion of Strength - potionInvsibility: Potion of Invsibility - potionJump: Potion of Jump - potionLuck: Potion of Luck - potionNightVision: Potion of Night Vision - potionRegeneration: Potion of Regeneration - potionSaturation: Potion of Saturation - potionSlowness: Potion of Slowness - potionFatigue: Potion of Fatigue - potionSlowFalling: Potion of Slow Falling - potionSpeed: Potion of Speed - potionBadLuck: Potion of Bad Luck - potionWaterBreathing: Potion of Water Breathing - potionWeakness: Potion of Weakness - potionDecay: Potion of Decay - potionAwkward: Awkward Potion - potionUncraftable: Uncraftable Potion - potionMundane: Mundane Potion - potionTurtleMaster: Potion of the Turtle Master - potionThick: Thick Potion - potionWater: Water Bottle - ingredient: Ingredient - usedToBrew: Is used to brew - costs: costs - xpLevel: Minecraft XP Level - xpLevels: Minecraft XP Levels - craftXPRequirement: This recipe requires at least - bedGUI: You cannot use this command while in bed! - statsUpdated: Your stats were changed to be consistent with a new EXP curve. - All skill trees and passive perks have been reset. All tokens must be re-invested. - timeRemaining: Time Remaining - numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed - commandDesc14: Resets the cooldown period for a skill to 0 seconds - commandDesc15: Looks up a player's FreeRPG stats - repairUnsafeEnchant: This item is too powerful to be repaired - salvageUnsafeEnchant: This item is too powerful to be salvaged - rank: Rank - stats: stats - outOf: out of - playerNotInLeaderboard: That player is not on any leaderboards - virtual: Virtual - commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) + plPL: #Translated by QuarVey + languageName: Polski + englishLanguageName: Polish + translationCredit: QuarVey + global: Globalny + digging: Kopanie + woodcutting: Ścinanie drzew + mining: Górnictwo + farming: Rolnictwo + fishing: Łowienie ryb + archery: Łucznictwo + beastMastery: Mistrzostwo Bestii + swordsmanship: Mistrzostwo Miecza + defense: Obrona + axeMastery: Mistrzostwo Siekiery + repair: Naprawa + alchemy: Alchemia + agility: Zwinność + smelting: Wytapianie + enchanting: Zaklinanie + information: Informacja + configuration: Konfiguracja + level: Poziom + experience: Doświadczenie + toNext: do nastepnego + total: Całkowity + diggingPerkTitle0: Więcej dropu + diggingPerkTitle1: Podwójny skarb + diggingPerkTitle2: Rzadszy drop + diggingPerkTitle3: Złodziej dusz + diggingPerkTitle4: Poszukiwacz Krzemienia + diggingPerkTitle5: Król łopaty + diggingPerkTitle6: Ultra kopanie + diggingPerkDesc0: Rozszerza tabelę skarbów o 1 przedmiot na poziom + diggingPerkDesc1: + 5% szansy na podwójny drop skarbu na poziom (kiedy + skarb jest wyrzucony) + diggingPerkDesc2: Dalej rozszerza tabele dropu o przedmiot na poziom + diggingPerkDesc3: Piasek duszy ma o 5% większe prawdopodobieństwo upuszczenia skarbu na poziom + diggingPerkDesc4: Żwir ma 100% szansy na wypadanie krzemienia (trzeba włączyć umiejetność Poszukiwacz Krzemienia) + diggingPerkDesc5: Łopaty zadają podwójne obrażenia + diggingPerkDesc6: Używając zdolności, niszczysz teraz sekcję bloku 3x3 (20% normalnego wskaźnik skarbów, gdy jest aktywny) + diggingPassiveTitle0: Tokeny Pasywne + diggingPassiveTitle1: Powrót + diggingPassiveTitle2: Tokeny Umiejętności + diggingPassiveTitle3: Duży Kopacz + diggingPassiveTitle4: Szansa na Skarb + diggingPassiveDesc0: Tokeny do rozwoju umiejętności pasywnych + diggingPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności + diggingPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności + diggingPassiveDesc3: Zwiększa czas trwania umiejętności Duży Kopacz o 0.02 sek + diggingPassiveDesc4: Zwiększa szansę na wykopanie skarbu o 0,005% + woodcuttingPerkTitle0: Gorliwe Korzenie + woodcuttingPerkTitle1: Świerze Ręce + woodcuttingPerkTitle2: Ukryta Wiedza + woodcuttingPerkTitle3: Zmiatacz Liści + woodcuttingPerkTitle4: Niszczyciel Drzew+ + woodcuttingPerkTitle5: Dmuchawa do Liści + woodcuttingPerkTitle6: Zdolny Topornik + woodcuttingPerkDesc0: + 20% szansy, że klocki drewna upuszczą 1 PD na poziom + woodcuttingPerkDesc1: +12 sek co poziom Pośpiechu I oraz pierwszym zniszczonym drzewem w przeciągu 5 minut + woodcuttingPerkDesc2: Drzewa mają +0.2% szansy na wypadnięcie zaklętej księgi + woodcuttingPerkDesc3: Liście mają 1% szansy na upuszczenie +1 skarbu na poziom + woodcuttingPerkDesc4: Zwiększono limit zniszczenia drewna z 64 do 128 + woodcuttingPerkDesc5: Break a large section of leaves using an axe (toggleable with /leafBlowerToggle) + woodcuttingPerkDesc6: Podwaja drop, Gorliwe korzenie i ukryta wiedza są teraz stosowane do drewna z połową skuteczności + woodcuttingPassiveTitle0: Tokeny Pasywne + woodcuttingPassiveTitle1: Powrót + woodcuttingPassiveTitle2: Tokeny Umiejętności + woodcuttingPassiveTitle3: Zdolny Drwal + woodcuttingPassiveTitle4: Podwójny Drop + woodcuttingPassiveDesc0: Tokeny do rozwoju umiejętności pasywnych + woodcuttingPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności + woodcuttingPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności + woodcuttingPassiveDesc3: Zwiększa czas trwania umiejętności Zdolnego Drwala o 0.02 sek + woodcuttingPassiveDesc4: Zwiększa szansę na otrzymanie podwójnego dropu o 0.05% + miningPerkTitle0: Bezużyteczny Pośpiech + miningPerkTitle1: Więcej Bomb + miningPerkTitle2: Poszukiwacz Skarbów + miningPerkTitle3: Bombowa Akcja + miningPerkTitle4: Ekspert Żył + miningPerkTitle5: Człowiek Demolka + miningPerkTitle6: Potrójne kłopoty + miningPerkDesc0: Otrzymujesz premie do przyspieszenia po wydobyciu rud na każdym poziomie + miningPerkDesc1: Przepis na TNT produkuje +1 blok TNT na poziom + miningPerkDesc2: Podczas używania umiejętności na kamieniu + 1% na poziom szansy na drop rudy + (dodatkowe punkty doświadczenia można zdobyć z wydropionych rud) + miningPerkDesc3: Zwiększa promień wybuchu TNT(kiedy jest oświetlony krzemieniem i stalą) z każdym poziomem + miningPerkDesc4: Żyły rudy są natychmiast wydobywane po rozbiciu jednego bloku(możliwość wł/wył) + miningPerkDesc5: Eksplozje TNT nie powodują obrażeń + miningPerkDesc6: Podwójny drop jest teraz potrójny + miningPassiveTitle0: Tokeny umiejętności pasywnych + miningPassiveTitle1: Powrót + miningPassiveTitle2: Tokeny umiejętności + miningPassiveTitle3: Berserker + miningPassiveTitle4: Podwójny Drop + miningPassiveTitle5: Wybuchowe Górnictwo + miningPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne + miningPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności + miningPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności + miningPassiveDesc3: Zwiększa czas trwania Berserkera o 0.02sek + miningPassiveDesc4: Zwiększa szansę na zdobycie podwójnego dropu z rud o 0.05% + miningPassiveDesc5: Zwiększa szanse na powstanie rudy z wybuchów TNT o 0.01% + (Więcej zniszczonych bloków = Więcej wyrzuconych skarbów) + farmingPerkTitle0: Lepszy nawóz + farmingPerkTitle1: Farma zwierząt + farmingPerkTitle2: Dieta rolnika + farmingPerkTitle3: Mięsożerny + farmingPerkTitle4: Zielony kciuk + farmingPerkTitle5: Hormony wzrostu + farmingPerkTitle6: Jedność z naturą + farmingPerkDesc0: +10% szansy, aby nie spożyć mączki kostnej podczas użycia + farmingPerkDesc1: Można stworzyć dodatkowe jajko przyzywające na poziom + farmingPerkDesc2: Karma rolnicza jest o 20% bardziej skuteczna w przywracaniu głodu i sytości + na poziom + farmingPerkDesc3: Mięso jest o 20% bardziej skuteczne w przywracaniu głodu i sytości na poziom + farmingPerkDesc4: Możliwość przesadzania upraw w pełni wyrośniętych z większą szansą na + przesadzanie w późniejszych stadiach wzrostu; umiejętność działa teraz na melony i dynie + farmingPerkDesc5: Cukier może być używany na małych zwierzętach, aby natychmiast rosły + farmingPerkDesc6: Zyskujesz Regenerację I stojąc nieruchomo na trawie + farmingPassiveTitle0: Tokeny umiejętności pasywnych + farmingPassiveTitle1: Powrót + farmingPassiveTitle2: Tokeny umiejętności + farmingPassiveTitle3: Naturalna Regeneracja + farmingPassiveTitle4: Podwójny drop (Uprawy) + farmingPassiveTitle5: Podwójny drop (Zwierzęta) + farmingPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne + farmingPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności + farmingPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności + farmingPassiveDesc3: Zwiększa czas trwania naturalnej regeneracji o 0.02sek + farmingPassiveDesc4: Zwiększa szansę na otrzymanie podwójnego dropu z upraw o 0.05% + farmingPassiveDesc5: Zwiększa szansę na otrzymanie podwójnego dropu z większości umiejętności biernych + biernych Zwierząt o 0.05% + fishingPerkTitle0: Złodziejaszek + fishingPerkTitle1: Padlinożerca + fishingPerkTitle2: Dieta Rybaka + fishingPerkTitle3: Filtrowanie + fishingPerkTitle4: Hak z liną + fishingPerkTitle5: Gorąca Wędka + fishingPerkTitle6: Człowiek Ryba + fishingPerkDesc0: +15% szansy na ściągnięcie przedmiotu z moba na poziom + fishingPerkDesc1: Odblokowuje nowy poziom skarbów wędkarskich + fishingPerkDesc2: Ryby przywracają + 20% głodu na poziom + fishingPerkDesc3: Dropy wyższych poziomów (II-V) stają się bardziej powszechne a niższych poziomów (I) + stają się mniej powszechne + fishingPerkDesc4: Wędka działa teraz jak hak (możliwość wł/wył opcji) + fishingPerkDesc5: Ryby są teraz gotowane po złowieniu, niektóre rybackie skarby ulegają zmianie + (możliwość wł/wył) + fishingPerkDesc6: Nieskończone widzenie w nocy pod wodą, nieskończona łaska delfina + kiedy w wodzie + fishingPassiveTitle0: Tokeny umiejętności pasywnych + fishingPassiveTitle1: Powrót + fishingPassiveTitle2: Tokeny umiejętności + fishingPassiveTitle3: Super Przynęta + fishingPassiveTitle4: Podwójny Chwyt + fishingPassiveTitle5: Poszukiwacz Skarbów + fishingPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne + fishingPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności + fishingPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności + fishingPassiveDesc3: Zwiększa czas trwania Super Przynęty o 0.01sek + fishingPassiveDesc4: Zwiększa szansę na otrzymanie podwójnego dropu o 0.05% + fishingPassiveDesc5: Zmniejsza szansę znalezienia śmieci o 0,005%, zwiększa szansę + znalezienia skarbu o 0,005% + archeryPerkTitle0: Dodatkowe strzały + archeryPerkTitle1: Snajper + archeryPerkTitle2: Strzała światła + archeryPerkTitle3: Wybuchowe Strzały + archeryPerkTitle4: Smocze Strzały + archeryPerkTitle5: Szybkie ładowanie kuszy + archeryPerkTitle6: Śmiertelne uderzenie + archeryPerkDesc0: +1 strzała uzyskana z wytwarzania na poziom + archeryPerkDesc1: Szybkość strzały wzrasta o + 2% na poziom (~ 4% wzrost obrażeń / poziom) + archeryPerkDesc2: Widmowe strzały zwiększają obrażenia o + 5% na poziom + archeryPerkDesc3: Strzały mają + 1% do wywołania eksplozji przy trafieniu + archeryPerkDesc4: Pozwala na tworzenie wszystkich strzał z końcówkami za pomocą zwykłych mikstur + zamiast trwałych mikstur + archeryPerkDesc5: Umiejętności można teraz używać z kuszami, dzięki czemu wszystkie strzały będą się ładować + natychmiast + archeryPerkDesc6: Fajerwerki wystrzeliwane z kuszy zadają podwójne obrażenia (do 16 serc + uszkodzeń) + archeryPassiveTitle0: Tokeny umiejętności pasywnych + archeryPassiveTitle1: Powrót + archeryPassiveTitle2: Tokeny umiejętności + archeryPassiveTitle3: Szybki Ostrzał + archeryPassiveTitle4: Odzyskiwanie + archeryPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne + archeryPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności + archeryPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności + archeryPassiveDesc3: Zwiększa czas trwania Szybkiego Ostrzału o 0.02sek + archeryPassiveDesc4: Zwiększa szansę, że wystrzał strzały nie pochłonie strzały o 0,05% + na poziom + beastMasteryPerkTitle0: Grube futro + beastMasteryPerkTitle1: Ostre zęby + beastMasteryPerkTitle2: Zdrowe ukąszenia + beastMasteryPerkTitle3: Trzymaj się z daleka + beastMasteryPerkTitle4: Pies widmo + beastMasteryPerkTitle5: Zidentyfikować + beastMasteryPerkTitle6: Zwiększenie adrenaliny + beastMasteryPerkDesc0: Psy otrzymują -10% obrażeń na poziom + beastMasteryPerkDesc1: Psy zadają + 10% więcej obrażeń na poziom + beastMasteryPerkDesc2: Psy leczą +1/2 serca na poziom po zabiciu + beastMasteryPerkDesc3: Psy zyskują + 5% szansy na odrzucenie wrogów + beastMasteryPerkDesc4: Psy nie odnoszą obrażeń od upadku + beastMasteryPerkDesc5: Użycie kompasu na koniu lub wilku pokazuje teraz ich statystyki + beastMasteryPerkDesc6: Wzmocnienie kopnięcia ostrogi ma teraz prędkość III + beastMasteryPassiveTitle0: Tokeny umiejętności pasywnych + beastMasteryPassiveTitle1: Powrót + beastMasteryPassiveTitle2: Tokeny umiejętności + beastMasteryPassiveTitle3: Kopnięcie Ostrogą + beastMasteryPassiveTitle4: Krytyczne Ugryzienie + beastMasteryPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne + beastMasteryPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności + beastMasteryPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności + beastMasteryPassiveDesc3: Zwiększa czas trwania Kopnięcia Ostrogą o 0.02sek + beastMasteryPassiveDesc4: Zwiększa szansę na trafienie krytyczne przez psa + 0,025% + swordsmanshipPerkTitle0: Adrenalina + swordsmanshipPerkTitle1: Szał zabijania + swordsmanshipPerkTitle2: Adrenalina+ + swordsmanshipPerkTitle3: Szalony Zabijaka + swordsmanshipPerkTitle4: Pragnienie krwi + swordsmanshipPerkTitle5: Oszust! + swordsmanshipPerkTitle6: Mistrz miecza + swordsmanshipPerkDesc0: Zabijanie wrogich mobów mieczem zapewnia +2 sek szybkości ataku + na poziom + swordsmanshipPerkDesc1: Zabijanie wrogich mobów mieczem zapewnia +2 sek. Siły + na poziom + swordsmanshipPerkDesc2: + 20% wzmocnienia prędkości I z Adrenaliny to teraz prędkość II + swordsmanshipPerkDesc3: + 20% siły, którą wzmocniłeś Szałem zabijania, to teraz siła + II + swordsmanshipPerkDesc4: Zabicie niektórych agresywnych mobów za pomocą miecza przywraca + głód + swordsmanshipPerkDesc5: Szybkie uderzenia dodają teraz poziom ostrości do twojego miecza + swordsmanshipPerkDesc6: Miecze na stałe zadają +1 do serca obrażeń + swordsmanshipPassiveTitle0: Tokeny umiejętności pasywnych + swordsmanshipPassiveTitle1: Powrót + swordsmanshipPassiveTitle2: Tokeny umiejętności + swordsmanshipPassiveTitle3: Szybkie Ciosy + swordsmanshipPassiveTitle4: Podwójne trafienie + swordsmanshipPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne + swordsmanshipPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności + swordsmanshipPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności + swordsmanshipPassiveDesc3: Zwiększa czas trwania Szybkich ciosów o 0.02sek + swordsmanshipPassiveDesc4: Zwiększa szansę na dwukrotne trafienie moba (drugie trafienie zadaje + 50% obrażeń) o 0,02% + defensePerkTitle0: Uzdrowiciel + defensePerkTitle1: Sztywniak + defensePerkTitle2: Twardogłowy + defensePerkTitle3: Sztywniak+ + defensePerkTitle4: Prezent z Góry + defensePerkTitle5: Silne nogi + defensePerkTitle6: Serdeczny + defensePerkDesc0: Zyskujesz + 3sek regeneracji życia na poziom przy zabiciu + defensePerkDesc1: + 2% szansy na uzyskanie odporności I na 5 sek po trafieniu + defensePerkDesc2: Twarde ciało zmniejsza obrażenia o dodatkowe 6,6% na poziom + defensePerkDesc3: + 2% szansy na uzyskanie odporności II na 5 sek po trafieniu + defensePerkDesc4: Twardy jak głaz zapewnia teraz 4 serca absorpcji za długość trwania umiejętności + +1 minuta + defensePerkDesc5: Twardy jak głaz teraz daje spowolnienie I zamiast spowolnienia IV + defensePerkDesc6: +2 serca na stałe + defensePassiveTitle0: Tokeny umiejętności pasywnych + defensePassiveTitle1: Powrót + defensePassiveTitle2: Tokeny umiejętności + defensePassiveTitle3: Twardy jak głaz + defensePassiveTitle4: Twarde Ciało + defensePassiveTitle5: Podwójny drop (Wrogie Moby) + defensePassiveDesc0: Tokeny do inwestowania w umiejętności pasywne + defensePassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności + defensePassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności + defensePassiveDesc3: Zwiększa czas trwania umiejętności Twardy jak głaz o 0.02sek + defensePassiveDesc4: Zwiększa szansę na odniesienie zmniejszonych (bazowych -33%) obrażeń o 0,01% + na poziom + defensePassiveDesc5: Zwiększa szansę na otrzymanie podwójnych dropów od agresywnych + mobów o 0,05% + axeMasteryPerkTitle0: Wspaniała Siekiera + axeMasteryPerkTitle1: Święty Siekiera + axeMasteryPerkTitle2: Ożywiony + axeMasteryPerkTitle3: Krew wojownika + axeMasteryPerkTitle4: Trzęsienie ziemi + axeMasteryPerkTitle5: Lepsze krytycze ciosy + axeMasteryPerkTitle6: Bóg Siekiery + axeMasteryPerkDesc0: Promień obrażeń Wspaniałej Siekiery zwiększa się o 1 blok na poziom + axeMasteryPerkDesc1: +2% szansy na to, że fala światła uderzy w moby przy trafieniu siekierą + axeMasteryPerkDesc2: +1% szansy na pełne uleczenie przy zabiciu na poziom + axeMasteryPerkDesc3: +3sek za każdy poziom Siły I w przypadku zabójstw siekierą + axeMasteryPerkDesc4: Obrażenia obszarowe umiejętności są podwojone (25% -> 50% obrażeń) + axeMasteryPerkDesc5: Boskie trafienia krytyczne mają teraz mnożnik 1,6x zamiast 1,25x + axeMasteryPerkDesc6: Siekiery na stałe zadają +1 obrażeń do serca + axeMasteryPassiveTitle0: Tokeny umiejętności pasywnych + axeMasteryPassiveTitle1: Powrót + axeMasteryPassiveTitle2: Tokeny umiejętności + axeMasteryPassiveTitle3: Wspaniała Siekiera + axeMasteryPassiveTitle4: Boskie trafienie krytyczne + axeMasteryPassiveDesc0: Tokeny do inwestowania w umiejętności pasywne + axeMasteryPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności + axeMasteryPassiveDesc2: Tokeny do zainwestowania w drzewko umiejętności + axeMasteryPassiveDesc3: Zwiększa czas trwania Wspaniałej Siekiery o 0.02sek + axeMasteryPassiveDesc4: Zwiększa szansę na losowe trafienie krytyczne (podstawowe 1,25x obrażeń) o 0,01% + repairPerkTitle0: Ratowanie + repairPerkTitle1: Pomysłowy + repairPerkTitle2: Mistrzostwo w naprawach magicznych przedmiotów + repairPerkDesc0: Zdobywasz więcej materiałów z odzysku + repairPerkDesc1: +10% szansy na utrzymanie zużytego materiału podczas naprawy + repairPerkDesc2: Gwarantowane utrzymanie zaklęć w naprawie + repairPassiveTitle0: Powrót + repairPassiveTitle1: Tokeny umiejętności + repairPassiveTitle2: Wprawa + repairPassiveDesc0: Przenosi cię z powrotem do głównego menu umiejętności + repairPassiveDesc1: Tokeny do zainwestowania w drzewko umiejętności + repairPassiveDesc2: Materiały przywracają większą trwałość podczas naprawy + agilityPerkTitle0: Unik + agilityPerkTitle1: Stalowe kości + agilityPerkTitle2: Łaskawe Stopy + agilityPerkDesc0: + 4% szansy na uniknięcie ataków na poziom + agilityPerkDesc1: -10% obrażeń od upadku na poziom + agilityPerkDesc2: Stałe wzmocnienie prędkości I (możliwość wł/wył) + agilityPassiveTitle0: Powrót + agilityPassiveTitle1: Tokeny umiejętności + agilityPassiveTitle2: Przewrót + agilityPassiveDesc0: Przenosi cię z powrotem do głównego menu umiejętności + agilityPassiveDesc1: Tokeny do zainwestowania w drzewko umiejętnośc + agilityPassiveDesc2: Szansa na przewrót i zmniejszenie obrażeń od upadku + alchemyPerkTitle0: Alchemiczne przywołanie + alchemyPerkTitle1: Starożytna Wiedza + alchemyPerkTitle2: Mistrz Eliksirów + alchemyPerkDesc0: Pozwala na tworzenie niektórych mikstur bez stołu alchemicznego + alchemyPerkDesc1: Odblokowuje możliwość warzenia nowych mikstur + alchemyPerkDesc2: Poziom wszystkich użytych mikstur wzrasta o 1 (możliwość wł/wył) + alchemyPassiveTitle0: Powrót + alchemyPassiveTitle1: Tokeny Umiejętności + alchemyPassiveTitle2: Half-life+ + alchemyPassiveDesc0: Przenosi cię z powrotem do głównego menu umiejętności + alchemyPassiveDesc1: Tokeny do zainwestowania w drzewko umiejętności + alchemyPassiveDesc2: Wydłuża czas działania mikstur, gdy są używane + smeltingPerkTitle0: Efektywność Paliw + smeltingPerkTitle1: Podwójne wytapianie + smeltingPerkTitle2: Płomienny kilof + smeltingPerkDesc0: Paliwo trwa o 20% dłużej na poziom + smeltingPerkDesc1: + 5% szansy na podwojenie wytopionej rudy na poziom + smeltingPerkDesc2: Wydobywane rudy są natychmiast wytapiane (możliwość wł/wył) + smeltingPassiveTitle0: Powrót + smeltingPassiveTitle1: Tokeny umiejętności + smeltingPassiveTitle2: Prędkość paliwa + smeltingPassiveDesc0: Przenosi cię z powrotem do głównego menu umiejętności + smeltingPassiveDesc1: Tokeny do zainwestowania w drzewko umiejętności + smeltingPassiveDesc2: Zwiększanie prędkości gotowania + enchantingPerkTitle0: Skuteczne zaklinanie + enchantingPerkTitle1: Mądrala + enchantingPerkTitle2: Nieśmiertelne doświadczenie + enchantingPerkDesc0: Poziomy potrzebne do zaklinania -1 na poziom, koszty naprawy kowadła + -1 (minimum 2) poziomy XP na poziom + enchantingPerkDesc1: Odblokowuje przepisy rzemieślnicze dla niektórych zaklętych ksiąg + enchantingPerkDesc2: Zatrzymaj PD w razie śmierci + enchantingPassiveTitle0: Powrót + enchantingPassiveTitle1: Tokeny umiejętności + enchantingPassiveTitle2: Szybszy rozwój + enchantingPassiveDesc0: Przenosi cię z powrotem do głównego menu umiejętności + enchantingPassiveDesc1: Tokeny do zainwestowania w drzewko umiejętności + enchantingPassiveDesc2: Zwiększone wszystkie otrzymane PD + globalPerkTitle0: Zbieracz + globalPerkTitle1: Uczony + globalPerkTitle2: Wojownik + globalPerkTitle3: Ciężka praca + globalPerkTitle4: Badania + globalPerkTitle5: Trening + globalPerkTitle6: Reinkarnacja+ + globalPerkTitle7: Zbieranie dusz + globalPerkTitle8: Wcielenie + globalPerkTitle9: Sztukmistrz + globalPerkDesc0: + 20% Zwiekszonego doświadczenia w kopaniu, ścinaniu drzew, górnictwie, rolnictwie i + wędkarstwie + globalPerkDesc1: +20% Zwiekszonego doświadczenia w naprawie, zręczności, warzeniu, wytapianiu i zaklinaniu + globalPerkDesc2: +20% Zwiekszonego doświadczenia w Łucznictwie, Mistrzostwie Bestii, Mistrzostwie Miecza, Obronie, + oraz Mistrzostwie Siekiery + globalPerkDesc3: +1 Token umiejętności we wszystkich umiejętnościach Zbieracza + globalPerkDesc4: +1 Token umiejętności we wszystkich umiejętnościach Uczonego + globalPerkDesc5: +1 Token umiejętności we wszystkich umiejętnościach Wojownika + globalPerkDesc6: Po śmierci 50% szansy na zatrzymanie części każdego cennego przedmiotu w twoim + ekwipunku + globalPerkDesc7: Teraz zbierasz dusze zabijając agresywne moby, co może + być używane do zwrotu umiejętności ścinania drzew + globalPerkDesc8: 10% szans na brak obrażeń i uzyskanie wszystkich wzmocnień w grze przez 10 sek + przy trafieniu, które normalnie by cię zabiło + globalPerkDesc9: Skraca czas odnowienia umiejętności o 33% + globalPassiveTitle0: Tokeny Globalne + globalPassiveTitle1: Powrót + globalPassiveDesc0: Tokeny do zainwestowania w drzewko umiejętności + globalPassiveDesc1: Przenosi cię z powrotem do głównego menu umiejętności + cannotRepair: Nie możesz naprawiać, gdy ta umiejętność jest aktywna! + cannotSalvage: Nie możesz ratować, gdy ta umiejętność jest aktywna! + spite: Wszystko, co dobre, powstaje na złość + refundSkill: są wymagane do cofnięcia drzewka umiejętności + refundSkill2: aby cofnąć drzewko umiejętności + needToUnlock: Musisz odblokować + perkRequirement: Aby odblokować tą zdolność, potrzebujesz co najmniej 2 tokenów umiejętności zainwestowanych w poprzednie zdolności + perkRequirementM: Potrzebujesz co najmniej 10 tokenów umiejętności zainwestowanych w drzewko umiejętności, aby odblokować tą zdolność maestrii + noSkillTokens: Nie masz żadnych tokenów umiejętności + noPassiveTokens: Nie masz żadnych pasywnych tokenów + maxedOutPerk: Już osiągnąłeś maksymalny poziom tej zdolności! + requiredGlobalPerks0: Aby odblokować tą zdolność, potrzebujesz poprzedniej zdolności + requiredGlobalPerks1: są wymagane, aby odblokować tą zdolność + requiredGlobalPerks2: jest wymagany, aby odblokować tą zdolność + requiredGlobalPerks3: Aby odblokować tą zdolność, potrzebujesz każdej globalnej zdolności + craftRequirement: jest wymagany do stworzenia tego przepisu! + roll: PRZEWRÓT + dodge: UNIK + prepare: Przygotowujesz swój + rest: Odkładasz swój + activated: aktywowany! + ended: zakończył się + readyToUse: jest gotowy do ponownego użycia + cooldown: czas odnowienia + rapidFire: Szybki ogień + bow: łuk + greatAxe: Wspaniała Siekiera + axe: siekiera + spurKick: Kopnięcie ostrogi + leg: noga + stoneSoldier: Kamienny żołnierz + yourself: siebie + bigDig: Duży Kopacz + shovel: łopata + naturalRegeneration: Naturalna Regeneracja + hoe: motyka + superBait: Super Przynęta + fishingRod: wędka + berserkPick: Berserker + pickaxe: kilof + swiftStrikes: Szybkie Ciosy + sword: miecz + timber: Drewno + hyperHorse: Ten koń jest już hiper szybki! + magicForce: Magiczna siła kończy twoją zdolność + rob: okradziony + repairFail0: Nie masz wystarczających umiejętności, aby odpowiednio naprawić ten przedmiot + repairFail1: Nie udało ci się uratować żadnych materiałów + repairFail2: Nie udało Ci się zachować mocy zaklęcia przedmiotu + treeTooBig0: To drzewo jest za duże, abyś mógł je posiekać za jednym zamachem! ” + treeTooBig1: Tego drzewa nigdy nie będzie się dało zrąbać za jednym razem... + noPermission: Nie masz uprawnień do używania tej komendy! + improperArguments: Nieprawidłowe argumenty, spróbuj + totalPlayTime: Całkowity czas gry + clickForOptions: Kliknij, aby wyświetlić opcje + unknownCommand: Nieznana komenda + expToLevel: PD do następnego poziomu + playerName: nazwaGracza + skillName: nazwaUmiejętności (in English) + page: strona + on0: "WŁ" + off0: "WYŁ" + onOrOff: WŁ/WYŁ + manuallyToggles: Przełącza ręcznie + commandDesc0: Otwiera główne menu ze wszystkimi umiejętnościami + commandDesc1: Otwiera wybrane menu drzewa umiejętności + commandDesc2: Otwiera menu konfiguracyjne + commandDesc3: Daje wybranemu graczowi PD w określonej umiejętności + commandDesc4: Ustawia poziom danego gracza w określonej umiejętności + commandDesc5: Resetuje statystyki gracza w określonej umiejętności (nie zwraca statystyk) + commandDesc6: Wyświetla tabelę wyników dla określonej statystyki + commandDesc7: Zawiera link do strony z informacjami o wtyczce + commandDesc8: Próbuje zaczarować przedmiot w dłoni użytkownika na określonym poziomie + informationURL: Adres informacji URL (Google Docs) + click: KLIKNIJ + levelArgument: Argument poziomu musi być mniejszy niż 40 + leaderboard: Tablica Wyników + playerOffline: Ten gracz nie jest online + onlyIncrease: Za pomocą tego polecenia zwiększ tylko exp, w przeciwnym razie użyj / frpg statReset, a następnie / frpg giveEXP + amount: ilość + unlockToggle: Aby użyć tego polecenia, musisz odblokować + levelUpNotif: Powiadomienia o wyższym poziomie + abilityPreparationNotif: Powiadomienia o przygotowaniu umiejętności + yes0: "TAK" + no0: "NIE" + warning: UWAGA + souls: dusze + refundSkillTree0: Zwrot kosztów drzewka umiejętności + refundSkillTree1: i jest nieodwracalne, czy na pewno chcesz + refundSkillTree2: zwrócić + skill: umiejętność + backToSkillTree: Przenosi cię z powrotem do drzewa umiejętności + miningPerkDesc0_1: 2 sekundy przyśpieszenia I po wydobyciu dowolnej rudy + miningPerkDesc0_2: 5 sekund przyśpieszenia I po wydobyciu dowolnej rudy + miningPerkDesc0_3: 10 sekund przyśpieszenia I po wydobyciu dowolnej rudy + miningPerkDesc0_4: 5 sekund przyśpieszenia II po wydobyciu dowolnej rudy, a następnie 5 sekund przyspieszenia I. + miningPerkDesc0_5: 10 sekund przyśpieszenia II po wydobyciu dowolnej rudy + woodcuttingPerkDesc3_1: Liście mogą teraz opadać + common: pospolity + uncommon: niezwykły + rare: rzadki + veryRare: bardzo rzadki + legendary: legendarny + fishingPerkDesc1_1: Odblokowuje poziom skarbu + farmingPerkDesc1_1: Zdobądź umiejętność by stworzyć + cowSpawnEgg: jajko przywołania krowę + beeSpawnEgg: jajko przywołania pszczoły + mooshroomSpawnEgg: jajko przywołania grzybowej krowy + horseSpawnEgg: jajko przywołania konia + slimeSpawnEgg: jajko przywołania slime + diggingPerkDesc0_1: Możesz teraz wykopać + defensePerkDesc0_1: Zyskujesz +3 sek regeneracji na poziom przy zabójstwach + defensePerkDesc0_2: Zyskujesz +0,5 serca na poziom natychmiast po zabiciu + duration: Czas trwania + likelihood: Prawdopodobieństwo + junkChance: Szansa na śmieci + locked: ZABLOKOWANY + unlocked: ODBLOKOWANY + cowEgg: Krowie Jajo + beeEgg: Jajko pszczoły + mooshroomEgg: Jajko grzybowej krowy + horseEgg: jajko konia + slimeEgg: jajko slime + tippedArrows: Ostre strzały + toggle: Przełącznik + refundSkillTitle: Zwrot Umiejętności + refundSkillTreeDesc: Kliknij, aby zwrócić to drzewo umiejętności + enchantingPerkDesc1_0: Odblokowuje możliwość tworzenia + enchantingPerkDesc1_1: Zaklęte książki Moc I i Wydajność I (Kosztują 1 poziom aby wytworzyć) " + enchantingPerkDesc1_2: Zaklęte książki Ostrośc I i Ochrona I (Kosztują 1 poziom aby wytworzyć) + enchantingPerkDesc1_3: Zaklęte książki Morska fortuna I i Przynęta I (Kosztują 1 poziom aby wytworzyć) + enchantingPerkDesc1_4: Zaklęte książki Głębinowy wędrowiec I i Mroźny piechur I (Kosztują 1 poziom aby wytworzyć) + enchantingPerkDesc1_5: Zaklęte książki Naprawa (kosztuje 10 poziomów aby wytworzyc) Fortuna I (Kosztuje 2 poziomy aby wytworzyć) + repairPerkDesc0_1: Zdobywa więcej materiałów średnio ze złomu + repairPerkDesc0_2: Zdobywa więcej materiałów średnio ze złomu , ratowanie teraz przechowuje zaklęcia przedmiotów w książce + xpBoost: Zwiększone PD + speedBoost: Zwiększenie prędkości + timeExtension: Przedłużenie czasu + enchantingCraft0: Księga Moc I + enchantingCraft1: Księga Wydajność I + enchantingCraft2: Księga Ostrość I + enchantingCraft3: Księga Ochrona I + enchantingCraft4: Księga Morska fortuna I + enchantingCraft5: Księga Przynęta I + enchantingCraft6: Księga Mroźny piechur I + enchantingCraft7: Księga Głebinowy Wędrowiec I + enchantingCraft8: Księga Naprawa + enchantingCraft9: Księga Fortuna I + commandDesc9: Ustawia dusze dla określonego gracza + commandDesc10: Ustawia tokeny umiejętności lub pasywne w określonej umiejętności dla określonego gracza + commandDesc11: Ustawia globalne tokeny dla określonego gracza + commandDesc12: Zapisuje statystyki wszystkich graczy lub określonego gracza + status: STATUS + complete: KOMPLETNY + incomplete: NIEKOMPLETNY + try0: "próba" + passiveImprove: Twoje pasywne zdolności poprawiają się z każdym poziomem! + increasedBy: wzrosła o + expIncrease: Mnożnik PD + personalMultiplier: Osobisty mnożnik + translators: Tłumacze + commandDesc13: Ustawia osobisty mnożnik dla określonego gracza + abilityDescription: Ability Description + abilityDescription_digging: Temporarily adds 5 levels of effiency to your shovel. Activated by right-clicking a shovel then breaking a block. + abilityDescription_woodcutting: Temporarily makes axes break an entire tree with one block break. Activated by right-clicking an axe then breaking a log. + abilityDescription_mining: Temporarily adds 5 levels of effiency to your pickaxe. Activated by right-clicking a pickaxe then breaking block. + abilityDescription_farming: Temporarily makes crops broken with a hoe automatically replant. Activated by right-clicking a hoe then breaking a crop. + abilityDescription_fishing: Temporarily makes fishing rods instantly catch a fish. Activated by left-clicking a fishing rod then fishing in water. + abilityDescription_archery: Temporarily makes all arrows fired at max speed. Activated by left-clicking a bow then shooting an arrow. + abilityDescription_beastMastery: Temporarily gives your horse a speed buff. Activated by right-clicking while on a horse then left-clicking. + abilityDescription_swordsmanship: Temporarily removes swinging cooldown on swords. Activated by right-clicking a sword then hitting a mob. + abilityDescription_defense: Temporarily gives the user Resistance and Slowness effects. Activated by right-clicking with an empty hand then hitting a mob. + abilityDescription_axeMastery: Temporarily makes axes do damage to all mobs in a certain radius. Activated by right-clicking an axe then hitting a mob. + alchemyPerkDesc1_0: Odblokowuje możliwość warzenia + alchemyPerkDesc0_0: Na stole rzemieślniczym można tworzyć mikstury do + triggerAbilities: Trigger Abilities + showEXPBar: Show EXP Bar + disabledSkill: This skill is disabled + skillConfigDesc: Takes you to configuration menu for this skill + lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" + exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" + potionAbsorption: Potion of Absorption + potionBadOmen: Potion of Bad Omen + potionBlindess: Potion of Blindess + potionConduitPower: Potion of Conduit Power + potionResistance: Potion of Resistance + potionDolphinsGrace: Potion of Dolphins Grace + potionHaste: Potion of Haste + potionFireResistance: Potion of Fire Resistance + potionGlowing: Potion of Glowing + potionHarm: Potion of Harm + potionHealing: Potion of Healing + potionHealthBoost: Potion of Health Boost + potiontheHero: Potion of the Hero + potionHunger: Potion of Hunger + potionStrength: Potion of Strength + potionInvsibility: Potion of Invsibility + potionJump: Potion of Jump + potionLuck: Potion of Luck + potionNightVision: Potion of Night Vision + potionRegeneration: Potion of Regeneration + potionSaturation: Potion of Saturation + potionSlowness: Potion of Slowness + potionFatigue: Potion of Fatigue + potionSlowFalling: Potion of Slow Falling + potionSpeed: Potion of Speed + potionBadLuck: Potion of Bad Luck + potionWaterBreathing: Potion of Water Breathing + potionWeakness: Potion of Weakness + potionDecay: Potion of Decay + potionAwkward: Awkward Potion + potionUncraftable: Uncraftable Potion + potionMundane: Mundane Potion + potionTurtleMaster: Potion of the Turtle Master + potionThick: Thick Potion + potionWater: Water Bottle + ingredient: Ingredient + usedToBrew: Is used to brew + costs: costs + xpLevel: Minecraft XP Level + xpLevels: Minecraft XP Levels + craftXPRequirement: This recipe requires at least + bedGUI: You cannot use this command while in bed! + statsUpdated: Your stats were changed to be consistent with a new EXP curve. + All skill trees and passive perks have been reset. All tokens must be re-invested. + timeRemaining: Time Remaining + numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed + commandDesc14: Resets the cooldown period for a skill to 0 seconds + commandDesc15: Looks up a player's FreeRPG stats + repairUnsafeEnchant: This item is too powerful to be repaired + salvageUnsafeEnchant: This item is too powerful to be salvaged + rank: Rank + stats: stats + outOf: out of + playerNotInLeaderboard: That player is not on any leaderboards + virtual: Virtual + commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) - esCl: #Translated by PibeChileno - languageName: Español - englishLanguageName: Chilean Spanish - translationCredit: PibeChileno - global: Global - digging: Excavación - woodcutting: Tala de madera - mining: Minería - farming: Agricultura - fishing: Pesca - archery: Tiro con arco - beastMastery: Dominio de las bestias - swordsmanship: Manejo de la espada - defense: Defensa - axeMastery: Dominio del hacha - repair: Reparación - alchemy: Alquimia - agility: Agilidad - smelting: Fundición - enchanting: Encantador - information: Información - configuration: Configuración - level: Nivel - experience: Experiencia - toNext: Al siguiente - total: Total - diggingPerkTitle0: Mo 'gotas - diggingPerkTitle1: Tesoro doble - diggingPerkTitle2: Gotas más raras - diggingPerkTitle3: Ladron de almas - diggingPerkTitle4: Buscador de pedernal - diggingPerkTitle5: Caballero de la pala - diggingPerkTitle6: Mega Excavación - diggingPerkDesc0: expande la tabla de caída del tesoro en 1 artículo por nivel - diggingPerkDesc1: + 5% de probabilidad de recibir el doble de tesoro por nivel - (cuando se rueda el tesoro) - diggingPerkDesc2: expande aún más la tabla desplegable por elemento por nivel - diggingPerkDesc3: La arena del alma tiene un 5% más de probabilidades de soltar - tesoros por nivel - diggingPerkDesc4: Grava tiene una tasa de caída de pedernal del 100% (conmutable - por / pedernal) - diggingPerkDesc5: Las palas hacen el doble de daño - diggingPerkDesc6: Cuando usas la habilidad, ahora rompes una sección de bloque - de 3x3 (20% de la tasa de tesoro normal cuando está activo) - diggingPassiveTitle0: Fichas pasivas - diggingPassiveTitle1: Atrás - diggingPassiveTitle2: Fichas de habilidad - diggingPassiveTitle3: Duración de gran excavación - diggingPassiveTitle4: Treasure Chance - diggingPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) - diggingPassiveDesc1: te lleva de vuelta al menú principal de habilidades - diggingPassiveDesc2: Fichas para invertir en árbol de habilidades - diggingPassiveDesc3: aumenta la duración de Big Dig en 0.02 s - diggingPassiveDesc4: aumenta la probabilidad de desenterrar un tesoro en un 0,005% - woodcuttingPerkTitle0: Raíces celosas - woodcuttingPerkTitle1: Armas frescas - woodcuttingPerkTitle2: Conocimiento oculto - woodcuttingPerkTitle3: Carroñero de hojas - woodcuttingPerkTitle4: Madera + - woodcuttingPerkTitle5: Soplador de hojas - woodcuttingPerkTitle6: Hacha capaz - woodcuttingPerkDesc0: + 20% de probabilidad de que los troncos caigan 1 XP por - nivel - woodcuttingPerkDesc1: +12 s por nivel de celeridad I después de que se rompa el - primer tronco en 5 minutos - woodcuttingPerkDesc2: Los troncos tienen un + 0,2% de probabilidad por nivel de - dejar caer un libro - woodcuttingPerkDesc3: Las hojas tienen un 1% de probabilidad de soltar +1 objeto - del tesoro por nivel - woodcuttingPerkDesc4: límite de rotura de madera aumentado de 64 a 128 - woodcuttingPerkDesc5: Romper una gran sección de hojas con un hacha (toggleable - with /leafBlowerToggle) - woodcuttingPerkDesc6: Gotas dobles, Raíces celosas y Conocimiento oculto, todo - ahora aplicar a la madera (a la mitad de efectividad) - woodcuttingPassiveTitle0: Fichas pasivas - woodcuttingPassiveTitle1: Volver - woodcuttingPassiveTitle2: Fichas de habilidad - woodcuttingPassiveTitle3: Duración de la madera - woodcuttingPassiveTitle4: Gotas dobles - woodcuttingPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) - woodcuttingPassiveDesc1: te lleva de vuelta al menú principal de habilidades - woodcuttingPassiveDesc2: Fichas para invertir en árbol de habilidades - woodcuttingPassiveDesc3: aumenta la duración de la madera en 0.02 s - woodcuttingPassiveDesc4: aumenta la probabilidad de recibir una caída doble en - un 0.05% - miningPerkTitle0: Prisa inútil - miningPerkTitle1: Más bombas - miningPerkTitle2: Buscador de tesoros - miningPerkTitle3: Viaje bomba - miningPerkTitle4: Minero de venas - miningPerkTitle5: Hombre de demolición - miningPerkTitle6: Triple problema - miningPerkDesc0: Gana prisa después de extraer minerales para cada nivel. - miningPerkDesc1: La receta de elaboración de TNT produce +1 bloque TNT por nivel - miningPerkDesc2: al usar la habilidad en piedras, + 1% por nivel de probabilidad - de un mineral para soltar (se obtiene experiencia adicional de los minerales - arrojados) - miningPerkDesc3: aumenta el radio de explosión TNT (cuando se enciende con pedernal - y acero) cada uno nivel - miningPerkDesc4: Las vetas de mineral se extraen instantáneamente al romper un - bloque (conmutable) - miningPerkDesc5: No se recibe daño de las explosiones TNT - miningPerkDesc6: las gotas dobles ahora son gotas triples - miningPassiveTitle0: Fichas pasivas - miningPassiveTitle1: Volver - miningPassiveTitle2: Fichas de habilidad - miningPassiveTitle3: Duración de selección de Berserk - miningPassiveTitle4: Gotas dobles - miningPassiveTitle5: Explotación minera - miningPassiveDesc0: Tokens para invertir en habilidades pasivas (tintes) - miningPassiveDesc1: lo lleva de regreso al menú principal de habilidades - miningPassiveDesc2: Tokens para invertir en árbol de habilidades - miningPassiveDesc3: aumenta la duración de Berserk Pick en 0.02s - miningPassiveDesc4: aumenta la probabilidad de recibir una caída doble de los - minerales en un 0.05% - miningPassiveDesc5: aumenta las posibilidades de que se cree mineral a partir - de explosiones de TNT en un 0,01% (más bloques rotos = más tiradas del tesoro) - farmingPerkTitle0: Mejor fertilizante - farmingPerkTitle1: Granja de animales - farmingPerkTitle2: Dieta del granjero - farmingPerkTitle3: Carnívoro - farmingPerkTitle4: Pulgar verde - farmingPerkTitle5: Hormonas de crecimiento - farmingPerkTitle6: Uno con la naturaleza - farmingPerkDesc0: + 10% de probabilidad de no consumir harina de huesos en uso - farmingPerkDesc1: Puede crear un huevo de desove adicional por nivel - farmingPerkDesc2: Los alimentos agrícolas son un 20% más efectivos para restaurar - el hambre y la saturación por nivel - farmingPerkDesc3: La carne es un 20% más efectiva para restaurar el hambre y la - saturación. por nivel - farmingPerkDesc4: La habilidad puede replantar cultivos completamente desarrollados - con mayor probabilidad de replantación en etapas posteriores de crecimiento; - La habilidad ahora afecta a Melones y Calabazas. - farmingPerkDesc5: El azúcar se puede usar en animales bebés para hacerlos crecer - instantáneamente - farmingPerkDesc6: Gana Regeneración I cuando te quedas quieto sobre la hierba - farmingPassiveTitle0: Fichas pasivas - farmingPassiveTitle1: Atrás - farmingPassiveTitle2: Fichas de habilidad - farmingPassiveTitle3: Duración de la regeneración natural - farmingPassiveTitle4: Gotas dobles (cultivos) - farmingPassiveTitle5: Gotas dobles (animales) - farmingPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) - farmingPassiveDesc1: te lleva de vuelta al menú principal de habilidades - farmingPassiveDesc2: Fichas para invertir en árbol de habilidades - farmingPassiveDesc3: aumenta la duración de la regeneración natural en 0.02s - farmingPassiveDesc4: aumenta la probabilidad de recibir una caída doble de los - cultivos en un 0.05% - farmingPassiveDesc5: aumenta la probabilidad de recibir una caída doble de la - mayoría de pasivos animales en un 0,05% - fishingPerkTitle0: Robar - fishingPerkTitle1: Carroñero - fishingPerkTitle2: Dieta del pescador - fishingPerkTitle3: Filtración - fishingPerkTitle4: Gancho de agarre - fishingPerkTitle5: Barra caliente - fishingPerkTitle6: Persona pez - fishingPerkDesc0: + 15% de probabilidad de sacar un objeto de una mafia por nivel - fishingPerkDesc1: Desbloquea un nuevo nivel de tesoro de pesca - fishingPerkDesc2: Restauración de peces + 20% de hambre por nivel - fishingPerkDesc3: El botín de nivel superior (II-V) se vuelve más común, nivel - inferior (I) se vuelve menos común - fishingPerkDesc4: la caña de pescar ahora actúa como un gancho de agarre (se puede - alternar con / grappleToggle ) - fishingPerkDesc5: El pescado ahora se cocina cuando se captura, algunos tesoros - de pesca se cambiado (conmutable con / hotRodToggle) - fishingPerkDesc6: Visión nocturna infinita bajo el agua, gracia infinita de los - delfines cuando en el agua - fishingPassiveTitle0: Fichas pasivas - fishingPassiveTitle1: Volver - fishingPassiveTitle2: Fichas de habilidad - fishingPassiveTitle3: Duración del super cebo - fishingPassiveTitle4: Capturas dobles - fishingPassiveTitle5: Buscador de tesoros - fishingPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) - fishingPassiveDesc1: te lleva de vuelta al menú principal de habilidades - fishingPassiveDesc2: Fichas para invertir en árbol de habilidades - fishingPassiveDesc3: aumenta la duración de Super cebo en 0.01s - fishingPassiveDesc4: aumenta la probabilidad de recibir una caída doble en un - 0.05% - fishingPassiveDesc5: Disminuye la probabilidad de encontrar basura en un 0.005%, - aumenta la probabilidad de encontrar tesoros en un 0,005% - archeryPerkTitle0: Flechas adicionales - archeryPerkTitle1: Francotirador - archeryPerkTitle2: Flecha de luz - archeryPerkTitle3: Flechas explosivas - archeryPerkTitle4: Flechas sin dragón - archeryPerkTitle5: Ballesta de carga rápida - archeryPerkTitle6: Golpe mortal - archeryPerkDesc0: +1 flecha obtenida de la elaboración por nivel - archeryPerkDesc1: La velocidad de la flecha aumenta en un + 2% por nivel (~ 4% - de aumento de daño / nivel) - archeryPerkDesc2: Las flechas espectrales obtienen un aumento de daño de + 5% - por nivel - archeryPerkDesc3: Las flechas tienen un + 1% de crear una explosión al golpear - archeryPerkDesc4: permite crear todas las flechas con puntas con pociones regulares - en su lugar de pociones persistentes - archeryPerkDesc5: la habilidad ahora se puede usar con ballestas, lo que hace - que todos los disparos se carguen instantáneamente - archeryPerkDesc6: Los fuegos artificiales disparados con ballestas hacen el doble - de daño (hasta 16 corazones de daño) - archeryPassiveTitle0: Fichas pasivas - archeryPassiveTitle1: Atrás - archeryPassiveTitle2: Fichas de habilidad - archeryPassiveTitle3: Duración de disparo rápido - archeryPassiveTitle4: Recuperación - archeryPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) - archeryPassiveDesc1: te lleva de regreso al menú principal de habilidades - archeryPassiveDesc2: Fichas para invertir en árbol de habilidades - archeryPassiveDesc3: aumenta la duración del disparo rápido en 0.02s - archeryPassiveDesc4: aumenta la probabilidad de que el disparo de flecha no consuma - flecha en un 0.05% por nivel - beastMasteryPerkTitle0: Piel gruesa - beastMasteryPerkTitle1: Dientes afilados - beastMasteryPerkTitle2: Bocados saludables - beastMasteryPerkTitle3: Mantente alejado - beastMasteryPerkTitle4: Acro-Dog - beastMasteryPerkTitle5: Identificar - beastMasteryPerkTitle6: Impulso de adrenalina - beastMasteryPerkDesc0: Los perros reciben -10% de daño por nivel - beastMasteryPerkDesc1: Los perros hacen + 10% más de daño por nivel - beastMasteryPerkDesc2: Los perros curan +1/2 corazón por nivel al matar - beastMasteryPerkDesc3: Los perros tienen + 5% de probabilidad de derribar enemigos. - beastMasteryPerkDesc4: Los perros no reciben daño por caída - beastMasteryPerkDesc5: el uso de una brújula en un caballo o lobo ahora muestra - sus estadísticas - beastMasteryPerkDesc6: La mejora de la patada espuela ahora es velocidad III - beastMasteryPassiveTitle0: Fichas pasivas - beastMasteryPassiveTitle1: Atrás - beastMasteryPassiveTitle2: Fichas de habilidad - beastMasteryPassiveTitle3: Patada agria Duración - beastMasteryPassiveTitle4: Mordedura crítica - beastMasteryPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) - beastMasteryPassiveDesc1: te lleva de vuelta al menú principal de habilidades - beastMasteryPassiveDesc2: Fichas para invertir en árbol de habilidades - beastMasteryPassiveDesc3: aumenta la duración de Patada agria en 0.02s - beastMasteryPassiveDesc4: aumenta la probabilidad de que un perro tenga un golpe - crítico 0,025% - swordsmanshipPerkTitle0: Adrenalina - swordsmanshipPerkTitle1: Matanza - swordsmanshipPerkTitle2: + Adrenalina - swordsmanshipPerkTitle3: Frenesí asesino - swordsmanshipPerkTitle4: Sed de sangre - swordsmanshipPerkTitle5: ¡Más afilado! - swordsmanshipPerkTitle6: Dominio de la espada - swordsmanshipPerkDesc0: matar mobs hostiles con una espada proporciona +2 s de - velocidad por nivel - swordsmanshipPerkDesc1: Matar mobs hostiles con una espada proporciona +2 s de - fuerza por nivel - swordsmanshipPerkDesc2: + 20% de la mejora de velocidad I de Adrenalina ahora - es velocidad II - swordsmanshipPerkDesc3: + 20% de la fuerza que obtengo de Killing Spree ahora - es fuerza II - swordsmanshipPerkDesc4: Matar a ciertos mobs agresivos con una espada restaura - hambre - swordsmanshipPerkDesc5: Los golpes rápidos ahora agregan un nivel de nitidez a - tu espada - swordsmanshipPerkDesc6: Las espadas infligen de forma permanente +1 al corazón - de daño - swordsmanshipPassiveTitle0: Fichas pasivas - swordsmanshipPassiveTitle1: Espalda - swordsmanshipPassiveTitle2: Fichas de habilidad - swordsmanshipPassiveTitle3: Duración de los golpes rápidos - swordsmanshipPassiveTitle4: Doble golpe - swordsmanshipPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) - swordsmanshipPassiveDesc1: te lleva de vuelta al menú principal de habilidades. - swordsmanshipPassiveDesc2: Fichas para invertir en árbol de habilidades - swordsmanshipPassiveDesc3: Aumenta la duración de Swift Strikes en 0.02s - swordsmanshipPassiveDesc4: aumenta la probabilidad de golpear a la mafia dos veces - (el segundo golpe lo hace 50% de daño) en un 0,02% - defensePerkTitle0: Curador - defensePerkTitle1: Endurecer - defensePerkTitle2: Cabeza dura - defensePerkTitle3: + Endurecer - defensePerkTitle4: Regalo de arriba - defensePerkTitle5: Piernas más fuertes - defensePerkTitle6: Abundante - defensePerkDesc0: Obtienes + 3s de regeneración por nivel al matar - defensePerkDesc1: + 2% de probabilidad de ganar resistencia I durante 5 segundos - al recibir un golpe. - defensePerkDesc2: Cuerpo duro reduce el daño en un 6.6% adicional por nivel - defensePerkDesc3: + 2% de probabilidad de ganar resistencia II durante 5 segundos - cuando se golpea - defensePerkDesc4: Piedra sólida ahora otorga 4 corazones de absorción para la - duración de la habilidad +1 minuto - defensePerkDesc5: Piedra sólida ahora da lentitud I en lugar de lentitud IV - defensePerkDesc6: +2 corazones permanentemente - defensePassiveTitle0: Fichas pasivas - defensePassiveTitle1: Atrás - defensePassiveTitle2: Fichas de habilidad - defensePassiveTitle3: Duración de piedra solida - defensePassiveTitle4: Cuerpo duro - defensePassiveTitle5: Gotas dobles (Mobs hostiles) - defensePassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) - defensePassiveDesc1: te lleva de vuelta al menú principal de habilidades. - defensePassiveDesc2: Fichas para invertir en árbol de habilidades - defensePassiveDesc3: aumenta la duración de Stone Solid en 0.02s - defensePassiveDesc4: aumenta la probabilidad de recibir daño reducido (base -33%) - en un 0.01% por nivel - defensePassiveDesc5: aumenta la probabilidad de recibir gotas dobles de agresivos - mobs en un 0,05% - axeMasteryPerkTitle0: Hacha mayor - axeMasteryPerkTitle1: Hacha sagrada - axeMasteryPerkTitle2: Revitalizado - axeMasteryPerkTitle3: Sangre de guerrero - axeMasteryPerkTitle4: Terremoto - axeMasteryPerkTitle5: Mejores críticas - axeMasteryPerkTitle6: Hombre Hacha - axeMasteryPerkDesc0: El radio de daño del Gran Hacha aumenta en 1 bloque por nivel - axeMasteryPerkDesc1: + 2% de probabilidad de que la iluminación golpee a las turbas - con el hacha - axeMasteryPerkDesc2: + 1% de probabilidad de curación completa al matar por nivel - axeMasteryPerkDesc3: +3 s por nivel de Fuerza I en muertes con un hacha - axeMasteryPerkDesc4: El daño AOE de la habilidad se duplica (25% -> 50% del daño) - axeMasteryPerkDesc5: Los críticos divinos ahora tienen un multiplicador de 1.6x - en lugar de 1.25x - axeMasteryPerkDesc6: las hachas infligen de forma permanente +1 al corazón de - daño - axeMasteryPassiveTitle0: Fichas pasivas - axeMasteryPassiveTitle1: Atrás - axeMasteryPassiveTitle2: Fichas de habilidad - axeMasteryPassiveTitle3: Duración del gran hacha - axeMasteryPassiveTitle4: Críticos divinos - axeMasteryPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) - axeMasteryPassiveDesc1: te lleva de regreso al menú principal de habilidades - axeMasteryPassiveDesc2: Fichas para invertir en árbol de habilidades - axeMasteryPassiveDesc3: aumenta la duración de Great Axe en 0.02s - axeMasteryPassiveDesc4: aumenta la probabilidad de crítico aleatorio (base 1.25x - daño) en un 0.01% - repairPerkTitle0: Recuperación - repairPerkTitle1: Ingenioso - repairPerkTitle2: Maestría en reparación mágica - repairPerkDesc0: Obtenga más materiales en promedio al recuperar - repairPerkDesc1: + 10% de probabilidad de mantener el material usado al reparar - repairPerkDesc2: Garantizado para mantener los encantamientos en reparación - repairPassiveTitle0: Atrás - repairPassiveTitle1: Fichas de habilidad - repairPassiveTitle2: Competencia - repairPassiveDesc0: te lleva de vuelta al menú principal de habilidades - repairPassiveDesc1: Fichas para invertir en árbol de habilidades - repairPassiveDesc2: los materiales restauran más durabilidad en la reparación - agilityPerkTitle0: Esquivar - agilityPerkTitle1: Huesos de acero - agilityPerkTitle2: Pies agraciados - agilityPerkDesc0: + 4% de probabilidad de esquivar ataques por nivel - agilityPerkDesc1: -10% de daño por caída por nivel - agilityPerkDesc2: Mejora permanente de velocidad I (conmutable por / speedToggle) - agilityPassiveTitle0: Atrás - agilityPassiveTitle1: Fichas de habilidad - agilityPassiveTitle2: Rodar - agilityPassiveDesc0: te lleva de vuelta al menú principal de habilidades - agilityPassiveDesc1: Fichas para invertir en árbol de habilidades - agilityPassiveDesc2: Posibilidad de rodar y recibir daño por caída reducido - alchemyPerkTitle0: Invocación alquímica - alchemyPerkTitle1: Conocimiento antiguo - alchemyPerkTitle2: Maestro de pociones - alchemyPerkDesc0: permite la elaboración de algunas pociones sin un soporte de - preparación - alchemyPerkDesc1: Desbloquea la capacidad de preparar nuevas pociones - alchemyPerkDesc2: Todas las pociones usadas aumentan de nivel en 1 (se puede alternar - con / togglePotion) - alchemyPassiveTitle0: Volver - alchemyPassiveTitle1: Fichas de habilidad - alchemyPassiveTitle2: + Media vida - alchemyPassiveDesc0: te lleva de regreso al menú principal de habilidades - alchemyPassiveDesc1: Fichas para invertir en árbol de habilidades - alchemyPassiveDesc2: Aumento de la duración de las pociones cuando se usan - smeltingPerkTitle0: Eficiencia de combustible - smeltingPerkTitle1: Doble olor - smeltingPerkTitle2: Pico de llamas - smeltingPerkDesc0: El combustible dura un 20% más por nivel - smeltingPerkDesc1: + 5% de probabilidad de que el mineral fundido se duplique - por nivel - smeltingPerkDesc2: Los minerales extraídos se funden instantáneamente (se puede - alternar con / toggleFlamePick) - smeltingPassiveTitle0: Volver - smeltingPassiveTitle1: Fichas de habilidad - smeltingPassiveTitle2: Velocidad del combustible - smeltingPassiveDesc0: te lleva de vuelta al menú principal de habilidades - smeltingPassiveDesc1: Fichas para invertir en árbol de habilidades - smeltingPassiveDesc2: Aumento de la velocidad de cocción - enchantingPerkTitle0: Encantamiento eficiente - enchantingPerkTitle1: Reserva inteligente - enchantingPerkTitle2: Experiencia inmortal - enchantingPerkDesc0: Niveles necesarios para encantar -1 por nivel, costos de - reparación del yunque -1 (mínimo de 2) niveles de XP por nivel - enchantingPerkDesc1: Desbloquea recetas de elaboración para algunos libros encantados - enchantingPerkDesc2: Keep xp on death - enchantingPassiveTitle0: Volver - enchantingPassiveTitle1: Fichas de habilidad - enchantingPassiveTitle2: Desarrollo más rápido - enchantingPassiveDesc0: te lleva de regreso al menú principal de habilidades - enchantingPassiveDesc1: Fichas para invertir en árbol de habilidades - enchantingPassiveDesc2: Todos los XP recibidos aumentaron - globalPerkTitle0: Recolector - globalPerkTitle1: Académico - globalPerkTitle2: Luchador - globalPerkTitle3: Trabajo duro - globalPerkTitle4: Investigación - globalPerkTitle5: Capacitación - globalPerkTitle6: Reencarnación + - globalPerkTitle7: Cosecha de almas - globalPerkTitle8: Avatar - globalPerkTitle9: Maestro de las artes - globalPerkDesc0: + 20% de experiencia ganada en excavación, tala de madera, minería, - agricultura y Pescar - globalPerkDesc1: + 20% de experiencia obtenida en Reparación, Agilidad, Elaboración - de cerveza, Fundición y Encantamiento - globalPerkDesc2: + 20% de experiencia obtenida en Tiro con arco, Dominio de bestias, - Esgrima, Defensa, y dominio del hacha - globalPerkDesc3: +1 ficha de habilidad en todas las habilidades de recolector - globalPerkDesc4: +1 ficha de habilidad en todas las habilidades de erudito - globalPerkDesc5: +1 ficha de habilidad en todas las habilidades de luchador - globalPerkDesc6: Al morir, 50% de probabilidad de mantener algo de cada elemento - valioso en su inventario - globalPerkDesc7: ahora cosechas almas al matar mobs agresivos, que pueden ser - utilizado para reembolsar árboles de habilidades - globalPerkDesc8: 10% de probabilidad de no recibir daño y obtener todos los beneficios - del juego durante 10 segundos en un golpe que normalmente te mataría - globalPerkDesc9: Los tiempos de reutilización de habilidades disminuyeron un 33% - globalPassiveTitle0: Tokens globales - globalPassiveTitle1: Atrás - globalPassiveDesc0: Tokens para invertir en árbol de habilidades - globalPassiveDesc1: te lleva de vuelta al menú principal de habilidades - cannotRepair: ¡No puedes reparar mientras esta habilidad esté activa! - cannotSalvage: ¡No puedes salvar mientras esta habilidad está activa! - spite: todo lo bueno está hecho de despecho - refundSkill: se requieren para reembolsar un árbol de habilidades - refundSkill2: para reembolsar un árbol de habilidades - needToUnlock: Necesitas desbloquear - PerkRequirement: Necesitas al menos 2 fichas de habilidad invertidas en las ventajas - anteriores para desbloquear esta ventaja - perkRequirementM: necesitas al menos 10 fichas de habilidad en total invertidas - en el árbol de habilidades para desbloquear esta ventaja de maestría - noSkillTokens: no tienes ninguna ficha de habilidad - noPassiveTokens: no tienes ningún token pasivo - maxedOutPerk: ¡Ya has maximizado este beneficio! - requiredGlobalPerks0: Necesitas la ventaja anterior para desbloquear esta ventaja - requiredGlobalPerks1: son necesarios para desbloquear este beneficio - requiredGlobalPerks2: es necesario para desbloquear este beneficio - requiredGlobalPerks3: Necesitas todas las ventajas globales para desbloquear esta - ventaja - craftRequirement: ¡se requiere para elaborar esta receta! - roll: ROLLO - dodge: ESQUIVAR - prepare: usted prepara su - rest: Descansas tu - activated: activado! - ended: ha terminado - readyToUse: está listo para usar de nuevo - cooldown: enfriamiento - rapidFire: Fuego rápido - bown: arco - greatAxe: Gran hacha - axe: hacha - spurKick: Spur Kick - leg: pierna - stoneSoldier: Soldado de piedra - yourself: usted mismo - bigDig: Big Dig - shovel: pala - naturalRegeneration: Regeneración natural - hoe: Azada - superbait: superbait - fishingRod: caña de pescar - berserkPick: Pico del Berserker - pickaxe: pico - swiftStrikes: Golpes rápidos - sword: espada - timber: Madera - hyperHorse: ¡Este caballo ya es hiperactivo! - magicForce: una fuerza mágica acaba con tu habilidad - rob: Robar - repairFail0: No tienes la habilidad suficiente para reparar este artículo adecuadamente - repairFail1: No lograste recuperar ningún material - repairFail2: No pudiste retener el poder de encantamiento del objeto - treeTooBig0: ¡Este árbol es demasiado grande para cortarlo de una vez! " - treeTooBig1: Este árbol nunca se puede cortar de una sola vez así ... - noPermission: ¡No tienes permiso para usar este comando! - improperArguments: argumentos impropios, intente - totalPlayTime: tiempo total de reproducción - clickForOptions: Haga clic para ver las opciones - unknownCommand: Comando desconocido - expToLevel: EXP al siguiente nivel - playerName: Nombre del jugador - skillName: Nombre de la habilidad (en inglés) - page: página - on0: 'ON' - off0: 'OFF' - onOrOff: ENCENDIDO / APAGADO - manuallyToggles: alterna manualmente - commandDesc0: abre la GUI principal con todas las habilidades - commandDesc1: abre una GUI de árbol de habilidades de su elección - commandDesc2: abre la GUI de configuración - commandDesc3: le da a un jugador de elección EXP en una habilidad específica - commandDesc4: establece el nivel de un jugador determinado en una habilidad específica - commandDesc5: restablece las estadísticas de un jugador en una habilidad específica - (no reembolsa las estadísticas) - commandDesc6: muestra una tabla de clasificación para una estadística específica - commandDesc7: proporciona un enlace a una página de información del complemento - commandDesc8: Intenta encantar un elemento en la mano del usuario en un nivel - específico - informationURL: URL de información (Google Docs) - click: CLIC - levelArgument: el argumento de nivel debe ser menor que 40 - leadboard: tabla de clasificación - playerOffline: ese jugador no está en línea - onlyIncrease: solo aumente exp con este comando; de lo contrario, use / frpg statReset - y luego / frpg giveEXP - amount: cantidad - unlockToggle: Para usar este comando debes desbloquear - levelUpNotif: Notificaciones de nivel superior - abilityPreparationNotif: Notificaciones de preparación de habilidades - yes0: SI - no0: 'NO' - warning: ADVERTENCIA - souls: almas - refundSkillTree0: Reembolso de los costos de un árbol de habilidades - refundSkillTree1: y no es reversible, ¿está seguro de que desea - refundSkillTree2: reembolsar el - skill: Habilidad - backToSkillTree: Te lleva de vuelta al árbol de habilidades - miningPerkDesc0_1: 2 segundos de celeridad I después de extraer cualquier mineral - miningPerkDesc0_2: 5 segundos de celeridad I después de extraer cualquier mineral - miningPerkDesc0_3: 10 segundos de celeridad I después de extraer cualquier mineral - miningPerkDesc0_4: 5 segundos de Prisa II después de extraer cualquier mineral, - seguidos de 5 segundos de Haste I - miningPerkDesc0_5: 10 segundos de Prisa II después de extraer cualquier mineral - woodcuttingPerkDesc3_1: Las hojas ahora pueden dejar caer un - common: Común - uncommon: Poco común - rare: Raro - veryRare: Muy raro - legendary: Legendario - fishingPerkDesc1_1: Desbloquea el nivel del tesoro - farmingPerkDesc1_1: Obtén la capacidad de crear - cowSpawnEgg: Huevo de desove de vaca - beeSpawnEgg: Huevo de desove de abeja - mooshroomSpawnEgg: Huevo de desove de mooshroom - horseSpawnEgg: Huevo de desove de caballo - slimeSpawnEgg: Huevo de engendro de limo - diggingPerkDesc0_1: Ahora puede desenterrar un - defensePerkDesc0_1: Obtienes +3 s de regeneración por nivel en muertes - defensePerkDesc0_2: Gana +0.5 corazones por nivel instantáneamente en muertes - duration: Duración - likelihood: Probabilidad - junkChance: Oportunidad basura - locked: BLOQUEADO - unlocked: DESBLOQUEADO - cowEgg: Huevo de vaca - beeEgg: Huevo de abeja - mooshroomEgg: Huevo de Mooshroom - horseEgg: Huevo de caballo - slimeEgg: Huevo de limo - tippedArrows: Flechas con punta - toggle: Alternar - refundSkillTitle: Habilidad de reembolso - refundSkillTreeDesc: Haga clic para reembolsar este árbol de habilidades - enchantingPerkDesc1_0: Desbloquea la capacidad de crear - enchantingPerkDesc1_1: Libros encantados Poder I y Eficiencia I (cuesta 1 nivel - para fabricarlos) - enchantingPerkDesc1_2: Filo I y Proteccion I libros encantados (cuesta 1 nivel - para fabricarlos) - enchantingPerkDesc1_3: Suerte marina I y Señuelo I libros encantados (cuesta 1 - nivel) - enchantingPerkDesc1_4: Profundidad I y Caminante helado I libros encantados (cuesta - 1 nivel) - enchantingPerkDesc1_5: Reparacion (cuesta 10 niveles para crear) y Fortune I (cuesta - 2 niveles para crear) libros encantados - repairPerkDesc0_1: Obtén más materiales recuperando en promedio - repairPerkDesc0_2: obtén más materiales de la recuperación en promedio, la recuperación - ahora almacena encantamientos de objetos en un libro - xpBoost: Aumento de XP - speedBoost: Aumento de velocidad - timeExtension: Extensión de tiempo - enchantingCraft0: Libro de Poder I - enchantingCraft1: Libro de Eficiencia I - enchantingCraft2: Libro de Filo I - enchantingCraft3: Libro de Proteccion I - enchantingCraft4: Libro de Suerte marina I - enchantingCraft5: Libro de Señuelo I - enchantingCraft6: Libro de Caminante helado I - enchantingCraft7: Libro de Profundidad I - enchantingCraft8: Libro de Reparación - enchantingCraft9: Libro de Fortuna I - commandDesc9: Establece las almas para un jugador específico - commandDesc10: Establece la habilidad o las fichas pasivas en una habilidad específica - para un jugador específico - commandDesc11: Establece los tokens globales para un jugador específico - commandDesc12: Guarda las estadísticas de todos los jugadores o de un jugador - específico - status: ESTADO - complete: COMPLETO - incomplete: INCOMPLETO - try0: probar - passiveImprove: ¡Tus ventajas pasivas mejoran cada nivel! - increasedBy: Aumentado en - expIncrease: Multiplicador de EXP - personalMultiplier: Multiplicador personal - translators: Traductores - commandDesc13: Establece el multiplicador personal para un jugador específico - abilityDescription: Descripción de la habilidad - abilityDescription_digging: Agrega temporalmente 5 niveles de eficiencia a tu - pala. Se activa haciendo clic derecho en una pala y luego rompiendo un bloque. - abilityDescription_woodcutting: Temporalmente hace que los ejes rompan un árbol - entero con una ruptura de bloque. Se activa haciendo clic derecho en un hacha - y luego rompiendo un tronco. - abilityDescription_mining: Agrega temporalmente 5 niveles de eficiencia a tu pico. - Se activa haciendo clic derecho en un pico y luego rompiendo el bloque. - abilityDescription_farming: Hace que los cultivos se rompan temporalmente con - una azada y se replanten automáticamente. Se activa haciendo clic con el botón - derecho en una azada y luego rompiendo un cultivo. - abilityDescription_fishing: Temporalmente hace que las cañas de pescar capturen - un pez al instante. Se activa haciendo clic con el botón izquierdo en una caña - de pescar y luego pescando en el agua. - abilityDescription_archery: Hace que todas las flechas se disparen temporalmente - a la velocidad máxima. Se activa haciendo clic con el botón izquierdo en un - arco y luego disparando una flecha. - abilityDescription_beastMastery: Le otorga temporalmente a tu caballo una mejora - de velocidad. Se activa haciendo clic con el botón derecho en un caballo y luego - haciendo clic con el botón izquierdo. - abilityDescription_swordsmanship: Elimina temporalmente el tiempo de reutilización - de las espadas. Se activa haciendo clic derecho en una espada y luego golpeando - a una mafia. - abilityDescription_defense: Proporciona temporalmente al usuario efectos de Resistencia - y Lentitud. Se activa haciendo clic derecho con una mano vacía y luego golpeando - a una mafia. - abilityDescription_axeMastery: Temporalmente hace que las hachas hagan daño a - todos los mobs en un cierto radio. Se activa haciendo clic derecho en un hacha - y luego golpeando a una mafia. - alchemyPerkDesc1_0: Desbloquea la capacidad de elaborar cerveza - alchemyPerkDesc0_0: Se puede usar una mesa de artesanía para - triggerAbilities: Habilidades de activación - showEXPBar: Mostrar barra EXP - disabledSkill: Esta habilidad está desactivada - skillConfigDesc: te lleva al menú de configuración de esta habilidad - lvl: Lvl. - exp: EXP - potionAbsorption: Poción de absorción - potionBadOmen: Poción de mal augurio - potionBlindess: Poción de ceguera - potionConduitPower: Poción de poder de conducto - potionResistance: Poción de resistencia - pociónDolphinsGrace: Poción de Dolphins Grace - potionHaste: Poción de prisa - potionFireResistance: Poción de resistencia al fuego - potionGlowing: Poción de resplandor - potionHarm: Poción de daño - potionHealing: Poción de sanación - potionHealthBoost: Poción de aumento de salud - potiontheHero: Poción del héroe - potionHunger: Poción del hambre - potionStrength: Poción de fuerza - potionInvsibility: Poción de invibilidad - potionJump: Poción de salto - potionLuck: Poción de la suerte - potionNightVision: Poción de visión nocturna - potionRegeneration: Poción de regeneración - potionSaturation: Poción de saturación - potionSlowness: Poción de lentitud - potionFatigue: Poción de fatiga - potionSlowFalling: Poción de caída lenta - potionSpeed: Poción de velocidad - potionBadLuck: Poción de mala suerte - potionWaterBreathing: Poción de respiración de agua - potionWeakness: Poción de debilidad - potionDecay: Poción de descomposición - potionAwkward: Poción torpe - poción Uncraftable: Poción Inconvenible - poción Mundane: Poción Mundana - potionTurtleMaster: Poción del maestro tortuga - potionThick: Poción espesa - potionWater: Botella de agua - ingredient: ingrediente - usedToBrew: se utiliza para preparar - costs: costos - xpLevel: Nivel Minecraft XP - xpLevels: niveles de XP de Minecraft - craftXPRequirement: Esta receta requiere al menos - bedGUI: ¡No puedes usar este comando mientras estás en la cama! - statsUpdated: Sus estadísticas se cambiaron para que sean consistentes con una nueva curva EXP. Todos - Se han restablecido los árboles de habilidades y las ventajas pasivas. Todos los tokens deben reinvertirse. - timeRemaining: Tiempo restante - numberOfAbilityTimersDisplayed: Número de temporizadores de habilidad mostrados - commandDesc14: Restablece el período de recuperación de una habilidad a 0 segundos - commandDesc15: Busca las estadísticas de FreeRPG de un jugador - repairUnsafeEnchant: Este objeto es demasiado poderoso para ser reparado - salvageUnsafeEnchant: Este objeto es demasiado poderoso para ser recuperado - rank: Rango - stats: estadisticas - outOf: fuera de - playerNotInLeaderboard: Ese jugador no está en ninguna tabla de clasificación - virtual: Virtual - commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) + esCl: #Translated by PibeChileno + languageName: Español + englishLanguageName: Chilean Spanish + translationCredit: PibeChileno + global: Global + digging: Excavación + woodcutting: Tala de madera + mining: Minería + farming: Agricultura + fishing: Pesca + archery: Tiro con arco + beastMastery: Dominio de las bestias + swordsmanship: Manejo de la espada + defense: Defensa + axeMastery: Dominio del hacha + repair: Reparación + alchemy: Alquimia + agility: Agilidad + smelting: Fundición + enchanting: Encantador + information: Información + configuration: Configuración + level: Nivel + experience: Experiencia + toNext: Al siguiente + total: Total + diggingPerkTitle0: Mo 'gotas + diggingPerkTitle1: Tesoro doble + diggingPerkTitle2: Gotas más raras + diggingPerkTitle3: Ladron de almas + diggingPerkTitle4: Buscador de pedernal + diggingPerkTitle5: Caballero de la pala + diggingPerkTitle6: Mega Excavación + diggingPerkDesc0: expande la tabla de caída del tesoro en 1 artículo por nivel + diggingPerkDesc1: + 5% de probabilidad de recibir el doble de tesoro por nivel + (cuando se rueda el tesoro) + diggingPerkDesc2: expande aún más la tabla desplegable por elemento por nivel + diggingPerkDesc3: La arena del alma tiene un 5% más de probabilidades de soltar + tesoros por nivel + diggingPerkDesc4: Grava tiene una tasa de caída de pedernal del 100% (conmutable + por / pedernal) + diggingPerkDesc5: Las palas hacen el doble de daño + diggingPerkDesc6: Cuando usas la habilidad, ahora rompes una sección de bloque + de 3x3 (20% de la tasa de tesoro normal cuando está activo) + diggingPassiveTitle0: Fichas pasivas + diggingPassiveTitle1: Atrás + diggingPassiveTitle2: Fichas de habilidad + diggingPassiveTitle3: Duración de gran excavación + diggingPassiveTitle4: Treasure Chance + diggingPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) + diggingPassiveDesc1: te lleva de vuelta al menú principal de habilidades + diggingPassiveDesc2: Fichas para invertir en árbol de habilidades + diggingPassiveDesc3: aumenta la duración de Big Dig en 0.02 s + diggingPassiveDesc4: aumenta la probabilidad de desenterrar un tesoro en un 0,005% + woodcuttingPerkTitle0: Raíces celosas + woodcuttingPerkTitle1: Armas frescas + woodcuttingPerkTitle2: Conocimiento oculto + woodcuttingPerkTitle3: Carroñero de hojas + woodcuttingPerkTitle4: Madera + + woodcuttingPerkTitle5: Soplador de hojas + woodcuttingPerkTitle6: Hacha capaz + woodcuttingPerkDesc0: + 20% de probabilidad de que los troncos caigan 1 XP por + nivel + woodcuttingPerkDesc1: +12 s por nivel de celeridad I después de que se rompa el + primer tronco en 5 minutos + woodcuttingPerkDesc2: Los troncos tienen un + 0,2% de probabilidad por nivel de + dejar caer un libro + woodcuttingPerkDesc3: Las hojas tienen un 1% de probabilidad de soltar +1 objeto + del tesoro por nivel + woodcuttingPerkDesc4: límite de rotura de madera aumentado de 64 a 128 + woodcuttingPerkDesc5: Romper una gran sección de hojas con un hacha (toggleable + with /leafBlowerToggle) + woodcuttingPerkDesc6: Gotas dobles, Raíces celosas y Conocimiento oculto, todo + ahora aplicar a la madera (a la mitad de efectividad) + woodcuttingPassiveTitle0: Fichas pasivas + woodcuttingPassiveTitle1: Volver + woodcuttingPassiveTitle2: Fichas de habilidad + woodcuttingPassiveTitle3: Duración de la madera + woodcuttingPassiveTitle4: Gotas dobles + woodcuttingPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) + woodcuttingPassiveDesc1: te lleva de vuelta al menú principal de habilidades + woodcuttingPassiveDesc2: Fichas para invertir en árbol de habilidades + woodcuttingPassiveDesc3: aumenta la duración de la madera en 0.02 s + woodcuttingPassiveDesc4: aumenta la probabilidad de recibir una caída doble en + un 0.05% + miningPerkTitle0: Prisa inútil + miningPerkTitle1: Más bombas + miningPerkTitle2: Buscador de tesoros + miningPerkTitle3: Viaje bomba + miningPerkTitle4: Minero de venas + miningPerkTitle5: Hombre de demolición + miningPerkTitle6: Triple problema + miningPerkDesc0: Gana prisa después de extraer minerales para cada nivel. + miningPerkDesc1: La receta de elaboración de TNT produce +1 bloque TNT por nivel + miningPerkDesc2: al usar la habilidad en piedras, + 1% por nivel de probabilidad + de un mineral para soltar (se obtiene experiencia adicional de los minerales + arrojados) + miningPerkDesc3: aumenta el radio de explosión TNT (cuando se enciende con pedernal + y acero) cada uno nivel + miningPerkDesc4: Las vetas de mineral se extraen instantáneamente al romper un + bloque (conmutable) + miningPerkDesc5: No se recibe daño de las explosiones TNT + miningPerkDesc6: las gotas dobles ahora son gotas triples + miningPassiveTitle0: Fichas pasivas + miningPassiveTitle1: Volver + miningPassiveTitle2: Fichas de habilidad + miningPassiveTitle3: Duración de selección de Berserk + miningPassiveTitle4: Gotas dobles + miningPassiveTitle5: Explotación minera + miningPassiveDesc0: Tokens para invertir en habilidades pasivas (tintes) + miningPassiveDesc1: lo lleva de regreso al menú principal de habilidades + miningPassiveDesc2: Tokens para invertir en árbol de habilidades + miningPassiveDesc3: aumenta la duración de Berserk Pick en 0.02s + miningPassiveDesc4: aumenta la probabilidad de recibir una caída doble de los + minerales en un 0.05% + miningPassiveDesc5: aumenta las posibilidades de que se cree mineral a partir + de explosiones de TNT en un 0,01% (más bloques rotos = más tiradas del tesoro) + farmingPerkTitle0: Mejor fertilizante + farmingPerkTitle1: Granja de animales + farmingPerkTitle2: Dieta del granjero + farmingPerkTitle3: Carnívoro + farmingPerkTitle4: Pulgar verde + farmingPerkTitle5: Hormonas de crecimiento + farmingPerkTitle6: Uno con la naturaleza + farmingPerkDesc0: + 10% de probabilidad de no consumir harina de huesos en uso + farmingPerkDesc1: Puede crear un huevo de desove adicional por nivel + farmingPerkDesc2: Los alimentos agrícolas son un 20% más efectivos para restaurar + el hambre y la saturación por nivel + farmingPerkDesc3: La carne es un 20% más efectiva para restaurar el hambre y la + saturación. por nivel + farmingPerkDesc4: La habilidad puede replantar cultivos completamente desarrollados + con mayor probabilidad de replantación en etapas posteriores de crecimiento; + La habilidad ahora afecta a Melones y Calabazas. + farmingPerkDesc5: El azúcar se puede usar en animales bebés para hacerlos crecer + instantáneamente + farmingPerkDesc6: Gana Regeneración I cuando te quedas quieto sobre la hierba + farmingPassiveTitle0: Fichas pasivas + farmingPassiveTitle1: Atrás + farmingPassiveTitle2: Fichas de habilidad + farmingPassiveTitle3: Duración de la regeneración natural + farmingPassiveTitle4: Gotas dobles (cultivos) + farmingPassiveTitle5: Gotas dobles (animales) + farmingPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) + farmingPassiveDesc1: te lleva de vuelta al menú principal de habilidades + farmingPassiveDesc2: Fichas para invertir en árbol de habilidades + farmingPassiveDesc3: aumenta la duración de la regeneración natural en 0.02s + farmingPassiveDesc4: aumenta la probabilidad de recibir una caída doble de los + cultivos en un 0.05% + farmingPassiveDesc5: aumenta la probabilidad de recibir una caída doble de la + mayoría de pasivos animales en un 0,05% + fishingPerkTitle0: Robar + fishingPerkTitle1: Carroñero + fishingPerkTitle2: Dieta del pescador + fishingPerkTitle3: Filtración + fishingPerkTitle4: Gancho de agarre + fishingPerkTitle5: Barra caliente + fishingPerkTitle6: Persona pez + fishingPerkDesc0: + 15% de probabilidad de sacar un objeto de una mafia por nivel + fishingPerkDesc1: Desbloquea un nuevo nivel de tesoro de pesca + fishingPerkDesc2: Restauración de peces + 20% de hambre por nivel + fishingPerkDesc3: El botín de nivel superior (II-V) se vuelve más común, nivel + inferior (I) se vuelve menos común + fishingPerkDesc4: la caña de pescar ahora actúa como un gancho de agarre (se puede + alternar con / grappleToggle ) + fishingPerkDesc5: El pescado ahora se cocina cuando se captura, algunos tesoros + de pesca se cambiado (conmutable con / hotRodToggle) + fishingPerkDesc6: Visión nocturna infinita bajo el agua, gracia infinita de los + delfines cuando en el agua + fishingPassiveTitle0: Fichas pasivas + fishingPassiveTitle1: Volver + fishingPassiveTitle2: Fichas de habilidad + fishingPassiveTitle3: Duración del super cebo + fishingPassiveTitle4: Capturas dobles + fishingPassiveTitle5: Buscador de tesoros + fishingPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) + fishingPassiveDesc1: te lleva de vuelta al menú principal de habilidades + fishingPassiveDesc2: Fichas para invertir en árbol de habilidades + fishingPassiveDesc3: aumenta la duración de Super cebo en 0.01s + fishingPassiveDesc4: aumenta la probabilidad de recibir una caída doble en un + 0.05% + fishingPassiveDesc5: Disminuye la probabilidad de encontrar basura en un 0.005%, + aumenta la probabilidad de encontrar tesoros en un 0,005% + archeryPerkTitle0: Flechas adicionales + archeryPerkTitle1: Francotirador + archeryPerkTitle2: Flecha de luz + archeryPerkTitle3: Flechas explosivas + archeryPerkTitle4: Flechas sin dragón + archeryPerkTitle5: Ballesta de carga rápida + archeryPerkTitle6: Golpe mortal + archeryPerkDesc0: +1 flecha obtenida de la elaboración por nivel + archeryPerkDesc1: La velocidad de la flecha aumenta en un + 2% por nivel (~ 4% + de aumento de daño / nivel) + archeryPerkDesc2: Las flechas espectrales obtienen un aumento de daño de + 5% + por nivel + archeryPerkDesc3: Las flechas tienen un + 1% de crear una explosión al golpear + archeryPerkDesc4: permite crear todas las flechas con puntas con pociones regulares + en su lugar de pociones persistentes + archeryPerkDesc5: la habilidad ahora se puede usar con ballestas, lo que hace + que todos los disparos se carguen instantáneamente + archeryPerkDesc6: Los fuegos artificiales disparados con ballestas hacen el doble + de daño (hasta 16 corazones de daño) + archeryPassiveTitle0: Fichas pasivas + archeryPassiveTitle1: Atrás + archeryPassiveTitle2: Fichas de habilidad + archeryPassiveTitle3: Duración de disparo rápido + archeryPassiveTitle4: Recuperación + archeryPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) + archeryPassiveDesc1: te lleva de regreso al menú principal de habilidades + archeryPassiveDesc2: Fichas para invertir en árbol de habilidades + archeryPassiveDesc3: aumenta la duración del disparo rápido en 0.02s + archeryPassiveDesc4: aumenta la probabilidad de que el disparo de flecha no consuma + flecha en un 0.05% por nivel + beastMasteryPerkTitle0: Piel gruesa + beastMasteryPerkTitle1: Dientes afilados + beastMasteryPerkTitle2: Bocados saludables + beastMasteryPerkTitle3: Mantente alejado + beastMasteryPerkTitle4: Acro-Dog + beastMasteryPerkTitle5: Identificar + beastMasteryPerkTitle6: Impulso de adrenalina + beastMasteryPerkDesc0: Los perros reciben -10% de daño por nivel + beastMasteryPerkDesc1: Los perros hacen + 10% más de daño por nivel + beastMasteryPerkDesc2: Los perros curan +1/2 corazón por nivel al matar + beastMasteryPerkDesc3: Los perros tienen + 5% de probabilidad de derribar enemigos. + beastMasteryPerkDesc4: Los perros no reciben daño por caída + beastMasteryPerkDesc5: el uso de una brújula en un caballo o lobo ahora muestra + sus estadísticas + beastMasteryPerkDesc6: La mejora de la patada espuela ahora es velocidad III + beastMasteryPassiveTitle0: Fichas pasivas + beastMasteryPassiveTitle1: Atrás + beastMasteryPassiveTitle2: Fichas de habilidad + beastMasteryPassiveTitle3: Patada agria Duración + beastMasteryPassiveTitle4: Mordedura crítica + beastMasteryPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) + beastMasteryPassiveDesc1: te lleva de vuelta al menú principal de habilidades + beastMasteryPassiveDesc2: Fichas para invertir en árbol de habilidades + beastMasteryPassiveDesc3: aumenta la duración de Patada agria en 0.02s + beastMasteryPassiveDesc4: aumenta la probabilidad de que un perro tenga un golpe + crítico 0,025% + swordsmanshipPerkTitle0: Adrenalina + swordsmanshipPerkTitle1: Matanza + swordsmanshipPerkTitle2: + Adrenalina + swordsmanshipPerkTitle3: Frenesí asesino + swordsmanshipPerkTitle4: Sed de sangre + swordsmanshipPerkTitle5: ¡Más afilado! + swordsmanshipPerkTitle6: Dominio de la espada + swordsmanshipPerkDesc0: matar mobs hostiles con una espada proporciona +2 s de + velocidad por nivel + swordsmanshipPerkDesc1: Matar mobs hostiles con una espada proporciona +2 s de + fuerza por nivel + swordsmanshipPerkDesc2: + 20% de la mejora de velocidad I de Adrenalina ahora + es velocidad II + swordsmanshipPerkDesc3: + 20% de la fuerza que obtengo de Killing Spree ahora + es fuerza II + swordsmanshipPerkDesc4: Matar a ciertos mobs agresivos con una espada restaura + hambre + swordsmanshipPerkDesc5: Los golpes rápidos ahora agregan un nivel de nitidez a + tu espada + swordsmanshipPerkDesc6: Las espadas infligen de forma permanente +1 al corazón + de daño + swordsmanshipPassiveTitle0: Fichas pasivas + swordsmanshipPassiveTitle1: Espalda + swordsmanshipPassiveTitle2: Fichas de habilidad + swordsmanshipPassiveTitle3: Duración de los golpes rápidos + swordsmanshipPassiveTitle4: Doble golpe + swordsmanshipPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) + swordsmanshipPassiveDesc1: te lleva de vuelta al menú principal de habilidades. + swordsmanshipPassiveDesc2: Fichas para invertir en árbol de habilidades + swordsmanshipPassiveDesc3: Aumenta la duración de Swift Strikes en 0.02s + swordsmanshipPassiveDesc4: aumenta la probabilidad de golpear a la mafia dos veces + (el segundo golpe lo hace 50% de daño) en un 0,02% + defensePerkTitle0: Curador + defensePerkTitle1: Endurecer + defensePerkTitle2: Cabeza dura + defensePerkTitle3: + Endurecer + defensePerkTitle4: Regalo de arriba + defensePerkTitle5: Piernas más fuertes + defensePerkTitle6: Abundante + defensePerkDesc0: Obtienes + 3s de regeneración por nivel al matar + defensePerkDesc1: + 2% de probabilidad de ganar resistencia I durante 5 segundos + al recibir un golpe. + defensePerkDesc2: Cuerpo duro reduce el daño en un 6.6% adicional por nivel + defensePerkDesc3: + 2% de probabilidad de ganar resistencia II durante 5 segundos + cuando se golpea + defensePerkDesc4: Piedra sólida ahora otorga 4 corazones de absorción para la + duración de la habilidad +1 minuto + defensePerkDesc5: Piedra sólida ahora da lentitud I en lugar de lentitud IV + defensePerkDesc6: +2 corazones permanentemente + defensePassiveTitle0: Fichas pasivas + defensePassiveTitle1: Atrás + defensePassiveTitle2: Fichas de habilidad + defensePassiveTitle3: Duración de piedra solida + defensePassiveTitle4: Cuerpo duro + defensePassiveTitle5: Gotas dobles (Mobs hostiles) + defensePassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) + defensePassiveDesc1: te lleva de vuelta al menú principal de habilidades. + defensePassiveDesc2: Fichas para invertir en árbol de habilidades + defensePassiveDesc3: aumenta la duración de Stone Solid en 0.02s + defensePassiveDesc4: aumenta la probabilidad de recibir daño reducido (base -33%) + en un 0.01% por nivel + defensePassiveDesc5: aumenta la probabilidad de recibir gotas dobles de agresivos + mobs en un 0,05% + axeMasteryPerkTitle0: Hacha mayor + axeMasteryPerkTitle1: Hacha sagrada + axeMasteryPerkTitle2: Revitalizado + axeMasteryPerkTitle3: Sangre de guerrero + axeMasteryPerkTitle4: Terremoto + axeMasteryPerkTitle5: Mejores críticas + axeMasteryPerkTitle6: Hombre Hacha + axeMasteryPerkDesc0: El radio de daño del Gran Hacha aumenta en 1 bloque por nivel + axeMasteryPerkDesc1: + 2% de probabilidad de que la iluminación golpee a las turbas + con el hacha + axeMasteryPerkDesc2: + 1% de probabilidad de curación completa al matar por nivel + axeMasteryPerkDesc3: +3 s por nivel de Fuerza I en muertes con un hacha + axeMasteryPerkDesc4: El daño AOE de la habilidad se duplica (25% -> 50% del daño) + axeMasteryPerkDesc5: Los críticos divinos ahora tienen un multiplicador de 1.6x + en lugar de 1.25x + axeMasteryPerkDesc6: las hachas infligen de forma permanente +1 al corazón de + daño + axeMasteryPassiveTitle0: Fichas pasivas + axeMasteryPassiveTitle1: Atrás + axeMasteryPassiveTitle2: Fichas de habilidad + axeMasteryPassiveTitle3: Duración del gran hacha + axeMasteryPassiveTitle4: Críticos divinos + axeMasteryPassiveDesc0: Fichas para invertir en habilidades pasivas (tintes) + axeMasteryPassiveDesc1: te lleva de regreso al menú principal de habilidades + axeMasteryPassiveDesc2: Fichas para invertir en árbol de habilidades + axeMasteryPassiveDesc3: aumenta la duración de Great Axe en 0.02s + axeMasteryPassiveDesc4: aumenta la probabilidad de crítico aleatorio (base 1.25x + daño) en un 0.01% + repairPerkTitle0: Recuperación + repairPerkTitle1: Ingenioso + repairPerkTitle2: Maestría en reparación mágica + repairPerkDesc0: Obtenga más materiales en promedio al recuperar + repairPerkDesc1: + 10% de probabilidad de mantener el material usado al reparar + repairPerkDesc2: Garantizado para mantener los encantamientos en reparación + repairPassiveTitle0: Atrás + repairPassiveTitle1: Fichas de habilidad + repairPassiveTitle2: Competencia + repairPassiveDesc0: te lleva de vuelta al menú principal de habilidades + repairPassiveDesc1: Fichas para invertir en árbol de habilidades + repairPassiveDesc2: los materiales restauran más durabilidad en la reparación + agilityPerkTitle0: Esquivar + agilityPerkTitle1: Huesos de acero + agilityPerkTitle2: Pies agraciados + agilityPerkDesc0: + 4% de probabilidad de esquivar ataques por nivel + agilityPerkDesc1: -10% de daño por caída por nivel + agilityPerkDesc2: Mejora permanente de velocidad I (conmutable por / speedToggle) + agilityPassiveTitle0: Atrás + agilityPassiveTitle1: Fichas de habilidad + agilityPassiveTitle2: Rodar + agilityPassiveDesc0: te lleva de vuelta al menú principal de habilidades + agilityPassiveDesc1: Fichas para invertir en árbol de habilidades + agilityPassiveDesc2: Posibilidad de rodar y recibir daño por caída reducido + alchemyPerkTitle0: Invocación alquímica + alchemyPerkTitle1: Conocimiento antiguo + alchemyPerkTitle2: Maestro de pociones + alchemyPerkDesc0: permite la elaboración de algunas pociones sin un soporte de + preparación + alchemyPerkDesc1: Desbloquea la capacidad de preparar nuevas pociones + alchemyPerkDesc2: Todas las pociones usadas aumentan de nivel en 1 (se puede alternar + con / togglePotion) + alchemyPassiveTitle0: Volver + alchemyPassiveTitle1: Fichas de habilidad + alchemyPassiveTitle2: + Media vida + alchemyPassiveDesc0: te lleva de regreso al menú principal de habilidades + alchemyPassiveDesc1: Fichas para invertir en árbol de habilidades + alchemyPassiveDesc2: Aumento de la duración de las pociones cuando se usan + smeltingPerkTitle0: Eficiencia de combustible + smeltingPerkTitle1: Doble olor + smeltingPerkTitle2: Pico de llamas + smeltingPerkDesc0: El combustible dura un 20% más por nivel + smeltingPerkDesc1: + 5% de probabilidad de que el mineral fundido se duplique + por nivel + smeltingPerkDesc2: Los minerales extraídos se funden instantáneamente (se puede + alternar con / toggleFlamePick) + smeltingPassiveTitle0: Volver + smeltingPassiveTitle1: Fichas de habilidad + smeltingPassiveTitle2: Velocidad del combustible + smeltingPassiveDesc0: te lleva de vuelta al menú principal de habilidades + smeltingPassiveDesc1: Fichas para invertir en árbol de habilidades + smeltingPassiveDesc2: Aumento de la velocidad de cocción + enchantingPerkTitle0: Encantamiento eficiente + enchantingPerkTitle1: Reserva inteligente + enchantingPerkTitle2: Experiencia inmortal + enchantingPerkDesc0: Niveles necesarios para encantar -1 por nivel, costos de + reparación del yunque -1 (mínimo de 2) niveles de XP por nivel + enchantingPerkDesc1: Desbloquea recetas de elaboración para algunos libros encantados + enchantingPerkDesc2: Keep xp on death + enchantingPassiveTitle0: Volver + enchantingPassiveTitle1: Fichas de habilidad + enchantingPassiveTitle2: Desarrollo más rápido + enchantingPassiveDesc0: te lleva de regreso al menú principal de habilidades + enchantingPassiveDesc1: Fichas para invertir en árbol de habilidades + enchantingPassiveDesc2: Todos los XP recibidos aumentaron + globalPerkTitle0: Recolector + globalPerkTitle1: Académico + globalPerkTitle2: Luchador + globalPerkTitle3: Trabajo duro + globalPerkTitle4: Investigación + globalPerkTitle5: Capacitación + globalPerkTitle6: Reencarnación + + globalPerkTitle7: Cosecha de almas + globalPerkTitle8: Avatar + globalPerkTitle9: Maestro de las artes + globalPerkDesc0: + 20% de experiencia ganada en excavación, tala de madera, minería, + agricultura y Pescar + globalPerkDesc1: + 20% de experiencia obtenida en Reparación, Agilidad, Elaboración + de cerveza, Fundición y Encantamiento + globalPerkDesc2: + 20% de experiencia obtenida en Tiro con arco, Dominio de bestias, + Esgrima, Defensa, y dominio del hacha + globalPerkDesc3: +1 ficha de habilidad en todas las habilidades de recolector + globalPerkDesc4: +1 ficha de habilidad en todas las habilidades de erudito + globalPerkDesc5: +1 ficha de habilidad en todas las habilidades de luchador + globalPerkDesc6: Al morir, 50% de probabilidad de mantener algo de cada elemento + valioso en su inventario + globalPerkDesc7: ahora cosechas almas al matar mobs agresivos, que pueden ser + utilizado para reembolsar árboles de habilidades + globalPerkDesc8: 10% de probabilidad de no recibir daño y obtener todos los beneficios + del juego durante 10 segundos en un golpe que normalmente te mataría + globalPerkDesc9: Los tiempos de reutilización de habilidades disminuyeron un 33% + globalPassiveTitle0: Tokens globales + globalPassiveTitle1: Atrás + globalPassiveDesc0: Tokens para invertir en árbol de habilidades + globalPassiveDesc1: te lleva de vuelta al menú principal de habilidades + cannotRepair: ¡No puedes reparar mientras esta habilidad esté activa! + cannotSalvage: ¡No puedes salvar mientras esta habilidad está activa! + spite: todo lo bueno está hecho de despecho + refundSkill: se requieren para reembolsar un árbol de habilidades + refundSkill2: para reembolsar un árbol de habilidades + needToUnlock: Necesitas desbloquear + PerkRequirement: Necesitas al menos 2 fichas de habilidad invertidas en las ventajas + anteriores para desbloquear esta ventaja + perkRequirementM: necesitas al menos 10 fichas de habilidad en total invertidas + en el árbol de habilidades para desbloquear esta ventaja de maestría + noSkillTokens: no tienes ninguna ficha de habilidad + noPassiveTokens: no tienes ningún token pasivo + maxedOutPerk: ¡Ya has maximizado este beneficio! + requiredGlobalPerks0: Necesitas la ventaja anterior para desbloquear esta ventaja + requiredGlobalPerks1: son necesarios para desbloquear este beneficio + requiredGlobalPerks2: es necesario para desbloquear este beneficio + requiredGlobalPerks3: Necesitas todas las ventajas globales para desbloquear esta + ventaja + craftRequirement: ¡se requiere para elaborar esta receta! + roll: ROLLO + dodge: ESQUIVAR + prepare: usted prepara su + rest: Descansas tu + activated: activado! + ended: ha terminado + readyToUse: está listo para usar de nuevo + cooldown: enfriamiento + rapidFire: Fuego rápido + bown: arco + greatAxe: Gran hacha + axe: hacha + spurKick: Spur Kick + leg: pierna + stoneSoldier: Soldado de piedra + yourself: usted mismo + bigDig: Big Dig + shovel: pala + naturalRegeneration: Regeneración natural + hoe: Azada + superbait: superbait + fishingRod: caña de pescar + berserkPick: Pico del Berserker + pickaxe: pico + swiftStrikes: Golpes rápidos + sword: espada + timber: Madera + hyperHorse: ¡Este caballo ya es hiperactivo! + magicForce: una fuerza mágica acaba con tu habilidad + rob: Robar + repairFail0: No tienes la habilidad suficiente para reparar este artículo adecuadamente + repairFail1: No lograste recuperar ningún material + repairFail2: No pudiste retener el poder de encantamiento del objeto + treeTooBig0: ¡Este árbol es demasiado grande para cortarlo de una vez! " + treeTooBig1: Este árbol nunca se puede cortar de una sola vez así ... + noPermission: ¡No tienes permiso para usar este comando! + improperArguments: argumentos impropios, intente + totalPlayTime: tiempo total de reproducción + clickForOptions: Haga clic para ver las opciones + unknownCommand: Comando desconocido + expToLevel: EXP al siguiente nivel + playerName: Nombre del jugador + skillName: Nombre de la habilidad (en inglés) + page: página + on0: 'ON' + off0: 'OFF' + onOrOff: ENCENDIDO / APAGADO + manuallyToggles: alterna manualmente + commandDesc0: abre la GUI principal con todas las habilidades + commandDesc1: abre una GUI de árbol de habilidades de su elección + commandDesc2: abre la GUI de configuración + commandDesc3: le da a un jugador de elección EXP en una habilidad específica + commandDesc4: establece el nivel de un jugador determinado en una habilidad específica + commandDesc5: restablece las estadísticas de un jugador en una habilidad específica + (no reembolsa las estadísticas) + commandDesc6: muestra una tabla de clasificación para una estadística específica + commandDesc7: proporciona un enlace a una página de información del complemento + commandDesc8: Intenta encantar un elemento en la mano del usuario en un nivel + específico + informationURL: URL de información (Google Docs) + click: CLIC + levelArgument: el argumento de nivel debe ser menor que 40 + leadboard: tabla de clasificación + playerOffline: ese jugador no está en línea + onlyIncrease: solo aumente exp con este comando; de lo contrario, use / frpg statReset + y luego / frpg giveEXP + amount: cantidad + unlockToggle: Para usar este comando debes desbloquear + levelUpNotif: Notificaciones de nivel superior + abilityPreparationNotif: Notificaciones de preparación de habilidades + yes0: SI + no0: 'NO' + warning: ADVERTENCIA + souls: almas + refundSkillTree0: Reembolso de los costos de un árbol de habilidades + refundSkillTree1: y no es reversible, ¿está seguro de que desea + refundSkillTree2: reembolsar el + skill: Habilidad + backToSkillTree: Te lleva de vuelta al árbol de habilidades + miningPerkDesc0_1: 2 segundos de celeridad I después de extraer cualquier mineral + miningPerkDesc0_2: 5 segundos de celeridad I después de extraer cualquier mineral + miningPerkDesc0_3: 10 segundos de celeridad I después de extraer cualquier mineral + miningPerkDesc0_4: 5 segundos de Prisa II después de extraer cualquier mineral, + seguidos de 5 segundos de Haste I + miningPerkDesc0_5: 10 segundos de Prisa II después de extraer cualquier mineral + woodcuttingPerkDesc3_1: Las hojas ahora pueden dejar caer un + common: Común + uncommon: Poco común + rare: Raro + veryRare: Muy raro + legendary: Legendario + fishingPerkDesc1_1: Desbloquea el nivel del tesoro + farmingPerkDesc1_1: Obtén la capacidad de crear + cowSpawnEgg: Huevo de desove de vaca + beeSpawnEgg: Huevo de desove de abeja + mooshroomSpawnEgg: Huevo de desove de mooshroom + horseSpawnEgg: Huevo de desove de caballo + slimeSpawnEgg: Huevo de engendro de limo + diggingPerkDesc0_1: Ahora puede desenterrar un + defensePerkDesc0_1: Obtienes +3 s de regeneración por nivel en muertes + defensePerkDesc0_2: Gana +0.5 corazones por nivel instantáneamente en muertes + duration: Duración + likelihood: Probabilidad + junkChance: Oportunidad basura + locked: BLOQUEADO + unlocked: DESBLOQUEADO + cowEgg: Huevo de vaca + beeEgg: Huevo de abeja + mooshroomEgg: Huevo de Mooshroom + horseEgg: Huevo de caballo + slimeEgg: Huevo de limo + tippedArrows: Flechas con punta + toggle: Alternar + refundSkillTitle: Habilidad de reembolso + refundSkillTreeDesc: Haga clic para reembolsar este árbol de habilidades + enchantingPerkDesc1_0: Desbloquea la capacidad de crear + enchantingPerkDesc1_1: Libros encantados Poder I y Eficiencia I (cuesta 1 nivel + para fabricarlos) + enchantingPerkDesc1_2: Filo I y Proteccion I libros encantados (cuesta 1 nivel + para fabricarlos) + enchantingPerkDesc1_3: Suerte marina I y Señuelo I libros encantados (cuesta 1 + nivel) + enchantingPerkDesc1_4: Profundidad I y Caminante helado I libros encantados (cuesta + 1 nivel) + enchantingPerkDesc1_5: Reparacion (cuesta 10 niveles para crear) y Fortune I (cuesta + 2 niveles para crear) libros encantados + repairPerkDesc0_1: Obtén más materiales recuperando en promedio + repairPerkDesc0_2: obtén más materiales de la recuperación en promedio, la recuperación + ahora almacena encantamientos de objetos en un libro + xpBoost: Aumento de XP + speedBoost: Aumento de velocidad + timeExtension: Extensión de tiempo + enchantingCraft0: Libro de Poder I + enchantingCraft1: Libro de Eficiencia I + enchantingCraft2: Libro de Filo I + enchantingCraft3: Libro de Proteccion I + enchantingCraft4: Libro de Suerte marina I + enchantingCraft5: Libro de Señuelo I + enchantingCraft6: Libro de Caminante helado I + enchantingCraft7: Libro de Profundidad I + enchantingCraft8: Libro de Reparación + enchantingCraft9: Libro de Fortuna I + commandDesc9: Establece las almas para un jugador específico + commandDesc10: Establece la habilidad o las fichas pasivas en una habilidad específica + para un jugador específico + commandDesc11: Establece los tokens globales para un jugador específico + commandDesc12: Guarda las estadísticas de todos los jugadores o de un jugador + específico + status: ESTADO + complete: COMPLETO + incomplete: INCOMPLETO + try0: probar + passiveImprove: ¡Tus ventajas pasivas mejoran cada nivel! + increasedBy: Aumentado en + expIncrease: Multiplicador de EXP + personalMultiplier: Multiplicador personal + translators: Traductores + commandDesc13: Establece el multiplicador personal para un jugador específico + abilityDescription: Descripción de la habilidad + abilityDescription_digging: Agrega temporalmente 5 niveles de eficiencia a tu + pala. Se activa haciendo clic derecho en una pala y luego rompiendo un bloque. + abilityDescription_woodcutting: Temporalmente hace que los ejes rompan un árbol + entero con una ruptura de bloque. Se activa haciendo clic derecho en un hacha + y luego rompiendo un tronco. + abilityDescription_mining: Agrega temporalmente 5 niveles de eficiencia a tu pico. + Se activa haciendo clic derecho en un pico y luego rompiendo el bloque. + abilityDescription_farming: Hace que los cultivos se rompan temporalmente con + una azada y se replanten automáticamente. Se activa haciendo clic con el botón + derecho en una azada y luego rompiendo un cultivo. + abilityDescription_fishing: Temporalmente hace que las cañas de pescar capturen + un pez al instante. Se activa haciendo clic con el botón izquierdo en una caña + de pescar y luego pescando en el agua. + abilityDescription_archery: Hace que todas las flechas se disparen temporalmente + a la velocidad máxima. Se activa haciendo clic con el botón izquierdo en un + arco y luego disparando una flecha. + abilityDescription_beastMastery: Le otorga temporalmente a tu caballo una mejora + de velocidad. Se activa haciendo clic con el botón derecho en un caballo y luego + haciendo clic con el botón izquierdo. + abilityDescription_swordsmanship: Elimina temporalmente el tiempo de reutilización + de las espadas. Se activa haciendo clic derecho en una espada y luego golpeando + a una mafia. + abilityDescription_defense: Proporciona temporalmente al usuario efectos de Resistencia + y Lentitud. Se activa haciendo clic derecho con una mano vacía y luego golpeando + a una mafia. + abilityDescription_axeMastery: Temporalmente hace que las hachas hagan daño a + todos los mobs en un cierto radio. Se activa haciendo clic derecho en un hacha + y luego golpeando a una mafia. + alchemyPerkDesc1_0: Desbloquea la capacidad de elaborar cerveza + alchemyPerkDesc0_0: Se puede usar una mesa de artesanía para + triggerAbilities: Habilidades de activación + showEXPBar: Mostrar barra EXP + disabledSkill: Esta habilidad está desactivada + skillConfigDesc: te lleva al menú de configuración de esta habilidad + lvl: Lvl. + exp: EXP + potionAbsorption: Poción de absorción + potionBadOmen: Poción de mal augurio + potionBlindess: Poción de ceguera + potionConduitPower: Poción de poder de conducto + potionResistance: Poción de resistencia + pociónDolphinsGrace: Poción de Dolphins Grace + potionHaste: Poción de prisa + potionFireResistance: Poción de resistencia al fuego + potionGlowing: Poción de resplandor + potionHarm: Poción de daño + potionHealing: Poción de sanación + potionHealthBoost: Poción de aumento de salud + potiontheHero: Poción del héroe + potionHunger: Poción del hambre + potionStrength: Poción de fuerza + potionInvsibility: Poción de invibilidad + potionJump: Poción de salto + potionLuck: Poción de la suerte + potionNightVision: Poción de visión nocturna + potionRegeneration: Poción de regeneración + potionSaturation: Poción de saturación + potionSlowness: Poción de lentitud + potionFatigue: Poción de fatiga + potionSlowFalling: Poción de caída lenta + potionSpeed: Poción de velocidad + potionBadLuck: Poción de mala suerte + potionWaterBreathing: Poción de respiración de agua + potionWeakness: Poción de debilidad + potionDecay: Poción de descomposición + potionAwkward: Poción torpe + poción Uncraftable: Poción Inconvenible + poción Mundane: Poción Mundana + potionTurtleMaster: Poción del maestro tortuga + potionThick: Poción espesa + potionWater: Botella de agua + ingredient: ingrediente + usedToBrew: se utiliza para preparar + costs: costos + xpLevel: Nivel Minecraft XP + xpLevels: niveles de XP de Minecraft + craftXPRequirement: Esta receta requiere al menos + bedGUI: ¡No puedes usar este comando mientras estás en la cama! + statsUpdated: Sus estadísticas se cambiaron para que sean consistentes con una nueva curva EXP. Todos + Se han restablecido los árboles de habilidades y las ventajas pasivas. Todos los tokens deben reinvertirse. + timeRemaining: Tiempo restante + numberOfAbilityTimersDisplayed: Número de temporizadores de habilidad mostrados + commandDesc14: Restablece el período de recuperación de una habilidad a 0 segundos + commandDesc15: Busca las estadísticas de FreeRPG de un jugador + repairUnsafeEnchant: Este objeto es demasiado poderoso para ser reparado + salvageUnsafeEnchant: Este objeto es demasiado poderoso para ser recuperado + rank: Rango + stats: estadisticas + outOf: fuera de + playerNotInLeaderboard: Ese jugador no está en ninguna tabla de clasificación + virtual: Virtual + commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) - ruRU: #Translated by MoKotik, DevilPlay, Cr1stalz_ - languageName: Русский язык - englishLanguageName: Russian - translationCredit: Cr1stalz_, MoKotik, Devilplay - global: Глобальный уровень - digging: Копание - woodcutting: Добывание дерева - mining: Шахтерство - farming: Фермество - fishing: Рыбаловство - archery: Стрельба из лука - beastMastery: Повелитель зверей - swordsmanship: Фехтование - defense: Защита - axeMastery: Владение топором - repair: Ремонт - alchemy: Алхимия - agility: Ловкость - smelting: Выплавка - enchanting: Зачарование - information: Информация - configuration: Конфигурация - level: Уровень - experience: Опыт - toNext: к следующему - total: Всего - diggingPerkTitle0: Больше сокровищ - diggingPerkTitle1: Двойное сокровище - diggingPerkTitle2: Редкий дроп - diggingPerkTitle3: Похититель душ - diggingPerkTitle4: Поиск кремния - diggingPerkTitle5: Рыцарь лопаты - diggingPerkTitle6: Мега копание - diggingPerkDesc0: Расширяет таблицу выпадения сокровищ на 1 предмет за уровень - diggingPerkDesc1: +5% шанса выпадения двойного сокровища за уровень - diggingPerkDesc2: Расширяет таблицу выпадения дропа по предметам за уровень - diggingPerkDesc3: Выпадение сокровищ из песка душ на +5% больше за уровень - diggingPerkDesc4: Гравий дает 100% шанс выпадения кремня (переключается с помощью /frpg flintToggle) - diggingPerkDesc5: Лопата наносит двойной урон - diggingPerkDesc6: Теперь при использовании способности, вы разбиваете область 3x3 блока (20% от обычного количества сокровищ, когда оно активно) - diggingPassiveTitle0: Пассивные жетоны - diggingPassiveTitle1: Назад - diggingPassiveTitle2: Жетоны умений - diggingPassiveTitle3: Длительность "Большого Копания" - diggingPassiveTitle4: Шанс сокровища - diggingPassiveDesc0: Жетоны для прокачки пассивных умений (красители) - diggingPassiveDesc1: Возвращает вас в главное меню навыков - diggingPassiveDesc2: Жетоны для прокачки дерева умений - diggingPassiveDesc3: Увеличивает длительность "Большого Копания" на 0.02с - diggingPassiveDesc4: Увеличивает шанс выкопать сокровище на 0.005% - woodcuttingPerkTitle0: Ревностные корни - woodcuttingPerkTitle1: Свежие руки - woodcuttingPerkTitle2: Скрытое знание - woodcuttingPerkTitle3: Падающие листья - woodcuttingPerkTitle4: Древесина+ - woodcuttingPerkTitle5: Сдувание листьев - woodcuttingPerkTitle6: Всемогущий топор - woodcuttingPerkDesc0: +20% шанса для деревьев выдать 1 XP за уровень - woodcuttingPerkDesc1: +12с за уровень Спешки I, после первого сломанного бревна в течение 5 минут - woodcuttingPerkDesc2: Бревна дают +0.2% шанса за уровень дропнуть зачарованную книгу - woodcuttingPerkDesc3: Листья дают 1% шанс дропнуть +1 сокровище за уровень - woodcuttingPerkDesc4: Лимит разрушения дерева увеличен с 64 до 128 - woodcuttingPerkDesc5: Ломайте большую область листьев с помощью топора (переключается с помощью /frpg leafBlowerToggle) - woodcuttingPerkDesc6: Двойной дроп, Ревностные корни и Скрытое знание - теперь все применяется к бревнам (с половинной эффективностью) - woodcuttingPassiveTitle0: Пассивные жетоны - woodcuttingPassiveTitle1: Назад - woodcuttingPassiveTitle2: Жетоны умений - woodcuttingPassiveTitle3: Длительность "Лесоруба" - woodcuttingPassiveTitle4: Двойной дроп - woodcuttingPassiveDesc0: Жетоны для прокачки пассивных умений (красители) - woodcuttingPassiveDesc1: Возвращает вас в главное меню навыков - woodcuttingPassiveDesc2: Жетоны для прокачки дерева умений - woodcuttingPassiveDesc3: Увеличивает длительность "Лесоруба" на 0.02с - woodcuttingPassiveDesc4: Увеличивает шанс двойного дропа на 0.05% - miningPerkTitle0: Бесконечная Спешка - miningPerkTitle1: Больше бомб - miningPerkTitle2: Кладоискатель - miningPerkTitle3: Бомба-вояж - miningPerkTitle4: Копатель жил - miningPerkTitle5: Подрывник - miningPerkTitle6: Тройные неприятности - miningPerkDesc0: Дает Спешку после добычи руды для каждого уровня - miningPerkDesc1: При крафте TNT дается +1 доп. блок TNT за уровень - miningPerkDesc2: При использовании способности на камнях, +1% шанс выпадения руды за уровень (дополнительный опыт зарабатывается за выпавшую руду) - miningPerkDesc3: Увеличивает радиус взрыва TNT (при использовании зажигалки) на каждом уровне - miningPerkDesc4: Рудные жилы мгновенно добываются при разрушении одного блока (переключаемый) - miningPerkDesc5: Нету урона от взрывов TNT - miningPerkDesc6: Двойной дроп теперь тройной дроп - miningPassiveTitle0: Пассивные жетоны - miningPassiveTitle1: Назад - miningPassiveTitle2: Жетоны умений - miningPassiveTitle3: Длительность "Кирки Берсерка" - miningPassiveTitle4: Двойной дроп - miningPassiveTitle5: Взрывная добыча - miningPassiveDesc0: Жетоны для прокачки пассивных умений (красители) - miningPassiveDesc1: Возвращает вас в главное меню навыков - miningPassiveDesc2: Жетоны для прокачки дерева умений - miningPassiveDesc3: Увеличивает длительность "Кирки Берсерка" на 0.02с - miningPassiveDesc4: Увеличивает шанс получить двойной дроп из руды на 0.05% - miningPassiveDesc5: Повышает вероятность образования руды из взрывов TNT на 0.01% (Больше сломаных блоков = Больше драгоценностей) - farmingPerkTitle0: Лучшее удобрение - farmingPerkTitle1: Ферма животных - farmingPerkTitle2: Фермерская диета - farmingPerkTitle3: Плотоядный - farmingPerkTitle4: Садоводство - farmingPerkTitle5: Гормон роста - farmingPerkTitle6: Наедине с природой - farmingPerkDesc0: +10% шанса не потратить костную муку при использовании - farmingPerkDesc1: Можете создать больше яиц призыва с каждым уровнем - farmingPerkDesc2: Фермерская еда на 20% эффективнее восстанавливает голод и насыщение за уровень - farmingPerkDesc3: Мясо на 20% эффективнее восстанавливает голод и насыщение за уровень - farmingPerkDesc4: Возможность повторной посадки полностью выращенных культур, с более высокой вероятностью, пересадить на более более позднюю стадию роста; способность теперь действует на арбузы и тыквы - farmingPerkDesc5: Сахар можно использовать на детенышах животных, чтобы заставить их расти мгновенно - farmingPerkDesc6: Даёт Регенерацию I, когда Вы стоите на траве - farmingPassiveTitle0: Пассивные жетоны - farmingPassiveTitle1: Назад - farmingPassiveTitle2: Жетоны умений - farmingPassiveTitle3: Длительность "Натуральной регенерации" - farmingPassiveTitle4: Двойной дроп (Растительность) - farmingPassiveTitle5: Двойной дроп (Животные) - farmingPassiveDesc0: Жетоны для прокачки пассивных умений (красители) - farmingPassiveDesc1: Возвращает вас в главное меню навыков - farmingPassiveDesc2: Жетоны для прокачки дерева умений - farmingPassiveDesc3: Увеличивает длительность "Натуральной регенерации" на 0.02с - farmingPassiveDesc4: Увеличивает шанс получить двойной дроп из растительности на 0.05% - farmingPassiveDesc5: Увеличивает шанс получить двойной дроп с дружелюбных животных на 0.05% - fishingPerkTitle0: Счастливчик - fishingPerkTitle1: Мусорщик - fishingPerkTitle2: Рыбацкая диета - fishingPerkTitle3: Фильтрация - fishingPerkTitle4: Абордажный крюк - fishingPerkTitle5: Горячая удочка - fishingPerkTitle6: Русалка - fishingPerkDesc0: +15% шанса выбить предмет из моба за уровнем - fishingPerkDesc1: Открывает новый уровень рыболовных сокровищ - fishingPerkDesc2: Рыба восстанавливает +20% голода за уровень - fishingPerkDesc3: Добыча более высокого уровня (II-V) становится более распространенной, более низкого уровня (I) становится менее распространенной - fishingPerkDesc4: Удочка теперь действует как крюк для захвата (переключается с помощью /frpg grappleToggle) - fishingPerkDesc5: Рыба теперь готовится при ловле, некоторые рыболовные сокровища изменены (переключается с помощью /frpg hotRodToggle) - fishingPerkDesc6: Бесконечное ночное зрение под водой и бесконечная грация дельфина, когда находишься в воде - fishingPassiveTitle0: Пассивные жетоны - fishingPassiveTitle1: Назад - fishingPassiveTitle2: Жетоны умений - fishingPassiveTitle3: Длительность "Супер приманки" - fishingPassiveTitle4: Двойной улов - fishingPassiveTitle5: Искатель сокровищ - fishingPassiveDesc0: Жетоны для прокачки пассивных умений (красители) - fishingPassiveDesc1: Возвращает вас в главное меню навыков - fishingPassiveDesc2: Жетоны для прокачки дерева умений - fishingPassiveDesc3: Увеличивает длительность "Супер приманки" на 0.01с - fishingPassiveDesc4: Увеличивает шанс получить двойной дроп на 0.05% - fishingPassiveDesc5: Уменьшает шанс найти мусор на 0.005%, увеличивает шанс поиска сокровище на 0.005% - archeryPerkTitle0: Дополнительные стрелы - archeryPerkTitle1: Снайпер - archeryPerkTitle2: Стрелы света - archeryPerkTitle3: Взрывные стрелы - archeryPerkTitle4: Стрелы без дракона - archeryPerkTitle5: Быстрая зарядка арбалета - archeryPerkTitle6: Смертельный удар - archeryPerkDesc0: +1 стрела, получаемая от крафта, за уровень - archeryPerkDesc1: Скорость стрелы увеличивается на +2% за уровень (прибавка к урону на ~4% за уровень) - archeryPerkDesc2: Спектральные стрелы получают +5% к урону за уровень - archeryPerkDesc3: Стрелы имеют +1% шанса взорваться при попадании - archeryPerkDesc4: Позволяет создавать все стрелы с наконечниками из обычных зелий вместо туманных зелий - archeryPerkDesc5: Теперь способность можно использовать с арбалетами, чтобы все выстрелы производились мгновенно - archeryPerkDesc6: Выстрел фейерверком из арбалетов наносит двойной урон (до 16 урона) - archeryPassiveTitle0: Пассивные жетоны - archeryPassiveTitle1: Назад - archeryPassiveTitle2: Жетоны умений - archeryPassiveTitle3: Длительность "Быстрого Огня" - archeryPassiveTitle4: Кешбэк - archeryPassiveDesc0: Жетоны для прокачки пассивных умений (красители) - archeryPassiveDesc1: Возвращает вас в главное меню навыков - archeryPassiveDesc2: Жетоны для прокачки дерева умений - archeryPassiveDesc3: Увеличивает длительность "Быстрого Огня" на 0.02с - archeryPassiveDesc4: Увеличивает шанс для выстрела стрелы не потратив стрелу на 0.05% за уровень - beastMasteryPerkTitle0: Густой мех - beastMasteryPerkTitle1: Острые зубы - beastMasteryPerkTitle2: Полезные закуски - beastMasteryPerkTitle3: Держись подальше - beastMasteryPerkTitle4: Акро-Собака - beastMasteryPerkTitle5: Идентификация - beastMasteryPerkTitle6: Повышение адреналина - beastMasteryPerkDesc0: Собаки получают -10% урона за уровень - beastMasteryPerkDesc1: Собаки наносят на +10% больше урона за уровень - beastMasteryPerkDesc2: Собаки лечат +1/2 сердце за уровень от убийства - beastMasteryPerkDesc3: Собоки получают +5% шанса отбросить врагов - beastMasteryPerkDesc4: Собаки не получают урона от падения - beastMasteryPerkDesc5: При использовании компоса на лошаде или волке, отображается их статистика - beastMasteryPerkDesc6: Усиливание способности "Прямой Удар" теперь имеет Скорость III - beastMasteryPassiveTitle0: Пассивные жетоны - beastMasteryPassiveTitle1: Назад - beastMasteryPassiveTitle2: Жетоны умений - beastMasteryPassiveTitle3: Длительность "Прямого Удара" - beastMasteryPassiveTitle4: Критический укус - beastMasteryPassiveDesc0: Жетоны для прокачки пассивных умений (красители) - beastMasteryPassiveDesc1: Возвращает вас в главное меню навыков - beastMasteryPassiveDesc2: Жетоны для прокачки дерева умений - beastMasteryPassiveDesc3: Увеличивает длительность "Прямого Удара" на 0.02с - beastMasteryPassiveDesc4: Повышает шанс критического удара для собаки на 0.025% - swordsmanshipPerkTitle0: Адреналин - swordsmanshipPerkTitle1: Серия убийств - swordsmanshipPerkTitle2: Адреналин+ - swordsmanshipPerkTitle3: Убивающее безумие - swordsmanshipPerkTitle4: Жажда крови - swordsmanshipPerkTitle5: Резче! - swordsmanshipPerkTitle6: Мастерство меча - swordsmanshipPerkDesc0: Убийство враждебных мобов мечом дает +2с скорости за уровень - swordsmanshipPerkDesc1: Убийство враждебных мобов мечом дает +2с силы за уровень - swordsmanshipPerkDesc2: +20% баффа Скорости I от "Адреналина" теперь будет Скорость II - swordsmanshipPerkDesc3: +20% баффа Силы I от "Серии убийств" теперь будет Сила II - swordsmanshipPerkDesc4: Убийство некоторых агрессивных мобов мечом восстанавливает голод - swordsmanshipPerkDesc5: "\"Быстрые Удары\" теперь добавляют уровень Остроты вашему мечу" - swordsmanshipPerkDesc6: Мечи навсегда получают +1 к урону - swordsmanshipPassiveTitle0: Пассивные жетоны - swordsmanshipPassiveTitle1: Назад - swordsmanshipPassiveTitle2: Жетоны умений - swordsmanshipPassiveTitle3: Длительность "Быстрых Ударов" - swordsmanshipPassiveTitle4: Двойные удары - swordsmanshipPassiveDesc0: Жетоны для прокачки пассивных умений (красители) - swordsmanshipPassiveDesc1: Возвращает вас в главное меню навыков - swordsmanshipPassiveDesc2: Жетоны для прокачки дерева умений - swordsmanshipPassiveDesc3: Увеличивает длительность "Быстрых Ударов" на 0.02с - swordsmanshipPassiveDesc4: Увеличивает шанс ударить моба дважды (второй удар наносит 50% урона) на 0.02% - defensePerkTitle0: Целитель - defensePerkTitle1: Жесткость - defensePerkTitle2: Жесткий - defensePerkTitle3: Жесткость+ - defensePerkTitle4: Небесный дар - defensePerkTitle5: Сильные ноги - defensePerkTitle6: Крепкий - defensePerkDesc0: Дает +3с регенерации за уровень после убийства - defensePerkDesc1: +2% шанса получить Сопротивление урону I на 5с при ударе - defensePerkDesc2: "\"Твердое Тело\" снижает урон на 6.6% за уровень" - defensePerkDesc3: +2% шанса получить Сопротивление урону II на 5с при ударе - defensePerkDesc4: "\"Твердый Камень\" теперь дает 4 поглощающих сердца на время действия способности +1 минуту" - defensePerkDesc5: "\"Твердый Камень\" теперь дает Медленность I вместо Медленности IV" - defensePerkDesc6: +2 сердца навсегда - defensePassiveTitle0: Пассивные жетоны - defensePassiveTitle1: Назад - defensePassiveTitle2: Жетоны умений - defensePassiveTitle3: Длительность "Твердого Камня" - defensePassiveTitle4: Твердое Тело - defensePassiveTitle5: Двойной дроп (Враждебные мобы) - defensePassiveDesc0: Жетоны для прокачки пассивных умений (красители) - defensePassiveDesc1: Возвращает вас в главное меню навыков - defensePassiveDesc2: Жетоны для прокачки дерева умений - defensePassiveDesc3: Увеличивает длительность "Твердого Камня" на 0.02с - defensePassiveDesc4: Увеличивает шанс получить уменьшенный (базовый -33%) урон на 0.01% за уровень - defensePassiveDesc5: Увеличивает шанс получить двойной дроп с агрессивных мобов на 0.05% - axeMasteryPerkTitle0: Великий топор - axeMasteryPerkTitle1: Святой топор - axeMasteryPerkTitle2: Оживление - axeMasteryPerkTitle3: Кровь воина - axeMasteryPerkTitle4: Землетрясение - axeMasteryPerkTitle5: Улучшенные криты - axeMasteryPerkTitle6: Лесоруб - axeMasteryPerkDesc0: Радиус урона "Великого топора" увеличивается на 1 блок за уровень - axeMasteryPerkDesc1: +2% шанса поразить молние моба при ударе топором - axeMasteryPerkDesc2: +1% шанса на полное исцеление при убийстве за уровень - axeMasteryPerkDesc3: +3с за уровень Силы I при убийстве топором - axeMasteryPerkDesc4: AOE-урон способности удваивается (25% -> 50% урона) - axeMasteryPerkDesc5: "\"Улучшенные криты\" теперь имеют множитель 1.6x вместо 1.25" - axeMasteryPerkDesc6: Топоры навсегда получают +1 к урону - axeMasteryPassiveTitle0: Пассивные жетоны - axeMasteryPassiveTitle1: Назад - axeMasteryPassiveTitle2: Жетоны умений - axeMasteryPassiveTitle3: Длительность "Великого топора" - axeMasteryPassiveTitle4: Улучшенные криты - axeMasteryPassiveDesc0: Жетоны для прокачки пассивных умений (красители) - axeMasteryPassiveDesc1: Возвращает вас в главное меню навыков - axeMasteryPassiveDesc2: Жетоны для прокачки дерева умений - axeMasteryPassiveDesc3: Увеличивает длительность "Великого топора" на 0.02с - axeMasteryPassiveDesc4: Увеличивает шанс случайного критического удара (базовый урон 1.25x) на 0.01% - repairPerkTitle0: Утилизация - repairPerkTitle1: Находчивый - repairPerkTitle2: Мастерство магического ремонта - repairPerkDesc0: Получите больше материалов от утилизации - repairPerkDesc1: +10% шанса сохранить материал, использованный при ремонте - repairPerkDesc2: Гарантия сохранения чар при ремонте - repairPassiveTitle0: Назад - repairPassiveTitle1: Жетоны умений - repairPassiveTitle2: Знание - repairPassiveDesc0: Возвращает вас в главное меню навыков - repairPassiveDesc1: Жетоны для прокачки дерева умений - repairPassiveDesc2: Материалы восстанавливают больше прочности при ремонте - agilityPerkTitle0: Уклонение - agilityPerkTitle1: Стальные кости - agilityPerkTitle2: Изящные ноги - agilityPerkDesc0: +4% шанс уклониться от атак за уровень - agilityPerkDesc1: -10% урона от падения за уровень - agilityPerkDesc2: Постоянный бафф Скорости I (переключается с помощью /frpg speedToggle) - agilityPassiveTitle0: Назад - agilityPassiveTitle1: Жетоны умений - agilityPassiveTitle2: Кувырок - agilityPassiveDesc0: Возвращает вас в главное меню навыков - agilityPassiveDesc1: Жетоны для прокачки дерева умений - agilityPassiveDesc2: Шанс получить уменьшенный урон от падения - alchemyPerkTitle0: Алхимический призыв - alchemyPerkTitle1: Древнее знание - alchemyPerkTitle2: Мастер зелий - alchemyPerkDesc0: Позволяет создавать некоторые зелья без зельеварки - alchemyPerkDesc1: Открывает возможность варить новые зелья. - alchemyPerkDesc2: Уровень всех используемых зелий повышается на 1 (переключается с помощью /frpg togglePotion) - alchemyPassiveTitle0: Назад - alchemyPassiveTitle1: Жетоны умений - alchemyPassiveTitle2: Half-life+ - alchemyPassiveDesc0: Возвращает вас в главное меню навыков - alchemyPassiveDesc1: Жетоны для прокачки дерева умений - alchemyPassiveDesc2: Увеличивает длительность зелий при использовании - smeltingPerkTitle0: Эффективность топлива - smeltingPerkTitle1: Двойная выплавка - smeltingPerkTitle2: Огненная кирка - smeltingPerkDesc0: Топливо длится на +20% дольше за уровень - smeltingPerkDesc1: +5% шанса удвоить выплавленную руду за уровень - smeltingPerkDesc2: Добытая руда мгновенно плавится (переключается с помощью /frpg toggleFlamePick) - smeltingPassiveTitle0: Назад - smeltingPassiveTitle1: Жетоны умений - smeltingPassiveTitle2: Скорость подачи топлива - smeltingPassiveDesc0: Возвращает вас в главное меню навыков - smeltingPassiveDesc1: Жетоны для прокачки дерева умений - smeltingPassiveDesc2: Увеличение скорости приготовления - enchantingPerkTitle0: Эффективное наложение чар - enchantingPerkTitle1: Книжный магазин - enchantingPerkTitle2: Бессмертный опыт - enchantingPerkDesc0: Уровень, необходимый для зачарования -1 за уровень; ремонт на наковальне стоит на -1 (минимум 2) уровень опыта за уровень - enchantingPerkDesc1: Открывает крафт некоторых зачарованных книг - enchantingPerkDesc2: Сохраняйте опыт после смерти - enchantingPassiveTitle0: Назад - enchantingPassiveTitle1: Жетоны умений - enchantingPassiveTitle2: Более быстрое развитие - enchantingPassiveDesc0: Возвращает вас в главное меню навыков - enchantingPassiveDesc1: Жетоны для прокачки дерева умений - enchantingPassiveDesc2: Весь получаемый опыт увеличен - globalPerkTitle0: Собиратель - globalPerkTitle1: Ученый - globalPerkTitle2: Боец - globalPerkTitle3: Тяжелая работа - globalPerkTitle4: Исследование - globalPerkTitle5: Тренировка - globalPerkTitle6: Реинкарнация+ - globalPerkTitle7: Сбор душ - globalPerkTitle8: Аватар - globalPerkTitle9: Магистр искусств - globalPerkDesc0: +20% опыта за Копание, Добывание дерева, Шахтерство, Фермество и Рыбаловство - globalPerkDesc1: +20% опыта за Ремонт, Ловкость, Приготовление зелий, Выплавку и Зачарование - globalPerkDesc2: +20% опыта за Стрельбу из лука, Повелителя зверей, Фехтование, Защиту и Владения топором - globalPerkDesc3: +1 жетон умения ко всем умениям Собирателя - globalPerkDesc4: +1 sжетон умения ко всем умениям Ученого - globalPerkDesc5: +1 жетон умения ко всем умениям Бойца - globalPerkDesc6: 50% шанса сохранить сохранить часть каждого ценного предмета в вашем инвентаре после смерти - globalPerkDesc7: Теперь вы собираете души, убивая агрессивных мобов, которые можно использовать для возврата деревьев навыков - globalPerkDesc8: 10% шанс не получить урон и получить все игровые баффы на 10с при ударе, который обычно убивает вас - globalPerkDesc9: Время восстановления способностей уменьшено на 33% - globalPassiveTitle0: Глобальные жетоны - globalPassiveTitle1: Назад - globalPassiveDesc0: Жетоны для прокачки дерева умений - globalPassiveDesc1: Возвращает вас в главное меню навыков - cannotRepair: Вы не можете ремонтировать, пока активна эта способность! - cannotSalvage: Вы не можете утилизировать, пока активна эта способность! - spite: Все хорошее сделано назло - refundSkill: требуются для возврата дерева навыков - refundSkill2: ", чтобы вернуть дерево навыков" - needToUnlock: Вам нужно разблокировать - perkRequirement: Вам нужно как минимум 2 жетона навыков, вложенных в предыдущие перки, чтобы разблокировать этот перк - perkRequirementM: Вам необходимо как минимум 10 жетонов навыков, вложенных в дерево навыков, чтобы разблокировать этот перк мастерства - noSkillTokens: У вас нет жетонов навыков - noPassiveTokens: У вас нет пассивных токенов - maxedOutPerk: Этот навык максимально прокачан! - requiredGlobalPerks0: Чтобы разблокировать этот навык, вам понадобится предыдущий навык - requiredGlobalPerks1: необходимы для разблокировки этого навыка - requiredGlobalPerks2: требуется для разблокировки этого навыка - requiredGlobalPerks3: Вам нужны все глобальные навыки, чтобы разблокировать этот навык - craftRequirement: требуется для создания крафта! - roll: КУВЫРОК - dodge: УКЛОНЕНИЕ - prepare: Вы готовите - rest: Вы остановили подготовку - activated: активирована! - ended: закончилась - readyToUse: снова готова к использованию - cooldown: на перезарядке - rapidFire: Способность "Быстрый Огонь" - bow: лук(а) - greatAxe: Способность "Великий топор" - axe: топор(а) - spurKick: Способность "Прямой Удар" - leg: ногу(и) - stoneSoldier: Способность "Каменного Солдата" - yourself: себя - bigDig: Способность "Большое Копание" - shovel: лопату(ы) - naturalRegeneration: Способность "Натуральная Регенерация" - hoe: мотыгу(и) - superBait: Способность "Супер приманка" - fishingRod: удочку(и) - berserkPick: Способность "Кирка Берсерка" - pickaxe: кирку(и) - swiftStrikes: Способность "Быстрые Удары" - sword: меч(а) - timber: Способность "Лесоруб" - hyperHorse: Эта лошадь уже ускорена! - magicForce: Магическая сила лишает тебя способности - rob: Украсть - repairFail0: У вас недостаточно навыков, чтобы должным образом отремонтировать этот предмет - repairFail1: Вам не удалось утилизировать какие-либо материалы - repairFail2: Вам не удалось сохранить силу чар предмета - treeTooBig0: Это дерево слишком велико, чтобы срубить его за один раз! - treeTooBig1: Это дерево нельзя за один раз срубить... - noPermission: У вас нет разрешения на использование этой команды! - improperArguments: Неправильные аргументы, попробуйте - totalPlayTime: Общее время игры - clickForOptions: Нажмите, чтобы увидеть параметры - unknownCommand: Неизвестная команда - expToLevel: Опыта до следующего уровня - playerName: ник игрока - skillName: название навыка (на Английском) - page: страница - on0: "ВКЛ" - off0: "ВЫКЛ" - onOrOff: ВКЛ/ВЫКЛ - manuallyToggles: Переключает вручную - commandDesc0: Открывает основной меню со всеми навыками - commandDesc1: Открывает выбранное меню дерева навыков - commandDesc2: Открывает меню конфигурации - commandDesc3: Дает выбранному игроку опыт в указанном навыке - commandDesc4: Устанавливает уровень данного игрока в указанном навыке - commandDesc5: Сбрасывает статистику игрока в указанном навыке (без возврата статистики) - commandDesc6: Отображает таблицу лидеров для определенного показателя - commandDesc7: Предоставляет ссылку на страницу информации о плагине - commandDesc8: Попытки наложить чары на предмет в руке пользователя на определенном уровне - informationURL: Информационный URL (Google Docs) - click: НАЖМИТЕ - levelArgument: Аргумент уровня должен быть меньше 40 - leaderboard: Таблица лидеров - playerOffline: Этот игрок не в сети - onlyIncrease: Пожалуйста, увеличивайте опыт только с помощью этой команды, иначе используйте /frpg statReset, затем /frpg giveEXP - amount: количество - unlockToggle: Чтобы использовать эту команду, вы должны разблокировать - levelUpNotif: Уведомления о повышении уровня - abilityPreparationNotif: Уведомления о подготовке способностей - yes0: "ДА" - no0: "НЕТ" - warning: ПРЕДУПРЕЖДЕНИЕ - souls: души - refundSkillTree0: Стоимость возврата дерева навыков - refundSkillTree1: и необратимый, вы уверены, что хотите - refundSkillTree2: вернуть - skill: умение - backToSkillTree: Возвращает вас к дереву навыков - miningPerkDesc0_1: 2 секунды Спешки I после добычи любой руды - miningPerkDesc0_2: 5 секунд Спешки I после добычи любой руды - miningPerkDesc0_3: 10 секунд Спешки I после добычи любой руды - miningPerkDesc0_4: 5 секунд Спешки II после добычи любой руды, затем 5 секунд Спешки I - miningPerkDesc0_5: 10 секунд Спешки II после добычи любой руды - woodcuttingPerkDesc3_1: Листья теперь могут дропать - common: обычный - uncommon: необычный - rare: редкий - veryRare: очень редкий - legendary: легендарный - fishingPerkDesc1_1: Открывает уровень сокровищ - farmingPerkDesc1_1: Дает способность крафтить - cowSpawnEgg: яйцо призыва коровы - beeSpawnEgg: яйцо призыва пчелы - mooshroomSpawnEgg: яйцо призыва грибной коровы - horseSpawnEgg: яйцо призыва лошади - slimeSpawnEgg: яйцо призыва слизня - diggingPerkDesc0_1: Теперь вы можете выкопать - defensePerkDesc0_1: Дает +3с регенерации за уровень при убийстве - defensePerkDesc0_2: Дает +0.5 сердца за уровень мгновенно при убийствах - duration: Длительность - likelihood: Вероятность - junkChance: Шанс на мусор - locked: ЗАБЛОКИРОВАНО - unlocked: РАЗБЛОКИРОВАНО - cowEgg: Яйцо коровы - beeEgg: Яйцо пчелы - mooshroomEgg: Яйцо грибной коровы - horseEgg: Яйцо лошади - slimeEgg: Яйцо слизня - tippedArrows: Остроконечные стрелы - toggle: Переключить - refundSkillTitle: Возврат навыков - refundSkillTreeDesc: Нажмите, чтобы вернуть это дерево навыков - enchantingPerkDesc1_0: Открывает способность крафтить - enchantingPerkDesc1_1: Зачарованные книги Сила I и Эффективность I (создание стоит 1 уровень) - enchantingPerkDesc1_2: Зачарованные книги Острота I и Защита I (создание стоит 1 уровень) - enchantingPerkDesc1_3: Зачарованные книги Морская удача I и Приманка I (создание стоит 1 уровень) - enchantingPerkDesc1_4: Подводная ходьба I и Ледоход I зачаровали книги (создание стоит 1 уровень) - enchantingPerkDesc1_5: Зачарованные книги Починка (создание стоит 10 уровень) и Удача I (создание стоит 2 уровня) - repairPerkDesc0_1: Получите больше материалов от утилизации в среднем - repairPerkDesc0_2: В среднем вы получаете больше материалов при утилизации, теперь при утилизации зачарования предмета хранятся в книге - xpBoost: Увеличение опыта - speedBoost: Повышение скорости - timeExtension: Продление времени - enchantingCraft0: Книга Cилы I - enchantingCraft1: Книга Эффективность I - enchantingCraft2: Книга Острота I - enchantingCraft3: Книга Защита I - enchantingCraft4: Книга Морская удача I - enchantingCraft5: Книга Приманка I - enchantingCraft6: Книга Ледоход I - enchantingCraft7: Книга Подводная ходьба I - enchantingCraft8: Книга Починка - enchantingCraft9: Книга Удача I - commandDesc9: Устанавливает количество душ для указанного игрока - commandDesc10: Устанавливает количество жетонов навыков или пассивных жетонов в указанном навыке для указанного игрока - commandDesc11: Устанавливает Глобальные жетоны для указанного игрока - commandDesc12: Сохраняет статистику всех игроков или указанного игрока - status: СТАТУС - complete: ЗАВЕРШЕНО - incomplete: НЕ ЗАВЕРШЕНО - try0: "повторите" - passiveImprove: Ваши пассивные умения улучшаются с каждым уровнем! - increasedBy: увеличено на - expIncrease: Множитель опыта - personalMultiplier: Персональный множитель - translators: Переводчики - commandDesc13: Устанавливает персональный множитель для указанного игрока - abilityDescription: Описание способности - abilityDescription_digging: Временно увеличивает эффективность вашей лопаты на 5 уровней. Активируется щелчком правой кнопкой мыши по лопате, затем разрушением блока. - abilityDescription_woodcutting: Временно заставляет топоры ломать все дерево разрушением одного блока. Активируется щелчком правой кнопкой мыши по топору, затем разрушением бревна. - abilityDescription_mining: Временно увеличивает эффективность вашей кирки на 5 уровней. Активируется щелчком правой кнопкой мыши по кирке, затем разрушением блока. - abilityDescription_farming: Временно заставляет посевы, сломанные мотыгой, автоматически пересаживать. Активируется щелчком правой кнопкой мыши по мотыге, затем разрушением посева. - abilityDescription_fishing: Временно заставляет удочки мгновенно ловить рыбу. Активируется щелчком левой кнопки мыши удочкой по блоку, затем ловлей рыбы. - abilityDescription_archery: Временно заставляет все стрелы стрелять на максимальной скорости. Активируется щелчком левой кнопки мыши по луку, затем выстрелом. - abilityDescription_beastMastery: Временно увеличивает скорость вашей лошади. Активируется щелчком правой кнопкой мыши по лошади, а затем щелчком левой кнопкой мыши. - abilityDescription_swordsmanship: Временно убирает перезарядку атаки на мечах. Активируется щелчком правой кнопки мыши по мечу, затем ударом мечом по мобу. - abilityDescription_defense: Временно дает пользователю эффекты сопротивления к урону и замедления. Активируется щелчком правой кнопкой мыши пустой рукой, затем ударом по мобу. - abilityDescription_axeMastery: Временно заставляет топоры наносить урон всем мобам в определенном радиусе.Активируется щелчком правой кнопкой мыши по топору, затем ударом по мобу. - alchemyPerkDesc1_0: Открывает способность варить (зелья) - alchemyPerkDesc0_0: Верстак можно использовать для крафта (зелий) - triggerAbilities: Триггерные способности - showEXPBar: Показывать полосу опыта - disabledSkill: Этот навык отключен - skillConfigDesc: Переход в меню конфигурации для этого навыка - lvl: Ур. - exp: Опыт - potionAbsorption: Зелье Поглощения - potionBadOmen: Зелье Дурного предзнаменования - potionBlindess: Зелье Слепоты - potionConduitPower: Зелье Морской силы - potionResistance: Зелье Сопротивления к урону - potionDolphinsGrace: Зелье Грация дельфина - potionHaste: Зелье Спешки - potionFireResistance: Зелье Сопротивления огню - potionGlowing: Зелье Свечение - potionHarm: Зелье Вреда - potionHealing: Зелье Исцеления - potionHealthBoost: Зелье Повышения здоровья - potiontheHero: Зелье Героя - potionHunger: Зелье Голода - potionStrength: Зелье Силы - potionInvsibility: Зелье Невидимости - potionJump: Зелье Прыгучести - potionLuck: Зелье Удачи - potionNightVision: Зелье Ночного видения - potionRegeneration: Зелье Регенерации - potionSaturation: Зелье Насыщения - potionSlowness: Зелье Медлительности - potionFatigue: Зелье Усталости - potionSlowFalling: Зелье Медленного падения - potionSpeed: Зелье Скорости - potionBadLuck: Зелье Неудачи - potionWaterBreathing: Зелье Водного дыхания - potionWeakness: Зелье Слабости - potionDecay: Зелье Разрушение - potionAwkward: Неловкое зелье - potionUncraftable: Невозможное зелье - potionMundane: Земное зелье - potionTurtleMaster: Зелье Мастера черепах - potionThick: Густое зелье - potionWater: Бутылка с водой - ingredient: Ингредиент - usedToBrew: Используется для варки - costs: стоимость - xpLevel: Minecraft XP Уровень - xpLevels: Minecraft XP Уровни - craftXPRequirement: Для этого рецепта требуется не менее - bedGUI: Вы не можете использовать эту команду в кровати! - statsUpdated: Ваши характеристики были изменены, чтобы соответствовать новой кривой опыта. Все деревья навыков и пассивные навыки были сброшены. Все токены необходимо переиспользовать. - timeRemaining: Оставшееся время - numberOfAbilityTimersDisplayed: Количество отображаемых таймеров способностей - commandDesc14: Сбрасывает время восстановления умения до 0 секунд. - commandDesc15: Просмотр FreeRPG-статистики игрока - repairUnsafeEnchant: Этот предмет слишком мощный, чтобы его можно было ремонтировать - salvageUnsafeEnchant: Этот предмет слишком мощный, чтобы его можно было утилизировать - rank: Ранг - stats: статистика - outOf: из - playerNotInLeaderboard: Этого игрока нет ни в одной таблице лидеров - virtual: Виртуальный - commandDesc16: Изменяет FreeRPG множитель опыта игрока на указанную величину (положительный или отрицательный) + ruRU: #Translated by MoKotik, DevilPlay, Cr1stalz_ + languageName: Русский язык + englishLanguageName: Russian + translationCredit: Cr1stalz_, MoKotik, Devilplay + global: Глобальный уровень + digging: Копание + woodcutting: Добывание дерева + mining: Шахтерство + farming: Фермество + fishing: Рыбаловство + archery: Стрельба из лука + beastMastery: Повелитель зверей + swordsmanship: Фехтование + defense: Защита + axeMastery: Владение топором + repair: Ремонт + alchemy: Алхимия + agility: Ловкость + smelting: Выплавка + enchanting: Зачарование + information: Информация + configuration: Конфигурация + level: Уровень + experience: Опыт + toNext: к следующему + total: Всего + diggingPerkTitle0: Больше сокровищ + diggingPerkTitle1: Двойное сокровище + diggingPerkTitle2: Редкий дроп + diggingPerkTitle3: Похититель душ + diggingPerkTitle4: Поиск кремния + diggingPerkTitle5: Рыцарь лопаты + diggingPerkTitle6: Мега копание + diggingPerkDesc0: Расширяет таблицу выпадения сокровищ на 1 предмет за уровень + diggingPerkDesc1: +5% шанса выпадения двойного сокровища за уровень + diggingPerkDesc2: Расширяет таблицу выпадения дропа по предметам за уровень + diggingPerkDesc3: Выпадение сокровищ из песка душ на +5% больше за уровень + diggingPerkDesc4: Гравий дает 100% шанс выпадения кремня (переключается с помощью /frpg flintToggle) + diggingPerkDesc5: Лопата наносит двойной урон + diggingPerkDesc6: Теперь при использовании способности, вы разбиваете область 3x3 блока (20% от обычного количества сокровищ, когда оно активно) + diggingPassiveTitle0: Пассивные жетоны + diggingPassiveTitle1: Назад + diggingPassiveTitle2: Жетоны умений + diggingPassiveTitle3: Длительность "Большого Копания" + diggingPassiveTitle4: Шанс сокровища + diggingPassiveDesc0: Жетоны для прокачки пассивных умений (красители) + diggingPassiveDesc1: Возвращает вас в главное меню навыков + diggingPassiveDesc2: Жетоны для прокачки дерева умений + diggingPassiveDesc3: Увеличивает длительность "Большого Копания" на 0.02с + diggingPassiveDesc4: Увеличивает шанс выкопать сокровище на 0.005% + woodcuttingPerkTitle0: Ревностные корни + woodcuttingPerkTitle1: Свежие руки + woodcuttingPerkTitle2: Скрытое знание + woodcuttingPerkTitle3: Падающие листья + woodcuttingPerkTitle4: Древесина+ + woodcuttingPerkTitle5: Сдувание листьев + woodcuttingPerkTitle6: Всемогущий топор + woodcuttingPerkDesc0: +20% шанса для деревьев выдать 1 XP за уровень + woodcuttingPerkDesc1: +12с за уровень Спешки I, после первого сломанного бревна в течение 5 минут + woodcuttingPerkDesc2: Бревна дают +0.2% шанса за уровень дропнуть зачарованную книгу + woodcuttingPerkDesc3: Листья дают 1% шанс дропнуть +1 сокровище за уровень + woodcuttingPerkDesc4: Лимит разрушения дерева увеличен с 64 до 128 + woodcuttingPerkDesc5: Ломайте большую область листьев с помощью топора (переключается с помощью /frpg leafBlowerToggle) + woodcuttingPerkDesc6: Двойной дроп, Ревностные корни и Скрытое знание - теперь все применяется к бревнам (с половинной эффективностью) + woodcuttingPassiveTitle0: Пассивные жетоны + woodcuttingPassiveTitle1: Назад + woodcuttingPassiveTitle2: Жетоны умений + woodcuttingPassiveTitle3: Длительность "Лесоруба" + woodcuttingPassiveTitle4: Двойной дроп + woodcuttingPassiveDesc0: Жетоны для прокачки пассивных умений (красители) + woodcuttingPassiveDesc1: Возвращает вас в главное меню навыков + woodcuttingPassiveDesc2: Жетоны для прокачки дерева умений + woodcuttingPassiveDesc3: Увеличивает длительность "Лесоруба" на 0.02с + woodcuttingPassiveDesc4: Увеличивает шанс двойного дропа на 0.05% + miningPerkTitle0: Бесконечная Спешка + miningPerkTitle1: Больше бомб + miningPerkTitle2: Кладоискатель + miningPerkTitle3: Бомба-вояж + miningPerkTitle4: Копатель жил + miningPerkTitle5: Подрывник + miningPerkTitle6: Тройные неприятности + miningPerkDesc0: Дает Спешку после добычи руды для каждого уровня + miningPerkDesc1: При крафте TNT дается +1 доп. блок TNT за уровень + miningPerkDesc2: При использовании способности на камнях, +1% шанс выпадения руды за уровень (дополнительный опыт зарабатывается за выпавшую руду) + miningPerkDesc3: Увеличивает радиус взрыва TNT (при использовании зажигалки) на каждом уровне + miningPerkDesc4: Рудные жилы мгновенно добываются при разрушении одного блока (переключаемый) + miningPerkDesc5: Нету урона от взрывов TNT + miningPerkDesc6: Двойной дроп теперь тройной дроп + miningPassiveTitle0: Пассивные жетоны + miningPassiveTitle1: Назад + miningPassiveTitle2: Жетоны умений + miningPassiveTitle3: Длительность "Кирки Берсерка" + miningPassiveTitle4: Двойной дроп + miningPassiveTitle5: Взрывная добыча + miningPassiveDesc0: Жетоны для прокачки пассивных умений (красители) + miningPassiveDesc1: Возвращает вас в главное меню навыков + miningPassiveDesc2: Жетоны для прокачки дерева умений + miningPassiveDesc3: Увеличивает длительность "Кирки Берсерка" на 0.02с + miningPassiveDesc4: Увеличивает шанс получить двойной дроп из руды на 0.05% + miningPassiveDesc5: Повышает вероятность образования руды из взрывов TNT на 0.01% (Больше сломаных блоков = Больше драгоценностей) + farmingPerkTitle0: Лучшее удобрение + farmingPerkTitle1: Ферма животных + farmingPerkTitle2: Фермерская диета + farmingPerkTitle3: Плотоядный + farmingPerkTitle4: Садоводство + farmingPerkTitle5: Гормон роста + farmingPerkTitle6: Наедине с природой + farmingPerkDesc0: +10% шанса не потратить костную муку при использовании + farmingPerkDesc1: Можете создать больше яиц призыва с каждым уровнем + farmingPerkDesc2: Фермерская еда на 20% эффективнее восстанавливает голод и насыщение за уровень + farmingPerkDesc3: Мясо на 20% эффективнее восстанавливает голод и насыщение за уровень + farmingPerkDesc4: Возможность повторной посадки полностью выращенных культур, с более высокой вероятностью, пересадить на более более позднюю стадию роста; способность теперь действует на арбузы и тыквы + farmingPerkDesc5: Сахар можно использовать на детенышах животных, чтобы заставить их расти мгновенно + farmingPerkDesc6: Даёт Регенерацию I, когда Вы стоите на траве + farmingPassiveTitle0: Пассивные жетоны + farmingPassiveTitle1: Назад + farmingPassiveTitle2: Жетоны умений + farmingPassiveTitle3: Длительность "Натуральной регенерации" + farmingPassiveTitle4: Двойной дроп (Растительность) + farmingPassiveTitle5: Двойной дроп (Животные) + farmingPassiveDesc0: Жетоны для прокачки пассивных умений (красители) + farmingPassiveDesc1: Возвращает вас в главное меню навыков + farmingPassiveDesc2: Жетоны для прокачки дерева умений + farmingPassiveDesc3: Увеличивает длительность "Натуральной регенерации" на 0.02с + farmingPassiveDesc4: Увеличивает шанс получить двойной дроп из растительности на 0.05% + farmingPassiveDesc5: Увеличивает шанс получить двойной дроп с дружелюбных животных на 0.05% + fishingPerkTitle0: Счастливчик + fishingPerkTitle1: Мусорщик + fishingPerkTitle2: Рыбацкая диета + fishingPerkTitle3: Фильтрация + fishingPerkTitle4: Абордажный крюк + fishingPerkTitle5: Горячая удочка + fishingPerkTitle6: Русалка + fishingPerkDesc0: +15% шанса выбить предмет из моба за уровнем + fishingPerkDesc1: Открывает новый уровень рыболовных сокровищ + fishingPerkDesc2: Рыба восстанавливает +20% голода за уровень + fishingPerkDesc3: Добыча более высокого уровня (II-V) становится более распространенной, более низкого уровня (I) становится менее распространенной + fishingPerkDesc4: Удочка теперь действует как крюк для захвата (переключается с помощью /frpg grappleToggle) + fishingPerkDesc5: Рыба теперь готовится при ловле, некоторые рыболовные сокровища изменены (переключается с помощью /frpg hotRodToggle) + fishingPerkDesc6: Бесконечное ночное зрение под водой и бесконечная грация дельфина, когда находишься в воде + fishingPassiveTitle0: Пассивные жетоны + fishingPassiveTitle1: Назад + fishingPassiveTitle2: Жетоны умений + fishingPassiveTitle3: Длительность "Супер приманки" + fishingPassiveTitle4: Двойной улов + fishingPassiveTitle5: Искатель сокровищ + fishingPassiveDesc0: Жетоны для прокачки пассивных умений (красители) + fishingPassiveDesc1: Возвращает вас в главное меню навыков + fishingPassiveDesc2: Жетоны для прокачки дерева умений + fishingPassiveDesc3: Увеличивает длительность "Супер приманки" на 0.01с + fishingPassiveDesc4: Увеличивает шанс получить двойной дроп на 0.05% + fishingPassiveDesc5: Уменьшает шанс найти мусор на 0.005%, увеличивает шанс поиска сокровище на 0.005% + archeryPerkTitle0: Дополнительные стрелы + archeryPerkTitle1: Снайпер + archeryPerkTitle2: Стрелы света + archeryPerkTitle3: Взрывные стрелы + archeryPerkTitle4: Стрелы без дракона + archeryPerkTitle5: Быстрая зарядка арбалета + archeryPerkTitle6: Смертельный удар + archeryPerkDesc0: +1 стрела, получаемая от крафта, за уровень + archeryPerkDesc1: Скорость стрелы увеличивается на +2% за уровень (прибавка к урону на ~4% за уровень) + archeryPerkDesc2: Спектральные стрелы получают +5% к урону за уровень + archeryPerkDesc3: Стрелы имеют +1% шанса взорваться при попадании + archeryPerkDesc4: Позволяет создавать все стрелы с наконечниками из обычных зелий вместо туманных зелий + archeryPerkDesc5: Теперь способность можно использовать с арбалетами, чтобы все выстрелы производились мгновенно + archeryPerkDesc6: Выстрел фейерверком из арбалетов наносит двойной урон (до 16 урона) + archeryPassiveTitle0: Пассивные жетоны + archeryPassiveTitle1: Назад + archeryPassiveTitle2: Жетоны умений + archeryPassiveTitle3: Длительность "Быстрого Огня" + archeryPassiveTitle4: Кешбэк + archeryPassiveDesc0: Жетоны для прокачки пассивных умений (красители) + archeryPassiveDesc1: Возвращает вас в главное меню навыков + archeryPassiveDesc2: Жетоны для прокачки дерева умений + archeryPassiveDesc3: Увеличивает длительность "Быстрого Огня" на 0.02с + archeryPassiveDesc4: Увеличивает шанс для выстрела стрелы не потратив стрелу на 0.05% за уровень + beastMasteryPerkTitle0: Густой мех + beastMasteryPerkTitle1: Острые зубы + beastMasteryPerkTitle2: Полезные закуски + beastMasteryPerkTitle3: Держись подальше + beastMasteryPerkTitle4: Акро-Собака + beastMasteryPerkTitle5: Идентификация + beastMasteryPerkTitle6: Повышение адреналина + beastMasteryPerkDesc0: Собаки получают -10% урона за уровень + beastMasteryPerkDesc1: Собаки наносят на +10% больше урона за уровень + beastMasteryPerkDesc2: Собаки лечат +1/2 сердце за уровень от убийства + beastMasteryPerkDesc3: Собоки получают +5% шанса отбросить врагов + beastMasteryPerkDesc4: Собаки не получают урона от падения + beastMasteryPerkDesc5: При использовании компоса на лошаде или волке, отображается их статистика + beastMasteryPerkDesc6: Усиливание способности "Прямой Удар" теперь имеет Скорость III + beastMasteryPassiveTitle0: Пассивные жетоны + beastMasteryPassiveTitle1: Назад + beastMasteryPassiveTitle2: Жетоны умений + beastMasteryPassiveTitle3: Длительность "Прямого Удара" + beastMasteryPassiveTitle4: Критический укус + beastMasteryPassiveDesc0: Жетоны для прокачки пассивных умений (красители) + beastMasteryPassiveDesc1: Возвращает вас в главное меню навыков + beastMasteryPassiveDesc2: Жетоны для прокачки дерева умений + beastMasteryPassiveDesc3: Увеличивает длительность "Прямого Удара" на 0.02с + beastMasteryPassiveDesc4: Повышает шанс критического удара для собаки на 0.025% + swordsmanshipPerkTitle0: Адреналин + swordsmanshipPerkTitle1: Серия убийств + swordsmanshipPerkTitle2: Адреналин+ + swordsmanshipPerkTitle3: Убивающее безумие + swordsmanshipPerkTitle4: Жажда крови + swordsmanshipPerkTitle5: Резче! + swordsmanshipPerkTitle6: Мастерство меча + swordsmanshipPerkDesc0: Убийство враждебных мобов мечом дает +2с скорости за уровень + swordsmanshipPerkDesc1: Убийство враждебных мобов мечом дает +2с силы за уровень + swordsmanshipPerkDesc2: +20% баффа Скорости I от "Адреналина" теперь будет Скорость II + swordsmanshipPerkDesc3: +20% баффа Силы I от "Серии убийств" теперь будет Сила II + swordsmanshipPerkDesc4: Убийство некоторых агрессивных мобов мечом восстанавливает голод + swordsmanshipPerkDesc5: "\"Быстрые Удары\" теперь добавляют уровень Остроты вашему мечу" + swordsmanshipPerkDesc6: Мечи навсегда получают +1 к урону + swordsmanshipPassiveTitle0: Пассивные жетоны + swordsmanshipPassiveTitle1: Назад + swordsmanshipPassiveTitle2: Жетоны умений + swordsmanshipPassiveTitle3: Длительность "Быстрых Ударов" + swordsmanshipPassiveTitle4: Двойные удары + swordsmanshipPassiveDesc0: Жетоны для прокачки пассивных умений (красители) + swordsmanshipPassiveDesc1: Возвращает вас в главное меню навыков + swordsmanshipPassiveDesc2: Жетоны для прокачки дерева умений + swordsmanshipPassiveDesc3: Увеличивает длительность "Быстрых Ударов" на 0.02с + swordsmanshipPassiveDesc4: Увеличивает шанс ударить моба дважды (второй удар наносит 50% урона) на 0.02% + defensePerkTitle0: Целитель + defensePerkTitle1: Жесткость + defensePerkTitle2: Жесткий + defensePerkTitle3: Жесткость+ + defensePerkTitle4: Небесный дар + defensePerkTitle5: Сильные ноги + defensePerkTitle6: Крепкий + defensePerkDesc0: Дает +3с регенерации за уровень после убийства + defensePerkDesc1: +2% шанса получить Сопротивление урону I на 5с при ударе + defensePerkDesc2: "\"Твердое Тело\" снижает урон на 6.6% за уровень" + defensePerkDesc3: +2% шанса получить Сопротивление урону II на 5с при ударе + defensePerkDesc4: "\"Твердый Камень\" теперь дает 4 поглощающих сердца на время действия способности +1 минуту" + defensePerkDesc5: "\"Твердый Камень\" теперь дает Медленность I вместо Медленности IV" + defensePerkDesc6: +2 сердца навсегда + defensePassiveTitle0: Пассивные жетоны + defensePassiveTitle1: Назад + defensePassiveTitle2: Жетоны умений + defensePassiveTitle3: Длительность "Твердого Камня" + defensePassiveTitle4: Твердое Тело + defensePassiveTitle5: Двойной дроп (Враждебные мобы) + defensePassiveDesc0: Жетоны для прокачки пассивных умений (красители) + defensePassiveDesc1: Возвращает вас в главное меню навыков + defensePassiveDesc2: Жетоны для прокачки дерева умений + defensePassiveDesc3: Увеличивает длительность "Твердого Камня" на 0.02с + defensePassiveDesc4: Увеличивает шанс получить уменьшенный (базовый -33%) урон на 0.01% за уровень + defensePassiveDesc5: Увеличивает шанс получить двойной дроп с агрессивных мобов на 0.05% + axeMasteryPerkTitle0: Великий топор + axeMasteryPerkTitle1: Святой топор + axeMasteryPerkTitle2: Оживление + axeMasteryPerkTitle3: Кровь воина + axeMasteryPerkTitle4: Землетрясение + axeMasteryPerkTitle5: Улучшенные криты + axeMasteryPerkTitle6: Лесоруб + axeMasteryPerkDesc0: Радиус урона "Великого топора" увеличивается на 1 блок за уровень + axeMasteryPerkDesc1: +2% шанса поразить молние моба при ударе топором + axeMasteryPerkDesc2: +1% шанса на полное исцеление при убийстве за уровень + axeMasteryPerkDesc3: +3с за уровень Силы I при убийстве топором + axeMasteryPerkDesc4: AOE-урон способности удваивается (25% -> 50% урона) + axeMasteryPerkDesc5: "\"Улучшенные криты\" теперь имеют множитель 1.6x вместо 1.25" + axeMasteryPerkDesc6: Топоры навсегда получают +1 к урону + axeMasteryPassiveTitle0: Пассивные жетоны + axeMasteryPassiveTitle1: Назад + axeMasteryPassiveTitle2: Жетоны умений + axeMasteryPassiveTitle3: Длительность "Великого топора" + axeMasteryPassiveTitle4: Улучшенные криты + axeMasteryPassiveDesc0: Жетоны для прокачки пассивных умений (красители) + axeMasteryPassiveDesc1: Возвращает вас в главное меню навыков + axeMasteryPassiveDesc2: Жетоны для прокачки дерева умений + axeMasteryPassiveDesc3: Увеличивает длительность "Великого топора" на 0.02с + axeMasteryPassiveDesc4: Увеличивает шанс случайного критического удара (базовый урон 1.25x) на 0.01% + repairPerkTitle0: Утилизация + repairPerkTitle1: Находчивый + repairPerkTitle2: Мастерство магического ремонта + repairPerkDesc0: Получите больше материалов от утилизации + repairPerkDesc1: +10% шанса сохранить материал, использованный при ремонте + repairPerkDesc2: Гарантия сохранения чар при ремонте + repairPassiveTitle0: Назад + repairPassiveTitle1: Жетоны умений + repairPassiveTitle2: Знание + repairPassiveDesc0: Возвращает вас в главное меню навыков + repairPassiveDesc1: Жетоны для прокачки дерева умений + repairPassiveDesc2: Материалы восстанавливают больше прочности при ремонте + agilityPerkTitle0: Уклонение + agilityPerkTitle1: Стальные кости + agilityPerkTitle2: Изящные ноги + agilityPerkDesc0: +4% шанс уклониться от атак за уровень + agilityPerkDesc1: -10% урона от падения за уровень + agilityPerkDesc2: Постоянный бафф Скорости I (переключается с помощью /frpg speedToggle) + agilityPassiveTitle0: Назад + agilityPassiveTitle1: Жетоны умений + agilityPassiveTitle2: Кувырок + agilityPassiveDesc0: Возвращает вас в главное меню навыков + agilityPassiveDesc1: Жетоны для прокачки дерева умений + agilityPassiveDesc2: Шанс получить уменьшенный урон от падения + alchemyPerkTitle0: Алхимический призыв + alchemyPerkTitle1: Древнее знание + alchemyPerkTitle2: Мастер зелий + alchemyPerkDesc0: Позволяет создавать некоторые зелья без зельеварки + alchemyPerkDesc1: Открывает возможность варить новые зелья. + alchemyPerkDesc2: Уровень всех используемых зелий повышается на 1 (переключается с помощью /frpg togglePotion) + alchemyPassiveTitle0: Назад + alchemyPassiveTitle1: Жетоны умений + alchemyPassiveTitle2: Half-life+ + alchemyPassiveDesc0: Возвращает вас в главное меню навыков + alchemyPassiveDesc1: Жетоны для прокачки дерева умений + alchemyPassiveDesc2: Увеличивает длительность зелий при использовании + smeltingPerkTitle0: Эффективность топлива + smeltingPerkTitle1: Двойная выплавка + smeltingPerkTitle2: Огненная кирка + smeltingPerkDesc0: Топливо длится на +20% дольше за уровень + smeltingPerkDesc1: +5% шанса удвоить выплавленную руду за уровень + smeltingPerkDesc2: Добытая руда мгновенно плавится (переключается с помощью /frpg toggleFlamePick) + smeltingPassiveTitle0: Назад + smeltingPassiveTitle1: Жетоны умений + smeltingPassiveTitle2: Скорость подачи топлива + smeltingPassiveDesc0: Возвращает вас в главное меню навыков + smeltingPassiveDesc1: Жетоны для прокачки дерева умений + smeltingPassiveDesc2: Увеличение скорости приготовления + enchantingPerkTitle0: Эффективное наложение чар + enchantingPerkTitle1: Книжный магазин + enchantingPerkTitle2: Бессмертный опыт + enchantingPerkDesc0: Уровень, необходимый для зачарования -1 за уровень; ремонт на наковальне стоит на -1 (минимум 2) уровень опыта за уровень + enchantingPerkDesc1: Открывает крафт некоторых зачарованных книг + enchantingPerkDesc2: Сохраняйте опыт после смерти + enchantingPassiveTitle0: Назад + enchantingPassiveTitle1: Жетоны умений + enchantingPassiveTitle2: Более быстрое развитие + enchantingPassiveDesc0: Возвращает вас в главное меню навыков + enchantingPassiveDesc1: Жетоны для прокачки дерева умений + enchantingPassiveDesc2: Весь получаемый опыт увеличен + globalPerkTitle0: Собиратель + globalPerkTitle1: Ученый + globalPerkTitle2: Боец + globalPerkTitle3: Тяжелая работа + globalPerkTitle4: Исследование + globalPerkTitle5: Тренировка + globalPerkTitle6: Реинкарнация+ + globalPerkTitle7: Сбор душ + globalPerkTitle8: Аватар + globalPerkTitle9: Магистр искусств + globalPerkDesc0: +20% опыта за Копание, Добывание дерева, Шахтерство, Фермество и Рыбаловство + globalPerkDesc1: +20% опыта за Ремонт, Ловкость, Приготовление зелий, Выплавку и Зачарование + globalPerkDesc2: +20% опыта за Стрельбу из лука, Повелителя зверей, Фехтование, Защиту и Владения топором + globalPerkDesc3: +1 жетон умения ко всем умениям Собирателя + globalPerkDesc4: +1 sжетон умения ко всем умениям Ученого + globalPerkDesc5: +1 жетон умения ко всем умениям Бойца + globalPerkDesc6: 50% шанса сохранить сохранить часть каждого ценного предмета в вашем инвентаре после смерти + globalPerkDesc7: Теперь вы собираете души, убивая агрессивных мобов, которые можно использовать для возврата деревьев навыков + globalPerkDesc8: 10% шанс не получить урон и получить все игровые баффы на 10с при ударе, который обычно убивает вас + globalPerkDesc9: Время восстановления способностей уменьшено на 33% + globalPassiveTitle0: Глобальные жетоны + globalPassiveTitle1: Назад + globalPassiveDesc0: Жетоны для прокачки дерева умений + globalPassiveDesc1: Возвращает вас в главное меню навыков + cannotRepair: Вы не можете ремонтировать, пока активна эта способность! + cannotSalvage: Вы не можете утилизировать, пока активна эта способность! + spite: Все хорошее сделано назло + refundSkill: требуются для возврата дерева навыков + refundSkill2: ", чтобы вернуть дерево навыков" + needToUnlock: Вам нужно разблокировать + perkRequirement: Вам нужно как минимум 2 жетона навыков, вложенных в предыдущие перки, чтобы разблокировать этот перк + perkRequirementM: Вам необходимо как минимум 10 жетонов навыков, вложенных в дерево навыков, чтобы разблокировать этот перк мастерства + noSkillTokens: У вас нет жетонов навыков + noPassiveTokens: У вас нет пассивных токенов + maxedOutPerk: Этот навык максимально прокачан! + requiredGlobalPerks0: Чтобы разблокировать этот навык, вам понадобится предыдущий навык + requiredGlobalPerks1: необходимы для разблокировки этого навыка + requiredGlobalPerks2: требуется для разблокировки этого навыка + requiredGlobalPerks3: Вам нужны все глобальные навыки, чтобы разблокировать этот навык + craftRequirement: требуется для создания крафта! + roll: КУВЫРОК + dodge: УКЛОНЕНИЕ + prepare: Вы готовите + rest: Вы остановили подготовку + activated: активирована! + ended: закончилась + readyToUse: снова готова к использованию + cooldown: на перезарядке + rapidFire: Способность "Быстрый Огонь" + bow: лук(а) + greatAxe: Способность "Великий топор" + axe: топор(а) + spurKick: Способность "Прямой Удар" + leg: ногу(и) + stoneSoldier: Способность "Каменного Солдата" + yourself: себя + bigDig: Способность "Большое Копание" + shovel: лопату(ы) + naturalRegeneration: Способность "Натуральная Регенерация" + hoe: мотыгу(и) + superBait: Способность "Супер приманка" + fishingRod: удочку(и) + berserkPick: Способность "Кирка Берсерка" + pickaxe: кирку(и) + swiftStrikes: Способность "Быстрые Удары" + sword: меч(а) + timber: Способность "Лесоруб" + hyperHorse: Эта лошадь уже ускорена! + magicForce: Магическая сила лишает тебя способности + rob: Украсть + repairFail0: У вас недостаточно навыков, чтобы должным образом отремонтировать этот предмет + repairFail1: Вам не удалось утилизировать какие-либо материалы + repairFail2: Вам не удалось сохранить силу чар предмета + treeTooBig0: Это дерево слишком велико, чтобы срубить его за один раз! + treeTooBig1: Это дерево нельзя за один раз срубить... + noPermission: У вас нет разрешения на использование этой команды! + improperArguments: Неправильные аргументы, попробуйте + totalPlayTime: Общее время игры + clickForOptions: Нажмите, чтобы увидеть параметры + unknownCommand: Неизвестная команда + expToLevel: Опыта до следующего уровня + playerName: ник игрока + skillName: название навыка (на Английском) + page: страница + on0: "ВКЛ" + off0: "ВЫКЛ" + onOrOff: ВКЛ/ВЫКЛ + manuallyToggles: Переключает вручную + commandDesc0: Открывает основной меню со всеми навыками + commandDesc1: Открывает выбранное меню дерева навыков + commandDesc2: Открывает меню конфигурации + commandDesc3: Дает выбранному игроку опыт в указанном навыке + commandDesc4: Устанавливает уровень данного игрока в указанном навыке + commandDesc5: Сбрасывает статистику игрока в указанном навыке (без возврата статистики) + commandDesc6: Отображает таблицу лидеров для определенного показателя + commandDesc7: Предоставляет ссылку на страницу информации о плагине + commandDesc8: Попытки наложить чары на предмет в руке пользователя на определенном уровне + informationURL: Информационный URL (Google Docs) + click: НАЖМИТЕ + levelArgument: Аргумент уровня должен быть меньше 40 + leaderboard: Таблица лидеров + playerOffline: Этот игрок не в сети + onlyIncrease: Пожалуйста, увеличивайте опыт только с помощью этой команды, иначе используйте /frpg statReset, затем /frpg giveEXP + amount: количество + unlockToggle: Чтобы использовать эту команду, вы должны разблокировать + levelUpNotif: Уведомления о повышении уровня + abilityPreparationNotif: Уведомления о подготовке способностей + yes0: "ДА" + no0: "НЕТ" + warning: ПРЕДУПРЕЖДЕНИЕ + souls: души + refundSkillTree0: Стоимость возврата дерева навыков + refundSkillTree1: и необратимый, вы уверены, что хотите + refundSkillTree2: вернуть + skill: умение + backToSkillTree: Возвращает вас к дереву навыков + miningPerkDesc0_1: 2 секунды Спешки I после добычи любой руды + miningPerkDesc0_2: 5 секунд Спешки I после добычи любой руды + miningPerkDesc0_3: 10 секунд Спешки I после добычи любой руды + miningPerkDesc0_4: 5 секунд Спешки II после добычи любой руды, затем 5 секунд Спешки I + miningPerkDesc0_5: 10 секунд Спешки II после добычи любой руды + woodcuttingPerkDesc3_1: Листья теперь могут дропать + common: обычный + uncommon: необычный + rare: редкий + veryRare: очень редкий + legendary: легендарный + fishingPerkDesc1_1: Открывает уровень сокровищ + farmingPerkDesc1_1: Дает способность крафтить + cowSpawnEgg: яйцо призыва коровы + beeSpawnEgg: яйцо призыва пчелы + mooshroomSpawnEgg: яйцо призыва грибной коровы + horseSpawnEgg: яйцо призыва лошади + slimeSpawnEgg: яйцо призыва слизня + diggingPerkDesc0_1: Теперь вы можете выкопать + defensePerkDesc0_1: Дает +3с регенерации за уровень при убийстве + defensePerkDesc0_2: Дает +0.5 сердца за уровень мгновенно при убийствах + duration: Длительность + likelihood: Вероятность + junkChance: Шанс на мусор + locked: ЗАБЛОКИРОВАНО + unlocked: РАЗБЛОКИРОВАНО + cowEgg: Яйцо коровы + beeEgg: Яйцо пчелы + mooshroomEgg: Яйцо грибной коровы + horseEgg: Яйцо лошади + slimeEgg: Яйцо слизня + tippedArrows: Остроконечные стрелы + toggle: Переключить + refundSkillTitle: Возврат навыков + refundSkillTreeDesc: Нажмите, чтобы вернуть это дерево навыков + enchantingPerkDesc1_0: Открывает способность крафтить + enchantingPerkDesc1_1: Зачарованные книги Сила I и Эффективность I (создание стоит 1 уровень) + enchantingPerkDesc1_2: Зачарованные книги Острота I и Защита I (создание стоит 1 уровень) + enchantingPerkDesc1_3: Зачарованные книги Морская удача I и Приманка I (создание стоит 1 уровень) + enchantingPerkDesc1_4: Подводная ходьба I и Ледоход I зачаровали книги (создание стоит 1 уровень) + enchantingPerkDesc1_5: Зачарованные книги Починка (создание стоит 10 уровень) и Удача I (создание стоит 2 уровня) + repairPerkDesc0_1: Получите больше материалов от утилизации в среднем + repairPerkDesc0_2: В среднем вы получаете больше материалов при утилизации, теперь при утилизации зачарования предмета хранятся в книге + xpBoost: Увеличение опыта + speedBoost: Повышение скорости + timeExtension: Продление времени + enchantingCraft0: Книга Cилы I + enchantingCraft1: Книга Эффективность I + enchantingCraft2: Книга Острота I + enchantingCraft3: Книга Защита I + enchantingCraft4: Книга Морская удача I + enchantingCraft5: Книга Приманка I + enchantingCraft6: Книга Ледоход I + enchantingCraft7: Книга Подводная ходьба I + enchantingCraft8: Книга Починка + enchantingCraft9: Книга Удача I + commandDesc9: Устанавливает количество душ для указанного игрока + commandDesc10: Устанавливает количество жетонов навыков или пассивных жетонов в указанном навыке для указанного игрока + commandDesc11: Устанавливает Глобальные жетоны для указанного игрока + commandDesc12: Сохраняет статистику всех игроков или указанного игрока + status: СТАТУС + complete: ЗАВЕРШЕНО + incomplete: НЕ ЗАВЕРШЕНО + try0: "повторите" + passiveImprove: Ваши пассивные умения улучшаются с каждым уровнем! + increasedBy: увеличено на + expIncrease: Множитель опыта + personalMultiplier: Персональный множитель + translators: Переводчики + commandDesc13: Устанавливает персональный множитель для указанного игрока + abilityDescription: Описание способности + abilityDescription_digging: Временно увеличивает эффективность вашей лопаты на 5 уровней. Активируется щелчком правой кнопкой мыши по лопате, затем разрушением блока. + abilityDescription_woodcutting: Временно заставляет топоры ломать все дерево разрушением одного блока. Активируется щелчком правой кнопкой мыши по топору, затем разрушением бревна. + abilityDescription_mining: Временно увеличивает эффективность вашей кирки на 5 уровней. Активируется щелчком правой кнопкой мыши по кирке, затем разрушением блока. + abilityDescription_farming: Временно заставляет посевы, сломанные мотыгой, автоматически пересаживать. Активируется щелчком правой кнопкой мыши по мотыге, затем разрушением посева. + abilityDescription_fishing: Временно заставляет удочки мгновенно ловить рыбу. Активируется щелчком левой кнопки мыши удочкой по блоку, затем ловлей рыбы. + abilityDescription_archery: Временно заставляет все стрелы стрелять на максимальной скорости. Активируется щелчком левой кнопки мыши по луку, затем выстрелом. + abilityDescription_beastMastery: Временно увеличивает скорость вашей лошади. Активируется щелчком правой кнопкой мыши по лошади, а затем щелчком левой кнопкой мыши. + abilityDescription_swordsmanship: Временно убирает перезарядку атаки на мечах. Активируется щелчком правой кнопки мыши по мечу, затем ударом мечом по мобу. + abilityDescription_defense: Временно дает пользователю эффекты сопротивления к урону и замедления. Активируется щелчком правой кнопкой мыши пустой рукой, затем ударом по мобу. + abilityDescription_axeMastery: Временно заставляет топоры наносить урон всем мобам в определенном радиусе.Активируется щелчком правой кнопкой мыши по топору, затем ударом по мобу. + alchemyPerkDesc1_0: Открывает способность варить (зелья) + alchemyPerkDesc0_0: Верстак можно использовать для крафта (зелий) + triggerAbilities: Триггерные способности + showEXPBar: Показывать полосу опыта + disabledSkill: Этот навык отключен + skillConfigDesc: Переход в меню конфигурации для этого навыка + lvl: Ур. + exp: Опыт + potionAbsorption: Зелье Поглощения + potionBadOmen: Зелье Дурного предзнаменования + potionBlindess: Зелье Слепоты + potionConduitPower: Зелье Морской силы + potionResistance: Зелье Сопротивления к урону + potionDolphinsGrace: Зелье Грация дельфина + potionHaste: Зелье Спешки + potionFireResistance: Зелье Сопротивления огню + potionGlowing: Зелье Свечение + potionHarm: Зелье Вреда + potionHealing: Зелье Исцеления + potionHealthBoost: Зелье Повышения здоровья + potiontheHero: Зелье Героя + potionHunger: Зелье Голода + potionStrength: Зелье Силы + potionInvsibility: Зелье Невидимости + potionJump: Зелье Прыгучести + potionLuck: Зелье Удачи + potionNightVision: Зелье Ночного видения + potionRegeneration: Зелье Регенерации + potionSaturation: Зелье Насыщения + potionSlowness: Зелье Медлительности + potionFatigue: Зелье Усталости + potionSlowFalling: Зелье Медленного падения + potionSpeed: Зелье Скорости + potionBadLuck: Зелье Неудачи + potionWaterBreathing: Зелье Водного дыхания + potionWeakness: Зелье Слабости + potionDecay: Зелье Разрушение + potionAwkward: Неловкое зелье + potionUncraftable: Невозможное зелье + potionMundane: Земное зелье + potionTurtleMaster: Зелье Мастера черепах + potionThick: Густое зелье + potionWater: Бутылка с водой + ingredient: Ингредиент + usedToBrew: Используется для варки + costs: стоимость + xpLevel: Minecraft XP Уровень + xpLevels: Minecraft XP Уровни + craftXPRequirement: Для этого рецепта требуется не менее + bedGUI: Вы не можете использовать эту команду в кровати! + statsUpdated: Ваши характеристики были изменены, чтобы соответствовать новой кривой опыта. Все деревья навыков и пассивные навыки были сброшены. Все токены необходимо переиспользовать. + timeRemaining: Оставшееся время + numberOfAbilityTimersDisplayed: Количество отображаемых таймеров способностей + commandDesc14: Сбрасывает время восстановления умения до 0 секунд. + commandDesc15: Просмотр FreeRPG-статистики игрока + repairUnsafeEnchant: Этот предмет слишком мощный, чтобы его можно было ремонтировать + salvageUnsafeEnchant: Этот предмет слишком мощный, чтобы его можно было утилизировать + rank: Ранг + stats: статистика + outOf: из + playerNotInLeaderboard: Этого игрока нет ни в одной таблице лидеров + virtual: Виртуальный + commandDesc16: Изменяет FreeRPG множитель опыта игрока на указанную величину (положительный или отрицательный) - ptBR: #Translated by gbuueno - languageName: Porutgues Brazil - englishLanguageName: Portuguese - translationCredit: gbuueno - global: Global - digging: Escavação - woodcutting: Corte de madeira - mining: Mineração - farming: Agricultura - fishing: Pescaria - archery: Tiro com arco - beastMastery: Domínio da Besta - swordsmanship: Esgrima - defense: Defesa - axeMastery: Maestria de machado - repair: Reparar - alchemy: Alquimia - agility: Agilidade - smelting: Fundição - enchanting: Encantadora - information: Em formação - configuration: Configuração - level: Level - experience: Experiência - toNext: para a próxima - total: Total - diggingPerkTitle0: Mo' drops - diggingPerkTitle1: Tesouro duplo - diggingPerkTitle2: Drops raros - diggingPerkTitle3: Ladrão de almas - diggingPerkTitle4: Localizador de flint - diggingPerkTitle5: Cavaleiro da pá - diggingPerkTitle6: Mega Dig - diggingPerkDesc0: Expande a tabela de queda de tesouro em 1 item por nível - diggingPerkDesc1: + 5% de chance de receber o dobro da queda de tesouro por nível (quando - tesouro é rolado) - diggingPerkDesc2: Expande ainda mais a tabela suspensa por item por nível - diggingPerkDesc3: A areia da alma tem 5% a mais de probabilidade de soltar tesouros por nível - diggingPerkDesc4: Cascalho tem 100% de taxa de queda de pederneira (alternável por /flintToggle) - diggingPerkDesc5: Pás causam dano duplo - diggingPerkDesc6: Ao usar a habilidade, você agora quebra uma seção de bloqueio 3x3 (20% de - taxa de tesouro normal quando ativo) - diggingPassiveTitle0: Tokens passivos - diggingPassiveTitle1: Voltar - diggingPassiveTitle2: Tokens de habilidade - diggingPassiveTitle3: Duração do Big Dig - diggingPassiveTitle4: Chance de tesouro - diggingPassiveDesc0: Tokens para investir em habilidades passivas (corantes) - diggingPassiveDesc1: Leva você de volta ao menu principal de habilidades - diggingPassiveDesc2: Tokens para investir na árvore de habilidades - diggingPassiveDesc3: Aumenta a duração da Big Dig em 0,02 s - diggingPassiveDesc4: Aumenta a chance de desenterrar tesouros em 0,005% - woodcuttingPerkTitle0: Raizes Zelosas - woodcuttingPerkTitle1: Armas frescas - woodcuttingPerkTitle2: Conhecimento Oculto - woodcuttingPerkTitle3: Leaf Scavenger - woodcuttingPerkTitle4: Madeira + - woodcuttingPerkTitle5: Soprador de folhas - woodcuttingPerkTitle6: Machado capaz - woodcuttingPerkDesc0: + 20% de chance de os logs caírem 1 XP por nível - woodcuttingPerkDesc1: +12 s por nível de Haste I após o primeiro log quebrado em 5 minutos - woodcuttingPerkDesc2: Logs têm + 0,2% de chance por nível de derrubar um encantado - livro - woodcuttingPerkDesc3: As folhas têm 1% de chance de soltar +1 item de tesouro por nível - woodcuttingPerkDesc4: O limite de quebra de madeira aumentou de 64 para 128 - woodcuttingPerkDesc5: Quebre uma grande seção de folhas usando um machado (alternável com / leafBlowerToggle) - woodcuttingPerkDesc6: Gotas duplas, raízes zelosas e conhecimento oculto, tudo agora - aplicar à madeira (com metade da eficácia) - woodcuttingPassiveTitle0: Tokens passivos - woodcuttingPassiveTitle1: Voltar - woodcuttingPassiveTitle2: Tokens de habilidade - woodcuttingPassiveTitle3: Timber Duration - woodcuttingPassiveTitle4: Drops duplos - woodcuttingPassiveDesc0: Tokens para investir em habilidades passivas (corantes) - woodcuttingPassiveDesc1: Leva você de volta ao menu principal de habilidades - woodcuttingPassiveDesc2: Tokens para investir na árvore de habilidades - woodcuttingPassiveDesc3: Aumenta a duração da madeira em 0,02 s - woodcuttingPassiveDesc4: Aumenta a chance de receber uma queda dupla em 0,05% - miningPerkTitle0: Pressa inútil - miningPerkTitle1: Mmis bombas - miningPerkTitle2: Caçadora de tesouros - miningPerkTitle3: Viagem de bomba - miningPerkTitle4: Veia mineira - miningPerkTitle5: Homem de demolição - miningPerkTitle6: Problema triplo - miningPerkDesc0: Ganhe pressa após minerar minérios para cada nível - miningPerkDesc1: A receita de criação para TNT produz +1 bloco de TNT por nível - miningPerkDesc2: Ao usar a habilidade em pedras, + 1% por nível de chance de um minério - para descartar (exp extra é ganho com minérios descartados) - miningPerkDesc3: Aumenta o raio de explosão TNT (quando iluminado por sílex e aço) cada - nível - miningPerkDesc4: Os veios de minério são extraídos instantaneamente ao quebrar um bloco (comutável) - miningPerkDesc5: Nenhum dano é causado por explosões TNT - miningPerkDesc6: Quedas duplas agora são quedas triplas - miningPassiveTitle0: Tokens passivos - miningPassiveTitle1: Voltar - miningPassiveTitle2: Tokens de habilidade - miningPassiveTitle3: Duração da escolha furiosa - miningPassiveTitle4: Drops duplos - miningPassiveTitle5: Explosão de mineração - miningPassiveDesc0: Tokens para investir em habilidades passivas (corantes) - miningPassiveDesc1: Leva você de volta ao menu principal de habilidades - miningPassiveDesc2: Tokens para investir na árvore de habilidades - miningPassiveDesc3: Aumenta a duração do Berserk Pick em 0,02s - miningPassiveDesc4: Aumenta a chance de receber uma queda dupla de minérios em 0,05% - miningPassiveDesc5: Aumenta as chances de o minério ser criado a partir de explosões de TNT - em 0,01% (mais blocos quebrados = mais rolos de tesouro) - farmingPerkTitle0: Melhor Fertilizante - farmingPerkTitle1: Fazenda de animais - farmingPerkTitle2: Dieta do Fazendeiro - farmingPerkTitle3: Carnívoro - farmingPerkTitle4: Polegar verde - farmingPerkTitle5: Hormônios de crescimento - farmingPerkTitle6: Um com a natureza - farmingPerkDesc0: + 10% de chance de não consumir farinha de osso durante o uso - farmingPerkDesc1: Pode criar um ovo de desova adicional por nível - farmingPerkDesc2: Alimentos agrícolas são 20% mais eficazes para restaurar a fome e a saturação - por nível - farmingPerkDesc3: A carne é 20% mais eficaz em restaurar a fome e a saturação - por nível - farmingPerkDesc4: A habilidade pode replantar safras totalmente crescidas com maior chance de - replantio em estágios posteriores de crescimento; habilidade agora afeta melões e abóboras - farmingPerkDesc5: O açúcar pode ser usado em animais bebês para fazê-los crescer instantaneamente - farmingPerkDesc6: Ganhe Regeneração I ao ficar parado na grama - farmingPassiveTitle0: Tokens passivos - farmingPassiveTitle1: Voltar - farmingPassiveTitle2: Tokens de habilidade - farmingPassiveTitle3: Duração da regeneração natural - farmingPassiveTitle4: Drops duplos (Cultivo) - farmingPassiveTitle5: Drops duplos (Animais) - farmingPassiveDesc0: Tokens para investir em habilidades passivas (corantes) - farmingPassiveDesc1: Leva você de volta ao menu principal de habilidades - farmingPassiveDesc2: Tokens para investir na árvore de habilidades - farmingPassiveDesc3: Aumenta a duração da regeneração natural em 0,02s - farmingPassiveDesc4: Aumenta a chance de receber uma queda dupla das safras em 0,05% - farmingPassiveDesc5: Aumenta a chance de receber uma queda dupla da maioria dos passivos - animais em 0,05% - fishingPerkTitle0: Roubar - fishingPerkTitle1: Carniceiro - fishingPerkTitle2: Dieta do Pescador - fishingPerkTitle3: Filtração - fishingPerkTitle4: Gancho - fishingPerkTitle5: Vara de pesca quente - fishingPerkTitle6: Pessoa Peixe - fishingPerkDesc0: + 15% de chance de retirar o item de um mob por nível - fishingPerkDesc1: Desbloqueia nova camada de tesouro de pesca - fishingPerkDesc2: Restauração de peixes + 20% de fome por nível - fishingPerkDesc3: Loot de nível superior (II-V) torna-se mais comum, nível inferior (I) - torna-se menos comum - fishingPerkDesc4: Vara de pesca agora atua como um gancho (alternável com / grappleToggle - ) - fishingPerkDesc5: Os peixes agora são cozidos quando pescados, alguns tesouros de pesca são - alterado (alternável com /hotRodToggle) - fishingPerkDesc6: Visão noturna infinita quando debaixo d'água, graça infinita do golfinho - quando na água - fishingPassiveTitle0: Tokens passivos - fishingPassiveTitle1: Voltar - fishingPassiveTitle2: Tokens de habilidade - fishingPassiveTitle3: Super duração da isca - fishingPassiveTitle4: Pegadas duplas - fishingPassiveTitle5: Descobridor de tesouro - fishingPassiveDesc0: Tokens para investir em habilidades passivas (corantes) - fishingPassiveDesc1: Leva você de volta ao menu principal de habilidades - fishingPassiveDesc2: Tokens para investir na árvore de habilidades - fishingPassiveDesc3: Aumenta a duração do Super Bait em 0,01s - fishingPassiveDesc4: Aumenta a chance de receber uma queda dupla em 0,05% - fishingPassiveDesc5: Diminui a chance de encontrar lixo em 0,005%, aumenta a chance - de encontrar tesouros em 0,005% - archeryPerkTitle0: Flechas extras - archeryPerkTitle1: Franco-atirador - archeryPerkTitle2: Flecha de luz - archeryPerkTitle3: Flehas Explosivas - archeryPerkTitle4: Flecha Dragon-less - archeryPerkTitle5: Carga rápida de besta - archeryPerkTitle6: Golpe Mortal - archeryPerkDesc0: +1 flecha obtida na fabricação por nível - archeryPerkDesc1: A velocidade da flecha aumenta em + 2% por nível (~ 4% de aumento de dano / nível) - archeryPerkDesc2: Flechas espectrais recebem um aumento de dano de + 5% por nível - archeryPerkDesc3: As flechas têm + 1% de criação de uma explosão ao acertar - archeryPerkDesc4: Permite a fabricação de todas as flechas com pontas com poções regulares - de poções persistentes - archeryPerkDesc5: A habilidade agora pode ser usada com bestas, fazendo com que todos os tiros sejam carregados - imediatamente - archeryPerkDesc6: Fogos de artifício disparados de bestas causam dano duplo (até 16 corações - de dano) - archeryPassiveTitle0: Tokens passivos - archeryPassiveTitle1: Voltar - archeryPassiveTitle2: Tokens de habilidade - archeryPassiveTitle3: Duração rápida do fogo - archeryPassiveTitle4: Recuperação - archeryPassiveDesc0: Tokens para investir em habilidades passivas (corantes) - archeryPassiveDesc1: Leva você de volta ao menu principal de habilidades - archeryPassiveDesc2: Tokens para investir na árvore de habilidades - archeryPassiveDesc3: Aumenta a duração do Fogo Rápido em 0,02s - archeryPassiveDesc4: Aumenta a chance de o tiro de flecha não consumir a flecha em 0,05% - por nível - beastMasteryPerkTitle0: Pelo Grosso - beastMasteryPerkTitle1: Dentes afiados - beastMasteryPerkTitle2: Mordidas saudáveis - beastMasteryPerkTitle3: Mantenha-se afastado - beastMasteryPerkTitle4: Acro-Cão - beastMasteryPerkTitle5: Identificar - beastMasteryPerkTitle6: Impulso de adrenalina - beastMasteryPerkDesc0: Os cães sofrem -10% de dano por nível - beastMasteryPerkDesc1: Os cães causam + 10% a mais de dano por nível - beastMasteryPerkDesc2: Os cães curam +1/2 de coração por nível de matar - beastMasteryPerkDesc3: Cães ganham + 5% de chance de derrubar inimigos Voltar - beastMasteryPerkDesc4: Os cães não sofrem danos de queda - beastMasteryPerkDesc5: Usar uma bússola em um cavalo ou lobo agora mostra suas estatísticas - beastMasteryPerkDesc6: Spur kick buff agora é velocidade III - beastMasteryPassiveTitle0: Tokens passivos - beastMasteryPassiveTitle1: Voltar - beastMasteryPassiveTitle2: Tokens de habilidade - beastMasteryPassiveTitle3: Duração do chute de esporão - beastMasteryPassiveTitle4: Mordida Crítica - beastMasteryPassiveDesc0: Tokens para investir em habilidades passivas (corantes) - beastMasteryPassiveDesc1: Leva você de volta ao menu principal de habilidades - beastMasteryPassiveDesc2: Tokens para investir na árvore de habilidades - beastMasteryPassiveDesc3: Aumenta a duração do Spur Kick em 0,02s - beastMasteryPassiveDesc4: Aumenta a chance de um cão ter um acerto crítico por - 0,025% - swordsmanshipPerkTitle0: Adrenalina - swordsmanshipPerkTitle1: Matança - swordsmanshipPerkTitle2: Adrenalina+ - swordsmanshipPerkTitle3: Frenesi mortal - swordsmanshipPerkTitle4: Sede de sangue - swordsmanshipPerkTitle5: Mais nítido! - swordsmanshipPerkTitle6: Maestria de espada - swordsmanshipPerkDesc0: Matar mobs hostis com uma espada fornece +2 s de velocidade - por nível - swordsmanshipPerkDesc1: Matar mobs hostis com uma espada fornece +2 s de força - por nível - swordsmanshipPerkDesc2: + 20% do buff de velocidade I da Adrenalina agora é velocidade II - swordsmanshipPerkDesc3: + 20% da força que eu buff de Killing Spree agora é força - II - swordsmanshipPerkDesc4: Matar certos mobs agressivos com uma espada restaura - fome - swordsmanshipPerkDesc5: Golpes rápidos agora adicionam um nível de nitidez à sua espada - swordsmanshipPerkDesc6: Espadas causam permanentemente +1 coração de dano - swordsmanshipPassiveTitle0: Tokens passivos - swordsmanshipPassiveTitle1: Voltar - swordsmanshipPassiveTitle2: Tokens de habilidade - swordsmanshipPassiveTitle3: Duração de ataques rápidos - swordsmanshipPassiveTitle4: Golpe duplo - swordsmanshipPassiveDesc0: Tokens para investir em habilidades passivas (corantes) - swordsmanshipPassiveDesc1: Leva você de volta ao menu principal de habilidades - swordsmanshipPassiveDesc2: Tokens para investir na árvore de habilidades - swordsmanshipPassiveDesc3: Aumenta a duração dos golpes rápidos em 0,02s - swordsmanshipPassiveDesc4: Aumenta a chance de acertar o mob duas vezes (o segundo acerto faz - 50% de dano) em 0,02% - defensePerkTitle0: Curador - defensePerkTitle1: Endurecer - defensePerkTitle2: Cabeça dura - defensePerkTitle3: Endurecer+ - defensePerkTitle4: Presente de cima - defensePerkTitle5: Pernas mais fortes - defensePerkTitle6: Forte - defensePerkDesc0: Ganhe + 3s de regeneração por nível ao matar - defensePerkDesc1: + 2% de chance de ganhar resistência I por 5s ao acertar - defensePerkDesc2: Corpo rígido diminui o dano em 6,6% adicionais por nível - defensePerkDesc3: + 2% de chance de ganhar resistência II por 5s ao acertar - defensePerkDesc4: Pedra Sólida agora concede 4 corações de absorção para comprimento de habilidade - +1 minuto - defensePerkDesc5: Pedra Sólida agora dá lentidão I em vez de lentidão IV - defensePerkDesc6: +2 corações permanentemente - defensePassiveTitle0: Tokens passivos - defensePassiveTitle1: Voltar - defensePassiveTitle2: Tokens de habilidade - defensePassiveTitle3: Duração da Pedra Sólida - defensePassiveTitle4: Corpo duro - defensePassiveTitle5: Drops duplos (Mobs Hostis) - defensePassiveDesc0: Tokens para investir em habilidades passivas (corantes) - defensePassiveDesc1: Leva você de volta ao menu principal de habilidades - defensePassiveDesc2: Tokens para investir na árvore de habilidades - defensePassiveDesc3: Aumenta a duração da Pedra Sólida em 0,02s - defensePassiveDesc4: Aumenta a chance de sofrer dano reduzido (base -33%) em 0,01% - por nível - defensePassiveDesc5: Aumenta a chance de receber Drops duplos de agressivo - mobs em 0,05% - axeMasteryPerkTitle0: Otimo machado - axeMasteryPerkTitle1: Machado sagrado - axeMasteryPerkTitle2: Revitalizado - axeMasteryPerkTitle3: Guerreiro sangue - axeMasteryPerkTitle4: Tremor de terra - axeMasteryPerkTitle5: Melhores créditos - axeMasteryPerkTitle6: Homem machado - axeMasteryPerkDesc0: O raio de dano do grande machado aumenta em 1 bloco por nível - axeMasteryPerkDesc1: + 2% de chance de iluminação para atingir mobs em um golpe de machado - axeMasteryPerkDesc2: + 1% de chance de cura total ao matar por nível - axeMasteryPerkDesc3: +3 s por nível de Força I em mortes com um machado - axeMasteryPerkDesc4: O dano AOE da habilidade é dobrado (25% -> 50% do dano) - axeMasteryPerkDesc5: Os Critos Divinos agora têm um multiplicador de 1,6x em vez de 1,25x - axeMasteryPerkDesc6: Machados causam permanentemente +1 de dano - axeMasteryPassiveTitle0: Tokens passivos - axeMasteryPassiveTitle1: Voltar - axeMasteryPassiveTitle2: Tokens de habilidade - axeMasteryPassiveTitle3: Duração do Grande Machado - axeMasteryPassiveTitle4: Critos Divinos - axeMasteryPassiveDesc0: Tokens para investir em habilidades passivas (corantes) - axeMasteryPassiveDesc1: Leva você de volta ao menu principal de habilidades - axeMasteryPassiveDesc2: Tokens para investir na árvore de habilidades - axeMasteryPassiveDesc3: Aumenta a duração do Grande Machado em 0,02s - axeMasteryPassiveDesc4: Aumenta a chance de crítico aleatório (base 1,25x de dano) em 0,01% - repairPerkTitle0: Salvando - repairPerkTitle1: Engenhoso - repairPerkTitle2: Maestria de reparo mágico - repairPerkDesc0: Obtenha mais materiais em média com a recuperação - repairPerkDesc1: + 10% de chance de manter o material usado durante o reparo - repairPerkDesc2: Garantido para manter os encantos em reparo - repairPassiveTitle0: Voltar - repairPassiveTitle1: Tokens de habilidade - repairPassiveTitle2: Competência - repairPassiveDesc0: Leva você de volta ao menu principal de habilidades - repairPassiveDesc1: Tokens para investir na árvore de habilidades - repairPassiveDesc2: Os materiais restauram mais durabilidade no reparo - agilityPerkTitle0: Esquiva - agilityPerkTitle1: Ossos de aço - agilityPerkTitle2: Pés graciosos - agilityPerkDesc0: + 4% de chance de esquivar de ataques por nível - agilityPerkDesc1: -10% de dano de queda por nível - agilityPerkDesc2: Velocidade permanente I buff (alternável por /speedToggle) - agilityPassiveTitle0: Voltar - agilityPassiveTitle1: Tokens de habilidade - agilityPassiveTitle2: Lista - agilityPassiveDesc0: Leva você de volta ao menu principal de habilidades - agilityPassiveDesc1: Tokens para investir na árvore de habilidades - agilityPassiveDesc2: Chance de rolar e receber dano de queda reduzido - alchemyPerkTitle0: Invocação Alquímica - alchemyPerkTitle1: Conhecimento Antigo - alchemyPerkTitle2: Mestre de Poções - alchemyPerkDesc0: Permite a elaboração de algumas poções sem um suporte de fermentação - alchemyPerkDesc1: Desbloqueia a capacidade de preparar novas poções - alchemyPerkDesc2: Todas as poções usadas são aumentadas de nível em 1 (alternável com - /togglePotion) - alchemyPassiveTitle0: Voltar - alchemyPassiveTitle1: Tokens de habilidade - alchemyPassiveTitle2: Meia vida+ - alchemyPassiveDesc0: Leva você de volta ao menu principais habilidades - alchemyPassiveDesc1: Tokens para investir na árvore de habilidades - alchemyPassiveDesc2: Aumento na duração das poções quando usadas - smeltingPerkTitle0: Eficiência do combustível - smeltingPerkTitle1: Cheiro duplo - smeltingPerkTitle2: Picareta em chamas - smeltingPerkDesc0: O combustível dura + 20% a mais por nível - smeltingPerkDesc1: + 5% de chance de o minério fundido dobrar por nível - smeltingPerkDesc2: Os minérios extraídos são fundidos instantaneamente (alternável com /toggleFlamePick) - smeltingPassiveTitle0: Voltar - smeltingPassiveTitle1: Tokens de habilidade - smeltingPassiveTitle2: Velocidade de Combustível - smeltingPassiveDesc0: Leva você de volta ao menu principal de habilidades - smeltingPassiveDesc1: Tokens para investir na árvore de habilidades - smeltingPassiveDesc2: Aumentando a velocidade de cozimento - enchantingPerkTitle0: Eficiente Encantador - enchantingPerkTitle1: Livro inteligente - enchantingPerkTitle2: Experiência Imortal - enchantingPerkDesc0: Níveis necessários para encantar -1 por nível, custos de reparo da bigorna - -1 (mínimo de 2) níveis de XP por nível - enchantingPerkDesc1: Desbloqueia a elaboração de receitas para alguns livros encantados - enchantingPerkDesc2: Mantenha xp na morte - enchantingPassiveTitle0: Voltar - enchantingPassiveTitle1: Tokens de habilidade - enchantingPassiveTitle2: Desenvolvimento mais rápido - enchantingPassiveDesc0: Leva você de volta ao menu principal de habilidades - enchantingPassiveDesc1: Tokens para investir na árvore de habilidades - enchantingPassiveDesc2: Todos os XP recebidos aumentaram - globalPerkTitle0: Coletor - globalPerkTitle1: Estudioso - globalPerkTitle2: Lutador - globalPerkTitle3: Trabalho duro - globalPerkTitle4: Pesquisa - globalPerkTitle5: Treinamento - globalPerkTitle6: Reencarnação+ - globalPerkTitle7: Colheita de Alma - globalPerkTitle8: Avatar - globalPerkTitle9: Mestre das artes - globalPerkDesc0: + 20% de exp ganho em escavação, corte de lenha, mineração, agricultura e - pescaria - globalPerkDesc1: + 20% de exp ganho em Reparo, Agilidade, Fabricação, Fundição e Encantamento - globalPerkDesc2: + 20% de exp ganho em arco e flecha, maestria de bestas, esgrima, defesa, - e maestria de machado - globalPerkDesc3: +1 token de habilidade em todas as habilidades de Coletor - globalPerkDesc4: +1 token de habilidade em todas as habilidades acadêmicas - globalPerkDesc5: +1 token de habilidade em todas as habilidades de lutador - globalPerkDesc6: Na morte, 50% de chance de manter alguns de cada item valioso em seu - estoques - globalPerkDesc7: Você agora colhe almas matando mobs agressivos, que podem - ser usado para reembolsar árvores de habilidade - globalPerkDesc8: 10% de chance de não sofrer nenhum dano e ganhar todos os buffs do jogo por 10s - em um golpe que normalmente te mataria - globalPerkDesc9: As habilidades de resfriamentos diminuíram 33% - globalPassiveTitle0: Tokens globais - globalPassiveTitle1: Voltar - globalPassiveDesc0: Tokens para investir na árvore de habilidades - globalPassiveDesc1: Leva você de volta ao menu principal de habilidades - cannotRepair: Você não pode reparar enquanto esta habilidade estiver ativa! - cannotSalvage: Você não pode salvar enquanto esta habilidade estiver ativa! - spite: Tudo de bom é feito de rancor - refundSkill: são obrigados a reembolsar uma árvore de habilidade - refundSkill2: a fim de reembolsar uma árvore de habilidade - needToUnlock: Você precisa desbloquear - perkRequirement: Você precisa de pelo menos 2 tokens de habilidade investidos nas vantagens anteriores para desbloquear esta vantagem - perkRequirementM: Você precisa de pelo menos 10 tokens de habilidade totais investidos na árvore de habilidades para desbloquear este privilégio de maestria - noSkillTokens: Você não tem nenhum Tokens de habilidade - noPassiveTokens: Você não tem nenhum Tokens passivo - maxedOutPerk: Você já atingiu o limite máximo deste benefício! - requiredGlobalPerks0: Você precisa do benefício anterior para desbloquear este benefício - requiredGlobalPerks1: são necessários para desbloquear este privilégio - requiredGlobalPerks2: é necessário para desbloquear este privilégio - requiredGlobalPerks3: Você precisa de todos os benefícios globais para desbloquear este benefício - craftRequirement: é necessário para criar esta receita! - roll: Lista - dodge: Esquiva - prepare: Você preparou o seu - rest: Você descansou seu - activated: Ativado! - ended: Voce terminou - readyToUse: Está pronto para usar novamente - cooldown: Esfriou - rapidFire: Fogo rápido - bow: Arco - greatAxe: Grande machado - axe: Machado - spurKick: Chute com espora - leg: Perna - stoneSoldier: Soldado de Pedra - yourself: Você mesmo - bigDig: Grande escavação - shovel: Pá - naturalRegeneration: Regeneração natural - hoe: Enxada - superBait: Super isca - fishingRod: Vara de pesca - berserkPick: Picareta Furiosa - pickaxe: Picareta - swiftStrikes: Ataques rápidos - sword: Espada - timber: Madeira - hyperHorse: Este cavalo já está hiper! - magicForce: Uma força mágica acaba com sua habilidade - rob: Roubar - repairFail0: Você não é qualificado o suficiente para reparar este item de forma adequada - repairFail1: Você falhou em salvar qualquer material - repairFail2: Você falhou em manter o poder de encantamento do item - treeTooBig0: Esta árvore é muito grande para você cortar de uma vez! " - treeTooBig1: Esta árvore nunca pode ser cortada de uma vez como esta ... - noPermission: Você não tem permissão para usar este comando! - improperArguments: Argumentos impróprios, tente - totalPlayTime: Tempo total de jogo - clickForOptions: Clique para opções - unknownCommand: Comando desconhecido - expToLevel: EXP para o próximo nível - playerName: nome do jogador - skillName: skillName (em inglês) - page: página - on0: "LIGADO" - off0: "DESLIGADO" - onOrOff: LIGADO/DESLIGADO - manuallyToggles: Alterna manualmente - commandDesc0: Abre a GUI principal com todas as habilidades - commandDesc1: Abre uma árvore de habilidade GUI de escolha - commandDesc2: Abre a GUI de configuração - commandDesc3: Dá a um jogador de escolha EXP em uma habilidade específica - commandDesc4: Define o nível de um determinado jogador em uma habilidade específica - commandDesc5: Redefine as estatísticas de um jogador em uma habilidade especificada (não reembolsa estatísticas) - commandDesc6: Exibe uma tabela de classificação para uma estatística especificada - commandDesc7: Fornece um link para uma página de informações do plugin - commandDesc8: Tenta encantar um item na mão do usuário em um nível especificado - informationURL: URL de informação (Google Docs) - click: CLIQUE - levelArgument: O argumento de nível deve ser inferior a 40 - leaderboard: Entre os melhores - playerOffline: Esse jogador não está online - onlyIncrease: Apenas aumente exp com este comando, caso contrário, use /frpg statReset e /frpg giveEXP - amount: montante - unlockToggle: Para usar este comando você deve desbloquear - levelUpNotif: Notificações de subida de nível - abilityPreparationNotif: Notificações de preparação de habilidade - yes0: "SIM" - no0: "NAO" - warning: ATENÇÃO - souls: almas - refundSkillTree0: Reembolsando os custos de uma árvore de habilidade - refundSkillTree1: e não é reversível, você tem certeza que quer - refundSkillTree2: devolver o - skill: habilidade - VoltarToSkillTree: Leva você de volta para a árvore de habilidade - miningPerkDesc0_1: 2 segundos de aceleração I após minerar qualquer minério - miningPerkDesc0_2: 5 segundos de aceleração I após a mineração de qualquer minério - miningPerkDesc0_3: 10 segundos de aceleração I após a mineração de qualquer minério - miningPerkDesc0_4: 5 segundos de Haste II após a mineração de qualquer minério, seguidos por 5 segundos de Haste I - miningPerkDesc0_5: 10 segundos de Haste II após a mineração de qualquer minério - woodcuttingPerkDesc3_1: As folhas agora podem cair um - common: comum - uncommon: incomum - rare: raro - veryRare: muito raro - legendary: lendario - fishingPerkDesc1_1: Desbloqueia a camada do tesouro - farmingPerkDesc1_1: Ganhe a habilidade de criar - cowSpawnEgg: ovo de desova de vaca - beeSpawnEgg: ovo de desova de abelha - mooshroomSpawnEgg: ovo de desova de mooshroom - horseSpawnEgg: ovo de desova de cavalo - slimeSpawnEgg: ovo de desova de gosma - diggingPerkDesc0_1: Agora você pode desenterrar um - defensePerkDesc0_1: Ganhe +3 s de regeneração por nível em mortes - defensePerkDesc0_2: Ganhe +0,5 corações por nível instantaneamente ao matar - duration: Duração - likelihood: Probabilidade - junkChance: Chance de lixo - locked: BLOQUEADO - unlocked: DESBLOQUEADO - cowEgg: Ovo de vaca - beeEgg: Ovo de abelha - mooshroomEgg: Ovo mooshroom - horseEgg: Ovo de cavalo - slimeEgg: Ovo de limo - tippedArrows: Flechas inclinadas - toggle: Alternancia - refundSkillTitle: Habilidade de Reembolso - refundSkillTreeDesc: Clique para reembolsar esta árvore de habilidade - enchantingPerkDesc1_0: Desbloqueia a capacidade de criar - enchantingPerkDesc1_1: Livros encantados Poder I e Eficiência I (custa 1 nível para fabricar) - enchantingPerkDesc1_2: Livros encantados Sharpness I e Protection I (custa 1 nível para fabricar) - enchantingPerkDesc1_3: Livros encantados Luck of the Sea I e Lure I (custa 1 nível para fabricar) - enchantingPerkDesc1_4: Livros encantados de Depth Strider I e Frost Walker I (custa 1 nível para fabricar) - enchantingPerkDesc1_5: Remendando (custa 10 níveis para criar) e Fortune I (custa 2 níveis para criar) livros encantados - repairPerkDesc0_1: Ganhe mais materiais de recuperação em média - repairPerkDesc0_2: Em média, ganhe mais materiais com a recuperação. A recuperação agora armazena os encantos dos itens em um livro - xpBoost: aumento de xp - speedBoost: Aumento de velocidade - timeExtension: Extensão de tempo - enchantingCraft0: Livro Poder I - enchantingCraft1: Livro Eficiencia I - enchantingCraft2: Livro Afiada I - enchantingCraft3: Livro Protecao I - enchantingCraft4: Livro Sorte do mar I - enchantingCraft5: Livro Atrair I - enchantingCraft6: Livro Caminhante de gelo I - enchantingCraft7: Livro Profundidade Strider I - enchantingCraft8: Livro de remendos - enchantingCraft9: Livro Fortuna I - commandDesc9: Define as almas de um jogador específico - commandDesc10: Define a habilidade ou Tokens passivos na habilidade especificada para um jogador especificado - commandDesc11: Define os tokens globais para um jogador específico - commandDesc12: Salva estatísticas de todos os jogadores ou de um jogador específico - status: STATUS - complete: COMPLETO - incomplete: INCOMPLETO - try0: "tentar" - passiveImprove: Suas vantagens passivas melhoram a cada nível! - increasedBy: aumentado por - expIncrease: Multiplicador EXP - personalMultiplier: Multiplicador Pessoal - translators: Tradutores - commandDesc13: Define o multiplicador pessoal para um jogador específico - abilityDescription: Descrição de habilidade - abilityDescription_digging: Adiciona temporariamente 5 níveis de eficiência à sua pá. Ativado clicando com o botão direito em uma pá e quebrando um bloco. - abilityDescription_woodcutting: Faz com que os eixos quebrem temporariamente uma árvore inteira com uma quebra de bloco. Ativado clicando com o botão direito em um machado e quebrando um tronco. - abilityDescription_mining: Adiciona temporariamente 5 níveis de eficiência à sua picareta. Ativado clicando com o botão direito em uma picareta e depois quebrando o bloco. - abilityDescription_farming: Faz safras temporariamente quebradas com uma enxada e replanta automaticamente. Ativado ao clicar com o botão direito do mouse em uma enxada e quebrar uma colheita. - abilityDescription_fishing: Faz com que as varas de pesca capturem um peixe temporariamente. Ativado ao clicar com o botão esquerdo em uma vara de pescar e pescar na água. - abilityDescription_archery: Faz temporariamente todas as flechas serem disparadas na velocidade máxima. Ativado clicando com o botão esquerdo em um arco e depois atirando uma flecha. - abilityDescription_beastMastery: Temporariamente dá ao seu cavalo um buff de velocidade. Ativado ao clicar com o botão direito do mouse em um cavalo e depois clicar com o botão esquerdo. - abilityDescription_swordsmanship: Remove temporariamente o cooldown oscilante em espadas. Ativado ao clicar com o botão direito do mouse em uma espada e acertar um mob. - abilityDescription_defense: Fornece temporariamente ao usuário efeitos de resistência e lentidão. Ativado ao clicar com o botão direito com a mão vazia e acertar um mob. - abilityDescription_axeMastery: faz com que os machados causem danos temporariamente a todos os mobs em um determinado raio. Ativado ao clicar com o botão direito do mouse em um machado e acertar uma multidão. - alchemyPerkDesc1_0: Desbloqueia a capacidade de preparar - alchemyPerkDesc0_0: Uma mesa de artesanato pode ser usada para criar - triggerAbilities: Habilidades de gatilho - showEXPBar: Mostrar barra de EXP - disabledSkill: Esta habilidade está desativada - skillConfigDesc: Leva você ao menu de configuração para esta habilidade - lvl: Lvl. #Abreviatura para "Nível" Se o seu idioma não tem abreviatura, por favor coloque a tradução para "Nível" - exp: EXP #Abreviatura para "experiência" se o seu idioma não tiver abreviatura, coloque a tradução para "experiência" - potionAbsorption: Poção de Absorção - potionBadOmen: Poção de presságio ruim - potionBlindess: Poção dos Cegos - potionConduitPower: Poção de Energia do conduíte - potionResistance: Poção de Resistência - potionDolphinsGrace: Poção da Graça dos Golfinhos - potionHaste: Poção da Rapidez - potionFireResistance: Poção de Resistência ao Fogo - potionGlowing: Poção de brilho - potionHarm: Poção de dano - potionHealing: Poção de Cura - potionHealthBoost: Poção de aumento de saúde - potiontheHero: Poção do Herói - potionHunger: Poção da Fome - potionStrength: Poção de Força - potionInvsibility: Poção de Invsibilidade - potionJump: Poção de Salto - potionLuck: Poção da Sorte - potionNightVision: Poção de Visão Noturna - potionRegeneration: Poção de Regeneração - potionSaturation: Poção de Saturação - potionSlowness: Poção da Lentidão - potionFatigue: Poção da Fadiga - potionSlowFalling: Poção de Queda Lenta - potionSpeed: Poção de Velocidade - potionBadLuck: Poção da Má Sorte - potionWaterBreathing: Poção de Respiração de Água - potionWeakness: Poção da Fraqueza - potionDecay: Poção da Decadência - potionAwkward: Poção estranha - potionUncraftable: Poção Incrustável - potionMundane: Poção Mundana - potionTurtleMaster: Poção do Mestre da Tartaruga - potionThick: Poção Grossa - potionWater: Garrafa de agua - ingredient: Ingrediente - usedToBrew: É usado para preparar cerveja - costs: custos - xpLevel: Minecraft XP nivél - xpLevels: Minecraft XP niveís - craftXPRequirement: Esta receita requer pelo menos - bedGUI: Você não pode usar este comando enquanto está na cama! - statsUpdated: Suas estatísticas foram alteradas para serem consistentes com uma nova curva de EXP. - Todas as árvores de habilidade e vantagens passivas foram reiniciadas. Todos os tokens devem ser reinvestidos. - timeRemaining: Tempo restante - numberOfAbilityTimersDisplayed: Número de temporizadores de habilidade exibidos - commandDesc14: Redefine o período de espera de uma habilidade para 0 segundos - commandDesc15: Procura as estatísticas de FreeRPG de um jogador - repairUnsafeEnchant: Este item é muito poderoso para ser reparado - salvageUnsafeEnchant: Este item é muito poderoso para ser recuperado - rank: Classificação - stats: Status - outOf: fora de - playerNotInLeaderboard: Esse jogador não está em nenhuma tabela de classificação - virtual: Virtual - commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) + ptBR: #Translated by gbuueno + languageName: Porutgues Brazil + englishLanguageName: Portuguese + translationCredit: gbuueno + global: Global + digging: Escavação + woodcutting: Corte de madeira + mining: Mineração + farming: Agricultura + fishing: Pescaria + archery: Tiro com arco + beastMastery: Domínio da Besta + swordsmanship: Esgrima + defense: Defesa + axeMastery: Maestria de machado + repair: Reparar + alchemy: Alquimia + agility: Agilidade + smelting: Fundição + enchanting: Encantadora + information: Em formação + configuration: Configuração + level: Level + experience: Experiência + toNext: para a próxima + total: Total + diggingPerkTitle0: Mo' drops + diggingPerkTitle1: Tesouro duplo + diggingPerkTitle2: Drops raros + diggingPerkTitle3: Ladrão de almas + diggingPerkTitle4: Localizador de flint + diggingPerkTitle5: Cavaleiro da pá + diggingPerkTitle6: Mega Dig + diggingPerkDesc0: Expande a tabela de queda de tesouro em 1 item por nível + diggingPerkDesc1: + 5% de chance de receber o dobro da queda de tesouro por nível (quando + tesouro é rolado) + diggingPerkDesc2: Expande ainda mais a tabela suspensa por item por nível + diggingPerkDesc3: A areia da alma tem 5% a mais de probabilidade de soltar tesouros por nível + diggingPerkDesc4: Cascalho tem 100% de taxa de queda de pederneira (alternável por /flintToggle) + diggingPerkDesc5: Pás causam dano duplo + diggingPerkDesc6: Ao usar a habilidade, você agora quebra uma seção de bloqueio 3x3 (20% de + taxa de tesouro normal quando ativo) + diggingPassiveTitle0: Tokens passivos + diggingPassiveTitle1: Voltar + diggingPassiveTitle2: Tokens de habilidade + diggingPassiveTitle3: Duração do Big Dig + diggingPassiveTitle4: Chance de tesouro + diggingPassiveDesc0: Tokens para investir em habilidades passivas (corantes) + diggingPassiveDesc1: Leva você de volta ao menu principal de habilidades + diggingPassiveDesc2: Tokens para investir na árvore de habilidades + diggingPassiveDesc3: Aumenta a duração da Big Dig em 0,02 s + diggingPassiveDesc4: Aumenta a chance de desenterrar tesouros em 0,005% + woodcuttingPerkTitle0: Raizes Zelosas + woodcuttingPerkTitle1: Armas frescas + woodcuttingPerkTitle2: Conhecimento Oculto + woodcuttingPerkTitle3: Leaf Scavenger + woodcuttingPerkTitle4: Madeira + + woodcuttingPerkTitle5: Soprador de folhas + woodcuttingPerkTitle6: Machado capaz + woodcuttingPerkDesc0: + 20% de chance de os logs caírem 1 XP por nível + woodcuttingPerkDesc1: +12 s por nível de Haste I após o primeiro log quebrado em 5 minutos + woodcuttingPerkDesc2: Logs têm + 0,2% de chance por nível de derrubar um encantado + livro + woodcuttingPerkDesc3: As folhas têm 1% de chance de soltar +1 item de tesouro por nível + woodcuttingPerkDesc4: O limite de quebra de madeira aumentou de 64 para 128 + woodcuttingPerkDesc5: Quebre uma grande seção de folhas usando um machado (alternável com / leafBlowerToggle) + woodcuttingPerkDesc6: Gotas duplas, raízes zelosas e conhecimento oculto, tudo agora + aplicar à madeira (com metade da eficácia) + woodcuttingPassiveTitle0: Tokens passivos + woodcuttingPassiveTitle1: Voltar + woodcuttingPassiveTitle2: Tokens de habilidade + woodcuttingPassiveTitle3: Timber Duration + woodcuttingPassiveTitle4: Drops duplos + woodcuttingPassiveDesc0: Tokens para investir em habilidades passivas (corantes) + woodcuttingPassiveDesc1: Leva você de volta ao menu principal de habilidades + woodcuttingPassiveDesc2: Tokens para investir na árvore de habilidades + woodcuttingPassiveDesc3: Aumenta a duração da madeira em 0,02 s + woodcuttingPassiveDesc4: Aumenta a chance de receber uma queda dupla em 0,05% + miningPerkTitle0: Pressa inútil + miningPerkTitle1: Mmis bombas + miningPerkTitle2: Caçadora de tesouros + miningPerkTitle3: Viagem de bomba + miningPerkTitle4: Veia mineira + miningPerkTitle5: Homem de demolição + miningPerkTitle6: Problema triplo + miningPerkDesc0: Ganhe pressa após minerar minérios para cada nível + miningPerkDesc1: A receita de criação para TNT produz +1 bloco de TNT por nível + miningPerkDesc2: Ao usar a habilidade em pedras, + 1% por nível de chance de um minério + para descartar (exp extra é ganho com minérios descartados) + miningPerkDesc3: Aumenta o raio de explosão TNT (quando iluminado por sílex e aço) cada + nível + miningPerkDesc4: Os veios de minério são extraídos instantaneamente ao quebrar um bloco (comutável) + miningPerkDesc5: Nenhum dano é causado por explosões TNT + miningPerkDesc6: Quedas duplas agora são quedas triplas + miningPassiveTitle0: Tokens passivos + miningPassiveTitle1: Voltar + miningPassiveTitle2: Tokens de habilidade + miningPassiveTitle3: Duração da escolha furiosa + miningPassiveTitle4: Drops duplos + miningPassiveTitle5: Explosão de mineração + miningPassiveDesc0: Tokens para investir em habilidades passivas (corantes) + miningPassiveDesc1: Leva você de volta ao menu principal de habilidades + miningPassiveDesc2: Tokens para investir na árvore de habilidades + miningPassiveDesc3: Aumenta a duração do Berserk Pick em 0,02s + miningPassiveDesc4: Aumenta a chance de receber uma queda dupla de minérios em 0,05% + miningPassiveDesc5: Aumenta as chances de o minério ser criado a partir de explosões de TNT + em 0,01% (mais blocos quebrados = mais rolos de tesouro) + farmingPerkTitle0: Melhor Fertilizante + farmingPerkTitle1: Fazenda de animais + farmingPerkTitle2: Dieta do Fazendeiro + farmingPerkTitle3: Carnívoro + farmingPerkTitle4: Polegar verde + farmingPerkTitle5: Hormônios de crescimento + farmingPerkTitle6: Um com a natureza + farmingPerkDesc0: + 10% de chance de não consumir farinha de osso durante o uso + farmingPerkDesc1: Pode criar um ovo de desova adicional por nível + farmingPerkDesc2: Alimentos agrícolas são 20% mais eficazes para restaurar a fome e a saturação + por nível + farmingPerkDesc3: A carne é 20% mais eficaz em restaurar a fome e a saturação + por nível + farmingPerkDesc4: A habilidade pode replantar safras totalmente crescidas com maior chance de + replantio em estágios posteriores de crescimento; habilidade agora afeta melões e abóboras + farmingPerkDesc5: O açúcar pode ser usado em animais bebês para fazê-los crescer instantaneamente + farmingPerkDesc6: Ganhe Regeneração I ao ficar parado na grama + farmingPassiveTitle0: Tokens passivos + farmingPassiveTitle1: Voltar + farmingPassiveTitle2: Tokens de habilidade + farmingPassiveTitle3: Duração da regeneração natural + farmingPassiveTitle4: Drops duplos (Cultivo) + farmingPassiveTitle5: Drops duplos (Animais) + farmingPassiveDesc0: Tokens para investir em habilidades passivas (corantes) + farmingPassiveDesc1: Leva você de volta ao menu principal de habilidades + farmingPassiveDesc2: Tokens para investir na árvore de habilidades + farmingPassiveDesc3: Aumenta a duração da regeneração natural em 0,02s + farmingPassiveDesc4: Aumenta a chance de receber uma queda dupla das safras em 0,05% + farmingPassiveDesc5: Aumenta a chance de receber uma queda dupla da maioria dos passivos + animais em 0,05% + fishingPerkTitle0: Roubar + fishingPerkTitle1: Carniceiro + fishingPerkTitle2: Dieta do Pescador + fishingPerkTitle3: Filtração + fishingPerkTitle4: Gancho + fishingPerkTitle5: Vara de pesca quente + fishingPerkTitle6: Pessoa Peixe + fishingPerkDesc0: + 15% de chance de retirar o item de um mob por nível + fishingPerkDesc1: Desbloqueia nova camada de tesouro de pesca + fishingPerkDesc2: Restauração de peixes + 20% de fome por nível + fishingPerkDesc3: Loot de nível superior (II-V) torna-se mais comum, nível inferior (I) + torna-se menos comum + fishingPerkDesc4: Vara de pesca agora atua como um gancho (alternável com / grappleToggle + ) + fishingPerkDesc5: Os peixes agora são cozidos quando pescados, alguns tesouros de pesca são + alterado (alternável com /hotRodToggle) + fishingPerkDesc6: Visão noturna infinita quando debaixo d'água, graça infinita do golfinho + quando na água + fishingPassiveTitle0: Tokens passivos + fishingPassiveTitle1: Voltar + fishingPassiveTitle2: Tokens de habilidade + fishingPassiveTitle3: Super duração da isca + fishingPassiveTitle4: Pegadas duplas + fishingPassiveTitle5: Descobridor de tesouro + fishingPassiveDesc0: Tokens para investir em habilidades passivas (corantes) + fishingPassiveDesc1: Leva você de volta ao menu principal de habilidades + fishingPassiveDesc2: Tokens para investir na árvore de habilidades + fishingPassiveDesc3: Aumenta a duração do Super Bait em 0,01s + fishingPassiveDesc4: Aumenta a chance de receber uma queda dupla em 0,05% + fishingPassiveDesc5: Diminui a chance de encontrar lixo em 0,005%, aumenta a chance + de encontrar tesouros em 0,005% + archeryPerkTitle0: Flechas extras + archeryPerkTitle1: Franco-atirador + archeryPerkTitle2: Flecha de luz + archeryPerkTitle3: Flehas Explosivas + archeryPerkTitle4: Flecha Dragon-less + archeryPerkTitle5: Carga rápida de besta + archeryPerkTitle6: Golpe Mortal + archeryPerkDesc0: +1 flecha obtida na fabricação por nível + archeryPerkDesc1: A velocidade da flecha aumenta em + 2% por nível (~ 4% de aumento de dano / nível) + archeryPerkDesc2: Flechas espectrais recebem um aumento de dano de + 5% por nível + archeryPerkDesc3: As flechas têm + 1% de criação de uma explosão ao acertar + archeryPerkDesc4: Permite a fabricação de todas as flechas com pontas com poções regulares + de poções persistentes + archeryPerkDesc5: A habilidade agora pode ser usada com bestas, fazendo com que todos os tiros sejam carregados + imediatamente + archeryPerkDesc6: Fogos de artifício disparados de bestas causam dano duplo (até 16 corações + de dano) + archeryPassiveTitle0: Tokens passivos + archeryPassiveTitle1: Voltar + archeryPassiveTitle2: Tokens de habilidade + archeryPassiveTitle3: Duração rápida do fogo + archeryPassiveTitle4: Recuperação + archeryPassiveDesc0: Tokens para investir em habilidades passivas (corantes) + archeryPassiveDesc1: Leva você de volta ao menu principal de habilidades + archeryPassiveDesc2: Tokens para investir na árvore de habilidades + archeryPassiveDesc3: Aumenta a duração do Fogo Rápido em 0,02s + archeryPassiveDesc4: Aumenta a chance de o tiro de flecha não consumir a flecha em 0,05% + por nível + beastMasteryPerkTitle0: Pelo Grosso + beastMasteryPerkTitle1: Dentes afiados + beastMasteryPerkTitle2: Mordidas saudáveis + beastMasteryPerkTitle3: Mantenha-se afastado + beastMasteryPerkTitle4: Acro-Cão + beastMasteryPerkTitle5: Identificar + beastMasteryPerkTitle6: Impulso de adrenalina + beastMasteryPerkDesc0: Os cães sofrem -10% de dano por nível + beastMasteryPerkDesc1: Os cães causam + 10% a mais de dano por nível + beastMasteryPerkDesc2: Os cães curam +1/2 de coração por nível de matar + beastMasteryPerkDesc3: Cães ganham + 5% de chance de derrubar inimigos Voltar + beastMasteryPerkDesc4: Os cães não sofrem danos de queda + beastMasteryPerkDesc5: Usar uma bússola em um cavalo ou lobo agora mostra suas estatísticas + beastMasteryPerkDesc6: Spur kick buff agora é velocidade III + beastMasteryPassiveTitle0: Tokens passivos + beastMasteryPassiveTitle1: Voltar + beastMasteryPassiveTitle2: Tokens de habilidade + beastMasteryPassiveTitle3: Duração do chute de esporão + beastMasteryPassiveTitle4: Mordida Crítica + beastMasteryPassiveDesc0: Tokens para investir em habilidades passivas (corantes) + beastMasteryPassiveDesc1: Leva você de volta ao menu principal de habilidades + beastMasteryPassiveDesc2: Tokens para investir na árvore de habilidades + beastMasteryPassiveDesc3: Aumenta a duração do Spur Kick em 0,02s + beastMasteryPassiveDesc4: Aumenta a chance de um cão ter um acerto crítico por + 0,025% + swordsmanshipPerkTitle0: Adrenalina + swordsmanshipPerkTitle1: Matança + swordsmanshipPerkTitle2: Adrenalina+ + swordsmanshipPerkTitle3: Frenesi mortal + swordsmanshipPerkTitle4: Sede de sangue + swordsmanshipPerkTitle5: Mais nítido! + swordsmanshipPerkTitle6: Maestria de espada + swordsmanshipPerkDesc0: Matar mobs hostis com uma espada fornece +2 s de velocidade + por nível + swordsmanshipPerkDesc1: Matar mobs hostis com uma espada fornece +2 s de força + por nível + swordsmanshipPerkDesc2: + 20% do buff de velocidade I da Adrenalina agora é velocidade II + swordsmanshipPerkDesc3: + 20% da força que eu buff de Killing Spree agora é força + II + swordsmanshipPerkDesc4: Matar certos mobs agressivos com uma espada restaura + fome + swordsmanshipPerkDesc5: Golpes rápidos agora adicionam um nível de nitidez à sua espada + swordsmanshipPerkDesc6: Espadas causam permanentemente +1 coração de dano + swordsmanshipPassiveTitle0: Tokens passivos + swordsmanshipPassiveTitle1: Voltar + swordsmanshipPassiveTitle2: Tokens de habilidade + swordsmanshipPassiveTitle3: Duração de ataques rápidos + swordsmanshipPassiveTitle4: Golpe duplo + swordsmanshipPassiveDesc0: Tokens para investir em habilidades passivas (corantes) + swordsmanshipPassiveDesc1: Leva você de volta ao menu principal de habilidades + swordsmanshipPassiveDesc2: Tokens para investir na árvore de habilidades + swordsmanshipPassiveDesc3: Aumenta a duração dos golpes rápidos em 0,02s + swordsmanshipPassiveDesc4: Aumenta a chance de acertar o mob duas vezes (o segundo acerto faz + 50% de dano) em 0,02% + defensePerkTitle0: Curador + defensePerkTitle1: Endurecer + defensePerkTitle2: Cabeça dura + defensePerkTitle3: Endurecer+ + defensePerkTitle4: Presente de cima + defensePerkTitle5: Pernas mais fortes + defensePerkTitle6: Forte + defensePerkDesc0: Ganhe + 3s de regeneração por nível ao matar + defensePerkDesc1: + 2% de chance de ganhar resistência I por 5s ao acertar + defensePerkDesc2: Corpo rígido diminui o dano em 6,6% adicionais por nível + defensePerkDesc3: + 2% de chance de ganhar resistência II por 5s ao acertar + defensePerkDesc4: Pedra Sólida agora concede 4 corações de absorção para comprimento de habilidade + +1 minuto + defensePerkDesc5: Pedra Sólida agora dá lentidão I em vez de lentidão IV + defensePerkDesc6: +2 corações permanentemente + defensePassiveTitle0: Tokens passivos + defensePassiveTitle1: Voltar + defensePassiveTitle2: Tokens de habilidade + defensePassiveTitle3: Duração da Pedra Sólida + defensePassiveTitle4: Corpo duro + defensePassiveTitle5: Drops duplos (Mobs Hostis) + defensePassiveDesc0: Tokens para investir em habilidades passivas (corantes) + defensePassiveDesc1: Leva você de volta ao menu principal de habilidades + defensePassiveDesc2: Tokens para investir na árvore de habilidades + defensePassiveDesc3: Aumenta a duração da Pedra Sólida em 0,02s + defensePassiveDesc4: Aumenta a chance de sofrer dano reduzido (base -33%) em 0,01% + por nível + defensePassiveDesc5: Aumenta a chance de receber Drops duplos de agressivo + mobs em 0,05% + axeMasteryPerkTitle0: Otimo machado + axeMasteryPerkTitle1: Machado sagrado + axeMasteryPerkTitle2: Revitalizado + axeMasteryPerkTitle3: Guerreiro sangue + axeMasteryPerkTitle4: Tremor de terra + axeMasteryPerkTitle5: Melhores créditos + axeMasteryPerkTitle6: Homem machado + axeMasteryPerkDesc0: O raio de dano do grande machado aumenta em 1 bloco por nível + axeMasteryPerkDesc1: + 2% de chance de iluminação para atingir mobs em um golpe de machado + axeMasteryPerkDesc2: + 1% de chance de cura total ao matar por nível + axeMasteryPerkDesc3: +3 s por nível de Força I em mortes com um machado + axeMasteryPerkDesc4: O dano AOE da habilidade é dobrado (25% -> 50% do dano) + axeMasteryPerkDesc5: Os Critos Divinos agora têm um multiplicador de 1,6x em vez de 1,25x + axeMasteryPerkDesc6: Machados causam permanentemente +1 de dano + axeMasteryPassiveTitle0: Tokens passivos + axeMasteryPassiveTitle1: Voltar + axeMasteryPassiveTitle2: Tokens de habilidade + axeMasteryPassiveTitle3: Duração do Grande Machado + axeMasteryPassiveTitle4: Critos Divinos + axeMasteryPassiveDesc0: Tokens para investir em habilidades passivas (corantes) + axeMasteryPassiveDesc1: Leva você de volta ao menu principal de habilidades + axeMasteryPassiveDesc2: Tokens para investir na árvore de habilidades + axeMasteryPassiveDesc3: Aumenta a duração do Grande Machado em 0,02s + axeMasteryPassiveDesc4: Aumenta a chance de crítico aleatório (base 1,25x de dano) em 0,01% + repairPerkTitle0: Salvando + repairPerkTitle1: Engenhoso + repairPerkTitle2: Maestria de reparo mágico + repairPerkDesc0: Obtenha mais materiais em média com a recuperação + repairPerkDesc1: + 10% de chance de manter o material usado durante o reparo + repairPerkDesc2: Garantido para manter os encantos em reparo + repairPassiveTitle0: Voltar + repairPassiveTitle1: Tokens de habilidade + repairPassiveTitle2: Competência + repairPassiveDesc0: Leva você de volta ao menu principal de habilidades + repairPassiveDesc1: Tokens para investir na árvore de habilidades + repairPassiveDesc2: Os materiais restauram mais durabilidade no reparo + agilityPerkTitle0: Esquiva + agilityPerkTitle1: Ossos de aço + agilityPerkTitle2: Pés graciosos + agilityPerkDesc0: + 4% de chance de esquivar de ataques por nível + agilityPerkDesc1: -10% de dano de queda por nível + agilityPerkDesc2: Velocidade permanente I buff (alternável por /speedToggle) + agilityPassiveTitle0: Voltar + agilityPassiveTitle1: Tokens de habilidade + agilityPassiveTitle2: Lista + agilityPassiveDesc0: Leva você de volta ao menu principal de habilidades + agilityPassiveDesc1: Tokens para investir na árvore de habilidades + agilityPassiveDesc2: Chance de rolar e receber dano de queda reduzido + alchemyPerkTitle0: Invocação Alquímica + alchemyPerkTitle1: Conhecimento Antigo + alchemyPerkTitle2: Mestre de Poções + alchemyPerkDesc0: Permite a elaboração de algumas poções sem um suporte de fermentação + alchemyPerkDesc1: Desbloqueia a capacidade de preparar novas poções + alchemyPerkDesc2: Todas as poções usadas são aumentadas de nível em 1 (alternável com + /togglePotion) + alchemyPassiveTitle0: Voltar + alchemyPassiveTitle1: Tokens de habilidade + alchemyPassiveTitle2: Meia vida+ + alchemyPassiveDesc0: Leva você de volta ao menu principais habilidades + alchemyPassiveDesc1: Tokens para investir na árvore de habilidades + alchemyPassiveDesc2: Aumento na duração das poções quando usadas + smeltingPerkTitle0: Eficiência do combustível + smeltingPerkTitle1: Cheiro duplo + smeltingPerkTitle2: Picareta em chamas + smeltingPerkDesc0: O combustível dura + 20% a mais por nível + smeltingPerkDesc1: + 5% de chance de o minério fundido dobrar por nível + smeltingPerkDesc2: Os minérios extraídos são fundidos instantaneamente (alternável com /toggleFlamePick) + smeltingPassiveTitle0: Voltar + smeltingPassiveTitle1: Tokens de habilidade + smeltingPassiveTitle2: Velocidade de Combustível + smeltingPassiveDesc0: Leva você de volta ao menu principal de habilidades + smeltingPassiveDesc1: Tokens para investir na árvore de habilidades + smeltingPassiveDesc2: Aumentando a velocidade de cozimento + enchantingPerkTitle0: Eficiente Encantador + enchantingPerkTitle1: Livro inteligente + enchantingPerkTitle2: Experiência Imortal + enchantingPerkDesc0: Níveis necessários para encantar -1 por nível, custos de reparo da bigorna + -1 (mínimo de 2) níveis de XP por nível + enchantingPerkDesc1: Desbloqueia a elaboração de receitas para alguns livros encantados + enchantingPerkDesc2: Mantenha xp na morte + enchantingPassiveTitle0: Voltar + enchantingPassiveTitle1: Tokens de habilidade + enchantingPassiveTitle2: Desenvolvimento mais rápido + enchantingPassiveDesc0: Leva você de volta ao menu principal de habilidades + enchantingPassiveDesc1: Tokens para investir na árvore de habilidades + enchantingPassiveDesc2: Todos os XP recebidos aumentaram + globalPerkTitle0: Coletor + globalPerkTitle1: Estudioso + globalPerkTitle2: Lutador + globalPerkTitle3: Trabalho duro + globalPerkTitle4: Pesquisa + globalPerkTitle5: Treinamento + globalPerkTitle6: Reencarnação+ + globalPerkTitle7: Colheita de Alma + globalPerkTitle8: Avatar + globalPerkTitle9: Mestre das artes + globalPerkDesc0: + 20% de exp ganho em escavação, corte de lenha, mineração, agricultura e + pescaria + globalPerkDesc1: + 20% de exp ganho em Reparo, Agilidade, Fabricação, Fundição e Encantamento + globalPerkDesc2: + 20% de exp ganho em arco e flecha, maestria de bestas, esgrima, defesa, + e maestria de machado + globalPerkDesc3: +1 token de habilidade em todas as habilidades de Coletor + globalPerkDesc4: +1 token de habilidade em todas as habilidades acadêmicas + globalPerkDesc5: +1 token de habilidade em todas as habilidades de lutador + globalPerkDesc6: Na morte, 50% de chance de manter alguns de cada item valioso em seu + estoques + globalPerkDesc7: Você agora colhe almas matando mobs agressivos, que podem + ser usado para reembolsar árvores de habilidade + globalPerkDesc8: 10% de chance de não sofrer nenhum dano e ganhar todos os buffs do jogo por 10s + em um golpe que normalmente te mataria + globalPerkDesc9: As habilidades de resfriamentos diminuíram 33% + globalPassiveTitle0: Tokens globais + globalPassiveTitle1: Voltar + globalPassiveDesc0: Tokens para investir na árvore de habilidades + globalPassiveDesc1: Leva você de volta ao menu principal de habilidades + cannotRepair: Você não pode reparar enquanto esta habilidade estiver ativa! + cannotSalvage: Você não pode salvar enquanto esta habilidade estiver ativa! + spite: Tudo de bom é feito de rancor + refundSkill: são obrigados a reembolsar uma árvore de habilidade + refundSkill2: a fim de reembolsar uma árvore de habilidade + needToUnlock: Você precisa desbloquear + perkRequirement: Você precisa de pelo menos 2 tokens de habilidade investidos nas vantagens anteriores para desbloquear esta vantagem + perkRequirementM: Você precisa de pelo menos 10 tokens de habilidade totais investidos na árvore de habilidades para desbloquear este privilégio de maestria + noSkillTokens: Você não tem nenhum Tokens de habilidade + noPassiveTokens: Você não tem nenhum Tokens passivo + maxedOutPerk: Você já atingiu o limite máximo deste benefício! + requiredGlobalPerks0: Você precisa do benefício anterior para desbloquear este benefício + requiredGlobalPerks1: são necessários para desbloquear este privilégio + requiredGlobalPerks2: é necessário para desbloquear este privilégio + requiredGlobalPerks3: Você precisa de todos os benefícios globais para desbloquear este benefício + craftRequirement: é necessário para criar esta receita! + roll: Lista + dodge: Esquiva + prepare: Você preparou o seu + rest: Você descansou seu + activated: Ativado! + ended: Voce terminou + readyToUse: Está pronto para usar novamente + cooldown: Esfriou + rapidFire: Fogo rápido + bow: Arco + greatAxe: Grande machado + axe: Machado + spurKick: Chute com espora + leg: Perna + stoneSoldier: Soldado de Pedra + yourself: Você mesmo + bigDig: Grande escavação + shovel: Pá + naturalRegeneration: Regeneração natural + hoe: Enxada + superBait: Super isca + fishingRod: Vara de pesca + berserkPick: Picareta Furiosa + pickaxe: Picareta + swiftStrikes: Ataques rápidos + sword: Espada + timber: Madeira + hyperHorse: Este cavalo já está hiper! + magicForce: Uma força mágica acaba com sua habilidade + rob: Roubar + repairFail0: Você não é qualificado o suficiente para reparar este item de forma adequada + repairFail1: Você falhou em salvar qualquer material + repairFail2: Você falhou em manter o poder de encantamento do item + treeTooBig0: Esta árvore é muito grande para você cortar de uma vez! " + treeTooBig1: Esta árvore nunca pode ser cortada de uma vez como esta ... + noPermission: Você não tem permissão para usar este comando! + improperArguments: Argumentos impróprios, tente + totalPlayTime: Tempo total de jogo + clickForOptions: Clique para opções + unknownCommand: Comando desconhecido + expToLevel: EXP para o próximo nível + playerName: nome do jogador + skillName: skillName (em inglês) + page: página + on0: "LIGADO" + off0: "DESLIGADO" + onOrOff: LIGADO/DESLIGADO + manuallyToggles: Alterna manualmente + commandDesc0: Abre a GUI principal com todas as habilidades + commandDesc1: Abre uma árvore de habilidade GUI de escolha + commandDesc2: Abre a GUI de configuração + commandDesc3: Dá a um jogador de escolha EXP em uma habilidade específica + commandDesc4: Define o nível de um determinado jogador em uma habilidade específica + commandDesc5: Redefine as estatísticas de um jogador em uma habilidade especificada (não reembolsa estatísticas) + commandDesc6: Exibe uma tabela de classificação para uma estatística especificada + commandDesc7: Fornece um link para uma página de informações do plugin + commandDesc8: Tenta encantar um item na mão do usuário em um nível especificado + informationURL: URL de informação (Google Docs) + click: CLIQUE + levelArgument: O argumento de nível deve ser inferior a 40 + leaderboard: Entre os melhores + playerOffline: Esse jogador não está online + onlyIncrease: Apenas aumente exp com este comando, caso contrário, use /frpg statReset e /frpg giveEXP + amount: montante + unlockToggle: Para usar este comando você deve desbloquear + levelUpNotif: Notificações de subida de nível + abilityPreparationNotif: Notificações de preparação de habilidade + yes0: "SIM" + no0: "NAO" + warning: ATENÇÃO + souls: almas + refundSkillTree0: Reembolsando os custos de uma árvore de habilidade + refundSkillTree1: e não é reversível, você tem certeza que quer + refundSkillTree2: devolver o + skill: habilidade + VoltarToSkillTree: Leva você de volta para a árvore de habilidade + miningPerkDesc0_1: 2 segundos de aceleração I após minerar qualquer minério + miningPerkDesc0_2: 5 segundos de aceleração I após a mineração de qualquer minério + miningPerkDesc0_3: 10 segundos de aceleração I após a mineração de qualquer minério + miningPerkDesc0_4: 5 segundos de Haste II após a mineração de qualquer minério, seguidos por 5 segundos de Haste I + miningPerkDesc0_5: 10 segundos de Haste II após a mineração de qualquer minério + woodcuttingPerkDesc3_1: As folhas agora podem cair um + common: comum + uncommon: incomum + rare: raro + veryRare: muito raro + legendary: lendario + fishingPerkDesc1_1: Desbloqueia a camada do tesouro + farmingPerkDesc1_1: Ganhe a habilidade de criar + cowSpawnEgg: ovo de desova de vaca + beeSpawnEgg: ovo de desova de abelha + mooshroomSpawnEgg: ovo de desova de mooshroom + horseSpawnEgg: ovo de desova de cavalo + slimeSpawnEgg: ovo de desova de gosma + diggingPerkDesc0_1: Agora você pode desenterrar um + defensePerkDesc0_1: Ganhe +3 s de regeneração por nível em mortes + defensePerkDesc0_2: Ganhe +0,5 corações por nível instantaneamente ao matar + duration: Duração + likelihood: Probabilidade + junkChance: Chance de lixo + locked: BLOQUEADO + unlocked: DESBLOQUEADO + cowEgg: Ovo de vaca + beeEgg: Ovo de abelha + mooshroomEgg: Ovo mooshroom + horseEgg: Ovo de cavalo + slimeEgg: Ovo de limo + tippedArrows: Flechas inclinadas + toggle: Alternancia + refundSkillTitle: Habilidade de Reembolso + refundSkillTreeDesc: Clique para reembolsar esta árvore de habilidade + enchantingPerkDesc1_0: Desbloqueia a capacidade de criar + enchantingPerkDesc1_1: Livros encantados Poder I e Eficiência I (custa 1 nível para fabricar) + enchantingPerkDesc1_2: Livros encantados Sharpness I e Protection I (custa 1 nível para fabricar) + enchantingPerkDesc1_3: Livros encantados Luck of the Sea I e Lure I (custa 1 nível para fabricar) + enchantingPerkDesc1_4: Livros encantados de Depth Strider I e Frost Walker I (custa 1 nível para fabricar) + enchantingPerkDesc1_5: Remendando (custa 10 níveis para criar) e Fortune I (custa 2 níveis para criar) livros encantados + repairPerkDesc0_1: Ganhe mais materiais de recuperação em média + repairPerkDesc0_2: Em média, ganhe mais materiais com a recuperação. A recuperação agora armazena os encantos dos itens em um livro + xpBoost: aumento de xp + speedBoost: Aumento de velocidade + timeExtension: Extensão de tempo + enchantingCraft0: Livro Poder I + enchantingCraft1: Livro Eficiencia I + enchantingCraft2: Livro Afiada I + enchantingCraft3: Livro Protecao I + enchantingCraft4: Livro Sorte do mar I + enchantingCraft5: Livro Atrair I + enchantingCraft6: Livro Caminhante de gelo I + enchantingCraft7: Livro Profundidade Strider I + enchantingCraft8: Livro de remendos + enchantingCraft9: Livro Fortuna I + commandDesc9: Define as almas de um jogador específico + commandDesc10: Define a habilidade ou Tokens passivos na habilidade especificada para um jogador especificado + commandDesc11: Define os tokens globais para um jogador específico + commandDesc12: Salva estatísticas de todos os jogadores ou de um jogador específico + status: STATUS + complete: COMPLETO + incomplete: INCOMPLETO + try0: "tentar" + passiveImprove: Suas vantagens passivas melhoram a cada nível! + increasedBy: aumentado por + expIncrease: Multiplicador EXP + personalMultiplier: Multiplicador Pessoal + translators: Tradutores + commandDesc13: Define o multiplicador pessoal para um jogador específico + abilityDescription: Descrição de habilidade + abilityDescription_digging: Adiciona temporariamente 5 níveis de eficiência à sua pá. Ativado clicando com o botão direito em uma pá e quebrando um bloco. + abilityDescription_woodcutting: Faz com que os eixos quebrem temporariamente uma árvore inteira com uma quebra de bloco. Ativado clicando com o botão direito em um machado e quebrando um tronco. + abilityDescription_mining: Adiciona temporariamente 5 níveis de eficiência à sua picareta. Ativado clicando com o botão direito em uma picareta e depois quebrando o bloco. + abilityDescription_farming: Faz safras temporariamente quebradas com uma enxada e replanta automaticamente. Ativado ao clicar com o botão direito do mouse em uma enxada e quebrar uma colheita. + abilityDescription_fishing: Faz com que as varas de pesca capturem um peixe temporariamente. Ativado ao clicar com o botão esquerdo em uma vara de pescar e pescar na água. + abilityDescription_archery: Faz temporariamente todas as flechas serem disparadas na velocidade máxima. Ativado clicando com o botão esquerdo em um arco e depois atirando uma flecha. + abilityDescription_beastMastery: Temporariamente dá ao seu cavalo um buff de velocidade. Ativado ao clicar com o botão direito do mouse em um cavalo e depois clicar com o botão esquerdo. + abilityDescription_swordsmanship: Remove temporariamente o cooldown oscilante em espadas. Ativado ao clicar com o botão direito do mouse em uma espada e acertar um mob. + abilityDescription_defense: Fornece temporariamente ao usuário efeitos de resistência e lentidão. Ativado ao clicar com o botão direito com a mão vazia e acertar um mob. + abilityDescription_axeMastery: faz com que os machados causem danos temporariamente a todos os mobs em um determinado raio. Ativado ao clicar com o botão direito do mouse em um machado e acertar uma multidão. + alchemyPerkDesc1_0: Desbloqueia a capacidade de preparar + alchemyPerkDesc0_0: Uma mesa de artesanato pode ser usada para criar + triggerAbilities: Habilidades de gatilho + showEXPBar: Mostrar barra de EXP + disabledSkill: Esta habilidade está desativada + skillConfigDesc: Leva você ao menu de configuração para esta habilidade + lvl: Lvl. #Abreviatura para "Nível" Se o seu idioma não tem abreviatura, por favor coloque a tradução para "Nível" + exp: EXP #Abreviatura para "experiência" se o seu idioma não tiver abreviatura, coloque a tradução para "experiência" + potionAbsorption: Poção de Absorção + potionBadOmen: Poção de presságio ruim + potionBlindess: Poção dos Cegos + potionConduitPower: Poção de Energia do conduíte + potionResistance: Poção de Resistência + potionDolphinsGrace: Poção da Graça dos Golfinhos + potionHaste: Poção da Rapidez + potionFireResistance: Poção de Resistência ao Fogo + potionGlowing: Poção de brilho + potionHarm: Poção de dano + potionHealing: Poção de Cura + potionHealthBoost: Poção de aumento de saúde + potiontheHero: Poção do Herói + potionHunger: Poção da Fome + potionStrength: Poção de Força + potionInvsibility: Poção de Invsibilidade + potionJump: Poção de Salto + potionLuck: Poção da Sorte + potionNightVision: Poção de Visão Noturna + potionRegeneration: Poção de Regeneração + potionSaturation: Poção de Saturação + potionSlowness: Poção da Lentidão + potionFatigue: Poção da Fadiga + potionSlowFalling: Poção de Queda Lenta + potionSpeed: Poção de Velocidade + potionBadLuck: Poção da Má Sorte + potionWaterBreathing: Poção de Respiração de Água + potionWeakness: Poção da Fraqueza + potionDecay: Poção da Decadência + potionAwkward: Poção estranha + potionUncraftable: Poção Incrustável + potionMundane: Poção Mundana + potionTurtleMaster: Poção do Mestre da Tartaruga + potionThick: Poção Grossa + potionWater: Garrafa de agua + ingredient: Ingrediente + usedToBrew: É usado para preparar cerveja + costs: custos + xpLevel: Minecraft XP nivél + xpLevels: Minecraft XP niveís + craftXPRequirement: Esta receita requer pelo menos + bedGUI: Você não pode usar este comando enquanto está na cama! + statsUpdated: Suas estatísticas foram alteradas para serem consistentes com uma nova curva de EXP. + Todas as árvores de habilidade e vantagens passivas foram reiniciadas. Todos os tokens devem ser reinvestidos. + timeRemaining: Tempo restante + numberOfAbilityTimersDisplayed: Número de temporizadores de habilidade exibidos + commandDesc14: Redefine o período de espera de uma habilidade para 0 segundos + commandDesc15: Procura as estatísticas de FreeRPG de um jogador + repairUnsafeEnchant: Este item é muito poderoso para ser reparado + salvageUnsafeEnchant: Este item é muito poderoso para ser recuperado + rank: Classificação + stats: Status + outOf: fora de + playerNotInLeaderboard: Esse jogador não está em nenhuma tabela de classificação + virtual: Virtual + commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) - csCZ: #Translated by Pieck4444, Fractvival - languageName: Čeština - englishLanguageName: Czech Language - translationCredit: Pieck4444, Fractvival - global: Globalní přehled - digging: Kopání - woodcutting: Dřevorubectví - mining: Těžba - farming: Zemědělství - fishing: Rybaření - archery: Lukostřelba - beastMastery: Krocení zvěře - swordsmanship: Mistrovství mečů - defense: Obrana - axeMastery: Mistrovství seker - repair: Opravování - alchemy: Alchymie - agility: Obratnost - smelting: Tavení - enchanting: Čarování - information: Informace - configuration: Nastavení - level: Level - experience: Zkušenosti - toNext: další - total: Celkem - diggingPerkTitle0: Kapka dropu - diggingPerkTitle1: Dvojitá kapka - diggingPerkTitle2: Lepší dropy - diggingPerkTitle3: Zloděj duší - diggingPerkTitle4: Drtič štěrků - diggingPerkTitle5: Král lopaty - diggingPerkTitle6: Mega Kopáč - diggingPerkDesc0: Rozšíří tabulku dropů o 1 položku na level - diggingPerkDesc1: +5% šance dvojitého dropu na level - diggingPerkDesc2: Dále rozšiřuje tabulku dropů o 1 na level - diggingPerkDesc3: Písek duší je o +5% více dropů na level - diggingPerkDesc4: Štěrk má 100% na drop pazourku (přepnutí možno pomoci /flintToggle) - diggingPerkDesc5: Lopata má dvojitou sílu - diggingPerkDesc6: Při použití schopnosti rozbije 3x3 bloků - diggingPassiveTitle0: Pasivní Tokeny - diggingPassiveTitle1: Zpět - diggingPassiveTitle2: Dovednostní Tokeny - diggingPassiveTitle3: Dlouhý Kop - diggingPassiveTitle4: Šance dropů - diggingPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) - diggingPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností - diggingPassiveDesc2: Tokeny k rozvoji v seznamu dovedností - diggingPassiveDesc3: Zvýšení délku času Dlouhého Kopu o 0.02 s - diggingPassiveDesc4: Zvýšení šance na vykopání dropů o 0.005% - woodcuttingPerkTitle0: Horlivé kořeny - woodcuttingPerkTitle1: Svižné ruce - woodcuttingPerkTitle2: Skryté znalosti - woodcuttingPerkTitle3: Zametač listí - woodcuttingPerkTitle4: Drtička+ - woodcuttingPerkTitle5: Zvedač listí - woodcuttingPerkTitle6: Schopná sekera - woodcuttingPerkDesc0: +20% šance že blok kmene dropne 1 XP na level - woodcuttingPerkDesc1: +12s Spěch I za pokácení celého stromu do 5 minut od prvního seknutého kmene - woodcuttingPerkDesc2: Kmen má +0.2% šanci na level k dropu očarované knihy - woodcuttingPerkDesc3: Listy mají 1% šanci +1 drop na level - woodcuttingPerkDesc4: Limit Drtičky zvýšen o hodnotu v rozmezí 64 až 128 - woodcuttingPerkDesc5: Zničí velký kus listí pomocí sekery (přepinání pomocí /leafBlowerToggle) - woodcuttingPerkDesc6: Dvojitý drop, Horlivé kořeny a Skryté znalosti se sjednotili (s poloviční účinností) - woodcuttingPassiveTitle0: Pasivní Tokeny - woodcuttingPassiveTitle1: Zpět - woodcuttingPassiveTitle2: Dovednostní Tokeny - woodcuttingPassiveTitle3: Čas Drtičky - woodcuttingPassiveTitle4: Dvojité dropy - woodcuttingPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) - woodcuttingPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností - woodcuttingPassiveDesc2: Tokeny k rozvoji v seznamu dovedností - woodcuttingPassiveDesc3: Zvýšení délku času Drtičky o 0.02 s - woodcuttingPassiveDesc4: Zvýšení šance na dvojitý drop o 0.05% - miningPerkTitle0: Nuzný Spěch - miningPerkTitle1: Více bomb - miningPerkTitle2: Hledač pokladů - miningPerkTitle3: Bomba akce - miningPerkTitle4: Důlní mistr - miningPerkTitle5: Ničitel - miningPerkTitle6: Trojité šílenství - miningPerkDesc0: Získ spěchu po těžbě rud na level - miningPerkDesc1: Recept na TNT produkuje +1 TNT na level - miningPerkDesc2: Při použití schopnosti na kameny +1% šance dropu rud na level (expy jsou z rud) - miningPerkDesc3: Zvyšuje poloměr výbuchu TNT (při použití zapalovače) na level - miningPerkDesc4: Instatní těžba rud jedním kliknutím (přepínání-able) - miningPerkDesc5: Bez poškození z výbuchu TNT - miningPerkDesc6: Proměna z dvojitých dropů na trojité - miningPassiveTitle0: Pasivní Tokeny - miningPassiveTitle1: Zpět - miningPassiveTitle2: Dovednostní Tokeny - miningPassiveTitle3: Čas Běsnění - miningPassiveTitle4: Dvojité dropy - miningPassiveTitle5: Bombová těžba - miningPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) - miningPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností - miningPassiveDesc2: Tokeny k rozvoji v seznamu dovedností - miningPassiveDesc3: Zvýšení délky času Běsnění o 0.02s - miningPassiveDesc4: Zvýšení šance na dvojitý drop o 0.05% - miningPassiveDesc5: Zvýšení šance dropů rud z TNT exploze o 0.01% - farmingPerkTitle0: Lepší hnojivo - farmingPerkTitle1: Zvířecí farma - farmingPerkTitle2: Farmářova dieta - farmingPerkTitle3: Masožravec - farmingPerkTitle4: Zahradníkův palec - farmingPerkTitle5: Růstové hormony - farmingPerkTitle6: Spojen s přírodou - farmingPerkDesc0: +10% šance na snížení spotřeby bonemealu - farmingPerkDesc1: Možnost vycraftit dodatečné vajíčka na level - farmingPerkDesc2: Jídlo z farem o +20% snižuje efekt pocitu hladu na level - farmingPerkDesc3: Maso o +20% snižuje efekt pocitu hladu na level - farmingPerkDesc4: Vyšší šance sadby zralých plodin při znovusadbě později; Schopnost nyní platí na melouny i dýně - farmingPerkDesc5: Cukr promění zvířecí mláďata na dospělce - farmingPerkDesc6: Umožní Regeneraci I když postojíš na trávě - farmingPassiveTitle0: Pasivní Tokeny - farmingPassiveTitle1: Zpět - farmingPassiveTitle2: Dovednostní Tokeny - farmingPassiveTitle3: Čas Regenerace - farmingPassiveTitle4: Dvojitý drop (plodiny) - farmingPassiveTitle5: Dvojitý drop (zvířata) - farmingPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) - farmingPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností - farmingPassiveDesc2: Tokeny k rozvoji v seznamu dovedností - farmingPassiveDesc3: Zvýšení času Regenerace o 0.02s - farmingPassiveDesc4: Zvýšení šancí dvojitých dropů z plodin o 0.05% - farmingPassiveDesc5: Zvýšení šancí dvojitých dropů ze zvířat (pasivních) o 0.05% - fishingPerkTitle0: Pytlák - fishingPerkTitle1: Mrchožrout - fishingPerkTitle2: Rybářova dieta - fishingPerkTitle3: Filtrace - fishingPerkTitle4: Hákování - fishingPerkTitle5: Superprut - fishingPerkTitle6: Triton - fishingPerkDesc0: +15% šance k vytažení itemu na level - fishingPerkDesc1: Odemčení nových rybářských itemů - fishingPerkDesc2: Jídlo z ryb poskytne o +20% méně hladu na level - fishingPerkDesc3: Vyšší úrovně itemů (II-V) jsou častější na úkor nižších úrovní (I) - fishingPerkDesc4: Rybářský prut nyní funguje jako hák (přepínač /grappleToggle) - fishingPerkDesc5: Ryby vyskakují rovnou pečené, menší změny itemů (přepínač /hotRodToggle) - fishingPerkDesc6: Nekonečné noční vidění pod vodou, nekonečná vlídnost delfínů - fishingPassiveTitle0: Pasivní tokeny - fishingPassiveTitle1: Zpět - fishingPassiveTitle2: Dovednostní Tokeny - fishingPassiveTitle3: Čas Super návnady - fishingPassiveTitle4: Dvojité úlovky - fishingPassiveTitle5: Hledač pokladů - fishingPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) - fishingPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností - fishingPassiveDesc2: Tokeny k rozvoji v seznamu dovedností - fishingPassiveDesc3: Zvýšení času trvání Super návnady o 0.01s - fishingPassiveDesc4: Zvýšení šancí dvojitých úlovků o 0.05% - fishingPassiveDesc5: Snížení nálezů šrotu o 0.005%, zvýšení nálezu pokladu o 0.005% - archeryPerkTitle0: Extra šípy - archeryPerkTitle1: Sniper - archeryPerkTitle2: Žhavé šípy - archeryPerkTitle3: Bouchající včeličky - archeryPerkTitle4: Zhasínač draků - archeryPerkTitle5: Rychlonabíječ - archeryPerkTitle6: Smrtící dávka - archeryPerkDesc0: +1 šíp navíc k vycraftěné na level - archeryPerkDesc1: Rychlost šípů zvýšena o +2% na level (~4% poškození navíc/level) - archeryPerkDesc2: Spektrální šípy získájí +5% poškození navíc na level - archeryPerkDesc3: Šípy mají +1% šanci na explodující zásah - archeryPerkDesc4: Možnost craftit všechny šípy z běžných lektvarů namísto pokročilých - archeryPerkDesc5: Dovednost lze použít k okamžitému nabíjení šípů - archeryPerkDesc6: Ohňostroj vystřelený z luku má dvojité poškození (až 16 srdíček) - archeryPassiveTitle0: Pasivní Tokeny - archeryPassiveTitle1: Zpět - archeryPassiveTitle2: Dovednostní Tokeny - archeryPassiveTitle3: Čas Rychlonabíječe - archeryPassiveTitle4: Obnova - archeryPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) - archeryPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností - archeryPassiveDesc2: Tokeny k rozvoji v seznamu dovedností - archeryPassiveDesc3: Zvýšení času Rychlonabíjení o 0.02s - archeryPassiveDesc4: Zvýšení šance že šíp nebude ztracen o 0.05% na level - beastMasteryPerkTitle0: Hustá srst - beastMasteryPerkTitle1: Ostré zuby - beastMasteryPerkTitle2: Zdravé kousnutí - beastMasteryPerkTitle3: Držení stranou - beastMasteryPerkTitle4: Acro-Pes - beastMasteryPerkTitle5: Identifikátor - beastMasteryPerkTitle6: Adrenalin booster - beastMasteryPerkDesc0: Sníží poškození psů o -10% na level - beastMasteryPerkDesc1: Psi způsobí o +10% poškození víc na level - beastMasteryPerkDesc2: Psí uzdravení +1/2 srdíčka za level po zabití - beastMasteryPerkDesc3: Psi získají +5% šanci na zahnání nepřítele - beastMasteryPerkDesc4: Psi nedostanou poškození z pádu - beastMasteryPerkDesc5: Použití kompasu na koni či vlkovi zobrazí jejich statistiku - beastMasteryPerkDesc6: Kopnutí ostruhy má nyní rychlost III - beastMasteryPassiveTitle0: Pasivní Tokeny - beastMasteryPassiveTitle1: Zpět - beastMasteryPassiveTitle2: Dovednostní Tokeny - beastMasteryPassiveTitle3: Čas Kopnutí ostruhy - beastMasteryPassiveTitle4: Kritické kousnutí - beastMasteryPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) - beastMasteryPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností - beastMasteryPassiveDesc2: Tokeny k rozvoji v seznamu dovedností - beastMasteryPassiveDesc3: Zvýšení času Kopnutí ostruhou o 0.02s - beastMasteryPassiveDesc4: Zvyšuje šanci na krytické kousnutí psa o 0.025% - swordsmanshipPerkTitle0: Adrenalin - swordsmanshipPerkTitle1: Smrtící řádění - swordsmanshipPerkTitle2: Adrenalin+ - swordsmanshipPerkTitle3: Smrtící šílenství - swordsmanshipPerkTitle4: Touha po krvi - swordsmanshipPerkTitle5: Ostřejší! - swordsmanshipPerkTitle6: Mistrovství meče - swordsmanshipPerkDesc0: Zabíjení nepřátelských mobů mečem +2s Rychlost na level - swordsmanshipPerkDesc1: Zabíjení nepřátelských mobů mečem +2s Síla na level - swordsmanshipPerkDesc2: +20% Rychlost I z Adrenalinu je nyní Rychlost II - swordsmanshipPerkDesc3: +20% Síla I ze Smrtících běsnění je nyní Síla II - swordsmanshipPerkDesc4: Zabití určitých agresivních mobů mečem obnoví hlad - swordsmanshipPerkDesc5: Svižnost úderů teď přídá level Ostrosti do tvého meče - swordsmanshipPerkDesc6: Meče permanentně mají +1 srdíčka poškození - swordsmanshipPassiveTitle0: Pasivní Tokeny - swordsmanshipPassiveTitle1: Zpět - swordsmanshipPassiveTitle2: Dovednostní Tokeny - swordsmanshipPassiveTitle3: Čas Svižných úderů - swordsmanshipPassiveTitle4: Dvojité hitnutí - swordsmanshipPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) - swordsmanshipPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností - swordsmanshipPassiveDesc2: Tokeny k rozvoji v seznamu dovedností - swordsmanshipPassiveDesc3: Zvýšení času Svižnosti úderů o 0.02s - swordsmanshipPassiveDesc4: Zvýšení šance na dvojitý hit moba (druhý hit dá 50% poškození) o 0.02% - defensePerkTitle0: Léčitel - defensePerkTitle1: Ztuhlost - defensePerkTitle2: Tvrdost hlavy - defensePerkTitle3: Ztuhlost+ - defensePerkTitle4: Dárek shora - defensePerkTitle5: Pevnější nohy - defensePerkTitle6: Srdíčka - defensePerkDesc0: Získání +3s regenerace na level při zabití - defensePerkDesc1: Získání +2% šance Obrany I v délce 5s při hitu - defensePerkDesc2: Tvrdost těla snižuje poškození o dalších 6.6% na level - defensePerkDesc3: +2% šance na získání Obrany II v délce 5s při hitu - defensePerkDesc4: Tvrdost nyní dává 4 absorční srdíčka za délku Dovednosti +1 minuty - defensePerkDesc5: Tvrdost nyní získá Zpomalení I namísto Zpomalení IV - defensePerkDesc6: +2 srdíčka permanentně - defensePassiveTitle0: Pasivní Tokeny - defensePassiveTitle1: Zpět - defensePassiveTitle2: Dovednostní Tokeny - defensePassiveTitle3: Čas Tvrdosti - defensePassiveTitle4: Tvrdost těla - defensePassiveTitle5: Dvojitý drop (z Mobů) - defensePassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) - defensePassiveDesc1: Vrátí tě zpět do hlavního menu dovedností - defensePassiveDesc2: Tokeny k rozvoji v seznamu dovedností - defensePassiveDesc3: Zvýšení času Tvrdosti o 0.02s - defensePassiveDesc4: Zvýšení šance k zmírnění (základ -33%) poškození o 0.01% na level - defensePassiveDesc5: Zvýšení šance k získání dvojitých dropů z agresivních mobů o 0.05% - axeMasteryPerkTitle0: Velkolepá sekera - axeMasteryPerkTitle1: Posvátná sekera - axeMasteryPerkTitle2: Oživení - axeMasteryPerkTitle3: Krveláčný bojovník - axeMasteryPerkTitle4: Zemětřas - axeMasteryPerkTitle5: Vylepšené záseky - axeMasteryPerkTitle6: Bůh seker - axeMasteryPerkDesc0: Akční rádius Velkolepé sekery zvýšen o 1 blok na level - axeMasteryPerkDesc1: +2% šance zásahu moba bleskem při hitu sekerou - axeMasteryPerkDesc2: +1% šance plného healu při zabití na level - axeMasteryPerkDesc3: +3s na level Síly I při zabití sekerou - axeMasteryPerkDesc4: Schopnost AOE poškození je dvojitá (25% -> 50%) - axeMasteryPerkDesc5: Zvýšení násobiče Vylepšených záseků z 1.2x na 1.6x - axeMasteryPerkDesc6: Sekery permanentně +1 srdíčka poškození - axeMasteryPassiveTitle0: Pasivní Tokeny - axeMasteryPassiveTitle1: Zpět - axeMasteryPassiveTitle2: Dovednostní Tokeny - axeMasteryPassiveTitle3: Čas Velkolepé sekery - axeMasteryPassiveTitle4: Vylepšené záseky - axeMasteryPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) - axeMasteryPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností - axeMasteryPassiveDesc2: Tokeny k rozvoji v seznamu dovedností - axeMasteryPassiveDesc3: Zvýšení času Velkolepé sekery o 0.02s - axeMasteryPassiveDesc4: Zvýšení šance náhodných záseků (základ 1.25x) o 0.01% - repairPerkTitle0: Záchrana - repairPerkTitle1: Vynalézavost - repairPerkTitle2: Mistrovství opravování - repairPerkDesc0: Získá více materiálu ze záchran - repairPerkDesc1: +10% šance zachování použitých materiálu při opravách - repairPerkDesc2: Garance zachování očarování při opravách - repairPassiveTitle0: Zpět - repairPassiveTitle1: Dovednostní Tokeny - repairPassiveTitle2: Odbornost - repairPassiveDesc0: Vrátí tě zpět do hlavního menu dovedností - repairPassiveDesc1: Tokeny k rozvoji v seznamu dovedností - repairPassiveDesc2: Materiály vrací více trvanlivosti při opravách - agilityPerkTitle0: Úskok - agilityPerkTitle1: Ocelové kosti - agilityPerkTitle2: Půvabné chodidla - agilityPerkDesc0: +4% šance k uskočení při útoku na level - agilityPerkDesc1: -10% poškození z pádu na level - agilityPerkDesc2: Permanentní Rychlost I (přepínač /speedToggle) - agilityPassiveTitle0: Zpět - agilityPassiveTitle1: Dovednostní Tokeny - agilityPassiveTitle2: Kotoul - agilityPassiveDesc0: Vrátí tě zpět do hlavního menu dovedností - agilityPassiveDesc1: Tokeny k rozvoji v seznamu dovedností - agilityPassiveDesc2: Šance na kotoul a zmírnění poškození dopadem - alchemyPerkTitle0: Volání alchymie - alchemyPerkTitle1: Starověké znalosti - alchemyPerkTitle2: Mistr lektvarů - alchemyPerkDesc0: Umožňuje vyrábět lektvary bez vařiče - alchemyPerkDesc1: Odemkne schopnost vařit nové lektvary - alchemyPerkDesc2: Všechny použité lektvary jsou zvýšeny o 1 na level (přepínač /togglePotion) - alchemyPassiveTitle0: Zpět - alchemyPassiveTitle1: Dovednostní Tokeny - alchemyPassiveTitle2: Half-life+ - alchemyPassiveDesc0: Vrátí tě zpět do hlavního menu dovedností - alchemyPassiveDesc1: Tokeny k rozvoji v seznamu dovedností - alchemyPassiveDesc2: Zvýšení trvání lektvarů při použití - smeltingPerkTitle0: Efektivnost paliva - smeltingPerkTitle1: Dvojitá tavba - smeltingPerkTitle2: Plamenný krumpáč - smeltingPerkDesc0: Palivo trvá o +20% déle na level - smeltingPerkDesc1: +5% šance na dvojitý výpek rud na level - smeltingPerkDesc2: Vytěžená ruda instantně přetavena (přepnutí /toggleFlamePick) - smeltingPassiveTitle0: Zpět - smeltingPassiveTitle1: Dovednostní Tokeny - smeltingPassiveTitle2: Rychlost paliva - smeltingPassiveDesc0: Vrátí tě zpět do hlavního menu dovedností - smeltingPassiveDesc1: Tokeny k rozvoji v seznamu dovedností - smeltingPassiveDesc2: Zvýšení rychlosti tavení - enchantingPerkTitle0: Efektivní očarování - enchantingPerkTitle1: Receptář - enchantingPerkTitle2: Nesmrtelné zkušenosti - enchantingPerkDesc0: Levely potřebné k očarování -1 levelu, cena opravy na kovadlině -1 XP levelu - enchantingPerkDesc1: Odemkne recepty některých očarovaných knih - enchantingPerkDesc2: Zachování XP při smrti - enchantingPassiveTitle0: Zpět - enchantingPassiveTitle1: Dovednostní Tokeny - enchantingPassiveTitle2: Rychlejší vývoj - enchantingPassiveDesc0: Vrátí tě zpět do hlavního menu dovedností - enchantingPassiveDesc1: Tokeny k rozvoji v seznamu dovedností - enchantingPassiveDesc2: Všechny přijaté XP zvýšeny - globalPerkTitle0: Sběrač - globalPerkTitle1: Učenec - globalPerkTitle2: Bojovník - globalPerkTitle3: Tvrdá práce - globalPerkTitle4: Výzkum - globalPerkTitle5: Trénink - globalPerkTitle6: Reinkarnace+ - globalPerkTitle7: Sběrač duší - globalPerkTitle8: Avatar - globalPerkTitle9: Mistrovské umění - globalPerkDesc0: +20% xp získané v Kopání, Dřevorubectví, Těžení, Zemědělství a Rybáření - globalPerkDesc1: +20% xp získané v Opravování, Dovednosti, Vaření, Tavení a Čarování - globalPerkDesc2: +20% xp získané v Lukostřelbě, Krocení zvěře, Mistrovství mečů, Obraně a Mistrovství seker - globalPerkDesc3: +1 dovednostní token ve sběračských skillů - globalPerkDesc4: +1 dovednostní token ve učeneckých skillů - globalPerkDesc5: +1 dovednostní token ve bojovnických skillů - globalPerkDesc6: Při smrti, 50% šance k zachování některých hodnot položek v inventáři - globalPerkDesc7: Nyní můžeš sbírat duše z mrtvých mobů které je možno použít k navrácení dovedností (v seznamu) - globalPerkDesc8: 10% šance k zastavení poškození a získání si všech okolo na 10s při hitu který by tě normálně zabil - globalPerkDesc9: Odpočet schopností snížen o 33% - globalPassiveTitle0: Globalní Tokeny - globalPassiveTitle1: Zpět - globalPassiveDesc0: Tokeny k rozvoji v seznamu dovedností - globalPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností - cannotRepair: Nemůžeš opravovat dokud je aktivní zkušenost! - cannotSalvage: Nemůžeš teď zachraňovat když je zkušenost aktivní! - spite: Všechno zlé je k nečemu dobré a naopak - refundSkill: jsou povinni vrátit do seznamu dovedností - refundSkill2: v pořadí k návratu do seznamu dovedností - needToUnlock: Musíš odemknout - perkRequirement: Potřebuješ alespoň 2 Tokeny investované do předchozí dovednosti k odemčení této - perkRequirementM: K odemčení tohoto mistrovství potřebuješ alespoň 10 tokenů dovedností investovaných v seznamu dovedností - noSkillTokens: Nemáš žádné Tokeny - noPassiveTokens: Nemáš žádné pasivní Tokeny - maxedOutPerk: Tato dovednost je na maximu! - requiredGlobalPerks0: K odemčení této výhody potřebuješ předchozí výhodu - requiredGlobalPerks1: jsou vyžadovány k odemČení této dovednosti - requiredGlobalPerks2: je vyžadováno k odemčení této dovednosti - requiredGlobalPerks3: K odemčení této dovednosti je zapotřebí všech globálních dovedností - craftRequirement: je potřeba k vycraftění tohoto receptu - roll: KOTOUL - dodge: USKOK - prepare: Připravuješ - rest: Pokládáš - activated: v akci! - ended: ukončeno - readyToUse: je opět připraveno - cooldown: obnovení - rapidFire: Zběsilý oheň - bow: luk - greatAxe: Velkolepá sekera - axe: sekera - spurKick: Kopnutí ostruhou - leg: noha - stoneSoldier: Tvrdost - yourself: sebe - bigDig: Dlouhý kop - shovel: lopata - naturalRegeneration: Regenerace přírody - hoe: motyka - superBait: Super návnada - fishingRod: rybářský prut - berserkPick: Běsnění - pickaxe: krumpáč - swiftStrikes: Svižné údery - sword: meč - timber: Drtička - hyperHorse: Tento kůň už má hyper rychlost! - magicForce: Magická síla ukončení dovednosti - rob: Okradeno - repairFail0: Nemáš dostatečnou kvalifikaci k opravě tohoto itemu - repairFail1: Nepodařilo se ti zachránit všechen materiál - repairFail2: Nepodařilo se ti zachovat očarování - treeTooBig0: Strom je příliš velký na rozdrcení jednou ranou - treeTooBig1: Tento strom nejde srazit jednou ranou tímto způsobem - noPermission: Nemáš dostatečné oprávnění k použití příkazu - improperArguments: Nesprávné argumenty, zkus - totalPlayTime: Celkový herní čas - clickForOptions: Klikni pro nastavení - unknownCommand: Neznámý příkaz - expToLevel: EXP k dalšímu levelu - playerName: názevHráče - skillName: názevDovednosti (anglicky) - page: strana - on0: "ZAPNUTO" - off0: "VYPNUTO" - onOrOff: ZAPNOUT/VYPNOUT - manuallyToggles: Manuální přepínání - commandDesc0: Otevře hlavní nabídku se všemi dovednostmi - commandDesc1: Otevře seznam dovedností k výběru - commandDesc2: Otevře nabídku s nastavením - commandDesc3: Dá zvolenému hráči EXP v dané dovednosti - commandDesc4: Nastavuje a dá hráčům level v dané dovednosti - commandDesc5: Resetuje hráčům statistiku v dané dovednosti (nevrací statistiky) - commandDesc6: Zobrazí srovnávací tabulku pro danou statistiku - commandDesc7: Poskytne odkaz na stránku s informacemi o pluginu - commandDesc8: Pokus o očarování itemu v ruce hráče na určený level - informationURL: Informace URL (Google Docs) - click: KLIK - levelArgument: Argument úrovně musí být menší než 40 - leaderboard: Srovnávací tabulka - playerOffline: Tento hráč není online - onlyIncrease: Pouze tímto příkazem navyšuj EXP, takže, použij /frpg statReset a poté /frpg giveEXP - amount: počet - unlockToggle: K použití tohoto příkazu musíš odemknout - levelUpNotif: Notifikace o zvýšení levelu - abilityPreparationNotif: Notifikace připravenosti schopnosti - yes0: "ANO" - no0: "NE" - warning: UPOZORNĚNÍ - souls: duše - refundSkillTree0: Navrácení seznamu dovedností stojí - refundSkillTree1: a není reverzibilní, jseš si jist že to chceš - refundSkillTree2: vrátit - skill: dovednost - backToSkillTree: Návrat do seznamu dovedností - miningPerkDesc0_1: 2 sekundy Spěch po těžbě jakékoliv rudy - miningPerkDesc0_2: 5 sekund Spěch po těžbě jakékoliv rudy - miningPerkDesc0_3: 10 sekund Spěch po těžbě jakékoliv rudy - miningPerkDesc0_4: 5 sekund Spěch II po těžbě jakékoliv rudy, následované Spěch I po dobu dalších 5 sekund - miningPerkDesc0_5: 10 sekund Spěch II po těžbě jakékoliv rudy - woodcuttingPerkDesc3_1: Leaves may now drop a - common: běžný - uncommon: neobvyklý - rare: vzácný - veryRare: velmi vzácný - legendary: legendární - fishingPerkDesc1_1: Odemknutí úrovně - farmingPerkDesc1_1: Získání schopnosti - cowSpawnEgg: vajíčko s krávou - beeSpawnEgg: vajíčko se včelkou - mooshroomSpawnEgg: vajíčko s krávomůrkou - horseSpawnEgg: vajíčko s koníkem - slimeSpawnEgg: vajíčko se slizounem - diggingPerkDesc0_1: Nyní můžeš provádět kopy - defensePerkDesc0_1: Získáváš +3s regenerace na level při zabitích - defensePerkDesc0_2: Získáváš +0.5 srdíčka na level při zabitích - duration: Trvání - likelihood: Pravděpodobnost - junkChance: Šance na smetí - locked: ZAMČENO - unlocked: ODEMČENO - cowEgg: Vajíčko s krávou - beeEgg: Vajíčko se včelkou - mooshroomEgg: Vajíčko s krávomůrkou - horseEgg: Vajíčko s koníkem - slimeEgg: Vajíčko se slizounem - tippedArrows: Ostré střely - toggle: Přepínač - refundSkillTitle: Návrat dovednosti - refundSkillTreeDesc: Klikni k návratu seznamu dovednosti - enchantingPerkDesc1_0: Odemče dovednost ke craftění - enchantingPerkDesc1_1: Očarované knihy Síla I a Účinnost I (cena 1 levelu ke craftění) - enchantingPerkDesc1_2: Očarované knihy Ostrost I a Ochrana I (cena 1 levelu ke craftění) - enchantingPerkDesc1_3: Očarované knihy Štěstí moře I a Návnada I (cena 1 levelu ke craftění) - enchantingPerkDesc1_4: Očarované knihy Jako ryba ve vodě a Mrazík (cena 1 levelu ke craftění) - enchantingPerkDesc1_5: Kniha Oprava (cena 10 levelu k vycraftění) - repairPerkDesc0_1: Získání průměrem více materiálu ze záchrany - repairPerkDesc0_2: Získání průměrem více materiálu ze záchrany, záchrana nyní uschová očarování v knižce - xpBoost: XP Boost - speedBoost: Rychlost Boost - timeExtension: Prodloužení času - enchantingCraft0: Knížka Síla I - enchantingCraft1: Knížka Účinnost I - enchantingCraft2: Knížka Ostrost I - enchantingCraft3: Knížka Ochrana I - enchantingCraft4: Knížka Štěstí moře I - enchantingCraft5: Knížka Návnada I - enchantingCraft6: Knížka Mrazík I - enchantingCraft7: Knížka Jako ryba ve vodě I - enchantingCraft8: Knížka Oprava - enchantingCraft9: Knížka Štěstí I - commandDesc9: Nastaví duše danému hráči - commandDesc10: Nastaví dovednostní nebo pasivní Tokeny pro dovednost danému hráči - commandDesc11: Nastaví globální Tokeny danému hráči - commandDesc12: Uloží statistiky všech hráčů nebo daného hráče - status: STAV - complete: KOMPLETNÍ - incomplete: NEKOMPLETNÍ - try0: "zkus" - passiveImprove: Tvé pasivní Tokeny vylepšují každý level! - increasedBy: zvýšeno od - expIncrease: EXP násobič - personalMultiplier: Osobní násobič - translators: Překlady - commandDesc13: Nastaví osobní násobič daného hráče - abilityDescription: Popis dovednosti - abilityDescription_digging: Dočasně přidá 5 levelů účinnosti tvé lopatě. Aktivace pravým kliknutím lopaty o blok - abilityDescription_woodcutting: Dočasně vytvoří sekery schopné skácet strom jedním klikem. Aktivace pravým kliknutím sekery o kmen stromu - abilityDescription_mining: Dočasně přidá 5 levelů účinnosti tvého krumpáče. Aktivace pravým kliknutím krumpáče o blok - abilityDescription_farming: Dočasně vytvoření motyky schopné při sklizni rovnou zasít. Aktivace pravým kliknutím o blok políčka - abilityDescription_fishing: Dočasně vytvoří rybářské pruty schopné okamžitého úlovku. Aktivace pravým kliknutím prutu o vodu - abilityDescription_archery: Dočasně vytvoří všechny šípy o maximální rychlosti. Aktivace levým kliknutím na luk a vystřelením šípu - abilityDescription_beastMastery: Dočasně dá tvému koni maximální zrychlení. Aktivuje se pravým kliknutím na koně s následným levým kliknutím - abilityDescription_swordsmanship: Dočasně odstraní prodlevy švihu meče. Aktivace pravým kliknutím o moba (hitnutí pravým) - abilityDescription_defense: Dočasně dá uživateli efekt odporu a spomalení. Aktivace pravým kliknutím prázdné ruky a následně hitnutím moba - abilityDescription_axeMastery: Dočasně vytvoří sekery k poškození mobů v akčním radiusu. Aktivace pravým kliknutím a hitem do moba - alchemyPerkDesc1_0: Odemče schopnosti vaření - alchemyPerkDesc0_0: Tabulku receptů možno použít ke craftění - triggerAbilities: Spouštěč dovedností - showEXPBar: Zobrazí EXP Bar - disabledSkill: Tato dovednost je vypnuts - skillConfigDesc: Návrat k přehledu nastavení této dovednosti - lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" - exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" - potionAbsorption: Potion of Absorption - potionBadOmen: Potion of Bad Omen - potionBlindess: Potion of Blindess - potionConduitPower: Potion of Conduit Power - potionResistance: Potion of Resistance - potionDolphinsGrace: Potion of Dolphins Grace - potionHaste: Potion of Haste - potionFireResistance: Potion of Fire Resistance - potionGlowing: Potion of Glowing - potionHarm: Potion of Harm - potionHealing: Potion of Healing - potionHealthBoost: Potion of Health Boost - potiontheHero: Potion of the Hero - potionHunger: Potion of Hunger - potionStrength: Potion of Strength - potionInvsibility: Potion of Invsibility - potionJump: Potion of Jump - potionLuck: Potion of Luck - potionNightVision: Potion of Night Vision - potionRegeneration: Potion of Regeneration - potionSaturation: Potion of Saturation - potionSlowness: Potion of Slowness - potionFatigue: Potion of Fatigue - potionSlowFalling: Potion of Slow Falling - potionSpeed: Potion of Speed - potionBadLuck: Potion of Bad Luck - potionWaterBreathing: Potion of Water Breathing - potionWeakness: Potion of Weakness - potionDecay: Potion of Decay - potionAwkward: Awkward Potion - potionUncraftable: Uncraftable Potion - potionMundane: Mundane Potion - potionTurtleMaster: Potion of the Turtle Master - potionThick: Thick Potion - potionWater: Water Bottle - ingredient: Ingredience - usedToBrew: Je použit k vaření - costs: cena - xpLevel: Minecraft XP Level - xpLevels: Minecraft XP Levely - craftXPRequirement: Tento recept vyžaduje alespoň - bedGUI: Nemůžeš použít tento příkaz z postele - statsUpdated: Tvé statistiky byly ustanoveny dle nových nastavení pluginu. Všechny dovednosti a tokeny byly resetovány. Všechny tokeny musí být znovu vloženy. - timeRemaining: Zbývající čas - numberOfAbilityTimersDisplayed: Počet zobrazených času schopností - commandDesc14: Resety odpočtů dovedností - commandDesc15: Vyhledá statistiky hráče FreeRPG - repairUnsafeEnchant: Tento item je příliš zdobný k opravám - salvageUnsafeEnchant: Tento item je příliš zdobný k záchraně - rank: Rank - stats: statistika - outOf: z - playerNotInLeaderboard: Tento hráč nemá žádné přehledy - virtual: Virtual - commandDesc16: Mění hráčův násobič o danou hodnotu (do plusu či mínusu) + csCZ: #Translated by Pieck4444, Fractvival + languageName: Čeština + englishLanguageName: Czech Language + translationCredit: Pieck4444, Fractvival + global: Globalní přehled + digging: Kopání + woodcutting: Dřevorubectví + mining: Těžba + farming: Zemědělství + fishing: Rybaření + archery: Lukostřelba + beastMastery: Krocení zvěře + swordsmanship: Mistrovství mečů + defense: Obrana + axeMastery: Mistrovství seker + repair: Opravování + alchemy: Alchymie + agility: Obratnost + smelting: Tavení + enchanting: Čarování + information: Informace + configuration: Nastavení + level: Level + experience: Zkušenosti + toNext: další + total: Celkem + diggingPerkTitle0: Kapka dropu + diggingPerkTitle1: Dvojitá kapka + diggingPerkTitle2: Lepší dropy + diggingPerkTitle3: Zloděj duší + diggingPerkTitle4: Drtič štěrků + diggingPerkTitle5: Král lopaty + diggingPerkTitle6: Mega Kopáč + diggingPerkDesc0: Rozšíří tabulku dropů o 1 položku na level + diggingPerkDesc1: +5% šance dvojitého dropu na level + diggingPerkDesc2: Dále rozšiřuje tabulku dropů o 1 na level + diggingPerkDesc3: Písek duší je o +5% více dropů na level + diggingPerkDesc4: Štěrk má 100% na drop pazourku (přepnutí možno pomoci /flintToggle) + diggingPerkDesc5: Lopata má dvojitou sílu + diggingPerkDesc6: Při použití schopnosti rozbije 3x3 bloků + diggingPassiveTitle0: Pasivní Tokeny + diggingPassiveTitle1: Zpět + diggingPassiveTitle2: Dovednostní Tokeny + diggingPassiveTitle3: Dlouhý Kop + diggingPassiveTitle4: Šance dropů + diggingPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) + diggingPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností + diggingPassiveDesc2: Tokeny k rozvoji v seznamu dovedností + diggingPassiveDesc3: Zvýšení délku času Dlouhého Kopu o 0.02 s + diggingPassiveDesc4: Zvýšení šance na vykopání dropů o 0.005% + woodcuttingPerkTitle0: Horlivé kořeny + woodcuttingPerkTitle1: Svižné ruce + woodcuttingPerkTitle2: Skryté znalosti + woodcuttingPerkTitle3: Zametač listí + woodcuttingPerkTitle4: Drtička+ + woodcuttingPerkTitle5: Zvedač listí + woodcuttingPerkTitle6: Schopná sekera + woodcuttingPerkDesc0: +20% šance že blok kmene dropne 1 XP na level + woodcuttingPerkDesc1: +12s Spěch I za pokácení celého stromu do 5 minut od prvního seknutého kmene + woodcuttingPerkDesc2: Kmen má +0.2% šanci na level k dropu očarované knihy + woodcuttingPerkDesc3: Listy mají 1% šanci +1 drop na level + woodcuttingPerkDesc4: Limit Drtičky zvýšen o hodnotu v rozmezí 64 až 128 + woodcuttingPerkDesc5: Zničí velký kus listí pomocí sekery (přepinání pomocí /leafBlowerToggle) + woodcuttingPerkDesc6: Dvojitý drop, Horlivé kořeny a Skryté znalosti se sjednotili (s poloviční účinností) + woodcuttingPassiveTitle0: Pasivní Tokeny + woodcuttingPassiveTitle1: Zpět + woodcuttingPassiveTitle2: Dovednostní Tokeny + woodcuttingPassiveTitle3: Čas Drtičky + woodcuttingPassiveTitle4: Dvojité dropy + woodcuttingPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) + woodcuttingPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností + woodcuttingPassiveDesc2: Tokeny k rozvoji v seznamu dovedností + woodcuttingPassiveDesc3: Zvýšení délku času Drtičky o 0.02 s + woodcuttingPassiveDesc4: Zvýšení šance na dvojitý drop o 0.05% + miningPerkTitle0: Nuzný Spěch + miningPerkTitle1: Více bomb + miningPerkTitle2: Hledač pokladů + miningPerkTitle3: Bomba akce + miningPerkTitle4: Důlní mistr + miningPerkTitle5: Ničitel + miningPerkTitle6: Trojité šílenství + miningPerkDesc0: Získ spěchu po těžbě rud na level + miningPerkDesc1: Recept na TNT produkuje +1 TNT na level + miningPerkDesc2: Při použití schopnosti na kameny +1% šance dropu rud na level (expy jsou z rud) + miningPerkDesc3: Zvyšuje poloměr výbuchu TNT (při použití zapalovače) na level + miningPerkDesc4: Instatní těžba rud jedním kliknutím (přepínání-able) + miningPerkDesc5: Bez poškození z výbuchu TNT + miningPerkDesc6: Proměna z dvojitých dropů na trojité + miningPassiveTitle0: Pasivní Tokeny + miningPassiveTitle1: Zpět + miningPassiveTitle2: Dovednostní Tokeny + miningPassiveTitle3: Čas Běsnění + miningPassiveTitle4: Dvojité dropy + miningPassiveTitle5: Bombová těžba + miningPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) + miningPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností + miningPassiveDesc2: Tokeny k rozvoji v seznamu dovedností + miningPassiveDesc3: Zvýšení délky času Běsnění o 0.02s + miningPassiveDesc4: Zvýšení šance na dvojitý drop o 0.05% + miningPassiveDesc5: Zvýšení šance dropů rud z TNT exploze o 0.01% + farmingPerkTitle0: Lepší hnojivo + farmingPerkTitle1: Zvířecí farma + farmingPerkTitle2: Farmářova dieta + farmingPerkTitle3: Masožravec + farmingPerkTitle4: Zahradníkův palec + farmingPerkTitle5: Růstové hormony + farmingPerkTitle6: Spojen s přírodou + farmingPerkDesc0: +10% šance na snížení spotřeby bonemealu + farmingPerkDesc1: Možnost vycraftit dodatečné vajíčka na level + farmingPerkDesc2: Jídlo z farem o +20% snižuje efekt pocitu hladu na level + farmingPerkDesc3: Maso o +20% snižuje efekt pocitu hladu na level + farmingPerkDesc4: Vyšší šance sadby zralých plodin při znovusadbě později; Schopnost nyní platí na melouny i dýně + farmingPerkDesc5: Cukr promění zvířecí mláďata na dospělce + farmingPerkDesc6: Umožní Regeneraci I když postojíš na trávě + farmingPassiveTitle0: Pasivní Tokeny + farmingPassiveTitle1: Zpět + farmingPassiveTitle2: Dovednostní Tokeny + farmingPassiveTitle3: Čas Regenerace + farmingPassiveTitle4: Dvojitý drop (plodiny) + farmingPassiveTitle5: Dvojitý drop (zvířata) + farmingPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) + farmingPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností + farmingPassiveDesc2: Tokeny k rozvoji v seznamu dovedností + farmingPassiveDesc3: Zvýšení času Regenerace o 0.02s + farmingPassiveDesc4: Zvýšení šancí dvojitých dropů z plodin o 0.05% + farmingPassiveDesc5: Zvýšení šancí dvojitých dropů ze zvířat (pasivních) o 0.05% + fishingPerkTitle0: Pytlák + fishingPerkTitle1: Mrchožrout + fishingPerkTitle2: Rybářova dieta + fishingPerkTitle3: Filtrace + fishingPerkTitle4: Hákování + fishingPerkTitle5: Superprut + fishingPerkTitle6: Triton + fishingPerkDesc0: +15% šance k vytažení itemu na level + fishingPerkDesc1: Odemčení nových rybářských itemů + fishingPerkDesc2: Jídlo z ryb poskytne o +20% méně hladu na level + fishingPerkDesc3: Vyšší úrovně itemů (II-V) jsou častější na úkor nižších úrovní (I) + fishingPerkDesc4: Rybářský prut nyní funguje jako hák (přepínač /grappleToggle) + fishingPerkDesc5: Ryby vyskakují rovnou pečené, menší změny itemů (přepínač /hotRodToggle) + fishingPerkDesc6: Nekonečné noční vidění pod vodou, nekonečná vlídnost delfínů + fishingPassiveTitle0: Pasivní tokeny + fishingPassiveTitle1: Zpět + fishingPassiveTitle2: Dovednostní Tokeny + fishingPassiveTitle3: Čas Super návnady + fishingPassiveTitle4: Dvojité úlovky + fishingPassiveTitle5: Hledač pokladů + fishingPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) + fishingPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností + fishingPassiveDesc2: Tokeny k rozvoji v seznamu dovedností + fishingPassiveDesc3: Zvýšení času trvání Super návnady o 0.01s + fishingPassiveDesc4: Zvýšení šancí dvojitých úlovků o 0.05% + fishingPassiveDesc5: Snížení nálezů šrotu o 0.005%, zvýšení nálezu pokladu o 0.005% + archeryPerkTitle0: Extra šípy + archeryPerkTitle1: Sniper + archeryPerkTitle2: Žhavé šípy + archeryPerkTitle3: Bouchající včeličky + archeryPerkTitle4: Zhasínač draků + archeryPerkTitle5: Rychlonabíječ + archeryPerkTitle6: Smrtící dávka + archeryPerkDesc0: +1 šíp navíc k vycraftěné na level + archeryPerkDesc1: Rychlost šípů zvýšena o +2% na level (~4% poškození navíc/level) + archeryPerkDesc2: Spektrální šípy získájí +5% poškození navíc na level + archeryPerkDesc3: Šípy mají +1% šanci na explodující zásah + archeryPerkDesc4: Možnost craftit všechny šípy z běžných lektvarů namísto pokročilých + archeryPerkDesc5: Dovednost lze použít k okamžitému nabíjení šípů + archeryPerkDesc6: Ohňostroj vystřelený z luku má dvojité poškození (až 16 srdíček) + archeryPassiveTitle0: Pasivní Tokeny + archeryPassiveTitle1: Zpět + archeryPassiveTitle2: Dovednostní Tokeny + archeryPassiveTitle3: Čas Rychlonabíječe + archeryPassiveTitle4: Obnova + archeryPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) + archeryPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností + archeryPassiveDesc2: Tokeny k rozvoji v seznamu dovedností + archeryPassiveDesc3: Zvýšení času Rychlonabíjení o 0.02s + archeryPassiveDesc4: Zvýšení šance že šíp nebude ztracen o 0.05% na level + beastMasteryPerkTitle0: Hustá srst + beastMasteryPerkTitle1: Ostré zuby + beastMasteryPerkTitle2: Zdravé kousnutí + beastMasteryPerkTitle3: Držení stranou + beastMasteryPerkTitle4: Acro-Pes + beastMasteryPerkTitle5: Identifikátor + beastMasteryPerkTitle6: Adrenalin booster + beastMasteryPerkDesc0: Sníží poškození psů o -10% na level + beastMasteryPerkDesc1: Psi způsobí o +10% poškození víc na level + beastMasteryPerkDesc2: Psí uzdravení +1/2 srdíčka za level po zabití + beastMasteryPerkDesc3: Psi získají +5% šanci na zahnání nepřítele + beastMasteryPerkDesc4: Psi nedostanou poškození z pádu + beastMasteryPerkDesc5: Použití kompasu na koni či vlkovi zobrazí jejich statistiku + beastMasteryPerkDesc6: Kopnutí ostruhy má nyní rychlost III + beastMasteryPassiveTitle0: Pasivní Tokeny + beastMasteryPassiveTitle1: Zpět + beastMasteryPassiveTitle2: Dovednostní Tokeny + beastMasteryPassiveTitle3: Čas Kopnutí ostruhy + beastMasteryPassiveTitle4: Kritické kousnutí + beastMasteryPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) + beastMasteryPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností + beastMasteryPassiveDesc2: Tokeny k rozvoji v seznamu dovedností + beastMasteryPassiveDesc3: Zvýšení času Kopnutí ostruhou o 0.02s + beastMasteryPassiveDesc4: Zvyšuje šanci na krytické kousnutí psa o 0.025% + swordsmanshipPerkTitle0: Adrenalin + swordsmanshipPerkTitle1: Smrtící řádění + swordsmanshipPerkTitle2: Adrenalin+ + swordsmanshipPerkTitle3: Smrtící šílenství + swordsmanshipPerkTitle4: Touha po krvi + swordsmanshipPerkTitle5: Ostřejší! + swordsmanshipPerkTitle6: Mistrovství meče + swordsmanshipPerkDesc0: Zabíjení nepřátelských mobů mečem +2s Rychlost na level + swordsmanshipPerkDesc1: Zabíjení nepřátelských mobů mečem +2s Síla na level + swordsmanshipPerkDesc2: +20% Rychlost I z Adrenalinu je nyní Rychlost II + swordsmanshipPerkDesc3: +20% Síla I ze Smrtících běsnění je nyní Síla II + swordsmanshipPerkDesc4: Zabití určitých agresivních mobů mečem obnoví hlad + swordsmanshipPerkDesc5: Svižnost úderů teď přídá level Ostrosti do tvého meče + swordsmanshipPerkDesc6: Meče permanentně mají +1 srdíčka poškození + swordsmanshipPassiveTitle0: Pasivní Tokeny + swordsmanshipPassiveTitle1: Zpět + swordsmanshipPassiveTitle2: Dovednostní Tokeny + swordsmanshipPassiveTitle3: Čas Svižných úderů + swordsmanshipPassiveTitle4: Dvojité hitnutí + swordsmanshipPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) + swordsmanshipPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností + swordsmanshipPassiveDesc2: Tokeny k rozvoji v seznamu dovedností + swordsmanshipPassiveDesc3: Zvýšení času Svižnosti úderů o 0.02s + swordsmanshipPassiveDesc4: Zvýšení šance na dvojitý hit moba (druhý hit dá 50% poškození) o 0.02% + defensePerkTitle0: Léčitel + defensePerkTitle1: Ztuhlost + defensePerkTitle2: Tvrdost hlavy + defensePerkTitle3: Ztuhlost+ + defensePerkTitle4: Dárek shora + defensePerkTitle5: Pevnější nohy + defensePerkTitle6: Srdíčka + defensePerkDesc0: Získání +3s regenerace na level při zabití + defensePerkDesc1: Získání +2% šance Obrany I v délce 5s při hitu + defensePerkDesc2: Tvrdost těla snižuje poškození o dalších 6.6% na level + defensePerkDesc3: +2% šance na získání Obrany II v délce 5s při hitu + defensePerkDesc4: Tvrdost nyní dává 4 absorční srdíčka za délku Dovednosti +1 minuty + defensePerkDesc5: Tvrdost nyní získá Zpomalení I namísto Zpomalení IV + defensePerkDesc6: +2 srdíčka permanentně + defensePassiveTitle0: Pasivní Tokeny + defensePassiveTitle1: Zpět + defensePassiveTitle2: Dovednostní Tokeny + defensePassiveTitle3: Čas Tvrdosti + defensePassiveTitle4: Tvrdost těla + defensePassiveTitle5: Dvojitý drop (z Mobů) + defensePassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) + defensePassiveDesc1: Vrátí tě zpět do hlavního menu dovedností + defensePassiveDesc2: Tokeny k rozvoji v seznamu dovedností + defensePassiveDesc3: Zvýšení času Tvrdosti o 0.02s + defensePassiveDesc4: Zvýšení šance k zmírnění (základ -33%) poškození o 0.01% na level + defensePassiveDesc5: Zvýšení šance k získání dvojitých dropů z agresivních mobů o 0.05% + axeMasteryPerkTitle0: Velkolepá sekera + axeMasteryPerkTitle1: Posvátná sekera + axeMasteryPerkTitle2: Oživení + axeMasteryPerkTitle3: Krveláčný bojovník + axeMasteryPerkTitle4: Zemětřas + axeMasteryPerkTitle5: Vylepšené záseky + axeMasteryPerkTitle6: Bůh seker + axeMasteryPerkDesc0: Akční rádius Velkolepé sekery zvýšen o 1 blok na level + axeMasteryPerkDesc1: +2% šance zásahu moba bleskem při hitu sekerou + axeMasteryPerkDesc2: +1% šance plného healu při zabití na level + axeMasteryPerkDesc3: +3s na level Síly I při zabití sekerou + axeMasteryPerkDesc4: Schopnost AOE poškození je dvojitá (25% -> 50%) + axeMasteryPerkDesc5: Zvýšení násobiče Vylepšených záseků z 1.2x na 1.6x + axeMasteryPerkDesc6: Sekery permanentně +1 srdíčka poškození + axeMasteryPassiveTitle0: Pasivní Tokeny + axeMasteryPassiveTitle1: Zpět + axeMasteryPassiveTitle2: Dovednostní Tokeny + axeMasteryPassiveTitle3: Čas Velkolepé sekery + axeMasteryPassiveTitle4: Vylepšené záseky + axeMasteryPassiveDesc0: Tokeny k rozvoji pasivních dovedností (barviva) + axeMasteryPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností + axeMasteryPassiveDesc2: Tokeny k rozvoji v seznamu dovedností + axeMasteryPassiveDesc3: Zvýšení času Velkolepé sekery o 0.02s + axeMasteryPassiveDesc4: Zvýšení šance náhodných záseků (základ 1.25x) o 0.01% + repairPerkTitle0: Záchrana + repairPerkTitle1: Vynalézavost + repairPerkTitle2: Mistrovství opravování + repairPerkDesc0: Získá více materiálu ze záchran + repairPerkDesc1: +10% šance zachování použitých materiálu při opravách + repairPerkDesc2: Garance zachování očarování při opravách + repairPassiveTitle0: Zpět + repairPassiveTitle1: Dovednostní Tokeny + repairPassiveTitle2: Odbornost + repairPassiveDesc0: Vrátí tě zpět do hlavního menu dovedností + repairPassiveDesc1: Tokeny k rozvoji v seznamu dovedností + repairPassiveDesc2: Materiály vrací více trvanlivosti při opravách + agilityPerkTitle0: Úskok + agilityPerkTitle1: Ocelové kosti + agilityPerkTitle2: Půvabné chodidla + agilityPerkDesc0: +4% šance k uskočení při útoku na level + agilityPerkDesc1: -10% poškození z pádu na level + agilityPerkDesc2: Permanentní Rychlost I (přepínač /speedToggle) + agilityPassiveTitle0: Zpět + agilityPassiveTitle1: Dovednostní Tokeny + agilityPassiveTitle2: Kotoul + agilityPassiveDesc0: Vrátí tě zpět do hlavního menu dovedností + agilityPassiveDesc1: Tokeny k rozvoji v seznamu dovedností + agilityPassiveDesc2: Šance na kotoul a zmírnění poškození dopadem + alchemyPerkTitle0: Volání alchymie + alchemyPerkTitle1: Starověké znalosti + alchemyPerkTitle2: Mistr lektvarů + alchemyPerkDesc0: Umožňuje vyrábět lektvary bez vařiče + alchemyPerkDesc1: Odemkne schopnost vařit nové lektvary + alchemyPerkDesc2: Všechny použité lektvary jsou zvýšeny o 1 na level (přepínač /togglePotion) + alchemyPassiveTitle0: Zpět + alchemyPassiveTitle1: Dovednostní Tokeny + alchemyPassiveTitle2: Half-life+ + alchemyPassiveDesc0: Vrátí tě zpět do hlavního menu dovedností + alchemyPassiveDesc1: Tokeny k rozvoji v seznamu dovedností + alchemyPassiveDesc2: Zvýšení trvání lektvarů při použití + smeltingPerkTitle0: Efektivnost paliva + smeltingPerkTitle1: Dvojitá tavba + smeltingPerkTitle2: Plamenný krumpáč + smeltingPerkDesc0: Palivo trvá o +20% déle na level + smeltingPerkDesc1: +5% šance na dvojitý výpek rud na level + smeltingPerkDesc2: Vytěžená ruda instantně přetavena (přepnutí /toggleFlamePick) + smeltingPassiveTitle0: Zpět + smeltingPassiveTitle1: Dovednostní Tokeny + smeltingPassiveTitle2: Rychlost paliva + smeltingPassiveDesc0: Vrátí tě zpět do hlavního menu dovedností + smeltingPassiveDesc1: Tokeny k rozvoji v seznamu dovedností + smeltingPassiveDesc2: Zvýšení rychlosti tavení + enchantingPerkTitle0: Efektivní očarování + enchantingPerkTitle1: Receptář + enchantingPerkTitle2: Nesmrtelné zkušenosti + enchantingPerkDesc0: Levely potřebné k očarování -1 levelu, cena opravy na kovadlině -1 XP levelu + enchantingPerkDesc1: Odemkne recepty některých očarovaných knih + enchantingPerkDesc2: Zachování XP při smrti + enchantingPassiveTitle0: Zpět + enchantingPassiveTitle1: Dovednostní Tokeny + enchantingPassiveTitle2: Rychlejší vývoj + enchantingPassiveDesc0: Vrátí tě zpět do hlavního menu dovedností + enchantingPassiveDesc1: Tokeny k rozvoji v seznamu dovedností + enchantingPassiveDesc2: Všechny přijaté XP zvýšeny + globalPerkTitle0: Sběrač + globalPerkTitle1: Učenec + globalPerkTitle2: Bojovník + globalPerkTitle3: Tvrdá práce + globalPerkTitle4: Výzkum + globalPerkTitle5: Trénink + globalPerkTitle6: Reinkarnace+ + globalPerkTitle7: Sběrač duší + globalPerkTitle8: Avatar + globalPerkTitle9: Mistrovské umění + globalPerkDesc0: +20% xp získané v Kopání, Dřevorubectví, Těžení, Zemědělství a Rybáření + globalPerkDesc1: +20% xp získané v Opravování, Dovednosti, Vaření, Tavení a Čarování + globalPerkDesc2: +20% xp získané v Lukostřelbě, Krocení zvěře, Mistrovství mečů, Obraně a Mistrovství seker + globalPerkDesc3: +1 dovednostní token ve sběračských skillů + globalPerkDesc4: +1 dovednostní token ve učeneckých skillů + globalPerkDesc5: +1 dovednostní token ve bojovnických skillů + globalPerkDesc6: Při smrti, 50% šance k zachování některých hodnot položek v inventáři + globalPerkDesc7: Nyní můžeš sbírat duše z mrtvých mobů které je možno použít k navrácení dovedností (v seznamu) + globalPerkDesc8: 10% šance k zastavení poškození a získání si všech okolo na 10s při hitu který by tě normálně zabil + globalPerkDesc9: Odpočet schopností snížen o 33% + globalPassiveTitle0: Globalní Tokeny + globalPassiveTitle1: Zpět + globalPassiveDesc0: Tokeny k rozvoji v seznamu dovedností + globalPassiveDesc1: Vrátí tě zpět do hlavního menu dovedností + cannotRepair: Nemůžeš opravovat dokud je aktivní zkušenost! + cannotSalvage: Nemůžeš teď zachraňovat když je zkušenost aktivní! + spite: Všechno zlé je k nečemu dobré a naopak + refundSkill: jsou povinni vrátit do seznamu dovedností + refundSkill2: v pořadí k návratu do seznamu dovedností + needToUnlock: Musíš odemknout + perkRequirement: Potřebuješ alespoň 2 Tokeny investované do předchozí dovednosti k odemčení této + perkRequirementM: K odemčení tohoto mistrovství potřebuješ alespoň 10 tokenů dovedností investovaných v seznamu dovedností + noSkillTokens: Nemáš žádné Tokeny + noPassiveTokens: Nemáš žádné pasivní Tokeny + maxedOutPerk: Tato dovednost je na maximu! + requiredGlobalPerks0: K odemčení této výhody potřebuješ předchozí výhodu + requiredGlobalPerks1: jsou vyžadovány k odemČení této dovednosti + requiredGlobalPerks2: je vyžadováno k odemčení této dovednosti + requiredGlobalPerks3: K odemčení této dovednosti je zapotřebí všech globálních dovedností + craftRequirement: je potřeba k vycraftění tohoto receptu + roll: KOTOUL + dodge: USKOK + prepare: Připravuješ + rest: Pokládáš + activated: v akci! + ended: ukončeno + readyToUse: je opět připraveno + cooldown: obnovení + rapidFire: Zběsilý oheň + bow: luk + greatAxe: Velkolepá sekera + axe: sekera + spurKick: Kopnutí ostruhou + leg: noha + stoneSoldier: Tvrdost + yourself: sebe + bigDig: Dlouhý kop + shovel: lopata + naturalRegeneration: Regenerace přírody + hoe: motyka + superBait: Super návnada + fishingRod: rybářský prut + berserkPick: Běsnění + pickaxe: krumpáč + swiftStrikes: Svižné údery + sword: meč + timber: Drtička + hyperHorse: Tento kůň už má hyper rychlost! + magicForce: Magická síla ukončení dovednosti + rob: Okradeno + repairFail0: Nemáš dostatečnou kvalifikaci k opravě tohoto itemu + repairFail1: Nepodařilo se ti zachránit všechen materiál + repairFail2: Nepodařilo se ti zachovat očarování + treeTooBig0: Strom je příliš velký na rozdrcení jednou ranou + treeTooBig1: Tento strom nejde srazit jednou ranou tímto způsobem + noPermission: Nemáš dostatečné oprávnění k použití příkazu + improperArguments: Nesprávné argumenty, zkus + totalPlayTime: Celkový herní čas + clickForOptions: Klikni pro nastavení + unknownCommand: Neznámý příkaz + expToLevel: EXP k dalšímu levelu + playerName: názevHráče + skillName: názevDovednosti (anglicky) + page: strana + on0: "ZAPNUTO" + off0: "VYPNUTO" + onOrOff: ZAPNOUT/VYPNOUT + manuallyToggles: Manuální přepínání + commandDesc0: Otevře hlavní nabídku se všemi dovednostmi + commandDesc1: Otevře seznam dovedností k výběru + commandDesc2: Otevře nabídku s nastavením + commandDesc3: Dá zvolenému hráči EXP v dané dovednosti + commandDesc4: Nastavuje a dá hráčům level v dané dovednosti + commandDesc5: Resetuje hráčům statistiku v dané dovednosti (nevrací statistiky) + commandDesc6: Zobrazí srovnávací tabulku pro danou statistiku + commandDesc7: Poskytne odkaz na stránku s informacemi o pluginu + commandDesc8: Pokus o očarování itemu v ruce hráče na určený level + informationURL: Informace URL (Google Docs) + click: KLIK + levelArgument: Argument úrovně musí být menší než 40 + leaderboard: Srovnávací tabulka + playerOffline: Tento hráč není online + onlyIncrease: Pouze tímto příkazem navyšuj EXP, takže, použij /frpg statReset a poté /frpg giveEXP + amount: počet + unlockToggle: K použití tohoto příkazu musíš odemknout + levelUpNotif: Notifikace o zvýšení levelu + abilityPreparationNotif: Notifikace připravenosti schopnosti + yes0: "ANO" + no0: "NE" + warning: UPOZORNĚNÍ + souls: duše + refundSkillTree0: Navrácení seznamu dovedností stojí + refundSkillTree1: a není reverzibilní, jseš si jist že to chceš + refundSkillTree2: vrátit + skill: dovednost + backToSkillTree: Návrat do seznamu dovedností + miningPerkDesc0_1: 2 sekundy Spěch po těžbě jakékoliv rudy + miningPerkDesc0_2: 5 sekund Spěch po těžbě jakékoliv rudy + miningPerkDesc0_3: 10 sekund Spěch po těžbě jakékoliv rudy + miningPerkDesc0_4: 5 sekund Spěch II po těžbě jakékoliv rudy, následované Spěch I po dobu dalších 5 sekund + miningPerkDesc0_5: 10 sekund Spěch II po těžbě jakékoliv rudy + woodcuttingPerkDesc3_1: Leaves may now drop a + common: běžný + uncommon: neobvyklý + rare: vzácný + veryRare: velmi vzácný + legendary: legendární + fishingPerkDesc1_1: Odemknutí úrovně + farmingPerkDesc1_1: Získání schopnosti + cowSpawnEgg: vajíčko s krávou + beeSpawnEgg: vajíčko se včelkou + mooshroomSpawnEgg: vajíčko s krávomůrkou + horseSpawnEgg: vajíčko s koníkem + slimeSpawnEgg: vajíčko se slizounem + diggingPerkDesc0_1: Nyní můžeš provádět kopy + defensePerkDesc0_1: Získáváš +3s regenerace na level při zabitích + defensePerkDesc0_2: Získáváš +0.5 srdíčka na level při zabitích + duration: Trvání + likelihood: Pravděpodobnost + junkChance: Šance na smetí + locked: ZAMČENO + unlocked: ODEMČENO + cowEgg: Vajíčko s krávou + beeEgg: Vajíčko se včelkou + mooshroomEgg: Vajíčko s krávomůrkou + horseEgg: Vajíčko s koníkem + slimeEgg: Vajíčko se slizounem + tippedArrows: Ostré střely + toggle: Přepínač + refundSkillTitle: Návrat dovednosti + refundSkillTreeDesc: Klikni k návratu seznamu dovednosti + enchantingPerkDesc1_0: Odemče dovednost ke craftění + enchantingPerkDesc1_1: Očarované knihy Síla I a Účinnost I (cena 1 levelu ke craftění) + enchantingPerkDesc1_2: Očarované knihy Ostrost I a Ochrana I (cena 1 levelu ke craftění) + enchantingPerkDesc1_3: Očarované knihy Štěstí moře I a Návnada I (cena 1 levelu ke craftění) + enchantingPerkDesc1_4: Očarované knihy Jako ryba ve vodě a Mrazík (cena 1 levelu ke craftění) + enchantingPerkDesc1_5: Kniha Oprava (cena 10 levelu k vycraftění) + repairPerkDesc0_1: Získání průměrem více materiálu ze záchrany + repairPerkDesc0_2: Získání průměrem více materiálu ze záchrany, záchrana nyní uschová očarování v knižce + xpBoost: XP Boost + speedBoost: Rychlost Boost + timeExtension: Prodloužení času + enchantingCraft0: Knížka Síla I + enchantingCraft1: Knížka Účinnost I + enchantingCraft2: Knížka Ostrost I + enchantingCraft3: Knížka Ochrana I + enchantingCraft4: Knížka Štěstí moře I + enchantingCraft5: Knížka Návnada I + enchantingCraft6: Knížka Mrazík I + enchantingCraft7: Knížka Jako ryba ve vodě I + enchantingCraft8: Knížka Oprava + enchantingCraft9: Knížka Štěstí I + commandDesc9: Nastaví duše danému hráči + commandDesc10: Nastaví dovednostní nebo pasivní Tokeny pro dovednost danému hráči + commandDesc11: Nastaví globální Tokeny danému hráči + commandDesc12: Uloží statistiky všech hráčů nebo daného hráče + status: STAV + complete: KOMPLETNÍ + incomplete: NEKOMPLETNÍ + try0: "zkus" + passiveImprove: Tvé pasivní Tokeny vylepšují každý level! + increasedBy: zvýšeno od + expIncrease: EXP násobič + personalMultiplier: Osobní násobič + translators: Překlady + commandDesc13: Nastaví osobní násobič daného hráče + abilityDescription: Popis dovednosti + abilityDescription_digging: Dočasně přidá 5 levelů účinnosti tvé lopatě. Aktivace pravým kliknutím lopaty o blok + abilityDescription_woodcutting: Dočasně vytvoří sekery schopné skácet strom jedním klikem. Aktivace pravým kliknutím sekery o kmen stromu + abilityDescription_mining: Dočasně přidá 5 levelů účinnosti tvého krumpáče. Aktivace pravým kliknutím krumpáče o blok + abilityDescription_farming: Dočasně vytvoření motyky schopné při sklizni rovnou zasít. Aktivace pravým kliknutím o blok políčka + abilityDescription_fishing: Dočasně vytvoří rybářské pruty schopné okamžitého úlovku. Aktivace pravým kliknutím prutu o vodu + abilityDescription_archery: Dočasně vytvoří všechny šípy o maximální rychlosti. Aktivace levým kliknutím na luk a vystřelením šípu + abilityDescription_beastMastery: Dočasně dá tvému koni maximální zrychlení. Aktivuje se pravým kliknutím na koně s následným levým kliknutím + abilityDescription_swordsmanship: Dočasně odstraní prodlevy švihu meče. Aktivace pravým kliknutím o moba (hitnutí pravým) + abilityDescription_defense: Dočasně dá uživateli efekt odporu a spomalení. Aktivace pravým kliknutím prázdné ruky a následně hitnutím moba + abilityDescription_axeMastery: Dočasně vytvoří sekery k poškození mobů v akčním radiusu. Aktivace pravým kliknutím a hitem do moba + alchemyPerkDesc1_0: Odemče schopnosti vaření + alchemyPerkDesc0_0: Tabulku receptů možno použít ke craftění + triggerAbilities: Spouštěč dovedností + showEXPBar: Zobrazí EXP Bar + disabledSkill: Tato dovednost je vypnuts + skillConfigDesc: Návrat k přehledu nastavení této dovednosti + lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" + exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" + potionAbsorption: Potion of Absorption + potionBadOmen: Potion of Bad Omen + potionBlindess: Potion of Blindess + potionConduitPower: Potion of Conduit Power + potionResistance: Potion of Resistance + potionDolphinsGrace: Potion of Dolphins Grace + potionHaste: Potion of Haste + potionFireResistance: Potion of Fire Resistance + potionGlowing: Potion of Glowing + potionHarm: Potion of Harm + potionHealing: Potion of Healing + potionHealthBoost: Potion of Health Boost + potiontheHero: Potion of the Hero + potionHunger: Potion of Hunger + potionStrength: Potion of Strength + potionInvsibility: Potion of Invsibility + potionJump: Potion of Jump + potionLuck: Potion of Luck + potionNightVision: Potion of Night Vision + potionRegeneration: Potion of Regeneration + potionSaturation: Potion of Saturation + potionSlowness: Potion of Slowness + potionFatigue: Potion of Fatigue + potionSlowFalling: Potion of Slow Falling + potionSpeed: Potion of Speed + potionBadLuck: Potion of Bad Luck + potionWaterBreathing: Potion of Water Breathing + potionWeakness: Potion of Weakness + potionDecay: Potion of Decay + potionAwkward: Awkward Potion + potionUncraftable: Uncraftable Potion + potionMundane: Mundane Potion + potionTurtleMaster: Potion of the Turtle Master + potionThick: Thick Potion + potionWater: Water Bottle + ingredient: Ingredience + usedToBrew: Je použit k vaření + costs: cena + xpLevel: Minecraft XP Level + xpLevels: Minecraft XP Levely + craftXPRequirement: Tento recept vyžaduje alespoň + bedGUI: Nemůžeš použít tento příkaz z postele + statsUpdated: Tvé statistiky byly ustanoveny dle nových nastavení pluginu. Všechny dovednosti a tokeny byly resetovány. Všechny tokeny musí být znovu vloženy. + timeRemaining: Zbývající čas + numberOfAbilityTimersDisplayed: Počet zobrazených času schopností + commandDesc14: Resety odpočtů dovedností + commandDesc15: Vyhledá statistiky hráče FreeRPG + repairUnsafeEnchant: Tento item je příliš zdobný k opravám + salvageUnsafeEnchant: Tento item je příliš zdobný k záchraně + rank: Rank + stats: statistika + outOf: z + playerNotInLeaderboard: Tento hráč nemá žádné přehledy + virtual: Virtual + commandDesc16: Mění hráčův násobič o danou hodnotu (do plusu či mínusu) - koKR: #Translated by Re_Oh - languageName: 한국어 - englishLanguageName: Korean Language - translationCredit: Re_Oh - global: 글로벌 스킬 - digging: 토굴 - woodcutting: 벌목 - mining: 채광 - farming: 농사 - fishing: 낚시 - archery: 궁술 - beastMastery: 야수 마스터리 - swordsmanship: 검술 - defense: 방어 - axeMastery: 도끼 마스터리 - repair: 수리 - alchemy: 연금술 - agility: 민첩 - smelting: 제련 - enchanting: 인첸트 - information: 정보 - configuration: 설정 - level: 레벨 - experience: 경험치휙득 - toNext: 다음 - total: 합계 - diggingPerkTitle0: Mo' drops [ 많은 드랍 ] - diggingPerkTitle1: Double Treasure [ 보물 두배 ] - diggingPerkTitle2: Rarer Drops [ 레어 드랍 ] - diggingPerkTitle3: Soul Stealer [ 영혼 수확자 ] - diggingPerkTitle4: Flint Finder [ 부싯돌을 찾는자 ] - diggingPerkTitle5: Shovel Knight [ 삽의 기사 ] - diggingPerkTitle6: Mega Dig [ M!E!G!A! 채굴 ] - diggingPerkDesc0: 레벨당 1개의 아이템의 보물 드랍 테이블을 확장 - diggingPerkDesc1: 레벨당 보물을 두배로 휙득할 확률이 5% 증가함 (when - treasure is rolled) - diggingPerkDesc2: 레벨당 아이템의 휙득 드랍테이블 을 추가 확장 - diggingPerkDesc3: 영혼 모래에서 보물을 떨어뜨릴 확률이 레벨당 5% 증가합니다 - diggingPerkDesc4: 자갈에서 100% 확률로 부싯돌을 드랍함 (명령어 /flintToggle) - diggingPerkDesc5: 삽으로 공격시 두배의 피해를 가합니다. - diggingPerkDesc6: 능력을 사용할때, 당신은 3x3의 블럭크기만큼 캘수잇습니다. ( 활성화시 보물휙득 - 확률을 20%만 적용함) - diggingPassiveTitle0: 패시브 토큰 - diggingPassiveTitle1: 뒤로 - diggingPassiveTitle2: 스킬 토큰 - diggingPassiveTitle3: Big Dig 지속시간 - diggingPassiveTitle4: Treasure Chance [ 보물 찬스 ] - diggingPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) - diggingPassiveDesc1: 주요 스킬 메뉴로 돌아가기 - diggingPassiveDesc2: 스킬 트리에 투자할 토큰 - diggingPassiveDesc3: Big Dig 지속 시간 0.02초 증가 - diggingPassiveDesc4: 보물 발굴 가능성 0.005% 증가 - woodcuttingPerkTitle0: Zealous Roots [ 정성을 다한 뿌리 ] - woodcuttingPerkTitle1: Fresh Arms [ 신선한 팔 ] - woodcuttingPerkTitle2: Hidden Knowledge [ 숨겨진 지식 ] - woodcuttingPerkTitle3: Leaf Scavenger [ 나뭇잎을 뒤져보는사람 ] - woodcuttingPerkTitle4: Timber+ [ 팀버 + ] - woodcuttingPerkTitle5: Leaf Blower [ 나뭇잎을 부는자 ] - woodcuttingPerkTitle6: Able Axe [ 도끼에 재능잇는자 ] - woodcuttingPerkDesc0: 레벨당 20% 확률로 나무에서 경험치 1 을 드랍합니다. - woodcuttingPerkDesc1: 5분안에 첫 나무를 벌복시에 헤이스트 1 효과를 레벨당 12초씩 받습니다. - woodcuttingPerkDesc2: 레벨당 0.2% 확률로 나무에서 인첸트북을 드랍합니다. - woodcuttingPerkDesc3: 레벨당 1개의 보물 아이템을 1% 확률로 나뭇잎에서 드랍합니다 - woodcuttingPerkDesc4: Timber break 제한이 64 개에서 128 개로 증가합니다. - woodcuttingPerkDesc5: 도끼로 나뭇잎을 많이 부술수 잇습니다. ( 명령어 on, off - - /leafBlowerToggle) - woodcuttingPerkDesc6: Timber 스킬효과를 모든 벌목스킬에 적용합니다. ( 절반의 효과만 ) - woodcuttingPassiveTitle0: 패시브 토큰 - woodcuttingPassiveTitle1: 뒤로 - woodcuttingPassiveTitle2: 스킬 토큰 - woodcuttingPassiveTitle3: Timber Duration - woodcuttingPassiveTitle4: Double Drops - woodcuttingPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) - woodcuttingPassiveDesc1: 주요 스킬 메뉴로 돌아가기 - woodcuttingPassiveDesc2: 스킬 트리에 투자할 토큰 - woodcuttingPassiveDesc3: Timber 스킬의 지속시간이 0.02초 증가 - woodcuttingPassiveDesc4: 두배로 드랍하는 확률을 0.05% 증가시킵니다. - miningPerkTitle0: Wasteless Haste [ 낭비하지않는 성급함 ] - miningPerkTitle1: More Bombs [ 더많은 폭격 ] - miningPerkTitle2: Treasure Seeker [ 보물 발견자 ] - miningPerkTitle3: Bomb-boyage [ 폭격-여행 ] - miningPerkTitle4: Vein Miner - miningPerkTitle5: Demolition Man [ 파괴하는 사람 ] - miningPerkTitle6: Triple Trouble - miningPerkDesc0: 채광시 각 레벨당 헤이스트 효과를 얻음 - miningPerkDesc1: 조합해서 만든 TNT 의 파괴력을 레벨당 1개 크기의 TNT를 더 터트린다 - miningPerkDesc2: 능력을 사용후 돌을 캐면, 1레벨당 1%확률로 광석이 드랍됨 - (추가 경험치는 광석으로 드랍됨) - miningPerkDesc3: 레벨당 TNT 터지는 반경 증가 ( 부싯돌로 점화시에만 ) - miningPerkDesc4: 광물을 캐면 그광물과 연결되잇는 광물들이 한번에 채굴됨 (on/off 가능) - miningPerkDesc5: TNT 폭발시 자신은 데미지를 입지않음 - miningPerkDesc6: Double drops 스킬은 Triple drops 으로 업그레이드 됨 - miningPassiveTitle0: 패시브 토큰 - miningPassiveTitle1: 뒤로 - miningPassiveTitle2: 스킬 토큰 - miningPassiveTitle3: Berserk Pick 지속시간 - miningPassiveTitle4: Double Drops [ x2배 드랍 ] - miningPassiveTitle5: Blast Mining [ 폭발하는 채광 ] - miningPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) - miningPassiveDesc1: 주요 스킬 메뉴로 돌아가기 - miningPassiveDesc2: 스킬 트리에 투자할 토큰 - miningPassiveDesc3: Berserk pick 지속시간 0.02초 증가 - miningPassiveDesc4: 채광시 0.05%확률로 광석을 두배로 휙득함 ( 스킬 업그레이드시 확률 증가 ) - miningPassiveDesc5: TNT로 광석을 부술시에 0.01%확률로 광물이 보존됨 - (More blocks broken = More treasure rolls) - farmingPerkTitle0: Better Fertilizer [ 더좋은 비료 ] - farmingPerkTitle1: Animal Farm [ 동물 농장 ] - farmingPerkTitle2: Farmer's Diet [ 농부의 다이어트 ] - farmingPerkTitle3: Carnivore [ 육식 동물 ] - farmingPerkTitle4: Green Thumb [ 원예 재능 ] - farmingPerkTitle5: Growth Hormones [ 성장 호르몬 ] - farmingPerkTitle6: One with Nature [ 자연과 하나됨 ] - farmingPerkDesc0: 뼛가루 사용시 10% 확률로 소모하지않음 - farmingPerkDesc1: 레벨당 추가적인 스폰알을 제작 가능함 - farmingPerkDesc2: 농식량이 수준당 기아와 포화상태 회복에 - 레벨당 20% 더 효과적 - farmingPerkDesc3: 고기는 배고픔과 포화상태 회복에 레벨당 20% 더 효과적 - 레벨당 20% 더 효과적 - farmingPerkDesc4: 완전히 다 자란 작물을 설치 할 수 있습니다 - 레벨이 오를 수록 확률이 올라갑니다. 능력 효과는 멜론과 호박에 적용됨. - farmingPerkDesc5: 설탕을 먹이면 아기동물들을 급속성장 할수있음 - farmingPerkDesc6: 잔디위에 있을시에 재생 효과를 받습니다 - farmingPassiveTitle0: 패시브 토큰 - farmingPassiveTitle1: 뒤로 - farmingPassiveTitle2: 스킬 토큰 - farmingPassiveTitle3: Natural Regeneration Duration [ 자연 재생 지속시간 ] - farmingPassiveTitle4: Double Drops (농작물) - farmingPassiveTitle5: Double Drops (동물) - farmingPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) - farmingPassiveDesc1: 주요 스킬 메뉴로 돌아가기 - farmingPassiveDesc2: 스킬 트리에 투자할 토큰 - farmingPassiveDesc3: 자연치유 효과를 0.02초 증가시킵니다. - farmingPassiveDesc4: 농작물로부터 두배휙득할 확률을 0.05% 증가시킵니다. - farmingPassiveDesc5: 대부분의 수동형 동물로부터 두배 휙득할 확률을 - 0.05% 증가 시킵니다. - fishingPerkTitle0: Rob [ 탈탈 털기 ] - fishingPerkTitle1: Scavenger [ 스캐빈저 ] - fishingPerkTitle2: Fisherman's Diet [ 어부의 다이어트 ] - fishingPerkTitle3: Filtration [ 여과 ] - fishingPerkTitle4: Grappling Hook [ 그래플링 갈고리 ] - fishingPerkTitle5: Hot Rod [ ] - fishingPerkTitle6: Fish Person [ 낚시꾼 ] - fishingPerkDesc0: 레벨당 15% 확률로 몬스터에게서 모든아이템을 얻습니다. - fishingPerkDesc1: 보물 낚시의 새로운 티어를 잠금해제 - fishingPerkDesc2: 생선 섭취시에 +20%의 허기가 보충됩니다. - fishingPerkDesc3: 고등급(II-V) 아이템의 휘득확률이 오르고, 저등급(I) 아이템의 - 약탈 확률이 감소합니다 - fishingPerkDesc4: 낚싯대로 갈고리 클라이밍을 할 수 있습니다 ( 명령어 /grappleToggle - ) - fishingPerkDesc5: 물고기는 잡히는 즉시 요리되고, 약간의 물고기는 - 보물로 변합니다 (명령어 on,off - /hotRodToggle) - fishingPerkDesc6: 물에서 제한없는 돌고래의 우아함효과를 얻고 - 심해에서는 제한없는 야간투시효과를 얻습니다 - fishingPassiveTitle0: 패시브 토큰 - fishingPassiveTitle1: 뒤로 - fishingPassiveTitle2: 스킬 토큰 - fishingPassiveTitle3: Super Bait 지속시간 - fishingPassiveTitle4: Double catches [ 두배 잡기 ] - fishingPassiveTitle5: Treasure Finder [ 보물 발견자 ] - fishingPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) - fishingPassiveDesc1: 주요 스킬 메뉴로 돌아가기 - fishingPassiveDesc2: 스킬 트리에 투자할 토큰 - fishingPassiveDesc3: Super Bait의 지속시간이 0.01초 증가합니다 - fishingPassiveDesc4: double drop의 확률이 0.05% 증가합니다 - fishingPassiveDesc5: Junk 를 찾을 확률이 0.005% 감소하고 - 보물을 찾을 확률이 0.005% 증가합니다 - archeryPerkTitle0: Extra Arrows [ 추가 화살 ] - archeryPerkTitle1: Sniper [ 저격수 ] - archeryPerkTitle2: Arrow of Light [ 빛의 화살 ] - archeryPerkTitle3: Explosive Arrows [ 폭발 화살 ] - archeryPerkTitle4: Dragon-less Arrows - archeryPerkTitle5: Crossbow Rapid Load - archeryPerkTitle6: Deadly Strike [ 치명적인 공격 ] - archeryPerkDesc0: 화살 제작시 레벨당 +1개 만큼 제작합니다 - archeryPerkDesc1: 화살 발사속도가 레벨당 2% 씩 증가합니다. (레벨당 ~4% 데미지 증가) - archeryPerkDesc2: 분광 화살은 레벨당 5% 씩 추가 데미지를 가합니다. - archeryPerkDesc3: 화살을 명중 시 +1%의 폭발을 일으킨다. - archeryPerkDesc4: 물약과 화살을 조합하여 모든 "왜곡된" - 화살을 만들 수 있습니다. - archeryPerkDesc5: 이제 능력을 석궁에서도 사용할수있고, 빠른 속도로 - 재장전 합니다. - archeryPerkDesc6: 석궁으로 화상효과 부여시, 데미지가 2배로 늘어납니다 (최대 중첩 - 피해는 16의 체력까지만 ) - archeryPassiveTitle0: 패시브 토큰 - archeryPassiveTitle1: 뒤로 - archeryPassiveTitle2: 스킬 토큰 - archeryPassiveTitle3: Rapid Fire 지속시간 - archeryPassiveTitle4: Retrieval [ 검색 or 되찾기 ] - archeryPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) - archeryPassiveDesc1: 주요 스킬 메뉴로 돌아가기 - archeryPassiveDesc2: 스킬 트리에 투자할 토큰 - archeryPassiveDesc3: Rapid Fire 의 지속시간이 0.02초 증가합니다. - archeryPassiveDesc4: 활 공격시 레벨당 0.05% 확률로 화살을화살 발사시 레벨당 0.05% 확률로 소모하지않습니다. - 소모하지 않습니다 - beastMasteryPerkTitle0: Thick Fur [ 두꺼운 털 ] - beastMasteryPerkTitle1: Sharp Teeth [ 날카로운 이빨 ] - beastMasteryPerkTitle2: Healthy Bites [ 건강에 좋은 물어뜯기 ] - beastMasteryPerkTitle3: Keep Away - beastMasteryPerkTitle4: Acro-Dog [ 아크로-개 ] - beastMasteryPerkTitle5: Identify [ 정보 확인 ] - beastMasteryPerkTitle6: Adrenaline Boost [ 아드레날린 부스트 ] - beastMasteryPerkDesc0: 길들인 늑대가 받는 피해가 레벨당 -10% 씩 감소합니다. - beastMasteryPerkDesc1: 길들인 늑대가 주는 피해가 레벨당 +10% 씩 증가합니다. - beastMasteryPerkDesc2: 길들인 늑대가 적을 죽이면 레벨당 1/2 체력 만큼 자신을 회복합니다. - beastMasteryPerkDesc3: 길들인 늑대가 5% 확률로 적을 죽입니다. - beastMasteryPerkDesc4: 길들인 늑대의 낙사피해가 없어집니다. - beastMasteryPerkDesc5: 말 과 늑대 에 나침반을 사용하면 스텟을 보여줍니다. - beastMasteryPerkDesc6: Spur kick 버프가 이제 3단계 의 속도효과 를 받습니다 - beastMasteryPassiveTitle0: 패시트 토큰 - beastMasteryPassiveTitle1: 뒤로 - beastMasteryPassiveTitle2: 스킬 토큰 - beastMasteryPassiveTitle3: Spur Kick 지속시간 - beastMasteryPassiveTitle4: Critical Bite [ 물어뜯기 크리티컬 ] - beastMasteryPassiveDesc0: 패시브 스킬에 투자할 토큰 (염료 아이콘 스킬) - beastMasteryPassiveDesc1: 주요 스킬 메뉴로 돌아가기 - beastMasteryPassiveDesc2: 스킬 트리에 투자할 토큰 - beastMasteryPassiveDesc3: Spur Kick 의 지속시간이 0.02초 증가합니다. - beastMasteryPassiveDesc4: 길들인 늑대가 주는 피해가 치명타일 확률 - 0.025% 증가합니다. - swordsmanshipPerkTitle0: Adrenaline [ 아드레날린 ] - swordsmanshipPerkTitle1: Killing Spree - swordsmanshipPerkTitle2: Adrenaline+ [ 아드레날린 + ] - swordsmanshipPerkTitle3: Killing Frenzy - swordsmanshipPerkTitle4: Thirst for Blood - swordsmanshipPerkTitle5: Sharper! - swordsmanshipPerkTitle6: Sword Mastery [ 검술 마스터리 ] - swordsmanshipPerkDesc0: 적대적인 몹을 검으로 죽일시에 신속 효과를 - 레벨당 2초간 부여합니다 - swordsmanshipPerkDesc1: 적대적인 몹을 검으로 죽일시에 힘 효과를 - 레벨당 2초간 부여합니다 - swordsmanshipPerkDesc2: 아드레날린 스킬로 부터 받는 +20%의 스피드 I 버프가 스피드 II 로 증가합니다. - swordsmanshipPerkDesc3: Killing Spree 스킬로 받는 +20%의 힘 I 버프가 힘 II - II 로 증가합니다. - swordsmanshipPerkDesc4: 검으로 적대적인 몹들을 죽일시에는 - 허기가 복원됩니다. - swordsmanshipPerkDesc5: swift strikes 사용시에 검에 날카로움 레벨효과를 추가합니다. - swordsmanshipPerkDesc6: 검은 영구적으로 +1 체력피해 데미지를 가합니다. - swordsmanshipPassiveTitle0: 패시브 토큰 - swordsmanshipPassiveTitle1: 뒤로 - swordsmanshipPassiveTitle2: 스킬 토큰 - swordsmanshipPassiveTitle3: Swift Strikes 지속시간 - swordsmanshipPassiveTitle4: Double Hit [ x2 피해 ] - swordsmanshipPassiveDesc0: 패시브 스킬에 투자할 토큰 (염료 아이콘 스킬) - swordsmanshipPassiveDesc1: 주요 스킬 메뉴로 돌아가기 - swordsmanshipPassiveDesc2: 스킬 트리에 투자할 토큰 - swordsmanshipPassiveDesc3: Swift Strikes의 지속시간이 0.02초 증가됩니다. - swordsmanshipPassiveDesc4: 몬스터 공격시에 한번에 두번 공격될 확률이 0.02% 증가됩니다. - ( 두번째 타격 데미지는 50%의 피해를 입힙니다. ) - defensePerkTitle0: Healer [ 힐러 ] - defensePerkTitle1: Stiffen [ 뻣뻣함 ] - defensePerkTitle2: Hard Headed [ 빈틈없는 사람 ] - defensePerkTitle3: Stiffen+ [ 뻣뻣함+ ] - defensePerkTitle4: Gift From Above [ 위에서 내려오는 축복 ] - defensePerkTitle5: Stronger Legs [ 강한 다리 ] - defensePerkTitle6: Hearty [ 혈기 왕성 ] - defensePerkDesc0: 사살 레벨당 3초의 재생효과 얻음 - defensePerkDesc1: 피해를 입을시에 2%확률로 저항 I 효과를 5초동안 얻습니다. - defensePerkDesc2: Hard Body 스킬에 레벨당 6.6%의 데미지 감소 효과를 추가합니다. - defensePerkDesc3: 피해를 입을시에 2%확률로 저항 II 효과를 5초동안 얻습니다. - defensePerkDesc4: Stone solid 능력 발동시간에는 1분간 +4 만큼의 체력 보호효과 를 - 부여합니다. - defensePerkDesc5: Stone Solid 스킬효과가 속도감소 I 에서 속도감소 IV 로 증가합니다. - defensePerkDesc6: 영구적인 체력 보너스 + 2칸 - defensePassiveTitle0: 패시브 토큰 - defensePassiveTitle1: 뒤로 - defensePassiveTitle2: 스킬 토큰 - defensePassiveTitle3: Stone Solid 지속시간 - defensePassiveTitle4: Hard Body [ 단단한 몸 ] - defensePassiveTitle5: Double Drops (적대 몬스터에게만) - defensePassiveDesc0: 패시브 스킬에 투자할 토큰 (염료 아이콘 스킬) - defensePassiveDesc1: 주요 스킬 메뉴로 돌아가기 - defensePassiveDesc2: 스킬 트리에 투자할 토큰 - defensePassiveDesc3: Stone Solid 의 지속시간 0.02초 증가됩니다. - defensePassiveDesc4: 레벨당 피해감소효과가 0.01% 증가합니다. - ( 기본 감소효과 -33% ) - defensePassiveDesc5: 공격적인 몬스터로부터 double drops 효과를 받을 - 기회가 0.05% 증가합니다 - axeMasteryPerkTitle0: Greater Axe [ 엄청난 도끼 ] - axeMasteryPerkTitle1: Holy Axe [ 신성한 도끼 ] - axeMasteryPerkTitle2: Revitalized [ 활성화! ] - axeMasteryPerkTitle3: Warrior Blood [ 피의 전사 ] - axeMasteryPerkTitle4: Earthquake [ 지진 ] - axeMasteryPerkTitle5: Better Crits [ ] - axeMasteryPerkTitle6: Axe Man [ 도끼와 한몸 ] - axeMasteryPerkDesc0: Great Axe 의 피해 반경이 레벨당 1 블록 씩 증가합니다. - axeMasteryPerkDesc1: 도끼로 타격시 2% 확률로 번개공격을 가합니다. - axeMasteryPerkDesc2: 사살시 레벨당 1% 확률로 모든 체력이 회복됩니다. - axeMasteryPerkDesc3: 도끼로 사살시 레벨당 힘 I 효과를 3초간 받습니다. - axeMasteryPerkDesc4: Ability's AOE 의 데미지는 두배가됩니다. (25% -> 50% ) - axeMasteryPerkDesc5: Divine Crits 스킬의 데미지 효과가 증가합니다. ( 1.25x -> 1.6x ) - axeMasteryPerkDesc6: 도끼가 영구적으로 1의 체력피해를 가합니다. - axeMasteryPassiveTitle0: 패시브 토큰 - axeMasteryPassiveTitle1: 뒤로 - axeMasteryPassiveTitle2: 스킬 토큰 - axeMasteryPassiveTitle3: Great Axe 지속시간 - axeMasteryPassiveTitle4: Divine Crits - axeMasteryPassiveDesc0: 패시브 스킬에 투자할 토큰 (염료 아이콘 스킬) - axeMasteryPassiveDesc1: 주요 스킬 메뉴로 돌아가기 - axeMasteryPassiveDesc2: 스킬 트리에 투자할 토큰 - axeMasteryPassiveDesc3: Great Axe의 지속시간을 0.02초 증가시킵니다. - axeMasteryPassiveDesc4: 랜덤으로 크리티컬(데미지 x1.25배) 확률을 0.01% 증가시킵니다. - repairPerkTitle0: Salvaging - repairPerkTitle1: Resourceful - repairPerkTitle2: Magic Repair Mastery [ 마법 수리 마스터리 ] - repairPerkDesc0: Get more materials on average from salvaging - repairPerkDesc1: 10% 확률로 수리에 필요한 재료들을 소모하지않음 - repairPerkDesc2: 수리에 필요한 인첸트 보장 - repairPassiveTitle0: 뒤로 - repairPassiveTitle1: 스킬 토큰 - repairPassiveTitle2: Proficiency [ 숙달자 ] - repairPassiveDesc0: 주요 스킬 메뉴로 돌아가기 - repairPassiveDesc1: 스킬 트리에 투자할 토큰 - repairPassiveDesc2: 수리시에 내구도복구량 증가 - agilityPerkTitle0: 회피 - agilityPerkTitle1: Steel Bones [ 강철 뼈 ] - agilityPerkTitle2: Graceful Feet [ 우아한 발 ] - agilityPerkDesc0: 레벨당 회피공격 확률 4% 증가 - agilityPerkDesc1: 레벨당 낙하데미지 10% 감소 - agilityPerkDesc2: 영구적인 이동속도 버프 (명령어 on/off - /speedToggle) - agilityPassiveTitle0: 뒤로 - agilityPassiveTitle1: 스킬 토큰 - agilityPassiveTitle2: 구르기 - agilityPassiveDesc0: 주요 스킬 메뉴로 돌아가기 - agilityPassiveDesc1: 스킬 트리에 투자할 토큰 - agilityPassiveDesc2: 구르기와 낙하데미지 감소 확률 - alchemyPerkTitle0: Alchemical Summoning [ 연금술 소환 ] - alchemyPerkTitle1: Ancient Knowledge [ 고대의 지식 ] - alchemyPerkTitle2: Potion Master [ 포션 마스터 ] - alchemyPerkDesc0: 양조기 없이 일부 물약을 제조 할수있음 - alchemyPerkDesc1: 새로운 물약 제조방법 잠금해제 - alchemyPerkDesc2: 사용한 포션의 레벨이 1 증가한다 (toggleable with /togglePotion) - alchemyPassiveTitle0: 뒤로 - alchemyPassiveTitle1: 스킬 토큰 - alchemyPassiveTitle2: Half-life+ [ 하프-라이프+ ] - alchemyPassiveDesc0: 주요 스킬 메뉴로 돌아가기 - alchemyPassiveDesc1: 스킬 트리에 투자할 토큰 - alchemyPassiveDesc2: 포션을 사용했을때 지속시간이 증가합니다. - smeltingPerkTitle0: Fuel Efficiency [ 연료 효율 ] - smeltingPerkTitle1: Double Smelt [ x2 제련 ] - smeltingPerkTitle2: Flame Pickaxe [ 화염의 곡괭이 ] - smeltingPerkDesc0: 레벨당 연료가 20% 더 지속됨 - smeltingPerkDesc1: 광석 용해시 두배로 휙득할 확률이 레벨당 5% 증가 - smeltingPerkDesc2: 광석이 채광즉시 용해됨 ( 명령어 on,off - /toggleFlamePick) - smeltingPassiveTitle0: 뒤로 - smeltingPassiveTitle1: 스킬 토큰 - smeltingPassiveTitle2: 화로 스피드 - smeltingPassiveDesc0: 주요 스킬 메뉴로 돌아가기 - smeltingPassiveDesc1: 스킬 트리에 투자할 토큰 - smeltingPassiveDesc2: 음식 굽는 속도 증가 - enchantingPerkTitle0: Efficient Enchanting [ 효과적인 인첸트 ] - enchantingPerkTitle1: Booksmart [ 책방 ] - enchantingPerkTitle2: Immortal Experience[ 불멸의 경험치 ] - enchantingPerkDesc0: 레벨당 인첸트 필요레벨 -1, 모루 수리비용 -1 (최소 2등급) - enchantingPerkDesc1: 일부 인첸트책 제작법 잠금 해제 - enchantingPerkDesc2: 사망해도 경험치 유지 - enchantingPassiveTitle0: 뒤로 - enchantingPassiveTitle1: 스킬 토큰 - enchantingPassiveTitle2: 더 빠른 개발 - enchantingPassiveDesc0: 주요 스킬 메뉴로 돌아가기 - enchantingPassiveDesc1: 스킬 트리에 투자할 토큰 - enchantingPassiveDesc2: 받는 모든 경험치량 증가 - globalPerkTitle0: Gatherer [ 채집가 ] - globalPerkTitle1: Scholar [ 학자 ] - globalPerkTitle2: Fighter [ 파이터 ] - globalPerkTitle3: Hard Work [ 어려운 일 ] - globalPerkTitle4: Research [ 재검색 ] - globalPerkTitle5: Training [ 트레이닝 ] - globalPerkTitle6: Reincarnation+ [ 라인카네이션 ] - globalPerkTitle7: Soul Harvesting [ 영혼 수확 ] - globalPerkTitle8: Avatar [ 아바타 ] - globalPerkTitle9: Master of the Arts [ 예술의 마스터 ] - globalPerkDesc0: 토굴,벌목,채굴,농사,낚시 에서 +20%의 경험치를 휙득함 - globalPerkDesc1: 수리,민첩,양조,제련,인첸트 에서 +20%의 경험치를 휙득함 - globalPerkDesc2: 궁술,야수마스터리,검술,방어,도끼마스터리 에서 +20%의 경험치를 휙득함 - globalPerkDesc3: Gatherer 스킬에서 얻는 토큰수 +1 - globalPerkDesc4: Scholar 스킬에서 얻는 토큰수 +1 - globalPerkDesc5: Fighter 스킬에서 얻는 토큰수 +1 - globalPerkDesc6: 사망시에 50% 확률로 인벤토리에 아이템이 남아있습니다 - globalPerkDesc7: 당신은 공격적인 적들을 죽이면 영혼을 휙득하고, 영혼을 스킬트리 환불에 사용할수잇다 - globalPerkDesc8: 피해를 입지않고 적을 죽이면 10% 확률로 10초간 모든버프를 휙득함 - globalPerkDesc9: 능력 재사용 대기시간 33% 감소 - globalPassiveTitle0: 글로벌스킬 토큰 - globalPassiveTitle1: 뒤로 - globalPassiveDesc0: 스킬 트리에 투자할 토큰 - globalPassiveDesc1: 주요 스킬 메뉴로 돌아가기 - cannotRepair: 능력이 활성화 중인 상태에서는 복구를 할수없습니다. - cannotSalvage: 능력이 활성화 중일때는 salvage 할수없습니다. - spite: Everything good is made of spite - refundSkill: 스킬 트리를 환불해야 함 - refundSkill2: in order to refund a skill tree - needToUnlock: 잠금을 해제해야 합니다. - perkRequirement: 이 능력을 잠금 해제하려면 이전 능력에 최소 2개의 - 기술 토큰을 투자해야 함 - perkRequirementM: 당신은 스킬트리에 10개이상의 토근을 소모해야 - 마스터 스킬을 해제 할수있습니다. - noSkillTokens: 당신은 어떤 스킬 토큰 도 가지고있지않습니다. - noPassiveTokens: 당신은 어떤 패시브 토큰을 가지고있지않다. - maxedOutPerk: 당신은 이미 스킬 전부를 해제 하였습니다. - requiredGlobalPerks0: 이 스킬을 잠금해제 하려면 이전의 스킬이 필요합니다. - requiredGlobalPerks1: ← 스킬 잠금해제에 필요한 스킬들 - requiredGlobalPerks2: ← 스킬을 잠금해제 해야 이스킬을 해제할수잇습니다. - requiredGlobalPerks3: 모든 글로벌 스킬을 해제해야 이 스킬을 휙득할수 있습니다. - craftRequirement: ← 레시피를 만드는데 필요함 - roll: 구르기 - dodge: 피하기 - prepare: 능력이 활성화되었습니다 - rest: 쿨타임 - activated: 활성화! - ended: 사용시간이 끝낫습니다 - readyToUse: 준비까지 - cooldown: 쿨타임 준비중 - rapidFire: Rapid Fire 스킬의 - bow: 활을 사용하세요! - greatAxe: Great Axe 스킬의 - axe: 도끼를 사용하세요! - spurKick: Spur Kick 스킬의 - leg: leg - stoneSoldier: Stone Soldier 스킬의 - yourself: 좌클릭을 하세요! - bigDig: Big Dig 스킬의 - shovel: 삽을 사용하세요! - naturalRegeneration: 자연 재생 - hoe: 호미을 사용하세요! - superBait: Super Bait 스킬의 - fishingRod: fishing rod 스킬의 - berserkPick: Berserk Pick 스킬의 - pickaxe: 곡괭이을 사용하세요! - swiftStrikes: Swift Strikes [ 신속한 피해 ] - sword: 검을 사용하세요! - timber: Timber 스킬의 - hyperHorse: This horse is already hyper! - magicForce: A magic force ends your ability - rob: Rob - repairFail0: You are not skilled enough to adequately repair this item - repairFail1: You failed to salavage any materials - repairFail2: You failed to retain the item's enchantment power - treeTooBig0: 이 나무는 너무커서 한번에 자를수 없어! - treeTooBig1: This tree can never be chopped in one go like this... - noPermission: 이 명령어를 사용하기위한 권한이 없습니다. - improperArguments: Improper Arguments, try - totalPlayTime: 총 플레이 시간 - clickForOptions: 옵션을 보려면 클릭하십시오. - unknownCommand: 커맨드 잠금해제 - expToLevel: 레벨업하기 위한 필요경험치 - playerName: playerName - skillName: 스킬이름 (영문) - page: 페이지 - on0: 'ON' - off0: 'OFF' - onOrOff: ON/OFF - manuallyToggles: 수동으로 전환 - commandDesc0: 모든 스킬의 메인 GUI 열기 - commandDesc1: 선택한 스킬트리의 GUI 열기 - commandDesc2: 환결설정 GUI 열기 - commandDesc3: 선택한 플레이어에게 스킬을 사용해 경험치를 줍니다. - commandDesc4: 스킬을 사용해서 준 유저의 레벨을 설정 - commandDesc5: 지정된 스킬에 유저의 스탯을 초기화함. ( 스탯 환불 안됨 ) - commandDesc6: 지정된 스탯을 위한 리더보드 화면 표시 - commandDesc7: 플러그인 정보 페이지에 대한 링크 제공 - commandDesc8: Attempts to enchant an item in the users hand at a specified level - informationURL: 정보 URL (Google Docs) - click: 클릭 - levelArgument: Level argument must be less than 40 - leaderboard: 리더보드 - playerOffline: 그 유저는 현재 오프라인 상태입니다. - onlyIncrease: Please only increase exp with this command, otherwise, use /frpg - statReset then /frpg giveEXP - amount: 총량 - unlockToggle: 이 커맨드를 사용하기위해선 잠금해제해야함 - levelUpNotif: 레벨업 알림 - abilityPreparationNotif: 능력 준비 알림 - yes0: 'YES' - no0: 'NO' - warning: 주의 - souls: 소울 - refundSkillTree0: 스킬트리비용 환불받기 - refundSkillTree1: and is not reversible, are you sure you want to - refundSkillTree2: 환불해라 → - skill: 스킬 - backToSkillTree: 스킬 트리로 돌아가기 - miningPerkDesc0_1: 아무 광물이나 채광하면 2초간 헤이스트 효과 받음 - miningPerkDesc0_2: 아무 광물이나 채광하면 5초간 헤이스트 효과 받음 - miningPerkDesc0_3: 아무 광물이나 채광하면 10초간 헤이스트 효과 받음 - miningPerkDesc0_4: 헤이스트 1단계를 받는동안 5초안에 아무 광석이나 채광시 헤이스트 2단계 받음 - miningPerkDesc0_5: 아무 광물이나 채광하면 10초간 헤이스트 2단계 효과 받음 - woodcuttingPerkDesc3_1: 나뭇잎에서 깃털이 드랍됩니다. - common: common [ 커먼 ] - uncommon: uncommon [ 언커먼 ] - rare: rare [ 레어 ] - veryRare: very rare - legendary: legendary [ 레전더리 ] - fishingPerkDesc1_1: 보물 티어 잠금해제 - farmingPerkDesc1_1: 제작 능력 획득 - cowSpawnEgg: 소 스폰 알 - beeSpawnEgg: 벌 스폰 알 - mooshroomSpawnEgg: 버섯소 스폰 알 - horseSpawnEgg: 말 스폰 알 - slimeSpawnEgg: 슬라임 스폰 알 - diggingPerkDesc0_1: 이제부터 채굴할수있습니다. → - defensePerkDesc0_1: 사살 레벨당 스킬에서 3초의 리젠을 얻음 - defensePerkDesc0_2: 즉사할시 레벨당 0.5의 체력을 얻음 - duration: 지속시간 - likelihood: 확률 - junkChance: Junk Chance - locked: 잠김 - unlocked: 해제 - cowEgg: 소 알 - beeEgg: 벌 알 - mooshroomEgg: 버섯소 알 - horseEgg: 말 알 - slimeEgg: 슬라임 알 - tippedArrows: Tipped Arrows - toggle: 활성화 - refundSkillTitle: 스킬 환불 - refundSkillTreeDesc: 스킬 트리를 환불하려면 클릭하십시오. - enchantingPerkDesc1_0: 제작 능력 잠금해제 - enchantingPerkDesc1_1: 파워 I , 효율 I 인첸트북 해제 ( 제작에 1레벨 소모 ) - enchantingPerkDesc1_2: 날카로움 I , 보호 I 인첸트북 해제 ( 제작에 1레벨 소모 ) - enchantingPerkDesc1_3: 바다의행운 I , 미끼 I 인첸트북 해제 ( 제작에 1레벨 소모 ) - enchantingPerkDesc1_4: 물갈퀴 I , 차가운 걸음 I enchanted books ( 제작에 1레벨 소모 ) - enchantingPerkDesc1_5: 수선 ( 제작에 10레벨 소모 ) , 행운 I ( 제작에 2레벨 소모) 인첸트북 해제 - repairPerkDesc0_1: 보통 확률로 더 많은 재료를 얻습니다. - repairPerkDesc0_2: 보통 확률로 더 많은 재료를 얻으며, 인양(견인)을 통해 얻는 마법부여 - 아이템들의 효과가 인첸트 북으로 바뀝니다. - xpBoost: 경험치 부스트 - speedBoost: 속도 부스트 - timeExtension: 시간 연장 - enchantingCraft0: 힘 I 인첸트책 - enchantingCraft1: 효율 I 인첸트책 - enchantingCraft2: 날카로움 I 인첸트책 - enchantingCraft3: 보호 I 인첸트책 - enchantingCraft4: 바다의 행운 I 인첸트책 - enchantingCraft5: 미끼 I 인첸트책 - enchantingCraft6: 차가운 걸음 I 인첸트책 - enchantingCraft7: 물갈퀴 I 인첸트책 - enchantingCraft8: 수선 인첸트책 - enchantingCraft9: 행운 I 인첸트책 - commandDesc9: 지정된 플레이어의 소울 설정 - commandDesc10: 지정된 플레이어에 대해 지정된 스킬에 스킬 또는 패시브 토큰 설정 - commandDesc11: 지정된 플레이어의 글로벌 토큰 설정 - commandDesc12: 모든 플레이어 또는 지정된 플레이어의 통계 저장 - status: 상태 - complete: 완성 - incomplete: 미완성 - try0: try - passiveImprove: 당신의 패시브 퍽이 모든 레벨을 증가시킴 - increasedBy: 레벨 증가됨 + - expIncrease: EXP Multiplier - personalMultiplier: Personal Multiplier - translators: Translators - commandDesc13: Sets the personal multiplier for a specified player - abilityDescription: 능력의 정보 - abilityDescription_digging: 일시적으로 삽에 5 효율 효과를 적용합니당. - 삽을 들고 우클릭후 토굴시 능력이 적용됨. - abilityDescription_woodcutting: 일시적으로 찹트리 능력을 휙득합니다 ( ^_^ ) - 도끼를 들고 우클릭후 벌목시 능력이 적용됨. - abilityDescription_mining: 일시적으로 곡괭이에 5 효율 효과를 적용한다. - 곡괭이를 들고 우클릭후 채광시 능력이 적용됨. - abilityDescription_farming: 일시적으로 괭이로 농작물들을 자동으로 수확합니다. - 괭이를 들고 우클릭후 작물을 캐면 능력이 적용됨. - abilityDescription_fishing: 일시적으로 낚싯대에 물고기만 걸리게 됩니다. - 낚시대를 들고 우클릭후 낚시를 시작하면 활성화됨. - abilityDescription_archery: 일시적으로 모든 화살이 최대속도로 발사됨. - 활을 들고 우클릭후 화살을 쏘면 능력이 적용됨. - abilityDescription_beastMastery: 말에게 임시로 스피드 버프를 준다. - 말을 탄상태로 좌클릭 유지상태로 우클릭을 하면 활성화됨. - abilityDescription_swordsmanship: 검을 휘두를때 최대피해 쿨타임을 없애준다. - 검을 든상태로 우클릭후 몬스터타격시 능력이 적용됨. - abilityDescription_defense: 상대에게 속도저항과 저항효과를 줌 - 빈손으로 우클릭후 몬스터 타격시 능력이 적용됨. - abilityDescription_axeMastery: 특정 반경내의 모든 몬스터에게 일시적인 피해를 가함 - 도끼를 든 상태로 우클릭후 몬스터타격시 능력이 적용됨. - alchemyPerkDesc1_0: 양조 기능 해제 - alchemyPerkDesc0_0: 제작테이블에서 물약을 제조할수잇습니다. - triggerAbilities: Trigger Abilities - showEXPBar: 경험치 바 활성화 - disabledSkill: 이 스킬은 비활성화됨 - skillConfigDesc: 이 스킬에 대한 구성 메뉴로 이동 - lvl: 레벨. - exp: 경험치 - potionAbsorption: 흡수의 물약 - potionBadOmen: 흉조의 물약 ( 마을에 잇으면 부정적인 효과를 일으킴 ) - potionBlindess: 실명의 물약 - potionConduitPower: 도관 전달체 물약 ( 수중호흡 + 야간투시 ) - potionResistance: 저항의 물약 - potionDolphinsGrace: 돌고래의 우아함 물약 - potionHaste: 가속의 물약 - potionFireResistance: 화염 저항의 물약 - potionGlowing: 발광의 물약 - potionHarm: 피해의 물약 - potionHealing: 치유의 물약 - potionHealthBoost: 체력 재생의 물약 - potiontheHero: 마을의 영웅 물약 ( 상인과의 거래비용이 감소함 ) - potionHunger: 굶주림의 물약 - potionStrength: 힘의 물약 - potionInvsibility: 투명화 물약 - potionJump: 도약의 물약 - potionLuck: 행운의 물약 - potionNightVision: 야간 투시의 물약 - potionRegeneration: 재생의 물약 - potionSaturation: 포화의 물약 ( 허기보충에 보너스효과 ) - potionSlowness: 감속의 물약 - potionFatigue: 피로의 물약 - potionSlowFalling: 느린 낙하의 물약 - potionSpeed: 신속의 물약 - potionBadLuck: 불행의 물약 - potionWaterBreathing: 수중 호흡의 물약 - potionWeakness: 나약함의 물약 - potionDecay: 부패의 물약 - potionAwkward: 어색한 물약 - potionUncraftable: 제작 불가능한 물약 - potionMundane: 평범한 물약 - potionTurtleMaster: 거북 도사의 물약 - potionThick: 진한 물약 - potionWater: 물병 - ingredient: 성분 - usedToBrew: 양조 할때 사용됨 - costs: 비용 - xpLevel: 마인크래프트 경험치 레벨 - xpLevels: 마인크래프트 경험치 레벨 - craftXPRequirement: This recipe requires at least - bedGUI: 이 명령은 침대에 있는 동안에는 사용할 수 없다! - statsUpdated: Your stats were changed to be consistent with a new EXP curve. All - skill trees and passive perks have been reset. All tokens must be re-invested. - timeRemaining: Time Remaining - numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed - commandDesc14: Resets the cooldown period for a skill to 0 seconds - commandDesc15: Looks up a player's FreeRPG stats - repairUnsafeEnchant: This item is too powerful to be repaired - salvageUnsafeEnchant: This item is too powerful to be salvaged - rank: 랭크 - stats: 스탯 - outOf: out of - playerNotInLeaderboard: 그 플레이어는 리더보드에 없습니다 - virtual: Virtual - commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount - (positive or negative) + koKR: #Translated by Re_Oh + languageName: 한국어 + englishLanguageName: Korean Language + translationCredit: Re_Oh + global: 글로벌 스킬 + digging: 토굴 + woodcutting: 벌목 + mining: 채광 + farming: 농사 + fishing: 낚시 + archery: 궁술 + beastMastery: 야수 마스터리 + swordsmanship: 검술 + defense: 방어 + axeMastery: 도끼 마스터리 + repair: 수리 + alchemy: 연금술 + agility: 민첩 + smelting: 제련 + enchanting: 인첸트 + information: 정보 + configuration: 설정 + level: 레벨 + experience: 경험치휙득 + toNext: 다음 + total: 합계 + diggingPerkTitle0: Mo' drops [ 많은 드랍 ] + diggingPerkTitle1: Double Treasure [ 보물 두배 ] + diggingPerkTitle2: Rarer Drops [ 레어 드랍 ] + diggingPerkTitle3: Soul Stealer [ 영혼 수확자 ] + diggingPerkTitle4: Flint Finder [ 부싯돌을 찾는자 ] + diggingPerkTitle5: Shovel Knight [ 삽의 기사 ] + diggingPerkTitle6: Mega Dig [ M!E!G!A! 채굴 ] + diggingPerkDesc0: 레벨당 1개의 아이템의 보물 드랍 테이블을 확장 + diggingPerkDesc1: 레벨당 보물을 두배로 휙득할 확률이 5% 증가함 (when + treasure is rolled) + diggingPerkDesc2: 레벨당 아이템의 휙득 드랍테이블 을 추가 확장 + diggingPerkDesc3: 영혼 모래에서 보물을 떨어뜨릴 확률이 레벨당 5% 증가합니다 + diggingPerkDesc4: 자갈에서 100% 확률로 부싯돌을 드랍함 (명령어 /flintToggle) + diggingPerkDesc5: 삽으로 공격시 두배의 피해를 가합니다. + diggingPerkDesc6: 능력을 사용할때, 당신은 3x3의 블럭크기만큼 캘수잇습니다. ( 활성화시 보물휙득 + 확률을 20%만 적용함) + diggingPassiveTitle0: 패시브 토큰 + diggingPassiveTitle1: 뒤로 + diggingPassiveTitle2: 스킬 토큰 + diggingPassiveTitle3: Big Dig 지속시간 + diggingPassiveTitle4: Treasure Chance [ 보물 찬스 ] + diggingPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) + diggingPassiveDesc1: 주요 스킬 메뉴로 돌아가기 + diggingPassiveDesc2: 스킬 트리에 투자할 토큰 + diggingPassiveDesc3: Big Dig 지속 시간 0.02초 증가 + diggingPassiveDesc4: 보물 발굴 가능성 0.005% 증가 + woodcuttingPerkTitle0: Zealous Roots [ 정성을 다한 뿌리 ] + woodcuttingPerkTitle1: Fresh Arms [ 신선한 팔 ] + woodcuttingPerkTitle2: Hidden Knowledge [ 숨겨진 지식 ] + woodcuttingPerkTitle3: Leaf Scavenger [ 나뭇잎을 뒤져보는사람 ] + woodcuttingPerkTitle4: Timber+ [ 팀버 + ] + woodcuttingPerkTitle5: Leaf Blower [ 나뭇잎을 부는자 ] + woodcuttingPerkTitle6: Able Axe [ 도끼에 재능잇는자 ] + woodcuttingPerkDesc0: 레벨당 20% 확률로 나무에서 경험치 1 을 드랍합니다. + woodcuttingPerkDesc1: 5분안에 첫 나무를 벌복시에 헤이스트 1 효과를 레벨당 12초씩 받습니다. + woodcuttingPerkDesc2: 레벨당 0.2% 확률로 나무에서 인첸트북을 드랍합니다. + woodcuttingPerkDesc3: 레벨당 1개의 보물 아이템을 1% 확률로 나뭇잎에서 드랍합니다 + woodcuttingPerkDesc4: Timber break 제한이 64 개에서 128 개로 증가합니다. + woodcuttingPerkDesc5: 도끼로 나뭇잎을 많이 부술수 잇습니다. ( 명령어 on, off - + /leafBlowerToggle) + woodcuttingPerkDesc6: Timber 스킬효과를 모든 벌목스킬에 적용합니다. ( 절반의 효과만 ) + woodcuttingPassiveTitle0: 패시브 토큰 + woodcuttingPassiveTitle1: 뒤로 + woodcuttingPassiveTitle2: 스킬 토큰 + woodcuttingPassiveTitle3: Timber Duration + woodcuttingPassiveTitle4: Double Drops + woodcuttingPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) + woodcuttingPassiveDesc1: 주요 스킬 메뉴로 돌아가기 + woodcuttingPassiveDesc2: 스킬 트리에 투자할 토큰 + woodcuttingPassiveDesc3: Timber 스킬의 지속시간이 0.02초 증가 + woodcuttingPassiveDesc4: 두배로 드랍하는 확률을 0.05% 증가시킵니다. + miningPerkTitle0: Wasteless Haste [ 낭비하지않는 성급함 ] + miningPerkTitle1: More Bombs [ 더많은 폭격 ] + miningPerkTitle2: Treasure Seeker [ 보물 발견자 ] + miningPerkTitle3: Bomb-boyage [ 폭격-여행 ] + miningPerkTitle4: Vein Miner + miningPerkTitle5: Demolition Man [ 파괴하는 사람 ] + miningPerkTitle6: Triple Trouble + miningPerkDesc0: 채광시 각 레벨당 헤이스트 효과를 얻음 + miningPerkDesc1: 조합해서 만든 TNT 의 파괴력을 레벨당 1개 크기의 TNT를 더 터트린다 + miningPerkDesc2: 능력을 사용후 돌을 캐면, 1레벨당 1%확률로 광석이 드랍됨 + (추가 경험치는 광석으로 드랍됨) + miningPerkDesc3: 레벨당 TNT 터지는 반경 증가 ( 부싯돌로 점화시에만 ) + miningPerkDesc4: 광물을 캐면 그광물과 연결되잇는 광물들이 한번에 채굴됨 (on/off 가능) + miningPerkDesc5: TNT 폭발시 자신은 데미지를 입지않음 + miningPerkDesc6: Double drops 스킬은 Triple drops 으로 업그레이드 됨 + miningPassiveTitle0: 패시브 토큰 + miningPassiveTitle1: 뒤로 + miningPassiveTitle2: 스킬 토큰 + miningPassiveTitle3: Berserk Pick 지속시간 + miningPassiveTitle4: Double Drops [ x2배 드랍 ] + miningPassiveTitle5: Blast Mining [ 폭발하는 채광 ] + miningPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) + miningPassiveDesc1: 주요 스킬 메뉴로 돌아가기 + miningPassiveDesc2: 스킬 트리에 투자할 토큰 + miningPassiveDesc3: Berserk pick 지속시간 0.02초 증가 + miningPassiveDesc4: 채광시 0.05%확률로 광석을 두배로 휙득함 ( 스킬 업그레이드시 확률 증가 ) + miningPassiveDesc5: TNT로 광석을 부술시에 0.01%확률로 광물이 보존됨 + (More blocks broken = More treasure rolls) + farmingPerkTitle0: Better Fertilizer [ 더좋은 비료 ] + farmingPerkTitle1: Animal Farm [ 동물 농장 ] + farmingPerkTitle2: Farmer's Diet [ 농부의 다이어트 ] + farmingPerkTitle3: Carnivore [ 육식 동물 ] + farmingPerkTitle4: Green Thumb [ 원예 재능 ] + farmingPerkTitle5: Growth Hormones [ 성장 호르몬 ] + farmingPerkTitle6: One with Nature [ 자연과 하나됨 ] + farmingPerkDesc0: 뼛가루 사용시 10% 확률로 소모하지않음 + farmingPerkDesc1: 레벨당 추가적인 스폰알을 제작 가능함 + farmingPerkDesc2: 농식량이 수준당 기아와 포화상태 회복에 + 레벨당 20% 더 효과적 + farmingPerkDesc3: 고기는 배고픔과 포화상태 회복에 레벨당 20% 더 효과적 + 레벨당 20% 더 효과적 + farmingPerkDesc4: 완전히 다 자란 작물을 설치 할 수 있습니다 + 레벨이 오를 수록 확률이 올라갑니다. 능력 효과는 멜론과 호박에 적용됨. + farmingPerkDesc5: 설탕을 먹이면 아기동물들을 급속성장 할수있음 + farmingPerkDesc6: 잔디위에 있을시에 재생 효과를 받습니다 + farmingPassiveTitle0: 패시브 토큰 + farmingPassiveTitle1: 뒤로 + farmingPassiveTitle2: 스킬 토큰 + farmingPassiveTitle3: Natural Regeneration Duration [ 자연 재생 지속시간 ] + farmingPassiveTitle4: Double Drops (농작물) + farmingPassiveTitle5: Double Drops (동물) + farmingPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) + farmingPassiveDesc1: 주요 스킬 메뉴로 돌아가기 + farmingPassiveDesc2: 스킬 트리에 투자할 토큰 + farmingPassiveDesc3: 자연치유 효과를 0.02초 증가시킵니다. + farmingPassiveDesc4: 농작물로부터 두배휙득할 확률을 0.05% 증가시킵니다. + farmingPassiveDesc5: 대부분의 수동형 동물로부터 두배 휙득할 확률을 + 0.05% 증가 시킵니다. + fishingPerkTitle0: Rob [ 탈탈 털기 ] + fishingPerkTitle1: Scavenger [ 스캐빈저 ] + fishingPerkTitle2: Fisherman's Diet [ 어부의 다이어트 ] + fishingPerkTitle3: Filtration [ 여과 ] + fishingPerkTitle4: Grappling Hook [ 그래플링 갈고리 ] + fishingPerkTitle5: Hot Rod [ ] + fishingPerkTitle6: Fish Person [ 낚시꾼 ] + fishingPerkDesc0: 레벨당 15% 확률로 몬스터에게서 모든아이템을 얻습니다. + fishingPerkDesc1: 보물 낚시의 새로운 티어를 잠금해제 + fishingPerkDesc2: 생선 섭취시에 +20%의 허기가 보충됩니다. + fishingPerkDesc3: 고등급(II-V) 아이템의 휘득확률이 오르고, 저등급(I) 아이템의 + 약탈 확률이 감소합니다 + fishingPerkDesc4: 낚싯대로 갈고리 클라이밍을 할 수 있습니다 ( 명령어 /grappleToggle + ) + fishingPerkDesc5: 물고기는 잡히는 즉시 요리되고, 약간의 물고기는 + 보물로 변합니다 (명령어 on,off - /hotRodToggle) + fishingPerkDesc6: 물에서 제한없는 돌고래의 우아함효과를 얻고 + 심해에서는 제한없는 야간투시효과를 얻습니다 + fishingPassiveTitle0: 패시브 토큰 + fishingPassiveTitle1: 뒤로 + fishingPassiveTitle2: 스킬 토큰 + fishingPassiveTitle3: Super Bait 지속시간 + fishingPassiveTitle4: Double catches [ 두배 잡기 ] + fishingPassiveTitle5: Treasure Finder [ 보물 발견자 ] + fishingPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) + fishingPassiveDesc1: 주요 스킬 메뉴로 돌아가기 + fishingPassiveDesc2: 스킬 트리에 투자할 토큰 + fishingPassiveDesc3: Super Bait의 지속시간이 0.01초 증가합니다 + fishingPassiveDesc4: double drop의 확률이 0.05% 증가합니다 + fishingPassiveDesc5: Junk 를 찾을 확률이 0.005% 감소하고 + 보물을 찾을 확률이 0.005% 증가합니다 + archeryPerkTitle0: Extra Arrows [ 추가 화살 ] + archeryPerkTitle1: Sniper [ 저격수 ] + archeryPerkTitle2: Arrow of Light [ 빛의 화살 ] + archeryPerkTitle3: Explosive Arrows [ 폭발 화살 ] + archeryPerkTitle4: Dragon-less Arrows + archeryPerkTitle5: Crossbow Rapid Load + archeryPerkTitle6: Deadly Strike [ 치명적인 공격 ] + archeryPerkDesc0: 화살 제작시 레벨당 +1개 만큼 제작합니다 + archeryPerkDesc1: 화살 발사속도가 레벨당 2% 씩 증가합니다. (레벨당 ~4% 데미지 증가) + archeryPerkDesc2: 분광 화살은 레벨당 5% 씩 추가 데미지를 가합니다. + archeryPerkDesc3: 화살을 명중 시 +1%의 폭발을 일으킨다. + archeryPerkDesc4: 물약과 화살을 조합하여 모든 "왜곡된" + 화살을 만들 수 있습니다. + archeryPerkDesc5: 이제 능력을 석궁에서도 사용할수있고, 빠른 속도로 + 재장전 합니다. + archeryPerkDesc6: 석궁으로 화상효과 부여시, 데미지가 2배로 늘어납니다 (최대 중첩 + 피해는 16의 체력까지만 ) + archeryPassiveTitle0: 패시브 토큰 + archeryPassiveTitle1: 뒤로 + archeryPassiveTitle2: 스킬 토큰 + archeryPassiveTitle3: Rapid Fire 지속시간 + archeryPassiveTitle4: Retrieval [ 검색 or 되찾기 ] + archeryPassiveDesc0: Tokens to invest in passive skills (염료 아이콘 스킬) + archeryPassiveDesc1: 주요 스킬 메뉴로 돌아가기 + archeryPassiveDesc2: 스킬 트리에 투자할 토큰 + archeryPassiveDesc3: Rapid Fire 의 지속시간이 0.02초 증가합니다. + archeryPassiveDesc4: 활 공격시 레벨당 0.05% 확률로 화살을화살 발사시 레벨당 0.05% 확률로 소모하지않습니다. + 소모하지 않습니다 + beastMasteryPerkTitle0: Thick Fur [ 두꺼운 털 ] + beastMasteryPerkTitle1: Sharp Teeth [ 날카로운 이빨 ] + beastMasteryPerkTitle2: Healthy Bites [ 건강에 좋은 물어뜯기 ] + beastMasteryPerkTitle3: Keep Away + beastMasteryPerkTitle4: Acro-Dog [ 아크로-개 ] + beastMasteryPerkTitle5: Identify [ 정보 확인 ] + beastMasteryPerkTitle6: Adrenaline Boost [ 아드레날린 부스트 ] + beastMasteryPerkDesc0: 길들인 늑대가 받는 피해가 레벨당 -10% 씩 감소합니다. + beastMasteryPerkDesc1: 길들인 늑대가 주는 피해가 레벨당 +10% 씩 증가합니다. + beastMasteryPerkDesc2: 길들인 늑대가 적을 죽이면 레벨당 1/2 체력 만큼 자신을 회복합니다. + beastMasteryPerkDesc3: 길들인 늑대가 5% 확률로 적을 죽입니다. + beastMasteryPerkDesc4: 길들인 늑대의 낙사피해가 없어집니다. + beastMasteryPerkDesc5: 말 과 늑대 에 나침반을 사용하면 스텟을 보여줍니다. + beastMasteryPerkDesc6: Spur kick 버프가 이제 3단계 의 속도효과 를 받습니다 + beastMasteryPassiveTitle0: 패시트 토큰 + beastMasteryPassiveTitle1: 뒤로 + beastMasteryPassiveTitle2: 스킬 토큰 + beastMasteryPassiveTitle3: Spur Kick 지속시간 + beastMasteryPassiveTitle4: Critical Bite [ 물어뜯기 크리티컬 ] + beastMasteryPassiveDesc0: 패시브 스킬에 투자할 토큰 (염료 아이콘 스킬) + beastMasteryPassiveDesc1: 주요 스킬 메뉴로 돌아가기 + beastMasteryPassiveDesc2: 스킬 트리에 투자할 토큰 + beastMasteryPassiveDesc3: Spur Kick 의 지속시간이 0.02초 증가합니다. + beastMasteryPassiveDesc4: 길들인 늑대가 주는 피해가 치명타일 확률 + 0.025% 증가합니다. + swordsmanshipPerkTitle0: Adrenaline [ 아드레날린 ] + swordsmanshipPerkTitle1: Killing Spree + swordsmanshipPerkTitle2: Adrenaline+ [ 아드레날린 + ] + swordsmanshipPerkTitle3: Killing Frenzy + swordsmanshipPerkTitle4: Thirst for Blood + swordsmanshipPerkTitle5: Sharper! + swordsmanshipPerkTitle6: Sword Mastery [ 검술 마스터리 ] + swordsmanshipPerkDesc0: 적대적인 몹을 검으로 죽일시에 신속 효과를 + 레벨당 2초간 부여합니다 + swordsmanshipPerkDesc1: 적대적인 몹을 검으로 죽일시에 힘 효과를 + 레벨당 2초간 부여합니다 + swordsmanshipPerkDesc2: 아드레날린 스킬로 부터 받는 +20%의 스피드 I 버프가 스피드 II 로 증가합니다. + swordsmanshipPerkDesc3: Killing Spree 스킬로 받는 +20%의 힘 I 버프가 힘 II + II 로 증가합니다. + swordsmanshipPerkDesc4: 검으로 적대적인 몹들을 죽일시에는 + 허기가 복원됩니다. + swordsmanshipPerkDesc5: swift strikes 사용시에 검에 날카로움 레벨효과를 추가합니다. + swordsmanshipPerkDesc6: 검은 영구적으로 +1 체력피해 데미지를 가합니다. + swordsmanshipPassiveTitle0: 패시브 토큰 + swordsmanshipPassiveTitle1: 뒤로 + swordsmanshipPassiveTitle2: 스킬 토큰 + swordsmanshipPassiveTitle3: Swift Strikes 지속시간 + swordsmanshipPassiveTitle4: Double Hit [ x2 피해 ] + swordsmanshipPassiveDesc0: 패시브 스킬에 투자할 토큰 (염료 아이콘 스킬) + swordsmanshipPassiveDesc1: 주요 스킬 메뉴로 돌아가기 + swordsmanshipPassiveDesc2: 스킬 트리에 투자할 토큰 + swordsmanshipPassiveDesc3: Swift Strikes의 지속시간이 0.02초 증가됩니다. + swordsmanshipPassiveDesc4: 몬스터 공격시에 한번에 두번 공격될 확률이 0.02% 증가됩니다. + ( 두번째 타격 데미지는 50%의 피해를 입힙니다. ) + defensePerkTitle0: Healer [ 힐러 ] + defensePerkTitle1: Stiffen [ 뻣뻣함 ] + defensePerkTitle2: Hard Headed [ 빈틈없는 사람 ] + defensePerkTitle3: Stiffen+ [ 뻣뻣함+ ] + defensePerkTitle4: Gift From Above [ 위에서 내려오는 축복 ] + defensePerkTitle5: Stronger Legs [ 강한 다리 ] + defensePerkTitle6: Hearty [ 혈기 왕성 ] + defensePerkDesc0: 사살 레벨당 3초의 재생효과 얻음 + defensePerkDesc1: 피해를 입을시에 2%확률로 저항 I 효과를 5초동안 얻습니다. + defensePerkDesc2: Hard Body 스킬에 레벨당 6.6%의 데미지 감소 효과를 추가합니다. + defensePerkDesc3: 피해를 입을시에 2%확률로 저항 II 효과를 5초동안 얻습니다. + defensePerkDesc4: Stone solid 능력 발동시간에는 1분간 +4 만큼의 체력 보호효과 를 + 부여합니다. + defensePerkDesc5: Stone Solid 스킬효과가 속도감소 I 에서 속도감소 IV 로 증가합니다. + defensePerkDesc6: 영구적인 체력 보너스 + 2칸 + defensePassiveTitle0: 패시브 토큰 + defensePassiveTitle1: 뒤로 + defensePassiveTitle2: 스킬 토큰 + defensePassiveTitle3: Stone Solid 지속시간 + defensePassiveTitle4: Hard Body [ 단단한 몸 ] + defensePassiveTitle5: Double Drops (적대 몬스터에게만) + defensePassiveDesc0: 패시브 스킬에 투자할 토큰 (염료 아이콘 스킬) + defensePassiveDesc1: 주요 스킬 메뉴로 돌아가기 + defensePassiveDesc2: 스킬 트리에 투자할 토큰 + defensePassiveDesc3: Stone Solid 의 지속시간 0.02초 증가됩니다. + defensePassiveDesc4: 레벨당 피해감소효과가 0.01% 증가합니다. + ( 기본 감소효과 -33% ) + defensePassiveDesc5: 공격적인 몬스터로부터 double drops 효과를 받을 + 기회가 0.05% 증가합니다 + axeMasteryPerkTitle0: Greater Axe [ 엄청난 도끼 ] + axeMasteryPerkTitle1: Holy Axe [ 신성한 도끼 ] + axeMasteryPerkTitle2: Revitalized [ 활성화! ] + axeMasteryPerkTitle3: Warrior Blood [ 피의 전사 ] + axeMasteryPerkTitle4: Earthquake [ 지진 ] + axeMasteryPerkTitle5: Better Crits [ ] + axeMasteryPerkTitle6: Axe Man [ 도끼와 한몸 ] + axeMasteryPerkDesc0: Great Axe 의 피해 반경이 레벨당 1 블록 씩 증가합니다. + axeMasteryPerkDesc1: 도끼로 타격시 2% 확률로 번개공격을 가합니다. + axeMasteryPerkDesc2: 사살시 레벨당 1% 확률로 모든 체력이 회복됩니다. + axeMasteryPerkDesc3: 도끼로 사살시 레벨당 힘 I 효과를 3초간 받습니다. + axeMasteryPerkDesc4: Ability's AOE 의 데미지는 두배가됩니다. (25% -> 50% ) + axeMasteryPerkDesc5: Divine Crits 스킬의 데미지 효과가 증가합니다. ( 1.25x -> 1.6x ) + axeMasteryPerkDesc6: 도끼가 영구적으로 1의 체력피해를 가합니다. + axeMasteryPassiveTitle0: 패시브 토큰 + axeMasteryPassiveTitle1: 뒤로 + axeMasteryPassiveTitle2: 스킬 토큰 + axeMasteryPassiveTitle3: Great Axe 지속시간 + axeMasteryPassiveTitle4: Divine Crits + axeMasteryPassiveDesc0: 패시브 스킬에 투자할 토큰 (염료 아이콘 스킬) + axeMasteryPassiveDesc1: 주요 스킬 메뉴로 돌아가기 + axeMasteryPassiveDesc2: 스킬 트리에 투자할 토큰 + axeMasteryPassiveDesc3: Great Axe의 지속시간을 0.02초 증가시킵니다. + axeMasteryPassiveDesc4: 랜덤으로 크리티컬(데미지 x1.25배) 확률을 0.01% 증가시킵니다. + repairPerkTitle0: Salvaging + repairPerkTitle1: Resourceful + repairPerkTitle2: Magic Repair Mastery [ 마법 수리 마스터리 ] + repairPerkDesc0: Get more materials on average from salvaging + repairPerkDesc1: 10% 확률로 수리에 필요한 재료들을 소모하지않음 + repairPerkDesc2: 수리에 필요한 인첸트 보장 + repairPassiveTitle0: 뒤로 + repairPassiveTitle1: 스킬 토큰 + repairPassiveTitle2: Proficiency [ 숙달자 ] + repairPassiveDesc0: 주요 스킬 메뉴로 돌아가기 + repairPassiveDesc1: 스킬 트리에 투자할 토큰 + repairPassiveDesc2: 수리시에 내구도복구량 증가 + agilityPerkTitle0: 회피 + agilityPerkTitle1: Steel Bones [ 강철 뼈 ] + agilityPerkTitle2: Graceful Feet [ 우아한 발 ] + agilityPerkDesc0: 레벨당 회피공격 확률 4% 증가 + agilityPerkDesc1: 레벨당 낙하데미지 10% 감소 + agilityPerkDesc2: 영구적인 이동속도 버프 (명령어 on/off - /speedToggle) + agilityPassiveTitle0: 뒤로 + agilityPassiveTitle1: 스킬 토큰 + agilityPassiveTitle2: 구르기 + agilityPassiveDesc0: 주요 스킬 메뉴로 돌아가기 + agilityPassiveDesc1: 스킬 트리에 투자할 토큰 + agilityPassiveDesc2: 구르기와 낙하데미지 감소 확률 + alchemyPerkTitle0: Alchemical Summoning [ 연금술 소환 ] + alchemyPerkTitle1: Ancient Knowledge [ 고대의 지식 ] + alchemyPerkTitle2: Potion Master [ 포션 마스터 ] + alchemyPerkDesc0: 양조기 없이 일부 물약을 제조 할수있음 + alchemyPerkDesc1: 새로운 물약 제조방법 잠금해제 + alchemyPerkDesc2: 사용한 포션의 레벨이 1 증가한다 (toggleable with /togglePotion) + alchemyPassiveTitle0: 뒤로 + alchemyPassiveTitle1: 스킬 토큰 + alchemyPassiveTitle2: Half-life+ [ 하프-라이프+ ] + alchemyPassiveDesc0: 주요 스킬 메뉴로 돌아가기 + alchemyPassiveDesc1: 스킬 트리에 투자할 토큰 + alchemyPassiveDesc2: 포션을 사용했을때 지속시간이 증가합니다. + smeltingPerkTitle0: Fuel Efficiency [ 연료 효율 ] + smeltingPerkTitle1: Double Smelt [ x2 제련 ] + smeltingPerkTitle2: Flame Pickaxe [ 화염의 곡괭이 ] + smeltingPerkDesc0: 레벨당 연료가 20% 더 지속됨 + smeltingPerkDesc1: 광석 용해시 두배로 휙득할 확률이 레벨당 5% 증가 + smeltingPerkDesc2: 광석이 채광즉시 용해됨 ( 명령어 on,off - /toggleFlamePick) + smeltingPassiveTitle0: 뒤로 + smeltingPassiveTitle1: 스킬 토큰 + smeltingPassiveTitle2: 화로 스피드 + smeltingPassiveDesc0: 주요 스킬 메뉴로 돌아가기 + smeltingPassiveDesc1: 스킬 트리에 투자할 토큰 + smeltingPassiveDesc2: 음식 굽는 속도 증가 + enchantingPerkTitle0: Efficient Enchanting [ 효과적인 인첸트 ] + enchantingPerkTitle1: Booksmart [ 책방 ] + enchantingPerkTitle2: Immortal Experience[ 불멸의 경험치 ] + enchantingPerkDesc0: 레벨당 인첸트 필요레벨 -1, 모루 수리비용 -1 (최소 2등급) + enchantingPerkDesc1: 일부 인첸트책 제작법 잠금 해제 + enchantingPerkDesc2: 사망해도 경험치 유지 + enchantingPassiveTitle0: 뒤로 + enchantingPassiveTitle1: 스킬 토큰 + enchantingPassiveTitle2: 더 빠른 개발 + enchantingPassiveDesc0: 주요 스킬 메뉴로 돌아가기 + enchantingPassiveDesc1: 스킬 트리에 투자할 토큰 + enchantingPassiveDesc2: 받는 모든 경험치량 증가 + globalPerkTitle0: Gatherer [ 채집가 ] + globalPerkTitle1: Scholar [ 학자 ] + globalPerkTitle2: Fighter [ 파이터 ] + globalPerkTitle3: Hard Work [ 어려운 일 ] + globalPerkTitle4: Research [ 재검색 ] + globalPerkTitle5: Training [ 트레이닝 ] + globalPerkTitle6: Reincarnation+ [ 라인카네이션 ] + globalPerkTitle7: Soul Harvesting [ 영혼 수확 ] + globalPerkTitle8: Avatar [ 아바타 ] + globalPerkTitle9: Master of the Arts [ 예술의 마스터 ] + globalPerkDesc0: 토굴,벌목,채굴,농사,낚시 에서 +20%의 경험치를 휙득함 + globalPerkDesc1: 수리,민첩,양조,제련,인첸트 에서 +20%의 경험치를 휙득함 + globalPerkDesc2: 궁술,야수마스터리,검술,방어,도끼마스터리 에서 +20%의 경험치를 휙득함 + globalPerkDesc3: Gatherer 스킬에서 얻는 토큰수 +1 + globalPerkDesc4: Scholar 스킬에서 얻는 토큰수 +1 + globalPerkDesc5: Fighter 스킬에서 얻는 토큰수 +1 + globalPerkDesc6: 사망시에 50% 확률로 인벤토리에 아이템이 남아있습니다 + globalPerkDesc7: 당신은 공격적인 적들을 죽이면 영혼을 휙득하고, 영혼을 스킬트리 환불에 사용할수잇다 + globalPerkDesc8: 피해를 입지않고 적을 죽이면 10% 확률로 10초간 모든버프를 휙득함 + globalPerkDesc9: 능력 재사용 대기시간 33% 감소 + globalPassiveTitle0: 글로벌스킬 토큰 + globalPassiveTitle1: 뒤로 + globalPassiveDesc0: 스킬 트리에 투자할 토큰 + globalPassiveDesc1: 주요 스킬 메뉴로 돌아가기 + cannotRepair: 능력이 활성화 중인 상태에서는 복구를 할수없습니다. + cannotSalvage: 능력이 활성화 중일때는 salvage 할수없습니다. + spite: Everything good is made of spite + refundSkill: 스킬 트리를 환불해야 함 + refundSkill2: in order to refund a skill tree + needToUnlock: 잠금을 해제해야 합니다. + perkRequirement: 이 능력을 잠금 해제하려면 이전 능력에 최소 2개의 + 기술 토큰을 투자해야 함 + perkRequirementM: 당신은 스킬트리에 10개이상의 토근을 소모해야 + 마스터 스킬을 해제 할수있습니다. + noSkillTokens: 당신은 어떤 스킬 토큰 도 가지고있지않습니다. + noPassiveTokens: 당신은 어떤 패시브 토큰을 가지고있지않다. + maxedOutPerk: 당신은 이미 스킬 전부를 해제 하였습니다. + requiredGlobalPerks0: 이 스킬을 잠금해제 하려면 이전의 스킬이 필요합니다. + requiredGlobalPerks1: ← 스킬 잠금해제에 필요한 스킬들 + requiredGlobalPerks2: ← 스킬을 잠금해제 해야 이스킬을 해제할수잇습니다. + requiredGlobalPerks3: 모든 글로벌 스킬을 해제해야 이 스킬을 휙득할수 있습니다. + craftRequirement: ← 레시피를 만드는데 필요함 + roll: 구르기 + dodge: 피하기 + prepare: 능력이 활성화되었습니다 + rest: 쿨타임 + activated: 활성화! + ended: 사용시간이 끝낫습니다 + readyToUse: 준비까지 + cooldown: 쿨타임 준비중 + rapidFire: Rapid Fire 스킬의 + bow: 활을 사용하세요! + greatAxe: Great Axe 스킬의 + axe: 도끼를 사용하세요! + spurKick: Spur Kick 스킬의 + leg: leg + stoneSoldier: Stone Soldier 스킬의 + yourself: 좌클릭을 하세요! + bigDig: Big Dig 스킬의 + shovel: 삽을 사용하세요! + naturalRegeneration: 자연 재생 + hoe: 호미을 사용하세요! + superBait: Super Bait 스킬의 + fishingRod: fishing rod 스킬의 + berserkPick: Berserk Pick 스킬의 + pickaxe: 곡괭이을 사용하세요! + swiftStrikes: Swift Strikes [ 신속한 피해 ] + sword: 검을 사용하세요! + timber: Timber 스킬의 + hyperHorse: This horse is already hyper! + magicForce: A magic force ends your ability + rob: Rob + repairFail0: You are not skilled enough to adequately repair this item + repairFail1: You failed to salavage any materials + repairFail2: You failed to retain the item's enchantment power + treeTooBig0: 이 나무는 너무커서 한번에 자를수 없어! + treeTooBig1: This tree can never be chopped in one go like this... + noPermission: 이 명령어를 사용하기위한 권한이 없습니다. + improperArguments: Improper Arguments, try + totalPlayTime: 총 플레이 시간 + clickForOptions: 옵션을 보려면 클릭하십시오. + unknownCommand: 커맨드 잠금해제 + expToLevel: 레벨업하기 위한 필요경험치 + playerName: playerName + skillName: 스킬이름 (영문) + page: 페이지 + on0: 'ON' + off0: 'OFF' + onOrOff: ON/OFF + manuallyToggles: 수동으로 전환 + commandDesc0: 모든 스킬의 메인 GUI 열기 + commandDesc1: 선택한 스킬트리의 GUI 열기 + commandDesc2: 환결설정 GUI 열기 + commandDesc3: 선택한 플레이어에게 스킬을 사용해 경험치를 줍니다. + commandDesc4: 스킬을 사용해서 준 유저의 레벨을 설정 + commandDesc5: 지정된 스킬에 유저의 스탯을 초기화함. ( 스탯 환불 안됨 ) + commandDesc6: 지정된 스탯을 위한 리더보드 화면 표시 + commandDesc7: 플러그인 정보 페이지에 대한 링크 제공 + commandDesc8: Attempts to enchant an item in the users hand at a specified level + informationURL: 정보 URL (Google Docs) + click: 클릭 + levelArgument: Level argument must be less than 40 + leaderboard: 리더보드 + playerOffline: 그 유저는 현재 오프라인 상태입니다. + onlyIncrease: Please only increase exp with this command, otherwise, use /frpg + statReset then /frpg giveEXP + amount: 총량 + unlockToggle: 이 커맨드를 사용하기위해선 잠금해제해야함 + levelUpNotif: 레벨업 알림 + abilityPreparationNotif: 능력 준비 알림 + yes0: 'YES' + no0: 'NO' + warning: 주의 + souls: 소울 + refundSkillTree0: 스킬트리비용 환불받기 + refundSkillTree1: and is not reversible, are you sure you want to + refundSkillTree2: 환불해라 → + skill: 스킬 + backToSkillTree: 스킬 트리로 돌아가기 + miningPerkDesc0_1: 아무 광물이나 채광하면 2초간 헤이스트 효과 받음 + miningPerkDesc0_2: 아무 광물이나 채광하면 5초간 헤이스트 효과 받음 + miningPerkDesc0_3: 아무 광물이나 채광하면 10초간 헤이스트 효과 받음 + miningPerkDesc0_4: 헤이스트 1단계를 받는동안 5초안에 아무 광석이나 채광시 헤이스트 2단계 받음 + miningPerkDesc0_5: 아무 광물이나 채광하면 10초간 헤이스트 2단계 효과 받음 + woodcuttingPerkDesc3_1: 나뭇잎에서 깃털이 드랍됩니다. + common: common [ 커먼 ] + uncommon: uncommon [ 언커먼 ] + rare: rare [ 레어 ] + veryRare: very rare + legendary: legendary [ 레전더리 ] + fishingPerkDesc1_1: 보물 티어 잠금해제 + farmingPerkDesc1_1: 제작 능력 획득 + cowSpawnEgg: 소 스폰 알 + beeSpawnEgg: 벌 스폰 알 + mooshroomSpawnEgg: 버섯소 스폰 알 + horseSpawnEgg: 말 스폰 알 + slimeSpawnEgg: 슬라임 스폰 알 + diggingPerkDesc0_1: 이제부터 채굴할수있습니다. → + defensePerkDesc0_1: 사살 레벨당 스킬에서 3초의 리젠을 얻음 + defensePerkDesc0_2: 즉사할시 레벨당 0.5의 체력을 얻음 + duration: 지속시간 + likelihood: 확률 + junkChance: Junk Chance + locked: 잠김 + unlocked: 해제 + cowEgg: 소 알 + beeEgg: 벌 알 + mooshroomEgg: 버섯소 알 + horseEgg: 말 알 + slimeEgg: 슬라임 알 + tippedArrows: Tipped Arrows + toggle: 활성화 + refundSkillTitle: 스킬 환불 + refundSkillTreeDesc: 스킬 트리를 환불하려면 클릭하십시오. + enchantingPerkDesc1_0: 제작 능력 잠금해제 + enchantingPerkDesc1_1: 파워 I , 효율 I 인첸트북 해제 ( 제작에 1레벨 소모 ) + enchantingPerkDesc1_2: 날카로움 I , 보호 I 인첸트북 해제 ( 제작에 1레벨 소모 ) + enchantingPerkDesc1_3: 바다의행운 I , 미끼 I 인첸트북 해제 ( 제작에 1레벨 소모 ) + enchantingPerkDesc1_4: 물갈퀴 I , 차가운 걸음 I enchanted books ( 제작에 1레벨 소모 ) + enchantingPerkDesc1_5: 수선 ( 제작에 10레벨 소모 ) , 행운 I ( 제작에 2레벨 소모) 인첸트북 해제 + repairPerkDesc0_1: 보통 확률로 더 많은 재료를 얻습니다. + repairPerkDesc0_2: 보통 확률로 더 많은 재료를 얻으며, 인양(견인)을 통해 얻는 마법부여 + 아이템들의 효과가 인첸트 북으로 바뀝니다. + xpBoost: 경험치 부스트 + speedBoost: 속도 부스트 + timeExtension: 시간 연장 + enchantingCraft0: 힘 I 인첸트책 + enchantingCraft1: 효율 I 인첸트책 + enchantingCraft2: 날카로움 I 인첸트책 + enchantingCraft3: 보호 I 인첸트책 + enchantingCraft4: 바다의 행운 I 인첸트책 + enchantingCraft5: 미끼 I 인첸트책 + enchantingCraft6: 차가운 걸음 I 인첸트책 + enchantingCraft7: 물갈퀴 I 인첸트책 + enchantingCraft8: 수선 인첸트책 + enchantingCraft9: 행운 I 인첸트책 + commandDesc9: 지정된 플레이어의 소울 설정 + commandDesc10: 지정된 플레이어에 대해 지정된 스킬에 스킬 또는 패시브 토큰 설정 + commandDesc11: 지정된 플레이어의 글로벌 토큰 설정 + commandDesc12: 모든 플레이어 또는 지정된 플레이어의 통계 저장 + status: 상태 + complete: 완성 + incomplete: 미완성 + try0: try + passiveImprove: 당신의 패시브 퍽이 모든 레벨을 증가시킴 + increasedBy: 레벨 증가됨 + + expIncrease: EXP Multiplier + personalMultiplier: Personal Multiplier + translators: Translators + commandDesc13: Sets the personal multiplier for a specified player + abilityDescription: 능력의 정보 + abilityDescription_digging: 일시적으로 삽에 5 효율 효과를 적용합니당. + 삽을 들고 우클릭후 토굴시 능력이 적용됨. + abilityDescription_woodcutting: 일시적으로 찹트리 능력을 휙득합니다 ( ^_^ ) + 도끼를 들고 우클릭후 벌목시 능력이 적용됨. + abilityDescription_mining: 일시적으로 곡괭이에 5 효율 효과를 적용한다. + 곡괭이를 들고 우클릭후 채광시 능력이 적용됨. + abilityDescription_farming: 일시적으로 괭이로 농작물들을 자동으로 수확합니다. + 괭이를 들고 우클릭후 작물을 캐면 능력이 적용됨. + abilityDescription_fishing: 일시적으로 낚싯대에 물고기만 걸리게 됩니다. + 낚시대를 들고 우클릭후 낚시를 시작하면 활성화됨. + abilityDescription_archery: 일시적으로 모든 화살이 최대속도로 발사됨. + 활을 들고 우클릭후 화살을 쏘면 능력이 적용됨. + abilityDescription_beastMastery: 말에게 임시로 스피드 버프를 준다. + 말을 탄상태로 좌클릭 유지상태로 우클릭을 하면 활성화됨. + abilityDescription_swordsmanship: 검을 휘두를때 최대피해 쿨타임을 없애준다. + 검을 든상태로 우클릭후 몬스터타격시 능력이 적용됨. + abilityDescription_defense: 상대에게 속도저항과 저항효과를 줌 + 빈손으로 우클릭후 몬스터 타격시 능력이 적용됨. + abilityDescription_axeMastery: 특정 반경내의 모든 몬스터에게 일시적인 피해를 가함 + 도끼를 든 상태로 우클릭후 몬스터타격시 능력이 적용됨. + alchemyPerkDesc1_0: 양조 기능 해제 + alchemyPerkDesc0_0: 제작테이블에서 물약을 제조할수잇습니다. + triggerAbilities: Trigger Abilities + showEXPBar: 경험치 바 활성화 + disabledSkill: 이 스킬은 비활성화됨 + skillConfigDesc: 이 스킬에 대한 구성 메뉴로 이동 + lvl: 레벨. + exp: 경험치 + potionAbsorption: 흡수의 물약 + potionBadOmen: 흉조의 물약 ( 마을에 잇으면 부정적인 효과를 일으킴 ) + potionBlindess: 실명의 물약 + potionConduitPower: 도관 전달체 물약 ( 수중호흡 + 야간투시 ) + potionResistance: 저항의 물약 + potionDolphinsGrace: 돌고래의 우아함 물약 + potionHaste: 가속의 물약 + potionFireResistance: 화염 저항의 물약 + potionGlowing: 발광의 물약 + potionHarm: 피해의 물약 + potionHealing: 치유의 물약 + potionHealthBoost: 체력 재생의 물약 + potiontheHero: 마을의 영웅 물약 ( 상인과의 거래비용이 감소함 ) + potionHunger: 굶주림의 물약 + potionStrength: 힘의 물약 + potionInvsibility: 투명화 물약 + potionJump: 도약의 물약 + potionLuck: 행운의 물약 + potionNightVision: 야간 투시의 물약 + potionRegeneration: 재생의 물약 + potionSaturation: 포화의 물약 ( 허기보충에 보너스효과 ) + potionSlowness: 감속의 물약 + potionFatigue: 피로의 물약 + potionSlowFalling: 느린 낙하의 물약 + potionSpeed: 신속의 물약 + potionBadLuck: 불행의 물약 + potionWaterBreathing: 수중 호흡의 물약 + potionWeakness: 나약함의 물약 + potionDecay: 부패의 물약 + potionAwkward: 어색한 물약 + potionUncraftable: 제작 불가능한 물약 + potionMundane: 평범한 물약 + potionTurtleMaster: 거북 도사의 물약 + potionThick: 진한 물약 + potionWater: 물병 + ingredient: 성분 + usedToBrew: 양조 할때 사용됨 + costs: 비용 + xpLevel: 마인크래프트 경험치 레벨 + xpLevels: 마인크래프트 경험치 레벨 + craftXPRequirement: This recipe requires at least + bedGUI: 이 명령은 침대에 있는 동안에는 사용할 수 없다! + statsUpdated: Your stats were changed to be consistent with a new EXP curve. All + skill trees and passive perks have been reset. All tokens must be re-invested. + timeRemaining: Time Remaining + numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed + commandDesc14: Resets the cooldown period for a skill to 0 seconds + commandDesc15: Looks up a player's FreeRPG stats + repairUnsafeEnchant: This item is too powerful to be repaired + salvageUnsafeEnchant: This item is too powerful to be salvaged + rank: 랭크 + stats: 스탯 + outOf: out of + playerNotInLeaderboard: 그 플레이어는 리더보드에 없습니다 + virtual: Virtual + commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount + (positive or negative) - custom: - languageName: Čûşŧøm Ľãņğŭågè - englishLanguageName: Custom Language - translationCredit: N/A - global: Global - digging: Digging - woodcutting: Woodcutting - mining: Mining - farming: Farming - fishing: Fishing - archery: Archery - beastMastery: Beast Mastery - swordsmanship: Swordsmanship - defense: Defense - axeMastery: Axe Mastery - repair: Repair - alchemy: Alchemy - agility: Agility - smelting: Smelting - enchanting: Enchanting - information: Information - configuration: Configuration - level: Level - experience: Experience - toNext: to next - total: Total - diggingPerkTitle0: Mo' drops - diggingPerkTitle1: Double Treasure - diggingPerkTitle2: Rarer Drops - diggingPerkTitle3: Soul Stealer - diggingPerkTitle4: Flint Finder - diggingPerkTitle5: Shovel Knight - diggingPerkTitle6: Mega Dig - diggingPerkDesc0: Expands treasure drop table by 1 item per level - diggingPerkDesc1: +5% chance of receiving double treasure drop per level (when - treasure is rolled) - diggingPerkDesc2: Further expands drop table by item per level - diggingPerkDesc3: Soul sand is +5% more likely to drop treasure per level - diggingPerkDesc4: Gravel has 100% flint drop rate (toggleable by /flintToggle) - diggingPerkDesc5: Shovels do double damage - diggingPerkDesc6: When using ability, you now break a 3x3 block section (20% of - normal treasure rate when active) - diggingPassiveTitle0: Passive Tokens - diggingPassiveTitle1: Back - diggingPassiveTitle2: Skill Tokens - diggingPassiveTitle3: Big Dig Duration - diggingPassiveTitle4: Treasure Chance - diggingPassiveDesc0: Tokens to invest in passive skills (dyes) - diggingPassiveDesc1: Takes you back to the main skills menu - diggingPassiveDesc2: Tokens to invest in skill tree - diggingPassiveDesc3: Increases duration of Big Dig by 0.02 s - diggingPassiveDesc4: Increases chance of digging up treasure by 0.005% - woodcuttingPerkTitle0: Zealous Roots - woodcuttingPerkTitle1: Fresh Arms - woodcuttingPerkTitle2: Hidden Knowledge - woodcuttingPerkTitle3: Leaf Scavenger - woodcuttingPerkTitle4: Timber+ - woodcuttingPerkTitle5: Leaf Blower - woodcuttingPerkTitle6: Able Axe - woodcuttingPerkDesc0: +20% chance for logs to drop 1 XP per level - woodcuttingPerkDesc1: +12 s per level of Haste I after first log broken in 5 minutes - woodcuttingPerkDesc2: Logs have a +0.2% chance per level to drop an enchanted - book - woodcuttingPerkDesc3: Leaves have a 1% chance to drop +1 treasure item per level - woodcuttingPerkDesc4: Timber break limit increased from 64 to 128 - woodcuttingPerkDesc5: Break a large section of leaves using an axe (toggleable with /leafBlowerToggle) - woodcuttingPerkDesc6: Double drops, Zealous Roots, and Hidden Knowledge all now - apply to timber (at half effectiveness) - woodcuttingPassiveTitle0: Passive Tokens - woodcuttingPassiveTitle1: Back - woodcuttingPassiveTitle2: Skill Tokens - woodcuttingPassiveTitle3: Timber Duration - woodcuttingPassiveTitle4: Double Drops - woodcuttingPassiveDesc0: Tokens to invest in passive skills (dyes) - woodcuttingPassiveDesc1: Takes you back to the main skills menu - woodcuttingPassiveDesc2: Tokens to invest in skill tree - woodcuttingPassiveDesc3: Increases duration of Timber by 0.02 s - woodcuttingPassiveDesc4: Increases chance to receive a double drop by 0.05% - miningPerkTitle0: Wasteless Haste - miningPerkTitle1: More Bombs - miningPerkTitle2: Treasure Seeker - miningPerkTitle3: Bomb-boyage - miningPerkTitle4: Vein Miner - miningPerkTitle5: Demolition Man - miningPerkTitle6: Triple Trouble - miningPerkDesc0: Gain haste after mining ores for each level - miningPerkDesc1: The crafting recipe for TNT produces +1 TNT block per level - miningPerkDesc2: When using ability on stones, +1% per level chance for an ore - to drop (extra exp is earned from dropped ores) - miningPerkDesc3: Increases TNT blast radius (when lit by flint and steel) each - level - miningPerkDesc4: Ore veins are instantly mined upon breaking one block (toggle-able) - miningPerkDesc5: No damage is taken from TNT explosions - miningPerkDesc6: Double drops are now triple drops - miningPassiveTitle0: Passive Tokens - miningPassiveTitle1: Back - miningPassiveTitle2: Skill Tokens - miningPassiveTitle3: Berserk Pick Duration - miningPassiveTitle4: Double Drops - miningPassiveTitle5: Blast Mining - miningPassiveDesc0: Tokens to invest in passive skills (dyes) - miningPassiveDesc1: Takes you back to the main skills menu - miningPassiveDesc2: Tokens to invest in skill tree - miningPassiveDesc3: Increases duration of Berserk Pick by 0.02s - miningPassiveDesc4: Increases chance to receive a double drop from ores by 0.05% - miningPassiveDesc5: Increases chances for ore to be created from TNT explosions - by 0.01% (More blocks broken = More treasure rolls) - farmingPerkTitle0: Better Fertilizer - farmingPerkTitle1: Animal Farm - farmingPerkTitle2: Farmer's Diet - farmingPerkTitle3: Carnivore - farmingPerkTitle4: Green Thumb - farmingPerkTitle5: Growth Hormones - farmingPerkTitle6: One with Nature - farmingPerkDesc0: +10% chance to not consume bonemeal on use - farmingPerkDesc1: Can craft an additional spawn egg per level - farmingPerkDesc2: Farm food is +20% more effective at restoring hunger and saturation - per level - farmingPerkDesc3: Meat is +20% more effective at restoring hunger and saturation - per level - farmingPerkDesc4: Ability may replant crops fully grown with higher chance of - replanting in later growth stages; ability now effects Melons and Pumpkins - farmingPerkDesc5: Sugar can be used on baby animals to make them grow instantly - farmingPerkDesc6: Gain Regeneration I when standing still on grass - farmingPassiveTitle0: Passive Tokens - farmingPassiveTitle1: Back - farmingPassiveTitle2: Skill Tokens - farmingPassiveTitle3: Natural Regeneration Duration - farmingPassiveTitle4: Double Drops (Crops) - farmingPassiveTitle5: Double Drops (Animals) - farmingPassiveDesc0: Tokens to invest in passive skills (dyes) - farmingPassiveDesc1: Takes you back to the main skills menu - farmingPassiveDesc2: Tokens to invest in skill tree - farmingPassiveDesc3: Increases duration of Natural Regeneration by 0.02s - farmingPassiveDesc4: Increases chance to receive a double drop from crops by 0.05% - farmingPassiveDesc5: Increases chance to receive a double drop from most passive - animals by 0.05% - fishingPerkTitle0: Rob - fishingPerkTitle1: Scavenger - fishingPerkTitle2: Fisherman's Diet - fishingPerkTitle3: Filtration - fishingPerkTitle4: Grappling Hook - fishingPerkTitle5: Hot Rod - fishingPerkTitle6: Fish Person - fishingPerkDesc0: +15% chance to pull item off a mob per level - fishingPerkDesc1: Unlocks new tier of fishing treasure - fishingPerkDesc2: Fish restore +20% hunger per level - fishingPerkDesc3: Higher tier (II-V) loot becomes more common, lower tier (I) - becomes less common - fishingPerkDesc4: Fishing rod now acts as a grappling hook (toggleable with /grappleToggle - ) - fishingPerkDesc5: Fish are now cooked when caught, some fishing treasures are - changed (toggleable with /hotRodToggle) - fishingPerkDesc6: Infinite night vision when underwater, infinite dolphin's grace - when in the water - fishingPassiveTitle0: Passive Tokens - fishingPassiveTitle1: Back - fishingPassiveTitle2: Skill Tokens - fishingPassiveTitle3: Super Bait Duration - fishingPassiveTitle4: Double catches - fishingPassiveTitle5: Treasure Finder - fishingPassiveDesc0: Tokens to invest in passive skills (dyes) - fishingPassiveDesc1: Takes you back to the main skills menu - fishingPassiveDesc2: Tokens to invest in skill tree - fishingPassiveDesc3: Increases duration of Super Bait by 0.01s - fishingPassiveDesc4: Increases chance to receive a double drop by 0.05% - fishingPassiveDesc5: Decreases chance of finding junk by 0.005%, increases chance - of finding treasure by 0.005% - archeryPerkTitle0: Extra Arrows - archeryPerkTitle1: Sniper - archeryPerkTitle2: Arrow of Light - archeryPerkTitle3: Explosive Arrows - archeryPerkTitle4: Dragon-less Arrows - archeryPerkTitle5: Crossbow Rapid Load - archeryPerkTitle6: Deadly Strike - archeryPerkDesc0: +1 arrow gained from crafting per level - archeryPerkDesc1: Arrow speed increases by +2% per level (~4% damage increase/level) - archeryPerkDesc2: Spectral arrows get a +5% damage boost per level - archeryPerkDesc3: Arrows have a +1% of creating an explosion on hit - archeryPerkDesc4: Allows crafting all tipped arrows with regular potions instead - of lingering potions - archeryPerkDesc5: Ability can now be used with crossbows, making all shots load - instantly - archeryPerkDesc6: Fireworks shot from crossbows do double damage (up to 16 hearts - of damage) - archeryPassiveTitle0: Passive Tokens - archeryPassiveTitle1: Back - archeryPassiveTitle2: Skill Tokens - archeryPassiveTitle3: Rapid Fire Duration - archeryPassiveTitle4: Retrieval - archeryPassiveDesc0: Tokens to invest in passive skills (dyes) - archeryPassiveDesc1: Takes you back to the main skills menu - archeryPassiveDesc2: Tokens to invest in skill tree - archeryPassiveDesc3: Increases duration of Rapid Fire by 0.02s - archeryPassiveDesc4: Increases chance for arrow shot to not consume arrow by 0.05% - per level - beastMasteryPerkTitle0: Thick Fur - beastMasteryPerkTitle1: Sharp Teeth - beastMasteryPerkTitle2: Healthy Bites - beastMasteryPerkTitle3: Keep Away - beastMasteryPerkTitle4: Acro-Dog - beastMasteryPerkTitle5: Identify - beastMasteryPerkTitle6: Adrenaline Boost - beastMasteryPerkDesc0: Dogs take -10% damage per level - beastMasteryPerkDesc1: Dogs do +10% more damage per level - beastMasteryPerkDesc2: Dogs heal +1/2 heart per level from killing - beastMasteryPerkDesc3: Dogs have gain +5% chance of knocking back foes - beastMasteryPerkDesc4: Dogs do not take fall damage - beastMasteryPerkDesc5: Using a compass on a horse or wolf now shows their stats - beastMasteryPerkDesc6: Spur kick buff is now speed III - beastMasteryPassiveTitle0: Passive Tokens - beastMasteryPassiveTitle1: Back - beastMasteryPassiveTitle2: Skill Tokens - beastMasteryPassiveTitle3: Spur Kick Duration - beastMasteryPassiveTitle4: Critical Bite - beastMasteryPassiveDesc0: Tokens to invest in passive skills (dyes) - beastMasteryPassiveDesc1: Takes you back to the main skills menu - beastMasteryPassiveDesc2: Tokens to invest in skill tree - beastMasteryPassiveDesc3: Increases duration of Spur Kick by 0.02s - beastMasteryPassiveDesc4: Increases chance for a dog to have a critical hit by - 0.025% - swordsmanshipPerkTitle0: Adrenaline - swordsmanshipPerkTitle1: Killing Spree - swordsmanshipPerkTitle2: Adrenaline+ - swordsmanshipPerkTitle3: Killing Frenzy - swordsmanshipPerkTitle4: Thirst for Blood - swordsmanshipPerkTitle5: Sharper! - swordsmanshipPerkTitle6: Sword Mastery - swordsmanshipPerkDesc0: Killing hostile mobs with a sword provides +2 s of speed - per level - swordsmanshipPerkDesc1: Killing hostile mobs with a sword provides +2 s of strength - per level - swordsmanshipPerkDesc2: +20% of speed I buff from Adrenaline is now speed II - swordsmanshipPerkDesc3: +20% of strength I buff from Killing Spree is now strength - II - swordsmanshipPerkDesc4: Killing certain aggressive mobs with a sword restores - hunger - swordsmanshipPerkDesc5: Swift strikes now adds a level of sharpness to your sword - swordsmanshipPerkDesc6: Swords permanently do +1 heart of damage - swordsmanshipPassiveTitle0: Passive Tokens - swordsmanshipPassiveTitle1: Back - swordsmanshipPassiveTitle2: Skill Tokens - swordsmanshipPassiveTitle3: Swift Strikes Duration - swordsmanshipPassiveTitle4: Double Hit - swordsmanshipPassiveDesc0: Tokens to invest in passive skills (dyes) - swordsmanshipPassiveDesc1: Takes you back to the main skills menu - swordsmanshipPassiveDesc2: Tokens to invest in skill tree - swordsmanshipPassiveDesc3: Increases duration of Swift Strikes by 0.02s - swordsmanshipPassiveDesc4: Increases chance to hit mob twice (second hit does - 50% damage) by 0.02% - defensePerkTitle0: Healer - defensePerkTitle1: Stiffen - defensePerkTitle2: Hard Headed - defensePerkTitle3: Stiffen+ - defensePerkTitle4: Gift From Above - defensePerkTitle5: Stronger Legs - defensePerkTitle6: Hearty - defensePerkDesc0: Gain +3s of regen per level on kill - defensePerkDesc1: +2% chance to gain resistance I for 5s when hit - defensePerkDesc2: Hard Body decreases damage by an additional 6.6% per level - defensePerkDesc3: +2% chance to gain resistance II for 5s when hit - defensePerkDesc4: Stone Solid now grants 4 absorption hearts for ability length - +1 minute - defensePerkDesc5: Stone Solid now gives slowness I instead of slowness IV - defensePerkDesc6: +2 hearts permanently - defensePassiveTitle0: Passive Tokens - defensePassiveTitle1: Back - defensePassiveTitle2: Skill Tokens - defensePassiveTitle3: Stone Solid Duration - defensePassiveTitle4: Hard Body - defensePassiveTitle5: Double Drops (Hostile Mobs) - defensePassiveDesc0: Tokens to invest in passive skills (dyes) - defensePassiveDesc1: Takes you back to the main skills menu - defensePassiveDesc2: Tokens to invest in skill tree - defensePassiveDesc3: Increases duration of Stone Solid by 0.02s - defensePassiveDesc4: Increases chance to take reduced (base -33%) damage by 0.01% - per level - defensePassiveDesc5: Increases chance to receive double drops from aggressive - mobs by 0.05% - axeMasteryPerkTitle0: Greater Axe - axeMasteryPerkTitle1: Holy Axe - axeMasteryPerkTitle2: Revitalized - axeMasteryPerkTitle3: Warrior Blood - axeMasteryPerkTitle4: Earthquake - axeMasteryPerkTitle5: Better Crits - axeMasteryPerkTitle6: Axe Man - axeMasteryPerkDesc0: Great Axe damage radius increases by 1 block per level - axeMasteryPerkDesc1: +2% chance for lighting to strike mobs on axe hit - axeMasteryPerkDesc2: +1% chance for full heal on kill per level - axeMasteryPerkDesc3: +3 s per level of Strength I on kills with an axe - axeMasteryPerkDesc4: Ability's AOE damage is doubled (25% -> 50% of damage) - axeMasteryPerkDesc5: Divine Crits now have 1.6x multiplier instead of 1.25x - axeMasteryPerkDesc6: Axes permanently do +1 heart of damage - axeMasteryPassiveTitle0: Passive Tokens - axeMasteryPassiveTitle1: Back - axeMasteryPassiveTitle2: Skill Tokens - axeMasteryPassiveTitle3: Great Axe Duration - axeMasteryPassiveTitle4: Divine Crits - axeMasteryPassiveDesc0: Tokens to invest in passive skills (dyes) - axeMasteryPassiveDesc1: Takes you back to the main skills menu - axeMasteryPassiveDesc2: Tokens to invest in skill tree - axeMasteryPassiveDesc3: Increases duration of Great Axe by 0.02s - axeMasteryPassiveDesc4: Increases random crit chance (base 1.25x damage) by 0.01% - repairPerkTitle0: Salvaging - repairPerkTitle1: Resourceful - repairPerkTitle2: Magic Repair Mastery - repairPerkDesc0: Get more materials on average from salvaging - repairPerkDesc1: +10% chance of keeping material used when repairing - repairPerkDesc2: Guarenteed to keep enchants on repair - repairPassiveTitle0: Back - repairPassiveTitle1: Skill Tokens - repairPassiveTitle2: Proficiency - repairPassiveDesc0: Takes you back to the main skills menu - repairPassiveDesc1: Tokens to invest in skill tree - repairPassiveDesc2: Materials restore more durability on repair - agilityPerkTitle0: Dodge - agilityPerkTitle1: Steel Bones - agilityPerkTitle2: Graceful Feet - agilityPerkDesc0: +4% chance to dodge attacks per level - agilityPerkDesc1: -10% fall damage per level - agilityPerkDesc2: Permanent speed I buff (toggleable by /speedToggle) - agilityPassiveTitle0: Back - agilityPassiveTitle1: Skill Tokens - agilityPassiveTitle2: Roll - agilityPassiveDesc0: Takes you back to the main skills menu - agilityPassiveDesc1: Tokens to invest in skill tree - agilityPassiveDesc2: Chance to roll and take reduced fall damage - alchemyPerkTitle0: Alchemical Summoning - alchemyPerkTitle1: Ancient Knowledge - alchemyPerkTitle2: Potion Master - alchemyPerkDesc0: Allows crafting of some potions without a brewing stand - alchemyPerkDesc1: Unlocks ability to brew new potions - alchemyPerkDesc2: All used potions are increased in level by 1 (toggleable with - /togglePotion) - alchemyPassiveTitle0: Back - alchemyPassiveTitle1: Skill Tokens - alchemyPassiveTitle2: Half-life+ - alchemyPassiveDesc0: Takes you back to the main skills menu - alchemyPassiveDesc1: Tokens to invest in skill tree - alchemyPassiveDesc2: Increase in duration of potions when used - smeltingPerkTitle0: Fuel Efficiency - smeltingPerkTitle1: Double Smelt - smeltingPerkTitle2: Flame Pickaxe - smeltingPerkDesc0: Fuel last +20% longer per level - smeltingPerkDesc1: +5% chance for smelted ore to be doubled per level - smeltingPerkDesc2: Mined ores are instantly smelted (toggleable with /toggleFlamePick) - smeltingPassiveTitle0: Back - smeltingPassiveTitle1: Skill Tokens - smeltingPassiveTitle2: Fuel Speed - smeltingPassiveDesc0: Takes you back to the main skills menu - smeltingPassiveDesc1: Tokens to invest in skill tree - smeltingPassiveDesc2: Increasing cooking speed - enchantingPerkTitle0: Efficient Enchanting - enchantingPerkTitle1: Booksmart - enchantingPerkTitle2: Immortal Experience - enchantingPerkDesc0: Levels needed to enchant -1 per level, anvil repair costs - -1 (minimum of 2) XP levels per level - enchantingPerkDesc1: Unlocks crafting recipes for some enchanted books - enchantingPerkDesc2: Keep xp on death - enchantingPassiveTitle0: Back - enchantingPassiveTitle1: Skill Tokens - enchantingPassiveTitle2: Quicker Development - enchantingPassiveDesc0: Takes you back to the main skills menu - enchantingPassiveDesc1: Tokens to invest in skill tree - enchantingPassiveDesc2: All xp received increased - globalPerkTitle0: Gatherer - globalPerkTitle1: Scholar - globalPerkTitle2: Fighter - globalPerkTitle3: Hard Work - globalPerkTitle4: Research - globalPerkTitle5: Training - globalPerkTitle6: Reincarnation+ - globalPerkTitle7: Soul Harvesting - globalPerkTitle8: Avatar - globalPerkTitle9: Master of the Arts - globalPerkDesc0: +20% exp gained in Digging, Woodcutting, Mining, Farming, and - Fishing - globalPerkDesc1: +20% exp gained in Repair, Agility, Brewing, Smelting, and Enchanting - globalPerkDesc2: +20% exp gained in Archery, Beast Mastery, Swordsmanship, Defense, - and Axe Mastery - globalPerkDesc3: +1 skill token in all Gatherer skills - globalPerkDesc4: +1 skill token in all Scholar skills - globalPerkDesc5: +1 skill token in all Fighter skills - globalPerkDesc6: On death, 50% chance to keep some of each valuable item in your - inventory - globalPerkDesc7: You now harvest souls from killing aggressive mobs, which can - be used to refund skill trees - globalPerkDesc8: 10% chance to take no damage and gain all in-game buffs for 10s - on a hit that would normally kill you - globalPerkDesc9: Ability cooldowns decreased by 33% - globalPassiveTitle0: Global Tokens - globalPassiveTitle1: Back - globalPassiveDesc0: Tokens to invest in skill tree - globalPassiveDesc1: Takes you back to the main skills menu - cannotRepair: You cannot repair while this ability is active! - cannotSalvage: You cannot salvage while this ability is active! - spite: Everything good is made of spite - refundSkill: are required to refund a skill tree - refundSkill2: in order to refund a skill tree - needToUnlock: You need to unlock - perkRequirement: You need at least 2 skill tokens invested in the previous perks to unlock this perk - perkRequirementM: You need at least 10 total skill tokens invested in the skill tree to unlock this mastery perk - noSkillTokens: You do not have any skill tokens - noPassiveTokens: You do not have any passive tokens - maxedOutPerk: You have already maxed out this perk! - requiredGlobalPerks0: You need the previous perk to unlock this perk - requiredGlobalPerks1: are required to unlock this perk - requiredGlobalPerks2: is required to unlock this perk - requiredGlobalPerks3: You need every global perk to unlock this perk - craftRequirement: is required to craft this recipe! - roll: ROLL - dodge: DODGE - prepare: You prepare your - rest: You rest your - activated: activated! - ended: has ended - readyToUse: is ready to use again - cooldown: cooldown - rapidFire: Rapid Fire - bow: bow - greatAxe: Great Axe - axe: axe - spurKick: Spur Kick - leg: leg - stoneSoldier: Stone Soldier - yourself: yourself - bigDig: Big Dig - shovel: shovel - naturalRegeneration: Natural Regeneration - hoe: hoe - superBait: Super Bait - fishingRod: fishing rod - berserkPick: Berserk Pick - pickaxe: pickaxe - swiftStrikes: Swift Strikes - sword: sword - timber: Timber - hyperHorse: This horse is already hyper! - magicForce: A magic force ends your ability - rob: Rob - repairFail0: You are not skilled enough to adequately repair this item - repairFail1: You failed to salavage any materials - repairFail2: You failed to retain the item's enchantment power - treeTooBig0: This tree is too big for you to chop in one go!" - treeTooBig1: This tree can never be chopped in one go like this... - noPermission: You do not have permission to use this command! - improperArguments: Improper Arguments, try - totalPlayTime: Total Play Time - clickForOptions: Click for options - unknownCommand: Unknown command - expToLevel: EXP to next level - playerName: playerName - skillName: skillName (in English) - page: page - on0: "ON" - off0: "OFF" - onOrOff: ON/OFF - manuallyToggles: Manually toggles - commandDesc0: Opens the main GUI with all skills - commandDesc1: Opens a skill tree GUI of choice - commandDesc2: Opens the configuration GUI - commandDesc3: Gives a player of choice EXP in a specified skill - commandDesc4: Sets a given player's level in a specified skill - commandDesc5: Resets a player's stats in a specified skill (does not refund stats) - commandDesc6: Displays a leaderboard for a specified stat - commandDesc7: Provides a link to a plugin information page - commandDesc8: Attempts to enchant an item in the users hand at a specified level - informationURL: Information URL (Google Docs) - click: CLICK - levelArgument: Level argument must be less than 40 - leaderboard: Leaderboard - playerOffline: That player is not online - onlyIncrease: Please only increase exp with this command, otherwise, use /frpg statReset then /frpg giveEXP - amount: amount - unlockToggle: To use this command you must unlock - levelUpNotif: Level Up Notifications - abilityPreparationNotif: Ability Preparation Notifications - yes0: "YES" - no0: "NO" - warning: WARNING - souls: souls - refundSkillTree0: Refunding a skill tree costs - refundSkillTree1: and is not reversible, are you sure you want to - refundSkillTree2: refund the - skill: skill - backToSkillTree: Takes you back to the skill tree - miningPerkDesc0_1: 2 seconds of Haste I after mining any ore - miningPerkDesc0_2: 5 seconds of Haste I after mining any ore - miningPerkDesc0_3: 10 seconds of Haste I after mining any ore - miningPerkDesc0_4: 5 seconds of Haste II after mining any ore, followed by 5 seconds of Haste I - miningPerkDesc0_5: 10 seconds of Haste II after mining any ore - woodcuttingPerkDesc3_1: Leaves may now drop a - common: common - uncommon: uncommon - rare: rare - veryRare: very rare - legendary: legendary - fishingPerkDesc1_1: Unlocks treasure tier - farmingPerkDesc1_1: Gain the ability to craft - cowSpawnEgg: cow spawn egg - beeSpawnEgg: bee spawn egg - mooshroomSpawnEgg: mooshroom spawn egg - horseSpawnEgg: horse spawn egg - slimeSpawnEgg: slime spawn egg - diggingPerkDesc0_1: You may now dig up a - defensePerkDesc0_1: Gain +3 s of regen per level on kills - defensePerkDesc0_2: Gain +0.5 hearts per level instantly on kills - duration: Duration - likelihood: Likelihood - junkChance: Junk Chance - locked: LOCKED - unlocked: UNLOCKED - cowEgg: Cow Egg - beeEgg: Bee Egg - mooshroomEgg: Mooshroom Egg - horseEgg: Horse Egg - slimeEgg: Slime Egg - tippedArrows: Tipped Arrows - toggle: Toggle - refundSkillTitle: Refund Skill - refundSkillTreeDesc: Click to refund this skill tree - enchantingPerkDesc1_0: Unlocks ability to craft - enchantingPerkDesc1_1: Power I and Efficiency I enchanted books (costs 1 level to craft) - enchantingPerkDesc1_2: Sharpness I and Protection I enchanted books (costs 1 level to craft) - enchantingPerkDesc1_3: Luck of the Sea I and Lure I enchanted books (costs 1 level to craft) - enchantingPerkDesc1_4: Depth Strider I and Frost Walker I enchanted books (costs 1 level to craft) - enchantingPerkDesc1_5: Mending (costs 10 levels to craft) and Fortune I (costs 2 levels to craft) enchanted books - repairPerkDesc0_1: Gain more materials from salvaging on average - repairPerkDesc0_2: Gain more materials from salvaging on average, salvaging now stores item enchants in a book - xpBoost: XP Boost - speedBoost: Speed Boost - timeExtension: Time Extension - enchantingCraft0: Power I Book - enchantingCraft1: Efficiency I Book - enchantingCraft2: Sharpness I Book - enchantingCraft3: Protection I Book - enchantingCraft4: Luck of the Sea I Book - enchantingCraft5: Lure I Book - enchantingCraft6: Frost Walker I Book - enchantingCraft7: Depth Strider I Book - enchantingCraft8: Mending Book - enchantingCraft9: Fortune I Book - commandDesc9: Sets the souls for a specified player - commandDesc10: Sets the skill or passive tokens in specified skill for a specified player - commandDesc11: Sets the global tokens for a specified player - commandDesc12: Saves stats of all players or a specified player - status: STATUS - complete: COMPLETE - incomplete: INCOMPLETE - try0: "try" - passiveImprove: Your passive perks improve every level! - increasedBy: increased by - expIncrease: EXP Multiplier - personalMultiplier: Personal Multiplier - translators: Translators - commandDesc13: Sets the personal multiplier for a specified player - abilityDescription: Ability Description - abilityDescription_digging: Temporarily adds 5 levels of effiency to your shovel. Activated by right-clicking a shovel then breaking a block. - abilityDescription_woodcutting: Temporarily makes axes break an entire tree with one block break. Activated by right-clicking an axe then breaking a log. - abilityDescription_mining: Temporarily adds 5 levels of effiency to your pickaxe. Activated by right-clicking a pickaxe then breaking block. - abilityDescription_farming: Temporarily makes crops broken with a hoe automatically replant. Activated by right-clicking a hoe then breaking a crop. - abilityDescription_fishing: Temporarily makes fishing rods instantly catch a fish. Activated by left-clicking a fishing rod then fishing in water. - abilityDescription_archery: Temporarily makes all arrows fired at max speed. Activated by left-clicking a bow then shooting an arrow. - abilityDescription_beastMastery: Temporarily gives your horse a speed buff. Activated by right-clicking while on a horse then left-clicking. - abilityDescription_swordsmanship: Temporarily removes swinging cooldown on swords. Activated by right-clicking a sword then hitting a mob. - abilityDescription_defense: Temporarily gives the user Resistance and Slowness effects. Activated by right-clicking with an empty hand then hitting a mob. - abilityDescription_axeMastery: Temporarily makes axes do damage to all mobs in a certain radius. Activated by right-clicking an axe then hitting a mob. - alchemyPerkDesc1_0: Unlocks ability to brew - alchemyPerkDesc0_0: A crafting table can be used to craft - triggerAbilities: Trigger Abilities - showEXPBar: Show EXP Bar - disabledSkill: This skill is disabled - skillConfigDesc: Takes you to configuration menu for this skill - lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" - exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" - potionAbsorption: Potion of Absorption - potionBadOmen: Potion of Bad Omen - potionBlindess: Potion of Blindess - potionConduitPower: Potion of Conduit Power - potionResistance: Potion of Resistance - potionDolphinsGrace: Potion of Dolphins Grace - potionHaste: Potion of Haste - potionFireResistance: Potion of Fire Resistance - potionGlowing: Potion of Glowing - potionHarm: Potion of Harm - potionHealing: Potion of Healing - potionHealthBoost: Potion of Health Boost - potiontheHero: Potion of the Hero - potionHunger: Potion of Hunger - potionStrength: Potion of Strength - potionInvsibility: Potion of Invsibility - potionJump: Potion of Jump - potionLuck: Potion of Luck - potionNightVision: Potion of Night Vision - potionRegeneration: Potion of Regeneration - potionSaturation: Potion of Saturation - potionSlowness: Potion of Slowness - potionFatigue: Potion of Fatigue - potionSlowFalling: Potion of Slow Falling - potionSpeed: Potion of Speed - potionBadLuck: Potion of Bad Luck - potionWaterBreathing: Potion of Water Breathing - potionWeakness: Potion of Weakness - potionDecay: Potion of Decay - potionAwkward: Awkward Potion - potionUncraftable: Uncraftable Potion - potionMundane: Mundane Potion - potionTurtleMaster: Potion of the Turtle Master - potionThick: Thick Potion - potionWater: Water Bottle - ingredient: Ingredient - usedToBrew: Is used to brew - costs: costs - xpLevel: Minecraft XP Level - xpLevels: Minecraft XP Levels - craftXPRequirement: This recipe requires at least - bedGUI: You cannot use this command while in bed! - statsUpdated: Your stats were changed to be consistent with a new EXP curve. - All skill trees and passive perks have been reset. All tokens must be re-invested. - timeRemaining: Time Remaining - numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed - commandDesc14: Resets the cooldown period for a skill to 0 seconds - commandDesc15: Looks up a player's FreeRPG stats - repairUnsafeEnchant: This item is too powerful to be repaired - salvageUnsafeEnchant: This item is too powerful to be salvaged - rank: Rank - stats: stats - outOf: out of - playerNotInLeaderboard: That player is not on any leaderboards - virtual: Virtual - commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) + custom: + languageName: Čûşŧøm Ľãņğŭågè + englishLanguageName: Custom Language + translationCredit: N/A + global: Global + digging: Digging + woodcutting: Woodcutting + mining: Mining + farming: Farming + fishing: Fishing + archery: Archery + beastMastery: Beast Mastery + swordsmanship: Swordsmanship + defense: Defense + axeMastery: Axe Mastery + repair: Repair + alchemy: Alchemy + agility: Agility + smelting: Smelting + enchanting: Enchanting + information: Information + configuration: Configuration + level: Level + experience: Experience + toNext: to next + total: Total + diggingPerkTitle0: Mo' drops + diggingPerkTitle1: Double Treasure + diggingPerkTitle2: Rarer Drops + diggingPerkTitle3: Soul Stealer + diggingPerkTitle4: Flint Finder + diggingPerkTitle5: Shovel Knight + diggingPerkTitle6: Mega Dig + diggingPerkDesc0: Expands treasure drop table by 1 item per level + diggingPerkDesc1: +5% chance of receiving double treasure drop per level (when + treasure is rolled) + diggingPerkDesc2: Further expands drop table by item per level + diggingPerkDesc3: Soul sand is +5% more likely to drop treasure per level + diggingPerkDesc4: Gravel has 100% flint drop rate (toggleable by /flintToggle) + diggingPerkDesc5: Shovels do double damage + diggingPerkDesc6: When using ability, you now break a 3x3 block section (20% of + normal treasure rate when active) + diggingPassiveTitle0: Passive Tokens + diggingPassiveTitle1: Back + diggingPassiveTitle2: Skill Tokens + diggingPassiveTitle3: Big Dig Duration + diggingPassiveTitle4: Treasure Chance + diggingPassiveDesc0: Tokens to invest in passive skills (dyes) + diggingPassiveDesc1: Takes you back to the main skills menu + diggingPassiveDesc2: Tokens to invest in skill tree + diggingPassiveDesc3: Increases duration of Big Dig by 0.02 s + diggingPassiveDesc4: Increases chance of digging up treasure by 0.005% + woodcuttingPerkTitle0: Zealous Roots + woodcuttingPerkTitle1: Fresh Arms + woodcuttingPerkTitle2: Hidden Knowledge + woodcuttingPerkTitle3: Leaf Scavenger + woodcuttingPerkTitle4: Timber+ + woodcuttingPerkTitle5: Leaf Blower + woodcuttingPerkTitle6: Able Axe + woodcuttingPerkDesc0: +20% chance for logs to drop 1 XP per level + woodcuttingPerkDesc1: +12 s per level of Haste I after first log broken in 5 minutes + woodcuttingPerkDesc2: Logs have a +0.2% chance per level to drop an enchanted + book + woodcuttingPerkDesc3: Leaves have a 1% chance to drop +1 treasure item per level + woodcuttingPerkDesc4: Timber break limit increased from 64 to 128 + woodcuttingPerkDesc5: Break a large section of leaves using an axe (toggleable with /leafBlowerToggle) + woodcuttingPerkDesc6: Double drops, Zealous Roots, and Hidden Knowledge all now + apply to timber (at half effectiveness) + woodcuttingPassiveTitle0: Passive Tokens + woodcuttingPassiveTitle1: Back + woodcuttingPassiveTitle2: Skill Tokens + woodcuttingPassiveTitle3: Timber Duration + woodcuttingPassiveTitle4: Double Drops + woodcuttingPassiveDesc0: Tokens to invest in passive skills (dyes) + woodcuttingPassiveDesc1: Takes you back to the main skills menu + woodcuttingPassiveDesc2: Tokens to invest in skill tree + woodcuttingPassiveDesc3: Increases duration of Timber by 0.02 s + woodcuttingPassiveDesc4: Increases chance to receive a double drop by 0.05% + miningPerkTitle0: Wasteless Haste + miningPerkTitle1: More Bombs + miningPerkTitle2: Treasure Seeker + miningPerkTitle3: Bomb-boyage + miningPerkTitle4: Vein Miner + miningPerkTitle5: Demolition Man + miningPerkTitle6: Triple Trouble + miningPerkDesc0: Gain haste after mining ores for each level + miningPerkDesc1: The crafting recipe for TNT produces +1 TNT block per level + miningPerkDesc2: When using ability on stones, +1% per level chance for an ore + to drop (extra exp is earned from dropped ores) + miningPerkDesc3: Increases TNT blast radius (when lit by flint and steel) each + level + miningPerkDesc4: Ore veins are instantly mined upon breaking one block (toggle-able) + miningPerkDesc5: No damage is taken from TNT explosions + miningPerkDesc6: Double drops are now triple drops + miningPassiveTitle0: Passive Tokens + miningPassiveTitle1: Back + miningPassiveTitle2: Skill Tokens + miningPassiveTitle3: Berserk Pick Duration + miningPassiveTitle4: Double Drops + miningPassiveTitle5: Blast Mining + miningPassiveDesc0: Tokens to invest in passive skills (dyes) + miningPassiveDesc1: Takes you back to the main skills menu + miningPassiveDesc2: Tokens to invest in skill tree + miningPassiveDesc3: Increases duration of Berserk Pick by 0.02s + miningPassiveDesc4: Increases chance to receive a double drop from ores by 0.05% + miningPassiveDesc5: Increases chances for ore to be created from TNT explosions + by 0.01% (More blocks broken = More treasure rolls) + farmingPerkTitle0: Better Fertilizer + farmingPerkTitle1: Animal Farm + farmingPerkTitle2: Farmer's Diet + farmingPerkTitle3: Carnivore + farmingPerkTitle4: Green Thumb + farmingPerkTitle5: Growth Hormones + farmingPerkTitle6: One with Nature + farmingPerkDesc0: +10% chance to not consume bonemeal on use + farmingPerkDesc1: Can craft an additional spawn egg per level + farmingPerkDesc2: Farm food is +20% more effective at restoring hunger and saturation + per level + farmingPerkDesc3: Meat is +20% more effective at restoring hunger and saturation + per level + farmingPerkDesc4: Ability may replant crops fully grown with higher chance of + replanting in later growth stages; ability now effects Melons and Pumpkins + farmingPerkDesc5: Sugar can be used on baby animals to make them grow instantly + farmingPerkDesc6: Gain Regeneration I when standing still on grass + farmingPassiveTitle0: Passive Tokens + farmingPassiveTitle1: Back + farmingPassiveTitle2: Skill Tokens + farmingPassiveTitle3: Natural Regeneration Duration + farmingPassiveTitle4: Double Drops (Crops) + farmingPassiveTitle5: Double Drops (Animals) + farmingPassiveDesc0: Tokens to invest in passive skills (dyes) + farmingPassiveDesc1: Takes you back to the main skills menu + farmingPassiveDesc2: Tokens to invest in skill tree + farmingPassiveDesc3: Increases duration of Natural Regeneration by 0.02s + farmingPassiveDesc4: Increases chance to receive a double drop from crops by 0.05% + farmingPassiveDesc5: Increases chance to receive a double drop from most passive + animals by 0.05% + fishingPerkTitle0: Rob + fishingPerkTitle1: Scavenger + fishingPerkTitle2: Fisherman's Diet + fishingPerkTitle3: Filtration + fishingPerkTitle4: Grappling Hook + fishingPerkTitle5: Hot Rod + fishingPerkTitle6: Fish Person + fishingPerkDesc0: +15% chance to pull item off a mob per level + fishingPerkDesc1: Unlocks new tier of fishing treasure + fishingPerkDesc2: Fish restore +20% hunger per level + fishingPerkDesc3: Higher tier (II-V) loot becomes more common, lower tier (I) + becomes less common + fishingPerkDesc4: Fishing rod now acts as a grappling hook (toggleable with /grappleToggle + ) + fishingPerkDesc5: Fish are now cooked when caught, some fishing treasures are + changed (toggleable with /hotRodToggle) + fishingPerkDesc6: Infinite night vision when underwater, infinite dolphin's grace + when in the water + fishingPassiveTitle0: Passive Tokens + fishingPassiveTitle1: Back + fishingPassiveTitle2: Skill Tokens + fishingPassiveTitle3: Super Bait Duration + fishingPassiveTitle4: Double catches + fishingPassiveTitle5: Treasure Finder + fishingPassiveDesc0: Tokens to invest in passive skills (dyes) + fishingPassiveDesc1: Takes you back to the main skills menu + fishingPassiveDesc2: Tokens to invest in skill tree + fishingPassiveDesc3: Increases duration of Super Bait by 0.01s + fishingPassiveDesc4: Increases chance to receive a double drop by 0.05% + fishingPassiveDesc5: Decreases chance of finding junk by 0.005%, increases chance + of finding treasure by 0.005% + archeryPerkTitle0: Extra Arrows + archeryPerkTitle1: Sniper + archeryPerkTitle2: Arrow of Light + archeryPerkTitle3: Explosive Arrows + archeryPerkTitle4: Dragon-less Arrows + archeryPerkTitle5: Crossbow Rapid Load + archeryPerkTitle6: Deadly Strike + archeryPerkDesc0: +1 arrow gained from crafting per level + archeryPerkDesc1: Arrow speed increases by +2% per level (~4% damage increase/level) + archeryPerkDesc2: Spectral arrows get a +5% damage boost per level + archeryPerkDesc3: Arrows have a +1% of creating an explosion on hit + archeryPerkDesc4: Allows crafting all tipped arrows with regular potions instead + of lingering potions + archeryPerkDesc5: Ability can now be used with crossbows, making all shots load + instantly + archeryPerkDesc6: Fireworks shot from crossbows do double damage (up to 16 hearts + of damage) + archeryPassiveTitle0: Passive Tokens + archeryPassiveTitle1: Back + archeryPassiveTitle2: Skill Tokens + archeryPassiveTitle3: Rapid Fire Duration + archeryPassiveTitle4: Retrieval + archeryPassiveDesc0: Tokens to invest in passive skills (dyes) + archeryPassiveDesc1: Takes you back to the main skills menu + archeryPassiveDesc2: Tokens to invest in skill tree + archeryPassiveDesc3: Increases duration of Rapid Fire by 0.02s + archeryPassiveDesc4: Increases chance for arrow shot to not consume arrow by 0.05% + per level + beastMasteryPerkTitle0: Thick Fur + beastMasteryPerkTitle1: Sharp Teeth + beastMasteryPerkTitle2: Healthy Bites + beastMasteryPerkTitle3: Keep Away + beastMasteryPerkTitle4: Acro-Dog + beastMasteryPerkTitle5: Identify + beastMasteryPerkTitle6: Adrenaline Boost + beastMasteryPerkDesc0: Dogs take -10% damage per level + beastMasteryPerkDesc1: Dogs do +10% more damage per level + beastMasteryPerkDesc2: Dogs heal +1/2 heart per level from killing + beastMasteryPerkDesc3: Dogs have gain +5% chance of knocking back foes + beastMasteryPerkDesc4: Dogs do not take fall damage + beastMasteryPerkDesc5: Using a compass on a horse or wolf now shows their stats + beastMasteryPerkDesc6: Spur kick buff is now speed III + beastMasteryPassiveTitle0: Passive Tokens + beastMasteryPassiveTitle1: Back + beastMasteryPassiveTitle2: Skill Tokens + beastMasteryPassiveTitle3: Spur Kick Duration + beastMasteryPassiveTitle4: Critical Bite + beastMasteryPassiveDesc0: Tokens to invest in passive skills (dyes) + beastMasteryPassiveDesc1: Takes you back to the main skills menu + beastMasteryPassiveDesc2: Tokens to invest in skill tree + beastMasteryPassiveDesc3: Increases duration of Spur Kick by 0.02s + beastMasteryPassiveDesc4: Increases chance for a dog to have a critical hit by + 0.025% + swordsmanshipPerkTitle0: Adrenaline + swordsmanshipPerkTitle1: Killing Spree + swordsmanshipPerkTitle2: Adrenaline+ + swordsmanshipPerkTitle3: Killing Frenzy + swordsmanshipPerkTitle4: Thirst for Blood + swordsmanshipPerkTitle5: Sharper! + swordsmanshipPerkTitle6: Sword Mastery + swordsmanshipPerkDesc0: Killing hostile mobs with a sword provides +2 s of speed + per level + swordsmanshipPerkDesc1: Killing hostile mobs with a sword provides +2 s of strength + per level + swordsmanshipPerkDesc2: +20% of speed I buff from Adrenaline is now speed II + swordsmanshipPerkDesc3: +20% of strength I buff from Killing Spree is now strength + II + swordsmanshipPerkDesc4: Killing certain aggressive mobs with a sword restores + hunger + swordsmanshipPerkDesc5: Swift strikes now adds a level of sharpness to your sword + swordsmanshipPerkDesc6: Swords permanently do +1 heart of damage + swordsmanshipPassiveTitle0: Passive Tokens + swordsmanshipPassiveTitle1: Back + swordsmanshipPassiveTitle2: Skill Tokens + swordsmanshipPassiveTitle3: Swift Strikes Duration + swordsmanshipPassiveTitle4: Double Hit + swordsmanshipPassiveDesc0: Tokens to invest in passive skills (dyes) + swordsmanshipPassiveDesc1: Takes you back to the main skills menu + swordsmanshipPassiveDesc2: Tokens to invest in skill tree + swordsmanshipPassiveDesc3: Increases duration of Swift Strikes by 0.02s + swordsmanshipPassiveDesc4: Increases chance to hit mob twice (second hit does + 50% damage) by 0.02% + defensePerkTitle0: Healer + defensePerkTitle1: Stiffen + defensePerkTitle2: Hard Headed + defensePerkTitle3: Stiffen+ + defensePerkTitle4: Gift From Above + defensePerkTitle5: Stronger Legs + defensePerkTitle6: Hearty + defensePerkDesc0: Gain +3s of regen per level on kill + defensePerkDesc1: +2% chance to gain resistance I for 5s when hit + defensePerkDesc2: Hard Body decreases damage by an additional 6.6% per level + defensePerkDesc3: +2% chance to gain resistance II for 5s when hit + defensePerkDesc4: Stone Solid now grants 4 absorption hearts for ability length + +1 minute + defensePerkDesc5: Stone Solid now gives slowness I instead of slowness IV + defensePerkDesc6: +2 hearts permanently + defensePassiveTitle0: Passive Tokens + defensePassiveTitle1: Back + defensePassiveTitle2: Skill Tokens + defensePassiveTitle3: Stone Solid Duration + defensePassiveTitle4: Hard Body + defensePassiveTitle5: Double Drops (Hostile Mobs) + defensePassiveDesc0: Tokens to invest in passive skills (dyes) + defensePassiveDesc1: Takes you back to the main skills menu + defensePassiveDesc2: Tokens to invest in skill tree + defensePassiveDesc3: Increases duration of Stone Solid by 0.02s + defensePassiveDesc4: Increases chance to take reduced (base -33%) damage by 0.01% + per level + defensePassiveDesc5: Increases chance to receive double drops from aggressive + mobs by 0.05% + axeMasteryPerkTitle0: Greater Axe + axeMasteryPerkTitle1: Holy Axe + axeMasteryPerkTitle2: Revitalized + axeMasteryPerkTitle3: Warrior Blood + axeMasteryPerkTitle4: Earthquake + axeMasteryPerkTitle5: Better Crits + axeMasteryPerkTitle6: Axe Man + axeMasteryPerkDesc0: Great Axe damage radius increases by 1 block per level + axeMasteryPerkDesc1: +2% chance for lighting to strike mobs on axe hit + axeMasteryPerkDesc2: +1% chance for full heal on kill per level + axeMasteryPerkDesc3: +3 s per level of Strength I on kills with an axe + axeMasteryPerkDesc4: Ability's AOE damage is doubled (25% -> 50% of damage) + axeMasteryPerkDesc5: Divine Crits now have 1.6x multiplier instead of 1.25x + axeMasteryPerkDesc6: Axes permanently do +1 heart of damage + axeMasteryPassiveTitle0: Passive Tokens + axeMasteryPassiveTitle1: Back + axeMasteryPassiveTitle2: Skill Tokens + axeMasteryPassiveTitle3: Great Axe Duration + axeMasteryPassiveTitle4: Divine Crits + axeMasteryPassiveDesc0: Tokens to invest in passive skills (dyes) + axeMasteryPassiveDesc1: Takes you back to the main skills menu + axeMasteryPassiveDesc2: Tokens to invest in skill tree + axeMasteryPassiveDesc3: Increases duration of Great Axe by 0.02s + axeMasteryPassiveDesc4: Increases random crit chance (base 1.25x damage) by 0.01% + repairPerkTitle0: Salvaging + repairPerkTitle1: Resourceful + repairPerkTitle2: Magic Repair Mastery + repairPerkDesc0: Get more materials on average from salvaging + repairPerkDesc1: +10% chance of keeping material used when repairing + repairPerkDesc2: Guarenteed to keep enchants on repair + repairPassiveTitle0: Back + repairPassiveTitle1: Skill Tokens + repairPassiveTitle2: Proficiency + repairPassiveDesc0: Takes you back to the main skills menu + repairPassiveDesc1: Tokens to invest in skill tree + repairPassiveDesc2: Materials restore more durability on repair + agilityPerkTitle0: Dodge + agilityPerkTitle1: Steel Bones + agilityPerkTitle2: Graceful Feet + agilityPerkDesc0: +4% chance to dodge attacks per level + agilityPerkDesc1: -10% fall damage per level + agilityPerkDesc2: Permanent speed I buff (toggleable by /speedToggle) + agilityPassiveTitle0: Back + agilityPassiveTitle1: Skill Tokens + agilityPassiveTitle2: Roll + agilityPassiveDesc0: Takes you back to the main skills menu + agilityPassiveDesc1: Tokens to invest in skill tree + agilityPassiveDesc2: Chance to roll and take reduced fall damage + alchemyPerkTitle0: Alchemical Summoning + alchemyPerkTitle1: Ancient Knowledge + alchemyPerkTitle2: Potion Master + alchemyPerkDesc0: Allows crafting of some potions without a brewing stand + alchemyPerkDesc1: Unlocks ability to brew new potions + alchemyPerkDesc2: All used potions are increased in level by 1 (toggleable with + /togglePotion) + alchemyPassiveTitle0: Back + alchemyPassiveTitle1: Skill Tokens + alchemyPassiveTitle2: Half-life+ + alchemyPassiveDesc0: Takes you back to the main skills menu + alchemyPassiveDesc1: Tokens to invest in skill tree + alchemyPassiveDesc2: Increase in duration of potions when used + smeltingPerkTitle0: Fuel Efficiency + smeltingPerkTitle1: Double Smelt + smeltingPerkTitle2: Flame Pickaxe + smeltingPerkDesc0: Fuel last +20% longer per level + smeltingPerkDesc1: +5% chance for smelted ore to be doubled per level + smeltingPerkDesc2: Mined ores are instantly smelted (toggleable with /toggleFlamePick) + smeltingPassiveTitle0: Back + smeltingPassiveTitle1: Skill Tokens + smeltingPassiveTitle2: Fuel Speed + smeltingPassiveDesc0: Takes you back to the main skills menu + smeltingPassiveDesc1: Tokens to invest in skill tree + smeltingPassiveDesc2: Increasing cooking speed + enchantingPerkTitle0: Efficient Enchanting + enchantingPerkTitle1: Booksmart + enchantingPerkTitle2: Immortal Experience + enchantingPerkDesc0: Levels needed to enchant -1 per level, anvil repair costs + -1 (minimum of 2) XP levels per level + enchantingPerkDesc1: Unlocks crafting recipes for some enchanted books + enchantingPerkDesc2: Keep xp on death + enchantingPassiveTitle0: Back + enchantingPassiveTitle1: Skill Tokens + enchantingPassiveTitle2: Quicker Development + enchantingPassiveDesc0: Takes you back to the main skills menu + enchantingPassiveDesc1: Tokens to invest in skill tree + enchantingPassiveDesc2: All xp received increased + globalPerkTitle0: Gatherer + globalPerkTitle1: Scholar + globalPerkTitle2: Fighter + globalPerkTitle3: Hard Work + globalPerkTitle4: Research + globalPerkTitle5: Training + globalPerkTitle6: Reincarnation+ + globalPerkTitle7: Soul Harvesting + globalPerkTitle8: Avatar + globalPerkTitle9: Master of the Arts + globalPerkDesc0: +20% exp gained in Digging, Woodcutting, Mining, Farming, and + Fishing + globalPerkDesc1: +20% exp gained in Repair, Agility, Brewing, Smelting, and Enchanting + globalPerkDesc2: +20% exp gained in Archery, Beast Mastery, Swordsmanship, Defense, + and Axe Mastery + globalPerkDesc3: +1 skill token in all Gatherer skills + globalPerkDesc4: +1 skill token in all Scholar skills + globalPerkDesc5: +1 skill token in all Fighter skills + globalPerkDesc6: On death, 50% chance to keep some of each valuable item in your + inventory + globalPerkDesc7: You now harvest souls from killing aggressive mobs, which can + be used to refund skill trees + globalPerkDesc8: 10% chance to take no damage and gain all in-game buffs for 10s + on a hit that would normally kill you + globalPerkDesc9: Ability cooldowns decreased by 33% + globalPassiveTitle0: Global Tokens + globalPassiveTitle1: Back + globalPassiveDesc0: Tokens to invest in skill tree + globalPassiveDesc1: Takes you back to the main skills menu + cannotRepair: You cannot repair while this ability is active! + cannotSalvage: You cannot salvage while this ability is active! + spite: Everything good is made of spite + refundSkill: are required to refund a skill tree + refundSkill2: in order to refund a skill tree + needToUnlock: You need to unlock + perkRequirement: You need at least 2 skill tokens invested in the previous perks to unlock this perk + perkRequirementM: You need at least 10 total skill tokens invested in the skill tree to unlock this mastery perk + noSkillTokens: You do not have any skill tokens + noPassiveTokens: You do not have any passive tokens + maxedOutPerk: You have already maxed out this perk! + requiredGlobalPerks0: You need the previous perk to unlock this perk + requiredGlobalPerks1: are required to unlock this perk + requiredGlobalPerks2: is required to unlock this perk + requiredGlobalPerks3: You need every global perk to unlock this perk + craftRequirement: is required to craft this recipe! + roll: ROLL + dodge: DODGE + prepare: You prepare your + rest: You rest your + activated: activated! + ended: has ended + readyToUse: is ready to use again + cooldown: cooldown + rapidFire: Rapid Fire + bow: bow + greatAxe: Great Axe + axe: axe + spurKick: Spur Kick + leg: leg + stoneSoldier: Stone Soldier + yourself: yourself + bigDig: Big Dig + shovel: shovel + naturalRegeneration: Natural Regeneration + hoe: hoe + superBait: Super Bait + fishingRod: fishing rod + berserkPick: Berserk Pick + pickaxe: pickaxe + swiftStrikes: Swift Strikes + sword: sword + timber: Timber + hyperHorse: This horse is already hyper! + magicForce: A magic force ends your ability + rob: Rob + repairFail0: You are not skilled enough to adequately repair this item + repairFail1: You failed to salavage any materials + repairFail2: You failed to retain the item's enchantment power + treeTooBig0: This tree is too big for you to chop in one go!" + treeTooBig1: This tree can never be chopped in one go like this... + noPermission: You do not have permission to use this command! + improperArguments: Improper Arguments, try + totalPlayTime: Total Play Time + clickForOptions: Click for options + unknownCommand: Unknown command + expToLevel: EXP to next level + playerName: playerName + skillName: skillName (in English) + page: page + on0: "ON" + off0: "OFF" + onOrOff: ON/OFF + manuallyToggles: Manually toggles + commandDesc0: Opens the main GUI with all skills + commandDesc1: Opens a skill tree GUI of choice + commandDesc2: Opens the configuration GUI + commandDesc3: Gives a player of choice EXP in a specified skill + commandDesc4: Sets a given player's level in a specified skill + commandDesc5: Resets a player's stats in a specified skill (does not refund stats) + commandDesc6: Displays a leaderboard for a specified stat + commandDesc7: Provides a link to a plugin information page + commandDesc8: Attempts to enchant an item in the users hand at a specified level + informationURL: Information URL (Google Docs) + click: CLICK + levelArgument: Level argument must be less than 40 + leaderboard: Leaderboard + playerOffline: That player is not online + onlyIncrease: Please only increase exp with this command, otherwise, use /frpg statReset then /frpg giveEXP + amount: amount + unlockToggle: To use this command you must unlock + levelUpNotif: Level Up Notifications + abilityPreparationNotif: Ability Preparation Notifications + yes0: "YES" + no0: "NO" + warning: WARNING + souls: souls + refundSkillTree0: Refunding a skill tree costs + refundSkillTree1: and is not reversible, are you sure you want to + refundSkillTree2: refund the + skill: skill + backToSkillTree: Takes you back to the skill tree + miningPerkDesc0_1: 2 seconds of Haste I after mining any ore + miningPerkDesc0_2: 5 seconds of Haste I after mining any ore + miningPerkDesc0_3: 10 seconds of Haste I after mining any ore + miningPerkDesc0_4: 5 seconds of Haste II after mining any ore, followed by 5 seconds of Haste I + miningPerkDesc0_5: 10 seconds of Haste II after mining any ore + woodcuttingPerkDesc3_1: Leaves may now drop a + common: common + uncommon: uncommon + rare: rare + veryRare: very rare + legendary: legendary + fishingPerkDesc1_1: Unlocks treasure tier + farmingPerkDesc1_1: Gain the ability to craft + cowSpawnEgg: cow spawn egg + beeSpawnEgg: bee spawn egg + mooshroomSpawnEgg: mooshroom spawn egg + horseSpawnEgg: horse spawn egg + slimeSpawnEgg: slime spawn egg + diggingPerkDesc0_1: You may now dig up a + defensePerkDesc0_1: Gain +3 s of regen per level on kills + defensePerkDesc0_2: Gain +0.5 hearts per level instantly on kills + duration: Duration + likelihood: Likelihood + junkChance: Junk Chance + locked: LOCKED + unlocked: UNLOCKED + cowEgg: Cow Egg + beeEgg: Bee Egg + mooshroomEgg: Mooshroom Egg + horseEgg: Horse Egg + slimeEgg: Slime Egg + tippedArrows: Tipped Arrows + toggle: Toggle + refundSkillTitle: Refund Skill + refundSkillTreeDesc: Click to refund this skill tree + enchantingPerkDesc1_0: Unlocks ability to craft + enchantingPerkDesc1_1: Power I and Efficiency I enchanted books (costs 1 level to craft) + enchantingPerkDesc1_2: Sharpness I and Protection I enchanted books (costs 1 level to craft) + enchantingPerkDesc1_3: Luck of the Sea I and Lure I enchanted books (costs 1 level to craft) + enchantingPerkDesc1_4: Depth Strider I and Frost Walker I enchanted books (costs 1 level to craft) + enchantingPerkDesc1_5: Mending (costs 10 levels to craft) and Fortune I (costs 2 levels to craft) enchanted books + repairPerkDesc0_1: Gain more materials from salvaging on average + repairPerkDesc0_2: Gain more materials from salvaging on average, salvaging now stores item enchants in a book + xpBoost: XP Boost + speedBoost: Speed Boost + timeExtension: Time Extension + enchantingCraft0: Power I Book + enchantingCraft1: Efficiency I Book + enchantingCraft2: Sharpness I Book + enchantingCraft3: Protection I Book + enchantingCraft4: Luck of the Sea I Book + enchantingCraft5: Lure I Book + enchantingCraft6: Frost Walker I Book + enchantingCraft7: Depth Strider I Book + enchantingCraft8: Mending Book + enchantingCraft9: Fortune I Book + commandDesc9: Sets the souls for a specified player + commandDesc10: Sets the skill or passive tokens in specified skill for a specified player + commandDesc11: Sets the global tokens for a specified player + commandDesc12: Saves stats of all players or a specified player + status: STATUS + complete: COMPLETE + incomplete: INCOMPLETE + try0: "try" + passiveImprove: Your passive perks improve every level! + increasedBy: increased by + expIncrease: EXP Multiplier + personalMultiplier: Personal Multiplier + translators: Translators + commandDesc13: Sets the personal multiplier for a specified player + abilityDescription: Ability Description + abilityDescription_digging: Temporarily adds 5 levels of effiency to your shovel. Activated by right-clicking a shovel then breaking a block. + abilityDescription_woodcutting: Temporarily makes axes break an entire tree with one block break. Activated by right-clicking an axe then breaking a log. + abilityDescription_mining: Temporarily adds 5 levels of effiency to your pickaxe. Activated by right-clicking a pickaxe then breaking block. + abilityDescription_farming: Temporarily makes crops broken with a hoe automatically replant. Activated by right-clicking a hoe then breaking a crop. + abilityDescription_fishing: Temporarily makes fishing rods instantly catch a fish. Activated by left-clicking a fishing rod then fishing in water. + abilityDescription_archery: Temporarily makes all arrows fired at max speed. Activated by left-clicking a bow then shooting an arrow. + abilityDescription_beastMastery: Temporarily gives your horse a speed buff. Activated by right-clicking while on a horse then left-clicking. + abilityDescription_swordsmanship: Temporarily removes swinging cooldown on swords. Activated by right-clicking a sword then hitting a mob. + abilityDescription_defense: Temporarily gives the user Resistance and Slowness effects. Activated by right-clicking with an empty hand then hitting a mob. + abilityDescription_axeMastery: Temporarily makes axes do damage to all mobs in a certain radius. Activated by right-clicking an axe then hitting a mob. + alchemyPerkDesc1_0: Unlocks ability to brew + alchemyPerkDesc0_0: A crafting table can be used to craft + triggerAbilities: Trigger Abilities + showEXPBar: Show EXP Bar + disabledSkill: This skill is disabled + skillConfigDesc: Takes you to configuration menu for this skill + lvl: Lvl. #Abbreviation for "Level" If your language has no abbreviation, please put the translation for "Level" + exp: EXP #Abbreviation for "experience" if your language has no abbreviation, please put the translation for "experience" + potionAbsorption: Potion of Absorption + potionBadOmen: Potion of Bad Omen + potionBlindess: Potion of Blindess + potionConduitPower: Potion of Conduit Power + potionResistance: Potion of Resistance + potionDolphinsGrace: Potion of Dolphins Grace + potionHaste: Potion of Haste + potionFireResistance: Potion of Fire Resistance + potionGlowing: Potion of Glowing + potionHarm: Potion of Harm + potionHealing: Potion of Healing + potionHealthBoost: Potion of Health Boost + potiontheHero: Potion of the Hero + potionHunger: Potion of Hunger + potionStrength: Potion of Strength + potionInvsibility: Potion of Invsibility + potionJump: Potion of Jump + potionLuck: Potion of Luck + potionNightVision: Potion of Night Vision + potionRegeneration: Potion of Regeneration + potionSaturation: Potion of Saturation + potionSlowness: Potion of Slowness + potionFatigue: Potion of Fatigue + potionSlowFalling: Potion of Slow Falling + potionSpeed: Potion of Speed + potionBadLuck: Potion of Bad Luck + potionWaterBreathing: Potion of Water Breathing + potionWeakness: Potion of Weakness + potionDecay: Potion of Decay + potionAwkward: Awkward Potion + potionUncraftable: Uncraftable Potion + potionMundane: Mundane Potion + potionTurtleMaster: Potion of the Turtle Master + potionThick: Thick Potion + potionWater: Water Bottle + ingredient: Ingredient + usedToBrew: Is used to brew + costs: costs + xpLevel: Minecraft XP Level + xpLevels: Minecraft XP Levels + craftXPRequirement: This recipe requires at least + bedGUI: You cannot use this command while in bed! + statsUpdated: Your stats were changed to be consistent with a new EXP curve. + All skill trees and passive perks have been reset. All tokens must be re-invested. + timeRemaining: Time Remaining + numberOfAbilityTimersDisplayed: Number of Ability Timers Displayed + commandDesc14: Resets the cooldown period for a skill to 0 seconds + commandDesc15: Looks up a player's FreeRPG stats + repairUnsafeEnchant: This item is too powerful to be repaired + salvageUnsafeEnchant: This item is too powerful to be salvaged + rank: Rank + stats: stats + outOf: out of + playerNotInLeaderboard: That player is not on any leaderboards + virtual: Virtual + commandDesc16: Changes player's FreeRPG experience multiplier by a specified amount (positive or negative) diff --git a/src/main/resources/perkConfig.yml b/src/main/resources/perkConfig.yml index 12fcd10..05878b1 100644 --- a/src/main/resources/perkConfig.yml +++ b/src/main/resources/perkConfig.yml @@ -260,13 +260,13 @@ global: enabled: true #Change this to false to disable this skill from working level-1: #Mobs that will drop souls. You must provide the mob name spelled correctly. Select from this list: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/EntityType.html - affected-mobList: [SPIDER,CAVE_SPIDER,ENDERMAN, - BLAZE,CREEPER,DROWNED,ELDER_GUARDIAN, - ENDERMITE,EVOKER,GHAST,GUARDIAN, - HUSK,MAGMA_CUBE,PHANTOM,PILLAGER, - RAVAGER,SHULKER,SKELETON,SLIME, - STRAY,VEX,VINDICATOR,WITCH, - WITHER_SKELETON,ZOMBIE,ZOMBIE_VILLAGER] + affected-mobList: [ SPIDER,CAVE_SPIDER,ENDERMAN, + BLAZE,CREEPER,DROWNED,ELDER_GUARDIAN, + ENDERMITE,EVOKER,GHAST,GUARDIAN, + HUSK,MAGMA_CUBE,PHANTOM,PILLAGER, + RAVAGER,SHULKER,SKELETON,SLIME, + STRAY,VEX,VINDICATOR,WITCH, + WITHER_SKELETON,ZOMBIE,ZOMBIE_VILLAGER ] skill-8: #Reincarnation+ enabled: true #Change this to false to disable this skill from working level-1: @@ -274,44 +274,44 @@ global: minimumPortionKept: 0.0 #Minimum potion of the saved valuable item kept (the player will always keep at least 1 if the chanceToKeepValuable roll is good enough) maximumPortionKept: 1.0 #Maximum portion of the saved valuable item kept #Items that have a chance of being kept on death. You must provide the item name spelled correctly. Select from this list: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html - affected-itemList: [IRON_ORE,GOLD_ORE,DIAMOND_ORE,EMERALD_ORE,REDSTONE_ORE,LAPIS_ORE, - IRON_BLOCK,GOLD_BLOCK,DIAMOND_BLOCK,EMERALD_BLOCK,REDSTONE_BLOCK,LAPIS_BLOCK, - SLIME_BLOCK,SPONGE,NETHER_QUARTZ_ORE,NETHER_WART_BLOCK,DRAGON_EGG,SHULKER_BOX, - ENCHANTING_TABLE,ANVIL,BEACON,BREWING_STAND,CAKE,JUKEBOX, - TNT,CREEPER_HEAD,DRAGON_HEAD,PLAYER_HEAD,ZOMBIE_HEAD,SKELETON_SKULL,WITHER_SKELETON_SKULL, - ENDER_EYE,ENDER_PEARL,FIREWORK_ROCKET,FIRE_CHARGE,POTION,SPLASH_POTION,LINGERING_POTION, - NETHER_WART,REDSTONE,TRIDENT,DIAMOND_SWORD,DIAMOND_BOOTS,DIAMOND_CHESTPLATE, - DIAMOND_HELMET,DIAMOND_HOE,DIAMOND_LEGGINGS,DIAMOND_PICKAXE,DIAMOND_SHOVEL,DIAMOND_AXE, - ELYTRA,ENCHANTED_BOOK,ENCHANTED_GOLDEN_APPLE,GOLDEN_APPLE,IRON_INGOT, - MUSIC_DISC_11, MUSIC_DISC_13, MUSIC_DISC_BLOCKS, MUSIC_DISC_CAT, - MUSIC_DISC_CHIRP, MUSIC_DISC_FAR, MUSIC_DISC_MALL, MUSIC_DISC_MELLOHI, - MUSIC_DISC_STAL, MUSIC_DISC_STRAD, MUSIC_DISC_WAIT, MUSIC_DISC_WARD, - NAME_TAG,TIPPED_ARROW,TOTEM_OF_UNDYING,SPECTRAL_ARROW,DIAMOND,GOLD_INGOT, - HEART_OF_THE_SEA,DRAGON_BREATH,EMERALD,NAUTILUS_SHELL,NETHER_STAR,SLIME_BALL, - RABBIT_FOOT] + affected-itemList: [ IRON_ORE,GOLD_ORE,DIAMOND_ORE,EMERALD_ORE,REDSTONE_ORE,LAPIS_ORE, + IRON_BLOCK,GOLD_BLOCK,DIAMOND_BLOCK,EMERALD_BLOCK,REDSTONE_BLOCK,LAPIS_BLOCK, + SLIME_BLOCK,SPONGE,NETHER_QUARTZ_ORE,NETHER_WART_BLOCK,DRAGON_EGG,SHULKER_BOX, + ENCHANTING_TABLE,ANVIL,BEACON,BREWING_STAND,CAKE,JUKEBOX, + TNT,CREEPER_HEAD,DRAGON_HEAD,PLAYER_HEAD,ZOMBIE_HEAD,SKELETON_SKULL,WITHER_SKELETON_SKULL, + ENDER_EYE,ENDER_PEARL,FIREWORK_ROCKET,FIRE_CHARGE,POTION,SPLASH_POTION,LINGERING_POTION, + NETHER_WART,REDSTONE,TRIDENT,DIAMOND_SWORD,DIAMOND_BOOTS,DIAMOND_CHESTPLATE, + DIAMOND_HELMET,DIAMOND_HOE,DIAMOND_LEGGINGS,DIAMOND_PICKAXE,DIAMOND_SHOVEL,DIAMOND_AXE, + ELYTRA,ENCHANTED_BOOK,ENCHANTED_GOLDEN_APPLE,GOLDEN_APPLE,IRON_INGOT, + MUSIC_DISC_11, MUSIC_DISC_13, MUSIC_DISC_BLOCKS, MUSIC_DISC_CAT, + MUSIC_DISC_CHIRP, MUSIC_DISC_FAR, MUSIC_DISC_MALL, MUSIC_DISC_MELLOHI, + MUSIC_DISC_STAL, MUSIC_DISC_STRAD, MUSIC_DISC_WAIT, MUSIC_DISC_WARD, + NAME_TAG,TIPPED_ARROW,TOTEM_OF_UNDYING,SPECTRAL_ARROW,DIAMOND,GOLD_INGOT, + HEART_OF_THE_SEA,DRAGON_BREATH,EMERALD,NAUTILUS_SHELL,NETHER_STAR,SLIME_BALL, + RABBIT_FOOT ] skill-9: #Avatar enabled: true #Change this to false to disable this skill from working level-1: effectChance: 0.10 #Chance the perk activates # List of custom effects given. effectsGiven: - - [effect: DOLPHINS_GRACE, level: 1, duration: 10.0, delay: 0.0, prob: 1.0] #Example for how to use delay and prob - - [effect: LUCK, level: 1, duration: 10.0] - - [effect: INVISIBILITY, level: 1, duration: 10.0] - - [effect: NIGHT_VISION, level: 1, duration: 10.0] - - [effect: FIRE_RESISTANCE, level: 1, duration: 10.0] - - [effect: WATER_BREATHING, level: 1, duration: 10.0] - - [effect: SPEED, level: 1, duration: 10.0] - - [effect: JUMP, level: 1, duration: 10.0] - - [effect: ABSORPTION, level: 1, duration: 10.0] - - [effect: CONDUIT_POWER, level: 1, duration: 10.0] - - [effect: DAMAGE_RESISTANCE, level: 1, duration: 10.0] - - [effect: FAST_DIGGING, level: 1, duration: 10.0] - - [effect: HEAL, level: 1, duration: 0.05] - - [effect: HEALTH_BOOST, level: 1, duration: 10.0] - - [effect: INCREASE_DAMAGE, level: 1, duration: 10.0] - - [effect: REGENERATION, level: 1, duration: 10.0] - - [effect: SATURATION, level: 1, duration: 10.0] + - [ effect: DOLPHINS_GRACE, level: 1, duration: 10.0, delay: 0.0, prob: 1.0 ] #Example for how to use delay and prob + - [ effect: LUCK, level: 1, duration: 10.0 ] + - [ effect: INVISIBILITY, level: 1, duration: 10.0 ] + - [ effect: NIGHT_VISION, level: 1, duration: 10.0 ] + - [ effect: FIRE_RESISTANCE, level: 1, duration: 10.0 ] + - [ effect: WATER_BREATHING, level: 1, duration: 10.0 ] + - [ effect: SPEED, level: 1, duration: 10.0 ] + - [ effect: JUMP, level: 1, duration: 10.0 ] + - [ effect: ABSORPTION, level: 1, duration: 10.0 ] + - [ effect: CONDUIT_POWER, level: 1, duration: 10.0 ] + - [ effect: DAMAGE_RESISTANCE, level: 1, duration: 10.0 ] + - [ effect: FAST_DIGGING, level: 1, duration: 10.0 ] + - [ effect: HEAL, level: 1, duration: 0.05 ] + - [ effect: HEALTH_BOOST, level: 1, duration: 10.0 ] + - [ effect: INCREASE_DAMAGE, level: 1, duration: 10.0 ] + - [ effect: REGENERATION, level: 1, duration: 10.0 ] + - [ effect: SATURATION, level: 1, duration: 10.0 ] skill-10: #Master of the Arts enabled: true #Change this to false to disable this skill from working level-1: @@ -320,53 +320,55 @@ digging: passive-1: #Big Dig Duration enabled: true #Change this to false to disable this passive skill from working startingValue: 2.0 #Starting duration in seconds - allowedRange: [0.0, INF] #The range of possible durations (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The range of possible durations (INF or -INF represent positive and negative infinity) changePerLevel: 0.02 #Number of seconds the duration increases each level passive-2: #Treasure Chance enabled: true #Change this to false to disable this passive skill from working startingValue: 0.01 #Starting likelihood - allowedRange: [0.0, 0.25] #The allowed range of likelihoods (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 0.25 ] #The allowed range of likelihoods (INF or -INF represent positive and negative infinity) changePerLevel: 0.00005 #Increase in likelihood each level # Drop table for this skill. Use a list of custom drops. They act as the default treasures for this skill. dropTable: - - [drop: GLOWSTONE_DUST, amount: 1, exp: 100, weight: 52] - - [drop: GOLD_NUGGET, amount: 1, exp: 100, weight: 52] - - [drop: STRING, amount: 1, exp: 100, weight: 52] - - [drop: IRON_NUGGET, amount: 1, exp: 100, weight: 52] - - [drop: COBWEB, amount: 1, exp: 100, weight: 52] + - [ drop: GLOWSTONE_DUST, amount: 1, exp: 100, weight: 52 ] + - [ drop: GOLD_NUGGET, amount: 1, exp: 100, weight: 52 ] + - [ drop: STRING, amount: 1, exp: 100, weight: 52 ] + - [ drop: IRON_NUGGET, amount: 1, exp: 100, weight: 52 ] + - [ drop: COBWEB, amount: 1, exp: 100, weight: 52 ] skill-1: #Mo' Drops enabled: true #Change this to false to disable this skill from working # Drop tables added for this skill. Use a list of custom drops. level-1: dropsAdded: - - [drop: GOLD_INGOT, amount: 1, exp: 100, weight: 52] + - [ drop: GOLD_INGOT, amount: 1, exp: 100, weight: 52 ] level-2: dropsAdded: - - [drop: NAME_TAG, amount: 1, exp: 150, weight: 52] + - [ drop: NAME_TAG, amount: 1, exp: 150, weight: 52 ] level-3: dropsAdded: - - [drop: MUSIC_DISC_STAL, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_MELLOHI, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_FAR, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_CHIRP, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_CAT, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_BLOCKS, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_11, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_MALL, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_WAIT, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_WARD, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_STRAD, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_13, amount: 1, exp: 160, weight: 4 ] - - [drop: MUSIC_DISC_PIGSTEP, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_STAL, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_MELLOHI, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_FAR, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_CHIRP, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_CAT, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_BLOCKS, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_11, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_MALL, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_WAIT, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_WARD, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_STRAD, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_13, amount: 1, exp: 160, weight: 4 ] + - [ drop: MUSIC_DISC_PIGSTEP, amount: 1, exp: 160, weight: 4 ] + # added since 1.16.5 + - [ drop: MUSIC_DISC_OTHERSIDE, amount: 1, exp: 160, weight: 4 ] level-4: dropsAdded: - - [drop: DIAMOND_HORSE_ARMOR, amount: 1, exp: 170, weight: 13] - - [drop: GOLDEN_HORSE_ARMOR, amount: 1, exp: 170, weight: 13] - - [drop: IRON_HORSE_ARMOR, amount: 1, exp: 170, weight: 13] - - [drop: LEATHER_HORSE_ARMOR, amount: 1, exp: 170, weight: 13] + - [ drop: DIAMOND_HORSE_ARMOR, amount: 1, exp: 170, weight: 13 ] + - [ drop: GOLDEN_HORSE_ARMOR, amount: 1, exp: 170, weight: 13 ] + - [ drop: IRON_HORSE_ARMOR, amount: 1, exp: 170, weight: 13 ] + - [ drop: LEATHER_HORSE_ARMOR, amount: 1, exp: 170, weight: 13 ] level-5: dropsAdded: - - [drop: DIAMOND, amount: 1, exp: 2000, prob: 0.0025] + - [ drop: DIAMOND, amount: 1, exp: 2000, prob: 0.0025 ] skill-2: #Double Treasure enabled: true #Change this to false to disable this skill from working level-1: @@ -384,36 +386,36 @@ digging: # Drop tables added for this skill. Use a list of custom drops. level-1: dropsAdded: - - [drop: EMERALD, amount: 1, exp: 180, prob: 0.022900] + - [ drop: EMERALD, amount: 1, exp: 180, prob: 0.022900 ] level-2: dropsAdded: - - [drop: ENCHANTED_BOOK, amount: 1, exp: 350, prob: 0.001275, enchantmentBounds: [lower: 30, upper: 30, isTreasure: true]] + - [ drop: ENCHANTED_BOOK, amount: 1, exp: 350, prob: 0.001275, enchantmentBounds: [ lower: 30, upper: 30, isTreasure: true ] ] level-3: dropsAdded: - - [drop: DRAGON_BREATH, amount: 1, exp: 600, prob: 0.008350] + - [ drop: DRAGON_BREATH, amount: 1, exp: 600, prob: 0.008350 ] level-4: dropsAdded: - - [drop: TOTEM_OF_UNDYING, amount: 1, exp: 2050, prob: 0.002500] + - [ drop: TOTEM_OF_UNDYING, amount: 1, exp: 2050, prob: 0.002500 ] level-5: dropsAdded: - - [drop: NETHER_STAR, amount: 1, exp: 4000, prob: 0.001000] + - [ drop: NETHER_STAR, amount: 1, exp: 4000, prob: 0.001000 ] skill-4: #Soul Stealer enabled: true #Change this to false to disable this skill from working level-1: likelihoodIncrease: 0.05 #Total likelihood Increase - affected-blockList: [SOUL_SAND] #Blocks that boost the treasure likelihood + affected-blockList: [ SOUL_SAND ] #Blocks that boost the treasure likelihood level-2: likelihoodIncrease: 0.10 #Total likelihood Increase - affected-blockList: [SOUL_SAND] #Blocks that boost the treasure likelihood + affected-blockList: [ SOUL_SAND ] #Blocks that boost the treasure likelihood level-3: likelihoodIncrease: 0.15 #Total likelihood Increase - affected-blockList: [SOUL_SAND] #Blocks that boost the treasure likelihood + affected-blockList: [ SOUL_SAND ] #Blocks that boost the treasure likelihood level-4: likelihoodIncrease: 0.20 #Total likelihood Increase - affected-blockList: [SOUL_SAND] #Blocks that boost the treasure likelihood + affected-blockList: [ SOUL_SAND ] #Blocks that boost the treasure likelihood level-5: likelihoodIncrease: 0.25 #Total likelihood Increase - affected-blockList: [SOUL_SAND] #Blocks that boost the treasure likelihood + affected-blockList: [ SOUL_SAND ] #Blocks that boost the treasure likelihood skill-5: #Flinter Finder enabled: true #Change this to false to disable this skill from working level-1: @@ -432,20 +434,20 @@ woodcutting: passive-1: #Timber Duration enabled: true #Change this to false to disable this passive skill from working startingValue: 2.0 #Starting duration in seconds - allowedRange: [0.0, INF] #The allowed range of durations, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of durations, (INF or -INF represent positive and negative infinity) changePerLevel: 0.02 #Number of seconds the duration increases each level passive-2: #Double Drops enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities (INF or -INF represent positive and negative infinity) changePerLevel: 0.0005 #Probability increase per level # Blocks double drops applies to # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Blocks that are not spelled correctly or do not exist in the current minecraft version are ignored - affected-blockList: [ACACIA_LOG,BIRCH_LOG,DARK_OAK_LOG,OAK_LOG,SPRUCE_LOG,JUNGLE_LOG, - STRIPPED_ACACIA_LOG,STRIPPED_BIRCH_LOG,STRIPPED_DARK_OAK_LOG,STRIPPED_JUNGLE_LOG, - STRIPPED_OAK_LOG,STRIPPED_SPRUCE_LOG,CRIMSON_STEM,WARPED_STEM, - STRIPPED_CRIMSON_STEM,STRIPPED_WARPED_STEM] + affected-blockList: [ ACACIA_LOG,BIRCH_LOG,DARK_OAK_LOG,OAK_LOG,SPRUCE_LOG,JUNGLE_LOG, + STRIPPED_ACACIA_LOG,STRIPPED_BIRCH_LOG,STRIPPED_DARK_OAK_LOG,STRIPPED_JUNGLE_LOG, + STRIPPED_OAK_LOG,STRIPPED_SPRUCE_LOG,CRIMSON_STEM,WARPED_STEM, + STRIPPED_CRIMSON_STEM,STRIPPED_WARPED_STEM ] skill-1: #Zelous Roots enabled: true #Change this to false to disable this skill from working level-1: @@ -464,23 +466,23 @@ woodcutting: level-1: effectChance: 1.0 #Chance the perk activates effectsGiven: - - [effect: HASTE, level: 1, duration: 12, delay: 0.0, prob: 1.0] #Example of how to use prob + - [ effect: HASTE, level: 1, duration: 12, delay: 0.0, prob: 1.0 ] #Example of how to use prob level-2: effectChance: 1.0 #Chance the perk activates effectsGiven: - - [effect: HASTE, level: 1, duration: 24] + - [ effect: HASTE, level: 1, duration: 24 ] level-3: effectChance: 1.0 #Chance the perk activates effectsGiven: - - [effect: HASTE, level: 1, duration: 36] + - [ effect: HASTE, level: 1, duration: 36 ] level-4: effectChance: 1.0 #Chance the perk activates effectsGiven: - - [effect: HASTE, level: 1, duration: 48] + - [ effect: HASTE, level: 1, duration: 48 ] level-5: effectChance: 1.0 #Chance the perk activates effectsGiven: - - [effect: HASTE, level: 1, duration: 60] + - [ effect: HASTE, level: 1, duration: 60 ] skill-3: #Hidden Knowledge (More coming soon for this one) enabled: true #Change this to false to disable this skill from working level-1: @@ -501,29 +503,29 @@ woodcutting: # If you really want to use weight, you can drop nothing by setting amount to 0. level-1: dropTable: - - [drop: FEATHER, amount: 1, exp: 150, prob: 0.0200] + - [ drop: FEATHER, amount: 1, exp: 150, prob: 0.0200 ] level-2: dropTable: - - [drop: FEATHER, amount: 1, exp: 150, prob: 0.0200] - - [drop: GOLD_NUGGET, amount: 1, exp: 180, prob: 0.0200] + - [ drop: FEATHER, amount: 1, exp: 150, prob: 0.0200 ] + - [ drop: GOLD_NUGGET, amount: 1, exp: 180, prob: 0.0200 ] level-3: dropTable: - - [drop: FEATHER, amount: 1, exp: 150, prob: 0.0200] - - [drop: GOLD_NUGGET, amount: 1, exp: 180, prob: 0.0200] - - [drop: GOLDEN_APPLE, amount: 1, exp: 800, prob: 0.0025] + - [ drop: FEATHER, amount: 1, exp: 150, prob: 0.0200 ] + - [ drop: GOLD_NUGGET, amount: 1, exp: 180, prob: 0.0200 ] + - [ drop: GOLDEN_APPLE, amount: 1, exp: 800, prob: 0.0025 ] level-4: dropTable: - - [drop: FEATHER, amount: 1, exp: 150, prob: 0.0200] - - [drop: GOLD_NUGGET, amount: 1, exp: 180, prob: 0.0200] - - [drop: GOLDEN_APPLE, amount: 1, exp: 800, prob: 0.0025] - - [drop: EXPERIENCE_BOTTLE, amount: 1, exp: 400, prob: 0.0075] + - [ drop: FEATHER, amount: 1, exp: 150, prob: 0.0200 ] + - [ drop: GOLD_NUGGET, amount: 1, exp: 180, prob: 0.0200 ] + - [ drop: GOLDEN_APPLE, amount: 1, exp: 800, prob: 0.0025 ] + - [ drop: EXPERIENCE_BOTTLE, amount: 1, exp: 400, prob: 0.0075 ] level-5: dropTable: - - [drop: FEATHER, amount: 1, exp: 150, prob: 0.0200] - - [drop: GOLD_NUGGET, amount: 1, exp: 180, prob: 0.0200] - - [drop: GOLDEN_APPLE, amount: 1, exp: 800, prob: 0.0025] - - [drop: EXPERIENCE_BOTTLE, amount: 1, exp: 400, prob: 0.0075] - - [drop: ENCHANTED_GOLDEN_APPLE, amount: 1, exp: 1500, prob: 0.0005] + - [ drop: FEATHER, amount: 1, exp: 150, prob: 0.0200 ] + - [ drop: GOLD_NUGGET, amount: 1, exp: 180, prob: 0.0200 ] + - [ drop: GOLDEN_APPLE, amount: 1, exp: 800, prob: 0.0025 ] + - [ drop: EXPERIENCE_BOTTLE, amount: 1, exp: 400, prob: 0.0075 ] + - [ drop: ENCHANTED_GOLDEN_APPLE, amount: 1, exp: 1500, prob: 0.0005 ] skill-5: #Timber + enabled: true #Change this to false to disable this skill from working level-1: @@ -541,56 +543,56 @@ mining: passive-1: #Berserk Pick Duration enabled: true #Change this to false to disable this passive skill from working startingValue: 2.0 #Starting duration in seconds - allowedRange: [0.0, INF] #The allowed range of durations, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of durations, (INF or -INF represent positive and negative infinity) changePerLevel: 0.02 #Number of seconds the duration increases each level passive-2: #Double Drops enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities (INF or -INF represent positive and negative infinity) changePerLevel: 0.0005 #Increase in probability each level # Blocks double drops applies to # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Blocks that are not spelled correctly or do not exist in the current minecraft version are ignored - affected-blockList: [REDSTONE_ORE,NETHER_QUARTZ_ORE,LAPIS_ORE,IRON_ORE,GOLD_ORE, - EMERALD_ORE,DIAMOND_ORE,COAL_ORE,NETHER_GOLD_ORE,ANCIENT_DEBRIS,GILDED_BLACKSTONE] + affected-blockList: [ REDSTONE_ORE,NETHER_QUARTZ_ORE,LAPIS_ORE,IRON_ORE,GOLD_ORE, + EMERALD_ORE,DIAMOND_ORE,COAL_ORE,NETHER_GOLD_ORE,ANCIENT_DEBRIS,GILDED_BLACKSTONE ] passive-3: #Blast Mining enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) changePerLevel: 0.0001 #Increase in probability each level # Drop table for this skill. Provide a list of custom items. dropTable: - - [drop: COAL, amount: 1, exp: 200, weight: 500] - - [drop: IRON_ORE, amount: 1, exp: 350, weight: 200] - - [drop: GOLD_ORE, amount: 1, exp: 500, weight: 100] - - [drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 50 ] - - [drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 50 ] - - [drop: REDSTONE, amount: 1, exp: 500, weight: 90 ] - - [drop: DIAMOND, amount: 1, exp: 1000, weight: 9 ] - - [drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 1 ] + - [ drop: COAL, amount: 1, exp: 200, weight: 500 ] + - [ drop: IRON_ORE, amount: 1, exp: 350, weight: 200 ] + - [ drop: GOLD_ORE, amount: 1, exp: 500, weight: 100 ] + - [ drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 50 ] + - [ drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 50 ] + - [ drop: REDSTONE, amount: 1, exp: 500, weight: 90 ] + - [ drop: DIAMOND, amount: 1, exp: 1000, weight: 9 ] + - [ drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 1 ] skill-1: #Wasteless Haste enabled: true #Change this to false to disable this skill from working level-1: effectChance: 1.0 #Chance the effects are given effectsGiven: # Provide a list of custom effects - - [effect: HASTE, level: 1, duration: 2, prob: 1.0] #Example of how to use prob + - [ effect: HASTE, level: 1, duration: 2, prob: 1.0 ] #Example of how to use prob level-2: effectChance: 1.0 #Chance the effects are given effectsGiven: # Provide a list of custom effects - - [effect: HASTE, level: 1, duration: 5] + - [ effect: HASTE, level: 1, duration: 5 ] level-3: effectChance: 1.0 #Chance the effects are given effectsGiven: # Provide a list of custom effects - - [effect: HASTE, level: 1, duration: 10] + - [ effect: HASTE, level: 1, duration: 10 ] level-4: effectChance: 1.0 #Chance the effects are given effectsGiven: # Provide a list of custom effects - - [effect: HASTE, level: 2, duration: 5, delay: 0] - - [effect: HASTE, level: 1, duration: 5, delay: 5] + - [ effect: HASTE, level: 2, duration: 5, delay: 0 ] + - [ effect: HASTE, level: 1, duration: 5, delay: 5 ] level-5: effectChance: 1.0 #Chance the effects are given effectsGiven: # Provide a list of custom effects - - [effect: HASTE, level: 2, duration: 10] + - [ effect: HASTE, level: 2, duration: 10 ] skill-2: #More Bombs enabled: true #Change this to false to disable this skill from working level-1: @@ -607,69 +609,69 @@ mining: enabled: true #Change this to false to disable this skill from working level-1: dropChance: 0.01 #Probability that treasure will be rolled - effectedBlocks: [STONE] #Blocks that will cause the treasure roll + effectedBlocks: [ STONE ] #Blocks that will cause the treasure roll # Drop table for this skill. Provide a list of custom items. dropTable: - - [drop: COAL, amount: 1, exp: 200, weight: 500] - - [drop: IRON_ORE, amount: 1, exp: 350, weight: 200] - - [drop: GOLD_ORE, amount: 1, exp: 500, weight: 100] - - [drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 50 ] - - [drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 50 ] - - [drop: REDSTONE, amount: 1, exp: 500, weight: 90 ] - - [drop: DIAMOND, amount: 1, exp: 1000, weight: 9 ] - - [drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 1 ] + - [ drop: COAL, amount: 1, exp: 200, weight: 500 ] + - [ drop: IRON_ORE, amount: 1, exp: 350, weight: 200 ] + - [ drop: GOLD_ORE, amount: 1, exp: 500, weight: 100 ] + - [ drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 50 ] + - [ drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 50 ] + - [ drop: REDSTONE, amount: 1, exp: 500, weight: 90 ] + - [ drop: DIAMOND, amount: 1, exp: 1000, weight: 9 ] + - [ drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 1 ] level-2: dropChance: 0.02 #Probability that treasure will be rolled - effectedBlocks: [STONE] #Blocks that will cause the treasure roll + effectedBlocks: [ STONE ] #Blocks that will cause the treasure roll # Drop table for this skill. Provide a list of custom items. dropTable: - - [drop: COAL, amount: 1, exp: 200, weight: 400] - - [drop: IRON_ORE, amount: 1, exp: 350, weight: 250] - - [drop: GOLD_ORE, amount: 1, exp: 500, weight: 110] - - [drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 60 ] - - [drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 60 ] - - [drop: REDSTONE, amount: 1, exp: 500, weight: 100] - - [drop: DIAMOND, amount: 1, exp: 1000, weight: 18 ] - - [drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 2 ] + - [ drop: COAL, amount: 1, exp: 200, weight: 400 ] + - [ drop: IRON_ORE, amount: 1, exp: 350, weight: 250 ] + - [ drop: GOLD_ORE, amount: 1, exp: 500, weight: 110 ] + - [ drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 60 ] + - [ drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 60 ] + - [ drop: REDSTONE, amount: 1, exp: 500, weight: 100 ] + - [ drop: DIAMOND, amount: 1, exp: 1000, weight: 18 ] + - [ drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 2 ] level-3: dropChance: 0.03 #Probability that treasure will be rolled - effectedBlocks: [STONE] #Blocks that will cause the treasure roll + effectedBlocks: [ STONE ] #Blocks that will cause the treasure roll # Drop table for this skill. Provide a list of custom items. dropTable: - - [drop: COAL, amount: 1, exp: 200, weight: 300] - - [drop: IRON_ORE, amount: 1, exp: 350, weight: 300] - - [drop: GOLD_ORE, amount: 1, exp: 500, weight: 120] - - [drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 70 ] - - [drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 70 ] - - [drop: REDSTONE, amount: 1, exp: 500, weight: 110] - - [drop: DIAMOND, amount: 1, exp: 1000, weight: 27 ] - - [drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 3 ] + - [ drop: COAL, amount: 1, exp: 200, weight: 300 ] + - [ drop: IRON_ORE, amount: 1, exp: 350, weight: 300 ] + - [ drop: GOLD_ORE, amount: 1, exp: 500, weight: 120 ] + - [ drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 70 ] + - [ drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 70 ] + - [ drop: REDSTONE, amount: 1, exp: 500, weight: 110 ] + - [ drop: DIAMOND, amount: 1, exp: 1000, weight: 27 ] + - [ drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 3 ] level-4: dropChance: 0.04 #Probability that treasure will be rolled - effectedBlocks: [STONE] #Blocks that will cause the treasure roll + effectedBlocks: [ STONE ] #Blocks that will cause the treasure roll # Drop table for this skill. Provide a list of custom items. dropTable: - - [drop: COAL, amount: 1, exp: 200, weight: 250] - - [drop: IRON_ORE, amount: 1, exp: 350, weight: 250] - - [drop: GOLD_ORE, amount: 1, exp: 500, weight: 160] - - [drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 100] - - [drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 100] - - [drop: REDSTONE, amount: 1, exp: 500, weight: 100] - - [drop: DIAMOND, amount: 1, exp: 1000, weight: 36 ] - - [drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 4 ] + - [ drop: COAL, amount: 1, exp: 200, weight: 250 ] + - [ drop: IRON_ORE, amount: 1, exp: 350, weight: 250 ] + - [ drop: GOLD_ORE, amount: 1, exp: 500, weight: 160 ] + - [ drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 100 ] + - [ drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 100 ] + - [ drop: REDSTONE, amount: 1, exp: 500, weight: 100 ] + - [ drop: DIAMOND, amount: 1, exp: 1000, weight: 36 ] + - [ drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 4 ] level-5: dropChance: 0.05 #Probability that treasure will be rolled - effectedBlocks: [STONE] #Blocks that will cause the treasure roll + effectedBlocks: [ STONE ] #Blocks that will cause the treasure roll # Drop table for this skill. Provide a list of custom items. dropTable: - - [drop: COAL, amount: 1, exp: 200, weight: 200] - - [drop: IRON_ORE, amount: 1, exp: 350, weight: 250] - - [drop: GOLD_ORE, amount: 1, exp: 500, weight: 200] - - [drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 70 ] - - [drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 150] - - [drop: REDSTONE, amount: 1, exp: 500, weight: 70 ] - - [drop: DIAMOND, amount: 1, exp: 1000, weight: 45 ] - - [drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 5 ] + - [ drop: COAL, amount: 1, exp: 200, weight: 200 ] + - [ drop: IRON_ORE, amount: 1, exp: 350, weight: 250 ] + - [ drop: GOLD_ORE, amount: 1, exp: 500, weight: 200 ] + - [ drop: LAPIS_LAZULI, amount: 1, exp: 700, weight: 70 ] + - [ drop: EMERALD_ORE, amount: 1, exp: 1250, weight: 150 ] + - [ drop: REDSTONE, amount: 1, exp: 500, weight: 70 ] + - [ drop: DIAMOND, amount: 1, exp: 1000, weight: 45 ] + - [ drop: NETHERITE_SCRAP, amount: 1, exp: 1500, weight: 5 ] skill-4: #Bomb-boyage enabled: true #Change this to false to disable this skill from working #Base TNT power is 4.0. The formula for TNT explosion radius is complicated, but a rule of thumb is each additional @@ -687,7 +689,11 @@ mining: skill-5: #vein Miner enabled: true #Change this to false to disable this skill from working level-1: - affected-blockList: [REDSTONE_ORE,NETHER_QUARTZ_ORE,LAPIS_ORE,IRON_ORE,GOLD_ORE,EMERALD_ORE,DIAMOND_ORE,COAL_ORE,GLOWSTONE,NETHER_GOLD_ORE,ANCIENT_DEBRIS,GILDED_BLACKSTONE] + affected-blockList: [ REDSTONE_ORE,NETHER_QUARTZ_ORE,LAPIS_ORE,IRON_ORE,GOLD_ORE,EMERALD_ORE, + DIAMOND_ORE,COAL_ORE,GLOWSTONE,NETHER_GOLD_ORE,ANCIENT_DEBRIS, + GILDED_BLACKSTONE,COPPER_ORE,DEEPSLATE_COPPER_ORE,DEEPSLATE_COAL_ORE, + DEEPSLATE_DIAMOND_ORE,DEEPSLATE_EMERALD_ORE,DEEPSLATE_IRON_ORE, + DEEPSLATE_LAPIS_ORE,DEEPSLATE_REDSTONE_ORE ] maxBlocks: 30 #Set to -1 for no limit (not recommended) durabilityMultiplier: 1.0 #Average durability points of damaged removed per block broken (without unbreaking) expMultiplier: 1.0 #Multiplier for experience gained from blocks broken by veinMiner @@ -703,31 +709,31 @@ farming: passive-1: #Natural Regeneration Duration enabled: true #Change this to false to disable this passive skill from working startingValue: 2.0 #Starting duration in seconds - allowedRange: [0.0, INF] #The allowed range of durations, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of durations, (INF or -INF represent positive and negative infinity) changePerLevel: 0.02 #Number of seconds the duration increases each level passive-2: #Double Drops (Crops) enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) changePerLevel: 0.0005 #Increase in probability each level # Blocks double drops applies to # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Blocks that are not spelled correctly or do not exist in the current minecraft version are ignored - affected-blockList: [WHEAT,BEETROOTS,CARROTS,CHORUS_FLOWER,MELON_STEM,MELON, - NETHER_WART,POTATOES,PUMPKIN_STEM,PUMPKIN,SWEET_BERRY_BUSH,COCOA, - SUGAR_CANE,BAMBOO,CACTUS,KELP,KELP_PLANT] + affected-blockList: [ WHEAT,BEETROOTS,CARROTS,CHORUS_FLOWER,MELON_STEM,MELON, + NETHER_WART,POTATOES,PUMPKIN_STEM,PUMPKIN,SWEET_BERRY_BUSH,COCOA, + SUGAR_CANE,BAMBOO,CACTUS,KELP,KELP_PLANT ] passive-3: #Double Drops (Animals) enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) changePerLevel: 0.0005 #Increase in probability each level doubleShearDrops: true #Set to false for double drops to not apply to shearing # Mobs double drops applies to # Select mobs from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/EntityType.html # Mobs that are not spelled correctly or do not exist in the current minecraft version are ignored - affected-mobList: [CHICKEN,COW,DONKEY,FOX,HORSE,MUSHROOM_COW, - MULE,PARROT,PIG,RABBIT,SHEEP,SQUID, - SKELETON_HORSE,TURTLE] + affected-mobList: [ CHICKEN,COW,DONKEY,FOX,HORSE,MUSHROOM_COW, + MULE,PARROT,PIG,RABBIT,SHEEP,SQUID, + SKELETON_HORSE,TURTLE ] skill-1: #Better Fertilizer enabled: true #Change this to false to disable this skill from working level-1: @@ -746,93 +752,93 @@ farming: # Eventually multiple recipes will be able to be added, but for now just one will be read in level-1: recipes: - - output: [item: COW_SPAWN_EGG, amount: 1] #Output Item - recipe: [LEATHER,BEEF,LEATHER,BEEF,BONE,BEEF,LEATHER,BEEF,LEATHER] #Crafting Recipe + - output: [ item: COW_SPAWN_EGG, amount: 1 ] #Output Item + recipe: [ LEATHER,BEEF,LEATHER,BEEF,BONE,BEEF,LEATHER,BEEF,LEATHER ] #Crafting Recipe level-2: recipes: - - output: [item: BEE_SPAWN_EGG, amount: 1] #Output Item - recipe: [AIR,OXEYE_DAISY,AIR,DANDELION,HONEY_BOTTLE,POPPY,AIR,AZURE_BLUET,AIR] #Crafting Recipe + - output: [ item: BEE_SPAWN_EGG, amount: 1 ] #Output Item + recipe: [ AIR,OXEYE_DAISY,AIR,DANDELION,HONEY_BOTTLE,POPPY,AIR,AZURE_BLUET,AIR ] #Crafting Recipe level-3: recipes: - - output: [item: MOOSHROOM_SPAWN_EGG, amount: 1] #Output Item - recipe: [LEATHER,RED_MUSHROOM,LEATHER,BEEF,BONE,BEEF,LEATHER,BEEF,LEATHER] #Crafting Recipe + - output: [ item: MOOSHROOM_SPAWN_EGG, amount: 1 ] #Output Item + recipe: [ LEATHER,RED_MUSHROOM,LEATHER,BEEF,BONE,BEEF,LEATHER,BEEF,LEATHER ] #Crafting Recipe level-4: recipes: - - output: [item: HORSE_SPAWN_EGG, amount: 1] #Output Item - recipe: [LEATHER,SADDLE,LEATHER,LEATHER,BONE,LEATHER,HAY_BLOCK,HAY_BLOCK,HAY_BLOCK] #Crafting Recipe + - output: [ item: HORSE_SPAWN_EGG, amount: 1 ] #Output Item + recipe: [ LEATHER,SADDLE,LEATHER,LEATHER,BONE,LEATHER,HAY_BLOCK,HAY_BLOCK,HAY_BLOCK ] #Crafting Recipe level-5: recipes: - - output: [item: SLIME_SPAWN_EGG, amount: 1] #Output Item - recipe: [AIR,AIR,AIR,AIR,SLIME_BALL,SLIME_BALL,AIR,SLIME_BALL,SLIME_BALL] #Crafting Recipe + - output: [ item: SLIME_SPAWN_EGG, amount: 1 ] #Output Item + recipe: [ AIR,AIR,AIR,AIR,SLIME_BALL,SLIME_BALL,AIR,SLIME_BALL,SLIME_BALL ] #Crafting Recipe skill-3: #Farmer's Diet enabled: true #Change this to false to disable this skill from working level-1: foodModifier: 1.20 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [GOLDEN_APPLE,GOLDEN_CARROT,BAKED_POTATO,BEETROOT,BEETROOT_SOUP, - BREAD,CARROT,MUSHROOM_STEW,APPLE,CHORUS_FRUIT,DRIED_KELP,MELON_SLICE, - POTATO,PUMPKIN_PIE,COOKIE,HONEY_BOTTLE,SWEET_BERRIES] + affected-itemList: [ GOLDEN_APPLE,GOLDEN_CARROT,BAKED_POTATO,BEETROOT,BEETROOT_SOUP, + BREAD,CARROT,MUSHROOM_STEW,APPLE,CHORUS_FRUIT,DRIED_KELP,MELON_SLICE, + POTATO,PUMPKIN_PIE,COOKIE,HONEY_BOTTLE,SWEET_BERRIES ] level-2: foodModifier: 1.40 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [GOLDEN_APPLE,GOLDEN_CARROT,BAKED_POTATO,BEETROOT,BEETROOT_SOUP, - BREAD,CARROT,MUSHROOM_STEW,APPLE,CHORUS_FRUIT,DRIED_KELP,MELON_SLICE, - POTATO,PUMPKIN_PIE,COOKIE,HONEY_BOTTLE,SWEET_BERRIES] + affected-itemList: [ GOLDEN_APPLE,GOLDEN_CARROT,BAKED_POTATO,BEETROOT,BEETROOT_SOUP, + BREAD,CARROT,MUSHROOM_STEW,APPLE,CHORUS_FRUIT,DRIED_KELP,MELON_SLICE, + POTATO,PUMPKIN_PIE,COOKIE,HONEY_BOTTLE,SWEET_BERRIES ] level-3: foodModifier: 1.60 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [GOLDEN_APPLE,GOLDEN_CARROT,BAKED_POTATO,BEETROOT,BEETROOT_SOUP, - BREAD,CARROT,MUSHROOM_STEW,APPLE,CHORUS_FRUIT,DRIED_KELP,MELON_SLICE, - POTATO,PUMPKIN_PIE,COOKIE,HONEY_BOTTLE,SWEET_BERRIES] + affected-itemList: [ GOLDEN_APPLE,GOLDEN_CARROT,BAKED_POTATO,BEETROOT,BEETROOT_SOUP, + BREAD,CARROT,MUSHROOM_STEW,APPLE,CHORUS_FRUIT,DRIED_KELP,MELON_SLICE, + POTATO,PUMPKIN_PIE,COOKIE,HONEY_BOTTLE,SWEET_BERRIES ] level-4: foodModifier: 1.80 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [GOLDEN_APPLE,GOLDEN_CARROT,BAKED_POTATO,BEETROOT,BEETROOT_SOUP, - BREAD,CARROT,MUSHROOM_STEW,APPLE,CHORUS_FRUIT,DRIED_KELP,MELON_SLICE, - POTATO,PUMPKIN_PIE,COOKIE,HONEY_BOTTLE,SWEET_BERRIES] + affected-itemList: [ GOLDEN_APPLE,GOLDEN_CARROT,BAKED_POTATO,BEETROOT,BEETROOT_SOUP, + BREAD,CARROT,MUSHROOM_STEW,APPLE,CHORUS_FRUIT,DRIED_KELP,MELON_SLICE, + POTATO,PUMPKIN_PIE,COOKIE,HONEY_BOTTLE,SWEET_BERRIES ] level-5: foodModifier: 2.00 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [GOLDEN_APPLE,GOLDEN_CARROT,BAKED_POTATO,BEETROOT,BEETROOT_SOUP, - BREAD,CARROT,MUSHROOM_STEW,APPLE,CHORUS_FRUIT,DRIED_KELP,MELON_SLICE, - POTATO,PUMPKIN_PIE,COOKIE,HONEY_BOTTLE,SWEET_BERRIES] + affected-itemList: [ GOLDEN_APPLE,GOLDEN_CARROT,BAKED_POTATO,BEETROOT,BEETROOT_SOUP, + BREAD,CARROT,MUSHROOM_STEW,APPLE,CHORUS_FRUIT,DRIED_KELP,MELON_SLICE, + POTATO,PUMPKIN_PIE,COOKIE,HONEY_BOTTLE,SWEET_BERRIES ] skill-4: #Carnivore enabled: true #Change this to false to disable this skill from working level-1: foodModifier: 1.20 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [COOKED_MUTTON,COOKED_PORKCHOP,COOKED_BEEF,COOKED_CHICKEN,COOKED_RABBIT, - RABBIT_STEW,BEEF,MUTTON,PORKCHOP,RABBIT,CHICKEN,ROTTEN_FLESH] + affected-itemList: [ COOKED_MUTTON,COOKED_PORKCHOP,COOKED_BEEF,COOKED_CHICKEN,COOKED_RABBIT, + RABBIT_STEW,BEEF,MUTTON,PORKCHOP,RABBIT,CHICKEN,ROTTEN_FLESH ] level-2: foodModifier: 1.40 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [COOKED_MUTTON,COOKED_PORKCHOP,COOKED_BEEF,COOKED_CHICKEN,COOKED_RABBIT, - RABBIT_STEW,BEEF,MUTTON,PORKCHOP,RABBIT,CHICKEN,ROTTEN_FLESH] + affected-itemList: [ COOKED_MUTTON,COOKED_PORKCHOP,COOKED_BEEF,COOKED_CHICKEN,COOKED_RABBIT, + RABBIT_STEW,BEEF,MUTTON,PORKCHOP,RABBIT,CHICKEN,ROTTEN_FLESH ] level-3: foodModifier: 1.60 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [COOKED_MUTTON,COOKED_PORKCHOP,COOKED_BEEF,COOKED_CHICKEN,COOKED_RABBIT, - RABBIT_STEW,BEEF,MUTTON,PORKCHOP,RABBIT,CHICKEN,ROTTEN_FLESH] + affected-itemList: [ COOKED_MUTTON,COOKED_PORKCHOP,COOKED_BEEF,COOKED_CHICKEN,COOKED_RABBIT, + RABBIT_STEW,BEEF,MUTTON,PORKCHOP,RABBIT,CHICKEN,ROTTEN_FLESH ] level-4: foodModifier: 1.80 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [COOKED_MUTTON,COOKED_PORKCHOP,COOKED_BEEF,COOKED_CHICKEN,COOKED_RABBIT, - RABBIT_STEW,BEEF,MUTTON,PORKCHOP,RABBIT,CHICKEN,ROTTEN_FLESH] + affected-itemList: [ COOKED_MUTTON,COOKED_PORKCHOP,COOKED_BEEF,COOKED_CHICKEN,COOKED_RABBIT, + RABBIT_STEW,BEEF,MUTTON,PORKCHOP,RABBIT,CHICKEN,ROTTEN_FLESH ] level-5: foodModifier: 2.00 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [COOKED_MUTTON,COOKED_PORKCHOP,COOKED_BEEF,COOKED_CHICKEN,COOKED_RABBIT, - RABBIT_STEW,BEEF,MUTTON,PORKCHOP,RABBIT,CHICKEN,ROTTEN_FLESH] + affected-itemList: [ COOKED_MUTTON,COOKED_PORKCHOP,COOKED_BEEF,COOKED_CHICKEN,COOKED_RABBIT, + RABBIT_STEW,BEEF,MUTTON,PORKCHOP,RABBIT,CHICKEN,ROTTEN_FLESH ] skill-5: #Green Thumb enabled: true #Change this to false to disable this skill from working level-1: @@ -842,37 +848,37 @@ farming: skill-6: #Growth Hormones enabled: true #Change this to false to disable this skill from working level-1: - affected-itemList: [SUGAR] #Items that can be used to active that growth Hormones Ability + affected-itemList: [ SUGAR ] #Items that can be used to active that growth Hormones Ability skill-7: #One with Nature enabled: true #Change this to false to disable this skill from working level-1: # Blocks that activate One with nature when stood on # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Blocks that are not spelled correctly or do not exist in the current minecraft version are ignored - affected-blockList: [GRASS_BLOCK] + affected-blockList: [ GRASS_BLOCK ] # Each buff that will be given with the level and duration. You must provide the potion effect spelled correctly. Select from this list: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html # Format: [ {EffectName}, {Level (Integer)}, {Duration (Decimal)}, {Delay (optional), {probability (default == 1)} ] # Note: effectChance is the chance that the perk activates, while the probabilities in effectsGiven are the chance that particular # effect is added (given that the perk activated). effectChance: 1.0 effectsGiven: - - [effect: REGENERATION, level: 1, duration: 3, delay: 0.0, prob: 1.0] #Example of how to use delay and prob + - [ effect: REGENERATION, level: 1, duration: 3, delay: 0.0, prob: 1.0 ] #Example of how to use delay and prob refreshTimer: 2.0 #Number of seconds to between server checks to give the buff fishing: passive-1: #Super Bait enabled: true #Change this to false to disable this passive skill from working startingValue: 1.0 #Starting duration in seconds - allowedRange: [0.0, INF] #The allowed range of durations, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of durations, (INF or -INF represent positive and negative infinity) changePerLevel: 0.01 #Number of seconds the duration increases each level passive-2: #Double catches enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) changePerLevel: 0.0005 #Increase in probability each level passive-3: #Treasure Finder enabled: true #Change this to false to disable this passive skill from working startingValue: 0.10 #Starting probability - allowedRange: [0.0, 0.25] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 0.25 ] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) changePerLevel: -0.00005 #Decrease in probability each level skill-1: #Rob enabled: true #Change this to false to disable this skill from working @@ -889,64 +895,64 @@ fishing: # The weight only matters if there are multiple drops for a single mob # To add multiple drops for a mob, list the mob multiple times with the different associated drops mobDropTable: - - [mob: BLAZE, drop: BLAZE_ROD, amount: 1, exp: 300] - - [mob: GHAST, drop: GHAST_TEAR, amount: 1, exp: 300] - - [mob: GHAST, drop: GUNPOWDER, amount: 1, exp: 300] - - [mob: ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 375, weight: 98 ] - - [mob: ZOMBIE, drop: ZOMBIE_HEAD, amount: 1, exp: 375, weight: 2 ] - - [mob: SPIDER, drop: STRING, amount: 1, exp: 375] - - [mob: SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375] - - [mob: CAVE_SPIDER, drop: STRING, amount: 1, exp: 375] - - [mob: CAVE_SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375] - - [mob: PIG, drop: PORKCHOP, amount: 1, exp: 240] - - [mob: CREEPER, drop: GUNPOWDER, amount: 1, exp: 375, weight: 98 ] - - [mob: CREEPER, drop: CREEPER_HEAD, amount: 1, exp: 375, weight: 2 ] - - [mob: CHICKEN, drop: EGG, amount: 1, exp: 240] - - [mob: CHICKEN, drop: CHICKEN, amount: 1, exp: 240] - - [mob: CHICKEN, drop: FEATHER, amount: 1, exp: 240] - - [mob: SKELETON, drop: BONE, amount: 1, exp: 375, weight: 150] - - [mob: SKELETON, drop: ARROW, amount: 1, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: ARROW, amount: 2, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: ARROW, amount: 3, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: SKELETON_SKULL, amount: 1, exp: 375, weight: 3 ] - - [mob: WITHER_SKELETON, drop: BONE, amount: 1, exp: 400, weight: 150] - - [mob: WITHER_SKELETON, drop: COAL, amount: 1, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: COAL, amount: 2, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: COAL, amount: 3, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: WITHER_SKELETON_SKULL, amount: 1, exp: 400, weight: 3 ] - - [mob: SLIME, drop: SLIME_BALL, amount: 1, exp: 300] - - [mob: MAGMA_CUBE, drop: MAGMA_CUBE, amount: 1, exp: 375] - - [mob: COW, drop: LEATHER, amount: 1, exp: 240, weight: 49 ] - - [mob: COW, drop: BEEF, amount: 1, exp: 240, weight: 49 ] - - [mob: COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 2 ] - - [mob: MUSHROOM_COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 5 ] - - [mob: MUSHROOM_COW, drop: MUSHROOM_STEW, amount: 1, exp: 240, weight: 5 ] - - [mob: MUSHROOM_COW, drop: LEATHER, amount: 1, exp: 240, weight: 30 ] - - [mob: MUSHROOM_COW, drop: BEEF, amount: 1, exp: 240, weight: 30 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 1, exp: 240, weight: 10 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 2, exp: 240, weight: 10 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 3, exp: 240, weight: 10 ] - - [mob: ENDERMAN, drop: ENDER_PEARL, amount: 1, exp: 375] - - [mob: SHEEP, drop: WHITE_WOOL, amount: 1, exp: 240] - - [mob: IRON_GOLEM, drop: PUMPKIN, amount: 1, exp: 300, weight: 3 ] - - [mob: IRON_GOLEM, drop: IRON_INGOT, amount: 1, exp: 300, weight: 12 ] - - [mob: IRON_GOLEM, drop: POPPY, amount: 1, exp: 300, weight: 85 ] - - [mob: SNOWMAN, drop: PUMPKIN, amount: 1, exp: 240, weight: 3 ] - - [mob: SNOWMAN, drop: SNOWBALL, amount: 1, exp: 240, weight: 97 ] - - [mob: SHULKER, drop: SHULKER_SHELL, amount: 1, exp: 300, weight: 25 ] - - [mob: SHULKER, drop: PURPUR_BLOCK, amount: 1, exp: 300, weight: 75 ] - - [mob: ZOMBIFIED_PIGLIN, drop: ROTTEN_FLESH, amount: 1, exp: 300] - - [mob: ZOMBIFIED_PIGLIN, drop: GOLD_NUGGET, amount: 1, exp: 300] - - [mob: PIG_ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 300] # 1.15 Zombie Pigman - - [mob: PIG_ZOMBIE, drop: GOLD_NUGGET, amount: 1, exp: 300] # 1.15 Zombie Pigman - - [mob: WITCH, drop: GLASS_BOTTLE, amount: 1, exp: 300] - - [mob: WITCH, drop: SUGAR, amount: 1, exp: 300] - - [mob: WITCH, drop: SPIDER_EYE, amount: 1, exp: 300] - - [mob: WITCH, drop: GUNPOWDER, amount: 1, exp: 300] - - [mob: WITCH, drop: FERMENTED_SPIDER_EYE, amount: 1, exp: 300] - - [mob: WITCH, drop: GLOWSTONE_DUST, amount: 1, exp: 300] - - [mob: WITCH, drop: REDSTONE, amount: 1, exp: 300] - - [mob: WITCH, drop: STICK, amount: 1, exp: 300] + - [ mob: BLAZE, drop: BLAZE_ROD, amount: 1, exp: 300 ] + - [ mob: GHAST, drop: GHAST_TEAR, amount: 1, exp: 300 ] + - [ mob: GHAST, drop: GUNPOWDER, amount: 1, exp: 300 ] + - [ mob: ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 375, weight: 98 ] + - [ mob: ZOMBIE, drop: ZOMBIE_HEAD, amount: 1, exp: 375, weight: 2 ] + - [ mob: SPIDER, drop: STRING, amount: 1, exp: 375 ] + - [ mob: SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375 ] + - [ mob: CAVE_SPIDER, drop: STRING, amount: 1, exp: 375 ] + - [ mob: CAVE_SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375 ] + - [ mob: PIG, drop: PORKCHOP, amount: 1, exp: 240 ] + - [ mob: CREEPER, drop: GUNPOWDER, amount: 1, exp: 375, weight: 98 ] + - [ mob: CREEPER, drop: CREEPER_HEAD, amount: 1, exp: 375, weight: 2 ] + - [ mob: CHICKEN, drop: EGG, amount: 1, exp: 240 ] + - [ mob: CHICKEN, drop: CHICKEN, amount: 1, exp: 240 ] + - [ mob: CHICKEN, drop: FEATHER, amount: 1, exp: 240 ] + - [ mob: SKELETON, drop: BONE, amount: 1, exp: 375, weight: 150 ] + - [ mob: SKELETON, drop: ARROW, amount: 1, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: ARROW, amount: 2, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: ARROW, amount: 3, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: SKELETON_SKULL, amount: 1, exp: 375, weight: 3 ] + - [ mob: WITHER_SKELETON, drop: BONE, amount: 1, exp: 400, weight: 150 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 1, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 2, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 3, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: WITHER_SKELETON_SKULL, amount: 1, exp: 400, weight: 3 ] + - [ mob: SLIME, drop: SLIME_BALL, amount: 1, exp: 300 ] + - [ mob: MAGMA_CUBE, drop: MAGMA_CUBE, amount: 1, exp: 375 ] + - [ mob: COW, drop: LEATHER, amount: 1, exp: 240, weight: 49 ] + - [ mob: COW, drop: BEEF, amount: 1, exp: 240, weight: 49 ] + - [ mob: COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 2 ] + - [ mob: MUSHROOM_COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 5 ] + - [ mob: MUSHROOM_COW, drop: MUSHROOM_STEW, amount: 1, exp: 240, weight: 5 ] + - [ mob: MUSHROOM_COW, drop: LEATHER, amount: 1, exp: 240, weight: 30 ] + - [ mob: MUSHROOM_COW, drop: BEEF, amount: 1, exp: 240, weight: 30 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 1, exp: 240, weight: 10 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 2, exp: 240, weight: 10 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 3, exp: 240, weight: 10 ] + - [ mob: ENDERMAN, drop: ENDER_PEARL, amount: 1, exp: 375 ] + - [ mob: SHEEP, drop: WHITE_WOOL, amount: 1, exp: 240 ] + - [ mob: IRON_GOLEM, drop: PUMPKIN, amount: 1, exp: 300, weight: 3 ] + - [ mob: IRON_GOLEM, drop: IRON_INGOT, amount: 1, exp: 300, weight: 12 ] + - [ mob: IRON_GOLEM, drop: POPPY, amount: 1, exp: 300, weight: 85 ] + - [ mob: SNOWMAN, drop: PUMPKIN, amount: 1, exp: 240, weight: 3 ] + - [ mob: SNOWMAN, drop: SNOWBALL, amount: 1, exp: 240, weight: 97 ] + - [ mob: SHULKER, drop: SHULKER_SHELL, amount: 1, exp: 300, weight: 25 ] + - [ mob: SHULKER, drop: PURPUR_BLOCK, amount: 1, exp: 300, weight: 75 ] + - [ mob: ZOMBIFIED_PIGLIN, drop: ROTTEN_FLESH, amount: 1, exp: 300 ] + - [ mob: ZOMBIFIED_PIGLIN, drop: GOLD_NUGGET, amount: 1, exp: 300 ] + - [ mob: PIG_ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 300 ] # 1.15 Zombie Pigman + - [ mob: PIG_ZOMBIE, drop: GOLD_NUGGET, amount: 1, exp: 300 ] # 1.15 Zombie Pigman + - [ mob: WITCH, drop: GLASS_BOTTLE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: SUGAR, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: SPIDER_EYE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: GUNPOWDER, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: FERMENTED_SPIDER_EYE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: GLOWSTONE_DUST, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: REDSTONE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: STICK, amount: 1, exp: 300 ] level-2: robChance: 0.30 #Chance of Rob skill activating # Mobs rob applies to @@ -956,64 +962,64 @@ fishing: # Format: [{Entity Name},{Drop Name},{Amount},{experience gained},{probability weight (optional, default == 1)}] # To add multiple drops for a mob, list the mob multiple times with the different associated drops mobDropTable: - - [mob: BLAZE, drop: BLAZE_ROD, amount: 1, exp: 300] - - [mob: GHAST, drop: GHAST_TEAR, amount: 1, exp: 300] - - [mob: GHAST, drop: GUNPOWDER, amount: 1, exp: 300] - - [mob: ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 375, weight: 98 ] - - [mob: ZOMBIE, drop: ZOMBIE_HEAD, amount: 1, exp: 375, weight: 2 ] - - [mob: SPIDER, drop: STRING, amount: 1, exp: 375] - - [mob: SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375] - - [mob: CAVE_SPIDER, drop: STRING, amount: 1, exp: 375] - - [mob: CAVE_SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375] - - [mob: PIG, drop: PORKCHOP, amount: 1, exp: 240] - - [mob: CREEPER, drop: GUNPOWDER, amount: 1, exp: 375, weight: 98 ] - - [mob: CREEPER, drop: CREEPER_HEAD, amount: 1, exp: 375, weight: 2 ] - - [mob: CHICKEN, drop: EGG, amount: 1, exp: 240] - - [mob: CHICKEN, drop: CHICKEN, amount: 1, exp: 240] - - [mob: CHICKEN, drop: FEATHER, amount: 1, exp: 240] - - [mob: SKELETON, drop: BONE, amount: 1, exp: 375, weight: 150] - - [mob: SKELETON, drop: ARROW, amount: 1, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: ARROW, amount: 2, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: ARROW, amount: 3, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: SKELETON_SKULL, amount: 1, exp: 375, weight: 3 ] - - [mob: WITHER_SKELETON, drop: BONE, amount: 1, exp: 400, weight: 150] - - [mob: WITHER_SKELETON, drop: COAL, amount: 1, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: COAL, amount: 2, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: COAL, amount: 3, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: WITHER_SKELETON_SKULL, amount: 1, exp: 400, weight: 3 ] - - [mob: SLIME, drop: SLIME_BALL, amount: 1, exp: 300] - - [mob: MAGMA_CUBE, drop: MAGMA_CUBE, amount: 1, exp: 375] - - [mob: COW, drop: LEATHER, amount: 1, exp: 240, weight: 49 ] - - [mob: COW, drop: BEEF, amount: 1, exp: 240, weight: 49 ] - - [mob: COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 2 ] - - [mob: MUSHROOM_COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 5 ] - - [mob: MUSHROOM_COW, drop: MUSHROOM_STEW, amount: 1, exp: 240, weight: 5 ] - - [mob: MUSHROOM_COW, drop: LEATHER, amount: 1, exp: 240, weight: 30 ] - - [mob: MUSHROOM_COW, drop: BEEF, amount: 1, exp: 240, weight: 30 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 1, exp: 240, weight: 10 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 2, exp: 240, weight: 10 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 3, exp: 240, weight: 10 ] - - [mob: ENDERMAN, drop: ENDER_PEARL, amount: 1, exp: 375] - - [mob: SHEEP, drop: WHITE_WOOL, amount: 1, exp: 240] - - [mob: IRON_GOLEM, drop: PUMPKIN, amount: 1, exp: 300, weight: 3 ] - - [mob: IRON_GOLEM, drop: IRON_INGOT, amount: 1, exp: 300, weight: 12 ] - - [mob: IRON_GOLEM, drop: POPPY, amount: 1, exp: 300, weight: 85 ] - - [mob: SNOWMAN, drop: PUMPKIN, amount: 1, exp: 240, weight: 3 ] - - [mob: SNOWMAN, drop: SNOWBALL, amount: 1, exp: 240, weight: 97 ] - - [mob: SHULKER, drop: SHULKER_SHELL, amount: 1, exp: 300, weight: 25 ] - - [mob: SHULKER, drop: PURPUR_BLOCK, amount: 1, exp: 300, weight: 75 ] - - [mob: ZOMBIFIED_PIGLIN, drop: ROTTEN_FLESH, amount: 1, exp: 300] - - [mob: ZOMBIFIED_PIGLIN, drop: GOLD_NUGGET, amount: 1, exp: 300] - - [mob: PIG_ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 300] # 1.15 Zombie Pigman - - [mob: PIG_ZOMBIE, drop: GOLD_NUGGET, amount: 1, exp: 300] # 1.15 Zombie Pigman - - [mob: WITCH, drop: GLASS_BOTTLE, amount: 1, exp: 300] - - [mob: WITCH, drop: SUGAR, amount: 1, exp: 300] - - [mob: WITCH, drop: SPIDER_EYE, amount: 1, exp: 300] - - [mob: WITCH, drop: GUNPOWDER, amount: 1, exp: 300] - - [mob: WITCH, drop: FERMENTED_SPIDER_EYE, amount: 1, exp: 300] - - [mob: WITCH, drop: GLOWSTONE_DUST, amount: 1, exp: 300] - - [mob: WITCH, drop: REDSTONE, amount: 1, exp: 300] - - [mob: WITCH, drop: STICK, amount: 1, exp: 300] + - [ mob: BLAZE, drop: BLAZE_ROD, amount: 1, exp: 300 ] + - [ mob: GHAST, drop: GHAST_TEAR, amount: 1, exp: 300 ] + - [ mob: GHAST, drop: GUNPOWDER, amount: 1, exp: 300 ] + - [ mob: ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 375, weight: 98 ] + - [ mob: ZOMBIE, drop: ZOMBIE_HEAD, amount: 1, exp: 375, weight: 2 ] + - [ mob: SPIDER, drop: STRING, amount: 1, exp: 375 ] + - [ mob: SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375 ] + - [ mob: CAVE_SPIDER, drop: STRING, amount: 1, exp: 375 ] + - [ mob: CAVE_SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375 ] + - [ mob: PIG, drop: PORKCHOP, amount: 1, exp: 240 ] + - [ mob: CREEPER, drop: GUNPOWDER, amount: 1, exp: 375, weight: 98 ] + - [ mob: CREEPER, drop: CREEPER_HEAD, amount: 1, exp: 375, weight: 2 ] + - [ mob: CHICKEN, drop: EGG, amount: 1, exp: 240 ] + - [ mob: CHICKEN, drop: CHICKEN, amount: 1, exp: 240 ] + - [ mob: CHICKEN, drop: FEATHER, amount: 1, exp: 240 ] + - [ mob: SKELETON, drop: BONE, amount: 1, exp: 375, weight: 150 ] + - [ mob: SKELETON, drop: ARROW, amount: 1, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: ARROW, amount: 2, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: ARROW, amount: 3, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: SKELETON_SKULL, amount: 1, exp: 375, weight: 3 ] + - [ mob: WITHER_SKELETON, drop: BONE, amount: 1, exp: 400, weight: 150 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 1, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 2, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 3, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: WITHER_SKELETON_SKULL, amount: 1, exp: 400, weight: 3 ] + - [ mob: SLIME, drop: SLIME_BALL, amount: 1, exp: 300 ] + - [ mob: MAGMA_CUBE, drop: MAGMA_CUBE, amount: 1, exp: 375 ] + - [ mob: COW, drop: LEATHER, amount: 1, exp: 240, weight: 49 ] + - [ mob: COW, drop: BEEF, amount: 1, exp: 240, weight: 49 ] + - [ mob: COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 2 ] + - [ mob: MUSHROOM_COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 5 ] + - [ mob: MUSHROOM_COW, drop: MUSHROOM_STEW, amount: 1, exp: 240, weight: 5 ] + - [ mob: MUSHROOM_COW, drop: LEATHER, amount: 1, exp: 240, weight: 30 ] + - [ mob: MUSHROOM_COW, drop: BEEF, amount: 1, exp: 240, weight: 30 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 1, exp: 240, weight: 10 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 2, exp: 240, weight: 10 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 3, exp: 240, weight: 10 ] + - [ mob: ENDERMAN, drop: ENDER_PEARL, amount: 1, exp: 375 ] + - [ mob: SHEEP, drop: WHITE_WOOL, amount: 1, exp: 240 ] + - [ mob: IRON_GOLEM, drop: PUMPKIN, amount: 1, exp: 300, weight: 3 ] + - [ mob: IRON_GOLEM, drop: IRON_INGOT, amount: 1, exp: 300, weight: 12 ] + - [ mob: IRON_GOLEM, drop: POPPY, amount: 1, exp: 300, weight: 85 ] + - [ mob: SNOWMAN, drop: PUMPKIN, amount: 1, exp: 240, weight: 3 ] + - [ mob: SNOWMAN, drop: SNOWBALL, amount: 1, exp: 240, weight: 97 ] + - [ mob: SHULKER, drop: SHULKER_SHELL, amount: 1, exp: 300, weight: 25 ] + - [ mob: SHULKER, drop: PURPUR_BLOCK, amount: 1, exp: 300, weight: 75 ] + - [ mob: ZOMBIFIED_PIGLIN, drop: ROTTEN_FLESH, amount: 1, exp: 300 ] + - [ mob: ZOMBIFIED_PIGLIN, drop: GOLD_NUGGET, amount: 1, exp: 300 ] + - [ mob: PIG_ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 300 ] # 1.15 Zombie Pigman + - [ mob: PIG_ZOMBIE, drop: GOLD_NUGGET, amount: 1, exp: 300 ] # 1.15 Zombie Pigman + - [ mob: WITCH, drop: GLASS_BOTTLE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: SUGAR, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: SPIDER_EYE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: GUNPOWDER, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: FERMENTED_SPIDER_EYE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: GLOWSTONE_DUST, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: REDSTONE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: STICK, amount: 1, exp: 300 ] level-3: robChance: 0.45 #Chance of Rob skill activating # Mobs rob applies to @@ -1023,64 +1029,64 @@ fishing: # Format: [{Entity Name},{Drop Name},{Amount},{experience gained},{probability weight (optional, default == 1)}] # To add multiple drops for a mob, list the mob multiple times with the different associated drops mobDropTable: - - [mob: BLAZE, drop: BLAZE_ROD, amount: 1, exp: 300] - - [mob: GHAST, drop: GHAST_TEAR, amount: 1, exp: 300] - - [mob: GHAST, drop: GUNPOWDER, amount: 1, exp: 300] - - [mob: ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 375, weight: 98 ] - - [mob: ZOMBIE, drop: ZOMBIE_HEAD, amount: 1, exp: 375, weight: 2 ] - - [mob: SPIDER, drop: STRING, amount: 1, exp: 375] - - [mob: SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375] - - [mob: CAVE_SPIDER, drop: STRING, amount: 1, exp: 375] - - [mob: CAVE_SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375] - - [mob: PIG, drop: PORKCHOP, amount: 1, exp: 240] - - [mob: CREEPER, drop: GUNPOWDER, amount: 1, exp: 375, weight: 98 ] - - [mob: CREEPER, drop: CREEPER_HEAD, amount: 1, exp: 375, weight: 2 ] - - [mob: CHICKEN, drop: EGG, amount: 1, exp: 240] - - [mob: CHICKEN, drop: CHICKEN, amount: 1, exp: 240] - - [mob: CHICKEN, drop: FEATHER, amount: 1, exp: 240] - - [mob: SKELETON, drop: BONE, amount: 1, exp: 375, weight: 150] - - [mob: SKELETON, drop: ARROW, amount: 1, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: ARROW, amount: 2, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: ARROW, amount: 3, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: SKELETON_SKULL, amount: 1, exp: 375, weight: 3 ] - - [mob: WITHER_SKELETON, drop: BONE, amount: 1, exp: 400, weight: 150] - - [mob: WITHER_SKELETON, drop: COAL, amount: 1, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: COAL, amount: 2, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: COAL, amount: 3, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: WITHER_SKELETON_SKULL, amount: 1, exp: 400, weight: 3 ] - - [mob: SLIME, drop: SLIME_BALL, amount: 1, exp: 300] - - [mob: MAGMA_CUBE, drop: MAGMA_CUBE, amount: 1, exp: 375] - - [mob: COW, drop: LEATHER, amount: 1, exp: 240, weight: 49 ] - - [mob: COW, drop: BEEF, amount: 1, exp: 240, weight: 49 ] - - [mob: COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 2 ] - - [mob: MUSHROOM_COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 5 ] - - [mob: MUSHROOM_COW, drop: MUSHROOM_STEW, amount: 1, exp: 240, weight: 5 ] - - [mob: MUSHROOM_COW, drop: LEATHER, amount: 1, exp: 240, weight: 30 ] - - [mob: MUSHROOM_COW, drop: BEEF, amount: 1, exp: 240, weight: 30 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 1, exp: 240, weight: 10 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 2, exp: 240, weight: 10 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 3, exp: 240, weight: 10 ] - - [mob: ENDERMAN, drop: ENDER_PEARL, amount: 1, exp: 375] - - [mob: SHEEP, drop: WHITE_WOOL, amount: 1, exp: 240] - - [mob: IRON_GOLEM, drop: PUMPKIN, amount: 1, exp: 300, weight: 3 ] - - [mob: IRON_GOLEM, drop: IRON_INGOT, amount: 1, exp: 300, weight: 12 ] - - [mob: IRON_GOLEM, drop: POPPY, amount: 1, exp: 300, weight: 85 ] - - [mob: SNOWMAN, drop: PUMPKIN, amount: 1, exp: 240, weight: 3 ] - - [mob: SNOWMAN, drop: SNOWBALL, amount: 1, exp: 240, weight: 97 ] - - [mob: SHULKER, drop: SHULKER_SHELL, amount: 1, exp: 300, weight: 25 ] - - [mob: SHULKER, drop: PURPUR_BLOCK, amount: 1, exp: 300, weight: 75 ] - - [mob: ZOMBIFIED_PIGLIN, drop: ROTTEN_FLESH, amount: 1, exp: 300] - - [mob: ZOMBIFIED_PIGLIN, drop: GOLD_NUGGET, amount: 1, exp: 300] - - [mob: PIG_ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 300] # 1.15 Zombie Pigman - - [mob: PIG_ZOMBIE, drop: GOLD_NUGGET, amount: 1, exp: 300] # 1.15 Zombie Pigman - - [mob: WITCH, drop: GLASS_BOTTLE, amount: 1, exp: 300] - - [mob: WITCH, drop: SUGAR, amount: 1, exp: 300] - - [mob: WITCH, drop: SPIDER_EYE, amount: 1, exp: 300] - - [mob: WITCH, drop: GUNPOWDER, amount: 1, exp: 300] - - [mob: WITCH, drop: FERMENTED_SPIDER_EYE, amount: 1, exp: 300] - - [mob: WITCH, drop: GLOWSTONE_DUST, amount: 1, exp: 300] - - [mob: WITCH, drop: REDSTONE, amount: 1, exp: 300] - - [mob: WITCH, drop: STICK, amount: 1, exp: 300] + - [ mob: BLAZE, drop: BLAZE_ROD, amount: 1, exp: 300 ] + - [ mob: GHAST, drop: GHAST_TEAR, amount: 1, exp: 300 ] + - [ mob: GHAST, drop: GUNPOWDER, amount: 1, exp: 300 ] + - [ mob: ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 375, weight: 98 ] + - [ mob: ZOMBIE, drop: ZOMBIE_HEAD, amount: 1, exp: 375, weight: 2 ] + - [ mob: SPIDER, drop: STRING, amount: 1, exp: 375 ] + - [ mob: SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375 ] + - [ mob: CAVE_SPIDER, drop: STRING, amount: 1, exp: 375 ] + - [ mob: CAVE_SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375 ] + - [ mob: PIG, drop: PORKCHOP, amount: 1, exp: 240 ] + - [ mob: CREEPER, drop: GUNPOWDER, amount: 1, exp: 375, weight: 98 ] + - [ mob: CREEPER, drop: CREEPER_HEAD, amount: 1, exp: 375, weight: 2 ] + - [ mob: CHICKEN, drop: EGG, amount: 1, exp: 240 ] + - [ mob: CHICKEN, drop: CHICKEN, amount: 1, exp: 240 ] + - [ mob: CHICKEN, drop: FEATHER, amount: 1, exp: 240 ] + - [ mob: SKELETON, drop: BONE, amount: 1, exp: 375, weight: 150 ] + - [ mob: SKELETON, drop: ARROW, amount: 1, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: ARROW, amount: 2, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: ARROW, amount: 3, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: SKELETON_SKULL, amount: 1, exp: 375, weight: 3 ] + - [ mob: WITHER_SKELETON, drop: BONE, amount: 1, exp: 400, weight: 150 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 1, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 2, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 3, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: WITHER_SKELETON_SKULL, amount: 1, exp: 400, weight: 3 ] + - [ mob: SLIME, drop: SLIME_BALL, amount: 1, exp: 300 ] + - [ mob: MAGMA_CUBE, drop: MAGMA_CUBE, amount: 1, exp: 375 ] + - [ mob: COW, drop: LEATHER, amount: 1, exp: 240, weight: 49 ] + - [ mob: COW, drop: BEEF, amount: 1, exp: 240, weight: 49 ] + - [ mob: COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 2 ] + - [ mob: MUSHROOM_COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 5 ] + - [ mob: MUSHROOM_COW, drop: MUSHROOM_STEW, amount: 1, exp: 240, weight: 5 ] + - [ mob: MUSHROOM_COW, drop: LEATHER, amount: 1, exp: 240, weight: 30 ] + - [ mob: MUSHROOM_COW, drop: BEEF, amount: 1, exp: 240, weight: 30 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 1, exp: 240, weight: 10 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 2, exp: 240, weight: 10 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 3, exp: 240, weight: 10 ] + - [ mob: ENDERMAN, drop: ENDER_PEARL, amount: 1, exp: 375 ] + - [ mob: SHEEP, drop: WHITE_WOOL, amount: 1, exp: 240 ] + - [ mob: IRON_GOLEM, drop: PUMPKIN, amount: 1, exp: 300, weight: 3 ] + - [ mob: IRON_GOLEM, drop: IRON_INGOT, amount: 1, exp: 300, weight: 12 ] + - [ mob: IRON_GOLEM, drop: POPPY, amount: 1, exp: 300, weight: 85 ] + - [ mob: SNOWMAN, drop: PUMPKIN, amount: 1, exp: 240, weight: 3 ] + - [ mob: SNOWMAN, drop: SNOWBALL, amount: 1, exp: 240, weight: 97 ] + - [ mob: SHULKER, drop: SHULKER_SHELL, amount: 1, exp: 300, weight: 25 ] + - [ mob: SHULKER, drop: PURPUR_BLOCK, amount: 1, exp: 300, weight: 75 ] + - [ mob: ZOMBIFIED_PIGLIN, drop: ROTTEN_FLESH, amount: 1, exp: 300 ] + - [ mob: ZOMBIFIED_PIGLIN, drop: GOLD_NUGGET, amount: 1, exp: 300 ] + - [ mob: PIG_ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 300 ] # 1.15 Zombie Pigman + - [ mob: PIG_ZOMBIE, drop: GOLD_NUGGET, amount: 1, exp: 300 ] # 1.15 Zombie Pigman + - [ mob: WITCH, drop: GLASS_BOTTLE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: SUGAR, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: SPIDER_EYE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: GUNPOWDER, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: FERMENTED_SPIDER_EYE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: GLOWSTONE_DUST, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: REDSTONE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: STICK, amount: 1, exp: 300 ] level-4: robChance: 0.60 #Chance of Rob skill activating # Mobs rob applies to @@ -1090,64 +1096,64 @@ fishing: # Format: [{Entity Name},{Drop Name},{Amount},{experience gained},{probability weight (optional, default == 1)}] # To add multiple drops for a mob, list the mob multiple times with the different associated drops mobDropTable: - - [mob: BLAZE, drop: BLAZE_ROD, amount: 1, exp: 300] - - [mob: GHAST, drop: GHAST_TEAR, amount: 1, exp: 300] - - [mob: GHAST, drop: GUNPOWDER, amount: 1, exp: 300] - - [mob: ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 375, weight: 98 ] - - [mob: ZOMBIE, drop: ZOMBIE_HEAD, amount: 1, exp: 375, weight: 2 ] - - [mob: SPIDER, drop: STRING, amount: 1, exp: 375] - - [mob: SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375] - - [mob: CAVE_SPIDER, drop: STRING, amount: 1, exp: 375] - - [mob: CAVE_SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375] - - [mob: PIG, drop: PORKCHOP, amount: 1, exp: 240] - - [mob: CREEPER, drop: GUNPOWDER, amount: 1, exp: 375, weight: 98 ] - - [mob: CREEPER, drop: CREEPER_HEAD, amount: 1, exp: 375, weight: 2 ] - - [mob: CHICKEN, drop: EGG, amount: 1, exp: 240] - - [mob: CHICKEN, drop: CHICKEN, amount: 1, exp: 240] - - [mob: CHICKEN, drop: FEATHER, amount: 1, exp: 240] - - [mob: SKELETON, drop: BONE, amount: 1, exp: 375, weight: 150] - - [mob: SKELETON, drop: ARROW, amount: 1, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: ARROW, amount: 2, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: ARROW, amount: 3, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: SKELETON_SKULL, amount: 1, exp: 375, weight: 3 ] - - [mob: WITHER_SKELETON, drop: BONE, amount: 1, exp: 400, weight: 150] - - [mob: WITHER_SKELETON, drop: COAL, amount: 1, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: COAL, amount: 2, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: COAL, amount: 3, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: WITHER_SKELETON_SKULL, amount: 1, exp: 400, weight: 3 ] - - [mob: SLIME, drop: SLIME_BALL, amount: 1, exp: 300] - - [mob: MAGMA_CUBE, drop: MAGMA_CUBE, amount: 1, exp: 375] - - [mob: COW, drop: LEATHER, amount: 1, exp: 240, weight: 49 ] - - [mob: COW, drop: BEEF, amount: 1, exp: 240, weight: 49 ] - - [mob: COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 2 ] - - [mob: MUSHROOM_COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 5 ] - - [mob: MUSHROOM_COW, drop: MUSHROOM_STEW, amount: 1, exp: 240, weight: 5 ] - - [mob: MUSHROOM_COW, drop: LEATHER, amount: 1, exp: 240, weight: 30 ] - - [mob: MUSHROOM_COW, drop: BEEF, amount: 1, exp: 240, weight: 30 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 1, exp: 240, weight: 10 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 2, exp: 240, weight: 10 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 3, exp: 240, weight: 10 ] - - [mob: ENDERMAN, drop: ENDER_PEARL, amount: 1, exp: 375] - - [mob: SHEEP, drop: WHITE_WOOL, amount: 1, exp: 240] - - [mob: IRON_GOLEM, drop: PUMPKIN, amount: 1, exp: 300, weight: 3 ] - - [mob: IRON_GOLEM, drop: IRON_INGOT, amount: 1, exp: 300, weight: 12 ] - - [mob: IRON_GOLEM, drop: POPPY, amount: 1, exp: 300, weight: 85 ] - - [mob: SNOWMAN, drop: PUMPKIN, amount: 1, exp: 240, weight: 3 ] - - [mob: SNOWMAN, drop: SNOWBALL, amount: 1, exp: 240, weight: 97 ] - - [mob: SHULKER, drop: SHULKER_SHELL, amount: 1, exp: 300, weight: 25 ] - - [mob: SHULKER, drop: PURPUR_BLOCK, amount: 1, exp: 300, weight: 75 ] - - [mob: ZOMBIFIED_PIGLIN, drop: ROTTEN_FLESH, amount: 1, exp: 300] - - [mob: ZOMBIFIED_PIGLIN, drop: GOLD_NUGGET, amount: 1, exp: 300] - - [mob: PIG_ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 300] # 1.15 Zombie Pigman - - [mob: PIG_ZOMBIE, drop: GOLD_NUGGET, amount: 1, exp: 300] # 1.15 Zombie Pigman - - [mob: WITCH, drop: GLASS_BOTTLE, amount: 1, exp: 300] - - [mob: WITCH, drop: SUGAR, amount: 1, exp: 300] - - [mob: WITCH, drop: SPIDER_EYE, amount: 1, exp: 300] - - [mob: WITCH, drop: GUNPOWDER, amount: 1, exp: 300] - - [mob: WITCH, drop: FERMENTED_SPIDER_EYE, amount: 1, exp: 300] - - [mob: WITCH, drop: GLOWSTONE_DUST, amount: 1, exp: 300] - - [mob: WITCH, drop: REDSTONE, amount: 1, exp: 300] - - [mob: WITCH, drop: STICK, amount: 1, exp: 300] + - [ mob: BLAZE, drop: BLAZE_ROD, amount: 1, exp: 300 ] + - [ mob: GHAST, drop: GHAST_TEAR, amount: 1, exp: 300 ] + - [ mob: GHAST, drop: GUNPOWDER, amount: 1, exp: 300 ] + - [ mob: ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 375, weight: 98 ] + - [ mob: ZOMBIE, drop: ZOMBIE_HEAD, amount: 1, exp: 375, weight: 2 ] + - [ mob: SPIDER, drop: STRING, amount: 1, exp: 375 ] + - [ mob: SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375 ] + - [ mob: CAVE_SPIDER, drop: STRING, amount: 1, exp: 375 ] + - [ mob: CAVE_SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375 ] + - [ mob: PIG, drop: PORKCHOP, amount: 1, exp: 240 ] + - [ mob: CREEPER, drop: GUNPOWDER, amount: 1, exp: 375, weight: 98 ] + - [ mob: CREEPER, drop: CREEPER_HEAD, amount: 1, exp: 375, weight: 2 ] + - [ mob: CHICKEN, drop: EGG, amount: 1, exp: 240 ] + - [ mob: CHICKEN, drop: CHICKEN, amount: 1, exp: 240 ] + - [ mob: CHICKEN, drop: FEATHER, amount: 1, exp: 240 ] + - [ mob: SKELETON, drop: BONE, amount: 1, exp: 375, weight: 150 ] + - [ mob: SKELETON, drop: ARROW, amount: 1, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: ARROW, amount: 2, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: ARROW, amount: 3, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: SKELETON_SKULL, amount: 1, exp: 375, weight: 3 ] + - [ mob: WITHER_SKELETON, drop: BONE, amount: 1, exp: 400, weight: 150 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 1, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 2, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 3, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: WITHER_SKELETON_SKULL, amount: 1, exp: 400, weight: 3 ] + - [ mob: SLIME, drop: SLIME_BALL, amount: 1, exp: 300 ] + - [ mob: MAGMA_CUBE, drop: MAGMA_CUBE, amount: 1, exp: 375 ] + - [ mob: COW, drop: LEATHER, amount: 1, exp: 240, weight: 49 ] + - [ mob: COW, drop: BEEF, amount: 1, exp: 240, weight: 49 ] + - [ mob: COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 2 ] + - [ mob: MUSHROOM_COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 5 ] + - [ mob: MUSHROOM_COW, drop: MUSHROOM_STEW, amount: 1, exp: 240, weight: 5 ] + - [ mob: MUSHROOM_COW, drop: LEATHER, amount: 1, exp: 240, weight: 30 ] + - [ mob: MUSHROOM_COW, drop: BEEF, amount: 1, exp: 240, weight: 30 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 1, exp: 240, weight: 10 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 2, exp: 240, weight: 10 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 3, exp: 240, weight: 10 ] + - [ mob: ENDERMAN, drop: ENDER_PEARL, amount: 1, exp: 375 ] + - [ mob: SHEEP, drop: WHITE_WOOL, amount: 1, exp: 240 ] + - [ mob: IRON_GOLEM, drop: PUMPKIN, amount: 1, exp: 300, weight: 3 ] + - [ mob: IRON_GOLEM, drop: IRON_INGOT, amount: 1, exp: 300, weight: 12 ] + - [ mob: IRON_GOLEM, drop: POPPY, amount: 1, exp: 300, weight: 85 ] + - [ mob: SNOWMAN, drop: PUMPKIN, amount: 1, exp: 240, weight: 3 ] + - [ mob: SNOWMAN, drop: SNOWBALL, amount: 1, exp: 240, weight: 97 ] + - [ mob: SHULKER, drop: SHULKER_SHELL, amount: 1, exp: 300, weight: 25 ] + - [ mob: SHULKER, drop: PURPUR_BLOCK, amount: 1, exp: 300, weight: 75 ] + - [ mob: ZOMBIFIED_PIGLIN, drop: ROTTEN_FLESH, amount: 1, exp: 300 ] + - [ mob: ZOMBIFIED_PIGLIN, drop: GOLD_NUGGET, amount: 1, exp: 300 ] + - [ mob: PIG_ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 300 ] # 1.15 Zombie Pigman + - [ mob: PIG_ZOMBIE, drop: GOLD_NUGGET, amount: 1, exp: 300 ] # 1.15 Zombie Pigman + - [ mob: WITCH, drop: GLASS_BOTTLE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: SUGAR, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: SPIDER_EYE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: GUNPOWDER, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: FERMENTED_SPIDER_EYE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: GLOWSTONE_DUST, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: REDSTONE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: STICK, amount: 1, exp: 300 ] level-5: robChance: 0.75 #Chance of Rob skill activating # Mobs rob applies to @@ -1157,297 +1163,298 @@ fishing: # Format: [{Entity Name},{Drop Name},{Amount},{experience gained},{probability weight (optional, default == 1)}] # To add multiple drops for a mob, list the mob multiple times with the different associated drops mobDropTable: - - [mob: BLAZE, drop: BLAZE_ROD, amount: 1, exp: 300] - - [mob: GHAST, drop: GHAST_TEAR, amount: 1, exp: 300] - - [mob: GHAST, drop: GUNPOWDER, amount: 1, exp: 300] - - [mob: ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 375, weight: 98 ] - - [mob: ZOMBIE, drop: ZOMBIE_HEAD, amount: 1, exp: 375, weight: 2 ] - - [mob: SPIDER, drop: STRING, amount: 1, exp: 375] - - [mob: SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375] - - [mob: CAVE_SPIDER, drop: STRING, amount: 1, exp: 375] - - [mob: CAVE_SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375] - - [mob: PIG, drop: PORKCHOP, amount: 1, exp: 240] - - [mob: CREEPER, drop: GUNPOWDER, amount: 1, exp: 375, weight: 98 ] - - [mob: CREEPER, drop: CREEPER_HEAD, amount: 1, exp: 375, weight: 2 ] - - [mob: CHICKEN, drop: EGG, amount: 1, exp: 240] - - [mob: CHICKEN, drop: CHICKEN, amount: 1, exp: 240] - - [mob: CHICKEN, drop: FEATHER, amount: 1, exp: 240] - - [mob: SKELETON, drop: BONE, amount: 1, exp: 375, weight: 150] - - [mob: SKELETON, drop: ARROW, amount: 1, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: ARROW, amount: 2, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: ARROW, amount: 3, exp: 375, weight: 49 ] - - [mob: SKELETON, drop: SKELETON_SKULL, amount: 1, exp: 375, weight: 3 ] - - [mob: WITHER_SKELETON, drop: BONE, amount: 1, exp: 400, weight: 150] - - [mob: WITHER_SKELETON, drop: COAL, amount: 1, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: COAL, amount: 2, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: COAL, amount: 3, exp: 400, weight: 49 ] - - [mob: WITHER_SKELETON, drop: WITHER_SKELETON_SKULL, amount: 1, exp: 400, weight: 3 ] - - [mob: SLIME, drop: SLIME_BALL, amount: 1, exp: 300] - - [mob: MAGMA_CUBE, drop: MAGMA_CUBE, amount: 1, exp: 375] - - [mob: COW, drop: LEATHER, amount: 1, exp: 240, weight: 49 ] - - [mob: COW, drop: BEEF, amount: 1, exp: 240, weight: 49 ] - - [mob: COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 2 ] - - [mob: MUSHROOM_COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 5 ] - - [mob: MUSHROOM_COW, drop: MUSHROOM_STEW, amount: 1, exp: 240, weight: 5 ] - - [mob: MUSHROOM_COW, drop: LEATHER, amount: 1, exp: 240, weight: 30 ] - - [mob: MUSHROOM_COW, drop: BEEF, amount: 1, exp: 240, weight: 30 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 1, exp: 240, weight: 10 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 2, exp: 240, weight: 10 ] - - [mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 3, exp: 240, weight: 10 ] - - [mob: ENDERMAN, drop: ENDER_PEARL, amount: 1, exp: 375] - - [mob: SHEEP, drop: WHITE_WOOL, amount: 1, exp: 240] - - [mob: IRON_GOLEM, drop: PUMPKIN, amount: 1, exp: 300, weight: 3 ] - - [mob: IRON_GOLEM, drop: IRON_INGOT, amount: 1, exp: 300, weight: 12 ] - - [mob: IRON_GOLEM, drop: POPPY, amount: 1, exp: 300, weight: 85 ] - - [mob: SNOWMAN, drop: PUMPKIN, amount: 1, exp: 240, weight: 3 ] - - [mob: SNOWMAN, drop: SNOWBALL, amount: 1, exp: 240, weight: 97 ] - - [mob: SHULKER, drop: SHULKER_SHELL, amount: 1, exp: 300, weight: 25 ] - - [mob: SHULKER, drop: PURPUR_BLOCK, amount: 1, exp: 300, weight: 75 ] - - [mob: ZOMBIFIED_PIGLIN, drop: ROTTEN_FLESH, amount: 1, exp: 300] - - [mob: ZOMBIFIED_PIGLIN, drop: GOLD_NUGGET, amount: 1, exp: 300] - - [mob: PIG_ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 300] # 1.15 Zombie Pigman - - [mob: PIG_ZOMBIE, drop: GOLD_NUGGET, amount: 1, exp: 300] # 1.15 Zombie Pigman - - [mob: WITCH, drop: GLASS_BOTTLE, amount: 1, exp: 300] - - [mob: WITCH, drop: SUGAR, amount: 1, exp: 300] - - [mob: WITCH, drop: SPIDER_EYE, amount: 1, exp: 300] - - [mob: WITCH, drop: GUNPOWDER, amount: 1, exp: 300] - - [mob: WITCH, drop: FERMENTED_SPIDER_EYE, amount: 1, exp: 300] - - [mob: WITCH, drop: GLOWSTONE_DUST, amount: 1, exp: 300] - - [mob: WITCH, drop: REDSTONE, amount: 1, exp: 300] - - [mob: WITCH, drop: STICK, amount: 1, exp: 300] + - [ mob: BLAZE, drop: BLAZE_ROD, amount: 1, exp: 300 ] + - [ mob: GHAST, drop: GHAST_TEAR, amount: 1, exp: 300 ] + - [ mob: GHAST, drop: GUNPOWDER, amount: 1, exp: 300 ] + - [ mob: ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 375, weight: 98 ] + - [ mob: ZOMBIE, drop: ZOMBIE_HEAD, amount: 1, exp: 375, weight: 2 ] + - [ mob: SPIDER, drop: STRING, amount: 1, exp: 375 ] + - [ mob: SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375 ] + - [ mob: CAVE_SPIDER, drop: STRING, amount: 1, exp: 375 ] + - [ mob: CAVE_SPIDER, drop: SPIDER_EYE, amount: 1, exp: 375 ] + - [ mob: PIG, drop: PORKCHOP, amount: 1, exp: 240 ] + - [ mob: CREEPER, drop: GUNPOWDER, amount: 1, exp: 375, weight: 98 ] + - [ mob: CREEPER, drop: CREEPER_HEAD, amount: 1, exp: 375, weight: 2 ] + - [ mob: CHICKEN, drop: EGG, amount: 1, exp: 240 ] + - [ mob: CHICKEN, drop: CHICKEN, amount: 1, exp: 240 ] + - [ mob: CHICKEN, drop: FEATHER, amount: 1, exp: 240 ] + - [ mob: SKELETON, drop: BONE, amount: 1, exp: 375, weight: 150 ] + - [ mob: SKELETON, drop: ARROW, amount: 1, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: ARROW, amount: 2, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: ARROW, amount: 3, exp: 375, weight: 49 ] + - [ mob: SKELETON, drop: SKELETON_SKULL, amount: 1, exp: 375, weight: 3 ] + - [ mob: WITHER_SKELETON, drop: BONE, amount: 1, exp: 400, weight: 150 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 1, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 2, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: COAL, amount: 3, exp: 400, weight: 49 ] + - [ mob: WITHER_SKELETON, drop: WITHER_SKELETON_SKULL, amount: 1, exp: 400, weight: 3 ] + - [ mob: SLIME, drop: SLIME_BALL, amount: 1, exp: 300 ] + - [ mob: MAGMA_CUBE, drop: MAGMA_CUBE, amount: 1, exp: 375 ] + - [ mob: COW, drop: LEATHER, amount: 1, exp: 240, weight: 49 ] + - [ mob: COW, drop: BEEF, amount: 1, exp: 240, weight: 49 ] + - [ mob: COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 2 ] + - [ mob: MUSHROOM_COW, drop: MILK_BUCKET, amount: 1, exp: 240, weight: 5 ] + - [ mob: MUSHROOM_COW, drop: MUSHROOM_STEW, amount: 1, exp: 240, weight: 5 ] + - [ mob: MUSHROOM_COW, drop: LEATHER, amount: 1, exp: 240, weight: 30 ] + - [ mob: MUSHROOM_COW, drop: BEEF, amount: 1, exp: 240, weight: 30 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 1, exp: 240, weight: 10 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 2, exp: 240, weight: 10 ] + - [ mob: MUSHROOM_COW, drop: RED_MUSHROOM, amount: 3, exp: 240, weight: 10 ] + - [ mob: ENDERMAN, drop: ENDER_PEARL, amount: 1, exp: 375 ] + - [ mob: SHEEP, drop: WHITE_WOOL, amount: 1, exp: 240 ] + - [ mob: IRON_GOLEM, drop: PUMPKIN, amount: 1, exp: 300, weight: 3 ] + - [ mob: IRON_GOLEM, drop: IRON_INGOT, amount: 1, exp: 300, weight: 12 ] + - [ mob: IRON_GOLEM, drop: POPPY, amount: 1, exp: 300, weight: 85 ] + - [ mob: SNOWMAN, drop: PUMPKIN, amount: 1, exp: 240, weight: 3 ] + - [ mob: SNOWMAN, drop: SNOWBALL, amount: 1, exp: 240, weight: 97 ] + - [ mob: SHULKER, drop: SHULKER_SHELL, amount: 1, exp: 300, weight: 25 ] + - [ mob: SHULKER, drop: PURPUR_BLOCK, amount: 1, exp: 300, weight: 75 ] + - [ mob: ZOMBIFIED_PIGLIN, drop: ROTTEN_FLESH, amount: 1, exp: 300 ] + - [ mob: ZOMBIFIED_PIGLIN, drop: GOLD_NUGGET, amount: 1, exp: 300 ] + - [ mob: PIG_ZOMBIE, drop: ROTTEN_FLESH, amount: 1, exp: 300 ] # 1.15 Zombie Pigman + - [ mob: PIG_ZOMBIE, drop: GOLD_NUGGET, amount: 1, exp: 300 ] # 1.15 Zombie Pigman + - [ mob: WITCH, drop: GLASS_BOTTLE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: SUGAR, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: SPIDER_EYE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: GUNPOWDER, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: FERMENTED_SPIDER_EYE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: GLOWSTONE_DUST, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: REDSTONE, amount: 1, exp: 300 ] + - [ mob: WITCH, drop: STICK, amount: 1, exp: 300 ] skill-2: #Scavenger enabled: true #Change this to false to disable this skill from working level-1: baseChance: 0.045 #Base probability of tier being rolled (from any catch) # Fill in the drop table with custom items dropTable: - - [drop: ENDER_PEARL, amount: 1, exp: 2500, weight: 88] - - [drop: GHAST_TEAR, amount: 1, exp: 2500, weight: 88] - - [drop: GOLD_INGOT, amount: 1, exp: 2500, weight: 88] - - [drop: IRON_INGOT, amount: 1, exp: 2500, weight: 88] - - [drop: STONE_SHOVEL, amount: 1, exp: 2500, weight: 10, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: STONE_SWORD, amount: 1, exp: 2500, weight: 10, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: STONE_AXE, amount: 1, exp: 2500, weight: 10, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: STONE_PICKAXE, amount: 1, exp: 2500, weight: 10, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: LEATHER_BOOTS, amount: 1, exp: 2500, weight: 10, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: LEATHER_LEGGINGS, amount: 1, exp: 2500, weight: 10, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: LEATHER_CHESTPLATE, amount: 1, exp: 2500, weight: 10, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: LEATHER_HELMET, amount: 1, exp: 2500, weight: 10, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: IRON_SHOVEL, amount: 1, exp: 2500, weight: 1, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: IRON_SWORD, amount: 1, exp: 2500, weight: 1, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: IRON_AXE, amount: 1, exp: 2500, weight: 1, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: IRON_PICKAXE, amount: 1, exp: 2500, weight: 1, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: IRON_BOOTS, amount: 1, exp: 2500, weight: 1, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: IRON_LEGGINGS, amount: 1, exp: 2500, weight: 1, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: IRON_CHESTPLATE, amount: 1, exp: 2500, weight: 1, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] - - [drop: IRON_HELMET, amount: 1, exp: 2500, weight: 1, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 1,upper: 3, isTreasure: false]] + - [ drop: ENDER_PEARL, amount: 1, exp: 2500, weight: 88 ] + - [ drop: GHAST_TEAR, amount: 1, exp: 2500, weight: 88 ] + - [ drop: GOLD_INGOT, amount: 1, exp: 2500, weight: 88 ] + - [ drop: IRON_INGOT, amount: 1, exp: 2500, weight: 88 ] + - [ drop: STONE_SHOVEL, amount: 1, exp: 2500, weight: 10, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: STONE_SWORD, amount: 1, exp: 2500, weight: 10, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: STONE_AXE, amount: 1, exp: 2500, weight: 10, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: STONE_PICKAXE, amount: 1, exp: 2500, weight: 10, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: LEATHER_BOOTS, amount: 1, exp: 2500, weight: 10, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: LEATHER_LEGGINGS, amount: 1, exp: 2500, weight: 10, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: LEATHER_CHESTPLATE, amount: 1, exp: 2500, weight: 10, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: LEATHER_HELMET, amount: 1, exp: 2500, weight: 10, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: IRON_SHOVEL, amount: 1, exp: 2500, weight: 1, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: IRON_SWORD, amount: 1, exp: 2500, weight: 1, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: IRON_AXE, amount: 1, exp: 2500, weight: 1, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: IRON_PICKAXE, amount: 1, exp: 2500, weight: 1, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: IRON_BOOTS, amount: 1, exp: 2500, weight: 1, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: IRON_LEGGINGS, amount: 1, exp: 2500, weight: 1, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: IRON_CHESTPLATE, amount: 1, exp: 2500, weight: 1, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] + - [ drop: IRON_HELMET, amount: 1, exp: 2500, weight: 1, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 1,upper: 3, isTreasure: false ] ] level-2: baseChance: 0.025 #Base probability of tier being rolled (from any catch) # Fill in the drop table with custom items dropTable: - - [drop: WET_SPONGE, amount: 1, exp: 3000, weight: 132] - - [drop: EMERALD, amount: 1, exp: 3000, weight: 132] - - [drop: SLIME_BALL, amount: 1, exp: 3000, weight: 132] - - [drop: ENDER_PEARL, amount: 2, exp: 3000, weight: 33] - - [drop: ENDER_PEARL, amount: 3, exp: 3000, weight: 33] - - [drop: ENDER_PEARL, amount: 4, exp: 3000, weight: 33] - - [drop: ENDER_PEARL, amount: 5, exp: 3000, weight: 33] - - [drop: STONE_SHOVEL, amount: 1, exp: 3000, weight: 10, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: STONE_SWORD, amount: 1, exp: 3000, weight: 10, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: STONE_AXE, amount: 1, exp: 3000, weight: 10, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: STONE_PICKAXE, amount: 1, exp: 3000, weight: 10, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: LEATHER_BOOTS, amount: 1, exp: 3000, weight: 10, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: LEATHER_LEGGINGS, amount: 1, exp: 3000, weight: 10, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: LEATHER_CHESTPLATE, amount: 1, exp: 3000, weight: 10, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: LEATHER_HELMET, amount: 1, exp: 3000, weight: 10, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: IRON_SHOVEL, amount: 1, exp: 3000, weight: 6, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: IRON_SWORD, amount: 1, exp: 3000, weight: 6, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: IRON_AXE, amount: 1, exp: 3000, weight: 6, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: IRON_PICKAXE, amount: 1, exp: 3000, weight: 6, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: IRON_BOOTS, amount: 1, exp: 3000, weight: 6, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: IRON_LEGGINGS, amount: 1, exp: 3000, weight: 4, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: IRON_CHESTPLATE, amount: 1, exp: 3000, weight: 4, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: IRON_HELMET, amount: 1, exp: 3000, weight: 6, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 19,upper: 28, isTreasure: false]] - - [drop: GOLDEN_BOOTS, amount: 1, exp: 3000, weight: 2, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: GOLDEN_LEGGINGS, amount: 1, exp: 3000, weight: 2, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: GOLDEN_CHESTPLATE, amount: 1, exp: 3000, weight: 2, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] - - [drop: GOLDEN_HELMET, amount: 1, exp: 3000, weight: 2, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 10,upper: 19, isTreasure: false]] + - [ drop: WET_SPONGE, amount: 1, exp: 3000, weight: 132 ] + - [ drop: EMERALD, amount: 1, exp: 3000, weight: 132 ] + - [ drop: SLIME_BALL, amount: 1, exp: 3000, weight: 132 ] + - [ drop: ENDER_PEARL, amount: 2, exp: 3000, weight: 33 ] + - [ drop: ENDER_PEARL, amount: 3, exp: 3000, weight: 33 ] + - [ drop: ENDER_PEARL, amount: 4, exp: 3000, weight: 33 ] + - [ drop: ENDER_PEARL, amount: 5, exp: 3000, weight: 33 ] + - [ drop: STONE_SHOVEL, amount: 1, exp: 3000, weight: 10, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: STONE_SWORD, amount: 1, exp: 3000, weight: 10, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: STONE_AXE, amount: 1, exp: 3000, weight: 10, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: STONE_PICKAXE, amount: 1, exp: 3000, weight: 10, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: LEATHER_BOOTS, amount: 1, exp: 3000, weight: 10, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: LEATHER_LEGGINGS, amount: 1, exp: 3000, weight: 10, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: LEATHER_CHESTPLATE, amount: 1, exp: 3000, weight: 10, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: LEATHER_HELMET, amount: 1, exp: 3000, weight: 10, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: IRON_SHOVEL, amount: 1, exp: 3000, weight: 6, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: IRON_SWORD, amount: 1, exp: 3000, weight: 6, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: IRON_AXE, amount: 1, exp: 3000, weight: 6, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: IRON_PICKAXE, amount: 1, exp: 3000, weight: 6, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: IRON_BOOTS, amount: 1, exp: 3000, weight: 6, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: IRON_LEGGINGS, amount: 1, exp: 3000, weight: 4, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: IRON_CHESTPLATE, amount: 1, exp: 3000, weight: 4, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: IRON_HELMET, amount: 1, exp: 3000, weight: 6, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 19,upper: 28, isTreasure: false ] ] + - [ drop: GOLDEN_BOOTS, amount: 1, exp: 3000, weight: 2, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: GOLDEN_LEGGINGS, amount: 1, exp: 3000, weight: 2, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: GOLDEN_CHESTPLATE, amount: 1, exp: 3000, weight: 2, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] + - [ drop: GOLDEN_HELMET, amount: 1, exp: 3000, weight: 2, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 10,upper: 19, isTreasure: false ] ] level-3: baseChance: 0.015 #Base probability of tier being rolled (from any catch) # Fill in the drop table with custom items dropTable: - - [drop: MUSIC_DISC_STAL, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_MELLOHI, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_FAR, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_CHIRP, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_CAT, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_BLOCKS, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_11, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_MALL, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_WAIT, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_WARD, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_STRAD, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_13, amount: 1, exp: 3500, weight: 84 ] - - [drop: MUSIC_DISC_PIGSTEP, amount: 1, exp: 3500, weight: 84 ] - - [drop: CHAINMAIL_BOOTS, amount: 1, exp: 3500, weight: 273 ] - - [drop: CHAINMAIL_CHESTPLATE, amount: 1, exp: 3500, weight: 273 ] - - [drop: CHAINMAIL_HELMET, amount: 1, exp: 3500, weight: 273 ] - - [drop: CHAINMAIL_LEGGINGS, amount: 1, exp: 3500, weight: 273 ] - - [drop: SPECTRAL_ARROW, amount: 3, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 4, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 5, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 6, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 7, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 8, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 9, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 10, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 11, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 12, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 13, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 14, exp: 3500, weight: 84 ] - - [drop: SPECTRAL_ARROW, amount: 15, exp: 3500, weight: 84 ] - - [drop: TRIDENT, amount: 15, exp: 3500, weight: 1092] - - [drop: STONE_SHOVEL, amount: 1, exp: 3500, weight: 13, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: STONE_SWORD, amount: 1, exp: 3500, weight: 13, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: STONE_AXE, amount: 1, exp: 3500, weight: 13, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: STONE_PICKAXE, amount: 1, exp: 3500, weight: 13, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: LEATHER_BOOTS, amount: 1, exp: 3500, weight: 13, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: LEATHER_LEGGINGS, amount: 1, exp: 3500, weight: 13, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: LEATHER_CHESTPLATE, amount: 1, exp: 3500, weight: 13, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: LEATHER_HELMET, amount: 1, exp: 3500, weight: 13, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: IRON_SHOVEL, amount: 1, exp: 3500, weight: 91, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: IRON_SWORD, amount: 1, exp: 3500, weight: 91, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: IRON_AXE, amount: 1, exp: 3500, weight: 91, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: IRON_PICKAXE, amount: 1, exp: 3500, weight: 91, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: IRON_BOOTS, amount: 1, exp: 3500, weight: 104, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: IRON_LEGGINGS, amount: 1, exp: 3500, weight: 78, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: IRON_CHESTPLATE, amount: 1, exp: 3500, weight: 78, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: IRON_HELMET, amount: 1, exp: 3500, weight: 104, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: GOLDEN_BOOTS, amount: 1, exp: 3500, weight: 52, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: GOLDEN_LEGGINGS, amount: 1, exp: 3500, weight: 26, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: GOLDEN_CHESTPLATE, amount: 1, exp: 3500, weight: 26, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: GOLDEN_HELMET, amount: 1, exp: 3500, weight: 52, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: GOLDEN_SHOVEL, amount: 1, exp: 3500, weight: 26, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: GOLDEN_SWORD, amount: 1, exp: 3500, weight: 26, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: GOLDEN_AXE, amount: 1, exp: 3500, weight: 26, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] - - [drop: GOLDEN_PICKAXE, amount: 1, exp: 3500, weight: 26, durability: [lower: 0.00, upper: 0.85], enchantmentBounds: [lower: 19, upper: 28, isTreasure: false]] + - [ drop: MUSIC_DISC_STAL, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_MELLOHI, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_FAR, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_CHIRP, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_CAT, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_BLOCKS, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_11, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_MALL, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_WAIT, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_WARD, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_STRAD, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_13, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_PIGSTEP, amount: 1, exp: 3500, weight: 84 ] + - [ drop: MUSIC_DISC_OTHERSIDE, amount: 1, exp: 3500, weight: 84 ] + - [ drop: CHAINMAIL_BOOTS, amount: 1, exp: 3500, weight: 273 ] + - [ drop: CHAINMAIL_CHESTPLATE, amount: 1, exp: 3500, weight: 273 ] + - [ drop: CHAINMAIL_HELMET, amount: 1, exp: 3500, weight: 273 ] + - [ drop: CHAINMAIL_LEGGINGS, amount: 1, exp: 3500, weight: 273 ] + - [ drop: SPECTRAL_ARROW, amount: 3, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 4, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 5, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 6, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 7, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 8, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 9, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 10, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 11, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 12, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 13, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 14, exp: 3500, weight: 84 ] + - [ drop: SPECTRAL_ARROW, amount: 15, exp: 3500, weight: 84 ] + - [ drop: TRIDENT, amount: 15, exp: 3500, weight: 1092 ] + - [ drop: STONE_SHOVEL, amount: 1, exp: 3500, weight: 13, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: STONE_SWORD, amount: 1, exp: 3500, weight: 13, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: STONE_AXE, amount: 1, exp: 3500, weight: 13, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: STONE_PICKAXE, amount: 1, exp: 3500, weight: 13, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: LEATHER_BOOTS, amount: 1, exp: 3500, weight: 13, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: LEATHER_LEGGINGS, amount: 1, exp: 3500, weight: 13, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: LEATHER_CHESTPLATE, amount: 1, exp: 3500, weight: 13, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: LEATHER_HELMET, amount: 1, exp: 3500, weight: 13, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: IRON_SHOVEL, amount: 1, exp: 3500, weight: 91, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: IRON_SWORD, amount: 1, exp: 3500, weight: 91, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: IRON_AXE, amount: 1, exp: 3500, weight: 91, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: IRON_PICKAXE, amount: 1, exp: 3500, weight: 91, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: IRON_BOOTS, amount: 1, exp: 3500, weight: 104, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: IRON_LEGGINGS, amount: 1, exp: 3500, weight: 78, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: IRON_CHESTPLATE, amount: 1, exp: 3500, weight: 78, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: IRON_HELMET, amount: 1, exp: 3500, weight: 104, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: GOLDEN_BOOTS, amount: 1, exp: 3500, weight: 52, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: GOLDEN_LEGGINGS, amount: 1, exp: 3500, weight: 26, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: GOLDEN_CHESTPLATE, amount: 1, exp: 3500, weight: 26, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: GOLDEN_HELMET, amount: 1, exp: 3500, weight: 52, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: GOLDEN_SHOVEL, amount: 1, exp: 3500, weight: 26, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: GOLDEN_SWORD, amount: 1, exp: 3500, weight: 26, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: GOLDEN_AXE, amount: 1, exp: 3500, weight: 26, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] + - [ drop: GOLDEN_PICKAXE, amount: 1, exp: 3500, weight: 26, durability: [ lower: 0.00, upper: 0.85 ], enchantmentBounds: [ lower: 19, upper: 28, isTreasure: false ] ] level-4: baseChance: 0.010 #Base probability of tier being rolled (from any catch) # Fill in the drop table with custom items dropTable: - - [drop: DIAMOND, amount: 1, exp: 4500, weight: 498] - - [drop: NAUTILUS_SHELL, amount: 2, exp: 4500, weight: 166] - - [drop: NAUTILUS_SHELL, amount: 3, exp: 4500, weight: 166] - - [drop: NAUTILUS_SHELL, amount: 4, exp: 4500, weight: 166] - - [drop: EMERALD, amount: 3, exp: 4500, weight: 83 ] - - [drop: EMERALD, amount: 4, exp: 4500, weight: 83 ] - - [drop: EMERALD, amount: 5, exp: 4500, weight: 83 ] - - [drop: EMERALD, amount: 6, exp: 4500, weight: 83 ] - - [drop: EMERALD, amount: 7, exp: 4500, weight: 83 ] - - [drop: EMERALD, amount: 8, exp: 4500, weight: 83 ] - - [drop: CROSSBOW, amount: 1, exp: 4500, weight: 498, durability: [lower: 1.00,upper: 1.00], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false]] - - [drop: IRON_SHOVEL, amount: 1, exp: 4500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: IRON_SWORD, amount: 1, exp: 4500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: IRON_AXE, amount: 1, exp: 4500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: IRON_PICKAXE, amount: 1, exp: 4500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: IRON_BOOTS, amount: 1, exp: 4500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: IRON_LEGGINGS, amount: 1, exp: 4500, weight: 27, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: IRON_CHESTPLATE, amount: 1, exp: 4500, weight: 24, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: IRON_HELMET, amount: 1, exp: 4500, weight: 10, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: DIAMOND_BOOTS, amount: 1, exp: 4500, weight: 3, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: DIAMOND_HELMET, amount: 1, exp: 4500, weight: 3, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: DIAMOND_SHOVEL, amount: 1, exp: 4500, weight: 3, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: DIAMOND_SWORD, amount: 1, exp: 4500, weight: 3, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: DIAMOND_AXE, amount: 1, exp: 4500, weight: 3, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] - - [drop: DIAMOND_PICKAXE, amount: 1, exp: 4500, weight: 3, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 28,upper: 30, isTreasure: false]] + - [ drop: DIAMOND, amount: 1, exp: 4500, weight: 498 ] + - [ drop: NAUTILUS_SHELL, amount: 2, exp: 4500, weight: 166 ] + - [ drop: NAUTILUS_SHELL, amount: 3, exp: 4500, weight: 166 ] + - [ drop: NAUTILUS_SHELL, amount: 4, exp: 4500, weight: 166 ] + - [ drop: EMERALD, amount: 3, exp: 4500, weight: 83 ] + - [ drop: EMERALD, amount: 4, exp: 4500, weight: 83 ] + - [ drop: EMERALD, amount: 5, exp: 4500, weight: 83 ] + - [ drop: EMERALD, amount: 6, exp: 4500, weight: 83 ] + - [ drop: EMERALD, amount: 7, exp: 4500, weight: 83 ] + - [ drop: EMERALD, amount: 8, exp: 4500, weight: 83 ] + - [ drop: CROSSBOW, amount: 1, exp: 4500, weight: 498, durability: [ lower: 1.00,upper: 1.00 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ] ] + - [ drop: IRON_SHOVEL, amount: 1, exp: 4500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: IRON_SWORD, amount: 1, exp: 4500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: IRON_AXE, amount: 1, exp: 4500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: IRON_PICKAXE, amount: 1, exp: 4500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: IRON_BOOTS, amount: 1, exp: 4500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: IRON_LEGGINGS, amount: 1, exp: 4500, weight: 27, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: IRON_CHESTPLATE, amount: 1, exp: 4500, weight: 24, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: IRON_HELMET, amount: 1, exp: 4500, weight: 10, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: DIAMOND_BOOTS, amount: 1, exp: 4500, weight: 3, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: DIAMOND_HELMET, amount: 1, exp: 4500, weight: 3, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: DIAMOND_SHOVEL, amount: 1, exp: 4500, weight: 3, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: DIAMOND_SWORD, amount: 1, exp: 4500, weight: 3, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: DIAMOND_AXE, amount: 1, exp: 4500, weight: 3, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] + - [ drop: DIAMOND_PICKAXE, amount: 1, exp: 4500, weight: 3, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 28,upper: 30, isTreasure: false ] ] level-5: baseChance: 0.005 #Base probability of tier being rolled (from any catch) # Fill in the drop table with custom items dropTable: - - [drop: ELYTRA, amount: 1, exp: 6500, weight: 5760] - - [drop: HEART_OF_THE_SEA, amount: 1, exp: 6500, weight: 5760] - - [drop: TOTEM_OF_UNDYING, amount: 1, exp: 6500, weight: 5760] - - [drop: DIAMOND, amount: 2, exp: 6500, weight: 1440] - - [drop: DIAMOND, amount: 3, exp: 6500, weight: 1440] - - [drop: DIAMOND, amount: 4, exp: 6500, weight: 1440] - - [drop: DIAMOND, amount: 5, exp: 6500, weight: 1440] - - [drop: DIAMOND_SHOVEL, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - - [drop: DIAMOND_SHOVEL, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: DIAMOND_AXE, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - - [drop: DIAMOND_AXE, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: DIAMOND_PICKAXE, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - - [drop: DIAMOND_PICKAXE, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: SHARPNESS, level: 5]] ] - - [drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FIRE_ASPECT, level: 5]] ] - - [drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: LOOTING, level: 3]] ] - - [drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: SWEEPING, level: 3]] ] - - [drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - [drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 129, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FROST_WALKER, level: 2]] ] - - [drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: DEPTH_STRIDER, level: 2]] ] - - [drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FEATHER_FALLING, level: 4]] ] - - [drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: DIAMOND_LEGGINGS, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - [drop: DIAMOND_LEGGINGS, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - [drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: THORNS, level: 3]] ] - - [drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - [drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: RESPIRATION, level: 3]] ] - - [drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: AQUA_AFFINITY, level: 1]] ] - - [drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: IRON_SHOVEL, amount: 1, exp: 6500, weight: 60, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - - [drop: IRON_SHOVEL, amount: 1, exp: 6500, weight: 60, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: IRON_AXE, amount: 1, exp: 6500, weight: 60, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - - [drop: IRON_AXE, amount: 1, exp: 6500, weight: 60, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: IRON_PICKAXE, amount: 1, exp: 6500, weight: 60, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - - [drop: IRON_PICKAXE, amount: 1, exp: 6500, weight: 60, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: IRON_SWORD, amount: 1, exp: 6500, weight: 24, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: SHARPNESS, level: 5]] ] - - [drop: IRON_SWORD, amount: 1, exp: 6500, weight: 24, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FIRE_ASPECT, level: 5]] ] - - [drop: IRON_SWORD, amount: 1, exp: 6500, weight: 24, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: LOOTING, level: 3]] ] - - [drop: IRON_SWORD, amount: 1, exp: 6500, weight: 24, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: SWEEPING, level: 3]] ] - - [drop: IRON_SWORD, amount: 1, exp: 6500, weight: 24, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: IRON_BOOTS, amount: 1, exp: 6500, weight: 24, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - [drop: IRON_BOOTS, amount: 1, exp: 6500, weight: 24, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FROST_WALKER, level: 2]] ] - - [drop: IRON_BOOTS, amount: 1, exp: 6500, weight: 24, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: DEPTH_STRIDER, level: 2]] ] - - [drop: IRON_BOOTS, amount: 1, exp: 6500, weight: 24, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FEATHER_FALLING, level: 4]] ] - - [drop: IRON_BOOTS, amount: 1, exp: 6500, weight: 24, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: IRON_LEGGINGS, amount: 1, exp: 6500, weight: 60, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - [drop: IRON_LEGGINGS, amount: 1, exp: 6500, weight: 60, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: IRON_CHESTPLATE, amount: 1, exp: 6500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - [drop: IRON_CHESTPLATE, amount: 1, exp: 6500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: THORNS, level: 3]] ] - - [drop: IRON_CHESTPLATE, amount: 1, exp: 6500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - [drop: IRON_HELMET, amount: 1, exp: 6500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - [drop: IRON_HELMET, amount: 1, exp: 6500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: RESPIRATION, level: 3]] ] - - [drop: IRON_HELMET, amount: 1, exp: 6500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: AQUA_AFFINITY, level: 1]] ] - - [drop: IRON_HELMET, amount: 1, exp: 6500, weight: 30, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] + - [ drop: ELYTRA, amount: 1, exp: 6500, weight: 5760 ] + - [ drop: HEART_OF_THE_SEA, amount: 1, exp: 6500, weight: 5760 ] + - [ drop: TOTEM_OF_UNDYING, amount: 1, exp: 6500, weight: 5760 ] + - [ drop: DIAMOND, amount: 2, exp: 6500, weight: 1440 ] + - [ drop: DIAMOND, amount: 3, exp: 6500, weight: 1440 ] + - [ drop: DIAMOND, amount: 4, exp: 6500, weight: 1440 ] + - [ drop: DIAMOND, amount: 5, exp: 6500, weight: 1440 ] + - [ drop: DIAMOND_SHOVEL, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + - [ drop: DIAMOND_SHOVEL, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: DIAMOND_AXE, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + - [ drop: DIAMOND_AXE, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: DIAMOND_PICKAXE, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + - [ drop: DIAMOND_PICKAXE, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: SHARPNESS, level: 5 ] ] ] + - [ drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FIRE_ASPECT, level: 5 ] ] ] + - [ drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: LOOTING, level: 3 ] ] ] + - [ drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: SWEEPING, level: 3 ] ] ] + - [ drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - [ drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 129, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FROST_WALKER, level: 2 ] ] ] + - [ drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: DEPTH_STRIDER, level: 2 ] ] ] + - [ drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FEATHER_FALLING, level: 4 ] ] ] + - [ drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: DIAMOND_LEGGINGS, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - [ drop: DIAMOND_LEGGINGS, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - [ drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: THORNS, level: 3 ] ] ] + - [ drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - [ drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: RESPIRATION, level: 3 ] ] ] + - [ drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: AQUA_AFFINITY, level: 1 ] ] ] + - [ drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: IRON_SHOVEL, amount: 1, exp: 6500, weight: 60, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + - [ drop: IRON_SHOVEL, amount: 1, exp: 6500, weight: 60, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: IRON_AXE, amount: 1, exp: 6500, weight: 60, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + - [ drop: IRON_AXE, amount: 1, exp: 6500, weight: 60, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: IRON_PICKAXE, amount: 1, exp: 6500, weight: 60, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + - [ drop: IRON_PICKAXE, amount: 1, exp: 6500, weight: 60, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: IRON_SWORD, amount: 1, exp: 6500, weight: 24, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: SHARPNESS, level: 5 ] ] ] + - [ drop: IRON_SWORD, amount: 1, exp: 6500, weight: 24, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FIRE_ASPECT, level: 5 ] ] ] + - [ drop: IRON_SWORD, amount: 1, exp: 6500, weight: 24, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: LOOTING, level: 3 ] ] ] + - [ drop: IRON_SWORD, amount: 1, exp: 6500, weight: 24, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: SWEEPING, level: 3 ] ] ] + - [ drop: IRON_SWORD, amount: 1, exp: 6500, weight: 24, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: IRON_BOOTS, amount: 1, exp: 6500, weight: 24, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - [ drop: IRON_BOOTS, amount: 1, exp: 6500, weight: 24, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FROST_WALKER, level: 2 ] ] ] + - [ drop: IRON_BOOTS, amount: 1, exp: 6500, weight: 24, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: DEPTH_STRIDER, level: 2 ] ] ] + - [ drop: IRON_BOOTS, amount: 1, exp: 6500, weight: 24, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FEATHER_FALLING, level: 4 ] ] ] + - [ drop: IRON_BOOTS, amount: 1, exp: 6500, weight: 24, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: IRON_LEGGINGS, amount: 1, exp: 6500, weight: 60, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - [ drop: IRON_LEGGINGS, amount: 1, exp: 6500, weight: 60, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: IRON_CHESTPLATE, amount: 1, exp: 6500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - [ drop: IRON_CHESTPLATE, amount: 1, exp: 6500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: THORNS, level: 3 ] ] ] + - [ drop: IRON_CHESTPLATE, amount: 1, exp: 6500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - [ drop: IRON_HELMET, amount: 1, exp: 6500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - [ drop: IRON_HELMET, amount: 1, exp: 6500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: RESPIRATION, level: 3 ] ] ] + - [ drop: IRON_HELMET, amount: 1, exp: 6500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: AQUA_AFFINITY, level: 1 ] ] ] + - [ drop: IRON_HELMET, amount: 1, exp: 6500, weight: 30, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] skill-3: #Fisherman's diet enabled: true #Change this to false to disable this skill from working level-1: foodModifier: 1.20 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [COOKED_MUTTON,COOKED_COD,COD,SALMON,TROPICAL_FISH,PUFFERFISH,DRIED_KELP] + affected-itemList: [ COOKED_MUTTON,COOKED_COD,COD,SALMON,TROPICAL_FISH,PUFFERFISH,DRIED_KELP ] level-2: foodModifier: 1.40 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [COOKED_MUTTON,COOKED_COD,COD,SALMON,TROPICAL_FISH,PUFFERFISH,DRIED_KELP] + affected-itemList: [ COOKED_MUTTON,COOKED_COD,COD,SALMON,TROPICAL_FISH,PUFFERFISH,DRIED_KELP ] level-3: foodModifier: 1.60 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [COOKED_MUTTON,COOKED_COD,COD,SALMON,TROPICAL_FISH,PUFFERFISH,DRIED_KELP] + affected-itemList: [ COOKED_MUTTON,COOKED_COD,COD,SALMON,TROPICAL_FISH,PUFFERFISH,DRIED_KELP ] level-4: foodModifier: 1.80 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [COOKED_MUTTON,COOKED_COD,COD,SALMON,TROPICAL_FISH,PUFFERFISH,DRIED_KELP] + affected-itemList: [ COOKED_MUTTON,COOKED_COD,COD,SALMON,TROPICAL_FISH,PUFFERFISH,DRIED_KELP ] level-5: foodModifier: 2.00 #Effectiveness multiplier for food # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Food effected by food modifier - affected-itemList: [COOKED_MUTTON,COOKED_COD,COD,SALMON,TROPICAL_FISH,PUFFERFISH,DRIED_KELP] + affected-itemList: [ COOKED_MUTTON,COOKED_COD,COD,SALMON,TROPICAL_FISH,PUFFERFISH,DRIED_KELP ] skill-4: #Filtration #The configuration for this skill is fairly complicated because Filtration's effect depends on the level for Scavenger # The relative portion of probability taken from the decreasingTiers @@ -1476,60 +1483,60 @@ fishing: # The weight reflects how much of the probability each tier loses or gains # Format [{tier (1,2,3,4, or 5)}, {weight}] decreasingTiers: - - [tier: 1, weight: 1] + - [ tier: 1, weight: 1 ] increasingTiers: - - [tier: 2, weight: 5] - - [tier: 2, weight: 2] - - [tier: 2, weight: 2] - - [tier: 2, weight: 1] + - [ tier: 2, weight: 5 ] + - [ tier: 2, weight: 2 ] + - [ tier: 2, weight: 2 ] + - [ tier: 2, weight: 1 ] level-2: portionShifted: 0.444444 #The portion of the total probability of the decreasingTiers moved to Increasing Tiers #Where the probability is leaving and where it is going # The weight reflects how much of the probability each tier loses or gains # Format [{tier (1,2,3,4, or 5)}, {weight}] decreasingTiers: - - [tier: 1, weight: 1] + - [ tier: 1, weight: 1 ] increasingTiers: - - [tier: 2, weight: 5] - - [tier: 2, weight: 2] - - [tier: 2, weight: 2] - - [tier: 2, weight: 1] + - [ tier: 2, weight: 5 ] + - [ tier: 2, weight: 2 ] + - [ tier: 2, weight: 2 ] + - [ tier: 2, weight: 1 ] level-3: portionShifted: 0.555555 #The portion of the total probability of the decreasingTiers moved to Increasing Tiers #Where the probability is leaving and where it is going # The weight reflects how much of the probability each tier loses or gains # Format [{tier (1,2,3,4, or 5)}, {weight}] decreasingTiers: - - [tier: 1, weight: 1] + - [ tier: 1, weight: 1 ] increasingTiers: - - [tier: 2, weight: 10] - - [tier: 2, weight: 6] - - [tier: 2, weight: 6] - - [tier: 2, weight: 3] + - [ tier: 2, weight: 10 ] + - [ tier: 2, weight: 6 ] + - [ tier: 2, weight: 6 ] + - [ tier: 2, weight: 3 ] level-4: portionShifted: 0.666666 #The portion of the total probability of the decreasingTiers moved to Increasing Tiers #Where the probability is leaving and where it is going # The weight reflects how much of the probability each tier loses or gains # Format [{tier (1,2,3,4, or 5)}, {weight}] decreasingTiers: - - [tier: 1, weight: 1] + - [ tier: 1, weight: 1 ] increasingTiers: - - [tier: 2, weight: 10] - - [tier: 2, weight: 8] - - [tier: 2, weight: 8] - - [tier: 2, weight: 4] + - [ tier: 2, weight: 10 ] + - [ tier: 2, weight: 8 ] + - [ tier: 2, weight: 8 ] + - [ tier: 2, weight: 4 ] level-5: portionShifted: 0.777777 #The portion of the total probability of the decreasingTiers moved to Increasing Tiers #Where the probability is leaving and where it is going # The weight reflects how much of the probability each tier loses or gains # Format [{tier (1,2,3,4, or 5)}, {weight}] decreasingTiers: - - [tier: 1, weight: 1] + - [ tier: 1, weight: 1 ] increasingTiers: - - [tier: 2, weight: 10] - - [tier: 2, weight: 10] - - [tier: 2, weight: 10] - - [tier: 2, weight: 5] + - [ tier: 2, weight: 10 ] + - [ tier: 2, weight: 10 ] + - [ tier: 2, weight: 10 ] + - [ tier: 2, weight: 5 ] skill-5: #Grappling Hook enabled: true #Change this to false to disable this skill from working level-1: @@ -1550,122 +1557,122 @@ fishing: # Then, replace that drop here with another drop with a nonzero weight. # You can also replace drops listed in config.yml's fishing section dropChanges: - #Ender Pearls --> Fire Charge - - oldDrop: [drop: ENDER_PEARL, amount: 1, exp: 2500, weight: 88] - newDrop: [drop: FIRE_CHARGE, amount: 3, exp: 2750, weight: 33] - - oldDrop: [drop: ENDER_PEARL, amount: 2, exp: 3000, weight: 33] - newDrop: [drop: FIRE_CHARGE, amount: 6, exp: 3250, weight: 33] - - oldDrop: [drop: ENDER_PEARL, amount: 3, exp: 3000, weight: 33] - newDrop: [drop: FIRE_CHARGE, amount: 9, exp: 3250, weight: 33] - - oldDrop: [drop: ENDER_PEARL, amount: 4, exp: 3000, weight: 33] - newDrop: [drop: FIRE_CHARGE, amount: 12, exp: 3250, weight: 33] - - oldDrop: [drop: ENDER_PEARL, amount: 5, exp: 3000, weight: 33] - newDrop: [drop: FIRE_CHARGE, amount: 15, exp: 3250, weight: 33] + #Ender Pearls --> Fire Charge + - oldDrop: [ drop: ENDER_PEARL, amount: 1, exp: 2500, weight: 88 ] + newDrop: [ drop: FIRE_CHARGE, amount: 3, exp: 2750, weight: 33 ] + - oldDrop: [ drop: ENDER_PEARL, amount: 2, exp: 3000, weight: 33 ] + newDrop: [ drop: FIRE_CHARGE, amount: 6, exp: 3250, weight: 33 ] + - oldDrop: [ drop: ENDER_PEARL, amount: 3, exp: 3000, weight: 33 ] + newDrop: [ drop: FIRE_CHARGE, amount: 9, exp: 3250, weight: 33 ] + - oldDrop: [ drop: ENDER_PEARL, amount: 4, exp: 3000, weight: 33 ] + newDrop: [ drop: FIRE_CHARGE, amount: 12, exp: 3250, weight: 33 ] + - oldDrop: [ drop: ENDER_PEARL, amount: 5, exp: 3000, weight: 33 ] + newDrop: [ drop: FIRE_CHARGE, amount: 15, exp: 3250, weight: 33 ] #Wet Sponge --> Sponge - - oldDrop: [drop: WET_SPONGE, amount: 1, exp: 3000, weight: 132] - newDrop: [drop: SPONGE, amount: 1, exp: 3250, weight: 132] + - oldDrop: [ drop: WET_SPONGE, amount: 1, exp: 3000, weight: 132 ] + newDrop: [ drop: SPONGE, amount: 1, exp: 3250, weight: 132 ] #Slime balls --> Magma Cream - - oldDrop: [drop: SLIME_BALL, amount: 1, exp: 3000, weight: 132] - newDrop: [drop: MAGMA_CREAM, amount: 1, exp: 3250, weight: 132] + - oldDrop: [ drop: SLIME_BALL, amount: 1, exp: 3000, weight: 132 ] + newDrop: [ drop: MAGMA_CREAM, amount: 1, exp: 3250, weight: 132 ] #Ghast Tear --> Blaze Powder - - oldDrop: [drop: GHAST_TEAR, amount: 1, exp: 2500, weight: 88 ] - newDrop: [drop: BLAZE_POWDER, amount: 1, exp: 2750, weight: 88 ] + - oldDrop: [ drop: GHAST_TEAR, amount: 1, exp: 2500, weight: 88 ] + newDrop: [ drop: BLAZE_POWDER, amount: 1, exp: 2750, weight: 88 ] #Diamond --> Netherite Scrap - - oldDrop: [drop: DIAMOND, amount: 1, exp: 4500, weight: 498] - newDrop: [drop: NETHERITE_SCRAP, amount: 1, exp: 4750, weight: 498] - - oldDrop: [drop: DIAMOND, amount: 2, exp: 6500, weight: 1440] - newDrop: [drop: NETHERITE_SCRAP, amount: 2, exp: 6750, weight: 1440] - - oldDrop: [drop: DIAMOND, amount: 3, exp: 6500, weight: 1440] - newDrop: [drop: NETHERITE_SCRAP, amount: 3, exp: 6750, weight: 1440] - - oldDrop: [drop: DIAMOND, amount: 4, exp: 6500, weight: 1440] - newDrop: [drop: NETHERITE_SCRAP, amount: 4, exp: 6750, weight: 1440] - - oldDrop: [drop: DIAMOND, amount: 5, exp: 6500, weight: 1440] - newDrop: [drop: NETHERITE_SCRAP, amount: 5, exp: 6750, weight: 1440] + - oldDrop: [ drop: DIAMOND, amount: 1, exp: 4500, weight: 498 ] + newDrop: [ drop: NETHERITE_SCRAP, amount: 1, exp: 4750, weight: 498 ] + - oldDrop: [ drop: DIAMOND, amount: 2, exp: 6500, weight: 1440 ] + newDrop: [ drop: NETHERITE_SCRAP, amount: 2, exp: 6750, weight: 1440 ] + - oldDrop: [ drop: DIAMOND, amount: 3, exp: 6500, weight: 1440 ] + newDrop: [ drop: NETHERITE_SCRAP, amount: 3, exp: 6750, weight: 1440 ] + - oldDrop: [ drop: DIAMOND, amount: 4, exp: 6500, weight: 1440 ] + newDrop: [ drop: NETHERITE_SCRAP, amount: 4, exp: 6750, weight: 1440 ] + - oldDrop: [ drop: DIAMOND, amount: 5, exp: 6500, weight: 1440 ] + newDrop: [ drop: NETHERITE_SCRAP, amount: 5, exp: 6750, weight: 1440 ] #Diamond gear --> Netherite gear - - oldDrop: [drop: DIAMOND_SHOVEL, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - newDrop: [drop: NETHERITE_SHOVEL, amount: 1, exp: 7000, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - - oldDrop: [drop: DIAMOND_SHOVEL, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - newDrop: [drop: NETHERITE_SHOVEL, amount: 1, exp: 7000, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - oldDrop: [drop: DIAMOND_AXE, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - newDrop: [drop: NETHERITE_AXE, amount: 1, exp: 7000, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - - oldDrop: [drop: DIAMOND_AXE, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - newDrop: [drop: NETHERITE_AXE, amount: 1, exp: 7000, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - oldDrop: [drop: DIAMOND_PICKAXE, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - newDrop: [drop: NETHERITE_PICKAXE, amount: 1, exp: 7000, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: EFFICIENCY, level: 5]] ] - - oldDrop: [drop: DIAMOND_PICKAXE, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - newDrop: [drop: NETHERITE_PICKAXE, amount: 1, exp: 7000, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - oldDrop: [drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: SHARPNESS, level: 5]] ] - newDrop: [drop: NETHERITE_SWORD, amount: 1, exp: 7000, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: SHARPNESS, level: 5]] ] - - oldDrop: [drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FIRE_ASPECT, level: 5]] ] - newDrop: [drop: NETHERITE_SWORD, amount: 1, exp: 7000, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FIRE_ASPECT, level: 5]] ] - - oldDrop: [drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: LOOTING, level: 3]] ] - newDrop: [drop: NETHERITE_SWORD, amount: 1, exp: 7000, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: LOOTING, level: 3]] ] - - oldDrop: [drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: SWEEPING, level: 3]] ] - newDrop: [drop: NETHERITE_SWORD, amount: 1, exp: 7000, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: SWEEPING, level: 3]] ] - - oldDrop: [drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - newDrop: [drop: NETHERITE_SWORD, amount: 1, exp: 7000, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - oldDrop: [drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - newDrop: [drop: NETHERITE_BOOTS, amount: 1, exp: 7000, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - oldDrop: [drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 129, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FROST_WALKER, level: 2]] ] - newDrop: [drop: NETHERITE_BOOTS, amount: 1, exp: 7000, weight: 129, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FROST_WALKER, level: 2]] ] - - oldDrop: [drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: DEPTH_STRIDER, level: 2]] ] - newDrop: [drop: NETHERITE_BOOTS, amount: 1, exp: 7000, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: DEPTH_STRIDER, level: 2]] ] - - oldDrop: [drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FEATHER_FALLING, level: 4]] ] - newDrop: [drop: NETHERITE_BOOTS, amount: 1, exp: 7000, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: FEATHER_FALLING, level: 4]] ] - - oldDrop: [drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - newDrop: [drop: NETHERITE_BOOTS, amount: 1, exp: 7000, weight: 120, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - oldDrop: [drop: DIAMOND_LEGGINGS, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - newDrop: [drop: NETHERITE_LEGGINGS, amount: 1, exp: 7000, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - oldDrop: [drop: DIAMOND_LEGGINGS, amount: 1, exp: 6500, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - newDrop: [drop: NETHERITE_LEGGINGS, amount: 1, exp: 7000, weight: 300, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - oldDrop: [drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - newDrop: [drop: NETHERITE_CHESTPLATE, amount: 1, exp: 7000, weight: 200, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - oldDrop: [drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: THORNS, level: 3]] ] - newDrop: [drop: NETHERITE_CHESTPLATE, amount: 1, exp: 7000, weight: 200, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: THORNS, level: 3]] ] - - oldDrop: [drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - newDrop: [drop: NETHERITE_CHESTPLATE, amount: 1, exp: 7000, weight: 200, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - - oldDrop: [drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - newDrop: [drop: NETHERITE_HELMET, amount: 1, exp: 7000, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: PROTECTION, level: 4]] ] - - oldDrop: [drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: RESPIRATION, level: 3]] ] - newDrop: [drop: NETHERITE_HELMET, amount: 1, exp: 7000, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: RESPIRATION, level: 3]] ] - - oldDrop: [drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: AQUA_AFFINITY, level: 1]] ] - newDrop: [drop: NETHERITE_HELMET, amount: 1, exp: 7000, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: AQUA_AFFINITY, level: 1]] ] - - oldDrop: [drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] - newDrop: [drop: NETHERITE_HELMET, amount: 1, exp: 7000, weight: 150, durability: [lower: 0.00,upper: 0.85], enchantmentBounds: [lower: 30,upper: 30, isTreasure: false], staticEnchantments: [[enchant: MENDING, level: 1]] ] + - oldDrop: [ drop: DIAMOND_SHOVEL, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + newDrop: [ drop: NETHERITE_SHOVEL, amount: 1, exp: 7000, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + - oldDrop: [ drop: DIAMOND_SHOVEL, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + newDrop: [ drop: NETHERITE_SHOVEL, amount: 1, exp: 7000, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - oldDrop: [ drop: DIAMOND_AXE, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + newDrop: [ drop: NETHERITE_AXE, amount: 1, exp: 7000, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + - oldDrop: [ drop: DIAMOND_AXE, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + newDrop: [ drop: NETHERITE_AXE, amount: 1, exp: 7000, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - oldDrop: [ drop: DIAMOND_PICKAXE, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + newDrop: [ drop: NETHERITE_PICKAXE, amount: 1, exp: 7000, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: EFFICIENCY, level: 5 ] ] ] + - oldDrop: [ drop: DIAMOND_PICKAXE, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + newDrop: [ drop: NETHERITE_PICKAXE, amount: 1, exp: 7000, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - oldDrop: [ drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: SHARPNESS, level: 5 ] ] ] + newDrop: [ drop: NETHERITE_SWORD, amount: 1, exp: 7000, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: SHARPNESS, level: 5 ] ] ] + - oldDrop: [ drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FIRE_ASPECT, level: 5 ] ] ] + newDrop: [ drop: NETHERITE_SWORD, amount: 1, exp: 7000, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FIRE_ASPECT, level: 5 ] ] ] + - oldDrop: [ drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: LOOTING, level: 3 ] ] ] + newDrop: [ drop: NETHERITE_SWORD, amount: 1, exp: 7000, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: LOOTING, level: 3 ] ] ] + - oldDrop: [ drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: SWEEPING, level: 3 ] ] ] + newDrop: [ drop: NETHERITE_SWORD, amount: 1, exp: 7000, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: SWEEPING, level: 3 ] ] ] + - oldDrop: [ drop: DIAMOND_SWORD, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + newDrop: [ drop: NETHERITE_SWORD, amount: 1, exp: 7000, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - oldDrop: [ drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + newDrop: [ drop: NETHERITE_BOOTS, amount: 1, exp: 7000, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - oldDrop: [ drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 129, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FROST_WALKER, level: 2 ] ] ] + newDrop: [ drop: NETHERITE_BOOTS, amount: 1, exp: 7000, weight: 129, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FROST_WALKER, level: 2 ] ] ] + - oldDrop: [ drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: DEPTH_STRIDER, level: 2 ] ] ] + newDrop: [ drop: NETHERITE_BOOTS, amount: 1, exp: 7000, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: DEPTH_STRIDER, level: 2 ] ] ] + - oldDrop: [ drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FEATHER_FALLING, level: 4 ] ] ] + newDrop: [ drop: NETHERITE_BOOTS, amount: 1, exp: 7000, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: FEATHER_FALLING, level: 4 ] ] ] + - oldDrop: [ drop: DIAMOND_BOOTS, amount: 1, exp: 6500, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + newDrop: [ drop: NETHERITE_BOOTS, amount: 1, exp: 7000, weight: 120, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - oldDrop: [ drop: DIAMOND_LEGGINGS, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + newDrop: [ drop: NETHERITE_LEGGINGS, amount: 1, exp: 7000, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - oldDrop: [ drop: DIAMOND_LEGGINGS, amount: 1, exp: 6500, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + newDrop: [ drop: NETHERITE_LEGGINGS, amount: 1, exp: 7000, weight: 300, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - oldDrop: [ drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + newDrop: [ drop: NETHERITE_CHESTPLATE, amount: 1, exp: 7000, weight: 200, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - oldDrop: [ drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: THORNS, level: 3 ] ] ] + newDrop: [ drop: NETHERITE_CHESTPLATE, amount: 1, exp: 7000, weight: 200, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: THORNS, level: 3 ] ] ] + - oldDrop: [ drop: DIAMOND_CHESTPLATE, amount: 1, exp: 6500, weight: 200, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + newDrop: [ drop: NETHERITE_CHESTPLATE, amount: 1, exp: 7000, weight: 200, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + - oldDrop: [ drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + newDrop: [ drop: NETHERITE_HELMET, amount: 1, exp: 7000, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: PROTECTION, level: 4 ] ] ] + - oldDrop: [ drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: RESPIRATION, level: 3 ] ] ] + newDrop: [ drop: NETHERITE_HELMET, amount: 1, exp: 7000, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: RESPIRATION, level: 3 ] ] ] + - oldDrop: [ drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: AQUA_AFFINITY, level: 1 ] ] ] + newDrop: [ drop: NETHERITE_HELMET, amount: 1, exp: 7000, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: AQUA_AFFINITY, level: 1 ] ] ] + - oldDrop: [ drop: DIAMOND_HELMET, amount: 1, exp: 6500, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] + newDrop: [ drop: NETHERITE_HELMET, amount: 1, exp: 7000, weight: 150, durability: [ lower: 0.00,upper: 0.85 ], enchantmentBounds: [ lower: 30,upper: 30, isTreasure: false ], staticEnchantments: [ [ enchant: MENDING, level: 1 ] ] ] skill-7: #Fish Person enabled: true #Change this to false to disable this skill from working level-1: # Blocks that activate Fish person when the player is inside of them # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Blocks that are not spelled correctly or do not exist in the current minecraft version are ignored - affected-blockList: [WATER] + affected-blockList: [ WATER ] # Each buff that will be given with the level and duration. You must provide the potion effect spelled correctly. Select from this list: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html # Format: [ {EffectName}, {Level (Integer)}, {Duration (Decimal)}, {Delay (optional), {probability (default == 1)} ] # Note: effectChance is the chance that the perk activates, while the probabilities in effectsGiven are the chance that particular # effect is added (given that the perk activated). effectChance: 1.0 effectsGiven: - - [effect: DOLPHINS_GRACE, level: 1, duration: 15, delay: 0.0, prob: 1.0] #Example of how to use delay and prob - - [effect: NIGHT_VISION, level: 1, duration: 15] + - [ effect: DOLPHINS_GRACE, level: 1, duration: 15, delay: 0.0, prob: 1.0 ] #Example of how to use delay and prob + - [ effect: NIGHT_VISION, level: 1, duration: 15 ] refreshTimer: 2.0 #Number of seconds to between server checks to give the buff archery: passive-1: #Rapid Fire Duration enabled: true #Change this to false to disable this passive skill from working startingValue: 2.0 #Starting duration in seconds - allowedRange: [0.0, INF] #The allowed range of durations, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of durations, (INF or -INF represent positive and negative infinity) changePerLevel: 0.02 #Number of seconds the duration increases each level passive-2: #Retrieval enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) changePerLevel: 0.0005 #Increase in probability each level # Select between ARROW, SPECTRAL_ARROW, TIPPED_ARROW, and FIREWORK - affected-itemList: [ARROW,SPECTRAL_ARROW,TIPPED_ARROW] + affected-itemList: [ ARROW,SPECTRAL_ARROW,TIPPED_ARROW ] skill-1: #Extra Arrows enabled: true #Change this to false to disable this skill from working level-1: @@ -1736,13 +1743,13 @@ archery: # Select potion effects from this list https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html # Format: [{effect name}, {is extended ?}, {is upgraded ?}] uncraftable-potionDataList: - - [effect: SPEED, isExtended: true, isUpgraded: true] #This is an example. It will have no effect because no tipped arrow effect is extended and upgraded + - [ effect: SPEED, isExtended: true, isUpgraded: true ] #This is an example. It will have no effect because no tipped arrow effect is extended and upgraded skill-6: #Crossbow Rapid Load enabled: true #Change this to false to disable this skill from working level-1: # Arrows that the ability applies to # Select between ARROW, SPECTRAL_ARROW, TIPPED_ARROW, and FIREWORK - affected-itemList: [ARROw,SPECTRAL_ARROW,TIPPED_ARROW] + affected-itemList: [ ARROw,SPECTRAL_ARROW,TIPPED_ARROW ] skill-7: #Deadly Strike enabled: true #Change this to false to disable this skill from working level-1: @@ -1752,12 +1759,12 @@ beastMastery: passive-1: #Spur Kick Duration enabled: true #Change this to false to disable this passive skill from working startingValue: 2.0 #Starting duration in seconds - allowedRange: [0.0, INF] #The allowed range of durations, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of durations, (INF or -INF represent positive and negative infinity) changePerLevel: 0.02 #Number of seconds the duration increases each level passive-2: #Critical Bite enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of durations, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of durations, (INF or -INF represent positive and negative infinity) changePerLevel: 0.00025 #Increase in probability each level damageMultiplier: 1.5 #Damage multiplier on a critical hit skill-1: #Thick Fur @@ -1826,7 +1833,7 @@ beastMastery: skill-6: #Indentify enabled: true #Change this to false to disable this skill from working level-1: - affected_itemList: [COMPASS] #Items that will show a horse's stats when a horse is right clicked on with it + affected_itemList: [ COMPASS ] #Items that will show a horse's stats when a horse is right clicked on with it skill-7: #Adrenaline Boost enabled: true #Change this to false to disable this skill from working level-1: @@ -1836,18 +1843,18 @@ beastMastery: #Format: [ {EffectName}, {Level (Integer)}, {Static Duration}] #THis effect will either override or append to the buffs given by Spur Kick effectsAdded: - - [effect: SPEED, level: 3, durationAdded: 0.0, durationMultiplier: 1.0] + - [ effect: SPEED, level: 3, durationAdded: 0.0, durationMultiplier: 1.0 ] # - [effect: SPEED, level: 3, staticDuration: 10.0] (Example of how to use static duration) swordsmanship: passive-1: #Swift Strikes Duration enabled: true #Change this to false to disable this passive skill from working startingValue: 2.0 #Starting duration in seconds - allowedRange: [0.0, INF] #The allowed range of durations, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of durations, (INF or -INF represent positive and negative infinity) changePerLevel: 0.02 #Number of seconds the duration increases each level passive-2: #Double Hit enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting Probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) changePerLevel: 0.0002 #Increae in probability each level damageMultiplier: 0.5 #Proportion of damage the second hit does compared to the first knockbackMultiplier: 2.0 #Knockback multiplication once second hit is applied @@ -1860,23 +1867,23 @@ swordsmanship: level-1: effectChance: 1.0 effectsGiven: - - [effect: SPEED, level: 1, duration: 2, delay: 0.0, prob: 1.0] #Example of how to use delay and prob + - [ effect: SPEED, level: 1, duration: 2, delay: 0.0, prob: 1.0 ] #Example of how to use delay and prob level-2: effectChance: 1.0 effectsGiven: - - [effect: SPEED, level: 1, duration: 4] + - [ effect: SPEED, level: 1, duration: 4 ] level-3: effectChance: 1.0 effectsGiven: - - [effect: SPEED, level: 1, duration: 6] + - [ effect: SPEED, level: 1, duration: 6 ] level-4: effectChance: 1.0 effectsGiven: - - [effect: SPEED, level: 1, duration: 8] + - [ effect: SPEED, level: 1, duration: 8 ] level-5: effectChance: 1.0 effectsGiven: - - [effect: SPEED, level: 1, duration: 10] + - [ effect: SPEED, level: 1, duration: 10 ] skill-2: #Killing Spree enabled: true #Change this to false to disable this skill from working # Each buff that will be given with the level and duration. You must provide the potion effect spelled correctly. Select from this list: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html @@ -1886,23 +1893,23 @@ swordsmanship: level-1: effectChance: 1.0 effectsGiven: - - [effect: STRENGTH, level: 1, duration: 2, delay: 0.0, prob: 1.0] #Example of how to use delay and prob + - [ effect: STRENGTH, level: 1, duration: 2, delay: 0.0, prob: 1.0 ] #Example of how to use delay and prob level-2: effectChance: 1.0 effectsGiven: - - [effect: STRENGTH, level: 1, duration: 4] + - [ effect: STRENGTH, level: 1, duration: 4 ] level-3: effectChance: 1.0 effectsGiven: - - [effect: STRENGTH, level: 1, duration: 6] + - [ effect: STRENGTH, level: 1, duration: 6 ] level-4: effectChance: 1.0 effectsGiven: - - [effect: STRENGTH, level: 1, duration: 8] + - [ effect: STRENGTH, level: 1, duration: 8 ] level-5: effectChance: 1.0 effectsGiven: - - [effect: STRENGTH, level: 1, duration: 10] + - [ effect: STRENGTH, level: 1, duration: 10 ] skill-3: #Adrenaline+ enabled: true #Change this to false to disable this skill from working # Each buff that will be given with the level and duration. You must provide the potion effect spelled correctly. Select from this list: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html @@ -1914,19 +1921,19 @@ swordsmanship: # Effects with relativeDuration will always activate if the effect in adrenaline activated. Therefore there is no effectChance. level-1: effectsGiven: - - [effect: SPEED, level: 2, relativeDuration: 0.2] #Gives Speed II for 20% of the Speed I duration in Adrenaline + - [ effect: SPEED, level: 2, relativeDuration: 0.2 ] #Gives Speed II for 20% of the Speed I duration in Adrenaline level-2: effectsGiven: - - [effect: SPEED, level: 2, relativeDuration: 0.4] + - [ effect: SPEED, level: 2, relativeDuration: 0.4 ] level-3: effectsGiven: - - [effect: SPEED, level: 2, relativeDuration: 0.6] + - [ effect: SPEED, level: 2, relativeDuration: 0.6 ] level-4: effectsGiven: - - [effect: SPEED, level: 2, relativeDuration: 0.8] + - [ effect: SPEED, level: 2, relativeDuration: 0.8 ] level-5: effectsGiven: - - [effect: SPEED, level: 2, relativeDuration: 1.0] + - [ effect: SPEED, level: 2, relativeDuration: 1.0 ] skill-4: #Killing Frenzy enabled: true #Change this to false to disable this skill from working # Each buff that will be given with the level and duration. You must provide the potion effect spelled correctly. Select from this list: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html @@ -1938,19 +1945,19 @@ swordsmanship: # Effects with relativeDuration will always activate if the effect in adrenaline activated. Therefore there is no effectChance. level-1: effectsGiven: - - [effect: STRENGTH, level: 2, relativeDuration: 0.2] #Gives Strength II for 20% of the Speed I duration in Killing Spree + - [ effect: STRENGTH, level: 2, relativeDuration: 0.2 ] #Gives Strength II for 20% of the Speed I duration in Killing Spree level-2: effectsGiven: - - [effect: STRENGTH, level: 2, relativeDuration: 0.4] + - [ effect: STRENGTH, level: 2, relativeDuration: 0.4 ] level-3: effectsGiven: - - [effect: STRENGTH, level: 2, relativeDuration: 0.6] + - [ effect: STRENGTH, level: 2, relativeDuration: 0.6 ] level-4: effectsGiven: - - [effect: STRENGTH, level: 2, relativeDuration: 0.8] + - [ effect: STRENGTH, level: 2, relativeDuration: 0.8 ] level-5: effectsGiven: - - [effect: STRENGTH, level: 2, relativeDuration: 1.0] + - [ effect: STRENGTH, level: 2, relativeDuration: 1.0 ] skill-5: #Thirst for Blood enabled: true #Change this to false to disable this skill from working level-1: @@ -1959,22 +1966,22 @@ swordsmanship: # Mobs that are not spelled correctly or do not exist in the current minecraft version are ignored # Format: [{Entity Name},{Hunger Restored},{Saturation Restored},{experience gained}] affectedMobs: - - [mob: DROWNED, hungerRestored: 2, saturationRestored: 2, exp: 50] - - [mob: ELDER_GUARDIAN, hungerRestored: 3, saturationRestored: 3, exp: 50] - - [mob: EVOKER, hungerRestored: 1, saturationRestored: 1, exp: 50] - - [mob: GUARDIAN, hungerRestored: 1, saturationRestored: 2, exp: 50] - - [mob: HUSK, hungerRestored: 2, saturationRestored: 2, exp: 50] - - [mob: PILLAGER, hungerRestored: 2, saturationRestored: 3, exp: 50] - - [mob: RAVAGER, hungerRestored: 3, saturationRestored: 4, exp: 50] - - [mob: VINDICATOR, hungerRestored: 2, saturationRestored: 3, exp: 50] - - [mob: WITCH, hungerRestored: 2, saturationRestored: 3, exp: 50] - - [mob: ZOMBIE, hungerRestored: 2, saturationRestored: 2, exp: 50] - - [mob: ZOMBIE_VILLAGER, hungerRestored: 2, saturationRestored: 2, exp: 50] - - [mob: HOGLIN, hungerRestored: 3, saturationRestored: 4, exp: 50] - - [mob: PIGLIN, hungerRestored: 3, saturationRestored: 3, exp: 50] - - [mob: ZOMBIFIED_PIGLIN, hungerRestored: 2, saturationRestored: 2, exp: 50] - - [mob: ZOGLIN, hungerRestored: 2, saturationRestored: 3, exp: 50] - - [mob: PIG_ZOMBIE, hungerRestored: 2, saturationRestored: 2, exp: 50] + - [ mob: DROWNED, hungerRestored: 2, saturationRestored: 2, exp: 50 ] + - [ mob: ELDER_GUARDIAN, hungerRestored: 3, saturationRestored: 3, exp: 50 ] + - [ mob: EVOKER, hungerRestored: 1, saturationRestored: 1, exp: 50 ] + - [ mob: GUARDIAN, hungerRestored: 1, saturationRestored: 2, exp: 50 ] + - [ mob: HUSK, hungerRestored: 2, saturationRestored: 2, exp: 50 ] + - [ mob: PILLAGER, hungerRestored: 2, saturationRestored: 3, exp: 50 ] + - [ mob: RAVAGER, hungerRestored: 3, saturationRestored: 4, exp: 50 ] + - [ mob: VINDICATOR, hungerRestored: 2, saturationRestored: 3, exp: 50 ] + - [ mob: WITCH, hungerRestored: 2, saturationRestored: 3, exp: 50 ] + - [ mob: ZOMBIE, hungerRestored: 2, saturationRestored: 2, exp: 50 ] + - [ mob: ZOMBIE_VILLAGER, hungerRestored: 2, saturationRestored: 2, exp: 50 ] + - [ mob: HOGLIN, hungerRestored: 3, saturationRestored: 4, exp: 50 ] + - [ mob: PIGLIN, hungerRestored: 3, saturationRestored: 3, exp: 50 ] + - [ mob: ZOMBIFIED_PIGLIN, hungerRestored: 2, saturationRestored: 2, exp: 50 ] + - [ mob: ZOGLIN, hungerRestored: 2, saturationRestored: 3, exp: 50 ] + - [ mob: PIG_ZOMBIE, hungerRestored: 2, saturationRestored: 2, exp: 50 ] skill-6: #Sharper! enabled: true #Change this to false to disable this skill from working level-1: @@ -1985,7 +1992,7 @@ swordsmanship: # OR # Overall Format: [{Enchantment name}, {levels to add}, {static duration}] added-enchantmentList: - - [enchantment: SHARPNESS, addedLevels: 1, relativeDuration: 1.0 ] #Relative duration is 100% of the ability length + - [ enchantment: SHARPNESS, addedLevels: 1, relativeDuration: 1.0 ] #Relative duration is 100% of the ability length #Example for static duration: - [enchantment: SHARPNESS, addedLevels: 1, staticDuration: 5 ] skill-7: #Sword Mastery enabled: true #Change this to false to disable this skill from working @@ -1994,32 +2001,32 @@ swordsmanship: damageMultiplier: 1.0 #Multiplier for extra damage done when enemy is hit by an effected Item (STACKS WITH DAMAGE INCREASE) # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Items that Sword mastery applies to. I.e items that enemies will receive extra damage when hit by. - affected_itemList: [WOODEN_SWORD,STONE_SWORD,GOLDEN_SWORD,IRON_SWORD,DIAMOND_SWORD,NETHERITE_SWORD] + affected_itemList: [ WOODEN_SWORD,STONE_SWORD,GOLDEN_SWORD,IRON_SWORD,DIAMOND_SWORD,NETHERITE_SWORD ] defense: passive-1: #Stone solid duration enabled: true #Change this to false to disable this passive skill from working startingValue: 2.0 #Starting duration in seconds - allowedRange: [0.0, INF] #The allowed range of durations, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of durations, (INF or -INF represent positive and negative infinity) changePerLevel: 0.02 #Number of seconds the duration increases each level passive-2: #Hard Body enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) changePerLevel: 0.0001 #Probability increase per level damageMultiplier: 0.66 #Damage multiplier when perk activated passive-3: #Double Drops (Hostile Mobs) enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) changePerLevel: 0.0005 #Probability increase per level - affected_mobList: [SPIDER,CAVE_SPIDER,ENDERMAN, - BLAZE,CREEPER,DROWNED,ELDER_GUARDIAN, - ENDERMITE,EVOKER,GHAST,GUARDIAN, - HUSK,MAGMA_CUBE,PHANTOM,PILLAGER, - RAVAGER,SHULKER,SKELETON,SLIME, - STRAY,VEX,VINDICATOR,WITCH, - WITHER_SKELETON,ZOMBIE,ZOMBIE_VILLAGER, - HOGLIN, PIGLIN, ZOMBIFIED_PIGLIN, ZOGLIN] + affected_mobList: [ SPIDER,CAVE_SPIDER,ENDERMAN, + BLAZE,CREEPER,DROWNED,ELDER_GUARDIAN, + ENDERMITE,EVOKER,GHAST,GUARDIAN, + HUSK,MAGMA_CUBE,PHANTOM,PILLAGER, + RAVAGER,SHULKER,SKELETON,SLIME, + STRAY,VEX,VINDICATOR,WITCH, + WITHER_SKELETON,ZOMBIE,ZOMBIE_VILLAGER, + HOGLIN, PIGLIN, ZOMBIFIED_PIGLIN, ZOGLIN ] skill-1: #Healer enabled: true #Change this to false to disable this skill from working #Each buff that will be given with the level and duration. You must provide the potion effect spelled correctly. Select from this list: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html @@ -2030,27 +2037,27 @@ defense: healthHealed: 0 #Health instantly healed on a kill (1 = 1/2 heart) effectChance: 1.0 effectsGiven: - - [effect: REGEN, level: 1, duration: 3, delay: 0.0, prob: 1.0] #Example of how to use delay and prob + - [ effect: REGEN, level: 1, duration: 3, delay: 0.0, prob: 1.0 ] #Example of how to use delay and prob level-2: healthHealed: 0 #Health instantly healed on a kill (1 = 1/2 heart) effectChance: 1.0 effectsGiven: - - [effect: REGEN, level: 1, duration: 6] + - [ effect: REGEN, level: 1, duration: 6 ] level-3: healthHealed: 0 #Health instantly healed on a kill (1 = 1/2 heart) effectChance: 1.0 effectsGiven: - - [effect: REGEN, level: 1, duration: 9] + - [ effect: REGEN, level: 1, duration: 9 ] level-4: healthHealed: 1 #Health instantly healed on a kill (1 = 1/2 heart) effectChance: 1.0 effectsGiven: - - [effect: REGEN, level: 1, duration: 12] + - [ effect: REGEN, level: 1, duration: 12 ] level-5: healthHealed: 2 #Health instantly healed on a kill (1 = 1/2 heart) effectChance: 1.0 effectsGiven: - - [effect: REGEN, level: 1, duration: 15] + - [ effect: REGEN, level: 1, duration: 15 ] skill-2: #Stiffen enabled: true #Change this to false to disable this skill from working #Each buff that will be given with the level and duration. You must provide the potion effect spelled correctly. Select from this list: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html @@ -2060,23 +2067,23 @@ defense: level-1: effectChance: 1.0 effectsGiven: - - [effect: DAMAGE_RESISTANCE, level: 1, duration: 5, prob: 0.02, delay: 0.0] #Example of how to use delay + - [ effect: DAMAGE_RESISTANCE, level: 1, duration: 5, prob: 0.02, delay: 0.0 ] #Example of how to use delay level-2: effectChance: 1.0 effectsGiven: - - [effect: DAMAGE_RESISTANCE, level: 1, duration: 5, prob: 0.04] + - [ effect: DAMAGE_RESISTANCE, level: 1, duration: 5, prob: 0.04 ] level-3: effectChance: 1.0 effectsGiven: - - [effect: DAMAGE_RESISTANCE, level: 1, duration: 5, prob: 0.06] + - [ effect: DAMAGE_RESISTANCE, level: 1, duration: 5, prob: 0.06 ] level-4: effectChance: 1.0 effectsGiven: - - [effect: DAMAGE_RESISTANCE, level: 1, duration: 5, prob: 0.08] + - [ effect: DAMAGE_RESISTANCE, level: 1, duration: 5, prob: 0.08 ] level-5: effectChance: 1.0 effectsGiven: - - [effect: DAMAGE_RESISTANCE, level: 1, duration: 5, prob: 0.10] + - [ effect: DAMAGE_RESISTANCE, level: 1, duration: 5, prob: 0.10 ] skill-3: #Hard Headed enabled: true #Change this to false to disable this skill from working level-1: @@ -2098,23 +2105,23 @@ defense: level-1: effectChance: 1.0 effectsGiven: - - [effect: DAMAGE_RESISTANCE, level: 2, duration: 5, prob: 0.02, delay: 0.0] #Example of how to use delay + - [ effect: DAMAGE_RESISTANCE, level: 2, duration: 5, prob: 0.02, delay: 0.0 ] #Example of how to use delay level-2: effectChance: 1.0 effectsGiven: - - [effect: DAMAGE_RESISTANCE, level: 2, duration: 5, prob: 0.04] + - [ effect: DAMAGE_RESISTANCE, level: 2, duration: 5, prob: 0.04 ] level-3: effectChance: 1.0 effectsGiven: - - [effect: DAMAGE_RESISTANCE, level: 2, duration: 5, prob: 0.06] + - [ effect: DAMAGE_RESISTANCE, level: 2, duration: 5, prob: 0.06 ] level-4: effectChance: 1.0 effectsGiven: - - [effect: DAMAGE_RESISTANCE, level: 2, duration: 5, prob: 0.08] + - [ effect: DAMAGE_RESISTANCE, level: 2, duration: 5, prob: 0.08 ] level-5: effectChance: 1.0 effectsGiven: - - [effect: DAMAGE_RESISTANCE, level: 2, duration: 5, prob: 0.10] + - [ effect: DAMAGE_RESISTANCE, level: 2, duration: 5, prob: 0.10 ] skill-5: #Gift From Above enabled: true #Change this to false to disable this skill from working level-1: @@ -2124,7 +2131,7 @@ defense: #Format: [ {EffectName}, {Level (Integer)}, {Static Duration}] #This effect will either override or append to the buffs given by Stone Solid effectsAdded: - - [effect: ABSORPTION, level: 2, durationAdded: 60.0, durationMultiplier: 1.0] + - [ effect: ABSORPTION, level: 2, durationAdded: 60.0, durationMultiplier: 1.0 ] # - [effect: ABSORPTION, level: 2, staticDuration: 10.0] (Example of how to use static duration) skill-6: #Stronger Legs enabled: true #Change this to false to disable this skill from working @@ -2135,7 +2142,7 @@ defense: #Format: [ {EffectName}, {Level (Integer)}, {Static Duration}] #This effect will either override or append to the buffs given by Stone Solid effectsAdded: - - [effect: SLOW, level: 1, durationAdded: 0.0, durationMultiplier: 1.0] + - [ effect: SLOW, level: 1, durationAdded: 0.0, durationMultiplier: 1.0 ] # - [effect: SLOW, level: 2, staticDuration: 10.0] (Example of how to use static duration) skill-7: #Hearty enabled: true #Change this to false to disable this skill from working @@ -2145,12 +2152,12 @@ axeMastery: passive-1: #Great Axe Duration enabled: true #Change this to false to disable this passive skill from working startingValue: 2.0 #Starting duration in seconds - allowedRange: [0.0, INF] #The allowed range of durations, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of durations, (INF or -INF represent positive and negative infinity) changePerLevel: 0.02 #Number of seconds the duration increases each level passive-2: #Divine Crits enabled: true #Change this to false to disable this passive skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) changePerLevel: 0.0001 #Probability Increase per level damageMultiplier: 1.25 #Damage multiplier when a crit is rolled skill-1: #Greater Axe @@ -2203,23 +2210,23 @@ axeMastery: level-1: effectChance: 1.0 effectsGiven: - - [effect: STRENGTH, level: 1, duration: 3, prob: 1.0, delay: 0.0] #Example of how to use delay and prob + - [ effect: STRENGTH, level: 1, duration: 3, prob: 1.0, delay: 0.0 ] #Example of how to use delay and prob level-2: effectChance: 1.0 effectsGiven: - - [effect: STRENGTH, level: 1, duration: 6] + - [ effect: STRENGTH, level: 1, duration: 6 ] level-3: effectChance: 1.0 effectsGiven: - - [effect: STRENGTH, level: 1, duration: 9] + - [ effect: STRENGTH, level: 1, duration: 9 ] level-4: effectChance: 1.0 effectsGiven: - - [effect: STRENGTH, level: 1, duration: 12] + - [ effect: STRENGTH, level: 1, duration: 12 ] level-5: effectChance: 1.0 effectsGiven: - - [effect: STRENGTH, level: 1, duration: 15] + - [ effect: STRENGTH, level: 1, duration: 15 ] skill-5: #Earthquake enabled: true #Change this to false to disable this skill from working level-1: @@ -2235,12 +2242,12 @@ axeMastery: damageMultiplier: 1.0 #Multiplier for extra damage done when enemy is hit by an effected Item (STACKS WITH DAMAGE INCREASE) # Select items from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html # Items that axe mastery applies to. I.e items that enemies will receive extra damage when hit by. - affected-itemList: [WOODEN_AXE,STONE_AXE,GOLDEN_AXE,IRON_AXE,DIAMOND_AXE,NETHERITE_AXE] + affected-itemList: [ WOODEN_AXE,STONE_AXE,GOLDEN_AXE,IRON_AXE,DIAMOND_AXE,NETHERITE_AXE ] repair: passive-1: #Proficiency enabled: true #Change this to false to disable this skill from working startingValue: 0 #Starting level - allowedRange: [0.0, INF] #The allowed range of repair bonuses, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of repair bonuses, (INF or -INF represent positive and negative infinity) # Each item tier (diamond, wood, etc.) has a difficultly modifier, X < 1.0. For example X = 0.9 for wood tools (by default) # Each item has a number of components to craft, Y. For example a diamond pickaxe takes 3 diamonds so Y=3 (by default). # Let the player's repair level be Z @@ -2289,7 +2296,7 @@ agility: passive-1: #Roll enabled: true #Change this to false to disable this skill from working startingValue: 0.00 #Starting probability - allowedRange: [0.0, 1.0] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, 1.0 ] #The allowed range of probabilities, (INF or -INF represent positive and negative infinity) changePerLevel: 0.0005 #Probability Increase per level damageMultiplier: 0.5 #Multiplier on fall damage taken skill-1: #Dodge @@ -2298,28 +2305,28 @@ agility: level-1: dodgeChance: 0.04 #Chance that damage is dodged # Damage types that can be avoided - affected-damageTypeList: [BLOCK_EXPLOSION,CONTACT,DRAGON_BREATH,ENTITY_ATTACK,ENTITY_EXPLOSION,ENTITY_SWEEP_ATTACK, - FALLING_BLOCK,HOT_FLOOR,LIGHTNING,MAGIC,PROJECTILE,THORNS] + affected-damageTypeList: [ BLOCK_EXPLOSION,CONTACT,DRAGON_BREATH,ENTITY_ATTACK,ENTITY_EXPLOSION,ENTITY_SWEEP_ATTACK, + FALLING_BLOCK,HOT_FLOOR,LIGHTNING,MAGIC,PROJECTILE,THORNS ] level-2: dodgeChance: 0.08 #Chance that damage is dodged # Damage types that can be avoided - affected-damageTypeList: [BLOCK_EXPLOSION,CONTACT,DRAGON_BREATH,ENTITY_ATTACK,ENTITY_EXPLOSION,ENTITY_SWEEP_ATTACK, - FALLING_BLOCK,HOT_FLOOR,LIGHTNING,MAGIC,PROJECTILE,THORNS] + affected-damageTypeList: [ BLOCK_EXPLOSION,CONTACT,DRAGON_BREATH,ENTITY_ATTACK,ENTITY_EXPLOSION,ENTITY_SWEEP_ATTACK, + FALLING_BLOCK,HOT_FLOOR,LIGHTNING,MAGIC,PROJECTILE,THORNS ] level-3: dodgeChance: 0.12 #Chance that damage is dodged # Damage types that can be avoided - affected-damageTypeList: [BLOCK_EXPLOSION,CONTACT,DRAGON_BREATH,ENTITY_ATTACK,ENTITY_EXPLOSION,ENTITY_SWEEP_ATTACK, - FALLING_BLOCK,HOT_FLOOR,LIGHTNING,MAGIC,PROJECTILE,THORNS] + affected-damageTypeList: [ BLOCK_EXPLOSION,CONTACT,DRAGON_BREATH,ENTITY_ATTACK,ENTITY_EXPLOSION,ENTITY_SWEEP_ATTACK, + FALLING_BLOCK,HOT_FLOOR,LIGHTNING,MAGIC,PROJECTILE,THORNS ] level-4: dodgeChance: 0.16 #Chance that damage is dodged # Damage types that can be avoided - affected-damageTypeList: [BLOCK_EXPLOSION,CONTACT,DRAGON_BREATH,ENTITY_ATTACK,ENTITY_EXPLOSION,ENTITY_SWEEP_ATTACK, - FALLING_BLOCK,HOT_FLOOR,LIGHTNING,MAGIC,PROJECTILE,THORNS] + affected-damageTypeList: [ BLOCK_EXPLOSION,CONTACT,DRAGON_BREATH,ENTITY_ATTACK,ENTITY_EXPLOSION,ENTITY_SWEEP_ATTACK, + FALLING_BLOCK,HOT_FLOOR,LIGHTNING,MAGIC,PROJECTILE,THORNS ] level-5: dodgeChance: 0.20 #Chance that damage is dodged # Damage types that can be avoided - affected-damageTypeList: [BLOCK_EXPLOSION,CONTACT,DRAGON_BREATH,ENTITY_ATTACK,ENTITY_EXPLOSION,ENTITY_SWEEP_ATTACK, - FALLING_BLOCK,HOT_FLOOR,LIGHTNING,MAGIC,PROJECTILE,THORNS] + affected-damageTypeList: [ BLOCK_EXPLOSION,CONTACT,DRAGON_BREATH,ENTITY_ATTACK,ENTITY_EXPLOSION,ENTITY_SWEEP_ATTACK, + FALLING_BLOCK,HOT_FLOOR,LIGHTNING,MAGIC,PROJECTILE,THORNS ] skill-2: #Steel Bones enabled: true #Change this to false to disable this skill from working level-1: @@ -2341,13 +2348,13 @@ agility: # effect is added (given that the perk activated). effectChance: 1.0 effectsGiven: - - [effect: SPEED, level: 1, duration: 1200, delay: 0.0, prob: 1.0] #Example of how to use delay and prob + - [ effect: SPEED, level: 1, duration: 1200, delay: 0.0, prob: 1.0 ] #Example of how to use delay and prob refreshTimer: 10.0 #Number of seconds to between server checks to give the buff alchemy: passive-1: #Half-life+ enabled: true #Change this to false to disable this skill from working startingValue: 0.00 #Starting time extension - allowedRange: [0, INF] #The allowed range of percent increases, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0, INF ] #The allowed range of percent increases, (INF or -INF represent positive and negative infinity) changePerLevel: 0.001 #Proportional extension per level skill-1: #Alchemical Summoning enabled: true #Change this to false to disable this skill from working @@ -2356,24 +2363,24 @@ alchemy: # For now, custom items are not recognizable in crafting recipes (it takes quite a bit of code to make crafting recipes recognize more than a material) level-1: recipes: - - output: [item: POTION, amount: 1, potion: [effect: WATER_BREATHING, isUpgraded: false, isExtended: false] ] #Output Item - recipe: [AIR,PUFFERFISH,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR] #Crafting Recipe + - output: [ item: POTION, amount: 1, potion: [ effect: WATER_BREATHING, isUpgraded: false, isExtended: false ] ] #Output Item + recipe: [ AIR,PUFFERFISH,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR ] #Crafting Recipe level-2: recipes: - - output: [item: POTION, amount: 1, potion: [effect: SPEED, isUpgraded: false, isExtended: false] ] #Output Item - recipe: [AIR,SUGAR,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR] #Crafting Recipe + - output: [ item: POTION, amount: 1, potion: [ effect: SPEED, isUpgraded: false, isExtended: false ] ] #Output Item + recipe: [ AIR,SUGAR,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR ] #Crafting Recipe level-3: recipes: - - output: [item: POTION, amount: 1, potion: [effect: FIRE_RESISTANCE, isUpgraded: false, isExtended: false] ] #Output Item - recipe: [AIR,MAGMA_CREAM,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR] #Crafting Recipe + - output: [ item: POTION, amount: 1, potion: [ effect: FIRE_RESISTANCE, isUpgraded: false, isExtended: false ] ] #Output Item + recipe: [ AIR,MAGMA_CREAM,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR ] #Crafting Recipe level-4: recipes: - - output: [item: POTION, amount: 1, potion: [effect: HEAL, isUpgraded: false, isExtended: false] ] #Output Item - recipe: [AIR,GLISTERING_MELON_SLICE,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR] #Crafting Recipe + - output: [ item: POTION, amount: 1, potion: [ effect: HEAL, isUpgraded: false, isExtended: false ] ] #Output Item + recipe: [ AIR,GLISTERING_MELON_SLICE,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR ] #Crafting Recipe level-5: recipes: - - output: [item: POTION, amount: 1, potion: [effect: INCREASE_DAMAGE, isUpgraded: false, isExtended: false] ] #Output Item - recipe: [AIR,BLAZE_POWDER,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR] #Crafting Recipe + - output: [ item: POTION, amount: 1, potion: [ effect: INCREASE_DAMAGE, isUpgraded: false, isExtended: false ] ] #Output Item + recipe: [ AIR,BLAZE_POWDER,AIR,AIR,GLASS_BOTTLE,AIR,AIR,AIR,AIR ] #Crafting Recipe skill-2: #Ancient Knowledge enabled: true #Change this to false to disable this skill from working # Effects on the crafted potion are added under potionEffects. Mutliple can be added. Select from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html @@ -2385,237 +2392,237 @@ alchemy: # You can add as many potion recipes as you want, and the inputs/outputs do not have to be potions level-1: potionRecipes: - #Initial - - ingredient: [item: EMERALD] - output: [name: "Potion of Resistance", item: POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [effect: AWKWARD] ] #Input Item(s) + #Initial + - ingredient: [ item: EMERALD ] + output: [ name: "Potion of Resistance", item: POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ effect: AWKWARD ] ] #Input Item(s) #Extension - - ingredient: [item: REDSTONE] - output: [name: "Potion of Resistance", item: POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 480, color: (30,210,64)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64)]] ] #Input Item(s) + - ingredient: [ item: REDSTONE ] + output: [ name: "Potion of Resistance", item: POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 480, color: (30,210,64) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64) ] ] ] #Input Item(s) #Upgrade - - ingredient: [item: GLOWSTONE] - output: [name: "Potion of Resistance II", item: POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 2, duration: 90, color: (30,210,64)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64)]] ] #Input Item(s) + - ingredient: [ item: GLOWSTONE ] + output: [ name: "Potion of Resistance II", item: POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 2, duration: 90, color: (30,210,64) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64) ] ] ] #Input Item(s) #Splash - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Resistance", item: SPLASH_POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Resistance", item: SPLASH_POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64) ] ] ] #Input Item(s) #Splash Extended - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Resistance", item: SPLASH_POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 480, color: (30,210,64)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 480, color: (30,210,64)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Resistance", item: SPLASH_POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 480, color: (30,210,64) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 480, color: (30,210,64) ] ] ] #Input Item(s) #Splash Upgraded - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Resistance II", item: SPLASH_POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 2, duration: 90, color: (30,210,64)]] ] #Output Item - input: [tem: POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 2, duration: 90, color: (30,210,64)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Resistance II", item: SPLASH_POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 2, duration: 90, color: (30,210,64) ] ] ] #Output Item + input: [ tem: POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 2, duration: 90, color: (30,210,64) ] ] ] #Input Item(s) #Lingering - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Resistance", item: LINGERING_POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Resistance", item: LINGERING_POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 180, color: (30,210,64) ] ] ] #Input Item(s) #Lingering Extended - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Resistance", item: LINGERING_POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 480, color: (30,210,64)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 1, duration: 480, color: (30,210,64)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Resistance", item: LINGERING_POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 480, color: (30,210,64) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 1, duration: 480, color: (30,210,64) ] ] ] #Input Item(s) #lingering Upgraded - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Resistance II", item: LINGERING_POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 2, duration: 90, color: (30,210,64)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: HERO_OF_THE_VILLAGE, level: 2, duration: 90, color: (30,210,64)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Resistance II", item: LINGERING_POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 2, duration: 90, color: (30,210,64) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: HERO_OF_THE_VILLAGE, level: 2, duration: 90, color: (30,210,64) ] ] ] #Input Item(s) level-2: potionRecipes: - #Initial - - ingredient: [item: SLIMEBALL] - output: [name: "Potion of Mining Fatigue", item: POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [effect: AWKWARD] ] #Input Item(s) + #Initial + - ingredient: [ item: SLIMEBALL ] + output: [ name: "Potion of Mining Fatigue", item: POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ effect: AWKWARD ] ] #Input Item(s) #Extension - - ingredient: [item: REDSTONE] - output: [name: "Potion of Mining Fatigue", item: POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 160, color: (164,212,10)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10)]] ] #Input Item(s) + - ingredient: [ item: REDSTONE ] + output: [ name: "Potion of Mining Fatigue", item: POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 160, color: (164,212,10) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10) ] ] ] #Input Item(s) #Upgrade - - ingredient: [item: GLOWSTONE] - output: [name: "Potion of Mining Fatigue II", item: POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 2, duration: 30, color: (164,212,10)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10)]] ] #Input Item(s) + - ingredient: [ item: GLOWSTONE ] + output: [ name: "Potion of Mining Fatigue II", item: POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 2, duration: 30, color: (164,212,10) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10) ] ] ] #Input Item(s) #Splash - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Mining Fatigue", item: POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Mining Fatigue", item: POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10) ] ] ] #Input Item(s) #Splash Extended - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Mining Fatigue", item: SPLASH_POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 160, color: (164,212,10)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 160, color: (164,212,10)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Mining Fatigue", item: SPLASH_POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 160, color: (164,212,10) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 160, color: (164,212,10) ] ] ] #Input Item(s) #Splash Upgraded - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Mining Fatigue II", item: SPLASH_POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 2, duration: 30, color: (164,212,10)]] ] #Output Item - input: [tem: POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 2, duration: 30, color: (164,212,10)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Mining Fatigue II", item: SPLASH_POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 2, duration: 30, color: (164,212,10) ] ] ] #Output Item + input: [ tem: POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 2, duration: 30, color: (164,212,10) ] ] ] #Input Item(s) #Lingering - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Mining Fatigue", item: LINGERING_POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Mining Fatigue", item: LINGERING_POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 60, color: (164,212,10) ] ] ] #Input Item(s) #Lingering Extended - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Mining Fatigue", item: LINGERING_POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 160, color: (164,212,10)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 1, duration: 160, color: (164,212,10)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Mining Fatigue", item: LINGERING_POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 160, color: (164,212,10) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 1, duration: 160, color: (164,212,10) ] ] ] #Input Item(s) #lingering Upgraded - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Mining Fatigue II", item: LINGERING_POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 2, duration: 30, color: (164,212,10)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: SLOW_DIGGING, level: 2, duration: 30, color: (164,212,10)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Mining Fatigue II", item: LINGERING_POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 2, duration: 30, color: (164,212,10) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: SLOW_DIGGING, level: 2, duration: 30, color: (164,212,10) ] ] ] #Input Item(s) level-3: potionRecipes: - #Initial - - ingredient: [item: CLOCK] - output: [name: "Potion of Haste", item: POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [effect: AWKWARD] ] #Input Item(s) + #Initial + - ingredient: [ item: CLOCK ] + output: [ name: "Potion of Haste", item: POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ effect: AWKWARD ] ] #Input Item(s) #Extension - - ingredient: [item: REDSTONE] - output: [name: "Potion of Haste", item: POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 480, color: (159,232,186)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186)]] ] #Input Item(s) + - ingredient: [ item: REDSTONE ] + output: [ name: "Potion of Haste", item: POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 480, color: (159,232,186) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186) ] ] ] #Input Item(s) #Upgrade - - ingredient: [item: GLOWSTONE] - output: [name: "Potion of Haste II", item: POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 2, duration: 90, color: (159,232,186)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186)]] ] #Input Item(s) + - ingredient: [ item: GLOWSTONE ] + output: [ name: "Potion of Haste II", item: POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 2, duration: 90, color: (159,232,186) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186) ] ] ] #Input Item(s) #Splash - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Haste", item: SPLASH_POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Haste", item: SPLASH_POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186) ] ] ] #Input Item(s) #Splash Extended - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Haste", item: SPLASH_POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 480, color: (159,232,186)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 480, color: (159,232,186)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Haste", item: SPLASH_POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 480, color: (159,232,186) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 480, color: (159,232,186) ] ] ] #Input Item(s) #Splash Upgraded - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Haste II", item: SPLASH_POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 2, duration: 90, color: (159,232,186)]] ] #Output Item - input: [tem: POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 2, duration: 90, color: (159,232,186)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Haste II", item: SPLASH_POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 2, duration: 90, color: (159,232,186) ] ] ] #Output Item + input: [ tem: POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 2, duration: 90, color: (159,232,186) ] ] ] #Input Item(s) #Lingering - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Haste", item: LINGERING_POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Haste", item: LINGERING_POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 180, color: (159,232,186) ] ] ] #Input Item(s) #Lingering Extended - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Haste", item: LINGERING_POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 480, color: (159,232,186)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 1, duration: 480, color: (159,232,186)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Haste", item: LINGERING_POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 480, color: (159,232,186) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 1, duration: 480, color: (159,232,186) ] ] ] #Input Item(s) #lingering Upgraded - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Haste II", item: LINGERING_POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 2, duration: 90, color: (159,232,186)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: FAST_DIGGING, level: 2, duration: 90, color: (159,232,186)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Haste II", item: LINGERING_POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 2, duration: 90, color: (159,232,186) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: FAST_DIGGING, level: 2, duration: 90, color: (159,232,186) ] ] ] #Input Item(s) level-4: #Initial - - ingredient: [item: POISONOUS_POTATO] - output: [name: "Potion of Mining Fatigue", item: POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 30, color: (0,0,0)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [effect: AWKWARD] ] #Input Item(s) + - ingredient: [ item: POISONOUS_POTATO ] + output: [ name: "Potion of Mining Fatigue", item: POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 30, color: (0,0,0) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ effect: AWKWARD ] ] #Input Item(s) #Extension - - ingredient: [item: REDSTONE] - output: [name: "Potion of Mining Fatigue", item: POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 80, color: (0,0,0)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 30, color: (0,0,0)]] ] #Input Item(s) + - ingredient: [ item: REDSTONE ] + output: [ name: "Potion of Mining Fatigue", item: POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 80, color: (0,0,0) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 30, color: (0,0,0) ] ] ] #Input Item(s) #Upgrade - - ingredient: [item: GLOWSTONE] - output: [name: "Potion of Mining Fatigue II", item: POTION, amount: 1, potion: [[effect: WITHER, level: 2, duration: 15, color: (0,0,0)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 30, color: (0,0,0)]] ] #Input Item(s) + - ingredient: [ item: GLOWSTONE ] + output: [ name: "Potion of Mining Fatigue II", item: POTION, amount: 1, potion: [ [ effect: WITHER, level: 2, duration: 15, color: (0,0,0) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 30, color: (0,0,0) ] ] ] #Input Item(s) #Splash - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Mining Fatigue", item: POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 30, color: (0,0,0)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 30, color: (0,0,0)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Mining Fatigue", item: POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 30, color: (0,0,0) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 30, color: (0,0,0) ] ] ] #Input Item(s) #Splash Extended - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Mining Fatigue", item: SPLASH_POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 80, color: (0,0,0)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 80, color: (0,0,0)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Mining Fatigue", item: SPLASH_POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 80, color: (0,0,0) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 80, color: (0,0,0) ] ] ] #Input Item(s) #Splash Upgraded - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Mining Fatigue II", item: SPLASH_POTION, amount: 1, potion: [[effect: WITHER, level: 2, duration: 15, color: (0,0,0)]] ] #Output Item - input: [tem: POTION, amount: 1, potion: [[effect: WITHER, level: 2, duration: 15, color: (0,0,0)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Mining Fatigue II", item: SPLASH_POTION, amount: 1, potion: [ [ effect: WITHER, level: 2, duration: 15, color: (0,0,0) ] ] ] #Output Item + input: [ tem: POTION, amount: 1, potion: [ [ effect: WITHER, level: 2, duration: 15, color: (0,0,0) ] ] ] #Input Item(s) #Lingering - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Mining Fatigue", item: LINGERING_POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 30, color: (0,0,0)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 30, color: (0,0,0)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Mining Fatigue", item: LINGERING_POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 30, color: (0,0,0) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 30, color: (0,0,0) ] ] ] #Input Item(s) #Lingering Extended - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Mining Fatigue", item: LINGERING_POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 80, color: (0,0,0)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: WITHER, level: 1, duration: 80, color: (0,0,0)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Mining Fatigue", item: LINGERING_POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 80, color: (0,0,0) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: WITHER, level: 1, duration: 80, color: (0,0,0) ] ] ] #Input Item(s) #lingering Upgraded - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Mining Fatigue II", item: LINGERING_POTION, amount: 1, potion: [[effect: WITHER, level: 2, duration: 15, color: (0,0,0)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: WITHER, level: 2, duration: 15, color: (0,0,0)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Mining Fatigue II", item: LINGERING_POTION, amount: 1, potion: [ [ effect: WITHER, level: 2, duration: 15, color: (0,0,0) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: WITHER, level: 2, duration: 15, color: (0,0,0) ] ] ] #Input Item(s) level-5: potionRecipes: #Initial - - ingredient: [item: GOLDEN_APPLE] - output: [name: "Potion of Haste", item: POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [effect: AWKWARD] ] #Input Item(s) + - ingredient: [ item: GOLDEN_APPLE ] + output: [ name: "Potion of Haste", item: POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ effect: AWKWARD ] ] #Input Item(s) #Extension - - ingredient: [item: REDSTONE] - output: [name: "Potion of Haste", item: POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 480, color: (150,140,175)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175)]] ] #Input Item(s) + - ingredient: [ item: REDSTONE ] + output: [ name: "Potion of Haste", item: POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 480, color: (150,140,175) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175) ] ] ] #Input Item(s) #Upgrade - - ingredient: [item: GLOWSTONE] - output: [name: "Potion of Haste II", item: POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 2, duration: 90, color: (150,140,175)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175)]] ] #Input Item(s) + - ingredient: [ item: GLOWSTONE ] + output: [ name: "Potion of Haste II", item: POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 2, duration: 90, color: (150,140,175) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175) ] ] ] #Input Item(s) #Splash - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Haste", item: SPLASH_POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Haste", item: SPLASH_POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175) ] ] ] #Input Item(s) #Splash Extended - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Haste", item: SPLASH_POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 480, color: (150,140,175)]] ] #Output Item - input: [item: POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 480, color: (150,140,175)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Haste", item: SPLASH_POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 480, color: (150,140,175) ] ] ] #Output Item + input: [ item: POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 480, color: (150,140,175) ] ] ] #Input Item(s) #Splash Upgraded - - ingredient: [item: GUNPOWDER] - output: [name: "Splash Potion of Haste II", item: SPLASH_POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 2, duration: 90, color: (150,140,175)]] ] #Output Item - input: [tem: POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 2, duration: 90, color: (150,140,175)]] ] #Input Item(s) + - ingredient: [ item: GUNPOWDER ] + output: [ name: "Splash Potion of Haste II", item: SPLASH_POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 2, duration: 90, color: (150,140,175) ] ] ] #Output Item + input: [ tem: POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 2, duration: 90, color: (150,140,175) ] ] ] #Input Item(s) #Lingering - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Haste", item: LINGERING_POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Haste", item: LINGERING_POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 180, color: (150,140,175) ] ] ] #Input Item(s) #Lingering Extended - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Haste", item: LINGERING_POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 480, color: (150,140,175)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 1, duration: 480, color: (150,140,175)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Haste", item: LINGERING_POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 480, color: (150,140,175) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 1, duration: 480, color: (150,140,175) ] ] ] #Input Item(s) #lingering Upgraded - - ingredient: [item: DRAGON_BREATH] - output: [name: "Lingering Potion of Haste II", item: LINGERING_POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 2, duration: 90, color: (150,140,175)]] ] #Output Item - input: [item: SPLASH_POTION, amount: 1, potion: [[effect: DAMAGE_RESISTANCE, level: 2, duration: 90, color: (150,140,175)]] ] #Input Item(s) + - ingredient: [ item: DRAGON_BREATH ] + output: [ name: "Lingering Potion of Haste II", item: LINGERING_POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 2, duration: 90, color: (150,140,175) ] ] ] #Output Item + input: [ item: SPLASH_POTION, amount: 1, potion: [ [ effect: DAMAGE_RESISTANCE, level: 2, duration: 90, color: (150,140,175) ] ] ] #Input Item(s) skill-3: #Potion Master enabled: true #Change this to false to disable this skill from working @@ -2627,57 +2634,57 @@ alchemy: # Format [{potionEffect name}, {level change}] level-1: changedEffects: #Effects increased or decreased in level by potion Master. At minimum, the level will be reduced to 1. - - [potionType: FIRE_RESISTANCE, levelChange: 1] - - [potionType: INSTANT_DAMAGE, levelChange: -1] - - [potionType: INSTANT_HEAL, levelChange: 1] - - [potionType: INVISIBILITY, levelChange: 1] - - [potionType: JUMP, levelChange: 1] - - [potionType: LUCK, levelChange: 1] - - [potionType: NIGHT_VISION, levelChange: 1] - - [potionType: POISON, levelChange: -1] - - [potionType: REGEN, levelChange: 1] - - [potionType: SLOW_FALLING, levelChange: 1] - - [potionType: SLOWNESS, levelChange: -1] - - [potionType: SPEED, levelChange: 1] - - [potionType: STRENGTH, levelChange: 1] - - [potionType: TURTLE_MASTER, levelChange: 0] - - [potionType: WATER_BREATHING, levelChange: 1] - - [potionType: WEAKNESS, levelChange: -1] - - [potionEffect: ABSORPTION, levelChange: 1] - - [potionEffect: BAD_OMEN, levelChange: -1] - - [potionEffect: BLINDNESS, levelChange: -1] - - [potionEffect: CONDUIT_POWER, levelChange: 1] - - [potionEffect: CONFUSION, levelChange: -1] - - [potionEffect: DAMAGE_RESISTANCE, levelChange: 1] - - [potionEffect: DOLPHINS_GRACE, levelChange: 1] - - [potionEffect: FAST_DIGGING, levelChange: 1] - - [potionEffect: FIRE_RESISTANCE, levelChange: 1] - - [potionEffect: GLOWING, levelChange: 1] - - [potionEffect: HARM, levelChange: -1] - - [potionEffect: HEAL, levelChange: 1] - - [potionEffect: HEALTH_BOOST, levelChange: 1] - - [potionEffect: HERO_OF_THE_VILLAGE, levelChange: 1] - - [potionEffect: HUNGER, levelChange: -1] - - [potionEffect: INCREASE_DAMAGE, levelChange: 1] - - [potionEffect: INVISIBILITY, levelChange: 1] - - [potionEffect: JUMP, levelChange: 1] - - [potionEffect: LEVITATION, levelChange: 1] - - [potionEffect: LUCK, levelChange: 1] - - [potionEffect: NIGHT_VISION, levelChange: 1] - - [potionEffect: POISON, levelChange: -1] - - [potionEffect: REGENERATION, levelChange: 1] - - [potionEffect: SATURATION, levelChange: 1] - - [potionEffect: SLOW, levelChange: -1] - - [potionEffect: SPEED, levelChange: 1] - - [potionEffect: UNLUCK, levelChange: -1] - - [potionEffect: WATER_BREATHING, levelChange: 1] - - [potionEffect: WEAKNESS, levelChange: -1] - - [potionEffect: WITHER, levelChange: -1] + - [ potionType: FIRE_RESISTANCE, levelChange: 1 ] + - [ potionType: INSTANT_DAMAGE, levelChange: -1 ] + - [ potionType: INSTANT_HEAL, levelChange: 1 ] + - [ potionType: INVISIBILITY, levelChange: 1 ] + - [ potionType: JUMP, levelChange: 1 ] + - [ potionType: LUCK, levelChange: 1 ] + - [ potionType: NIGHT_VISION, levelChange: 1 ] + - [ potionType: POISON, levelChange: -1 ] + - [ potionType: REGEN, levelChange: 1 ] + - [ potionType: SLOW_FALLING, levelChange: 1 ] + - [ potionType: SLOWNESS, levelChange: -1 ] + - [ potionType: SPEED, levelChange: 1 ] + - [ potionType: STRENGTH, levelChange: 1 ] + - [ potionType: TURTLE_MASTER, levelChange: 0 ] + - [ potionType: WATER_BREATHING, levelChange: 1 ] + - [ potionType: WEAKNESS, levelChange: -1 ] + - [ potionEffect: ABSORPTION, levelChange: 1 ] + - [ potionEffect: BAD_OMEN, levelChange: -1 ] + - [ potionEffect: BLINDNESS, levelChange: -1 ] + - [ potionEffect: CONDUIT_POWER, levelChange: 1 ] + - [ potionEffect: CONFUSION, levelChange: -1 ] + - [ potionEffect: DAMAGE_RESISTANCE, levelChange: 1 ] + - [ potionEffect: DOLPHINS_GRACE, levelChange: 1 ] + - [ potionEffect: FAST_DIGGING, levelChange: 1 ] + - [ potionEffect: FIRE_RESISTANCE, levelChange: 1 ] + - [ potionEffect: GLOWING, levelChange: 1 ] + - [ potionEffect: HARM, levelChange: -1 ] + - [ potionEffect: HEAL, levelChange: 1 ] + - [ potionEffect: HEALTH_BOOST, levelChange: 1 ] + - [ potionEffect: HERO_OF_THE_VILLAGE, levelChange: 1 ] + - [ potionEffect: HUNGER, levelChange: -1 ] + - [ potionEffect: INCREASE_DAMAGE, levelChange: 1 ] + - [ potionEffect: INVISIBILITY, levelChange: 1 ] + - [ potionEffect: JUMP, levelChange: 1 ] + - [ potionEffect: LEVITATION, levelChange: 1 ] + - [ potionEffect: LUCK, levelChange: 1 ] + - [ potionEffect: NIGHT_VISION, levelChange: 1 ] + - [ potionEffect: POISON, levelChange: -1 ] + - [ potionEffect: REGENERATION, levelChange: 1 ] + - [ potionEffect: SATURATION, levelChange: 1 ] + - [ potionEffect: SLOW, levelChange: -1 ] + - [ potionEffect: SPEED, levelChange: 1 ] + - [ potionEffect: UNLUCK, levelChange: -1 ] + - [ potionEffect: WATER_BREATHING, levelChange: 1 ] + - [ potionEffect: WEAKNESS, levelChange: -1 ] + - [ potionEffect: WITHER, levelChange: -1 ] smelting: passive-1: #Fuel Speed enabled: true #Change this to false to disable this skill from working startingValue: 0.00 #Starting speed increase - allowedRange: [0.0, INF] #The allowed range of speed increase proportions, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of speed increase proportions, (INF or -INF represent positive and negative infinity) changePerLevel: 0.002 #Proportional speed boost per level skill-1: #Fuel Efficiency enabled: true #Change this to false to disable this skill from working @@ -2715,7 +2722,7 @@ enchanting: passive-1: #Quicker Development enabled: true #Change this to false to disable this skill from working startingValue: 0.00 #Starting minecraft xp boost - allowedRange: [0.0, INF] #The allowed range of minecraft xp boost proportions, (INF or -INF represent positive and negative infinity) + allowedRange: [ 0.0, INF ] #The allowed range of minecraft xp boost proportions, (INF or -INF represent positive and negative infinity) changePerLevel: 0.002 #Proportional minecraft xp boost per level skill-1: #Efficient Enchanting enabled: true #Change this to false to disable this skill from working @@ -2742,43 +2749,43 @@ enchanting: # You can also add the "XPcost" tag which requires and subtracts a specified number of levels on crafting level-1: recipes: - - output: [item: ENCHANTED_BOOK, amount: 1, enchantments: [[enchant: POWER, level: 1]] ] - recipe: [AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,BOW] + - output: [ item: ENCHANTED_BOOK, amount: 1, enchantments: [ [ enchant: POWER, level: 1 ] ] ] + recipe: [ AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,BOW ] xpCost: 1 - - output: [item: ENCHANTED_BOOK, amount: 1, enchantments: [[enchant: EFFICIENCY, level: 1]] ] - recipe: [AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,IRON_PICKAXE] + - output: [ item: ENCHANTED_BOOK, amount: 1, enchantments: [ [ enchant: EFFICIENCY, level: 1 ] ] ] + recipe: [ AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,IRON_PICKAXE ] xpCost: 1 level-2: recipes: - - output: [item: ENCHANTED_BOOK, amount: 1, enchantments: [[enchant: SHARPNESS, level: 1]] ] - recipe: [IRON_INGOT,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,IRON_SWORD] + - output: [ item: ENCHANTED_BOOK, amount: 1, enchantments: [ [ enchant: SHARPNESS, level: 1 ] ] ] + recipe: [ IRON_INGOT,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,IRON_SWORD ] xpCost: 1 - - output: [item: ENCHANTED_BOOK, amount: 1, enchantments: [[enchant: PROTECTION, level: 1]] ] - recipe: [AIR,IRON_INGOT,AIR,IRON_INGOT,PAPER,PAPER,AIR,PAPER,IRON_INGOT] + - output: [ item: ENCHANTED_BOOK, amount: 1, enchantments: [ [ enchant: PROTECTION, level: 1 ] ] ] + recipe: [ AIR,IRON_INGOT,AIR,IRON_INGOT,PAPER,PAPER,AIR,PAPER,IRON_INGOT ] xpCost: 1 level-3: recipes: - - output: [item: ENCHANTED_BOOK, amount: 1, enchantments: [[enchant: LUCK_OF_THE_SEA, level: 1]] ] - recipe: [RABBIT_FOOT,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,FISHING_ROD] + - output: [ item: ENCHANTED_BOOK, amount: 1, enchantments: [ [ enchant: LUCK_OF_THE_SEA, level: 1 ] ] ] + recipe: [ RABBIT_FOOT,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,FISHING_ROD ] xpCost: 1 - - output: [item: ENCHANTED_BOOK, amount: 1, enchantments: [[enchant: LURE, level: 1]] ] - recipe: [COD_BUCKET,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,FISHING_ROD] + - output: [ item: ENCHANTED_BOOK, amount: 1, enchantments: [ [ enchant: LURE, level: 1 ] ] ] + recipe: [ COD_BUCKET,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,FISHING_ROD ] xpCost: 1 level-4: recipes: - - output: [item: ENCHANTED_BOOK, amount: 1, enchantments: [[enchant: FROST_WALKER, level: 1]] ] - recipe: [ICE,PACKED_ICE,PACKED_ICE,PACKED_ICE,PAPER,PAPER,PACKED_ICE,PAPER,BLUE_ICE] + - output: [ item: ENCHANTED_BOOK, amount: 1, enchantments: [ [ enchant: FROST_WALKER, level: 1 ] ] ] + recipe: [ ICE,PACKED_ICE,PACKED_ICE,PACKED_ICE,PAPER,PAPER,PACKED_ICE,PAPER,BLUE_ICE ] xpCost: 2 - - output: [item: ENCHANTED_BOOK, amount: 1, enchantments: [[enchant: DEPTH_STRIDER, level: 1]] ] - recipe: [AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,NAUTILUS_SHELL] + - output: [ item: ENCHANTED_BOOK, amount: 1, enchantments: [ [ enchant: DEPTH_STRIDER, level: 1 ] ] ] + recipe: [ AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,NAUTILUS_SHELL ] xpCost: 2 level-5: recipes: - - output: [item: ENCHANTED_BOOK, amount: 1, enchantments: [[enchant: MENDING, level: 1]] ] - recipe: [AIR,DIAMOND_BLOCK,AIR,DIAMOND_BLOCK,PAPER,PAPER,AIR,PAPER,DIAMOND_BLOCK] + - output: [ item: ENCHANTED_BOOK, amount: 1, enchantments: [ [ enchant: MENDING, level: 1 ] ] ] + recipe: [ AIR,DIAMOND_BLOCK,AIR,DIAMOND_BLOCK,PAPER,PAPER,AIR,PAPER,DIAMOND_BLOCK ] xpCost: 10 - - output: [item: ENCHANTED_BOOK, amount: 1, enchantments: [[enchant: FORTUNE, level: 1]] ] - recipe: [AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,GOLD_BLOCK] + - output: [ item: ENCHANTED_BOOK, amount: 1, enchantments: [ [ enchant: FORTUNE, level: 1 ] ] ] + recipe: [ AIR,AIR,AIR,AIR,PAPER,PAPER,AIR,PAPER,GOLD_BLOCK ] xpCost: 2 skill-3: #Immortal Experience enabled: true #Change this to false to disable this skill from working diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 08b67f7..6886c71 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -2,13 +2,13 @@ name: FreeRPG version: ${project.version} main: mc.carlton.freerpg.FreeRPG api-version: 1.13 -authors: [JackCarlton] +authors: [ JackCarlton, AdvancedWipe ] description: Made from Spite -softdepend: [WorldGuard,PlaceholderAPI] +softdepend: [ WorldGuard,PlaceholderAPI ] commands: frpg: description: Main FreeRPG command, type /frpg help for more info - aliases: [rpgFree] + aliases: [ rpgFree ] spite: descriptions: Tells you what spite is good for. permissions: