diff --git a/.editorconfig b/.editorconfig index 82389cdc8..5d3f183aa 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,8 +14,25 @@ ij_smart_tabs = false ij_visual_guides = ij_wrap_on_typing = false -[*.dcl] -ij_declarative_keep_indents_on_empty_lines = false +[*.css] +ij_css_align_closing_brace_with_properties = false +ij_css_blank_lines_around_nested_selector = 1 +ij_css_blank_lines_between_blocks = 1 +ij_css_block_comment_add_space = false +ij_css_brace_placement = end_of_line +ij_css_enforce_quotes_on_format = false +ij_css_hex_color_long_format = false +ij_css_hex_color_lower_case = false +ij_css_hex_color_short_format = false +ij_css_hex_color_upper_case = false +ij_css_keep_blank_lines_in_code = 2 +ij_css_keep_indents_on_empty_lines = false +ij_css_keep_single_line_blocks = false +ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_css_space_after_colon = true +ij_css_space_before_opening_brace = true +ij_css_use_double_quotes = true +ij_css_value_alignment = do_not_align [*.java] ij_java_align_consecutive_assignments = false @@ -41,6 +58,7 @@ ij_java_align_multiline_throws_list = false ij_java_align_subsequent_simple_methods = false ij_java_align_throws_keyword = false ij_java_align_types_in_multi_catch = true +ij_java_annotation_new_line_in_record_component = 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 @@ -65,6 +83,7 @@ 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_blank_lines_between_record_components = 0 ij_java_block_brace_style = end_of_line ij_java_block_comment_add_space = false ij_java_block_comment_at_first_column = true @@ -79,6 +98,7 @@ ij_java_class_brace_style = end_of_line ij_java_class_count_to_use_import_on_demand = 5 ij_java_class_names_in_javadoc = 1 ij_java_deconstruction_list_wrap = normal +ij_java_delete_unused_module_imports = false ij_java_do_not_indent_top_level_class_members = false ij_java_do_not_wrap_after_single_annotation = false ij_java_do_not_wrap_after_single_annotation_in_parameter = false @@ -102,6 +122,21 @@ 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_entity_dd_prefix = +ij_java_entity_dd_suffix = EJB +ij_java_entity_eb_prefix = +ij_java_entity_eb_suffix = Bean +ij_java_entity_hi_prefix = +ij_java_entity_hi_suffix = Home +ij_java_entity_lhi_prefix = Local +ij_java_entity_lhi_suffix = Home +ij_java_entity_li_prefix = Local +ij_java_entity_li_suffix = +ij_java_entity_pk_class = java.lang.String +ij_java_entity_ri_prefix = +ij_java_entity_ri_suffix = +ij_java_entity_vo_prefix = +ij_java_entity_vo_suffix = VO ij_java_enum_constants_wrap = off ij_java_enum_field_annotation_wrap = off ij_java_extends_keyword_wrap = off @@ -109,6 +144,10 @@ ij_java_extends_list_wrap = off ij_java_field_annotation_wrap = split_into_lines ij_java_field_name_prefix = ij_java_field_name_suffix = +ij_java_filter_class_prefix = +ij_java_filter_class_suffix = +ij_java_filter_dd_prefix = +ij_java_filter_dd_suffix = ij_java_finally_on_new_line = false ij_java_for_brace_force = never ij_java_for_statement_new_line_after_left_paren = false @@ -139,12 +178,19 @@ 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_on_demand_import_from_same_package_first = true ij_java_layout_static_imports_separately = true ij_java_line_comment_add_space = false ij_java_line_comment_add_space_on_reformat = false ij_java_line_comment_at_first_column = true +ij_java_listener_class_prefix = +ij_java_listener_class_suffix = ij_java_local_variable_name_prefix = ij_java_local_variable_name_suffix = +ij_java_message_dd_prefix = +ij_java_message_dd_suffix = EJB +ij_java_message_eb_prefix = +ij_java_message_eb_suffix = Bean ij_java_method_annotation_wrap = split_into_lines ij_java_method_brace_style = end_of_line ij_java_method_call_chain_wrap = off @@ -167,8 +213,8 @@ 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_preserve_module_imports = true ij_java_record_components_wrap = normal -ij_java_repeat_annotations = ij_java_repeat_synchronized = true ij_java_replace_instanceof_and_cast = false ij_java_replace_null_check = true @@ -179,6 +225,24 @@ ij_java_resource_list_wrap = off ij_java_rparen_on_new_line_in_annotation = false ij_java_rparen_on_new_line_in_deconstruction_pattern = true ij_java_rparen_on_new_line_in_record_header = false +ij_java_servlet_class_prefix = +ij_java_servlet_class_suffix = +ij_java_servlet_dd_prefix = +ij_java_servlet_dd_suffix = +ij_java_session_dd_prefix = +ij_java_session_dd_suffix = EJB +ij_java_session_eb_prefix = +ij_java_session_eb_suffix = Bean +ij_java_session_hi_prefix = +ij_java_session_hi_suffix = Home +ij_java_session_lhi_prefix = Local +ij_java_session_lhi_suffix = Home +ij_java_session_li_prefix = Local +ij_java_session_li_suffix = +ij_java_session_ri_prefix = +ij_java_session_ri_suffix = +ij_java_session_si_prefix = +ij_java_session_si_suffix = Service ij_java_space_after_closing_angle_bracket_in_type_argument = false ij_java_space_after_colon = true ij_java_space_after_comma = true @@ -283,24 +347,6 @@ ij_java_wrap_first_method_in_call_chain = false ij_java_wrap_long_lines = false ij_java_wrap_semicolon_after_call_chain = false -[*.nbtt] -indent_style = tab -max_line_length = 150 -ij_continuation_indent_size = 4 -ij_nbtt_keep_indents_on_empty_lines = false -ij_nbtt_space_after_colon = true -ij_nbtt_space_after_comma = true -ij_nbtt_space_before_colon = true -ij_nbtt_space_before_comma = false -ij_nbtt_spaces_within_brackets = false -ij_nbtt_spaces_within_parentheses = 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 @@ -309,7 +355,7 @@ 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}] +[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.pom,*.rng,*.tld,*.wadl,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul}] ij_xml_align_attributes = true ij_xml_align_text = false ij_xml_attribute_wrap = normal @@ -338,198 +384,181 @@ ij_shell_redirect_followed_by_space = false ij_shell_switch_cases_indented = false ij_shell_use_unix_line_separator = true -[{*.gant,*.groovy,*.gy}] -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_enable_groovydoc_formatting = true -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_ginq_general_clause_wrap_policy = 2 -ij_groovy_ginq_having_wrap_policy = 1 -ij_groovy_ginq_indent_having_clause = true -ij_groovy_ginq_indent_on_clause = true -ij_groovy_ginq_on_wrap_policy = 1 -ij_groovy_ginq_space_after_keyword = true -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_add_space_on_reformat = 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 +[{*.cjs,*.es6,*.js,*.mjs}] +ij_continuation_indent_size = 4 +ij_javascript_align_imports = false +ij_javascript_align_multiline_array_initializer_expression = false +ij_javascript_align_multiline_binary_operation = false +ij_javascript_align_multiline_chained_methods = false +ij_javascript_align_multiline_extends_list = false +ij_javascript_align_multiline_for = true +ij_javascript_align_multiline_parameters = true +ij_javascript_align_multiline_parameters_in_calls = false +ij_javascript_align_multiline_ternary_operation = false +ij_javascript_align_object_properties = 0 +ij_javascript_align_union_types = false +ij_javascript_align_var_statements = 0 +ij_javascript_array_initializer_new_line_after_left_brace = false +ij_javascript_array_initializer_right_brace_on_new_line = false +ij_javascript_array_initializer_wrap = off +ij_javascript_assignment_wrap = off +ij_javascript_binary_operation_sign_on_next_line = false +ij_javascript_binary_operation_wrap = off +ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_javascript_blank_lines_after_imports = 1 +ij_javascript_blank_lines_around_class = 1 +ij_javascript_blank_lines_around_field = 0 +ij_javascript_blank_lines_around_function = 1 +ij_javascript_blank_lines_around_method = 1 +ij_javascript_block_brace_style = end_of_line +ij_javascript_block_comment_add_space = false +ij_javascript_block_comment_at_first_column = true +ij_javascript_call_parameters_new_line_after_left_paren = false +ij_javascript_call_parameters_right_paren_on_new_line = false +ij_javascript_call_parameters_wrap = off +ij_javascript_catch_on_new_line = false +ij_javascript_chained_call_dot_on_new_line = true +ij_javascript_class_brace_style = end_of_line +ij_javascript_class_decorator_wrap = split_into_lines +ij_javascript_class_field_decorator_wrap = off +ij_javascript_class_method_decorator_wrap = off +ij_javascript_comma_on_new_line = false +ij_javascript_do_while_brace_force = never +ij_javascript_else_on_new_line = false +ij_javascript_enforce_trailing_comma = keep +ij_javascript_extends_keyword_wrap = off +ij_javascript_extends_list_wrap = off +ij_javascript_field_prefix = _ +ij_javascript_file_name_style = relaxed +ij_javascript_finally_on_new_line = false +ij_javascript_for_brace_force = never +ij_javascript_for_statement_new_line_after_left_paren = false +ij_javascript_for_statement_right_paren_on_new_line = false +ij_javascript_for_statement_wrap = off +ij_javascript_force_quote_style = false +ij_javascript_force_semicolon_style = false +ij_javascript_function_expression_brace_style = end_of_line +ij_javascript_function_parameter_decorator_wrap = off +ij_javascript_if_brace_force = never +ij_javascript_import_merge_members = global +ij_javascript_import_prefer_absolute_path = global +ij_javascript_import_sort_members = true +ij_javascript_import_sort_module_name = false +ij_javascript_import_use_node_resolution = true +ij_javascript_imports_wrap = on_every_item +ij_javascript_indent_case_from_switch = true +ij_javascript_indent_chained_calls = true +ij_javascript_indent_package_children = 0 +ij_javascript_jsx_attribute_value = braces +ij_javascript_keep_blank_lines_in_code = 2 +ij_javascript_keep_first_column_comment = true +ij_javascript_keep_indents_on_empty_lines = false +ij_javascript_keep_line_breaks = true +ij_javascript_keep_simple_blocks_in_one_line = false +ij_javascript_keep_simple_methods_in_one_line = false +ij_javascript_line_comment_add_space = true +ij_javascript_line_comment_at_first_column = false +ij_javascript_method_brace_style = end_of_line +ij_javascript_method_call_chain_wrap = off +ij_javascript_method_parameters_new_line_after_left_paren = false +ij_javascript_method_parameters_right_paren_on_new_line = false +ij_javascript_method_parameters_wrap = off +ij_javascript_object_literal_wrap = on_every_item +ij_javascript_object_types_wrap = on_every_item +ij_javascript_parentheses_expression_new_line_after_left_paren = false +ij_javascript_parentheses_expression_right_paren_on_new_line = false +ij_javascript_place_assignment_sign_on_next_line = false +ij_javascript_prefer_as_type_cast = false +ij_javascript_prefer_explicit_types_function_expression_returns = false +ij_javascript_prefer_explicit_types_function_returns = false +ij_javascript_prefer_explicit_types_vars_fields = false +ij_javascript_prefer_parameters_wrap = false +ij_javascript_property_prefix = +ij_javascript_reformat_c_style_comments = false +ij_javascript_space_after_colon = true +ij_javascript_space_after_comma = true +ij_javascript_space_after_dots_in_rest_parameter = false +ij_javascript_space_after_generator_mult = true +ij_javascript_space_after_property_colon = true +ij_javascript_space_after_quest = true +ij_javascript_space_after_type_colon = true +ij_javascript_space_after_unary_not = false +ij_javascript_space_before_async_arrow_lparen = true +ij_javascript_space_before_catch_keyword = true +ij_javascript_space_before_catch_left_brace = true +ij_javascript_space_before_catch_parentheses = true +ij_javascript_space_before_class_lbrace = true +ij_javascript_space_before_class_left_brace = true +ij_javascript_space_before_colon = true +ij_javascript_space_before_comma = false +ij_javascript_space_before_do_left_brace = true +ij_javascript_space_before_else_keyword = true +ij_javascript_space_before_else_left_brace = true +ij_javascript_space_before_finally_keyword = true +ij_javascript_space_before_finally_left_brace = true +ij_javascript_space_before_for_left_brace = true +ij_javascript_space_before_for_parentheses = true +ij_javascript_space_before_for_semicolon = false +ij_javascript_space_before_function_left_parenth = true +ij_javascript_space_before_generator_mult = false +ij_javascript_space_before_if_left_brace = true +ij_javascript_space_before_if_parentheses = true +ij_javascript_space_before_method_call_parentheses = false +ij_javascript_space_before_method_left_brace = true +ij_javascript_space_before_method_parentheses = false +ij_javascript_space_before_property_colon = false +ij_javascript_space_before_quest = true +ij_javascript_space_before_switch_left_brace = true +ij_javascript_space_before_switch_parentheses = true +ij_javascript_space_before_try_left_brace = true +ij_javascript_space_before_type_colon = false +ij_javascript_space_before_unary_not = false +ij_javascript_space_before_while_keyword = true +ij_javascript_space_before_while_left_brace = true +ij_javascript_space_before_while_parentheses = true +ij_javascript_spaces_around_additive_operators = true +ij_javascript_spaces_around_arrow_function_operator = true +ij_javascript_spaces_around_assignment_operators = true +ij_javascript_spaces_around_bitwise_operators = true +ij_javascript_spaces_around_equality_operators = true +ij_javascript_spaces_around_logical_operators = true +ij_javascript_spaces_around_multiplicative_operators = true +ij_javascript_spaces_around_relational_operators = true +ij_javascript_spaces_around_shift_operators = true +ij_javascript_spaces_around_unary_operator = false +ij_javascript_spaces_within_array_initializer_brackets = false +ij_javascript_spaces_within_brackets = false +ij_javascript_spaces_within_catch_parentheses = false +ij_javascript_spaces_within_for_parentheses = false +ij_javascript_spaces_within_if_parentheses = false +ij_javascript_spaces_within_imports = false +ij_javascript_spaces_within_interpolation_expressions = false +ij_javascript_spaces_within_method_call_parentheses = false +ij_javascript_spaces_within_method_parentheses = false +ij_javascript_spaces_within_object_literal_braces = false +ij_javascript_spaces_within_object_type_braces = true +ij_javascript_spaces_within_parentheses = false +ij_javascript_spaces_within_switch_parentheses = false +ij_javascript_spaces_within_type_assertion = false +ij_javascript_spaces_within_union_types = true +ij_javascript_spaces_within_while_parentheses = false +ij_javascript_special_else_if_treatment = true +ij_javascript_ternary_operation_signs_on_next_line = false +ij_javascript_ternary_operation_wrap = off +ij_javascript_union_types_wrap = on_every_item +ij_javascript_use_chained_calls_group_indents = false +ij_javascript_use_double_quotes = true +ij_javascript_use_explicit_js_extension = auto +ij_javascript_use_import_type = auto +ij_javascript_use_path_mapping = always +ij_javascript_use_public_modifier = false +ij_javascript_use_semicolon_after_statement = true +ij_javascript_var_declaration_wrap = normal +ij_javascript_while_brace_force = never +ij_javascript_while_on_new_line = false +ij_javascript_wrap_comments = false -[{*.har,*.json,*.jsonc,*.png.mcmeta}] +[{*.har,*.jsb2,*.jsb3,*.json,*.jsonc,*.png.mcmeta,*.postman_collection,*.postman_environment,.babelrc,.eslintrc,.prettierrc,.stylelintrc,.ws-context,jest.config,mcmod.info,pack.mcmeta}] indent_size = 2 ij_json_array_wrapping = split_into_lines ij_json_keep_blank_lines_in_code = 0 @@ -582,7 +611,17 @@ 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_collection_literal_expression = false +ij_kotlin_allow_trailing_comma_context_receiver_list = true +ij_kotlin_allow_trailing_comma_destructuring_declaration = true +ij_kotlin_allow_trailing_comma_function_literal = true +ij_kotlin_allow_trailing_comma_indices = false ij_kotlin_allow_trailing_comma_on_call_site = false +ij_kotlin_allow_trailing_comma_type_argument_list = false +ij_kotlin_allow_trailing_comma_type_parameter_list = true +ij_kotlin_allow_trailing_comma_value_argument_list = false +ij_kotlin_allow_trailing_comma_value_parameter_list = true +ij_kotlin_allow_trailing_comma_when_entry = true ij_kotlin_assignment_wrap = normal ij_kotlin_blank_lines_after_class_header = 0 ij_kotlin_blank_lines_around_block_when_branches = 0 @@ -606,6 +645,7 @@ 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_function_context_parameters_wrap = split_into_lines ij_kotlin_if_rparen_on_new_line = true ij_kotlin_import_nested_classes = false ij_kotlin_imports_layout = *,java.**,javax.**,kotlin.**,^ @@ -631,6 +671,7 @@ 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_property_context_parameters_wrap = split_into_lines ij_kotlin_space_after_comma = true ij_kotlin_space_after_extend_colon = true ij_kotlin_space_after_type_colon = true @@ -678,7 +719,13 @@ ij_markdown_min_lines_between_paragraphs = 1 ij_markdown_wrap_text_if_long = true ij_markdown_wrap_text_inside_blockquotes = true -[{*.toml,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,poetry.lock,uv.lock}] +[{*.properties,spring.handlers,spring.schemas}] +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 + +[{*.toml,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,pdm.lock,poetry.lock,uv.lock}] ij_toml_keep_indents_on_empty_lines = false [{*.yaml,*.yml}] @@ -696,4 +743,3 @@ 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/.github/workflows/build.yml b/.github/workflows/build.yml index f640c9605..cd635174c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,7 @@ jobs: - name: Upload JAR if: ${{ github.event_name != 'pull_request'}} - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 with: name: vane-${{ matrix.project }}-${{ env.git_hash }}.jar path: target/vane-${{ matrix.project }}-*.jar diff --git a/.github/workflows/lint-commit.yml b/.github/workflows/lint-commit.yml index d12a63cf7..7fbf8897a 100644 --- a/.github/workflows/lint-commit.yml +++ b/.github/workflows/lint-commit.yml @@ -8,13 +8,13 @@ jobs: if: always() && github.repository == 'oddlama/vane' steps: - - uses: actions/checkout@v6.0.1 + - uses: actions/checkout@v6.0.2 with: fetch-depth: 0 persist-credentials: false ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-node@v6.1.0 + - uses: actions/setup-node@v6.3.0 with: node-version: 24 - run: | diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e1115505c..b038cbe6d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,9 +1,9 @@ [versions] paper = "1.21.11-R0.1-SNAPSHOT" -bstats = "3.1.0" +bstats = "3.2.1" [libraries] -annotations = {group = "org.jetbrains", name = "annotations", version = "26.0.2-1"} +annotations = {group = "org.jetbrains", name = "annotations", version = "26.1.0"} reflections = {group = "org.reflections", name = "reflections", version = "0.10.2"} commonsLang = {group = "org.apache.commons", name = "commons-lang3", version = "3.20.0"} commonsText = {group = "org.apache.commons", name = "commons-text", version = "1.15.0"} @@ -16,8 +16,11 @@ bstatsBase = {group = "org.bstats", name = "bstats-base", version.ref = "bstats" bstatsBukkit = {group = "org.bstats", name = "bstats-bukkit", version.ref = "bstats"} bstatsVelocity = {group = "org.bstats", name = "bstats-velocity", version.ref = "bstats"} vault = {group = "com.github.MilkBowl", name = "VaultAPI", version = "1.7.1"} -velocity = {group = "com.velocitypowered", name = "velocity-api", version = "3.4.0-SNAPSHOT"} -packetEvents = {group = "com.github.retrooper", name = "packetevents-spigot", version = "2.11.1"} +velocity = {group = "com.velocitypowered", name = "velocity-api", version = "3.5.0-SNAPSHOT"} +packetEvents = {group = "com.github.retrooper", name = "packetevents-spigot", version = "2.11.2"} + +# spotbugs / findbugs annotations (avoids missing annotation warnings) +spotbugsAnnotations = {group = "com.github.spotbugs", name = "spotbugs-annotations", version = "4.9.8"} # maps dynmap = {group = "us.dynmap", name = "DynmapCoreAPI", version = "3.7-beta-6"} @@ -26,5 +29,5 @@ bluemap = {group = "de.bluecolored", name = "bluemap-api", version = "2.7.7"} [plugins] paperweightUserdev = {id = "io.papermc.paperweight.userdev", version = "2.0.0-beta.19"} runPaper = {id = "xyz.jpenilla.run-paper", version = "3.0.2"} -shadow = {id = "com.gradleup.shadow", version = "9.3.0"} -blossom = {id = "net.kyori.blossom", version = "2.2.0"} \ No newline at end of file +shadow = {id = "com.gradleup.shadow", version = "9.3.2"} +blossom = {id = "net.kyori.blossom", version = "2.2.0"} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index f8e1ee312..d997cfc60 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 23449a2b5..dbc3ce4a0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index adff685a0..0262dcbd5 100755 --- a/gradlew +++ b/gradlew @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/vane-annotations/src/main/java/org/oddlama/vane/annotation/enchantment/VaneEnchantment.java b/vane-annotations/src/main/java/org/oddlama/vane/annotation/enchantment/VaneEnchantment.java index 53848fa87..857410385 100644 --- a/vane-annotations/src/main/java/org/oddlama/vane/annotation/enchantment/VaneEnchantment.java +++ b/vane-annotations/src/main/java/org/oddlama/vane/annotation/enchantment/VaneEnchantment.java @@ -4,7 +4,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.bukkit.enchantments.EnchantmentTarget; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @@ -23,7 +22,6 @@ boolean generate_in_treasure() default false; - EnchantmentTarget target() default EnchantmentTarget.BREAKABLE; boolean allow_custom() default false; } diff --git a/vane-core/build.gradle.kts b/vane-core/build.gradle.kts index 7c8397e35..4005e17df 100644 --- a/vane-core/build.gradle.kts +++ b/vane-core/build.gradle.kts @@ -38,6 +38,8 @@ val resource_pack_sha1 by lazy { sha1_hash_string } +val projectProperties = project.properties + tasks { shadowJar { dependencies { @@ -58,7 +60,7 @@ tasks { processResources { filesMatching("vane-core.properties") { - expand(project.properties + mapOf("resource_pack_sha1" to resource_pack_sha1)) + expand(projectProperties + mapOf("resource_pack_sha1" to resource_pack_sha1)) } } } \ No newline at end of file diff --git a/vane-core/src/main/java/org/oddlama/vane/core/Core.java b/vane-core/src/main/java/org/oddlama/vane/core/Core.java index aacef5b7b..41d4eaf6e 100644 --- a/vane-core/src/main/java/org/oddlama/vane/core/Core.java +++ b/vane-core/src/main/java/org/oddlama/vane/core/Core.java @@ -175,7 +175,7 @@ public void unfreeze_registries() { ); // Since 1.20.2 this is also needed for enchantments: } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { - e.printStackTrace(); + log.log(Level.SEVERE, "Failed to unfreeze registries", e); } } diff --git a/vane-core/src/main/java/org/oddlama/vane/core/enchantments/CustomEnchantment.java b/vane-core/src/main/java/org/oddlama/vane/core/enchantments/CustomEnchantment.java index 6c570b258..a873b82d2 100644 --- a/vane-core/src/main/java/org/oddlama/vane/core/enchantments/CustomEnchantment.java +++ b/vane-core/src/main/java/org/oddlama/vane/core/enchantments/CustomEnchantment.java @@ -9,7 +9,6 @@ import net.kyori.adventure.text.format.TextDecoration; import org.bukkit.NamespacedKey; import org.bukkit.enchantments.Enchantment; -import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; import org.oddlama.vane.annotation.enchantment.Rarity; @@ -176,15 +175,6 @@ public final boolean generate_in_treasure() { return annotation.generate_in_treasure(); } - /** - * Determines which item types this enchantment can be applied to. {@link - * #can_enchant(ItemStack)} can be used to further limit the applicable items. Always reflects - * the annotation value {@link VaneEnchantment#target()}. - */ - public final EnchantmentTarget target() { - return annotation.target(); - } - /** * Determines the enchantment rarity. Always reflects the annotation value {@link * VaneEnchantment#rarity()}. @@ -208,13 +198,11 @@ public boolean is_compatible(@NotNull Enchantment other) { /** * Determines if this enchantment can be applied to the given item. By default, this returns - * true if the {@link #target()} category includes the given itemstack. Unfortunately, this - * method cannot be used to widen the allowed items, just to narrow it (limitation due to - * minecraft server internals). So for best results, always check super.can_enchant first when - * overriding. + * true for all items. Item compatibility is now primarily managed by tags in the registry system. + * This method can still be used for additional custom validation if needed. */ public boolean can_enchant(@NotNull ItemStack item_stack) { - return annotation.target().includes(item_stack); + return true; } public RecipeList default_recipes() { diff --git a/vane-core/src/main/java/org/oddlama/vane/core/item/CustomItemHelper.java b/vane-core/src/main/java/org/oddlama/vane/core/item/CustomItemHelper.java index cf6411f13..077b44841 100644 --- a/vane-core/src/main/java/org/oddlama/vane/core/item/CustomItemHelper.java +++ b/vane-core/src/main/java/org/oddlama/vane/core/item/CustomItemHelper.java @@ -9,6 +9,7 @@ import org.oddlama.vane.core.Core; import org.oddlama.vane.core.item.api.CustomItem; import org.oddlama.vane.util.StorageUtil; +import java.util.List; public class CustomItemHelper { @@ -22,16 +23,20 @@ public class CustomItemHelper { public static final NamespacedKey CUSTOM_ITEM_VERSION = StorageUtil.namespaced_key("vane", "custom_item_version"); /** - * Internal function. Used as a dispatcher to update internal information and then call {@link - * #updateItemStack(ItemStack)} to let the user update information. This prevents problems with - * information de-sync in case the user would forget to call super. + * Internal function. Acts as a dispatcher that updates internal metadata on the provided + * ItemStack (persistent-data tags, model data, durability) and then calls the + * CustomItem-specific update method so subclasses can apply any additional changes. + * This prevents information de-sync in case a subclass forgets to call super. */ public static ItemStack updateItemStack(final CustomItem customItem, @NotNull final ItemStack itemStack) { itemStack.editMeta(meta -> { final var data = meta.getPersistentDataContainer(); data.set(CUSTOM_ITEM_IDENTIFIER, PersistentDataType.STRING, customItem.key().toString()); data.set(CUSTOM_ITEM_VERSION, PersistentDataType.INTEGER, customItem.version()); - meta.setCustomModelData(customItem.customModelData()); + // Use the new CustomModelDataComponent API instead of the deprecated setCustomModelData(Integer). + final var customModelDataComponent = meta.getCustomModelDataComponent(); + customModelDataComponent.setFloats(List.of((float) customItem.customModelData())); + meta.setCustomModelDataComponent(customModelDataComponent); }); DurabilityManager.initialize_or_update_max(customItem, itemStack); diff --git a/vane-core/src/main/java/org/oddlama/vane/core/item/ExistingItemConverter.java b/vane-core/src/main/java/org/oddlama/vane/core/item/ExistingItemConverter.java index 946112c85..7f65e9e61 100644 --- a/vane-core/src/main/java/org/oddlama/vane/core/item/ExistingItemConverter.java +++ b/vane-core/src/main/java/org/oddlama/vane/core/item/ExistingItemConverter.java @@ -94,8 +94,14 @@ private void process_inventory(@NotNull Inventory inventory) { // Update custom items to a new version, or if another detectable property changed. final var key_and_version = CustomItemHelper.customItemTagsFromItemStack(is); final var meta = is.getItemMeta(); + final var modelDataList = meta.getCustomModelDataComponent().getFloats(); + final Integer modelDataInt = (!modelDataList.isEmpty() && modelDataList.getFirst() != null) + ? modelDataList.getFirst().intValue() + : null; + if ( - meta.getCustomModelData() != custom_item.customModelData() || + modelDataInt == null || + modelDataInt != custom_item.customModelData() || is.getType() != custom_item.baseMaterial() || key_and_version.getRight() != custom_item.version()) { // Also includes durability max update. diff --git a/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackDevServer.java b/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackDevServer.java index 2ac079039..b1ca20f27 100644 --- a/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackDevServer.java +++ b/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackDevServer.java @@ -15,25 +15,37 @@ public class ResourcePackDevServer implements HttpHandler { private final ResourcePackDistributor resource_pack_distributor; private final File file; + private HttpServer httpServer; public ResourcePackDevServer(ResourcePackDistributor resource_pack_distributor, File file) { this.resource_pack_distributor = resource_pack_distributor; this.file = file; } + public void stop() { + if (httpServer != null) { + httpServer.stop(0); + httpServer = null; + } + } + @SuppressWarnings({ "deprecation", "UnstableApiUsage" }) public void serve() { try { - final HttpServer httpServer = HttpServer.create(new InetSocketAddress(9000), 0); + httpServer = HttpServer.create(new InetSocketAddress(9000), 0); var hash = com.google.common.io.Files.asByteSource(this.file).hash(Hashing.sha1()); resource_pack_distributor.pack_sha1 = hash.toString(); resource_pack_distributor.pack_url = "http://localhost:9000/vane-resource-pack.zip"; - httpServer.createContext("/", this); - httpServer.setExecutor(null); - httpServer.start(); + this.httpServer.createContext("/", this); + this.httpServer.setExecutor(null); + this.httpServer.start(); } catch (IOException e) { - e.printStackTrace(); + resource_pack_distributor.get_module().log.log( + java.util.logging.Level.SEVERE, + "Failed to start resource pack dev server", + e + ); } } diff --git a/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackDistributor.java b/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackDistributor.java index 92efa26c5..509914857 100644 --- a/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackDistributor.java +++ b/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackDistributor.java @@ -81,8 +81,12 @@ public void on_enable() { dev_server = new ResourcePackDevServer(this, pack_output); dev_server.serve(); file_watcher.watch_for_changes(); - } catch (IOException | InterruptedException ignored) { - ignored.printStackTrace(); + } catch (IOException | InterruptedException e) { + get_module().log.log( + java.util.logging.Level.SEVERE, + "Failed to initialize resource pack dev server or file watcher", + e + ); } get_module().log.info("Setting up dev lazy server"); @@ -146,6 +150,26 @@ public void on_enable() { } } + @Override + public void on_disable() { + // Release all pending configuration latches so blocked threads can exit + for (var latch : latches.values()) { + latch.countDown(); + } + latches.clear(); + + if (file_watcher != null) { + file_watcher.stop(); + file_watcher = null; + } + if (dev_server != null) { + dev_server.stop(); + dev_server = null; + } + + super.on_disable(); + } + @EventHandler public void on_player_async_connection_configure(AsyncPlayerConnectionConfigureEvent event) { var profile_uuid = event.getConnection().getProfile().getId(); diff --git a/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackFileWatcher.java b/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackFileWatcher.java index 6bc594bb6..640fd192c 100644 --- a/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackFileWatcher.java +++ b/vane-core/src/main/java/org/oddlama/vane/core/resourcepack/ResourcePackFileWatcher.java @@ -15,6 +15,8 @@ public class ResourcePackFileWatcher { private final ResourcePackDistributor resource_pack_distributor; private final File file; + private WatchService eyes; + private org.bukkit.scheduler.BukkitTask watchTask; public ResourcePackFileWatcher(ResourcePackDistributor resource_pack_distributor, File file) throws IOException, InterruptedException { @@ -27,11 +29,24 @@ public void watch_for_changes() throws IOException { var lang_file_match = FileSystems.getDefault().getPathMatcher("glob:**/lang-*.yml"); register_directories(Paths.get("plugins"), eyes, this::is_vane_module_folder); - watch_async(eyes, lang_file_match, this::update_and_send_resource_pack).runTaskAsynchronously( + watchTask = watch_async(eyes, lang_file_match, this::update_and_send_resource_pack).runTaskAsynchronously( resource_pack_distributor.get_module() ); } + public void stop() { + if (watchTask != null) { + watchTask.cancel(); + watchTask = null; + } + if (eyes != null) { + try { + eyes.close(); + } catch (IOException ignored) {} + eyes = null; + } + } + private void update_and_send_resource_pack() { resource_pack_distributor.counter++; resource_pack_distributor.get_module().generate_resource_pack(); @@ -73,8 +88,11 @@ public void run() { final WatchKey key; try { key = eyes.take(); + } catch (java.nio.file.ClosedWatchServiceException e) { + return; } catch (InterruptedException e) { - throw new RuntimeException(e); + Thread.currentThread().interrupt(); + return; } // process events for (WatchEvent event : key.pollEvents()) { diff --git a/vane-core/src/main/java/org/oddlama/vane/util/BlockUtil.java b/vane-core/src/main/java/org/oddlama/vane/util/BlockUtil.java index 1a9b47039..9706ca666 100644 --- a/vane-core/src/main/java/org/oddlama/vane/util/BlockUtil.java +++ b/vane-core/src/main/java/org/oddlama/vane/util/BlockUtil.java @@ -345,12 +345,12 @@ public static RaytraceDominantFaceResult raytrace_dominant_face(final LivingEnti } public static String texture_from_skull(final Skull skull) { - final var profile = skull.getPlayerProfile(); + final var profile = skull.getProfile(); if (profile == null) { return null; } - for (final var property : profile.getProperties()) { + for (final var property : profile.properties()) { if ("textures".equals(property.getName())) { return property.getValue(); } diff --git a/vane-core/src/main/java/org/oddlama/vane/util/Nms.java b/vane-core/src/main/java/org/oddlama/vane/util/Nms.java index 9caaa753f..493868548 100644 --- a/vane-core/src/main/java/org/oddlama/vane/util/Nms.java +++ b/vane-core/src/main/java/org/oddlama/vane/util/Nms.java @@ -13,14 +13,11 @@ import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; -import net.minecraft.tags.ItemTags; -import net.minecraft.tags.TagKey; import net.minecraft.util.datafix.DataFixers; import net.minecraft.util.datafix.fixes.References; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.CreativeModeTabs; -import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -30,7 +27,6 @@ import org.bukkit.craftbukkit.entity.CraftEntity; import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; @@ -49,40 +45,6 @@ public static org.bukkit.inventory.ItemStack bukkit_item_stack(ItemStack stack) return CraftItemStack.asCraftMirror(stack); } - public static TagKey enchantment_slot_type(EnchantmentTarget target) { - switch (target) { - case ARMOR: - return ItemTags.ARMOR_ENCHANTABLE; - case ARMOR_FEET: - return ItemTags.FOOT_ARMOR_ENCHANTABLE; - case ARMOR_HEAD: - return ItemTags.HEAD_ARMOR_ENCHANTABLE; - case ARMOR_LEGS: - return ItemTags.LEG_ARMOR_ENCHANTABLE; - case ARMOR_TORSO: - return ItemTags.CHEST_ARMOR_ENCHANTABLE; - case TOOL: - return ItemTags.MINING_ENCHANTABLE; - case WEAPON: - return ItemTags.WEAPON_ENCHANTABLE; - case BOW: - return ItemTags.BOW_ENCHANTABLE; - case FISHING_ROD: - return ItemTags.FISHING_ENCHANTABLE; - case BREAKABLE: - return ItemTags.DURABILITY_ENCHANTABLE; - case WEARABLE: - return ItemTags.EQUIPPABLE_ENCHANTABLE; - case TRIDENT: - return ItemTags.TRIDENT_ENCHANTABLE; - case CROSSBOW: - return ItemTags.CROSSBOW_ENCHANTABLE; - case VANISHABLE: - return ItemTags.VANISHING_ENCHANTABLE; - default: - return null; - } - } public static ItemStack item_handle(org.bukkit.inventory.ItemStack item_stack) { if (item_stack == null) { diff --git a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/GrapplingHook.java b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/GrapplingHook.java index 863201245..02cd57740 100644 --- a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/GrapplingHook.java +++ b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/GrapplingHook.java @@ -1,7 +1,6 @@ package org.oddlama.vane.enchantments.enchantments; import org.bukkit.Material; -import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerFishEvent; @@ -23,8 +22,7 @@ name = "grappling_hook", max_level = 3, rarity = Rarity.UNCOMMON, - treasure = true, - target = EnchantmentTarget.FISHING_ROD + treasure = true ) public class GrapplingHook extends CustomEnchantment { diff --git a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/HellBent.java b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/HellBent.java index 9bfc59f20..f79eb5e27 100644 --- a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/HellBent.java +++ b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/HellBent.java @@ -1,7 +1,6 @@ package org.oddlama.vane.enchantments.enchantments; import org.bukkit.Material; -import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -17,7 +16,7 @@ import org.oddlama.vane.core.module.Context; import org.oddlama.vane.enchantments.Enchantments; -@VaneEnchantment(name = "hell_bent", rarity = Rarity.COMMON, treasure = true, target = EnchantmentTarget.ARMOR_HEAD) +@VaneEnchantment(name = "hell_bent", rarity = Rarity.COMMON, treasure = true) public class HellBent extends CustomEnchantment { public HellBent(Context context) { diff --git a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Leafchopper.java b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Leafchopper.java index b844e53b3..6cfe36778 100644 --- a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Leafchopper.java +++ b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Leafchopper.java @@ -4,7 +4,6 @@ import org.bukkit.Sound; import org.bukkit.SoundCategory; import org.bukkit.block.data.type.Leaves; -import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.block.Action; @@ -18,7 +17,7 @@ import org.oddlama.vane.core.module.Context; import org.oddlama.vane.enchantments.Enchantments; -@VaneEnchantment(name = "leafchopper", rarity = Rarity.COMMON, treasure = true, target = EnchantmentTarget.TOOL) +@VaneEnchantment(name = "leafchopper", rarity = Rarity.COMMON, treasure = true) public class Leafchopper extends CustomEnchantment { public Leafchopper(Context context) { diff --git a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Lightning.java b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Lightning.java index efd495865..9aed5c9b9 100644 --- a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Lightning.java +++ b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Lightning.java @@ -1,7 +1,6 @@ package org.oddlama.vane.enchantments.enchantments; import org.bukkit.Material; -import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -22,8 +21,7 @@ name = "lightning", max_level = 1, rarity = Rarity.RARE, - treasure = true, - target = EnchantmentTarget.WEAPON + treasure = true ) public class Lightning extends CustomEnchantment { diff --git a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Rake.java b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Rake.java index af1ca39b8..29aa131fc 100644 --- a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Rake.java +++ b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Rake.java @@ -6,7 +6,6 @@ import static org.oddlama.vane.util.PlayerUtil.till_block; import org.bukkit.Material; -import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.block.Action; @@ -19,7 +18,7 @@ import org.oddlama.vane.core.module.Context; import org.oddlama.vane.enchantments.Enchantments; -@VaneEnchantment(name = "rake", max_level = 4, rarity = Rarity.COMMON, treasure = true, target = EnchantmentTarget.TOOL) +@VaneEnchantment(name = "rake", max_level = 4, rarity = Rarity.COMMON, treasure = true) public class Rake extends CustomEnchantment { public Rake(Context context) { diff --git a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Seeding.java b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Seeding.java index fa67c6ee4..13f8ee337 100644 --- a/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Seeding.java +++ b/vane-enchantments/src/main/java/org/oddlama/vane/enchantments/enchantments/Seeding.java @@ -9,7 +9,6 @@ import static org.oddlama.vane.util.PlayerUtil.swing_arm; import org.bukkit.Material; -import org.bukkit.enchantments.EnchantmentTarget; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.block.Action; @@ -26,8 +25,7 @@ name = "seeding", max_level = 4, rarity = Rarity.COMMON, - treasure = true, - target = EnchantmentTarget.TOOL + treasure = true ) public class Seeding extends CustomEnchantment { diff --git a/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/Maintenance.java b/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/Maintenance.java index 88ce647a4..e07d149ae 100644 --- a/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/Maintenance.java +++ b/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/Maintenance.java @@ -191,7 +191,7 @@ public void save() { writer.write(Long.toString(start)); } } catch (IOException e) { - e.printStackTrace(); + plugin.get_logger().log(Level.SEVERE, "Failed to save maintenance state to file", e); } } diff --git a/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/VaneProxyPlugin.java b/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/VaneProxyPlugin.java index fad55c2a3..c6f7c974a 100644 --- a/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/VaneProxyPlugin.java +++ b/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/VaneProxyPlugin.java @@ -142,7 +142,7 @@ public void try_start_server(ManagedServer server) { ); } } catch (Exception e) { - e.printStackTrace(); + get_logger().log(Level.SEVERE, "Failed to start server '" + server.id() + "'", e); } server_starting = false; diff --git a/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/listeners/PreLoginEvent.java b/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/listeners/PreLoginEvent.java index 93b1b1a42..c4690a84c 100644 --- a/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/listeners/PreLoginEvent.java +++ b/vane-proxy-core/src/main/java/org/oddlama/vane/proxycore/listeners/PreLoginEvent.java @@ -105,7 +105,9 @@ public static void register_auth_multiplex_player( out.writeUTF(multiplexed_player.new_uuid.toString()); out.writeUTF(multiplexed_player.new_name); } catch (IOException e) { - e.printStackTrace(); + // This should not happen in a ByteArrayOutputStream, but log it for diagnostics + java.util.logging.Logger.getLogger(PreLoginEvent.class.getName()) + .log(java.util.logging.Level.SEVERE, "Failed to write multiplexed player data", e); } server.sendData(stream.toByteArray()); diff --git a/vane-velocity/build.gradle.kts b/vane-velocity/build.gradle.kts index 245f46a6f..981ba51e7 100644 --- a/vane-velocity/build.gradle.kts +++ b/vane-velocity/build.gradle.kts @@ -4,6 +4,7 @@ plugins { dependencies { compileOnly(fileTree(mapOf("dir" to "external", "include" to listOf("*.jar")))) + compileOnly(libs.spotbugsAnnotations) implementation(libs.velocity) annotationProcessor(libs.velocity) implementation(libs.bstatsVelocity) @@ -15,7 +16,7 @@ dependencies { java { toolchain { - languageVersion = JavaLanguageVersion.of(17) + languageVersion = JavaLanguageVersion.of(21) } } diff --git a/vane-velocity/external/velocity-proxy-3.4.0-SNAPSHOT.jar b/vane-velocity/external/velocity-3.5.0-SNAPSHOT.jar similarity index 65% rename from vane-velocity/external/velocity-proxy-3.4.0-SNAPSHOT.jar rename to vane-velocity/external/velocity-3.5.0-SNAPSHOT.jar index 28ac08178..65a0ae986 100644 Binary files a/vane-velocity/external/velocity-proxy-3.4.0-SNAPSHOT.jar and b/vane-velocity/external/velocity-3.5.0-SNAPSHOT.jar differ diff --git a/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyDisconnectListener.java b/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyDisconnectListener.java index 6f92444d5..97017bbd7 100644 --- a/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyDisconnectListener.java +++ b/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyDisconnectListener.java @@ -15,7 +15,7 @@ public ProxyDisconnectListener(Velocity velocity) { this.velocity = velocity; } - @Subscribe(order = PostOrder.LAST) + @Subscribe(priority = 0) public void disconnect(DisconnectEvent event) { final var uuid = event.getPlayer().getUniqueId(); velocity.get_multiplexed_uuids().remove(uuid); diff --git a/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyGameProfileRequestListener.java b/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyGameProfileRequestListener.java index 396a5e7b5..b854e8690 100644 --- a/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyGameProfileRequestListener.java +++ b/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyGameProfileRequestListener.java @@ -19,7 +19,7 @@ public ProxyGameProfileRequestListener(Velocity velocity) { this.velocity = velocity; } - @Subscribe(order = PostOrder.LAST) + @Subscribe(priority = 0) public void game_profile_request(final GameProfileRequestEvent event) { // ======= Check we even have a valid pending login ======= diff --git a/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyLoginListener.java b/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyLoginListener.java index 61195f1b6..bd0d4ec36 100644 --- a/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyLoginListener.java +++ b/vane-velocity/src/main/java/org/oddlama/velocity/listeners/ProxyLoginListener.java @@ -21,7 +21,7 @@ public ProxyLoginListener(Velocity velocity) { this.velocity = velocity; } - @Subscribe(order = PostOrder.LAST) + @Subscribe(priority = 0) public void login(com.velocitypowered.api.event.connection.LoginEvent event) { if (!event.getResult().isAllowed()) return;