Compare commits

..

424 Commits

Author SHA1 Message Date
Zoë Gidiere 18cb08b622 Update Mapping.java 2025-03-06 21:45:23 +00:00
Zoë Gidiere 1b15694878 Merge pull request #490 from AllayMC/dev/allay-api-0.2.0
feat: adapt allay-api 0.2.0
2025-03-06 21:32:44 +00:00
Dmitry Luk 267994427e fix: .gitignore 2025-03-07 01:05:15 +04:00
Dmitry Luk 248eb174d8 refactor: use submodules 2025-03-07 01:02:32 +04:00
Dmitry Luk 0a93b0fac3 fix: apply project code style 2025-03-07 00:39:22 +04:00
Dmitry Luk 03124cb008 refactor: mappings loading
docs: add how to use in README.md
2025-03-06 15:22:04 +04:00
Dmitry Luk 14a07602ee fix: correct bundle mapping [
6808d0e](https://github.com/GeyserMC/mappings/commit/6808d0e16a85e5e569d9d7f89ace59c73196c1f4)
chores: sort je default states and add new
2025-03-03 16:23:54 +04:00
daoge_cmd 167a712c0e feat: adapt allay-api 0.2.0 2025-03-03 19:52:25 +08:00
Zoë Gidiere 83bc2c9022 Bump Version 2025-03-02 06:42:12 -07:00
Zoë Gidiere 06a60b3db4 Merge pull request #489 from RitaSister/patch-1
fix crash chunk generate column in generate chunk process
2025-03-02 06:41:41 -07:00
Mirai 1b4824c5db fix crash chunk generate column in generate chunk process
The change removes the subtraction of one from properties.getMinHeight(), fixing a crash on version 1.21.4.
2025-03-02 09:57:48 +02:00
Zoë Gidiere 49c6e70037 try catch downloading packs for offline usage 2025-03-01 10:48:58 -07:00
Zoë Gidiere c36b12e657 Fix Vanilla Features Spawning in Terra Biomes 2025-03-01 10:48:42 -07:00
Zoë Gidiere 9906771fbc Merge pull request #472 from PolyhedralDev/ver/6.6.0
Ver/6.6.0
2025-02-28 04:31:06 +00:00
Zoe Gidiere e0a26046a0 Update Fabric version info 2025-02-27 19:51:18 -07:00
Zoe Gidiere 8bad33ef22 fabric 1.21.4 2025-02-27 19:33:51 -07:00
Zoë Gidiere f278ae7ab5 update licence 2025-02-26 22:34:41 -07:00
Zoë Gidiere a61c6b8a97 Merge remote-tracking branch 'everbuild-org/feat/platform/minestom' into ver/6.6.0 2025-02-26 10:22:37 -07:00
Zoë Gidiere 830ede9272 Merge pull request #484 from AllayMC/dev/allay-update
fix: adapt allay update
2025-02-26 10:20:43 -07:00
Zoë Gidiere 8e544a68d4 Merge pull request #483 from PolyhedralDev/dev/1.21.4
Add support for 1.21.4 on Paper
2025-02-26 10:20:25 -07:00
daoge_cmd e8e9f69fac feat: use allay-api 0.1.3 2025-01-26 19:48:23 +08:00
Christian Bergschneider 3a7d1a69d0 feat: use system property for configurable data folder path
Updated `getDataFolder` to allow customization via the `terra.datafolder` system property. This ensures greater flexibility for specifying the data folder location, while maintaining the default path if the property is not set.
2025-01-25 04:42:52 +01:00
Christian Bergschneider 7b29d25847 fix: remove unused application plugin from Minestom platform build script 2025-01-05 17:04:27 +01:00
Christian Bergschneider 810d10ac0a fix: move minestom example to own module 2025-01-05 16:58:28 +01:00
Christian Bergschneider aecc003f23 fix: minestom and slf4j as transitive dependencies 2025-01-05 16:49:20 +01:00
Christian Bergschneider d0bc006faa chore: reformat 2025-01-04 20:42:54 +01:00
daoge 98aadc816b feat: use allay-api 0.1.2 2025-01-04 17:49:38 +08:00
Christian Bergschneider 992ae592fd fix: Implement GeneratorWrapper interface in Minestom wrapper 2025-01-04 00:14:32 +01:00
Christian Bergschneider 7711e67999 feat: support reload 2025-01-04 00:10:35 +01:00
Christian Bergschneider 35bdc99873 build: make available via maven repo 2025-01-03 23:52:31 +01:00
Christian Bergschneider 5ba5d6efdd revert: block type implementation hint 2025-01-03 22:19:08 +01:00
Christian Bergschneider c848c33bc0 fix: add lighting engine to test server 2025-01-03 17:28:47 +01:00
Christian Bergschneider ff153ddc21 feat: allow external block entity implementations 2025-01-02 23:22:44 +01:00
Christian Bergschneider cb2841ed4f fix: Adjust progress bar update interval to every 60 ticks. 2025-01-02 20:54:56 +01:00
Christian Bergschneider 4f668adb67 feat: add chunk filtering for debugging and remove feature caching
Removed Feature caching since it was buggy asf
2025-01-02 20:49:07 +01:00
Christian Bergschneider 1d8a208d10 feat: implement platform enchantments 2025-01-02 19:32:14 +01:00
Christian Bergschneider 6279638363 feat: implement platform biome 2025-01-02 12:27:40 +01:00
Christian Bergschneider 23b846eca9 feat: get faster generation times 2025-01-02 00:48:26 +01:00
Christian Bergschneider d1f881ca2c feat: minestom entities 2025-01-01 20:39:09 +01:00
Christian Bergschneider b4ab3769b0 Merge branch 'ver/6.6.0' into feat/platform/minestom 2025-01-01 18:48:48 +01:00
Christian Bergschneider d5ab3e23f5 feat: better example server 2025-01-01 18:41:33 +01:00
Christian Bergschneider 3a28551e97 fix: generate populators in every chunk 2024-12-29 18:55:47 +01:00
Christian Bergschneider ac66fc7d69 fix: different populators now know about each other 2024-12-29 15:51:05 +01:00
Christian Bergschneider bfc1c32d46 feat: surface decoration generation but only in even chunks 2024-12-29 15:17:35 +01:00
Christian Bergschneider fa6e0e0ae4 feat: feature generation but only in even chunks 2024-12-28 21:41:51 +01:00
Christian Bergschneider f953c5085d feat: start generating features 2024-12-28 20:05:50 +01:00
Christian Bergschneider 7288373dbc feat: cache generated chunks
This commit is in preparation of multi-layered worldgen with minestom
2024-12-28 18:18:17 +01:00
Christian Bergschneider 983cb1f012 feat: base terrain generation with minestom 2024-12-28 12:22:07 +01:00
daoge_cmd 944c04b9b8 feat: use allay-api 0.1.0 2024-12-23 00:43:51 +08:00
Dmitry Luk 73a2c70794 chores: pretty-print biomes.json 2024-12-17 13:53:18 +04:00
daoge_cmd 088523222d chores: remove unrelated code reformatting 2024-12-17 13:17:11 +08:00
daoge_cmd 6badce6bc7 chores: use pretty print for je_block_default_states.json 2024-12-17 12:48:24 +08:00
daoge_cmd 92a5134458 revert: revert code format related changes 2024-12-17 12:43:46 +08:00
daoge_cmd 4222eef531 deps: use specified allay-api version 2024-12-17 12:31:03 +08:00
Dmitry Luk 9b6a503f31 fix: adapt allay update
* feat: update mapping files to latest
2024-12-16 23:28:19 +04:00
OakLoaf 82a9ecf736 Fixed typo 2024-12-12 15:24:38 +00:00
OakLoaf eec4db43b2 Added support for 1.21.4 2024-12-12 12:40:33 +00:00
OakLoaf 1d3c380784 Reverted to old methods grass and foliage color methods 2024-11-05 16:50:04 +00:00
OakLoaf 65e4c9a149 Removed comment 2024-11-01 19:46:34 +00:00
OakLoaf d4549643fc The definition of AwfulBukkitHacks 2024-11-01 16:46:33 +00:00
OakLoaf a87ad8c966 Bumped Paper version 2024-11-01 16:10:36 +00:00
OakLoaf 153f6e5a87 Recreated old reset tags method 2024-11-01 13:36:41 +00:00
OakLoaf a385a43250 Moved registry unfreeze 2024-11-01 12:02:49 +00:00
OakLoaf 3cd6aead64 Changed biome registry casting 2024-11-01 12:02:32 +00:00
OakLoaf 4f33b11828 Fixed issue with RegistryFetcher 2024-11-01 12:02:09 +00:00
OakLoaf f5bbaa3c3a Corrected class proxy 2024-11-01 11:57:35 +00:00
Zoe Gidiere 4fd84a3f2d Fix paralithic relocating 2024-10-31 13:42:41 -06:00
Zoë Gidiere bed67c211d Merge pull request #478 from PolyhedralDev/dev/let-expression
Add let expression support
2024-10-30 18:51:05 +00:00
Astrash 2c8d3416ab Load parse options before registering metaconfig 2024-10-30 14:04:40 +11:00
Astrash 5e43f0afef Add support for Paralithic let expressions 2024-10-30 14:04:40 +11:00
Zoe Gidiere 02fdcee705 Fix fabric 2024-10-29 20:24:32 -06:00
Zoe Gidiere 4165224c51 Mark Cache Sampler Experimental 2024-10-29 16:04:55 -06:00
Zoe Gidiere 710bbc33c9 Refractor bukkit to v1_21_3 2024-10-29 15:53:48 -06:00
Zoë Gidiere 1929239015 Merge pull request #473 from PolyhedralDev/dev/biomes3
Some refractors and updates to platofrm biomes
2024-10-29 20:27:42 +00:00
Zoe Gidiere 3ca90808f0 Fix up 2024-10-29 14:23:45 -06:00
Zoe Gidiere 9d91440997 fixup 2024-10-29 14:14:25 -06:00
Zoe Gidiere f98062d417 Merge remote-tracking branch 'origin/dev/bukkit/biome-settings' into dev/biomes3 2024-10-29 13:53:08 -06:00
OakLoaf 8df3a4dd02 Added NMSAddon override for BukkitAddon 2024-10-29 19:38:59 +00:00
OakLoaf afd2c81b19 Made grass colour use default if none is defined 2024-10-29 18:31:37 +00:00
Zoë Gidiere 4432ae4867 Merge pull request #476 from AllayMC/dev/support-world-unload
feat: support world unloading
2024-10-28 18:18:23 +00:00
daoge_cmd 16c951838b feat: support world unloading 2024-10-28 17:39:25 +08:00
OakLoaf 8de4f1198a Started adding more biome settings to bukkit 2024-10-26 10:02:32 +01:00
Zoe Gidiere 144c932703 mixin tweak 2024-10-25 16:09:42 -06:00
Zoë Gidiere e56b8856fa Merge pull request #474 from AllayMC/allay
feat: add support for allay platform
2024-10-25 16:05:58 -06:00
Zoë Gidiere 04f6d18198 Merge pull request #470 from PolyhedralDev/dev/1.21.2
Dev/1.21.2
2024-10-25 14:09:16 -06:00
Zoe Gidiere 640645b96b fix version 2024-10-25 14:03:27 -06:00
Zoe Gidiere a70738eda5 Version updates 2024-10-25 13:58:33 -06:00
OakLoaf 62756d2784 Updated Bukkit to support 1.21.3 2024-10-25 19:36:18 +01:00
Zoe Gidiere 32f8907cb1 Merge branch 'ver/6.6.0' into dev/1.21.2 2024-10-25 12:28:03 -06:00
Astrash b75e9c152e Refactor palette addon 2024-10-18 19:29:48 +11:00
Astrash c190485dbe Use more appropriate names in probability collection loader 2024-10-18 17:50:41 +11:00
Astrash e756953828 Use singleton impl for map based probability collections 2024-10-18 17:49:07 +11:00
daoge 071f9d39af docs: fix a typo in README.md 2024-10-15 10:03:54 +08:00
daoge_cmd d2107fd258 fix: chunkGenerator should be overwritten after reloading 2024-10-14 22:37:09 +08:00
daoge_cmd df3e623530 feat: implement config pack reloading 2024-10-14 22:13:54 +08:00
daoge_cmd f0d03d4538 feat: fallback to FLAT generator if config pack name is missing 2024-10-14 21:34:23 +08:00
daoge_cmd 84fe8792d6 fix: fix entrance in plugin.json 2024-10-14 21:33:59 +08:00
daoge_cmd 67fc2ba4dc docs: remove useless TODOs 2024-10-14 21:21:54 +08:00
daoge_cmd 8d63c40e2f refactor: replace 'var' with explicit type 2024-10-14 21:13:00 +08:00
daoge_cmd b0bc37c34d refactor: remove version info in mapping files 2024-10-14 21:05:06 +08:00
daoge_cmd f2c5c15650 refactor: use com.dfsek as the new package name 2024-10-14 21:02:07 +08:00
daoge_cmd f5de88215c build: use fixed allay api version 2024-10-14 21:00:15 +08:00
daoge_cmd 8a6ad95947 refactor: delombok and move version info to Versions.kt 2024-10-14 20:55:11 +08:00
daoge_cmd cc14c716bf build: move repo declaration to DependencyConfig.kt 2024-10-14 20:36:40 +08:00
daoge_cmd ece5213a87 feat: use macro in plugin.json and update author list 2024-10-14 11:33:40 +08:00
daoge_cmd a01f700653 build: rollback github action file changes 2024-10-14 11:24:54 +08:00
daoge_cmd 0ca7171bae docs: add README.md to allay platform 2024-10-14 11:23:59 +08:00
daoge_cmd 6261f0849c feat: remove java version declaration in allay platform as all platforms are in java 21 now 2024-10-14 11:23:27 +08:00
daoge 4fc24f022f Merge branch 'PolyhedralDev:master' into allay 2024-10-14 11:07:34 +08:00
daoge_cmd 61ed302137 feat: adapting terra 6.5.1 (WIP) 2024-10-14 11:07:12 +08:00
Zoe Gidiere 053ec39b7b Merge branch 'master' into ver/6.6.0 2024-10-13 16:32:26 -06:00
Zoe Gidiere 0a952cff4c bump build number 2024-10-13 16:06:35 -06:00
Zoe Gidiere 12faae8fd5 Use reflection remapper for worldGenContext on bukkit
How this even worked before astounds me
2024-10-13 15:55:29 -06:00
daoge_cmd 1496f2c929 build: update jitpack repo link 2024-10-13 15:41:03 +08:00
Zoe Gidiere 40a938be19 Merge branch 'ver/6.6.0' into dev/biomes3 2024-10-12 15:44:19 -06:00
Zoe Gidiere 4be2390294 Small cache fix 2024-10-12 15:43:23 -06:00
Zoe Gidiere da16f65ea2 Merge branch 'ver/6.6.0' into dev/biomes3 2024-10-12 15:39:03 -06:00
Zoe Gidiere 65d026a130 Fix Cache Deadlock 2024-10-12 15:38:51 -06:00
Zoe Gidiere d45256b2f7 Another merge fixup 2024-10-12 14:52:11 -06:00
Zoe Gidiere 16d8e8f29d Fix up merge 2024-10-12 14:49:53 -06:00
Zoe Gidiere a58b2a5193 Merge remote-tracking branch 'origin/dev/biome2' into ver/6.6.0 2024-10-12 14:40:33 -06:00
Zoe Gidiere 1e5a1e20c2 Merge remote-tracking branch 'origin/master' into ver/6.6.0 2024-10-12 14:29:42 -06:00
Zoë Gidiere 592788450c Update CODEOWNERS 2024-10-12 13:45:55 -06:00
Zoë Gidiere 060cbfd0c4 Update CODEOWNERS 2024-10-12 13:44:02 -06:00
Zoe Gidiere b9c2f4e63b Update Licence year 2024-10-12 02:03:43 -06:00
Zoe Gidiere 87674aa0ba fix cellular sampler 2024-10-12 02:02:28 -06:00
Zoe Gidiere 40ccf80c7f Optimization when Terra Profiler is not running
Do not set Profiler SAFE Threadlocal var when profiler is not running but ensure it is set to false after the profiler stops to ensure consistent behavior
2024-10-12 00:58:08 -06:00
Zoe Gidiere 6946755e31 Minor Cellular opt 2024-10-12 00:56:37 -06:00
Zoë Gidiere 3b9962662e Merge pull request #471 from PolyhedralDev/dev/caching
Dev/caching
2024-10-12 00:22:43 -06:00
Zoe Gidiere 7ca61f82b2 Some API clean up 2024-10-12 00:22:18 -06:00
Zoe Gidiere 6851999926 Some refactoring 2024-10-11 19:45:12 -06:00
Zoe Gidiere 585967157d 1.21.2-pre3 2024-10-11 18:40:59 -06:00
Zoe Gidiere 305255511d More cache improvements 2024-10-11 18:27:37 -06:00
Zoe Gidiere 819be16d83 Merge branch 'dev/cli' into dev/caching 2024-10-11 16:40:26 -06:00
Zoe Gidiere 8a028b193a Add no save option 2024-10-11 16:35:26 -06:00
Zoe Gidiere d31679e6be remove stuff from example 2024-10-11 16:06:40 -06:00
Zoe Gidiere 9d328b12b3 More cache improvements 2024-10-11 16:06:23 -06:00
Zoe Gidiere a743e9c015 Merge branch 'dev/cli' into dev/caching 2024-10-11 15:16:20 -06:00
Zoe Gidiere 43d52e4bc1 CLI Improvements 2024-10-11 15:16:04 -06:00
Zoe Gidiere accc07fa07 Bump Version 2024-10-11 15:15:38 -06:00
Zoe Gidiere c1d3155ddd Cache Improvements 2024-10-11 15:15:10 -06:00
Zoe Gidiere 9a01a6c6a0 more WIP on cache 2024-10-11 00:20:46 -06:00
Zoe Gidiere 3033fbbf29 Fix a ton of fabric impl bugs 2024-10-10 16:49:40 -06:00
Zoe Gidiere c78a984a11 Update to pre2 2024-10-10 14:02:53 -06:00
Zoe Gidiere 1ae0d1f867 WIP Caching Hints and Caching Sampler 2024-10-09 23:36:12 -06:00
Zoe Gidiere be7e10c30c Fix runtime errors 2024-10-09 16:41:04 -06:00
Zoe Gidiere 2ccf8a8805 1.21.2-pre1 builds 2024-10-09 16:18:47 -06:00
Zoe Gidiere 197cb12be2 Update fabric versions to 1.21.2-pre1 2024-10-09 15:28:52 -06:00
Zoe Gidiere adb43dcaa8 Gradle update 2024-10-09 15:17:09 -06:00
Zoe Gidiere b03d128913 Addon dependency updates 2024-10-09 14:01:24 -06:00
Zoe Gidiere 725fa88466 Remap fabric 2024-10-09 14:01:12 -06:00
Zoe Gidiere 370b2e0122 Fix import 2024-10-09 13:01:54 -06:00
Zoe Gidiere 331075e54d Refractor name 2024-10-09 12:59:19 -06:00
Zoë Gidiere 973590f5fd Add parameter to turn off salting cellular lookup
another updated astrash commit
2024-10-09 12:42:24 -06:00
Astrash 1a5ab6b505 Add meta annotations 2024-10-09 12:42:13 -06:00
Astrash 14732328cd Add default 'from' values for linear map template 2024-10-09 12:41:55 -06:00
Zoë Gidiere 6c7974c302 Implement linear map normalizer
Updated astrash commit
2024-10-09 12:41:40 -06:00
Zoe Gidiere 1204b7a8c1 ArithmeticSampler Derivatives 2024-10-09 12:37:50 -06:00
Astrash fbe1c76e26 Forgot to include 4th derivative array index for 3D FBM 2024-10-09 21:50:08 +11:00
Astrash add7803e65 Simplify isDifferentiable static method impl 2024-10-09 20:56:37 +11:00
Astrash 4393a16b2f Use proper static isDifferentiable method 2024-10-09 20:56:11 +11:00
Astrash b4fa635455 Ensure throw with incorrect use of SimplexStyle derivatives
This should ensure that in the case an implementation fails to correctly
check isDifferentiable then performs a subsequent derivative based sample,
an error is thrown, rather than potentially missing a logic bug due to
noise of 0 and derivative of 0 being returned which could otherwise be
hard to narrow down.
2024-10-09 20:45:25 +11:00
Astrash 9f425c6159 Add support for derivatives in FBM 2024-10-09 20:39:45 +11:00
Astrash 158ffba2a5 Make FractalNoiseFunction impls support derivatives 2024-10-09 20:39:13 +11:00
Zoë Gidiere b7326c0ff6 Merge pull request #469 from PolyhedralDev/dev/fix-bukkit-spawner
fix spawners on bukkit
2024-09-24 23:27:44 -06:00
Zoe Gidiere f70a83aec3 fix spawners on bukkit 2024-09-24 23:26:49 -06:00
astrsh 589cf83c38 Flip comparison
As per request from @duplexsystem
2024-09-25 14:08:19 +10:00
Zoë Gidiere c374c2d5ef Merge pull request #467 from PolyhedralDev/ver/6.5.0
Ver/6.5.0
2024-09-24 09:41:58 -06:00
Zoe Gidiere 13782bb51e Remforamt 2024-09-24 09:11:43 -06:00
Zoe Gidiere 1aa3ef813c add default sampler to pseudoerosion 2024-09-24 09:05:33 -06:00
Zoe Gidiere 6cc53beecb Fix Sin/Cos 2024-09-23 23:14:35 -06:00
Zoe Gidiere 2c45ba91aa Fix up commit 2024-09-23 22:40:37 -06:00
Zoe Gidiere 6244ffca63 Revert "Sin/Cos Opts"
This reverts commit 1d05f95f74.
2024-09-23 22:38:45 -06:00
Zoe Gidiere 59d943b3ea Revert "Fix build"
This reverts commit 10d723372d.
2024-09-23 22:38:17 -06:00
Zoe Gidiere f605ee1937 Remove Final from psuedoerosion template 2024-09-23 22:35:01 -06:00
Zoe Gidiere f87b7c07d9 Reformat 2024-09-23 22:27:53 -06:00
Zoe Gidiere f1124aae6b Update platform mod file versions and authors 2024-09-23 21:18:47 -06:00
Zoe Gidiere 9c8298fe53 convert pseudoerosion to double 2024-09-23 21:09:19 -06:00
Zoe Gidiere d69b0dba90 reformat 2 2024-09-23 21:06:07 -06:00
Zoe Gidiere 42166d5239 bump version number 2024-09-23 20:59:02 -06:00
Zoe Gidiere d6772f51ea Reformat 2024-09-23 20:56:13 -06:00
Zoe Gidiere f469193909 Make seed affect pseudoerosion hasing 2024-09-23 20:51:00 -06:00
Zoe Gidiere 10d723372d Fix build 2024-09-23 20:45:47 -06:00
Zoe Gidiere 1d05f95f74 Sin/Cos Opts 2024-09-23 20:38:22 -06:00
Zoe Gidiere bd73427072 OpenSimplex 2 Derivative Impl 2024-09-23 20:29:41 -06:00
Zoe Gidiere 017b4608bc Fix build 2024-09-23 19:49:16 -06:00
Zoe Gidiere 5f340f8ffd slight open simplex 2s op\pt 2024-09-23 19:48:22 -06:00
Zoe Gidiere 5b35eb041b Remove temp DerivativeFractl nose 2024-09-23 19:43:56 -06:00
Zoe Gidiere 699d5d1d62 Derivable OpenSimplex2S Impl
baased on https://gist.github.com/KdotJPG/882f36b2ae5ae56a8fc91627ec1c87f4
2024-09-23 19:42:50 -06:00
Zoe Gidiere 07e3d0058d Refractor PseudoErosion 2024-09-23 16:46:48 -06:00
Zoe Gidiere b1ad820e1c Move pseudoerosion to NoiseFunction 2024-09-23 16:37:42 -06:00
Zoe Gidiere 3644ee7fca Implement DerivateNoiseFunction 2024-09-23 16:28:34 -06:00
Zoe Gidiere b14b355c6f Merge branch 'dev/fractal-gavoro-pseudoerosion' into ver/6.5.0 2024-09-21 17:22:47 -06:00
daoge_cmd 6042f1c036 build: update build.gradle.kts 2024-09-21 00:57:18 +08:00
daoge_cmd af2ac64cd4 feat: using the new safe getter api 2024-09-20 19:47:49 +08:00
Zoe Gidiere 06457bf3ce some fixes 2024-09-18 15:43:31 -06:00
Zoe Gidiere b63f5f4a8f Reformat 2024-09-18 12:43:41 -06:00
daoge_cmd 4bad8f702c docs: format javadoc 2024-09-18 13:02:16 +08:00
daoge_cmd 76f12e0cb8 build: prepare for merging 2024-09-18 12:59:30 +08:00
Zoë Gidiere 8cf766e77b Merge pull request #455 from pumken/seasoned-samplers-2
Add salted version of sampler functions in EXPRESSION samplers
2024-09-17 17:59:26 -06:00
Zoe Gidiere a23d624ab9 Merge branch 'dev/1.21.1' into ver/6.5.0 2024-09-17 17:41:25 -06:00
Zoe Gidiere 15a298304e working 1.21.1 2024-09-17 17:40:56 -06:00
Zoe Gidiere 664d1a3191 working 1.20.6 2024-09-17 16:34:30 -06:00
Zoë Gidiere 73047284c8 Merge pull request #461 from OakLoaf/dev/1.21/bukkit
Updated Bukkit to 1.21/1.21.1
2024-09-17 09:43:05 -06:00
daoge_cmd ce9fb53df4 build: disable useless modules 2024-09-17 22:28:04 +08:00
daoge 1f01b99d29 ci: should check allay branch 2024-09-17 20:40:24 +08:00
daoge 18a24562ec ci: upload jar 2024-09-17 20:39:49 +08:00
daoge 2f2d43e1b8 build: disable mixin platform 2024-09-17 20:00:42 +08:00
daoge 6c8a7da254 build: disable mixin platform 2024-09-17 19:59:43 +08:00
daoge ca4461ba2a build: disable bukkit platform 2024-09-17 19:56:45 +08:00
daoge c6df3c302b build: disable fabric platform 2024-09-17 19:56:03 +08:00
daoge 328ebf5aa9 build: disable cli platform 2024-09-17 19:55:20 +08:00
daoge 2c476a25d9 build: fix build for allay platform 2024-09-17 19:45:26 +08:00
daoge b432a4e01d build: use jdk21 for allay platform 2024-09-17 19:39:01 +08:00
daoge f73eadda76 ci: use jdk 21 2024-09-17 19:18:08 +08:00
daoge 1acdad5c6b ci: run github action when pushing 2024-09-17 19:01:41 +08:00
daoge 732a894945 ci: trigger github action 2024-09-17 18:59:53 +08:00
daoge_cmd bbf0915bc9 build: use org.allaymc.allay as the group id 2024-09-07 19:47:19 +08:00
daoge_cmd 5f70ecb943 feat: use jitpack 2024-09-04 23:55:24 +08:00
daoge_cmd 2e709dace6 feat: sync allay 2024-08-27 19:15:42 +08:00
OakLoaf 3bef7d8572 Resolved errors when tab completing 2024-08-26 12:34:08 +01:00
OakLoaf 08df5fc278 Added 1.21.1 support 2024-08-26 11:24:04 +01:00
daoge_cmd c97f25cb95 feat: support 1.21.20 and newer versions 2024-08-23 20:18:45 +08:00
daoge_cmd 28c689d16f feat: fetch allay's changes 2024-08-19 01:36:32 +08:00
daoge_cmd a34946cece feat: return air if block type not found 2024-08-18 19:39:23 +08:00
OakLoaf 922cd35e84 Updated Cloud dependency to v2 2024-08-16 11:07:03 +01:00
daoge_cmd 4acd0de6fa feat: fetch allay's changes 2024-07-24 20:30:24 +08:00
Oak 44d23573b3 Updated dependencies to Paper 1.21 snapshot 2024-07-20 20:17:25 +01:00
daoge_cmd 2443fff0a4 feat: fetch allay's changes 2024-07-17 01:32:01 +08:00
daoge_cmd cd767a648c feat: fetch allay's changes 2024-07-17 01:27:56 +08:00
Oak e7cc275340 Corrected issues with worldGenContext not correctly being set (Ref: https://stackoverflow.com/questions/56039341/get-declared-fields-of-java-lang-reflect-fields-in-jdk12/56043252#56043252) 2024-06-23 14:16:50 +01:00
Oak fddc9a52b9 Temporarily disabled commands whilst awaiting Cloud Framework update 2024-06-19 13:34:35 +01:00
Oak 0758e13bc7 Made patch version optional as not all Minecraft versions have a patch number 2024-06-19 13:33:55 +01:00
daoge_cmd d490324bfc feat: support waterlogged 2024-06-19 18:09:31 +08:00
daoge_cmd 5fa7007d45 fix: fix a typo 2024-06-19 17:19:17 +08:00
daoge_cmd 2d0e4a83b0 fix: OtherChunkAccessibleContext.get/setBlockState() should use level pos instead of chunk local pos 2024-06-19 01:05:37 +08:00
daoge_cmd e68f928e38 feat: use OtherChunkAccessibleContext directly 2024-06-18 14:59:42 +08:00
daoge_cmd 4a3678cea9 feat: update to 1.21 2024-06-18 03:41:17 +08:00
Oak d810cad8d0 Adjusted code for Spigot compatibility 2024-06-17 15:50:06 +01:00
Oak 4e7de501c0 Updated bukkit platform to 1.21 2024-06-16 19:21:34 +01:00
daoge_cmd 6ff0903d83 fix: fix an mistake 2024-06-17 01:21:14 +08:00
daoge_cmd 133df45968 feat: make it works! 2024-06-17 00:37:16 +08:00
daoge_cmd 1f937a2ae0 feat: fake entity 2024-06-16 15:55:28 +08:00
daoge_cmd d861d3e849 feat: more works 2024-06-16 15:48:18 +08:00
daoge_cmd 3d4aec4abb chores: improve imports 2024-06-16 15:03:19 +08:00
daoge_cmd 62e589870d feat: more works 2024-06-16 15:02:42 +08:00
daoge_cmd 2b125414c9 feat: more works 2024-06-16 06:01:38 +08:00
daoge_cmd 59d7632927 feat: add mapping files 2024-06-16 03:30:50 +08:00
daoge_cmd d81f886e8c feat: more works 2024-06-16 03:29:03 +08:00
daoge_cmd b29ba2db70 feat: more works 2024-06-16 01:33:46 +08:00
daoge_cmd 02a7363f01 feat: init work on allay 2024-06-16 00:07:52 +08:00
Oak 9e60db4b0d Updated MinecraftVersionInfo 2024-06-10 11:07:24 +01:00
Oak 4536767794 Updated to 1.20.6 2024-06-03 11:36:50 +01:00
Oak 3fa4b21247 Attempted to fix paper versions 2024-06-02 21:27:07 +01:00
Oak 17acde09a3 Updated Bukkit to 1.20.6 2024-05-31 12:11:07 +01:00
Zoe Gidiere dd272bce64 WIP 1.20.6 2024-05-01 17:04:34 -06:00
Gavin Tran c20b1eaf10 Apply code style fixes 2024-04-21 15:39:48 -04:00
Gavin Tran 72f761678a Add SaltedNoiseFunctions in sampler conversion 2024-04-21 14:54:45 -04:00
Gavin Tran 62317a2f3f Add SaltedNoiseFunctions 2024-04-21 14:48:46 -04:00
Astrash 823afd592b Reduce number of erosion impulses
A reduction of impulse evaluations from 5^2 to 3^2, original algorithm used exponential falloff function which required evaluating impulses from further away to avoid artifacts. I've changed it to a parabolic falloff function which is exactly 0 at the largest possible distance from a cell origin, meaning any cells further than that will not have an effect, preventing said artifacting from occurring. The parabolic function could be replaced with an exponential function (or any other similar easing function) as long as it has an x-intercept at maxCellDistSq. In addition, an option to control whether averaging impulses has been added as it has more of a visual impact with the aforementioned changes.
2024-04-20 15:55:59 +10:00
Astrash ff03b38b81 Derivative API documentation 2024-04-19 21:25:16 +10:00
Astrash 35246d65b9 Require implementing derivable check 2024-04-19 21:07:53 +10:00
Astrash 41652d29df Use proper check for derivative sampler validation 2024-04-19 21:05:52 +10:00
Astrash 142d364682 WIP fractal-gavoro-pseudoerosion 2024-04-19 20:55:14 +10:00
Zoë Gidiere 01e011a9ed UX tweaks to biome config 2024-03-28 14:47:12 -05:00
Zoë 94949c9120 Merge pull request #449 from Browsit/ver/6.5.0
Prevent exception with other world generators
2024-02-23 14:58:51 +00:00
Browsit c52ad56ccc Return null for empty generator IDs 2024-02-02 08:15:37 -05:00
Astrash f3476c5cc8 Add feature stage blending 2024-01-07 17:02:08 +11:00
Astrash 9c181f7ee1 Add ability to disable slant palettes globally 2024-01-06 09:13:02 +11:00
Astrash 271e7f3c69 Fix empty slant holders attempting to calculate slant
This occurs when the NoiseChunkGenerator3D#getSlant method is invoked at
a position where the biome has an empty slant holder, currently possible
when using the slant locator addon.

This is fixed by making slant calculation independent of SlantHolders.
Some minor refactoring has also been done as a result of this change.
2024-01-05 18:42:35 +11:00
Zoë 6681bdfbf2 Merge remote-tracking branch 'origin/master' into ver/6.5.0 2023-12-24 22:39:06 -06:00
dfsek ab60f14ff1 Merge pull request #444 from PolyhedralDev/dev/fix-lerp
6.4.3 - Fix lerp (urgent)
2023-12-24 02:15:54 -07:00
dfsek d8ba9e1016 bump version 2023-12-24 02:06:11 -07:00
dfsek 3622003a39 fix other lerp issues 2023-12-24 02:02:46 -07:00
dfsek 84cd96ecf7 fix BrownianMotionSampler lerp usage 2023-12-24 01:53:05 -07:00
Zoë 8afda7424c Merge branch 'master' into ver/6.5.0 2023-12-22 15:02:53 -06:00
Zoë da4ab8b71c Merge pull request #441 from PolyhedralDev/ver/6.4.2
Ver/6.4.2
2023-12-18 13:01:36 -07:00
Zoë Gidiere 3745c3e947 fix typos 2023-12-17 15:32:35 -07:00
Zoë Gidiere fd20837b55 fix error on startup 2023-12-17 15:29:18 -07:00
Zoë Gidiere 0091e5b785 spell check 2023-12-10 18:50:40 -07:00
Zoë Gidiere 41045ae8aa literally forgor the most important part 2023-12-10 18:47:12 -07:00
Zoë Gidiere 4a83f01c1f fix incase mods are used 2023-12-10 18:44:26 -07:00
Zoë Gidiere fc764a0fb3 fix issues with spawners and entity parsing 2023-12-10 18:40:43 -07:00
Zoë Gidiere 22c46f2f80 Pin OWConfig Version 2023-12-10 17:45:52 -07:00
Zoë Gidiere f408faaa80 reformat 2023-12-10 17:07:18 -07:00
Zoë Gidiere 0ad7ee4f9f fix CME 2023-12-10 16:57:27 -07:00
Zoë Gidiere 1e55074cfa Enforce NMS bindings 2023-12-10 15:46:00 -07:00
Zoë 2a92d76276 Merge pull request #437 from PolyhedralDev/dev/1.20.3
Dev/1.20.3
2023-12-09 15:13:11 -07:00
Zoë Gidiere 687ad5db59 Final dep update
confirmed working on paper and fabric
2023-12-09 15:00:46 -07:00
Zoë Gidiere f9c9789016 remove unused maven repo 2023-12-09 01:16:38 -07:00
Zoë Gidiere 3142c2a4f0 update paper to 1.20.4 2023-12-08 22:57:01 -07:00
Zoë Gidiere b5532b7679 Merge branch 'ver/6.4.2' into dev/1.20.3 2023-12-08 22:31:12 -07:00
Zoë Gidiere 8af299d09c fix path of vale ignore 2023-12-08 22:31:04 -07:00
Zoë Gidiere 5cf8a5061d Merge branch 'ver/6.4.2' into dev/1.20.3 2023-12-08 22:11:57 -07:00
Zoë Gidiere 017876475e Add Vale config to gitignore 2023-12-08 22:11:48 -07:00
Zoë Gidiere d88e4f1f9b fix stupid error
thank you caffeine mc peeps
2023-12-08 19:57:05 -07:00
Zoë Gidiere 17eac505a0 Merge branch 'ver/6.4.2' into dev/1.20.3 2023-12-07 11:29:31 -07:00
Zoë Gidiere 8043814138 pull up version range of fabric 2023-12-07 11:29:19 -07:00
Zoë Gidiere 554887ab54 build fabric against 1.20.4 2023-12-07 11:27:06 -07:00
Zoë Gidiere 2f46a01adc Merge remote-tracking branch 'origin/master' into ver/6.4.2 2023-12-07 00:34:00 -07:00
Zoë Gidiere a1db0574e9 Merge branch 'ver/6.4.2' into dev/1.20.3 2023-12-07 00:33:45 -07:00
Zoë fd6decc706 Merge pull request #439 from PolyhedralDev/dev/github-actions
Create gradle-build.yml
2023-12-06 23:11:33 -07:00
Zoë Gidiere 0ba0d472e6 seems arch loom auto uses vineflower now 2023-12-06 22:47:35 -07:00
Zoë Gidiere 11b03eb93d actually bump bukkit version 2023-12-06 22:27:26 -07:00
Zoë Gidiere 46ca45cb1d fix bukkit build 2023-12-06 22:25:53 -07:00
Zoë Gidiere 4e5b066b91 add bukkit grass workaround 2023-12-06 22:24:55 -07:00
Zoë Gidiere db8df9741f bukkit 1.20.3 2023-12-06 22:22:18 -07:00
Zoë Gidiere 80c52870f5 add additional spigot warning 2023-12-06 12:00:03 -07:00
Zoë Gidiere 5048bc8ede Remove folialib 2023-12-06 10:52:31 -07:00
Zoë Gidiere fc0d7374e4 remove old bukkit versions 2023-12-06 10:14:43 -07:00
Zoë Gidiere e4c3affb9f pull up version range 2023-12-05 20:11:00 -07:00
Zoë Gidiere e160cae3d8 reformat 2023-12-05 20:04:08 -07:00
Zoë Gidiere cb9aa4f167 fix permissions 2023-12-05 19:53:05 -07:00
Zoë Gidiere b612d1c7aa fix name 2023-12-05 19:52:50 -07:00
Zoë Gidiere e4df8dce1d proper gradle cache 2023-12-05 19:52:12 -07:00
Zoë Gidiere 601d174720 pin versions and remove dead lines 2023-12-05 19:44:00 -07:00
Zoë 3339d08e11 Create gradle-build.yml 2023-12-05 19:35:23 -07:00
Zoë Gidiere bc65015af0 update gradle 2023-12-05 18:53:19 -07:00
Zoë Gidiere 913637b0a5 update deps 2023-12-05 18:29:43 -07:00
Zoë Gidiere 86f2356cc8 Merge branch 'ver/6.4.2' into ver/6.5.0 2023-11-27 17:55:40 -07:00
Zoë 55d09818f7 Merge pull request #436 from PolyhedralDev/dev/flatten-biome-array
Dev/flatten biome array
2023-11-27 17:54:38 -07:00
Zoë Gidiere aecdcd578c initial 1.20.3
also disable forge. we're not publishing it anyway
2023-11-27 13:35:48 -07:00
Zoë Gidiere 382069b094 Bump Version to 6.4.2 2023-11-27 11:35:06 -07:00
Zoë Gidiere 734d4bfb94 reformat 2023-11-27 11:31:20 -07:00
Zoë Gidiere c82e015559 flatten array for pipeline biomes 2023-11-27 11:31:11 -07:00
Astrash ffb1198da2 Merge branch 'master' into ver/6.5.0 2023-11-25 12:33:51 +11:00
Astrash 2c211f0aa6 Merge branch 'master' into ver/6.5.0 2023-11-25 12:29:54 +11:00
Astrashh 3aef977384 Patch version 6.4.1 (#435)
* Bump version to 6.4.1

* fix fabric dev env

* Invert exposed ore logic (#433)

* Invert exposed ore logic

* Bump ore addon version

* Use logger in Gradle over println (#434)

* Log info instead of println in gradle scripts

* Missed buildSrc printlns

---------

Co-authored-by: Zoë <duplexsys@protonmail.com>
2023-11-25 01:02:45 +00:00
Zoë 6060ceae57 Merge pull request #432 from PolyhedralDev/dev/codeowners
update condeowners
2023-11-18 10:05:10 +00:00
Zoë Gidiere 0efb0916e6 Initial Bukkit Biome Config 2023-11-17 16:16:18 -07:00
Zoë Gidiere 82fbf796da Refractor BiomeUtil 2023-11-17 15:26:53 -07:00
Zoë Gidiere 94bf67d09d fix dev env by having fabric api at runtime 2023-11-17 14:57:14 -07:00
Zoë Gidiere e499ddebd4 update condeowners 2023-11-17 13:34:56 -07:00
Zoë Gidiere f86d4bae32 remove old bukkit versions 2023-11-17 13:22:10 -07:00
Zoë Gidiere c7cecaebe6 Merge remote-tracking branch 'origin/dev/biome2' into ver/6.5.0 2023-11-17 13:21:39 -07:00
Zoë Gidiere 866d527d35 bump version 2023-11-17 13:11:28 -07:00
Zoë 4f706f5502 Merge pull request #430 from PolyhedralDev/ver/6.4.0
We've had one, yes. What about second build issue?
2023-11-17 19:12:52 +00:00
Zoë Gidiere fe954a7b2b We've had one, yes. What about second build issue? 2023-11-17 12:12:13 -07:00
Zoë 15e72bae35 Merge pull request #429 from PolyhedralDev/ver/6.4.0
fix building
2023-11-17 18:07:22 +00:00
Zoë Gidiere 513c2df9f9 fix building
for real this time
2023-11-17 11:06:41 -07:00
Zoë aec00d9169 Merge pull request #428 from PolyhedralDev/ver/6.4.0
Ver/6.4.0 2: Electric Boogaloo
2023-11-13 23:07:22 +00:00
Zoë Gidiere 540552d301 Partially Revert "Fix stupid build error and a couple gradle warnings"
This reverts commit 77812545df.
2023-11-13 15:22:09 -07:00
Zoë Gidiere 4dfe2054e9 Revert "Actually fix issue"
This reverts commit 0b1d67b533.
2023-11-13 15:21:17 -07:00
Zoë Gidiere 16e61098d9 depend on fabric api 2023-11-13 15:08:15 -07:00
Zoë Gidiere 8aecf6b97f don't include fabric api 2023-11-13 15:05:21 -07:00
Zoë Gidiere 4788483139 remove gc flags from build 2023-11-13 15:04:44 -07:00
Zoë 9e8aefe7f7 Merge pull request #420 from PolyhedralDev/ver/6.4.0
Terra Version 6.4.0
2023-11-13 04:55:02 +00:00
Zoë Gidiere 272556ed81 final reformat and import optimize 2023-11-12 21:45:47 -07:00
Zoë Gidiere fd0c4df04c Revert "add stub for not physics"
This reverts commit 839bc23a5a.
2023-11-12 21:18:27 -07:00
Astrashh 1c3ee86376 Simplify PR template (#427) 2023-11-13 00:57:27 +00:00
Astrashh defd775f13 Change Java whitespace handling in .editorconfig (#425)
* Change whitespace handling in .editorconfig

* Reformat code

* fix format error

* Reformat code

---------

Co-authored-by: Zoë Gidiere <duplexsys@protonmail.com>
2023-11-13 00:57:01 +00:00
Astrash a73fda7d04 Forgot @Meta 2023-11-13 11:48:06 +11:00
Astrash b8586135b8 Make RangeLoader inner class private
Also removes redundant suppression
2023-11-10 13:34:05 +11:00
Astrashh 4065cfea53 Fix YAML formatting (#426)
* Remove trailing whitespace in YAML formatting

* Reformat YAML files
2023-11-10 00:47:12 +00:00
Zoë Gidiere a117db40be change formatting 2023-11-09 12:47:48 -07:00
Zoë Gidiere 72e0974cc5 fix cli build 2023-11-09 11:40:19 -07:00
Zoë Gidiere d8938c5519 remove comments 2023-11-09 11:37:46 -07:00
Zoë Gidiere acf79f5c53 change class structure of LifecycleEntryPoint 2023-11-09 11:37:01 -07:00
Zoë Gidiere 839bc23a5a add stub for not physics 2023-11-09 11:29:09 -07:00
Zoë Gidiere 852cf0321b Merge remote-tracking branch 'origin/ver/6.4.0' into ver/6.4.0 2023-11-08 21:59:14 -07:00
Zoë Gidiere 89d497d500 Some requested changes 2023-11-08 21:58:57 -07:00
Zoë Gidiere 0df940d688 improve invSqrt formatting
Co-authored-by: solonovamax <solonovamax@12oclockpoint.com>

what the fuck?
2023-11-08 21:20:01 -07:00
Zoë Gidiere dd7bebb27f Update lerp usage and docs 2023-11-08 21:18:35 -07:00
solonovamax 72649d5cf7 Merge remote-tracking branch 'upstream/ver/6.4.0' into ver/6.4.0 2023-11-08 22:42:23 -05:00
solonovamax 7cf87de463 Add TODO to replace FoliaLib when we drop support for 1.18 and 1.19
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
2023-11-08 22:42:14 -05:00
Zoë Gidiere 020033f839 add rsqrt ts function 2023-11-08 19:53:36 -07:00
Zoë Gidiere b3ef4ac79c optimized tan 2023-11-08 19:52:05 -07:00
solonovamax 3f9f2bdce4 Use kotlin's Path extensions rather than Files.whatever
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
2023-11-08 20:38:25 -05:00
Zoë Gidiere 0ab463f34f bukkit clean up 2023-11-05 21:07:25 -07:00
Zoë Gidiere 0b1d67b533 Actually fix issue 2023-11-05 20:51:28 -07:00
Zoë Gidiere c4f665ffc5 fix format error 2023-11-05 20:13:04 -07:00
Zoë Gidiere c00753b0fc let reformat have another go at it 2023-11-05 20:12:57 -07:00
Zoë Gidiere 77812545df Fix stupid build error and a couple gradle warnings
thank you gradle .replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() } is clearly better than .capitalize()
2023-11-05 20:07:13 -07:00
Zoë Gidiere ad9bc7f67c fix format error 2023-11-02 18:47:45 -06:00
Zoë Gidiere 81a96d6b76 Reformat code 2023-11-02 18:47:36 -06:00
Zoë Gidiere d696e4fd24 Optimize imports 2023-11-02 18:45:13 -06:00
Zoë Gidiere c98d39c5d7 Update licence year 2023-11-02 18:42:51 -06:00
Zoë a6fe268f79 Merge pull request #422 from PolyhedralDev/dev/image-caching
Improve image caching
2023-11-03 00:10:52 +00:00
Zoë 648da95e7d Scattered ore (#424)
* Scattered Ore Impl

* remove break

* remove another break

* sphereCount -> blockCount

---------

Co-authored-by: Astrash <astrash@protonmail.com>
2023-10-29 17:33:50 -06:00
Zoë Gidiere 5829112a74 Merge branch 'ver/6.4.0' into dev/image-caching 2023-10-26 12:56:17 -06:00
Zoë Gidiere c41bf55b7b implement missing methods from last comit 2023-10-26 12:53:55 -06:00
Zoë Gidiere 5d12a560f1 add zero and unit vectors 2023-10-26 11:08:36 -06:00
Zoë Gidiere 6f08908bb4 merge ovre-v2 into ore(v1) 2023-10-26 10:43:13 -06:00
Zoë Gidiere 9292d3de17 Remove FastMath
hotspot has intrinsics for almost everything we use it for
2023-10-26 10:37:25 -06:00
Astrash 0149a29b04 Load correct path 2023-10-24 14:08:56 +11:00
Astrash cd8605850f Replace unload-on-timeout with timeout > 0 2023-10-24 13:47:25 +11:00
Astrash 148b8dfe35 Bump image lib patch version 2023-10-24 13:34:10 +11:00
Astrash 3f485b1825 Add to unload on timeout description 2023-10-24 13:30:09 +11:00
Astrash cb6ecff113 Remove sout 2023-10-24 13:29:53 +11:00
Astrash e30bcbf1ba Improve image caching options 2023-10-24 13:26:35 +11:00
Astrash 805f99f57a Make ore algorithm readable 2023-10-20 10:55:23 +11:00
Astrash 4e5b02ef42 Pass correct coords for ore block checks 2023-10-20 10:30:25 +11:00
Astrash e80e998cec Only log warnings with debug logging 2023-10-20 10:03:04 +11:00
Zoë fde29220af Merge pull request #419 from PolyhedralDev/dev/disable-quilt
Dev/disable quilt
2023-10-19 17:31:40 +00:00
Zoë Gidiere d3a9b57872 disable quilt 2023-10-18 19:53:59 -06:00
Zoë 4671ec5bd3 Merge pull request #417 from PolyhedralDev/dev/folia
Dev/folia
2023-10-19 01:18:45 +00:00
Zoë 9f4a8e06e1 Update DependencyConfig.kt 2023-10-17 21:00:28 -06:00
Zoë c8f2871aaa Update build.gradle.kts 2023-10-17 20:59:27 -06:00
Zoë 4a537a56aa Merge pull request #415 from PolyhedralDev/dev/ore-v2
Add updated ore-v2
2023-10-18 00:33:15 +00:00
Zoë 4917160123 Update README.md 2023-10-17 18:32:00 -06:00
Zoë b3f80dcb64 Merge pull request #410 from PolyhedralDev/dev/1.20.2
1.20.2 + update libs
2023-10-15 19:45:43 +00:00
Zoë Gidiere d49b9ccad5 Merge branch 'dev/1.20.2' into dev/folia 2023-10-14 16:02:54 -06:00
Zoë Gidiere a8387ce419 Merge remote-tracking branch 'origin/ver/6.4.0' into dev/1.20.2 2023-10-14 16:02:40 -06:00
Zoë Gidiere 94854f2bdb update versions 2023-10-14 15:55:43 -06:00
Astrashh 47f531089e Add slant locator (#413)
* Add slant locator addon

* Bump slant locator noise3d dependency version

* Fix slant locator dependency version range

* Actually fix slant locator dependency version range
2023-10-10 00:35:47 +00:00
Astrashh abd83e8278 Add number predicate addon (#412) 2023-10-10 00:35:26 +00:00
Astrash b5e7c7c112 Fix TOP locator 2023-10-10 09:44:53 +11:00
Zoë Gidiere d71f7d4c36 clarify value and change default 2023-10-03 21:03:44 -06:00
Zoë Gidiere 84898a7a6b fixes 2023-10-03 20:03:46 -06:00
Zoë Gidiere 0c1a6efc72 refractor classes 2023-10-03 19:42:15 -06:00
Zoë Gidiere 200281f140 dep orev1 2023-10-03 11:58:32 -06:00
Zoë Gidiere f1ea8074de config-ore-v2 2023-10-03 11:54:18 -06:00
Zoë Gidiere ce2b964ce3 Merge branch 'dev/1.20.2' into dev/folia 2023-10-02 01:38:24 -06:00
Zoë Gidiere 0ee5f49972 quilt 2023-10-02 01:38:01 -06:00
Zoë Gidiere 3bc10cdb6a Merge branch 'dev/1.20.2' into dev/folia 2023-10-02 00:42:11 -06:00
Zoë Gidiere 86ba52850d update strata 2023-10-02 00:41:54 -06:00
Zoë Gidiere 27eebf6a47 Folia support
Co-authored-by: Janet Blackquill <uhhadd@gmail.com>
2023-10-02 00:23:19 -06:00
Zoë Gidiere 2d2bba20b6 found an untrue in read me 2023-10-01 23:22:44 -06:00
Zoë Gidiere eb3994005c fix me being fucking stupid 2023-10-01 22:46:41 -06:00
Zoë Gidiere 0a7cdb82a3 update deps + 1.20.2 2023-10-01 22:18:54 -06:00
Zoë Gidiere 70b1c3bbf3 warning 2023-09-30 12:06:21 -06:00
Zoë Gidiere e9b145b6c3 unbreaking via deprecation 2023-09-30 11:50:15 -06:00
Zoë 99d848b394 UX tweaks to biome config 2023-09-30 11:42:05 -06:00
Zoë Gidiere 4828d51da4 Merge branch 'dev/physics' into dev/biome2 2023-09-30 11:38:18 -06:00
1060 changed files with 19189 additions and 12530 deletions
+7 -7
View File
@@ -8,7 +8,7 @@ indent_style = space
insert_final_newline = false
max_line_length = 140
tab_width = 4
ij_continuation_indent_size = 8
ij_continuation_indent_size = 4
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
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_assignment = 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_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_in_calls = true
ij_java_align_multiline_parameters_in_calls = false
ij_java_align_multiline_parenthesized_expression = true
ij_java_align_multiline_records = 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_control_statement_in_one_line = true
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_multiple_expressions_in_one_line = false
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_spaces_around_key_value_delimiter = false
[{*.yaml, *.yml}]
[{*.yml, *.yaml}]
indent_size = 2
ij_visual_guides = none
ij_yaml_align_values_properties = do_not_align
ij_yaml_autoinsert_sequence_marker = true
ij_yaml_block_mapping_on_new_line = false
ij_yaml_indent_sequence_value = true
ij_yaml_keep_indents_on_empty_lines = true
ij_yaml_keep_indents_on_empty_lines = false
ij_yaml_keep_line_breaks = true
ij_yaml_sequence_on_new_line = false
ij_yaml_space_before_colon = false
+7 -12
View File
@@ -1,19 +1,14 @@
# Global owners, automatically request review when pull request is submitted
* @dfsek @solonovamax
* @dfsek @solonovamax @duplexsystem @astrsh @justaureus
# Platforms
## dfsek wrote the majority of the platform impls
/platforms/bukkit/ @dfsek
/platforms/fabric/ @dfsek
/platforms/forge/ @dfsek
/platforms/sponge/ @dfsek
## solonovamax is working on the region generator (unless duplexsystem takes it over)
/platforms/region/ @solonovamax
/platforms/ @dfsek @solonovamax @duplexsystem @justaureus
/platforms/bukkit @dfsek @solonovamax @duplexsystem @justaureus @OakLoaf
# Common
/common/ @dfsek @solonovamax
/common/ @dfsek @solonovamax @duplexsystem @astrsh
# Gradle Stuff
## Most gradle stuff was written by solonovamax
/buildSrc/ @solonovamax
*.gradle.kts @solonovamax
/buildSrc/ @dfsek @solonovamax @duplexsystem
*.gradle.kts @dfsek @solonovamax @duplexsystem
/gradle/ @dfsek @solonovamax @duplexsystem
+7 -7
View File
@@ -51,13 +51,13 @@ assignees: ""
<!-- You can fill out the different items by putting the correct value beside each cell. -->
| Name | Value |
|------------------------------|-------|
| 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) -->
| Any External Plugins or Mods | <!-- Put a list of all the plugins or mods you have installed here. (remove the comment) (Make sure to NOT include any new lines) -->
| Terra Packs In Use | <!-- Put a list of all the Terra packs you have installed here. (remove the comment) (Make sure to NOT include any new lines) (/te packs may be used to get a list) -->
| Terra Addons In Use | <!-- Put a list of all the Terra addons you have installed here. (remove the comment) (Make sure to NOT include any new lines) (/te addons may be used to get a list) -->
| Name | Value |
|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 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) -->
| Any External Plugins or Mods | <!-- Put a list of all the plugins or mods you have installed here. (remove the comment) (Make sure to NOT include any new lines) -->
| Terra Packs In Use | <!-- Put a list of all the Terra packs you have installed here. (remove the comment) (Make sure to NOT include any new lines) (/te packs may be used to get a list) -->
| Terra Addons In Use | <!-- Put a list of all the Terra addons you have installed here. (remove the comment) (Make sure to NOT include any new lines) (/te addons may be used to get a list) -->
## Issue Description
+69 -83
View File
@@ -1,58 +1,19 @@
# Pull Request
## Brief description.
## Description
<!-- Please provide a brief description of the goals of your PR -->
<!-- Include a description of the PR here -->
<!--
###########################################################################
## WARNING! ##
## IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN YOUR PR BEING CLOSED ##
###########################################################################
-->
<!--
Please go through this checklist item by item and make sure you have successfully completed each of these steps.
- Your pull request MUST be either on the latest version of Terra, or on a branch for a future release.
- Make sure that there are no already existing PRs that fix this. If so, it will be closed as a duplicate.
- Make sure that this change is actually within the scope of Terra and is something a terrain generator should be doing.
- Make sure that this is not an issue with a specific Terra *pack*, and instead applies to all of Terra.
- Make sure that you have filled out all the required information and given descriptions of everything.
-->
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### What Issues Does This Fix?
<!--
Put Fix #XXXX or Closes #XXXX here if there are any open issues that this PR fixes.
This is to automatically close the relevant issues.
You may remove this if there is no issue for this PR.
But unless this is a very small change, you should make an issue for it.
If applicable, include 'Fixes #XXXX' or 'Closes #XXXX' for any related open issues.
This helps us relate, track, and close the relevant issues.
-->
## Licensing
<!-- In order to be accepted, your changes must be under the GPLv3 license. Please check one of the following: -->
- [ ] I am the original author of this code, and I am willing to release it
under [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html).
- [ ] I am not the original author of this code, but it is in public domain or
released under [GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html) or a
compatible license.
<!--
Please provide reliable evidence of this.
NOTE: for compatible licenses, you must make sure to add the included license somewhere in the program, if so required.
(And even if it's not required, it's still nice to do it. Also add attribution somewhere.)
-->
## Goal of the PR
### Changelog
<!--
What is the goal of the PR?
Put a checklist here of what has been done
(and what *hasn't*, but you plan to do),
so we can easily know what was changed.
Note: this is only required for PRs that add new features.
If your PR is not adding new features, only fixing bugs or adding translations, then you may delete this section.
Fill out a changelog below of what has been done, and what might be planned to be done.
You may delete this if your PR is not adding new features, only fixing bugs or adding translations.
-->
- [ ] <!-- First thing -->
@@ -61,47 +22,58 @@
- [ ] <!-- Second thing -->
- [ ] <!-- etc. -->
## Affects of the PR
## Checklist
<!---
What types of changes does your code introduce? (Select any that apply. You may select multiple.)
You must put an x in all the boxes that it applies to. (Like this: [x])
<!--
Select the options below that apply.
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
- [ ] Bug Fix <!-- Anything which fixes an issue in Terra. -->
- [ ] Build system <!-- Anything which pretain to the build system. -->
- [ ] Documentation <!-- Anything which adds or improves documentation for existing features. -->
- [ ] New Feature <!-- Anything which adds new functionality to Terra. -->
- [ ] Performance <!-- Anything which is imrpoves the performance of Terra. -->
- [ ] Refactoring <!-- Anything which does not add any new code, only moves code around. -->
- [ ] Repository <!-- Anything which affects the repository. Eg. changes to the `README.md` file. -->
- [ ] Revert <!-- Anything which reverts previous commits. -->
- [ ] Style <!-- Anything which updates style. -->
- [ ] Tests <!-- Anything which adds or updates tests. -->
- [ ] Translation <!-- Anything which is internationalizing the Terra program to other languages. -->
- [ ] Bug Fix <!-- Changes include bug fixes. -->
- [ ] Build system <!-- Changes the build system. -->
- [ ] Documentation <!-- Changes add to or improve documentation. -->
- [ ] New Feature <!-- Changes add new functionality to Terra. -->
- [ ] Performance <!-- Changes improve the performance of Terra. -->
- [ ] Refactoring <!-- Changes do not add any new code, only moves code around. -->
- [ ] Repository <!-- Changes affect the repository. E.g. changes to the `README.md` file. -->
- [ ] Revert <!-- Changes revert previous commits. -->
- [ ] Style <!-- Changes update style, namely the .editorconfig file. -->
- [ ] Tests <!-- Changes add or update tests. -->
- [ ] Translation <!-- Changes include translations to other languages for Terra. -->
#### Compatiblity
#### Compatibility
- [ ] Breaking
change <!-- A fix, or a feature, that breaks some previous functionality to Terra. -->
- [ ] Non-Breaking change.
<!--
A change which does not break *any* previous functionality of Terra.
(ie. is backwards compatible and will work with *any* previously existing supported features.
Note: if a feature is annotated with @Incubating, @Preview, @Experimental,
or is in a package called something similar to the previous annotations,
then you may push breaking changes to only THOSE parts of Terra.)
-->
<!-- The following options determine if the PR pertains to a major, minor, or patch version bump -->
#### Contribution Guidelines.
- [ ] 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. -->
- [ ] Introduces a breaking change
<!--
Breaking changes are any fix or feature that breaks some previous functionality to Terra / is not backwards compatible.
Breaking changes do not include:
- changes that are backwards compatible and will work with *any* previously existing supported features.
- changes to code marked as in a pre-release
state (annotated with @Incubating, @Preview, @Experimental
or in a package called something similar to the previous annotations)
-->
- [ ] Introduces new functionality in a backwards compatible way.
- [ ] Introduces bug fixes
#### Documentation
@@ -112,7 +84,21 @@
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
<!--
If it only introduces small changes, you don't need to add tests.
But if you add big changes, you should probably at least write *some* testing, where applicable.
-->
<!--
Tests are typically not necessary for small changes.
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.)
-->
+47
View File
@@ -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@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up JDK 21
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with:
java-version: '21'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6
name: Build Terra
with:
# Specifies arguments for Gradle execution
# If arguments is missing or empty, then Gradle is not executed
arguments: build
# arguments can be multi-line for better readability
# arguments: |
# --no-paralell
# build
# -x test
# Gradle version to use for execution:
# wrapper (default), current, rc, nightly, release-nightly, or
# versions like 6.6 (see https://services.gradle.org/versions/all)
gradle-version: wrapper
# Properties are passed as -Pname=value
properties: |
kotlin.js.compiler=ir
kotlin.parallel.tasks.in.project=true
+2
View File
@@ -249,3 +249,5 @@ nbdist/
platforms/**/run/**
#Vale Config File
**/.vale.ini
+6
View File
@@ -0,0 +1,6 @@
[submodule "platforms/allay/src/main/resources/mappings"]
path = platforms/allay/src/main/resources/mappings
url = https://github.com/GeyserMC/mappings
[submodule "platforms/allay/src/main/resources/mappings-generator"]
path = platforms/allay/src/main/resources/mappings-generator
url = https://github.com/GeyserMC/mappings-generator
+1 -1
View File
@@ -1,6 +1,6 @@
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
of this software and associated documentation files (the "Software"), to deal
+1 -8
View File
@@ -47,14 +47,7 @@ JARs are produced in `platforms/<platform>/build/libs`.
To run Minecraft with Terra in the IDE (for testing) use the following tasks:
* Bukkit
* `installPaper` - Install a [Paper](https://github.com/PaperMC/Paper) test
server. (Only needs to be run once).
* `installPurpur` - Install a [Purpur](https://github.com/pl3xgaming/Purpur)
test server. (Only needs to be run once).
* `runPaper` - Run the Paper test server with Terra (`installPaper` must
have been run previously).
* `runPurpur` - Run the Purpur test server with Terra (`installPurpur` must
have been run previously).
* `runServer` - Run the Paper test server with Terra installed.
* Fabric
* `runClient` - Run a Minecraft Fabric client with Terra installed.
* `runServer` - Run a Minecraft Fabric server with Terra installed.
+15 -13
View File
@@ -1,38 +1,39 @@
preRelease(true)
versionProjects(":common:api", version("6.4.0"))
versionProjects(":common:implementation", version("6.4.0"))
versionProjects(":platforms", version("6.4.0"))
versionProjects(":common:api", version("6.6.1"))
versionProjects(":common:implementation", version("6.6.1"))
versionProjects(":platforms", version("6.6.1"))
allprojects {
group = "com.dfsek.terra"
configureCompilation()
configureDependencies()
configurePublishing()
tasks.withType<JavaCompile>().configureEach {
options.isFork = true
options.isIncremental = true
options.release.set(21)
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
maxHeapSize = "2G"
ignoreFailures = false
failFast = true
maxParallelForks = (Runtime.getRuntime().availableProcessors() - 1).takeIf { it > 0 } ?: 1
reports.html.required.set(false)
reports.junitXml.required.set(false)
}
tasks.withType<Copy>().configureEach {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.withType<Jar>().configureEach {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
@@ -43,13 +44,14 @@ afterEvaluate {
configureDistribution()
}
project(":platforms:bukkit:common").configureDistribution()
project(":platforms:minestom:example").configureDistribution()
forSubProjects(":common:addons") {
apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "com.gradleup.shadow")
tasks.named("build") {
finalizedBy(tasks.named("shadowJar"))
}
dependencies {
"compileOnly"(project(":common:api"))
"testImplementation"(project(":common:api"))
+9 -17
View File
@@ -3,32 +3,24 @@ plugins {
kotlin("jvm") version embeddedKotlinVersion
}
buildscript {
configurations.all {
resolutionStrategy {
force("org.ow2.asm:asm:9.3") // TODO: remove when ShadowJar updates ASM version
force("org.ow2.asm:asm-commons:9.3")
}
}
}
repositories {
mavenCentral()
gradlePluginPortal()
maven("https://repo.codemc.org/repository/maven-public") {
name = "CodeMC"
}
maven("https://papermc.io/repo/repository/maven-public/") {
maven("https://repo.papermc.io/repository/maven-public/") {
name = "PaperMC"
}
}
dependencies {
implementation("gradle.plugin.com.github.jengelman.gradle.plugins:shadow:+")
implementation("io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.3.5")
implementation("org.ow2.asm:asm:9.3")
implementation("org.ow2.asm:asm-tree:9.3")
implementation("com.dfsek.tectonic:common:4.2.0")
implementation("org.yaml:snakeyaml:1.27")
//TODO Allow pulling from Versions.kt
implementation("com.gradleup.shadow", "shadow-gradle-plugin", "8.3.1")
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.2")
implementation("org.ow2.asm", "asm", "9.7")
implementation("org.ow2.asm", "asm-tree", "9.7")
implementation("com.dfsek.tectonic", "common", "4.2.1")
implementation("org.yaml", "snakeyaml", "2.3")
}
+2 -2
View File
@@ -18,7 +18,7 @@ fun Project.addonDir(dir: File, task: Task) {
matchingAddons(dir) {
it.name.startsWith("Terra-") // Assume everything that starts with Terra- is a core addon.
}.forEach {
println("Deleting old addon: " + it.absolutePath)
logger.info("Deleting old addon: " + it.absolutePath)
it.delete()
}
forSubProjects(":common:addons") {
@@ -29,7 +29,7 @@ fun Project.addonDir(dir: File, task: Task) {
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)
}
@@ -22,8 +22,8 @@ fun Project.configureCompilation() {
apply<TectonicDocPlugin>()
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType<JavaCompile> {
+19 -7
View File
@@ -36,7 +36,7 @@ fun Project.configureDependencies() {
maven("https://repo.codemc.org/repository/maven-public") {
name = "CodeMC"
}
maven("https://papermc.io/repo/repository/maven-public/") {
maven("https://repo.papermc.io/repository/maven-public/") {
name = "PaperMC"
}
maven("https://files.minecraftforge.net/maven/") {
@@ -48,14 +48,26 @@ fun Project.configureDependencies() {
maven("https://jitpack.io") {
name = "JitPack"
}
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
name = "Sonatype Snapshots"
}
maven("https://repo.opencollab.dev/maven-releases/") {
name = "OpenCollab Releases"
}
maven("https://repo.opencollab.dev/maven-snapshots/") {
name = "OpenCollab Snapshots"
}
maven("https://storehouse.okaeri.eu/repository/maven-public/") {
name = "Okaeri"
}
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.7.0")
compileOnly("org.jetbrains:annotations:23.0.0")
testImplementation("org.junit.jupiter", "junit-jupiter-api", Versions.Libraries.Internal.junit)
testImplementation("org.junit.jupiter", "junit-jupiter-engine", Versions.Libraries.Internal.junit)
compileOnly("org.jetbrains", "annotations", Versions.Libraries.Internal.jetBrainsAnnotations)
compileOnly("com.google.guava:guava:30.0-jre")
testImplementation("com.google.guava:guava:30.0-jre")
compileOnly("com.google.guava", "guava", Versions.Libraries.Internal.guava)
testImplementation("com.google.guava", "guava", Versions.Libraries.Internal.guava)
}
}
}
+49 -31
View File
@@ -1,15 +1,14 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import io.papermc.paperweight.util.path
import java.io.File
import java.io.FileWriter
import java.net.URI
import java.net.URL
import java.nio.file.FileSystems
import java.nio.file.Files
import java.nio.file.StandardCopyOption
import java.nio.file.Path
import org.gradle.api.DefaultTask
import org.gradle.api.Project
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.configure
import org.gradle.kotlin.dsl.extra
@@ -17,17 +16,43 @@ import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.named
import org.yaml.snakeyaml.DumperOptions
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() {
apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "com.gradleup.shadow")
val downloadDefaultPacks = tasks.create("downloadDefaultPacks") {
group = "terra"
doFirst {
file("${buildDir}/resources/main/packs/").deleteRecursively()
val defaultPackUrl = URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/latest/default.zip")
downloadPack(defaultPackUrl, project)
try {
file("${buildDir}/resources/main/packs/").deleteRecursively()
val defaultPackUrl =
URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/" + Versions.Terra.overworldConfig + "/default.zip")
downloadPack(defaultPackUrl, project)
} catch (_:Exception) {}
}
}
@@ -45,25 +70,18 @@ fun Project.configureDistribution() {
doLast {
// https://github.com/johnrengelman/shadow/issues/111
val dest = URI.create("jar:" + tasks.named<ShadowJar>("shadowJar").get().archiveFile.get().asFile.toURI())
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)
}
}
}
val dest = tasks.named<ShadowJar>("shadowJar").get().archiveFile.get().path
installAddonsInto(dest)
}
}
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()
resources.computeIfAbsent(
if (extra.has("bootstrap") && extra.get("bootstrap") as Boolean) "addons/bootstrap"
else "addons") { ArrayList() }.add(jar)
else "addons"
) { ArrayList() }.add(jar)
}
val options = DumperOptions()
@@ -110,7 +129,7 @@ fun Project.configureDistribution() {
FileWriter(manifest).use {
yaml.dump(resources, it)
}
}
}
@@ -126,10 +145,9 @@ fun Project.configureDistribution() {
dependsOn(downloadDefaultPacks)
configurations = listOf(project.configurations["shaded"])
archiveClassifier.set("shaded")
setVersion(project.version)
version = project.version
relocate("org.apache.commons", "com.dfsek.terra.lib.commons")
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.yaml", "com.dfsek.terra.lib.yaml")
+2 -2
View File
@@ -42,10 +42,10 @@ fun preRelease(preRelease: Boolean) {
fun Project.versionProjects(project: String, version: String) {
forSubProjects(project) {
this.version = version
println("Setting version of $path to $version")
logger.info("Setting version of $path to $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 {
+67 -46
View File
@@ -1,68 +1,89 @@
object Versions {
object Terra {
const val overworldConfig = "v1.3.4"
}
object Libraries {
const val tectonic = "4.2.0"
const val paralithic = "0.7.0"
const val strata = "1.1.1"
const val tectonic = "4.2.1"
const val paralithic = "0.8.1"
const val strata = "1.3.2"
const val cloud = "1.8.0"
const val cloud = "2.0.0"
const val slf4j = "1.7.36"
const val log4j_slf4j_impl = "2.14.1"
const val caffeine = "3.1.8"
const val slf4j = "2.0.16"
object Internal {
const val apacheText = "1.9"
const val jafama = "2.3.2"
const val apacheIO = "2.6"
const val fastutil = "8.5.6"
const val shadow = "8.3.3"
const val apacheText = "1.12.0"
const val apacheIO = "2.17.0"
const val guava = "33.3.1-jre"
const val asm = "9.7.1"
const val snakeYml = "2.3"
const val jetBrainsAnnotations = "26.0.1"
const val junit = "5.11.3"
const val nbt = "6.1"
}
}
object Fabric {
const val fabricLoader = "0.14.8"
const val fabricAPI = "0.83.1+1.20.1"
}
object Quilt {
const val quiltLoader = "0.17.0"
const val fabricApi = "6.0.0-beta.3+0.76.0-1.19.4"
const val fabricAPI = "0.118.0+${Mod.minecraft}"
const val cloud = "2.0.0-beta.9"
}
//
// object Quilt {
// const val quiltLoader = "0.20.2"
// const val fabricApi = "7.3.1+0.89.3-1.20.1"
// }
object Mod {
const val mixin = "0.11.2+mixin.0.8.5"
const val mixin = "0.15.3+mixin.0.8.7"
const val minecraft = "1.20.1"
const val yarn = "$minecraft+build.2"
const val fabricLoader = "0.14.21"
const val minecraft = "1.21.4"
const val yarn = "$minecraft+build.8"
const val fabricLoader = "0.16.10"
const val architecuryLoom = "0.12.0.290"
const val architecturyPlugin = "3.4-SNAPSHOT"
const val loomQuiltflower = "1.7.1"
}
object Forge {
const val forge = "${Mod.minecraft}-47.0.3"
const val burningwave = "12.53.0"
const val architecuryLoom = "1.7.413"
const val architecturyPlugin = "3.4.159"
}
//
// object Forge {
// const val forge = "${Mod.minecraft}-48.0.13"
// const val burningwave = "12.63.0"
// }
object Bukkit {
const val paper = "1.18.2-R0.1-SNAPSHOT"
const val paperLib = "1.0.5"
const val minecraft = "1.20.1"
const val reflectionRemapper = "0.1.0-SNAPSHOT"
const val paperDevBundle = "1.20.1-R0.1-SNAPSHOT"
}
object Sponge {
const val sponge = "9.0.0-SNAPSHOT"
const val mixin = "0.8.2"
const val minecraft = "1.17.1"
const val minecraft = "1.21.4"
const val paperBuild = "$minecraft-R0.1-20241211.212446-17"
const val paper = paperBuild
const val paperLib = "1.0.8"
const val reflectionRemapper = "0.1.1"
const val paperDevBundle = paperBuild
const val runPaper = "2.3.1"
const val paperWeight = "1.7.2"
const val cloud = "2.0.0-beta.10"
}
//
// object Sponge {
// const val sponge = "9.0.0-SNAPSHOT"
// const val mixin = "0.8.2"
// const val minecraft = "1.17.1"
// }
//
object CLI {
const val nbt = "6.1"
const val logback = "1.2.9"
const val commonsIO = "2.7"
const val guava = "31.0.1-jre"
const val logback = "1.5.8"
const val picocli = "4.7.6"
}
}
object Allay {
const val api = "0.2.0"
const val gson = "2.12.1"
}
object Minestom {
const val minestom = "187931e50b"
}
}
@@ -82,7 +82,7 @@ abstract class GenerateDocsTask : DefaultTask() {
}
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.*"
})
}
+1 -1
View File
@@ -1,6 +1,6 @@
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
of this software and associated documentation files (the "Software"), to deal
@@ -8,17 +8,17 @@ import com.dfsek.terra.api.addon.BaseAddon;
public class ApiAddon implements BaseAddon {
private final Version version;
private final String id;
public ApiAddon(Version version, String id) {
this.version = version;
this.id = id;
}
@Override
public Version getVersion() {
return version;
}
@Override
public String getID() {
return id;
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -15,7 +15,7 @@ public class ApiAddonClassLoader extends URLClassLoader {
static {
ClassLoader.registerAsParallelCapable();
}
public ApiAddonClassLoader(URL[] urls, ClassLoader parent) {
super(urls, parent);
}
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -20,18 +20,18 @@ import com.dfsek.terra.api.addon.bootstrap.BootstrapBaseAddon;
public class ApiAddonLoader implements BootstrapBaseAddon<BaseAddon> {
private static final Version VERSION = Versions.getVersion(1, 0, 0);
@Override
public Iterable<BaseAddon> loadAddons(Path addonsFolder, BootstrapAddonClassLoader parent) {
return Collections.emptySet();
}
@Override
public String getID() {
return "API";
}
@Override
public Version getVersion() {
return VERSION;
@@ -9,11 +9,11 @@ class BaseBiomeColumn implements Column<Biome> {
private final Biome base;
private final int min;
private final int max;
private final int x;
private final int z;
private final long seed;
protected BaseBiomeColumn(BiomeExtrusionProvider biomeProvider, Biome base, int min, int max, int x, int z, long seed) {
this.biomeProvider = biomeProvider;
this.base = base;
@@ -23,27 +23,27 @@ class BaseBiomeColumn implements Column<Biome> {
this.z = z;
this.seed = seed;
}
@Override
public int getMinY() {
return min;
}
@Override
public int getMaxY() {
return max;
}
@Override
public int getX() {
return x;
}
@Override
public int getZ() {
return z;
}
@Override
public Biome get(int y) {
return biomeProvider.extrude(base, x, y, z, seed);
@@ -27,41 +27,41 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
public class BiomeExtrusionAddon implements AddonInitializer {
public static final TypeKey<Supplier<ObjectTemplate<Extrusion>>> EXTRUSION_REGISTRY_KEY = new TypeKey<>() {
};
public static final TypeKey<Supplier<ObjectTemplate<BiomeProvider>>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
};
@Inject
private Platform platform;
@Inject
private BaseAddon addon;
@Override
public void initialize() {
platform.getEventManager()
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPreLoadEvent.class)
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry =
event.getPack()
.getOrCreateRegistry(PROVIDER_REGISTRY_KEY);
providerRegistry.register(addon.key("EXTRUSION"), BiomeExtrusionTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<Extrusion>>> extrusionRegistry = event.getPack().getOrCreateRegistry(
EXTRUSION_REGISTRY_KEY);
extrusionRegistry.register(addon.key("SET"), SetExtrusionTemplate::new);
extrusionRegistry.register(addon.key("REPLACE"), ReplaceExtrusionTemplate::new);
})
.failThrough();
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPreLoadEvent.class)
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry =
event.getPack()
.getOrCreateRegistry(PROVIDER_REGISTRY_KEY);
providerRegistry.register(addon.key("EXTRUSION"), BiomeExtrusionTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<Extrusion>>> extrusionRegistry = event.getPack().getOrCreateRegistry(
EXTRUSION_REGISTRY_KEY);
extrusionRegistry.register(addon.key("SET"), SetExtrusionTemplate::new);
extrusionRegistry.register(addon.key("REPLACE"), ReplaceExtrusionTemplate::new);
})
.failThrough();
platform.getEventManager()
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPostLoadEvent.class)
.then(event -> {
Registry<Biome> biomeRegistry = event.getPack().getRegistry(Biome.class);
event.getPack().applyLoader(ReplaceableBiome.class, new ReplaceableBiomeLoader(biomeRegistry));
});
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPostLoadEvent.class)
.then(event -> {
Registry<Biome> biomeRegistry = event.getPack().getRegistry(Biome.class);
event.getPack().applyLoader(ReplaceableBiome.class, new ReplaceableBiomeLoader(biomeRegistry));
});
}
}
@@ -16,7 +16,7 @@ public class BiomeExtrusionProvider implements BiomeProvider {
private final Set<Biome> biomes;
private final List<Extrusion> extrusions;
private final int resolution;
public BiomeExtrusionProvider(BiomeProvider delegate, List<Extrusion> extrusions, int resolution) {
this.delegate = delegate;
this.biomes = delegate.stream().collect(Collectors.toSet());
@@ -24,43 +24,43 @@ public class BiomeExtrusionProvider implements BiomeProvider {
this.extrusions = extrusions;
this.resolution = resolution;
}
@Override
public Biome getBiome(int x, int y, int z, long seed) {
Biome delegated = delegate.getBiome(x, y, z, seed);
return extrude(delegated, x, y, z, seed);
}
public Biome extrude(Biome original, int x, int y, int z, long seed) {
for(Extrusion extrusion : extrusions) {
original = extrusion.extrude(original, x, y, z, seed);
}
return original;
}
@Override
public Column<Biome> getColumn(int x, int z, long seed, int min, int max) {
return delegate.getBaseBiome(x, z, seed)
.map(base -> (Column<Biome>) new BaseBiomeColumn(this, base, min, max, x, z, seed))
.orElseGet(() -> BiomeProvider.super.getColumn(x, z, seed, min, max));
.map(base -> (Column<Biome>) new BaseBiomeColumn(this, base, min, max, x, z, seed))
.orElseGet(() -> BiomeProvider.super.getColumn(x, z, seed, min, max));
}
@Override
public Optional<Biome> getBaseBiome(int x, int z, long seed) {
return delegate.getBaseBiome(x, z, seed);
}
@Override
public Iterable<Biome> getBiomes() {
return biomes;
}
@Override
public int resolution() {
return resolution;
}
public BiomeProvider getDelegate() {
return delegate;
}
@@ -1,12 +1,12 @@
package com.dfsek.terra.addons.biome.extrusion.api;
import java.util.Collection;
import com.dfsek.terra.api.world.biome.Biome;
import java.util.Collection;
public interface Extrusion {
Biome extrude(Biome original, int x, int y, int z, long seed);
Collection<Biome> getBiomes();
}
@@ -6,16 +6,16 @@ import com.dfsek.terra.api.world.biome.Biome;
final class PresentBiome implements ReplaceableBiome {
private final Biome biome;
PresentBiome(Biome biome) {
this.biome = biome;
}
@Override
public Biome get(Biome existing) {
return biome;
}
@Override
public boolean isSelf() {
return false;
@@ -13,19 +13,19 @@ public sealed interface ReplaceableBiome permits PresentBiome, SelfBiome {
static ReplaceableBiome of(Biome biome) {
return new PresentBiome(biome);
}
static ReplaceableBiome self() {
return SelfBiome.INSTANCE;
}
Biome get(Biome existing);
default Biome get() {
if(isSelf()) {
throw new IllegalStateException("Cannot get() self biome!");
}
return get(null);
}
boolean isSelf();
}
@@ -8,12 +8,12 @@ import com.dfsek.terra.api.world.biome.Biome;
final class SelfBiome implements ReplaceableBiome {
public static final SelfBiome INSTANCE = new SelfBiome();
@Override
public Biome get(Biome existing) {
return Objects.requireNonNull(existing);
}
@Override
public boolean isSelf() {
return true;
@@ -15,14 +15,14 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
public class BiomeExtrusionTemplate implements ObjectTemplate<BiomeProvider> {
@Value("provider")
private @Meta BiomeProvider provider;
@Value("resolution")
@Default
private @Meta int resolution = 4;
@Value("extrusions")
private @Meta List<@Meta Extrusion> extrusions;
@Override
public BiomeProvider get() {
return new BiomeExtrusionProvider(provider, extrusions, resolution);
@@ -15,18 +15,18 @@ import com.dfsek.terra.api.world.biome.Biome;
public class ReplaceableBiomeLoader implements TypeLoader<ReplaceableBiome> {
private final Registry<Biome> biomeRegistry;
public ReplaceableBiomeLoader(Registry<Biome> biomeRegistry) {
this.biomeRegistry = biomeRegistry;
}
@Override
public ReplaceableBiome load(@NotNull AnnotatedType t, @NotNull Object c, @NotNull ConfigLoader loader, DepthTracker depthTracker)
throws LoadException {
if(c.equals("SELF")) return ReplaceableBiome.self();
return biomeRegistry
.getByID((String) c)
.map(ReplaceableBiome::of)
.orElseThrow(() -> new LoadException("No such biome: " + c, depthTracker));
.getByID((String) c)
.map(ReplaceableBiome::of)
.orElseThrow(() -> new LoadException("No such biome: " + c, depthTracker));
}
}
@@ -12,10 +12,10 @@ import com.dfsek.terra.api.util.collection.ProbabilityCollection;
public class ReplaceExtrusionTemplate extends SamplerExtrusionTemplate {
@Value("to")
private @Meta ProbabilityCollection<@Meta ReplaceableBiome> biomes;
@Value("from")
private @Meta String fromTag;
@Override
public Extrusion get() {
return new ReplaceExtrusion(sampler, range, biomes, fromTag);
@@ -12,7 +12,7 @@ import com.dfsek.terra.api.util.Range;
public abstract class SamplerExtrusionTemplate implements ObjectTemplate<Extrusion> {
@Value("sampler")
protected @Meta NoiseSampler sampler;
@Value("range")
protected @Meta Range range;
}
@@ -12,7 +12,7 @@ import com.dfsek.terra.api.util.collection.ProbabilityCollection;
public class SetExtrusionTemplate extends SamplerExtrusionTemplate {
@Value("to")
private @Meta ProbabilityCollection<@Meta ReplaceableBiome> biomes;
@Override
public Extrusion get() {
return new SetExtrusion(sampler, range, biomes);
@@ -18,20 +18,20 @@ import com.dfsek.terra.api.world.biome.Biome;
*/
public class ReplaceExtrusion implements Extrusion {
private final NoiseSampler sampler;
private final Range range;
private final ProbabilityCollection<ReplaceableBiome> biomes;
private final Predicate<Biome> hasTag;
public ReplaceExtrusion(NoiseSampler sampler, Range range, ProbabilityCollection<ReplaceableBiome> biomes, String tag) {
this.sampler = sampler;
this.range = range;
this.biomes = biomes;
this.hasTag = BiomeQueries.has(tag);
}
@Override
public Biome extrude(Biome original, int x, int y, int z, long seed) {
if(hasTag.test(original)) {
@@ -39,14 +39,14 @@ public class ReplaceExtrusion implements Extrusion {
}
return original;
}
@Override
public Collection<Biome> getBiomes() {
return biomes
.getContents()
.stream()
.filter(Predicate.not(ReplaceableBiome::isSelf))
.map(ReplaceableBiome::get)
.collect(Collectors.toSet());
.getContents()
.stream()
.filter(Predicate.not(ReplaceableBiome::isSelf))
.map(ReplaceableBiome::get)
.collect(Collectors.toSet());
}
}
@@ -17,29 +17,29 @@ import com.dfsek.terra.api.world.biome.Biome;
*/
public class SetExtrusion implements Extrusion {
private final NoiseSampler sampler;
private final Range range;
private final ProbabilityCollection<ReplaceableBiome> biomes;
public SetExtrusion(NoiseSampler sampler, Range range, ProbabilityCollection<ReplaceableBiome> biomes) {
this.sampler = sampler;
this.range = range;
this.biomes = biomes;
}
@Override
public Biome extrude(Biome original, int x, int y, int z, long seed) {
return range.ifInRange(y, () -> biomes.get(sampler, x, y, z, seed).get(original), original);
}
@Override
public Collection<Biome> getBiomes() {
return biomes
.getContents()
.stream()
.filter(Predicate.not(ReplaceableBiome::isSelf))
.map(ReplaceableBiome::get)
.collect(Collectors.toSet());
.getContents()
.stream()
.filter(Predicate.not(ReplaceableBiome::isSelf))
.map(ReplaceableBiome::get)
.collect(Collectors.toSet());
}
}
@@ -1,6 +1,6 @@
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
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 {
compileOnlyApi(project(":common:addons:manifest-addon-loader"))
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")
}
}
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -9,41 +9,41 @@ package com.dfsek.terra.addons.biome.image.v2;
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.converter.ColorConverter;
import com.dfsek.terra.api.world.biome.Biome;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
public class ImageBiomeProvider implements BiomeProvider {
private final int resolution;
private final ColorConverter<Biome> colorConverter;
private final ColorSampler colorSampler;
public ImageBiomeProvider(ColorConverter<Biome> colorConverter, ColorSampler colorSampler, int resolution) {
this.resolution = resolution;
this.colorConverter = colorConverter;
this.colorSampler = colorSampler;
}
@Override
public Biome getBiome(int x, int y, int z, long seed) {
return getBiome(x, z);
}
public Biome getBiome(int x, int z) {
x /= resolution;
z /= resolution;
return colorConverter.apply(colorSampler.apply(x, z));
}
@Override
public Optional<Biome> getBaseBiome(int x, int z, long seed) {
return Optional.of(getBiome(x, z));
}
@Override
public Iterable<Biome> getBiomes() {
return colorConverter.getEntries();
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -33,42 +33,46 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
public class ImageBiomeProviderAddon implements AddonInitializer {
public static final TypeKey<Supplier<ObjectTemplate<BiomeProvider>>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
};
public static final TypeKey<Supplier<ObjectTemplate<ColorConverter<Biome>>>> BIOME_COLOR_CONVERTER_REGISTRY_KEY = new TypeKey<>() {
};
public static final TypeKey<Supplier<ObjectTemplate<ColorMapping<Biome>>>> BIOME_COLOR_MAPPING_REGISTRY_KEY = new TypeKey<>() {
};
@Inject
private Platform platform;
@Inject
private BaseAddon addon;
@Override
public void initialize() {
platform.getEventManager()
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPreLoadEvent.class)
.priority(501)
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
PROVIDER_REGISTRY_KEY);
providerRegistry.register(addon.key("IMAGE"), ImageProviderTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<ColorConverter<Biome>>>> biomeColorConverterRegistry = event.getPack().getOrCreateRegistry(
BIOME_COLOR_CONVERTER_REGISTRY_KEY);
biomeColorConverterRegistry.register(addon.key("EXACT"), ExactBiomeColorConverterTemplate::new);
biomeColorConverterRegistry.register(addon.key("CLOSEST"), ClosestBiomeColorConverterTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<ColorMapping<Biome>>>> biomeColorMappingRegistry = event.getPack().getOrCreateRegistry(
BIOME_COLOR_MAPPING_REGISTRY_KEY);
biomeColorMappingRegistry.register(addon.key("USE_BIOME_COLORS"), () -> () -> new BiomeDefinedColorMapping<>(event.getPack().getRegistry(Biome.class), b -> b));
biomeColorMappingRegistry.register(addon.key("MAP"), DefinedBiomeColorMappingTemplate::new);
})
.failThrough();
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPreLoadEvent.class)
.priority(501)
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
PROVIDER_REGISTRY_KEY);
providerRegistry.register(addon.key("IMAGE"), ImageProviderTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<ColorConverter<Biome>>>> biomeColorConverterRegistry =
event.getPack().getOrCreateRegistry(
BIOME_COLOR_CONVERTER_REGISTRY_KEY);
biomeColorConverterRegistry.register(addon.key("EXACT"), ExactBiomeColorConverterTemplate::new);
biomeColorConverterRegistry.register(addon.key("CLOSEST"), ClosestBiomeColorConverterTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<ColorMapping<Biome>>>> biomeColorMappingRegistry =
event.getPack().getOrCreateRegistry(
BIOME_COLOR_MAPPING_REGISTRY_KEY);
biomeColorMappingRegistry.register(addon.key("USE_BIOME_COLORS"),
() -> () -> new BiomeDefinedColorMapping<>(event.getPack().getRegistry(Biome.class),
b -> b));
biomeColorMappingRegistry.register(addon.key("MAP"), DefinedBiomeColorMappingTemplate::new);
})
.failThrough();
}
}
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -13,26 +13,26 @@ import com.dfsek.tectonic.api.config.template.annotations.Value;
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
import com.dfsek.terra.addons.biome.image.v2.ImageBiomeProvider;
import com.dfsek.terra.addons.image.converter.ColorConverter;
import com.dfsek.terra.addons.image.colorsampler.ColorSampler;
import com.dfsek.terra.addons.image.converter.ColorConverter;
import com.dfsek.terra.api.world.biome.Biome;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
@SuppressWarnings("FieldMayBeFinal")
public class ImageProviderTemplate implements ObjectTemplate<BiomeProvider> {
@Value("resolution")
@Default
@Description("Sets the resolution at which to sample the image.")
private int resolution = 1;
@Value("color-sampler")
private ColorSampler colorSampler;
@Value("color-conversion")
private ColorConverter<Biome> colorConverter;
@Override
public BiomeProvider get() {
return new ImageBiomeProvider(colorConverter, colorSampler, resolution);
@@ -11,7 +11,7 @@ public class ClosestBiomeColorConverterTemplate extends ClosestColorConverterTem
@Value("match")
private ColorMapping<Biome> match;
@Override
protected ColorMapping<Biome> getMapping() {
return match;
@@ -9,13 +9,13 @@ import com.dfsek.terra.api.world.biome.Biome;
public class ExactBiomeColorConverterTemplate extends ExactColorConverterTemplate<Biome> {
@Value("match")
private ColorMapping<Biome> match;
@Value("else")
private Biome fallback;
@Value("ignore-alpha")
@Default
private boolean ignoreAlpha = true;
@@ -29,7 +29,7 @@ public class ExactBiomeColorConverterTemplate extends ExactColorConverterTemplat
protected Biome getFallback() {
return fallback;
}
@Override
protected boolean ignoreAlpha() {
return ignoreAlpha;
@@ -12,10 +12,10 @@ import com.dfsek.terra.api.world.biome.Biome;
public class DefinedBiomeColorMappingTemplate implements ObjectTemplate<ColorMapping<Biome>> {
@Value("map")
Map<ColorString, Biome> map;
@Override
public ColorMapping<Biome> get() {
var map = MapUtil.mapKeys(this.map, ColorString::getColor);
+1 -1
View File
@@ -1,6 +1,6 @@
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
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 {
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")
}
}
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -7,8 +7,6 @@
package com.dfsek.terra.addons.biome.image;
import net.jafama.FastMath;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.util.HashMap;
@@ -25,62 +23,62 @@ public class ImageBiomeProvider implements BiomeProvider {
private final BufferedImage image;
private final int resolution;
private final Align align;
public ImageBiomeProvider(Set<Biome> registry, BufferedImage image, int resolution, Align align) {
this.image = image;
this.resolution = resolution;
this.align = align;
registry.forEach(biome -> colorBiomeMap.put(new Color(biome.getColor()), biome));
}
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
public Biome getBiome(int x, int y, int z, long seed) {
return getBiome(x, z);
}
public Biome getBiome(int x, int z) {
x /= resolution;
z /= resolution;
Color color = align.getColor(image, x, z);
return colorBiomeMap.get(colorBiomeMap.keySet()
.stream()
.reduce(colorBiomeMap.keySet().stream().findAny().orElseThrow(IllegalStateException::new),
(running, element) -> {
int d1 = distance(color, running);
int d2 = distance(color, element);
return d1 < d2 ? running : element;
}));
.stream()
.reduce(colorBiomeMap.keySet().stream().findAny().orElseThrow(IllegalStateException::new),
(running, element) -> {
int d1 = distance(color, running);
int d2 = distance(color, element);
return d1 < d2 ? running : element;
}));
}
@Override
public Optional<Biome> getBaseBiome(int x, int z, long seed) {
return Optional.of(getBiome(x, z));
}
@Override
public Iterable<Biome> getBiomes() {
return colorBiomeMap.values();
}
public enum Align {
CENTER {
@Override
public Color getColor(BufferedImage image, int x, int z) {
return new Color(image.getRGB(FastMath.floorMod(x - image.getWidth() / 2, image.getWidth()),
FastMath.floorMod(z - image.getHeight() / 2, image.getHeight())));
return new Color(image.getRGB(Math.floorMod(x - image.getWidth() / 2, image.getWidth()),
Math.floorMod(z - image.getHeight() / 2, image.getHeight())));
}
},
NONE {
@Override
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())));
}
};
public abstract Color getColor(BufferedImage image, int x, int z);
}
}
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -26,30 +26,31 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
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<>() {
};
private static final Logger logger = LoggerFactory.getLogger(ImageBiomeProviderAddon.class);
@Inject
private Platform platform;
@Inject
private BaseAddon addon;
@Override
public void initialize() {
platform.getEventManager()
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPreLoadEvent.class)
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
PROVIDER_REGISTRY_KEY);
providerRegistry.register(addon.key("IMAGE"),
() -> new ImageProviderTemplate(event.getPack().getRegistry(Biome.class)));
})
.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.");
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPreLoadEvent.class)
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
PROVIDER_REGISTRY_KEY);
providerRegistry.register(addon.key("IMAGE"),
() -> new ImageProviderTemplate(event.getPack().getRegistry(Biome.class)));
})
.failThrough();
if(platform.getTerraConfig().isDebugLog())
logger.warn(
"The biome-provider-image addon is deprecated and scheduled for removal in Terra 7.0. It is recommended to use the " +
"biome-provider-image-v2 addon for future pack development instead.");
}
}
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -33,11 +33,11 @@ public class ImageProviderTemplate implements ObjectTemplate<BiomeProvider> {
@Value("image.align")
@Description("Sets the alignment style to use for the image.")
private ImageBiomeProvider.Align align;
public ImageProviderTemplate(Registry<Biome> set) {
this.biomes = set;
}
@Override
public BiomeProvider get() {
return new ImageBiomeProvider(new HashSet<>(biomes.entries()), image, resolution, align);
@@ -1,6 +1,6 @@
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
of this software and associated documentation files (the "Software"), to deal
@@ -6,7 +6,7 @@ of "stages" to apply "mutations" to a 2D grid of biomes.
Version 2 is a re-implementation of the original addon with the primary goal of providing
consistent scaling for noise relative to the world
(See https://github.com/PolyhedralDev/Terra/issues/264 for more details), and has been
included as a separate addon to maintain parity with packs utilizing the first version.
included as a separate addon to maintain parity with packs utilizing the first version.
This addon registers the `PIPELINE` biome provider type, and all associated
configurations.
@@ -1,12 +1,5 @@
version = version("1.0.0")
version = version("1.0.1")
dependencies {
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,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,
* 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 com.dfsek.terra.addons.biome.pipeline.v2.api.Source;
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
import com.dfsek.terra.addons.biome.pipeline.v2.config.BiomePipelineTemplate;
import com.dfsek.terra.addons.biome.pipeline.v2.config.PipelineBiomeLoader;
import com.dfsek.terra.addons.biome.pipeline.v2.config.source.SamplerSourceTemplate;
@@ -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.ReplaceStageTemplate;
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.api.Platform;
import com.dfsek.terra.api.addon.BaseAddon;
@@ -38,52 +38,52 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
public class BiomePipelineAddon implements AddonInitializer {
public static final TypeKey<Supplier<ObjectTemplate<Source>>> SOURCE_REGISTRY_KEY = new TypeKey<>() {
};
public static final TypeKey<Supplier<ObjectTemplate<Stage>>> STAGE_REGISTRY_KEY = new TypeKey<>() {
};
public static final TypeKey<Supplier<ObjectTemplate<BiomeProvider>>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
};
@Inject
private Platform platform;
@Inject
private BaseAddon addon;
@Override
public void initialize() {
platform.getEventManager()
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPreLoadEvent.class)
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
PROVIDER_REGISTRY_KEY);
providerRegistry.register(addon.key("PIPELINE"), BiomePipelineTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<Source>>> sourceRegistry = event.getPack().getOrCreateRegistry(
SOURCE_REGISTRY_KEY);
sourceRegistry.register(addon.key("SAMPLER"), SamplerSourceTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<Stage>>> stageRegistry = event.getPack().getOrCreateRegistry(
STAGE_REGISTRY_KEY);
stageRegistry.register(addon.key("FRACTAL_EXPAND"), ExpanderStageTemplate::new);
stageRegistry.register(addon.key("SMOOTH"), SmoothStageTemplate::new);
stageRegistry.register(addon.key("REPLACE"), ReplaceStageTemplate::new);
stageRegistry.register(addon.key("REPLACE_LIST"), ReplaceListStageTemplate::new);
stageRegistry.register(addon.key("BORDER"), BorderStageTemplate::new);
stageRegistry.register(addon.key("BORDER_LIST"), BorderListStageTemplate::new);
})
.failThrough();
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPreLoadEvent.class)
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
PROVIDER_REGISTRY_KEY);
providerRegistry.register(addon.key("PIPELINE"), BiomePipelineTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<Source>>> sourceRegistry = event.getPack().getOrCreateRegistry(
SOURCE_REGISTRY_KEY);
sourceRegistry.register(addon.key("SAMPLER"), SamplerSourceTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<Stage>>> stageRegistry = event.getPack().getOrCreateRegistry(
STAGE_REGISTRY_KEY);
stageRegistry.register(addon.key("FRACTAL_EXPAND"), ExpanderStageTemplate::new);
stageRegistry.register(addon.key("SMOOTH"), SmoothStageTemplate::new);
stageRegistry.register(addon.key("REPLACE"), ReplaceStageTemplate::new);
stageRegistry.register(addon.key("REPLACE_LIST"), ReplaceListStageTemplate::new);
stageRegistry.register(addon.key("BORDER"), BorderStageTemplate::new);
stageRegistry.register(addon.key("BORDER_LIST"), BorderListStageTemplate::new);
})
.failThrough();
platform.getEventManager()
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPostLoadEvent.class)
.then(event -> {
Registry<Biome> biomeRegistry = event.getPack().getRegistry(Biome.class);
event.getPack().applyLoader(PipelineBiome.class, new PipelineBiomeLoader(biomeRegistry));
});
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPostLoadEvent.class)
.then(event -> {
Registry<Biome> biomeRegistry = event.getPack().getRegistry(Biome.class);
event.getPack().applyLoader(PipelineBiome.class, new PipelineBiomeLoader(biomeRegistry));
});
}
}
@@ -12,11 +12,11 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
public class BiomePipelineColumn implements Column<Biome> {
private final int min;
private final int max;
private final int x;
private final int z;
private final Biome biome;
protected BiomePipelineColumn(BiomeProvider biomeProvider, int min, int max, int x, int z, long seed) {
this.min = min;
this.max = max;
@@ -24,44 +24,44 @@ public class BiomePipelineColumn implements Column<Biome> {
this.z = z;
this.biome = biomeProvider.getBiome(x, 0, z, seed);
}
@Override
public int getMinY() {
return min;
}
@Override
public int getMaxY() {
return max;
}
@Override
public int getX() {
return x;
}
@Override
public int getZ() {
return z;
}
@Override
public Biome get(int y) {
return biome;
}
@Override
public void forRanges(int resolution, IntIntObjConsumer<Biome> consumer) {
consumer.accept(min, max, biome);
}
@Override
public void forEach(Consumer<Biome> consumer) {
for(int y = min; y < max; y++) {
consumer.accept(biome);
}
}
@Override
public void forEach(IntObjConsumer<Biome> consumer) {
for(int y = min; y < max; y++) {
@@ -1,13 +1,9 @@
package com.dfsek.terra.addons.biome.pipeline.v2;
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.SeededVector;
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.util.cache.SeededVector2Key;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.LoadingCache;
import net.jafama.FastMath;
import java.util.Comparator;
import java.util.HashSet;
@@ -15,6 +11,10 @@ import java.util.Optional;
import java.util.Set;
import java.util.stream.StreamSupport;
import com.dfsek.terra.addons.biome.pipeline.v2.api.BiomeChunk;
import com.dfsek.terra.addons.biome.pipeline.v2.api.Pipeline;
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.registry.key.StringIdentifiable;
import com.dfsek.terra.api.util.Column;
@@ -23,23 +23,23 @@ import com.dfsek.terra.api.world.biome.generation.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 resolution;
private final NoiseSampler mutator;
private final double noiseAmp;
private final Set<Biome> biomes;
public PipelineBiomeProvider(Pipeline pipeline, int resolution, NoiseSampler mutator, double noiseAmp) {
this.resolution = resolution;
this.mutator = mutator;
this.noiseAmp = noiseAmp;
this.chunkSize = pipeline.getChunkSize();
this.biomeChunkCache = Caffeine.newBuilder()
.maximumSize(64)
.build(pipeline::generateChunk);
.maximumSize(64)
.build(pipeline::generateChunk);
Set<PipelineBiome> biomeSet = new HashSet<>();
pipeline.getSource().getBiomes().forEach(biomeSet::add);
Iterable<PipelineBiome> result = biomeSet;
@@ -50,64 +50,65 @@ public class PipelineBiomeProvider implements BiomeProvider {
Iterable<PipelineBiome> finalResult = result;
result.forEach(pipelineBiome -> {
if(pipelineBiome.isPlaceholder()) {
StringBuilder biomeList = new StringBuilder("\n");
StreamSupport.stream(finalResult.spliterator(), false)
.sorted(Comparator.comparing(StringIdentifiable::getID))
.forEach(delegate -> biomeList
.append(" - ")
.append(delegate.getID())
.append(':')
.append(delegate.getClass().getCanonicalName())
.append('\n'));
.sorted(Comparator.comparing(StringIdentifiable::getID))
.forEach(delegate -> biomeList
.append(" - ")
.append(delegate.getID())
.append(':')
.append(delegate.getClass().getCanonicalName())
.append('\n'));
throw new IllegalArgumentException("Biome Pipeline leaks placeholder biome \"" + pipelineBiome.getID() +
"\". Ensure there is a stage to guarantee replacement of the placeholder biome. Biomes: " +
"\". Ensure there is a stage to guarantee replacement of the placeholder biome. " +
"Biomes: " +
biomeList);
}
this.biomes.add(pipelineBiome.getBiome());
});
}
@Override
public Biome getBiome(int x, int y, int z, long seed) {
return getBiome(x, z, seed);
}
public Biome getBiome(int x, int z, long seed) {
x += mutator.noise(seed + 1, x, z) * noiseAmp;
z += mutator.noise(seed + 2, x, z) * noiseAmp;
x /= resolution;
z /= resolution;
int chunkX = FastMath.floorDiv(x, chunkSize);
int chunkZ = FastMath.floorDiv(z, chunkSize);
int chunkX = Math.floorDiv(x, chunkSize);
int chunkZ = Math.floorDiv(z, chunkSize);
int chunkWorldX = chunkX * chunkSize;
int chunkWorldZ = chunkZ * chunkSize;
int xInChunk = x - chunkWorldX;
int zInChunk = z - chunkWorldZ;
return biomeChunkCache.get(new SeededVector(seed, chunkWorldX, chunkWorldZ)).get(xInChunk, zInChunk).getBiome();
return biomeChunkCache.get(new SeededVector2Key(chunkWorldX, chunkWorldZ, seed)).get(xInChunk, zInChunk).getBiome();
}
@Override
public Iterable<Biome> getBiomes() {
return biomes;
}
@Override
public Optional<Biome> getBaseBiome(int x, int z, long seed) {
return Optional.of(getBiome(x, z, seed));
}
@Override
public Column<Biome> getColumn(int x, int z, long seed, int min, int max) {
return new BiomePipelineColumn(this, min, max, x, z, seed);
}
@Override
public int resolution() {
return resolution;
@@ -5,6 +5,6 @@ import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
public interface BiomeChunk {
PipelineBiome get(int xInChunk, int zInChunk);
}
@@ -1,7 +1,7 @@
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.pipeline.BiomeChunkImpl.ViewPoint;
/**
@@ -9,14 +9,14 @@ import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
* filling in null biomes as a result of this resizing.
*/
public interface Expander extends Stage {
PipelineBiome fillBiome(ViewPoint viewPoint);
@Override
default int maxRelativeReadDistance() {
return 0;
}
@Override
default PipelineBiome apply(ViewPoint viewPoint) {
PipelineBiome currentBiome = viewPoint.getBiome();
@@ -1,14 +1,16 @@
package com.dfsek.terra.addons.biome.pipeline.v2.api;
import com.dfsek.terra.api.util.cache.SeededVector2Key;
import java.util.List;
public interface Pipeline {
BiomeChunk generateChunk(SeededVector worldCoordinates);
BiomeChunk generateChunk(SeededVector2Key worldCoordinates);
int getChunkSize();
Source getSource();
List<Stage> getStages();
}
@@ -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)));
}
}
@@ -6,6 +6,6 @@ import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
public interface Source {
PipelineBiome get(long seed, int x, int z);
Iterable<PipelineBiome> getBiomes();
}
@@ -1,14 +1,14 @@
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.pipeline.BiomeChunkImpl.ViewPoint;
public interface Stage {
PipelineBiome apply(ViewPoint viewPoint);
int maxRelativeReadDistance();
default Iterable<PipelineBiome> getBiomes(Iterable<PipelineBiome> biomes) {
return biomes;
}
@@ -7,32 +7,32 @@ import com.dfsek.terra.api.world.biome.Biome;
public final class DelegatedPipelineBiome implements PipelineBiome {
private final Biome biome;
public DelegatedPipelineBiome(Biome biome) {
this.biome = biome;
}
@Override
public Biome getBiome() {
return biome;
}
@Override
public int hashCode() {
return biome.hashCode();
}
@Override
public boolean equals(Object obj) {
if(!(obj instanceof DelegatedPipelineBiome that)) return false;
return that.biome.equals(this.biome);
}
@Override
public Set<String> getTags() {
return biome.getTags();
}
@Override
public String getID() {
return biome.getID();
@@ -7,29 +7,29 @@ import com.dfsek.terra.api.world.biome.Biome;
public interface PipelineBiome extends StringIdentifiable {
Biome getBiome();
static PipelineBiome placeholder(String id) {
return new PlaceholderPipelineBiome(id);
}
static PipelineBiome from(Biome biome) {
return new DelegatedPipelineBiome(biome);
}
static PipelineBiome self() {
return SelfPipelineBiome.INSTANCE;
}
Biome getBiome();
Set<String> getTags();
default boolean isPlaceholder() {
return false;
}
default boolean isSelf() {
return false;
}
}
@@ -9,43 +9,43 @@ import com.dfsek.terra.api.world.biome.Biome;
final class PlaceholderPipelineBiome implements PipelineBiome {
private final Set<String> tags;
private final String id;
public PlaceholderPipelineBiome(String id) {
this.id = id;
tags = new HashSet<>();
tags.add(id);
tags.add("ALL");
}
@Override
public Biome getBiome() {
throw new UnsupportedOperationException("Cannot get raw biome from placeholder pipeline biome");
}
@Override
public Set<String> getTags() {
return tags;
}
@Override
public String getID() {
return id;
}
@Override
public boolean isPlaceholder() {
return true;
}
@Override
public int hashCode() {
return id.hashCode();
}
@Override
public boolean equals(Object obj) {
if(!(obj instanceof PlaceholderPipelineBiome that)) return false;
return this.id.equals(that.id);
}
}
@@ -8,31 +8,31 @@ import com.dfsek.terra.api.world.biome.Biome;
final class SelfPipelineBiome implements PipelineBiome {
public static final SelfPipelineBiome INSTANCE = new SelfPipelineBiome();
private SelfPipelineBiome() {
}
@Override
public Biome getBiome() {
throw new UnsupportedOperationException("Cannot get biome from self delegate");
}
@Override
public boolean isSelf() {
return true;
}
@Override
public boolean isPlaceholder() {
return true;
}
@Override
public Set<String> getTags() {
return Collections.emptySet();
}
@Override
public String getID() {
return "SELF";
@@ -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,
* 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 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.Stage;
import com.dfsek.terra.addons.biome.pipeline.v2.pipeline.PipelineImpl;
import com.dfsek.terra.api.config.meta.Meta;
import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
@@ -33,25 +33,21 @@ public class BiomePipelineTemplate implements ObjectTemplate<BiomeProvider> {
Larger values are quadratically faster, but produce lower quality results.
For example, a value of 3 would sample every 3 blocks.""")
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")
@Default
@Description("A sampler to use for blending the edges of biomes via domain warping.")
protected @Meta NoiseSampler blendSampler = NoiseSampler.zero();
@Value("blend.amplitude")
@Default
@Description("The amplitude at which to perform blending.")
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
public BiomeProvider get() {
return new PipelineBiomeProvider(new PipelineImpl(source, stages, resolution, 128), resolution, blendSampler, blendAmplitude);
@@ -15,18 +15,18 @@ import com.dfsek.terra.api.world.biome.Biome;
public class PipelineBiomeLoader implements TypeLoader<PipelineBiome> {
private final Registry<Biome> biomeRegistry;
public PipelineBiomeLoader(Registry<Biome> biomeRegistry) {
this.biomeRegistry = biomeRegistry;
}
@Override
public PipelineBiome load(@NotNull AnnotatedType t, @NotNull Object c, @NotNull ConfigLoader loader, DepthTracker depthTracker)
throws LoadException {
if(c.equals("SELF")) return PipelineBiome.self();
return biomeRegistry
.getByID((String) c)
.map(PipelineBiome::from)
.orElseGet(() -> PipelineBiome.placeholder((String) c));
.getByID((String) c)
.map(PipelineBiome::from)
.orElseGet(() -> PipelineBiome.placeholder((String) c));
}
}
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -22,11 +22,11 @@ public class SamplerSourceTemplate extends SourceTemplate {
@Value("sampler")
@Description("The sampler used to distribute biomes.")
private @Meta NoiseSampler noise;
@Value("biomes")
@Description("The biomes to be distributed.")
private @Meta ProbabilityCollection<@Meta PipelineBiome> biomes;
@Override
public Source get() {
return new SamplerSource(biomes, noise);
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -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,
* 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;
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.config.stage.StageTemplate;
import com.dfsek.terra.addons.biome.pipeline.v2.stage.expander.FractalExpander;
@@ -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,
* 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 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.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.api.config.meta.Meta;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
@@ -23,17 +23,17 @@ import com.dfsek.terra.api.util.collection.ProbabilityCollection;
public class BorderListStageTemplate extends StageTemplate {
@Value("from")
private @Meta String from;
@Value("default-replace")
private @Meta String defaultReplace;
@Value("default-to")
private @Meta ProbabilityCollection<@Meta PipelineBiome> defaultTo;
@Value("replace")
private @Meta Map<@Meta PipelineBiome, @Meta ProbabilityCollection<@Meta PipelineBiome>> replace;
@Override
public Stage get() {
return new BorderListStage(replace, from, defaultReplace, noise, defaultTo);
@@ -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,
* 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.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.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.api.config.meta.Meta;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
@@ -21,13 +21,13 @@ import com.dfsek.terra.api.util.collection.ProbabilityCollection;
public class BorderStageTemplate extends StageTemplate {
@Value("from")
private @Meta String from;
@Value("replace")
private @Meta String replace;
@Value("to")
private @Meta ProbabilityCollection<@Meta PipelineBiome> to;
@Override
public Stage get() {
return new BorderStage(from, replace, noise, to);
@@ -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,
* 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 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.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.api.config.meta.Meta;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
@@ -23,13 +23,13 @@ import com.dfsek.terra.api.util.collection.ProbabilityCollection;
public class ReplaceListStageTemplate extends StageTemplate {
@Value("default-from")
private @Meta String defaultFrom;
@Value("default-to")
private @Meta ProbabilityCollection<@Meta PipelineBiome> defaultTo;
@Value("to")
private @Meta Map<@Meta PipelineBiome, @Meta ProbabilityCollection<@Meta PipelineBiome>> replace;
@Override
public Stage get() {
return new ReplaceListStage(replace, defaultFrom, defaultTo, noise);
@@ -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,
* 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.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.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.api.config.meta.Meta;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
@@ -21,10 +21,10 @@ import com.dfsek.terra.api.util.collection.ProbabilityCollection;
public class ReplaceStageTemplate extends StageTemplate {
@Value("from")
private @Meta String from;
@Value("to")
private @Meta ProbabilityCollection<@Meta PipelineBiome> to;
@Override
public Stage get() {
return new ReplaceStage(from, to, noise);
@@ -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,
* 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;
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.config.stage.StageTemplate;
import com.dfsek.terra.addons.biome.pipeline.v2.stage.mutators.SmoothStage;
@@ -1,53 +1,54 @@
package com.dfsek.terra.addons.biome.pipeline.v2.pipeline;
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.SeededVector;
import com.dfsek.terra.addons.biome.pipeline.v2.api.Stage;
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
import net.jafama.FastMath;
import java.util.List;
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.Stage;
import com.dfsek.terra.addons.biome.pipeline.v2.api.biome.PipelineBiome;
import com.dfsek.terra.api.util.cache.SeededVector2Key;
public class BiomeChunkImpl implements BiomeChunk {
private PipelineBiome[][] biomes;
private final SeededVector worldOrigin;
private final SeededVector2Key worldOrigin;
private final int chunkOriginArrayIndex;
private final int worldCoordinateScale;
public BiomeChunkImpl(SeededVector worldOrigin, PipelineImpl pipeline) {
private final int size;
private PipelineBiome[] biomes;
public BiomeChunkImpl(SeededVector2Key worldOrigin, PipelineImpl pipeline) {
this.worldOrigin = worldOrigin;
this.chunkOriginArrayIndex = pipeline.getChunkOriginArrayIndex();
this.worldCoordinateScale = pipeline.getResolution();
int size = pipeline.getArraySize();
this.size = pipeline.getArraySize();
int expanderCount = pipeline.getExpanderCount();
int expansionsApplied = 0;
// Allocate working arrays
this.biomes = new PipelineBiome[size][size];
PipelineBiome[][] lookupArray = new PipelineBiome[size][size];
this.biomes = 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
// Construct working grid
int gridOrigin = 0;
int gridInterval = calculateGridInterval(expanderCount, expansionsApplied);
int gridSize = (size / gridInterval);
gridSize += expanderCount > 0 ? 1 : 0; // Add an extra border if expansion occurs
// Fill working grid with initial cells
for(int gridX = 0; gridX < gridSize; gridX++) {
for(int gridZ = 0; gridZ < gridSize; gridZ++) {
int xIndex = gridOrigin + gridX * 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));
}
}
for(Stage stage : pipeline.getStages()) {
if(stage instanceof Expander) {
// Shrink working grid size, the expander will fill in null cells (as a result of shrinking the grid) during mutation
@@ -55,46 +56,32 @@ public class BiomeChunkImpl implements BiomeChunk {
gridInterval = calculateGridInterval(expanderCount, expansionsApplied);
gridSize = expandSize(gridSize);
}
int stageReadDistance = stage.maxRelativeReadDistance();
if(stageReadDistance > 0) {
// Discard edges such that adjacent lookups are only ran on valid cells
gridSize = contractBordersFromSize(gridSize, stageReadDistance);
gridOrigin += stageReadDistance * gridInterval;
}
// 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
PipelineBiome[][] tempArray = biomes;
PipelineBiome[] tempArray = biomes;
biomes = lookupArray;
lookupArray = tempArray;
// Apply stage to working grid
for(int gridZ = 0; gridZ < gridSize; gridZ = gridZ + 1) {
for(int gridX = 0; gridX < gridSize; gridX = gridX + 1) {
int xIndex = gridOrigin + gridX * 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) {
int size = initialSize;
for(int i = 0; i < expanderCount; i++) {
@@ -102,24 +89,24 @@ public class BiomeChunkImpl implements BiomeChunk {
}
return size;
}
protected static int calculateChunkOriginArrayIndex(int totalExpanderCount, List<Stage> stages) {
int finalGridOrigin = calculateFinalGridOrigin(totalExpanderCount, stages);
int initialGridInterval = calculateGridInterval(totalExpanderCount, 0);
// Round the final grid origin up to the nearest multiple of initialGridInterval, such that each
// chunk samples points on the same overall grid.
// 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.
return FastMath.ceilToInt((double) finalGridOrigin / initialGridInterval) * initialGridInterval;
return (int) Math.ceil((double) finalGridOrigin / initialGridInterval) * initialGridInterval;
}
private static int calculateFinalGridOrigin(int totalExpanderCount, List<Stage> stages) {
int gridOrigin = 0;
int expansionsApplied = 0;
int gridInterval = calculateGridInterval(totalExpanderCount, expansionsApplied);
for (Stage stage : stages) {
if (stage instanceof Expander) {
for(Stage stage : stages) {
if(stage instanceof Expander) {
expansionsApplied++;
gridInterval = calculateGridInterval(totalExpanderCount, expansionsApplied);
}
@@ -127,27 +114,42 @@ public class BiomeChunkImpl implements BiomeChunk {
}
return gridOrigin;
}
protected static int calculateChunkSize(int arraySize, int chunkOriginArrayIndex, int totalExpanderCount) {
return contractBordersFromSize(arraySize, chunkOriginArrayIndex) - (totalExpanderCount > 0 ? 1 : 0);
}
private static int expandSize(int size) {
return size * 2 - 1;
}
private static int contractBordersFromSize(int size, int border) {
return size - border * 2;
}
private static int calculateGridInterval(int totalExpansions, int 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;
}
/**
* Represents a point on the operating grid within the biomes array
*/
@@ -159,9 +161,11 @@ public class BiomeChunkImpl implements BiomeChunk {
private final int gridZ;
private final int xIndex;
private final int zIndex;
private final PipelineBiome[][] lookupArray;
private ViewPoint(BiomeChunkImpl chunk, int gridInterval, int gridX, int gridZ, int xIndex, int zIndex, 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, int size) {
this.chunk = chunk;
this.gridInterval = gridInterval;
this.gridX = gridX;
@@ -169,49 +173,50 @@ public class BiomeChunkImpl implements BiomeChunk {
this.xIndex = xIndex;
this.zIndex = zIndex;
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) {
int lookupXIndex = this.xIndex + x * gridInterval;
int lookupZIndex = this.zIndex + z * gridInterval;
return lookupArray[lookupXIndex][lookupZIndex];
return lookupArray[(lookupXIndex * this.size) + lookupZIndex];
}
public PipelineBiome getBiome() {
return biome;
}
/**
* @return X position of the point relative to the operating grid
*/
public int gridX() {
return gridX;
}
/**
* @return Z position of the point relative to the operating grid
*/
public int gridZ() {
return gridZ;
}
/**
* @return X position of the point in the world
*/
public int worldX() {
return chunk.xIndexToWorldCoordinate(xIndex);
}
/**
* @return Z position of the point in the world
*/
public int worldZ() {
return chunk.zIndexToWorldCoordinate(zIndex);
}
public long worldSeed() {
return chunk.getOrigin().seed();
return chunk.getOrigin().seed;
}
}
}
@@ -1,5 +1,7 @@
package com.dfsek.terra.addons.biome.pipeline.v2.pipeline;
import com.dfsek.terra.api.util.cache.SeededVector2Key;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -8,15 +10,14 @@ import java.util.List;
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.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.Stage;
public class PipelineImpl implements Pipeline {
private static final Logger logger = LoggerFactory.getLogger(PipelineImpl.class);
private final Source source;
private final List<Stage> stages;
private final int chunkSize;
@@ -24,68 +25,68 @@ public class PipelineImpl implements Pipeline {
private final int arraySize;
private final int chunkOriginArrayIndex;
private final int resolution;
public PipelineImpl(Source source, List<Stage> stages, int resolution, int idealChunkArraySize) {
this.source = source;
this.stages = stages;
this.resolution = resolution;
this.expanderCount = (int) stages.stream().filter(s -> s instanceof Expander).count();
// Optimize for the ideal array size
int arraySize;
int chunkOriginArrayIndex;
int chunkSize;
int initialSize = 1;
while (true) {
while(true) {
arraySize = BiomeChunkImpl.initialSizeToArraySize(expanderCount, initialSize);
chunkOriginArrayIndex = BiomeChunkImpl.calculateChunkOriginArrayIndex(expanderCount, stages);
chunkSize = BiomeChunkImpl.calculateChunkSize(arraySize, chunkOriginArrayIndex, expanderCount);
if (chunkSize > 1 && arraySize >= idealChunkArraySize) break;
if(chunkSize > 1 && arraySize >= idealChunkArraySize) break;
initialSize++;
}
this.arraySize = arraySize;
this.chunkOriginArrayIndex = chunkOriginArrayIndex;
this.chunkSize = chunkSize;
logger.debug("Initialized a new biome pipeline:");
logger.debug("Array size: {} (Target: {})", arraySize, idealChunkArraySize);
logger.debug("Internal array origin: {}", chunkOriginArrayIndex);
logger.debug("Chunk size: {}", chunkSize);
}
@Override
public BiomeChunk generateChunk(SeededVector worldCoordinates) {
public BiomeChunk generateChunk(SeededVector2Key worldCoordinates) {
return new BiomeChunkImpl(worldCoordinates, this);
}
@Override
public int getChunkSize() {
return chunkSize;
}
@Override
public Source getSource() {
return source;
}
@Override
public List<Stage> getStages() {
return stages;
}
protected int getExpanderCount() {
return expanderCount;
}
protected int getArraySize() {
return arraySize;
}
protected int getChunkOriginArrayIndex() {
return chunkOriginArrayIndex;
}
protected int getResolution() {
return resolution;
}
@@ -9,17 +9,17 @@ import com.dfsek.terra.api.util.collection.ProbabilityCollection;
public class SamplerSource implements Source {
private final ProbabilityCollection<PipelineBiome> biomes;
private final NoiseSampler sampler;
public SamplerSource(ProbabilityCollection<PipelineBiome> biomes, NoiseSampler sampler) {
this.biomes = biomes;
this.sampler = sampler;
}
@Override
public PipelineBiome get(long seed, int x, int z) {
return biomes.get(sampler, x, z, seed);
}
@Override
public Iterable<PipelineBiome> getBiomes() {
return biomes.getContents();
@@ -3,23 +3,23 @@ package com.dfsek.terra.addons.biome.pipeline.v2.source;
import java.util.Collections;
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.biome.PipelineBiome;
public class SingleSource implements Source {
private final PipelineBiome biome;
public SingleSource(PipelineBiome biome) {
this.biome = biome;
}
@Override
public PipelineBiome get(long seed, int x, int z) {
return biome;
}
@Override
public Set<PipelineBiome> getBiomes() {
return Collections.singleton(biome);
@@ -7,30 +7,30 @@ import com.dfsek.terra.api.noise.NoiseSampler;
public class FractalExpander implements Expander {
private final NoiseSampler sampler;
public FractalExpander(NoiseSampler sampler) {
this.sampler = sampler;
}
@Override
public PipelineBiome fillBiome(BiomeChunkImpl.ViewPoint viewPoint) {
int xMod2 = viewPoint.gridX() % 2;
int zMod2 = viewPoint.gridZ() % 2;
double roll = sampler.noise(viewPoint.worldSeed(), viewPoint.worldX(), viewPoint.worldZ());
if (xMod2 == 1 && zMod2 == 0) { // Pick one of 2 neighbors on X axis randomly
if(xMod2 == 1 && zMod2 == 0) { // Pick one of 2 neighbors on X axis randomly
return roll > 0 ? viewPoint.getRelativeBiome(-1, 0) : viewPoint.getRelativeBiome(1, 0);
} else if (xMod2 == 0 && zMod2 == 1) { // Pick one of 2 neighbors on Z axis randomly
} else if(xMod2 == 0 && zMod2 == 1) { // Pick one of 2 neighbors on Z axis randomly
return roll > 0 ? viewPoint.getRelativeBiome(0, -1) : viewPoint.getRelativeBiome(0, 1);
} else { // Pick one of 4 corners randomly
return roll > 0 ?
roll > 0.25 ? viewPoint.getRelativeBiome(-1, 1) : viewPoint.getRelativeBiome(1, 1) :
roll > 0.25 ? viewPoint.getRelativeBiome(-1, 1) : viewPoint.getRelativeBiome(1, 1) :
roll > -0.25 ? viewPoint.getRelativeBiome(-1, -1) : viewPoint.getRelativeBiome(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,
* reference the LICENSE file in this module's root directory.
@@ -28,9 +28,9 @@ public class BorderListStage implements Stage {
private final ProbabilityCollection<PipelineBiome> replaceDefault;
private final String defaultReplace;
private final Map<PipelineBiome, ProbabilityCollection<PipelineBiome>> replace;
private final Vector2Int[] borderPoints;
public BorderListStage(Map<PipelineBiome, ProbabilityCollection<PipelineBiome>> replace, String border, String defaultReplace,
NoiseSampler noiseSampler, ProbabilityCollection<PipelineBiome> replaceDefault) {
this.border = border;
@@ -38,7 +38,7 @@ public class BorderListStage implements Stage {
this.replaceDefault = replaceDefault;
this.defaultReplace = defaultReplace;
this.replace = replace;
List<Vector2Int> points = new ArrayList<>();
for(int x = -1; x <= 1; x++) {
for(int z = -1; z <= 1; z++) {
@@ -47,9 +47,9 @@ public class BorderListStage implements Stage {
}
}
this.borderPoints = points.toArray(new Vector2Int[0]);
}
@Override
public Iterable<PipelineBiome> getBiomes(Iterable<PipelineBiome> biomes) {
Set<PipelineBiome> biomeSet = new HashSet<>();
@@ -58,7 +58,7 @@ public class BorderListStage implements Stage {
replace.forEach((biome, collection) -> biomeSet.addAll(collection.getContents()));
return biomeSet;
}
@Override
public PipelineBiome apply(BiomeChunkImpl.ViewPoint viewPoint) {
PipelineBiome center = viewPoint.getBiome();
@@ -68,17 +68,18 @@ public class BorderListStage implements Stage {
if(current != null && current.getTags().contains(border)) {
if(replace.containsKey(center)) {
PipelineBiome replacement = replace.get(center).get(noiseSampler, viewPoint.worldX(), viewPoint.worldZ(),
viewPoint.worldSeed());
viewPoint.worldSeed());
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 center;
}
@Override
public int maxRelativeReadDistance() {
return 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,
* reference the LICENSE file in this module's root directory.
@@ -27,7 +27,7 @@ public class BorderStage implements Stage {
private final ProbabilityCollection<PipelineBiome> replace;
private final String replaceTag;
private final Vector2Int[] borderPoints;
public BorderStage(String border, String replaceTag, NoiseSampler noiseSampler, ProbabilityCollection<PipelineBiome> replace) {
this.border = border;
this.noiseSampler = noiseSampler;
@@ -42,7 +42,7 @@ public class BorderStage implements Stage {
}
this.borderPoints = points.toArray(new Vector2Int[0]);
}
@Override
public PipelineBiome apply(BiomeChunkImpl.ViewPoint viewPoint) {
PipelineBiome center = viewPoint.getBiome();
@@ -57,23 +57,23 @@ public class BorderStage implements Stage {
}
return center;
}
@Override
public Iterable<PipelineBiome> getBiomes(Iterable<PipelineBiome> biomes) {
Set<PipelineBiome> biomeSet = new HashSet<>();
biomes.forEach(biomeSet::add);
biomeSet.addAll(
replace
.getContents()
.stream()
.filter(
Predicate.not(PipelineBiome::isSelf)
)
.toList()
);
replace
.getContents()
.stream()
.filter(
Predicate.not(PipelineBiome::isSelf)
)
.toList()
);
return biomeSet;
}
@Override
public int maxRelativeReadDistance() {
return 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,
* reference the LICENSE file in this module's root directory.
@@ -24,7 +24,7 @@ public class ReplaceListStage implements Stage {
private final NoiseSampler sampler;
private final ProbabilityCollection<PipelineBiome> replaceDefault;
private final String defaultTag;
public ReplaceListStage(Map<PipelineBiome, ProbabilityCollection<PipelineBiome>> replace, String defaultTag,
ProbabilityCollection<PipelineBiome> replaceDefault, NoiseSampler sampler) {
this.replace = replace;
@@ -32,7 +32,7 @@ public class ReplaceListStage implements Stage {
this.defaultTag = defaultTag;
this.replaceDefault = replaceDefault;
}
@Override
public PipelineBiome apply(BiomeChunkImpl.ViewPoint viewPoint) {
PipelineBiome center = viewPoint.getBiome();
@@ -46,18 +46,18 @@ public class ReplaceListStage implements Stage {
}
return center;
}
@Override
public int maxRelativeReadDistance() {
return 0;
}
@Override
public Iterable<PipelineBiome> getBiomes(Iterable<PipelineBiome> biomes) {
Set<PipelineBiome> biomeSet = new HashSet<>();
Set<PipelineBiome> reject = new HashSet<>();
biomes.forEach(biome -> {
if(!biome.getTags().contains(defaultTag) && !replace.containsKey(biome)) {
biomeSet.add(biome);
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -22,13 +22,13 @@ public class ReplaceStage implements Stage {
private final String replaceableTag;
private final ProbabilityCollection<PipelineBiome> replace;
private final NoiseSampler sampler;
public ReplaceStage(String replaceable, ProbabilityCollection<PipelineBiome> replace, NoiseSampler sampler) {
this.replaceableTag = replaceable;
this.replace = replace;
this.sampler = sampler;
}
@Override
public PipelineBiome apply(BiomeChunkImpl.ViewPoint viewPoint) {
if(viewPoint.getBiome().getTags().contains(replaceableTag)) {
@@ -37,12 +37,12 @@ public class ReplaceStage implements Stage {
}
return viewPoint.getBiome();
}
@Override
public int maxRelativeReadDistance() {
return 0;
}
@Override
public Iterable<PipelineBiome> getBiomes(Iterable<PipelineBiome> biomes) {
Set<PipelineBiome> biomeSet = new HashSet<>();
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -16,25 +16,25 @@ import com.dfsek.terra.api.noise.NoiseSampler;
public class SmoothStage implements Stage {
private final NoiseSampler sampler;
public SmoothStage(NoiseSampler sampler) {
this.sampler = sampler;
}
@Override
public PipelineBiome apply(BiomeChunkImpl.ViewPoint viewPoint) {
PipelineBiome top = viewPoint.getRelativeBiome(1, 0);
PipelineBiome bottom = viewPoint.getRelativeBiome(-1, 0);
PipelineBiome left = viewPoint.getRelativeBiome(0, 1);
PipelineBiome right = viewPoint.getRelativeBiome(0, -1);
double roll = sampler.noise(viewPoint.worldSeed(), viewPoint.worldX(), viewPoint.worldZ());
boolean vert = Objects.equals(top, bottom);
boolean horiz = Objects.equals(left, right);
if(vert && horiz) {
return roll > 0 ?
roll > 0.25 ? left : right :
@@ -48,7 +48,7 @@ public class SmoothStage implements Stage {
}
return viewPoint.getBiome();
}
@Override
public int maxRelativeReadDistance() {
return 1;
@@ -1,6 +1,6 @@
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
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 {
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,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,
* reference the LICENSE file in this module's root directory.
@@ -20,7 +20,7 @@ public class BiomeHolderImpl implements BiomeHolder {
private final int width;
private final int offset;
private BiomeDelegate[][] biomes;
public BiomeHolderImpl(int width, Vector2.Mutable origin) {
width += 4;
this.width = width;
@@ -28,38 +28,38 @@ public class BiomeHolderImpl implements BiomeHolder {
this.origin = origin;
this.offset = 2;
}
private BiomeHolderImpl(BiomeDelegate[][] biomes, Vector2.Mutable origin, int width, int offset) {
this.biomes = biomes;
this.origin = origin;
this.width = width;
this.offset = 2 * offset;
}
@Override
public BiomeHolder expand(BiomeExpander expander, long seed) {
BiomeDelegate[][] old = biomes;
int newWidth = width * 2 - 1;
biomes = new BiomeDelegate[newWidth][newWidth];
for(int x = 0; x < width; x++) {
for(int z = 0; z < width; z++) {
biomes[x * 2][z * 2] = old[x][z];
if(z != width - 1)
biomes[x * 2][z * 2 + 1] = expander.getBetween(x + origin.getX(), z + 1 + origin.getZ(), seed, old[x][z],
old[x][z + 1]);
old[x][z + 1]);
if(x != width - 1)
biomes[x * 2 + 1][z * 2] = expander.getBetween(x + 1 + origin.getX(), z + origin.getZ(), seed, old[x][z],
old[x + 1][z]);
old[x + 1][z]);
if(x != width - 1 && z != width - 1)
biomes[x * 2 + 1][z * 2 + 1] = expander.getBetween(x + 1 + origin.getX(), z + 1 + origin.getZ(), seed, old[x][z],
old[x + 1][z + 1], old[x][z + 1], old[x + 1][z]);
old[x + 1][z + 1], old[x][z + 1], old[x + 1][z]);
}
}
return new BiomeHolderImpl(biomes, origin.setX(origin.getX() * 2 - 1).setZ(origin.getZ() * 2 - 1), newWidth, offset);
}
@Override
public void mutate(BiomeMutator mutator, long seed) {
for(int x = 0; x < width; x++) {
@@ -69,7 +69,7 @@ public class BiomeHolderImpl implements BiomeHolder {
}
}
}
@Override
public void fill(BiomeSource source, long seed) {
for(int x = 0; x < width; x++) {
@@ -78,14 +78,14 @@ public class BiomeHolderImpl implements BiomeHolder {
}
}
}
@Override
public BiomeDelegate getBiome(int x, int z) {
x += offset;
z += offset;
return getBiomeRaw(x, z);
}
@Override
public BiomeDelegate getBiomeRaw(int x, int z) {
if(x >= width || z >= width || x < 0 || z < 0) return null;
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -22,14 +22,14 @@ public class BiomePipeline {
private final List<Stage> stages;
private final int size;
private final int init;
private BiomePipeline(BiomeSource source, List<Stage> stages, int size, int init) {
this.source = source;
this.stages = stages;
this.size = size;
this.init = init;
}
/**
* Get biomes in a chunk
*
@@ -44,37 +44,37 @@ public class BiomePipeline {
for(Stage stage : stages) holder = stage.apply(holder, seed);
return holder;
}
public BiomeSource getSource() {
return source;
}
public List<Stage> getStages() {
return Collections.unmodifiableList(stages);
}
public int getSize() {
return size;
}
public static final class BiomePipelineBuilder {
private final int init;
private final List<Stage> stages = new ArrayList<>();
private int expand;
public BiomePipelineBuilder(int init) {
this.init = init;
expand = init;
}
public BiomePipeline build(BiomeSource source) {
for(Stage stage : stages) {
if(stage.isExpansion()) expand = expand * 2 - 1;
}
return new BiomePipeline(source, stages, expand, init);
}
public BiomePipelineBuilder addStage(Stage stage) {
stages.add(stage);
return this;
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -40,56 +40,57 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
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<Stage>>> STAGE_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
private Platform platform;
@Inject
private BaseAddon addon;
@Override
public void initialize() {
platform.getEventManager()
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPreLoadEvent.class)
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
PROVIDER_REGISTRY_KEY);
providerRegistry.register(addon.key("PIPELINE"), BiomePipelineTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeSource>>> sourceRegistry = event.getPack().getOrCreateRegistry(
SOURCE_REGISTRY_KEY);
sourceRegistry.register(addon.key("SAMPLER"), SamplerSourceTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<Stage>>> stageRegistry = event.getPack().getOrCreateRegistry(
STAGE_REGISTRY_KEY);
stageRegistry.register(addon.key("FRACTAL_EXPAND"), ExpanderStageTemplate::new);
stageRegistry.register(addon.key("SMOOTH"), SmoothMutatorTemplate::new);
stageRegistry.register(addon.key("REPLACE"), ReplaceMutatorTemplate::new);
stageRegistry.register(addon.key("REPLACE_LIST"), ReplaceListMutatorTemplate::new);
stageRegistry.register(addon.key("BORDER"), BorderMutatorTemplate::new);
stageRegistry.register(addon.key("BORDER_LIST"), BorderListMutatorTemplate::new);
})
.failThrough();
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPreLoadEvent.class)
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeProvider>>> providerRegistry = event.getPack().getOrCreateRegistry(
PROVIDER_REGISTRY_KEY);
providerRegistry.register(addon.key("PIPELINE"), BiomePipelineTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<BiomeSource>>> sourceRegistry = event.getPack().getOrCreateRegistry(
SOURCE_REGISTRY_KEY);
sourceRegistry.register(addon.key("SAMPLER"), SamplerSourceTemplate::new);
})
.then(event -> {
CheckedRegistry<Supplier<ObjectTemplate<Stage>>> stageRegistry = event.getPack().getOrCreateRegistry(
STAGE_REGISTRY_KEY);
stageRegistry.register(addon.key("FRACTAL_EXPAND"), ExpanderStageTemplate::new);
stageRegistry.register(addon.key("SMOOTH"), SmoothMutatorTemplate::new);
stageRegistry.register(addon.key("REPLACE"), ReplaceMutatorTemplate::new);
stageRegistry.register(addon.key("REPLACE_LIST"), ReplaceListMutatorTemplate::new);
stageRegistry.register(addon.key("BORDER"), BorderMutatorTemplate::new);
stageRegistry.register(addon.key("BORDER_LIST"), BorderListMutatorTemplate::new);
})
.failThrough();
platform.getEventManager()
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPostLoadEvent.class)
.then(event -> {
Registry<Biome> biomeRegistry = event.getPack().getRegistry(Biome.class);
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.");
.getHandler(FunctionalEventHandler.class)
.register(addon, ConfigPackPostLoadEvent.class)
.then(event -> {
Registry<Biome> biomeRegistry = event.getPack().getRegistry(Biome.class);
event.getPack().applyLoader(BiomeDelegate.class, new BiomeDelegateLoader(biomeRegistry));
});
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.");
}
}
@@ -12,11 +12,11 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
class BiomePipelineColumn implements Column<Biome> {
private final int min;
private final int max;
private final int x;
private final int z;
private final Biome biome;
protected BiomePipelineColumn(BiomeProvider biomeProvider, int min, int max, int x, int z, long seed) {
this.min = min;
this.max = max;
@@ -24,44 +24,44 @@ class BiomePipelineColumn implements Column<Biome> {
this.z = z;
this.biome = biomeProvider.getBiome(x, 0, z, seed);
}
@Override
public int getMinY() {
return min;
}
@Override
public int getMaxY() {
return max;
}
@Override
public int getX() {
return x;
}
@Override
public int getZ() {
return z;
}
@Override
public Biome get(int y) {
return biome;
}
@Override
public void forRanges(int resolution, IntIntObjConsumer<Biome> consumer) {
consumer.accept(min, max, biome);
}
@Override
public void forEach(Consumer<Biome> consumer) {
for(int y = min; y < max; y++) {
consumer.accept(biome);
}
}
@Override
public void forEach(IntObjConsumer<Biome> consumer) {
for(int y = min; y < max; y++) {
@@ -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,
* 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.LoadingCache;
import net.jafama.FastMath;
import java.util.Comparator;
import java.util.HashSet;
@@ -33,18 +32,18 @@ public class BiomePipelineProvider implements BiomeProvider {
private final int resolution;
private final NoiseSampler mutator;
private final double noiseAmp;
private final Set<Biome> biomes;
public BiomePipelineProvider(BiomePipeline pipeline, int resolution, NoiseSampler mutator, double noiseAmp) {
this.resolution = resolution;
this.mutator = mutator;
this.noiseAmp = noiseAmp;
holderCache = Caffeine.newBuilder()
.maximumSize(1024)
.build(key -> pipeline.getBiomes(key.x, key.z, key.seed));
.maximumSize(1024)
.build(key -> pipeline.getBiomes(key.x, key.z, key.seed));
this.pipeline = pipeline;
Set<BiomeDelegate> biomeSet = new HashSet<>();
pipeline.getSource().getBiomes().forEach(biomeSet::add);
Iterable<BiomeDelegate> result = biomeSet;
@@ -55,16 +54,16 @@ public class BiomePipelineProvider implements BiomeProvider {
Iterable<BiomeDelegate> finalResult = result;
result.forEach(biomeDelegate -> {
if(biomeDelegate.isEphemeral()) {
StringBuilder biomeList = new StringBuilder("\n");
StreamSupport.stream(finalResult.spliterator(), false)
.sorted(Comparator.comparing(StringIdentifiable::getID))
.forEach(delegate -> biomeList
.append(" - ")
.append(delegate.getID())
.append(':')
.append(delegate.getClass().getCanonicalName())
.append('\n'));
.sorted(Comparator.comparing(StringIdentifiable::getID))
.forEach(delegate -> biomeList
.append(" - ")
.append(delegate.getID())
.append(':')
.append(delegate.getClass().getCanonicalName())
.append('\n'));
throw new IllegalArgumentException("Biome Pipeline leaks ephemeral biome \"" + biomeDelegate.getID() +
"\". Ensure there is a stage to guarantee replacement of the ephemeral biome. Biomes: " +
biomeList);
@@ -72,12 +71,12 @@ public class BiomePipelineProvider implements BiomeProvider {
this.biomes.add(biomeDelegate.getBiome());
});
}
@Override
public Biome getBiome(int x, int y, int z, long seed) {
return getBiome(x, z, seed);
}
public Biome getBiome(int x, int z, long seed) {
x += mutator.noise(seed + 1, x, z) * noiseAmp;
z += mutator.noise(seed + 2, x, z) * noiseAmp;
@@ -86,32 +85,32 @@ public class BiomePipelineProvider implements BiomeProvider {
x /= resolution;
z /= resolution;
int fdX = FastMath.floorDiv(x, pipeline.getSize());
int fdZ = FastMath.floorDiv(z, pipeline.getSize());
int fdX = Math.floorDiv(x, pipeline.getSize());
int fdZ = Math.floorDiv(z, 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();
}
@Override
public Optional<Biome> getBaseBiome(int x, int z, long seed) {
return Optional.of(getBiome(x, z, seed));
}
@Override
public Iterable<Biome> getBiomes() {
return biomes;
}
@Override
public Column<Biome> getColumn(int x, int z, long seed, int min, int max) {
return new BiomePipelineColumn(this, min, max, x, z, seed);
}
@Override
public int resolution() {
return resolution;
}
private record SeededVector(int x, int z, long seed) {
@Override
public boolean equals(Object obj) {
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -15,12 +15,12 @@ import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
public interface BiomeHolder {
BiomeHolder expand(BiomeExpander expander, long seed);
void mutate(BiomeMutator mutator, long seed);
void fill(BiomeSource source, long seed);
BiomeDelegate getBiome(int x, int z);
BiomeDelegate getBiomeRaw(int x, int z);
}
@@ -10,26 +10,26 @@ public interface BiomeDelegate extends StringIdentifiable {
static BiomeDelegate ephemeral(String id) {
return new EphemeralBiomeDelegate(id);
}
static BiomeDelegate from(Biome biome) {
return new DelegatedBiome(biome);
}
static BiomeDelegate self() {
return SelfDelegate.INSTANCE;
}
Biome getBiome();
Set<String> getTags();
default boolean isEphemeral() {
return false;
}
default boolean isSelf() {
return false;
}
}
@@ -7,32 +7,32 @@ import com.dfsek.terra.api.world.biome.Biome;
final class DelegatedBiome implements BiomeDelegate {
private final Biome biome;
public DelegatedBiome(Biome biome) {
this.biome = biome;
}
@Override
public Biome getBiome() {
return biome;
}
@Override
public int hashCode() {
return biome.hashCode();
}
@Override
public boolean equals(Object obj) {
if(!(obj instanceof DelegatedBiome that)) return false;
return that.biome.equals(this.biome);
}
@Override
public Set<String> getTags() {
return biome.getTags();
}
@Override
public String getID() {
return biome.getID();
@@ -9,43 +9,43 @@ import com.dfsek.terra.api.world.biome.Biome;
final class EphemeralBiomeDelegate implements BiomeDelegate {
private final Set<String> tags;
private final String id;
public EphemeralBiomeDelegate(String id) {
this.id = id;
tags = new HashSet<>();
tags.add(id);
tags.add("ALL");
}
@Override
public Biome getBiome() {
throw new UnsupportedOperationException("Cannot get biome from ephemeral delegate");
}
@Override
public Set<String> getTags() {
return tags;
}
@Override
public String getID() {
return id;
}
@Override
public boolean isEphemeral() {
return true;
}
@Override
public int hashCode() {
return id.hashCode();
}
@Override
public boolean equals(Object obj) {
if(!(obj instanceof EphemeralBiomeDelegate that)) return false;
return this.id.equals(that.id);
}
}
@@ -8,31 +8,31 @@ import com.dfsek.terra.api.world.biome.Biome;
final class SelfDelegate implements BiomeDelegate {
public static final SelfDelegate INSTANCE = new SelfDelegate();
private SelfDelegate() {
}
@Override
public Biome getBiome() {
throw new UnsupportedOperationException("Cannot get biome from self delegate");
}
@Override
public boolean isSelf() {
return true;
}
@Override
public boolean isEphemeral() {
return true;
}
@Override
public Set<String> getTags() {
return Collections.emptySet();
}
@Override
public String getID() {
return "SELF";
@@ -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,
* reference the LICENSE file in this module's root directory.
@@ -13,8 +13,8 @@ import com.dfsek.terra.addons.biome.pipeline.api.delegate.BiomeDelegate;
public interface Stage {
BiomeHolder apply(BiomeHolder in, long seed);
boolean isExpansion();
Iterable<BiomeDelegate> getBiomes(Iterable<BiomeDelegate> biomes);
}
@@ -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,
* reference the LICENSE file in this module's root directory.

Some files were not shown because too many files have changed in this diff Show More