mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-05-20 08:40:26 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd86664e5e | |||
| b9ac23baba | |||
| c620c17ac6 | |||
| c1232298b3 | |||
| 373f6a5fe3 | |||
| fb505fe28b | |||
| 3594beb406 | |||
| 2b142b282f | |||
| f1bda5c907 | |||
| dca8dd4c4f | |||
| 54335bfd70 | |||
| ddbae360c3 | |||
| 9718c99149 | |||
| 32cc38c6b2 | |||
| 965d0681eb | |||
| f137fe2b7a | |||
| 72a4909145 |
+101
-348
@@ -8,156 +8,142 @@ indent_style = space
|
|||||||
insert_final_newline = false
|
insert_final_newline = false
|
||||||
max_line_length = 140
|
max_line_length = 140
|
||||||
tab_width = 4
|
tab_width = 4
|
||||||
ij_continuation_indent_size = 4
|
ij_continuation_indent_size = 8
|
||||||
ij_formatter_off_tag = @formatter:off
|
ij_formatter_off_tag = @formatter:off
|
||||||
ij_formatter_on_tag = @formatter:on
|
ij_formatter_on_tag = @formatter:on
|
||||||
ij_formatter_tags_enabled = false
|
ij_formatter_tags_enabled = false
|
||||||
ij_smart_tabs = false
|
ij_smart_tabs = false
|
||||||
ij_visual_guides = 140
|
|
||||||
ij_wrap_on_typing = false
|
ij_wrap_on_typing = false
|
||||||
|
|
||||||
[*.java]
|
[*.java]
|
||||||
ij_visual_guides = none
|
|
||||||
ij_java_align_consecutive_assignments = false
|
ij_java_align_consecutive_assignments = false
|
||||||
ij_java_align_consecutive_variable_declarations = false
|
ij_java_align_consecutive_variable_declarations = false
|
||||||
ij_java_align_group_field_declarations = false
|
ij_java_align_group_field_declarations = false
|
||||||
ij_java_align_multiline_annotation_parameters = true
|
ij_java_align_multiline_annotation_parameters = false
|
||||||
ij_java_align_multiline_array_initializer_expression = true
|
ij_java_align_multiline_array_initializer_expression = false
|
||||||
ij_java_align_multiline_assignment = true
|
ij_java_align_multiline_assignment = false
|
||||||
ij_java_align_multiline_binary_operation = true
|
ij_java_align_multiline_binary_operation = false
|
||||||
ij_java_align_multiline_chained_methods = false
|
ij_java_align_multiline_chained_methods = false
|
||||||
ij_java_align_multiline_extends_list = true
|
ij_java_align_multiline_extends_list = false
|
||||||
ij_java_align_multiline_for = true
|
ij_java_align_multiline_for = true
|
||||||
ij_java_align_multiline_method_parentheses = false
|
ij_java_align_multiline_method_parentheses = false
|
||||||
ij_java_align_multiline_parameters = true
|
ij_java_align_multiline_parameters = true
|
||||||
ij_java_align_multiline_parameters_in_calls = false
|
ij_java_align_multiline_parameters_in_calls = false
|
||||||
ij_java_align_multiline_parenthesized_expression = true
|
ij_java_align_multiline_parenthesized_expression = false
|
||||||
ij_java_align_multiline_records = true
|
ij_java_align_multiline_records = true
|
||||||
ij_java_align_multiline_resources = true
|
ij_java_align_multiline_resources = true
|
||||||
ij_java_align_multiline_ternary_operation = true
|
ij_java_align_multiline_ternary_operation = false
|
||||||
ij_java_align_multiline_text_blocks = true
|
ij_java_align_multiline_text_blocks = false
|
||||||
ij_java_align_multiline_throws_list = true
|
ij_java_align_multiline_throws_list = false
|
||||||
ij_java_align_subsequent_simple_methods = true
|
ij_java_align_subsequent_simple_methods = false
|
||||||
ij_java_align_throws_keyword = true
|
ij_java_align_throws_keyword = false
|
||||||
ij_java_annotation_parameter_wrap = on_every_item
|
ij_java_annotation_parameter_wrap = off
|
||||||
ij_java_array_initializer_new_line_after_left_brace = true
|
ij_java_array_initializer_new_line_after_left_brace = false
|
||||||
ij_java_array_initializer_right_brace_on_new_line = true
|
ij_java_array_initializer_right_brace_on_new_line = false
|
||||||
ij_java_array_initializer_wrap = normal
|
ij_java_array_initializer_wrap = off
|
||||||
ij_java_assert_statement_colon_on_next_line = true
|
ij_java_assert_statement_colon_on_next_line = false
|
||||||
ij_java_assert_statement_wrap = on_every_item
|
ij_java_assert_statement_wrap = off
|
||||||
ij_java_assignment_wrap = normal
|
ij_java_assignment_wrap = off
|
||||||
ij_java_binary_operation_sign_on_next_line = false
|
ij_java_binary_operation_sign_on_next_line = false
|
||||||
ij_java_binary_operation_wrap = normal
|
ij_java_binary_operation_wrap = off
|
||||||
ij_java_blank_lines_after_anonymous_class_header = 0
|
ij_java_blank_lines_after_anonymous_class_header = 0
|
||||||
ij_java_blank_lines_after_class_header = 0
|
ij_java_blank_lines_after_class_header = 0
|
||||||
ij_java_blank_lines_after_imports = 2
|
ij_java_blank_lines_after_imports = 1
|
||||||
ij_java_blank_lines_after_package = 1
|
ij_java_blank_lines_after_package = 1
|
||||||
ij_java_blank_lines_around_class = 2
|
ij_java_blank_lines_around_class = 1
|
||||||
ij_java_blank_lines_around_field = 0
|
ij_java_blank_lines_around_field = 0
|
||||||
ij_java_blank_lines_around_field_in_interface = 0
|
ij_java_blank_lines_around_field_in_interface = 0
|
||||||
ij_java_blank_lines_around_initializer = 0
|
ij_java_blank_lines_around_initializer = 1
|
||||||
ij_java_blank_lines_around_method = 1
|
ij_java_blank_lines_around_method = 1
|
||||||
ij_java_blank_lines_around_method_in_interface = 1
|
ij_java_blank_lines_around_method_in_interface = 1
|
||||||
ij_java_blank_lines_before_class_end = 0
|
ij_java_blank_lines_before_class_end = 0
|
||||||
ij_java_blank_lines_before_imports = 1
|
ij_java_blank_lines_before_imports = 1
|
||||||
ij_java_blank_lines_before_method_body = 0
|
ij_java_blank_lines_before_method_body = 0
|
||||||
ij_java_blank_lines_before_package = 1
|
ij_java_blank_lines_before_package = 0
|
||||||
ij_java_block_brace_style = end_of_line
|
ij_java_block_brace_style = end_of_line
|
||||||
ij_java_block_comment_at_first_column = true
|
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_new_line_after_left_paren = false
|
||||||
ij_java_call_parameters_right_paren_on_new_line = false
|
ij_java_call_parameters_right_paren_on_new_line = false
|
||||||
ij_java_call_parameters_wrap = normal
|
ij_java_call_parameters_wrap = off
|
||||||
ij_java_case_statement_on_separate_line = true
|
ij_java_case_statement_on_separate_line = true
|
||||||
ij_java_catch_on_new_line = false
|
ij_java_catch_on_new_line = false
|
||||||
ij_java_class_annotation_wrap = split_into_lines
|
ij_java_class_annotation_wrap = split_into_lines
|
||||||
ij_java_class_brace_style = end_of_line
|
ij_java_class_brace_style = end_of_line
|
||||||
ij_java_class_count_to_use_import_on_demand = 200
|
ij_java_class_count_to_use_import_on_demand = 30
|
||||||
ij_java_class_names_in_javadoc = 3
|
ij_java_class_names_in_javadoc = 1
|
||||||
ij_java_do_not_indent_top_level_class_members = 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 = false
|
||||||
ij_java_do_while_brace_force = never
|
ij_java_do_while_brace_force = never
|
||||||
ij_java_doc_add_blank_line_after_description = true
|
ij_java_doc_add_blank_line_after_description = true
|
||||||
ij_java_doc_add_blank_line_after_param_comments = true
|
ij_java_doc_add_blank_line_after_param_comments = false
|
||||||
ij_java_doc_add_blank_line_after_return = true
|
ij_java_doc_add_blank_line_after_return = false
|
||||||
ij_java_doc_add_p_tag_on_empty_lines = true
|
ij_java_doc_add_p_tag_on_empty_lines = true
|
||||||
ij_java_doc_align_exception_comments = true
|
ij_java_doc_align_exception_comments = true
|
||||||
ij_java_doc_align_param_comments = true
|
ij_java_doc_align_param_comments = true
|
||||||
ij_java_doc_do_not_wrap_if_one_line = false
|
ij_java_doc_do_not_wrap_if_one_line = false
|
||||||
ij_java_doc_enable_formatting = true
|
ij_java_doc_enable_formatting = true
|
||||||
ij_java_doc_enable_leading_asterisks = true
|
ij_java_doc_enable_leading_asterisks = true
|
||||||
ij_java_doc_indent_on_continuation = true
|
ij_java_doc_indent_on_continuation = false
|
||||||
ij_java_doc_keep_empty_lines = true
|
ij_java_doc_keep_empty_lines = true
|
||||||
ij_java_doc_keep_empty_parameter_tag = true
|
ij_java_doc_keep_empty_parameter_tag = true
|
||||||
ij_java_doc_keep_empty_return_tag = true
|
ij_java_doc_keep_empty_return_tag = true
|
||||||
ij_java_doc_keep_empty_throws_tag = true
|
ij_java_doc_keep_empty_throws_tag = true
|
||||||
ij_java_doc_keep_invalid_tags = true
|
ij_java_doc_keep_invalid_tags = true
|
||||||
ij_java_doc_param_description_on_new_line = false
|
ij_java_doc_param_description_on_new_line = false
|
||||||
ij_java_doc_preserve_line_breaks = true
|
ij_java_doc_preserve_line_breaks = false
|
||||||
ij_java_doc_use_throws_not_exception_tag = true
|
ij_java_doc_use_throws_not_exception_tag = true
|
||||||
ij_java_else_on_new_line = false
|
ij_java_else_on_new_line = false
|
||||||
ij_java_entity_dd_suffix = EJB
|
ij_java_enum_constants_wrap = off
|
||||||
ij_java_entity_eb_suffix = Bean
|
ij_java_extends_keyword_wrap = off
|
||||||
ij_java_entity_hi_suffix = Home
|
ij_java_extends_list_wrap = off
|
||||||
ij_java_entity_lhi_prefix = Local
|
|
||||||
ij_java_entity_lhi_suffix = Home
|
|
||||||
ij_java_entity_li_prefix = Local
|
|
||||||
ij_java_entity_pk_class = java.lang.String
|
|
||||||
ij_java_entity_vo_suffix = VO
|
|
||||||
ij_java_enum_constants_wrap = split_into_lines
|
|
||||||
ij_java_extends_keyword_wrap = normal
|
|
||||||
ij_java_extends_list_wrap = on_every_item
|
|
||||||
ij_java_field_annotation_wrap = split_into_lines
|
ij_java_field_annotation_wrap = split_into_lines
|
||||||
ij_java_finally_on_new_line = false
|
ij_java_finally_on_new_line = false
|
||||||
ij_java_for_brace_force = never
|
ij_java_for_brace_force = never
|
||||||
ij_java_for_statement_new_line_after_left_paren = false
|
ij_java_for_statement_new_line_after_left_paren = false
|
||||||
ij_java_for_statement_right_paren_on_new_line = false
|
ij_java_for_statement_right_paren_on_new_line = false
|
||||||
ij_java_for_statement_wrap = on_every_item
|
ij_java_for_statement_wrap = off
|
||||||
ij_java_generate_final_locals = false
|
ij_java_generate_final_locals = false
|
||||||
ij_java_generate_final_parameters = false
|
ij_java_generate_final_parameters = false
|
||||||
ij_java_if_brace_force = never
|
ij_java_if_brace_force = never
|
||||||
ij_java_imports_layout = *, |, javax.**, java.**, |, com.dfsek.terra.**, |, $org.junit.jupiter.api.Assertions.**, |, $*
|
ij_java_imports_layout = *, |, javax.**, java.**, |, $*
|
||||||
ij_java_indent_case_from_switch = true
|
ij_java_indent_case_from_switch = true
|
||||||
ij_java_insert_inner_class_imports = true
|
ij_java_insert_inner_class_imports = false
|
||||||
ij_java_insert_override_annotation = true
|
ij_java_insert_override_annotation = true
|
||||||
ij_java_keep_blank_lines_before_right_brace = 2
|
ij_java_keep_blank_lines_before_right_brace = 2
|
||||||
ij_java_keep_blank_lines_between_package_declaration_and_header = 1
|
ij_java_keep_blank_lines_between_package_declaration_and_header = 2
|
||||||
ij_java_keep_blank_lines_in_code = 2
|
ij_java_keep_blank_lines_in_code = 2
|
||||||
ij_java_keep_blank_lines_in_declarations = 2
|
ij_java_keep_blank_lines_in_declarations = 2
|
||||||
ij_java_keep_builder_methods_indents = true
|
|
||||||
ij_java_keep_control_statement_in_one_line = true
|
ij_java_keep_control_statement_in_one_line = true
|
||||||
ij_java_keep_first_column_comment = false
|
ij_java_keep_first_column_comment = true
|
||||||
ij_java_keep_indents_on_empty_lines = false
|
ij_java_keep_indents_on_empty_lines = false
|
||||||
ij_java_keep_line_breaks = true
|
ij_java_keep_line_breaks = true
|
||||||
ij_java_keep_multiple_expressions_in_one_line = false
|
ij_java_keep_multiple_expressions_in_one_line = false
|
||||||
ij_java_keep_simple_blocks_in_one_line = true
|
ij_java_keep_simple_blocks_in_one_line = false
|
||||||
ij_java_keep_simple_classes_in_one_line = false
|
ij_java_keep_simple_classes_in_one_line = false
|
||||||
ij_java_keep_simple_lambdas_in_one_line = true
|
ij_java_keep_simple_lambdas_in_one_line = false
|
||||||
ij_java_keep_simple_methods_in_one_line = true
|
ij_java_keep_simple_methods_in_one_line = false
|
||||||
ij_java_label_indent_absolute = false
|
ij_java_label_indent_absolute = false
|
||||||
ij_java_label_indent_size = 0
|
ij_java_label_indent_size = 0
|
||||||
ij_java_lambda_brace_style = end_of_line
|
ij_java_lambda_brace_style = end_of_line
|
||||||
ij_java_layout_static_imports_separately = true
|
ij_java_layout_static_imports_separately = true
|
||||||
ij_java_line_comment_add_space = false
|
ij_java_line_comment_add_space = false
|
||||||
ij_java_line_comment_at_first_column = true
|
ij_java_line_comment_at_first_column = true
|
||||||
ij_java_message_dd_suffix = EJB
|
|
||||||
ij_java_message_eb_suffix = Bean
|
|
||||||
ij_java_method_annotation_wrap = split_into_lines
|
ij_java_method_annotation_wrap = split_into_lines
|
||||||
ij_java_method_brace_style = end_of_line
|
ij_java_method_brace_style = end_of_line
|
||||||
ij_java_method_call_chain_wrap = on_every_item
|
ij_java_method_call_chain_wrap = off
|
||||||
ij_java_method_parameters_new_line_after_left_paren = false
|
ij_java_method_parameters_new_line_after_left_paren = false
|
||||||
ij_java_method_parameters_right_paren_on_new_line = false
|
ij_java_method_parameters_right_paren_on_new_line = false
|
||||||
ij_java_method_parameters_wrap = normal
|
ij_java_method_parameters_wrap = off
|
||||||
ij_java_modifier_list_wrap = false
|
ij_java_modifier_list_wrap = false
|
||||||
ij_java_names_count_to_use_import_on_demand = 50
|
ij_java_names_count_to_use_import_on_demand = 3
|
||||||
ij_java_new_line_after_lparen_in_record_header = false
|
ij_java_new_line_after_lparen_in_record_header = false
|
||||||
ij_java_packages_to_use_import_on_demand = $org.junit.jupiter.api.Assertions.*
|
ij_java_packages_to_use_import_on_demand = java.awt.*, javax.swing.*
|
||||||
ij_java_parameter_annotation_wrap = on_every_item
|
ij_java_parameter_annotation_wrap = off
|
||||||
ij_java_parentheses_expression_new_line_after_left_paren = false
|
ij_java_parentheses_expression_new_line_after_left_paren = false
|
||||||
ij_java_parentheses_expression_right_paren_on_new_line = false
|
ij_java_parentheses_expression_right_paren_on_new_line = false
|
||||||
ij_java_place_assignment_sign_on_next_line = false
|
ij_java_place_assignment_sign_on_next_line = false
|
||||||
ij_java_prefer_longer_names = true
|
ij_java_prefer_longer_names = true
|
||||||
ij_java_prefer_parameters_wrap = true
|
ij_java_prefer_parameters_wrap = false
|
||||||
ij_java_record_components_wrap = normal
|
ij_java_record_components_wrap = normal
|
||||||
ij_java_repeat_synchronized = true
|
ij_java_repeat_synchronized = true
|
||||||
ij_java_replace_instanceof_and_cast = false
|
ij_java_replace_instanceof_and_cast = false
|
||||||
@@ -165,15 +151,8 @@ ij_java_replace_null_check = true
|
|||||||
ij_java_replace_sum_lambda_with_method_ref = true
|
ij_java_replace_sum_lambda_with_method_ref = true
|
||||||
ij_java_resource_list_new_line_after_left_paren = false
|
ij_java_resource_list_new_line_after_left_paren = false
|
||||||
ij_java_resource_list_right_paren_on_new_line = false
|
ij_java_resource_list_right_paren_on_new_line = false
|
||||||
ij_java_resource_list_wrap = on_every_item
|
ij_java_resource_list_wrap = off
|
||||||
ij_java_rparen_on_new_line_in_record_header = false
|
ij_java_rparen_on_new_line_in_record_header = false
|
||||||
ij_java_session_dd_suffix = EJB
|
|
||||||
ij_java_session_eb_suffix = Bean
|
|
||||||
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_si_suffix = Service
|
|
||||||
ij_java_space_after_closing_angle_bracket_in_type_argument = false
|
ij_java_space_after_closing_angle_bracket_in_type_argument = false
|
||||||
ij_java_space_after_colon = true
|
ij_java_space_after_colon = true
|
||||||
ij_java_space_after_comma = true
|
ij_java_space_after_comma = true
|
||||||
@@ -183,7 +162,7 @@ ij_java_space_after_quest = true
|
|||||||
ij_java_space_after_type_cast = true
|
ij_java_space_after_type_cast = true
|
||||||
ij_java_space_before_annotation_array_initializer_left_brace = false
|
ij_java_space_before_annotation_array_initializer_left_brace = false
|
||||||
ij_java_space_before_annotation_parameter_list = false
|
ij_java_space_before_annotation_parameter_list = false
|
||||||
ij_java_space_before_array_initializer_left_brace = false
|
ij_java_space_before_array_initializer_left_brace = true
|
||||||
ij_java_space_before_catch_keyword = true
|
ij_java_space_before_catch_keyword = true
|
||||||
ij_java_space_before_catch_left_brace = true
|
ij_java_space_before_catch_left_brace = true
|
||||||
ij_java_space_before_catch_parentheses = false
|
ij_java_space_before_catch_parentheses = false
|
||||||
@@ -217,7 +196,7 @@ ij_java_space_before_while_keyword = true
|
|||||||
ij_java_space_before_while_left_brace = true
|
ij_java_space_before_while_left_brace = true
|
||||||
ij_java_space_before_while_parentheses = false
|
ij_java_space_before_while_parentheses = false
|
||||||
ij_java_space_inside_one_line_enum_braces = false
|
ij_java_space_inside_one_line_enum_braces = false
|
||||||
ij_java_space_within_empty_array_initializer_braces = true
|
ij_java_space_within_empty_array_initializer_braces = false
|
||||||
ij_java_space_within_empty_method_call_parentheses = false
|
ij_java_space_within_empty_method_call_parentheses = false
|
||||||
ij_java_space_within_empty_method_parentheses = false
|
ij_java_space_within_empty_method_parentheses = false
|
||||||
ij_java_spaces_around_additive_operators = true
|
ij_java_spaces_around_additive_operators = true
|
||||||
@@ -234,8 +213,8 @@ ij_java_spaces_around_type_bounds_in_type_parameters = true
|
|||||||
ij_java_spaces_around_unary_operator = false
|
ij_java_spaces_around_unary_operator = false
|
||||||
ij_java_spaces_within_angle_brackets = false
|
ij_java_spaces_within_angle_brackets = false
|
||||||
ij_java_spaces_within_annotation_parentheses = false
|
ij_java_spaces_within_annotation_parentheses = false
|
||||||
ij_java_spaces_within_array_initializer_braces = true
|
ij_java_spaces_within_array_initializer_braces = false
|
||||||
ij_java_spaces_within_braces = true
|
ij_java_spaces_within_braces = false
|
||||||
ij_java_spaces_within_brackets = false
|
ij_java_spaces_within_brackets = false
|
||||||
ij_java_spaces_within_cast_parentheses = false
|
ij_java_spaces_within_cast_parentheses = false
|
||||||
ij_java_spaces_within_catch_parentheses = false
|
ij_java_spaces_within_catch_parentheses = false
|
||||||
@@ -244,276 +223,80 @@ ij_java_spaces_within_if_parentheses = false
|
|||||||
ij_java_spaces_within_method_call_parentheses = false
|
ij_java_spaces_within_method_call_parentheses = false
|
||||||
ij_java_spaces_within_method_parentheses = false
|
ij_java_spaces_within_method_parentheses = false
|
||||||
ij_java_spaces_within_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_switch_parentheses = false
|
||||||
ij_java_spaces_within_synchronized_parentheses = false
|
ij_java_spaces_within_synchronized_parentheses = false
|
||||||
ij_java_spaces_within_try_parentheses = false
|
ij_java_spaces_within_try_parentheses = false
|
||||||
ij_java_spaces_within_while_parentheses = false
|
ij_java_spaces_within_while_parentheses = false
|
||||||
ij_java_special_else_if_treatment = true
|
ij_java_special_else_if_treatment = true
|
||||||
ij_java_subclass_name_suffix = Impl
|
ij_java_subclass_name_suffix = Impl
|
||||||
ij_java_ternary_operation_signs_on_next_line = true
|
ij_java_ternary_operation_signs_on_next_line = false
|
||||||
ij_java_ternary_operation_wrap = on_every_item
|
ij_java_ternary_operation_wrap = off
|
||||||
ij_java_test_name_suffix = Test
|
ij_java_test_name_suffix = Test
|
||||||
ij_java_throws_keyword_wrap = normal
|
ij_java_throws_keyword_wrap = off
|
||||||
ij_java_throws_list_wrap = normal
|
ij_java_throws_list_wrap = off
|
||||||
ij_java_use_external_annotations = false
|
ij_java_use_external_annotations = false
|
||||||
ij_java_use_fq_class_names = false
|
ij_java_use_fq_class_names = false
|
||||||
ij_java_use_relative_indents = false
|
ij_java_use_relative_indents = false
|
||||||
ij_java_use_single_class_imports = true
|
ij_java_use_single_class_imports = true
|
||||||
ij_java_variable_annotation_wrap = on_every_item
|
ij_java_variable_annotation_wrap = off
|
||||||
ij_java_visibility = public
|
ij_java_visibility = public
|
||||||
ij_java_while_brace_force = never
|
ij_java_while_brace_force = never
|
||||||
ij_java_while_on_new_line = false
|
ij_java_while_on_new_line = false
|
||||||
ij_java_wrap_comments = true
|
ij_java_wrap_comments = false
|
||||||
ij_java_wrap_first_method_in_call_chain = false
|
ij_java_wrap_first_method_in_call_chain = false
|
||||||
ij_java_wrap_long_lines = true
|
ij_java_wrap_long_lines = false
|
||||||
|
|
||||||
[.editorconfig]
|
[{*.gradle.kts, *.kt, *.kts, *.main.kts}]
|
||||||
ij_visual_guides = none
|
ij_kotlin_align_in_columns_case_branch = false
|
||||||
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
|
|
||||||
|
|
||||||
[{*.gant, *.gradle, *.groovy, *.gson, *.gy}]
|
|
||||||
ij_visual_guides = none
|
|
||||||
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_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_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_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_long_lines = false
|
|
||||||
|
|
||||||
[{*.gql, *.graphql, *.graphqls}]
|
|
||||||
ij_visual_guides = none
|
|
||||||
|
|
||||||
[{*.kt, *.kts}]
|
|
||||||
ij_visual_guides = none
|
|
||||||
ij_kotlin_align_in_columns_case_branch = true
|
|
||||||
ij_kotlin_align_multiline_binary_operation = false
|
ij_kotlin_align_multiline_binary_operation = false
|
||||||
ij_kotlin_align_multiline_extends_list = true
|
ij_kotlin_align_multiline_extends_list = false
|
||||||
ij_kotlin_align_multiline_method_parentheses = true
|
ij_kotlin_align_multiline_method_parentheses = false
|
||||||
ij_kotlin_align_multiline_parameters = true
|
ij_kotlin_align_multiline_parameters = true
|
||||||
ij_kotlin_align_multiline_parameters_in_calls = true
|
ij_kotlin_align_multiline_parameters_in_calls = false
|
||||||
ij_kotlin_allow_trailing_comma = false
|
ij_kotlin_allow_trailing_comma = false
|
||||||
ij_kotlin_allow_trailing_comma_on_call_site = false
|
ij_kotlin_allow_trailing_comma_on_call_site = false
|
||||||
ij_kotlin_assignment_wrap = normal
|
ij_kotlin_assignment_wrap = off
|
||||||
ij_kotlin_blank_lines_after_class_header = 0
|
ij_kotlin_blank_lines_after_class_header = 0
|
||||||
ij_kotlin_blank_lines_around_block_when_branches = 1
|
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_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1
|
||||||
ij_kotlin_block_comment_at_first_column = true
|
ij_kotlin_block_comment_at_first_column = true
|
||||||
ij_kotlin_call_parameters_new_line_after_left_paren = true
|
ij_kotlin_call_parameters_new_line_after_left_paren = false
|
||||||
ij_kotlin_call_parameters_right_paren_on_new_line = true
|
ij_kotlin_call_parameters_right_paren_on_new_line = false
|
||||||
ij_kotlin_call_parameters_wrap = on_every_item
|
ij_kotlin_call_parameters_wrap = off
|
||||||
ij_kotlin_catch_on_new_line = false
|
ij_kotlin_catch_on_new_line = false
|
||||||
ij_kotlin_class_annotation_wrap = split_into_lines
|
ij_kotlin_class_annotation_wrap = split_into_lines
|
||||||
ij_kotlin_continuation_indent_for_chained_calls = false
|
ij_kotlin_continuation_indent_for_chained_calls = true
|
||||||
ij_kotlin_continuation_indent_for_expression_bodies = false
|
ij_kotlin_continuation_indent_for_expression_bodies = true
|
||||||
ij_kotlin_continuation_indent_in_argument_lists = false
|
ij_kotlin_continuation_indent_in_argument_lists = true
|
||||||
ij_kotlin_continuation_indent_in_elvis = false
|
ij_kotlin_continuation_indent_in_elvis = true
|
||||||
ij_kotlin_continuation_indent_in_if_conditions = false
|
ij_kotlin_continuation_indent_in_if_conditions = true
|
||||||
ij_kotlin_continuation_indent_in_parameter_lists = false
|
ij_kotlin_continuation_indent_in_parameter_lists = true
|
||||||
ij_kotlin_continuation_indent_in_supertype_lists = false
|
ij_kotlin_continuation_indent_in_supertype_lists = true
|
||||||
ij_kotlin_else_on_new_line = false
|
ij_kotlin_else_on_new_line = false
|
||||||
ij_kotlin_enum_constants_wrap = on_every_item
|
ij_kotlin_enum_constants_wrap = off
|
||||||
ij_kotlin_extends_list_wrap = normal
|
ij_kotlin_extends_list_wrap = off
|
||||||
ij_kotlin_field_annotation_wrap = on_every_item
|
ij_kotlin_field_annotation_wrap = split_into_lines
|
||||||
ij_kotlin_finally_on_new_line = false
|
ij_kotlin_finally_on_new_line = false
|
||||||
ij_kotlin_if_rparen_on_new_line = true
|
ij_kotlin_if_rparen_on_new_line = false
|
||||||
ij_kotlin_import_nested_classes = false
|
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_insert_whitespaces_in_simple_one_line_method = true
|
||||||
ij_kotlin_keep_blank_lines_before_right_brace = 1
|
ij_kotlin_keep_blank_lines_before_right_brace = 2
|
||||||
ij_kotlin_keep_blank_lines_in_code = 2
|
ij_kotlin_keep_blank_lines_in_code = 2
|
||||||
ij_kotlin_keep_blank_lines_in_declarations = 2
|
ij_kotlin_keep_blank_lines_in_declarations = 2
|
||||||
ij_kotlin_keep_first_column_comment = true
|
ij_kotlin_keep_first_column_comment = true
|
||||||
ij_kotlin_keep_indents_on_empty_lines = true
|
ij_kotlin_keep_indents_on_empty_lines = false
|
||||||
ij_kotlin_keep_line_breaks = true
|
ij_kotlin_keep_line_breaks = true
|
||||||
ij_kotlin_lbrace_on_next_line = false
|
ij_kotlin_lbrace_on_next_line = false
|
||||||
ij_kotlin_line_comment_add_space = false
|
ij_kotlin_line_comment_add_space = false
|
||||||
ij_kotlin_line_comment_at_first_column = true
|
ij_kotlin_line_comment_at_first_column = true
|
||||||
ij_kotlin_method_annotation_wrap = on_every_item
|
ij_kotlin_method_annotation_wrap = split_into_lines
|
||||||
ij_kotlin_method_call_chain_wrap = normal
|
ij_kotlin_method_call_chain_wrap = off
|
||||||
ij_kotlin_method_parameters_new_line_after_left_paren = true
|
ij_kotlin_method_parameters_new_line_after_left_paren = false
|
||||||
ij_kotlin_method_parameters_right_paren_on_new_line = true
|
ij_kotlin_method_parameters_right_paren_on_new_line = false
|
||||||
ij_kotlin_method_parameters_wrap = on_every_item
|
ij_kotlin_method_parameters_wrap = off
|
||||||
ij_kotlin_name_count_to_use_star_import = 2147483647
|
ij_kotlin_name_count_to_use_star_import = 5
|
||||||
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
|
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_parameter_annotation_wrap = on_every_item
|
|
||||||
ij_kotlin_space_after_comma = true
|
ij_kotlin_space_after_comma = true
|
||||||
ij_kotlin_space_after_extend_colon = true
|
ij_kotlin_space_after_extend_colon = true
|
||||||
ij_kotlin_space_after_type_colon = true
|
ij_kotlin_space_after_type_colon = true
|
||||||
@@ -532,63 +315,33 @@ ij_kotlin_spaces_around_equality_operators = true
|
|||||||
ij_kotlin_spaces_around_function_type_arrow = true
|
ij_kotlin_spaces_around_function_type_arrow = true
|
||||||
ij_kotlin_spaces_around_logical_operators = true
|
ij_kotlin_spaces_around_logical_operators = true
|
||||||
ij_kotlin_spaces_around_multiplicative_operators = true
|
ij_kotlin_spaces_around_multiplicative_operators = true
|
||||||
ij_kotlin_spaces_around_range = true
|
ij_kotlin_spaces_around_range = false
|
||||||
ij_kotlin_spaces_around_relational_operators = true
|
ij_kotlin_spaces_around_relational_operators = true
|
||||||
ij_kotlin_spaces_around_unary_operator = false
|
ij_kotlin_spaces_around_unary_operator = false
|
||||||
ij_kotlin_spaces_around_when_arrow = true
|
ij_kotlin_spaces_around_when_arrow = true
|
||||||
ij_kotlin_variable_annotation_wrap = on_every_item
|
ij_kotlin_variable_annotation_wrap = off
|
||||||
ij_kotlin_while_on_new_line = false
|
ij_kotlin_while_on_new_line = false
|
||||||
ij_kotlin_wrap_elvis_expressions = 1
|
ij_kotlin_wrap_elvis_expressions = 1
|
||||||
ij_kotlin_wrap_expression_body_functions = 1
|
ij_kotlin_wrap_expression_body_functions = 0
|
||||||
ij_kotlin_wrap_first_method_in_call_chain = false
|
ij_kotlin_wrap_first_method_in_call_chain = false
|
||||||
|
|
||||||
[{*.graphqlconfig, *.har, *.jsb2, *.jsb3, *.json, .babelrc, .eslintrc, .stylelintrc, bowerrc, jest.config, mcmod.info, pack.mcmeta}]
|
[{*.har, *.jsb2, *.jsb3, *.json, .babelrc, .eslintrc, .stylelintrc, bowerrc, jest.config}]
|
||||||
ij_visual_guides = none
|
indent_size = 2
|
||||||
ij_json_keep_blank_lines_in_code = 1
|
ij_json_keep_blank_lines_in_code = 0
|
||||||
ij_json_keep_indents_on_empty_lines = false
|
ij_json_keep_indents_on_empty_lines = false
|
||||||
ij_json_keep_line_breaks = true
|
ij_json_keep_line_breaks = true
|
||||||
ij_json_space_after_colon = true
|
ij_json_space_after_colon = true
|
||||||
ij_json_space_after_comma = true
|
ij_json_space_after_comma = true
|
||||||
ij_json_space_before_colon = true
|
ij_json_space_before_colon = true
|
||||||
ij_json_space_before_comma = false
|
ij_json_space_before_comma = false
|
||||||
ij_json_spaces_within_braces = true
|
ij_json_spaces_within_braces = false
|
||||||
ij_json_spaces_within_brackets = true
|
ij_json_spaces_within_brackets = false
|
||||||
ij_json_wrap_long_lines = false
|
ij_json_wrap_long_lines = false
|
||||||
|
|
||||||
[{*.markdown, *.md}]
|
[{*.yaml, *.yml}]
|
||||||
max_line_length = 80
|
|
||||||
ij_visual_guides = 80
|
|
||||||
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
|
|
||||||
|
|
||||||
[{*.properties, spring.handlers, spring.schemas}]
|
|
||||||
ij_visual_guides = none
|
|
||||||
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
|
|
||||||
|
|
||||||
[{*.yml, *.yaml}]
|
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
ij_visual_guides = none
|
ij_yaml_keep_indents_on_empty_lines = true
|
||||||
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_keep_line_breaks = true
|
||||||
ij_yaml_sequence_on_new_line = false
|
|
||||||
ij_yaml_space_before_colon = false
|
ij_yaml_space_before_colon = false
|
||||||
ij_yaml_spaces_within_braces = true
|
ij_yaml_spaces_within_braces = true
|
||||||
ij_yaml_spaces_within_brackets = true
|
ij_yaml_spaces_within_brackets = true
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+12
-7
@@ -1,14 +1,19 @@
|
|||||||
# Global owners, automatically request review when pull request is submitted
|
# Global owners, automatically request review when pull request is submitted
|
||||||
* @dfsek @solonovamax @duplexsystem @astrsh @justaureus
|
* @dfsek @solonovamax
|
||||||
|
|
||||||
# Platforms
|
# Platforms
|
||||||
/platforms/ @dfsek @solonovamax @duplexsystem @justaureus
|
## dfsek wrote the majority of the platform impls
|
||||||
/platforms/bukkit @dfsek @solonovamax @duplexsystem @justaureus @OakLoaf
|
/platforms/bukkit/ @dfsek
|
||||||
|
/platforms/fabric/ @dfsek
|
||||||
|
/platforms/forge/ @dfsek
|
||||||
|
/platforms/sponge/ @dfsek
|
||||||
|
## solonovamax is working on the region generator (unless duplexsystem takes it over)
|
||||||
|
/platforms/region/ @solonovamax
|
||||||
|
|
||||||
# Common
|
# Common
|
||||||
/common/ @dfsek @solonovamax @duplexsystem @astrsh
|
/common/ @dfsek @solonovamax
|
||||||
|
|
||||||
# Gradle Stuff
|
# Gradle Stuff
|
||||||
/buildSrc/ @dfsek @solonovamax @duplexsystem
|
## Most gradle stuff was written by solonovamax
|
||||||
*.gradle.kts @dfsek @solonovamax @duplexsystem
|
/buildSrc/ @solonovamax
|
||||||
/gradle/ @dfsek @solonovamax @duplexsystem
|
*.gradle.kts @solonovamax
|
||||||
@@ -37,13 +37,10 @@ assignees: ""
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
- [ ] I have checked that I am on the latest version of Terra.
|
- [ ] I have checked that I am on the latest version of Terra.
|
||||||
- [ ] I have searched the github issue tracker for similar issues, including
|
- [ ] I have searched the github issue tracker for similar issues, including closed ones.
|
||||||
closed ones.
|
- [ ] I have made sure that this is not a bug with another mod or plugin, and it is Terra that is causing the issue.
|
||||||
- [ ] I have made sure that this is not a bug with another mod or plugin, and it
|
- [ ] I have checked that this is an issue with Terra and not an issue with the pack I am using.
|
||||||
is Terra that is causing the issue.
|
<!-- If this is an issue with the default Terra pack, please open an issue on the pack repo: https://github.com/PolyhedralDev/TerraDefaultConfig/issues/new -->
|
||||||
- [ ] I have checked that this is an issue with Terra and not an issue with the
|
|
||||||
pack I am using.
|
|
||||||
<!-- If this is an issue with the default Terra pack, please open an issue on the pack repo: https://github.com/PolyhedralDev/TerraOverworldConfig/issues/new -->
|
|
||||||
- [ ] I have attached a copy of the `latest.log` file
|
- [ ] I have attached a copy of the `latest.log` file
|
||||||
- [ ] I have filled out and provided all the appropriate information.
|
- [ ] I have filled out and provided all the appropriate information.
|
||||||
|
|
||||||
@@ -51,13 +48,13 @@ assignees: ""
|
|||||||
|
|
||||||
<!-- You can fill out the different items by putting the correct value beside each cell. -->
|
<!-- You can fill out the different items by putting the correct value beside each cell. -->
|
||||||
|
|
||||||
| Name | Value |
|
| Name | Value |
|
||||||
|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------------------|-------|
|
||||||
| Terra Version | <!-- Put your Terra version here. (remove the comment) -->
|
| Terra Version | <!-- Put your Terra version here. (remove the comment) -->
|
||||||
| Platform / Platform Version | <!-- Put your platform and platform version here. (remove the comment) (eg. Spigot, Fabric, Paper, etc.) (If you are using the Region generator, put that here instead) -->
|
| Platform / Platform Version | <!-- Put your platform and platform version here. (remove the comment) (eg. Spigot, Fabric, Paper, etc.) (If you are using the Region generator, put that here instead) -->
|
||||||
| Any External Plugins or Mods | <!-- Put a list of all the plugins or mods you have installed here. (remove the comment) (Make sure to NOT include any new lines) -->
|
| Any External Plugins or Mods | <!-- Put a list of all the plugins or mods you have installed here. (remove the comment) (Make sure to NOT include any new lines) -->
|
||||||
| Terra Packs In Use | <!-- Put a list of all the Terra packs you have installed here. (remove the comment) (Make sure to NOT include any new lines) (/te packs may be used to get a list) -->
|
| Terra Packs In Use | <!-- Put a list of all the Terra packs you have installed here. (remove the comment) (Make sure to NOT include any new lines) (/te packs may be used to get a list) -->
|
||||||
| Terra Addons In Use | <!-- Put a list of all the Terra addons you have installed here. (remove the comment) (Make sure to NOT include any new lines) (/te addons may be used to get a list) -->
|
| Terra Addons In Use | <!-- Put a list of all the Terra addons you have installed here. (remove the comment) (Make sure to NOT include any new lines) (/te addons may be used to get a list) -->
|
||||||
|
|
||||||
## Issue Description
|
## Issue Description
|
||||||
|
|
||||||
|
|||||||
@@ -31,11 +31,9 @@ assignees: ""
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
- [ ] I have checked that I am on the latest version of Terra.
|
- [ ] I have checked that I am on the latest version of Terra.
|
||||||
- [ ] I have searched github for similar features requests, including closed
|
- [ ] I have searched github for similar features requests, including closed ones, and found none.
|
||||||
ones, and found none.
|
|
||||||
- [ ] I believe this is within the scope of Terra.
|
- [ ] I believe this is within the scope of Terra.
|
||||||
- [ ] This feature request is for *all* of Terra, and isn't something that
|
- [ ] This feature request is for *all* of Terra, and isn't something that should be implemented by a pack or addon.
|
||||||
should be implemented by a pack or addon.
|
|
||||||
|
|
||||||
## Feature Description
|
## Feature Description
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "Other Issue"
|
name: "Other Issue"
|
||||||
about: "Use this template if your issue doesn't accurately fit into any of the
|
about: "Use this template if your issue doesn't accurately fit into any of the other categories."
|
||||||
other categories."
|
|
||||||
title: ""
|
title: ""
|
||||||
labels: "Type: Question, Status: Pending"
|
labels: "Type: Question, Status: Pending"
|
||||||
assignees: ""
|
assignees: ""
|
||||||
|
|||||||
@@ -1,19 +1,56 @@
|
|||||||
# Pull Request
|
# Pull Request
|
||||||
|
|
||||||
## Description
|
## Brief description.
|
||||||
|
|
||||||
<!-- Include a description of the PR here -->
|
<!-- Please provide a brief description of the goals of your PR -->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
If applicable, include 'Fixes #XXXX' or 'Closes #XXXX' for any related open issues.
|
###########################################################################
|
||||||
This helps us relate, track, and close the relevant issues.
|
## WARNING! ##
|
||||||
|
## IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN YOUR PR BEING CLOSED ##
|
||||||
|
###########################################################################
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
Please go through this checklist item by item and make sure you have successfully completed each of these steps.
|
||||||
|
- Your pull request MUST be either on the latest version of Terra, or on a branch for a future release.
|
||||||
|
- Make sure that there are no already existing PRs that fix this. If so, it will be closed as a duplicate.
|
||||||
|
- Make sure that this change is actually within the scope of Terra and is something a terrain generator should be doing.
|
||||||
|
- Make sure that this is not an issue with a specific Terra *pack*, and instead applies to all of Terra.
|
||||||
|
- Make sure that you have filled out all the required information and given descriptions of everything.
|
||||||
|
-->
|
||||||
|
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
|
||||||
|
|
||||||
|
### What Issues Does This Fix?
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Put Fix #XXXX or Closes #XXXX here if there are any open issues that this PR fixes.
|
||||||
|
This is to automatically close the relevant issues.
|
||||||
|
You may remove this if there is no issue for this PR.
|
||||||
|
But unless this is a very small change, you should make an issue for it.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### Changelog
|
## Licensing
|
||||||
|
|
||||||
|
<!-- In order to be accepted, your changes must be under the GPLv3 license. Please check one of the following: -->
|
||||||
|
|
||||||
|
- [ ] I am the original author of this code, and I am willing to release it under [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html).
|
||||||
|
- [ ] I am not the original author of this code, but it is in public domain or released
|
||||||
|
under [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html) or a compatible license.
|
||||||
|
<!--
|
||||||
|
Please provide reliable evidence of this.
|
||||||
|
NOTE: for compatible licenses, you must make sure to add the included license somewhere in the program, if so required.
|
||||||
|
(And even if it's not required, it's still nice to do it. Also add attribution somewhere.)
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Goal of the PR
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Fill out a changelog below of what has been done, and what might be planned to be done.
|
What is the goal of the PR?
|
||||||
You may delete this if your PR is not adding new features, only fixing bugs or adding translations.
|
Put a checklist here of what has been done
|
||||||
|
(and what *hasn't*, but you plan to do),
|
||||||
|
so we can easily know what was changed.
|
||||||
|
Note: this is only required for PRs that add new features.
|
||||||
|
If your PR is not adding new features, only fixing bugs or adding translations, then you may delete this section.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
- [ ] <!-- First thing -->
|
- [ ] <!-- First thing -->
|
||||||
@@ -22,58 +59,45 @@ You may delete this if your PR is not adding new features, only fixing bugs or a
|
|||||||
- [ ] <!-- Second thing -->
|
- [ ] <!-- Second thing -->
|
||||||
- [ ] <!-- etc. -->
|
- [ ] <!-- etc. -->
|
||||||
|
|
||||||
## Checklist
|
## Affects of the PR
|
||||||
|
|
||||||
<!--
|
<!---
|
||||||
Select the options below that apply.
|
What types of changes does your code introduce? (Select any that apply. You may select multiple.)
|
||||||
You must put an x in all the boxes that it applies to. (Like this: [x])
|
You must put an x in all the boxes that it applies to. (Like this: [x])
|
||||||
-->
|
-->
|
||||||
|
|
||||||
#### Mandatory checks
|
|
||||||
|
|
||||||
- [ ] The base branch of this PR is an unreleased version branch (that has a `ver/` prefix)
|
|
||||||
or is a branch that is intended to be merged into a version branch.
|
|
||||||
<!--
|
|
||||||
This is not applicable if the PR is a version branch itself.
|
|
||||||
PRs for new versions should use the `master` branch instead.
|
|
||||||
-->
|
|
||||||
- [ ] There are no already existing PRs that provide the same changes.
|
|
||||||
<!-- If this is not applicable, the PR will be removed as a duplicate. -->
|
|
||||||
- [ ] The PR is within the scope of Terra (i.e. is something a configurable terrain generator should be doing).
|
|
||||||
- [ ] Changes follow the code style for this project.
|
|
||||||
<!-- There is an included `.editorconfig` file in the base of the repo. Please use a plugin for your IDE of choice that follows those settings. -->
|
|
||||||
- [ ] I have read the [`CONTRIBUTING.md`](https://github.com/PolyhedralDev/Terra/blob/master/CONTRIBUTING.md)
|
|
||||||
document in the root of the git repository.
|
|
||||||
|
|
||||||
#### Types of changes
|
#### Types of changes
|
||||||
|
|
||||||
- [ ] Bug Fix <!-- Changes include bug fixes. -->
|
- [ ] Bug Fix <!-- Anything which fixes an issue in Terra. -->
|
||||||
- [ ] Build system <!-- Changes the build system. -->
|
- [ ] Build system <!-- Anything which pretain to the build system. -->
|
||||||
- [ ] Documentation <!-- Changes add to or improve documentation. -->
|
- [ ] Documentation <!-- Anything which adds or improves documentation for existing features. -->
|
||||||
- [ ] New Feature <!-- Changes add new functionality to Terra. -->
|
- [ ] New Feature <!-- Anything which adds new functionality to Terra. -->
|
||||||
- [ ] Performance <!-- Changes improve the performance of Terra. -->
|
- [ ] Performance <!-- Anything which is imrpoves the performance of Terra. -->
|
||||||
- [ ] Refactoring <!-- Changes do not add any new code, only moves code around. -->
|
- [ ] Refactoring <!-- Anything which does not add any new code, only moves code around. -->
|
||||||
- [ ] Repository <!-- Changes affect the repository. E.g. changes to the `README.md` file. -->
|
- [ ] Repository <!-- Anything which affects the repository. Eg. changes to the `README.md` file. -->
|
||||||
- [ ] Revert <!-- Changes revert previous commits. -->
|
- [ ] Revert <!-- Anything which reverts previous commits. -->
|
||||||
- [ ] Style <!-- Changes update style, namely the .editorconfig file. -->
|
- [ ] Style <!-- Anything which updates style. -->
|
||||||
- [ ] Tests <!-- Changes add or update tests. -->
|
- [ ] Tests <!-- Anything which adds or updates tests. -->
|
||||||
- [ ] Translation <!-- Changes include translations to other languages for Terra. -->
|
- [ ] Translation <!-- Anything which is internationalizing the Terra program to other languages. -->
|
||||||
|
|
||||||
#### Compatibility
|
#### Compatiblity
|
||||||
|
|
||||||
<!-- The following options determine if the PR pertains to a major, minor, or patch version bump -->
|
- [ ] Breaking change <!-- A fix, or a feature, that breaks some previous functionality to Terra. -->
|
||||||
|
- [ ] Non-Breaking change.
|
||||||
|
<!--
|
||||||
|
A change which does not break *any* previous functionality of Terra.
|
||||||
|
(ie. is backwards compatible and will work with *any* previously existing supported features.
|
||||||
|
Note: if a feature is annotated with @Incubating, @Preview, @Experimental,
|
||||||
|
or is in a package called something similar to the previous annotations,
|
||||||
|
then you may push breaking changes to only THOSE parts of Terra.)
|
||||||
|
-->
|
||||||
|
|
||||||
- [ ] Introduces a breaking change
|
#### Contribution Guidelines.
|
||||||
<!--
|
|
||||||
Breaking changes are any fix or feature that breaks some previous functionality to Terra / is not backwards compatible.
|
- [ ] I have read the [`CONTRIBUTING.md`](https://github.com/PolyhedralDev/Terra/blob/master/CONTRIBUTING.md) document in the root of the
|
||||||
Breaking changes do not include:
|
git repository.
|
||||||
- changes that are backwards compatible and will work with *any* previously existing supported features.
|
- [ ] My code follows the code style for this
|
||||||
- changes to code marked as in a pre-release
|
project. <!-- There is an included `.editorconfig` file in the base of the repo. Please use a plugin for your IDE of choice that follows those settings. -->
|
||||||
state (annotated with @Incubating, @Preview, @Experimental
|
|
||||||
or in a package called something similar to the previous annotations)
|
|
||||||
-->
|
|
||||||
- [ ] Introduces new functionality in a backwards compatible way.
|
|
||||||
- [ ] Introduces bug fixes
|
|
||||||
|
|
||||||
#### Documentation
|
#### Documentation
|
||||||
|
|
||||||
@@ -84,21 +108,7 @@ You must put an x in all the boxes that it applies to. (Like this: [x])
|
|||||||
|
|
||||||
- [ ] I have added tests to cover my changes.
|
- [ ] I have added tests to cover my changes.
|
||||||
- [ ] All new and existing tests passed.
|
- [ ] All new and existing tests passed.
|
||||||
<!--
|
<!--
|
||||||
Tests are typically not necessary for small changes.
|
If it only introduces small changes, you don't need to add tests.
|
||||||
Including *some* testing is recommended for large changes where applicable.
|
But if you add big changes, you should probably at least write *some* testing, where applicable.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
#### Licensing
|
|
||||||
|
|
||||||
<!-- In order to be accepted, your changes must be under the GPLv3 license. Please check one of the following: -->
|
|
||||||
|
|
||||||
- [ ] I am the original author of this code, and I am willing to
|
|
||||||
release it under [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html).
|
|
||||||
- [ ] I am not the original author of this code, but it is in public domain or
|
|
||||||
released under [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html) or a compatible license.
|
|
||||||
<!--
|
|
||||||
Please provide reliable evidence of this.
|
|
||||||
NOTE: for compatible licenses, you must make sure to add the included license somewhere in the program, if so required.
|
|
||||||
(And even if it's not required, it's still nice to do it. Also add attribution somewhere.)
|
|
||||||
-->
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
# This workflow uses actions that are not certified by GitHub.
|
|
||||||
# They are provided by a third-party and are governed by
|
|
||||||
# separate terms of service, privacy policy, and support
|
|
||||||
# documentation.
|
|
||||||
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
|
|
||||||
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
|
|
||||||
|
|
||||||
name: Gradle Build
|
|
||||||
|
|
||||||
on: [ pull_request ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
|
|
||||||
- name: Set up JDK 21
|
|
||||||
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
|
|
||||||
with:
|
|
||||||
java-version: '21'
|
|
||||||
distribution: 'temurin'
|
|
||||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
|
||||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
|
||||||
|
|
||||||
- uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6
|
|
||||||
name: Build Terra
|
|
||||||
with:
|
|
||||||
# Specifies arguments for Gradle execution
|
|
||||||
# If arguments is missing or empty, then Gradle is not executed
|
|
||||||
arguments: build
|
|
||||||
# arguments can be multi-line for better readability
|
|
||||||
# arguments: |
|
|
||||||
# --no-paralell
|
|
||||||
# build
|
|
||||||
# -x test
|
|
||||||
# Gradle version to use for execution:
|
|
||||||
# wrapper (default), current, rc, nightly, release-nightly, or
|
|
||||||
# versions like 6.6 (see https://services.gradle.org/versions/all)
|
|
||||||
gradle-version: wrapper
|
|
||||||
# Properties are passed as -Pname=value
|
|
||||||
properties: |
|
|
||||||
kotlin.js.compiler=ir
|
|
||||||
kotlin.parallel.tasks.in.project=true
|
|
||||||
+10
-120
@@ -65,8 +65,6 @@ hs_err_pid*
|
|||||||
.idea/**/dictionaries
|
.idea/**/dictionaries
|
||||||
.idea/**/shelf
|
.idea/**/shelf
|
||||||
|
|
||||||
.idea/
|
|
||||||
|
|
||||||
# Generated files
|
# Generated files
|
||||||
.idea/**/contentModel.xml
|
.idea/**/contentModel.xml
|
||||||
|
|
||||||
@@ -129,125 +127,17 @@ fabric.properties
|
|||||||
# Android studio 3.1+ serialized cache file
|
# Android studio 3.1+ serialized cache file
|
||||||
.idea/caches/build_file_checksums.ser
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
### Windows template
|
# Ignore Gradle build output directory
|
||||||
# Windows thumbnail cache files
|
build
|
||||||
Thumbs.db
|
/target/
|
||||||
Thumbs.db:encryptable
|
|
||||||
ehthumbs.db
|
|
||||||
ehthumbs_vista.db
|
|
||||||
|
|
||||||
# Dump file
|
.idea/sonarlint/**
|
||||||
*.stackdump
|
.idea/codeStyles/**
|
||||||
|
.idea/**.xml
|
||||||
# Folder config file
|
.idea/modules/**.iml
|
||||||
[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
|
|
||||||
|
|
||||||
### 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*
|
|
||||||
|
|
||||||
### Application
|
|
||||||
# Archive love files
|
|
||||||
*.log.gz
|
|
||||||
|
|
||||||
# binary files
|
|
||||||
*.bin
|
|
||||||
|
|
||||||
# Database files
|
|
||||||
*.db
|
|
||||||
|
|
||||||
# Cache files
|
|
||||||
*.meta
|
|
||||||
*.data
|
|
||||||
|
|
||||||
### JEnv template
|
|
||||||
# JEnv local Java version configuration file
|
|
||||||
.java-version
|
|
||||||
|
|
||||||
# Used by previous versions of JEnv
|
|
||||||
.jenv-version
|
|
||||||
|
|
||||||
### VisualStudioCode template
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/settings.json
|
|
||||||
!.vscode/tasks.json
|
|
||||||
!.vscode/launch.json
|
|
||||||
!.vscode/extensions.json
|
|
||||||
*.code-workspace
|
|
||||||
|
|
||||||
# Local History for Visual Studio Code
|
|
||||||
.history/
|
|
||||||
|
|
||||||
### NetBeans template
|
|
||||||
**/nbproject/private/
|
|
||||||
**/nbproject/Makefile-*.mk
|
|
||||||
**/nbproject/Package-*.bash
|
|
||||||
build/
|
|
||||||
nbbuild/
|
|
||||||
dist/
|
|
||||||
nbdist/
|
|
||||||
.nb-gradle/
|
|
||||||
|
|
||||||
###
|
|
||||||
**/target/
|
|
||||||
|
|
||||||
|
!lib/*.jar
|
||||||
/run/
|
/run/
|
||||||
|
idea/**
|
||||||
|
|
||||||
**/testDir/
|
testDir/
|
||||||
|
|
||||||
platforms/**/run/**
|
|
||||||
|
|
||||||
#Vale Config File
|
|
||||||
**/.vale.ini
|
|
||||||
+164
-256
@@ -2,41 +2,32 @@
|
|||||||
|
|
||||||
# TL;DR
|
# TL;DR
|
||||||
|
|
||||||
Polyhedral Development is dedicated to providing a harassment-free experience
|
Polyhedral Development is dedicated to providing a harassment-free experience for everyone, regardless of gender, gender identity and
|
||||||
for everyone, regardless of gender, gender identity and expression, preferred
|
expression, preferred pronouns, sexual orientation, disability, physical appearance, age, race, religion, etc. We do not tolerate harassment
|
||||||
pronouns, sexual orientation, disability, physical appearance, age, race,
|
of participants in any form.
|
||||||
religion, etc. We do not tolerate harassment of participants in any form.
|
|
||||||
|
|
||||||
This code of conduct applies to all Terra community spaces, including the github
|
This code of conduct applies to all Terra community spaces, including the github discussions tab, our
|
||||||
discussions tab, our [community discord server](https://discord.gg/PXUEbbF),
|
[community discord server](https://discord.gg/PXUEbbF), the [community subreddit](https://reddit.com/r/TerraGenerator), or any other Terra
|
||||||
the [community subreddit](https://reddit.com/r/TerraGenerator), or any other
|
space, both online and off. Anyone in violation of this code, as determined by the applicable moderators, may be subject to verbal warning,
|
||||||
Terra space, both online and off. Anyone in violation of this code, as
|
expulsion from these spaces, or future events and activities for an undetermined amount of time.
|
||||||
determined by the applicable moderators, may be subject to verbal warning,
|
|
||||||
expulsion from these spaces, or future events and activities for an undetermined
|
|
||||||
amount of time.
|
|
||||||
|
|
||||||
Some Terra community spaces may have additional rules in place, which will be
|
Some Terra community spaces may have additional rules in place, which will be made clearly available to all participants. Participants are
|
||||||
made clearly available to all participants. Participants are responsible for
|
responsible for knowing and abiding by these rules.
|
||||||
knowing and abiding by these rules.
|
|
||||||
|
|
||||||
# Longer version
|
# Longer version
|
||||||
|
|
||||||
Polyhedral Development is dedicated to providing a harassment-free experience
|
Polyhedral Development is dedicated to providing a harassment-free experience for everyone. We do not tolerate harassment of participants in
|
||||||
for everyone. We do not tolerate harassment of participants in any form.
|
any form.
|
||||||
|
|
||||||
## When and How to Use These Guidelines
|
## When and How to Use These Guidelines
|
||||||
|
|
||||||
This code of conduct applies to all Terra community spaces, both online and off.
|
This code of conduct applies to all Terra community spaces, both online and off. This applies to the github discussion tab,
|
||||||
This applies to the github discussion tab, the
|
the [Polyhedral Development community discord server](https://discord.gg/PXUEbbF), and any other Terra community. In addition, we may choose
|
||||||
[Polyhedral Development community discord server](https://discord.gg/PXUEbbF),
|
to invoke them in instances of harassment outside the Terra communities, and we will punish the responsible individuals appropriately. We
|
||||||
and any other Terra community. In addition, we may choose to invoke them in
|
will not tolerate harassment in any form, even outside of Terra.
|
||||||
instances of harassment outside the Terra communities, and we will punish the
|
|
||||||
responsible individuals appropriately. We will not tolerate harassment in any
|
|
||||||
form, even outside of Terra.
|
|
||||||
|
|
||||||
Some Terra spaces may have additional rules in place, which will be made clearly
|
Some Terra spaces may have additional rules in place, which will be made clearly available to participants. Participants are responsible for
|
||||||
available to participants. Participants are responsible for knowing and abiding
|
knowing and abiding by these rules, in addition to this code of conduct.
|
||||||
by these rules, in addition to this code of conduct.
|
|
||||||
|
|
||||||
## Expected Behavior
|
## Expected Behavior
|
||||||
|
|
||||||
@@ -44,43 +35,33 @@ The following behaviors are expected of all members of the Terra community:
|
|||||||
|
|
||||||
### Be Respectful
|
### Be Respectful
|
||||||
|
|
||||||
Value each other's ideas, styles and viewpoints. We may not always agree, but
|
Value each other's ideas, styles and viewpoints. We may not always agree, but disagreement is no excuse for poor manners. Be open to
|
||||||
disagreement is no excuse for poor manners. Be open to different possibilities
|
different possibilities and to being wrong. Be respectful in all interactions and communications, especially when debating the merits of
|
||||||
and to being wrong. Be respectful in all interactions and communications,
|
different options. Be aware of your impact and how intense interactions may be affecting people. Be direct, constructive and positive. Take
|
||||||
especially when debating the merits of different options. Be aware of your
|
responsibility for your impact, and your mistakes – if someone says they have been harmed through your words or actions, listen carefully,
|
||||||
impact and how intense interactions may be affecting people. Be direct,
|
apologize sincerely, and correct the behavior going forward.
|
||||||
constructive and positive. Take responsibility for your impact, and your
|
|
||||||
mistakes – if someone says they have been harmed through your words or actions,
|
|
||||||
listen carefully, apologize sincerely, and correct the behavior going forward.
|
|
||||||
|
|
||||||
#### Be Prepared to Admit When You are Wrong
|
#### Be Prepared to Admit When You are Wrong
|
||||||
|
|
||||||
Any member of the Terra community should always be open to new ideas and must
|
Any member of the Terra community should always be open to new ideas and must always be open to the possibility of being wrong. Nobody can
|
||||||
always be open to the possibility of being wrong. Nobody can always be right,
|
always be right, and we are only human; we are [fallible](https://www.merriam-webster.com/dictionary/fallible) by nature. It is okay to make
|
||||||
and we are only human; we are
|
mistakes, but we must be willing to admit when we make one.
|
||||||
[fallible](https://www.merriam-webster.com/dictionary/fallible) by nature. It is
|
|
||||||
okay to make mistakes, but we must be willing to admit when we make one.
|
|
||||||
|
|
||||||
### Be Direct but Professional
|
### Be Direct but Professional
|
||||||
|
|
||||||
We are likely to have some discussions about if and when criticism is respectful
|
We are likely to have some discussions about if and when criticism is respectful and when it's not. We must be able to speak directly when
|
||||||
and when it's not. We must be able to speak directly when we disagree and when
|
we disagree and when we think we need to improve. We cannot withhold hard truths. Doing so respectfully is hard, doing so when others don't
|
||||||
we think we need to improve. We cannot withhold hard truths. Doing so
|
seem to be listening is harder, and hearing such comments when one is the recipient can be even harder still. We need to be honest and
|
||||||
respectfully is hard, doing so when others don't seem to be listening is harder,
|
direct, as well as respectful.
|
||||||
and hearing such comments when one is the recipient can be even harder still. We
|
|
||||||
need to be honest and direct, as well as respectful.
|
|
||||||
|
|
||||||
### Be Inclusive
|
### Be Inclusive
|
||||||
|
|
||||||
Seek diverse perspectives. Diversity of views and of people on teams powers
|
Seek diverse perspectives. Diversity of views and of people on teams powers innovation, even if it is not always comfortable. Encourage all
|
||||||
innovation, even if it is not always comfortable. Encourage all voices. Help new
|
voices. Help new perspectives be heard and listen actively. If you find yourself dominating a discussion, it is especially important to step
|
||||||
perspectives be heard and listen actively. If you find yourself dominating a
|
back and encourage other voices to join in. Be aware of how much time is taken up by dominant members of the group. Provide alternative ways
|
||||||
discussion, it is especially important to step back and encourage other voices
|
to contribute or participate when possible.
|
||||||
to join in. Be aware of how much time is taken up by dominant members of the
|
|
||||||
group. Provide alternative ways to contribute or participate when possible.
|
|
||||||
|
|
||||||
Be inclusive of everyone in an interaction, respecting and facilitating people's
|
Be inclusive of everyone in an interaction, respecting and facilitating people's participation whether they are:
|
||||||
participation whether they are:
|
|
||||||
|
|
||||||
- Not native language speakers
|
- Not native language speakers
|
||||||
- Coming from a different culture
|
- Coming from a different culture
|
||||||
@@ -89,60 +70,47 @@ participation whether they are:
|
|||||||
- Facing other challenges to participate
|
- Facing other challenges to participate
|
||||||
- Or anything else. Be respectful of *everyone* at *all times*.
|
- Or anything else. Be respectful of *everyone* at *all times*.
|
||||||
|
|
||||||
Think about how you might facilitate alternative ways to contribute or
|
Think about how you might facilitate alternative ways to contribute or participate. If you find yourself dominating a discussion, step back.
|
||||||
participate. If you find yourself dominating a discussion, step back. Make way
|
Make way for other voices and listen actively to them.
|
||||||
for other voices and listen actively to them.
|
|
||||||
|
|
||||||
### Understand Different Perspectives
|
### Understand Different Perspectives
|
||||||
|
|
||||||
Our goal should not be to "win" every disagreement or argument. A more
|
Our goal should not be to "win" every disagreement or argument. A more productive goal is to be open to ideas that make our own ideas
|
||||||
productive goal is to be open to ideas that make our own ideas better. Strive to
|
better. Strive to be an example for inclusive thinking. "Winning" is when different perspectives make our work richer and stronger. That
|
||||||
be an example for inclusive thinking. "Winning" is when different perspectives
|
means, you must pay attention to all ideas proposed. Don't disregard one without giving it the attention it deserves.
|
||||||
make our work richer and stronger. That means, you must pay attention to all
|
|
||||||
ideas proposed. Don't disregard one without giving it the attention it deserves.
|
|
||||||
|
|
||||||
### Appreciate and Accommodate Our Similarities and Differences
|
### Appreciate and Accommodate Our Similarities and Differences
|
||||||
|
|
||||||
People come from many cultures and backgrounds. Cultural differences can
|
People come from many cultures and backgrounds. Cultural differences can encompass everything from official religious observances to
|
||||||
encompass everything from official religious observances to personal habits to
|
personal habits to clothing. Be respectful of anyone with different cultural practices, attitudes and beliefs. Work to eliminate your own
|
||||||
clothing. Be respectful of anyone with different cultural practices, attitudes
|
biases, prejudices and discriminatory practices. Think of others' needs from their point of view. Use preferred titles (including
|
||||||
and beliefs. Work to eliminate your own biases, prejudices and discriminatory
|
pronouns<sup>[\[1\]](#1)</sup>) and the appropriate tone of voice. Respect people's right to privacy and confidentiality. Be open to
|
||||||
practices. Think of others' needs from their point of view. Use preferred
|
learning from and educating others as well as educating yourself; it is unrealistic to expect someone to know the cultural practices of
|
||||||
titles (including pronouns<sup>[\[1\]](#1)</sup>) and the appropriate tone of
|
every ethnic and cultural group. Therefore we must be ready to correct someone if they make a mistake, and must be ready ourselves to change
|
||||||
voice. Respect people's right to privacy and confidentiality. Be open to
|
and learn if we make a mistake.
|
||||||
learning from and educating others as well as educating yourself; it is
|
|
||||||
unrealistic to expect someone to know the cultural practices of every ethnic and
|
|
||||||
cultural group. Therefore we must be ready to correct someone if they make a
|
|
||||||
mistake, and must be ready ourselves to change and learn if we make a mistake.
|
|
||||||
|
|
||||||
### Lead by Example
|
### Lead by Example
|
||||||
|
|
||||||
By matching your actions with your words, you become a person others want to
|
By matching your actions with your words, you become a person others want to follow. Your actions influence others to behave and respond in
|
||||||
follow. Your actions influence others to behave and respond in ways that are
|
ways that are valuable and appropriate for our organizational outcomes. Design your community and your work for inclusion. Hold yourself and
|
||||||
valuable and appropriate for our organizational outcomes. Design your community
|
others accountable for inclusive behaviors.
|
||||||
and your work for inclusion. Hold yourself and others accountable for inclusive
|
|
||||||
behaviors.
|
|
||||||
|
|
||||||
## Behavior That Will Not Be Tolerated
|
## Behavior That Will Not Be Tolerated
|
||||||
|
|
||||||
The following behaviors are considered to be unacceptable and will not be
|
The following behaviors are considered to be unacceptable and will not be tolerated:
|
||||||
tolerated:
|
|
||||||
|
|
||||||
### Violence and Threats of Violence
|
### Violence and Threats of Violence
|
||||||
|
|
||||||
Violence and threats of violence are not acceptable - online or offline. This
|
Violence and threats of violence are not acceptable - online or offline. This includes incitement of violence toward any individual,
|
||||||
includes incitement of violence toward any individual, including encouraging a
|
including encouraging a person to commit self-harm, engage in self-harm, or put themselves in a negative position (e.g. one which can lead
|
||||||
person to commit self-harm, engage in self-harm, or put themselves in a negative
|
to an increase of depression, etc.).
|
||||||
position (e.g. one which can lead to an increase of depression, etc.).
|
|
||||||
|
|
||||||
### Personal Attacks
|
### Personal Attacks
|
||||||
|
|
||||||
Conflicts will inevitably arise, but frustration should never turn into a
|
Conflicts will inevitably arise, but frustration should never turn into a personal attack. It is not okay to insult, demean or belittle
|
||||||
personal attack. It is not okay to insult, demean or belittle others. Attacking
|
others. Attacking someone for their opinions, beliefs and ideas is not acceptable. It is important to speak directly when we disagree and
|
||||||
someone for their opinions, beliefs and ideas is not acceptable. It is important
|
when we think we need to improve, but such discussions must be conducted respectfully and professionally, remaining focused on the issue at
|
||||||
to speak directly when we disagree and when we think we need to improve, but
|
hand.
|
||||||
such discussions must be conducted respectfully and professionally, remaining
|
|
||||||
focused on the issue at hand.
|
|
||||||
|
|
||||||
### Derogatory Language
|
### Derogatory Language
|
||||||
|
|
||||||
@@ -167,40 +135,30 @@ Offensive, unwelcome, or hurtful comments related to:
|
|||||||
- Socioeconomic status
|
- Socioeconomic status
|
||||||
- Religion
|
- Religion
|
||||||
- Employment
|
- Employment
|
||||||
- Or anything really. Just don't be offensive towards people, insult them, or
|
- Or anything really. Just don't be offensive towards people, insult them, or make unwanted comments.
|
||||||
make unwanted comments.
|
|
||||||
|
|
||||||
is not acceptable. This includes deliberately referring to someone by a gender
|
is not acceptable. This includes deliberately referring to someone by a gender that they do not identify with, and/or questioning the
|
||||||
that they do not identify with, and/or questioning the legitimacy of an
|
legitimacy of an individual's gender identity. If you're unsure if a word is derogatory, don't use it. This also includes repeated subtle
|
||||||
individual's gender identity. If you're unsure if a word is derogatory, don't
|
and/or indirect discrimination; when asked to stop, stop the behavior in question.
|
||||||
use it. This also includes repeated subtle and/or indirect discrimination; when
|
|
||||||
asked to stop, stop the behavior in question.
|
|
||||||
|
|
||||||
### Unwelcome Sexual Attention or Physical Contact
|
### Unwelcome Sexual Attention or Physical Contact
|
||||||
|
|
||||||
Unwelcome sexual attention or unwelcome physical contact is not acceptable. This
|
Unwelcome sexual attention or unwelcome physical contact is not acceptable. This includes sexualized comments, jokes or imagery in
|
||||||
includes sexualized comments, jokes or imagery in interactions, communications
|
interactions, communications or presentation materials, as well as inappropriate touching, groping, or sexual advances. Additionally,
|
||||||
or presentation materials, as well as inappropriate touching, groping, or sexual
|
touching a person without permission, including sensitive areas such as their hair, pregnant stomach, mobility device (wheelchair, scooter,
|
||||||
advances. Additionally, touching a person without permission, including
|
etc) or tattoos is unacceptable. This includes physically blocking or intimidating another person. Physical contact or simulated physical
|
||||||
sensitive areas such as their hair, pregnant stomach, mobility device (
|
contact (e.g. emojis like ":​kiss:", ":hug:", or ":kiss_mark:", textual descriptions like "\*hug\*", "\*backrub\*", or "\*kisses
|
||||||
wheelchair, scooter, etc) or tattoos is unacceptable. This includes physically
|
you\*", etc.) without affirmative consent or after a request to stop will not be accepted.
|
||||||
blocking or intimidating another person. Physical contact or simulated physical
|
|
||||||
contact (e.g. emojis like ":​kiss:", ":hug:", or ":kiss_mark:", textual
|
|
||||||
descriptions like "\*hug\*", "\*backrub\*", or "\*kisses you\*", etc.) without
|
|
||||||
affirmative consent or after a request to stop will not be accepted.
|
|
||||||
|
|
||||||
### Sexual Behaviour Where it is Not Appropriate
|
### Sexual Behaviour Where it is Not Appropriate
|
||||||
|
|
||||||
Uninvited or off-topic sexual images, text, or behaviour in spaces where they're
|
Uninvited or off-topic sexual images, text, or behaviour in spaces where they're not appropriate will not be accepted whatsoever. We are an
|
||||||
not appropriate will not be accepted whatsoever. We are an open community, which
|
open community, which means spaces must be appropriate for all ages, and everybody must feel comfortable. Discussion of sexual things, will
|
||||||
means spaces must be appropriate for all ages, and everybody must feel
|
be prohibited unless otherwise noted.
|
||||||
comfortable. Discussion of sexual things, will be prohibited unless otherwise
|
|
||||||
noted.
|
|
||||||
|
|
||||||
### Discussion of Sensitive Topics
|
### Discussion of Sensitive Topics
|
||||||
|
|
||||||
Discussion of sensitive topics when asked to stop, or when not appropriate.
|
Discussion of sensitive topics when asked to stop, or when not appropriate. Including, but not limited to:
|
||||||
Including, but not limited to:
|
|
||||||
|
|
||||||
- Anything sexual
|
- Anything sexual
|
||||||
- Gore
|
- Gore
|
||||||
@@ -209,110 +167,81 @@ Including, but not limited to:
|
|||||||
- Anything related to death
|
- Anything related to death
|
||||||
- Or really anything that someone may be sensitive about.
|
- Or really anything that someone may be sensitive about.
|
||||||
|
|
||||||
shall not be tolerated. As a community for all ages and all kinds of people, we
|
shall not be tolerated. As a community for all ages and all kinds of people, we must cater to everyone, and must make sure everyone feels
|
||||||
must cater to everyone, and must make sure everyone feels comfortable here.
|
comfortable here. Repeatedly breaking someone else's boundaries will not be tolerated.
|
||||||
Repeatedly breaking someone else's boundaries will not be tolerated.
|
|
||||||
|
|
||||||
### Disruptive Behavior
|
### Disruptive Behavior
|
||||||
|
|
||||||
Sustained disruption of events, forums, or meetings, online or otherwise,
|
Sustained disruption of events, forums, or meetings, online or otherwise, including talks and presentations, will not be tolerated. This
|
||||||
including talks and presentations, will not be tolerated. This includes:
|
includes:
|
||||||
|
|
||||||
- 'Talking over', 'heckling', or otherwise disrupting speakers.
|
- 'Talking over', 'heckling', or otherwise disrupting speakers.
|
||||||
- Making derogatory comments about someone else's choices, pushing people to do
|
- Making derogatory comments about someone else's choices, pushing people to do something they do not wish to do, talking about their
|
||||||
something they do not wish to do, talking about their choices or personal
|
choices or personal preferences to others, or pressuring them to do something they don't wish to - physically or through jeering.
|
||||||
preferences to others, or pressuring them to do something they don't wish to -
|
|
||||||
physically or through jeering.
|
|
||||||
- Behaviour that intentionally disrupts an event.
|
- Behaviour that intentionally disrupts an event.
|
||||||
- Otherwise influencing actions that may cause hostility in the session.
|
- Otherwise influencing actions that may cause hostility in the session.
|
||||||
|
|
||||||
### Influencing Unacceptable Behavior
|
### Influencing Unacceptable Behavior
|
||||||
|
|
||||||
We will treat influencing or leading such activities the same way we treat the
|
We will treat influencing or leading such activities the same way we treat the activities themselves, and thus the same consequences apply.
|
||||||
activities themselves, and thus the same consequences apply. To make someone do
|
To make someone do something bad is the same thing as if you were to do it yourself, and we will not tolerate it.
|
||||||
something bad is the same thing as if you were to do it yourself, and we will
|
|
||||||
not tolerate it.
|
|
||||||
|
|
||||||
### Stalking or Following
|
### Stalking or Following
|
||||||
|
|
||||||
Stalking or following in any form (offline or online) is unnacceptable. In
|
Stalking or following in any form (offline or online) is unnacceptable. In addition, you may not take pictures or record video of others
|
||||||
addition, you may not take pictures or record video of others without their
|
without their express permission or when asked to stop. Any individual may also request for you to delete all footage you have of them, even
|
||||||
express permission or when asked to stop. Any individual may also request for
|
if you took it with their prior consent.
|
||||||
you to delete all footage you have of them, even if you took it with their prior
|
|
||||||
consent.
|
|
||||||
|
|
||||||
### Publication of Personal Information
|
### Publication of Personal Information
|
||||||
|
|
||||||
The publication of personally identifying information (commonly known
|
The publication of personally identifying information (commonly known as "[doxxing](https://en.wikipedia.org/wiki/Doxing)") is directly
|
||||||
as "[doxxing](https://en.wikipedia.org/wiki/Doxing)") is directly prohibited.
|
prohibited. You may not publish information that someone wants to keep private, unless it is necessary to protect vulnerable people from
|
||||||
You may not publish information that someone wants to keep private, unless it is
|
intentional abuse. Addditionally, you may not deliberately "out" any aspect of a person's identity without their consent, this includes
|
||||||
necessary to protect vulnerable people from intentional abuse. Addditionally,
|
gender, pronouns, sexual identity, etc.
|
||||||
you may not deliberately "out" any aspect of a person's identity without their
|
|
||||||
consent, this includes gender, pronouns, sexual identity, etc.
|
|
||||||
|
|
||||||
Unless it pretains to a case of harassment, as outlined here, in which case some
|
Unless it pretains to a case of harassment, as outlined here, in which case some personally identifying information may need to be brought
|
||||||
personally identifying information may need to be brought up in private with the
|
up in private with the appropriate moderation team to help aid our efforts in keeping the community safe.
|
||||||
appropriate moderation team to help aid our efforts in keeping the community
|
|
||||||
safe.
|
|
||||||
|
|
||||||
### Deliberate Misuse of Pronouns<sup>[\[1\]](#1)</sup> or Names
|
### Deliberate Misuse of Pronouns<sup>[\[1\]](#1)</sup> or Names
|
||||||
|
|
||||||
As an inclusive community, we must respect everyone. That means respecting the
|
As an inclusive community, we must respect everyone. That means respecting the pronouns or names they wish for us to use. Deliberate
|
||||||
pronouns or names they wish for us to use. Deliberate misgendering, misuse of
|
misgendering, misuse of preferred pronouns<sup>[\[1\]](#1)</sup>, or use of 'dead' or rejected names is not to be tolerated. (If someone
|
||||||
preferred pronouns<sup>[\[1\]](#1)</sup>, or use of 'dead' or rejected names is
|
*accidentally* uses the incorrect pronouns, gender, or name, politely ask them to use the correct pronouns/gender/name. But if they are to
|
||||||
not to be tolerated. (If someone
|
continue using the incorrect pronouns, gender, or name, then you should escalate and report them to us.)
|
||||||
*accidentally* uses the incorrect pronouns, gender, or name, politely ask them
|
|
||||||
to use the correct pronouns/gender/name. But if they are to continue using the
|
|
||||||
incorrect pronouns, gender, or name, then you should escalate and report them to
|
|
||||||
us.)
|
|
||||||
|
|
||||||
### Not Stopping After Multiple Requests
|
### Not Stopping After Multiple Requests
|
||||||
|
|
||||||
If someone asks you to stop doing something, then you should stop. Continuing to
|
If someone asks you to stop doing something, then you should stop. Continuing to do it may be considered harassment, and can lead you to be
|
||||||
do it may be considered harassment, and can lead you to be removed from our
|
removed from our community.
|
||||||
community.
|
|
||||||
|
|
||||||
## Complains We May Ignore
|
## Complains We May Ignore
|
||||||
|
|
||||||
Additionally, Terra prioritizes marginalized people's safety over privileged
|
Additionally, Terra prioritizes marginalized people's safety over privileged people's comfort. We reserve the right to ignore complaints
|
||||||
people's comfort. We reserve the right to ignore complaints regarding:
|
regarding:
|
||||||
|
|
||||||
- Claims of discrimination against non-marginalized or oppressed groups (eg.
|
- Claims of discrimination against non-marginalized or oppressed groups (eg. being 'superphobic', meaning to not support people who are
|
||||||
being 'superphobic', meaning to not support people who are
|
'superstraight', which is a dog whistle for transphobic groups, or being 'cisphobic' without large amounts of evidence, etc.), or claims
|
||||||
'superstraight', which is a dog whistle for transphobic groups, or being '
|
of discrimination with no evidence. (Basically, don't report 'cisphobia' to us, because it doesn't exist. But if someone is mocking you or
|
||||||
cisphobic' without large amounts of evidence, etc.), or claims of
|
making fun of you for being cis, and it is *really* getting out of hand, then do tell us.)
|
||||||
discrimination with no evidence. (Basically, don't report 'cisphobia' to us,
|
- Reasonable communication of boundaries, such as "leave me alone," "go away," or "I'm not discussing this with you." (If someone is asking
|
||||||
because it doesn't exist. But if someone is mocking you or making fun of you
|
you to stop, that is not reason for you to report them as harassing you.)
|
||||||
for being cis, and it is *really* getting out of hand, then do tell us.)
|
- Communicating in a 'tone' you don't find [congenial](https://www.thefreedictionary.com/congenial). (You may not report someone for
|
||||||
- Reasonable communication of boundaries, such as "leave me alone," "go away,"
|
harassment for being 'annoyed with you' or 'talking sternly to you')
|
||||||
or "I'm not discussing this with you." (If someone is asking you to stop, that
|
- Criticizing or calling out racist, sexist, discriminatory, or otherwise oppressive behavior or assumptions. (You may not say that someone
|
||||||
is not reason for you to report them as harassing you.)
|
is harassing you if they are telling you to stop discriminating against someone.)
|
||||||
- Communicating in a 'tone' you don't
|
- Disagreements that do not qualify as harassment. If you have a simple disagreement with someone, and they have not been discriminating to
|
||||||
find [congenial](https://www.thefreedictionary.com/congenial). (You may not
|
anyone, in any form, then we will not take action against them. Two people are allowed to disagree on things without it getting toxic.
|
||||||
report someone for harassment for being 'annoyed with you' or 'talking sternly
|
|
||||||
to you')
|
|
||||||
- Criticizing or calling out racist, sexist, discriminatory, or otherwise
|
|
||||||
oppressive behavior or assumptions. (You may not say that someone is harassing
|
|
||||||
you if they are telling you to stop discriminating against someone.)
|
|
||||||
- Disagreements that do not qualify as harassment. If you have a simple
|
|
||||||
disagreement with someone, and they have not been discriminating to anyone, in
|
|
||||||
any form, then we will not take action against them. Two people are allowed to
|
|
||||||
disagree on things without it getting toxic.
|
|
||||||
|
|
||||||
We may also additionally choose to enact punishment for submitting a complaint
|
We may also additionally choose to enact punishment for submitting a complaint in bad-faith or without adequate justification, if we deem
|
||||||
in bad-faith or without adequate justification, if we deem necessary; if you're
|
necessary; if you're submitting a complaint just to troll or to annoy people, we may choose to have you banned or removed from the community
|
||||||
submitting a complaint just to troll or to annoy people, we may choose to have
|
spaces. Don't waste our time.
|
||||||
you banned or removed from the community spaces. Don't waste our time.
|
|
||||||
|
|
||||||
In order to protect volunteers from abuse and burnout, we reserve the right to
|
In order to protect volunteers from abuse and burnout, we reserve the right to reject any report we believe to have been made in bad faith
|
||||||
reject any report we believe to have been made in bad faith or with misintent.
|
or with misintent. Reports intended to silence legitimate criticism may be deleted without response.
|
||||||
Reports intended to silence legitimate criticism may be deleted without
|
|
||||||
response.
|
|
||||||
|
|
||||||
## Reporting
|
## Reporting
|
||||||
|
|
||||||
Terra has a global moderation team which is currently comprised of the following
|
Terra has a global moderation team which is currently comprised of the following members:
|
||||||
members:
|
|
||||||
|
|
||||||
- solonovamax
|
- solonovamax
|
||||||
- discord: [@solonovamax#6983](https://discord.com/channels/@me/566146322273402881)*
|
- discord: [@solonovamax#6983](https://discord.com/channels/@me/566146322273402881)*
|
||||||
@@ -327,103 +256,82 @@ members:
|
|||||||
- github: [@duplexsystem](https://github.com/duplexsystem)
|
- github: [@duplexsystem](https://github.com/duplexsystem)
|
||||||
- email: [duplexsys@protonmail.com](mailto:duplexsys@protonmail.com)
|
- email: [duplexsys@protonmail.com](mailto:duplexsys@protonmail.com)
|
||||||
|
|
||||||
\* The preferred method of communication is through discord. Although we will
|
\* The preferred method of communication is through discord. Although we will still be responsive on the other platforms, we will be more
|
||||||
still be responsive on the other platforms, we will be more responsive on
|
responsive on discord.
|
||||||
discord.
|
|
||||||
|
|
||||||
These are people you can contact for anything regarding this code of conduct.
|
These are people you can contact for anything regarding this code of conduct.
|
||||||
|
|
||||||
If you are being harassed by a member of the Terra community, or by someone in a
|
If you are being harassed by a member of the Terra community, or by someone in a Terra community space, notice that someone else is being
|
||||||
Terra community space, notice that someone else is being harassed, or have any
|
harassed, or have any other concerns, please contact a moderator of the platform it occurred on, or someone on the global moderation team.
|
||||||
other concerns, please contact a moderator of the platform it occurred on, or
|
If the person who is harassing you is on the global moderation team, they will [recuse](https://www.thefreedictionary.com/recuse) themselves
|
||||||
someone on the global moderation team. If the person who is harassing you is on
|
from handling your incident. (Meaning: if you are reporting someone on the team, they will not be involved in the discussion.) We will
|
||||||
the global moderation team, they
|
respond within a reasonable time frame, but generally within about 1 day.
|
||||||
will [recuse](https://www.thefreedictionary.com/recuse) themselves from handling
|
|
||||||
your incident. (Meaning: if you are reporting someone on the team, they will not
|
|
||||||
be involved in the discussion.) We will respond within a reasonable time frame,
|
|
||||||
but generally within about 1 day.
|
|
||||||
|
|
||||||
This code of conduct applies to Terra community spaces, but if you are being
|
This code of conduct applies to Terra community spaces, but if you are being harassed by a member of Terra *outside* our spaces, we still
|
||||||
harassed by a member of Terra *outside* our spaces, we still want to know about
|
want to know about it as we may choose to take action within our community. We will take all good-faith reports seriously and will always
|
||||||
it as we may choose to take action within our community. We will take all
|
attempt to handle them appropriately. This includes harassment outside our spaces and harassment that took place at any point in time. The
|
||||||
good-faith reports seriously and will always attempt to handle them
|
moderation team reserves the right to exclude people from Terra communities based on their past behavior, including behavior outside Terra
|
||||||
appropriately. This includes harassment outside our spaces and harassment that
|
spaces and behavior towards people who are not in Terra.
|
||||||
took place at any point in time. The moderation team reserves the right to
|
|
||||||
exclude people from Terra communities based on their past behavior, including
|
|
||||||
behavior outside Terra spaces and behavior towards people who are not in Terra.
|
|
||||||
|
|
||||||
Note: although we only have the ability to moderate official community spaces,
|
Note: although we only have the ability to moderate official community spaces, if you are being harassed by someone in a non-official
|
||||||
if you are being harassed by someone in a non-official community space, and the
|
community space, and the moderation team of that platform refuses to do anything to help you (or even if they *do* help you), then you
|
||||||
moderation team of that platform refuses to do anything to help you (or even if
|
should notify us so that we may take appropriate action.
|
||||||
they *do* help you), then you should notify us so that we may take appropriate
|
|
||||||
action.
|
|
||||||
|
|
||||||
We will respect confidentiality requests for the purpose of protecting victims
|
We will respect confidentiality requests for the purpose of protecting victims of abuse. At our discretion, we may publicly name a person
|
||||||
of abuse. At our discretion, we may publicly name a person which we have
|
which we have received harassment complaints about, or privately warn third parties about them, but only if we believe that doing so will
|
||||||
received harassment complaints about, or privately warn third parties about
|
increase the safety of Terra community members or the general public. We will not name harassment victims or reporters of harassment
|
||||||
them, but only if we believe that doing so will increase the safety of Terra
|
(assuming the report was made in good-faith) without their explicit consent; all reports will remain anonymous by default.
|
||||||
community members or the general public. We will not name harassment victims or
|
|
||||||
reporters of harassment
|
|
||||||
(assuming the report was made in good-faith) without their explicit consent; all
|
|
||||||
reports will remain anonymous by default.
|
|
||||||
|
|
||||||
## Consequences of Unacceptable Behavior
|
## Consequences of Unacceptable Behavior
|
||||||
|
|
||||||
Participants asked to stop any harassing behavior are expected to comply
|
Participants asked to stop any harassing behavior are expected to comply immediately. Whether or not you comply immediately, you may still
|
||||||
immediately. Whether or not you comply immediately, you may still face
|
face consequences for you actions, but if the harasser doesn't comply immediately then we may choose to take additional actions to protect
|
||||||
consequences for you actions, but if the harasser doesn't comply immediately
|
the Terra community members or the individual being harassed.
|
||||||
then we may choose to take additional actions to protect the Terra community
|
|
||||||
members or the individual being harassed.
|
|
||||||
|
|
||||||
Violation of this code can result in being asked to leave an event or online
|
Violation of this code can result in being asked to leave an event or online space, either temporarily or for the duration of the event, or
|
||||||
space, either temporarily or for the duration of the event, or being banned from
|
being banned from participation in spaces, or future events and activities in perpetuity. If a participant engages in harassing behavior,
|
||||||
participation in spaces, or future events and activities in perpetuity. If a
|
the global moderation team may take any action they deem appropriate, up to and including expulsion from all Terra community spaces and
|
||||||
participant engages in harassing behavior, the global moderation team may take
|
identification of the participant as a harasser to other Terra community members or the general public. Bad behavior from any community
|
||||||
any action they deem appropriate, up to and including expulsion from all Terra
|
|
||||||
community spaces and identification of the participant as a harasser to other
|
|
||||||
Terra community members or the general public. Bad behavior from any community
|
|
||||||
member, including those with decision-making authority, will not be tolerated.
|
member, including those with decision-making authority, will not be tolerated.
|
||||||
|
|
||||||
In addition, any participants who abuse the reporting process will be considered
|
In addition, any participants who abuse the reporting process will be considered to be in violation of these guidelines and subject to
|
||||||
to be in violation of these guidelines and subject to consequences. False
|
consequences. False reporting, especially to retaliate or exclude, will not be accepted or tolerated.
|
||||||
reporting, especially to retaliate or exclude, will not be accepted or
|
|
||||||
tolerated.
|
|
||||||
|
|
||||||
## Questions
|
## Questions
|
||||||
|
|
||||||
if you have further questions for anything not addressed here, you may open an
|
if you have further questions for anything not addressed here, you may open an issue on this github repo, or contact a member of the global
|
||||||
issue on this github repo, or contact a member of the global moderation team.
|
moderation team.
|
||||||
|
|
||||||
## License and Attribution
|
## License and Attribution
|
||||||
|
|
||||||
This set of guidelines is distributed under a
|
This set of guidelines is distributed under a
|
||||||
[Creative Commons Attribution-ShareAlike license](https://creativecommons.org/licenses/by-sa/3.0/).
|
[Creative Commons Attribution-ShareAlike license](https://creativecommons.org/licenses/by-sa/3.0/).
|
||||||
|
|
||||||
These guidelines have been adapted with modifications from the following sources:
|
These guidelines have been adapted from
|
||||||
|
[Mozilla's Community Participation Guidelines](https://www.mozilla.org/en-US/about/governance/policies/participation/), which were adapted
|
||||||
|
from:
|
||||||
|
|
||||||
- [Mozilla's Community Participation Guidelines](https://www.mozilla.org/en-US/about/governance/policies/participation/)
|
- Mozilla's original Community Participation Guidelines
|
||||||
- The [Ubuntu Code of Conduct](https://ubuntu.com/community/code-of-conduct)
|
- The [Ubuntu Code of Conduct](https://ubuntu.com/community/code-of-conduct)
|
||||||
- Mozilla's [View Source Conference Code of Conduct](https://viewsourceconf.org/berlin-2016/code-of-conduct/)
|
- Mozilla's [View Source Conference Code of Conduct](https://viewsourceconf.org/berlin-2016/code-of-conduct/)
|
||||||
- The [Rust Language Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct)
|
- And the [Rust Language Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct)
|
||||||
- The [Stumptown Syndicate's Citizen Code of Conduct](http://citizencodeofconduct.org/)
|
|
||||||
- The [LGBTQ in Technology Code of Conduct](https://lgbtq.technology/coc.html)
|
which in turn were based on [Stumptown Syndicate's Citizen Code of Conduct](http://citizencodeofconduct.org/), along with some adapted text
|
||||||
- The [WisCon code of conduct](http://wiscon.net/policies/anti-harassment/code-of-conduct/)
|
from the [LGBTQ in Technology Code of Conduct](https://lgbtq.technology/coc.html) and
|
||||||
|
the [WisCon code of conduct](http://wiscon.net/policies/anti-harassment/code-of-conduct/).
|
||||||
|
|
||||||
|
It was then modified by solonovamax with various inclusions from
|
||||||
|
the [LGBTQ in Technology Code of Conduct](https://lgbtq.technology/coc.html) and a few other sources.
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
#### \[1\]
|
#### \[1\]
|
||||||
|
|
||||||
You provide a set of pronouns that everyone is comfortable addressing you with.
|
You provide a set of pronouns that everyone is comfortable addressing you with. Although some people are comfortable
|
||||||
Although some people are comfortable
|
using [neopronouns](https://www.mypronouns.org/neopronouns), not everyone is. Therefore, if you use neopronouns, you should have at *least*
|
||||||
using [neopronouns](https://www.mypronouns.org/neopronouns), not everyone is.
|
one set of more common pronouns (One of he/him, she/her, or they/them; it doesn't matter which one. Anyone who doesn't respect your basic
|
||||||
Therefore, if you use neopronouns, you should have at *least*
|
pronouns will be removed from the community.) that people may use, should they so choose, as some people are not comfortable
|
||||||
one set of more common pronouns (One of he/him, she/her, or they/them; it
|
using [neopronouns](https://www.mypronouns.org/neopronouns). But if someone refuses to use your more common pronouns, you should report them
|
||||||
doesn't matter which one. Anyone who doesn't respect your basic pronouns will be
|
to us. Additionally, you may not ask people to use unreasonable pronouns, such as 'acab/acabself', 'that/bitch', 'ur/mom', or
|
||||||
removed from the community.) that people may use, should they so choose, as some
|
'dream/dreamself' (pronouns related to real people, eg. the minecraft youtuber 'dreamwastaken'). Doing so will be considered mockery of
|
||||||
people are not comfortable
|
individuals who use non-standard pronouns and is very disrespectful.
|
||||||
using [neopronouns](https://www.mypronouns.org/neopronouns). But if someone
|
|
||||||
refuses to use your more common pronouns, you should report them to us.
|
|
||||||
Additionally, you may not ask people to use unreasonable pronouns, such as '
|
|
||||||
acab/acabself', 'that/bitch', 'ur/mom', or anything else that may be considered
|
|
||||||
disrectful. Doing so will be considered mockery of individuals who use
|
|
||||||
non-standard pronouns and is very disrespectful.
|
|
||||||
+113
-198
@@ -1,22 +1,17 @@
|
|||||||
# Contributing to Terra
|
# Contributing to Terra
|
||||||
|
|
||||||
First off, thank you for considering contributing to Terra. It's people like you
|
First off, thank you for considering contributing to Terra. It's people like you that make Terra such a great tool.
|
||||||
that make Terra such a great tool.
|
|
||||||
|
|
||||||
Following these guidelines helps to effectively use the time of the developers
|
Following these guidelines helps to effectively use the time of the developers managing and developing this open source project, making it
|
||||||
managing and developing this open source project, making it more enjoyable for
|
more enjoyable for all of us.
|
||||||
all of us.
|
|
||||||
|
|
||||||
Terra is an open source project and we love to receive contributions from our
|
Terra is an open source project and we love to receive contributions from our community, you! There are many ways to contribute, from
|
||||||
community, you! There are many ways to contribute, from writing tutorials or
|
writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code which can be
|
||||||
blog posts, improving the documentation, submitting bug reports and feature
|
incorporated into Terra.
|
||||||
requests or writing code which can be incorporated into Terra.
|
|
||||||
|
|
||||||
The following is a set of guidelines for contributing to Terra and its packages,
|
The following is a set of guidelines for contributing to Terra and its packages, which are hosted in
|
||||||
which are hosted in
|
the [PolyhedralDev Organization](https://github.com/PolyhedralDev) on GitHub. These are mostly guidelines, not rules. Use your best
|
||||||
the [PolyhedralDev Organization](https://github.com/PolyhedralDev) on GitHub.
|
judgment, and feel free to propose changes to this document in a pull request.
|
||||||
These are mostly guidelines, not rules. Use your best judgment, and feel free to
|
|
||||||
propose changes to this document in a pull request.
|
|
||||||
|
|
||||||
#### Table Of Contents
|
#### Table Of Contents
|
||||||
|
|
||||||
@@ -56,15 +51,12 @@ propose changes to this document in a pull request.
|
|||||||
|
|
||||||
## Code of Conduct
|
## Code of Conduct
|
||||||
|
|
||||||
This project and everyone participating in it is governed by
|
This project and everyone participating in it is governed by the [Terra of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected
|
||||||
the [Terra of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected
|
to uphold this code. Please report unacceptable behavior to [Terra global moderation team](CODE_OF_CONDUCT.md#Reporting).
|
||||||
to uphold this code. Please report unacceptable behavior
|
|
||||||
to [Terra global moderation team](CODE_OF_CONDUCT.md#Reporting).
|
|
||||||
|
|
||||||
## I don't want to read this whole thing I just have a question!!!
|
## I don't want to read this whole thing I just have a question!!!
|
||||||
|
|
||||||
> **Note:** Please don't file an issue to ask a question. You'll get faster
|
> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
|
||||||
> results by using the resources below.
|
|
||||||
|
|
||||||
We have an official discord server where you can request help from various users
|
We have an official discord server where you can request help from various users
|
||||||
|
|
||||||
@@ -74,221 +66,160 @@ We have an official discord server where you can request help from various users
|
|||||||
|
|
||||||
### Your First Contribution
|
### Your First Contribution
|
||||||
|
|
||||||
Unsure where to begin contributing to Terra? You can start by looking through "
|
Unsure where to begin contributing to Terra? You can start by looking through "beginner" and "help wanted" issues:
|
||||||
beginner" and "help wanted" issues:
|
|
||||||
|
|
||||||
- [Beginner issues](https://github.com/PolyhedralDev/Terra/labels/Note%3A%20Good%20First%20Issue)
|
- [Beginner issues](https://github.com/PolyhedralDev/Terra/labels/Note%3A%20Good%20First%20Issue) - issues which should be friendly to
|
||||||
- issues which should be friendly to anyone new to terra.
|
anyone new to terra.
|
||||||
- [Help wanted issues](https://github.com/PolyhedralDev/Terra/labels/Note%3A%20Help%20Wanted)
|
- [Help wanted issues](https://github.com/PolyhedralDev/Terra/labels/Note%3A%20Help%20Wanted) - issues which should be a bit more involved
|
||||||
- issues which should be a bit more involved than "beginner" issues.
|
than "beginner" issues.
|
||||||
|
|
||||||
New to github? Working on your first Pull Request? Check
|
New to github? Working on your first Pull Request? Check
|
||||||
out [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github)
|
out [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github)
|
||||||
to get you up on your feet.
|
to get you up on your feet.
|
||||||
|
|
||||||
At this point, you're ready to make your changes! Feel free to ask for help;
|
At this point, you're ready to make your changes! Feel free to ask for help; everyone is a beginner at first!
|
||||||
everyone is a beginner at first!
|
|
||||||
|
|
||||||
If a maintainer asks you to "rebase" your PR, they're saying that a lot of code
|
If a maintainer asks you to "rebase" your PR, they're saying that a lot of code has changed, and that you need to update your branch so it's
|
||||||
has changed, and that you need to update your branch so it's easier to merge.
|
easier to merge.
|
||||||
|
|
||||||
### Reporting Bugs
|
### Reporting Bugs
|
||||||
|
|
||||||
This section guides you through submitting a bug report for Terra. Following
|
This section guides you through submitting a bug report for Terra. Following these guidelines helps maintainers and the community understand
|
||||||
these guidelines helps maintainers and the community understand your report, and
|
your report, and spend their time fixing the issue instead of understanding what you mean.
|
||||||
spend their time fixing the issue instead of understanding what you mean.
|
|
||||||
|
|
||||||
Before creating bug reports, please
|
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create
|
||||||
check [this list](#before-submitting-a-bug-report) as you might find out that
|
one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report).
|
||||||
you don't need to create one. When you are creating a bug report,
|
|
||||||
please [include as many details as possible](#how-do-i-submit-a-good-bug-report)
|
|
||||||
.
|
|
||||||
|
|
||||||
> **Note:** If you find a **Closed** issue that seems like it is the same thing
|
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
|
||||||
> that you're experiencing, open a new issue and include a link to the original
|
|
||||||
> issue in the body of your new one.
|
|
||||||
|
|
||||||
#### Before Submitting A Bug Report
|
#### Before Submitting A Bug Report
|
||||||
|
|
||||||
- Join the [discord server](https://discord.dfsek.com) to help resolve simple
|
- Join the [discord server](https://discord.dfsek.com) to help resolve simple issues.
|
||||||
issues.
|
- You must be on the LATEST version of Terra to receive any support. There is no support for older versions of Terra.
|
||||||
- You must be on the LATEST version of Terra to receive any support. There is no
|
- Make sure that this is not a *specific* compatibility issue with another terrain generation mod. Do not request *specific* compatibility
|
||||||
support for older versions of Terra.
|
with mods or plugins (e.g. "Compatibility with TechCraft v7"). That should be implemented in an addon, **not** in the main project.
|
||||||
- Make sure that this is not a *specific* compatibility issue with another
|
*General* compatibility (e.g. "Ability to pull Vanilla/Modded features from parent biomes") will be considered in the main project.
|
||||||
terrain generation mod. Do not request *specific* compatibility with mods or
|
- Search for any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+) open with your problem. If you open
|
||||||
plugins (e.g. "Compatibility with TechCraft v7"). That should be implemented
|
a duplicate, it will be closed as such.
|
||||||
in an addon, **not** in the platform project.
|
- Make sure that it is actually Terra causing the issue, and not another mod/plugin. You can do this by testing to see if you can recreate
|
||||||
*General* compatibility (e.g. "Ability to pull Vanilla/Modded features from
|
the issue without Terra installed.
|
||||||
parent biomes") will be considered in the platform project.
|
- Double check that this is not an issue with a specific Terra *pack* or Terra *addon*, and instead applies to all of Terra.
|
||||||
- Search for
|
- Include a copy of the latest.log file. Putting *just* the exception is not enough. We need to be able to check that there wasn't anything
|
||||||
any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+)
|
else before that caused it.
|
||||||
open with your problem. If you open a duplicate, it will be closed as such.
|
- Be sure to fill out all the required information and give descriptions of everything.
|
||||||
- Make sure that it is actually Terra causing the issue, and not another
|
|
||||||
mod/plugin. You can do this by testing to see if you can recreate the issue
|
|
||||||
without Terra installed.
|
|
||||||
- Double check that this is not an issue with a specific Terra *pack* or Terra *
|
|
||||||
addon*, and instead applies to all of Terra.
|
|
||||||
- Include a copy of the latest.log file. Putting *just* the exception is not
|
|
||||||
enough. We need to be able to check that there wasn't anything else before
|
|
||||||
that caused it.
|
|
||||||
- Be sure to fill out all the required information and give descriptions of
|
|
||||||
everything.
|
|
||||||
|
|
||||||
#### How Do I Submit A (Good) Bug Report?
|
#### How Do I Submit A (Good) Bug Report?
|
||||||
|
|
||||||
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/)
|
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/)
|
||||||
. [Create an issue](https://github.com/PolyhedralDev/Terra/issues/new) and
|
. [Create an issue](https://github.com/PolyhedralDev/Terra/issues/new) and provide the prerequisite information by filling in the Bug Report
|
||||||
provide the prerequisite information by filling in the Bug Report template.
|
template.
|
||||||
|
|
||||||
Explain the problem and include additional details to help maintainers reproduce
|
Explain the problem and include additional details to help maintainers reproduce the problem:
|
||||||
the problem:
|
|
||||||
|
|
||||||
- **Use a clear and descriptive title** for the issue to identify the problem.
|
- **Use a clear and descriptive title** for the issue to identify the problem.
|
||||||
- **Describe the exact steps which reproduce the problem** in as many details as
|
- **Describe the exact steps which reproduce the problem** in as many details as possible. When listing steps, **don't just say what you
|
||||||
possible. When listing steps, **don't just say what you did, but explain how
|
did, but explain how you did it**.
|
||||||
you did it**.
|
|
||||||
- **Provide specific examples to demonstrate the steps**.
|
- **Provide specific examples to demonstrate the steps**.
|
||||||
- **Describe the behavior you observed after following the steps** and point out
|
- **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
|
||||||
what exactly is the problem with that behavior.
|
|
||||||
- **Explain which behavior you expected to see instead and why.**
|
- **Explain which behavior you expected to see instead and why.**
|
||||||
- **If the problem wasn't triggered by a specific action**, describe what you
|
- **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more
|
||||||
were doing before the problem happened and share more information using the
|
information using the guidelines below.
|
||||||
guidelines below.
|
|
||||||
|
|
||||||
Include details about your configuration and environment:
|
Include details about your configuration and environment:
|
||||||
|
|
||||||
- **Which version of Terra are you using?** You can get the exact version by
|
- **Which version of Terra are you using?** You can get the exact version by running `/te version`.
|
||||||
running `/te version`.
|
- **What's the name and version of the platform you're using**? (eg. Spigot, Fabric, Paper, etc.)
|
||||||
- **What's the name and version of the platform you're using**? (eg. Spigot,
|
|
||||||
Fabric, Paper, etc.)
|
|
||||||
- **Which external plugins or mods do you have installed?**
|
- **Which external plugins or mods do you have installed?**
|
||||||
- **Which Terra packs do you have installed?** You can get that list by
|
- **Which Terra packs do you have installed?** You can get that list by running `/te packs`.
|
||||||
running `/te packs`.
|
- **Which Terra addons do you have installed?** You can get that list by running `/te addons`.
|
||||||
- **Which Terra addons do you have installed?** You can get that list by
|
|
||||||
running `/te addons`.
|
|
||||||
|
|
||||||
### Suggesting Enhancements
|
### Suggesting Enhancements
|
||||||
|
|
||||||
This section guides you through submitting an enhancement suggestion for Terra,
|
This section guides you through submitting an enhancement suggestion for Terra, including completely new features and minor improvements to
|
||||||
including completely new features and minor improvements to existing
|
existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related
|
||||||
functionality. Following these guidelines helps maintainers and the community
|
suggestions.
|
||||||
understand your suggestion and find related suggestions.
|
|
||||||
|
|
||||||
Before creating enhancement suggestions, please
|
Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that
|
||||||
check [this list](#before-submitting-an-enhancement-suggestion) as you might
|
you don't need to create one. When you are creating an enhancement suggestion,
|
||||||
find out that you don't need to create one. When you are creating an enhancement
|
please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion).
|
||||||
suggestion,
|
|
||||||
please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion)
|
|
||||||
.
|
|
||||||
|
|
||||||
#### Before Submitting An Enhancement Suggestion
|
#### Before Submitting An Enhancement Suggestion
|
||||||
|
|
||||||
- You must be on the **LATEST** version of Terra to make sure your feature
|
- You must be on the **LATEST** version of Terra to make sure your feature hasn't been added yet.
|
||||||
hasn't been added yet.
|
- Search for any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+) (Including closed!) with your
|
||||||
- Search for
|
problem. If you open a duplicate, it will be closed as such.
|
||||||
any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+) (
|
|
||||||
Including closed!) with your problem. If you open a duplicate, it will be
|
|
||||||
closed as such.
|
|
||||||
- Verify that this is actually within the scope of Terra.
|
- Verify that this is actually within the scope of Terra.
|
||||||
- Be sure that this is not a feature request that should be made for a specific
|
- Be sure that this is not a feature request that should be made for a specific Terra *pack*, and instead applies to all of Terra.
|
||||||
Terra *pack*, and instead applies to all of Terra.
|
- Be sure that this is not something that should be implemented as a Terra addon, and instead applies to all of Terra.
|
||||||
- Be sure that this is not something that should be implemented as a Terra
|
- Make sure that you attach a copy of the latest.log file, if there are any exceptions thrown in the console. Putting *just* the exception
|
||||||
addon, and instead applies to all of Terra.
|
**is not enough**. We need to be able to check that there wasn't anything else before that caused it.
|
||||||
- Make sure that you attach a copy of the latest.log file, if there are any
|
|
||||||
exceptions thrown in the console. Putting *just* the exception
|
|
||||||
**is not enough**. We need to be able to check that there wasn't anything else
|
|
||||||
before that caused it.
|
|
||||||
|
|
||||||
#### How Do I Submit A (Good) Enhancement Suggestion?
|
#### How Do I Submit A (Good) Enhancement Suggestion?
|
||||||
|
|
||||||
Enhancement suggestions are tracked
|
Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue on our main repository
|
||||||
as [GitHub issues](https://guides.github.com/features/issues/). Create an issue
|
and provide the following information:
|
||||||
on our platform repository and provide the following information:
|
|
||||||
|
|
||||||
- **Use a clear and descriptive title** for the issue to identify the
|
- **Use a clear and descriptive title** for the issue to identify the suggestion.
|
||||||
suggestion.
|
- **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
|
||||||
- **Provide a step-by-step description of the suggested enhancement** in as many
|
|
||||||
details as possible.
|
|
||||||
- **Provide specific examples to demonstrate the steps**.
|
- **Provide specific examples to demonstrate the steps**.
|
||||||
- **Describe the current behavior** and **explain which behavior you expected to
|
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
|
||||||
see instead** and why.
|
- **Explain why this enhancement would be useful** to most Terra users and isn't something that can or should be implemented as an addon.
|
||||||
- **Explain why this enhancement would be useful** to most Terra users and isn't
|
|
||||||
something that can or should be implemented as an addon.
|
|
||||||
|
|
||||||
### Pull Requests
|
### Pull Requests
|
||||||
|
|
||||||
This section guides you through submitting a pull request for Terra.
|
This section guides you through submitting a pull request for Terra.
|
||||||
|
|
||||||
While the prerequisites above must be satisfied prior to having your pull
|
While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete
|
||||||
request reviewed, the reviewer(s) may ask you to complete additional design
|
additional design work, tests, or other changes before your pull request can be ultimately accepted.
|
||||||
work, tests, or other changes before your pull request can be ultimately
|
|
||||||
accepted.
|
|
||||||
|
|
||||||
#### Before Submitting A Pull Request
|
#### Before Submitting A Pull Request
|
||||||
|
|
||||||
- You must be on the **LATEST** version of Terra to make sure your feature
|
- You must be on the **LATEST** version of Terra to make sure your feature hasn't been added yet.
|
||||||
hasn't been added yet.
|
- Search for any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+) (Including closed!) with your
|
||||||
- Search for
|
problem. If you open a duplicate, it will be closed as such.
|
||||||
any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+) (
|
|
||||||
Including closed!) with your problem. If you open a duplicate, it will be
|
|
||||||
closed as such.
|
|
||||||
- Verify that this is actually within the scope of Terra.
|
- Verify that this is actually within the scope of Terra.
|
||||||
- Be sure that this is not a feature request that should be made for a specific
|
- Be sure that this is not a feature request that should be made for a specific Terra *pack*, and instead applies to all of Terra.
|
||||||
Terra *pack*, and instead applies to all of Terra.
|
- Be sure that this is not something that should be implemented as a Terra addon, and instead applies to all of Terra.
|
||||||
- Be sure that this is not something that should be implemented as a Terra
|
- Make sure that you attach a copy of the latest.log file, if there are any exceptions thrown in the console. Putting *just* the
|
||||||
addon, and instead applies to all of Terra.
|
exception **is not enough**. We need to be able to check that there wasn't anything else before that caused it.
|
||||||
- Make sure that you attach a copy of the latest.log file, if there are any
|
|
||||||
exceptions thrown in the console. Putting *just* the exception **is not
|
|
||||||
enough**. We need to be able to check that there wasn't anything else before
|
|
||||||
that caused it.
|
|
||||||
|
|
||||||
#### How Do I Submit A (Good) Pull Request?
|
#### How Do I Submit A (Good) Pull Request?
|
||||||
|
|
||||||
Pull Requests are tracked
|
Pull Requests are tracked as [GitHub Pull Requests](https://guides.github.com/activities/forking/#making-a-pull-request). Create a pr on our
|
||||||
as [GitHub Pull Requests](https://guides.github.com/activities/forking/#making-a-pull-request)
|
main repository and provide the following information:
|
||||||
. Create a pr on our platform repository and provide the following information:
|
|
||||||
|
|
||||||
- **Use a clear and descriptive title** to identify the pull request.
|
- **Use a clear and descriptive title** to identify the pull request.
|
||||||
- **State what this pull request adds/fixes**.
|
- **State what this pull request adds/fixes**.
|
||||||
- **Be sure that you are the owner of the code you contributed** or that it can
|
- **Be sure that you are the owner of the code you contributed** or that it can be licensed under the GPLv3.
|
||||||
be licensed under the GPLv3.
|
- **Provide a description goals and non-goals of the pull request** in as many details as possible.
|
||||||
- **Provide a description goals and non-goals of the pull request** in as many
|
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
|
||||||
details as possible.
|
- **Explain why this enhancement would be useful** to most Terra users and isn't something that can or should be implemented as an addon.
|
||||||
- **Describe the current behavior** and **explain which behavior you expected to
|
|
||||||
see instead** and why.
|
|
||||||
- **Explain why this enhancement would be useful** to most Terra users and isn't
|
|
||||||
something that can or should be implemented as an addon.
|
|
||||||
|
|
||||||
## Styleguides
|
## Styleguides
|
||||||
|
|
||||||
### Git Commits
|
### Git Commits
|
||||||
|
|
||||||
Following this is not mandatory, but rather a set of guidelines. As long as your
|
Following this is not mandatory, but rather a set of guidelines. As long as your commit messages aren't absolutely awful, it's probably
|
||||||
commit messages aren't absolutely awful, it's probably fine. But it would be
|
fine. But it would be nice if you followed them.
|
||||||
nice if you followed them.
|
|
||||||
|
|
||||||
#### Committing
|
#### Committing
|
||||||
|
|
||||||
When you commit code, try to avoid committing large amounts of code in a single
|
When you commit code, try to avoid committing large amounts of code in a single go. Splitting up code into smaller commits is much nicer and
|
||||||
go. Splitting up code into smaller commits is much nicer and makes it easier to
|
makes it easier to trace a feature to a single commit.
|
||||||
trace a feature to a single commit.
|
|
||||||
|
|
||||||
Try to stick to one feature/fix/etc. per commit. A good rule of thumb is if you
|
Try to stick to one feature/fix/etc. per commit. A good rule of thumb is if you need to use the word "and" in the subject line, then it
|
||||||
need to use the word "and" in the subject line, then it should probably™ be two
|
should probably™ be two commits.
|
||||||
commits.
|
|
||||||
|
|
||||||
#### Git Commit Messages
|
#### Git Commit Messages
|
||||||
|
|
||||||
- Subject line must fit the following format: `<type>: <short summary>`. Type
|
- Subject line must fit the following format: `<type>: <short summary>`. Type must be one of the following:
|
||||||
must be one of the following:
|
|
||||||
- Build: Changes that affect the build system or external dependencies.
|
- Build: Changes that affect the build system or external dependencies.
|
||||||
- Docs: Documentation only changes.
|
- Docs: Documentation only changes.
|
||||||
- Feat: A new feature.
|
- Feat: A new feature.
|
||||||
- Fix: A bug fix.
|
- Fix: A bug fix.
|
||||||
- Perf: Performance improvements.
|
- Perf: Performance improvements.
|
||||||
- Refactor: Refactoring sections of the codebase.
|
- Refactor: Refactoring sections of the codebase.
|
||||||
- Repo: Changes to the repository structure that do not affect code. (Eg.
|
- Repo: Changes to the repository structure that do not affect code. (Eg. modification of the `README.md` file, etc.)
|
||||||
modification of the `README.md` file, etc.)
|
|
||||||
- Revert: Revert a previous commit.
|
- Revert: Revert a previous commit.
|
||||||
- Style: Code style updates.
|
- Style: Code style updates.
|
||||||
- Test: Anything related to testing.
|
- Test: Anything related to testing.
|
||||||
@@ -335,8 +266,7 @@ commits.
|
|||||||
|
|
||||||
### Code Styleguide
|
### Code Styleguide
|
||||||
|
|
||||||
Use an IDE with support for `.editorconfig` files. There is an included
|
Use an IDE with support for `.editorconfig` files. There is an included editorconfig file in the base of the project so that your IDE should
|
||||||
editorconfig file in the base of the project so that your IDE should
|
|
||||||
automatically use the correct code style settings.
|
automatically use the correct code style settings.
|
||||||
|
|
||||||
### Documentation Styleguide
|
### Documentation Styleguide
|
||||||
@@ -349,56 +279,41 @@ TODO
|
|||||||
|
|
||||||
#### General Compatibility
|
#### General Compatibility
|
||||||
|
|
||||||
General compatibility (example: injection of Vanilla structures/features/carvers
|
General compatibility (example: injection of Vanilla structures/features/carvers into packs) is acceptable in the main project.
|
||||||
into packs) is acceptable in the platform project.
|
|
||||||
|
|
||||||
- General compatibility features should be *disabled by default*. Having things
|
- General compatibility features should be *disabled by default*. Having things auto-injected causes unpredictable behaviour that is
|
||||||
auto-injected causes unpredictable behaviour that is annoying to diagnose.
|
annoying to diagnose. General-compatibility options should have config values attached which are disabled by default.
|
||||||
General-compatibility options should have config values attached which are
|
- These config options should also be *simple to use*. Think of the people who will be using these compatibility options. They want to flick
|
||||||
disabled by default.
|
a switch and have things be compatible. That means that a majority of compatibility options should stay in `pack.yml`, to make it simple
|
||||||
- These config options should also be *simple to use*. Think of the people who
|
to go into a pack and turn on specific compatibilities. This does *not* mean that more advanced compatibility options are off the table,
|
||||||
will be using these compatibility options. They want to flick a switch and
|
for example, look at Feature compatibility, where features can either be automatically injected, *or* configured individually per Terra
|
||||||
have things be compatible. That means that a majority of compatibility options
|
biome, depending on how much control the user wants.
|
||||||
should stay in `pack.yml`, to make it simple to go into a pack and turn on
|
|
||||||
specific compatibilities. This does *not* mean that more advanced
|
|
||||||
compatibility options are off the table, for example, look at Feature
|
|
||||||
compatibility, where features can either be automatically injected, *or*
|
|
||||||
configured individually per Terra biome, depending on how much control the
|
|
||||||
user wants.
|
|
||||||
|
|
||||||
#### Specific Compatibility
|
#### Specific Compatibility
|
||||||
|
|
||||||
Specific compatibility should *not* be put in the platform project. (Example:
|
Specific compatibility should *not* be put in the main project. (Example: Adding the ability to generate TechCraft v7's doo-dads with a
|
||||||
Adding the ability to generate TechCraft v7's doo-dads with a TerraScript
|
TerraScript function)
|
||||||
function)
|
|
||||||
|
|
||||||
Having specific compatibilities leads to tons of extra dependencies to keep
|
Having specific compatibilities leads to tons of extra dependencies to keep track of, as well as adding lots of additional stuff to
|
||||||
track of, as well as adding lots of additional stuff to maintain. It quickly
|
maintain. It quickly becomes a mess. Especially when most users will never need to use this feature.
|
||||||
becomes a mess. Especially when most users will never need to use this feature.
|
|
||||||
|
|
||||||
We have designed an addon API for exactly this purpose. **Specific
|
We have designed an addon API for exactly this purpose. **Specific compatibilities are welcome and encouraged, in the form of addons.**
|
||||||
compatibilities are welcome and encouraged, in the form of addons.**
|
|
||||||
|
|
||||||
### Platform-Agnostic Design
|
### Platform-Agnostic Design
|
||||||
|
|
||||||
Terra must, at all times, remain platform agnostic. This means it must be able
|
Terra must, at all times, remain platform agnostic. This means it must be able to run on theoretically any voxel based platform. Including
|
||||||
to run on theoretically any voxel based platform. Including non-minecraft games
|
non-minecraft games like Terasology.
|
||||||
like Terasology.
|
|
||||||
|
|
||||||
When adding a new feature to `common`, make no assumptions about what platform
|
When adding a new feature to `common`, make no assumptions about what platform it'll be running on.
|
||||||
it'll be running on.
|
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
- Don't assume the world height is 256.
|
- Don't assume the world height is 256.
|
||||||
- Don't assume that a specific block, item, or entity exists. (Eg. don't assume
|
- Don't assume that a specific block, item, or entity exists. (Eg. don't assume there exists a block called `minecraft:grass_block`)
|
||||||
there exists a block called `minecraft:grass_block`)
|
|
||||||
|
|
||||||
### Data-Driven
|
### Data-Driven
|
||||||
|
|
||||||
When adding a new feature, make it abstract. Don't make assumptions about "
|
When adding a new feature, make it abstract. Don't make assumptions about "specific use cases." If you can only think of a few use cases,
|
||||||
specific use cases." If you can only think of a few use cases, your idea should
|
your idea should probably be generalized.
|
||||||
probably be generalized.
|
|
||||||
|
|
||||||
You must use configs effectively. Make configs that are *powerful* but also *
|
You must use configs effectively. Make configs that are *powerful* but also *make sense* and are \[easy\] to use.
|
||||||
make sense* and are \[easy\] to use.
|
|
||||||
@@ -1,21 +1,674 @@
|
|||||||
MIT License
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
Copyright (c) 2020-2025 Polyhedral Development
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Preamble
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The GNU General Public License is a free, copyleft license for
|
||||||
copies or substantial portions of the Software.
|
software and other kinds of works.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
The licenses for most software and other practical works are designed
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
to take away your freedom to share and change the works. By contrast,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
share and change all versions of a program--to make sure it remains free
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
GNU General Public License for most of our software; it applies also to
|
||||||
SOFTWARE.
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
|
|||||||
@@ -1,40 +1,25 @@
|
|||||||
<img align="left" width="64" height="64" src="https://raw.githubusercontent.com/wiki/PolyhedralDev/Terra/images/terra_logo.png" alt="Terra Logo">
|
|
||||||
|
|
||||||
# Terra
|
# Terra
|
||||||
|
|
||||||
Terra is a modern world generation modding platform, primarily for Minecraft.
|
Terra is an incredibly powerful free & open-source data-driven, platform-agnostic world generator. It allows you to create a world exactly
|
||||||
Terra allows complete customization of world generation with an advanced API,
|
to your specifications, with no knowledge of Java required.
|
||||||
tightly integrated with a powerful configuration system.
|
|
||||||
|
|
||||||
Terra consists of several parts:
|
|
||||||
|
|
||||||
* A voxel world generation API with emphasis on configuration and extensibility
|
|
||||||
* Several platform implementations, the layer between the API and the platform
|
|
||||||
it's running on.
|
|
||||||
* An addon loader, which allows addons to interface with the Terra API in a
|
|
||||||
platform-agnostic setting
|
|
||||||
* Several "core addons," which implement the "default" configurations of Terra.
|
|
||||||
These addons can be thought of as the config "standard library"
|
|
||||||
|
|
||||||
Terra currently officially supports the Fabric mod loader and the Bukkit API
|
|
||||||
(Paper and friends). We welcome Pull Requests implementing additional platforms!
|
|
||||||
|
|
||||||
## Downloads:
|
## Downloads:
|
||||||
|
|
||||||
* Fabric: [Modrinth](https://modrinth.com/mod/terra)
|
* Paper+ servers (Paper, Tuinity, Purpur, etc): [SpigotMC](https://www.spigotmc.org/resources/85151/)
|
||||||
|
* Fabric: [Modrinth](https://modrinth.com/mod/terra) / [CurseForge](https://www.curseforge.com/minecraft/mc-mods/terra-world-generator)
|
||||||
|
* Forge **(ALPHA - NOT PRODUCTION-READY)**: [Modrinth](https://modrinth.com/mod/terra)
|
||||||
/ [CurseForge](https://www.curseforge.com/minecraft/mc-mods/terra-world-generator)
|
/ [CurseForge](https://www.curseforge.com/minecraft/mc-mods/terra-world-generator)
|
||||||
* Paper+ servers (Paper, Tuinity, Purpur,
|
|
||||||
etc): [SpigotMC](https://www.spigotmc.org/resources/85151/)
|
|
||||||
|
|
||||||
## Building and Running Terra
|
## Building and Running Terra
|
||||||
|
|
||||||
To build, simply run `./gradlew build` (`gradlew.bat build` on Windows). This
|
To build, simply run `./gradlew build` (`gradlew.bat build` on Windows). This will build all platforms, and produce JARs
|
||||||
will build all platforms, and produce JARs in `platforms/<platform>/build/libs`
|
in `platforms/<platform>/build/libs`
|
||||||
|
|
||||||
### Production JARs:
|
### Production JARs:
|
||||||
|
|
||||||
* Bukkit: `Terra-<version>-shaded.jar`
|
* Bukkit: `Terra-<version>-shaded.jar`
|
||||||
* Fabric: `Terra-<version>-shaded-mapped.jar`
|
* Fabric: `Terra-<version>-shaded-mapped.jar`
|
||||||
|
* Forge: `Terra-<version>-shaded.jar`
|
||||||
|
|
||||||
### Building a Specific Platform
|
### Building a Specific Platform
|
||||||
|
|
||||||
@@ -47,55 +32,22 @@ JARs are produced in `platforms/<platform>/build/libs`.
|
|||||||
To run Minecraft with Terra in the IDE (for testing) use the following tasks:
|
To run Minecraft with Terra in the IDE (for testing) use the following tasks:
|
||||||
|
|
||||||
* Bukkit
|
* Bukkit
|
||||||
* `runServer` - Run the Paper test server with Terra installed.
|
* `installPaper` - Install a [Paper](https://github.com/PaperMC/Paper) test server. (Only needs to be run once).
|
||||||
|
* `installPurpur` - Install a [Purpur](https://github.com/pl3xgaming/Purpur) test server. (Only needs to be run once).
|
||||||
|
* `runPaper` - Run the Paper test server with Terra (`installPaper` must have been run previously).
|
||||||
|
* `runPurpur` - Run the Purpur test server with Terra (`installPurpur` must have been run previously).
|
||||||
* Fabric
|
* Fabric
|
||||||
* `runClient` - Run a Minecraft Fabric client with Terra installed.
|
* `runClient` - Run a Minecraft Fabric client with Terra installed.
|
||||||
* `runServer` - Run a Minecraft Fabric server with Terra installed.
|
* `runServer` - Run a Minecraft Fabric server with Terra installed.
|
||||||
|
* Forge
|
||||||
|
* `runClient` - Run a Minecraft Forge client with Terra installed.
|
||||||
|
* `runServer` - Run a Minecraft Forge server with Terra installed.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Contributions are welcome! If you want to see a feature in Terra, please, open
|
Contributions are welcome! If you want to see a feature in Terra, please, open an issue, or implement it yourself and submit a PR!
|
||||||
an issue, or implement it yourself and submit a PR!
|
Join the discord [here](https://discord.gg/PXUEbbF) if you would like to talk more about the project!
|
||||||
Join the discord [here](https://discord.gg/PXUEbbF) if you would like to talk
|
|
||||||
more about the project!
|
|
||||||
|
|
||||||
## Licensing
|
|
||||||
|
|
||||||
Parts of Terra are licensed under either the MIT License or the GNU General
|
|
||||||
Public License, version 3.0.
|
|
||||||
|
|
||||||
* Our API is licensed under the [MIT License](LICENSE), to ensure that everyone
|
|
||||||
is able to freely use it however they want.
|
|
||||||
* Our core addons are also licensed under the [MIT License](LICENSE), to ensure
|
|
||||||
that people can freely use code from them to learn and make their own addons,
|
|
||||||
without worrying about GPL infection.
|
|
||||||
* Our platform-agnostic implementations and platform implementations are
|
|
||||||
licensed under
|
|
||||||
the [GNU General Public License, version 3.0](common/implementation/LICENSE),
|
|
||||||
to ensure that they remain free software wherever they are used.
|
|
||||||
|
|
||||||
If you're not sure which license a particular file is under, check:
|
|
||||||
|
|
||||||
* The file's header
|
|
||||||
* The LICENSE file in the closest parent folder of the file in question
|
|
||||||
|
|
||||||
## Beta
|
## Beta
|
||||||
|
|
||||||
Terra is still in beta! While it is stable, it is not feature-complete. There is
|
Terra is still in beta! While it is stable, it is not feature-complete. There is a lot to be added!
|
||||||
a lot to be added!
|
|
||||||
|
|
||||||
## Special Thanks
|
|
||||||
|
|
||||||
[](https://www.yourkit.com/)
|
|
||||||
|
|
||||||
YourKit has granted Polyhedral Development an open-source license to their
|
|
||||||
outstanding Java profiler, allowing us to make our software as performant as it
|
|
||||||
can be!
|
|
||||||
|
|
||||||
YourKit supports open source projects with innovative and intelligent tools for
|
|
||||||
monitoring and profiling Java and .NET applications. YourKit is the creator of
|
|
||||||
the
|
|
||||||
[YourKit Java Profiler](https://www.yourkit.com/java/profiler/),
|
|
||||||
[YourKit .NET Profiler](https://www.yourkit.com/.net/profiler/),
|
|
||||||
and [YourKit YouMonitor](https://www.yourkit.com/youmonitor/).
|
|
||||||
|
|
||||||
|
|||||||
+20
-31
@@ -1,21 +1,18 @@
|
|||||||
preRelease(true)
|
import com.dfsek.terra.*
|
||||||
|
|
||||||
versionProjects(":common:api", version("6.6.1"))
|
|
||||||
versionProjects(":common:implementation", version("6.6.1"))
|
|
||||||
versionProjects(":platforms", version("6.6.1"))
|
|
||||||
|
|
||||||
|
val versionObj = Version("6", "0", "0", true)
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
|
version = versionObj
|
||||||
group = "com.dfsek.terra"
|
group = "com.dfsek.terra"
|
||||||
|
|
||||||
configureCompilation()
|
|
||||||
configureDependencies()
|
configureDependencies()
|
||||||
|
configureCompilation()
|
||||||
configurePublishing()
|
configurePublishing()
|
||||||
|
|
||||||
tasks.withType<JavaCompile>().configureEach {
|
tasks.withType<JavaCompile>().configureEach {
|
||||||
options.isFork = true
|
options.isFork = true
|
||||||
options.isIncremental = true
|
options.isIncremental = true
|
||||||
options.release.set(21)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<Test>().configureEach {
|
tasks.withType<Test>().configureEach {
|
||||||
@@ -29,32 +26,24 @@ allprojects {
|
|||||||
reports.html.required.set(false)
|
reports.html.required.set(false)
|
||||||
reports.junitXml.required.set(false)
|
reports.junitXml.required.set(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<Copy>().configureEach {
|
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Jar>().configureEach {
|
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
forImmediateSubProjects(":platforms") {
|
project(":platforms").subprojects.forEach { // Platform projects are where distribution happens
|
||||||
configureDistribution()
|
it.configureDistribution()
|
||||||
}
|
}
|
||||||
project(":platforms:bukkit:common").configureDistribution()
|
}
|
||||||
project(":platforms:minestom:example").configureDistribution()
|
|
||||||
forSubProjects(":common:addons") {
|
/**
|
||||||
apply(plugin = "com.gradleup.shadow")
|
* Version class that does version stuff.
|
||||||
|
*/
|
||||||
tasks.named("build") {
|
@Suppress("MemberVisibilityCanBePrivate")
|
||||||
finalizedBy(tasks.named("shadowJar"))
|
class Version(val major: String, val minor: String, val revision: String, val preRelease: Boolean = false) {
|
||||||
}
|
|
||||||
|
override fun toString(): String {
|
||||||
dependencies {
|
return if (!preRelease)
|
||||||
"compileOnly"(project(":common:api"))
|
"$major.$minor.$revision"
|
||||||
"testImplementation"(project(":common:api"))
|
else //Only use git hash if it's a prerelease.
|
||||||
}
|
"$major.$minor.$revision-BETA+${getGitHash()}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,21 +6,9 @@ plugins {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
maven("https://repo.codemc.org/repository/maven-public") {
|
|
||||||
name = "CodeMC"
|
|
||||||
}
|
|
||||||
maven("https://repo.papermc.io/repository/maven-public/") {
|
|
||||||
name = "PaperMC"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
//TODO Allow pulling from Versions.kt
|
"implementation"("com.github.jengelman.gradle.plugins:shadow:+")
|
||||||
implementation("com.gradleup.shadow", "shadow-gradle-plugin", "8.3.1")
|
"implementation"("org.yaml:snakeyaml:1.27")
|
||||||
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.2")
|
|
||||||
|
|
||||||
implementation("org.ow2.asm", "asm", "9.7")
|
|
||||||
implementation("org.ow2.asm", "asm-tree", "9.7")
|
|
||||||
implementation("com.dfsek.tectonic", "common", "4.2.1")
|
|
||||||
implementation("org.yaml", "snakeyaml", "2.3")
|
|
||||||
}
|
}
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
||||||
import java.io.File
|
|
||||||
import java.util.function.Predicate
|
|
||||||
import org.gradle.api.Project
|
|
||||||
import org.gradle.api.Task
|
|
||||||
import org.gradle.kotlin.dsl.extra
|
|
||||||
import kotlin.streams.asStream
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configures a directory where addons will be put.
|
|
||||||
*/
|
|
||||||
fun Project.addonDir(dir: File, task: Task) {
|
|
||||||
val moveAddons = tasks.register("moveAddons" + task.name) {
|
|
||||||
dependsOn("compileAddons")
|
|
||||||
doLast {
|
|
||||||
dir.parentFile.mkdirs()
|
|
||||||
matchingAddons(dir) {
|
|
||||||
it.name.startsWith("Terra-") // Assume everything that starts with Terra- is a core addon.
|
|
||||||
}.forEach {
|
|
||||||
logger.info("Deleting old addon: " + it.absolutePath)
|
|
||||||
it.delete()
|
|
||||||
}
|
|
||||||
forSubProjects(":common:addons") {
|
|
||||||
val jar = tasks.named("shadowJar").get() as ShadowJar
|
|
||||||
|
|
||||||
val boot = if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "bootstrap/" else ""
|
|
||||||
val target = File(dir, boot + jar.archiveFileName.get())
|
|
||||||
|
|
||||||
val base = "${jar.archiveBaseName.get()}-${version}"
|
|
||||||
|
|
||||||
logger.info("Copying addon ${jar.archiveFileName.get()} to ${target.absolutePath}. Base name: $base")
|
|
||||||
|
|
||||||
jar.archiveFile.orNull?.asFile?.copyTo(target)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
task.dependsOn(moveAddons)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun matchingAddons(dir: File, matcher: Predicate<File>): Set<File> {
|
|
||||||
val matching = HashSet<File>()
|
|
||||||
dir.walk().asStream().filter(matcher).forEach(matching::add)
|
|
||||||
return matching
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
import org.gradle.api.Project
|
|
||||||
import org.gradle.kotlin.dsl.creating
|
|
||||||
import org.gradle.kotlin.dsl.dependencies
|
|
||||||
import org.gradle.kotlin.dsl.getValue
|
|
||||||
import org.gradle.kotlin.dsl.getting
|
|
||||||
import org.gradle.kotlin.dsl.maven
|
|
||||||
import org.gradle.kotlin.dsl.repositories
|
|
||||||
|
|
||||||
fun Project.configureDependencies() {
|
|
||||||
val testImplementation by configurations.getting
|
|
||||||
val compileOnly by configurations.getting
|
|
||||||
|
|
||||||
val api by configurations.getting
|
|
||||||
val implementation by configurations.getting
|
|
||||||
|
|
||||||
val shaded by configurations.creating
|
|
||||||
|
|
||||||
@Suppress("UNUSED_VARIABLE")
|
|
||||||
val shadedApi by configurations.creating {
|
|
||||||
shaded.extendsFrom(this)
|
|
||||||
api.extendsFrom(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Suppress("UNUSED_VARIABLE")
|
|
||||||
val shadedImplementation by configurations.creating {
|
|
||||||
shaded.extendsFrom(this)
|
|
||||||
implementation.extendsFrom(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
gradlePluginPortal()
|
|
||||||
maven("https://maven.fabricmc.net/") {
|
|
||||||
name = "FabricMC"
|
|
||||||
}
|
|
||||||
maven("https://repo.codemc.org/repository/maven-public") {
|
|
||||||
name = "CodeMC"
|
|
||||||
}
|
|
||||||
maven("https://repo.papermc.io/repository/maven-public/") {
|
|
||||||
name = "PaperMC"
|
|
||||||
}
|
|
||||||
maven("https://files.minecraftforge.net/maven/") {
|
|
||||||
name = "Forge"
|
|
||||||
}
|
|
||||||
maven("https://maven.quiltmc.org/repository/release/") {
|
|
||||||
name = "Quilt"
|
|
||||||
}
|
|
||||||
maven("https://jitpack.io") {
|
|
||||||
name = "JitPack"
|
|
||||||
}
|
|
||||||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
|
|
||||||
name = "Sonatype Snapshots"
|
|
||||||
}
|
|
||||||
maven("https://repo.opencollab.dev/maven-releases/") {
|
|
||||||
name = "OpenCollab Releases"
|
|
||||||
}
|
|
||||||
maven("https://repo.opencollab.dev/maven-snapshots/") {
|
|
||||||
name = "OpenCollab Snapshots"
|
|
||||||
}
|
|
||||||
maven("https://storehouse.okaeri.eu/repository/maven-public/") {
|
|
||||||
name = "Okaeri"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
testImplementation("org.junit.jupiter", "junit-jupiter-api", Versions.Libraries.Internal.junit)
|
|
||||||
testImplementation("org.junit.jupiter", "junit-jupiter-engine", Versions.Libraries.Internal.junit)
|
|
||||||
compileOnly("org.jetbrains", "annotations", Versions.Libraries.Internal.jetBrainsAnnotations)
|
|
||||||
|
|
||||||
compileOnly("com.google.guava", "guava", Versions.Libraries.Internal.guava)
|
|
||||||
testImplementation("com.google.guava", "guava", Versions.Libraries.Internal.guava)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
import java.io.ByteArrayOutputStream
|
|
||||||
import org.gradle.api.Action
|
|
||||||
import org.gradle.api.Project
|
|
||||||
|
|
||||||
|
|
||||||
var isPrerelease = false
|
|
||||||
|
|
||||||
|
|
||||||
fun Project.getGitHash(): String {
|
|
||||||
val stdout = ByteArrayOutputStream()
|
|
||||||
exec {
|
|
||||||
commandLine = mutableListOf("git", "rev-parse", "--short", "HEAD")
|
|
||||||
standardOutput = stdout
|
|
||||||
}
|
|
||||||
return stdout.toString().trim()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.gitClone(name: String) {
|
|
||||||
val stdout = ByteArrayOutputStream()
|
|
||||||
exec {
|
|
||||||
commandLine = mutableListOf("git", "clone", name)
|
|
||||||
standardOutput = stdout
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.forSubProjects(project: String, action: Action<Project>) {
|
|
||||||
project(project).subprojects.forEach {
|
|
||||||
action.execute(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.forImmediateSubProjects(project: String, action: Action<Project>) {
|
|
||||||
project(project).childProjects.forEach {
|
|
||||||
action.execute(it.value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun preRelease(preRelease: Boolean) {
|
|
||||||
isPrerelease = preRelease
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.versionProjects(project: String, version: String) {
|
|
||||||
forSubProjects(project) {
|
|
||||||
this.version = version
|
|
||||||
logger.info("Setting version of $path to $version")
|
|
||||||
}
|
|
||||||
project(project).version = version
|
|
||||||
logger.info("Setting version of $project to $version")
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.version(version: String): String {
|
|
||||||
return if (!isPrerelease)
|
|
||||||
version
|
|
||||||
else //Only use git hash if it's a prerelease.
|
|
||||||
"$version-BETA+${getGitHash()}"
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
object Versions {
|
|
||||||
object Terra {
|
|
||||||
const val overworldConfig = "v1.3.4"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Libraries {
|
|
||||||
const val tectonic = "4.2.1"
|
|
||||||
const val paralithic = "0.8.1"
|
|
||||||
const val strata = "1.3.2"
|
|
||||||
|
|
||||||
const val cloud = "2.0.0"
|
|
||||||
|
|
||||||
const val caffeine = "3.1.8"
|
|
||||||
|
|
||||||
const val slf4j = "2.0.16"
|
|
||||||
|
|
||||||
object Internal {
|
|
||||||
const val shadow = "8.3.3"
|
|
||||||
const val apacheText = "1.12.0"
|
|
||||||
const val apacheIO = "2.17.0"
|
|
||||||
const val guava = "33.3.1-jre"
|
|
||||||
const val asm = "9.7.1"
|
|
||||||
const val snakeYml = "2.3"
|
|
||||||
const val jetBrainsAnnotations = "26.0.1"
|
|
||||||
const val junit = "5.11.3"
|
|
||||||
const val nbt = "6.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object Fabric {
|
|
||||||
const val fabricAPI = "0.118.0+${Mod.minecraft}"
|
|
||||||
const val cloud = "2.0.0-beta.9"
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// object Quilt {
|
|
||||||
// const val quiltLoader = "0.20.2"
|
|
||||||
// const val fabricApi = "7.3.1+0.89.3-1.20.1"
|
|
||||||
// }
|
|
||||||
|
|
||||||
object Mod {
|
|
||||||
const val mixin = "0.15.3+mixin.0.8.7"
|
|
||||||
|
|
||||||
const val minecraft = "1.21.4"
|
|
||||||
const val yarn = "$minecraft+build.8"
|
|
||||||
const val fabricLoader = "0.16.10"
|
|
||||||
|
|
||||||
const val architecuryLoom = "1.7.413"
|
|
||||||
const val architecturyPlugin = "3.4.159"
|
|
||||||
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// object Forge {
|
|
||||||
// const val forge = "${Mod.minecraft}-48.0.13"
|
|
||||||
// const val burningwave = "12.63.0"
|
|
||||||
// }
|
|
||||||
|
|
||||||
object Bukkit {
|
|
||||||
const val minecraft = "1.21.4"
|
|
||||||
const val paperBuild = "$minecraft-R0.1-20241211.212446-17"
|
|
||||||
const val paper = paperBuild
|
|
||||||
const val paperLib = "1.0.8"
|
|
||||||
const val reflectionRemapper = "0.1.1"
|
|
||||||
const val paperDevBundle = paperBuild
|
|
||||||
const val runPaper = "2.3.1"
|
|
||||||
const val paperWeight = "1.7.2"
|
|
||||||
const val cloud = "2.0.0-beta.10"
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// object Sponge {
|
|
||||||
// const val sponge = "9.0.0-SNAPSHOT"
|
|
||||||
// const val mixin = "0.8.2"
|
|
||||||
// const val minecraft = "1.17.1"
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
object CLI {
|
|
||||||
const val logback = "1.5.8"
|
|
||||||
const val picocli = "4.7.6"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Allay {
|
|
||||||
const val api = "0.2.0"
|
|
||||||
const val gson = "2.12.1"
|
|
||||||
const val mappings = "3626653"
|
|
||||||
const val mappingsGenerator = "366618e"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Minestom {
|
|
||||||
const val minestom = "187931e50b"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.dfsek.terra
|
||||||
|
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.api.Task
|
||||||
|
import org.gradle.jvm.tasks.Jar
|
||||||
|
import java.io.File
|
||||||
|
import java.util.function.Predicate
|
||||||
|
import kotlin.streams.asStream
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures a directory where addons will be put.
|
||||||
|
*/
|
||||||
|
fun Project.addonDir(dir: File, task: Task) {
|
||||||
|
task.doFirst {
|
||||||
|
dir.parentFile.mkdirs()
|
||||||
|
matchingAddons(dir) {
|
||||||
|
it.name.startsWith("Terra-") // Assume everything that starts with Terra- is a core addon.
|
||||||
|
}.forEach {
|
||||||
|
println("Deleting old addon: " + it.absolutePath)
|
||||||
|
it.delete()
|
||||||
|
}
|
||||||
|
project(":common:addons").subprojects.forEach { addonProject ->
|
||||||
|
val jar = (addonProject.tasks.named("jar").get() as Jar)
|
||||||
|
|
||||||
|
val target = File(dir, jar.archiveFileName.get())
|
||||||
|
|
||||||
|
val base = "${jar.archiveBaseName.get()}-${project.version}"
|
||||||
|
|
||||||
|
println("Copying addon ${jar.archiveFileName.get()} to ${target.absolutePath}. Base name: $base")
|
||||||
|
|
||||||
|
jar.archiveFile.orNull?.asFile?.copyTo(target)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun matchingAddons(dir: File, matcher: Predicate<File>): Set<File> {
|
||||||
|
val matching = HashSet<File>()
|
||||||
|
dir.walk().maxDepth(1).asStream().filter(matcher).forEach(matching::add)
|
||||||
|
return matching
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.dfsek.terra
|
||||||
|
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import java.io.ByteArrayOutputStream
|
||||||
|
|
||||||
|
fun Project.getGitHash(): String {
|
||||||
|
val stdout = ByteArrayOutputStream()
|
||||||
|
exec {
|
||||||
|
commandLine = mutableListOf("git", "rev-parse", "--short", "HEAD")
|
||||||
|
standardOutput = stdout
|
||||||
|
}
|
||||||
|
return stdout.toString().trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Project.gitClone(name: String) {
|
||||||
|
val stdout = ByteArrayOutputStream()
|
||||||
|
exec {
|
||||||
|
commandLine = mutableListOf("git", "clone", name)
|
||||||
|
standardOutput = stdout
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
-37
@@ -1,17 +1,12 @@
|
|||||||
import com.dfsek.terra.tectonicdoc.TectonicDocPlugin
|
package com.dfsek.terra
|
||||||
import org.apache.tools.ant.filters.ReplaceTokens
|
|
||||||
import org.gradle.api.JavaVersion
|
import org.gradle.api.JavaVersion
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.plugins.JavaPluginExtension
|
import org.gradle.api.plugins.JavaPluginExtension
|
||||||
import org.gradle.api.tasks.bundling.Jar
|
import org.gradle.api.tasks.bundling.Jar
|
||||||
import org.gradle.api.tasks.compile.JavaCompile
|
import org.gradle.api.tasks.compile.JavaCompile
|
||||||
import org.gradle.api.tasks.javadoc.Javadoc
|
import org.gradle.api.tasks.javadoc.Javadoc
|
||||||
import org.gradle.kotlin.dsl.apply
|
import org.gradle.kotlin.dsl.*
|
||||||
import org.gradle.kotlin.dsl.configure
|
|
||||||
import org.gradle.kotlin.dsl.filter
|
|
||||||
import org.gradle.kotlin.dsl.getByName
|
|
||||||
import org.gradle.kotlin.dsl.register
|
|
||||||
import org.gradle.kotlin.dsl.withType
|
|
||||||
import org.gradle.language.jvm.tasks.ProcessResources
|
import org.gradle.language.jvm.tasks.ProcessResources
|
||||||
|
|
||||||
fun Project.configureCompilation() {
|
fun Project.configureCompilation() {
|
||||||
@@ -19,57 +14,46 @@ fun Project.configureCompilation() {
|
|||||||
apply(plugin = "java")
|
apply(plugin = "java")
|
||||||
apply(plugin = "java-library")
|
apply(plugin = "java-library")
|
||||||
apply(plugin = "idea")
|
apply(plugin = "idea")
|
||||||
apply<TectonicDocPlugin>()
|
|
||||||
|
|
||||||
configure<JavaPluginExtension> {
|
configure<JavaPluginExtension> {
|
||||||
sourceCompatibility = JavaVersion.VERSION_21
|
sourceCompatibility = JavaVersion.VERSION_16
|
||||||
targetCompatibility = JavaVersion.VERSION_21
|
targetCompatibility = JavaVersion.VERSION_16
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<JavaCompile> {
|
tasks.withType<JavaCompile> {
|
||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
doFirst {
|
doFirst {
|
||||||
options.compilerArgs.add("-Xlint:all")
|
options.compilerArgs.add("-Xlint:all")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<ProcessResources> {
|
tasks.withType<ProcessResources> {
|
||||||
include("**/*.*")
|
include("**/*.*")
|
||||||
filter<ReplaceTokens>(
|
filter<org.apache.tools.ant.filters.ReplaceTokens>(
|
||||||
"tokens" to mapOf(
|
|
||||||
"DESCRIPTION" to properties["terra.description"],
|
|
||||||
"WIKI" to properties["terra.wiki"],
|
|
||||||
"SOURCE" to properties["terra.source"],
|
|
||||||
"ISSUES" to properties["terra.issues"],
|
|
||||||
"LICENSE" to properties["terra.license"]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
afterEvaluate {
|
|
||||||
tasks.withType<ProcessResources> {
|
|
||||||
include("**/*.*")
|
|
||||||
filter<ReplaceTokens>(
|
|
||||||
"tokens" to mapOf(
|
"tokens" to mapOf(
|
||||||
"VERSION" to version.toString()
|
"VERSION" to project.version.toString(),
|
||||||
)
|
"DESCRIPTION" to project.properties["terra.description"],
|
||||||
)
|
"WIKI" to project.properties["terra.wiki"],
|
||||||
}
|
"SOURCE" to project.properties["terra.source"],
|
||||||
|
"ISSUES" to project.properties["terra.issues"],
|
||||||
|
"LICENSE" to project.properties["terra.license"]
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<Javadoc> {
|
tasks.withType<Javadoc> {
|
||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<Jar> {
|
tasks.withType<Jar> {
|
||||||
archiveBaseName.set("Terra-${archiveBaseName.get()}")
|
archiveBaseName.set("Terra-${archiveBaseName.get()}")
|
||||||
from("../LICENSE", "../../LICENSE")
|
from("../LICENSE", "../../LICENSE")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<Jar>("sourcesJar") {
|
tasks.register<Jar>("sourcesJar") {
|
||||||
archiveClassifier.set("sources")
|
archiveClassifier.set("sources")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<Jar>("javadocJar") {
|
tasks.register<Jar>("javadocJar") {
|
||||||
dependsOn("javadoc")
|
dependsOn("javadoc")
|
||||||
archiveClassifier.set("javadoc")
|
archiveClassifier.set("javadoc")
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.dfsek.terra
|
||||||
|
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.kotlin.dsl.*
|
||||||
|
|
||||||
|
fun Project.configureDependencies() {
|
||||||
|
apply(plugin = "java")
|
||||||
|
apply(plugin = "java-library")
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
val shaded = create("shaded")
|
||||||
|
val shadedApi = create("shadedApi")
|
||||||
|
shaded.extendsFrom(shadedApi)
|
||||||
|
getByName("api").extendsFrom(shadedApi)
|
||||||
|
val shadedImplementation = create("shadedImplementation")
|
||||||
|
shaded.extendsFrom(shadedImplementation)
|
||||||
|
getByName("implementation").extendsFrom(shadedImplementation)
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven { url = uri("https://maven.enginehub.org/repo/") }
|
||||||
|
maven { url = uri("https://repo.codemc.org/repository/maven-public") }
|
||||||
|
maven { url = uri("https://papermc.io/repo/repository/maven-public/") }
|
||||||
|
maven { url = uri("https://maven.fabricmc.net/") }
|
||||||
|
gradlePluginPortal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
"testImplementation"("org.junit.jupiter:junit-jupiter-api:5.7.0")
|
||||||
|
"testImplementation"("org.junit.jupiter:junit-jupiter-engine:5.7.0")
|
||||||
|
"compileOnly"("org.jetbrains:annotations:20.1.0")
|
||||||
|
|
||||||
|
"compileOnly"("com.google.guava:guava:30.0-jre")
|
||||||
|
"testImplementation"("com.google.guava:guava:30.0-jre")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (project(":common:addons").subprojects.contains(this)) { // If this is an addon project, depend on the API.
|
||||||
|
dependencies {
|
||||||
|
"compileOnly"(project(":common:api"))
|
||||||
|
"testImplementation"(project(":common:api"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+71
-100
@@ -1,116 +1,98 @@
|
|||||||
|
package com.dfsek.terra
|
||||||
|
|
||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
import io.papermc.paperweight.util.path
|
|
||||||
import java.io.File
|
|
||||||
import java.io.FileWriter
|
|
||||||
import java.net.URL
|
|
||||||
import java.nio.file.FileSystems
|
|
||||||
import java.nio.file.Path
|
|
||||||
import org.gradle.api.DefaultTask
|
import org.gradle.api.DefaultTask
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.plugins.BasePluginExtension
|
import org.gradle.api.plugins.BasePluginExtension
|
||||||
import org.gradle.jvm.tasks.Jar
|
import org.gradle.jvm.tasks.Jar
|
||||||
import org.gradle.kotlin.dsl.apply
|
import org.gradle.kotlin.dsl.apply
|
||||||
import org.gradle.kotlin.dsl.configure
|
import org.gradle.kotlin.dsl.configure
|
||||||
import org.gradle.kotlin.dsl.extra
|
|
||||||
import org.gradle.kotlin.dsl.get
|
import org.gradle.kotlin.dsl.get
|
||||||
import org.gradle.kotlin.dsl.named
|
import org.gradle.kotlin.dsl.named
|
||||||
import org.yaml.snakeyaml.DumperOptions
|
import org.yaml.snakeyaml.DumperOptions
|
||||||
import org.yaml.snakeyaml.Yaml
|
import org.yaml.snakeyaml.Yaml
|
||||||
import kotlin.io.path.copyTo
|
import java.io.File
|
||||||
import kotlin.io.path.createDirectories
|
import java.io.FileInputStream
|
||||||
import kotlin.io.path.createFile
|
import java.io.FileOutputStream
|
||||||
import kotlin.io.path.exists
|
import java.io.FileWriter
|
||||||
|
import java.net.URL
|
||||||
private fun Project.installAddonsInto(dest: Path) {
|
import java.util.zip.ZipEntry
|
||||||
FileSystems.newFileSystem(dest, mapOf("create" to "false"), null).use { fs ->
|
import java.util.zip.ZipOutputStream
|
||||||
forSubProjects(":common:addons") {
|
|
||||||
val jar = getJarTask()
|
|
||||||
|
|
||||||
logger.info("Packaging addon ${jar.archiveFileName.get()} to $dest. size: ${jar.archiveFile.get().asFile.length() / 1024}KB")
|
|
||||||
|
|
||||||
val boot = if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "bootstrap/" else ""
|
|
||||||
val addonPath = fs.getPath("/addons/$boot${jar.archiveFileName.get()}")
|
|
||||||
|
|
||||||
if (!addonPath.exists()) {
|
|
||||||
addonPath.parent.createDirectories()
|
|
||||||
addonPath.createFile()
|
|
||||||
jar.archiveFile.get().asFile.toPath().copyTo(addonPath, overwrite = true)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.configureDistribution() {
|
fun Project.configureDistribution() {
|
||||||
apply(plugin = "com.gradleup.shadow")
|
apply(plugin = "com.github.johnrengelman.shadow")
|
||||||
|
|
||||||
val downloadDefaultPacks = tasks.create("downloadDefaultPacks") {
|
val downloadDefaultPacks = tasks.create("downloadDefaultPacks") {
|
||||||
group = "terra"
|
group = "terra"
|
||||||
doFirst {
|
doFirst {
|
||||||
try {
|
file("${buildDir}/resources/main/packs/").deleteRecursively()
|
||||||
file("${buildDir}/resources/main/packs/").deleteRecursively()
|
|
||||||
val defaultPackUrl =
|
val defaultPackUrl = URL("https://github.com/PolyhedralDev/TerraDefaultConfig/releases/download/latest/default.zip")
|
||||||
URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/" + Versions.Terra.overworldConfig + "/default.zip")
|
downloadPack(defaultPackUrl, project)
|
||||||
downloadPack(defaultPackUrl, project)
|
val netherPackUrl = URL("https://github.com/PolyhedralDev/TerraDefaultConfig/releases/download/latest/nether.zip")
|
||||||
} catch (_:Exception) {}
|
downloadPack(netherPackUrl, project)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val compileAddons = tasks.create("compileAddons") {
|
|
||||||
forSubProjects(":common:addons") {
|
|
||||||
afterEvaluate {
|
|
||||||
dependsOn(getJarTask())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val installAddons = tasks.create("installAddons") {
|
val installAddons = tasks.create("installAddons") {
|
||||||
group = "terra"
|
group = "terra"
|
||||||
dependsOn(compileAddons)
|
project(":common:addons").subprojects.forEach {
|
||||||
|
it.afterEvaluate {
|
||||||
doLast {
|
dependsOn(it.tasks.getByName("build")) // Depend on addon JARs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
doFirst {
|
||||||
|
// The addons are copied into a JAR because of a ShadowJar bug
|
||||||
|
// which expands *all* JARs, even resource ones, into the fat JAR.
|
||||||
|
// To get around this, we copy all addon JARs into a *new* JAR,
|
||||||
|
// then, ShadowJar expands the newly created JAR, putting the original
|
||||||
|
// JARs where they should go.
|
||||||
|
//
|
||||||
// https://github.com/johnrengelman/shadow/issues/111
|
// https://github.com/johnrengelman/shadow/issues/111
|
||||||
val dest = tasks.named<ShadowJar>("shadowJar").get().archiveFile.get().path
|
val dest = File(buildDir, "/resources/main/addons.jar")
|
||||||
installAddonsInto(dest)
|
dest.parentFile.mkdirs()
|
||||||
|
|
||||||
|
val zip = ZipOutputStream(FileOutputStream(dest))
|
||||||
|
|
||||||
|
project(":common:addons").subprojects.forEach { addonProject ->
|
||||||
|
val jar = (addonProject.tasks.named("jar").get() as Jar)
|
||||||
|
println("Packaging addon ${jar.archiveFileName.get()} to ${dest.absolutePath}.")
|
||||||
|
|
||||||
|
val entry = ZipEntry("addons/${jar.archiveFileName.get()}")
|
||||||
|
zip.putNextEntry(entry)
|
||||||
|
FileInputStream(jar.archiveFile.get().asFile).copyTo(zip)
|
||||||
|
zip.closeEntry()
|
||||||
|
}
|
||||||
|
zip.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.create("installAddonsIntoDefaultJar") {
|
|
||||||
group = "terra"
|
|
||||||
dependsOn(compileAddons)
|
|
||||||
|
|
||||||
doLast {
|
|
||||||
val dest = tasks.named<Jar>("jar").get().archiveFile.get().path
|
|
||||||
installAddonsInto(dest)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val generateResourceManifest = tasks.create("generateResourceManifest") {
|
val generateResourceManifest = tasks.create("generateResourceManifest") {
|
||||||
group = "terra"
|
group = "terra"
|
||||||
doLast {
|
dependsOn(downloadDefaultPacks)
|
||||||
|
dependsOn(installAddons)
|
||||||
|
doFirst {
|
||||||
val resources = HashMap<String, MutableList<String>>()
|
val resources = HashMap<String, MutableList<String>>()
|
||||||
val packsDir = File("${project.buildDir}/resources/main/packs/")
|
val packsDir = File("${project.buildDir}/resources/main/packs/")
|
||||||
|
|
||||||
packsDir.walkTopDown().forEach {
|
packsDir.walkTopDown().forEach {
|
||||||
if (it.isDirectory || !it.name.endsWith(".zip")) return@forEach
|
if (it.isDirectory || !it.name.endsWith(".zip")) return@forEach
|
||||||
resources.computeIfAbsent("packs") { ArrayList() }.add(it.name)
|
resources.computeIfAbsent("packs") { ArrayList() }.add(it.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
val langDir = File("${project(":common:implementation").buildDir}/resources/main/lang/")
|
val langDir = File("${project(":common:implementation").buildDir}/resources/main/lang/")
|
||||||
|
|
||||||
langDir.walkTopDown().forEach {
|
langDir.walkTopDown().forEach {
|
||||||
if (it.isDirectory || !it.name.endsWith(".yml")) return@forEach
|
if (it.isDirectory || !it.name.endsWith(".yml")) return@forEach
|
||||||
resources.computeIfAbsent("lang") { ArrayList() }.add(it.name)
|
resources.computeIfAbsent("lang") { ArrayList() }.add(it.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
forSubProjects(":common:addons") {
|
project(":common:addons").subprojects.forEach { addonProject ->
|
||||||
val jar = getJarTask().archiveFileName.get()
|
val jar = (addonProject.tasks.named("jar").get() as Jar).archiveFileName.get()
|
||||||
resources.computeIfAbsent(
|
resources.computeIfAbsent("addons") { ArrayList() }.add(jar)
|
||||||
if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "addons/bootstrap"
|
|
||||||
else "addons"
|
|
||||||
) { ArrayList() }.add(jar)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val options = DumperOptions()
|
val options = DumperOptions()
|
||||||
options.indent = 2
|
options.indent = 2
|
||||||
options.indentWithIndicator = true
|
options.indentWithIndicator = true
|
||||||
@@ -118,46 +100,37 @@ fun Project.configureDistribution() {
|
|||||||
options.isPrettyFlow = true
|
options.isPrettyFlow = true
|
||||||
options.defaultFlowStyle = DumperOptions.FlowStyle.BLOCK
|
options.defaultFlowStyle = DumperOptions.FlowStyle.BLOCK
|
||||||
options.defaultScalarStyle = DumperOptions.ScalarStyle.DOUBLE_QUOTED
|
options.defaultScalarStyle = DumperOptions.ScalarStyle.DOUBLE_QUOTED
|
||||||
|
|
||||||
val yaml = Yaml(options)
|
val yaml = Yaml(options)
|
||||||
|
|
||||||
val manifest = File("${project.buildDir}/resources/main/resources.yml")
|
val manifest = File("${project.buildDir}/resources/main/resources.yml")
|
||||||
|
|
||||||
if (manifest.exists()) manifest.delete()
|
if (manifest.exists()) manifest.delete()
|
||||||
manifest.parentFile.mkdirs()
|
|
||||||
manifest.createNewFile()
|
manifest.createNewFile()
|
||||||
FileWriter(manifest).use {
|
yaml.dump(resources, FileWriter(manifest))
|
||||||
yaml.dump(resources, it)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named("processResources") {
|
tasks["processResources"].dependsOn(generateResourceManifest)
|
||||||
generateResourceManifest.mustRunAfter(downloadDefaultPacks)
|
|
||||||
finalizedBy(downloadDefaultPacks)
|
|
||||||
finalizedBy(generateResourceManifest)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tasks.named<ShadowJar>("shadowJar") {
|
tasks.named<ShadowJar>("shadowJar") {
|
||||||
// Tell shadow to download the packs
|
// Tell shadow to download the packs
|
||||||
dependsOn(downloadDefaultPacks)
|
dependsOn(downloadDefaultPacks)
|
||||||
|
|
||||||
configurations = listOf(project.configurations["shaded"])
|
configurations = listOf(project.configurations["shaded"])
|
||||||
|
|
||||||
archiveClassifier.set("shaded")
|
archiveClassifier.set("shaded")
|
||||||
version = project.version
|
setVersion(project.version)
|
||||||
relocate("org.apache.commons", "com.dfsek.terra.lib.commons")
|
relocate("org.apache.commons", "com.dfsek.terra.lib.commons")
|
||||||
relocate("org.objectweb.asm", "com.dfsek.terra.lib.asm")
|
relocate("org.objectweb.asm", "com.dfsek.terra.lib.asm")
|
||||||
relocate("org.json", "com.dfsek.terra.lib.json")
|
relocate("org.json", "com.dfsek.terra.lib.json")
|
||||||
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
|
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
|
||||||
|
|
||||||
finalizedBy(installAddons)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configure<BasePluginExtension> {
|
configure<BasePluginExtension> {
|
||||||
archivesName.set(project.name)
|
archivesName.set(project.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named<DefaultTask>("build") {
|
tasks.named<DefaultTask>("build") {
|
||||||
dependsOn(tasks["shadowJar"])
|
dependsOn(tasks["shadowJar"])
|
||||||
}
|
}
|
||||||
@@ -168,6 +141,4 @@ fun downloadPack(packUrl: URL, project: Project) {
|
|||||||
val file = File("${project.buildDir}/resources/main/packs/${fileName}")
|
val file = File("${project.buildDir}/resources/main/packs/${fileName}")
|
||||||
file.parentFile.mkdirs()
|
file.parentFile.mkdirs()
|
||||||
file.outputStream().write(packUrl.readBytes())
|
file.outputStream().write(packUrl.readBytes())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.getJarTask() = tasks.named("shadowJar").get() as ShadowJar
|
|
||||||
+7
-8
@@ -1,24 +1,23 @@
|
|||||||
|
package com.dfsek.terra
|
||||||
|
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.publish.PublishingExtension
|
import org.gradle.api.publish.PublishingExtension
|
||||||
import org.gradle.api.publish.maven.MavenPublication
|
import org.gradle.api.publish.maven.MavenPublication
|
||||||
import org.gradle.kotlin.dsl.configure
|
import org.gradle.kotlin.dsl.*
|
||||||
import org.gradle.kotlin.dsl.create
|
|
||||||
import org.gradle.kotlin.dsl.get
|
|
||||||
import org.gradle.kotlin.dsl.maven
|
|
||||||
import org.gradle.kotlin.dsl.provideDelegate
|
|
||||||
|
|
||||||
fun Project.configurePublishing() {
|
fun Project.configurePublishing() {
|
||||||
configure<PublishingExtension> {
|
configure<PublishingExtension> {
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("mavenJava") {
|
create<MavenPublication>("mavenJava") {
|
||||||
from(components["java"])
|
artifact(tasks["sourcesJar"])
|
||||||
|
artifact(tasks["jar"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
val mavenUrl = "https://repo.codemc.io/repository/maven-releases/"
|
val mavenUrl = "https://repo.codemc.io/repository/maven-releases/"
|
||||||
//val mavenSnapshotUrl = "https://repo.codemc.io/repository/maven-snapshots/"
|
//val mavenSnapshotUrl = "https://repo.codemc.io/repository/maven-snapshots/"
|
||||||
|
|
||||||
maven(mavenUrl) {
|
maven(mavenUrl) {
|
||||||
val mavenUsername: String? by project
|
val mavenUsername: String? by project
|
||||||
val mavenPassword: String? by project
|
val mavenPassword: String? by project
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.dfsek.terra.tectonicdoc
|
|
||||||
|
|
||||||
class DocumentedTemplate(private val name: String) {
|
|
||||||
private val template = HashMap<String, String>()
|
|
||||||
|
|
||||||
fun add(name: String, content: String) {
|
|
||||||
template[name] = content
|
|
||||||
}
|
|
||||||
|
|
||||||
fun format(): String {
|
|
||||||
val builder = StringBuilder("# ").append(name).append("\n\n")
|
|
||||||
template.forEach { name, content ->
|
|
||||||
builder
|
|
||||||
.append("### $name\n\n")
|
|
||||||
.append(content)
|
|
||||||
.append("\n\n")
|
|
||||||
}
|
|
||||||
return builder.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,150 +0,0 @@
|
|||||||
package com.dfsek.terra.tectonicdoc
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Description
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Final
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value
|
|
||||||
import java.io.File
|
|
||||||
import java.io.FileInputStream
|
|
||||||
import java.io.InputStream
|
|
||||||
import org.gradle.api.DefaultTask
|
|
||||||
import org.gradle.api.plugins.JavaPluginExtension
|
|
||||||
import org.gradle.api.tasks.TaskAction
|
|
||||||
import org.objectweb.asm.ClassReader
|
|
||||||
import org.objectweb.asm.tree.ClassNode
|
|
||||||
import org.objectweb.asm.tree.FieldNode
|
|
||||||
|
|
||||||
|
|
||||||
abstract class GenerateDocsTask : DefaultTask() {
|
|
||||||
@TaskAction
|
|
||||||
fun generateDocs() {
|
|
||||||
project.extensions.getByType(JavaPluginExtension::class.java).sourceSets.forEach { sources ->
|
|
||||||
val classes = HashMap<String, ClassNode>()
|
|
||||||
sources.java.classesDirectory.get().asFileTree.forEach { file ->
|
|
||||||
if (file.name.endsWith(".class")) {
|
|
||||||
val node = createClassNode(FileInputStream(file))
|
|
||||||
if (node.fields.stream().anyMatch { field ->
|
|
||||||
field.visibleAnnotations?.stream()?.anyMatch {
|
|
||||||
it.desc.equals(descriptor(Value::class.java.canonicalName))
|
|
||||||
} == true
|
|
||||||
}) {
|
|
||||||
var name = sources
|
|
||||||
.java
|
|
||||||
.classesDirectory
|
|
||||||
.get()
|
|
||||||
.asFile
|
|
||||||
.toPath()
|
|
||||||
.relativize(file.toPath())
|
|
||||||
.toString()
|
|
||||||
.substringBeforeLast('.')
|
|
||||||
if (name.endsWith("Template")) {
|
|
||||||
name = name.substringBeforeLast("Template")
|
|
||||||
}
|
|
||||||
classes[name] = node
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val docsDir = File(project.buildDir, "tectonic")
|
|
||||||
docsDir.mkdirs()
|
|
||||||
|
|
||||||
classes.forEach { (name, clazz) ->
|
|
||||||
val template = DocumentedTemplate(name.substringAfterLast('/'))
|
|
||||||
clazz.fields
|
|
||||||
.stream()
|
|
||||||
.filter { field ->
|
|
||||||
field.visibleAnnotations?.stream()?.anyMatch {
|
|
||||||
it.desc.equals(descriptor(Value::class.java.canonicalName))
|
|
||||||
} == true
|
|
||||||
}.forEach { field ->
|
|
||||||
val annotations = field.visibleAnnotations
|
|
||||||
|
|
||||||
val description = StringBuilder()
|
|
||||||
|
|
||||||
annotations.stream().filter {
|
|
||||||
it.desc.equals(descriptor(Description::class.java.canonicalName))
|
|
||||||
}.forEach {
|
|
||||||
description.append(it.values[1])
|
|
||||||
}
|
|
||||||
|
|
||||||
val keyName = StringBuilder()
|
|
||||||
|
|
||||||
if (annotations.stream().anyMatch { it.desc.equals(descriptor(Final::class.java.canonicalName)) }) {
|
|
||||||
keyName.append("final ")
|
|
||||||
}
|
|
||||||
|
|
||||||
keyName.append(getType(field))
|
|
||||||
.append(" ")
|
|
||||||
|
|
||||||
annotations.stream().filter {
|
|
||||||
it.desc.equals(descriptor(Value::class.java.canonicalName))
|
|
||||||
}.forEach {
|
|
||||||
keyName.append(it.values[1])
|
|
||||||
}
|
|
||||||
|
|
||||||
template.add(keyName.toString(), description.toString().ifBlank {
|
|
||||||
logger.info("No description provided for field " + field.name + " in class " + name)
|
|
||||||
"*No description provided.*"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
val save = File(docsDir, "$name.md")
|
|
||||||
if (save.exists()) save.delete()
|
|
||||||
save.parentFile.mkdirs()
|
|
||||||
save.createNewFile()
|
|
||||||
save.writeText(template.format())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getType(node: FieldNode): String {
|
|
||||||
if (node.signature != null) {
|
|
||||||
return generic(node.signature)
|
|
||||||
}
|
|
||||||
return descriptorToHumanReadable(node.desc).substringAfterLast('.')
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun generic(type: String): String {
|
|
||||||
val clean = descriptorToHumanReadable(type)
|
|
||||||
|
|
||||||
if (clean.contains('<')) {
|
|
||||||
val typeIndex = clean.indexOf('<')
|
|
||||||
return clean.substring(0, typeIndex + 1).substringAfterLast('.') + generic(clean.substring(typeIndex + 1)) + "\\>"
|
|
||||||
}
|
|
||||||
|
|
||||||
return clean.substringAfterLast('.')
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun createClassNode(input: InputStream): ClassNode {
|
|
||||||
val reader = ClassReader(input)
|
|
||||||
val node = ClassNode()
|
|
||||||
try {
|
|
||||||
reader.accept(node, ClassReader.EXPAND_FRAMES)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
reader.accept(node, ClassReader.SKIP_FRAMES or ClassReader.SKIP_DEBUG)
|
|
||||||
}
|
|
||||||
return node
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun descriptorToHumanReadable(descriptor: String): String {
|
|
||||||
if (descriptor.startsWith('L')) {
|
|
||||||
return descriptor.substring(1).substringBeforeLast(';').replace('/', '.')
|
|
||||||
}
|
|
||||||
if (descriptor.startsWith("[")) {
|
|
||||||
return "${descriptorToHumanReadable(descriptor.substring(1))}[]"
|
|
||||||
}
|
|
||||||
return when (descriptor) {
|
|
||||||
"B" -> "byte"
|
|
||||||
"C" -> "char"
|
|
||||||
"I" -> "int"
|
|
||||||
"D" -> "double"
|
|
||||||
"F" -> "float"
|
|
||||||
"J" -> "long"
|
|
||||||
"S" -> "short"
|
|
||||||
"Z" -> "boolean"
|
|
||||||
else -> descriptor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun descriptor(name: String): String = "L${name.replace('.', '/')};"
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package com.dfsek.terra.tectonicdoc
|
|
||||||
|
|
||||||
import org.gradle.api.Plugin
|
|
||||||
import org.gradle.api.Project
|
|
||||||
|
|
||||||
class TectonicDocPlugin : Plugin<Project> {
|
|
||||||
override fun apply(project: Project) {
|
|
||||||
project.tasks.create("generateDocs", GenerateDocsTask::class.java)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
# Core Addons
|
# Core Addons
|
||||||
|
|
||||||
This directory contains the modularized "core addons" that implement Terra's
|
This directory contains the modularized "core addons" that implement Terra's default behavior.
|
||||||
default behavior.
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# api addon loader
|
|
||||||
|
|
||||||
Loads dependencies as addons
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
version = version("0.1.0")
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Jar> {
|
|
||||||
manifest {
|
|
||||||
attributes("Terra-Bootstrap-Addon-Entry-Point" to "com.dfsek.terra.addon.loader.ApiAddonLoader")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project.extra.set("bootstrap", true)
|
|
||||||
-26
@@ -1,26 +0,0 @@
|
|||||||
package com.dfsek.terra.addon.loader;
|
|
||||||
|
|
||||||
import ca.solostudios.strata.version.Version;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.addon.BaseAddon;
|
|
||||||
|
|
||||||
|
|
||||||
public class ApiAddon implements BaseAddon {
|
|
||||||
private final Version version;
|
|
||||||
private final String id;
|
|
||||||
|
|
||||||
public ApiAddon(Version version, String id) {
|
|
||||||
this.version = version;
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Version getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getID() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-22
@@ -1,22 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
*
|
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
|
||||||
* reference the LICENSE file in this module's root directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.dfsek.terra.addon.loader;
|
|
||||||
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLClassLoader;
|
|
||||||
|
|
||||||
|
|
||||||
public class ApiAddonClassLoader extends URLClassLoader {
|
|
||||||
static {
|
|
||||||
ClassLoader.registerAsParallelCapable();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApiAddonClassLoader(URL[] urls, ClassLoader parent) {
|
|
||||||
super(urls, parent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-39
@@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
*
|
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
|
||||||
* reference the LICENSE file in this module's root directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.dfsek.terra.addon.loader;
|
|
||||||
|
|
||||||
import ca.solostudios.strata.Versions;
|
|
||||||
import ca.solostudios.strata.version.Version;
|
|
||||||
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.addon.BaseAddon;
|
|
||||||
import com.dfsek.terra.api.addon.bootstrap.BootstrapAddonClassLoader;
|
|
||||||
import com.dfsek.terra.api.addon.bootstrap.BootstrapBaseAddon;
|
|
||||||
|
|
||||||
|
|
||||||
public class ApiAddonLoader implements BootstrapBaseAddon<BaseAddon> {
|
|
||||||
private static final Version VERSION = Versions.getVersion(1, 0, 0);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterable<BaseAddon> loadAddons(Path addonsFolder, BootstrapAddonClassLoader parent) {
|
|
||||||
|
|
||||||
return Collections.emptySet();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getID() {
|
|
||||||
return "API";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Version getVersion() {
|
|
||||||
return VERSION;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# api-features
|
||||||
|
Contains the API for feature generation.
|
||||||
|
|
||||||
|
This API implemented in:
|
||||||
|
* `config-feature`
|
||||||
|
* `generation-stage-feature`
|
||||||
|
* `config-locators`
|
||||||
|
* `config-distributors`
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
dependencies {
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
dependencies {
|
||||||
|
"shadedApi"("commons-io:commons-io:2.6")
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api;
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.terrascript.api.lang.Returnable;
|
||||||
|
import com.dfsek.terra.addons.terrascript.api.lang.Variable;
|
||||||
|
import com.dfsek.terra.api.properties.Context;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface Function<T> extends Returnable<T> {
|
||||||
|
Function<?> NULL = new Function<Object>() {
|
||||||
|
@Override
|
||||||
|
public ReturnType returnType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object apply(Context context, Map<String, Variable<?>> variableMap) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Position getPosition() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api;
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.terrascript.api.exception.ParseException;
|
||||||
|
import com.dfsek.terra.addons.terrascript.api.lang.Returnable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface FunctionBuilder<T extends Function<?>> {
|
||||||
|
T build(List<Returnable<?>> argumentList, Position position) throws ParseException;
|
||||||
|
|
||||||
|
int argNumber();
|
||||||
|
|
||||||
|
Returnable.ReturnType getArgument(int position);
|
||||||
|
}
|
||||||
+1
-8
@@ -1,11 +1,4 @@
|
|||||||
/*
|
package com.dfsek.terra.addons.terrascript.api;
|
||||||
* Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
*
|
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
|
||||||
* reference the LICENSE file in this module's root directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.dfsek.terra.addons.terrascript.tokenizer;
|
|
||||||
|
|
||||||
public class Position {
|
public class Position {
|
||||||
private final int line;
|
private final int line;
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.structure.Structure;
|
||||||
|
import com.dfsek.terra.api.structure.rotation.Rotation;
|
||||||
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public interface StructureScript extends Structure {
|
||||||
|
@SuppressWarnings("try")
|
||||||
|
boolean test(Vector3 location, World world, Random random, Rotation rotation);
|
||||||
|
}
|
||||||
+53
@@ -0,0 +1,53 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.properties.Properties;
|
||||||
|
import com.dfsek.terra.api.structure.buffer.Buffer;
|
||||||
|
import com.dfsek.terra.api.structure.rotation.Rotation;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class TerraProperties implements Properties {
|
||||||
|
private final Buffer buffer;
|
||||||
|
private final Rotation rotation;
|
||||||
|
private final Random random;
|
||||||
|
private final World world;
|
||||||
|
private final int recursions;
|
||||||
|
private boolean waterlog = false;
|
||||||
|
|
||||||
|
public TerraProperties(Buffer buffer, Rotation rotation, Random random, World world, int recursions) {
|
||||||
|
this.buffer = buffer;
|
||||||
|
this.rotation = rotation;
|
||||||
|
this.random = random;
|
||||||
|
this.world = world;
|
||||||
|
this.recursions = recursions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Buffer getBuffer() {
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRecursions() {
|
||||||
|
return recursions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Random getRandom() {
|
||||||
|
return random;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Rotation getRotation() {
|
||||||
|
return rotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isWaterlog() {
|
||||||
|
return waterlog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWaterlog(boolean waterlog) {
|
||||||
|
this.waterlog = waterlog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public World getWorld() {
|
||||||
|
return world;
|
||||||
|
}
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.addon.TerraAddon;
|
||||||
|
import com.dfsek.terra.api.addon.annotations.Addon;
|
||||||
|
import com.dfsek.terra.api.addon.annotations.Author;
|
||||||
|
import com.dfsek.terra.api.addon.annotations.Version;
|
||||||
|
|
||||||
|
@Addon("api-terrascript")
|
||||||
|
@Version("1.0.0")
|
||||||
|
@Author("Terra")
|
||||||
|
public class TerraScriptAPIAddon extends TerraAddon {
|
||||||
|
@Override
|
||||||
|
public void initialize() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.buffer;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.structure.buffer.BufferedItem;
|
||||||
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Cell implements BufferedItem {
|
||||||
|
private final List<BufferedItem> items = new ArrayList<>();
|
||||||
|
private String mark = null;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paste(Vector3 origin, World world) {
|
||||||
|
items.forEach(item -> item.paste(origin.clone(), world));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(BufferedItem item) {
|
||||||
|
items.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMark() {
|
||||||
|
return mark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMark(String mark) {
|
||||||
|
this.mark = mark;
|
||||||
|
}
|
||||||
|
}
|
||||||
+56
@@ -0,0 +1,56 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.buffer;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.structure.buffer.Buffer;
|
||||||
|
import com.dfsek.terra.api.structure.buffer.BufferedItem;
|
||||||
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
|
import com.dfsek.terra.api.world.Chunk;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Buffer implementation that directly pastes to the world.
|
||||||
|
*/
|
||||||
|
public class DirectBuffer implements Buffer {
|
||||||
|
private final Vector3 origin;
|
||||||
|
private final World target;
|
||||||
|
private final Map<Vector3, String> marks = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
public DirectBuffer(Vector3 origin, World target) {
|
||||||
|
this.origin = origin;
|
||||||
|
this.target = target;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paste(Vector3 origin, Chunk chunk) {
|
||||||
|
// no-op
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paste(Vector3 origin, World world) {
|
||||||
|
// no-op
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Buffer addItem(BufferedItem item, Vector3 location) {
|
||||||
|
item.paste(origin.clone().add(location), target);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Vector3 getOrigin() {
|
||||||
|
return origin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMark(Vector3 location) {
|
||||||
|
return marks.get(location);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Buffer setMark(String mark, Vector3 location) {
|
||||||
|
marks.put(location, mark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.buffer;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.structure.buffer.Buffer;
|
||||||
|
import com.dfsek.terra.api.structure.buffer.BufferedItem;
|
||||||
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
|
import com.dfsek.terra.api.world.Chunk;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
|
||||||
|
public class IntermediateBuffer implements Buffer {
|
||||||
|
private final Buffer original;
|
||||||
|
private final Vector3 offset;
|
||||||
|
|
||||||
|
public IntermediateBuffer(Buffer original, Vector3 offset) {
|
||||||
|
this.original = original;
|
||||||
|
this.offset = offset.clone();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paste(Vector3 origin, Chunk chunk) {
|
||||||
|
// no-op
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paste(Vector3 origin, World world) {
|
||||||
|
// no-op
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Buffer addItem(BufferedItem item, Vector3 location) {
|
||||||
|
return original.addItem(item, location.clone().add(offset));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Vector3 getOrigin() {
|
||||||
|
return original.getOrigin().clone().add(offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMark(Vector3 location) {
|
||||||
|
return original.getMark(location.clone().add(offset));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Buffer setMark(String mark, Vector3 location) {
|
||||||
|
original.setMark(mark, location.clone().add(offset));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
+68
@@ -0,0 +1,68 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.buffer;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.structure.buffer.Buffer;
|
||||||
|
import com.dfsek.terra.api.structure.buffer.BufferedItem;
|
||||||
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
|
import com.dfsek.terra.api.world.Chunk;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
import net.jafama.FastMath;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class StructureBuffer implements Buffer {
|
||||||
|
private final Map<Vector3, Cell> bufferedItemMap = new LinkedHashMap<>();
|
||||||
|
private final Vector3 origin;
|
||||||
|
private boolean succeeded;
|
||||||
|
|
||||||
|
public StructureBuffer(Vector3 origin) {
|
||||||
|
this.origin = origin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void paste(Vector3 origin, World world) {
|
||||||
|
bufferedItemMap.forEach(((vector3, item) -> item.paste(origin.clone().add(vector3), world)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void paste(Vector3 origin, Chunk chunk) {
|
||||||
|
bufferedItemMap.forEach(((location, item) -> {
|
||||||
|
Vector3 current = origin.clone().add(location);
|
||||||
|
if(FastMath.floorDiv(current.getBlockX(), 16) != chunk.getX() || FastMath.floorDiv(current.getBlockZ(), 16) != chunk.getZ())
|
||||||
|
return;
|
||||||
|
item.paste(current, chunk.getWorld());
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Buffer addItem(BufferedItem item, Vector3 location) {
|
||||||
|
bufferedItemMap.computeIfAbsent(location.clone(), l -> new Cell()).add(item);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMark(Vector3 location) {
|
||||||
|
Cell cell = bufferedItemMap.get(location);
|
||||||
|
if(cell != null) {
|
||||||
|
return cell.getMark();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Buffer setMark(String mark, Vector3 location) {
|
||||||
|
bufferedItemMap.computeIfAbsent(location.clone(), l -> new Cell()).setMark(mark);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSucceeded(boolean succeeded) {
|
||||||
|
this.succeeded = succeeded;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean succeeded() {
|
||||||
|
return succeeded;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Vector3 getOrigin() {
|
||||||
|
return origin.clone();
|
||||||
|
}
|
||||||
|
}
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.buffer.items;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.TerraPlugin;
|
||||||
|
import com.dfsek.terra.api.block.state.BlockState;
|
||||||
|
import com.dfsek.terra.api.block.state.properties.base.Properties;
|
||||||
|
import com.dfsek.terra.api.structure.buffer.BufferedItem;
|
||||||
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
|
||||||
|
public class BufferedBlock implements BufferedItem {
|
||||||
|
private final BlockState data;
|
||||||
|
private final boolean overwrite;
|
||||||
|
private final TerraPlugin main;
|
||||||
|
private final boolean waterlog;
|
||||||
|
|
||||||
|
public BufferedBlock(BlockState data, boolean overwrite, TerraPlugin main, boolean waterlog) {
|
||||||
|
this.data = data;
|
||||||
|
this.overwrite = overwrite;
|
||||||
|
this.main = main;
|
||||||
|
this.waterlog = waterlog;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paste(Vector3 origin, World world) {
|
||||||
|
try {
|
||||||
|
BlockState current = world.getBlockData(origin);
|
||||||
|
if(overwrite || current.isAir()) {
|
||||||
|
if(waterlog && current.has(Properties.WATERLOGGED) && current.getBlockType().isWater()) {
|
||||||
|
current.set(Properties.WATERLOGGED, true);
|
||||||
|
}
|
||||||
|
world.setBlockData(origin, data);
|
||||||
|
}
|
||||||
|
} catch(RuntimeException e) {
|
||||||
|
main.logger().severe("Failed to place block at location " + origin + ": " + e.getMessage());
|
||||||
|
main.getDebugLogger().stack(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.buffer.items;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.TerraPlugin;
|
||||||
|
import com.dfsek.terra.api.entity.Entity;
|
||||||
|
import com.dfsek.terra.api.entity.EntityType;
|
||||||
|
import com.dfsek.terra.api.event.events.world.generation.EntitySpawnEvent;
|
||||||
|
import com.dfsek.terra.api.structure.buffer.BufferedItem;
|
||||||
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
|
||||||
|
public class BufferedEntity implements BufferedItem {
|
||||||
|
|
||||||
|
private final EntityType type;
|
||||||
|
private final TerraPlugin main;
|
||||||
|
|
||||||
|
public BufferedEntity(EntityType type, TerraPlugin main) {
|
||||||
|
this.type = type;
|
||||||
|
this.main = main;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paste(Vector3 origin, World world) {
|
||||||
|
Entity entity = world.spawnEntity(origin.clone().add(0.5, 0, 0.5), type);
|
||||||
|
main.getEventManager().callEvent(new EntitySpawnEvent(entity.world().getConfig().getPack(), entity));
|
||||||
|
}
|
||||||
|
}
|
||||||
+47
@@ -0,0 +1,47 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.buffer.items;
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.terrascript.api.StructureScript;
|
||||||
|
import com.dfsek.terra.api.TerraPlugin;
|
||||||
|
import com.dfsek.terra.api.block.entity.BlockEntity;
|
||||||
|
import com.dfsek.terra.api.block.entity.Container;
|
||||||
|
import com.dfsek.terra.api.event.events.world.generation.LootPopulateEvent;
|
||||||
|
import com.dfsek.terra.api.structure.LootTable;
|
||||||
|
import com.dfsek.terra.api.structure.buffer.BufferedItem;
|
||||||
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class BufferedLootApplication implements BufferedItem {
|
||||||
|
private final LootTable table;
|
||||||
|
private final TerraPlugin main;
|
||||||
|
private final StructureScript structure;
|
||||||
|
|
||||||
|
public BufferedLootApplication(LootTable table, TerraPlugin main, StructureScript structure) {
|
||||||
|
this.table = table;
|
||||||
|
this.main = main;
|
||||||
|
this.structure = structure;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paste(Vector3 origin, World world) {
|
||||||
|
try {
|
||||||
|
BlockEntity data = world.getBlockState(origin);
|
||||||
|
if(!(data instanceof Container)) {
|
||||||
|
main.logger().severe("Failed to place loot at " + origin + "; block " + data + " is not container.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Container container = (Container) data;
|
||||||
|
|
||||||
|
LootPopulateEvent event = new LootPopulateEvent(container, table, world.getConfig().getPack(), structure);
|
||||||
|
main.getEventManager().callEvent(event);
|
||||||
|
if(event.isCancelled()) return;
|
||||||
|
|
||||||
|
event.getTable().fillInventory(container.getInventory(), new Random(origin.hashCode()));
|
||||||
|
data.update(false);
|
||||||
|
} catch(Exception e) {
|
||||||
|
main.logger().warning("Could not apply loot at " + origin + ": " + e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.buffer.items;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.block.state.BlockState;
|
||||||
|
import com.dfsek.terra.api.structure.buffer.BufferedItem;
|
||||||
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
|
||||||
|
public class BufferedPulledBlock implements BufferedItem {
|
||||||
|
private final BlockState data;
|
||||||
|
|
||||||
|
public BufferedPulledBlock(BlockState data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paste(Vector3 origin, World world) {
|
||||||
|
Vector3 mutable = origin.clone();
|
||||||
|
while(mutable.getY() > world.getMinHeight()) {
|
||||||
|
if(!world.getBlockData(mutable).isAir()) {
|
||||||
|
world.setBlockData(mutable, data);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
mutable.subtract(0, 1, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.buffer.items;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.TerraPlugin;
|
||||||
|
import com.dfsek.terra.api.block.entity.BlockEntity;
|
||||||
|
import com.dfsek.terra.api.structure.buffer.BufferedItem;
|
||||||
|
import com.dfsek.terra.api.vector.Vector3;
|
||||||
|
import com.dfsek.terra.api.world.World;
|
||||||
|
|
||||||
|
public class BufferedStateManipulator implements BufferedItem {
|
||||||
|
private final TerraPlugin main;
|
||||||
|
private final String data;
|
||||||
|
|
||||||
|
public BufferedStateManipulator(TerraPlugin main, String state) {
|
||||||
|
this.main = main;
|
||||||
|
this.data = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paste(Vector3 origin, World world) {
|
||||||
|
try {
|
||||||
|
BlockEntity state = world.getBlockState(origin);
|
||||||
|
state.applyState(data);
|
||||||
|
state.update(false);
|
||||||
|
} catch(Exception e) {
|
||||||
|
main.logger().warning("Could not apply BlockState at " + origin + ": " + e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
-14
@@ -1,19 +1,8 @@
|
|||||||
/*
|
package com.dfsek.terra.addons.terrascript.api.exception;
|
||||||
* Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
*
|
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
|
||||||
* reference the LICENSE file in this module's root directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.dfsek.terra.addons.terrascript.parser.exceptions;
|
import com.dfsek.terra.addons.terrascript.api.Position;
|
||||||
|
|
||||||
import java.io.Serial;
|
public class ParseException extends Exception {
|
||||||
|
|
||||||
import com.dfsek.terra.addons.terrascript.tokenizer.Position;
|
|
||||||
|
|
||||||
|
|
||||||
public class ParseException extends RuntimeException {
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 6744390543046766386L;
|
private static final long serialVersionUID = 6744390543046766386L;
|
||||||
private final Position position;
|
private final Position position;
|
||||||
|
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.lang;
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.terrascript.api.Position;
|
||||||
|
import com.dfsek.terra.api.properties.Context;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public abstract class ConstantExpression<T> implements Returnable<T> {
|
||||||
|
private final T constant;
|
||||||
|
private final Position position;
|
||||||
|
|
||||||
|
public ConstantExpression(T constant, Position position) {
|
||||||
|
this.constant = constant;
|
||||||
|
this.position = position;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T apply(Context context, Map<String, Variable<?>> variableMap) {
|
||||||
|
return constant;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Position getPosition() {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getConstant() {
|
||||||
|
return constant;
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.lang;
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.terrascript.api.Position;
|
||||||
|
import com.dfsek.terra.api.properties.Context;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface Item<T> {
|
||||||
|
T apply(Context context, Map<String, Variable<?>> variableMap);
|
||||||
|
|
||||||
|
Position getPosition();
|
||||||
|
}
|
||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.lang;
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.terrascript.api.Position;
|
||||||
|
import com.dfsek.terra.api.properties.Context;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface Returnable<T> extends Item<T> {
|
||||||
|
ReturnType returnType();
|
||||||
|
|
||||||
|
enum ReturnType {
|
||||||
|
NUMBER(true), STRING(true), BOOLEAN(false), VOID(false), OBJECT(false);
|
||||||
|
|
||||||
|
private final boolean comparable;
|
||||||
|
|
||||||
|
ReturnType(boolean comparable) {
|
||||||
|
this.comparable = comparable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isComparable() {
|
||||||
|
return comparable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static <T> Returnable<T> constant(T value, ReturnType type, Position position) {
|
||||||
|
return new Returnable<T>() {
|
||||||
|
@Override
|
||||||
|
public ReturnType returnType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T apply(Context context, Map<String, Variable<?>> variableMap) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Position getPosition() {
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
package com.dfsek.terra.addons.terrascript.api.lang;
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.terrascript.api.Position;
|
||||||
|
|
||||||
|
public interface Variable<T> {
|
||||||
|
T getValue();
|
||||||
|
|
||||||
|
void setValue(T value);
|
||||||
|
|
||||||
|
Returnable.ReturnType getType();
|
||||||
|
|
||||||
|
Position getPosition();
|
||||||
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
version = version("1.0.0")
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
|
||||||
compileOnlyApi(project(":common:addons:biome-query-api"))
|
|
||||||
}
|
|
||||||
-51
@@ -1,51 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.util.Column;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
|
|
||||||
|
|
||||||
class BaseBiomeColumn implements Column<Biome> {
|
|
||||||
private final BiomeExtrusionProvider biomeProvider;
|
|
||||||
private final Biome base;
|
|
||||||
private final int min;
|
|
||||||
private final int max;
|
|
||||||
|
|
||||||
private final int x;
|
|
||||||
private final int z;
|
|
||||||
private final long seed;
|
|
||||||
|
|
||||||
protected BaseBiomeColumn(BiomeExtrusionProvider biomeProvider, Biome base, int min, int max, int x, int z, long seed) {
|
|
||||||
this.biomeProvider = biomeProvider;
|
|
||||||
this.base = base;
|
|
||||||
this.min = min;
|
|
||||||
this.max = max;
|
|
||||||
this.x = x;
|
|
||||||
this.z = z;
|
|
||||||
this.seed = seed;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMinY() {
|
|
||||||
return min;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxY() {
|
|
||||||
return max;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getX() {
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getZ() {
|
|
||||||
return z;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Biome get(int y) {
|
|
||||||
return biomeProvider.extrude(base, x, y, z, seed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-67
@@ -1,67 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.Extrusion;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.ReplaceableBiome;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.config.BiomeExtrusionTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.config.ReplaceableBiomeLoader;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.config.extrusions.ReplaceExtrusionTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.config.extrusions.SetExtrusionTemplate;
|
|
||||||
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
|
|
||||||
import com.dfsek.terra.api.Platform;
|
|
||||||
import com.dfsek.terra.api.addon.BaseAddon;
|
|
||||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPostLoadEvent;
|
|
||||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
|
||||||
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
|
|
||||||
import com.dfsek.terra.api.inject.annotations.Inject;
|
|
||||||
import com.dfsek.terra.api.registry.CheckedRegistry;
|
|
||||||
import com.dfsek.terra.api.registry.Registry;
|
|
||||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class BiomeExtrusionAddon implements AddonInitializer {
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<Extrusion>>> EXTRUSION_REGISTRY_KEY = new TypeKey<>() {
|
|
||||||
};
|
|
||||||
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<BiomeProvider>>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
|
|
||||||
};
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private Platform platform;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private BaseAddon addon;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize() {
|
|
||||||
platform.getEventManager()
|
|
||||||
.getHandler(FunctionalEventHandler.class)
|
|
||||||
.register(addon, ConfigPackPreLoadEvent.class)
|
|
||||||
.then(event -> {
|
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry =
|
|
||||||
event.getPack()
|
|
||||||
.getOrCreateRegistry(PROVIDER_REGISTRY_KEY);
|
|
||||||
providerRegistry.register(addon.key("EXTRUSION"), BiomeExtrusionTemplate::new);
|
|
||||||
})
|
|
||||||
.then(event -> {
|
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<Extrusion>>> extrusionRegistry = event.getPack().getOrCreateRegistry(
|
|
||||||
EXTRUSION_REGISTRY_KEY);
|
|
||||||
extrusionRegistry.register(addon.key("SET"), SetExtrusionTemplate::new);
|
|
||||||
extrusionRegistry.register(addon.key("REPLACE"), ReplaceExtrusionTemplate::new);
|
|
||||||
})
|
|
||||||
.failThrough();
|
|
||||||
|
|
||||||
platform.getEventManager()
|
|
||||||
.getHandler(FunctionalEventHandler.class)
|
|
||||||
.register(addon, ConfigPackPostLoadEvent.class)
|
|
||||||
.then(event -> {
|
|
||||||
Registry<Biome> biomeRegistry = event.getPack().getRegistry(Biome.class);
|
|
||||||
event.getPack().applyLoader(ReplaceableBiome.class, new ReplaceableBiomeLoader(biomeRegistry));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-67
@@ -1,67 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.Extrusion;
|
|
||||||
import com.dfsek.terra.api.util.Column;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class BiomeExtrusionProvider implements BiomeProvider {
|
|
||||||
private final BiomeProvider delegate;
|
|
||||||
private final Set<Biome> biomes;
|
|
||||||
private final List<Extrusion> extrusions;
|
|
||||||
private final int resolution;
|
|
||||||
|
|
||||||
public BiomeExtrusionProvider(BiomeProvider delegate, List<Extrusion> extrusions, int resolution) {
|
|
||||||
this.delegate = delegate;
|
|
||||||
this.biomes = delegate.stream().collect(Collectors.toSet());
|
|
||||||
extrusions.forEach(e -> biomes.addAll(e.getBiomes()));
|
|
||||||
this.extrusions = extrusions;
|
|
||||||
this.resolution = resolution;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Biome getBiome(int x, int y, int z, long seed) {
|
|
||||||
Biome delegated = delegate.getBiome(x, y, z, seed);
|
|
||||||
|
|
||||||
return extrude(delegated, x, y, z, seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Biome extrude(Biome original, int x, int y, int z, long seed) {
|
|
||||||
for(Extrusion extrusion : extrusions) {
|
|
||||||
original = extrusion.extrude(original, x, y, z, seed);
|
|
||||||
}
|
|
||||||
return original;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Column<Biome> getColumn(int x, int z, long seed, int min, int max) {
|
|
||||||
return delegate.getBaseBiome(x, z, seed)
|
|
||||||
.map(base -> (Column<Biome>) new BaseBiomeColumn(this, base, min, max, x, z, seed))
|
|
||||||
.orElseGet(() -> BiomeProvider.super.getColumn(x, z, seed, min, max));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<Biome> getBaseBiome(int x, int z, long seed) {
|
|
||||||
return delegate.getBaseBiome(x, z, seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterable<Biome> getBiomes() {
|
|
||||||
return biomes;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int resolution() {
|
|
||||||
return resolution;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BiomeProvider getDelegate() {
|
|
||||||
return delegate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-12
@@ -1,12 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.api;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
|
|
||||||
public interface Extrusion {
|
|
||||||
Biome extrude(Biome original, int x, int y, int z, long seed);
|
|
||||||
|
|
||||||
Collection<Biome> getBiomes();
|
|
||||||
}
|
|
||||||
-23
@@ -1,23 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.api;
|
|
||||||
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
|
|
||||||
|
|
||||||
final class PresentBiome implements ReplaceableBiome {
|
|
||||||
private final Biome biome;
|
|
||||||
|
|
||||||
PresentBiome(Biome biome) {
|
|
||||||
this.biome = biome;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Biome get(Biome existing) {
|
|
||||||
return biome;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSelf() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-31
@@ -1,31 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.api;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Basically just a specialised implementation of {@link Optional} for biomes where a biome may be a "self" reference.
|
|
||||||
*/
|
|
||||||
public sealed interface ReplaceableBiome permits PresentBiome, SelfBiome {
|
|
||||||
static ReplaceableBiome of(Biome biome) {
|
|
||||||
return new PresentBiome(biome);
|
|
||||||
}
|
|
||||||
|
|
||||||
static ReplaceableBiome self() {
|
|
||||||
return SelfBiome.INSTANCE;
|
|
||||||
}
|
|
||||||
|
|
||||||
Biome get(Biome existing);
|
|
||||||
|
|
||||||
default Biome get() {
|
|
||||||
if(isSelf()) {
|
|
||||||
throw new IllegalStateException("Cannot get() self biome!");
|
|
||||||
}
|
|
||||||
return get(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean isSelf();
|
|
||||||
}
|
|
||||||
-21
@@ -1,21 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.api;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
|
|
||||||
|
|
||||||
final class SelfBiome implements ReplaceableBiome {
|
|
||||||
public static final SelfBiome INSTANCE = new SelfBiome();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Biome get(Biome existing) {
|
|
||||||
return Objects.requireNonNull(existing);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSelf() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-30
@@ -1,30 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.config;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Default;
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.BiomeExtrusionProvider;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.Extrusion;
|
|
||||||
import com.dfsek.terra.api.config.meta.Meta;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class BiomeExtrusionTemplate implements ObjectTemplate<BiomeProvider> {
|
|
||||||
@Value("provider")
|
|
||||||
private @Meta BiomeProvider provider;
|
|
||||||
|
|
||||||
@Value("resolution")
|
|
||||||
@Default
|
|
||||||
private @Meta int resolution = 4;
|
|
||||||
|
|
||||||
@Value("extrusions")
|
|
||||||
private @Meta List<@Meta Extrusion> extrusions;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BiomeProvider get() {
|
|
||||||
return new BiomeExtrusionProvider(provider, extrusions, resolution);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-32
@@ -1,32 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.config;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.depth.DepthTracker;
|
|
||||||
import com.dfsek.tectonic.api.exception.LoadException;
|
|
||||||
import com.dfsek.tectonic.api.loader.ConfigLoader;
|
|
||||||
import com.dfsek.tectonic.api.loader.type.TypeLoader;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.lang.reflect.AnnotatedType;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.ReplaceableBiome;
|
|
||||||
import com.dfsek.terra.api.registry.Registry;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
|
|
||||||
|
|
||||||
public class ReplaceableBiomeLoader implements TypeLoader<ReplaceableBiome> {
|
|
||||||
private final Registry<Biome> biomeRegistry;
|
|
||||||
|
|
||||||
public ReplaceableBiomeLoader(Registry<Biome> biomeRegistry) {
|
|
||||||
this.biomeRegistry = biomeRegistry;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReplaceableBiome load(@NotNull AnnotatedType t, @NotNull Object c, @NotNull ConfigLoader loader, DepthTracker depthTracker)
|
|
||||||
throws LoadException {
|
|
||||||
if(c.equals("SELF")) return ReplaceableBiome.self();
|
|
||||||
return biomeRegistry
|
|
||||||
.getByID((String) c)
|
|
||||||
.map(ReplaceableBiome::of)
|
|
||||||
.orElseThrow(() -> new LoadException("No such biome: " + c, depthTracker));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-23
@@ -1,23 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.config.extrusions;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.Extrusion;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.ReplaceableBiome;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.extrusions.ReplaceExtrusion;
|
|
||||||
import com.dfsek.terra.api.config.meta.Meta;
|
|
||||||
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
|
||||||
|
|
||||||
|
|
||||||
public class ReplaceExtrusionTemplate extends SamplerExtrusionTemplate {
|
|
||||||
@Value("to")
|
|
||||||
private @Meta ProbabilityCollection<@Meta ReplaceableBiome> biomes;
|
|
||||||
|
|
||||||
@Value("from")
|
|
||||||
private @Meta String fromTag;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Extrusion get() {
|
|
||||||
return new ReplaceExtrusion(sampler, range, biomes, fromTag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.config.extrusions;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.Extrusion;
|
|
||||||
import com.dfsek.terra.api.config.meta.Meta;
|
|
||||||
import com.dfsek.terra.api.noise.NoiseSampler;
|
|
||||||
import com.dfsek.terra.api.util.Range;
|
|
||||||
|
|
||||||
|
|
||||||
public abstract class SamplerExtrusionTemplate implements ObjectTemplate<Extrusion> {
|
|
||||||
@Value("sampler")
|
|
||||||
protected @Meta NoiseSampler sampler;
|
|
||||||
|
|
||||||
@Value("range")
|
|
||||||
protected @Meta Range range;
|
|
||||||
}
|
|
||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.config.extrusions;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.Extrusion;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.ReplaceableBiome;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.extrusions.SetExtrusion;
|
|
||||||
import com.dfsek.terra.api.config.meta.Meta;
|
|
||||||
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
|
||||||
|
|
||||||
|
|
||||||
public class SetExtrusionTemplate extends SamplerExtrusionTemplate {
|
|
||||||
@Value("to")
|
|
||||||
private @Meta ProbabilityCollection<@Meta ReplaceableBiome> biomes;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Extrusion get() {
|
|
||||||
return new SetExtrusion(sampler, range, biomes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-52
@@ -1,52 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.extrusions;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.Extrusion;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.ReplaceableBiome;
|
|
||||||
import com.dfsek.terra.addons.biome.query.api.BiomeQueries;
|
|
||||||
import com.dfsek.terra.api.noise.NoiseSampler;
|
|
||||||
import com.dfsek.terra.api.util.Range;
|
|
||||||
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets biomes at locations based on a sampler.
|
|
||||||
*/
|
|
||||||
public class ReplaceExtrusion implements Extrusion {
|
|
||||||
private final NoiseSampler sampler;
|
|
||||||
|
|
||||||
private final Range range;
|
|
||||||
|
|
||||||
private final ProbabilityCollection<ReplaceableBiome> biomes;
|
|
||||||
|
|
||||||
private final Predicate<Biome> hasTag;
|
|
||||||
|
|
||||||
public ReplaceExtrusion(NoiseSampler sampler, Range range, ProbabilityCollection<ReplaceableBiome> biomes, String tag) {
|
|
||||||
this.sampler = sampler;
|
|
||||||
this.range = range;
|
|
||||||
this.biomes = biomes;
|
|
||||||
this.hasTag = BiomeQueries.has(tag);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Biome extrude(Biome original, int x, int y, int z, long seed) {
|
|
||||||
if(hasTag.test(original)) {
|
|
||||||
return range.ifInRange(y, () -> biomes.get(sampler, x, y, z, seed).get(original), original);
|
|
||||||
}
|
|
||||||
return original;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Collection<Biome> getBiomes() {
|
|
||||||
return biomes
|
|
||||||
.getContents()
|
|
||||||
.stream()
|
|
||||||
.filter(Predicate.not(ReplaceableBiome::isSelf))
|
|
||||||
.map(ReplaceableBiome::get)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-45
@@ -1,45 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.extrusions;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.Extrusion;
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.ReplaceableBiome;
|
|
||||||
import com.dfsek.terra.api.noise.NoiseSampler;
|
|
||||||
import com.dfsek.terra.api.util.Range;
|
|
||||||
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets biomes at locations based on a sampler.
|
|
||||||
*/
|
|
||||||
public class SetExtrusion implements Extrusion {
|
|
||||||
private final NoiseSampler sampler;
|
|
||||||
|
|
||||||
private final Range range;
|
|
||||||
|
|
||||||
private final ProbabilityCollection<ReplaceableBiome> biomes;
|
|
||||||
|
|
||||||
public SetExtrusion(NoiseSampler sampler, Range range, ProbabilityCollection<ReplaceableBiome> biomes) {
|
|
||||||
this.sampler = sampler;
|
|
||||||
this.range = range;
|
|
||||||
this.biomes = biomes;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Biome extrude(Biome original, int x, int y, int z, long seed) {
|
|
||||||
return range.ifInRange(y, () -> biomes.get(sampler, x, y, z, seed).get(original), original);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Collection<Biome> getBiomes() {
|
|
||||||
return biomes
|
|
||||||
.getContents()
|
|
||||||
.stream()
|
|
||||||
.filter(Predicate.not(ReplaceableBiome::isSelf))
|
|
||||||
.map(ReplaceableBiome::get)
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
schema-version: 1
|
|
||||||
contributors:
|
|
||||||
- Terra contributors
|
|
||||||
id: biome-provider-extrusion
|
|
||||||
version: @VERSION@
|
|
||||||
entrypoints:
|
|
||||||
- "com.dfsek.terra.addons.biome.extrusion.BiomeExtrusionAddon"
|
|
||||||
website:
|
|
||||||
issues: https://github.com/PolyhedralDev/Terra/issues
|
|
||||||
source: https://github.com/PolyhedralDev/Terra
|
|
||||||
docs: https://terra.polydev.org
|
|
||||||
license: MIT License
|
|
||||||
depends:
|
|
||||||
biome-query-api: "1.+"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# biome-provider-image-v2
|
|
||||||
|
|
||||||
Implements and registers the `IMAGE` biome provider, which
|
|
||||||
utilizes various config types provided by the `library-image` addon to
|
|
||||||
distribute biomes based on images.
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
version = version("1.0.1")
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
|
||||||
compileOnlyApi(project(":common:addons:library-image"))
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
-51
@@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
*
|
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
|
||||||
* reference the LICENSE file in this module's root directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.dfsek.terra.addons.biome.image.v2;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.image.colorsampler.ColorSampler;
|
|
||||||
import com.dfsek.terra.addons.image.converter.ColorConverter;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class ImageBiomeProvider implements BiomeProvider {
|
|
||||||
private final int resolution;
|
|
||||||
|
|
||||||
private final ColorConverter<Biome> colorConverter;
|
|
||||||
|
|
||||||
private final ColorSampler colorSampler;
|
|
||||||
|
|
||||||
public ImageBiomeProvider(ColorConverter<Biome> colorConverter, ColorSampler colorSampler, int resolution) {
|
|
||||||
this.resolution = resolution;
|
|
||||||
this.colorConverter = colorConverter;
|
|
||||||
this.colorSampler = colorSampler;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Biome getBiome(int x, int y, int z, long seed) {
|
|
||||||
return getBiome(x, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Biome getBiome(int x, int z) {
|
|
||||||
x /= resolution;
|
|
||||||
z /= resolution;
|
|
||||||
return colorConverter.apply(colorSampler.apply(x, z));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<Biome> getBaseBiome(int x, int z, long seed) {
|
|
||||||
return Optional.of(getBiome(x, z));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterable<Biome> getBiomes() {
|
|
||||||
return colorConverter.getEntries();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-78
@@ -1,78 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
*
|
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
|
||||||
* reference the LICENSE file in this module's root directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.dfsek.terra.addons.biome.image.v2;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.image.v2.config.ImageProviderTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.image.v2.config.converter.ClosestBiomeColorConverterTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.image.v2.config.converter.ExactBiomeColorConverterTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.image.v2.config.converter.mapping.DefinedBiomeColorMappingTemplate;
|
|
||||||
import com.dfsek.terra.addons.image.converter.ColorConverter;
|
|
||||||
import com.dfsek.terra.addons.image.converter.mapping.BiomeDefinedColorMapping;
|
|
||||||
import com.dfsek.terra.addons.image.converter.mapping.ColorMapping;
|
|
||||||
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
|
|
||||||
import com.dfsek.terra.api.Platform;
|
|
||||||
import com.dfsek.terra.api.addon.BaseAddon;
|
|
||||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
|
||||||
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
|
|
||||||
import com.dfsek.terra.api.inject.annotations.Inject;
|
|
||||||
import com.dfsek.terra.api.registry.CheckedRegistry;
|
|
||||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class ImageBiomeProviderAddon implements AddonInitializer {
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<BiomeProvider>>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
|
|
||||||
};
|
|
||||||
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<ColorConverter<Biome>>>> BIOME_COLOR_CONVERTER_REGISTRY_KEY = new TypeKey<>() {
|
|
||||||
};
|
|
||||||
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<ColorMapping<Biome>>>> BIOME_COLOR_MAPPING_REGISTRY_KEY = new TypeKey<>() {
|
|
||||||
};
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private Platform platform;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private BaseAddon addon;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize() {
|
|
||||||
platform.getEventManager()
|
|
||||||
.getHandler(FunctionalEventHandler.class)
|
|
||||||
.register(addon, ConfigPackPreLoadEvent.class)
|
|
||||||
.priority(501)
|
|
||||||
.then(event -> {
|
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
|
|
||||||
PROVIDER_REGISTRY_KEY);
|
|
||||||
providerRegistry.register(addon.key("IMAGE"), ImageProviderTemplate::new);
|
|
||||||
})
|
|
||||||
.then(event -> {
|
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<ColorConverter<Biome>>>> biomeColorConverterRegistry =
|
|
||||||
event.getPack().getOrCreateRegistry(
|
|
||||||
BIOME_COLOR_CONVERTER_REGISTRY_KEY);
|
|
||||||
biomeColorConverterRegistry.register(addon.key("EXACT"), ExactBiomeColorConverterTemplate::new);
|
|
||||||
biomeColorConverterRegistry.register(addon.key("CLOSEST"), ClosestBiomeColorConverterTemplate::new);
|
|
||||||
})
|
|
||||||
.then(event -> {
|
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<ColorMapping<Biome>>>> biomeColorMappingRegistry =
|
|
||||||
event.getPack().getOrCreateRegistry(
|
|
||||||
BIOME_COLOR_MAPPING_REGISTRY_KEY);
|
|
||||||
biomeColorMappingRegistry.register(addon.key("USE_BIOME_COLORS"),
|
|
||||||
() -> () -> new BiomeDefinedColorMapping<>(event.getPack().getRegistry(Biome.class),
|
|
||||||
b -> b));
|
|
||||||
biomeColorMappingRegistry.register(addon.key("MAP"), DefinedBiomeColorMappingTemplate::new);
|
|
||||||
})
|
|
||||||
.failThrough();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-40
@@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
*
|
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
|
||||||
* reference the LICENSE file in this module's root directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.dfsek.terra.addons.biome.image.v2.config;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Default;
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Description;
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.image.v2.ImageBiomeProvider;
|
|
||||||
import com.dfsek.terra.addons.image.colorsampler.ColorSampler;
|
|
||||||
import com.dfsek.terra.addons.image.converter.ColorConverter;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("FieldMayBeFinal")
|
|
||||||
public class ImageProviderTemplate implements ObjectTemplate<BiomeProvider> {
|
|
||||||
|
|
||||||
@Value("resolution")
|
|
||||||
@Default
|
|
||||||
@Description("Sets the resolution at which to sample the image.")
|
|
||||||
private int resolution = 1;
|
|
||||||
|
|
||||||
@Value("color-sampler")
|
|
||||||
private ColorSampler colorSampler;
|
|
||||||
|
|
||||||
@Value("color-conversion")
|
|
||||||
private ColorConverter<Biome> colorConverter;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BiomeProvider get() {
|
|
||||||
return new ImageBiomeProvider(colorConverter, colorSampler, resolution);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.image.v2.config.converter;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.image.config.converter.ClosestColorConverterTemplate;
|
|
||||||
import com.dfsek.terra.addons.image.converter.mapping.ColorMapping;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
|
|
||||||
|
|
||||||
public class ClosestBiomeColorConverterTemplate extends ClosestColorConverterTemplate<Biome> {
|
|
||||||
|
|
||||||
@Value("match")
|
|
||||||
private ColorMapping<Biome> match;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected ColorMapping<Biome> getMapping() {
|
|
||||||
return match;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-37
@@ -1,37 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.image.v2.config.converter;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Default;
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.image.config.converter.ExactColorConverterTemplate;
|
|
||||||
import com.dfsek.terra.addons.image.converter.mapping.ColorMapping;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
|
|
||||||
|
|
||||||
public class ExactBiomeColorConverterTemplate extends ExactColorConverterTemplate<Biome> {
|
|
||||||
|
|
||||||
@Value("match")
|
|
||||||
private ColorMapping<Biome> match;
|
|
||||||
|
|
||||||
@Value("else")
|
|
||||||
private Biome fallback;
|
|
||||||
|
|
||||||
@Value("ignore-alpha")
|
|
||||||
@Default
|
|
||||||
private boolean ignoreAlpha = true;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected ColorMapping<Biome> getMapping() {
|
|
||||||
return match;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Biome getFallback() {
|
|
||||||
return fallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean ignoreAlpha() {
|
|
||||||
return ignoreAlpha;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-24
@@ -1,24 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.image.v2.config.converter.mapping;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.image.config.ColorLoader.ColorString;
|
|
||||||
import com.dfsek.terra.addons.image.converter.mapping.ColorMapping;
|
|
||||||
import com.dfsek.terra.addons.image.util.MapUtil;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
|
|
||||||
|
|
||||||
public class DefinedBiomeColorMappingTemplate implements ObjectTemplate<ColorMapping<Biome>> {
|
|
||||||
|
|
||||||
@Value("map")
|
|
||||||
Map<ColorString, Biome> map;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ColorMapping<Biome> get() {
|
|
||||||
var map = MapUtil.mapKeys(this.map, ColorString::getColor);
|
|
||||||
return () -> map;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
schema-version: 1
|
|
||||||
contributors:
|
|
||||||
- Terra contributors
|
|
||||||
id: biome-provider-image-v2
|
|
||||||
version: @VERSION@
|
|
||||||
entrypoints:
|
|
||||||
- "com.dfsek.terra.addons.biome.image.v2.ImageBiomeProviderAddon"
|
|
||||||
website:
|
|
||||||
issues: https://github.com/PolyhedralDev/Terra/issues
|
|
||||||
source: https://github.com/PolyhedralDev/Terra
|
|
||||||
docs: https://terra.polydev.org
|
|
||||||
license: MIT License
|
|
||||||
depends:
|
|
||||||
library-image: "1.+"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# biome-provider-image
|
# biome-provider-image
|
||||||
|
|
||||||
Implements and registers the `IMAGE` biome provider, a biome provider which
|
Implements and registers the `IMAGE` biome provider, a biome provider which generates
|
||||||
generates biomes from an image, using the `color` attribute of biomes.
|
biomes from an image, using the `color` attribute of biomes.
|
||||||
|
|
||||||
This addon registers the provider type, and all associated config options.
|
This addon registers the provider type, and all associated config options.
|
||||||
@@ -1,7 +1,2 @@
|
|||||||
version = version("1.0.1")
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-44
@@ -1,30 +1,22 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
*
|
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
|
||||||
* reference the LICENSE file in this module's root directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.dfsek.terra.addons.biome.image;
|
package com.dfsek.terra.addons.biome.image;
|
||||||
|
|
||||||
import java.awt.Color;
|
import com.dfsek.terra.api.world.biome.TerraBiome;
|
||||||
|
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||||
|
import net.jafama.FastMath;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class ImageBiomeProvider implements BiomeProvider {
|
public class ImageBiomeProvider implements BiomeProvider {
|
||||||
private final Map<Color, Biome> colorBiomeMap = new HashMap<>();
|
private final Map<Color, TerraBiome> colorBiomeMap = new HashMap<>();
|
||||||
private final BufferedImage image;
|
private final BufferedImage image;
|
||||||
private final int resolution;
|
private final int resolution;
|
||||||
private final Align align;
|
private final Align align;
|
||||||
|
|
||||||
public ImageBiomeProvider(Set<Biome> registry, BufferedImage image, int resolution, Align align) {
|
public ImageBiomeProvider(Set<TerraBiome> registry, BufferedImage image, int resolution, Align align) {
|
||||||
this.image = image;
|
this.image = image;
|
||||||
this.resolution = resolution;
|
this.resolution = resolution;
|
||||||
this.align = align;
|
this.align = align;
|
||||||
@@ -32,50 +24,31 @@ public class ImageBiomeProvider implements BiomeProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static int distance(Color a, Color b) {
|
private static int distance(Color a, Color b) {
|
||||||
return Math.abs(a.getRed() - b.getRed()) + Math.abs(a.getGreen() - b.getGreen()) + Math.abs(a.getBlue() - b.getBlue());
|
return FastMath.abs(a.getRed() - b.getRed()) + FastMath.abs(a.getGreen() - b.getGreen()) + FastMath.abs(a.getBlue() - b.getBlue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Biome getBiome(int x, int y, int z, long seed) {
|
public TerraBiome getBiome(int x, int z, long seed) {
|
||||||
return getBiome(x, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Biome getBiome(int x, int z) {
|
|
||||||
x /= resolution;
|
x /= resolution;
|
||||||
z /= resolution;
|
z /= resolution;
|
||||||
Color color = align.getColor(image, x, z);
|
Color color = align.getColor(image, x, z);
|
||||||
return colorBiomeMap.get(colorBiomeMap.keySet()
|
return colorBiomeMap.get(colorBiomeMap.keySet().stream().reduce(colorBiomeMap.keySet().stream().findAny().orElseThrow(IllegalStateException::new), (running, element) -> {
|
||||||
.stream()
|
int d1 = distance(color, running);
|
||||||
.reduce(colorBiomeMap.keySet().stream().findAny().orElseThrow(IllegalStateException::new),
|
int d2 = distance(color, element);
|
||||||
(running, element) -> {
|
return d1 < d2 ? running : element;
|
||||||
int d1 = distance(color, running);
|
}));
|
||||||
int d2 = distance(color, element);
|
|
||||||
return d1 < d2 ? running : element;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<Biome> getBaseBiome(int x, int z, long seed) {
|
|
||||||
return Optional.of(getBiome(x, z));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterable<Biome> getBiomes() {
|
|
||||||
return colorBiomeMap.values();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Align {
|
public enum Align {
|
||||||
CENTER {
|
CENTER {
|
||||||
@Override
|
@Override
|
||||||
public Color getColor(BufferedImage image, int x, int z) {
|
public Color getColor(BufferedImage image, int x, int z) {
|
||||||
return new Color(image.getRGB(Math.floorMod(x - image.getWidth() / 2, image.getWidth()),
|
return new Color(image.getRGB(FastMath.floorMod(x - image.getWidth() / 2, image.getWidth()), FastMath.floorMod(z - image.getHeight() / 2, image.getHeight())));
|
||||||
Math.floorMod(z - image.getHeight() / 2, image.getHeight())));
|
|
||||||
}
|
}
|
||||||
},
|
}, NONE {
|
||||||
NONE {
|
|
||||||
@Override
|
@Override
|
||||||
public Color getColor(BufferedImage image, int x, int z) {
|
public Color getColor(BufferedImage image, int x, int z) {
|
||||||
return new Color(image.getRGB(Math.floorMod(x, image.getWidth()), Math.floorMod(z, image.getHeight())));
|
return new Color(image.getRGB(FastMath.floorMod(x, image.getWidth()), FastMath.floorMod(z, image.getHeight())));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+26
-42
@@ -1,56 +1,40 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
*
|
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
|
||||||
* reference the LICENSE file in this module's root directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.dfsek.terra.addons.biome.image;
|
package com.dfsek.terra.addons.biome.image;
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
import com.dfsek.tectonic.loading.object.ObjectTemplate;
|
||||||
import org.slf4j.Logger;
|
import com.dfsek.terra.api.TerraPlugin;
|
||||||
import org.slf4j.LoggerFactory;
|
import com.dfsek.terra.api.addon.TerraAddon;
|
||||||
|
import com.dfsek.terra.api.addon.annotations.Addon;
|
||||||
|
import com.dfsek.terra.api.addon.annotations.Author;
|
||||||
|
import com.dfsek.terra.api.addon.annotations.Version;
|
||||||
|
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
||||||
|
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
|
||||||
|
import com.dfsek.terra.api.injection.annotations.Inject;
|
||||||
|
import com.dfsek.terra.api.registry.CheckedRegistry;
|
||||||
|
import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||||
|
import com.dfsek.terra.api.world.biome.TerraBiome;
|
||||||
|
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
|
@Addon("biome-provider-image")
|
||||||
import com.dfsek.terra.api.Platform;
|
@Author("Terra")
|
||||||
import com.dfsek.terra.api.addon.BaseAddon;
|
@Version("1.0.0")
|
||||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
public class ImageBiomeProviderAddon extends TerraAddon {
|
||||||
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
|
|
||||||
import com.dfsek.terra.api.inject.annotations.Inject;
|
|
||||||
import com.dfsek.terra.api.registry.CheckedRegistry;
|
|
||||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class ImageBiomeProviderAddon implements AddonInitializer {
|
|
||||||
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<BiomeProvider>>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
|
public static final TypeKey<Supplier<ObjectTemplate<BiomeProvider>>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
|
||||||
};
|
};
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ImageBiomeProviderAddon.class);
|
|
||||||
@Inject
|
|
||||||
private Platform platform;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private BaseAddon addon;
|
private TerraPlugin main;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
platform.getEventManager()
|
main.getEventManager()
|
||||||
.getHandler(FunctionalEventHandler.class)
|
.getHandler(FunctionalEventHandler.class)
|
||||||
.register(addon, ConfigPackPreLoadEvent.class)
|
.register(this, ConfigPackPreLoadEvent.class)
|
||||||
.then(event -> {
|
.then(event -> {
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
|
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(PROVIDER_REGISTRY_KEY);
|
||||||
PROVIDER_REGISTRY_KEY);
|
providerRegistry.register("IMAGE", () -> new ImageProviderTemplate(event.getPack().getRegistry(TerraBiome.class)));
|
||||||
providerRegistry.register(addon.key("IMAGE"),
|
})
|
||||||
() -> new ImageProviderTemplate(event.getPack().getRegistry(Biome.class)));
|
.failThrough();
|
||||||
})
|
|
||||||
.failThrough();
|
|
||||||
if(platform.getTerraConfig().isDebugLog())
|
|
||||||
logger.warn(
|
|
||||||
"The biome-provider-image addon is deprecated and scheduled for removal in Terra 7.0. It is recommended to use the " +
|
|
||||||
"biome-provider-image-v2 addon for future pack development instead.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-25
@@ -1,40 +1,28 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
*
|
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
|
||||||
* reference the LICENSE file in this module's root directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.dfsek.terra.addons.biome.image;
|
package com.dfsek.terra.addons.biome.image;
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Default;
|
import com.dfsek.tectonic.annotations.Default;
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Description;
|
import com.dfsek.tectonic.annotations.Value;
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
import com.dfsek.tectonic.loading.object.ObjectTemplate;
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
import com.dfsek.terra.api.registry.Registry;
|
||||||
|
import com.dfsek.terra.api.world.biome.TerraBiome;
|
||||||
|
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import com.dfsek.terra.api.registry.Registry;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("FieldMayBeFinal")
|
|
||||||
public class ImageProviderTemplate implements ObjectTemplate<BiomeProvider> {
|
public class ImageProviderTemplate implements ObjectTemplate<BiomeProvider> {
|
||||||
private final Registry<Biome> biomes;
|
private final Registry<TerraBiome> biomes;
|
||||||
@Value("resolution")
|
|
||||||
@Default
|
|
||||||
@Description("Sets the resolution at which to sample the image.")
|
|
||||||
private int resolution = 1;
|
|
||||||
@Value("image.name")
|
@Value("image.name")
|
||||||
@Description("Sets the location of the image on the filesystem, relative to the pack root.")
|
|
||||||
private BufferedImage image;
|
private BufferedImage image;
|
||||||
|
|
||||||
@Value("image.align")
|
@Value("image.align")
|
||||||
@Description("Sets the alignment style to use for the image.")
|
|
||||||
private ImageBiomeProvider.Align align;
|
private ImageBiomeProvider.Align align;
|
||||||
|
|
||||||
public ImageProviderTemplate(Registry<Biome> set) {
|
@Value("resolution")
|
||||||
|
@Default
|
||||||
|
private int resolution = 1;
|
||||||
|
|
||||||
|
public ImageProviderTemplate(Registry<TerraBiome> set) {
|
||||||
this.biomes = set;
|
this.biomes = set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
schema-version: 1
|
|
||||||
contributors:
|
|
||||||
- Terra contributors
|
|
||||||
id: biome-provider-image
|
|
||||||
version: @VERSION@
|
|
||||||
entrypoints:
|
|
||||||
- "com.dfsek.terra.addons.biome.image.ImageBiomeProviderAddon"
|
|
||||||
website:
|
|
||||||
issues: https://github.com/PolyhedralDev/Terra/issues
|
|
||||||
source: https://github.com/PolyhedralDev/Terra
|
|
||||||
docs: https://terra.polydev.org
|
|
||||||
license: MIT License
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# biome-provider-pipeline-2
|
|
||||||
|
|
||||||
The second version of the Biome Pipeline, a procedural biome provider that uses a series
|
|
||||||
of "stages" to apply "mutations" to a 2D grid of biomes.
|
|
||||||
|
|
||||||
Version 2 is a re-implementation of the original addon with the primary goal of providing
|
|
||||||
consistent scaling for noise relative to the world
|
|
||||||
(See https://github.com/PolyhedralDev/Terra/issues/264 for more details), and has been
|
|
||||||
included as a separate addon to maintain parity with packs utilizing the first version.
|
|
||||||
|
|
||||||
This addon registers the `PIPELINE` biome provider type, and all associated
|
|
||||||
configurations.
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
version = version("1.0.1")
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
|
||||||
}
|
|
||||||
-89
@@ -1,89 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020-2025 Polyhedral Development
|
|
||||||
*
|
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
|
||||||
* reference the LICENSE file in this module's root directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.dfsek.terra.addons.biome.pipeline.v2;
|
|
||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Source;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.BiomePipelineTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.PipelineBiomeLoader;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.source.SamplerSourceTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.expander.ExpanderStageTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator.BorderListStageTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator.BorderStageTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator.ReplaceListStageTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator.ReplaceStageTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator.SmoothStageTemplate;
|
|
||||||
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
|
|
||||||
import com.dfsek.terra.api.Platform;
|
|
||||||
import com.dfsek.terra.api.addon.BaseAddon;
|
|
||||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPostLoadEvent;
|
|
||||||
import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
|
|
||||||
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
|
|
||||||
import com.dfsek.terra.api.inject.annotations.Inject;
|
|
||||||
import com.dfsek.terra.api.registry.CheckedRegistry;
|
|
||||||
import com.dfsek.terra.api.registry.Registry;
|
|
||||||
import com.dfsek.terra.api.util.reflection.TypeKey;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class BiomePipelineAddon implements AddonInitializer {
|
|
||||||
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<Source>>> SOURCE_REGISTRY_KEY = new TypeKey<>() {
|
|
||||||
};
|
|
||||||
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<Stage>>> STAGE_REGISTRY_KEY = new TypeKey<>() {
|
|
||||||
};
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<BiomeProvider>>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
|
|
||||||
};
|
|
||||||
@Inject
|
|
||||||
private Platform platform;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private BaseAddon addon;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initialize() {
|
|
||||||
platform.getEventManager()
|
|
||||||
.getHandler(FunctionalEventHandler.class)
|
|
||||||
.register(addon, ConfigPackPreLoadEvent.class)
|
|
||||||
.then(event -> {
|
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
|
|
||||||
PROVIDER_REGISTRY_KEY);
|
|
||||||
providerRegistry.register(addon.key("PIPELINE"), BiomePipelineTemplate::new);
|
|
||||||
})
|
|
||||||
.then(event -> {
|
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<Source>>> sourceRegistry = event.getPack().getOrCreateRegistry(
|
|
||||||
SOURCE_REGISTRY_KEY);
|
|
||||||
sourceRegistry.register(addon.key("SAMPLER"), SamplerSourceTemplate::new);
|
|
||||||
})
|
|
||||||
.then(event -> {
|
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<Stage>>> stageRegistry = event.getPack().getOrCreateRegistry(
|
|
||||||
STAGE_REGISTRY_KEY);
|
|
||||||
stageRegistry.register(addon.key("FRACTAL_EXPAND"), ExpanderStageTemplate::new);
|
|
||||||
stageRegistry.register(addon.key("SMOOTH"), SmoothStageTemplate::new);
|
|
||||||
stageRegistry.register(addon.key("REPLACE"), ReplaceStageTemplate::new);
|
|
||||||
stageRegistry.register(addon.key("REPLACE_LIST"), ReplaceListStageTemplate::new);
|
|
||||||
stageRegistry.register(addon.key("BORDER"), BorderStageTemplate::new);
|
|
||||||
stageRegistry.register(addon.key("BORDER_LIST"), BorderListStageTemplate::new);
|
|
||||||
})
|
|
||||||
.failThrough();
|
|
||||||
platform.getEventManager()
|
|
||||||
.getHandler(FunctionalEventHandler.class)
|
|
||||||
.register(addon, ConfigPackPostLoadEvent.class)
|
|
||||||
.then(event -> {
|
|
||||||
Registry<Biome> biomeRegistry = event.getPack().getRegistry(Biome.class);
|
|
||||||
event.getPack().applyLoader(PipelineBiome.class, new PipelineBiomeLoader(biomeRegistry));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-71
@@ -1,71 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2;
|
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.util.Column;
|
|
||||||
import com.dfsek.terra.api.util.function.IntIntObjConsumer;
|
|
||||||
import com.dfsek.terra.api.util.function.IntObjConsumer;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class BiomePipelineColumn implements Column<Biome> {
|
|
||||||
private final int min;
|
|
||||||
private final int max;
|
|
||||||
|
|
||||||
private final int x;
|
|
||||||
private final int z;
|
|
||||||
private final Biome biome;
|
|
||||||
|
|
||||||
protected BiomePipelineColumn(BiomeProvider biomeProvider, int min, int max, int x, int z, long seed) {
|
|
||||||
this.min = min;
|
|
||||||
this.max = max;
|
|
||||||
this.x = x;
|
|
||||||
this.z = z;
|
|
||||||
this.biome = biomeProvider.getBiome(x, 0, z, seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMinY() {
|
|
||||||
return min;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxY() {
|
|
||||||
return max;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getX() {
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getZ() {
|
|
||||||
return z;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Biome get(int y) {
|
|
||||||
return biome;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void forRanges(int resolution, IntIntObjConsumer<Biome> consumer) {
|
|
||||||
consumer.accept(min, max, biome);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void forEach(Consumer<Biome> consumer) {
|
|
||||||
for(int y = min; y < max; y++) {
|
|
||||||
consumer.accept(biome);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void forEach(IntObjConsumer<Biome> consumer) {
|
|
||||||
for(int y = min; y < max; y++) {
|
|
||||||
consumer.accept(y, biome);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-116
@@ -1,116 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.util.cache.SeededVector2Key;
|
|
||||||
|
|
||||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
|
||||||
import com.github.benmanes.caffeine.cache.LoadingCache;
|
|
||||||
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.StreamSupport;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.BiomeChunk;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Pipeline;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
|
||||||
import com.dfsek.terra.api.noise.NoiseSampler;
|
|
||||||
import com.dfsek.terra.api.registry.key.StringIdentifiable;
|
|
||||||
import com.dfsek.terra.api.util.Column;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
|
|
||||||
|
|
||||||
public class PipelineBiomeProvider implements BiomeProvider {
|
|
||||||
|
|
||||||
private final LoadingCache<SeededVector2Key, BiomeChunk> biomeChunkCache;
|
|
||||||
private final int chunkSize;
|
|
||||||
private final int resolution;
|
|
||||||
private final NoiseSampler mutator;
|
|
||||||
private final double noiseAmp;
|
|
||||||
private final Set<Biome> biomes;
|
|
||||||
|
|
||||||
public PipelineBiomeProvider(Pipeline pipeline, int resolution, NoiseSampler mutator, double noiseAmp) {
|
|
||||||
this.resolution = resolution;
|
|
||||||
this.mutator = mutator;
|
|
||||||
this.noiseAmp = noiseAmp;
|
|
||||||
this.chunkSize = pipeline.getChunkSize();
|
|
||||||
this.biomeChunkCache = Caffeine.newBuilder()
|
|
||||||
.maximumSize(64)
|
|
||||||
.build(pipeline::generateChunk);
|
|
||||||
|
|
||||||
Set<PipelineBiome> biomeSet = new HashSet<>();
|
|
||||||
pipeline.getSource().getBiomes().forEach(biomeSet::add);
|
|
||||||
Iterable<PipelineBiome> result = biomeSet;
|
|
||||||
for(Stage stage : pipeline.getStages()) {
|
|
||||||
result = stage.getBiomes(result);
|
|
||||||
}
|
|
||||||
this.biomes = new HashSet<>();
|
|
||||||
Iterable<PipelineBiome> finalResult = result;
|
|
||||||
result.forEach(pipelineBiome -> {
|
|
||||||
if(pipelineBiome.isPlaceholder()) {
|
|
||||||
|
|
||||||
StringBuilder biomeList = new StringBuilder("\n");
|
|
||||||
StreamSupport.stream(finalResult.spliterator(), false)
|
|
||||||
.sorted(Comparator.comparing(StringIdentifiable::getID))
|
|
||||||
.forEach(delegate -> biomeList
|
|
||||||
.append(" - ")
|
|
||||||
.append(delegate.getID())
|
|
||||||
.append(':')
|
|
||||||
.append(delegate.getClass().getCanonicalName())
|
|
||||||
.append('\n'));
|
|
||||||
throw new IllegalArgumentException("Biome Pipeline leaks placeholder biome \"" + pipelineBiome.getID() +
|
|
||||||
"\". Ensure there is a stage to guarantee replacement of the placeholder biome. " +
|
|
||||||
"Biomes: " +
|
|
||||||
biomeList);
|
|
||||||
}
|
|
||||||
this.biomes.add(pipelineBiome.getBiome());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Biome getBiome(int x, int y, int z, long seed) {
|
|
||||||
return getBiome(x, z, seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Biome getBiome(int x, int z, long seed) {
|
|
||||||
|
|
||||||
x += mutator.noise(seed + 1, x, z) * noiseAmp;
|
|
||||||
z += mutator.noise(seed + 2, x, z) * noiseAmp;
|
|
||||||
|
|
||||||
x /= resolution;
|
|
||||||
z /= resolution;
|
|
||||||
|
|
||||||
int chunkX = Math.floorDiv(x, chunkSize);
|
|
||||||
int chunkZ = Math.floorDiv(z, chunkSize);
|
|
||||||
|
|
||||||
int chunkWorldX = chunkX * chunkSize;
|
|
||||||
int chunkWorldZ = chunkZ * chunkSize;
|
|
||||||
|
|
||||||
int xInChunk = x - chunkWorldX;
|
|
||||||
int zInChunk = z - chunkWorldZ;
|
|
||||||
|
|
||||||
return biomeChunkCache.get(new SeededVector2Key(chunkWorldX, chunkWorldZ, seed)).get(xInChunk, zInChunk).getBiome();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterable<Biome> getBiomes() {
|
|
||||||
return biomes;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<Biome> getBaseBiome(int x, int z, long seed) {
|
|
||||||
return Optional.of(getBiome(x, z, seed));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Column<Biome> getColumn(int x, int z, long seed, int min, int max) {
|
|
||||||
return new BiomePipelineColumn(this, min, max, x, z, seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int resolution() {
|
|
||||||
return resolution;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-10
@@ -1,10 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
|
||||||
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
|
||||||
|
|
||||||
|
|
||||||
public interface BiomeChunk {
|
|
||||||
|
|
||||||
PipelineBiome get(int xInChunk, int zInChunk);
|
|
||||||
}
|
|
||||||
-29
@@ -1,29 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.pipeline.BiomeChunkImpl.ViewPoint;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resizes the internal grid of a BiomeChunk when applied, serves the purpose of
|
|
||||||
* filling in null biomes as a result of this resizing.
|
|
||||||
*/
|
|
||||||
public interface Expander extends Stage {
|
|
||||||
|
|
||||||
PipelineBiome fillBiome(ViewPoint viewPoint);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
default int maxRelativeReadDistance() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
default PipelineBiome apply(ViewPoint viewPoint) {
|
|
||||||
PipelineBiome currentBiome = viewPoint.getBiome();
|
|
||||||
if(currentBiome == null) {
|
|
||||||
return fillBiome(viewPoint);
|
|
||||||
} else {
|
|
||||||
return currentBiome;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-16
@@ -1,16 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.util.cache.SeededVector2Key;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public interface Pipeline {
|
|
||||||
BiomeChunk generateChunk(SeededVector2Key worldCoordinates);
|
|
||||||
|
|
||||||
int getChunkSize();
|
|
||||||
|
|
||||||
Source getSource();
|
|
||||||
|
|
||||||
List<Stage> getStages();
|
|
||||||
}
|
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
|
||||||
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
|
||||||
|
|
||||||
|
|
||||||
public interface Source {
|
|
||||||
PipelineBiome get(long seed, int x, int z);
|
|
||||||
|
|
||||||
Iterable<PipelineBiome> getBiomes();
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user