mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-13 12:21:05 +00:00
Compare commits
490 Commits
dev/folia
...
deps/cloud
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b62473372 | |||
| 9f546370cd | |||
| 428bf341ef | |||
| 8a61571ceb | |||
| b669f87b79 | |||
| e507675ef6 | |||
| 3322a16f09 | |||
| c658d1a81b | |||
| 56a7234494 | |||
| 217b708177 | |||
| 7d86a41f65 | |||
| 753574fc9b | |||
| 95f89ed2b6 | |||
| cb8aefe8d2 | |||
| 79f9488380 | |||
| 4c2ce65cdc | |||
| 70c448dd0d | |||
| 060bda2ec1 | |||
| 6b60246694 | |||
| 1a1f461550 | |||
| da20e282ce | |||
| 9b14b0ee96 | |||
| 118aeb872f | |||
| 5446b729f9 | |||
| d71c6bb25f | |||
| d8524603c6 | |||
| 85234ddc39 | |||
| 78162eaafe | |||
| 7a041d8a63 | |||
| 8cfa2e1467 | |||
| 5f367c0f2c | |||
| f4db7fc507 | |||
| ad9d16f48c | |||
| 85b6dcc891 | |||
| 29691dfb4d | |||
| 81eab13ce1 | |||
| 68d5b22ca4 | |||
| 40b8c85c75 | |||
| 63367e5f03 | |||
| 1d95e7a87d | |||
| b2e21d8b70 | |||
| 4041239b03 | |||
| 280699bbce | |||
| 6984dc29d0 | |||
| bd253ea5d2 | |||
| d743d7d1df | |||
| 238a7954a7 | |||
| c2319ca4ab | |||
| 95172bfa7e | |||
| 124dbc8836 | |||
| 8706340584 | |||
| 9a9f90aa0d | |||
| 20a5bfdd0f | |||
| 4fee8cdb24 | |||
| 70de38ffcb | |||
| 6722d22f72 | |||
| c5526c86a2 | |||
| 84fa72f96c | |||
| cc5258ce73 | |||
| 748e027282 | |||
| bf6612edd0 | |||
| d90a4200fe | |||
| af9fb211a8 | |||
| e4395cec83 | |||
| bab8923f1e | |||
| b4068e6c59 | |||
| b143c72d0e | |||
| 5f5e70970b | |||
| ec812ef5fb | |||
| 85826071cb | |||
| c4f093210a | |||
| f14d22b264 | |||
| 016961c19c | |||
| 9f3e225b62 | |||
| c95df25d30 | |||
| 0adca3c227 | |||
| 782b300d1f | |||
| 967a4a0b2b | |||
| d3df5e56c3 | |||
| dabc2359b3 | |||
| 1d658bd52d | |||
| 4bef2f5a7f | |||
| 18cb08b622 | |||
| 1b15694878 | |||
| 267994427e | |||
| 248eb174d8 | |||
| 0a93b0fac3 | |||
| 03124cb008 | |||
| 14a07602ee | |||
| 167a712c0e | |||
| 83bc2c9022 | |||
| 06a60b3db4 | |||
| 1b4824c5db | |||
| 49c6e70037 | |||
| c36b12e657 | |||
| 9906771fbc | |||
| e0a26046a0 | |||
| 8bad33ef22 | |||
| f278ae7ab5 | |||
| a61c6b8a97 | |||
| 830ede9272 | |||
| 8e544a68d4 | |||
| e8e9f69fac | |||
| 3a7d1a69d0 | |||
| 7b29d25847 | |||
| 810d10ac0a | |||
| aecc003f23 | |||
| d0bc006faa | |||
| 98aadc816b | |||
| 992ae592fd | |||
| 7711e67999 | |||
| 35bdc99873 | |||
| 5ba5d6efdd | |||
| c848c33bc0 | |||
| ff153ddc21 | |||
| cb2841ed4f | |||
| 4f668adb67 | |||
| 1d8a208d10 | |||
| 6279638363 | |||
| 23b846eca9 | |||
| d1f881ca2c | |||
| b4ab3769b0 | |||
| d5ab3e23f5 | |||
| 3a28551e97 | |||
| ac66fc7d69 | |||
| bfc1c32d46 | |||
| fa6e0e0ae4 | |||
| f953c5085d | |||
| 7288373dbc | |||
| 983cb1f012 | |||
| 944c04b9b8 | |||
| 73a2c70794 | |||
| 088523222d | |||
| 6badce6bc7 | |||
| 92a5134458 | |||
| 4222eef531 | |||
| 9b6a503f31 | |||
| 82a9ecf736 | |||
| eec4db43b2 | |||
| 1d3c380784 | |||
| 65e4c9a149 | |||
| d4549643fc | |||
| a87ad8c966 | |||
| 153f6e5a87 | |||
| a385a43250 | |||
| 3cd6aead64 | |||
| 4f33b11828 | |||
| f5bbaa3c3a | |||
| 4fd84a3f2d | |||
| bed67c211d | |||
| 2c8d3416ab | |||
| 5e43f0afef | |||
| 02fdcee705 | |||
| 4165224c51 | |||
| 710bbc33c9 | |||
| 1929239015 | |||
| 3ca90808f0 | |||
| 9d91440997 | |||
| f98062d417 | |||
| 8df3a4dd02 | |||
| afd2c81b19 | |||
| 4432ae4867 | |||
| 16c951838b | |||
| 8de4f1198a | |||
| 144c932703 | |||
| e56b8856fa | |||
| 04f6d18198 | |||
| 640645b96b | |||
| a70738eda5 | |||
| 62756d2784 | |||
| 32f8907cb1 | |||
| b75e9c152e | |||
| c190485dbe | |||
| e756953828 | |||
| 071f9d39af | |||
| d2107fd258 | |||
| df3e623530 | |||
| f0d03d4538 | |||
| 84fe8792d6 | |||
| 67fc2ba4dc | |||
| 8d63c40e2f | |||
| b0bc37c34d | |||
| f2c5c15650 | |||
| f5de88215c | |||
| 8a6ad95947 | |||
| cc14c716bf | |||
| ece5213a87 | |||
| a01f700653 | |||
| 0ca7171bae | |||
| 6261f0849c | |||
| 4fc24f022f | |||
| 61ed302137 | |||
| 053ec39b7b | |||
| 0a952cff4c | |||
| 12faae8fd5 | |||
| 1496f2c929 | |||
| 40a938be19 | |||
| 4be2390294 | |||
| da16f65ea2 | |||
| 65d026a130 | |||
| d45256b2f7 | |||
| 16d8e8f29d | |||
| a58b2a5193 | |||
| 1e5a1e20c2 | |||
| 592788450c | |||
| 060cbfd0c4 | |||
| b9c2f4e63b | |||
| 87674aa0ba | |||
| 40ccf80c7f | |||
| 6946755e31 | |||
| 3b9962662e | |||
| 7ca61f82b2 | |||
| 6851999926 | |||
| 585967157d | |||
| 305255511d | |||
| 819be16d83 | |||
| 8a028b193a | |||
| d31679e6be | |||
| 9d328b12b3 | |||
| a743e9c015 | |||
| 43d52e4bc1 | |||
| accc07fa07 | |||
| c1d3155ddd | |||
| 9a01a6c6a0 | |||
| 3033fbbf29 | |||
| c78a984a11 | |||
| 1ae0d1f867 | |||
| be7e10c30c | |||
| 2ccf8a8805 | |||
| 197cb12be2 | |||
| adb43dcaa8 | |||
| b03d128913 | |||
| 725fa88466 | |||
| 370b2e0122 | |||
| 331075e54d | |||
| 973590f5fd | |||
| 1a5ab6b505 | |||
| 14732328cd | |||
| 6c7974c302 | |||
| 1204b7a8c1 | |||
| fbe1c76e26 | |||
| add7803e65 | |||
| 4393a16b2f | |||
| b4fa635455 | |||
| 9f425c6159 | |||
| 158ffba2a5 | |||
| b7326c0ff6 | |||
| f70a83aec3 | |||
| 589cf83c38 | |||
| c374c2d5ef | |||
| 13782bb51e | |||
| 1aa3ef813c | |||
| 6cc53beecb | |||
| 2c45ba91aa | |||
| 6244ffca63 | |||
| 59d943b3ea | |||
| f605ee1937 | |||
| f87b7c07d9 | |||
| f1124aae6b | |||
| 9c8298fe53 | |||
| d69b0dba90 | |||
| 42166d5239 | |||
| d6772f51ea | |||
| f469193909 | |||
| 10d723372d | |||
| 1d05f95f74 | |||
| bd73427072 | |||
| 017b4608bc | |||
| 5f340f8ffd | |||
| 5b35eb041b | |||
| 699d5d1d62 | |||
| 07e3d0058d | |||
| b1ad820e1c | |||
| 3644ee7fca | |||
| b14b355c6f | |||
| 6042f1c036 | |||
| af2ac64cd4 | |||
| 06457bf3ce | |||
| b63f5f4a8f | |||
| 4bad8f702c | |||
| 76f12e0cb8 | |||
| 8cf766e77b | |||
| a23d624ab9 | |||
| 15a298304e | |||
| 664d1a3191 | |||
| 73047284c8 | |||
| ce9fb53df4 | |||
| 1f01b99d29 | |||
| 18a24562ec | |||
| 2f2d43e1b8 | |||
| 6c8a7da254 | |||
| ca4461ba2a | |||
| c6df3c302b | |||
| 328ebf5aa9 | |||
| 2c476a25d9 | |||
| b432a4e01d | |||
| f73eadda76 | |||
| 1acdad5c6b | |||
| 732a894945 | |||
| bbf0915bc9 | |||
| 5f70ecb943 | |||
| 2e709dace6 | |||
| 3bef7d8572 | |||
| 08df5fc278 | |||
| c97f25cb95 | |||
| 28c689d16f | |||
| a34946cece | |||
| 922cd35e84 | |||
| 4acd0de6fa | |||
| 44d23573b3 | |||
| 2443fff0a4 | |||
| cd767a648c | |||
| e7cc275340 | |||
| fddc9a52b9 | |||
| 0758e13bc7 | |||
| d490324bfc | |||
| 5fa7007d45 | |||
| 2d0e4a83b0 | |||
| e68f928e38 | |||
| 4a3678cea9 | |||
| d810cad8d0 | |||
| 4e7de501c0 | |||
| 6ff0903d83 | |||
| 133df45968 | |||
| 1f937a2ae0 | |||
| d861d3e849 | |||
| 3d4aec4abb | |||
| 62e589870d | |||
| 2b125414c9 | |||
| 59d7632927 | |||
| d81f886e8c | |||
| b29ba2db70 | |||
| 02a7363f01 | |||
| 9e60db4b0d | |||
| 4536767794 | |||
| 3fa4b21247 | |||
| 17acde09a3 | |||
| dd272bce64 | |||
| c20b1eaf10 | |||
| 72f761678a | |||
| 62317a2f3f | |||
| 823afd592b | |||
| ff03b38b81 | |||
| 35246d65b9 | |||
| 41652d29df | |||
| 142d364682 | |||
| 01e011a9ed | |||
| 94949c9120 | |||
| c52ad56ccc | |||
| f3476c5cc8 | |||
| 9c181f7ee1 | |||
| 271e7f3c69 | |||
| 6681bdfbf2 | |||
| ab60f14ff1 | |||
| d8ba9e1016 | |||
| 3622003a39 | |||
| 84cd96ecf7 | |||
| 8afda7424c | |||
| da4ab8b71c | |||
| 3745c3e947 | |||
| fd20837b55 | |||
| 0091e5b785 | |||
| 41045ae8aa | |||
| 4a83f01c1f | |||
| fc764a0fb3 | |||
| 22c46f2f80 | |||
| f408faaa80 | |||
| 0ad7ee4f9f | |||
| 1e55074cfa | |||
| 2a92d76276 | |||
| 687ad5db59 | |||
| f9c9789016 | |||
| 3142c2a4f0 | |||
| b5532b7679 | |||
| 8af299d09c | |||
| 5cf8a5061d | |||
| 017876475e | |||
| d88e4f1f9b | |||
| 17eac505a0 | |||
| 8043814138 | |||
| 554887ab54 | |||
| 2f46a01adc | |||
| a1db0574e9 | |||
| fd6decc706 | |||
| 0ba0d472e6 | |||
| 11b03eb93d | |||
| 46ca45cb1d | |||
| 4e5b066b91 | |||
| db8df9741f | |||
| 80c52870f5 | |||
| 5048bc8ede | |||
| fc0d7374e4 | |||
| e4c3affb9f | |||
| e160cae3d8 | |||
| cb9aa4f167 | |||
| b612d1c7aa | |||
| e4df8dce1d | |||
| 601d174720 | |||
| 3339d08e11 | |||
| bc65015af0 | |||
| 913637b0a5 | |||
| 86f2356cc8 | |||
| 55d09818f7 | |||
| aecdcd578c | |||
| 382069b094 | |||
| 734d4bfb94 | |||
| c82e015559 | |||
| ffb1198da2 | |||
| 2c211f0aa6 | |||
| 3aef977384 | |||
| 6060ceae57 | |||
| 0efb0916e6 | |||
| 82fbf796da | |||
| 94bf67d09d | |||
| e499ddebd4 | |||
| f86d4bae32 | |||
| c7cecaebe6 | |||
| 866d527d35 | |||
| 4f706f5502 | |||
| fe954a7b2b | |||
| 15e72bae35 | |||
| 513c2df9f9 | |||
| aec00d9169 | |||
| 540552d301 | |||
| 4dfe2054e9 | |||
| 16e61098d9 | |||
| 8aecf6b97f | |||
| 4788483139 | |||
| 9e8aefe7f7 | |||
| 272556ed81 | |||
| fd0c4df04c | |||
| 1c3ee86376 | |||
| defd775f13 | |||
| a73fda7d04 | |||
| b8586135b8 | |||
| 4065cfea53 | |||
| a117db40be | |||
| 72e0974cc5 | |||
| d8938c5519 | |||
| acf79f5c53 | |||
| 839bc23a5a | |||
| 852cf0321b | |||
| 89d497d500 | |||
| 0df940d688 | |||
| dd7bebb27f | |||
| 72649d5cf7 | |||
| 7cf87de463 | |||
| 020033f839 | |||
| b3ef4ac79c | |||
| 3f9f2bdce4 | |||
| 0ab463f34f | |||
| 0b1d67b533 | |||
| c4f665ffc5 | |||
| c00753b0fc | |||
| 77812545df | |||
| ad9bc7f67c | |||
| 81a96d6b76 | |||
| d696e4fd24 | |||
| c98d39c5d7 | |||
| a6fe268f79 | |||
| 648da95e7d | |||
| 5829112a74 | |||
| c41bf55b7b | |||
| 5d12a560f1 | |||
| 6f08908bb4 | |||
| 9292d3de17 | |||
| 0149a29b04 | |||
| cd8605850f | |||
| 148b8dfe35 | |||
| 3f485b1825 | |||
| cb6ecff113 | |||
| e30bcbf1ba | |||
| 805f99f57a | |||
| 4e5b02ef42 | |||
| e80e998cec | |||
| fde29220af | |||
| d3a9b57872 | |||
| 4671ec5bd3 | |||
| 4a537a56aa | |||
| 4917160123 | |||
| b3f80dcb64 | |||
| d71f7d4c36 | |||
| 84898a7a6b | |||
| 0c1a6efc72 | |||
| 200281f140 | |||
| f1ea8074de | |||
| 70b1c3bbf3 | |||
| e9b145b6c3 | |||
| 99d848b394 | |||
| 4828d51da4 |
+7
-7
@@ -8,7 +8,7 @@ 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 = 8
|
ij_continuation_indent_size = 4
|
||||||
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
|
||||||
@@ -25,12 +25,12 @@ ij_java_align_multiline_annotation_parameters = true
|
|||||||
ij_java_align_multiline_array_initializer_expression = true
|
ij_java_align_multiline_array_initializer_expression = true
|
||||||
ij_java_align_multiline_assignment = true
|
ij_java_align_multiline_assignment = true
|
||||||
ij_java_align_multiline_binary_operation = true
|
ij_java_align_multiline_binary_operation = true
|
||||||
ij_java_align_multiline_chained_methods = true
|
ij_java_align_multiline_chained_methods = false
|
||||||
ij_java_align_multiline_extends_list = true
|
ij_java_align_multiline_extends_list = true
|
||||||
ij_java_align_multiline_for = true
|
ij_java_align_multiline_for = true
|
||||||
ij_java_align_multiline_method_parentheses = true
|
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 = true
|
ij_java_align_multiline_parameters_in_calls = false
|
||||||
ij_java_align_multiline_parenthesized_expression = true
|
ij_java_align_multiline_parenthesized_expression = true
|
||||||
ij_java_align_multiline_records = true
|
ij_java_align_multiline_records = true
|
||||||
ij_java_align_multiline_resources = true
|
ij_java_align_multiline_resources = true
|
||||||
@@ -127,7 +127,7 @@ ij_java_keep_blank_lines_in_declarations = 2
|
|||||||
ij_java_keep_builder_methods_indents = true
|
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 = false
|
||||||
ij_java_keep_indents_on_empty_lines = true
|
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 = true
|
||||||
@@ -577,14 +577,14 @@ ij_properties_keep_blank_lines = false
|
|||||||
ij_properties_key_value_delimiter = equals
|
ij_properties_key_value_delimiter = equals
|
||||||
ij_properties_spaces_around_key_value_delimiter = false
|
ij_properties_spaces_around_key_value_delimiter = false
|
||||||
|
|
||||||
[{*.yaml, *.yml}]
|
[{*.yml, *.yaml}]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
ij_visual_guides = none
|
ij_visual_guides = none
|
||||||
ij_yaml_align_values_properties = do_not_align
|
ij_yaml_align_values_properties = do_not_align
|
||||||
ij_yaml_autoinsert_sequence_marker = true
|
ij_yaml_autoinsert_sequence_marker = true
|
||||||
ij_yaml_block_mapping_on_new_line = false
|
ij_yaml_block_mapping_on_new_line = false
|
||||||
ij_yaml_indent_sequence_value = true
|
ij_yaml_indent_sequence_value = true
|
||||||
ij_yaml_keep_indents_on_empty_lines = 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_sequence_on_new_line = false
|
||||||
ij_yaml_space_before_colon = false
|
ij_yaml_space_before_colon = false
|
||||||
|
|||||||
+7
-12
@@ -1,19 +1,14 @@
|
|||||||
# Global owners, automatically request review when pull request is submitted
|
# Global owners, automatically request review when pull request is submitted
|
||||||
* @dfsek @solonovamax
|
* @dfsek @solonovamax @duplexsystem @astrsh @justaureus
|
||||||
|
|
||||||
# Platforms
|
# Platforms
|
||||||
## dfsek wrote the majority of the platform impls
|
/platforms/ @dfsek @solonovamax @duplexsystem @justaureus
|
||||||
/platforms/bukkit/ @dfsek
|
/platforms/bukkit @dfsek @solonovamax @duplexsystem @justaureus @OakLoaf
|
||||||
/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
|
/common/ @dfsek @solonovamax @duplexsystem @astrsh
|
||||||
|
|
||||||
# Gradle Stuff
|
# Gradle Stuff
|
||||||
## Most gradle stuff was written by solonovamax
|
/buildSrc/ @dfsek @solonovamax @duplexsystem
|
||||||
/buildSrc/ @solonovamax
|
*.gradle.kts @dfsek @solonovamax @duplexsystem
|
||||||
*.gradle.kts @solonovamax
|
/gradle/ @dfsek @solonovamax @duplexsystem
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ 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) -->
|
||||||
|
|||||||
@@ -1,58 +1,19 @@
|
|||||||
# Pull Request
|
# Pull Request
|
||||||
|
|
||||||
## Brief description.
|
## Description
|
||||||
|
|
||||||
<!-- Please provide a brief description of the goals of your PR -->
|
<!-- Include a description of the PR here -->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
###########################################################################
|
If applicable, include 'Fixes #XXXX' or 'Closes #XXXX' for any related open issues.
|
||||||
## WARNING! ##
|
This helps us relate, track, and close the relevant issues.
|
||||||
## 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.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
## Licensing
|
### Changelog
|
||||||
|
|
||||||
<!-- 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
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
What is the goal of the PR?
|
Fill out a changelog below of what has been done, and what might be planned to be done.
|
||||||
Put a checklist here of what has been done
|
You may delete this if your PR is not adding new features, only fixing bugs or adding translations.
|
||||||
(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 -->
|
||||||
@@ -61,47 +22,58 @@
|
|||||||
- [ ] <!-- Second thing -->
|
- [ ] <!-- Second thing -->
|
||||||
- [ ] <!-- etc. -->
|
- [ ] <!-- etc. -->
|
||||||
|
|
||||||
## Affects of the PR
|
## Checklist
|
||||||
|
|
||||||
<!---
|
<!--
|
||||||
What types of changes does your code introduce? (Select any that apply. You may select multiple.)
|
Select the options below that apply.
|
||||||
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 <!-- Anything which fixes an issue in Terra. -->
|
- [ ] Bug Fix <!-- Changes include bug fixes. -->
|
||||||
- [ ] Build system <!-- Anything which pretain to the build system. -->
|
- [ ] Build system <!-- Changes the build system. -->
|
||||||
- [ ] Documentation <!-- Anything which adds or improves documentation for existing features. -->
|
- [ ] Documentation <!-- Changes add to or improve documentation. -->
|
||||||
- [ ] New Feature <!-- Anything which adds new functionality to Terra. -->
|
- [ ] New Feature <!-- Changes add new functionality to Terra. -->
|
||||||
- [ ] Performance <!-- Anything which is imrpoves the performance of Terra. -->
|
- [ ] Performance <!-- Changes improve the performance of Terra. -->
|
||||||
- [ ] Refactoring <!-- Anything which does not add any new code, only moves code around. -->
|
- [ ] Refactoring <!-- Changes do not add any new code, only moves code around. -->
|
||||||
- [ ] Repository <!-- Anything which affects the repository. Eg. changes to the `README.md` file. -->
|
- [ ] Repository <!-- Changes affect the repository. E.g. changes to the `README.md` file. -->
|
||||||
- [ ] Revert <!-- Anything which reverts previous commits. -->
|
- [ ] Revert <!-- Changes revert previous commits. -->
|
||||||
- [ ] Style <!-- Anything which updates style. -->
|
- [ ] Style <!-- Changes update style, namely the .editorconfig file. -->
|
||||||
- [ ] Tests <!-- Anything which adds or updates tests. -->
|
- [ ] Tests <!-- Changes add or update tests. -->
|
||||||
- [ ] Translation <!-- Anything which is internationalizing the Terra program to other languages. -->
|
- [ ] Translation <!-- Changes include translations to other languages for Terra. -->
|
||||||
|
|
||||||
#### Compatiblity
|
#### Compatibility
|
||||||
|
|
||||||
- [ ] Breaking
|
<!-- The following options determine if the PR pertains to a major, minor, or patch version bump -->
|
||||||
change <!-- A fix, or a feature, that breaks some previous functionality to Terra. -->
|
|
||||||
- [ ] Non-Breaking change.
|
- [ ] Introduces a breaking change
|
||||||
<!--
|
<!--
|
||||||
A change which does not break *any* previous functionality of Terra.
|
Breaking changes are any fix or feature that breaks some previous functionality to Terra / is not backwards compatible.
|
||||||
(ie. is backwards compatible and will work with *any* previously existing supported features.
|
Breaking changes do not include:
|
||||||
Note: if a feature is annotated with @Incubating, @Preview, @Experimental,
|
- changes that are backwards compatible and will work with *any* previously existing supported features.
|
||||||
or is in a package called something similar to the previous annotations,
|
- changes to code marked as in a pre-release
|
||||||
then you may push breaking changes to only THOSE parts of Terra.)
|
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.
|
||||||
#### Contribution Guidelines.
|
- [ ] Introduces bug fixes
|
||||||
|
|
||||||
- [ ] I have read
|
|
||||||
the [`CONTRIBUTING.md`](https://github.com/PolyhedralDev/Terra/blob/master/CONTRIBUTING.md)
|
|
||||||
document in the root of the git repository.
|
|
||||||
- [ ] My code follows 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. -->
|
|
||||||
|
|
||||||
#### Documentation
|
#### Documentation
|
||||||
|
|
||||||
@@ -113,6 +85,20 @@
|
|||||||
- [ ] 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.
|
||||||
<!--
|
<!--
|
||||||
If it only introduces small changes, you don't need to add tests.
|
Tests are typically not necessary for small changes.
|
||||||
But if you add big changes, you should probably at least write *some* testing, where applicable.
|
Including *some* testing is recommended for large changes 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.)
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
# 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@v4.2.2
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v4.7.1
|
||||||
|
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@v3.0.1
|
||||||
|
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
|
||||||
@@ -249,3 +249,5 @@ nbdist/
|
|||||||
|
|
||||||
platforms/**/run/**
|
platforms/**/run/**
|
||||||
|
|
||||||
|
#Vale Config File
|
||||||
|
**/.vale.ini
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2021 Polyhedral Development
|
Copyright (c) 2020-2025 Polyhedral Development
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
+6
-4
@@ -1,8 +1,8 @@
|
|||||||
preRelease(true)
|
preRelease(true)
|
||||||
|
|
||||||
versionProjects(":common:api", version("6.4.0"))
|
versionProjects(":common:api", version("6.6.5"))
|
||||||
versionProjects(":common:implementation", version("6.4.0"))
|
versionProjects(":common:implementation", version("6.6.5"))
|
||||||
versionProjects(":platforms", version("6.4.0"))
|
versionProjects(":platforms", version("6.6.5"))
|
||||||
|
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
@@ -15,6 +15,7 @@ allprojects {
|
|||||||
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 {
|
||||||
@@ -43,8 +44,9 @@ afterEvaluate {
|
|||||||
configureDistribution()
|
configureDistribution()
|
||||||
}
|
}
|
||||||
project(":platforms:bukkit:common").configureDistribution()
|
project(":platforms:bukkit:common").configureDistribution()
|
||||||
|
project(":platforms:minestom:example").configureDistribution()
|
||||||
forSubProjects(":common:addons") {
|
forSubProjects(":common:addons") {
|
||||||
apply(plugin = "com.github.johnrengelman.shadow")
|
apply(plugin = "com.gradleup.shadow")
|
||||||
|
|
||||||
tasks.named("build") {
|
tasks.named("build") {
|
||||||
finalizedBy(tasks.named("shadowJar"))
|
finalizedBy(tasks.named("shadowJar"))
|
||||||
|
|||||||
@@ -6,21 +6,27 @@ plugins {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
|
maven("https://maven.solo-studios.ca/releases") {
|
||||||
|
name = "Solo Studios"
|
||||||
|
}
|
||||||
|
maven("https://maven.solo-studios.ca/snapshots") {
|
||||||
|
name = "Solo Studios"
|
||||||
|
}
|
||||||
maven("https://repo.codemc.org/repository/maven-public") {
|
maven("https://repo.codemc.org/repository/maven-public") {
|
||||||
name = "CodeMC"
|
name = "CodeMC"
|
||||||
}
|
}
|
||||||
maven("https://papermc.io/repo/repository/maven-public/") {
|
maven("https://repo.papermc.io/repository/maven-public/") {
|
||||||
name = "PaperMC"
|
name = "PaperMC"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
//TODO Allow pulling from Versions.kt
|
//TODO Allow pulling from Versions.kt
|
||||||
implementation("com.github.johnrengelman", "shadow", "8.1.1")
|
implementation("com.gradleup.shadow", "shadow-gradle-plugin", "8.3.6")
|
||||||
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin","1.5.6")
|
|
||||||
|
|
||||||
implementation("org.ow2.asm", "asm", "9.5")
|
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "2.0.0-beta.17")
|
||||||
implementation("org.ow2.asm", "asm-tree", "9.5")
|
implementation("org.ow2.asm", "asm", "9.8")
|
||||||
implementation("com.dfsek.tectonic", "common", "4.2.0")
|
implementation("org.ow2.asm", "asm-tree", "9.8")
|
||||||
implementation("org.yaml", "snakeyaml", "2.2")
|
implementation("com.dfsek.tectonic", "common", "4.2.1")
|
||||||
|
implementation("org.yaml", "snakeyaml", "2.4")
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ fun Project.addonDir(dir: File, task: Task) {
|
|||||||
matchingAddons(dir) {
|
matchingAddons(dir) {
|
||||||
it.name.startsWith("Terra-") // Assume everything that starts with Terra- is a core addon.
|
it.name.startsWith("Terra-") // Assume everything that starts with Terra- is a core addon.
|
||||||
}.forEach {
|
}.forEach {
|
||||||
println("Deleting old addon: " + it.absolutePath)
|
logger.info("Deleting old addon: " + it.absolutePath)
|
||||||
it.delete()
|
it.delete()
|
||||||
}
|
}
|
||||||
forSubProjects(":common:addons") {
|
forSubProjects(":common:addons") {
|
||||||
@@ -29,7 +29,7 @@ fun Project.addonDir(dir: File, task: Task) {
|
|||||||
|
|
||||||
val base = "${jar.archiveBaseName.get()}-${version}"
|
val base = "${jar.archiveBaseName.get()}-${version}"
|
||||||
|
|
||||||
println("Copying addon ${jar.archiveFileName.get()} to ${target.absolutePath}. Base name: $base")
|
logger.info("Copying addon ${jar.archiveFileName.get()} to ${target.absolutePath}. Base name: $base")
|
||||||
|
|
||||||
jar.archiveFile.orNull?.asFile?.copyTo(target)
|
jar.archiveFile.orNull?.asFile?.copyTo(target)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ fun Project.configureCompilation() {
|
|||||||
apply<TectonicDocPlugin>()
|
apply<TectonicDocPlugin>()
|
||||||
|
|
||||||
configure<JavaPluginExtension> {
|
configure<JavaPluginExtension> {
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = JavaVersion.VERSION_21
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
targetCompatibility = JavaVersion.VERSION_21
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<JavaCompile> {
|
tasks.withType<JavaCompile> {
|
||||||
|
|||||||
@@ -30,13 +30,19 @@ fun Project.configureDependencies() {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
|
maven("https://maven.solo-studios.ca/releases") {
|
||||||
|
name = "Solo Studios"
|
||||||
|
}
|
||||||
|
maven("https://maven.solo-studios.ca/snapshots") {
|
||||||
|
name = "Solo Studios"
|
||||||
|
}
|
||||||
maven("https://maven.fabricmc.net/") {
|
maven("https://maven.fabricmc.net/") {
|
||||||
name = "FabricMC"
|
name = "FabricMC"
|
||||||
}
|
}
|
||||||
maven("https://repo.codemc.org/repository/maven-public") {
|
maven("https://repo.codemc.org/repository/maven-public") {
|
||||||
name = "CodeMC"
|
name = "CodeMC"
|
||||||
}
|
}
|
||||||
maven("https://papermc.io/repo/repository/maven-public/") {
|
maven("https://repo.papermc.io/repository/maven-public/") {
|
||||||
name = "PaperMC"
|
name = "PaperMC"
|
||||||
}
|
}
|
||||||
maven("https://files.minecraftforge.net/maven/") {
|
maven("https://files.minecraftforge.net/maven/") {
|
||||||
@@ -48,17 +54,29 @@ fun Project.configureDependencies() {
|
|||||||
maven("https://jitpack.io") {
|
maven("https://jitpack.io") {
|
||||||
name = "JitPack"
|
name = "JitPack"
|
||||||
}
|
}
|
||||||
maven("https://nexuslite.gcnt.net/repos/other/") {
|
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
|
||||||
name = "GCNT"
|
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"
|
||||||
|
}
|
||||||
|
maven("https://repo.onarandombox.com/multiverse-releases") {
|
||||||
|
name = "onarandombox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
|
testImplementation("org.junit.jupiter", "junit-jupiter", Versions.Libraries.Internal.junit)
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.7.0")
|
"testRuntimeOnly"("org.junit.platform", "junit-platform-launcher")
|
||||||
compileOnly("org.jetbrains:annotations:23.0.0")
|
compileOnly("org.jetbrains", "annotations", Versions.Libraries.Internal.jetBrainsAnnotations)
|
||||||
|
|
||||||
compileOnly("com.google.guava:guava:30.0-jre")
|
compileOnly("com.google.guava", "guava", Versions.Libraries.Internal.guava)
|
||||||
testImplementation("com.google.guava:guava:30.0-jre")
|
testImplementation("com.google.guava", "guava", Versions.Libraries.Internal.guava)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
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.File
|
||||||
import java.io.FileWriter
|
import java.io.FileWriter
|
||||||
import java.net.URI
|
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
import java.nio.file.FileSystems
|
import java.nio.file.FileSystems
|
||||||
import java.nio.file.Files
|
import java.nio.file.Path
|
||||||
import java.nio.file.StandardCopyOption
|
|
||||||
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.kotlin.dsl.TaskContainerScope
|
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.extra
|
||||||
@@ -17,17 +16,43 @@ 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 kotlin.io.path.createDirectories
|
||||||
|
import kotlin.io.path.createFile
|
||||||
|
import kotlin.io.path.exists
|
||||||
|
|
||||||
|
private fun Project.installAddonsInto(dest: Path) {
|
||||||
|
FileSystems.newFileSystem(dest, mapOf("create" to "false"), null).use { fs ->
|
||||||
|
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.github.johnrengelman.shadow")
|
apply(plugin = "com.gradleup.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 = URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/latest/default.zip")
|
val defaultPackUrl =
|
||||||
|
URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/" + Versions.Terra.overworldConfig + "/default.zip")
|
||||||
downloadPack(defaultPackUrl, project)
|
downloadPack(defaultPackUrl, project)
|
||||||
|
} catch (_:Exception) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,25 +70,18 @@ fun Project.configureDistribution() {
|
|||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
// https://github.com/johnrengelman/shadow/issues/111
|
// https://github.com/johnrengelman/shadow/issues/111
|
||||||
val dest = URI.create("jar:" + tasks.named<ShadowJar>("shadowJar").get().archiveFile.get().asFile.toURI())
|
val dest = tasks.named<ShadowJar>("shadowJar").get().archiveFile.get().path
|
||||||
|
installAddonsInto(dest)
|
||||||
FileSystems.newFileSystem(dest, mapOf("create" to "false"), null).use { fs ->
|
|
||||||
forSubProjects(":common:addons") {
|
|
||||||
val jar = getJarTask()
|
|
||||||
|
|
||||||
println("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 (!Files.exists(addonPath)) {
|
|
||||||
Files.createDirectories(addonPath.parent)
|
|
||||||
Files.createFile(addonPath)
|
|
||||||
Files.copy(jar.archiveFile.get().asFile.toPath(), addonPath, StandardCopyOption.REPLACE_EXISTING)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.create("installAddonsIntoDefaultJar") {
|
||||||
|
group = "terra"
|
||||||
|
dependsOn(compileAddons)
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
val dest = tasks.named<Jar>("jar").get().archiveFile.get().path
|
||||||
|
installAddonsInto(dest)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +107,8 @@ fun Project.configureDistribution() {
|
|||||||
val jar = getJarTask().archiveFileName.get()
|
val jar = getJarTask().archiveFileName.get()
|
||||||
resources.computeIfAbsent(
|
resources.computeIfAbsent(
|
||||||
if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "addons/bootstrap"
|
if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "addons/bootstrap"
|
||||||
else "addons") { ArrayList() }.add(jar)
|
else "addons"
|
||||||
|
) { ArrayList() }.add(jar)
|
||||||
}
|
}
|
||||||
|
|
||||||
val options = DumperOptions()
|
val options = DumperOptions()
|
||||||
@@ -126,10 +145,9 @@ fun Project.configureDistribution() {
|
|||||||
dependsOn(downloadDefaultPacks)
|
dependsOn(downloadDefaultPacks)
|
||||||
configurations = listOf(project.configurations["shaded"])
|
configurations = listOf(project.configurations["shaded"])
|
||||||
archiveClassifier.set("shaded")
|
archiveClassifier.set("shaded")
|
||||||
setVersion(project.version)
|
version = 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("com.dfsek.paralithic", "com.dfsek.terra.lib.paralithic")
|
|
||||||
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")
|
||||||
|
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ fun preRelease(preRelease: Boolean) {
|
|||||||
fun Project.versionProjects(project: String, version: String) {
|
fun Project.versionProjects(project: String, version: String) {
|
||||||
forSubProjects(project) {
|
forSubProjects(project) {
|
||||||
this.version = version
|
this.version = version
|
||||||
println("Setting version of $path to $version")
|
logger.info("Setting version of $path to $version")
|
||||||
}
|
}
|
||||||
project(project).version = version
|
project(project).version = version
|
||||||
println("Setting version of $project to $version")
|
logger.info("Setting version of $project to $version")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.version(version: String): String {
|
fun Project.version(version: String): String {
|
||||||
|
|||||||
@@ -1,71 +1,93 @@
|
|||||||
object Versions {
|
object Versions {
|
||||||
|
object Terra {
|
||||||
|
const val overworldConfig = "v1.5.2"
|
||||||
|
}
|
||||||
|
|
||||||
object Libraries {
|
object Libraries {
|
||||||
const val tectonic = "4.2.1"
|
const val tectonic = "4.2.1"
|
||||||
const val paralithic = "0.7.1"
|
const val paralithic = "0.8.1"
|
||||||
const val strata = "1.3.2"
|
const val strata = "1.3.2"
|
||||||
|
|
||||||
const val cloud = "1.8.4"
|
const val cloud = "2.0.0"
|
||||||
|
|
||||||
const val slf4j = "2.0.9"
|
const val caffeine = "3.2.1"
|
||||||
const val log4j_slf4j_impl = "2.20.0"
|
|
||||||
|
const val slf4j = "2.0.17"
|
||||||
|
|
||||||
object Internal {
|
object Internal {
|
||||||
const val shadow = "8.1.1"
|
const val shadow = "8.3.6"
|
||||||
const val apacheText = "1.10.0"
|
const val apacheText = "1.13.1"
|
||||||
const val jafama = "2.3.2"
|
const val apacheIO = "2.19.0"
|
||||||
const val apacheIO = "2.14.0"
|
const val guava = "33.4.8-jre"
|
||||||
const val guava = "32.1.3-jre"
|
const val asm = "9.8"
|
||||||
const val asm = "9.5"
|
const val snakeYml = "2.4"
|
||||||
const val snakeYml = "2.2"
|
const val jetBrainsAnnotations = "26.0.2"
|
||||||
|
const val junit = "5.13.1"
|
||||||
|
const val nbt = "6.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object Fabric {
|
object Fabric {
|
||||||
const val fabricAPI = "0.90.0+${Mod.minecraft}"
|
const val fabricAPI = "0.128.1+${Mod.minecraft}"
|
||||||
}
|
const val cloud = "2.0.0-beta.11"
|
||||||
|
|
||||||
object Quilt {
|
|
||||||
const val quiltLoader = "0.20.2"
|
|
||||||
const val fabricApi = "7.3.1+0.89.3-1.20.1"
|
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// object Quilt {
|
||||||
|
// const val quiltLoader = "0.20.2"
|
||||||
|
// const val fabricApi = "7.3.1+0.89.3-1.20.1"
|
||||||
|
// }
|
||||||
|
|
||||||
object Mod {
|
object Mod {
|
||||||
const val mixin = "0.12.5+mixin.0.8.5"
|
const val mixin = "0.15.5+mixin.0.8.7"
|
||||||
|
const val mixinExtras = "0.4.1"
|
||||||
|
|
||||||
const val minecraft = "1.20.2"
|
const val minecraft = "1.21.7"
|
||||||
const val yarn = "$minecraft+build.4"
|
const val yarn = "$minecraft+build.1"
|
||||||
const val fabricLoader = "0.14.23"
|
const val fabricLoader = "0.16.14"
|
||||||
|
|
||||||
const val architecuryLoom = "1.3.357"
|
const val architecuryLoom = "1.10.431"
|
||||||
const val architecturyPlugin = "3.4.146"
|
const val architecturyPlugin = "3.4.161"
|
||||||
|
|
||||||
const val loomVineflower = "1.11.0"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Forge {
|
|
||||||
const val forge = "${Mod.minecraft}-48.0.13"
|
|
||||||
const val burningwave = "12.63.0"
|
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// object Forge {
|
||||||
|
// const val forge = "${Mod.minecraft}-48.0.13"
|
||||||
|
// const val burningwave = "12.63.0"
|
||||||
|
// }
|
||||||
|
|
||||||
object Bukkit {
|
object Bukkit {
|
||||||
const val paper = "1.18.2-R0.1-SNAPSHOT"
|
const val minecraft = "1.21.7-R0.1"
|
||||||
const val paperLib = "1.0.5"
|
const val paperBuild = "$minecraft-20250630.144242-1"
|
||||||
const val foliaLib = "0.2.5"
|
const val paper = paperBuild
|
||||||
const val minecraft = "1.20.2"
|
const val paperLib = "1.0.8"
|
||||||
const val reflectionRemapper = "0.1.0-SNAPSHOT"
|
const val reflectionRemapper = "0.1.2"
|
||||||
const val paperDevBundle = "1.20.2-R0.1-SNAPSHOT"
|
const val paperDevBundle = paperBuild
|
||||||
const val runPaper = "2.2.0"
|
const val runPaper = "2.3.1"
|
||||||
const val paperWeight = "1.5.6"
|
const val paperWeight = "2.0.0-beta.17"
|
||||||
}
|
const val cloud = "2.0.0-beta.11"
|
||||||
|
const val multiverse = "5.0.2"
|
||||||
object Sponge {
|
|
||||||
const val sponge = "9.0.0-SNAPSHOT"
|
|
||||||
const val mixin = "0.8.2"
|
|
||||||
const val minecraft = "1.17.1"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// object Sponge {
|
||||||
|
// const val sponge = "9.0.0-SNAPSHOT"
|
||||||
|
// const val mixin = "0.8.2"
|
||||||
|
// const val minecraft = "1.17.1"
|
||||||
|
// }
|
||||||
|
//
|
||||||
object CLI {
|
object CLI {
|
||||||
const val nbt = "6.1"
|
const val logback = "1.5.18"
|
||||||
const val logback = "1.4.11"
|
const val picocli = "4.7.7"
|
||||||
|
}
|
||||||
|
|
||||||
|
object Allay {
|
||||||
|
const val api = "0.4.1"
|
||||||
|
const val gson = "2.13.1"
|
||||||
|
const val mappings = "3626653"
|
||||||
|
const val mappingsGenerator = "366618e"
|
||||||
|
}
|
||||||
|
|
||||||
|
object Minestom {
|
||||||
|
const val minestom = "1_21_6-c3ccee696b"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ abstract class GenerateDocsTask : DefaultTask() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template.add(keyName.toString(), description.toString().ifBlank {
|
template.add(keyName.toString(), description.toString().ifBlank {
|
||||||
println("No description provided for field " + field.name + " in class " + name)
|
logger.info("No description provided for field " + field.name + " in class " + name)
|
||||||
"*No description provided.*"
|
"*No description provided.*"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2021 Polyhedral Development
|
Copyright (c) 2020-2025 Polyhedral Development
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion.api;
|
package com.dfsek.terra.addons.biome.extrusion.api;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
import com.dfsek.terra.api.world.biome.Biome;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
|
||||||
public interface Extrusion {
|
public interface Extrusion {
|
||||||
Biome extrude(Biome original, int x, int y, int z, long seed);
|
Biome extrude(Biome original, int x, int y, int z, long seed);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2021 Polyhedral Development
|
Copyright (c) 2020-2025 Polyhedral Development
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
version = version("1.0.0")
|
version = version("1.0.1")
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
||||||
compileOnlyApi(project(":common:addons:library-image"))
|
compileOnlyApi(project(":common:addons:library-image"))
|
||||||
implementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
|
||||||
testImplementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
|
|
||||||
relocate("net.jafama", "com.dfsek.terra.addons.biome.image.lib.jafama")
|
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -9,8 +9,8 @@ package com.dfsek.terra.addons.biome.image.v2;
|
|||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.image.converter.ColorConverter;
|
|
||||||
import com.dfsek.terra.addons.image.colorsampler.ColorSampler;
|
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.Biome;
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||||
|
|
||||||
|
|||||||
+8
-4
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -58,15 +58,19 @@ public class ImageBiomeProviderAddon implements AddonInitializer {
|
|||||||
providerRegistry.register(addon.key("IMAGE"), ImageProviderTemplate::new);
|
providerRegistry.register(addon.key("IMAGE"), ImageProviderTemplate::new);
|
||||||
})
|
})
|
||||||
.then(event -> {
|
.then(event -> {
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<ColorConverter<Biome>>>> biomeColorConverterRegistry = event.getPack().getOrCreateRegistry(
|
CheckedRegistry<Supplier<ObjectTemplate<ColorConverter<Biome>>>> biomeColorConverterRegistry =
|
||||||
|
event.getPack().getOrCreateRegistry(
|
||||||
BIOME_COLOR_CONVERTER_REGISTRY_KEY);
|
BIOME_COLOR_CONVERTER_REGISTRY_KEY);
|
||||||
biomeColorConverterRegistry.register(addon.key("EXACT"), ExactBiomeColorConverterTemplate::new);
|
biomeColorConverterRegistry.register(addon.key("EXACT"), ExactBiomeColorConverterTemplate::new);
|
||||||
biomeColorConverterRegistry.register(addon.key("CLOSEST"), ClosestBiomeColorConverterTemplate::new);
|
biomeColorConverterRegistry.register(addon.key("CLOSEST"), ClosestBiomeColorConverterTemplate::new);
|
||||||
})
|
})
|
||||||
.then(event -> {
|
.then(event -> {
|
||||||
CheckedRegistry<Supplier<ObjectTemplate<ColorMapping<Biome>>>> biomeColorMappingRegistry = event.getPack().getOrCreateRegistry(
|
CheckedRegistry<Supplier<ObjectTemplate<ColorMapping<Biome>>>> biomeColorMappingRegistry =
|
||||||
|
event.getPack().getOrCreateRegistry(
|
||||||
BIOME_COLOR_MAPPING_REGISTRY_KEY);
|
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("USE_BIOME_COLORS"),
|
||||||
|
() -> () -> new BiomeDefinedColorMapping<>(event.getPack().getRegistry(Biome.class),
|
||||||
|
b -> b));
|
||||||
biomeColorMappingRegistry.register(addon.key("MAP"), DefinedBiomeColorMappingTemplate::new);
|
biomeColorMappingRegistry.register(addon.key("MAP"), DefinedBiomeColorMappingTemplate::new);
|
||||||
})
|
})
|
||||||
.failThrough();
|
.failThrough();
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -13,8 +13,8 @@ import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|||||||
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.image.v2.ImageBiomeProvider;
|
import com.dfsek.terra.addons.biome.image.v2.ImageBiomeProvider;
|
||||||
import com.dfsek.terra.addons.image.converter.ColorConverter;
|
|
||||||
import com.dfsek.terra.addons.image.colorsampler.ColorSampler;
|
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.Biome;
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2021 Polyhedral Development
|
Copyright (c) 2020-2025 Polyhedral Development
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
version = version("1.0.0")
|
version = version("1.0.1")
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
||||||
implementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
|
||||||
testImplementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
|
|
||||||
relocate("net.jafama", "com.dfsek.terra.addons.biome.image.lib.jafama")
|
|
||||||
}
|
}
|
||||||
+5
-7
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -7,8 +7,6 @@
|
|||||||
|
|
||||||
package com.dfsek.terra.addons.biome.image;
|
package com.dfsek.terra.addons.biome.image;
|
||||||
|
|
||||||
import net.jafama.FastMath;
|
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -34,7 +32,7 @@ public class ImageBiomeProvider implements BiomeProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static int distance(Color a, Color b) {
|
private static int distance(Color a, Color b) {
|
||||||
return FastMath.abs(a.getRed() - b.getRed()) + FastMath.abs(a.getGreen() - b.getGreen()) + FastMath.abs(a.getBlue() - b.getBlue());
|
return Math.abs(a.getRed() - b.getRed()) + Math.abs(a.getGreen() - b.getGreen()) + Math.abs(a.getBlue() - b.getBlue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -70,14 +68,14 @@ public class ImageBiomeProvider implements BiomeProvider {
|
|||||||
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(FastMath.floorMod(x - image.getWidth() / 2, image.getWidth()),
|
return new Color(image.getRGB(Math.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(FastMath.floorMod(x, image.getWidth()), FastMath.floorMod(z, image.getHeight())));
|
return new Color(image.getRGB(Math.floorMod(x, image.getWidth()), Math.floorMod(z, image.getHeight())));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -27,11 +27,9 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|||||||
|
|
||||||
public class ImageBiomeProviderAddon implements AddonInitializer {
|
public class ImageBiomeProviderAddon implements AddonInitializer {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ImageBiomeProviderAddon.class);
|
|
||||||
|
|
||||||
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
|
@Inject
|
||||||
private Platform platform;
|
private Platform platform;
|
||||||
|
|
||||||
@@ -50,6 +48,9 @@ public class ImageBiomeProviderAddon implements AddonInitializer {
|
|||||||
() -> new ImageProviderTemplate(event.getPack().getRegistry(Biome.class)));
|
() -> new ImageProviderTemplate(event.getPack().getRegistry(Biome.class)));
|
||||||
})
|
})
|
||||||
.failThrough();
|
.failThrough();
|
||||||
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.");
|
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.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2021 Polyhedral Development
|
Copyright (c) 2020-2025 Polyhedral Development
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
version = version("1.0.0")
|
version = version("1.0.1")
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
||||||
|
|
||||||
implementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
|
||||||
testImplementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
|
|
||||||
relocate("net.jafama", "com.dfsek.terra.addons.biome.pipeline.lib.jafama")
|
|
||||||
}
|
}
|
||||||
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -11,6 +11,9 @@ import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
|||||||
|
|
||||||
import java.util.function.Supplier;
|
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.BiomePipelineTemplate;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.PipelineBiomeLoader;
|
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.source.SamplerSourceTemplate;
|
||||||
@@ -20,9 +23,6 @@ import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator.BorderStage
|
|||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator.ReplaceListStageTemplate;
|
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.ReplaceStageTemplate;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator.SmoothStageTemplate;
|
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator.SmoothStageTemplate;
|
||||||
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.manifest.api.AddonInitializer;
|
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
|
||||||
import com.dfsek.terra.api.Platform;
|
import com.dfsek.terra.api.Platform;
|
||||||
import com.dfsek.terra.api.addon.BaseAddon;
|
import com.dfsek.terra.api.addon.BaseAddon;
|
||||||
|
|||||||
+12
-11
@@ -1,13 +1,9 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2;
|
package com.dfsek.terra.addons.biome.pipeline.v2;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.BiomeChunk;
|
import com.dfsek.terra.api.util.cache.SeededVector2Key;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Pipeline;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.SeededVector;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
|
||||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||||
import com.github.benmanes.caffeine.cache.LoadingCache;
|
import com.github.benmanes.caffeine.cache.LoadingCache;
|
||||||
import net.jafama.FastMath;
|
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -15,6 +11,10 @@ import java.util.Optional;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.StreamSupport;
|
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.noise.NoiseSampler;
|
||||||
import com.dfsek.terra.api.registry.key.StringIdentifiable;
|
import com.dfsek.terra.api.registry.key.StringIdentifiable;
|
||||||
import com.dfsek.terra.api.util.Column;
|
import com.dfsek.terra.api.util.Column;
|
||||||
@@ -24,7 +24,7 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|||||||
|
|
||||||
public class PipelineBiomeProvider implements BiomeProvider {
|
public class PipelineBiomeProvider implements BiomeProvider {
|
||||||
|
|
||||||
private final LoadingCache<SeededVector, BiomeChunk> biomeChunkCache;
|
private final LoadingCache<SeededVector2Key, BiomeChunk> biomeChunkCache;
|
||||||
private final int chunkSize;
|
private final int chunkSize;
|
||||||
private final int resolution;
|
private final int resolution;
|
||||||
private final NoiseSampler mutator;
|
private final NoiseSampler mutator;
|
||||||
@@ -61,7 +61,8 @@ public class PipelineBiomeProvider implements BiomeProvider {
|
|||||||
.append(delegate.getClass().getCanonicalName())
|
.append(delegate.getClass().getCanonicalName())
|
||||||
.append('\n'));
|
.append('\n'));
|
||||||
throw new IllegalArgumentException("Biome Pipeline leaks placeholder biome \"" + pipelineBiome.getID() +
|
throw new IllegalArgumentException("Biome Pipeline leaks placeholder biome \"" + pipelineBiome.getID() +
|
||||||
"\". Ensure there is a stage to guarantee replacement of the placeholder biome. Biomes: " +
|
"\". Ensure there is a stage to guarantee replacement of the placeholder biome. " +
|
||||||
|
"Biomes: " +
|
||||||
biomeList);
|
biomeList);
|
||||||
}
|
}
|
||||||
this.biomes.add(pipelineBiome.getBiome());
|
this.biomes.add(pipelineBiome.getBiome());
|
||||||
@@ -81,8 +82,8 @@ public class PipelineBiomeProvider implements BiomeProvider {
|
|||||||
x /= resolution;
|
x /= resolution;
|
||||||
z /= resolution;
|
z /= resolution;
|
||||||
|
|
||||||
int chunkX = FastMath.floorDiv(x, chunkSize);
|
int chunkX = Math.floorDiv(x, chunkSize);
|
||||||
int chunkZ = FastMath.floorDiv(z, chunkSize);
|
int chunkZ = Math.floorDiv(z, chunkSize);
|
||||||
|
|
||||||
int chunkWorldX = chunkX * chunkSize;
|
int chunkWorldX = chunkX * chunkSize;
|
||||||
int chunkWorldZ = chunkZ * chunkSize;
|
int chunkWorldZ = chunkZ * chunkSize;
|
||||||
@@ -90,7 +91,7 @@ public class PipelineBiomeProvider implements BiomeProvider {
|
|||||||
int xInChunk = x - chunkWorldX;
|
int xInChunk = x - chunkWorldX;
|
||||||
int zInChunk = z - chunkWorldZ;
|
int zInChunk = z - chunkWorldZ;
|
||||||
|
|
||||||
return biomeChunkCache.get(new SeededVector(seed, chunkWorldX, chunkWorldZ)).get(xInChunk, zInChunk).getBiome();
|
return biomeChunkCache.get(new SeededVector2Key(chunkWorldX, chunkWorldZ, seed)).get(xInChunk, zInChunk).getBiome();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.pipeline.BiomeChunkImpl.ViewPoint;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
||||||
|
import com.dfsek.terra.addons.biome.pipeline.v2.pipeline.BiomeChunkImpl.ViewPoint;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+3
-1
@@ -1,10 +1,12 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.util.cache.SeededVector2Key;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public interface Pipeline {
|
public interface Pipeline {
|
||||||
BiomeChunk generateChunk(SeededVector worldCoordinates);
|
BiomeChunk generateChunk(SeededVector2Key worldCoordinates);
|
||||||
|
|
||||||
int getChunkSize();
|
int getChunkSize();
|
||||||
|
|
||||||
|
|||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
|
||||||
|
|
||||||
public record SeededVector(long seed, int x, int z) {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj) {
|
|
||||||
if(obj instanceof SeededVector that) {
|
|
||||||
return this.z == that.z && this.x == that.x && this.seed == that.seed;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
int code = x;
|
|
||||||
code = 31 * code + z;
|
|
||||||
return 31 * code + ((int) (seed ^ (seed >>> 32)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
package com.dfsek.terra.addons.biome.pipeline.v2.api;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.pipeline.BiomeChunkImpl.ViewPoint;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
||||||
|
import com.dfsek.terra.addons.biome.pipeline.v2.pipeline.BiomeChunkImpl.ViewPoint;
|
||||||
|
|
||||||
|
|
||||||
public interface Stage {
|
public interface Stage {
|
||||||
|
|||||||
+2
-2
@@ -7,8 +7,6 @@ import com.dfsek.terra.api.world.biome.Biome;
|
|||||||
|
|
||||||
|
|
||||||
public interface PipelineBiome extends StringIdentifiable {
|
public interface PipelineBiome extends StringIdentifiable {
|
||||||
Biome getBiome();
|
|
||||||
|
|
||||||
static PipelineBiome placeholder(String id) {
|
static PipelineBiome placeholder(String id) {
|
||||||
return new PlaceholderPipelineBiome(id);
|
return new PlaceholderPipelineBiome(id);
|
||||||
}
|
}
|
||||||
@@ -21,6 +19,8 @@ public interface PipelineBiome extends StringIdentifiable {
|
|||||||
return SelfPipelineBiome.INSTANCE;
|
return SelfPipelineBiome.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Biome getBiome();
|
||||||
|
|
||||||
Set<String> getTags();
|
Set<String> getTags();
|
||||||
|
|
||||||
default boolean isPlaceholder() {
|
default boolean isPlaceholder() {
|
||||||
|
|||||||
+8
-12
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -15,9 +15,9 @@ import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.PipelineBiomeProvider;
|
import com.dfsek.terra.addons.biome.pipeline.v2.PipelineBiomeProvider;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.pipeline.PipelineImpl;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Source;
|
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.Stage;
|
||||||
|
import com.dfsek.terra.addons.biome.pipeline.v2.pipeline.PipelineImpl;
|
||||||
import com.dfsek.terra.api.config.meta.Meta;
|
import com.dfsek.terra.api.config.meta.Meta;
|
||||||
import com.dfsek.terra.api.noise.NoiseSampler;
|
import com.dfsek.terra.api.noise.NoiseSampler;
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||||
@@ -33,24 +33,20 @@ public class BiomePipelineTemplate implements ObjectTemplate<BiomeProvider> {
|
|||||||
Larger values are quadratically faster, but produce lower quality results.
|
Larger values are quadratically faster, but produce lower quality results.
|
||||||
For example, a value of 3 would sample every 3 blocks.""")
|
For example, a value of 3 would sample every 3 blocks.""")
|
||||||
protected @Meta int resolution = 1;
|
protected @Meta int resolution = 1;
|
||||||
|
|
||||||
@Value("pipeline.source")
|
|
||||||
@Description("The Biome Source to use for initial population of biomes.")
|
|
||||||
private @Meta Source source;
|
|
||||||
|
|
||||||
@Value("pipeline.stages")
|
|
||||||
@Description("A list of pipeline stages to apply to the result of #source")
|
|
||||||
private @Meta List<@Meta Stage> stages;
|
|
||||||
|
|
||||||
@Value("blend.sampler")
|
@Value("blend.sampler")
|
||||||
@Default
|
@Default
|
||||||
@Description("A sampler to use for blending the edges of biomes via domain warping.")
|
@Description("A sampler to use for blending the edges of biomes via domain warping.")
|
||||||
protected @Meta NoiseSampler blendSampler = NoiseSampler.zero();
|
protected @Meta NoiseSampler blendSampler = NoiseSampler.zero();
|
||||||
|
|
||||||
@Value("blend.amplitude")
|
@Value("blend.amplitude")
|
||||||
@Default
|
@Default
|
||||||
@Description("The amplitude at which to perform blending.")
|
@Description("The amplitude at which to perform blending.")
|
||||||
protected @Meta double blendAmplitude = 0d;
|
protected @Meta double blendAmplitude = 0d;
|
||||||
|
@Value("pipeline.source")
|
||||||
|
@Description("The Biome Source to use for initial population of biomes.")
|
||||||
|
private @Meta Source source;
|
||||||
|
@Value("pipeline.stages")
|
||||||
|
@Description("A list of pipeline stages to apply to the result of #source")
|
||||||
|
private @Meta List<@Meta Stage> stages;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BiomeProvider get() {
|
public BiomeProvider get() {
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
package com.dfsek.terra.addons.biome.pipeline.v2.config.stage.expander;
|
package com.dfsek.terra.addons.biome.pipeline.v2.config.stage.expander;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Expander;
|
import com.dfsek.terra.addons.biome.pipeline.v2.api.Expander;
|
||||||
|
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.stage.expander.FractalExpander;
|
import com.dfsek.terra.addons.biome.pipeline.v2.stage.expander.FractalExpander;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -11,9 +11,9 @@ import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
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.api.biome.PipelineBiome;
|
||||||
|
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.BorderListStage;
|
import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.BorderListStage;
|
||||||
import com.dfsek.terra.api.config.meta.Meta;
|
import com.dfsek.terra.api.config.meta.Meta;
|
||||||
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -9,9 +9,9 @@ package com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator;
|
|||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
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.api.biome.PipelineBiome;
|
||||||
|
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.BorderStage;
|
import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.BorderStage;
|
||||||
import com.dfsek.terra.api.config.meta.Meta;
|
import com.dfsek.terra.api.config.meta.Meta;
|
||||||
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -11,9 +11,9 @@ import com.dfsek.tectonic.api.config.template.annotations.Value;
|
|||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
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.api.biome.PipelineBiome;
|
||||||
|
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.ReplaceListStage;
|
import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.ReplaceListStage;
|
||||||
import com.dfsek.terra.api.config.meta.Meta;
|
import com.dfsek.terra.api.config.meta.Meta;
|
||||||
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -9,9 +9,9 @@ package com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator;
|
|||||||
|
|
||||||
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
import com.dfsek.tectonic.api.config.template.annotations.Value;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
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.api.biome.PipelineBiome;
|
||||||
|
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.ReplaceStage;
|
import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.ReplaceStage;
|
||||||
import com.dfsek.terra.api.config.meta.Meta;
|
import com.dfsek.terra.api.config.meta.Meta;
|
||||||
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
package com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator;
|
package com.dfsek.terra.addons.biome.pipeline.v2.config.stage.mutator;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
||||||
|
import com.dfsek.terra.addons.biome.pipeline.v2.config.stage.StageTemplate;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.SmoothStage;
|
import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.SmoothStage;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+40
-35
@@ -1,36 +1,36 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2.pipeline;
|
package com.dfsek.terra.addons.biome.pipeline.v2.pipeline;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.BiomeChunk;
|
import com.dfsek.terra.addons.biome.pipeline.v2.api.BiomeChunk;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Expander;
|
import com.dfsek.terra.addons.biome.pipeline.v2.api.Expander;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.SeededVector;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
|
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.api.biome.PipelineBiome;
|
||||||
import net.jafama.FastMath;
|
import com.dfsek.terra.api.util.cache.SeededVector2Key;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public class BiomeChunkImpl implements BiomeChunk {
|
public class BiomeChunkImpl implements BiomeChunk {
|
||||||
|
|
||||||
private PipelineBiome[][] biomes;
|
private final SeededVector2Key worldOrigin;
|
||||||
private final SeededVector worldOrigin;
|
|
||||||
private final int chunkOriginArrayIndex;
|
private final int chunkOriginArrayIndex;
|
||||||
private final int worldCoordinateScale;
|
private final int worldCoordinateScale;
|
||||||
|
private final int size;
|
||||||
|
private PipelineBiome[] biomes;
|
||||||
|
|
||||||
public BiomeChunkImpl(SeededVector worldOrigin, PipelineImpl pipeline) {
|
public BiomeChunkImpl(SeededVector2Key worldOrigin, PipelineImpl pipeline) {
|
||||||
|
|
||||||
this.worldOrigin = worldOrigin;
|
this.worldOrigin = worldOrigin;
|
||||||
this.chunkOriginArrayIndex = pipeline.getChunkOriginArrayIndex();
|
this.chunkOriginArrayIndex = pipeline.getChunkOriginArrayIndex();
|
||||||
this.worldCoordinateScale = pipeline.getResolution();
|
this.worldCoordinateScale = pipeline.getResolution();
|
||||||
|
|
||||||
int size = pipeline.getArraySize();
|
this.size = pipeline.getArraySize();
|
||||||
|
|
||||||
int expanderCount = pipeline.getExpanderCount();
|
int expanderCount = pipeline.getExpanderCount();
|
||||||
int expansionsApplied = 0;
|
int expansionsApplied = 0;
|
||||||
|
|
||||||
// Allocate working arrays
|
// Allocate working arrays
|
||||||
this.biomes = new PipelineBiome[size][size];
|
this.biomes = new PipelineBiome[size * size];
|
||||||
PipelineBiome[][] lookupArray = new PipelineBiome[size][size];
|
PipelineBiome[] lookupArray = new PipelineBiome[size * size];
|
||||||
// A second lookup array is required such that stage application doesn't affect lookups, otherwise application may cascade
|
// A second lookup array is required such that stage application doesn't affect lookups, otherwise application may cascade
|
||||||
|
|
||||||
// Construct working grid
|
// Construct working grid
|
||||||
@@ -44,7 +44,8 @@ public class BiomeChunkImpl implements BiomeChunk {
|
|||||||
for(int gridZ = 0; gridZ < gridSize; gridZ++) {
|
for(int gridZ = 0; gridZ < gridSize; gridZ++) {
|
||||||
int xIndex = gridOrigin + gridX * gridInterval;
|
int xIndex = gridOrigin + gridX * gridInterval;
|
||||||
int zIndex = gridOrigin + gridZ * gridInterval;
|
int zIndex = gridOrigin + gridZ * gridInterval;
|
||||||
biomes[xIndex][zIndex] = pipeline.getSource().get(worldOrigin.seed(), xIndexToWorldCoordinate(xIndex), zIndexToWorldCoordinate(zIndex));
|
biomes[(xIndex * size) + zIndex] = pipeline.getSource().get(worldOrigin.seed, xIndexToWorldCoordinate(xIndex),
|
||||||
|
zIndexToWorldCoordinate(zIndex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +66,7 @@ public class BiomeChunkImpl implements BiomeChunk {
|
|||||||
|
|
||||||
// Cycle arrays, the previously populated array is swapped to be used for lookups, and the result of the stage application
|
// Cycle arrays, the previously populated array is swapped to be used for lookups, and the result of the stage application
|
||||||
// overwrites the previous lookup array. This saves having to allocate a new array copy each time
|
// overwrites the previous lookup array. This saves having to allocate a new array copy each time
|
||||||
PipelineBiome[][] tempArray = biomes;
|
PipelineBiome[] tempArray = biomes;
|
||||||
biomes = lookupArray;
|
biomes = lookupArray;
|
||||||
lookupArray = tempArray;
|
lookupArray = tempArray;
|
||||||
|
|
||||||
@@ -74,27 +75,13 @@ public class BiomeChunkImpl implements BiomeChunk {
|
|||||||
for(int gridX = 0; gridX < gridSize; gridX = gridX + 1) {
|
for(int gridX = 0; gridX < gridSize; gridX = gridX + 1) {
|
||||||
int xIndex = gridOrigin + gridX * gridInterval;
|
int xIndex = gridOrigin + gridX * gridInterval;
|
||||||
int zIndex = gridOrigin + gridZ * gridInterval;
|
int zIndex = gridOrigin + gridZ * gridInterval;
|
||||||
biomes[xIndex][zIndex] = stage.apply(new ViewPoint(this, gridInterval, gridX, gridZ, xIndex, zIndex, lookupArray));
|
biomes[(xIndex * size) + zIndex] = stage.apply(
|
||||||
|
new ViewPoint(this, gridInterval, gridX, gridZ, xIndex, zIndex, lookupArray, size));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public PipelineBiome get(int xInChunk, int zInChunk) {
|
|
||||||
int xIndex = xInChunk + chunkOriginArrayIndex;
|
|
||||||
int zIndex = zInChunk + chunkOriginArrayIndex;
|
|
||||||
return biomes[xIndex][zIndex];
|
|
||||||
}
|
|
||||||
|
|
||||||
private int xIndexToWorldCoordinate(int xIndex) {
|
|
||||||
return (worldOrigin.x() + xIndex - chunkOriginArrayIndex) * worldCoordinateScale;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int zIndexToWorldCoordinate(int zIndex) {
|
|
||||||
return (worldOrigin.z() + zIndex - chunkOriginArrayIndex) * worldCoordinateScale;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static int initialSizeToArraySize(int expanderCount, int initialSize) {
|
protected static int initialSizeToArraySize(int expanderCount, int initialSize) {
|
||||||
int size = initialSize;
|
int size = initialSize;
|
||||||
for(int i = 0; i < expanderCount; i++) {
|
for(int i = 0; i < expanderCount; i++) {
|
||||||
@@ -111,7 +98,7 @@ public class BiomeChunkImpl implements BiomeChunk {
|
|||||||
// chunk samples points on the same overall grid.
|
// chunk samples points on the same overall grid.
|
||||||
// Without this, shared chunk borders (required because of adjacent cell reads) will not be identical
|
// Without this, shared chunk borders (required because of adjacent cell reads) will not be identical
|
||||||
// because points would be sampled on grids at different offsets, resulting in artifacts at borders.
|
// because points would be sampled on grids at different offsets, resulting in artifacts at borders.
|
||||||
return FastMath.ceilToInt((double) finalGridOrigin / initialGridInterval) * initialGridInterval;
|
return (int) Math.ceil((double) finalGridOrigin / initialGridInterval) * initialGridInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int calculateFinalGridOrigin(int totalExpanderCount, List<Stage> stages) {
|
private static int calculateFinalGridOrigin(int totalExpanderCount, List<Stage> stages) {
|
||||||
@@ -144,7 +131,22 @@ public class BiomeChunkImpl implements BiomeChunk {
|
|||||||
return 1 << (totalExpansions - expansionsApplied);
|
return 1 << (totalExpansions - expansionsApplied);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SeededVector getOrigin() {
|
@Override
|
||||||
|
public PipelineBiome get(int xInChunk, int zInChunk) {
|
||||||
|
int xIndex = xInChunk + chunkOriginArrayIndex;
|
||||||
|
int zIndex = zInChunk + chunkOriginArrayIndex;
|
||||||
|
return biomes[(xIndex * size) + zIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
private int xIndexToWorldCoordinate(int xIndex) {
|
||||||
|
return (worldOrigin.x + xIndex - chunkOriginArrayIndex) * worldCoordinateScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int zIndexToWorldCoordinate(int zIndex) {
|
||||||
|
return (worldOrigin.z + zIndex - chunkOriginArrayIndex) * worldCoordinateScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
private SeededVector2Key getOrigin() {
|
||||||
return worldOrigin;
|
return worldOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,9 +161,11 @@ public class BiomeChunkImpl implements BiomeChunk {
|
|||||||
private final int gridZ;
|
private final int gridZ;
|
||||||
private final int xIndex;
|
private final int xIndex;
|
||||||
private final int zIndex;
|
private final int zIndex;
|
||||||
private final PipelineBiome[][] lookupArray;
|
private final PipelineBiome[] lookupArray;
|
||||||
|
private final int size;
|
||||||
|
|
||||||
private ViewPoint(BiomeChunkImpl chunk, int gridInterval, int gridX, int gridZ, int xIndex, int zIndex, PipelineBiome[][] lookupArray) {
|
private ViewPoint(BiomeChunkImpl chunk, int gridInterval, int gridX, int gridZ, int xIndex, int zIndex,
|
||||||
|
PipelineBiome[] lookupArray, int size) {
|
||||||
this.chunk = chunk;
|
this.chunk = chunk;
|
||||||
this.gridInterval = gridInterval;
|
this.gridInterval = gridInterval;
|
||||||
this.gridX = gridX;
|
this.gridX = gridX;
|
||||||
@@ -169,13 +173,14 @@ public class BiomeChunkImpl implements BiomeChunk {
|
|||||||
this.xIndex = xIndex;
|
this.xIndex = xIndex;
|
||||||
this.zIndex = zIndex;
|
this.zIndex = zIndex;
|
||||||
this.lookupArray = lookupArray;
|
this.lookupArray = lookupArray;
|
||||||
this.biome = lookupArray[xIndex][zIndex];
|
this.size = size;
|
||||||
|
this.biome = lookupArray[(this.xIndex * this.size) + this.zIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
public PipelineBiome getRelativeBiome(int x, int z) {
|
public PipelineBiome getRelativeBiome(int x, int z) {
|
||||||
int lookupXIndex = this.xIndex + x * gridInterval;
|
int lookupXIndex = this.xIndex + x * gridInterval;
|
||||||
int lookupZIndex = this.zIndex + z * gridInterval;
|
int lookupZIndex = this.zIndex + z * gridInterval;
|
||||||
return lookupArray[lookupXIndex][lookupZIndex];
|
return lookupArray[(lookupXIndex * this.size) + lookupZIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
public PipelineBiome getBiome() {
|
public PipelineBiome getBiome() {
|
||||||
@@ -211,7 +216,7 @@ public class BiomeChunkImpl implements BiomeChunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long worldSeed() {
|
public long worldSeed() {
|
||||||
return chunk.getOrigin().seed();
|
return chunk.getOrigin().seed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -1,5 +1,7 @@
|
|||||||
package com.dfsek.terra.addons.biome.pipeline.v2.pipeline;
|
package com.dfsek.terra.addons.biome.pipeline.v2.pipeline;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.util.cache.SeededVector2Key;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -8,7 +10,6 @@ import java.util.List;
|
|||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.BiomeChunk;
|
import com.dfsek.terra.addons.biome.pipeline.v2.api.BiomeChunk;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Expander;
|
import com.dfsek.terra.addons.biome.pipeline.v2.api.Expander;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Pipeline;
|
import com.dfsek.terra.addons.biome.pipeline.v2.api.Pipeline;
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.SeededVector;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Source;
|
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.Stage;
|
||||||
|
|
||||||
@@ -55,7 +56,7 @@ public class PipelineImpl implements Pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BiomeChunk generateChunk(SeededVector worldCoordinates) {
|
public BiomeChunk generateChunk(SeededVector2Key worldCoordinates) {
|
||||||
return new BiomeChunkImpl(worldCoordinates, this);
|
return new BiomeChunkImpl(worldCoordinates, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,8 +3,8 @@ package com.dfsek.terra.addons.biome.pipeline.v2.source;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
|
||||||
import com.dfsek.terra.addons.biome.pipeline.v2.api.Source;
|
import com.dfsek.terra.addons.biome.pipeline.v2.api.Source;
|
||||||
|
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
|
||||||
|
|
||||||
|
|
||||||
public class SingleSource implements Source {
|
public class SingleSource implements Source {
|
||||||
|
|||||||
+3
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -71,7 +71,8 @@ public class BorderListStage implements Stage {
|
|||||||
viewPoint.worldSeed());
|
viewPoint.worldSeed());
|
||||||
return replacement.isSelf() ? center : replacement;
|
return replacement.isSelf() ? center : replacement;
|
||||||
}
|
}
|
||||||
PipelineBiome replacement = replaceDefault.get(noiseSampler, viewPoint.worldX(), viewPoint.worldZ(), viewPoint.worldSeed());
|
PipelineBiome replacement = replaceDefault.get(noiseSampler, viewPoint.worldX(), viewPoint.worldZ(),
|
||||||
|
viewPoint.worldSeed());
|
||||||
return replacement.isSelf() ? center : replacement;
|
return replacement.isSelf() ? center : replacement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2021 Polyhedral Development
|
Copyright (c) 2020-2025 Polyhedral Development
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
version = version("1.0.1")
|
version = version("1.0.2")
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
||||||
|
|
||||||
implementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
|
||||||
testImplementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
|
|
||||||
relocate("net.jafama", "com.dfsek.terra.addons.biome.pipeline.lib.jafama")
|
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+6
-5
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -41,15 +41,13 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|||||||
|
|
||||||
public class BiomePipelineAddon implements AddonInitializer {
|
public class BiomePipelineAddon implements AddonInitializer {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(BiomePipelineAddon.class);
|
|
||||||
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<BiomeSource>>> SOURCE_REGISTRY_KEY = new TypeKey<>() {
|
public static final TypeKey<Supplier<ObjectTemplate<BiomeSource>>> SOURCE_REGISTRY_KEY = new TypeKey<>() {
|
||||||
};
|
};
|
||||||
|
|
||||||
public static final TypeKey<Supplier<ObjectTemplate<Stage>>> STAGE_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<>() {
|
public static final TypeKey<Supplier<ObjectTemplate<BiomeProvider>>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
|
||||||
};
|
};
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(BiomePipelineAddon.class);
|
||||||
@Inject
|
@Inject
|
||||||
private Platform platform;
|
private Platform platform;
|
||||||
|
|
||||||
@@ -90,6 +88,9 @@ public class BiomePipelineAddon implements AddonInitializer {
|
|||||||
event.getPack().applyLoader(BiomeDelegate.class, new BiomeDelegateLoader(biomeRegistry));
|
event.getPack().applyLoader(BiomeDelegate.class, new BiomeDelegateLoader(biomeRegistry));
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.warn("The biome-provider-pipeline addon is deprecated and scheduled for removal in Terra 7.0. It is recommended to use the biome-provider-pipeline-v2 addon for future pack development instead.");
|
if(platform.getTerraConfig().isDebugLog())
|
||||||
|
logger.warn(
|
||||||
|
"The biome-provider-pipeline addon is deprecated and scheduled for removal in Terra 7.0. It is recommended to use the" +
|
||||||
|
" biome-provider-pipeline-v2 addon for future pack development instead.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-4
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -9,7 +9,6 @@ package com.dfsek.terra.addons.biome.pipeline;
|
|||||||
|
|
||||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||||
import com.github.benmanes.caffeine.cache.LoadingCache;
|
import com.github.benmanes.caffeine.cache.LoadingCache;
|
||||||
import net.jafama.FastMath;
|
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -86,8 +85,8 @@ public class BiomePipelineProvider implements BiomeProvider {
|
|||||||
x /= resolution;
|
x /= resolution;
|
||||||
z /= resolution;
|
z /= resolution;
|
||||||
|
|
||||||
int fdX = FastMath.floorDiv(x, pipeline.getSize());
|
int fdX = Math.floorDiv(x, pipeline.getSize());
|
||||||
int fdZ = FastMath.floorDiv(z, pipeline.getSize());
|
int fdZ = Math.floorDiv(z, pipeline.getSize());
|
||||||
return holderCache.get(new SeededVector(fdX, fdZ, seed)).getBiome(x - fdX * pipeline.getSize(),
|
return holderCache.get(new SeededVector(fdX, fdZ, seed)).getBiome(x - fdX * pipeline.getSize(),
|
||||||
z - fdZ * pipeline.getSize()).getBiome();
|
z - fdZ * pipeline.getSize()).getBiome();
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2021 Polyhedral Development
|
Copyright (c) 2020-2025 Polyhedral Development
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2021 Polyhedral Development
|
Copyright (c) 2020-2025 Polyhedral Development
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
version = version("1.2.0")
|
version = version("1.2.1")
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
|
||||||
|
|
||||||
implementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
|
||||||
testImplementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
|
|
||||||
relocate("net.jafama", "com.dfsek.terra.addons.chunkgenerator.lib.jafama")
|
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-6
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -13,6 +13,7 @@ import com.dfsek.terra.addons.chunkgenerator.config.noise.BiomeNoiseProperties;
|
|||||||
import com.dfsek.terra.addons.chunkgenerator.config.palette.BiomePaletteTemplate;
|
import com.dfsek.terra.addons.chunkgenerator.config.palette.BiomePaletteTemplate;
|
||||||
import com.dfsek.terra.addons.chunkgenerator.config.palette.slant.SlantLayerTemplate;
|
import com.dfsek.terra.addons.chunkgenerator.config.palette.slant.SlantLayerTemplate;
|
||||||
import com.dfsek.terra.addons.chunkgenerator.generation.NoiseChunkGenerator3D;
|
import com.dfsek.terra.addons.chunkgenerator.generation.NoiseChunkGenerator3D;
|
||||||
|
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||||
import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo;
|
import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo;
|
||||||
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
||||||
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
|
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
|
||||||
@@ -45,8 +46,8 @@ public class NoiseChunkGenerator3DAddon implements AddonInitializer {
|
|||||||
.priority(1000)
|
.priority(1000)
|
||||||
.then(event -> {
|
.then(event -> {
|
||||||
|
|
||||||
event.getPack().applyLoader(SlantHolder.CalculationMethod.class,
|
event.getPack().applyLoader(SlantCalculationMethod.class,
|
||||||
(type, o, loader, depthTracker) -> SlantHolder.CalculationMethod.valueOf((String) o));
|
(type, o, loader, depthTracker) -> SlantCalculationMethod.valueOf((String) o));
|
||||||
|
|
||||||
NoiseChunkGeneratorPackConfigTemplate config = event.loadTemplate(new NoiseChunkGeneratorPackConfigTemplate());
|
NoiseChunkGeneratorPackConfigTemplate config = event.loadTemplate(new NoiseChunkGeneratorPackConfigTemplate());
|
||||||
event.getPack().getContext().put(config);
|
event.getPack().getContext().put(config);
|
||||||
@@ -57,7 +58,8 @@ public class NoiseChunkGenerator3DAddon implements AddonInitializer {
|
|||||||
pack -> new NoiseChunkGenerator3D(pack, platform, config.getElevationBlend(),
|
pack -> new NoiseChunkGenerator3D(pack, platform, config.getElevationBlend(),
|
||||||
config.getHorizontalRes(),
|
config.getHorizontalRes(),
|
||||||
config.getVerticalRes(), noisePropertiesPropertyKey,
|
config.getVerticalRes(), noisePropertiesPropertyKey,
|
||||||
paletteInfoPropertyKey));
|
paletteInfoPropertyKey, config.getSlantCalculationMethod(),
|
||||||
|
config.isSlantPalettesEnabled()));
|
||||||
event.getPack()
|
event.getPack()
|
||||||
.applyLoader(SlantHolder.Layer.class, SlantLayerTemplate::new);
|
.applyLoader(SlantHolder.Layer.class, SlantLayerTemplate::new);
|
||||||
})
|
})
|
||||||
@@ -68,10 +70,13 @@ public class NoiseChunkGenerator3DAddon implements AddonInitializer {
|
|||||||
.register(addon, ConfigurationLoadEvent.class)
|
.register(addon, ConfigurationLoadEvent.class)
|
||||||
.then(event -> {
|
.then(event -> {
|
||||||
if(event.is(Biome.class)) {
|
if(event.is(Biome.class)) {
|
||||||
NoiseChunkGeneratorPackConfigTemplate config = event.getPack().getContext().get(NoiseChunkGeneratorPackConfigTemplate.class);
|
NoiseChunkGeneratorPackConfigTemplate config = event.getPack().getContext().get(
|
||||||
|
NoiseChunkGeneratorPackConfigTemplate.class);
|
||||||
|
|
||||||
event.getLoadedObject(Biome.class).getContext().put(paletteInfoPropertyKey,
|
event.getLoadedObject(Biome.class).getContext().put(paletteInfoPropertyKey,
|
||||||
event.load(new BiomePaletteTemplate(platform, config.getSlantCalculationMethod())).get());
|
event.load(new BiomePaletteTemplate(platform,
|
||||||
|
config.getSlantCalculationMethod()))
|
||||||
|
.get());
|
||||||
event.getLoadedObject(Biome.class).getContext().put(noisePropertiesPropertyKey,
|
event.getLoadedObject(Biome.class).getContext().put(noisePropertiesPropertyKey,
|
||||||
event.load(new BiomeNoiseConfigTemplate()).get());
|
event.load(new BiomeNoiseConfigTemplate()).get());
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-3
@@ -4,7 +4,7 @@ import com.dfsek.tectonic.api.config.template.ConfigTemplate;
|
|||||||
import com.dfsek.tectonic.api.config.template.annotations.Default;
|
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.annotations.Value;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||||
import com.dfsek.terra.api.config.meta.Meta;
|
import com.dfsek.terra.api.config.meta.Meta;
|
||||||
import com.dfsek.terra.api.properties.Properties;
|
import com.dfsek.terra.api.properties.Properties;
|
||||||
|
|
||||||
@@ -24,7 +24,11 @@ public class NoiseChunkGeneratorPackConfigTemplate implements ConfigTemplate, Pr
|
|||||||
|
|
||||||
@Value("slant.calculation-method")
|
@Value("slant.calculation-method")
|
||||||
@Default
|
@Default
|
||||||
private SlantHolder.@Meta CalculationMethod slantCalculationMethod = SlantHolder.CalculationMethod.Derivative;
|
private @Meta SlantCalculationMethod slantCalculationMethod = SlantCalculationMethod.Derivative;
|
||||||
|
|
||||||
|
@Value("slant.disable-palettes")
|
||||||
|
@Default
|
||||||
|
private @Meta boolean disableSlantPalettes = false;
|
||||||
|
|
||||||
public int getElevationBlend() {
|
public int getElevationBlend() {
|
||||||
return elevationBlend;
|
return elevationBlend;
|
||||||
@@ -38,7 +42,11 @@ public class NoiseChunkGeneratorPackConfigTemplate implements ConfigTemplate, Pr
|
|||||||
return verticalRes;
|
return verticalRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SlantHolder.CalculationMethod getSlantCalculationMethod() {
|
public SlantCalculationMethod getSlantCalculationMethod() {
|
||||||
return slantCalculationMethod;
|
return slantCalculationMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSlantPalettesEnabled() {
|
||||||
|
return !disableSlantPalettes;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-11
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -16,8 +16,9 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder;
|
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||||
import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo;
|
import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo;
|
||||||
|
import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder;
|
||||||
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
||||||
import com.dfsek.terra.api.Platform;
|
import com.dfsek.terra.api.Platform;
|
||||||
import com.dfsek.terra.api.block.state.BlockState;
|
import com.dfsek.terra.api.block.state.BlockState;
|
||||||
@@ -27,26 +28,22 @@ import com.dfsek.terra.api.world.chunk.generation.util.Palette;
|
|||||||
|
|
||||||
public class BiomePaletteTemplate implements ObjectTemplate<BiomePaletteInfo> {
|
public class BiomePaletteTemplate implements ObjectTemplate<BiomePaletteInfo> {
|
||||||
private final Platform platform;
|
private final Platform platform;
|
||||||
|
private final SlantCalculationMethod slantCalculationMethod;
|
||||||
@Value("slant")
|
@Value("slant")
|
||||||
@Default
|
@Default
|
||||||
@Description("The slant palettes to use in this biome.")
|
@Description("The slant palettes to use in this biome.")
|
||||||
private @Meta List<SlantHolder.@Meta Layer> slantLayers = Collections.emptyList();
|
private @Meta List<SlantHolder.@Meta Layer> slantLayers = Collections.emptyList();
|
||||||
|
|
||||||
@Value("slant-depth")
|
@Value("slant-depth")
|
||||||
@Default
|
@Default
|
||||||
@Description("The maximum depth at which to apply a slant palette.")
|
@Description("The maximum depth at which to apply a slant palette.")
|
||||||
private @Meta int slantDepth = Integer.MAX_VALUE;
|
private @Meta int slantDepth = Integer.MAX_VALUE;
|
||||||
|
|
||||||
@Value("palette")
|
@Value("palette")
|
||||||
@Description("The palettes to use in this biome.")
|
@Description("The palettes to use in this biome.")
|
||||||
private @Meta List<@Meta Map<@Meta Palette, @Meta Integer>> palettes;
|
private @Meta List<@Meta Map<@Meta Palette, @Meta Integer>> palettes;
|
||||||
|
|
||||||
@Value("ocean.level")
|
@Value("ocean.level")
|
||||||
@Description("Sea level in this biome. Defaults to zero")
|
@Description("Sea level in this biome. Defaults to zero")
|
||||||
@Default
|
@Default
|
||||||
private @Meta int seaLevel = 0;
|
private @Meta int seaLevel = 0;
|
||||||
|
|
||||||
@Value("ocean.palette")
|
@Value("ocean.palette")
|
||||||
@Description("The palette to use for the ocean in this biome. Defaults to a blank palette.")
|
@Description("The palette to use for the ocean in this biome. Defaults to a blank palette.")
|
||||||
@Default
|
@Default
|
||||||
@@ -56,14 +53,11 @@ public class BiomePaletteTemplate implements ObjectTemplate<BiomePaletteInfo> {
|
|||||||
return platform.getWorldHandle().air();
|
return platform.getWorldHandle().air();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@Value("carving.update-palette")
|
@Value("carving.update-palette")
|
||||||
@Default
|
@Default
|
||||||
private @Meta boolean updatePalette = false;
|
private @Meta boolean updatePalette = false;
|
||||||
|
|
||||||
private final SlantHolder.CalculationMethod slantCalculationMethod;
|
public BiomePaletteTemplate(Platform platform, SlantCalculationMethod slantCalculationMethod) {
|
||||||
|
|
||||||
public BiomePaletteTemplate(Platform platform, SlantHolder.CalculationMethod slantCalculationMethod) {
|
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
this.slantCalculationMethod = slantCalculationMethod;
|
this.slantCalculationMethod = slantCalculationMethod;
|
||||||
}
|
}
|
||||||
|
|||||||
+31
-17
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2021 Polyhedral Development
|
* Copyright (c) 2020-2025 Polyhedral Development
|
||||||
*
|
*
|
||||||
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
|
* 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.
|
* reference the LICENSE file in this module's root directory.
|
||||||
@@ -8,15 +8,15 @@
|
|||||||
package com.dfsek.terra.addons.chunkgenerator.generation;
|
package com.dfsek.terra.addons.chunkgenerator.generation;
|
||||||
|
|
||||||
|
|
||||||
import net.jafama.FastMath;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.chunkgenerator.config.noise.BiomeNoiseProperties;
|
import com.dfsek.terra.addons.chunkgenerator.config.noise.BiomeNoiseProperties;
|
||||||
import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo;
|
import com.dfsek.terra.addons.chunkgenerator.generation.math.SlantCalculationMethod;
|
||||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.PaletteUtil;
|
|
||||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation.LazilyEvaluatedInterpolator;
|
import com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation.LazilyEvaluatedInterpolator;
|
||||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D;
|
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D;
|
||||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.SamplerProvider;
|
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.SamplerProvider;
|
||||||
|
import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo;
|
||||||
|
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
||||||
import com.dfsek.terra.api.Platform;
|
import com.dfsek.terra.api.Platform;
|
||||||
import com.dfsek.terra.api.block.state.BlockState;
|
import com.dfsek.terra.api.block.state.BlockState;
|
||||||
import com.dfsek.terra.api.config.ConfigPack;
|
import com.dfsek.terra.api.config.ConfigPack;
|
||||||
@@ -43,16 +43,23 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
|||||||
private final PropertyKey<BiomePaletteInfo> paletteInfoPropertyKey;
|
private final PropertyKey<BiomePaletteInfo> paletteInfoPropertyKey;
|
||||||
private final PropertyKey<BiomeNoiseProperties> noisePropertiesKey;
|
private final PropertyKey<BiomeNoiseProperties> noisePropertiesKey;
|
||||||
|
|
||||||
|
private final SlantCalculationMethod slantCalculationMethod;
|
||||||
|
|
||||||
|
private final boolean useSlantPalettes;
|
||||||
|
|
||||||
public NoiseChunkGenerator3D(ConfigPack pack, Platform platform, int elevationBlend, int carverHorizontalResolution,
|
public NoiseChunkGenerator3D(ConfigPack pack, Platform platform, int elevationBlend, int carverHorizontalResolution,
|
||||||
int carverVerticalResolution,
|
int carverVerticalResolution,
|
||||||
PropertyKey<BiomeNoiseProperties> noisePropertiesKey,
|
PropertyKey<BiomeNoiseProperties> noisePropertiesKey,
|
||||||
PropertyKey<BiomePaletteInfo> paletteInfoPropertyKey) {
|
PropertyKey<BiomePaletteInfo> paletteInfoPropertyKey,
|
||||||
|
SlantCalculationMethod slantCalculationMethod, boolean useSlantPalettes) {
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
this.air = platform.getWorldHandle().air();
|
this.air = platform.getWorldHandle().air();
|
||||||
this.carverHorizontalResolution = carverHorizontalResolution;
|
this.carverHorizontalResolution = carverHorizontalResolution;
|
||||||
this.carverVerticalResolution = carverVerticalResolution;
|
this.carverVerticalResolution = carverVerticalResolution;
|
||||||
this.paletteInfoPropertyKey = paletteInfoPropertyKey;
|
this.paletteInfoPropertyKey = paletteInfoPropertyKey;
|
||||||
this.noisePropertiesKey = noisePropertiesKey;
|
this.noisePropertiesKey = noisePropertiesKey;
|
||||||
|
this.slantCalculationMethod = slantCalculationMethod;
|
||||||
|
this.useSlantPalettes = useSlantPalettes;
|
||||||
int maxBlend = pack
|
int maxBlend = pack
|
||||||
.getBiomeProvider()
|
.getBiomeProvider()
|
||||||
.stream()
|
.stream()
|
||||||
@@ -64,6 +71,17 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
|||||||
this.samplerCache = new SamplerProvider(platform, elevationBlend, noisePropertiesKey, maxBlend);
|
this.samplerCache = new SamplerProvider(platform, elevationBlend, noisePropertiesKey, maxBlend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Palette paletteAt(int x, int y, int z, Sampler3D sampler, BiomePaletteInfo paletteInfo, int depth) {
|
||||||
|
SlantHolder slantHolder = paletteInfo.slantHolder();
|
||||||
|
if(useSlantPalettes && slantHolder.isAboveDepth(depth)) {
|
||||||
|
double slant = slantCalculationMethod.slant(sampler, x, y, z);
|
||||||
|
if(slantHolder.isInSlantThreshold(slant)) {
|
||||||
|
return slantHolder.getPalette(slant).getPalette(y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return paletteInfo.paletteHolder().getPalette(y);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("try")
|
@SuppressWarnings("try")
|
||||||
public void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WorldProperties world,
|
public void generateChunkData(@NotNull ProtoChunk chunk, @NotNull WorldProperties world,
|
||||||
@@ -104,8 +122,7 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
|||||||
|
|
||||||
if(sampler.sample(x, y, z) > 0) {
|
if(sampler.sample(x, y, z) > 0) {
|
||||||
if(carver.sample(x, y, z) <= 0) {
|
if(carver.sample(x, y, z) <= 0) {
|
||||||
data = PaletteUtil
|
data = paletteAt(x, y, z, sampler, paletteInfo, paletteLevel)
|
||||||
.getPalette(x, y, z, sampler, paletteInfo, paletteLevel)
|
|
||||||
.get(paletteLevel, cx, y, cz, seed);
|
.get(paletteLevel, cx, y, cz, seed);
|
||||||
chunk.setBlock(x, y, z, data);
|
chunk.setBlock(x, y, z, data);
|
||||||
paletteLevel++;
|
paletteLevel++;
|
||||||
@@ -133,10 +150,10 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
|||||||
|
|
||||||
BiomePaletteInfo paletteInfo = biome.getContext().get(paletteInfoPropertyKey);
|
BiomePaletteInfo paletteInfo = biome.getContext().get(paletteInfoPropertyKey);
|
||||||
|
|
||||||
int fdX = FastMath.floorMod(x, 16);
|
int fdX = Math.floorMod(x, 16);
|
||||||
int fdZ = FastMath.floorMod(z, 16);
|
int fdZ = Math.floorMod(z, 16);
|
||||||
|
|
||||||
Palette palette = PaletteUtil.getPalette(fdX, y, fdZ, sampler, paletteInfo, 0);
|
Palette palette = paletteAt(fdX, y, fdZ, sampler, paletteInfo, 0);
|
||||||
double noise = sampler.sample(fdX, y, fdZ);
|
double noise = sampler.sample(fdX, y, fdZ);
|
||||||
if(noise > 0) {
|
if(noise > 0) {
|
||||||
int level = 0;
|
int level = 0;
|
||||||
@@ -156,13 +173,10 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double getSlant(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) {
|
public double getSlant(int x, int y, int z, WorldProperties world, BiomeProvider biomeProvider) {
|
||||||
int fdX = FastMath.floorMod(x, 16);
|
int fdX = Math.floorMod(x, 16);
|
||||||
int fdZ = FastMath.floorMod(z, 16);
|
int fdZ = Math.floorMod(z, 16);
|
||||||
return biomeProvider.getBiome(x, y, z, world.getSeed())
|
Sampler3D sampler = samplerCache.get(x, z, world, biomeProvider);
|
||||||
.getContext()
|
return slantCalculationMethod.slant(sampler, fdX, y, fdZ);
|
||||||
.get(paletteInfoPropertyKey)
|
|
||||||
.slantHolder()
|
|
||||||
.calculateSlant(samplerCache.get(x, z, world, biomeProvider), fdX, y, fdZ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SamplerProvider samplerProvider() {
|
public SamplerProvider samplerProvider() {
|
||||||
|
|||||||
-29
@@ -1,29 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2020-2021 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.chunkgenerator.generation.math;
|
|
||||||
|
|
||||||
import com.dfsek.terra.addons.chunkgenerator.palette.BiomePaletteInfo;
|
|
||||||
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D;
|
|
||||||
import com.dfsek.terra.addons.chunkgenerator.palette.slant.SlantHolder;
|
|
||||||
import com.dfsek.terra.api.world.chunk.generation.util.Palette;
|
|
||||||
|
|
||||||
|
|
||||||
public final class PaletteUtil {
|
|
||||||
|
|
||||||
public static Palette getPalette(int x, int y, int z, Sampler3D sampler, BiomePaletteInfo paletteInfo, int depth) {
|
|
||||||
SlantHolder slantHolder = paletteInfo.slantHolder();
|
|
||||||
if(slantHolder.isAboveDepth(depth)) {
|
|
||||||
double slant = slantHolder.calculateSlant(sampler, x, y, z);
|
|
||||||
if(slantHolder.isInSlantThreshold(slant)) {
|
|
||||||
return slantHolder.getPalette(slant).getPalette(y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return paletteInfo.paletteHolder().getPalette(y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+69
@@ -0,0 +1,69 @@
|
|||||||
|
package com.dfsek.terra.addons.chunkgenerator.generation.math;
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D;
|
||||||
|
import com.dfsek.terra.api.util.vector.Vector3;
|
||||||
|
|
||||||
|
|
||||||
|
public enum SlantCalculationMethod {
|
||||||
|
DotProduct {
|
||||||
|
private static final Vector3 DOT_PRODUCT_DIRECTION = Vector3.of(0, 1, 0);
|
||||||
|
|
||||||
|
private static final Vector3[] DOT_PRODUCT_SAMPLE_POINTS = {
|
||||||
|
Vector3.of(0, 0, -DERIVATIVE_DIST),
|
||||||
|
Vector3.of(0, 0, DERIVATIVE_DIST),
|
||||||
|
Vector3.of(0, -DERIVATIVE_DIST, 0),
|
||||||
|
Vector3.of(0, DERIVATIVE_DIST, 0),
|
||||||
|
Vector3.of(-DERIVATIVE_DIST, 0, 0),
|
||||||
|
Vector3.of(DERIVATIVE_DIST, 0, 0)
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double slant(Sampler3D sampler, double x, double y, double z) {
|
||||||
|
Vector3.Mutable normalApproximation = Vector3.Mutable.of(0, 0, 0);
|
||||||
|
for(Vector3 point : DOT_PRODUCT_SAMPLE_POINTS) {
|
||||||
|
var scalar = -sampler.sample(x + point.getX(), y + point.getY(), z + point.getZ());
|
||||||
|
normalApproximation.add(point.mutable().multiply(scalar));
|
||||||
|
}
|
||||||
|
return DOT_PRODUCT_DIRECTION.dot(normalApproximation.normalize());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean floorToThreshold() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
Derivative {
|
||||||
|
@Override
|
||||||
|
public double slant(Sampler3D sampler, double x, double y, double z) {
|
||||||
|
double baseSample = sampler.sample(x, y, z);
|
||||||
|
|
||||||
|
double xVal1 = (sampler.sample(x + DERIVATIVE_DIST, y, z) - baseSample) / DERIVATIVE_DIST;
|
||||||
|
double xVal2 = (sampler.sample(x - DERIVATIVE_DIST, y, z) - baseSample) / DERIVATIVE_DIST;
|
||||||
|
double zVal1 = (sampler.sample(x, y, z + DERIVATIVE_DIST) - baseSample) / DERIVATIVE_DIST;
|
||||||
|
double zVal2 = (sampler.sample(x, y, z - DERIVATIVE_DIST) - baseSample) / DERIVATIVE_DIST;
|
||||||
|
double yVal1 = (sampler.sample(x, y + DERIVATIVE_DIST, z) - baseSample) / DERIVATIVE_DIST;
|
||||||
|
double yVal2 = (sampler.sample(x, y - DERIVATIVE_DIST, z) - baseSample) / DERIVATIVE_DIST;
|
||||||
|
|
||||||
|
return Math.sqrt(
|
||||||
|
((xVal2 - xVal1) * (xVal2 - xVal1)) + ((zVal2 - zVal1) * (zVal2 - zVal1)) + ((yVal2 - yVal1) * (yVal2 - yVal1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean floorToThreshold() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private static final double DERIVATIVE_DIST = 0.55;
|
||||||
|
|
||||||
|
public abstract double slant(Sampler3D sampler, double x, double y, double z);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Controls whether palettes should be applied before or after their respective thresholds.
|
||||||
|
*
|
||||||
|
* If true, slant values will map to the palette of the next floor threshold, otherwise they
|
||||||
|
* will map to the ceiling.
|
||||||
|
*/
|
||||||
|
public abstract boolean floorToThreshold();
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user