9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-26 02:29:14 +00:00

Compare commits

...

1054 Commits
1.0 ... 1.3.3

Author SHA1 Message Date
Andrew Baker
ecaa388bbe V+ for release 2021-03-29 10:26:24 -07:00
Andrew
4cfdc5bf30 Merge pull request #327 from stijnb1234/master
General cleanup
2021-03-15 10:40:17 -07:00
Andrew Baker
ed1090430a Re-add issue templates
Took 4 minutes
2021-03-15 10:39:12 -07:00
stijnb1234
3322cd73ea Readded packignore.ignore and added release/ to .gitignore 2021-03-15 17:35:16 +01:00
stijnb1234
824f6ac4aa Readded Iris.iml again 2021-03-15 17:22:39 +01:00
stijnb1234
d5dfa89fdd .gitignore fix 2021-03-15 17:21:48 +01:00
stijnb1234
9628a98568 Readded Iris.iml to resolve conflict 2021-03-15 17:21:29 +01:00
Andrew Baker
cc3428d24b Cleanup
Took 1 minute
2021-03-15 09:16:12 -07:00
stijnb1234
fe684e9bbd .gitignore update 2021-03-15 17:15:46 +01:00
stijnb1234
f31ea9b7cf General cleanup 2021-03-15 17:15:25 +01:00
Andrew Baker
7eeebb66ab Remove gource 2021-03-15 09:11:06 -07:00
Andrew Baker
e4f53c1daf Remove unused obfuscators 2021-03-15 09:08:39 -07:00
Andrew Baker
98bd58a92c Prepare for OS
Took 47 minutes
2021-03-13 13:09:57 -08:00
CocoTheOwner
f9a7c12620 Update PlannedStructure.java 2021-03-10 16:20:30 +01:00
CocoTheOwner
d04223e174 Revert "Update IrisJigsawPieceConnector.java"
This reverts commit e71c514ef6.
2021-03-10 16:13:29 +01:00
CocoTheOwner
e71c514ef6 Update IrisJigsawPieceConnector.java 2021-03-10 16:13:22 +01:00
CocoTheOwner
57b089ac89 Add entityCount in jigsaw, add chance in object replace 2021-03-10 13:04:34 +01:00
CocoTheOwner
b97ff6fe14 DevV+ 2021-03-10 13:04:08 +01:00
CocoTheOwner
c57ac4c9fe Remove villager building cancelling check
This reintroduces villages but they can spawn in the water
2021-03-10 10:52:01 +01:00
CocoTheOwner
9cf60ca227 Add more command aliases 2021-03-10 10:51:40 +01:00
CocoTheOwner
8c9684e35c Remove blindness when failed studio create 2021-03-09 23:27:04 +01:00
CocoTheOwner
00854e2ea7 Reduce blindess duration 2021-03-09 23:26:40 +01:00
CocoTheOwner
dcae312d2c DevV+ 2021-03-09 23:26:26 +01:00
CocoTheOwner
963a851382 Remove confusion effect when creating studio worlds 2021-03-09 20:54:48 +01:00
CocoTheOwner
1d233c5250 DevV+ 2021-03-09 20:54:38 +01:00
CocoTheOwner
34919ec961 Cleanup and prevent crash error 2021-03-09 20:36:05 +01:00
CocoTheOwner
d15228656f Move potion effects so they dont trigger on accident 2021-03-09 20:34:57 +01:00
CocoTheOwner
dd20a06f80 Make sure sender is player before applying effects 2021-03-09 15:21:25 +01:00
CocoTheOwner
a4bbad3243 Prevent opening desktop when in headless mode 2021-03-09 15:21:09 +01:00
CocoTheOwner
343ae99b54 Warn for smoothie's illegal reflective access 2021-03-09 15:20:55 +01:00
CocoTheOwner
41d1714d28 Cleanup and prevent some potential NPEs 2021-03-09 13:41:38 +01:00
CocoTheOwner
c20a2ecd9a Add 'd' to object dust command alias list 2021-03-09 10:30:56 +01:00
CocoTheOwner
b609daf89d DevV+ 2021-03-09 09:56:25 +01:00
CocoTheOwner
f1cdcdaf3e Move commands into folders 2021-03-09 09:56:21 +01:00
CocoTheOwner
01da323ddb Add effects to creating studio worlds 2021-03-08 23:06:14 +01:00
CocoTheOwner
9675a608a8 DevV+ 2021-03-08 22:24:39 +01:00
CocoTheOwner
8231f28ded Prevent NPE and fix stupid typo 2021-03-08 22:01:36 +01:00
CocoTheOwner
772ecea71a Update gen message 2021-03-08 20:48:44 +01:00
CocoTheOwner
63a74f2dc9 Prevent editbiome in non-studio world 2021-03-08 18:51:00 +01:00
CocoTheOwner
4f3286f520 Replace stacktrace spam with warning 2021-03-08 18:50:49 +01:00
CocoTheOwner
26ca025070 Requrienonnull and remove info 2021-03-08 18:50:39 +01:00
CocoTheOwner
49b1c553ba Min bore ex y to -1 2021-03-08 18:50:28 +01:00
CocoTheOwner
55948d5b79 Fix tooltip 2021-03-08 18:50:13 +01:00
CocoTheOwner
3aeee71873 RequireNonNull & ignore 2021-03-08 18:50:07 +01:00
CocoTheOwner
d669e733cd Updating -> Building workspace 2021-03-08 18:49:54 +01:00
CocoTheOwner
d9af34ee81 Non-negative blockdata getters 2021-03-08 18:49:45 +01:00
CocoTheOwner
8649dbda35 DevV+ 2021-03-08 18:49:26 +01:00
CocoTheOwner
c7d05fbdb1 Remove cave modified. It's bad 2021-03-08 15:24:49 +01:00
CocoTheOwner
f2cfd50a44 Patch cave gen enhancement 2021-03-08 15:14:26 +01:00
CocoTheOwner
a8146a2e81 More information on recursive and other parallax object placement issues 2021-03-08 15:14:13 +01:00
CocoTheOwner
d166cc2a4a Add desciption & cleanup 2021-03-07 12:16:35 +01:00
CocoTheOwner
4558cb4846 Modify message for hotloading 2021-03-07 12:13:43 +01:00
CocoTheOwner
143349be3a Add desc to dimension field 2021-03-07 12:13:19 +01:00
CocoTheOwner
82ac92dfed Remove biome specific fluid type 2021-03-07 11:01:58 +01:00
CocoTheOwner
2643eb2e37 Reduce studio world pregen size and increase update frequency 2021-03-07 11:01:41 +01:00
CocoTheOwner
ac03b9f539 Set player gamemode to spectator when tping to studio 2021-03-07 11:01:24 +01:00
CocoTheOwner
a4370ba55a Remove objects from iris goto 2021-03-07 11:01:11 +01:00
CocoTheOwner
7aa4a01355 DevV+ 2021-03-06 17:03:09 +01:00
CocoTheOwner
349a9de592 Add s to studio aliases 2021-03-06 16:48:48 +01:00
CocoTheOwner
58c0b45ac8 Update IrisCaveModifier.java 2021-03-06 16:40:08 +01:00
CocoTheOwner
af0a923210 Patch 2021-03-06 16:39:59 +01:00
CocoTheOwner
9bcaeee794 Prevent caves from breaching ground in biomes with gen.min below sea 2021-03-06 16:39:06 +01:00
CocoTheOwner
b6d8771792 Patch locate overwrite 2021-03-06 16:18:13 +01:00
CocoTheOwner
f5fed50e4d DevV+ 2021-03-06 16:00:54 +01:00
CocoTheOwner
5a00f56a39 Disable regen command (again) 2021-03-06 15:32:13 +01:00
CocoTheOwner
0bb48f8af0 Warn when not specifying object with jig place 2021-03-06 15:04:16 +01:00
CocoTheOwner
f3ceda1b3d Add entity spawn location setting
Also prevents entities from spawning when a building was not spawned
2021-03-06 14:54:28 +01:00
CocoTheOwner
24c4cbe901 DevV+ 2021-03-06 13:00:30 +01:00
CocoTheOwner
26e2b2507d Attempt getting sky biome, into ground, into derivative 2021-03-06 12:58:48 +01:00
CocoTheOwner
d3378c638a Add small inc/decr to chance to prevent line artifacts 2021-03-06 12:58:30 +01:00
CocoTheOwner
aa90274cc2 Prevent NPE with getting compound (may not exist) 2021-03-06 12:58:17 +01:00
CocoTheOwner
d0a281c116 Fix getgroundbiome to get ground biome not sky 2021-03-06 12:58:05 +01:00
CocoTheOwner
4cbf192e74 Update Interpolated.java
Reimplement blockdata (drop 1.15 for this to not cause issues with that version, because it will...)
2021-03-06 11:18:52 +01:00
CocoTheOwner
1edafc40d0 Properly rethrow an NPE so it doesn't get stuck in labda 2021-02-28 18:09:45 +01:00
CocoTheOwner
6a4a25db40 remove debug prints & add warning, replace throwable with exception 2021-02-28 17:52:54 +01:00
CocoTheOwner
e5ca66305c Send more info on startup (java version etc) 2021-02-28 16:34:18 +01:00
CocoTheOwner
3250566949 First step towards finding objects 2021-02-28 15:34:26 +01:00
CocoTheOwner
4ced362dd0 Comment out block data from Interpolated 2021-02-28 15:28:53 +01:00
CocoTheOwner
4b87ac2907 Prevent NPE in Data Manager 2021-02-28 15:27:35 +01:00
CocoTheOwner
44e1b8f159 See description
- Catch /locate to be rerouted to /ir std goto
- Add "/ir locate", also directly points to /ir std goto
2021-02-28 15:27:24 +01:00
CocoTheOwner
81b1f06eec Replace studio TP command to prevent overlap with goto 2021-02-28 15:23:33 +01:00
CocoTheOwner
441d36e2e3 Remove unused import 2021-02-28 15:22:49 +01:00
CocoTheOwner
7cba76b1e8 Fix typo 2021-02-27 18:19:46 +01:00
CocoTheOwner
c3304a78fb Give tips when facing issue with downloading pack 2021-02-27 14:35:02 +01:00
CocoTheOwner
e6113b4aa1 Add strongholds (POG) 2021-02-26 12:28:58 +01:00
CocoTheOwner
044c7f997d Typo 2021-02-26 12:13:40 +01:00
CocoTheOwner
abfba739a8 Prevent NPE when getting Engine 2021-02-26 10:13:32 +01:00
CocoTheOwner
cec67484e5 Prevent NPE when world already exists 2021-02-25 10:03:22 +01:00
CocoTheOwner
aafed9b1b7 Prevent NPE by not checking hotloader when null 2021-02-25 09:46:55 +01:00
CocoTheOwner
552a87462a Revert "Revert "Merge branch 'master' of https://github.com/VolmitSoftware/IrisPlugin""
This reverts commit 4c8013e6d2.
2021-02-24 23:15:49 +01:00
CocoTheOwner
4c8013e6d2 Revert "Merge branch 'master' of https://github.com/VolmitSoftware/IrisPlugin"
This reverts commit 4f5efba173, reversing
changes made to e0c94af535.
2021-02-24 23:15:42 +01:00
CocoTheOwner
4f5efba173 Merge branch 'master' of https://github.com/VolmitSoftware/IrisPlugin 2021-02-24 23:15:17 +01:00
CocoTheOwner
e0c94af535 V+ 2021-02-24 23:15:07 +01:00
Andrew
a8ff0b5e62 Create LICENSE.md 2021-02-24 13:35:56 -08:00
CocoTheOwner
21a6a19caf Prevent stack-trace spam when placing tile entities where none exist
Improper fix but it suppresses the harmless error.
2021-02-24 18:26:49 +01:00
CocoTheOwner
b1d25ec35c Patch NPE 2021-02-23 21:01:19 +01:00
CocoTheOwner
685de56fbb Add proper getval to iris create 2021-02-23 21:00:55 +01:00
CocoTheOwner
e8adb7d533 Oops 2021-02-23 20:45:04 +01:00
CocoTheOwner
c2af0e8b48 Fix /0 error (It's a poor fix but it works) 2021-02-23 20:13:38 +01:00
CocoTheOwner
8ea7b09482 Replace hint by query
Why would you call this hint???
2021-02-11 11:25:16 +01:00
CocoTheOwner
5180d1a17a Clean up environment getting 2021-02-11 11:21:14 +01:00
CocoTheOwner
d7e3493a59 Add get region name 2021-02-11 11:20:57 +01:00
CocoTheOwner
5ea0a53995 Remove required, add getEnv, hasFocus and getFocus 2021-02-11 11:20:47 +01:00
CocoTheOwner
dd4c66dbd8 remove unused variables 2021-02-11 11:20:22 +01:00
CocoTheOwner
0e8c2476b2 Add warning for creating worlds without MV or bukkit 2021-02-11 10:17:44 +01:00
CocoTheOwner
53fdcce361 Patch /locate override, reverting cosmetic changes that caused issues. 2021-02-07 20:22:15 +01:00
CocoTheOwner
a4a8d78b1f Fix index out of bounds error x2 2021-02-07 18:15:05 +01:00
CocoTheOwner
8b7bb7faa2 Fix index out of bounds error 2021-02-07 18:08:23 +01:00
CocoTheOwner
28430cc1c3 Fix /locate command override 2021-02-07 12:52:07 +01:00
CocoTheOwner
672f2d717d V+ 2021-02-07 11:35:06 +01:00
CocoTheOwner
8362800a54 Add pregen alternative worlds to tab options 2021-02-07 11:17:52 +01:00
CocoTheOwner
731908c265 Make pregen updates look better 2021-02-07 11:14:11 +01:00
CocoTheOwner
3eb864deb9 Add functionality for pregenerating from console and specifying a world you're not in 2021-02-07 11:06:08 +01:00
CocoTheOwner
cb27043d12 Give tooltip upon not finding pack to download it 2021-02-07 10:36:28 +01:00
CocoTheOwner
5b90fce1f5 Catch hosted server with gui 2021-02-03 16:09:14 +01:00
CocoTheOwner
7f49ee3db6 Update CommandLocate.java 2021-02-03 16:08:57 +01:00
CocoTheOwner
72b645916f Give error when using hosted server & gui. 2021-02-03 16:08:53 +01:00
CocoTheOwner
4700c3711c Create CommandLocate.java 2021-01-31 02:13:29 +01:00
CocoTheOwner
feaf21c702 Fix compat error by continuing the throw from Java's fileReader class 2021-01-30 17:21:59 +01:00
CocoTheOwner
4fa8fff3db Fix compat error by continuing the throw from Java's fileReader class 2021-01-30 16:42:07 +01:00
CocoTheOwner
4e670f85f5 Fix compat error 2021-01-30 16:34:08 +01:00
CocoTheOwner
11a484714a Fix "boar" instead of "bore", lol 2021-01-30 15:04:50 +01:00
CocoTheOwner
6c425947bf Fix max items computed in .code-workspace files 2021-01-30 13:19:00 +01:00
CocoTheOwner
e06d34f546 Fix translation not affecting bore 2021-01-30 02:12:57 +01:00
CocoTheOwner
9ffd0dcdbe Merge remote-tracking branch 'origin/master' into master 2021-01-30 00:53:28 +01:00
CocoTheOwner
0ce51709da Fix java 11 incompatibility 2021-01-30 00:52:47 +01:00
CocoTheOwner
073944dd96 Fix java 11 incompatibility 2021-01-30 00:52:27 +01:00
Daniel Mills
874589c772 Merge remote-tracking branch 'origin/master' 2021-01-28 00:28:57 -05:00
Daniel Mills
4a05031a0f Jigsaw fixes 2021-01-28 00:28:55 -05:00
CocoTheOwner
38185ef2f1 consistency 2021-01-15 12:39:41 +01:00
Daniel Mills
66dde6c215 V+ 2021-01-14 14:57:21 -05:00
Daniel Mills
a438817d00 Support rotating orientable blocks 2021-01-14 14:53:04 -05:00
Daniel Mills
a92e651b43 Fix chance stream for objects 2021-01-14 08:40:53 -05:00
Daniel Mills
618da86b44 sync copy op in objects 2021-01-14 08:37:52 -05:00
Daniel Mills
46d810eddf Parallax optimization for jigsaw radii 2021-01-14 08:37:40 -05:00
Daniel Mills
031601bfa6 Fix cache miss positonal features 2021-01-14 08:37:26 -05:00
Daniel Mills
bb5f777cea Cache feature distances 2021-01-14 08:37:15 -05:00
Daniel Mills
fa6c2fb63e Tile data support ids 2021-01-14 08:37:07 -05:00
Daniel Mills
d561348c4f Insert tile entity support 2021-01-14 08:36:57 -05:00
Daniel Mills
c290dba3bb use KMaps for mapped hunks (cme issues) 2021-01-14 08:36:42 -05:00
Daniel Mills
1477180fa5 Use mapped hunks for parallax slices (performance on insertion improved) 2021-01-14 08:36:28 -05:00
Daniel Mills
6cd4b7c433 Improve rotation performance for worlds using jigsaw 2021-01-14 08:36:04 -05:00
Daniel Mills
36f56c2040 Fix npe object for pieces 2021-01-14 08:35:52 -05:00
Daniel Mills
f763cc4020 Use copy on write array for feature lists 2021-01-14 08:35:37 -05:00
Daniel Mills
180d2addd0 Support klists of runnables for bursting multicore 2021-01-14 08:35:25 -05:00
Daniel Mills
8fe21d6d05 fix util method no need for xz 2021-01-14 08:35:12 -05:00
Daniel Mills
3274fb9615 V+ 2021-01-14 08:35:00 -05:00
Daniel Mills
1c5863e6de Tile data in the parallax layer 2021-01-13 09:45:01 -05:00
Daniel Mills
60b424c101 Pasdte tile data 2021-01-13 09:44:54 -05:00
Daniel Mills
2a51454682 Parallax support tile data 2021-01-13 09:44:49 -05:00
Daniel Mills
1d052231f0 Tile Data IO 2021-01-13 09:44:40 -05:00
Daniel Mills
f120c41518 Pasting and loading tile types 2021-01-13 09:33:49 -05:00
Daniel Mills
30b8619dd1 "Spawner Support" 2021-01-13 09:33:40 -05:00
Daniel Mills
1e832ed0eb Pasting & loading tile data support 2021-01-13 09:06:26 -05:00
Daniel Mills
6260c07cd6 V+ 2021-01-13 09:00:55 -05:00
Daniel Mills
241d8fd321 Tile sign data 2021-01-13 09:00:46 -05:00
Daniel Mills
5ddbddf5cc Tiledata 2021-01-13 09:00:40 -05:00
Daniel Mills
38854b7d6a Object conversion 2021-01-13 09:00:31 -05:00
CocoTheOwner
958c5ea195 Fix jigsaw edit tooltip 2021-01-13 12:34:29 +01:00
CocoTheOwner
4329623341 Add command help title 2021-01-13 12:24:00 +01:00
Daniel Mills
658b0595ff Use object placement options for jigsaw pieces 2021-01-12 18:33:02 -05:00
Daniel Mills
2869a2157b Support regions & dimensions + strongholds 2021-01-12 18:32:36 -05:00
Daniel Mills
11d5d74c11 Stronghold position calculation & storage 2021-01-12 18:32:16 -05:00
Daniel Mills
54dd379cf5 Memes 2021-01-12 16:54:57 -05:00
Daniel Mills
7eef4ed876 V+ 2021-01-12 06:39:15 -05:00
Daniel Mills
dd7a8bae16 Eradicate the old structure system 2021-01-12 06:05:37 -05:00
Daniel Mills
93508d7514 Rename to jigsawStructures 2021-01-12 05:57:42 -05:00
Daniel Mills
1493beb79b Allow placement options for pieces 2021-01-12 05:55:27 -05:00
Daniel Mills
b7b15a8f7b Prevent CMOD on feature iteration in parallax insertion 2021-01-12 05:44:42 -05:00
Daniel Mills
6cb15d004e Optimize template loads 2021-01-12 05:44:22 -05:00
Daniel Mills
22220b1b95 Add vacuum mode 2021-01-12 05:42:18 -05:00
Daniel Mills
7fe418d529 Spec rename for place options 2021-01-12 05:42:09 -05:00
Daniel Mills
ed8b0a078d Optimize Object placement data 2021-01-12 05:41:58 -05:00
Daniel Mills
71affb0a70 Support features on entire jigsaw structures 2021-01-12 05:41:46 -05:00
Daniel Mills
52f829f5d1 Support place modes for objects on plax 2021-01-12 05:41:34 -05:00
Daniel Mills
518d10fc8f Rename to features 2021-01-12 05:41:20 -05:00
Daniel Mills
62bbeb9471 Fix resource loader issues 2021-01-12 05:41:08 -05:00
Daniel Mills
36986d7ddd Loaders better verbose 2021-01-11 17:05:11 -05:00
Daniel Mills
b266b8b341 Fix jig counting for par layer 2021-01-11 17:05:03 -05:00
Daniel Mills
c95c4b5f7d Fix jigsaw counting 2021-01-11 17:04:40 -05:00
Daniel Mills
68c55086cf Planned structure test-placer in parallax worlds... not final solution.. 2021-01-11 09:54:51 -05:00
Daniel Mills
6b77bba46d Remove object finding for now 2021-01-11 09:54:32 -05:00
Daniel Mills
675c7f8572 Support vacuum objects & experimental support for jigsaw structures 2021-01-11 09:54:25 -05:00
Daniel Mills
7fff705897 Vacuum checking 2021-01-11 09:54:08 -05:00
Daniel Mills
45a7e6a6ea Placement fixes 2021-01-11 09:54:00 -05:00
Daniel Mills
1db0f3f536 Attempt to fix parallax radius for structures using jigsaw 2021-01-11 09:53:45 -05:00
Daniel Mills
2f086a335d Fix schema with jigasaw pieces 2021-01-11 09:53:27 -05:00
Daniel Mills
9fe9c2a9dd Jigsaw structure registry with biomes 2021-01-11 09:53:16 -05:00
Daniel Mills
2cd9a25791 Fix schema with dimensions 2021-01-11 09:53:06 -05:00
Daniel Mills
45cef6a752 Fix goto issues with objects 2021-01-11 09:52:53 -05:00
Daniel Mills
3811dd3554 Remove board manager showing features 2021-01-11 09:52:46 -05:00
Daniel Mills
b2c944af43 Jigsaw placements 2021-01-11 09:52:36 -05:00
Daniel Mills
76ca4f2183 bhg 2021-01-11 05:19:17 -05:00
Daniel Mills
72d7154a96 Fix jigsaw edit command & parallax tweaks 2021-01-10 09:25:34 -05:00
Daniel Mills
ee6e9b059a Jigsaw structures max dimension allowed 2021-01-10 09:12:20 -05:00
Daniel Mills
2afb468ae4 Terminal Pieces 2021-01-10 09:00:18 -05:00
Daniel Mills
125f705a6a Autoterminate 2021-01-10 08:56:52 -05:00
Daniel Mills
3884af64a7 Performance Improvements 2021-01-10 08:48:58 -05:00
Daniel Mills
6bf65c7c74 Fixe3s 2021-01-10 08:02:50 -05:00
Daniel Mills
7ddaa3ce65 Utils 2021-01-10 08:01:38 -05:00
Daniel Mills
5786fe78b2 Structure optimizations for jigsaw 2021-01-10 04:57:36 -05:00
Daniel Mills
f50a2fd0ad Piece optimizations for Jigsaw 2021-01-10 04:57:22 -05:00
Daniel Mills
3f5b799728 Allow outside access of direct write for nbt blocks 2021-01-10 04:57:12 -05:00
Daniel Mills
0cd4997174 Support signed positions for jigsaw 2021-01-10 04:57:01 -05:00
Daniel Mills
f70046bc73 Support connector targets 2021-01-10 04:56:52 -05:00
Daniel Mills
feb246c559 Support jigsaw directions 2021-01-10 04:56:42 -05:00
Daniel Mills
1dd18c3c0a Import Minecraft Structures into Iris Jigsaw format 2021-01-10 04:56:35 -05:00
Daniel Mills
36b3521b2a Jigsaw command & editor fixes 2021-01-09 02:02:07 -05:00
Daniel Mills
c0df132c93 Connector fixes for jigsaw 2021-01-09 02:01:57 -05:00
Daniel Mills
0a08b4b0b9 Rotation opts 2021-01-09 02:01:51 -05:00
Daniel Mills
8a4208ab18 Iris fixes 2021-01-09 02:01:43 -05:00
Daniel Mills
2b8d5541af Better gen hittests 2021-01-09 02:01:29 -05:00
Daniel Mills
b81765adda Piece support twists 2021-01-09 02:01:23 -05:00
Daniel Mills
f7bd48cc9a Fix axis alignedbb 2021-01-09 02:01:15 -05:00
Daniel Mills
db7681676e Jigsaw place command 2021-01-09 02:01:07 -05:00
Daniel Mills
7d9cfb6ff9 Support pos sub 2021-01-08 20:16:03 -05:00
Daniel Mills
14f0a3ce05 Positioning of pieces 2021-01-08 20:15:57 -05:00
Daniel Mills
3c650a7c50 Piece fixes 2021-01-08 20:15:51 -05:00
Daniel Mills
a9a964cc75 Iris pos util 2021-01-08 19:51:36 -05:00
Daniel Mills
5085c89c22 IO Rotation static construct 2021-01-08 19:51:30 -05:00
Daniel Mills
9720ada87f Improved Iris object AABB detection 2021-01-08 19:51:14 -05:00
Daniel Mills
9adbbcee93 Jigsaw piece clone 2021-01-08 19:51:01 -05:00
Daniel Mills
160eee04ff Direction support rot 2021-01-08 19:50:51 -05:00
Daniel Mills
8353c5105b Planned structure init 2021-01-08 19:50:43 -05:00
Daniel Mills
6fd53d6e95 Planned Piece with rotation 2021-01-08 19:50:36 -05:00
Daniel Mills
7530c586f7 Fix jigsaw positions 2021-01-08 19:50:27 -05:00
Daniel Mills
8deb326ea1 Pieces 2021-01-08 19:50:17 -05:00
Daniel Mills
4b76b592d3 RT Sets 2021-01-08 10:12:10 -05:00
Daniel Mills
3f9288c60f g 2021-01-08 03:19:56 -05:00
Daniel Mills
91e1b614f3 Performance 2021-01-08 02:50:35 -05:00
Daniel Mills
b6f3e3a62f Drop nms 2021-01-08 02:50:28 -05:00
Daniel Mills
4a30b6d264 Locking 2021-01-05 18:48:55 -05:00
Daniel Mills
73bfa9beb8 Locks 2021-01-05 14:32:32 -05:00
Daniel Mills
18e203f007 Fix command and sync parallax 2021-01-05 13:57:11 -05:00
Daniel Mills
c6aad25ef2 Fixes 2021-01-04 21:58:52 -05:00
Daniel Mills
bc8f25ff4b Parallax support for featuress 2021-01-04 20:55:06 -05:00
Daniel Mills
4627303008 COmplex support parallax zones (features) 2021-01-04 20:54:56 -05:00
Daniel Mills
e46a36d1c4 Support meta gen for features 2021-01-04 20:54:47 -05:00
Daniel Mills
62325d9784 Support features in iris biomes dimensions and regions 2021-01-04 20:54:37 -05:00
Daniel Mills
38d0894c36 Positional iris features 2021-01-04 20:54:19 -05:00
Daniel Mills
f7e379c83f Iris feature potentials 2021-01-04 20:54:12 -05:00
Daniel Mills
185cc994f7 Iris range class (json tools) 2021-01-04 20:54:06 -05:00
Daniel Mills
8815518af9 Zone to feature 2021-01-04 20:53:46 -05:00
Daniel Mills
233144eede Update parallax chunk meta to json 2021-01-04 20:53:33 -05:00
Daniel Mills
1028ebccbb Calculate true interpolation radius for specifc algos 2021-01-04 20:43:15 -05:00
Daniel Mills
791fd4bc55 Attempt to create an nms world but fallback if needed 2021-01-04 16:02:16 -05:00
Daniel Mills
5a557e6f00 Parallax optimization 2021-01-04 16:02:01 -05:00
Daniel Mills
948f823744 Fix bedrock bug 2021-01-04 16:01:51 -05:00
Daniel Mills
c05d22b550 Fix 162 Post out of control 2021-01-04 16:01:44 -05:00
Daniel Mills
f062d5b894 Fix v163 post out of control 2021-01-04 16:01:32 -05:00
Daniel Mills
1af7ee8e8d V+ 2021-01-04 16:01:17 -05:00
Daniel Mills
53e8c9141c Simplify parallax 2021-01-04 13:04:00 -05:00
Daniel Mills
64f27e7d39 Simplify composite generators 2021-01-04 13:03:54 -05:00
Daniel Mills
a77c99d050 Fix effect zones 2021-01-04 13:03:39 -05:00
Daniel Mills
9c4ccc51c7 Simplify compound stitching 2021-01-04 13:03:33 -05:00
Daniel Mills
7937d8d041 TP on create 2021-01-03 10:36:23 -05:00
Daniel Mills
cca66f1f32 V+ 2021-01-03 10:36:17 -05:00
Daniel Mills
dc4f0c1159 Parallax retry methods 2021-01-03 10:25:39 -05:00
Daniel Mills
fb07b280be Iris create now uses mv create 2021-01-03 10:25:31 -05:00
Daniel Mills
2915ef885e Better mv support 2021-01-03 10:25:21 -05:00
Daniel Mills
152a4af549 tweaks 2021-01-03 09:44:10 -05:00
Daniel Mills
c7508441ec Fix engine issues 2021-01-03 09:44:04 -05:00
Daniel Mills
3073d3aa9d Fix paper gen & spigot gen & shutdown issue 2021-01-03 09:43:58 -05:00
Daniel Mills
78eebc255e FX Zones 2021-01-02 12:26:21 -05:00
Daniel Mills
5e6ec3b217 v 2021-01-01 23:52:15 -05:00
Daniel Mills
a6d6814f27 Fix cellular noise 2021-01-01 23:27:33 -05:00
Daniel Mills
9d634ba4d7 Fix Parallax & update settings 2021-01-01 22:54:17 -05:00
Daniel Mills
fcf8a80b0a Amazing pregenerator! 2021-01-01 22:54:03 -05:00
Daniel Mills
dfaf361bf2 Rewrite iris settings 2021-01-01 22:53:56 -05:00
Daniel Mills
6c791c034b V+ 2021-01-01 22:53:44 -05:00
Daniel Mills
8935c51cc9 Remove old pregen crap 2021-01-01 22:53:40 -05:00
Daniel Mills
b148fa94c3 Fix bedrock off generating air 2021-01-01 19:08:36 -05:00
Daniel Mills
70fef94d15 Sync gen of engines 2021-01-01 19:07:29 -05:00
Daniel Mills
a921845ae3 Fixes 2021-01-01 18:53:32 -05:00
Daniel Mills
8dd858e813 V+ 2020-12-30 08:33:14 -05:00
Daniel Mills
634e7ad7ee Cleanup 2020-12-30 08:31:23 -05:00
Daniel Mills
e926a08def Fix mca gens 2020-12-30 07:09:39 -05:00
Daniel Mills
f4eb0cfbcb Writer fixes 2020-12-29 06:14:18 -05:00
Daniel Mills
ee557d8191 Pregenerator 2020-12-29 06:14:11 -05:00
Daniel Mills
7d37954495 Try smoothies for hunks 2020-12-29 05:08:07 -05:00
Daniel Mills
3dc7bd74fe Fix jigsaw save locations 2020-12-29 05:05:08 -05:00
Daniel Mills
56ae387f7b Fix the leak 2020-12-28 13:17:49 -05:00
Daniel Mills
5878128746 Ducttape 2020-12-28 12:14:21 -05:00
Daniel Mills
5994cc66b4 Fixes for plax 2020-12-28 12:13:47 -05:00
Daniel Mills
a9410d92a2 Identified leak 2020-12-28 07:56:18 -05:00
Daniel Mills
89da5fe08a Smoothiemaps for everyone 2020-12-28 06:22:45 -05:00
Daniel Mills
bb69ae887f Low footprint nbt 2020-12-28 06:13:59 -05:00
Daniel Mills
540656870a Optimizations 2020-12-28 06:10:46 -05:00
Daniel Mills
4f3b6e4029 Smoothiemaps & nbt 2020-12-28 06:10:41 -05:00
Daniel Mills
cec56c8406 Fix pregen sizes 2020-12-27 06:17:12 -05:00
Daniel Mills
7bbae51c7d Faster 2020-12-27 05:28:34 -05:00
Daniel Mills
3d00e96f89 RN to jigsaw 2020-12-27 02:02:23 -05:00
Daniel Mills
6f29da1926 Connect up jigsaw pools with pieces 2020-12-27 02:01:35 -05:00
Daniel Mills
6f028eae6e Fixes 2020-12-26 07:57:51 -05:00
Daniel Mills
b44501566c Fix parallax 2020-12-26 06:12:50 -05:00
Daniel Mills
5f50fa4202 Registry for jigsaw 2020-12-26 05:00:26 -05:00
Daniel Mills
5487cd7858 f 2020-12-23 19:47:30 -05:00
Daniel Mills
89e1af456f J 2020-12-21 01:43:25 -05:00
Daniel Mills
439838abd2 v 2020-12-20 23:28:19 -05:00
Daniel Mills
1cf60544e1 Bugfixes for generation 2020-12-20 21:04:11 -05:00
Daniel Mills
70ae1cce4b Optimize parallax 2020-12-20 21:04:02 -05:00
Daniel Mills
b5fa41cdc1 Fix nms environments for nether and end 2020-12-20 21:03:53 -05:00
Daniel Mills
0cce35908d Registry for structure pieces 2020-12-20 21:03:40 -05:00
Daniel Mills
5a1d8348d8 Fixed non normal environments 2020-12-20 18:32:57 -05:00
Daniel Mills
63cd793407 Fix bedrock placing stone if false 2020-12-20 18:30:17 -05:00
Daniel Mills
f5abee1f92 Fixes 2020-12-20 16:40:18 -05:00
CocoTheOwner
1b0ed90a54 Prevent IOException when creating new compat file 2020-12-20 20:50:23 +01:00
CocoTheOwner
5003f69e8e Prevent getting engine when disabled 2020-12-20 20:48:05 +01:00
CocoTheOwner
68214cf16f Patches my own previous code
Error prevention code was already in place but was misplaced. The method was ran prior to the null check.
2020-12-18 17:16:56 +01:00
CocoTheOwner
1365d442e9 Warn instead of NPE on open non-existing
When opening non-existing packs a NPE is raised, this should resolve that.
2020-12-18 17:14:52 +01:00
BuildTools
2f29953ccb Merge branch 'master' of https://github.com/cyberpwnn/Iris 2020-12-16 13:08:28 +01:00
BuildTools
9929479bf0 Fix compat file loading error by creating prior 2020-12-16 13:08:15 +01:00
Daniel Mills
b52c71c0f3 Mc fixes 2020-12-14 09:22:44 -05:00
CocoTheOwner
712be51888 Attempt patching correct dimension
I'm quite lost so this will probably not work / do much.
2020-12-14 10:12:09 +01:00
CocoTheOwner
3e4cc8841d Patch closing comp nullpoint 2020-12-14 09:30:49 +01:00
Daniel Mills
3742d5ef81 Fix decorant issues 2020-12-13 10:13:52 -05:00
Daniel Mills
310b12c81d Revert "Add vanilla cave support back"
This reverts commit ab64a8f8e2.
2020-12-13 09:57:50 -05:00
Daniel Mills
ab64a8f8e2 Add vanilla cave support back 2020-12-13 09:40:20 -05:00
Daniel Mills
9d18a1297b Merge remote-tracking branch 'origin/master' 2020-12-13 09:38:20 -05:00
Daniel Mills
e73534ba2f Fix IOOB Exception 2020-12-13 09:38:10 -05:00
Daniel Mills
73360bb66c Fix parallax deadlocking 2020-12-13 09:37:58 -05:00
Daniel Mills
5b74f8f836 Default on gleam! 2020-12-13 09:37:43 -05:00
Daniel Mills
0b87cd9aef Support gleam only if on paper 2020-12-13 09:37:37 -05:00
BuildTools
c5c971eeae Update create command alias "+" 2020-12-11 10:03:06 +01:00
BuildTools
b554e2ee6c Update structure commands
Simplicity
2020-12-11 09:48:54 +01:00
BuildTools
436a8c4d8e Add /ir pregen resume command 2020-12-07 16:54:43 +01:00
Daniel Mills
a5725439ee v+ 2020-12-06 06:30:42 -05:00
Daniel Mills
30bc725631 Fix post block modifier (async issues) 2020-12-06 06:10:29 -05:00
Daniel Mills
d261347b06 Support sea layers 2020-12-06 06:10:18 -05:00
Daniel Mills
9bc65601c0 Finalize regen command 2020-12-06 06:10:06 -05:00
Daniel Mills
4a82def974 Fix a bug causing issues with decorations 2020-12-06 06:09:57 -05:00
Daniel Mills
0755e8f618 Regen inf 2020-12-06 06:09:33 -05:00
Daniel Mills
44ef039321 Pregen gleam fixes 2020-12-06 06:09:14 -05:00
Daniel Mills
a7f5451ea4 Regen command 2020-12-06 06:08:51 -05:00
Daniel Mills
4902e5b9bb Fixes & Fixes 2020-12-04 05:07:44 -05:00
Daniel Mills
f3eb1bb45e V+ 2020-12-02 01:41:13 -05:00
Daniel Mills
01a9a13402 Fix seed breaking on restarts 2020-12-02 01:40:49 -05:00
Daniel Mills
ff6f76e018 Default world type is used from the settings now, not just overworld 2020-12-02 01:17:38 -05:00
Daniel Mills
01110d0835 Fix attempts being shown to get custom dim 2020-12-02 01:07:33 -05:00
Daniel Mills
b6fdde403a More fixes 2020-11-27 19:26:41 -05:00
Daniel Mills
ad01a157ce Fixes 2020-11-23 14:47:16 -05:00
Daniel Mills
ac04ef34d7 Base biome fixes 2020-11-23 13:37:13 -05:00
Daniel Mills
58845ae79f Hotload fixes 2020-11-23 02:38:49 -05:00
Daniel Mills
d6b7a4bdba Fixes 2020-11-22 13:00:24 -05:00
Daniel Mills
34040abc8f Support spigot 2020-11-22 11:41:43 -05:00
Daniel Mills
03f535e85e gdffdg 2020-11-22 09:06:25 -05:00
Daniel Mills
6ea0bb30e0 VANILLA STRUCTURES 2020-11-22 07:27:24 -05:00
Daniel Mills
dd083f73f7 V+ 2020-11-17 22:28:46 -05:00
Daniel Mills
8dee20295e Updates to biomes 2020-11-17 22:25:06 -05:00
Daniel Mills
6e47e4bcd2 Fix dim loading 2020-11-17 21:32:11 -05:00
Daniel Mills
ff825b85aa Metrics or something or other 2020-11-17 02:10:17 -05:00
Daniel Mills
802bc50102 Config hotloading 2020-11-17 01:32:34 -05:00
Daniel Mills
6d08faa30f Metrics 2020-11-15 23:36:33 -05:00
Daniel Mills
116ab72f4e d 2020-11-14 22:31:15 -05:00
Daniel Mills
44d86bc350 Entity spawns 2020-11-14 22:27:37 -05:00
Daniel Mills
e0fc4b9443 Fix regions 2020-11-14 21:40:19 -05:00
Daniel Mills
d9e18e0f3b Goto Object 2020-11-14 21:38:22 -05:00
Daniel Mills
6b8610b72d Fixes 2020-11-14 15:08:11 -05:00
Daniel Mills
468448ff6e Move legacy crap out (atomics) 2020-11-14 15:05:56 -05:00
Daniel Mills
b85efcd85a Move NMS out of legacy 2020-11-14 15:04:13 -05:00
Daniel Mills
657f581a3d fff 2020-11-14 12:29:15 -05:00
Daniel Mills
0dbff85bd8 Performance! 2020-11-12 21:02:09 -05:00
Daniel Mills
bf9c4c602b Works, but somehow i broke parallax 2020-11-11 20:58:47 -05:00
Daniel Mills
4c44957764 Performance & Fixes 2020-11-11 16:46:36 -05:00
Daniel Mills
ec39d7146c Fixes 2020-11-11 00:30:39 -05:00
Daniel Mills
c60a772e84 Tweaks 2020-11-10 02:54:06 -05:00
Daniel Mills
9ba47c1b6a ERADICATE V1 2020-11-10 01:07:28 -05:00
Daniel Mills
4fc8a5ad0c Forcefully shove stuff into other stuff 2020-11-10 00:49:28 -05:00
Daniel Mills
50ffcceaf4 v 2020-11-09 12:57:48 -05:00
Daniel Mills
05060e76cb 1.16.4 Support 2020-11-08 11:26:11 -05:00
Daniel Mills
5139b587f6 Maven volmit 2020-11-07 16:20:14 -05:00
Daniel Mills
63870b75a7 Even more imports 2020-11-07 11:06:15 -05:00
Daniel Mills
cf0a8b3e95 More imports 2020-11-07 11:06:05 -05:00
Daniel Mills
8006482c22 Fix imports 2020-11-07 11:05:55 -05:00
Daniel Mills
cda15170bd IML 2020-11-07 11:05:45 -05:00
Daniel Mills
9ececd80d6 NMS Support for 1.16.4 (R3) 2020-11-07 11:05:30 -05:00
Daniel Mills
5ea938a20b Fixes 2020-11-06 09:20:29 -05:00
Daniel Mills
f4056a3fca A proper structure mgr 2020-11-06 01:00:03 -05:00
Daniel Mills
23188c3898 Tweaks for v2 support 2020-11-06 00:54:42 -05:00
Daniel Mills
7322f1a9fb Fix npe in post 2020-11-06 00:54:35 -05:00
Daniel Mills
4f6a676c32 True fracturing allowed 2020-11-06 00:54:28 -05:00
Daniel Mills
f2e3914ad8 v2 structures 2020-11-06 00:54:15 -05:00
Daniel Mills
25f2189a08 ITJ Sucks 2020-11-04 18:28:34 -05:00
Daniel Mills
448c406e3e Block Updates 2020-11-04 18:26:35 -05:00
Daniel Mills
d7c9640dc9 Fix Coco 2020-11-04 18:23:51 -05:00
Daniel Mills
08949ab25f V+ 2020-11-04 18:23:47 -05:00
Daniel Mills
24ae8d1679 Support ModX and ModZ 2020-11-04 18:22:24 -05:00
Daniel Mills
adb7b13599 Engine parallelisms 2020-11-04 18:22:10 -05:00
Daniel Mills
eddf94a340 Post block modifier for V2! 2020-11-04 18:21:58 -05:00
Daniel Mills
3df741c4fc ModXz in actuators 2020-11-04 18:21:48 -05:00
Daniel Mills
12e7c51c39 New decorator implementations! 2020-11-04 18:21:34 -05:00
Daniel Mills
c8e2bcd6e4 Iris engine decorators 2020-11-04 18:21:24 -05:00
Daniel Mills
14d5286eb0 Engine decorators 2020-11-04 18:21:14 -05:00
Daniel Mills
397a2b0d82 Merge remote-tracking branch 'origin/master' 2020-11-04 18:21:00 -05:00
Daniel Mills
35cf439592 Fixes 2020-11-04 18:20:53 -05:00
BuildTools
2f6d69efac Fix empty parameters 2020-11-04 11:11:11 +01:00
Daniel Mills
d00ab3f8d6 Merge remote-tracking branch 'origin/master' 2020-11-03 13:36:43 -05:00
Daniel Mills
05d3adff36 Fixes 2020-11-03 13:36:38 -05:00
BuildTools
4c24c570a8 Fix pregen command parameters 2020-11-03 15:50:01 +01:00
Daniel Mills
19f78f769b Fixes 2020-11-02 13:28:23 -05:00
Daniel Mills
44358c122f Block Updates (not yet working) 2020-11-02 12:29:55 -05:00
Daniel Mills
8b720e103f Ravines & Caves 2020-11-02 11:39:53 -05:00
Daniel Mills
bd5ca76ef4 Ravines 2020-11-02 11:23:33 -05:00
Daniel Mills
5e4136d9a1 Cave decorations 2020-11-01 16:53:29 -05:00
Daniel Mills
14029aa60f f 2020-11-01 16:31:45 -05:00
Daniel Mills
fa99b967ed f 2020-11-01 16:31:35 -05:00
Daniel Mills
a9120edb70 Implement baseline caves 2020-11-01 13:22:54 -05:00
Daniel Mills
cfc8458841 Fixes 2020-11-01 10:14:50 -05:00
Daniel Mills
7a7fee1d8a Temp fixes 2020-11-01 09:46:56 -05:00
Daniel Mills
b87153a445 Fixes 2020-11-01 09:16:11 -05:00
Daniel Mills
f97cd10bf6 Compat fixes 2020-10-31 19:28:44 -04:00
Daniel Mills
736deca1fc Fixes 2020-10-31 19:26:06 -04:00
Daniel Mills
7f3b9ec89a Carving & undercarriage 2020-10-31 19:24:25 -04:00
Daniel Mills
f2339f26ca v2 parallax fixes! 2020-10-31 14:45:58 -04:00
Daniel Mills
b74a00de22 Dust mech 2020-10-31 14:45:50 -04:00
Daniel Mills
d71297a114 Dust command 2020-10-31 14:45:44 -04:00
Daniel Mills
fb006a3032 Idea 2020-10-31 14:43:49 -04:00
Daniel Mills
536ed2b967 Fix parallax sizes & imports 2020-10-31 08:47:47 -04:00
Daniel Mills
1173c3d053 Parallax engine impl 2020-10-31 08:30:37 -04:00
Daniel Mills
c7c1b2b8c1 Parallax tweaks 2020-10-31 08:30:28 -04:00
Daniel Mills
6c8db56474 Region slice fixes 2020-10-31 08:30:20 -04:00
Daniel Mills
3292dc47ab Engine parallax support 2020-10-31 08:30:10 -04:00
Daniel Mills
98889780b9 RNG Chance utils 2020-10-31 08:29:59 -04:00
Daniel Mills
11703afd6b Placer fixes 2020-10-31 08:29:52 -04:00
Daniel Mills
3c1597f42f IDea 2020-10-31 08:29:46 -04:00
Daniel Mills
9d828ad291 V+ 2020-10-31 08:29:41 -04:00
Daniel Mills
84506c65ad Fix biome issues 2020-10-30 08:52:12 -04:00
Daniel Mills
c5bd594798 Proper dimensional stacking 2020-10-30 06:14:43 -04:00
Daniel Mills
13805edba9 Performance tweaks 2020-10-29 09:12:27 -04:00
Daniel Mills
79bd586def f 2020-10-29 07:54:16 -04:00
Daniel Mills
0e86e942ce Engine fixes 2020-10-29 07:54:12 -04:00
Daniel Mills
708959a0c5 Engine compounds 2020-10-29 07:54:05 -04:00
Daniel Mills
3bf3e2605b v2 data manager support 2020-10-29 07:53:56 -04:00
Daniel Mills
39b539aaed Reorder scaffolds 2020-10-29 06:35:16 -04:00
Daniel Mills
c9648a5ec4 Dimensional composites 2020-10-29 06:33:56 -04:00
Daniel Mills
acaa93367f STOPPPIT 2020-10-29 05:26:18 -04:00
Daniel Mills
2c830eacdd Cleanup for new engine 2020-10-29 05:26:10 -04:00
Daniel Mills
4c0e918559 Engine impl 2020-10-29 05:25:58 -04:00
Daniel Mills
f79a3d15d1 Engine api 2020-10-29 05:25:50 -04:00
Daniel Mills
f2b44d8f99 Engine actuators 2020-10-29 05:25:40 -04:00
Daniel Mills
a319314d04 Fixes 2020-10-29 03:50:34 -04:00
Daniel Mills
2c8c23522b Auto stash before merge of "master" and "origin/master" 2020-10-29 01:17:39 -04:00
BuildTools
c05696df8c Turn studio mode to enable by default 2020-10-28 11:42:17 +01:00
Daniel Mills
97019f1a2a Command stuffs 2020-10-28 04:51:30 -04:00
Daniel Mills
aa7a1ddd4e Bugfixes 2020-10-28 02:10:59 -04:00
Daniel Mills
6bbe1c8518 Fix ewg 2020-10-28 01:31:29 -04:00
Daniel Mills
0cf0d68026 V+ 2020-10-28 01:29:39 -04:00
Daniel Mills
6ff583a916 REMOVE FBD 2020-10-28 01:28:52 -04:00
Daniel Mills
f1856afa77 Fix holes and crap 2020-10-28 01:28:43 -04:00
Daniel Mills
6a03b4b125 Delete fbd 2020-10-28 00:29:37 -04:00
Daniel Mills
9e062acafb Parallax 2 Backend & API Complete 2020-10-28 00:28:56 -04:00
Daniel Mills
aff7e49024 Hunk Slices! 2020-10-27 22:14:32 -04:00
Daniel Mills
39b4649a04 Parallax API 2020-10-27 21:19:47 -04:00
Daniel Mills
ca8c7229ce Hunks 2020-10-27 21:19:42 -04:00
Daniel Mills
4634284e77 Hunk IO 2020-10-27 21:19:38 -04:00
Daniel Mills
e92fa789e9 Parallax storage 2020-10-27 21:19:33 -04:00
Daniel Mills
d29b4e486d Move to parallax views 2020-10-27 21:19:23 -04:00
Daniel Mills
56eb0b8ef1 Data palettes 2020-10-27 21:19:10 -04:00
Daniel Mills
dcda5741f1 I have an idea 2020-10-27 21:19:00 -04:00
Daniel Mills
46dd19c326 Fix idea configs 2020-10-27 17:01:05 -04:00
BuildTools
5ef9ccb466 Merge branch 'master' of https://github.com/cyberpwnn/Iris 2020-10-27 21:29:42 +01:00
Daniel Mills
5fef1b3f30 Stupidities 2020-10-27 15:48:40 -04:00
Daniel Mills
5606da3449 Fix 2020-10-27 15:42:24 -04:00
BuildTools
844d500037 Update CommandIrisStructureCreate.java 2020-10-27 19:09:59 +01:00
BuildTools
672a66695e Fix no structure specified error 2020-10-27 13:23:19 +01:00
BuildTools
125a89b5f9 Fix parameterless object selection modificaitons
Defaults to 1
2020-10-27 12:20:17 +01:00
Daniel Mills
c65c197fbe Fixes 2020-10-27 05:55:25 -04:00
Daniel Mills
98b1302b77 ""Fix"" Mineshafts 2020-10-27 02:51:15 -04:00
Daniel Mills
e75afe6c41 ""Fix"" Parallax map null issues 2020-10-27 02:49:52 -04:00
Daniel Mills
361d02e075 Iris reports 2020-10-27 02:33:44 -04:00
Daniel Mills
1b20d3b6ac Experimentals 2020-10-27 01:16:04 -04:00
Daniel Mills
c4536d789b Decorations! 2020-10-27 01:10:19 -04:00
Daniel Mills
a7f8d9126e Renamings 2020-10-26 22:33:36 -04:00
Daniel Mills
84e39add27 Decoration! 2020-10-26 22:33:21 -04:00
Daniel Mills
4d352b231c More complex streams 2020-10-26 22:33:15 -04:00
Daniel Mills
59eda04949 Bitshifting streams 2020-10-26 22:33:07 -04:00
Daniel Mills
695cf24861 Fix hunk queues 2020-10-26 22:32:58 -04:00
Daniel Mills
85d4dd9491 Rename deco 2020-10-26 22:32:43 -04:00
Daniel Mills
3a0fcd1517 What a mess of hunks 2020-10-26 16:53:20 -04:00
Daniel Mills
e7e649ad66 fixes 2020-10-26 05:54:34 -04:00
Daniel Mills
b875a4898b Conversion support for EWG and Schematics 2020-10-26 05:11:15 -04:00
Daniel Mills
a33cd35ae8 v 2020-10-26 04:05:58 -04:00
Daniel Mills
6e294d1363 Bam 2020-10-26 03:51:03 -04:00
Daniel Mills
7d7269bfe6 Multicore utils 2020-10-26 03:50:53 -04:00
Daniel Mills
1306a5bca1 Old crap removed 2020-10-26 03:50:45 -04:00
Daniel Mills
0dd45cdfa2 Hunks Galore 2020-10-26 03:50:36 -04:00
Daniel Mills
4a11ac917b Fixes 2020-10-25 23:07:13 -04:00
Daniel Mills
460be03a20 Biome implosion 2020-10-25 15:57:27 -04:00
Daniel Mills
9f3e5fea38 Height fixes 2020-10-25 12:30:05 -04:00
Daniel Mills
49b494ed02 Pregen job remembers generally where it left off 2020-10-25 12:26:56 -04:00
Daniel Mills
c72559c31a Cleanup & Add bedrock option 2020-10-25 12:08:52 -04:00
CocoTheOwner
2b8e189966 Merge branch 'master' of https://github.com/cyberpwnn/Iris 2020-10-25 16:44:31 +01:00
CocoTheOwner
09e37f3951 Fix command and get 2020-10-25 16:44:18 +01:00
Daniel Mills
c90359716b Scaffolding changes 2020-10-25 11:43:30 -04:00
Daniel Mills
4a1ad1c625 Biome streams 2020-10-25 11:43:19 -04:00
Daniel Mills
27694036a5 . 2020-10-24 03:44:45 -04:00
Daniel Mills
ed40dc34cf Iris Complex 2020-10-24 01:59:53 -04:00
Daniel Mills
af29b2833f Better test root 2020-10-24 00:30:20 -04:00
Daniel Mills
0ee1f5c47f Iris test command 2020-10-24 00:29:46 -04:00
Daniel Mills
018eb2fdcd Streams 2020-10-24 00:29:40 -04:00
Daniel Mills
368a74dfc9 Layers 2020-10-24 00:29:35 -04:00
Daniel Mills
1a0475433c Hunky Stuff... 2020-10-24 00:29:31 -04:00
Daniel Mills
e841bfad68 Hunk Views 2020-10-24 00:29:20 -04:00
Daniel Mills
5d3faba762 Stream support 2020-10-24 00:29:13 -04:00
Daniel Mills
87cce116af f 2020-10-23 19:15:41 -04:00
Daniel Mills
356c97a4b2 Stop spawning OCEAN_RUIN 2020-10-23 18:42:19 -04:00
Andrew Baker
dd6c20ce74 Fix log colors. Closes #22 2020-10-23 11:00:36 -07:00
Daniel Mills
e939ffaf2d V+ 2020-10-23 13:13:48 -04:00
Daniel Mills
5a6f6fba2e Fixes & merge 2020-10-23 13:05:16 -04:00
Daniel Mills
99022055cf Fix non overworld environments using overworld as the environment... 2020-10-23 11:27:59 -04:00
Daniel Mills
68030a4ae7 Fix decorations 2020-10-23 11:25:38 -04:00
Daniel Mills
75ca9240a9 Tops 2020-10-23 11:25:13 -04:00
Daniel Mills
6d917b31e0 Support decoration tops for stack decorations 2020-10-23 10:21:39 -04:00
BuildTools
75e508bfd0 Add note 2020-10-23 14:08:41 +02:00
BuildTools
23136be280 Add thread count getter 2020-10-23 13:59:38 +02:00
BuildTools
527a0f5c70 Update CommandIrisStructure.java
Add warning for use of objects over procedural structures (naming is a bit counter-intuitive)
2020-10-23 11:10:42 +02:00
BuildTools
9fbf9539ee Update CommandIrisObject.java
Add alias for object "obj"
2020-10-23 11:08:55 +02:00
BuildTools
dab69b2ffe Update CommandIrisWhatBlock.java
Prevent duplicate message
Fix some whitespace
2020-10-23 10:20:42 +02:00
BuildTools
7fdbebfb70 Fix bugs (see desc)
#33
#26
#27
#28
2020-10-23 09:55:48 +02:00
Daniel Mills
06ffe5cd06 Fix ex for fluid height 2020-10-22 19:23:05 -04:00
Daniel Mills
56203c3ee2 30% Performance Improvement 2020-10-22 19:05:52 -04:00
BuildTools
4f5b562e04 Update CommandIrisPregen.java
Fix whitespace
2020-10-23 00:37:00 +02:00
BuildTools
e247753f96 Update CommandIrisRegen.java
fix whitespace
2020-10-23 00:34:49 +02:00
BuildTools
575b5482b6 Update CommandIrisStructureCreate.java
Fix creator arguments (I'm stoopid)
2020-10-23 00:30:06 +02:00
BuildTools
aa5a72b788 Update CommandIrisStructureCreate.java
Last fix (trust me)
2020-10-23 00:21:32 +02:00
BuildTools
d8cb9f2c03 Update CommandIrisStructureCreate.java
Fix even number entering
2020-10-23 00:18:04 +02:00
BuildTools
5241182520 Merge branch 'master' of https://github.com/cyberpwnn/Iris 2020-10-23 00:09:26 +02:00
BuildTools
61d8f2e1d4 Update CommandIrisStructureCreate.java
Fuck switch statements
2020-10-23 00:09:13 +02:00
Daniel Mills
a8031a510f Fix warnings 2020-10-22 18:08:57 -04:00
Daniel Mills
c191060b73 Fix command issues with not in iris world 2020-10-22 18:06:58 -04:00
Daniel Mills
bfe7cf0ed7 Repush 2020-10-22 17:57:01 -04:00
Daniel Mills
a4d72eefbc Merge remote-tracking branch 'origin/master' 2020-10-22 17:56:54 -04:00
Daniel Mills
7b98105a0f Terrain stream 2020-10-22 17:56:48 -04:00
BuildTools
e741dd6f65 Update CommandIrisStructureCreate.java
Prevent omitting parameters
2020-10-22 23:56:45 +02:00
Daniel Mills
9ef1c1935d Drop sky providers 2020-10-22 11:17:40 -04:00
Daniel Mills
43562580d6 Fixes 2020-10-22 11:16:28 -04:00
Dan
986250543e Merge pull request #18 from cyberpwnn/citizens
Merge pull request #17 from cyberpwnn/master
2020-10-22 11:10:21 -04:00
Dan
90ed2f084d Merge pull request #17 from cyberpwnn/master
Fixes
2020-10-22 11:09:24 -04:00
Dan
d353e186a5 Merge branch 'citizens' into master 2020-10-22 11:09:07 -04:00
Daniel Mills
a8b684d966 Fixes 2020-10-22 11:07:47 -04:00
Andrew Baker
3ec70f9fb3 Merge branch 'master' of https://github.com/cyberpwnn/Iris into citizens 2020-10-21 18:05:51 -07:00
BuildTools
6199256058 Poor attempt at adding pregen pausing
Please fix /command/CommandIrisPregen.java (has // TODO:)
and
/util/PregenJob.java
(has // TODO:)
2020-10-21 17:47:20 +02:00
Daniel Mills
265936a791 V+ 2020-10-21 11:11:32 -04:00
BuildTools
2422013ddf fix typo 2020-10-21 17:10:19 +02:00
Daniel Mills
2641220fb0 Fix pregen resume issue 2020-10-21 11:04:19 -04:00
Daniel Mills
68e1830d8e Fix std loot 2020-10-21 11:01:59 -04:00
Daniel Mills
fd3f20ed52 Fixes & revert 2020-10-21 10:28:40 -04:00
Daniel Mills
ccdb136b9a Tweaks 2020-10-21 10:03:15 -04:00
Daniel Mills
0a0617c5fc Command fixes 2020-10-21 10:02:36 -04:00
Daniel Mills
b3e1c48f97 Stupid spigot & paper 2020-10-20 10:52:30 -04:00
Daniel Mills
88d589bae5 1.16 NMS Support 2020-10-20 10:16:19 -04:00
Daniel Mills
0fb5cbdb06 Hmm 2020-10-20 09:51:48 -04:00
Daniel Mills
d47da11ce8 INMS 2020-10-20 09:22:14 -04:00
Daniel Mills
743a4f97ba NMS 2020-10-20 09:22:09 -04:00
Daniel Mills
eac1247f36 FIxes 2020-10-19 10:04:06 -04:00
Daniel Mills
57f60326f3 PF 2020-10-19 09:20:57 -04:00
Daniel Mills
3235f6e388 V+ 2020-10-19 06:10:41 -04:00
Daniel Mills
a607a6a137 Fix structure manager with paper & worldedit 2020-10-19 06:10:37 -04:00
Daniel Mills
2348d4a855 Fix block data issues 2020-10-19 06:10:27 -04:00
Daniel Mills
e16f6c87c2 Remove loot tries 2020-10-19 06:10:19 -04:00
Daniel Mills
598962f5f3 Entities support baby & panda genes 2020-10-19 06:10:11 -04:00
Daniel Mills
8a241bb671 Fix loot 2020-10-19 06:10:03 -04:00
Daniel Mills
8bcb3d9e0e Fix npe and cmod on parallax layer 2020-10-19 06:09:54 -04:00
Daniel Mills
2317220666 What block show more info 2020-10-19 06:09:41 -04:00
Daniel Mills
47c1b58aa5 Loot fixes 2020-10-19 06:09:34 -04:00
Daniel Mills
0039582f28 Summon command 2020-10-19 06:09:28 -04:00
Daniel Mills
60a529375c Fix Regen Crash 2020-10-19 03:46:05 -04:00
Daniel Mills
d42bcb0ab9 Fix fx and spawning before terrain is setup 2020-10-19 03:43:33 -04:00
Daniel Mills
4b11bcb77b Merge remote-tracking branch 'origin/master' 2020-10-19 03:28:04 -04:00
Daniel Mills
6775edddab Move listing to iris dims 2020-10-19 03:27:56 -04:00
Andrew
039a732148 Update .gitignore 2020-10-18 16:36:22 -07:00
Andrew
9aac70c734 Remove IDEA cancer 2020-10-18 16:35:49 -07:00
Andrew
dc6c38cf24 Update .gitignore 2020-10-18 16:33:57 -07:00
Andrew
a2b09cb2aa Remove Iris.iml from repo 2020-10-18 16:32:06 -07:00
Andrew
6e6453f897 Update .gitignore 2020-10-18 16:29:25 -07:00
Andrew
f16de65934 Remove .idea from repo 2020-10-18 16:27:54 -07:00
Daniel Mills
fa0a5efb25 VP 2020-10-18 16:42:03 -04:00
Daniel Mills
1ffb6b9395 WC 2020-10-18 16:41:40 -04:00
Andrew
16d746fb8d Add Citizens support to IrisEntity.java 2020-10-18 11:44:30 -07:00
Andrew
e8629fab66 Add CitizensLink class variable to Iris.java 2020-10-18 11:40:51 -07:00
Andrew
9cb9719461 Create Citizenslink 2020-10-18 11:27:31 -07:00
Daniel Mills
564f02b188 Reload config command 2020-10-18 13:22:50 -04:00
Daniel Mills
d67596117f Fixes 2020-10-18 08:39:26 -04:00
Daniel Mills
ffecbb2298 Merge remote-tracking branch 'origin/master' 2020-10-18 08:39:20 -04:00
Andrew
b5fe2bcc60 Add Citizens to pom.xml 2020-10-17 17:30:43 -07:00
Andrew
7641d6dbdf IDEA bs 2020-10-17 17:07:34 -07:00
Andrew
54c5e3a8e3 Merge remote-tracking branch 'origin/master' 2020-10-17 17:06:35 -07:00
Andrew
d8427cdbcd IDEA bs 2020-10-17 17:05:57 -07:00
Andrew
fe03a12bec Update README.md 2020-10-17 15:36:59 -07:00
Andrew
37fca3fc3e Update IDEA files 2020-10-17 13:45:12 -07:00
Daniel Mills
4dcdbdec3a Fix slabs 2020-10-17 13:29:07 -04:00
Daniel Mills
564c79c411 Bugfixes 2020-10-17 13:20:38 -04:00
Daniel Mills
ea46c78a15 Faster block data! 2020-10-17 02:03:41 -04:00
Daniel Mills
93529cda60 Attempt at faster block data 2020-10-17 00:02:15 -04:00
Daniel Mills
13bf6a89cb Fix ctc 2020-10-16 23:48:21 -04:00
Daniel Mills
468c69d2dd Bugfixes & Performance Improvements 2020-10-16 23:45:44 -04:00
Daniel Mills
4ccfa8c3b6 Bugfixes for 13 2020-10-16 09:50:27 -04:00
Dan
b9a447453f Merge pull request #16 from cyberpwnn/performance-passes
Fix pr
2020-10-16 02:00:13 -04:00
Andrew
3daf03d89a Revert "Performance pass 5 (String concatenation in loop)"
This reverts commit d9d0f426e4.
2020-10-16 01:59:44 -04:00
Andrew
1a7d4c2c37 Revert "Performance pass 4 (String concatenation as argument to 'StringBuilder.append()' call)"
This reverts commit 1b88d3d785.
2020-10-16 01:59:31 -04:00
Daniel Mills
c7f612dac0 Fixes 2020-10-16 01:59:18 -04:00
Dan
1a7aa1218a Revert "Merge pull request #15 from cyberpwnn/performance-passes"
This reverts commit e530e30878.
2020-10-16 01:58:56 -04:00
Dan
e530e30878 Merge pull request #15 from cyberpwnn/performance-passes
Performance passes
2020-10-16 01:57:47 -04:00
Andrew
c5ef4df15a Performance pass 7 ('Collection.toArray()' call style) 2020-10-15 22:47:46 -07:00
Andrew
dba07c1832 Performance pass 6 (Wrapper type may be primitive) 2020-10-15 22:46:25 -07:00
Andrew
d9d0f426e4 Performance pass 5 (String concatenation in loop) 2020-10-15 22:46:05 -07:00
Andrew
1b88d3d785 Performance pass 4 (String concatenation as argument to 'StringBuilder.append()' call) 2020-10-15 22:45:09 -07:00
Andrew
1e188fe737 Performance pass 3 (Manual array to collection copy) 2020-10-15 22:44:30 -07:00
Andrew
335d4abbe1 Performance pass 3 (Manual array copy) 2020-10-15 22:44:13 -07:00
Andrew
1087d27523 Performance pass 2 (Loop can be terminated after condition is met) 2020-10-15 22:43:05 -07:00
Andrew
f8f8b884bc Performance pass 1 (Fix array size) 2020-10-15 22:42:44 -07:00
Andrew
c84c462aeb Merge remote-tracking branch 'origin/master' 2020-10-15 22:38:06 -07:00
Andrew
3ba4384c84 Add .gitignore to .idea folder 2020-10-15 22:36:09 -07:00
Andrew
d4c72c34c3 Fix /iris what block NPE 2020-10-15 22:23:06 -07:00
Andrew
60e950abcb Fix /iris what hand NPE 2020-10-15 22:17:10 -07:00
Daniel Mills
6cb48e76a8 Fix npes 2020-10-15 23:47:32 -04:00
Andrew
5e811b188b Add support for IDEA Minecraft Development plugin 2020-10-15 14:47:06 -07:00
Daniel Mills
31320b4ab7 Mythic mobs support 2020-10-13 05:53:50 -04:00
Daniel Mills
38e62a9c98 Print errors 2020-10-13 04:33:28 -04:00
Daniel Mills
74e59fa47b Optimizations 2020-10-13 04:27:25 -04:00
Daniel Mills
80b1374a61 Idea Nitpick ""Optimizations"" 2020-10-13 03:35:40 -04:00
Daniel Mills
bd3e9d01ec Handle objects on ravines 2020-10-12 21:49:49 -04:00
Daniel Mills
f3e7d188f9 Ravines 2020-10-12 21:40:52 -04:00
Daniel Mills
c45044b5c2 More Settings 2020-10-12 20:04:32 -04:00
Daniel Mills
ac2dcee6c3 Fix crash issues 2020-10-12 19:59:24 -04:00
Daniel Mills
e72ea21b6b Fix commands & support regeneration 2020-10-12 00:18:05 -04:00
Daniel Mills
a46f57eaab Fixes 2020-10-06 17:08:07 -04:00
Daniel Mills
843b5d7154 Bugfixes 2020-10-06 16:54:36 -04:00
Daniel Mills
4f7d659700 Compat lists 2020-10-06 14:22:10 -04:00
Daniel Mills
0a195e0c11 Auto stash before rebase of "refs/heads/master" 2020-10-06 13:32:45 -04:00
Daniel Mills
9a9a21350e Function sharing 2020-09-19 16:08:25 -04:00
Daniel Mills
5a4cbc74f7 Bam 2020-09-18 15:33:11 -04:00
Daniel Mills
27e06ceb2c g 2020-09-18 15:30:58 -04:00
Daniel Mills
68f2640ceb f 2020-09-18 15:30:30 -04:00
Daniel Mills
cd9cf902bf NoAuth 2020-09-18 15:29:51 -04:00
Daniel Mills
03f3b4f8d3 Fix data managers 2020-09-18 15:28:54 -04:00
Daniel Mills
6e430861d7 fix 2020-09-16 17:58:11 -04:00
Daniel Mills
b7d658cff3 Merge remote-tracking branch 'origin/master' 2020-09-16 17:57:52 -04:00
Daniel Mills
b1b85e7135 Pregen after mvc 2020-09-16 08:50:14 -04:00
Brian Fopiano
f28bdccd0f %% 2020-09-15 07:57:19 -07:00
Daniel Mills
d2ea288009 BLOCK DATA CUSTOM SUPPORT & FIX DECAYS 2020-09-14 08:27:14 -04:00
Daniel Mills
e0a60e3ef3 Fixes 2020-09-13 16:59:05 -04:00
Daniel Mills
563bf12de0 f 2020-09-13 10:45:51 -04:00
Daniel Mills
ef4037274d Fixes 2020-09-13 09:15:04 -04:00
Daniel Mills
639294af2d Default values 2020-09-13 09:06:45 -04:00
Daniel Mills
9e51a1617f Ugh 2020-09-13 08:57:13 -04:00
Daniel Mills
d317ac5236 Fix decorations 2020-09-13 07:03:42 -04:00
Daniel Mills
42907b5a5d Schema good 2020-09-12 17:44:52 -04:00
Daniel Mills
5d35fc80d5 g 2020-09-12 01:51:52 -04:00
Daniel Mills
11cab800e3 Faster caching 2020-09-12 01:44:54 -04:00
Daniel Mills
9272765f3c Carving Biomes 2020-09-12 00:17:12 -04:00
Daniel Mills
30e1d9552c fg 2020-09-11 23:45:36 -04:00
Daniel Mills
1bafdf0feb Carving Objects 2020-09-11 12:59:37 -04:00
Daniel Mills
1618d54b70 More SPEED 2020-09-11 11:06:32 -04:00
Daniel Mills
be6739ecb8 Fix spawning (pandas) 2020-09-11 08:05:11 -04:00
Daniel Mills
200e576ba8 Fix loot 2020-09-10 02:42:10 -04:00
Daniel Mills
ed6fe5631a Items 2020-09-10 00:23:33 -04:00
Daniel Mills
b0ee9b27a1 Blockdata backups 2020-09-10 00:17:13 -04:00
Daniel Mills
eb0de84ce3 Bam 2020-09-10 00:14:52 -04:00
Daniel Mills
c52b3d27bc Blockdata 2020-09-09 23:01:02 -04:00
Daniel Mills
352adbc9cb Support weight 2020-09-09 22:52:29 -04:00
Daniel Mills
c418683b3d Start the pain 2020-09-09 22:45:55 -04:00
Daniel Mills
5bd22f25b8 God dammit lombok 2020-09-09 22:25:34 -04:00
Daniel Mills
087ab3815f CHAINS 2020-09-09 21:27:53 -04:00
Daniel Mills
6af2055fd2 All access constructor 2020-09-09 21:12:20 -04:00
Daniel Mills
05e351be9c hh 2020-09-09 08:53:38 -04:00
Daniel Mills
9bdcd6aace Fix 2020-09-09 08:38:12 -04:00
Daniel Mills
265807941a Async gen cap 2020-09-09 06:47:27 -04:00
Daniel Mills
88b60ea945 Yrand 2020-09-09 05:11:55 -04:00
Daniel Mills
f5854f9342 Cave fluids 2020-09-09 04:13:21 -04:00
Daniel Mills
8ffe6fa8fb Instant changes 2020-09-09 00:29:22 -04:00
Daniel Mills
1d11585fcd FIxes 2020-09-08 22:57:29 -04:00
Daniel Mills
b0d8b9a078 More 2020-09-08 22:26:34 -04:00
Daniel Mills
9f1b66fb91 Schema 2020-09-08 21:46:08 -04:00
Daniel Mills
55fde2d3fb Fix value noise 2020-09-08 21:15:01 -04:00
Daniel Mills
649becb98e ff 2020-09-08 19:29:19 -04:00
Daniel Mills
0b9ea265f0 FND 2020-09-08 19:28:55 -04:00
Daniel Mills
3e92154e27 Fixes 2020-09-07 23:00:29 -04:00
Daniel Mills
bdb86808a5 Prg 2020-09-07 20:10:22 -04:00
Daniel Mills
1993639bf6 Config options & fix cave slabs for 2x lines 2020-09-07 11:56:22 -04:00
Daniel Mills
90a5398e98 Initial spawns 2020-09-06 04:01:20 -04:00
Daniel Mills
c5ab77b8ac tweaks 2020-09-06 03:29:35 -04:00
Daniel Mills
7cd268bb4c Dont warn 2020-09-06 03:19:55 -04:00
Daniel Mills
036dc289d5 Iris doesnt need worlds anymore 2020-09-06 03:19:01 -04:00
Daniel Mills
035f2a0236 Move 2020-09-06 03:18:48 -04:00
Daniel Mills
86669fb6e8 Terrain Data 2020-09-05 23:14:59 -04:00
Daniel Mills
5a2bb741a7 Fixes 2020-09-05 23:14:55 -04:00
Daniel Mills
28e8a234e9 Experiment 2020-09-05 22:41:16 -04:00
Daniel Mills
bd48e77e7c Fix bugs 2020-09-05 04:30:22 -04:00
Daniel Mills
5b6f1182fe Custom fluids 2020-09-05 02:59:45 -04:00
Daniel Mills
44d800de1e Noise overlay support & Post Foliage Cleaner 2020-09-05 01:39:19 -04:00
Daniel Mills
fc55622cc8 Fix Post rounding 2020-09-05 00:33:30 -04:00
Daniel Mills
0e217e431b Fixes 2020-09-04 23:14:34 -04:00
Daniel Mills
e4cbfcfedc Fixes 2020-09-04 22:11:03 -04:00
Daniel Mills
ccd59278e5 Fixes 2020-09-04 21:50:49 -04:00
Daniel Mills
a27bb66fef Fixes 2020-09-04 21:13:39 -04:00
Daniel Mills
ef6036a7d0 Commands & Settings 2020-09-04 21:10:48 -04:00
Daniel Mills
b158ea9e78 Cleanup 2020-09-04 20:59:13 -04:00
Daniel Mills
fbc02881d7 1.14+ support 2020-09-04 07:33:00 -04:00
Daniel Mills
4340d584c1 Merge remote-tracking branch 'origin/master' 2020-09-04 03:48:59 -04:00
Daniel Mills
a4a8678116 Clean up plax gen 2020-09-04 03:48:56 -04:00
Daniel Mills
ab4bee5d69 Structure tile seed cohesion 2020-09-04 03:48:47 -04:00
Daniel Mills
fad17c9cd2 Structure Seed cohesion 2020-09-04 03:48:40 -04:00
Daniel Mills
e7f0ba1982 Regions support for objects 2020-09-04 03:48:31 -04:00
Brian Fopiano
92bee965f0 EyeFix 2020-09-04 00:48:02 -07:00
Daniel Mills
dd4edb8ba5 Support Getters instead of fields 2020-09-04 03:24:52 -04:00
Daniel Mills
b8f58b9cc7 Low memory mode support 2020-09-04 03:24:38 -04:00
Daniel Mills
f334b0137e Iris LMM Support 2020-09-04 03:24:22 -04:00
Daniel Mills
e732c8ff6a STD Register LMM 2020-09-04 03:24:15 -04:00
Daniel Mills
60bb232d2a LMM Command 2020-09-04 03:24:09 -04:00
Daniel Mills
4f18f26935 CTC 2020-09-04 03:24:03 -04:00
Daniel Mills
7dc095b87a CTC Rename 2020-09-04 03:23:57 -04:00
Daniel Mills
759780f10e Meta 2020-09-04 02:42:03 -04:00
Daniel Mills
77ff87a9c4 Prefs for style 2020-09-04 02:39:46 -04:00
Brian Fopiano
82d6719681 Additives 2020-09-03 23:32:49 -07:00
Daniel Mills
073998789c Run Profiles 2020-09-04 02:30:04 -04:00
Daniel Mills
3f4347289c Unused NMS 2020-09-04 02:28:10 -04:00
Brian Fopiano
dc2a3cde47 f 2020-09-03 23:23:35 -07:00
Daniel Mills
252eebe5d8 F 2020-09-04 02:18:16 -04:00
Daniel Mills
bdd0da82e7 A Splash of Iris 2020-09-04 02:15:36 -04:00
Daniel Mills
d144b9ba0b Smart Bore & Islands 2020-09-04 01:15:38 -04:00
Daniel Mills
b201cf1990 Attempt to fix stilting 2020-09-03 18:06:58 -04:00
Daniel Mills
286c4da2f3 f 2020-09-03 16:37:03 -04:00
Daniel Mills
959a5b5c70 Fixes 2020-09-03 16:15:09 -04:00
Daniel Mills
607a7be337 Supercarves 2020-09-03 03:59:03 -04:00
Daniel Mills
3663b9f957 Fixes 2020-09-03 00:09:31 -04:00
Daniel Mills
9aa6d1c0fc Optimization 2020-09-02 21:06:01 -04:00
Daniel Mills
e6b59bc16d Fix holes 2020-09-02 18:16:12 -04:00
Daniel Mills
a478428721 Custom entity spawns 2020-09-02 16:46:11 -04:00
Daniel Mills
8bb01a2412 Fixes 2020-09-02 14:22:58 -04:00
Daniel Mills
4a98fb6c9d Multiverse Support 2020-09-02 13:47:20 -04:00
Daniel Mills
ea5dd69719 Fixes 2020-09-02 12:29:51 -04:00
Daniel Mills
6d3a35517b Rivers & Lakes 2020-09-02 02:31:17 -04:00
Daniel Mills
9be6e12a5c Perf 2020-09-01 21:47:18 -04:00
Daniel Mills
e8addbc954 Performance 2020-09-01 20:41:26 -04:00
Daniel Mills
683becabda Font render correction 2020-08-31 16:48:12 -04:00
Daniel Mills
8c0cbfe93a Fix text renderer 2020-08-31 16:20:24 -04:00
Daniel Mills
57cb8d5bda fAILS AT FONTS 2020-08-31 15:33:51 -04:00
Daniel Mills
0b583bcf80 Obfuscation fixes 2020-08-30 16:09:22 -04:00
Daniel Mills
9880248e49 Beautiful Interpolation 2020-08-29 18:01:00 -04:00
Daniel Mills
20b715f7cb noriver 2020-08-29 14:30:12 -04:00
Daniel Mills
ed9ddc0825 More fix 2020-08-26 09:33:05 -04:00
Daniel Mills
5ab2bae5d7 Loads o fix 2020-08-26 09:32:59 -04:00
Daniel Mills
8a2b69464f g 2020-08-25 17:12:48 -04:00
Daniel Mills
ff78830ead WORKING 2020-08-25 16:39:24 -04:00
Daniel Mills
01fd89f60c WORKING 2020-08-25 15:55:46 -04:00
Daniel Mills
44b6396b78 Loading & Saving! 2020-08-24 12:57:25 -04:00
Daniel Mills
998e1b62a5 ggg 2020-08-24 12:35:57 -04:00
Daniel Mills
273f7c7a73 GUI & Tasking utils 2020-08-24 08:03:05 -04:00
Daniel Mills
e9544bb610 Move wand manager 2020-08-24 08:02:58 -04:00
Daniel Mills
fecf7f987d Fixes 2020-08-23 04:02:11 -04:00
Daniel Mills
308395aa86 Fix 2020-08-23 03:25:12 -04:00
Daniel Mills
69218b6710 Faster 2020-08-22 11:27:06 -04:00
Daniel Mills
8bf7fcff28 f 2020-08-22 09:52:23 -04:00
Daniel Mills
416fbc093f Prep 2020-08-22 09:52:11 -04:00
Daniel Mills
2500fa54e4 Parallax 2 2020-08-22 09:51:54 -04:00
Daniel Mills
ccc7a947cd Fix tiles & decor 2020-08-21 23:50:07 -04:00
Daniel Mills
83772bed42 Loot table fixes 2020-08-21 12:42:21 -04:00
Daniel Mills
7f3b7df710 Rarity stuffs 2020-08-21 04:35:56 -04:00
Daniel Mills
39b7563d3a Loot 2020-08-21 03:48:53 -04:00
Daniel Mills
7b94d753b8 Block Updates 2020-08-20 22:44:16 -04:00
Daniel Mills
ab89d6a22f +3 depth dir finding for objects 2020-08-20 22:10:17 -04:00
Daniel Mills
bff242dc99 mm 2020-08-20 01:48:27 -04:00
Daniel Mills
ec452125e2 Fixes 2020-08-19 03:09:57 -04:00
Daniel Mills
faa4ca33ad Sea layer fixes 2020-08-19 02:48:26 -04:00
Daniel Mills
0b2284f163 Fix beach sea layers 2020-08-19 02:35:09 -04:00
Daniel Mills
b8c4d66160 Tweaks 2020-08-19 02:18:31 -04:00
Daniel Mills
4dfd033435 Cleanup 2020-08-18 16:02:07 -04:00
Daniel Mills
9ca8739514 Fix Interpolation 2020-08-18 01:16:30 -04:00
Dan
1d8691fed8 Merge pull request #14 from cyberpwnn/Blink
Blink
2020-08-17 20:25:37 -04:00
Daniel Mills
522aec1d3a Fixes 2020-08-17 20:25:01 -04:00
Daniel Mills
6153b25bc7 Fix noise 2020-08-17 15:52:50 -04:00
Daniel Mills
bb7e277f19 Fix placement 2020-08-17 00:54:52 -04:00
Daniel Mills
8a7bc3c17d Fixes 2020-08-17 00:26:21 -04:00
Daniel Mills
af22751210 Remove Ceiling Gen & Post Block Sep 2020-08-16 22:08:57 -04:00
Daniel Mills
81f6ce26d4 Stop overlocking 2020-08-16 21:26:27 -04:00
Daniel Mills
633fea8c68 Merge BiomeChunkGenerator -> TerrainChunkGenerator 2020-08-16 21:21:19 -04:00
Daniel Mills
0c5855a82d Alright 2020-08-16 21:14:40 -04:00
Daniel Mills
c07b4e9f98 WSU 2020-08-16 16:15:58 -04:00
Daniel Mills
2407c3f2f8 Schemas 2020-08-16 13:18:02 -04:00
Daniel Mills
d89371a279 Fixes 2020-08-16 02:23:53 -04:00
Daniel Mills
86be84b015 Fixes 2020-08-15 23:07:39 -04:00
Dan Macbook
da79b4e2ea ddd 2020-08-15 19:05:08 -04:00
Dan Macbook
e54f7d9c06 Hmmmmmmmmmmmm 2020-08-14 17:39:22 -04:00
Dan Macbook
c0991e46ec Hmmmmm 2020-08-14 17:39:11 -04:00
Dan Macbook
ddd29529ea Hmmm 2020-08-14 17:39:06 -04:00
Dan Macbook
a1d6431348 Mapping 2020-08-14 08:18:10 -04:00
Dan Macbook
31bd6a0c0d Biome Styling 2020-08-14 05:43:58 -04:00
Dan Macbook
7f98aff531 Caching Revisited 2020-08-14 05:16:58 -04:00
Dan Macbook
948317c27a No Caching 2020-08-14 03:39:35 -04:00
Dan Macbook
7406da66a7 ZPan 2020-08-13 14:59:30 -04:00
Dan Macbook
8586ec67b6 Lint 2020-08-13 10:45:59 -04:00
Dan Macbook
991aaa8677 MOAR 2020-08-13 08:10:48 -04:00
Dan Macbook
a4d1b5b972 Noise 2020-08-13 07:29:43 -04:00
Dan Macbook
887d355dea CNG Bakn 2020-08-13 07:04:50 -04:00
Dan Macbook
93866dc466 NVIS 2020-08-13 06:01:06 -04:00
Dan Macbook
6c014e25b5 NV 2020-08-13 05:42:02 -04:00
Dan Macbook
b1663c040f Noise fix 2020-08-13 02:49:35 -04:00
Dan Macbook
1f63b47500 normalize 2020-08-12 13:44:34 -04:00
Dan Macbook
ce0249f28e New Noise System 2020-08-11 16:27:48 -04:00
Dan Macbook
5d096092b9 Noise 2020-08-10 23:09:57 -04:00
Dan Macbook
a6b65c8d76 M 2020-08-10 23:09:52 -04:00
Daniel Mills
d3a4b0451d fixes 2020-08-09 01:24:58 -04:00
Daniel Mills
e0714637ff Schema 2020-08-08 19:14:12 -04:00
Daniel Mills
e777566339 Update docs 2020-08-08 19:07:08 -04:00
Daniel Mills
185d0d8817 Schema system 2020-08-08 18:56:01 -04:00
Daniel Mills
4132c0552f Object writing and whatnot 2020-08-07 14:36:07 -04:00
Daniel Mills
c158e74fb5 Region rarity 2020-08-07 13:36:41 -04:00
Daniel Mills
e5384509cf Localdata 2020-08-07 03:56:30 -04:00
Daniel Mills
60324c041c Structures 2020-08-07 01:29:05 -04:00
Daniel Mills
5be89f3f31 Fixes 2020-08-06 16:43:02 -04:00
Daniel Mills
4207330dcf Revert "Revert "Block Compat""
This reverts commit 05ab44d50b.
2020-08-06 16:02:01 -04:00
Daniel Mills
05ab44d50b Revert "Block Compat"
This reverts commit 2a849c417f.
2020-08-06 15:59:24 -04:00
Daniel Mills
2a849c417f Block Compat 2020-08-06 15:58:21 -04:00
Daniel Mills
d5d7e9a952 More Performance 2020-08-06 14:48:02 -04:00
Daniel Mills
f1e3210c7a Performance Improvements 2020-08-06 02:58:40 -04:00
Daniel Mills
cd07f29038 Loads of fixes 2020-08-05 02:56:18 -04:00
Daniel Mills
a7428838b3 Fixes 2020-08-04 00:34:52 -04:00
Daniel Mills
58b00b6ed5 Revert "Revert "Decorate""
This reverts commit 9d2544f8cb.
2020-08-03 23:31:36 -04:00
Daniel Mills
9d2544f8cb Revert "Decorate"
This reverts commit aca279c951.
2020-08-03 23:30:14 -04:00
Daniel Mills
4f99743db7 f 2020-08-03 23:30:03 -04:00
Daniel Mills
e5d622780e Revert "Revert ""Fix" ores""
This reverts commit 905625d18e.
2020-08-03 23:25:41 -04:00
Daniel Mills
905625d18e Revert ""Fix" ores"
This reverts commit b529cc5691.
2020-08-03 23:24:30 -04:00
Daniel Mills
b529cc5691 "Fix" ores 2020-08-03 23:24:23 -04:00
Daniel Mills
aca279c951 Decorate 2020-08-03 23:24:09 -04:00
Daniel Mills
086bb764a5 Fixes 2020-08-03 22:30:23 -04:00
Daniel Mills
4304cad029 Standalones 2020-08-03 13:56:51 -04:00
Daniel Mills
79e2bdb587 Standalones 2020-08-03 13:39:15 -04:00
Daniel Mills
51d55eed05 No BSky 2020-08-03 12:31:13 -04:00
Daniel Mills
ef5115b76c Fix locking 2020-08-03 10:44:39 -04:00
Daniel Mills
58a5aaed30 ATOMIC MAYHEM 2020-08-03 10:44:34 -04:00
Daniel Mills
b6592582b3 Fixes 2020-08-02 16:17:02 -04:00
Dan Macbook
7863660a47 fix 2020-08-02 11:35:35 -04:00
Daniel Mills
ea3e7f9ace Worlds 2020-08-01 12:16:42 -04:00
Daniel Mills
92e7ac7f20 Fix cmds 2020-08-01 11:11:53 -04:00
Daniel Mills
75f6a93024 fff 2020-08-01 10:13:23 -04:00
Daniel Mills
d679660e8a Move 2020-08-01 09:57:42 -04:00
Daniel Mills
f3d87f09d7 Total rotation support 2020-08-01 08:46:52 -04:00
Daniel Mills
71c90c6d31 Block type fixes 2020-08-01 07:20:54 -04:00
Daniel Mills
3b76bb64a9 Oh the commands 2020-08-01 04:36:57 -04:00
Daniel Mills
e5cdd9a7f1 f 2020-07-31 13:45:41 -04:00
Daniel Mills
121653a8f2 Fixes & Mem improvements 2020-07-31 01:02:00 -04:00
Daniel Mills
9d326d240a Fixes 2020-07-30 03:52:35 -04:00
Daniel Mills
d92c96ecc2 Fixes 2020-07-30 03:52:23 -04:00
Daniel Mills
aec5486144 Fixes 2020-07-30 02:58:08 -04:00
Daniel Mills
773dd2fd1a Biome Rarity 2020-07-29 23:18:37 -04:00
Daniel Mills
36e5fec284 Loads of bugfixes & Seed cohesion 2020-07-29 22:31:16 -04:00
Daniel Mills
84e81e9ce0 Now on hotload: Post Processing! 2020-07-29 00:53:30 -04:00
Daniel Mills
0ecde9531e Fix post 2020-07-29 00:23:48 -04:00
Daniel Mills
7d4b980e59 Speed 2020-07-28 20:49:35 -04:00
Daniel Mills
bccb4e154d Cave Biomes 2020-07-28 03:13:33 -04:00
Daniel Mills
45dd039c53 Start biome remodel 2020-07-28 00:02:30 -04:00
Daniel Mills
108499706a Cleanup 2020-07-27 20:49:26 -04:00
Daniel Mills
1ae1cebab6 Build script for release 2020-07-27 20:49:20 -04:00
Daniel Mills
77786af4d7 JSON 2020-07-27 20:49:09 -04:00
Daniel Mills
809959fde8 Proguard 2020-07-27 20:49:03 -04:00
Daniel Mills
a47ea13a9b Proguard 2020-07-27 20:48:37 -04:00
Daniel Mills
dddbcdf088 Reorganize 2020-07-27 20:48:00 -04:00
Daniel Mills
e1067aeb83 Fixes 2020-07-27 05:15:21 -04:00
Daniel Mills
e5e46f3239 Shatter Me 2020-07-26 20:44:36 -04:00
Daniel Mills
a28c08be99 Opts 2020-07-26 18:02:49 -04:00
Daniel Mills
279fcad10a More fixes 2020-07-26 14:17:20 -04:00
Daniel Mills
7505d645eb Fix 2020-07-26 13:24:54 -04:00
Daniel Mills
5af98c5683 Fix 2020-07-26 05:28:22 -04:00
Daniel Mills
f8cb0caa80 Decorate "spot": Shore Line 2020-07-25 14:03:12 -04:00
Daniel Mills
e3747d3cfd Fix Beaches 2020-07-25 14:02:58 -04:00
Daniel Mills
ebe96c0dad Dont log deposits 2020-07-25 13:23:40 -04:00
Daniel Mills
bbd394b95e Fix deposit placements 2020-07-25 13:23:05 -04:00
Daniel Mills
e1824ffda1 Caves fixed 2020-07-25 12:56:56 -04:00
Daniel Mills
d42be730c3 Fixes & Performance 2020-07-25 00:04:41 -04:00
Daniel Mills
a75817dde1 Revert "F"
This reverts commit 066fb7fba0.
2020-07-24 12:20:10 -04:00
Daniel Mills
066fb7fba0 F 2020-07-24 10:57:19 -04:00
Daniel Mills
30dc6e865f lol dual universe 2020-07-23 20:28:08 -04:00
Daniel Mills
ae5d0b282c Revert "Rarity System"
This reverts commit a9ce316d28.
2020-07-22 15:28:16 -04:00
Daniel Mills
a9ce316d28 Rarity System 2020-07-22 15:04:28 -04:00
Daniel Mills
6c28e270d2 Fixes 2020-07-22 11:10:03 -04:00
Daniel Mills
72d4c7eb40 Kboom 2020-07-21 04:23:02 -04:00
Daniel Mills
921e5912b3 Caves 2020-07-21 02:25:36 -04:00
Dan
aa168fab8c Merge pull request #13 from cyberpwnn/iris-2
Kablamalakazamshazam... fam
2020-07-21 01:32:00 -04:00
Daniel Mills
dffa357c0a Docs and crap 2020-07-21 01:30:47 -04:00
Daniel Mills
7c6442d51f Fixes 2020-07-20 14:58:32 -04:00
Daniel Mills
f995f6568c Bugfixes 2020-07-19 04:09:42 -04:00
Daniel Mills
5b8d812fc8 Fixes 2020-07-18 07:28:43 -04:00
Daniel Mills
27ce6ad5ba Surface decorators (including bisected blocks) 2020-07-17 18:56:12 -04:00
Daniel Mills
58dcb72adc Bam 2020-07-17 04:15:43 -04:00
Daniel Mills
202a7106a7 Bump 2020-05-19 04:28:47 -04:00
Daniel Mills
b8f79f6559 Fixes 2020-05-17 22:21:32 -04:00
Daniel Mills
e491401ca0 Generators 2020-05-16 04:41:45 -04:00
Daniel Mills
89b236ae9e fix 2020-05-15 00:57:28 -04:00
Daniel Mills
0566b30406 Rotation 2020-05-14 16:39:08 -04:00
Daniel Mills
14e63bd47d PAr fixes 2020-05-13 21:32:13 -04:00
Daniel Mills
1b2ce750ca Parallax 2020-05-11 10:09:23 -04:00
Daniel Mills
17df8f23c5 Cleanup 2020-05-10 20:43:30 -04:00
Daniel Mills
eca3174214 Deps 2020-05-10 17:16:44 -04:00
Daniel Mills
5d7126f772 Fix 2020-04-07 00:52:09 -04:00
Daniel Mills
a82ba6503f Max biomes 2020-03-21 03:26:55 -04:00
Daniel Mills
cecbad2eb9 Scaffolding 2020-03-20 10:17:51 -04:00
Daniel Mills
a97cb3df4f Moar 2020-03-16 17:11:31 -04:00
Daniel Mills
59f29eb6b4 RV 2020-03-16 11:55:17 -04:00
Daniel Mills
ba9cb41d47 Fixes 2020-03-15 19:35:07 -04:00
Daniel Mills
67a2ad708f Caverns 2020-03-14 23:01:06 -04:00
Daniel Mills
e385e3cec8 Fixes 2020-02-01 20:56:34 -05:00
Daniel Mills
6373478d13 Fuck bukkit's stupid classloaders 2020-01-31 13:43:28 -05:00
Daniel Mills
7cc6dd03ff Ores 2020-01-27 01:17:57 -05:00
Daniel Mills
30ffc8cd11 Support double plants and fix scatter chances 2020-01-26 23:17:55 -05:00
Daniel Mills
b61a71b3b4 Noise updates 2020-01-26 21:53:55 -05:00
Daniel Mills
1c7a7f6edf Never place decaying leaves 2020-01-26 18:05:15 -05:00
Daniel Mills
5d410764e1 Better placement 2020-01-26 16:42:19 -05:00
Daniel Mills
f645589cda Deep ocean tech 2020-01-25 17:45:06 -05:00
Daniel Mills
b49c1e6e47 Caves 2020-01-25 17:20:32 -05:00
Daniel Mills
58558732be Cobble steps 2020-01-24 19:31:21 -05:00
Daniel Mills
784ef277fc Slabs 2020-01-24 18:34:54 -05:00
Daniel Mills
eb359f79cb Lushness 2020-01-24 17:54:46 -05:00
Daniel Mills
31bf39d2e5 Patch 2020-01-24 14:39:55 -05:00
Daniel Mills
08159923d6 Fixes 2020-01-24 14:19:52 -05:00
Daniel Mills
7b8b8d6b75 Fixes 2020-01-24 08:20:47 -05:00
Daniel Mills
e52f5571a7 Fix pom 2020-01-23 19:48:42 -05:00
Daniel Mills
ea458935f0 Deployments 2020-01-23 17:42:02 -05:00
Daniel Mills
64674026a6 K 2020-01-23 08:20:45 -05:00
Daniel Mills
ea71474b62 Fix pom 2020-01-23 08:14:57 -05:00
Daniel Mills
5d6348b83c New biome system 2020-01-22 18:55:53 -05:00
Daniel Mills
199a26afbc f 2020-01-22 14:31:00 -05:00
Daniel Mills
c1971bffa8 Fix regen 2020-01-22 11:30:10 -05:00
Daniel Mills
51832005de Tweaks on height 2020-01-21 20:40:30 -05:00
Daniel Mills
9d5ae41c49 Fixes 2020-01-21 20:06:44 -05:00
Daniel Mills
fa1d2416e0 Parallaxes 2020-01-21 18:50:17 -05:00
Daniel Mills
c212bc294b Opts 2020-01-21 18:49:57 -05:00
Daniel Mills
ca21758889 Fix parallax 2020-01-21 18:43:00 -05:00
Daniel Mills
75da6d4df1 No warnings 2020-01-21 17:49:59 -05:00
Daniel Mills
0483bc0afe "Perfection" 2020-01-21 17:49:20 -05:00
Daniel Mills
0e12c6906f Fixes 2020-01-21 15:43:00 -05:00
Brian Fopiano
1e633278dd Mapping 2020-01-21 12:16:16 -08:00
Brian Fopiano
554756851f f 2020-01-21 11:33:17 -08:00
Daniel Mills
ac8ac06c8a f 2020-01-21 14:32:37 -05:00
Daniel Mills
f6780fcb76 Iris is 50%-200% faster & now has timings 2020-01-21 07:45:20 -05:00
Daniel Mills
31c2ea888b f 2020-01-21 05:15:20 -05:00
Daniel Mills
2702c0f2e4 f 2020-01-20 19:46:20 -05:00
Daniel Mills
2aef5f94c0 "fast" mode 2020-01-20 15:02:48 -05:00
Daniel Mills
a4b571ccbc Parallax Object Generation 2020-01-20 14:38:07 -05:00
Daniel Mills
fd561cd45d Fixes 2020-01-20 01:53:43 -05:00
Daniel Mills
1357d817e6 Fix Priority 2020-01-19 08:06:07 -05:00
Daniel Mills
ba2613d3c7 Push Fixes 2020-01-19 07:54:08 -05:00
Daniel Mills
b2e1717dc3 Swirls 2020-01-19 07:51:45 -05:00
Daniel Mills
ace5abea23 Fix missing blocks in schematic bug 2020-01-19 07:23:17 -05:00
Daniel Mills
2ea1bd5e67 Schematics 2020-01-19 07:11:11 -05:00
Daniel Mills
8ced379e44 Schematics Support Priority, Rotated Blocks, Sink & NoRotate 2020-01-19 04:56:26 -05:00
Daniel Mills
f5ab7f3102 Smashed the Stupid out of Memory 2020-01-19 02:58:29 -05:00
Daniel Mills
445ce46357 Fixed 2020-01-19 02:45:28 -05:00
Daniel Mills
1b9c7d48e4 Massive biome improvements 2020-01-18 07:16:33 -05:00
Daniel Mills
596c3368e0 Fix Warnings & Setup noise biome tests 2020-01-18 02:49:28 -05:00
Daniel Mills
3a699d34eb Tweaks 2020-01-17 10:40:45 -05:00
Daniel Mills
451eca0aa9 Biome specific generators 2020-01-17 09:19:41 -05:00
Daniel Mills
165517608d Fixes (for now) 2020-01-17 00:11:35 -05:00
Daniel Mills
05eb0b20be Tweaks 2020-01-16 20:36:17 -05:00
Daniel Mills
c47526ce8e Junk 2020-01-16 04:12:48 -05:00
Daniel Mills
75d9bf458a Fixes? 2020-01-16 03:55:54 -05:00
Daniel Mills
3b90a58418 Fixes for biome derivatives 2020-01-16 01:49:19 -05:00
Daniel Mills
84e49a266d Fixes 2020-01-16 01:31:36 -05:00
Daniel Mills
446430be4f Surfaces and subsurfaces 2020-01-16 01:17:45 -05:00
Daniel Mills
e0a5ecc156 RTP Fixes 2020-01-15 22:34:02 -05:00
Dan
59e8ba2297 Merge pull request #1 from VolmitSoftware/redesign-noise
Redesign noise
2020-01-15 21:33:27 -05:00
Daniel Mills
9f8caff571 Fixes 2020-01-15 06:49:41 -05:00
Daniel Mills
f68c206a17 Reimpl 2020-01-15 05:21:28 -05:00
Daniel Mills
8c5fdd4673 Cubic & Hermite 2020-01-15 04:14:27 -05:00
Daniel Mills
c62be9573d Back to linear 2020-01-15 03:19:22 -05:00
Daniel Mills
c4d2e16433 Sample radii & Remove ridges 2020-01-15 03:02:01 -05:00
Daniel Mills
ccf36f23c3 Unscramble Biomes 2020-01-15 02:46:22 -05:00
Daniel Mills
495dcd94d8 Disable features for noise testing 2020-01-15 02:39:07 -05:00
Daniel Mills
417a759c40 Gen Features 2020-01-14 21:11:46 -05:00
Daniel Mills
90846401a5 Tweaking carves 2020-01-14 01:16:33 -05:00
Daniel Mills
8e28c59163 PreHash 2020-01-13 21:23:45 -05:00
Daniel Mills
a3eb0bb9fc Terrain 3D Carving (noise) for overhangs & cliffs. Also performance stuf 2020-01-13 02:10:11 -05:00
Daniel Mills
9aac129aad Loads of fixes 2020-01-12 17:49:18 -05:00
Daniel Mills
9a6e3a80c7 Delete Pack (LOOK IN THE RESOURCES FOLDER) 2020-01-11 04:53:17 -05:00
Daniel Mills
7e45835424 Fixes 2020-01-11 04:45:31 -05:00
Daniel Mills
58632b8da3 Biome Regions (group biomes such as hot, cold) so less random gen 2020-01-11 04:30:38 -05:00
Daniel Mills
acaf95c017 Fixes 2020-01-11 03:54:51 -05:00
Daniel Mills
1c3ad6a925 Fix issues 2020-01-08 19:38:31 -05:00
Daniel Mills
9bf49d8732 Merge remote-tracking branch 'origin/master' 2020-01-08 19:31:35 -05:00
Daniel Mills
6895390f2b Biome List 2020-01-08 19:31:30 -05:00
Brian Fopiano
116831f6d9 Merge remote-tracking branch 'origin/master' 2020-01-08 16:31:21 -08:00
Brian Fopiano
51c401d6db missed a " " 2020-01-08 16:31:10 -08:00
Brian Fopiano
b13bc0060b " " 2020-01-08 16:30:49 -08:00
Daniel Mills
e68d573209 Merge remote-tracking branch 'origin/master' 2020-01-08 19:25:19 -05:00
Daniel Mills
2d6f3db8fe Replace flag 2020-01-08 19:25:15 -05:00
Brian Fopiano
1a68a60479 Sink Space 2020-01-08 16:23:11 -08:00
Daniel Mills
da55612726 Reloading & Resource copying 2020-01-08 19:07:28 -05:00
Daniel Mills
1b88e132cc Merge remote-tracking branch 'origin/master' 2020-01-08 18:53:12 -05:00
Daniel Mills
6179dbda8a Massive enhancements 2020-01-08 18:53:08 -05:00
Daniel Mills
2a7b2343b2 Gen renames 2020-01-08 18:53:01 -05:00
Brian Fopiano
f7de416070 testing 2020-01-08 15:11:58 -08:00
Brian Fopiano
ead4b9e695 AltDir fix 2020-01-08 14:24:43 -08:00
Brian Fopiano
362adedae6 path fix 2020-01-08 14:23:20 -08:00
Brian Fopiano
4d88c1f798 seru trees
jap trees
2020-01-08 14:22:03 -08:00
Brian Fopiano
f664142094 better birch fix 2020-01-08 12:04:02 -08:00
Brian Fopiano
0d533a71b6 Fixing birch gen 2020-01-08 11:49:47 -08:00
Brian Fopiano
d88a6c5db8 Merge remote-tracking branch 'origin/master' 2020-01-08 11:43:32 -08:00
Daniel Mills
4379deaca2 Opts 2020-01-08 14:42:57 -05:00
Brian Fopiano
67325fdb79 Merge remote-tracking branch 'origin/master' 2020-01-08 11:33:06 -08:00
Daniel Mills
77b6239b16 Log Colors 2020-01-08 14:32:09 -05:00
Daniel Mills
248f2ca3c4 Less spam 2020-01-08 14:24:28 -05:00
Brian Fopiano
8b672a68e6 Merge remote-tracking branch 'origin/master' 2020-01-08 11:20:59 -08:00
Daniel Mills
ce8127456c fIXES 2020-01-08 14:20:42 -05:00
Brian Fopiano
30185626a6 Merge remote-tracking branch 'origin/master' 2020-01-08 11:18:09 -08:00
Daniel Mills
431eea9152 Merge remote-tracking branch 'origin/master' 2020-01-08 14:17:21 -05:00
Daniel Mills
d53ec07857 Schematic fixes & timings 2020-01-08 14:17:18 -05:00
Brian Fopiano
2670a41545 integrated birch 2020-01-08 11:16:16 -08:00
Brian Fopiano
4825b21951 birch shit 2020-01-08 11:09:27 -08:00
Brian Fopiano
ac2974d290 houses 2020-01-08 10:53:17 -08:00
Daniel Mills
ad7a4503e0 Faster Schematic Placement 2020-01-08 13:50:43 -05:00
Daniel Mills
4094034aaf Settings & Schematic Fixes 2020-01-08 08:20:17 -05:00
Daniel Mills
11e74ef6cc Additional structures in biomes 2020-01-08 08:20:05 -05:00
Brian Fopiano
1930b911b3 Fantasy shit 2020-01-08 03:14:14 -08:00
Daniel Mills
7e9417b186 Update pack 2020-01-08 06:13:01 -05:00
Daniel Mills
c620a9388f Placement flags 2020-01-08 04:01:05 -05:00
Daniel Mills
0d55247dd9 Schematic Placement 2020-01-08 03:10:26 -05:00
Brian Fopiano
9940e61fec Godtree Packaged 2020-01-08 00:08:03 -08:00
Daniel Mills
feb4f77e39 scm loading 2020-01-08 02:42:50 -05:00
Daniel Mills
d1925201ef Ye 2020-01-07 08:26:39 -05:00
Daniel Mills
7e9cea94f3 Biome Systems 2020-01-07 07:47:42 -05:00
Daniel Mills
152b1bd24e Logs 2020-01-07 01:56:47 -05:00
Daniel Mills
5d6da6034d Random Objects 2020-01-07 01:54:18 -05:00
Daniel Mills
6ea203f6b9 Stumps 2020-01-07 01:45:49 -05:00
Daniel Mills
79aabc6feb Small & Medium Palm 2020-01-07 01:44:08 -05:00
Daniel Mills
0ef5b017df Medium Dead Spruce 2020-01-07 01:41:21 -05:00
Daniel Mills
8ab969688e Medium Spruce 2020-01-07 01:41:14 -05:00
Daniel Mills
7e5b94cc5f Medium Birch 2020-01-07 01:41:08 -05:00
Daniel Mills
8cd02543bc Oak Medium 2020-01-07 01:30:04 -05:00
Daniel Mills
6f68e8b2c7 Commands and objects 2020-01-07 01:28:46 -05:00
Daniel Mills
e7baa90792 Schem 2020-01-06 21:49:18 -05:00
Daniel Mills
4199824275 sdf 2020-01-06 21:27:24 -05:00
Daniel Mills
fc2abb0f3c G 2020-01-06 20:59:10 -05:00
Daniel Mills
5b275e4170 ffs 2020-01-06 20:57:21 -05:00
Daniel Mills
a7e58b715b Fixes 2020-01-06 01:40:16 -05:00
Daniel Mills
8b8d59065f Fixes 2020-01-06 01:07:19 -05:00
Daniel Mills
ed0efec628 Rotation of schematics 2020-01-04 17:54:34 -05:00
Daniel Mills
f8a40b8fb3 Variants 2020-01-04 17:06:49 -05:00
Brian Fopiano
ef8d48846c bY pAthS 2020-01-04 14:03:43 -08:00
Daniel Mills
8f973c8dc1 Paths 2020-01-04 16:54:08 -05:00
Daniel Mills
e1e47caf72 Tweaks 2020-01-04 16:48:44 -05:00
Daniel Mills
c2d7fe8612 Terrain improvements 2020-01-04 15:24:03 -05:00
Daniel Mills
93e02093be Schems 2020-01-04 14:01:10 -05:00
Daniel Mills
7934be70ee Epic Gens 2020-01-04 00:28:19 -05:00
Daniel Mills
ec43d2012e Schematics 2020-01-03 01:05:10 -05:00
Daniel Mills
e2c8b6ae02 Fix Biomes 2020-01-02 12:41:12 -05:00
Daniel Mills
4ce37da17e Cleanup & Fix seed issues 2020-01-02 12:40:55 -05:00
Daniel Mills
92ce6e5a8d WAAAAAAVVVVVSSSSSS 2020-01-02 01:09:10 -05:00
Daniel Mills
fd16fd2890 Pops 2020-01-01 20:52:10 -05:00
Daniel Mills
9f66725b4a f 2019-11-01 04:45:59 -04:00
Daniel Mills
373d75609a f 2019-11-01 04:27:47 -04:00
Daniel Mills
00d4f7640e v 2019-10-31 07:29:39 -04:00
Daniel Mills
98a26a40b1 f 2019-10-18 13:56:01 -04:00
Daniel Mills
ba84ac56e9 1.12.2 Stupid Speeds 2019-10-17 10:17:06 -04:00
Daniel Mills
05f501a66a f 2019-10-17 09:44:03 -04:00
651 changed files with 95048 additions and 1733 deletions

View File

@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

34
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: Bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots or Video Recordings**
If applicable, add screenshots or video recordings to help explain your problem.
**Server and Plugin Informations**
- Installed plugins:
- Iris Version:
- Server Platform and Version [eg: PaperSpigot 1.16.3 #240]:
- Operating System (if applicable):
- Server Logs:
**Additional context**
Add any other context about the problem here, server timings reports, Iris dump information, complete console log etc. Please do not make Pastebin dumps or screenshot expire.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: Enhancement, Addition
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

126
.gitignore vendored
View File

@@ -1,3 +1,125 @@
/target/
# User-specific stuff
.idea/
lib/
*.iml
*.ipr
*.iws
# IntelliJ
out/
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Package Files #
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.flattened-pom.xml
# Common working directory
run/
.gradle
**/build/
!src/**/build/
# Ignore Gradle GUI config
gradle-app.setting
# Cache of project
.gradletasknamecache
# Custom folders
release/

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Iris</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@@ -1,4 +0,0 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding/<project>=UTF-8

View File

@@ -1,8 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8

View File

@@ -1,4 +0,0 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

BIN
IRIS.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

97
Iris.iml Normal file
View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>SPIGOT</platformType>
<platformType>BUKKIT</platformType>
</autoDetectTypes>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: io.timeandspace:smoothie-map:2.0.2" level="project" />
<orderEntry type="library" name="Maven: io.timeandspace:jpsg-core:1.4" level="project" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.11.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.16-R0.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.26" level="project" />
<orderEntry type="library" name="Maven: io.papermc:paperlib:1.0.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit.craftbukkit:1.16.3:1.16.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit.craftbukkit:1.16.4:1.16.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.bergerkiller.bukkit:BKCommonLib:1.16.4-v2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit:worldedit-bukkit:7.2.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit:worldedit-core:7.2.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit.worldedit-libs:core:7.2.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-profile-default_2.13:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.scala-lang:scala-library:2.13.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-http:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-kernel-spec:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-annotations:2.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:annotations:3.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-cio:2.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-io:2.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-services:2.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-logging:2.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.inject:javax.inject:1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpclient:4.5.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.httpcomponents:httpcore:4.4.12" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-codec:commons-codec:1.11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:jcl-over-slf4j:1.7.28" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-odf:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-comp-zipdriver:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-comp-zip:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bouncycastle:bcprov-jdk15on:1.63" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-tar:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-comp-tardriver:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.commons:commons-compress:1.19" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-tar-bzip2:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-tar-gzip:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-tar-xz:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.tukaani:xz:1.8" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-zip-raes:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-profile-base_2.13:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-access-swing:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-access:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-file:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-jar:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-driver-zip:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-comp-ibm437:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truevfs:truevfs-kernel-impl_2.13:0.12.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-key-console:2.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-key-default:2.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-key-swing:2.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-key-macosx:2.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-key-spec:2.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.truecommons:truecommons-shed:2.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.dev.jna:jna:4.1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.mozilla:rhino-runtime:1.7.12" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.antlr:antlr4-runtime:4.7.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.sk89q.worldedit.worldedit-libs:bukkit:7.2.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.logging.log4j:log4j-slf4j-impl:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.logging.log4j:log4j-api:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bstats:bstats-bukkit:1.7" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: it.unimi.dsi:fastutil:8.2.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: io.lumine.xikage:MythicMobs:4.9.1" level="project" />
<orderEntry type="library" name="Maven: com.github.ben-manes.caffeine:caffeine:2.8.5" level="project" />
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.4.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.5" level="project" />
<orderEntry type="library" name="Maven: org.zeroturnaround:zt-zip:1.14" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.6.6" level="project" />
</component>
</module>

35
LICENSE.md Normal file
View File

@@ -0,0 +1,35 @@
VOLMIT SOFTWARE PUBLIC LICENSE
Version 1.2, 13 March 2021
Copyright :copyright: 2021 Andrew Baker
TERMS AND CONDITIONS
0. Definitions
"License" refers to this file. An updated version is available at <https://github.com/VolmitSoftware/Licenses>. The version at <https://github.com/VolmitSoftware/Licenses> is always correct and up-to-date.
"Author" refers to the person Andrew Baker <andrew@andrewcbaker.net>.
"Repository" refers to the location at which the software protected under this License is stored.
"Content" refers to the files and folders inside of the Repository.
"Copyright" refers to the laws on intellectual property and the legal rights automatically granted to the Author during the creation of the Content.
"Modify" refers to editing the Content as well as creating programs or code which depends on the Content to run.
"Compile" refers to the act of building the Content into an executable file such as a JAR file.
1. You may freely copy, Modify, distribute, create derivative works, or distribute derivative works of the Content as long as you obey the unmodified License that is supplied with the Content.
2. You may not copy, Modify, or distribute the Content in such a way that it will, directly or indirectly, generate revenue without explicit, written permission from the Author.
3. You may not host publicly available download links to Compiled versions of the Content unless you are using less than 5% of the original Content in a Repository of your own.
4. For any conditions not outlined in the License, refer to your country or state laws for Copyright.
5. If you do not agree to any of the above conditions you must delete the Content in its entirety as well as all copies of the Content and derivative works of the Content that you have made.
END TERMS AND CONDITIONS

View File

@@ -1,2 +1,3 @@
# Iris
World Generator
# [Support](https://discord.gg/3xxPTpT) **|** [Documentation](https://docs.volmit.com/iris/) **|** [Git](https://github.com/IrisDimensions)
![Iris Image](https://raw.githubusercontent.com/VolmitSoftware/Iris/master/IRIS.png)

View File

@@ -1,116 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>bytecode.ninja</groupId>
<artifactId>Iris</artifactId>
<name>Iris</name>
<version>1.0</version>
<build>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.yml</include>
<include>**/*.txt</include>
<include>**/*.properties</include>
<include>**/*.html</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>runbatchfile</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>${skip.copy}</skip>
<executable>${project.basedir}/scripts/copy.bat</executable>
<arguments>
<argument>${project.basedir}\target\${project.name}-${project.version}.jar</argument>
<argument>${development.location}</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>pub</id>
<url>http://nexus.mpm.care/content/repositories/pub</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>volmit</id>
<url>http://nexus.volmit.com/content/repositories/volmit</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>commons-lang</artifactId>
<groupId>commons-lang</groupId>
</exclusion>
<exclusion>
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
<exclusion>
<artifactId>bungeecord-chat</artifactId>
<groupId>net.md-5</groupId>
</exclusion>
<exclusion>
<artifactId>snakeyaml</artifactId>
<groupId>org.yaml</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cb</groupId>
<artifactId>craftbukkit-1.14.4</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.14.4.jar</systemPath>
</dependency>
</dependencies>
<properties>
<development.location>${user.home}\Documents\development\server\plugins\${project.name}.jar</development.location>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

201
json/HTTP.java Normal file
View File

@@ -0,0 +1,201 @@
package ninja.bytecode.shuriken.json;
/*
Copyright (c) 2002 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import java.util.Iterator;
/**
* Convert an HTTP header to a JSONObject and back.
*
* @author JSON.org
* @version 2014-05-03
*/
public class HTTP
{
/** Carriage return/line feed. */
public static final String CRLF = "\r\n";
/**
* Convert an HTTP header string into a JSONObject. It can be a request
* header or a response header. A request header will contain
*
* <pre>
* {
* Method: "POST" (for example),
* "Request-URI": "/" (for example),
* "HTTP-Version": "HTTP/1.1" (for example)
* }
* </pre>
*
* A response header will contain
*
* <pre>
* {
* "HTTP-Version": "HTTP/1.1" (for example),
* "Status-Code": "200" (for example),
* "Reason-Phrase": "OK" (for example)
* }
* </pre>
*
* In addition, the other parameters in the header will be captured, using
* the HTTP field names as JSON names, so that
*
* <pre>
* Date: Sun, 26 May 2002 18:06:04 GMT
* Cookie: Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s
* Cache-Control: no-cache
* </pre>
*
* become
*
* <pre>
* {...
* Date: "Sun, 26 May 2002 18:06:04 GMT",
* Cookie: "Q=q2=PPEAsg--; B=677gi6ouf29bn&b=2&f=s",
* "Cache-Control": "no-cache",
* ...}
* </pre>
*
* It does no further checking or conversion. It does not parse dates. It
* does not do '%' transforms on URLs.
*
* @param string
* An HTTP header string.
* @return A JSONObject containing the elements and attributes of the XML
* string.
* @throws JSONException
*/
public static JSONObject toJSONObject(String string) throws JSONException
{
JSONObject jo = new JSONObject();
HTTPTokener x = new HTTPTokener(string);
String token;
token = x.nextToken();
if(token.toUpperCase().startsWith("HTTP"))
{
// Response
jo.put("HTTP-Version", token);
jo.put("Status-Code", x.nextToken());
jo.put("Reason-Phrase", x.nextTo('\0'));
x.next();
} else
{
// Request
jo.put("Method", token);
jo.put("Request-URI", x.nextToken());
jo.put("HTTP-Version", x.nextToken());
}
// Fields
while(x.more())
{
String name = x.nextTo(':');
x.next(':');
jo.put(name, x.nextTo('\0'));
x.next();
}
return jo;
}
/**
* Convert a JSONObject into an HTTP header. A request header must contain
*
* <pre>
* {
* Method: "POST" (for example),
* "Request-URI": "/" (for example),
* "HTTP-Version": "HTTP/1.1" (for example)
* }
* </pre>
*
* A response header must contain
*
* <pre>
* {
* "HTTP-Version": "HTTP/1.1" (for example),
* "Status-Code": "200" (for example),
* "Reason-Phrase": "OK" (for example)
* }
* </pre>
*
* Any other members of the JSONObject will be output as HTTP fields. The
* result will end with two CRLF pairs.
*
* @param jo
* A JSONObject
* @return An HTTP header string.
* @throws JSONException
* if the object does not contain enough information.
*/
public static String toString(JSONObject jo) throws JSONException
{
Iterator<String> keys = jo.keys();
String string;
StringBuilder sb = new StringBuilder();
if(jo.has("Status-Code") && jo.has("Reason-Phrase"))
{
sb.append(jo.getString("HTTP-Version"));
sb.append(' ');
sb.append(jo.getString("Status-Code"));
sb.append(' ');
sb.append(jo.getString("Reason-Phrase"));
} else if(jo.has("Method") && jo.has("Request-URI"))
{
sb.append(jo.getString("Method"));
sb.append(' ');
sb.append('"');
sb.append(jo.getString("Request-URI"));
sb.append('"');
sb.append(' ');
sb.append(jo.getString("HTTP-Version"));
} else
{
throw new JSONException("Not enough material for an HTTP header.");
}
sb.append(CRLF);
while(keys.hasNext())
{
string = keys.next();
if(!"HTTP-Version".equals(string) && !"Status-Code".equals(string) && !"Reason-Phrase".equals(string) && !"Method".equals(string) && !"Request-URI".equals(string) && !jo.isNull(string))
{
sb.append(string);
sb.append(": ");
sb.append(jo.getString(string));
sb.append(CRLF);
}
}
sb.append(CRLF);
return sb.toString();
}
}

91
json/HTTPTokener.java Normal file
View File

@@ -0,0 +1,91 @@
package ninja.bytecode.shuriken.json;
/*
Copyright (c) 2002 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**
* The HTTPTokener extends the JSONTokener to provide additional methods for the
* parsing of HTTP headers.
*
* @author JSON.org
* @version 2014-05-03
*/
public class HTTPTokener extends JSONTokener
{
/**
* Construct an HTTPTokener from a string.
*
* @param string
* A source string.
*/
public HTTPTokener(String string)
{
super(string);
}
/**
* Get the next token or string. This is used in parsing HTTP headers.
*
* @throws JSONException
* @return A String.
*/
public String nextToken() throws JSONException
{
char c;
char q;
StringBuilder sb = new StringBuilder();
do
{
c = next();
} while(Character.isWhitespace(c));
if(c == '"' || c == '\'')
{
q = c;
for(;;)
{
c = next();
if(c < ' ')
{
throw syntaxError("Unterminated string.");
}
if(c == q)
{
return sb.toString();
}
sb.append(c);
}
}
for(;;)
{
if(c == 0 || Character.isWhitespace(c))
{
return sb.toString();
}
sb.append(c);
c = next();
}
}
}

1252
json/JSONArray.java Normal file

File diff suppressed because it is too large Load Diff

50
json/JSONException.java Normal file
View File

@@ -0,0 +1,50 @@
package ninja.bytecode.shuriken.json;
/**
* The JSONException is thrown by the JSON.org classes when things are amiss.
*
* @author JSON.org
* @version 2014-05-03
*/
public class JSONException extends RuntimeException
{
private static final long serialVersionUID = 0;
private Throwable cause;
/**
* Constructs a JSONException with an explanatory message.
*
* @param message
* Detail about the reason for the exception.
*/
public JSONException(String message)
{
super(message);
}
/**
* Constructs a new JSONException with the specified cause.
*
* @param cause
* The cause.
*/
public JSONException(Throwable cause)
{
super(cause.getMessage());
this.cause = cause;
}
/**
* Returns the cause of this exception or null if the cause is nonexistent
* or unknown.
*
* @return the cause of this exception or null if the cause is nonexistent
* or unknown.
*/
@Override
public Throwable getCause()
{
return this.cause;
}
}

555
json/JSONML.java Normal file
View File

@@ -0,0 +1,555 @@
package ninja.bytecode.shuriken.json;
/*
Copyright (c) 2008 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import java.util.Iterator;
/**
* This provides static methods to convert an XML text into a JSONArray or
* JSONObject, and to covert a JSONArray or JSONObject into an XML text using
* the JsonML transform.
*
* @author JSON.org
* @version 2014-05-03
*/
public class JSONML
{
/**
* Parse XML values and store them in a JSONArray.
*
* @param x
* The XMLTokener containing the source string.
* @param arrayForm
* true if array form, false if object form.
* @param ja
* The JSONArray that is containing the current tag or null if we
* are at the outermost level.
* @return A JSONArray if the value is the outermost tag, otherwise null.
* @throws JSONException
*/
private static Object parse(XMLTokener x, boolean arrayForm, JSONArray ja) throws JSONException
{
String attribute;
char c;
String closeTag = null;
int i;
JSONArray newja = null;
JSONObject newjo = null;
Object token;
String tagName = null;
// Test for and skip past these forms:
// <!-- ... -->
// <![ ... ]]>
// <! ... >
// <? ... ?>
while(true)
{
if(!x.more())
{
throw x.syntaxError("Bad XML");
}
token = x.nextContent();
if(token == XML.LT)
{
token = x.nextToken();
if(token instanceof Character)
{
if(token == XML.SLASH)
{
// Close tag </
token = x.nextToken();
if(!(token instanceof String))
{
throw new JSONException("Expected a closing name instead of '" + token + "'.");
}
if(x.nextToken() != XML.GT)
{
throw x.syntaxError("Misshaped close tag");
}
return token;
} else if(token == XML.BANG)
{
// <!
c = x.next();
if(c == '-')
{
if(x.next() == '-')
{
x.skipPast("-->");
} else
{
x.back();
}
} else if(c == '[')
{
token = x.nextToken();
if(token.equals("CDATA") && x.next() == '[')
{
if(ja != null)
{
ja.put(x.nextCDATA());
}
} else
{
throw x.syntaxError("Expected 'CDATA['");
}
} else
{
i = 1;
do
{
token = x.nextMeta();
if(token == null)
{
throw x.syntaxError("Missing '>' after '<!'.");
} else if(token == XML.LT)
{
i += 1;
} else if(token == XML.GT)
{
i -= 1;
}
} while(i > 0);
}
} else if(token == XML.QUEST)
{
// <?
x.skipPast("?>");
} else
{
throw x.syntaxError("Misshaped tag");
}
// Open tag <
} else
{
if(!(token instanceof String))
{
throw x.syntaxError("Bad tagName '" + token + "'.");
}
tagName = (String) token;
newja = new JSONArray();
newjo = new JSONObject();
if(arrayForm)
{
newja.put(tagName);
if(ja != null)
{
ja.put(newja);
}
} else
{
newjo.put("tagName", tagName);
if(ja != null)
{
ja.put(newjo);
}
}
token = null;
for(;;)
{
if(token == null)
{
token = x.nextToken();
}
if(token == null)
{
throw x.syntaxError("Misshaped tag");
}
if(!(token instanceof String))
{
break;
}
// attribute = value
attribute = (String) token;
if(!arrayForm && ("tagName".equals(attribute) || "childNode".equals(attribute)))
{
throw x.syntaxError("Reserved attribute.");
}
token = x.nextToken();
if(token == XML.EQ)
{
token = x.nextToken();
if(!(token instanceof String))
{
throw x.syntaxError("Missing value");
}
newjo.accumulate(attribute, XML.stringToValue((String) token));
token = null;
} else
{
newjo.accumulate(attribute, "");
}
}
if(arrayForm && newjo.length() > 0)
{
newja.put(newjo);
}
// Empty tag <.../>
if(token == XML.SLASH)
{
if(x.nextToken() != XML.GT)
{
throw x.syntaxError("Misshaped tag");
}
if(ja == null)
{
if(arrayForm)
{
return newja;
} else
{
return newjo;
}
}
// Content, between <...> and </...>
} else
{
if(token != XML.GT)
{
throw x.syntaxError("Misshaped tag");
}
closeTag = (String) parse(x, arrayForm, newja);
if(closeTag != null)
{
if(!closeTag.equals(tagName))
{
throw x.syntaxError("Mismatched '" + tagName + "' and '" + closeTag + "'");
}
tagName = null;
if(!arrayForm && newja.length() > 0)
{
newjo.put("childNodes", newja);
}
if(ja == null)
{
if(arrayForm)
{
return newja;
} else
{
return newjo;
}
}
}
}
}
} else
{
if(ja != null)
{
ja.put(token instanceof String ? XML.stringToValue((String) token) : token);
}
}
}
}
/**
* Convert a well-formed (but not necessarily valid) XML string into a
* JSONArray using the JsonML transform. Each XML tag is represented as a
* JSONArray in which the first element is the tag name. If the tag has
* attributes, then the second element will be JSONObject containing the
* name/value pairs. If the tag contains children, then strings and
* JSONArrays will represent the child tags. Comments, prologs, DTDs, and
* <code>&lt;[ [ ]]></code> are ignored.
*
* @param string
* The source string.
* @return A JSONArray containing the structured data from the XML string.
* @throws JSONException
*/
public static JSONArray toJSONArray(String string) throws JSONException
{
return toJSONArray(new XMLTokener(string));
}
/**
* Convert a well-formed (but not necessarily valid) XML string into a
* JSONArray using the JsonML transform. Each XML tag is represented as a
* JSONArray in which the first element is the tag name. If the tag has
* attributes, then the second element will be JSONObject containing the
* name/value pairs. If the tag contains children, then strings and
* JSONArrays will represent the child content and tags. Comments, prologs,
* DTDs, and <code>&lt;[ [ ]]></code> are ignored.
*
* @param x
* An XMLTokener.
* @return A JSONArray containing the structured data from the XML string.
* @throws JSONException
*/
public static JSONArray toJSONArray(XMLTokener x) throws JSONException
{
return (JSONArray) parse(x, true, null);
}
/**
* Convert a well-formed (but not necessarily valid) XML string into a
* JSONObject using the JsonML transform. Each XML tag is represented as a
* JSONObject with a "tagName" property. If the tag has attributes, then the
* attributes will be in the JSONObject as properties. If the tag contains
* children, the object will have a "childNodes" property which will be an
* array of strings and JsonML JSONObjects.
*
* Comments, prologs, DTDs, and <code>&lt;[ [ ]]></code> are ignored.
*
* @param x
* An XMLTokener of the XML source text.
* @return A JSONObject containing the structured data from the XML string.
* @throws JSONException
*/
public static JSONObject toJSONObject(XMLTokener x) throws JSONException
{
return (JSONObject) parse(x, false, null);
}
/**
* Convert a well-formed (but not necessarily valid) XML string into a
* JSONObject using the JsonML transform. Each XML tag is represented as a
* JSONObject with a "tagName" property. If the tag has attributes, then the
* attributes will be in the JSONObject as properties. If the tag contains
* children, the object will have a "childNodes" property which will be an
* array of strings and JsonML JSONObjects.
*
* Comments, prologs, DTDs, and <code>&lt;[ [ ]]></code> are ignored.
*
* @param string
* The XML source text.
* @return A JSONObject containing the structured data from the XML string.
* @throws JSONException
*/
public static JSONObject toJSONObject(String string) throws JSONException
{
return toJSONObject(new XMLTokener(string));
}
/**
* Reverse the JSONML transformation, making an XML text from a JSONArray.
*
* @param ja
* A JSONArray.
* @return An XML string.
* @throws JSONException
*/
public static String toString(JSONArray ja) throws JSONException
{
int i;
JSONObject jo;
String key;
Iterator<String> keys;
int length;
Object object;
StringBuilder sb = new StringBuilder();
String tagName;
String value;
// Emit <tagName
tagName = ja.getString(0);
XML.noSpace(tagName);
tagName = XML.escape(tagName);
sb.append('<');
sb.append(tagName);
object = ja.opt(1);
if(object instanceof JSONObject)
{
i = 2;
jo = (JSONObject) object;
// Emit the attributes
keys = jo.keys();
while(keys.hasNext())
{
key = keys.next();
XML.noSpace(key);
value = jo.optString(key);
if(value != null)
{
sb.append(' ');
sb.append(XML.escape(key));
sb.append('=');
sb.append('"');
sb.append(XML.escape(value));
sb.append('"');
}
}
} else
{
i = 1;
}
// Emit content in body
length = ja.length();
if(i >= length)
{
sb.append('/');
sb.append('>');
} else
{
sb.append('>');
do
{
object = ja.get(i);
i += 1;
if(object != null)
{
if(object instanceof String)
{
sb.append(XML.escape(object.toString()));
} else if(object instanceof JSONObject)
{
sb.append(toString((JSONObject) object));
} else if(object instanceof JSONArray)
{
sb.append(toString((JSONArray) object));
} else
{
sb.append(object.toString());
}
}
} while(i < length);
sb.append('<');
sb.append('/');
sb.append(tagName);
sb.append('>');
}
return sb.toString();
}
/**
* Reverse the JSONML transformation, making an XML text from a JSONObject.
* The JSONObject must contain a "tagName" property. If it has children,
* then it must have a "childNodes" property containing an array of objects.
* The other properties are attributes with string values.
*
* @param jo
* A JSONObject.
* @return An XML string.
* @throws JSONException
*/
public static String toString(JSONObject jo) throws JSONException
{
StringBuilder sb = new StringBuilder();
int i;
JSONArray ja;
String key;
Iterator<String> keys;
int length;
Object object;
String tagName;
String value;
// Emit <tagName
tagName = jo.optString("tagName");
if(tagName == null)
{
return XML.escape(jo.toString());
}
XML.noSpace(tagName);
tagName = XML.escape(tagName);
sb.append('<');
sb.append(tagName);
// Emit the attributes
keys = jo.keys();
while(keys.hasNext())
{
key = keys.next();
if(!"tagName".equals(key) && !"childNodes".equals(key))
{
XML.noSpace(key);
value = jo.optString(key);
if(value != null)
{
sb.append(' ');
sb.append(XML.escape(key));
sb.append('=');
sb.append('"');
sb.append(XML.escape(value));
sb.append('"');
}
}
}
// Emit content in body
ja = jo.optJSONArray("childNodes");
if(ja == null)
{
sb.append('/');
sb.append('>');
} else
{
sb.append('>');
length = ja.length();
for(i = 0; i < length; i += 1)
{
object = ja.get(i);
if(object != null)
{
if(object instanceof String)
{
sb.append(XML.escape(object.toString()));
} else if(object instanceof JSONObject)
{
sb.append(toString((JSONObject) object));
} else if(object instanceof JSONArray)
{
sb.append(toString((JSONArray) object));
} else
{
sb.append(object.toString());
}
}
}
sb.append('<');
sb.append('/');
sb.append(tagName);
sb.append('>');
}
return sb.toString();
}
}

2072
json/JSONObject.java Normal file

File diff suppressed because it is too large Load Diff

21
json/JSONString.java Normal file
View File

@@ -0,0 +1,21 @@
package ninja.bytecode.shuriken.json;
/**
* The <code>JSONString</code> interface allows a <code>toJSONString()</code>
* method so that a class can change the behavior of
* <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>, and
* <code>JSONWriter.value(</code>Object<code>)</code>. The
* <code>toJSONString</code> method will be used instead of the default behavior
* of using the Object's <code>toString()</code> method and quoting the result.
*/
public interface JSONString
{
/**
* The <code>toJSONString</code> method allows a class to produce its own
* JSON serialization.
*
* @return A strictly syntactically correct JSON text.
*/
public String toJSONString();
}

86
json/JSONStringer.java Normal file
View File

@@ -0,0 +1,86 @@
package ninja.bytecode.shuriken.json;
/*
Copyright (c) 2006 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import java.io.StringWriter;
/**
* JSONStringer provides a quick and convenient way of producing JSON text. The
* texts produced strictly conform to JSON syntax rules. No whitespace is added,
* so the results are ready for transmission or storage. Each instance of
* JSONStringer can produce one JSON text.
* <p>
* A JSONStringer instance provides a <code>value</code> method for appending
* values to the text, and a <code>key</code> method for adding keys before
* values in objects. There are <code>array</code> and <code>endArray</code>
* methods that make and bound array values, and <code>object</code> and
* <code>endObject</code> methods which make and bound object values. All of
* these methods return the JSONWriter instance, permitting cascade style. For
* example,
*
* <pre>
* myString = new JSONStringer().object().key("JSON").value("Hello, World!").endObject().toString();
* </pre>
*
* which produces the string
*
* <pre>
* {"JSON":"Hello, World!"}
* </pre>
* <p>
* The first method called must be <code>array</code> or <code>object</code>.
* There are no methods for adding commas or colons. JSONStringer adds them for
* you. Objects and arrays can be nested up to 20 levels deep.
* <p>
* This can sometimes be easier than using a JSONObject to build a string.
*
* @author JSON.org
* @version 2008-09-18
*/
public class JSONStringer extends JSONWriter
{
/**
* Make a fresh JSONStringer. It can be used to build one JSON text.
*/
public JSONStringer()
{
super(new StringWriter());
}
/**
* Return the JSON text. This method is used to obtain the product of the
* JSONStringer instance. It will return <code>null</code> if there was a
* problem in the construction of the JSON text (such as the calls to
* <code>array</code> were not properly balanced with calls to
* <code>endArray</code>).
*
* @return The JSON text.
*/
public String toString()
{
return this.mode == 'd' ? this.writer.toString() : null;
}
}

504
json/JSONTokener.java Normal file
View File

@@ -0,0 +1,504 @@
package ninja.bytecode.shuriken.json;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringReader;
/*
Copyright (c) 2002 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**
* A JSONTokener takes a source string and extracts characters and tokens from
* it. It is used by the JSONObject and JSONArray constructors to parse JSON
* source strings.
*
* @author JSON.org
* @version 2014-05-03
*/
public class JSONTokener
{
private long character;
private boolean eof;
private long index;
private long line;
private char previous;
private Reader reader;
private boolean usePrevious;
/**
* Construct a JSONTokener from a Reader.
*
* @param reader
* A reader.
*/
public JSONTokener(Reader reader)
{
this.reader = reader.markSupported() ? reader : new BufferedReader(reader);
this.eof = false;
this.usePrevious = false;
this.previous = 0;
this.index = 0;
this.character = 1;
this.line = 1;
}
/**
* Construct a JSONTokener from an InputStream.
*
* @param inputStream
* The source.
*/
public JSONTokener(InputStream inputStream) throws JSONException
{
this(new InputStreamReader(inputStream));
}
/**
* Construct a JSONTokener from a string.
*
* @param s
* A source string.
*/
public JSONTokener(String s)
{
this(new StringReader(s));
}
/**
* Back up one character. This provides a sort of lookahead capability, so
* that you can test for a digit or letter before attempting to parse the
* next number or identifier.
*/
public void back() throws JSONException
{
if(this.usePrevious || this.index <= 0)
{
throw new JSONException("Stepping back two steps is not supported");
}
this.index -= 1;
this.character -= 1;
this.usePrevious = true;
this.eof = false;
}
/**
* Get the hex value of a character (base16).
*
* @param c
* A character between '0' and '9' or between 'A' and 'F' or
* between 'a' and 'f'.
* @return An int between 0 and 15, or -1 if c was not a hex digit.
*/
public static int dehexchar(char c)
{
if(c >= '0' && c <= '9')
{
return c - '0';
}
if(c >= 'A' && c <= 'F')
{
return c - ('A' - 10);
}
if(c >= 'a' && c <= 'f')
{
return c - ('a' - 10);
}
return -1;
}
public boolean end()
{
return this.eof && !this.usePrevious;
}
/**
* Determine if the source string still contains characters that next() can
* consume.
*
* @return true if not yet at the end of the source.
*/
public boolean more() throws JSONException
{
this.next();
if(this.end())
{
return false;
}
this.back();
return true;
}
/**
* Get the next character in the source string.
*
* @return The next character, or 0 if past the end of the source string.
*/
public char next() throws JSONException
{
int c;
if(this.usePrevious)
{
this.usePrevious = false;
c = this.previous;
} else
{
try
{
c = this.reader.read();
} catch(IOException exception)
{
throw new JSONException(exception);
}
if(c <= 0)
{ // End of stream
this.eof = true;
c = 0;
}
}
this.index += 1;
if(this.previous == '\r')
{
this.line += 1;
this.character = c == '\n' ? 0 : 1;
} else if(c == '\n')
{
this.line += 1;
this.character = 0;
} else
{
this.character += 1;
}
this.previous = (char) c;
return this.previous;
}
/**
* Consume the next character, and check that it matches a specified
* character.
*
* @param c
* The character to match.
* @return The character.
* @throws JSONException
* if the character does not match.
*/
public char next(char c) throws JSONException
{
char n = this.next();
if(n != c)
{
throw this.syntaxError("Expected '" + c + "' and instead saw '" + n + "'");
}
return n;
}
/**
* Get the next n characters.
*
* @param n
* The number of characters to take.
* @return A string of n characters.
* @throws JSONException
* Substring bounds error if there are not n characters
* remaining in the source string.
*/
public String next(int n) throws JSONException
{
if(n == 0)
{
return "";
}
char[] chars = new char[n];
int pos = 0;
while(pos < n)
{
chars[pos] = this.next();
if(this.end())
{
throw this.syntaxError("Substring bounds error");
}
pos += 1;
}
return new String(chars);
}
/**
* Get the next char in the string, skipping whitespace.
*
* @throws JSONException
* @return A character, or 0 if there are no more characters.
*/
public char nextClean() throws JSONException
{
for(;;)
{
char c = this.next();
if(c == 0 || c > ' ')
{
return c;
}
}
}
/**
* Return the characters up to the next close quote character. Backslash
* processing is done. The formal JSON format does not allow strings in
* single quotes, but an implementation is allowed to accept them.
*
* @param quote
* The quoting character, either <code>"</code>&nbsp;
* <small>(double quote)</small> or <code>'</code>&nbsp;
* <small>(single quote)</small>.
* @return A String.
* @throws JSONException
* Unterminated string.
*/
public String nextString(char quote) throws JSONException
{
char c;
StringBuilder sb = new StringBuilder();
for(;;)
{
c = this.next();
switch(c)
{
case 0:
case '\n':
case '\r':
throw this.syntaxError("Unterminated string");
case '\\':
c = this.next();
switch(c)
{
case 'b':
sb.append('\b');
break;
case 't':
sb.append('\t');
break;
case 'n':
sb.append('\n');
break;
case 'f':
sb.append('\f');
break;
case 'r':
sb.append('\r');
break;
case 'u':
sb.append((char) Integer.parseInt(this.next(4), 16));
break;
case '"':
case '\'':
case '\\':
case '/':
sb.append(c);
break;
default:
throw this.syntaxError("Illegal escape.");
}
break;
default:
if(c == quote)
{
return sb.toString();
}
sb.append(c);
}
}
}
/**
* Get the text up but not including the specified character or the end of
* line, whichever comes first.
*
* @param delimiter
* A delimiter character.
* @return A string.
*/
public String nextTo(char delimiter) throws JSONException
{
StringBuilder sb = new StringBuilder();
for(;;)
{
char c = this.next();
if(c == delimiter || c == 0 || c == '\n' || c == '\r')
{
if(c != 0)
{
this.back();
}
return sb.toString().trim();
}
sb.append(c);
}
}
/**
* Get the text up but not including one of the specified delimiter
* characters or the end of line, whichever comes first.
*
* @param delimiters
* A set of delimiter characters.
* @return A string, trimmed.
*/
public String nextTo(String delimiters) throws JSONException
{
char c;
StringBuilder sb = new StringBuilder();
for(;;)
{
c = this.next();
if(delimiters.indexOf(c) >= 0 || c == 0 || c == '\n' || c == '\r')
{
if(c != 0)
{
this.back();
}
return sb.toString().trim();
}
sb.append(c);
}
}
/**
* Get the next value. The value can be a Boolean, Double, Integer,
* JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object.
*
* @throws JSONException
* If syntax error.
*
* @return An object.
*/
public Object nextValue() throws JSONException
{
char c = this.nextClean();
String string;
switch(c)
{
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
case '[':
this.back();
return new JSONArray(this);
}
/*
* Handle unquoted text. This could be the values true, false, or null,
* or it can be a number. An implementation (such as this one) is
* allowed to also accept non-standard forms.
*
* Accumulate characters until we reach the end of the text or a
* formatting character.
*/
StringBuilder sb = new StringBuilder();
while(c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0)
{
sb.append(c);
c = this.next();
}
this.back();
string = sb.toString().trim();
if("".equals(string))
{
throw this.syntaxError("Missing value");
}
return JSONObject.stringToValue(string);
}
/**
* Skip characters until the next character is the requested character. If
* the requested character is not found, no characters are skipped.
*
* @param to
* A character to skip to.
* @return The requested character, or zero if the requested character is
* not found.
*/
public char skipTo(char to) throws JSONException
{
char c;
try
{
long startIndex = this.index;
long startCharacter = this.character;
long startLine = this.line;
this.reader.mark(1000000);
do
{
c = this.next();
if(c == 0)
{
this.reader.reset();
this.index = startIndex;
this.character = startCharacter;
this.line = startLine;
return c;
}
} while(c != to);
} catch(IOException exception)
{
throw new JSONException(exception);
}
this.back();
return c;
}
/**
* Make a JSONException to signal a syntax error.
*
* @param message
* The error message.
* @return A JSONException object, suitable for throwing
*/
public JSONException syntaxError(String message)
{
return new JSONException(message + this.toString());
}
/**
* Make a printable string of this JSONTokener.
*
* @return " at {index} [character {character} line {line}]"
*/
public String toString()
{
return " at " + this.index + " [character " + this.character + " line " + this.line + "]";
}
}

388
json/JSONWriter.java Normal file
View File

@@ -0,0 +1,388 @@
package ninja.bytecode.shuriken.json;
import java.io.IOException;
import java.io.Writer;
/*
Copyright (c) 2006 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**
* JSONWriter provides a quick and convenient way of producing JSON text. The
* texts produced strictly conform to JSON syntax rules. No whitespace is added,
* so the results are ready for transmission or storage. Each instance of
* JSONWriter can produce one JSON text.
* <p>
* A JSONWriter instance provides a <code>value</code> method for appending
* values to the text, and a <code>key</code> method for adding keys before
* values in objects. There are <code>array</code> and <code>endArray</code>
* methods that make and bound array values, and <code>object</code> and
* <code>endObject</code> methods which make and bound object values. All of
* these methods return the JSONWriter instance, permitting a cascade style. For
* example,
*
* <pre>
* new JSONWriter(myWriter).object().key("JSON").value("Hello, World!").endObject();
* </pre>
*
* which writes
*
* <pre>
* {"JSON":"Hello, World!"}
* </pre>
* <p>
* The first method called must be <code>array</code> or <code>object</code>.
* There are no methods for adding commas or colons. JSONWriter adds them for
* you. Objects and arrays can be nested up to 20 levels deep.
* <p>
* This can sometimes be easier than using a JSONObject to build a string.
*
* @author JSON.org
* @version 2011-11-24
*/
public class JSONWriter
{
private static final int maxdepth = 200;
/**
* The comma flag determines if a comma should be output before the next
* value.
*/
private boolean comma;
/**
* The current mode. Values: 'a' (array), 'd' (done), 'i' (initial), 'k'
* (key), 'o' (object).
*/
protected char mode;
/**
* The object/array stack.
*/
private final JSONObject stack[];
/**
* The stack top index. A value of 0 indicates that the stack is empty.
*/
private int top;
/**
* The writer that will receive the output.
*/
protected Writer writer;
/**
* Make a fresh JSONWriter. It can be used to build one JSON text.
*/
public JSONWriter(Writer w)
{
this.comma = false;
this.mode = 'i';
this.stack = new JSONObject[maxdepth];
this.top = 0;
this.writer = w;
}
/**
* Append a value.
*
* @param string
* A string value.
* @return this
* @throws JSONException
* If the value is out of sequence.
*/
private JSONWriter append(String string) throws JSONException
{
if(string == null)
{
throw new JSONException("Null pointer");
}
if(this.mode == 'o' || this.mode == 'a')
{
try
{
if(this.comma && this.mode == 'a')
{
this.writer.write(',');
}
this.writer.write(string);
} catch(IOException e)
{
throw new JSONException(e);
}
if(this.mode == 'o')
{
this.mode = 'k';
}
this.comma = true;
return this;
}
throw new JSONException("Value out of sequence.");
}
/**
* Begin appending a new array. All values until the balancing
* <code>endArray</code> will be appended to this array. The
* <code>endArray</code> method must be called to mark the array's end.
*
* @return this
* @throws JSONException
* If the nesting is too deep, or if the object is started in
* the wrong place (for example as a key or after the end of the
* outermost array or object).
*/
public JSONWriter array() throws JSONException
{
if(this.mode == 'i' || this.mode == 'o' || this.mode == 'a')
{
this.push(null);
this.append("[");
this.comma = false;
return this;
}
throw new JSONException("Misplaced array.");
}
/**
* End something.
*
* @param mode
* Mode
* @param c
* Closing character
* @return this
* @throws JSONException
* If unbalanced.
*/
private JSONWriter end(char mode, char c) throws JSONException
{
if(this.mode != mode)
{
throw new JSONException(mode == 'a' ? "Misplaced endArray." : "Misplaced endObject.");
}
this.pop(mode);
try
{
this.writer.write(c);
} catch(IOException e)
{
throw new JSONException(e);
}
this.comma = true;
return this;
}
/**
* End an array. This method most be called to balance calls to
* <code>array</code>.
*
* @return this
* @throws JSONException
* If incorrectly nested.
*/
public JSONWriter endArray() throws JSONException
{
return this.end('a', ']');
}
/**
* End an object. This method most be called to balance calls to
* <code>object</code>.
*
* @return this
* @throws JSONException
* If incorrectly nested.
*/
public JSONWriter endObject() throws JSONException
{
return this.end('k', '}');
}
/**
* Append a key. The key will be associated with the next value. In an
* object, every value must be preceded by a key.
*
* @param string
* A key string.
* @return this
* @throws JSONException
* If the key is out of place. For example, keys do not belong
* in arrays or if the key is null.
*/
public JSONWriter key(String string) throws JSONException
{
if(string == null)
{
throw new JSONException("Null key.");
}
if(this.mode == 'k')
{
try
{
this.stack[this.top - 1].putOnce(string, Boolean.TRUE);
if(this.comma)
{
this.writer.write(',');
}
this.writer.write(JSONObject.quote(string));
this.writer.write(':');
this.comma = false;
this.mode = 'o';
return this;
} catch(IOException e)
{
throw new JSONException(e);
}
}
throw new JSONException("Misplaced key.");
}
/**
* Begin appending a new object. All keys and values until the balancing
* <code>endObject</code> will be appended to this object. The
* <code>endObject</code> method must be called to mark the object's end.
*
* @return this
* @throws JSONException
* If the nesting is too deep, or if the object is started in
* the wrong place (for example as a key or after the end of the
* outermost array or object).
*/
public JSONWriter object() throws JSONException
{
if(this.mode == 'i')
{
this.mode = 'o';
}
if(this.mode == 'o' || this.mode == 'a')
{
this.append("{");
this.push(new JSONObject());
this.comma = false;
return this;
}
throw new JSONException("Misplaced object.");
}
/**
* Pop an array or object scope.
*
* @param c
* The scope to close.
* @throws JSONException
* If nesting is wrong.
*/
private void pop(char c) throws JSONException
{
if(this.top <= 0)
{
throw new JSONException("Nesting error.");
}
char m = this.stack[this.top - 1] == null ? 'a' : 'k';
if(m != c)
{
throw new JSONException("Nesting error.");
}
this.top -= 1;
this.mode = this.top == 0 ? 'd' : this.stack[this.top - 1] == null ? 'a' : 'k';
}
/**
* Push an array or object scope.
*
* @param jo
* The scope to open.
* @throws JSONException
* If nesting is too deep.
*/
private void push(JSONObject jo) throws JSONException
{
if(this.top >= maxdepth)
{
throw new JSONException("Nesting too deep.");
}
this.stack[this.top] = jo;
this.mode = jo == null ? 'a' : 'k';
this.top += 1;
}
/**
* Append either the value <code>true</code> or the value <code>false</code>
* .
*
* @param b
* A boolean.
* @return this
* @throws JSONException
*/
public JSONWriter value(boolean b) throws JSONException
{
return this.append(b ? "true" : "false");
}
/**
* Append a double value.
*
* @param d
* A double.
* @return this
* @throws JSONException
* If the number is not finite.
*/
public JSONWriter value(double d) throws JSONException
{
return this.value(new Double(d));
}
/**
* Append a long value.
*
* @param l
* A long.
* @return this
* @throws JSONException
*/
public JSONWriter value(long l) throws JSONException
{
return this.append(Long.toString(l));
}
/**
* Append an object value.
*
* @param object
* The object to append. It can be null, or a Boolean, Number,
* String, JSONObject, or JSONArray, or an object that implements
* JSONString.
* @return this
* @throws JSONException
* If the value is out of sequence.
*/
public JSONWriter value(Object object) throws JSONException
{
return this.append(JSONObject.valueToString(object));
}
}

584
json/XML.java Normal file
View File

@@ -0,0 +1,584 @@
package ninja.bytecode.shuriken.json;
/*
Copyright (c) 2002 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import java.util.Iterator;
/**
* This provides static methods to convert an XML text into a JSONObject, and to
* covert a JSONObject into an XML text.
*
* @author JSON.org
* @version 2014-05-03
*/
public class XML
{
/** The Character '&amp;'. */
public static final Character AMP = '&';
/** The Character '''. */
public static final Character APOS = '\'';
/** The Character '!'. */
public static final Character BANG = '!';
/** The Character '='. */
public static final Character EQ = '=';
/** The Character '>'. */
public static final Character GT = '>';
/** The Character '&lt;'. */
public static final Character LT = '<';
/** The Character '?'. */
public static final Character QUEST = '?';
/** The Character '"'. */
public static final Character QUOT = '"';
/** The Character '/'. */
public static final Character SLASH = '/';
/**
* Replace special characters with XML escapes:
*
* <pre>
* &amp; <small>(ampersand)</small> is replaced by &amp;amp;
* &lt; <small>(less than)</small> is replaced by &amp;lt;
* &gt; <small>(greater than)</small> is replaced by &amp;gt;
* &quot; <small>(double quote)</small> is replaced by &amp;quot;
* </pre>
*
* @param string
* The string to be escaped.
* @return The escaped string.
*/
public static String escape(String string)
{
StringBuilder sb = new StringBuilder(string.length());
for(int i = 0, length = string.length(); i < length; i++)
{
char c = string.charAt(i);
switch(c)
{
case '&':
sb.append("&amp;");
break;
case '<':
sb.append("&lt;");
break;
case '>':
sb.append("&gt;");
break;
case '"':
sb.append("&quot;");
break;
case '\'':
sb.append("&apos;");
break;
default:
sb.append(c);
}
}
return sb.toString();
}
/**
* Throw an exception if the string contains whitespace. Whitespace is not
* allowed in tagNames and attributes.
*
* @param string
* A string.
* @throws JSONException
*/
public static void noSpace(String string) throws JSONException
{
int i, length = string.length();
if(length == 0)
{
throw new JSONException("Empty string.");
}
for(i = 0; i < length; i += 1)
{
if(Character.isWhitespace(string.charAt(i)))
{
throw new JSONException("'" + string + "' contains a space character.");
}
}
}
/**
* Scan the content following the named tag, attaching it to the context.
*
* @param x
* The XMLTokener containing the source string.
* @param context
* The JSONObject that will include the new material.
* @param name
* The tag name.
* @return true if the close tag is processed.
* @throws JSONException
*/
private static boolean parse(XMLTokener x, JSONObject context, String name) throws JSONException
{
char c;
int i;
JSONObject jsonobject = null;
String string;
String tagName;
Object token;
// Test for and skip past these forms:
// <!-- ... -->
// <! ... >
// <![ ... ]]>
// <? ... ?>
// Report errors for these forms:
// <>
// <=
// <<
token = x.nextToken();
// <!
if(token == BANG)
{
c = x.next();
if(c == '-')
{
if(x.next() == '-')
{
x.skipPast("-->");
return false;
}
x.back();
} else if(c == '[')
{
token = x.nextToken();
if("CDATA".equals(token))
{
if(x.next() == '[')
{
string = x.nextCDATA();
if(string.length() > 0)
{
context.accumulate("content", string);
}
return false;
}
}
throw x.syntaxError("Expected 'CDATA['");
}
i = 1;
do
{
token = x.nextMeta();
if(token == null)
{
throw x.syntaxError("Missing '>' after '<!'.");
} else if(token == LT)
{
i += 1;
} else if(token == GT)
{
i -= 1;
}
} while(i > 0);
return false;
} else if(token == QUEST)
{
// <?
x.skipPast("?>");
return false;
} else if(token == SLASH)
{
// Close tag </
token = x.nextToken();
if(name == null)
{
throw x.syntaxError("Mismatched close tag " + token);
}
if(!token.equals(name))
{
throw x.syntaxError("Mismatched " + name + " and " + token);
}
if(x.nextToken() != GT)
{
throw x.syntaxError("Misshaped close tag");
}
return true;
} else if(token instanceof Character)
{
throw x.syntaxError("Misshaped tag");
// Open tag <
} else
{
tagName = (String) token;
token = null;
jsonobject = new JSONObject();
for(;;)
{
if(token == null)
{
token = x.nextToken();
}
// attribute = value
if(token instanceof String)
{
string = (String) token;
token = x.nextToken();
if(token == EQ)
{
token = x.nextToken();
if(!(token instanceof String))
{
throw x.syntaxError("Missing value");
}
jsonobject.accumulate(string, XML.stringToValue((String) token));
token = null;
} else
{
jsonobject.accumulate(string, "");
}
// Empty tag <.../>
} else if(token == SLASH)
{
if(x.nextToken() != GT)
{
throw x.syntaxError("Misshaped tag");
}
if(jsonobject.length() > 0)
{
context.accumulate(tagName, jsonobject);
} else
{
context.accumulate(tagName, "");
}
return false;
// Content, between <...> and </...>
} else if(token == GT)
{
for(;;)
{
token = x.nextContent();
if(token == null)
{
if(tagName != null)
{
throw x.syntaxError("Unclosed tag " + tagName);
}
return false;
} else if(token instanceof String)
{
string = (String) token;
if(string.length() > 0)
{
jsonobject.accumulate("content", XML.stringToValue(string));
}
// Nested element
} else if(token == LT)
{
if(parse(x, jsonobject, tagName))
{
if(jsonobject.length() == 0)
{
context.accumulate(tagName, "");
} else if(jsonobject.length() == 1 && jsonobject.opt("content") != null)
{
context.accumulate(tagName, jsonobject.opt("content"));
} else
{
context.accumulate(tagName, jsonobject);
}
return false;
}
}
}
} else
{
throw x.syntaxError("Misshaped tag");
}
}
}
}
/**
* Try to convert a string into a number, boolean, or null. If the string
* can't be converted, return the string. This is much less ambitious than
* JSONObject.stringToValue, especially because it does not attempt to
* convert plus forms, octal forms, hex forms, or E forms lacking decimal
* points.
*
* @param string
* A String.
* @return A simple JSON value.
*/
public static Object stringToValue(String string)
{
if("true".equalsIgnoreCase(string))
{
return Boolean.TRUE;
}
if("false".equalsIgnoreCase(string))
{
return Boolean.FALSE;
}
if("null".equalsIgnoreCase(string))
{
return JSONObject.NULL;
}
// If it might be a number, try converting it, first as a Long, and then
// as a
// Double. If that doesn't work, return the string.
try
{
char initial = string.charAt(0);
if(initial == '-' || (initial >= '0' && initial <= '9'))
{
Long value = new Long(string);
if(value.toString().equals(string))
{
return value;
}
}
} catch(Exception ignore)
{
try
{
Double value = new Double(string);
if(value.toString().equals(string))
{
return value;
}
} catch(Exception ignoreAlso)
{
}
}
return string;
}
/**
* Convert a well-formed (but not necessarily valid) XML string into a
* JSONObject. Some information may be lost in this transformation because
* JSON is a data format and XML is a document format. XML uses elements,
* attributes, and content text, while JSON uses unordered collections of
* name/value pairs and arrays of values. JSON does not does not like to
* distinguish between elements and attributes. Sequences of similar
* elements are represented as JSONArrays. Content text may be placed in a
* "content" member. Comments, prologs, DTDs, and <code>&lt;[ [ ]]></code>
* are ignored.
*
* @param string
* The source string.
* @return A JSONObject containing the structured data from the XML string.
* @throws JSONException
*/
public static JSONObject toJSONObject(String string) throws JSONException
{
JSONObject jo = new JSONObject();
XMLTokener x = new XMLTokener(string);
while(x.more() && x.skipPast("<"))
{
parse(x, jo, null);
}
return jo;
}
/**
* Convert a JSONObject into a well-formed, element-normal XML string.
*
* @param object
* A JSONObject.
* @return A string.
* @throws JSONException
*/
public static String toString(Object object) throws JSONException
{
return toString(object, null);
}
/**
* Convert a JSONObject into a well-formed, element-normal XML string.
*
* @param object
* A JSONObject.
* @param tagName
* The optional name of the enclosing tag.
* @return A string.
* @throws JSONException
*/
public static String toString(Object object, String tagName) throws JSONException
{
StringBuilder sb = new StringBuilder();
int i;
JSONArray ja;
JSONObject jo;
String key;
Iterator<String> keys;
int length;
String string;
Object value;
if(object instanceof JSONObject)
{
// Emit <tagName>
if(tagName != null)
{
sb.append('<');
sb.append(tagName);
sb.append('>');
}
// Loop thru the keys.
jo = (JSONObject) object;
keys = jo.keys();
while(keys.hasNext())
{
key = keys.next();
value = jo.opt(key);
if(value == null)
{
value = "";
}
string = value instanceof String ? (String) value : null;
// Emit content in body
if("content".equals(key))
{
if(value instanceof JSONArray)
{
ja = (JSONArray) value;
length = ja.length();
for(i = 0; i < length; i += 1)
{
if(i > 0)
{
sb.append('\n');
}
sb.append(escape(ja.get(i).toString()));
}
} else
{
sb.append(escape(value.toString()));
}
// Emit an array of similar keys
} else if(value instanceof JSONArray)
{
ja = (JSONArray) value;
length = ja.length();
for(i = 0; i < length; i += 1)
{
value = ja.get(i);
if(value instanceof JSONArray)
{
sb.append('<');
sb.append(key);
sb.append('>');
sb.append(toString(value));
sb.append("</");
sb.append(key);
sb.append('>');
} else
{
sb.append(toString(value, key));
}
}
} else if("".equals(value))
{
sb.append('<');
sb.append(key);
sb.append("/>");
// Emit a new tag <k>
} else
{
sb.append(toString(value, key));
}
}
if(tagName != null)
{
// Emit the </tagname> close tag
sb.append("</");
sb.append(tagName);
sb.append('>');
}
return sb.toString();
// XML does not have good support for arrays. If an array appears in
// a place
// where XML is lacking, synthesize an <array> element.
} else
{
if(object.getClass().isArray())
{
object = new JSONArray(object);
}
if(object instanceof JSONArray)
{
ja = (JSONArray) object;
length = ja.length();
for(i = 0; i < length; i += 1)
{
sb.append(toString(ja.opt(i), tagName == null ? "array" : tagName));
}
return sb.toString();
} else
{
string = (object == null) ? "null" : escape(object.toString());
return (tagName == null) ? "\"" + string + "\"" : (string.length() == 0) ? "<" + tagName + "/>" : "<" + tagName + ">" + string + "</" + tagName + ">";
}
}
}
}

425
json/XMLTokener.java Normal file
View File

@@ -0,0 +1,425 @@
package ninja.bytecode.shuriken.json;
/*
Copyright (c) 2002 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**
* The XMLTokener extends the JSONTokener to provide additional methods for the
* parsing of XML texts.
*
* @author JSON.org
* @version 2014-05-03
*/
public class XMLTokener extends JSONTokener
{
/**
* The table of entity values. It initially contains Character values for
* amp, apos, gt, lt, quot.
*/
public static final java.util.HashMap<String, Character> entity;
static
{
entity = new java.util.HashMap<String, Character>(8);
entity.put("amp", XML.AMP);
entity.put("apos", XML.APOS);
entity.put("gt", XML.GT);
entity.put("lt", XML.LT);
entity.put("quot", XML.QUOT);
}
/**
* Construct an XMLTokener from a string.
*
* @param s
* A source string.
*/
public XMLTokener(String s)
{
super(s);
}
/**
* Get the text in the CDATA block.
*
* @return The string up to the <code>]]&gt;</code>.
* @throws JSONException
* If the <code>]]&gt;</code> is not found.
*/
public String nextCDATA() throws JSONException
{
char c;
int i;
StringBuilder sb = new StringBuilder();
for(;;)
{
c = next();
if(end())
{
throw syntaxError("Unclosed CDATA");
}
sb.append(c);
i = sb.length() - 3;
if(i >= 0 && sb.charAt(i) == ']' && sb.charAt(i + 1) == ']' && sb.charAt(i + 2) == '>')
{
sb.setLength(i);
return sb.toString();
}
}
}
/**
* Get the next XML outer token, trimming whitespace. There are two kinds of
* tokens: the '<' character which begins a markup tag, and the content text
* between markup tags.
*
* @return A string, or a '<' Character, or null if there is no more source
* text.
* @throws JSONException
*/
public Object nextContent() throws JSONException
{
char c;
StringBuilder sb;
do
{
c = next();
} while(Character.isWhitespace(c));
if(c == 0)
{
return null;
}
if(c == '<')
{
return XML.LT;
}
sb = new StringBuilder();
for(;;)
{
if(c == '<' || c == 0)
{
back();
return sb.toString().trim();
}
if(c == '&')
{
sb.append(nextEntity(c));
} else
{
sb.append(c);
}
c = next();
}
}
/**
* Return the next entity. These entities are translated to Characters:
* <code>&amp; &apos; &gt; &lt; &quot;</code>.
*
* @param ampersand
* An ampersand character.
* @return A Character or an entity String if the entity is not recognized.
* @throws JSONException
* If missing ';' in XML entity.
*/
public Object nextEntity(char ampersand) throws JSONException
{
StringBuilder sb = new StringBuilder();
for(;;)
{
char c = next();
if(Character.isLetterOrDigit(c) || c == '#')
{
sb.append(Character.toLowerCase(c));
} else if(c == ';')
{
break;
} else
{
throw syntaxError("Missing ';' in XML entity: &" + sb);
}
}
String string = sb.toString();
Object object = entity.get(string);
return object != null ? object : ampersand + string + ";";
}
/**
* Returns the next XML meta token. This is used for skipping over
* <!...> and <?...?> structures.
*
* @return Syntax characters (<code>< > / = ! ?</code>) are returned as
* Character, and strings and names are returned as Boolean. We
* don't care what the values actually are.
* @throws JSONException
* If a string is not properly closed or if the XML is badly
* structured.
*/
public Object nextMeta() throws JSONException
{
char c;
char q;
do
{
c = next();
} while(Character.isWhitespace(c));
switch(c)
{
case 0:
throw syntaxError("Misshaped meta tag");
case '<':
return XML.LT;
case '>':
return XML.GT;
case '/':
return XML.SLASH;
case '=':
return XML.EQ;
case '!':
return XML.BANG;
case '?':
return XML.QUEST;
case '"':
case '\'':
q = c;
for(;;)
{
c = next();
if(c == 0)
{
throw syntaxError("Unterminated string");
}
if(c == q)
{
return Boolean.TRUE;
}
}
default:
for(;;)
{
c = next();
if(Character.isWhitespace(c))
{
return Boolean.TRUE;
}
switch(c)
{
case 0:
case '<':
case '>':
case '/':
case '=':
case '!':
case '?':
case '"':
case '\'':
back();
return Boolean.TRUE;
}
}
}
}
/**
* Get the next XML Token. These tokens are found inside of angle brackets.
* It may be one of these characters: <code>/ > = ! ?</code> or it may be a
* string wrapped in single quotes or double quotes, or it may be a name.
*
* @return a String or a Character.
* @throws JSONException
* If the XML is not well formed.
*/
public Object nextToken() throws JSONException
{
char c;
char q;
StringBuilder sb;
do
{
c = next();
} while(Character.isWhitespace(c));
switch(c)
{
case 0:
throw syntaxError("Misshaped element");
case '<':
throw syntaxError("Misplaced '<'");
case '>':
return XML.GT;
case '/':
return XML.SLASH;
case '=':
return XML.EQ;
case '!':
return XML.BANG;
case '?':
return XML.QUEST;
// Quoted string
case '"':
case '\'':
q = c;
sb = new StringBuilder();
for(;;)
{
c = next();
if(c == 0)
{
throw syntaxError("Unterminated string");
}
if(c == q)
{
return sb.toString();
}
if(c == '&')
{
sb.append(nextEntity(c));
} else
{
sb.append(c);
}
}
default:
// Name
sb = new StringBuilder();
for(;;)
{
sb.append(c);
c = next();
if(Character.isWhitespace(c))
{
return sb.toString();
}
switch(c)
{
case 0:
return sb.toString();
case '>':
case '/':
case '=':
case '!':
case '?':
case '[':
case ']':
back();
return sb.toString();
case '<':
case '"':
case '\'':
throw syntaxError("Bad character in a name");
}
}
}
}
/**
* Skip characters until past the requested string. If it is not found, we
* are left at the end of the source with a result of false.
*
* @param to
* A string to skip past.
* @throws JSONException
*/
public boolean skipPast(String to) throws JSONException
{
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
/*
* First fill the circle buffer with as many characters as are in the to
* string. If we reach an early end, bail.
*/
for(i = 0; i < length; i += 1)
{
c = next();
if(c == 0)
{
return false;
}
circle[i] = c;
}
/* We will loop, possibly for all of the remaining characters. */
for(;;)
{
j = offset;
b = true;
/* Compare the circle buffer with the to string. */
for(i = 0; i < length; i += 1)
{
if(circle[j] != to.charAt(i))
{
b = false;
break;
}
j += 1;
if(j >= length)
{
j -= length;
}
}
/* If we exit the loop with b intact, then victory is ours. */
if(b)
{
return true;
}
/*
* Get the next character. If there isn't one, then defeat is ours.
*/
c = next();
if(c == 0)
{
return false;
}
/*
* Shove the character in the circle buffer and advance the circle
* offset. The offset is mod n.
*/
circle[offset] = c;
offset += 1;
if(offset >= length)
{
offset -= length;
}
}
}
}

8
listing.json Normal file
View File

@@ -0,0 +1,8 @@
[
"overworld IrisDimensions/overworld",
"vanilla IrisDimensions/vanilla",
"flat IrisDimensions/flat",
"redstone IrisDimensions/redstone",
"mars IrisDimensions/mars",
"example IrisDimensions/example"
]

3
packignore.ignore Normal file
View File

@@ -0,0 +1,3 @@
.DS_Store
*.code-workspace
*.txt

69
plains.json Normal file
View File

@@ -0,0 +1,69 @@
{
"children": [],
"decorators": [],
"objects": [],
"name": "Plains",
"layers": [
{
"minHeight": 1,
"terrainZoom": 5,
"maxHeight": 3,
"palette": [
"GRASS_BLOCK"
],
"dispersion": "SCATTER"
},
{
"minHeight": 1,
"terrainZoom": 5,
"maxHeight": 1,
"palette": [
"DIRT"
],
"dispersion": "SCATTER"
},
{
"minHeight": 1,
"terrainZoom": 5,
"maxHeight": 3,
"palette": [
"DIRT",
"COARSE_DIRT"
],
"dispersion": "SCATTER"
},
{
"minHeight": 6,
"terrainZoom": 5,
"maxHeight": 2341,
"palette": [
"STONE",
"ANDESITE",
"STONE"
],
"dispersion": "SCATTER"
}
],
"childShrinkFactor": 1.55,
"derivative": "THE_VOID",
"auxiliaryGenerators": [
{
"offsetX": 0,
"offsetZ": 0.01,
"min": 1,
"seed": 1336,
"max": 5,
"zoom": 3.065
},
{
"offsetX": 0,
"offsetZ": 0,
"min": 1.01,
"seed": 1339,
"max": 2,
"zoom": 1.6
}
],
"highHeight": 3.66669,
"lowHeight": 31.5
}

118
pom.xml
View File

@@ -2,15 +2,16 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>bytecode.ninja</groupId>
<groupId>com.volmit</groupId>
<artifactId>Iris</artifactId>
<version>1.0</version>
<version>1.3.3</version>
<name>Iris</name>
<properties>
<skip.copy>false</skip.copy>
<secretary.build>package</secretary.build>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<development.location>${user.home}\Documents\development\server\plugins\${project.name}.jar</development.location>
</properties>
<build>
<resources>
@@ -22,7 +23,7 @@
<include>**/*.yml</include>
<include>**/*.txt</include>
<include>**/*.properties</include>
<include>**/*.html</include>
<include>**/*.json</include>
</includes>
</resource>
</resources>
@@ -38,67 +39,102 @@
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<minimizeJar>false</minimizeJar>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>runbatchfile</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<skip>${skip.copy}</skip>
<executable>${project.basedir}/scripts/copy.bat</executable>
<arguments>
<argument>${project.basedir}\target\${project.name}-${project.version}.jar</argument>
<argument>${development.location}</argument>
</arguments>
<compilerVersion>1.8</compilerVersion>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>pub</id>
<url>http://nexus.mpm.care/content/repositories/pub</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>volmit</id>
<url>http://nexus.volmit.com/content/repositories/volmit</url>
<url>http://repo.volmit.com/repository/volmit/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>ninja.bytecode</groupId>
<artifactId>Shuriken</artifactId>
<version>1.0</version>
<groupId>io.timeandspace</groupId>
<artifactId>smoothie-map</artifactId>
<version>2.0.2</version>
</dependency>
<!-- Spigot API -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- Paper API -->
<dependency>
<groupId>io.papermc</groupId>
<artifactId>paperlib</artifactId>
<version>1.0.5</version>
<scope>compile</scope>
</dependency>
<!-- NMS -->
<dependency>
<groupId>org.bukkit.craftbukkit</groupId>
<artifactId>1.16.3</artifactId>
<version>1.16.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<artifactId>craftbukkit-1.14.4</artifactId>
<groupId>cb</groupId>
<version>1</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftbukkit-1.14.4.jar</systemPath>
<groupId>org.bukkit.craftbukkit</groupId>
<artifactId>1.16.4</artifactId>
<version>1.16.4</version>
<scope>provided</scope>
</dependency>
<!-- Hooks -->
<dependency>
<groupId>com.bergerkiller.bukkit</groupId>
<artifactId>BKCommonLib</artifactId>
<version>1.16.4-v2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.lumine.xikage</groupId>
<artifactId>MythicMobs</artifactId>
<version>4.9.1</version>
<scope>provided</scope>
</dependency>
<!-- Utilities -->
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.zeroturnaround</groupId>
<artifactId>zt-zip</artifactId>
<version>1.14</version>
</dependency>
</dependencies>
</project>

View File

@@ -1,3 +0,0 @@
@Echo off
echo Apply Script: COPY
echo F|xcopy /y /s /f /q "%1" "%2"

View File

@@ -0,0 +1,153 @@
package com.minelazz.epicworldgenerator.structures;
import com.volmit.iris.Iris;
import com.volmit.iris.object.IrisObject;
import com.volmit.iris.util.B;
import com.volmit.iris.util.DontObfuscate;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.util.BlockVector;
import java.io.*;
import java.util.EnumSet;
@DontObfuscate
public class StructureObject implements Serializable
{
@DontObfuscate
public static final String MESSAGE0 = "This was created from .ewg serialization files";
@DontObfuscate
public static final String MESSAGE1 = "This is not copied code, it is intended to ";
@DontObfuscate
public static final String MESSAGE2 = "be used so that people can convert EWG files";
@DontObfuscate
public static final String MESSAGE3 = "into .IOB files (iris objects)";
@DontObfuscate
public static IrisObject convert(File so) throws IOException, ClassNotFoundException
{
FileInputStream fin = new FileInputStream(so);
ObjectInputStream in = new ObjectInputStream(fin);
StructureObject o = (StructureObject) in.readObject();
in.close();
int maxX = 0;
int maxY = 0;
int maxZ = 0;
int minX = 0;
int minY = 0;
int minZ = 0;
for(SOBlock i : o.blocks)
{
maxX = maxX < i.x ? i.x : maxX;
maxY = maxY < i.y ? i.y : maxY;
maxZ = maxZ < i.z ? i.z : maxZ;
minX = minX > i.x ? i.x : minX;
minY = minY > i.y ? i.y : minY;
minZ = minZ > i.z ? i.z : minZ;
}
IrisObject iob = new IrisObject(maxX - minX, maxY - minY, maxZ - minZ);
for(SOBlock i : o.blocks)
{
BlockData bdx = null;
if(i.blockData == null)
{
BlockData f = map(i.id, i.data);
bdx = f == null ? null : f;
}
else
{
bdx = B.get(i.blockData);
}
if(bdx != null)
{
iob.getBlocks().put(new BlockVector(i.x, -i.y, i.z), bdx);
}
}
return iob;
}
@DontObfuscate
@SuppressWarnings("deprecation")
private static final BlockData map(int id, int dat)
{
for(Material i : EnumSet.allOf(Material.class))
{
if(!i.isLegacy())
{
continue;
}
if(i.getId() == id)
{
return Bukkit.getUnsafe().fromLegacy(i, (byte) dat);
}
}
Iris.warn("Unknown Type " + id + ":" + dat);
return null;
}
@DontObfuscate
private static final long serialVersionUID = -905274143366977303L;
@DontObfuscate
public SOBlock[] blocks;
@DontObfuscate
public String name;
@DontObfuscate
public final class SOBlock implements Serializable
{
@DontObfuscate
private static final long serialVersionUID = 2610063934261982315L;
@DontObfuscate
public final int x;
@DontObfuscate
public final int y;
@DontObfuscate
public final int z;
@DontObfuscate
public final int id;
@DontObfuscate
public final int data;
@DontObfuscate
public String meta;
@DontObfuscate
public String blockData;
@DontObfuscate
final StructureObject ref;
@DontObfuscate
public SOBlock(StructureObject structureObject, int x, int y, int z, String string)
{
this.ref = structureObject;
meta = null;
this.x = x;
this.y = y;
this.z = z;
id = -1;
data = 0;
blockData = string;
}
}
}

View File

@@ -0,0 +1,545 @@
package com.volmit.iris;
import com.volmit.iris.manager.*;
import com.volmit.iris.manager.command.CommandIris;
import com.volmit.iris.manager.command.world.CommandLocate;
import com.volmit.iris.manager.command.PermissionIris;
import com.volmit.iris.manager.link.BKLink;
import com.volmit.iris.manager.link.CitizensLink;
import com.volmit.iris.manager.link.MultiverseCoreLink;
import com.volmit.iris.manager.link.MythicMobsLink;
import com.volmit.iris.nms.INMS;
import com.volmit.iris.object.IrisCompat;
import com.volmit.iris.scaffold.IrisWorlds;
import com.volmit.iris.scaffold.engine.EngineCompositeGenerator;
import com.volmit.iris.util.*;
import io.papermc.lib.PaperLib;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.Plugin;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.util.concurrent.Callable;
public class Iris extends VolmitPlugin
{
public static KList<GroupedExecutor> executors = new KList<>();
public static Iris instance;
public static ProjectManager proj;
public static ConversionManager convert;
public static WandManager wand;
public static EditManager edit;
public static IrisBoardManager board;
public static BKLink linkBK;
public static MultiverseCoreLink linkMultiverseCore;
public static MythicMobsLink linkMythicMobs;
public static CitizensLink linkCitizens;
private static final Queue<Runnable> syncJobs = new ShurikenQueue<>();
public static boolean customModels = doesSupportCustomModels();
public static boolean awareEntities = doesSupportAwareness();
public static boolean biome3d = doesSupport3DBiomes();
public static boolean lowMemoryMode = false;
public static IrisCompat compat;
public static FileWatcher configWatcher;
public static boolean warnsmoothie = true;
@Permission
public static PermissionIris perm;
@com.volmit.iris.util.Command
public CommandIris commandIris;
public Iris()
{
instance = this;
INMS.get();
IO.delete(new File("iris"));
lowMemoryMode = Runtime.getRuntime().maxMemory() < 4000000000L; // 4 * 1000 * 1000 * 1000 // 4g
}
public static int getThreadCount()
{
int tc = IrisSettings.get().getConcurrency().getThreadCount();
if(tc <= 0)
{
int p = Runtime.getRuntime().availableProcessors();
return p > 16 ? 16 : p < 4 ? 4 : p;
}
return tc;
}
private static boolean doesSupport3DBiomes()
{
try
{
int v = Integer.parseInt(Bukkit.getBukkitVersion().split("\\Q-\\E")[0].split("\\Q.\\E")[1]);
return v >= 15;
}
catch(Throwable e)
{
}
return false;
}
private static boolean doesSupportCustomModels()
{
try
{
int v = Integer.parseInt(Bukkit.getBukkitVersion().split("\\Q-\\E")[0].split("\\Q.\\E")[1]);
return v >= 14;
}
catch(Throwable e)
{
}
return false;
}
private static boolean doesSupportAwareness()
{
try
{
int v = Integer.parseInt(Bukkit.getBukkitVersion().split("\\Q-\\E")[0].split("\\Q.\\E")[1]);
return v >= 15;
}
catch(Throwable e)
{
}
return false;
}
public static void warnsmoothie(){
if (warnsmoothie){
warn("The smoothieMap 'illegal reflective access operation' is required and can be safely ignored");
warnsmoothie = false;
}
}
@Override
public void start()
{
}
@Override
public void stop()
{
}
@Override
public String getTag(String subTag)
{
return C.BOLD + "" + C.DARK_GRAY + "[" + C.BOLD + "" + C.GREEN + "Iris" + C.BOLD + C.DARK_GRAY + "]" + C.RESET + "" + C.GRAY + ": ";
}
public void onEnable()
{
instance = this;
try {
compat = IrisCompat.configured(getDataFile("compat.json"));
} catch (IOException e){
// Do nothing. Everything continues properly but the exception is still there.
}
proj = new ProjectManager();
convert = new ConversionManager();
wand = new WandManager();
board = new IrisBoardManager();
linkMultiverseCore = new MultiverseCoreLink();
linkBK = new BKLink();
linkMythicMobs = new MythicMobsLink();
edit = new EditManager();
configWatcher = new FileWatcher(getDataFile("settings.json"));
J.a(() -> IO.delete(getTemp()));
J.a(this::bstats);
J.s(this::splash, 20);
J.sr(this::tickQueue, 0);
J.ar(this::checkConfigHotload, 50);
PaperLib.suggestPaper(this);
getServer().getPluginManager().registerEvents(new CommandLocate(), this);
super.onEnable();
}
private void checkConfigHotload() {
if(configWatcher.checkModified())
{
IrisSettings.invalidate();
IrisSettings.get();
configWatcher.checkModified();
Iris.info("Hotloaded settings.json");
}
}
public void onDisable()
{
if(IrisSettings.get().isStudio())
{
proj.close();
for(World i : Bukkit.getWorlds())
{
if(IrisWorlds.isIrisWorld(i))
{
IrisWorlds.access(i).close();
}
}
for(GroupedExecutor i : executors)
{
i.close();
}
}
executors.clear();
board.disable();
Bukkit.getScheduler().cancelTasks(this);
HandlerList.unregisterAll((Plugin) this);
super.onDisable();
}
public static void sq(Runnable r)
{
synchronized(syncJobs)
{
syncJobs.queue(r);
}
}
private void tickQueue()
{
synchronized(Iris.syncJobs)
{
if(!Iris.syncJobs.hasNext())
{
return;
}
long ms = M.ms();
while(Iris.syncJobs.hasNext() && M.ms() - ms < 25)
{
try
{
Iris.syncJobs.next().run();
}
catch(Throwable e)
{
e.printStackTrace();
}
}
}
}
private void bstats()
{
if(IrisSettings.get().getGeneral().isPluginMetrics())
{
J.s(() -> {
Metrics m = new Metrics(Iris.instance, 8757);
m.addCustomChart(new Metrics.SingleLineChart("custom_dimensions", new Callable<Integer>() {
@Override
public Integer call() throws Exception {
return ProjectManager.countUniqueDimensions();
}
}));
m.addCustomChart(new Metrics.SimplePie("using_custom_dimensions", new Callable<String>() {
@Override
public String call() throws Exception {
return ProjectManager.countUniqueDimensions() > 0 ? "Active Projects" : "No Projects";
}
}));
});
}
}
public static File getTemp()
{
return instance.getDataFolder("cache", "temp");
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
return super.onCommand(sender, command, label, args);
}
public void imsg(CommandSender s, String msg)
{
s.sendMessage(C.GREEN + "[" + C.DARK_GRAY + "Iris" + C.GREEN + "]" + C.GRAY + ": " + msg);
}
@Override
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id)
{
String dimension = IrisSettings.get().getGenerator().getDefaultWorldType();
if(id != null && !id.isEmpty())
{
dimension = id;
Iris.info("Generator ID: " + id + " requested by bukkit/plugin. Assuming IrisDimension: " + id);
}
return new EngineCompositeGenerator(dimension, true);
}
public static void msg(String string)
{
try
{
if(instance == null)
{
System.out.println("[Iris]: " + string);
return;
}
String msg = C.GRAY + "[" + C.GREEN + "Iris" + C.GRAY + "]: " + string;
Bukkit.getConsoleSender().sendMessage(msg);
}
catch(Throwable e)
{
System.out.println("[Iris]: " + string);
}
}
public static File getCached(String name, String url)
{
String h = IO.hash(name + "@" + url);
File f = Iris.instance.getDataFile("cache", h.substring(0, 2), h.substring(3, 5), h);
if(!f.exists())
{
try(BufferedInputStream in = new BufferedInputStream(new URL(url).openStream()); FileOutputStream fileOutputStream = new FileOutputStream(f))
{
byte[] dataBuffer = new byte[1024];
int bytesRead;
while((bytesRead = in.read(dataBuffer, 0, 1024)) != -1)
{
fileOutputStream.write(dataBuffer, 0, bytesRead);
Iris.verbose("Aquiring " + name);
}
}
catch(IOException ignored)
{
}
}
return f.exists() ? f : null;
}
public static String getNonCached(String name, String url)
{
String h = IO.hash(name + "*" + url);
File f = Iris.instance.getDataFile("cache", h.substring(0, 2), h.substring(3, 5), h);
try(BufferedInputStream in = new BufferedInputStream(new URL(url).openStream()); FileOutputStream fileOutputStream = new FileOutputStream(f))
{
byte[] dataBuffer = new byte[1024];
int bytesRead;
while((bytesRead = in.read(dataBuffer, 0, 1024)) != -1)
{
fileOutputStream.write(dataBuffer, 0, bytesRead);
}
}
catch(IOException ignored)
{
}
try
{
return IO.readAll(f);
}
catch(IOException ignored)
{
}
return "";
}
public static File getNonCachedFile(String name, String url)
{
String h = IO.hash(name + "*" + url);
File f = Iris.instance.getDataFile("cache", h.substring(0, 2), h.substring(3, 5), h);
try(BufferedInputStream in = new BufferedInputStream(new URL(url).openStream()); FileOutputStream fileOutputStream = new FileOutputStream(f))
{
byte[] dataBuffer = new byte[1024];
int bytesRead;
while((bytesRead = in.read(dataBuffer, 0, 1024)) != -1)
{
fileOutputStream.write(dataBuffer, 0, bytesRead);
}
}
catch(IOException ignored)
{
}
return f;
}
public static void warn(String string)
{
msg(C.YELLOW + string);
}
public static void error(String string)
{
msg(C.RED + string);
}
public static void verbose(String string)
{
try
{
if(IrisSettings.get().getGeneral().isVerbose())
{
msg(C.GRAY + string);
}
}
catch(Throwable e)
{
msg(C.GRAY + string);
}
}
public static void success(String string)
{
msg(C.GREEN + string);
}
public static void info(String string)
{
msg(C.WHITE + string);
}
public void hit(long hits2)
{
board.hits.put(hits2);
}
public void splash()
{
if(!IrisSettings.get().getGeneral().isSplashLogoStartup())
{
return;
}
// @NoArgsConstructor
String padd = Form.repeat(" ", 8);
String padd2 = Form.repeat(" ", 4);
String[] info = {"", "", "", "", "", padd2 + C.GREEN + " Iris", padd2 + C.GRAY + " by " + C.randomColor() + "V" + C.randomColor() + "o" + C.randomColor() + "l" + C.randomColor() + "m" + C.randomColor() + "i" + C.randomColor() + "t" + C.randomColor() + "S" + C.randomColor() + "o" + C.randomColor() + "f" + C.randomColor() + "t" + C.randomColor() + "w" + C.randomColor() + "a" + C.randomColor() + "r" + C.randomColor() + "e", padd2 + C.GRAY + " v" + getDescription().getVersion(),
};
String[] splash = {padd + C.GRAY + " @@@@@@@@@@@@@@" + C.DARK_GRAY + "@@@", padd + C.GRAY + " @@&&&&&&&&&" + C.DARK_GRAY + "&&&&&&" + C.GREEN + " .(((()))). ", padd + C.GRAY + "@@@&&&&&&&&" + C.DARK_GRAY + "&&&&&" + C.GREEN + " .((((((())))))). ", padd + C.GRAY + "@@@&&&&&" + C.DARK_GRAY + "&&&&&&&" + C.GREEN + " ((((((((())))))))) " + C.GRAY + " @", padd + C.GRAY + "@@@&&&&" + C.DARK_GRAY + "@@@@@&" + C.GREEN + " ((((((((-))))))))) " + C.GRAY + " @@", padd + C.GRAY + "@@@&&" + C.GREEN + " ((((((({ })))))))) " + C.GRAY + " &&@@@", padd + C.GRAY + "@@" + C.GREEN + " ((((((((-))))))))) " + C.DARK_GRAY + "&@@@@@" + C.GRAY + "&&&&@@@", padd + C.GRAY + "@" + C.GREEN + " ((((((((())))))))) " + C.DARK_GRAY + "&&&&&" + C.GRAY + "&&&&&&&@@@", padd + C.GRAY + "" + C.GREEN + " '((((((()))))))' " + C.DARK_GRAY + "&&&&&" + C.GRAY + "&&&&&&&&@@@", padd + C.GRAY + "" + C.GREEN + " '(((())))' " + C.DARK_GRAY + "&&&&&&&&" + C.GRAY + "&&&&&&&@@", padd + C.GRAY + " " + C.DARK_GRAY + "@@@" + C.GRAY + "@@@@@@@@@@@@@@"
};
//@done
Iris.info("Server type & version: " + Bukkit.getVersion());
Iris.info("Bukkit version: " + Bukkit.getBukkitVersion());
Iris.info("Java version: " + getJavaVersion());
for(int i = 0; i < info.length; i++)
{
splash[i] += info[i];
}
Iris.info("\n\n " + new KList<>(splash).toString("\n") + "\n");
if(lowMemoryMode)
{
Iris.verbose("* Low Memory mode Activated! For better performance, allocate 4gb or more to this server.");
}
if(!biome3d)
{
Iris.verbose("* This version of minecraft does not support 3D biomes (1.15 and up). Iris will generate as normal, but biome colors will not vary underground & in the sky.");
}
if(!customModels)
{
Iris.verbose("* This version of minecraft does not support custom model data in loot items (1.14 and up). Iris will generate as normal, but loot will not have custom models.");
}
if(!doesSupportAwareness())
{
Iris.verbose("* This version of minecraft does not support entity awareness.");
}
}
@SuppressWarnings("deprecation")
public static void later(NastyRunnable object)
{
Bukkit.getScheduler().scheduleAsyncDelayedTask(instance, () ->
{
try
{
object.run();
}
catch(Throwable e)
{
e.printStackTrace();
}
}, RNG.r.i(100, 1200));
}
public static int jobCount()
{
return syncJobs.size();
}
public static void clearQueues()
{
synchronized(syncJobs)
{
syncJobs.clear();
}
}
private static int getJavaVersion() {
String version = System.getProperty("java.version");
if(version.startsWith("1.")) {
version = version.substring(2, 3);
} else {
int dot = version.indexOf(".");
if(dot != -1) { version = version.substring(0, dot); }
} return Integer.parseInt(version);
}
public boolean isMCA() {
return IrisSettings.get().getGenerator().isMcaPregenerator();
}
}

View File

@@ -0,0 +1,262 @@
package com.volmit.iris;
import com.google.gson.Gson;
import com.volmit.iris.util.*;
import lombok.Data;
import java.io.File;
import java.io.IOException;
@Data
public class IrisSettings
{
public static transient IrisSettings settings;
private IrisSettingsCache cache = new IrisSettingsCache();
private IrisSettingsConcurrency concurrency = new IrisSettingsConcurrency();
private IrisSettingsParallax parallax = new IrisSettingsParallax();
private IrisSettingsGeneral general = new IrisSettingsGeneral();
private IrisSettingsGUI gui = new IrisSettingsGUI();
private IrisSettingsGenerator generator = new IrisSettingsGenerator();
private IrisSettingsStudio studio = new IrisSettingsStudio();
@DontObfuscate
public int configurationVersion = 3;
public boolean isStudio() {
return getStudio().isStudio();
}
public boolean isUseServerLaunchedGuis() {
return getGui().isUseServerLaunchedGuis();
}
public long getParallaxRegionEvictionMS() {
return getParallax().getParallaxRegionEvictionMS();
}
@Data
public static class IrisSettingsCache
{
@DontObfuscate
public int streamingCacheSize = 8192;
}
@Data
public static class IrisSettingsConcurrency
{
@DontObfuscate
public int threadCount = -1;
}
@Data
public static class IrisSettingsParallax
{
@DontObfuscate
public int parallaxRegionEvictionMS = 15000;
@DontObfuscate
public int parallaxChunkEvictionMS = 5000;
}
@Data
public static class IrisSettingsGeneral
{
@DontObfuscate
public boolean commandSounds = true;
@DontObfuscate
public boolean verbose = false;
@DontObfuscate
public boolean ignoreWorldEdit = false;
@DontObfuscate
public boolean disableNMS = false;
@DontObfuscate
public boolean pluginMetrics = true;
@DontObfuscate
public boolean splashLogoStartup = true;
}
@Data
public static class IrisSettingsGUI
{
@DontObfuscate
public boolean useServerLaunchedGuis = true;
@DontObfuscate
public boolean maximumPregenGuiFPS = false;
@DontObfuscate
public boolean localPregenGui = true;
}
@Data
public static class IrisSettingsGenerator
{
@DontObfuscate
public String defaultWorldType = "overworld";
@DontObfuscate
public boolean mcaPregenerator = false;
@DontObfuscate
public boolean systemEffects = true;
@DontObfuscate
public boolean systemEntitySpawnOverrides = true;
@DontObfuscate
public boolean systemEntityInitialSpawns = true;
@DontObfuscate
public int maxBiomeChildDepth = 5;
}
@Data
public static class IrisSettingsStudio
{
@DontObfuscate
public boolean studio = true;
@DontObfuscate
public boolean openVSCode = true;
}
public static IrisSettings get()
{
if(settings != null)
{
return settings;
}
IrisSettings defaults = new IrisSettings();
JSONObject def = new JSONObject(new Gson().toJson(defaults));
if(settings == null)
{
settings = new IrisSettings();
File s = Iris.instance.getDataFile("settings.json");
if(!s.exists())
{
try
{
IO.writeAll(s, new JSONObject(new Gson().toJson(settings)).toString(4));
}
catch(JSONException | IOException e)
{
e.printStackTrace();
}
}
else
{
try
{
String ss = IO.readAll(s);
settings = new Gson().fromJson(ss, IrisSettings.class);
J.a(() ->
{
try
{
JSONObject j = new JSONObject(ss);
boolean u = false;
for(String i : def.keySet())
{
if(!j.has(i))
{
u = true;
j.put(i, def.get(i));
Iris.warn("Adding new config key: " + i);
}
}
for(String i : new KSet<>(j.keySet()))
{
if(!def.has(i))
{
u = true;
j.remove(i);
Iris.warn("Removing unused config key: " + i);
}
}
if(u)
{
try
{
IO.writeAll(s, j.toString(4));
Iris.info("Updated Configuration Files");
}
catch(Throwable e)
{
e.printStackTrace();
}
}
}
catch(Throwable ee)
{
Iris.error("Configuration Error in settings.json! " + ee.getClass().getSimpleName() + ": " + ee.getMessage());
Iris.warn("Attempting to fix configuration while retaining valid in-memory settings...");
try {
IO.writeAll(s, new JSONObject(new Gson().toJson(settings)).toString(4));
Iris.info("Configuration Fixed!");
} catch (IOException e) {
e.printStackTrace();
Iris.error("ERROR! CONFIGURATION IMPOSSIBLE TO READ! Using an unmodifiable configuration from memory. Please delete the settings.json at some point to try to restore configurability!");
}
}
});
}
catch(Throwable ee)
{
Iris.error("Configuration Error in settings.json! " + ee.getClass().getSimpleName() + ": " + ee.getMessage());
Iris.warn("Attempting to fix configuration while retaining valid in-memory settings...");
try {
IO.writeAll(s, new JSONObject(new Gson().toJson(settings)).toString(4));
Iris.info("Configuration Fixed!");
} catch (IOException e) {
e.printStackTrace();
Iris.error("ERROR! CONFIGURATION IMPOSSIBLE TO READ! Using an unmodifiable configuration from memory. Please delete the settings.json at some point to try to restore configurability!");
}
}
}
if(!s.exists())
{
try
{
IO.writeAll(s, new JSONObject(new Gson().toJson(settings)).toString(4));
}
catch(JSONException | IOException e)
{
e.printStackTrace();
}
}
}
return settings;
}
public static void invalidate()
{
synchronized(settings)
{
settings = null;
}
}
}

View File

@@ -0,0 +1,364 @@
package com.volmit.iris.generator;
import com.google.common.util.concurrent.AtomicDouble;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.generator.actuator.IrisTerrainActuator;
import com.volmit.iris.generator.modifier.IrisCaveModifier;
import com.volmit.iris.generator.noise.CNG;
import com.volmit.iris.manager.IrisDataManager;
import com.volmit.iris.object.*;
import com.volmit.iris.scaffold.data.DataProvider;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.stream.ProceduralStream;
import com.volmit.iris.scaffold.stream.interpolation.Interpolated;
import com.volmit.iris.util.CaveResult;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.M;
import com.volmit.iris.util.RNG;
import lombok.Data;
import org.bukkit.Material;
import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData;
@Data
public class IrisComplex implements DataProvider
{
private RNG rng;
private double fluidHeight;
private IrisDataManager data;
private KList<IrisGenerator> generators;
private static final BlockData AIR = Material.AIR.createBlockData();
private ProceduralStream<IrisRegion> regionStream;
private ProceduralStream<InferredType> bridgeStream;
private ProceduralStream<IrisBiome> landBiomeStream;
private ProceduralStream<IrisBiome> caveBiomeStream;
private ProceduralStream<IrisBiome> seaBiomeStream;
private ProceduralStream<IrisBiome> shoreBiomeStream;
private ProceduralStream<IrisBiome> baseBiomeStream;
private ProceduralStream<IrisBiome> trueBiomeStream;
private ProceduralStream<Biome> trueBiomeDerivativeStream;
private ProceduralStream<Double> heightStream;
private ProceduralStream<Double> objectChanceStream;
private ProceduralStream<Double> maxHeightStream;
private ProceduralStream<Double> overlayStream;
private ProceduralStream<Double> heightFluidStream;
private ProceduralStream<Integer> trueHeightStream;
private ProceduralStream<Double> slopeStream;
private ProceduralStream<RNG> rngStream;
private ProceduralStream<RNG> chunkRngStream;
private ProceduralStream<IrisDecorator> terrainSurfaceDecoration;
private ProceduralStream<IrisDecorator> terrainCeilingDecoration;
private ProceduralStream<IrisDecorator> terrainCaveSurfaceDecoration;
private ProceduralStream<IrisDecorator> terrainCaveCeilingDecoration;
private ProceduralStream<IrisDecorator> seaSurfaceDecoration;
private ProceduralStream<IrisDecorator> shoreSurfaceDecoration;
private ProceduralStream<BlockData> rockStream;
private ProceduralStream<BlockData> fluidStream;
public ProceduralStream<IrisBiome> getBiomeStream(InferredType type)
{
switch(type)
{
case CAVE:
return caveBiomeStream;
case LAND:
return landBiomeStream;
case SEA:
return seaBiomeStream;
case SHORE:
return shoreBiomeStream;
case DEFER:
case LAKE:
case RIVER:
default:
break;
}
return null;
}
public IrisComplex(Engine engine)
{
int cacheSize = IrisSettings.get().getCache().getStreamingCacheSize();
this.rng = new RNG(engine.getWorld().getSeed());
this.data = engine.getData();
double height = engine.getHeight();
fluidHeight = engine.getDimension().getFluidHeight();
generators = new KList<>();
RNG rng = new RNG(engine.getWorld().getSeed());
//@builder
engine.getDimension().getRegions().forEach((i) -> data.getRegionLoader().load(i)
.getAllBiomes(this).forEach((b) -> b
.getGenerators()
.forEach((c) -> registerGenerator(c.getCachedGenerator(this)))));
overlayStream = ProceduralStream.ofDouble((x, z) -> 0D);
engine.getDimension().getOverlayNoise().forEach((i) -> overlayStream.add((x, z) -> i.get(rng, x, z)));
rngStream = ProceduralStream.of((x, z) -> new RNG(((x.longValue()) << 32) | (z.longValue() & 0xffffffffL))
.nextParallelRNG(engine.getWorld().getSeed()), Interpolated.RNG);
chunkRngStream = rngStream.blockToChunkCoords();
rockStream = engine.getDimension().getRockPalette().getLayerGenerator(rng.nextParallelRNG(45), data).stream()
.select(engine.getDimension().getRockPalette().getBlockData(data));
fluidStream = engine.getDimension().getFluidPalette().getLayerGenerator(rng.nextParallelRNG(78), data).stream()
.select(engine.getDimension().getFluidPalette().getBlockData(data));
regionStream = engine.getDimension().getRegionStyle().create(rng.nextParallelRNG(883)).stream()
.zoom(engine.getDimension().getRegionZoom())
.selectRarity(engine.getDimension().getRegions())
.convertCached((s) -> data.getRegionLoader().load(s)).cache2D(cacheSize);
caveBiomeStream = regionStream.convert((r)
-> engine.getDimension().getCaveBiomeStyle().create(rng.nextParallelRNG(1221)).stream()
.zoom(r.getCaveBiomeZoom())
.selectRarity(r.getCaveBiomes())
.onNull("")
.convertCached((s) -> {
if(s.isEmpty())
{
return new IrisBiome();
}
return data.getBiomeLoader().load(s)
.setInferredType(InferredType.CAVE);
})
).convertAware2D(ProceduralStream::get).cache2D(cacheSize);
landBiomeStream = regionStream.convert((r)
-> engine.getDimension().getLandBiomeStyle().create(rng.nextParallelRNG(234234234)).stream()
.zoom(r.getLandBiomeZoom())
.selectRarity(r.getLandBiomes())
.convertCached((s) -> data.getBiomeLoader().load(s)
.setInferredType(InferredType.LAND))
).convertAware2D(ProceduralStream::get)
.cache2D(cacheSize);
seaBiomeStream = regionStream.convert((r)
-> engine.getDimension().getSeaBiomeStyle().create(rng.nextParallelRNG(11232323)).stream()
.zoom(r.getSeaBiomeZoom())
.selectRarity(r.getSeaBiomes())
.convertCached((s) -> data.getBiomeLoader().load(s)
.setInferredType(InferredType.SEA))
).convertAware2D(ProceduralStream::get)
.cache2D(cacheSize);
shoreBiomeStream = regionStream.convert((r)
-> engine.getDimension().getShoreBiomeStyle().create(rng.nextParallelRNG(7787845)).stream()
.zoom(r.getShoreBiomeZoom())
.selectRarity(r.getShoreBiomes())
.convertCached((s) -> data.getBiomeLoader().load(s)
.setInferredType(InferredType.SHORE))
).convertAware2D(ProceduralStream::get).cache2D(cacheSize);
bridgeStream = engine.getDimension().getContinentalStyle().create(rng.nextParallelRNG(234234565)).bake().scale(1D / engine.getDimension().getContinentZoom()).bake().stream()
.convert((v) -> v >= engine.getDimension().getLandChance() ? InferredType.SEA : InferredType.LAND);
baseBiomeStream = bridgeStream.convertAware2D((t, x, z) -> t.equals(InferredType.SEA)
? seaBiomeStream.get(x, z) : landBiomeStream.get(x, z))
.convertAware2D(this::implode).cache2D(cacheSize);
heightStream = ProceduralStream.of((x, z) -> {
IrisBiome b = baseBiomeStream.get(x, z);
return getHeight(engine, b, x, z, engine.getWorld().getSeed());
}, Interpolated.DOUBLE).cache2D(cacheSize);
slopeStream = heightStream.slope(3).interpolate().bilinear(3, 3).cache2D(cacheSize);
objectChanceStream = ProceduralStream.ofDouble((x, z) -> {
AtomicDouble str = new AtomicDouble(1D);
engine.getFramework().getEngineParallax().forEachFeature(x, z, (i)
-> str.set(Math.min(str.get(), i.getObjectChanceModifier(x, z))));
return str.get();
});
trueBiomeStream = heightStream
.convertAware2D((h, x, z) ->
fixBiomeType(h, baseBiomeStream.get(x, z),
regionStream.get(x, z), x, z, fluidHeight)).cache2D(cacheSize);
trueBiomeDerivativeStream = trueBiomeStream.convert(IrisBiome::getDerivative).cache2D(cacheSize);
heightFluidStream = heightStream.max(fluidHeight).cache2D(cacheSize);
maxHeightStream = ProceduralStream.ofDouble((x, z) -> height);
terrainSurfaceDecoration = trueBiomeStream
.convertAware2D((b, xx,zz) -> decorateFor(b, xx, zz, DecorationPart.NONE));
terrainCeilingDecoration = trueBiomeStream
.convertAware2D((b, xx,zz) -> decorateFor(b, xx, zz, DecorationPart.CEILING));
terrainCaveSurfaceDecoration = caveBiomeStream
.convertAware2D((b, xx,zz) -> decorateFor(b, xx, zz, DecorationPart.NONE));
terrainCaveCeilingDecoration = caveBiomeStream
.convertAware2D((b, xx,zz) -> decorateFor(b, xx, zz, DecorationPart.CEILING));
shoreSurfaceDecoration = trueBiomeStream
.convertAware2D((b, xx,zz) -> decorateFor(b, xx, zz, DecorationPart.SHORE_LINE));
seaSurfaceDecoration = trueBiomeStream
.convertAware2D((b, xx,zz) -> decorateFor(b, xx, zz, DecorationPart.SEA_SURFACE));
trueHeightStream = ProceduralStream.of((x, z) -> {
int rx = (int) Math.round(engine.modifyX(x));
int rz = (int) Math.round(engine.modifyZ(z));
int heightf = (int) Math.round(getHeightStream().get(rx, rz));
int m = heightf;
if(engine.getDimension().isCarving())
{
if(engine.getDimension().isCarved(rx, m, rz, ((IrisTerrainActuator)engine.getFramework().getTerrainActuator()).getRng(), heightf))
{
m--;
while(engine.getDimension().isCarved(rx, m, rz, ((IrisTerrainActuator)engine.getFramework().getTerrainActuator()).getRng(), heightf))
{
m--;
}
}
}
if(engine.getDimension().isCaves())
{
KList<CaveResult> caves = ((IrisCaveModifier)engine.getFramework().getCaveModifier()).genCaves(rx, rz, 0, 0, null);
boolean again = true;
while(again)
{
again = false;
for(CaveResult i : caves)
{
if(i.getCeiling() > m && i.getFloor() < m)
{
m = i.getFloor();
again = true;
}
}
}
}
return m;
}, Interpolated.INT).cache2D(cacheSize);
//@done
}
private IrisDecorator decorateFor(IrisBiome b, double x, double z, DecorationPart part)
{
RNG rngc = chunkRngStream.get(x, z);
for(IrisDecorator i : b.getDecorators())
{
if(!i.getPartOf().equals(part))
{
continue;
}
BlockData block = i.getBlockData(b, rngc, x, z, data);
if(block != null)
{
return i;
}
}
return null;
}
private IrisBiome implode(IrisBiome b, Double x, Double z)
{
if(b.getChildren().isEmpty())
{
return b;
}
return implode(b, x, z, 3);
}
private IrisBiome implode(IrisBiome b, Double x, Double z, int max)
{
if(max < 0)
{
return b;
}
if(b.getChildren().isEmpty())
{
return b;
}
CNG childCell = b.getChildrenGenerator(rng, 123, b.getChildShrinkFactor());
KList<IrisBiome> chx = b.getRealChildren(this).copy();
chx.add(b);
IrisBiome biome = childCell.fitRarity(chx, x, z);
biome.setInferredType(b.getInferredType());
return implode(biome, x, z, max - 1);
}
private IrisBiome fixBiomeType(Double height, IrisBiome biome, IrisRegion region, Double x, Double z, double fluidHeight)
{
double sh = region.getShoreHeight(x, z);
if(height >= fluidHeight-1 && height <= fluidHeight + sh && !biome.isShore())
{
return shoreBiomeStream.get(x, z);
}
if(height > fluidHeight + sh && !biome.isLand())
{
return landBiomeStream.get(x, z);
}
if(height < fluidHeight && !biome.isAquatic())
{
return seaBiomeStream.get(x, z);
}
if(height == fluidHeight && !biome.isShore())
{
return shoreBiomeStream.get(x, z);
}
return biome;
}
private double getHeight(Engine engine, IrisBiome b, double x, double z, long seed)
{
double h = 0;
for(IrisGenerator gen : generators)
{
double hi = gen.getInterpolator().interpolate(x, z, (xx, zz) ->
{
try
{
IrisBiome bx = baseBiomeStream.get(xx, zz);
return bx.getGenLinkMax(gen.getLoadKey());
}
catch(Throwable e)
{
Iris.warn("Failed to sample hi biome at " + xx + " " + zz + " using the generator " + gen.getLoadKey());
}
return 0;
});
double lo = gen.getInterpolator().interpolate(x, z, (xx, zz) ->
{
try
{
IrisBiome bx = baseBiomeStream.get(xx, zz);
return bx.getGenLinkMin(gen.getLoadKey());
}
catch(Throwable e)
{
Iris.warn("Failed to sample lo biome at " + xx + " " + zz + " using the generator " + gen.getLoadKey());
}
return 0;
});
h += M.lerp(lo, hi, gen.getHeight(x, z, seed + 239945));
}
AtomicDouble noise = new AtomicDouble(h + fluidHeight + overlayStream.get(x,z));
engine.getFramework().getEngineParallax().forEachFeature(x, z, (i)
-> noise.set(i.filter(x, z, noise.get())));
return Math.min(engine.getHeight(), Math.max(noise.get(), 0));
}
private void registerGenerator(IrisGenerator cachedGenerator)
{
for(IrisGenerator i : generators)
{
if(i.getLoadKey().equals(cachedGenerator.getLoadKey()))
{
return;
}
}
generators.add(cachedGenerator);
}
}

View File

@@ -0,0 +1,154 @@
package com.volmit.iris.generator;
import com.volmit.iris.Iris;
import com.volmit.iris.scaffold.engine.*;
import com.volmit.iris.scaffold.hunk.Hunk;
import com.volmit.iris.util.J;
import com.volmit.iris.util.PrecisionStopwatch;
import com.volmit.iris.util.RNG;
import lombok.Getter;
import lombok.Setter;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData;
import org.bukkit.generator.BlockPopulator;
import org.jetbrains.annotations.NotNull;
import java.util.Random;
public class IrisEngine extends BlockPopulator implements Engine
{
@Getter
private final EngineCompound compound;
@Getter
private final EngineTarget target;
@Getter
private final EngineFramework framework;
@Getter
private final EngineEffects effects;
@Getter
private final EngineWorldManager worldManager;
@Setter
@Getter
private volatile int parallelism;
@Getter
private final int index;
@Getter
private final EngineMetrics metrics;
@Setter
@Getter
private volatile int minHeight;
private boolean failing;
private boolean closed;
private int cacheId;
private final int art;
public IrisEngine(EngineTarget target, EngineCompound compound, int index)
{
Iris.info("Initializing Engine: " + target.getWorld().getName() + "/" + target.getDimension().getLoadKey() + " (" + target.getHeight() + " height)");
metrics = new EngineMetrics(32);
this.target = target;
this.framework = new IrisEngineFramework(this);
worldManager = new IrisWorldManager(this);
this.compound = compound;
minHeight = 0;
failing = false;
closed = false;
this.index = index;
cacheId = RNG.r.nextInt();
effects = new IrisEngineEffects(this);
art = J.ar(effects::tickRandomPlayer, 0);
}
@Override
public void close()
{
J.car(art);
closed = true;
getWorldManager().close();
getFramework().close();
}
@Override
public boolean isClosed() {
return closed;
}
@Override
public void recycle() {
getFramework().recycle();
}
@Override
public double modifyX(double x) {
return x / getDimension().getTerrainZoom();
}
@Override
public double modifyZ(double z) {
return z / getDimension().getTerrainZoom();
}
@Override
public void generate(int x, int z, Hunk<BlockData> vblocks, Hunk<Biome> vbiomes) {
try
{
PrecisionStopwatch p = PrecisionStopwatch.start();
Hunk<BlockData> blocks = vblocks.synchronize().listen((xx,y,zz,t) -> catchBlockUpdates(x+xx,y+getMinHeight(),z+zz, t));
getFramework().getEngineParallax().generateParallaxArea(x>>4, z>>4);
getFramework().getBiomeActuator().actuate(x, z, vbiomes);
getFramework().getTerrainActuator().actuate(x, z, blocks);
getFramework().getCaveModifier().modify(x, z, blocks);
getFramework().getRavineModifier().modify(x, z, blocks);
getFramework().getPostModifier().modify(x, z, blocks);
getFramework().getDecorantActuator().actuate(x, z, blocks);
getFramework().getEngineParallax().insertParallax(x, z, blocks);
getFramework().getDepositModifier().modify(x, z, blocks);
getMetrics().getTotal().put(p.getMilliseconds());
}
catch(Throwable e)
{
fail("Failed to generate " + x + ", " + z, e);
}
}
@Override
public void populate(@NotNull World world, @NotNull Random random, @NotNull Chunk c)
{
getWorldManager().spawnInitialEntities(c);
updateChunk(c);
placeTiles(c);
}
@Override
public void fail(String error, Throwable e) {
failing = true;
Iris.error(error);
e.printStackTrace();
}
@Override
public boolean hasFailed() {
return failing;
}
@Override
public int getCacheID() {
return cacheId;
}
@Override
public void hotload() {
cacheId = RNG.r.nextInt();
}
}

View File

@@ -0,0 +1,366 @@
package com.volmit.iris.generator;
import com.volmit.iris.Iris;
import com.volmit.iris.manager.IrisDataManager;
import com.volmit.iris.nms.INMS;
import com.volmit.iris.object.IrisDimension;
import com.volmit.iris.object.IrisDimensionIndex;
import com.volmit.iris.object.IrisPosition;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineCompound;
import com.volmit.iris.scaffold.engine.EngineData;
import com.volmit.iris.scaffold.engine.EngineTarget;
import com.volmit.iris.scaffold.hunk.Hunk;
import com.volmit.iris.scaffold.parallel.MultiBurst;
import com.volmit.iris.util.*;
import lombok.Getter;
import lombok.Setter;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData;
import org.bukkit.command.CommandSender;
import org.bukkit.event.EventHandler;
import org.bukkit.event.world.WorldSaveEvent;
import org.bukkit.generator.BlockPopulator;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public class IrisEngineCompound implements EngineCompound {
@Getter
private final World world;
private final AtomicRollingSequence wallClock;
private Engine defaultEngine;
@Getter
private final EngineData engineMetadata;
private final Engine[] engines;
@Getter
private final MultiBurst burster;
@Getter
private final KList<BlockPopulator> populators;
@Getter
private final IrisDimension rootDimension;
@Getter
private final int threadCount = -1;
@Getter
@Setter
private boolean studio;
public IrisEngineCompound(World world, IrisDimension rootDimension, IrisDataManager data, int maximumThreads)
{
wallClock = new AtomicRollingSequence(32);
this.rootDimension = rootDimension;
Iris.info("Initializing Engine Composite for " + world.getName());
this.world = world;
engineMetadata = EngineData.load(getEngineMetadataFile());
engineMetadata.setDimension(rootDimension.getLoadKey());
engineMetadata.setLastVersion(Iris.instance.getDescription().getVersion());
if(engineMetadata.getStrongholdPositions() == null || engineMetadata.getStrongholdPositions().size() == 0)
{
if(!(world instanceof FakeWorld || world instanceof HeightedFakeWorld))
{
List<IrisPosition> strongholds = new ArrayList<>();
Object nmsWorld = new V(world).invoke("getHandle");
Object chunkProvider = new V(nmsWorld).invoke("getChunkProvider");
Object chunkGenerator = new V(chunkProvider).invoke("getChunkGenerator");
try {
Class<?> clazz = Class.forName("net.minecraft.server." + INMS.getNMSTag() + ".ChunkGenerator");
Class<?> clazzSG = Class.forName("net.minecraft.server." + INMS.getNMSTag() + ".StructureGenerator");
Class<?> clazzBP = Class.forName("net.minecraft.server." + INMS.getNMSTag() + ".BlockPosition");
getBPSafe(clazz, clazzSG, clazzBP, nmsWorld, chunkGenerator).thenAccept(bp -> {
if (bp == null){
throw new NullPointerException();
}
strongholds.add(new IrisPosition((int) new V(bp, false).invoke("getX"), (int) new V(bp, false).invoke("getY"), (int) new V(bp, false).invoke("getZ")));
StringBuilder positions = new StringBuilder();
for (IrisPosition pos : strongholds){
positions.append("(").append(pos.getX()).append(",").append(pos.getY()).append(",").append(pos.getZ()).append(") ");
}
Iris.info("Strongholds (" + engineMetadata.getStrongholdPositions().size() + ") found at [" + positions + "]");
});
engineMetadata.setStrongholdPositions(strongholds);
} catch (Throwable e) {
strongholds.add( new IrisPosition(1337, 32, -1337) );
engineMetadata.setStrongholdPositions(strongholds);
Iris.warn("Couldn't properly find the stronghold position for this world. Is this headless mode? Are you not using 1.16 or higher?");
Iris.warn(" -> Setting default stronghold position");
e.printStackTrace();
Iris.info("Got this far (3)");
StringBuilder positions = new StringBuilder();
for (IrisPosition pos : strongholds){
positions.append("(").append(pos.getX()).append(",").append(pos.getY()).append(",").append(pos.getZ()).append(") ");
}
Iris.info("Strongholds (" + engineMetadata.getStrongholdPositions().size() + ") found at [" + positions + "]");
}
}
}
saveEngineMetadata();
populators = new KList<>();
if(rootDimension.getDimensionalComposite().isEmpty())
{
burster = null;
engines = new Engine[]{new IrisEngine(new EngineTarget(world, rootDimension, data, 256, maximumThreads), this, 0)};
defaultEngine = engines[0];
}
else
{
double totalWeight = 0D;
engines = new Engine[rootDimension.getDimensionalComposite().size()];
burster = engines.length > 1 ? new MultiBurst(engines.length) : null;
int threadDist = (Math.max(2, maximumThreads - engines.length)) / engines.length;
if((threadDist * engines.length) + engines.length > maximumThreads)
{
Iris.warn("Using " + ((threadDist * engines.length) + engines.length) + " threads instead of the configured " + maximumThreads + " maximum thread count due to the requirements of this dimension!");
}
for(IrisDimensionIndex i : rootDimension.getDimensionalComposite())
{
totalWeight += i.getWeight();
}
int buf = 0;
for(int i = 0; i < engines.length; i++)
{
IrisDimensionIndex index = rootDimension.getDimensionalComposite().get(i);
IrisDimension dimension = data.getDimensionLoader().load(index.getDimension());
engines[i] = new IrisEngine(new EngineTarget(world, dimension, data.copy(), (int)Math.floor(256D * (index.getWeight() / totalWeight)), index.isInverted(), threadDist), this, i);
engines[i].setMinHeight(buf);
buf += engines[i].getHeight();
if(index.isPrimary())
{
defaultEngine = engines[i];
}
}
if(defaultEngine == null)
{
defaultEngine = engines[0];
}
}
for(Engine i : engines)
{
if(i instanceof BlockPopulator)
{
populators.add((BlockPopulator) i);
}
}
Iris.instance.registerListener(this);
}
private Object getBP(Class clazz, Class clazzSG, Class clazzBP, Object nmsWorld, Object chunkGenerator) throws NoSuchFieldException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
return clazz.getDeclaredMethod("findNearestMapFeature",
nmsWorld.getClass(),
clazzSG,
clazzBP,
int.class,
boolean.class
).invoke(chunkGenerator,
nmsWorld,
clazzSG.getDeclaredField("STRONGHOLD").get(null),
clazzBP.getDeclaredField("ZERO").get(null),
100,
false
);
}
public CompletableFuture<Object> getBPSafe(Class clazz, Class clazzSG, Class clazzBP, Object nmsWorld, Object chunkGenerator) {
CompletableFuture<Object> cf = new CompletableFuture<>();
Bukkit.getScheduler().runTask(Iris.instance, () -> {
try {
cf.complete(getBP(clazz, clazzSG, clazzBP, nmsWorld, chunkGenerator));
} catch (Throwable e){
cf.complete(null);
}
});
return cf;
}
public List<IrisPosition> getStrongholdPositions()
{
return engineMetadata.getStrongholdPositions();
}
@EventHandler
public void on(WorldSaveEvent e)
{
if(world != null &&e.getWorld().equals(world))
{
save();
}
}
public void printMetrics(CommandSender sender)
{
KMap<String, Double> totals = new KMap<>();
KMap<String, Double> weights = new KMap<>();
double masterWallClock = wallClock.getAverage();
for(int i = 0; i < getSize(); i++)
{
Engine e = getEngine(i);
KMap<String, Double> timings = e.getMetrics().pull();
double totalWeight = 0;
double wallClock = e.getMetrics().getTotal().getAverage();
for(double j : timings.values())
{
totalWeight += j;
}
for(String j : timings.k())
{
weights.put(e.getName() + "[" + e.getIndex() + "]." + j, (wallClock / totalWeight) * timings.get(j));
}
totals.put(e.getName() + "[" + e.getIndex() + "]", wallClock);
}
double mtotals = 0;
for(double i : totals.values())
{
mtotals+=i;
}
for(String i : totals.k())
{
totals.put(i, (masterWallClock / mtotals) * totals.get(i));
}
double v = 0;
for(double i : weights.values())
{
v+=i;
}
for(String i : weights.k())
{
weights.put(i, weights.get(i) / v);
}
sender.sendMessage("Total: " + C.BOLD + C.WHITE + Form.duration(masterWallClock, 0));
for(String i : totals.k())
{
sender.sendMessage(" Engine " + C.UNDERLINE + C.GREEN + i + C.RESET + ": " + C.BOLD + C.WHITE + Form.duration(totals.get(i), 0));
}
sender.sendMessage("Details: ");
for(String i : weights.sortKNumber().reverse())
{
String befb = C.UNDERLINE +""+ C.GREEN + "" + i.split("\\Q[\\E")[0] + C.RESET + C.GRAY + "[";
String num = C.GOLD + i.split("\\Q[\\E")[1].split("]")[0] + C.RESET + C.GRAY + "].";
String afb = C.ITALIC +""+ C.AQUA + i.split("\\Q]\\E")[1].substring(1) + C.RESET + C.GRAY;
sender.sendMessage(" " + befb + num + afb + ": " + C.BOLD + C.WHITE + Form.pc(weights.get(i), 0));
}
}
private File getEngineMetadataFile() {
return new File(world.getWorldFolder(), "iris/engine-metadata.json");
}
@Override
public void generate(int x, int z, Hunk<BlockData> blocks, Hunk<BlockData> postblocks, Hunk<Biome> biomes)
{
recycle();
PrecisionStopwatch p = PrecisionStopwatch.start();
if(engines.length == 1 && !getEngine(0).getTarget().isInverted())
{
engines[0].generate(x, z, blocks, biomes);
}
else
{
int i;
int offset = 0;
for(i = 0; i < engines.length; i++)
{
Engine engine = engines[i];
int doffset = offset;
int height = engine.getTarget().getHeight();
Hunk<BlockData> cblock = Hunk.newArrayHunk(16, height, 16);
Hunk<Biome> cbiome = Hunk.newArrayHunk(16, height, 16);
if(engine.getTarget().isInverted())
{
cblock = cblock.invertY();
cbiome = cbiome.invertY();
}
engine.generate(x, z, cblock, cbiome);
blocks.insert(0, doffset, 0, cblock);
biomes.insert(0, doffset, 0, cbiome);
offset += height;
}
}
wallClock.put(p.getMilliseconds());
}
@Override
public int getSize() {
return engines.length;
}
@Override
public Engine getEngine(int index) {
return engines[index];
}
@Override
public void saveEngineMetadata() {
engineMetadata.save(getEngineMetadataFile());
}
@Override
public IrisDataManager getData(int height) {
return getEngineForHeight(height).getData();
}
//TODO: FAIL
@Override
public boolean isFailing() {
return false;
}
@Override
public Engine getDefaultEngine() {
return defaultEngine;
}
@Override
public void hotload() {
for(int i = 0; i < getSize(); i++)
{
getEngine(i).hotload();
}
}
}

View File

@@ -0,0 +1,86 @@
package com.volmit.iris.generator;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineAssignedComponent;
import com.volmit.iris.scaffold.engine.EngineEffects;
import com.volmit.iris.scaffold.engine.EnginePlayer;
import com.volmit.iris.util.KMap;
import com.volmit.iris.util.M;
import com.volmit.iris.util.PrecisionStopwatch;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.Semaphore;
public class IrisEngineEffects extends EngineAssignedComponent implements EngineEffects {
private KMap<UUID, EnginePlayer> players;
private Semaphore limit;
public IrisEngineEffects(Engine engine) {
super(engine, "FX");
players = new KMap<>();
limit = new Semaphore(1);
}
@Override
public void updatePlayerMap() {
List<Player> pr = getEngine().getWorld().getPlayers();
for(Player i : pr)
{
Location l = i.getLocation();
boolean pcc = players.containsKey(i.getUniqueId());
if(getEngine().contains(l))
{
if(!pcc)
{
players.put(i.getUniqueId(), new EnginePlayer(getEngine(), i));
}
}
else if(pcc)
{
players.remove(i.getUniqueId());
}
}
for(UUID i : players.k())
{
if(!pr.contains(players.get(i).getPlayer()))
{
players.remove(i);
}
}
}
@Override
public void tickRandomPlayer() {
if(limit.tryAcquire())
{
if(M.r(0.02))
{
updatePlayerMap();
limit.release();
return;
}
if(players.isEmpty())
{
limit.release();
return;
}
double limitms = 1.5;
int max = players.size();
PrecisionStopwatch p = new PrecisionStopwatch();
while(max-- > 0 && M.ms() - p.getMilliseconds() < limitms)
{
players.v().getRandom().tick();
}
limit.release();
}
}
}

View File

@@ -0,0 +1,113 @@
package com.volmit.iris.generator;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.generator.actuator.IrisBiomeActuator;
import com.volmit.iris.generator.actuator.IrisDecorantActuator;
import com.volmit.iris.generator.actuator.IrisTerrainActuator;
import com.volmit.iris.generator.modifier.IrisCaveModifier;
import com.volmit.iris.generator.modifier.IrisDepositModifier;
import com.volmit.iris.generator.modifier.IrisPostModifier;
import com.volmit.iris.generator.modifier.IrisRavineModifier;
import com.volmit.iris.scaffold.engine.*;
import com.volmit.iris.util.ChronoLatch;
import lombok.Getter;
import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData;
import java.util.concurrent.atomic.AtomicBoolean;
public class IrisEngineFramework implements EngineFramework {
@Getter
private final Engine engine;
@Getter
private final IrisComplex complex;
@Getter
final EngineParallaxManager engineParallax;
@Getter
private final EngineActuator<BlockData> terrainActuator;
@Getter
private final EngineActuator<BlockData> decorantActuator;
@Getter
private final EngineActuator<Biome> biomeActuator;
@Getter
private final EngineModifier<BlockData> depositModifier;
@Getter
private final EngineModifier<BlockData> caveModifier;
@Getter
private final EngineModifier<BlockData> ravineModifier;
@Getter
private final EngineModifier<BlockData> postModifier;
private final AtomicBoolean cleaning;
private final ChronoLatch cleanLatch;
public IrisEngineFramework(Engine engine)
{
this.engine = engine;
this.complex = new IrisComplex(getEngine());
this.engineParallax = new IrisEngineParallax(getEngine());
this.terrainActuator = new IrisTerrainActuator(getEngine());
this.decorantActuator = new IrisDecorantActuator(getEngine());
this.biomeActuator = new IrisBiomeActuator(getEngine());
this.depositModifier = new IrisDepositModifier(getEngine());
this.ravineModifier = new IrisRavineModifier(getEngine());
this.caveModifier = new IrisCaveModifier(engine);
this.postModifier = new IrisPostModifier(engine);
cleaning = new AtomicBoolean(false);
cleanLatch = new ChronoLatch(Math.max(10000, Math.min(IrisSettings.get().getParallax().getParallaxChunkEvictionMS(), IrisSettings.get().getParallax().getParallaxRegionEvictionMS())));
}
@Override
public synchronized void recycle() {
if(!cleanLatch.flip())
{
return;
}
if (cleaning.get())
{
cleanLatch.flipDown();
return;
}
cleaning.set(true);
try
{
getEngine().getParallax().cleanup();
getData().getObjectLoader().clean();
}
catch(Throwable e)
{
Iris.error("Cleanup failed!");
e.printStackTrace();
}
cleaning.lazySet(false);
}
@Override
public void close()
{
getEngineParallax().close();
getTerrainActuator().close();
getDecorantActuator().close();
getBiomeActuator().close();
getDepositModifier().close();
getRavineModifier().close();
getCaveModifier().close();
getPostModifier().close();
}
}

View File

@@ -0,0 +1,19 @@
package com.volmit.iris.generator;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineParallaxManager;
import lombok.Getter;
public class IrisEngineParallax implements EngineParallaxManager {
@Getter
private final Engine engine;
@Getter
private final int parallaxSize;
public IrisEngineParallax(Engine engine)
{
this.engine = engine;
parallaxSize = computeParallaxSize();
}
}

View File

@@ -0,0 +1,171 @@
package com.volmit.iris.generator;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.object.*;
import com.volmit.iris.scaffold.cache.Cache;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineAssignedWorldManager;
import com.volmit.iris.util.J;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.RNG;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntitySpawnEvent;
public class IrisWorldManager extends EngineAssignedWorldManager {
private boolean spawnable;
public IrisWorldManager(Engine engine) {
super(engine);
spawnable = true;
}
@Override
public void onTick() {
}
@Override
public void onSave() {
getEngine().getParallax().saveAll();
}
@Override
public void spawnInitialEntities(Chunk c) {
RNG rng = new RNG(Cache.key(c));
getEngine().getParallaxAccess().getEntitiesR(c.getX(), c.getZ()).iterateSync((x,y,z,e) -> {
if(e != null)
{
IrisEntity en = getData().getEntityLoader().load(e);
if(en != null){
en.spawn(getEngine(), new Location(c.getWorld(), x+(c.getX()<<4),y,z+(c.getZ()<<4)));
}
}
});
int x = (c.getX() * 16) + rng.nextInt(15);
int z = (c.getZ() * 16) + rng.nextInt(15);
int y = getEngine().getHeight(x, z) + 1;
IrisDimension dim = getDimension();
IrisRegion region = getEngine().getRegion(x, z);
IrisBiome above = getEngine().getSurfaceBiome(x, z);
trySpawn(above.getEntityInitialSpawns(), c, rng);
trySpawn(region.getEntityInitialSpawns(), c, rng);
trySpawn(dim.getEntityInitialSpawns(), c, rng);
}
@Override
public void onEntitySpawn(EntitySpawnEvent e)
{
if(getTarget().getWorld() == null || !getTarget().getWorld().equals(e.getEntity().getWorld()))
{
return;
}
try
{
if(!IrisSettings.get().getGenerator().isSystemEntitySpawnOverrides())
{
return;
}
int x = e.getEntity().getLocation().getBlockX();
int y = e.getEntity().getLocation().getBlockY();
int z = e.getEntity().getLocation().getBlockZ();
J.a(() ->
{
if(spawnable)
{
IrisDimension dim = getDimension();
IrisRegion region = getEngine().getRegion(x, z);
IrisBiome above = getEngine().getSurfaceBiome(x, z);
IrisBiome bbelow = getEngine().getBiome(x, y, z);
if(above.getLoadKey().equals(bbelow.getLoadKey()))
{
bbelow = null;
}
IrisBiome below = bbelow;
J.s(() ->
{
if(below != null)
{
if(trySpawn(below.getEntitySpawnOverrides(), e))
{
return;
}
}
if(trySpawn(above.getEntitySpawnOverrides(), e))
{
return;
}
if(trySpawn(region.getEntitySpawnOverrides(), e))
{
return;
}
if(trySpawn(dim.getEntitySpawnOverrides(), e))
{
return;
}
});
}
});
}
catch(Throwable xe)
{
}
}
private boolean trySpawn(KList<IrisEntitySpawnOverride> s, EntitySpawnEvent e)
{
for(IrisEntitySpawnOverride i : s)
{
spawnable = false;
if(i.on(getEngine(), e.getLocation(), e.getEntityType(), e) != null)
{
e.setCancelled(true);
e.getEntity().remove();
return true;
}
else
{
spawnable = true;
}
}
return false;
}
private void trySpawn(KList<IrisEntityInitialSpawn> s, Chunk c, RNG rng)
{
for(IrisEntityInitialSpawn i : s)
{
i.spawn(getEngine(), c, rng);
}
}
@Override
public void onBlockBreak(BlockBreakEvent e) {
}
@Override
public void onBlockPlace(BlockPlaceEvent e) {
}
}

View File

@@ -0,0 +1,45 @@
package com.volmit.iris.generator.actuator;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineAssignedActuator;
import com.volmit.iris.scaffold.hunk.Hunk;
import com.volmit.iris.scaffold.parallel.BurstExecutor;
import com.volmit.iris.scaffold.parallel.MultiBurst;
import com.volmit.iris.util.PrecisionStopwatch;
import com.volmit.iris.util.RNG;
import org.bukkit.block.Biome;
public class IrisBiomeActuator extends EngineAssignedActuator<Biome>
{
public IrisBiomeActuator(Engine engine) {
super(engine, "Biome");
}
@Override
public void onActuate(int x, int z, Hunk<Biome> h) {
PrecisionStopwatch p = PrecisionStopwatch.start();
int zf,hh;
BurstExecutor burst = MultiBurst.burst.burst(h.getWidth() * h.getDepth());
for(int xf = 0; xf < h.getWidth(); xf++)
{
for(zf = 0; zf < h.getDepth(); zf++)
{
int xxf = xf;
int zzf = zf;
burst.queue(() -> {
Biome v = getComplex().getTrueBiomeStream().get(modX(xxf+x), modZ(zzf+z)).getSkyBiome(RNG.r, x, 0, z);
for(int i = 0; i < h.getHeight(); i++)
{
h.set(xxf, i, zzf, v);
}
});
}
}
burst.complete();
getEngine().getMetrics().getBiome().put(p.getMilliseconds());
}
}

View File

@@ -0,0 +1,121 @@
package com.volmit.iris.generator.actuator;
import com.volmit.iris.object.IrisBiome;
import com.volmit.iris.util.PrecisionStopwatch;
import com.volmit.iris.util.RNG;
import com.volmit.iris.generator.decorator.IrisCeilingDecorator;
import com.volmit.iris.generator.decorator.IrisSeaSurfaceDecorator;
import com.volmit.iris.generator.decorator.IrisShoreLineDecorator;
import com.volmit.iris.generator.decorator.IrisSurfaceDecorator;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineAssignedActuator;
import com.volmit.iris.scaffold.engine.EngineDecorator;
import com.volmit.iris.scaffold.hunk.Hunk;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import java.util.function.Predicate;
public class IrisDecorantActuator extends EngineAssignedActuator<BlockData>
{
private static final Predicate<BlockData> PREDICATE_SOLID = (b) -> b != null && !b.getMaterial().isAir() && !b.getMaterial().equals(Material.WATER) && !b.getMaterial().equals(Material.LAVA);
private final RNG rng;
@Getter
private final EngineDecorator surfaceDecorator;
@Getter
private final EngineDecorator ceilingDecorator;
@Getter
private final EngineDecorator seaSurfaceDecorator;
@Getter
private final EngineDecorator shoreLineDecorator;
private final boolean shouldRay;
public IrisDecorantActuator(Engine engine) {
super(engine, "Decorant");
shouldRay = shouldRayDecorate();
this.rng = new RNG(engine.getTarget().getWorld().getSeed());
surfaceDecorator = new IrisSurfaceDecorator(getEngine());
ceilingDecorator = new IrisCeilingDecorator(getEngine());
seaSurfaceDecorator = new IrisSeaSurfaceDecorator(getEngine());
shoreLineDecorator = new IrisShoreLineDecorator(getEngine());
}
@Override
public void onActuate(int x, int z, Hunk<BlockData> output) {
if(!getEngine().getDimension().isDecorate())
{
return;
}
PrecisionStopwatch p = PrecisionStopwatch.start();
boolean solid;
int emptyFor = 0;
int lastSolid = 0;
int j, realX, realZ, height;
IrisBiome biome, cave;
for(int i = 0; i < output.getWidth(); i++)
{
for(j = 0; j < output.getDepth(); j++)
{
realX = (int) Math.round(modX(x + i));
realZ = (int) Math.round(modZ(z + j));
height = (int) Math.round(getComplex().getHeightStream().get(realX, realZ));
biome = getComplex().getTrueBiomeStream().get(realX, realZ);
cave = shouldRay ? getComplex().getCaveBiomeStream().get(realX, realZ) : null;
if(biome.getDecorators().isEmpty() && (cave == null || cave.getDecorators().isEmpty()))
{
continue;
}
if(height == getDimension().getFluidHeight())
{
getShoreLineDecorator().decorate(i, j,
realX, (int) Math.round(modX(x + i+1)), (int) Math.round(modX(x + i-1)),
realZ, (int) Math.round(modZ(z + j+1)), (int) Math.round(modZ(z + j-1)),
output, biome, height, getEngine().getHeight() - height);
}
else if(height < getDimension().getFluidHeight())
{
getSeaSurfaceDecorator().decorate(i, j, realX, realZ, output, biome, getDimension().getFluidHeight(), getEngine().getHeight() - getDimension().getFluidHeight());
}
getSurfaceDecorator().decorate(i, j, realX, realZ, output, biome, height, getEngine().getHeight() - height);
if(cave != null && cave.getDecorators().isNotEmpty())
{
for(int k = height; k > 0; k--)
{
solid = PREDICATE_SOLID.test(output.get(i, k, j));
if(solid)
{
lastSolid = k;
}
else {
emptyFor++;
}
if(solid && emptyFor > 0)
{
getCeilingDecorator().decorate(i, j, realX, realZ, output, cave, lastSolid, emptyFor);
getSurfaceDecorator().decorate(i, j, realX, realZ, output, cave, k, emptyFor);
emptyFor = 0;
}
}
}
}
}
getEngine().getMetrics().getDecoration().put(p.getMilliseconds());
}
private boolean shouldRayDecorate()
{
return getEngine().getDimension().isCarving() || getEngine().getDimension().isCaves() || getEngine().getDimension().isRavines();
}
}

View File

@@ -0,0 +1,115 @@
package com.volmit.iris.generator.actuator;
import com.volmit.iris.object.IrisBiome;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.PrecisionStopwatch;
import com.volmit.iris.util.RNG;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineAssignedActuator;
import com.volmit.iris.scaffold.hunk.Hunk;
import lombok.Getter;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
public class IrisTerrainActuator extends EngineAssignedActuator<BlockData>
{
private static final BlockData AIR = Material.AIR.createBlockData();
private static final BlockData BEDROCK = Material.BEDROCK.createBlockData();
private static final BlockData CAVE_AIR = Material.CAVE_AIR.createBlockData();
@Getter
private final RNG rng;
private final boolean hasUnder;
public IrisTerrainActuator(Engine engine) {
super(engine, "Terrain");
rng = new RNG(engine.getWorld().getSeed());
hasUnder = getDimension().getUndercarriage() != null && !getDimension().getUndercarriage().getGenerator().isFlat();
}
@Override
public void onActuate(int x, int z, Hunk<BlockData> h) {
PrecisionStopwatch p = PrecisionStopwatch.start();
int i, zf, depth, realX, realZ, hf, he, b, fdepth;
IrisBiome biome;
KList<BlockData> blocks, fblocks;
for(int xf = 0; xf < h.getWidth(); xf++)
{
for(zf = 0; zf < h.getDepth(); zf++)
{
realX = (int) modX(xf + x);
realZ = (int) modZ(zf + z);
b = hasUnder ? (int) Math.round(getDimension().getUndercarriage().get(rng, realX, realZ)) : 0;
he = (int) Math.round(Math.min(h.getHeight(), getComplex().getHeightStream().get(realX, realZ)));
hf = (int) Math.round(Math.max(Math.min(h.getHeight(), getDimension().getFluidHeight()), he));
biome = getComplex().getTrueBiomeStream().get(realX, realZ);
blocks = null;
fblocks = null;
if(hf < b)
{
continue;
}
for(i = hf; i >= b; i--) {
if (i >= h.getHeight())
{
continue;
}
if(i == b)
{
if(getDimension().isBedrock())
{
h.set(xf, i, zf, BEDROCK);
continue;
}
}
if(getDimension().isCarved(realX, i, realZ, rng, he))
{
continue;
}
if(i > he && i <= hf)
{
fdepth = hf - i;
if(fblocks == null)
{
fblocks = biome.generateSeaLayers(realX, realZ, rng, hf - he, getData());
}
if(fblocks.hasIndex(fdepth))
{
h.set(xf, i, zf, fblocks.get(fdepth));
continue;
}
h.set(xf, i, zf, getComplex().getFluidStream().get(realX, +realZ));
continue;
}
if(i <= he)
{
depth = he - i;
if(blocks == null)
{
blocks = biome.generateLayers(realX, realZ, rng, (int)he, (int)he, getData(), getComplex());
}
if(blocks.hasIndex(depth))
{
h.set(xf, i, zf, blocks.get(depth));
continue;
}
h.set(xf, i, zf, getComplex().getRockStream().get(realX, realZ));
}
}
}
}
getEngine().getMetrics().getTerrain().put(p.getMilliseconds());
}
}

View File

@@ -0,0 +1,39 @@
package com.volmit.iris.generator.decorator;
import com.volmit.iris.object.DecorationPart;
import com.volmit.iris.object.IrisBiome;
import com.volmit.iris.object.IrisDecorator;
import com.volmit.iris.scaffold.cache.Cache;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.hunk.Hunk;
import org.bukkit.block.data.BlockData;
public class IrisCeilingDecorator extends IrisEngineDecorator
{
public IrisCeilingDecorator(Engine engine) {
super(engine, "Ceiling", DecorationPart.CEILING);
}
@Override
public void decorate(int x, int z, int realX, int realX1, int realX_1, int realZ, int realZ1, int realZ_1, Hunk<BlockData> data, IrisBiome biome, int height, int max) {
IrisDecorator decorator = getDecorator(biome, realX, realZ);
if(decorator != null)
{
if(!decorator.isStacking())
{
data.set(x, height-1, z, decorator.getBlockData100(biome, getRng(), realX, realZ, getData()));
}
else
{
int stack = Math.min(getRng().nextParallelRNG(Cache.key(realX, realZ)).i(decorator.getStackMin(), decorator.getStackMax()), max);
for(int i = 0; i < stack; i++)
{
data.set(x, height-1-i, z, i == stack-1 ? decorator.getBlockDataForTop(biome, getRng(), realX+i, realZ-i, getData()) : decorator.getBlockData100(biome, getRng(), realX+i, realZ-i, getData()));
}
}
}
}
}

View File

@@ -0,0 +1,47 @@
package com.volmit.iris.generator.decorator;
import com.volmit.iris.object.DecorationPart;
import com.volmit.iris.object.IrisBiome;
import com.volmit.iris.object.IrisDecorator;
import com.volmit.iris.scaffold.cache.Cache;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.RNG;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineAssignedComponent;
import com.volmit.iris.scaffold.engine.EngineDecorator;
import lombok.Getter;
public abstract class IrisEngineDecorator extends EngineAssignedComponent implements EngineDecorator {
@Getter
private final RNG rng;
@Getter
private final DecorationPart part;
public IrisEngineDecorator(Engine engine, String name, DecorationPart part) {
super(engine, name + " Decorator");
this.part = part;
this.rng = new RNG(getSeed() + 29356788 - (part.ordinal() * 10439677));
}
protected IrisDecorator getDecorator(IrisBiome biome, double realX, double realZ)
{
KList<IrisDecorator> v = new KList<>();
RNG rng = new RNG(Cache.key((int)realX, (int)realZ));
for(IrisDecorator i : biome.getDecorators())
{
if(i.getPartOf().equals(part) && i.getBlockData(biome, this.rng, realX, realZ, getData()) != null)
{
v.add(i);
}
}
if(v.isNotEmpty()) {
return v.get(rng.nextInt(v.size()));
}
return null;
}
}

View File

@@ -0,0 +1,43 @@
package com.volmit.iris.generator.decorator;
import com.volmit.iris.object.DecorationPart;
import com.volmit.iris.object.IrisBiome;
import com.volmit.iris.object.IrisDecorator;
import com.volmit.iris.scaffold.cache.Cache;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.hunk.Hunk;
import org.bukkit.block.data.BlockData;
public class IrisSeaSurfaceDecorator extends IrisEngineDecorator
{
public IrisSeaSurfaceDecorator(Engine engine) {
super(engine, "Sea Surface", DecorationPart.SEA_SURFACE);
}
@Override
public void decorate(int x, int z, int realX, int realX1, int realX_1, int realZ, int realZ1, int realZ_1, Hunk<BlockData> data, IrisBiome biome, int height, int max) {
if(height < getDimension().getFluidHeight()) {
{
IrisDecorator decorator = getDecorator(biome, realX, realZ);
if(decorator != null)
{
if(!decorator.isStacking())
{
data.set(x, getDimension().getFluidHeight()+1, z, decorator.getBlockData100(biome, getRng(), realX, realZ, getData()));
}
else
{
int stack = Math.min(getRng().nextParallelRNG(Cache.key(realX, realZ)).i(decorator.getStackMin(), decorator.getStackMax()), max);
for(int i = 0; i < stack; i++)
{
data.set(x, getDimension().getFluidHeight()+1+i, z, i == stack-1 ? decorator.getBlockDataForTop(biome, getRng(), realX+i, realZ-i, getData()) : decorator.getBlockData100(biome, getRng(), realX+i, realZ-i, getData()));
}
}
}
}
}
}
}

View File

@@ -0,0 +1,49 @@
package com.volmit.iris.generator.decorator;
import com.volmit.iris.object.DecorationPart;
import com.volmit.iris.object.IrisBiome;
import com.volmit.iris.object.IrisDecorator;
import com.volmit.iris.scaffold.cache.Cache;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.hunk.Hunk;
import org.bukkit.block.data.BlockData;
public class IrisShoreLineDecorator extends IrisEngineDecorator
{
public IrisShoreLineDecorator(Engine engine) {
super(engine, "Shore Line", DecorationPart.SHORE_LINE);
}
@Override
public void decorate(int x, int z, int realX, int realX1, int realX_1, int realZ, int realZ1, int realZ_1, Hunk<BlockData> data, IrisBiome biome, int height, int max) {
if(height == getDimension().getFluidHeight()) {
if (Math.round(getComplex().getHeightStream().get(realX1, realZ)) < getComplex().getFluidHeight() ||
Math.round(getComplex().getHeightStream().get(realX_1, realZ)) < getComplex().getFluidHeight() ||
Math.round(getComplex().getHeightStream().get(realX, realZ1)) < getComplex().getFluidHeight() ||
Math.round(getComplex().getHeightStream().get(realX, realZ_1)) < getComplex().getFluidHeight()
)
{
IrisDecorator decorator = getDecorator(biome, realX, realZ);
if(decorator != null)
{
if(!decorator.isStacking())
{
data.set(x, height+1, z, decorator.getBlockData100(biome, getRng(), realX, realZ, getData()));
}
else
{
int stack = Math.min(getRng().nextParallelRNG(Cache.key(realX, realZ)).i(decorator.getStackMin(), decorator.getStackMax()), max);
for(int i = 0; i < stack; i++)
{
data.set(x, height+1+i, z, i == stack-1 ? decorator.getBlockDataForTop(biome, getRng(), realX+i, realZ-i, getData()) : decorator.getBlockData100(biome, getRng(), realX+i, realZ-i, getData()));
}
}
}
}
}
}
}

View File

@@ -0,0 +1,98 @@
package com.volmit.iris.generator.decorator;
import com.volmit.iris.object.DecorationPart;
import com.volmit.iris.object.InferredType;
import com.volmit.iris.object.IrisBiome;
import com.volmit.iris.object.IrisDecorator;
import com.volmit.iris.scaffold.cache.Cache;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.hunk.Hunk;
import org.bukkit.block.data.Bisected;
import org.bukkit.block.data.BlockData;
public class IrisSurfaceDecorator extends IrisEngineDecorator
{
public IrisSurfaceDecorator(Engine engine) {
super(engine, "Surface", DecorationPart.NONE);
}
@Override
public void decorate(int x, int z, int realX, int realX1, int realX_1, int realZ, int realZ1, int realZ_1, Hunk<BlockData> data, IrisBiome biome, int height, int max) {
if(biome.getInferredType().equals(InferredType.SHORE) && height < getDimension().getFluidHeight())
{
return;
}
BlockData bd, bdx;
IrisDecorator decorator = getDecorator(biome, realX, realZ);
bdx = data.get(x, height, z);
boolean underwater = height < getDimension().getFluidHeight();
if(decorator != null)
{
if(!decorator.isStacking())
{
bd = decorator.getBlockData100(biome, getRng(), realX, realZ, getData());
if(!underwater)
{
if(!canGoOn(bd, bdx))
{
return;
}
}
if(bd instanceof Bisected)
{
bd = bd.clone();
((Bisected)bd).setHalf(Bisected.Half.TOP);
try
{
data.set(x, height+2, z, bd);
}
catch(Throwable e)
{
}
bd = bd.clone();
((Bisected)bd).setHalf(Bisected.Half.BOTTOM);
}
data.set(x, height+1, z, bd);
}
else {
if (height < getDimension().getFluidHeight())
{
max = getDimension().getFluidHeight() - height;
}
int stack = Math.min(getRng().nextParallelRNG(Cache.key(realX, realZ)).i(decorator.getStackMin(), decorator.getStackMax()), max);
for(int i = 0; i < stack; i++)
{
bd = i == stack-1 ? decorator.getBlockDataForTop(biome, getRng(), realX+i, realZ-i, getData()) : decorator.getBlockData100(biome, getRng(), realX+i, realZ-i, getData());
if(bd == null && i == stack-1)
{
bd = decorator.getBlockData100(biome, getRng(), realX+i, realZ-i, getData());
}
if(bd == null)
{
return;
}
if(i == 0 && !underwater && !canGoOn(bd, bdx))
{
return;
}
data.set(x, height+1+i, z, bd);
}
}
}
}
}

View File

@@ -0,0 +1,261 @@
package com.volmit.iris.generator.modifier;
import com.volmit.iris.generator.noise.FastNoiseDouble;
import com.volmit.iris.object.IrisBiome;
import com.volmit.iris.object.IrisCaveLayer;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineAssignedModifier;
import com.volmit.iris.scaffold.hunk.Hunk;
import com.volmit.iris.util.*;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import java.util.function.Function;
public class IrisCaveModifier extends EngineAssignedModifier<BlockData>
{
public static final BlockData CAVE_AIR = B.get("CAVE_AIR");
public static final BlockData AIR = B.get("AIR");
private static final KList<CaveResult> EMPTY = new KList<>();
private final FastNoiseDouble gg;
private final RNG rng;
public IrisCaveModifier(Engine engine) {
super(engine, "Cave");
rng = new RNG(engine.getWorld().getSeed() + 28934555);
gg = new FastNoiseDouble(324895L * rng.nextParallelRNG(49678).imax());
}
@Override
public void onModify(int x, int z, Hunk<BlockData> a) {
if(!getDimension().isCaves())
{
return;
}
PrecisionStopwatch p = PrecisionStopwatch.start();
for(int i = 0; i < a.getWidth(); i++)
{
for(int j = 0; j < a.getDepth(); j++)
{
KList<CaveResult> caves = genCaves(x + i, z + j, i, j, a);
int he = (int) Math.round(getComplex().getHeightStream().get(x+i, z+j));
if(caves != null && caves.isNotEmpty())
{
IrisBiome cave = getComplex().getCaveBiomeStream().get(x + i, z + j);
if(cave == null)
{
continue;
}
for(CaveResult cl : caves)
{
if(cl.getFloor() < 0 || cl.getFloor() > getEngine().getHeight() || cl.getCeiling() > getEngine().getHeight() || cl.getCeiling() < 0)
{
continue;
}
KList<BlockData> floor = cave.generateLayers(x + i, z + j, rng, cl.getFloor(), cl.getFloor(), getData(), getComplex());
KList<BlockData> ceiling = cave.generateLayers(x + i + 656, z + j - 656, rng,
he - cl.getCeiling(),
he - cl.getCeiling(), getData(), getComplex());
for(int g = 0; g < floor.size(); g++)
{
a.set(i, cl.getFloor() - g, j, floor.get(g));
}
for(int g = ceiling.size() - 1; g > 0; g--)
{
a.set(i, cl.getCeiling() + g, j, ceiling.get(g));
}
}
}
}
}
getEngine().getMetrics().getCave().put(p.getMilliseconds());
}
public KList<CaveResult> genCaves(double wxx, double wzz, int x, int z, Hunk<BlockData> data)
{
if(!getDimension().isCaves())
{
return EMPTY;
}
KList<CaveResult> result = new KList<>();
gg.setNoiseType(FastNoiseDouble.NoiseType.Cellular);
gg.setCellularReturnType(FastNoiseDouble.CellularReturnType.Distance2Sub);
gg.setCellularDistanceFunction(FastNoiseDouble.CellularDistanceFunction.Natural);
for(int i = 0; i < getDimension().getCaveLayers().size(); i++)
{
IrisCaveLayer layer = getDimension().getCaveLayers().get(i);
generateCave(result, wxx, wzz, x, z, data, layer, i);
}
return result;
}
public void generateCave(KList<CaveResult> result, double wxx, double wzz, int x, int z, Hunk<BlockData> data, IrisCaveLayer layer, int seed)
{
double scale = layer.getCaveZoom();
Function<Integer, BlockData> fluid = (height) ->
{
if(!layer.getFluid().hasFluid(getData()))
{
return CAVE_AIR;
}
if(layer.getFluid().isInverseHeight() && height >= layer.getFluid().getFluidHeight())
{
return layer.getFluid().getFluid(getData());
}
else if(!layer.getFluid().isInverseHeight() && height <= layer.getFluid().getFluidHeight())
{
return layer.getFluid().getFluid(getData());
}
return CAVE_AIR;
};
int surface = (int) Math.round(getComplex().getHeightStream().get(wxx, wzz));
double wx = wxx + layer.getHorizontalSlope().get(rng, wxx, wzz);
double wz = wzz + layer.getHorizontalSlope().get(rng, -wzz, -wxx);
double baseWidth = (14 * scale);
double distanceCheck = 0.0132 * baseWidth;
double distanceTake = 0.0022 * baseWidth;
double caveHeightNoise = layer.getVerticalSlope().get(rng, wxx, wzz);
if(caveHeightNoise > 259 || caveHeightNoise < -1)
{
return;
}
int ceiling = -256;
int floor = 512;
for(double tunnelHeight = 1; tunnelHeight <= baseWidth; tunnelHeight++)
{
double distance = (gg.GetCellular(((wx + (10000 * seed)) / layer.getCaveZoom()), ((wz - (10000 * seed)) / layer.getCaveZoom())) + 1D) / 2D;
if(distance < distanceCheck - (tunnelHeight * distanceTake))
{
int caveHeight = (int) Math.round(caveHeightNoise);
int pu = (int) (caveHeight + tunnelHeight);
int pd = (int) (caveHeight - tunnelHeight);
if(pd > surface + 1)
{
continue;
}
if(!layer.isCanBreakSurface() && pu > surface - 3)
{
continue;
}
if((pu > 255 && pd > 255) || (pu < 0 && pd < 0))
{
continue;
}
if(data == null)
{
ceiling = Math.max(pu, ceiling);
floor = Math.min(pu, floor);
ceiling = Math.max(pd, ceiling);
floor = Math.min(pd, floor);
if(tunnelHeight == 1)
{
ceiling = Math.max(caveHeight, ceiling);
floor = Math.min(caveHeight, floor);
}
}
else
{
if(dig(x, pu, z, data, fluid))
{
ceiling = Math.max(pu, ceiling);
floor = Math.min(pu, floor);
}
if(dig(x, pd, z, data, fluid))
{
ceiling = Math.max(pd, ceiling);
floor = Math.min(pd, floor);
}
if(tunnelHeight == 1)
{
if(dig(x, caveHeight, z, data, fluid))
{
ceiling = Math.max(caveHeight, ceiling);
floor = Math.min(caveHeight, floor);
}
}
}
}
}
if(floor >= 0 && ceiling <= 255)
{
result.add(new CaveResult(floor, ceiling));
}
}
private Material mat(int x, int y, int z, Hunk<BlockData> data)
{
BlockData d = data.get(Math.max(x, 0),Math.max(y, 0),Math.max(z,0));
if(d != null)
{
return d.getMaterial();
}
return Material.CAVE_AIR;
}
public boolean dig(int x, int y, int z, Hunk<BlockData> data, Function<Integer, BlockData> caveFluid)
{
Material a = mat(x,y,z, data);
Material c = mat(x, y + 1, z, data);
Material d = mat(x, y + 2, z, data);
Material e = mat(x, y + 3, z, data);
Material f = mat(x, y - 1, z, data);
BlockData b = caveFluid.apply(y);
BlockData b2 = caveFluid.apply(y + 1);
if(can(a) && canAir(c, b) && canAir(f, b) && canWater(d) && canWater(e))
{
data.set(x, y, z, b);
data.set(x, y + 1, z, b2);
return true;
}
return false;
}
public boolean canAir(Material m, BlockData caveFluid)
{
return (B.isSolid(m) ||
(B.isDecorant(m.createBlockData())) || m.equals(Material.AIR)
|| m.equals(caveFluid.getMaterial()) ||
m.equals(B.getMaterial("CAVE_AIR")))
&& !m.equals(Material.BEDROCK);
}
public boolean canWater(Material m)
{
return !m.equals(Material.WATER);
}
public boolean can(Material m)
{
return B.isSolid(m) && !m.equals(Material.BEDROCK);
}
}

View File

@@ -0,0 +1,134 @@
package com.volmit.iris.generator.modifier;
import com.volmit.iris.object.IrisBiome;
import com.volmit.iris.object.IrisDepositGenerator;
import com.volmit.iris.object.IrisObject;
import com.volmit.iris.object.IrisRegion;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineAssignedModifier;
import com.volmit.iris.scaffold.hunk.Hunk;
import com.volmit.iris.util.HeightMap;
import com.volmit.iris.util.PrecisionStopwatch;
import com.volmit.iris.util.RNG;
import org.bukkit.block.data.BlockData;
import org.bukkit.util.BlockVector;
public class IrisDepositModifier extends EngineAssignedModifier<BlockData> {
private final RNG rng;
public IrisDepositModifier(Engine engine) {
super(engine, "Deposit");
rng = new RNG(getEngine().getWorld().getSeed()+12938).nextParallelRNG(28348777);
}
@Override
public void onModify(int x, int z, Hunk<BlockData> output) {
PrecisionStopwatch p = PrecisionStopwatch.start();
generateDeposits(rng, output, Math.floorDiv(x, 16), Math.floorDiv(z, 16));
getEngine().getMetrics().getDeposit().put(p.getMilliseconds());
}
public void generateDeposits(RNG rx, Hunk<BlockData> terrain, int x, int z)
{
RNG ro = rx.nextParallelRNG(x * x).nextParallelRNG(z * z);
IrisRegion region = getComplex().getRegionStream().get((x * 16) + 7, (z * 16) + 7);
IrisBiome biome = getComplex().getTrueBiomeStream().get((x * 16) + 7, (z * 16) + 7);
for(IrisDepositGenerator k : getDimension().getDeposits())
{
generate(k, terrain, ro, x, z, false);
}
for(IrisDepositGenerator k : region.getDeposits())
{
for(int l = 0; l < ro.i(k.getMinPerChunk(), k.getMaxPerChunk()); l++)
{
generate(k, terrain, ro, x, z, false);
}
}
for(IrisDepositGenerator k : biome.getDeposits())
{
for(int l = 0; l < ro.i(k.getMinPerChunk(), k.getMaxPerChunk()); l++)
{
generate(k, terrain, ro, x, z, false);
}
}
}
public void generate(IrisDepositGenerator k, Hunk<BlockData> data, RNG rng, int cx, int cz, boolean safe)
{
generate(k, data, rng, cx, cz, safe, null);
}
public void generate(IrisDepositGenerator k, Hunk<BlockData> data, RNG rng, int cx, int cz, boolean safe, HeightMap he)
{
for(int l = 0; l < rng.i(k.getMinPerChunk(), k.getMaxPerChunk()); l++)
{
IrisObject clump = k.getClump(rng, getData());
int af = (int) Math.ceil(clump.getW() / 2D);
int bf = (int) Math.floor(16D - (clump.getW() / 2D));
if(af > bf || af < 0 || bf > 15 || af > 15 || bf < 0)
{
af = 6;
bf = 9;
}
int x = rng.i(af, bf);
int z = rng.i(af, bf);
int height = (he != null ? he.getHeight((cx << 4) + x, (cz << 4) + z) : (int) (Math.round(
getComplex().getHeightStream().get((cx << 4) + x, (cz << 4) + z)
))) - 7;
if(height <= 0)
{
return;
}
int i = Math.max(0, k.getMinHeight());
int a = Math.min(height, Math.min(256, k.getMaxHeight()));
if(i >= a)
{
return;
}
int h = rng.i(i, a);
if(h > k.getMaxHeight() || h < k.getMinHeight() || h > height - 2)
{
return;
}
for(BlockVector j : clump.getBlocks().keySet())
{
int nx = j.getBlockX() + x;
int ny = j.getBlockY() + h;
int nz = j.getBlockZ() + z;
if(ny > height || nx > 15 || nx < 0 || ny > 255 || ny < 0 || nz < 0 || nz > 15)
{
continue;
}
boolean allow = false;
BlockData b = data.get(nx, ny, nz);
if(b != null) {
for (BlockData f : getDimension().getRockPalette().getBlockData(getData())) {
if (f.getMaterial().equals(b.getMaterial())) {
allow = true;
break;
}
}
}
if(allow)
{
data.set(nx, ny, nz, clump.getBlocks().get(j));
}
}
}
}
}

View File

@@ -0,0 +1,551 @@
package com.volmit.iris.generator.modifier;
import com.volmit.iris.object.IrisBiome;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineAssignedModifier;
import com.volmit.iris.scaffold.hunk.Hunk;
import com.volmit.iris.scaffold.parallel.BurstExecutor;
import com.volmit.iris.scaffold.parallel.MultiBurst;
import com.volmit.iris.util.B;
import com.volmit.iris.util.CaveResult;
import com.volmit.iris.util.PrecisionStopwatch;
import com.volmit.iris.util.RNG;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Levelled;
import org.bukkit.block.data.Waterlogged;
import org.bukkit.block.data.type.Slab;
public class IrisPostModifier extends EngineAssignedModifier<BlockData> {
private static final BlockData AIR = B.get("CAVE_AIR");
private static final BlockData WATER = B.get("WATER");
private final RNG rng;
public IrisPostModifier(Engine engine) {
super(engine, "Post");
rng = new RNG(getEngine().getWorld().getSeed()+12938).nextParallelRNG(28348777);
}
@Override
public void onModify(int x, int z, Hunk<BlockData> output) {
PrecisionStopwatch p = PrecisionStopwatch.start();
BurstExecutor b = MultiBurst.burst.burst(output.getWidth() * output.getDepth());
int i, j;
for(i = 0; i < output.getWidth(); i++)
{
int ii = i;
for(j = 0; j < output.getDepth(); j++)
{
int jj = j;
b.queue(() -> post(ii, jj, output, ii+x, jj+z));
}
}
b.complete();
getEngine().getMetrics().getPost().put(p.getMilliseconds());
}
private void post(int currentPostX, int currentPostZ, Hunk<BlockData> currentData, int x, int z) {
int h = getFramework().getEngineParallax().trueHeight(x, z);
int ha = getFramework().getEngineParallax().trueHeight(x + 1, z);
int hb = getFramework().getEngineParallax().trueHeight(x, z + 1);
int hc = getFramework().getEngineParallax().trueHeight(x - 1, z);
int hd = getFramework().getEngineParallax().trueHeight(x, z - 1);
// Floating Nibs
int g = 0;
if(h < 1)
{
return;
}
g += ha < h - 1 ? 1 : 0;
g += hb < h - 1 ? 1 : 0;
g += hc < h - 1 ? 1 : 0;
g += hd < h - 1 ? 1 : 0;
if(g == 4 && isAir(x, h - 1, z, currentPostX, currentPostZ, currentData))
{
setPostBlock(x, h, z, AIR, currentPostX, currentPostZ, currentData);
for(int i = h - 1; i > 0; i--)
{
if(!isAir(x, i, z, currentPostX, currentPostZ, currentData))
{
h = i;
break;
}
}
}
// Nibs
g = 0;
g += ha == h - 1 ? 1 : 0;
g += hb == h - 1 ? 1 : 0;
g += hc == h - 1 ? 1 : 0;
g += hd == h - 1 ? 1 : 0;
if(g >= 4)
{
BlockData bc = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData);
BlockData b = getPostBlock(x, h + 1, z, currentPostX, currentPostZ, currentData);
Material m = bc.getMaterial();
if((b.getMaterial().isOccluding() && b.getMaterial().isSolid()))
{
if(m.isSolid())
{
setPostBlock(x, h, z, b, currentPostX, currentPostZ, currentData);
h--;
}
}
}
else
{
// Potholes
g = 0;
g += ha == h + 1 ? 1 : 0;
g += hb == h + 1 ? 1 : 0;
g += hc == h + 1 ? 1 : 0;
g += hd == h + 1 ? 1 : 0;
if(g >= 4)
{
BlockData ba = getPostBlock(x, ha, z, currentPostX, currentPostZ, currentData);
BlockData bb = getPostBlock(x, hb, z, currentPostX, currentPostZ, currentData);
BlockData bc = getPostBlock(x, hc, z, currentPostX, currentPostZ, currentData);
BlockData bd = getPostBlock(x, hd, z, currentPostX, currentPostZ, currentData);
g = 0;
g = B.isSolid(ba) ? g + 1 : g;
g = B.isSolid(bb) ? g + 1 : g;
g = B.isSolid(bc) ? g + 1 : g;
g = B.isSolid(bd) ? g + 1 : g;
if(g >= 3)
{
setPostBlock(x, h + 1, z, getPostBlock(x, h, z, currentPostX, currentPostZ, currentData), currentPostX, currentPostZ, currentData);
h++;
}
}
}
// Wall Patcher
IrisBiome biome = getComplex().getTrueBiomeStream().get(x,z);
if(getDimension().isPostProcessingWalls())
{
if(!biome.getWall().getPalette().isEmpty())
{
if(ha < h - 2 || hb < h - 2 || hc < h - 2 || hd < h - 2)
{
boolean brokeGround = false;
int max = Math.abs(Math.max(h - ha, Math.max(h - hb, Math.max(h - hc, h - hd))));
for(int i = h; i > h - max; i--)
{
BlockData d = biome.getWall().get(rng, x + i, i + h, z + i, getData());
if(d != null)
{
if(isAirOrWater(x, i, z, currentPostX, currentPostZ, currentData))
{
if(brokeGround)
{
break;
}
continue;
}
setPostBlock(x, i, z, d, currentPostX, currentPostZ, currentData);
brokeGround = true;
}
}
}
}
}
// Slab
if(getDimension().isPostProcessingSlabs())
{
//@builder
if((ha == h + 1 && isSolidNonSlab(x + 1, ha, z, currentPostX, currentPostZ, currentData))
|| (hb == h + 1 && isSolidNonSlab(x, hb, z + 1, currentPostX, currentPostZ, currentData))
|| (hc == h + 1 && isSolidNonSlab(x - 1, hc, z, currentPostX, currentPostZ, currentData))
|| (hd == h + 1 && isSolidNonSlab(x, hd, z - 1, currentPostX, currentPostZ, currentData)))
//@done
{
BlockData d = biome.getSlab().get(rng, x, h, z, getData());
if(d != null)
{
boolean cancel = false;
if(B.isAir(d))
{
cancel = true;
}
if(d.getMaterial().equals(Material.SNOW) && h + 1 <= getDimension().getFluidHeight())
{
cancel = true;
}
if(isSnowLayer(x, h, z, currentPostX, currentPostZ, currentData))
{
cancel = true;
}
if(!cancel && isAirOrWater(x, h + 1, z, currentPostX, currentPostZ, currentData))
{
setPostBlock(x, h + 1, z, d, currentPostX, currentPostZ, currentData);
h++;
}
}
}
}
// Waterlogging
BlockData b = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData);
if(b instanceof Waterlogged)
{
Waterlogged ww = (Waterlogged) b.clone();
boolean w = false;
if (h <= getDimension().getFluidHeight()+1) {
if(isWaterOrWaterlogged(x, h + 1, z, currentPostX, currentPostZ, currentData))
{
w = true;
}
else if((isWaterOrWaterlogged(x + 1, h, z, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x - 1, h, z, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x, h, z + 1, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x, h, z - 1, currentPostX, currentPostZ, currentData)))
{
w = true;
}
}
if(w != ww.isWaterlogged())
{
ww.setWaterlogged(w);
setPostBlock(x, h, z, ww, currentPostX, currentPostZ, currentData);
}
}
else if(b.getMaterial().equals(Material.AIR) && h <= getDimension().getFluidHeight())
{
if((isWaterOrWaterlogged(x + 1, h, z, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x - 1, h, z, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x, h, z + 1, currentPostX, currentPostZ, currentData) || isWaterOrWaterlogged(x, h, z - 1, currentPostX, currentPostZ, currentData)))
{
setPostBlock(x, h, z, WATER, currentPostX, currentPostZ, currentData);
}
}
// Foliage
b = getPostBlock(x, h + 1, z, currentPostX, currentPostZ, currentData);
if(B.isFoliage(b) || b.getMaterial().equals(Material.DEAD_BUSH))
{
Material onto = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData).getMaterial();
if(!B.canPlaceOnto(b.getMaterial(), onto))
{
setPostBlock(x, h + 1, z, AIR, currentPostX, currentPostZ, currentData);
}
}
if(getDimension().isPostProcessCaves())
{
IrisBiome cave = getComplex().getCaveBiomeStream().get(x, z);
if(cave != null)
{
for(CaveResult i : ((IrisCaveModifier)getFramework().getCaveModifier()).genCaves(x, z, 0, 0, null))
{
if(i.getCeiling() >= currentData.getMax2DParallelism() || i.getFloor() < 0)
{
continue;
}
int f = i.getFloor();
int fa = nearestCaveFloor(f, x + 1, z, currentPostX, currentPostZ, currentData);
int fb = nearestCaveFloor(f, x, z + 1, currentPostX, currentPostZ, currentData);
int fc = nearestCaveFloor(f, x - 1, z, currentPostX, currentPostZ, currentData);
int fd = nearestCaveFloor(f, x, z - 1, currentPostX, currentPostZ, currentData);
int c = i.getCeiling();
int ca = nearestCaveCeiling(c, x + 1, z, currentPostX, currentPostZ, currentData);
int cb = nearestCaveCeiling(c, x, z + 1, currentPostX, currentPostZ, currentData);
int cc = nearestCaveCeiling(c, x - 1, z, currentPostX, currentPostZ, currentData);
int cd = nearestCaveCeiling(c, x, z - 1, currentPostX, currentPostZ, currentData);
// Cave Nibs
g = 0;
g += fa == f - 1 ? 1 : 0;
g += fb == f - 1 ? 1 : 0;
g += fc == f - 1 ? 1 : 0;
g += fd == f - 1 ? 1 : 0;
if(g >= 4)
{
BlockData bc = getPostBlock(x, f, z, currentPostX, currentPostZ, currentData);
b = getPostBlock(x, f + 1, z, currentPostX, currentPostZ, currentData);
Material m = bc.getMaterial();
if(m.isSolid())
{
setPostBlock(x, f, z, b, currentPostX, currentPostZ, currentData);
h--;
}
}
else
{
// Cave Potholes
g = 0;
g += fa == f + 1 ? 1 : 0;
g += fb == f + 1 ? 1 : 0;
g += fc == f + 1 ? 1 : 0;
g += fd == f + 1 ? 1 : 0;
if(g >= 4)
{
BlockData ba = getPostBlock(x, fa, z, currentPostX, currentPostZ, currentData);
BlockData bb = getPostBlock(x, fb, z, currentPostX, currentPostZ, currentData);
BlockData bc = getPostBlock(x, fc, z, currentPostX, currentPostZ, currentData);
BlockData bd = getPostBlock(x, fd, z, currentPostX, currentPostZ, currentData);
g = 0;
g = B.isSolid(ba) ? g + 1 : g;
g = B.isSolid(bb) ? g + 1 : g;
g = B.isSolid(bc) ? g + 1 : g;
g = B.isSolid(bd) ? g + 1 : g;
if(g >= 4)
{
setPostBlock(x, f + 1, z, getPostBlock(x, f, z, currentPostX, currentPostZ, currentData), currentPostX, currentPostZ, currentData);
h++;
}
}
}
if(getDimension().isPostProcessingSlabs())
{
//@builder
if((fa == f + 1 && isSolidNonSlab(x + 1, fa, z, currentPostX, currentPostZ, currentData))
|| (fb == f + 1 && isSolidNonSlab(x, fb, z + 1, currentPostX, currentPostZ, currentData))
|| (fc == f + 1 && isSolidNonSlab(x - 1, fc, z, currentPostX, currentPostZ, currentData))
|| (fd == f + 1 && isSolidNonSlab(x, fd, z - 1, currentPostX, currentPostZ, currentData)))
//@done
{
BlockData d = cave.getSlab().get(rng, x, f, z, getData());
if(d != null)
{
boolean cancel = false;
if(B.isAir(d))
{
cancel = true;
}
if(d.getMaterial().equals(Material.SNOW) && f + 1 <= getDimension().getFluidHeight())
{
cancel = true;
}
if(isSnowLayer(x, f, z, currentPostX, currentPostZ, currentData))
{
cancel = true;
}
if(!cancel && isAirOrWater(x, f + 1, z, currentPostX, currentPostZ, currentData))
{
setPostBlock(x, f + 1, z, d, currentPostX, currentPostZ, currentData);
}
}
}
//@builder
if((ca == c - 1 && isSolidNonSlab(x + 1, ca, z, currentPostX, currentPostZ, currentData))
|| (cb == c - 1 && isSolidNonSlab(x, cb, z + 1, currentPostX, currentPostZ, currentData))
|| (cc == c - 1 && isSolidNonSlab(x - 1, cc, z, currentPostX, currentPostZ, currentData))
|| (cd == c - 1 && isSolidNonSlab(x, cd, z - 1, currentPostX, currentPostZ, currentData)))
//@done
{
BlockData d = cave.getSlab().get(rng, x, c, z, getData());
if(d != null)
{
boolean cancel = false;
if(B.isAir(d))
{
cancel = true;
}
if(!(d instanceof Slab))
{
cancel = true;
}
if(isSnowLayer(x, c, z, currentPostX, currentPostZ, currentData))
{
cancel = true;
}
if(!cancel && isAirOrWater(x, c, z, currentPostX, currentPostZ, currentData))
{
Slab slab = (Slab) d.clone();
slab.setType(Slab.Type.TOP);
setPostBlock(x, c, z, slab, currentPostX, currentPostZ, currentData);
}
}
}
}
}
}
}
}
private int nearestCaveFloor(int floor, int x, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
if(floor >= currentData.getHeight())
{
return currentData.getHeight()-1;
}
if(B.isAir(getPostBlock(x, floor, z, currentPostX, currentPostZ, currentData)))
{
if(B.isAir(getPostBlock(x, floor - 1, z, currentPostX, currentPostZ, currentData)))
{
return floor - 2;
}
return floor - 1;
}
else
{
if(!B.isAir(getPostBlock(x, floor + 1, z, currentPostX, currentPostZ, currentData)))
{
if(!B.isAir(getPostBlock(x, floor + 2, z, currentPostX, currentPostZ, currentData)))
{
return floor + 2;
}
return floor + 1;
}
return floor;
}
}
private int nearestCaveCeiling(int ceiling, int x, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
if(ceiling >= currentData.getHeight())
{
return currentData.getHeight()-1;
}
if(B.isAir(getPostBlock(x, ceiling, z, currentPostX, currentPostZ, currentData)))
{
if(B.isAir(getPostBlock(x, ceiling + 1, z, currentPostX, currentPostZ, currentData)))
{
return ceiling + 2;
}
return ceiling + 1;
}
else
{
if(!B.isAir(getPostBlock(x, ceiling - 1, z, currentPostX, currentPostZ, currentData)))
{
if(!B.isAir(getPostBlock(x, ceiling - 2, z, currentPostX, currentPostZ, currentData)))
{
return ceiling - 2;
}
return ceiling - 1;
}
return ceiling;
}
}
public boolean isAir(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
return d.getMaterial().equals(Material.AIR) || d.getMaterial().equals(Material.CAVE_AIR);
}
public boolean hasGravity(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
return d.getMaterial().equals(Material.SAND) || d.getMaterial().equals(Material.RED_SAND) || d.getMaterial().equals(Material.BLACK_CONCRETE_POWDER) || d.getMaterial().equals(Material.BLUE_CONCRETE_POWDER) || d.getMaterial().equals(Material.BROWN_CONCRETE_POWDER) || d.getMaterial().equals(Material.CYAN_CONCRETE_POWDER) || d.getMaterial().equals(Material.GRAY_CONCRETE_POWDER) || d.getMaterial().equals(Material.GREEN_CONCRETE_POWDER) || d.getMaterial().equals(Material.LIGHT_BLUE_CONCRETE_POWDER) || d.getMaterial().equals(Material.LIGHT_GRAY_CONCRETE_POWDER) || d.getMaterial().equals(Material.LIME_CONCRETE_POWDER) || d.getMaterial().equals(Material.MAGENTA_CONCRETE_POWDER) || d.getMaterial().equals(Material.ORANGE_CONCRETE_POWDER) || d.getMaterial().equals(Material.PINK_CONCRETE_POWDER) || d.getMaterial().equals(Material.PURPLE_CONCRETE_POWDER) || d.getMaterial().equals(Material.RED_CONCRETE_POWDER) || d.getMaterial().equals(Material.WHITE_CONCRETE_POWDER) || d.getMaterial().equals(Material.YELLOW_CONCRETE_POWDER);
}
public boolean isSolid(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
return d.getMaterial().isSolid();
}
public boolean isSolidNonSlab(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
return d.getMaterial().isSolid() && !(d instanceof Slab);
}
public boolean isAirOrWater(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
return d.getMaterial().equals(Material.WATER) || d.getMaterial().equals(Material.AIR) || d.getMaterial().equals(Material.CAVE_AIR);
}
public boolean isSlab(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
return d instanceof Slab;
}
public boolean isSnowLayer(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
return d.getMaterial().equals(Material.SNOW);
}
public boolean isWater(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
return d.getMaterial().equals(Material.WATER);
}
public boolean isWaterOrWaterlogged(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
return d.getMaterial().equals(Material.WATER) || (d instanceof Waterlogged && ((Waterlogged) d).isWaterlogged());
}
public boolean isLiquid(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData);
return d instanceof Levelled;
}
public void setPostBlock(int x, int y, int z, BlockData d, int currentPostX, int currentPostZ, Hunk<BlockData> currentData)
{
if(y < currentData.getHeight())
{
currentData.set(x & 15, y, z & 15, d);
}
}
public BlockData getPostBlock(int x, int y, int z, int cpx, int cpz, Hunk<BlockData> h)
{
BlockData b = h.getClosest(x & 15, y, z & 15);
return b == null ? AIR : b;
}
}

View File

@@ -0,0 +1,297 @@
package com.volmit.iris.generator.modifier;
import com.volmit.iris.generator.noise.CNG;
import com.volmit.iris.object.NoiseStyle;
import com.volmit.iris.util.*;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.EngineAssignedModifier;
import com.volmit.iris.scaffold.hunk.Hunk;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
public class IrisRavineModifier extends EngineAssignedModifier<BlockData> {
private static final BlockData CAVE_AIR = B.get("CAVE_AIR");
private static final BlockData LAVA = B.get("LAVA");
private CNG cng;
private RNG rng;
public IrisRavineModifier(Engine engine) {
super(engine, "Ravine");
rng = new RNG(getEngine().getWorld().getSeed()).nextParallelRNG(29596878);
cng = NoiseStyle.IRIS_THICK.create(rng);
}
@Override
public void onModify(int x, int z, Hunk<BlockData> output) {
if(!getDimension().isRavines())
{
return;
}
PrecisionStopwatch p = PrecisionStopwatch.start();
generateRavines(rng, Math.floorDiv(x, 16), Math.floorDiv(z, 16), output);
getEngine().getMetrics().getRavine().put(p.getMilliseconds());
}
private void set(Hunk<BlockData> pos, int x, int y, int z, BlockData b)
{
pos.set(x, y, z, b);
}
private BlockData get(Hunk<BlockData> pos, int x, int y, int z)
{
BlockData bb = pos.get(x, y, z);
if(bb == null)
{
bb = CAVE_AIR;
}
return bb;
}
private BlockData getSurfaceBlock(int n6, int i, RNG rmg)
{
return getComplex().getTrueBiomeStream().get(n6,i).getSurfaceBlock(n6, i, rmg, getData());
}
private float[] ravineCache = new float[1024];
private void doRavine(long seed, int tx, int tz, ChunkPosition pos, double sx, double sy, double sz, float f, float f2, float f3, int n3, int n4, double d4, RNG bbx, Hunk<BlockData> terrain)
{
int n5;
RNG random = new RNG(seed);
double x = tx * 16 + 8;
double z = tz * 16 + 8;
float f4 = 0.0f;
float f5 = 0.0f;
if(n4 <= 0)
{
n5 = 8 * 16 - 16;
n4 = n5 - random.nextInt(n5 / 4);
}
n5 = 0;
if(n3 == -1)
{
n3 = n4 / 2;
n5 = 1;
}
float f6 = 1.0f;
for(int i = 0; i < 256; ++i)
{
if(i == 0 || random.nextInt(getDimension().getRavineRibRarity()) == 0)
{
f6 = 1.0f + random.nextFloat() * random.nextFloat() * 1.0f;
}
this.ravineCache[i] = f6 * f6;
}
while(n3 < n4)
{
double d7 = 1.5 + (double) (MathHelper.sin((float) n3 * 3.1415927f / (float) n4) * f * 1.0f);
double d8 = d7 * d4;
d7 *= (double) random.nextFloat() * 0.25 + 0.75;
d8 *= (double) random.nextFloat() * 0.25 + 0.75;
float f7 = MathHelper.cos(f3);
float f8 = MathHelper.sin(f3);
sx = sx + (double) (MathHelper.cos(f2) * f7);
sy += f8;
sz += MathHelper.sin(f2) * f7;
f3 *= 0.7f;
f3 += f5 * 0.05f;
f2 += f4 * 0.05f;
f5 *= 0.8f;
f4 *= 0.5f;
f5 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0f;
f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0f;
if(n5 != 0 || random.nextInt(4) != 0)
{
double d9 = sx - x;
double d10 = sz - z;
double d11 = n4 - n3;
double d12 = f + 2.0f + 16.0f;
if(d9 * d9 + d10 * d10 - d11 * d11 > d12 * d12)
{
return;
}
if(sx >= x - 16.0 - d7 * 2.0 && sz >= z - 16.0 - d7 * 2.0 && sx <= x + 16.0 + d7 * 2.0 && sz <= z + 16.0 + d7 * 2.0)
{
int n6;
int n7 = MathHelper.floor(sx - d7) - tx * 16 - 1;
int n8 = MathHelper.floor(sx + d7) - tx * 16 + 1;
int n9 = MathHelper.floor(sy - d8) - 1;
int n10 = MathHelper.floor(sy + d8) + 1;
int n11 = MathHelper.floor(sz - d7) - tz * 16 - 1;
int n12 = MathHelper.floor(sz + d7) - tz * 16 + 1;
if(n7 < 0)
{
n7 = 0;
}
if(n8 > 16)
{
n8 = 16;
}
if(n9 < 1)
{
n9 = 1;
}
if(n10 > 248)
{
n10 = 248;
}
if(n11 < 0)
{
n11 = 0;
}
if(n12 > 16)
{
n12 = 16;
}
boolean bl = false;
for(int i = n7; !bl && i < n8; ++i)
{
for(n6 = n11; !bl && n6 < n12; ++n6)
{
for(int j = n10 + 1; !bl && j >= n9 - 1; --j)
{
if(j < 0 || j >= 256)
{
continue;
}
BlockData bb = get(terrain, i, j, n6);
if(B.isWater(bb))
{
bl = true;
}
if(j == n9 - 1 || i == n7 || i == n8 - 1 || n6 == n11 || n6 == n12 - 1)
{
continue;
}
j = n9;
}
}
}
if(!bl) {
BlockPosition bps = new BlockPosition(0, 0, 0);
for (n6 = n7; n6 < n8; ++n6) {
double d13 = ((double) (n6 + tx * 16) + 0.5 - sx) / d7;
for (int i = n11; i < n12; ++i) {
double d14 = ((double) (i + tz * 16) + 0.5 - sz) / d7;
boolean bl2 = false;
if (d13 * d13 + d14 * d14 >= 1.0) {
continue;
}
for (int j = n10; j > n9; --j) {
double d15 = ((double) (j - 1) + 0.5 - sy) / d8;
if ((d13 * d13 + d14 * d14) * (double) this.ravineCache[j - 1] + d15 * d15 / 6.0 >= 1.0) {
continue;
}
BlockData blockData = get(terrain, n6, j, i);
if (isSurface(blockData)) {
bl2 = true;
}
if (j - 1 < 10) {
set(terrain, n6, j, i, LAVA);
continue;
}
set(terrain, n6, j, i, CAVE_AIR);
if (!bl2 || !isDirt(get(terrain, n6, j - 1, i))) {
continue;
}
cSet(bps, n6 + tx * 16, 0, i + tz * 16);
set(terrain, n6, j - 1, i, getSurfaceBlock(n6, i, rng));
}
}
}
if (n5 != 0)
{
break;
}
}
}
}
++n3;
}
}
private BlockPosition cSet(BlockPosition bb, double var0, double var2, double var4)
{
bb.setX(MathHelper.floor((double) var0));
bb.setY(MathHelper.floor((double) var2));
bb.setZ(MathHelper.floor((double) var4));
return bb;
}
private boolean isDirt(BlockData d)
{
//@builder
Material m = d.getMaterial();
return m.equals(Material.DIRT) ||
m.equals(Material.COARSE_DIRT) ||
m.equals(Material.SAND);
//@done
}
private boolean isSurface(BlockData d)
{
//@builder
Material m = d.getMaterial();
return m.equals(Material.GRASS_BLOCK) ||
m.equals(Material.DIRT) ||
m.equals(Material.COARSE_DIRT) ||
m.equals(Material.PODZOL) ||
m.equals(Material.SAND);
//@done
}
public void genRavines(int n, int n2, ChunkPosition chunkSnapshot, RNG bbb, Hunk<BlockData> terrain)
{
RNG b = this.rng.nextParallelRNG(21949666);
RNG bx = this.rng.nextParallelRNG(6676121);
long l = b.nextLong();
long l2 = b.nextLong();
for(int i = n - 8; i <= n + 8; ++i)
{
for(int j = n2 - 8; j <= n2 + 8; ++j)
{
long l3 = (long) i * l;
long l4 = (long) j * l2;
bx = this.rng.nextParallelRNG((int) (l3 ^ l4 ^ 6676121));
doRavines(i, j, n, n2, chunkSnapshot, bx, terrain);
}
}
}
private void doRavines(int tx, int tz, int sx, int sz, ChunkPosition chunkSnapshot, RNG b, Hunk<BlockData> terrain)
{
if(b.nextInt(getDimension().getRavineRarity()) != 0)
{
return;
}
double x = tx * 16 + b.nextInt(16);
double d2 = b.nextInt(b.nextInt(40) + 8) + 20;
double z = tz * 16 + b.nextInt(16);
int n5 = 1;
for(int i = 0; i < n5; ++i)
{
float f = b.nextFloat() * 3.1415927f * 2.0f;
float f2 = (b.nextFloat() - 0.5f) * 2.0f / 8.0f;
float f3 = (b.nextFloat() * 2.0f + b.nextFloat()) * 2.0f;
this.doRavine(b.nextLong(), sx, sz, chunkSnapshot, x, d2, z, f3, f, f2, 0, 0, 3.0, b, terrain);
}
}
public void generateRavines(RNG nextParallelRNG, int x, int z, Hunk<BlockData> terrain)
{
genRavines(x, z, new ChunkPosition(x, z), nextParallelRNG.nextParallelRNG(x).nextParallelRNG(z), terrain);
}
}

View File

@@ -0,0 +1,410 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.scaffold.stream.ProceduralStream;
import com.volmit.iris.scaffold.stream.arithmetic.FittedStream;
import com.volmit.iris.scaffold.stream.sources.CNGStream;
import com.volmit.iris.util.*;
import lombok.Data;
import java.util.List;
@Data
public class CNG
{
public static long hits = 0;
public static long creates = 0;
public static final NoiseInjector ADD = (s, v) -> new double[] {s + v, 1};
public static final NoiseInjector SRC_SUBTRACT = (s, v) -> new double[] {s - v < 0 ? 0 : s - v, -1};
public static final NoiseInjector DST_SUBTRACT = (s, v) -> new double[] {v - s < 0 ? 0 : s - v, -1};
public static final NoiseInjector MULTIPLY = (s, v) -> new double[] {s * v, 0};
public static final NoiseInjector MAX = (s, v) -> new double[] {Math.max(s, v), 0};
public static final NoiseInjector MIN = (s, v) -> new double[] {Math.min(s, v), 0};
public static final NoiseInjector SRC_MOD = (s, v) -> new double[] {s % v, 0};
public static final NoiseInjector SRC_POW = (s, v) -> new double[] {Math.pow(s, v), 0};
public static final NoiseInjector DST_MOD = (s, v) -> new double[] {v % s, 0};
public static final NoiseInjector DST_POW = (s, v) -> new double[] {Math.pow(v, s), 0};
private double scale;
private double bakedScale;
private double fscale;
private boolean trueFracturing = false;
private KList<CNG> children;
private CNG fracture;
private NoiseGenerator generator;
private final double opacity;
private NoiseInjector injector;
private RNG rng;
private boolean noscale;
private int oct;
private double patch;
private double up;
private double down;
private double power;
public NoiseGenerator getGen()
{
return generator;
}
public ProceduralStream<Double> stream()
{
return new CNGStream(this);
}
public ProceduralStream<Double> stream(double min, double max)
{
return new FittedStream<Double>(stream(), min, max);
}
public static CNG signature(RNG rng)
{
return signature(rng, NoiseType.SIMPLEX);
}
public static CNG signatureHalf(RNG rng)
{
return signatureHalf(rng, NoiseType.SIMPLEX);
}
public static CNG signatureThick(RNG rng)
{
return signatureThick(rng, NoiseType.SIMPLEX);
}
public static CNG signatureDouble(RNG rng)
{
return signatureDouble(rng, NoiseType.SIMPLEX);
}
public static CNG signatureDouble(RNG rng, NoiseType t)
{
return signatureThick(rng, t).fractureWith(signature(rng.nextParallelRNG(4956)), 93);
}
public static CNG signature(RNG rng, NoiseType t)
{
// @NoArgsConstructor
return new CNG(rng.nextParallelRNG(17), t, 1D, 1).fractureWith(new CNG(rng.nextParallelRNG(18), 1, 1).scale(0.9).fractureWith(new CNG(rng.nextParallelRNG(20), 1, 1).scale(0.21).fractureWith(new CNG(rng.nextParallelRNG(20), 1, 1).scale(0.9), 620), 145), 44).bake();
// @done
}
public static CNG signatureThick(RNG rng, NoiseType t)
{
// @NoArgsConstructor
return new CNG(rng.nextParallelRNG(133), t, 1D, 1).fractureWith(new CNG(rng.nextParallelRNG(18), 1, 1).scale(0.5).fractureWith(new CNG(rng.nextParallelRNG(20), 1, 1).scale(0.11).fractureWith(new CNG(rng.nextParallelRNG(20), 1, 1).scale(0.4), 620), 145), 44).bake();
// @done
}
public static CNG signatureHalf(RNG rng, NoiseType t)
{
// @NoArgsConstructor
return new CNG(rng.nextParallelRNG(127), t, 1D, 1).fractureWith(new CNG(rng.nextParallelRNG(18), 1, 1).scale(0.9).fractureWith(new CNG(rng.nextParallelRNG(20), 1, 1).scale(0.21).fractureWith(new CNG(rng.nextParallelRNG(20), 1, 1).scale(0.9), 420), 99), 22).bake();
// @done
}
public CNG(RNG random)
{
this(random, 1);
}
public CNG(RNG random, int octaves)
{
this(random, 1D, octaves);
}
public CNG(RNG random, double opacity, int octaves)
{
this(random, NoiseType.SIMPLEX, opacity, octaves);
}
public CNG(RNG random, NoiseType t, double opacity, int octaves)
{
creates++;
noscale = t.equals(NoiseType.WHITE);
this.oct = octaves;
this.rng = random;
power = 1;
scale = 1;
patch = 1;
bakedScale = 1;
fscale = 1;
down = 0;
up = 0;
fracture = null;
generator = t.create(random.nextParallelRNG(33).lmax());
this.opacity = opacity;
this.injector = ADD;
if(generator instanceof OctaveNoise)
{
((OctaveNoise) generator).setOctaves(octaves);
}
}
public CNG bake()
{
bakedScale *= scale;
scale = 1;
return this;
}
public CNG child(CNG c)
{
if(children == null)
{
children = new KList<>();
}
children.add(c);
return this;
}
public RNG getRNG()
{
return rng;
}
public CNG fractureWith(CNG c, double scale)
{
fracture = c;
fscale = scale;
return this;
}
public CNG scale(double c)
{
scale = c;
return this;
}
public CNG patch(double c)
{
patch = c;
return this;
}
public CNG up(double c)
{
up = c;
return this;
}
public CNG down(double c)
{
down = c;
return this;
}
public CNG injectWith(NoiseInjector i)
{
injector = i;
return this;
}
public <T extends IRare> T fitRarity(KList<T> b, double... dim)
{
if(b.size() == 0)
{
return null;
}
if(b.size() == 1)
{
return b.get(0);
}
KList<T> rarityMapped = new KList<>();
boolean o = false;
int max = 1;
for(T i : b)
{
if(i.getRarity() > max)
{
max = i.getRarity();
}
}
max++;
for(T i : b)
{
for(int j = 0; j < max - i.getRarity(); j++)
{
if(o = !o)
{
rarityMapped.add(i);
}
else
{
rarityMapped.add(0, i);
}
}
}
if(rarityMapped.size() == 1)
{
return rarityMapped.get(0);
}
if(rarityMapped.isEmpty())
{
throw new RuntimeException("BAD RARITY MAP! RELATED TO: " + b.toString(", or possibly "));
}
return fit(rarityMapped, dim);
}
public <T> T fit(T[] v, double... dim)
{
if(v.length == 0)
{
return null;
}
if(v.length == 1)
{
return v[0];
}
return v[fit(0, v.length - 1, dim)];
}
public <T> T fit(List<T> v, double... dim)
{
if(v.size() == 0)
{
return null;
}
if(v.size() == 1)
{
return v.get(0);
}
try
{
return v.get(fit(0, v.size() - 1, dim));
}
catch(Throwable e)
{
}
return v.get(0);
}
public int fit(int min, int max, double... dim)
{
if(min == max)
{
return min;
}
double noise = noise(dim);
return (int) Math.round(IrisInterpolation.lerp(min, max, noise));
}
public int fit(double min, double max, double... dim)
{
if(min == max)
{
return (int) Math.round(min);
}
double noise = noise(dim);
return (int) Math.round(IrisInterpolation.lerp(min, max, noise));
}
public double fitDouble(double min, double max, double... dim)
{
if(min == max)
{
return min;
}
double noise = noise(dim);
return IrisInterpolation.lerp(min, max, noise);
}
private double getNoise(double... dim)
{
if(isTrueFracturing())
{
if(dim.length == 2)
{
double scale = noscale ? 1 : this.bakedScale * this.scale;
double f1 = noscale ? 0 : (fracture != null ? (fracture.noise(dim[0], dim[1]) - 0.5) * fscale : 0D);
double f2 = noscale ? 0 : (fracture != null ? (fracture.noise(dim[1], dim[0]) - 0.5) * fscale : 0D);
double x = dim[0] + f1;
double y = dim[1] + -f1;
double z = 0D;
return generator.noise(x * scale, y * scale, z * scale) * opacity;
}
else if(dim.length == 3)
{
double scale = noscale ? 1 : this.bakedScale * this.scale;
double f1 = noscale ? 0 : (fracture != null ? (fracture.noise(dim[0], dim[2], dim[1]) - 0.5) * fscale : 0D);
double f2 = noscale ? 0 : (fracture != null ? (fracture.noise(dim[1], dim[0], dim[2]) - 0.5) * fscale : 0D);
double f3 = noscale ? 0 : (fracture != null ? (fracture.noise(dim[2], dim[1], dim[0]) - 0.5) * fscale : 0D);
double x = dim[0] + f1;
double y = dim[1] + f3;
double z = dim[2] + f2;
return generator.noise(x * scale, y * scale, z * scale) * opacity;
}
}
double scale = noscale ? 1 : this.bakedScale * this.scale;
double f = noscale ? 0 : (fracture != null ? (fracture.noise(dim) - 0.5) * fscale : 0D);
double x = dim.length > 0 ? dim[0] + f : 0D;
double y = dim.length > 1 ? dim[1] + -f : 0D;
double z = dim.length > 2 ? dim[2] + -f : 0D;
return generator.noise(x * scale, y * scale, z * scale) * opacity;
}
public double noise(double... dim)
{
double n = getNoise(dim);
n = power != 1D ? (n < 0 ? -Math.pow(Math.abs(n), power) : Math.pow(n, power)) : n;
double m = 1;
hits += oct;
if(children == null)
{
return (n - down + up) * patch;
}
for(CNG i : children)
{
double[] r = injector.combine(n, i.noise(dim));
n = r[0];
m += r[1];
}
return ((n / m) - down + up) * patch;
}
public CNG pow(double power)
{
this.power = power;
return this;
}
public CNG oct(int octaves)
{
oct = octaves;
return this;
}
public double getScale()
{
return scale;
}
public boolean isStatic() {
return generator != null && generator.isStatic();
}
}

View File

@@ -0,0 +1,9 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
@FunctionalInterface
public interface CNGFactory
{
CNG create(RNG seed);
}

View File

@@ -0,0 +1,88 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
import lombok.Getter;
import lombok.Setter;
public class CellGenerator
{
private FastNoiseDouble fn;
private FastNoiseDouble fd;
private CNG cng;
@Getter
@Setter
private double cellScale;
@Getter
@Setter
private double shuffle;
public CellGenerator(RNG rng)
{
shuffle = 128;
cellScale = 0.73;
cng = CNG.signature(rng.nextParallelRNG(3204));
RNG rx = rng.nextParallelRNG(8735652);
long s = rx.lmax();
fn = new FastNoiseDouble(s);
fn.setNoiseType(FastNoiseDouble.NoiseType.Cellular);
fn.setCellularReturnType(FastNoiseDouble.CellularReturnType.CellValue);
fn.setCellularDistanceFunction(FastNoiseDouble.CellularDistanceFunction.Natural);
fd = new FastNoiseDouble(s);
fd.setNoiseType(FastNoiseDouble.NoiseType.Cellular);
fd.setCellularReturnType(FastNoiseDouble.CellularReturnType.Distance2Sub);
fd.setCellularDistanceFunction(FastNoiseDouble.CellularDistanceFunction.Natural);
}
public double getDistance(double x, double z)
{
return ((fd.GetCellular(((x * cellScale) + (cng.noise(x, z) * shuffle)), ((z * cellScale) + (cng.noise(z, x) * shuffle)))) + 1f) / 2f;
}
public double getDistance(double x, double y, double z)
{
return ((fd.GetCellular(((x * cellScale) + (cng.noise(x, y, z) * shuffle)), ((y * cellScale) + (cng.noise(x, y, z) * shuffle)), ((z * cellScale) + (cng.noise(z, y, x) * shuffle)))) + 1f) / 2f;
}
public double getValue(double x, double z, int possibilities)
{
if(possibilities == 1)
{
return 0;
}
return ((fn.GetCellular(((x * cellScale) + (cng.noise(x, z) * shuffle)), ((z * cellScale) + (cng.noise(z, x) * shuffle))) + 1f) / 2f) * (possibilities - 1);
}
public double getValue(double x, double y, double z, int possibilities)
{
if(possibilities == 1)
{
return 0;
}
return ((fn.GetCellular(((x * cellScale) + (cng.noise(x, z) * shuffle)), ((y * 8 * cellScale) + (cng.noise(x, y * 8) * shuffle)), ((z * cellScale) + (cng.noise(z, x) * shuffle))) + 1f) / 2f) * (possibilities - 1);
}
public int getIndex(double x, double z, int possibilities)
{
if(possibilities == 1)
{
return 0;
}
return (int) Math.round(getValue(x, z, possibilities));
}
public int getIndex(double x, double y, double z, int possibilities)
{
if(possibilities == 1)
{
return 0;
}
return (int) Math.round(getValue(x, y, z, possibilities));
}
}

View File

@@ -0,0 +1,40 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.M;
import com.volmit.iris.util.RNG;
public class CellHeightNoise implements NoiseGenerator
{
private final FastNoiseDouble n;
public CellHeightNoise(long seed)
{
this.n = new FastNoiseDouble(new RNG(seed).lmax());
n.setNoiseType(FastNoiseDouble.NoiseType.Cellular);
n.setCellularReturnType(FastNoiseDouble.CellularReturnType.Distance2Sub);
n.setCellularDistanceFunction(FastNoiseDouble.CellularDistanceFunction.Natural);
}
private double filter(double noise)
{
return M.clip(1D - ((noise / 2D) + 0.5D), 0D, 1D);
}
@Override
public double noise(double x)
{
return filter(n.GetCellular(x, 0));
}
@Override
public double noise(double x, double z)
{
return filter(n.GetCellular(x, z));
}
@Override
public double noise(double x, double y, double z)
{
return filter(n.GetCellular(x, y, z));
}
}

View File

@@ -0,0 +1,34 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
public class CellularNoise implements NoiseGenerator
{
private final FastNoise n;
public CellularNoise(long seed)
{
this.n = new FastNoise(new RNG(seed).imax());
n.SetNoiseType(FastNoise.NoiseType.Cellular);
n.SetCellularReturnType(FastNoise.CellularReturnType.CellValue);
n.SetCellularDistanceFunction(FastNoise.CellularDistanceFunction.Natural);
}
@Override
public double noise(double x)
{
return (n.GetCellular((float) x, 0) / 2D) + 0.5D;
}
@Override
public double noise(double x, double z)
{
return (n.GetCellular((float)x, (float)z) / 2D) + 0.5D;
}
@Override
public double noise(double x, double y, double z)
{
return (n.GetCellular((float)x, (float)y, (float)z) / 2D) + 0.5D;
}
}

View File

@@ -0,0 +1,36 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
public class CubicNoise implements NoiseGenerator
{
private final FastNoiseDouble n;
public CubicNoise(long seed)
{
this.n = new FastNoiseDouble(new RNG(seed).lmax());
}
private double f(double n)
{
return (n / 2D) + 0.5D;
}
@Override
public double noise(double x)
{
return f(n.GetCubic(x, 0));
}
@Override
public double noise(double x, double z)
{
return f(n.GetCubic(x, z));
}
@Override
public double noise(double x, double y, double z)
{
return f(n.GetCubic(x, y, z));
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,27 @@
package com.volmit.iris.generator.noise;
public class FlatNoise implements NoiseGenerator
{
public FlatNoise(long seed)
{
}
@Override
public double noise(double x)
{
return 1D;
}
@Override
public double noise(double x, double z)
{
return 1D;
}
@Override
public double noise(double x, double y, double z)
{
return 1D;
}
}

View File

@@ -0,0 +1,45 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.generator.noise.FastNoiseDouble.FractalType;
import com.volmit.iris.util.RNG;
public class FractalBillowPerlinNoise implements NoiseGenerator, OctaveNoise
{
private final FastNoiseDouble n;
public FractalBillowPerlinNoise(long seed)
{
this.n = new FastNoiseDouble(new RNG(seed).lmax());
n.setFractalOctaves(1);
n.setFractalType(FractalType.Billow);
}
public double f(double v)
{
return (v / 2D) + 0.5D;
}
@Override
public double noise(double x)
{
return f(n.GetPerlinFractal(x, 0f));
}
@Override
public double noise(double x, double z)
{
return f(n.GetPerlinFractal(x, z));
}
@Override
public double noise(double x, double y, double z)
{
return f(n.GetPerlinFractal(x, y, z));
}
@Override
public void setOctaves(int o)
{
n.setFractalOctaves(o);
}
}

View File

@@ -0,0 +1,45 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.generator.noise.FastNoiseDouble.FractalType;
import com.volmit.iris.util.RNG;
public class FractalBillowSimplexNoise implements NoiseGenerator, OctaveNoise
{
private final FastNoiseDouble n;
public FractalBillowSimplexNoise(long seed)
{
this.n = new FastNoiseDouble(new RNG(seed).lmax());
n.setFractalOctaves(1);
n.setFractalType(FractalType.Billow);
}
public double f(double v)
{
return (v / 2D) + 0.5D;
}
@Override
public double noise(double x)
{
return f(n.GetSimplexFractal(x, 0d));
}
@Override
public double noise(double x, double z)
{
return f(n.GetSimplexFractal(x, z));
}
@Override
public double noise(double x, double y, double z)
{
return f(n.GetSimplexFractal(x, y, z));
}
@Override
public void setOctaves(int o)
{
n.setFractalOctaves(o);
}
}

View File

@@ -0,0 +1,38 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.generator.noise.FastNoiseDouble.FractalType;
import com.volmit.iris.util.RNG;
public class FractalCubicNoise implements NoiseGenerator
{
private final FastNoiseDouble n;
public FractalCubicNoise(long seed)
{
this.n = new FastNoiseDouble(new RNG(seed).lmax());
n.setFractalType(FractalType.Billow);
}
private double f(double n)
{
return (n / 2D) + 0.5D;
}
@Override
public double noise(double x)
{
return f(n.GetCubicFractal(x, 0));
}
@Override
public double noise(double x, double z)
{
return f(n.GetCubicFractal(x, z));
}
@Override
public double noise(double x, double y, double z)
{
return f(n.GetCubicFractal(x, y, z));
}
}

View File

@@ -0,0 +1,45 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.generator.noise.FastNoiseDouble.FractalType;
import com.volmit.iris.util.RNG;
public class FractalFBMSimplexNoise implements NoiseGenerator, OctaveNoise
{
private final FastNoiseDouble n;
public FractalFBMSimplexNoise(long seed)
{
this.n = new FastNoiseDouble(new RNG(seed).lmax());
n.setFractalOctaves(1);
n.setFractalType(FractalType.FBM);
}
public double f(double v)
{
return (v / 2D) + 0.5D;
}
@Override
public double noise(double x)
{
return f(n.GetSimplexFractal(x, 0d));
}
@Override
public double noise(double x, double z)
{
return f(n.GetSimplexFractal(x, z));
}
@Override
public double noise(double x, double y, double z)
{
return f(n.GetSimplexFractal(x, y, z));
}
@Override
public void setOctaves(int o)
{
n.setFractalOctaves(o);
}
}

View File

@@ -0,0 +1,45 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.generator.noise.FastNoiseDouble.FractalType;
import com.volmit.iris.util.RNG;
public class FractalRigidMultiSimplexNoise implements NoiseGenerator, OctaveNoise
{
private final FastNoiseDouble n;
public FractalRigidMultiSimplexNoise(long seed)
{
this.n = new FastNoiseDouble(new RNG(seed).lmax());
n.setFractalOctaves(1);
n.setFractalType(FractalType.RigidMulti);
}
public double f(double v)
{
return (v / 2D) + 0.5D;
}
@Override
public double noise(double x)
{
return f(n.GetSimplexFractal(x, 0d));
}
@Override
public double noise(double x, double z)
{
return f(n.GetSimplexFractal(x, z));
}
@Override
public double noise(double x, double y, double z)
{
return f(n.GetSimplexFractal(x, y, z));
}
@Override
public void setOctaves(int o)
{
n.setFractalOctaves(o);
}
}

View File

@@ -0,0 +1,39 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
public class GlobNoise implements NoiseGenerator
{
private final FastNoiseDouble n;
public GlobNoise(long seed)
{
this.n = new FastNoiseDouble(new RNG(seed).lmax());
n.setNoiseType(FastNoiseDouble.NoiseType.Cellular);
n.setCellularReturnType(FastNoiseDouble.CellularReturnType.Distance2Div);
n.setCellularDistanceFunction(FastNoiseDouble.CellularDistanceFunction.Natural);
}
private double f(double n)
{
return n + 1D;
}
@Override
public double noise(double x)
{
return f(n.GetCellular(x, 0));
}
@Override
public double noise(double x, double z)
{
return f(n.GetCellular(x, z));
}
@Override
public double noise(double x, double y, double z)
{
return f(n.GetCellular(x, y, z));
}
}

View File

@@ -0,0 +1,7 @@
package com.volmit.iris.generator.noise;
@FunctionalInterface
public interface NoiseFactory
{
NoiseGenerator create(long seed);
}

View File

@@ -0,0 +1,15 @@
package com.volmit.iris.generator.noise;
public interface NoiseGenerator
{
public double noise(double x);
public double noise(double x, double z);
public double noise(double x, double y, double z);
public default boolean isStatic()
{
return false;
}
}

View File

@@ -0,0 +1,28 @@
package com.volmit.iris.generator.noise;
public enum NoiseType {
WHITE(seed -> new WhiteNoise(seed)),
SIMPLEX(seed -> new SimplexNoise(seed)),
PERLIN(seed -> new PerlinNoise(seed)),
FRACTAL_BILLOW_SIMPLEX(seed -> new FractalBillowSimplexNoise(seed)),
FRACTAL_BILLOW_PERLIN(seed -> new FractalBillowPerlinNoise(seed)),
FRACTAL_FBM_SIMPLEX(seed -> new FractalFBMSimplexNoise(seed)),
FRACTAL_RIGID_MULTI_SIMPLEX(seed -> new FractalRigidMultiSimplexNoise(seed)),
FLAT(seed -> new FlatNoise(seed)),
CELLULAR(seed -> new CellularNoise(seed)),
GLOB(seed -> new GlobNoise(seed)),
CUBIC(seed -> new CubicNoise(seed)),
FRACTAL_CUBIC(seed -> new FractalCubicNoise(seed)),
CELLULAR_HEIGHT(seed -> new CellHeightNoise(seed)),
VASCULAR(seed -> new VascularNoise(seed));
private NoiseFactory f;
private NoiseType(NoiseFactory f) {
this.f = f;
}
public NoiseGenerator create(long seed) {
return f.create(seed);
}
}

View File

@@ -0,0 +1,6 @@
package com.volmit.iris.generator.noise;
public interface OctaveNoise
{
public void setOctaves(int o);
}

View File

@@ -0,0 +1,89 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
public class PerlinNoise implements NoiseGenerator, OctaveNoise
{
private final FastNoiseDouble n;
private int octaves;
public PerlinNoise(long seed)
{
this.n = new FastNoiseDouble(new RNG(seed).lmax());
octaves = 1;
}
public double f(double v)
{
return (v / 2D) + 0.5D;
}
@Override
public double noise(double x)
{
if(octaves <= 1)
{
return f(n.GetPerlin(x, 0));
}
double f = 1;
double m = 0;
double v = 0;
for(int i = 0; i < octaves; i++)
{
v += n.GetPerlin((x * (f == 1 ? f++ : (f *= 2))), 0) * f;
m += f;
}
return f(v / m);
}
@Override
public double noise(double x, double z)
{
if(octaves <= 1)
{
return f(n.GetPerlin(x, z));
}
double f = 1;
double m = 0;
double v = 0;
for(int i = 0; i < octaves; i++)
{
f = f == 1 ? f + 1 : f * 2;
v += n.GetPerlin((x * f), (z * f)) * f;
m += f;
}
return f(v / m);
}
@Override
public double noise(double x, double y, double z)
{
if(octaves <= 1)
{
return f(n.GetPerlin(x, y, z));
}
double f = 1;
double m = 0;
double v = 0;
for(int i = 0; i < octaves; i++)
{
f = f == 1 ? f + 1 : f * 2;
v += n.GetPerlin((x * f), (y * f), (z * f)) * f;
m += f;
}
return f(v / m);
}
@Override
public void setOctaves(int o)
{
octaves = o;
}
}

View File

@@ -0,0 +1,67 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.IRare;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.RNG;
public class RarityCellGenerator<T extends IRare> extends CellGenerator
{
public RarityCellGenerator(RNG rng)
{
super(rng);
}
public T get(double x, double z, KList<T> b)
{
if(b.size() == 0)
{
return null;
}
if(b.size() == 1)
{
return b.get(0);
}
KList<T> rarityMapped = new KList<>();
boolean o = false;
int max = 1;
for(T i : b)
{
if(i.getRarity() > max)
{
max = i.getRarity();
}
}
max++;
for(T i : b)
{
for(int j = 0; j < max - i.getRarity(); j++)
{
if(o = !o)
{
rarityMapped.add(i);
}
else
{
rarityMapped.add(0, i);
}
}
}
if(rarityMapped.size() == 1)
{
return rarityMapped.get(0);
}
if(rarityMapped.isEmpty())
{
throw new RuntimeException("BAD RARITY MAP! RELATED TO: " + b.toString(", or possibly "));
}
return rarityMapped.get(getIndex(x, z, rarityMapped.size()));
}
}

View File

@@ -0,0 +1,89 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
public class SimplexNoise implements NoiseGenerator, OctaveNoise
{
private final FastNoiseDouble n;
private int octaves;
public SimplexNoise(long seed)
{
this.n = new FastNoiseDouble(new RNG(seed).lmax());
octaves = 1;
}
public double f(double v)
{
return (v / 2D) + 0.5D;
}
@Override
public double noise(double x)
{
if(octaves <= 1)
{
return f(n.GetSimplex(x, 0d));
}
double f = 1;
double m = 0;
double v = 0;
for(int i = 0; i < octaves; i++)
{
v += n.GetSimplex((x * (f == 1 ? f++ : (f *= 2))), 0d) * f;
m += f;
}
return f(v / m);
}
@Override
public double noise(double x, double z)
{
if(octaves <= 1)
{
return f(n.GetSimplex(x, z));
}
double f = 1;
double m = 0;
double v = 0;
for(int i = 0; i < octaves; i++)
{
f = f == 1 ? f + 1 : f * 2;
v += n.GetSimplex((x * f), (z * f)) * f;
m += f;
}
return f(v / m);
}
@Override
public double noise(double x, double y, double z)
{
if(octaves <= 1)
{
return f(n.GetSimplex(x, y, z));
}
double f = 1;
double m = 0;
double v = 0;
for(int i = 0; i < octaves; i++)
{
f = f == 1 ? f + 1 : f * 2;
v += n.GetSimplex((x * f), (y * f), (z * f)) * f;
m += f;
}
return f(v / m);
}
@Override
public void setOctaves(int o)
{
octaves = o;
}
}

View File

@@ -0,0 +1,40 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.M;
import com.volmit.iris.util.RNG;
public class VascularNoise implements NoiseGenerator
{
private final FastNoiseDouble n;
public VascularNoise(long seed)
{
this.n = new FastNoiseDouble(new RNG(seed).lmax());
n.setNoiseType(FastNoiseDouble.NoiseType.Cellular);
n.setCellularReturnType(FastNoiseDouble.CellularReturnType.Distance2Sub);
n.setCellularDistanceFunction(FastNoiseDouble.CellularDistanceFunction.Natural);
}
private double filter(double noise)
{
return M.clip((noise / 2D) + 0.5D, 0D, 1D);
}
@Override
public double noise(double x)
{
return filter(n.GetCellular(x, 0));
}
@Override
public double noise(double x, double z)
{
return filter(n.GetCellular(x, z));
}
@Override
public double noise(double x, double y, double z)
{
return filter(n.GetCellular(x, y, z));
}
}

View File

@@ -0,0 +1,41 @@
package com.volmit.iris.generator.noise;
import com.volmit.iris.util.RNG;
public class WhiteNoise implements NoiseGenerator
{
private final FastNoise n;
public WhiteNoise(long seed)
{
n = new FastNoise(new RNG(seed).imax());
}
public boolean isStatic()
{
return true;
}
private double f(double m)
{
return (m % 8192) * 1024;
}
@Override
public double noise(double x)
{
return (n.GetWhiteNoise(f(x), 0d) / 2D) + 0.5D;
}
@Override
public double noise(double x, double z)
{
return (n.GetWhiteNoise(f(x), f(z)) / 2D) + 0.5D;
}
@Override
public double noise(double x, double y, double z)
{
return (n.GetWhiteNoise(f(x), f(y), f(z)) / 2D) + 0.5D;
}
}

View File

@@ -0,0 +1,311 @@
package com.volmit.iris.manager;
import com.google.gson.Gson;
import com.minelazz.epicworldgenerator.structures.StructureObject;
import com.volmit.iris.Iris;
import com.volmit.iris.object.*;
import com.volmit.iris.pregen.DirectWorldWriter;
import com.volmit.iris.util.*;
import net.querz.nbt.io.NBTUtil;
import net.querz.nbt.io.NamedTag;
import net.querz.nbt.tag.CompoundTag;
import net.querz.nbt.tag.IntTag;
import net.querz.nbt.tag.ListTag;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.type.Jigsaw;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicInteger;
public class ConversionManager
{
private KList<Converter> converters;
private File folder;
public ConversionManager()
{
folder = Iris.instance.getDataFolder("convert");
converters = new KList<>();
J.s(() ->
{
J.attemptAsync(() ->
{
if(Bukkit.getPluginManager().isPluginEnabled("WorldEdit"))
{
converters.add(new Converter()
{
@Override
public String getOutExtension()
{
return "iob";
}
@Override
public String getInExtension()
{
return "schem";
}
@Override
public void convert(File in, File out)
{
SKConversion.convertSchematic(in, out);
}
});
converters.add(new Converter()
{
@Override
public String getOutExtension()
{
return "iob";
}
@Override
public String getInExtension()
{
return "schematic";
}
@Override
public void convert(File in, File out)
{
SKConversion.convertSchematic(in, out);
}
});
}
});
}, 5);
converters.add(new Converter()
{
@Override
public String getOutExtension()
{
return "iob";
}
@Override
public String getInExtension()
{
return "ewg";
}
@Override
public void convert(File in, File out)
{
try
{
StructureObject.convert(in).write(out);
}
catch(ClassNotFoundException | IOException e)
{
e.printStackTrace();
}
}
});
}
private String toPoolName(String poolReference)
{
return poolReference.split("\\Q:\\E")[1];
}
public void convertStructures(File in, File out, MortarSender s)
{
KMap<String, IrisJigsawPool> pools = new KMap<>();
KList<File> roots = new KList<>();
AtomicInteger total = new AtomicInteger(0);
AtomicInteger at = new AtomicInteger(0);
File destPools = new File(out.getAbsolutePath() + "/jigsaw-pools");
destPools.mkdirs();
findAllNBT(in, (folder, file) -> {
total.getAndIncrement();
if(roots.addIfMissing(folder))
{
String b = in.toURI().relativize(folder.toURI()).getPath();
if(b.startsWith("/"))
{
b = b.substring(1);
}
if(b.endsWith("/"))
{
b = b.substring(0, b.length() - 1);
}
pools.put(b, new IrisJigsawPool());
}
});
findAllNBT(in, (folder, file) -> {
at.getAndIncrement();
String b = in.toURI().relativize(folder.toURI()).getPath();
if(b.startsWith("/"))
{
b = b.substring(1);
}
if(b.endsWith("/"))
{
b = b.substring(0, b.length() - 1);
}
IrisJigsawPool jpool = pools.get(b);
File destObjects = new File(out.getAbsolutePath() + "/objects/" + in.toURI().relativize(folder.toURI()).getPath());
File destPieces = new File(out.getAbsolutePath() + "/jigsaw-pieces/" + in.toURI().relativize(folder.toURI()).getPath());
destObjects.mkdirs();
destPieces.mkdirs();
try {
NamedTag tag = NBTUtil.read(file);
CompoundTag compound = (CompoundTag) tag.getTag();
if (compound.containsKey("blocks") && compound.containsKey("palette") && compound.containsKey("size"))
{
String id = in.toURI().relativize(folder.toURI()).getPath() + file.getName().split("\\Q.\\E")[0];
ListTag<IntTag> size = (ListTag<IntTag>) compound.getListTag("size");
int w = size.get(0).asInt();
int h = size.get(1).asInt();
int d = size.get(2).asInt();
KList<BlockData> palette = new KList<>();
ListTag<CompoundTag> paletteList = (ListTag<CompoundTag>) compound.getListTag("palette");
for(int i = 0; i < paletteList.size(); i++)
{
CompoundTag cp = paletteList.get(i);
palette.add(DirectWorldWriter.getBlockData(cp));
}
IrisJigsawPiece piece = new IrisJigsawPiece();
IrisObject object = new IrisObject(w,h,d);
ListTag<CompoundTag> blockList = (ListTag<CompoundTag>) compound.getListTag("blocks");
for(int i = 0; i < blockList.size(); i++)
{
CompoundTag cp = blockList.get(i);
ListTag<IntTag> pos = (ListTag<IntTag>) cp.getListTag("pos");
int x = pos.get(0).asInt();
int y = pos.get(1).asInt();
int z = pos.get(2).asInt();
BlockData bd = palette.get(cp.getInt("state")).clone();
if(bd.getMaterial().equals(Material.JIGSAW) && cp.containsKey("nbt"))
{
piece.setObject(in.toURI().relativize(folder.toURI()).getPath() + file.getName().split("\\Q.\\E")[0]);
IrisPosition spos = new IrisPosition(object.getSigned(x,y,z));
CompoundTag nbt = cp.getCompoundTag("nbt");
CompoundTag finalState = new CompoundTag();
finalState.putString("Name", nbt.getString("final_state"));
BlockData jd = bd.clone();
bd = DirectWorldWriter.getBlockData(finalState);
String joint = nbt.getString("joint");
String pool = nbt.getString("pool");
String poolId = toPoolName(pool);
String name = nbt.getString("name");
String target = nbt.getString("target");
pools.computeIfAbsent(poolId, (k) -> new IrisJigsawPool());
IrisJigsawPieceConnector connector = new IrisJigsawPieceConnector();
connector.setName(name);
connector.setTargetName(target);
connector.setRotateConnector(false);
connector.setPosition(spos);
connector.getPools().add(poolId);
connector.setDirection(IrisDirection.getDirection(((Jigsaw)jd).getOrientation()));
if(target.equals("minecraft:building_entrance"))
{
connector.setInnerConnector(true);
}
piece.getConnectors().add(connector);
}
if(!bd.getMaterial().equals(Material.STRUCTURE_VOID) && !bd.getMaterial().equals(Material.AIR))
{
object.setUnsigned(x,y,z, bd);
}
}
jpool.getPieces().addIfMissing(id);
object.write(new File(destObjects, file.getName().split("\\Q.\\E")[0] + ".iob"));
IO.writeAll(new File(destPieces,file.getName().split("\\Q.\\E")[0] + ".json"), new JSONObject(new Gson().toJson(piece)).toString(4));
Iris.info("[Jigsaw]: (" + Form.pc((double)at.get() / (double)total.get(), 0) + ") Exported Piece: " + id);
}
} catch (Throwable e) {
e.printStackTrace();
}
});
for(String i : pools.k())
{
try {
IO.writeAll(new File(destPools, i + ".json"), new JSONObject(new Gson().toJson(pools.get(i))).toString(4));
} catch (IOException e) {
e.printStackTrace();
}
}
Iris.info("Done! Exported " + Form.f((total.get() * 2) + pools.size()) + " Files!");
}
public void findAllNBT(File path, Consumer2<File, File> inFile)
{
if(path == null)
{
return;
}
if(path.isFile() && path.getName().endsWith(".nbt"))
{
inFile.accept(path.getParentFile(), path);
return;
}
for(File i : path.listFiles())
{
if(i.isDirectory())
{
findAllNBT(i, inFile);
}
else if(i.isFile() && i.getName().endsWith(".nbt"))
{
inFile.accept(path, i);
}
}
}
public void check(MortarSender s)
{
int m = 0;
Iris.instance.getDataFolder("convert");
for(File i : folder.listFiles())
{
for(Converter j : converters)
{
if(i.getName().endsWith("." + j.getInExtension()))
{
File out = new File(folder, i.getName().replaceAll("\\Q." + j.getInExtension() + "\\E", "." + j.getOutExtension()));
m++;
j.convert(i, out);
s.sendMessage("Converted " + i.getName() + " -> " + out.getName());
}
}
if(i.isDirectory() && i.getName().equals("structures")) {
File f = new File(folder, "jigsaw");
if (!f.exists())
{
s.sendMessage("Converting NBT Structures into Iris Jigsaw Structures...");
f.mkdirs();
J.a(() -> convertStructures(i, f, s));
}
}
}
s.sendMessage("Converted " + m + " File" + (m == 1 ? "" : "s"));
}
}

View File

@@ -0,0 +1,121 @@
package com.volmit.iris.manager;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.WorldUnloadEvent;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.manager.edit.BlockEditor;
import com.volmit.iris.manager.edit.BukkitBlockEditor;
import com.volmit.iris.manager.edit.WEBlockEditor;
import com.volmit.iris.util.KMap;
import com.volmit.iris.util.M;
import io.papermc.lib.PaperLib;
public class EditManager implements Listener
{
private KMap<World, BlockEditor> editors;
public EditManager()
{
this.editors = new KMap<>();
Iris.instance.registerListener(this);
Bukkit.getScheduler().scheduleSyncRepeatingTask(Iris.instance, this::update, 0, 0);
}
public BlockData get(World world, int x, int y, int z)
{
return open(world).get(x, y, z);
}
public void set(World world, int x, int y, int z, BlockData d)
{
open(world).set(x, y, z, d);
}
public void setBiome(World world, int x, int y, int z, Biome d)
{
open(world).setBiome(x, y, z, d);
}
public void setBiome(World world, int x, int z, Biome d)
{
open(world).setBiome(x, z, d);
}
public Biome getBiome(World world, int x, int y, int z)
{
return open(world).getBiome(x, y, z);
}
public Biome getBiome(World world, int x, int z)
{
return open(world).getBiome(x, z);
}
@EventHandler
public void on(WorldUnloadEvent e)
{
if(editors.containsKey(e.getWorld()))
{
editors.remove(e.getWorld()).close();
}
}
public void update()
{
for(World i : editors.k())
{
if(M.ms() - editors.get(i).last() > 1000)
{
editors.remove(i).close();
}
}
}
public void flushNow()
{
for(World i : editors.k())
{
editors.remove(i).close();
}
}
public BlockEditor open(World world)
{
if(editors.containsKey(world))
{
return editors.get(world);
}
BlockEditor e = null;
if(Bukkit.getPluginManager().isPluginEnabled("WorldEdit") && !PaperLib.isPaper() && !IrisSettings.get().getGeneral().isIgnoreWorldEdit())
{
try
{
e = new WEBlockEditor(world);
}
catch(Throwable ex)
{
e = new BukkitBlockEditor(world);
}
}
else
{
e = new BukkitBlockEditor(world);
}
editors.put(world, e);
return e;
}
}

View File

@@ -0,0 +1,143 @@
package com.volmit.iris.manager;
import com.volmit.iris.Iris;
import com.volmit.iris.scaffold.IrisWorlds;
import com.volmit.iris.scaffold.engine.Engine;
import com.volmit.iris.scaffold.engine.IrisAccess;
import com.volmit.iris.util.*;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerChangedWorldEvent;
import java.util.List;
public class IrisBoardManager implements BoardProvider, Listener
{
@DontObfuscate
private BoardManager manager;
private String mem = "...";
public RollingSequence hits = new RollingSequence(20);
public RollingSequence tp = new RollingSequence(100);
private ChronoLatch cl = new ChronoLatch(1000);
@DontObfuscate
public IrisBoardManager()
{
Iris.instance.registerListener(this);
//@builder
manager = new BoardManager(Iris.instance, BoardSettings.builder()
.boardProvider(this)
.scoreDirection(ScoreDirection.DOWN)
.build());
//@done
}
@EventHandler
public void on(PlayerChangedWorldEvent e)
{
J.s(() -> updatePlayer(e.getPlayer()));
}
@DontObfuscate
private boolean isIrisWorld(World w)
{
return IrisWorlds.isIrisWorld(w) && IrisWorlds.access(w).isStudio();
}
public void updatePlayer(Player p)
{
if(isIrisWorld(p.getWorld()))
{
manager.remove(p);
manager.setup(p);
}
else
{
manager.remove(p);
}
}
@Override
public String getTitle(Player player)
{
return C.GREEN + "Iris";
}
@DontObfuscate
@Override
public List<String> getLines(Player player)
{
KList<String> v = new KList<>();
if(!isIrisWorld(player.getWorld()))
{
return v;
}
IrisAccess g = IrisWorlds.access(player.getWorld());
if(cl.flip())
{
// TODO MEMORY
mem = Form.memSize(0, 2);
}
int x = player.getLocation().getBlockX();
int y = player.getLocation().getBlockY();
int z = player.getLocation().getBlockZ();
Engine engine = g.getCompound().getEngineForHeight(y);
int parallaxChunks=0;
int parallaxRegions=0;
long memoryGuess=0;
int loadedObjects=0;
for(int i = 0; i < g.getCompound().getSize(); i++)
{
parallaxRegions += g.getCompound().getEngine(i).getParallax().getRegionCount();
parallaxChunks += g.getCompound().getEngine(i).getParallax().getChunkCount();
loadedObjects+= g.getCompound().getData().getObjectLoader().getSize();
memoryGuess += g.getCompound().getData().getObjectLoader().getTotalStorage() * 225;
memoryGuess+= parallaxChunks * 3500;
memoryGuess += parallaxRegions * 1700000;
}
tp.put(0); // TODO: CHUNK SPEED
v.add("&7&m------------------");
v.add(C.GREEN + "Speed" + C.GRAY + ": " + Form.f(g.getGeneratedPerSecond(), 0) + "/s " + Form.duration(1000D / g.getGeneratedPerSecond(), 0));
v.add(C.GREEN + "Memory Use" + C.GRAY + ": ~" + Form.memSize(memoryGuess, 0));
if(engine != null)
{
v.add("&7&m------------------");
v.add(C.AQUA + "Engine" + C.GRAY + ": " + engine.getName() + " " + engine.getMinHeight() + "-" + engine.getMaxHeight());
v.add(C.AQUA + "Region" + C.GRAY + ": " + engine.getRegion(x, z).getName());
v.add(C.AQUA + "Biome" + C.GRAY + ": " + engine.getBiome(x, y, z).getName());
v.add(C.AQUA + "Height" + C.GRAY + ": " + Math.round(engine.getHeight(x, z)));
v.add(C.AQUA + "Slope" + C.GRAY + ": " + Form.f(engine.getFramework().getComplex().getSlopeStream().get(x, z), 2));
}
if(Iris.jobCount() > 0)
{
v.add("&7&m------------------");
v.add(C.LIGHT_PURPLE + "Tasks" + C.GRAY + ": " + Iris.jobCount());
}
v.add("&7&m------------------");
return v;
}
@DontObfuscate
public void disable()
{
manager.onDisable();
}
}

View File

@@ -0,0 +1,212 @@
package com.volmit.iris.manager;
import com.volmit.iris.Iris;
import com.volmit.iris.object.*;
import com.volmit.iris.util.ObjectResourceLoader;
import com.volmit.iris.util.RNG;
import com.volmit.iris.util.ResourceLoader;
import lombok.Data;
import java.io.File;
import java.util.Objects;
import java.util.function.Function;
@Data
public class IrisDataManager
{
private ResourceLoader<IrisBiome> biomeLoader;
private ResourceLoader<IrisLootTable> lootLoader;
private ResourceLoader<IrisRegion> regionLoader;
private ResourceLoader<IrisDimension> dimensionLoader;
private ResourceLoader<IrisGenerator> generatorLoader;
private ResourceLoader<IrisJigsawPiece> jigsawPieceLoader;
private ResourceLoader<IrisJigsawPool> jigsawPoolLoader;
private ResourceLoader<IrisJigsawStructure> jigsawStructureLoader;
private ResourceLoader<IrisEntity> entityLoader;
private ResourceLoader<IrisBlockData> blockLoader;
private ObjectResourceLoader objectLoader;
private boolean closed;
private final File dataFolder;
private final int id;
public IrisDataManager(File dataFolder)
{
this(dataFolder, false);
}
public IrisDataManager(File dataFolder, boolean oneshot)
{
this.dataFolder = dataFolder;
this.id = RNG.r.imax();
closed = false;
hotloaded();
}
public void close()
{
closed = true;
dump();
this.lootLoader = null;
this.entityLoader = null;
this.regionLoader = null;
this.biomeLoader = null;
this.dimensionLoader = null;
this.jigsawPoolLoader = null;
this.jigsawPieceLoader = null;
this.generatorLoader = null;
this.jigsawStructureLoader = null;
this.blockLoader = null;
this.objectLoader = null;
}
private static void printData(ResourceLoader<?> rl)
{
Iris.warn(" " + rl.getResourceTypeName() + " @ /" + rl.getFolderName() + ": Cache=" + rl.getLoadCache().size() + " Folders=" + rl.getFolders().size());
}
public IrisDataManager copy() {
return new IrisDataManager(dataFolder);
}
public void hotloaded()
{
if(closed)
{
return;
}
File packs = dataFolder;
packs.mkdirs();
this.lootLoader = new ResourceLoader<>(packs, this, "loot", "Loot", IrisLootTable.class);
this.entityLoader = new ResourceLoader<>(packs,this, "entities", "Entity", IrisEntity.class);
this.regionLoader = new ResourceLoader<>(packs, this, "regions", "Region", IrisRegion.class);
this.biomeLoader = new ResourceLoader<>(packs, this, "biomes", "Biome", IrisBiome.class);
this.dimensionLoader = new ResourceLoader<>(packs, this, "dimensions", "Dimension", IrisDimension.class);
this.jigsawPoolLoader = new ResourceLoader<>(packs, this, "jigsaw-pools", "Jigsaw Pool", IrisJigsawPool.class);
this.jigsawStructureLoader = new ResourceLoader<>(packs, this, "jigsaw-structures", "Jigsaw Structure", IrisJigsawStructure.class);
this.jigsawPieceLoader = new ResourceLoader<>(packs, this, "jigsaw-pieces", "Jigsaw Piece", IrisJigsawPiece.class);
this.generatorLoader = new ResourceLoader<>(packs, this, "generators", "Generator", IrisGenerator.class);
this.blockLoader = new ResourceLoader<>(packs,this, "blocks", "Block", IrisBlockData.class);
this.objectLoader = new ObjectResourceLoader(packs, this, "objects", "Object");
}
public void dump()
{
if(closed)
{
return;
}
biomeLoader.clearCache();
blockLoader.clearCache();
lootLoader.clearCache();
objectLoader.clearCache();
jigsawPieceLoader.clearCache();
jigsawPoolLoader.clearCache();
jigsawStructureLoader.clearCache();
regionLoader.clearCache();
dimensionLoader.clearCache();
entityLoader.clearCache();
generatorLoader.clearCache();
}
public void clearLists()
{
if(closed)
{
return;
}
lootLoader.clearList();
blockLoader.clearList();
entityLoader.clearList();
biomeLoader.clearList();
regionLoader.clearList();
dimensionLoader.clearList();
generatorLoader.clearList();
jigsawStructureLoader.clearList();
jigsawPoolLoader.clearList();
jigsawPieceLoader.clearList();
objectLoader.clearList();
}
public static IrisObject loadAnyObject(String key)
{
return loadAny(key, (dm) -> dm.getObjectLoader().load(key, false));
}
public static IrisBiome loadAnyBiome(String key)
{
return loadAny(key, (dm) -> dm.getBiomeLoader().load(key, false));
}
public static IrisJigsawPiece loadAnyJigsawPiece(String key)
{
return loadAny(key, (dm) -> dm.getJigsawPieceLoader().load(key, false));
}
public static IrisJigsawPool loadAnyJigsawPool(String key)
{
return loadAny(key, (dm) -> dm.getJigsawPoolLoader().load(key, false));
}
public static IrisEntity loadAnyEntity(String key)
{
return loadAny(key, (dm) -> dm.getEntityLoader().load(key, false));
}
public static IrisLootTable loadAnyLootTable(String key)
{
return loadAny(key, (dm) -> dm.getLootLoader().load(key, false));
}
public static IrisBlockData loadAnyBlock(String key)
{
return loadAny(key, (dm) -> dm.getBlockLoader().load(key, false));
}
public static IrisRegion loadAnyRegion(String key)
{
return loadAny(key, (dm) -> dm.getRegionLoader().load(key, false));
}
public static IrisDimension loadAnyDimension(String key)
{
return loadAny(key, (dm) -> dm.getDimensionLoader().load(key, false));
}
public static IrisJigsawStructure loadAnyJigsawStructure(String key)
{
return loadAny(key, (dm) -> dm.getJigsawStructureLoader().load(key, false));
}
public static IrisGenerator loadAnyGenerator(String key)
{
return loadAny(key, (dm) -> dm.getGeneratorLoader().load(key, false));
}
public static <T extends IrisRegistrant> T loadAny(String key, Function<IrisDataManager, T> v) {
try
{
for(File i : Objects.requireNonNull(Iris.instance.getDataFolder("packs").listFiles()))
{
if(i.isDirectory())
{
IrisDataManager dm = new IrisDataManager(i, true);
T t = v.apply(dm);
if(t != null)
{
return t;
}
}
}
}
catch(Throwable e)
{
e.printStackTrace();
}
return null;
}
}

View File

@@ -0,0 +1,545 @@
package com.volmit.iris.manager;
import com.google.gson.Gson;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.object.*;
import com.volmit.iris.scaffold.IrisWorldCreator;
import com.volmit.iris.scaffold.engine.IrisAccess;
import com.volmit.iris.util.*;
import lombok.Data;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.zeroturnaround.zip.ZipUtil;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.util.Objects;
import java.util.UUID;
@Data
public class IrisProject
{
private File path;
private String name;
private IrisAccess activeProvider;
public IrisProject(File path)
{
this.path = path;
this.name = path.getName();
}
public boolean isOpen()
{
return activeProvider != null;
}
public void open(MortarSender sender)
{
open(sender, () ->
{
});
}
public void open(MortarSender sender, Runnable onDone)
{
if(isOpen())
{
close();
}
IrisDimension d = IrisDataManager.loadAnyDimension(getName());
if(d == null)
{
sender.sendMessage("Can't find dimension: " + getName());
return;
} else if(sender.isPlayer()){
sender.player().setGameMode(GameMode.SPECTATOR);
sender.player().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 500, 10));
sender.player().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(C.BLUE + "Creating studio world. Please wait..."));
}
J.attemptAsync(() ->
{
try
{
if (d.getLoader() == null){
sender.sendMessage("Could not get dimension loader");
return;
}
File f = d.getLoader().getDataFolder();
boolean foundWork = false;
for(File i : Objects.requireNonNull(f.listFiles()))
{
if(i.getName().endsWith(".code-workspace"))
{
foundWork = true;
sender.sendMessage("Updating Workspace...");
J.a(() ->
{
updateWorkspace();
sender.sendMessage("Workspace Updated");
});
if(IrisSettings.get().getStudio().isOpenVSCode())
{
if (!GraphicsEnvironment.isHeadless()) {
Iris.msg("Opening VSCode. You may see the output from VSCode.");
Iris.msg("VSCode output always starts with: '(node:#####) electron'");
Desktop.getDesktop().open(i);
}
}
break;
}
}
if(!foundWork)
{
File ff = new File(d.getLoader().getDataFolder(), d.getLoadKey() + ".code-workspace");
Iris.warn("Project missing code-workspace: " + ff.getAbsolutePath() + " Re-creating code workspace.");
try
{
IO.writeAll(ff, createCodeWorkspaceConfig());
}
catch(IOException e1)
{
e1.printStackTrace();
}
sender.sendMessage("Updating Workspace...");
updateWorkspace();
sender.sendMessage("Workspace Updated");
}
}
catch(Throwable e)
{
e.printStackTrace();
}
});
String wfp = "iris/" + UUID.randomUUID();
WorldCreator c = new IrisWorldCreator().dimension(getName())
.seed(1337)
.name(wfp)
.studioMode()
.create();
IrisAccess gx = ((IrisAccess)c.generator());
sender.sendMessage("Generating with " + Iris.getThreadCount() + " threads per chunk");
O<Boolean> done = new O<>();
done.set(false);
activeProvider = gx;
J.a(() ->
{
double last = 0;
int req = 300;
double lpc = 0;
boolean fc;
while(!done.get())
{
boolean derp = false;
assert gx != null;
double v = (double) gx.getGenerated() / (double) req;
fc = lpc != v;
lpc = v;
if(last > v || v > 1)
{
derp = true;
v = last;
}
else
{
last = v;
}
if(fc)
{
sender.sendMessage(C.WHITE + "Generating " + Form.pc(v) + (derp ? (C.GRAY + " (Waiting on Server...)") : (C.GRAY + " (" + (req - gx.getGenerated()) + " Left)")));
}
if (sender.isPlayer()){
sender.player().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(C.BLUE + "Creating studio world. Please wait..."));
}
J.sleep(1500);
if(gx.isFailing())
{
sender.sendMessage("Generation Failed!");
return;
}
}
});
//@builder
World world = c.createWorld();
Iris.linkMultiverseCore.removeFromConfig(world);
done.set(true);
sender.sendMessage(C.WHITE + "Generating Complete!");
if(sender.isPlayer())
{
assert world != null;
sender.player().teleport(world.getSpawnLocation());
}
Bukkit.getScheduler().scheduleSyncDelayedTask(Iris.instance, () ->
{
sender.sendMessage("Hotloading Active! Change any files and watch your changes appear as you load new chunks!");
if(sender.isPlayer())
{
sender.player().setGameMode(GameMode.SPECTATOR);
}
onDone.run();
}, 0);
}
public void close()
{
activeProvider.close();
File folder = activeProvider.getTarget().getWorld().getWorldFolder();
Iris.linkMultiverseCore.removeFromConfig(activeProvider.getTarget().getWorld().getName());
Bukkit.unloadWorld(activeProvider.getTarget().getWorld().getName(), false);
J.attemptAsync(() -> IO.delete(folder));
activeProvider = null;
}
public File getCodeWorkspaceFile()
{
return new File(path, getName() + ".code-workspace");
}
public boolean updateWorkspace()
{
getPath().mkdirs();
File ws = getCodeWorkspaceFile();
try
{
PrecisionStopwatch p = PrecisionStopwatch.start();
Iris.info("Building Workspace: " + ws.getPath());
JSONObject j = createCodeWorkspaceConfig();
IO.writeAll(ws, j.toString(4));
p.end();
Iris.info("Building Workspace: " + ws.getPath() + " took " + Form.duration(p.getMilliseconds(), 2));
return true;
}
catch(Throwable e)
{
Iris.warn("Project invalid: " + ws.getAbsolutePath() + " Re-creating. You may loose some vs-code workspace settings! But not your actual project!");
ws.delete();
try
{
IO.writeAll(ws, createCodeWorkspaceConfig());
}
catch(IOException e1)
{
e1.printStackTrace();
}
}
return false;
}
public JSONObject createCodeWorkspaceConfig()
{
JSONObject ws = new JSONObject();
JSONArray folders = new JSONArray();
JSONObject folder = new JSONObject();
folder.put("path", ".");
folders.put(folder);
ws.put("folders", folders);
JSONObject settings = new JSONObject();
settings.put("workbench.colorTheme", "Monokai");
settings.put("workbench.preferredDarkColorTheme", "Solarized Dark");
settings.put("workbench.tips.enabled", false);
settings.put("workbench.tree.indent", 24);
settings.put("files.autoSave", "onFocusChange");
JSONObject jc = new JSONObject();
jc.put("editor.autoIndent", "brackets");
jc.put("editor.acceptSuggestionOnEnter", "smart");
jc.put("editor.cursorSmoothCaretAnimation", true);
jc.put("editor.dragAndDrop", false);
jc.put("files.trimTrailingWhitespace", true);
jc.put("diffEditor.ignoreTrimWhitespace", true);
jc.put("files.trimFinalNewlines", true);
jc.put("editor.suggest.showKeywords", false);
jc.put("editor.suggest.showSnippets", false);
jc.put("editor.suggest.showWords", false);
JSONObject st = new JSONObject();
st.put("strings", true);
jc.put("editor.quickSuggestions", st);
jc.put("editor.suggest.insertMode", "replace");
settings.put("[json]", jc);
settings.put("json.maxItemsComputed", 30000);
JSONArray schemas = new JSONArray();
IrisDataManager dm = new IrisDataManager(getPath());
schemas.put(getSchemaEntry(IrisDimension.class, dm, "/dimensions/*.json"));
schemas.put(getSchemaEntry(IrisEntity.class, dm, "/entities/*.json"));
schemas.put(getSchemaEntry(IrisBiome.class, dm, "/biomes/*.json"));
schemas.put(getSchemaEntry(IrisRegion.class, dm, "/regions/*.json"));
schemas.put(getSchemaEntry(IrisGenerator.class,dm, "/generators/*.json"));
schemas.put(getSchemaEntry(IrisJigsawPiece.class, dm, "/jigsaw-pieces/*.json"));
schemas.put(getSchemaEntry(IrisJigsawPool.class, dm, "/jigsaw-pools/*.json"));
schemas.put(getSchemaEntry(IrisJigsawStructure.class, dm, "/jigsaw-structures/*.json"));
schemas.put(getSchemaEntry(IrisBlockData.class, dm, "/blocks/*.json"));
schemas.put(getSchemaEntry(IrisLootTable.class, dm, "/loot/*.json"));
settings.put("json.schemas", schemas);
ws.put("settings", settings);
return ws;
}
public JSONObject getSchemaEntry(Class<?> i, IrisDataManager dat, String... fileMatch)
{
Iris.verbose("Processing Folder " + i.getSimpleName() + " " + fileMatch[0]);
JSONObject o = new JSONObject();
o.put("fileMatch", new JSONArray(fileMatch));
o.put("schema", new SchemaBuilder(i, dat).compute());
return o;
}
public File compilePackage(MortarSender sender, boolean obfuscate, boolean minify)
{
String dimm = getName();
IrisDataManager dm = new IrisDataManager(path);
IrisDimension dimension = dm.getDimensionLoader().load(dimm);
File folder = new File(Iris.instance.getDataFolder(), "exports/" + dimension.getLoadKey());
folder.mkdirs();
Iris.info("Packaging Dimension " + dimension.getName() + " " + (obfuscate ? "(Obfuscated)" : ""));
KSet<IrisRegion> regions = new KSet<>();
KSet<IrisBiome> biomes = new KSet<>();
KSet<IrisEntity> entities = new KSet<>();
KSet<IrisGenerator> generators = new KSet<>();
KSet<IrisLootTable> loot = new KSet<>();
KSet<IrisBlockData> blocks = new KSet<>();
for(String i : dm.getDimensionLoader().getPossibleKeys())
{
blocks.add(dm.getBlockLoader().load(i));
}
//TODO: EXPORT JIGSAW PIECES FROM STRUCTURES
dimension.getRegions().forEach((i) -> regions.add(dm.getRegionLoader().load(i)));
dimension.getLoot().getTables().forEach((i) -> loot.add(dm.getLootLoader().load(i)));
regions.forEach((i) -> biomes.addAll(i.getAllBiomes(null)));
biomes.forEach((i) -> i.getGenerators().forEach((j) -> generators.add(j.getCachedGenerator(null))));
regions.forEach((r) -> r.getLoot().getTables().forEach((i) -> loot.add(dm.getLootLoader().load(i))));
biomes.forEach((r) -> r.getLoot().getTables().forEach((i) -> loot.add(dm.getLootLoader().load(i))));
biomes.forEach((r) -> r.getEntitySpawnOverrides().forEach((sp) -> entities.add(dm.getEntityLoader().load(sp.getEntity()))));
regions.forEach((r) -> r.getEntitySpawnOverrides().forEach((sp) -> entities.add(dm.getEntityLoader().load(sp.getEntity()))));
dimension.getEntitySpawnOverrides().forEach((sp) -> entities.add(dm.getEntityLoader().load(sp.getEntity())));
biomes.forEach((r) -> r.getEntityInitialSpawns().forEach((sp) -> entities.add(dm.getEntityLoader().load(sp.getEntity()))));
regions.forEach((r) -> r.getEntityInitialSpawns().forEach((sp) -> entities.add(dm.getEntityLoader().load(sp.getEntity()))));
dimension.getEntityInitialSpawns().forEach((sp) -> entities.add(dm.getEntityLoader().load(sp.getEntity())));
KMap<String, String> renameObjects = new KMap<>();
String a;
StringBuilder b = new StringBuilder();
StringBuilder c = new StringBuilder();
sender.sendMessage("Serializing Objects");
for(IrisBiome i : biomes)
{
for(IrisObjectPlacement j : i.getObjects())
{
b.append(j.hashCode());
KList<String> newNames = new KList<>();
for(String k : j.getPlace())
{
if(renameObjects.containsKey(k))
{
newNames.add(renameObjects.get(k));
continue;
}
String name = !obfuscate ? k : UUID.randomUUID().toString().replaceAll("-", "");
b.append(name);
newNames.add(name);
renameObjects.put(k, name);
}
j.setPlace(newNames);
}
}
for(IrisBiomeMutation i : dimension.getMutations())
{
for(IrisObjectPlacement j : i.getObjects())
{
b.append(j.hashCode());
KList<String> newNames = new KList<>();
for(String k : j.getPlace())
{
if(renameObjects.containsKey(k))
{
newNames.add(renameObjects.get(k));
continue;
}
String name = !obfuscate ? k : UUID.randomUUID().toString().replaceAll("-", "");
b.append(name);
newNames.add(name);
renameObjects.put(k, name);
}
j.setPlace(newNames);
}
}
KMap<String, KList<String>> lookupObjects = renameObjects.flip();
StringBuilder gb = new StringBuilder();
ChronoLatch cl = new ChronoLatch(1000);
O<Integer> ggg = new O<>();
ggg.set(0);
biomes.forEach((i) -> i.getObjects().forEach((j) -> j.getPlace().forEach((k) ->
{
try
{
File f = dm.getObjectLoader().findFile(lookupObjects.get(k).get(0));
IO.copyFile(f, new File(folder, "objects/" + k + ".iob"));
gb.append(IO.hash(f));
ggg.set(ggg.get() + 1);
if(cl.flip())
{
int g = ggg.get();
ggg.set(0);
sender.sendMessage("Wrote another " + g + " Objects");
}
}
catch(Throwable ignored)
{
}
})));
dimension.getMutations().forEach((i) -> i.getObjects().forEach((j) -> j.getPlace().forEach((k) ->
{
try
{
File f = dm.getObjectLoader().findFile(lookupObjects.get(k).get(0));
IO.copyFile(f, new File(folder, "objects/" + k + ".iob"));
gb.append(IO.hash(f));
ggg.set(ggg.get() + 1);
if(cl.flip())
{
int g = ggg.get();
ggg.set(0);
sender.sendMessage("Wrote another " + g + " Objects");
}
}
catch(Throwable ignored)
{
}
})));
b.append(IO.hash(gb.toString()));
c.append(IO.hash(b.toString()));
b = new StringBuilder();
Iris.info("Writing Dimensional Scaffold");
try
{
a = new JSONObject(new Gson().toJson(dimension)).toString(minify ? 0 : 4);
IO.writeAll(new File(folder, "dimensions/" + dimension.getLoadKey() + ".json"), a);
b.append(IO.hash(a));
for(IrisGenerator i : generators)
{
a = new JSONObject(new Gson().toJson(i)).toString(minify ? 0 : 4);
IO.writeAll(new File(folder, "generators/" + i.getLoadKey() + ".json"), a);
b.append(IO.hash(a));
}
c.append(IO.hash(b.toString()));
b = new StringBuilder();
for(IrisRegion i : regions)
{
a = new JSONObject(new Gson().toJson(i)).toString(minify ? 0 : 4);
IO.writeAll(new File(folder, "regions/" + i.getLoadKey() + ".json"), a);
b.append(IO.hash(a));
}
for(IrisBlockData i : blocks)
{
a = new JSONObject(new Gson().toJson(i)).toString(minify ? 0 : 4);
IO.writeAll(new File(folder, "blocks/" + i.getLoadKey() + ".json"), a);
b.append(IO.hash(a));
}
for(IrisBiome i : biomes)
{
a = new JSONObject(new Gson().toJson(i)).toString(minify ? 0 : 4);
IO.writeAll(new File(folder, "biomes/" + i.getLoadKey() + ".json"), a);
b.append(IO.hash(a));
}
for(IrisEntity i : entities)
{
a = new JSONObject(new Gson().toJson(i)).toString(minify ? 0 : 4);
IO.writeAll(new File(folder, "entities/" + i.getLoadKey() + ".json"), a);
b.append(IO.hash(a));
}
for(IrisLootTable i : loot)
{
a = new JSONObject(new Gson().toJson(i)).toString(minify ? 0 : 4);
IO.writeAll(new File(folder, "loot/" + i.getLoadKey() + ".json"), a);
b.append(IO.hash(a));
}
c.append(IO.hash(b.toString()));
String finalHash = IO.hash(c.toString());
JSONObject meta = new JSONObject();
meta.put("hash", finalHash);
meta.put("time", M.ms());
meta.put("version", dimension.getVersion());
IO.writeAll(new File(folder, "package.json"), meta.toString(minify ? 0 : 4));
File p = new File(Iris.instance.getDataFolder(), "exports/" + dimension.getLoadKey() + ".iris");
Iris.info("Compressing Package");
ZipUtil.pack(folder, p, 9);
IO.delete(folder);
sender.sendMessage("Package Compiled!");
return p;
}
catch(Throwable e)
{
e.printStackTrace();
}
sender.sendMessage("Failed!");
return null;
}
}

View File

@@ -0,0 +1,523 @@
package com.volmit.iris.manager;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.object.IrisDimension;
import com.volmit.iris.scaffold.cache.AtomicCache;
import com.volmit.iris.util.*;
import lombok.Data;
import org.bukkit.potion.PotionEffectType;
import org.zeroturnaround.zip.ZipUtil;
import org.zeroturnaround.zip.commons.FileUtils;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.Objects;
import java.util.UUID;
@Data
public class ProjectManager
{
public static final String LISTING = "https://raw.githubusercontent.com/IrisDimensions/_listing/main/listing.json";
public static final String WORKSPACE_NAME = "packs";
private KMap<String, String> cacheListing = null;
private IrisProject activeProject;
private static final AtomicCache<Integer> counter = new AtomicCache<>();
public ProjectManager()
{
if(IrisSettings.get().isStudio())
{
J.a(() ->
{
File ignore = getWorkspaceFile(".gitignore");
if(!ignore.exists())
{
File m = Iris.getCached("Pack Ignore (.gitignore)", "https://raw.githubusercontent.com/VolmitSoftware/Iris/master/packignore.ignore");
if(m != null)
{
try
{
IO.copyFile(m, ignore);
}
catch(IOException e)
{
}
}
}
});
}
}
public static int countUniqueDimensions() {
int vv = counter.aquire(() -> {
int v = 0;
try
{
for(File i : Iris.instance.getDataFolder(WORKSPACE_NAME).listFiles())
{
try
{
if(i.isDirectory() && i.list().length > 0 && !Iris.proj.getListing(true).keySet().contains(i.getName()))
{
v++;
}
}
catch(Throwable ignored)
{
}
}
}
catch(Throwable ignored)
{
}
return v;
});
return vv;
}
public IrisDimension installIntoWorld(MortarSender sender, String type, File folder)
{
sender.sendMessage("Looking for Package: " + type);
File iris = new File(folder, "iris");
File irispack = new File(folder, "iris/pack");
IrisDimension dim = IrisDataManager.loadAnyDimension(type);
if(dim == null)
{
for(File i : Iris.proj.getWorkspaceFolder().listFiles())
{
if(i.isFile() && i.getName().equals(type + ".iris"))
{
sender.sendMessage("Found " + type + ".iris in " + ProjectManager.WORKSPACE_NAME + " folder");
ZipUtil.unpack(i, irispack);
break;
}
}
}
else
{
sender.sendMessage("Found " + type + " dimension in " + ProjectManager.WORKSPACE_NAME + " folder. Repackaging");
File f = new IrisProject(new File(getWorkspaceFolder(), type)).getPath();
try
{
FileUtils.copyDirectory(f, irispack);
}
catch(IOException e)
{
}
}
File dimf = new File(irispack, "dimensions/" + type + ".json");
if(!dimf.exists() || !dimf.isFile())
{
Iris.proj.downloadSearch(sender, type, false);
File downloaded = Iris.proj.getWorkspaceFolder(type);
for(File i : downloaded.listFiles())
{
if(i.isFile())
{
try
{
FileUtils.copyFile(i, new File(irispack, i.getName()));
}
catch(IOException e)
{
e.printStackTrace();
}
}
else
{
try
{
FileUtils.copyDirectory(i, new File(irispack, i.getName()));
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
IO.delete(downloaded);
}
if(!dimf.exists() || !dimf.isFile())
{
sender.sendMessage("Can't find the " + dimf.getName() + " in the dimensions folder of this pack! Failed!");
return null;
}
IrisDataManager dm = new IrisDataManager(irispack);
dim = dm.getDimensionLoader().load(type);
if(dim == null)
{
sender.sendMessage("Can't load the dimension! Failed!");
return null;
}
sender.sendMessage(folder.getName() + " type installed. ");
return dim;
}
public void downloadSearch(MortarSender sender, String key, boolean trim)
{
downloadSearch(sender, key, trim, false);
}
public void downloadSearch(MortarSender sender, String key, boolean trim, boolean forceOverwrite)
{
String repo = getListing(false).get(key);
if(repo == null)
{
sender.sendMessage("Couldn't find the pack '" + key + "' in the iris repo listing.");
return;
}
sender.sendMessage("Found '" + key + "' in the Iris Listing as " + repo);
try
{
download(sender, repo, trim, forceOverwrite);
}
catch(JsonSyntaxException | IOException e)
{
sender.sendMessage("Failed to download '" + key + "'.");
}
}
public void download(MortarSender sender, String repo, boolean trim) throws JsonSyntaxException, IOException
{
download(sender, repo, trim, false);
}
public void download(MortarSender sender, String repo, boolean trim, boolean forceOverwrite) throws JsonSyntaxException, IOException
{
String url = "https://codeload.github.com/" + repo + "/zip/master";
sender.sendMessage("Downloading " + url);
File zip = Iris.getNonCachedFile("pack-" + trim + "-" + repo, url);
File temp = Iris.getTemp();
File work = new File(temp, "dl-" + UUID.randomUUID());
File packs = getWorkspaceFolder();
sender.sendMessage("Unpacking " + repo);
try {
ZipUtil.unpack(zip, work);
} catch (Exception e){
sender.sendMessage(
"Issue when unpacking. Please check/do the following:" +
"\n1. Do you have a functioning internet connection?" +
"\n2. Did the download corrupt?" +
"\n3. Try deleting the */plugins/iris/packs folder and re-download." +
"\n4. Download the pack from the GitHub repo: https://github.com/IrisDimensions/overworld" +
"\n5. Contact support (if all other options do not help)"
);
}
File dir = work.listFiles().length == 1 && work.listFiles()[0].isDirectory() ? work.listFiles()[0] : null;
if(dir == null)
{
sender.sendMessage("Invalid Format. Missing root folder or too many folders!");
return;
}
File dimensions = new File(dir, "dimensions");
if(!(dimensions.exists() && dimensions.isDirectory()))
{
sender.sendMessage("Invalid Format. Missing dimensions folder");
return;
}
if(dimensions.listFiles().length != 1)
{
sender.sendMessage("Dimensions folder must have 1 file in it");
return;
}
File dim = dimensions.listFiles()[0];
if(!dim.isFile())
{
sender.sendMessage("Invalid dimension (folder) in dimensions folder");
return;
}
String key = dim.getName().split("\\Q.\\E")[0];
IrisDimension d = new Gson().fromJson(IO.readAll(dim), IrisDimension.class);
sender.sendMessage("Importing " + d.getName() + " (" + key + ")");
File packEntry = new File(packs, key);
if(forceOverwrite)
{
IO.delete(packEntry);
}
if(IrisDataManager.loadAnyDimension(key) != null)
{
sender.sendMessage("Another dimension in the packs folder is already using the key " + key + " IMPORT FAILED!");
return;
}
if(packEntry.exists() && packEntry.listFiles().length > 0)
{
sender.sendMessage("Another pack is using the key " + key + ". IMPORT FAILED!");
return;
}
FileUtils.copyDirectory(dir, packEntry);
if(trim)
{
sender.sendMessage("Trimming " + key);
File cp = compilePackage(sender, key, false, false);
IO.delete(packEntry);
packEntry.mkdirs();
ZipUtil.unpack(cp, packEntry);
}
sender.sendMessage("Successfully Aquired " + d.getName());
}
public KMap<String, String> getListing(boolean cached)
{
if(cached && cacheListing != null)
{
return cacheListing;
}
JSONArray a;
if(cached)
{
a = new JSONArray(Objects.requireNonNull(Iris.getCached("cachedlisting", LISTING)));
}
else
{
a = new JSONArray(Iris.getNonCached(true + "listing", LISTING));
}
KMap<String, String> l = new KMap<>();
for(int i = 0; i < a.length(); i++)
{
try
{
String m = a.getString(i).trim();
String[] v = m.split("\\Q \\E");
l.put(v[0], v[1]);
}
catch(Throwable ignored)
{
}
}
return l;
}
public boolean isProjectOpen()
{
return activeProject != null && activeProject.isOpen();
}
public void open(MortarSender sender, String dimm)
{
try {
open(sender, dimm, () ->
{
if (sender.isPlayer()) {
sender.player().removePotionEffect(PotionEffectType.BLINDNESS);
}
});
} catch (Exception e){
sender.player().removePotionEffect(PotionEffectType.BLINDNESS);
sender.sendMessage("Error when creating studio world:");
e.printStackTrace();
}
}
public void open(MortarSender sender, String dimm, Runnable onDone)
{
if(isProjectOpen())
{
close();
}
IrisProject project = new IrisProject(new File(getWorkspaceFolder(), dimm));
activeProject = project;
project.open(sender, onDone);
}
public File getWorkspaceFolder(String... sub)
{
return Iris.instance.getDataFolderList(WORKSPACE_NAME, sub);
}
public File getWorkspaceFile(String... sub)
{
return Iris.instance.getDataFileList(WORKSPACE_NAME, sub);
}
public void close()
{
if(isProjectOpen())
{
activeProject.close();
activeProject = null;
}
}
public File compilePackage(MortarSender sender, String d, boolean obfuscate, boolean minify)
{
return new IrisProject(new File(getWorkspaceFolder(), d)).compilePackage(sender, obfuscate, minify);
}
public void createFrom(String existingPack, String newName)
{
File importPack = getWorkspaceFolder(existingPack);
File newPack = getWorkspaceFolder(newName);
if(importPack.listFiles().length == 0)
{
Iris.warn("Couldn't find the pack to create a new dimension from.");
return;
}
try
{
FileUtils.copyDirectory(importPack, newPack, new FileFilter()
{
@Override
public boolean accept(File pathname)
{
return !pathname.getAbsolutePath().contains(".git");
}
}, false);
}
catch(IOException e)
{
e.printStackTrace();
}
new File(importPack, existingPack + ".code-workspace").delete();
File dimFile = new File(importPack, "dimensions/" + existingPack + ".json");
File newDimFile = new File(newPack, "dimensions/" + newName + ".json");
try
{
FileUtils.copyFile(dimFile, newDimFile);
}
catch(IOException e)
{
e.printStackTrace();
}
new File(newPack, "dimensions/" + existingPack + ".json").delete();
try
{
JSONObject json = new JSONObject(IO.readAll(newDimFile));
if(json.has("name"))
{
json.put("name", Form.capitalizeWords(newName.replaceAll("\\Q-\\E", " ")));
IO.writeAll(newDimFile, json.toString(4));
}
}
catch(JSONException | IOException e)
{
e.printStackTrace();
}
try
{
IrisProject p = new IrisProject(getWorkspaceFolder(newName));
JSONObject ws = p.createCodeWorkspaceConfig();
IO.writeAll(getWorkspaceFile(newName, newName + ".code-workspace"), ws.toString(0));
}
catch(JSONException | IOException e)
{
e.printStackTrace();
}
}
public void create(MortarSender sender, String s, String downloadable)
{
boolean shouldDelete = false;
File importPack = getWorkspaceFolder(downloadable);
if(importPack.listFiles().length == 0)
{
downloadSearch(sender, downloadable, false);
if(importPack.listFiles().length > 0)
{
shouldDelete = true;
}
}
if(importPack.listFiles().length == 0)
{
sender.sendMessage("Couldn't find the pack to create a new dimension from.");
return;
}
File importDimensionFile = new File(importPack, "dimensions/" + downloadable + ".json");
if(!importDimensionFile.exists())
{
sender.sendMessage("Missing Imported Dimension File");
return;
}
sender.sendMessage("Importing " + downloadable + " into new Project " + s);
createFrom(downloadable, s);
if(shouldDelete)
{
importPack.delete();
}
open(sender, s);
}
public void create(MortarSender sender, String s)
{
create(sender, s, "example");
}
public void updateWorkspace()
{
if(isProjectOpen())
{
activeProject.updateWorkspace();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,354 @@
package com.volmit.iris.manager;
import com.volmit.iris.Iris;
import com.volmit.iris.manager.edit.DustRevealer;
import com.volmit.iris.object.IrisObject;
import com.volmit.iris.util.*;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.util.BlockVector;
import org.bukkit.util.Vector;
import java.awt.Color;
import java.util.Iterator;
import java.util.Objects;
public class WandManager implements Listener
{
public WandManager()
{
Bukkit.getScheduler().scheduleSyncRepeatingTask(Iris.instance, () ->
{
for(Player i : Bukkit.getOnlinePlayers())
{
tick(i);
}
}, 0, 5);
Bukkit.getPluginManager().registerEvents(this, Iris.instance);
}
public void tick(Player p)
{
try
{
if(isWand(p.getInventory().getItemInMainHand()))
{
Location[] d = getCuboid(p.getInventory().getItemInMainHand());
draw(d, p);
}
}
catch(Throwable e)
{
}
}
public void draw(Cuboid d, Player p)
{
draw(new Location[] {d.getLowerNE(), d.getUpperSW()}, p);
}
public void draw(Location[] d, Player p)
{
Vector gx = Vector.getRandom().subtract(Vector.getRandom()).normalize().clone().multiply(0.65);
d[0].getWorld().spawnParticle(Particle.CRIT_MAGIC, d[0], 1, 0.5 + gx.getX(), 0.5 + gx.getY(), 0.5 + gx.getZ(), 0, null, false);
Vector gxx = Vector.getRandom().subtract(Vector.getRandom()).normalize().clone().multiply(0.65);
d[1].getWorld().spawnParticle(Particle.CRIT, d[1], 1, 0.5 + gxx.getX(), 0.5 + gxx.getY(), 0.5 + gxx.getZ(), 0, null, false);
if(!d[0].getWorld().equals(d[1].getWorld()))
{
return;
}
if(d[0].distanceSquared(d[1]) > 64 * 64)
{
return;
}
int minx = Math.min(d[0].getBlockX(), d[1].getBlockX());
int miny = Math.min(d[0].getBlockY(), d[1].getBlockY());
int minz = Math.min(d[0].getBlockZ(), d[1].getBlockZ());
int maxx = Math.max(d[0].getBlockX(), d[1].getBlockX());
int maxy = Math.max(d[0].getBlockY(), d[1].getBlockY());
int maxz = Math.max(d[0].getBlockZ(), d[1].getBlockZ());
for(double j = minx - 1; j < maxx + 1; j += 0.25)
{
for(double k = miny - 1; k < maxy + 1; k += 0.25)
{
for(double l = minz - 1; l < maxz + 1; l += 0.25)
{
if(M.r(0.2))
{
boolean jj = j == minx || j == maxx;
boolean kk = k == miny || k == maxy;
boolean ll = l == minz || l == maxz;
double aa = j;
double bb = k;
double cc = l;
if((jj && kk) || (jj && ll) || (ll && kk))
{
Vector push = new Vector(0, 0, 0);
if(j == minx)
{
push.add(new Vector(-0.55, 0, 0));
}
if(k == miny)
{
push.add(new Vector(0, -0.55, 0));
}
if(l == minz)
{
push.add(new Vector(0, 0, -0.55));
}
if(j == maxx)
{
push.add(new Vector(0.55, 0, 0));
}
if(k == maxy)
{
push.add(new Vector(0, 0.55, 0));
}
if(l == maxz)
{
push.add(new Vector(0, 0, 0.55));
}
Location lv = new Location(d[0].getWorld(), aa, bb, cc).clone().add(0.5, 0.5, 0.5).clone().add(push);
Color color = Color.getHSBColor((float) (0.5f + (Math.sin((aa + bb + cc + (p.getTicksLived() / 2)) / 20f) / 2)), 1, 1);
int r = color.getRed();
int g = color.getGreen();
int b = color.getBlue();
p.spawnParticle(Particle.REDSTONE, lv.getX(), lv.getY(), lv.getZ(), 1, 0, 0, 0, 0, new Particle.DustOptions(org.bukkit.Color.fromRGB(r, g, b), 0.75f));
}
}
}
}
}
}
@EventHandler
public void on(PlayerInteractEvent e)
{
try
{
if(Objects.equals(e.getHand(), EquipmentSlot.HAND) && isWand(e.getPlayer().getInventory().getItemInMainHand()))
{
if(e.getAction().equals(Action.LEFT_CLICK_BLOCK))
{
e.setCancelled(true);
e.getPlayer().getInventory().setItemInMainHand(update(true, Objects.requireNonNull(e.getClickedBlock()).getLocation(), e.getPlayer().getInventory().getItemInMainHand()));
e.getPlayer().playSound(e.getClickedBlock().getLocation(), Sound.BLOCK_END_PORTAL_FRAME_FILL, 1f, 0.67f);
e.getPlayer().updateInventory();
}
else if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK))
{
e.setCancelled(true);
e.getPlayer().getInventory().setItemInMainHand(update(false, Objects.requireNonNull(e.getClickedBlock()).getLocation(), e.getPlayer().getInventory().getItemInMainHand()));
e.getPlayer().playSound(e.getClickedBlock().getLocation(), Sound.BLOCK_END_PORTAL_FRAME_FILL, 1f, 1.17f);
e.getPlayer().updateInventory();
}
}
if(e.getHand().equals(EquipmentSlot.HAND) && isDust(e.getPlayer().getInventory().getItemInMainHand()))
{
if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK))
{
e.setCancelled(true);
e.getPlayer().playSound(Objects.requireNonNull(e.getClickedBlock()).getLocation(), Sound.ENTITY_ENDER_EYE_DEATH, 2f, 1.97f);
DustRevealer.spawn(e.getClickedBlock(), new MortarSender(e.getPlayer(), Iris.instance.getTag()));
}
}
}
catch(Throwable ignored)
{
}
}
public static void pasteSchematic(IrisObject s, Location at)
{
s.place(at);
}
public static IrisObject createSchematic(ItemStack wand)
{
if(!isWand(wand))
{
return null;
}
try
{
Location[] f = getCuboid(wand);
Cuboid c = new Cuboid(f[0], f[1]);
IrisObject s = new IrisObject(c.getSizeX(), c.getSizeY(), c.getSizeZ());
Iterator<Block> bb = c.iterator();
while(bb.hasNext())
{
Block b = bb.next();
if(b.getType().equals(Material.AIR))
{
continue;
}
BlockVector bv = b.getLocation().subtract(c.getLowerNE().toVector()).toVector().toBlockVector();
s.setUnsigned(bv.getBlockX(), bv.getBlockY(), bv.getBlockZ(), b);
}
return s;
}
catch(Throwable e)
{
e.printStackTrace();
}
return null;
}
public static Location stringToLocation(String s)
{
try
{
String[] f = s.split("\\Q in \\E");
String[] g = f[0].split("\\Q,\\E");
return new Location(Bukkit.getWorld(f[1]), Integer.valueOf(g[0]), Integer.valueOf(g[1]), Integer.valueOf(g[2]));
}
catch(Throwable e)
{
return null;
}
}
public static String locationToString(Location s)
{
if(s == null)
{
return "<#>";
}
return s.getBlockX() + "," + s.getBlockY() + "," + s.getBlockZ() + " in " + s.getWorld().getName();
}
public static ItemStack createWand()
{
return createWand(null, null);
}
public static ItemStack createDust()
{
ItemStack is = new ItemStack(Material.GLOWSTONE_DUST);
is.addUnsafeEnchantment(Enchantment.ARROW_INFINITE, 1);
ItemMeta im = is.getItemMeta();
im.setDisplayName(C.BOLD + "" + C.YELLOW + "Dust of Revealing");
im.setUnbreakable(true);
im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_PLACED_ON, ItemFlag.HIDE_POTION_EFFECTS, ItemFlag.HIDE_DESTROYS, ItemFlag.HIDE_ENCHANTS);
im.setLore(new KList<String>().qadd("Right click on a block to reveal it's placement structure!"));
is.setItemMeta(im);
return is;
}
public boolean isDust(ItemStack is)
{
if(is == null || is.getType().equals(Material.AIR))
{
return false;
}
if(is.getType().equals(Material.GLOWSTONE_DUST))
{
return true;
}
return false;
}
public static ItemStack update(boolean left, Location a, ItemStack item)
{
if(!isWand(item))
{
return item;
}
Location[] f = getCuboid(item);
Location other = left ? f[1] : f[0];
if(other != null && !other.getWorld().getName().equals(a.getWorld().getName()))
{
other = null;
}
return createWand(left ? a : other, left ? other : a);
}
public static ItemStack createWand(Location a, Location b)
{
ItemStack is = new ItemStack(Material.BLAZE_ROD);
is.addUnsafeEnchantment(Enchantment.ARROW_INFINITE, 1);
ItemMeta im = is.getItemMeta();
im.setDisplayName(C.BOLD + "" + C.GOLD + "Wand of Iris");
im.setUnbreakable(true);
im.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_PLACED_ON, ItemFlag.HIDE_POTION_EFFECTS, ItemFlag.HIDE_DESTROYS, ItemFlag.HIDE_ENCHANTS);
im.setLore(new KList<String>().add(locationToString(a), locationToString(b)));
is.setItemMeta(im);
return is;
}
public static boolean isWand(Player p)
{
ItemStack is = p.getInventory().getItemInMainHand();
return !(is == null || !isWand(is));
}
public static Location[] getCuboid(ItemStack is)
{
ItemMeta im = is.getItemMeta();
return new Location[] {stringToLocation(im.getLore().get(0)), stringToLocation(im.getLore().get(1))};
}
public static boolean isWand(ItemStack item)
{
if(!item.getType().equals(createWand().getType()))
{
return false;
}
if(!item.getItemMeta().getEnchants().equals(createWand().getItemMeta().getEnchants()))
{
return false;
}
if(!item.getItemMeta().getDisplayName().equals(createWand().getItemMeta().getDisplayName()))
{
return false;
}
return true;
}
}

View File

@@ -0,0 +1,79 @@
package com.volmit.iris.manager.command;
import com.volmit.iris.Iris;
import com.volmit.iris.manager.command.jigsaw.CommandIrisJigsaw;
import com.volmit.iris.manager.command.object.CommandIrisObject;
import com.volmit.iris.manager.command.studio.CommandIrisStudio;
import com.volmit.iris.manager.command.what.CommandIrisWhat;
import com.volmit.iris.manager.command.world.*;
import com.volmit.iris.util.Command;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
public class CommandIris extends MortarCommand
{
@Command
private CommandIrisCreate create;
@Command
private CommandIrisFix fix;
@Command
private CommandIrisStudio studio;
@Command
private CommandIrisJigsaw jigsaw;
@Command
private CommandIrisObject object;
@Command
private CommandIrisRegen regen;
@Command
private CommandIrisDownload download;
@Command
private CommandIrisUpdateProject updateProject;
@Command
private CommandIrisUpdateWorld updateWorld;
@Command
private CommandIrisWhat what;
@Command
private CommandIrisMetrics metrics;
@Command
private CommandIrisPregen pregen;
@Command
private CommandIrisReload reload;
public CommandIris()
{
super("iris", "ir", "irs");
requiresPermission(Iris.perm);
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
sender.sendMessage("Iris v" + Iris.instance.getDescription().getVersion() + " by Volmit Software");
printHelp(sender);
return true;
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
protected String getArgsUsage()
{
return "";
}
}

View File

@@ -0,0 +1,52 @@
package com.volmit.iris.manager.command;
import com.volmit.iris.Iris;
import com.volmit.iris.util.*;
public class CommandIrisDownload extends MortarCommand
{
public CommandIrisDownload()
{
super("download", "down", "dl");
requiresPermission(Iris.perm.studio);
setDescription("Download a project.");
setCategory("Studio");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(args.length < 1)
{
sender.sendMessage("/iris dl " + C.BOLD + "<NAME>");
return true;
}
boolean trim = false;
for(String i : args)
{
if(i.equals("-t") || i.equals("--trim"))
{
trim = true;
}
}
boolean btrim = trim;
J.a(() -> Iris.proj.downloadSearch(sender, args[0], btrim));
return true;
}
@Override
protected String getArgsUsage()
{
return "<name> [-t/--trim]";
}
}

View File

@@ -0,0 +1,66 @@
package com.volmit.iris.manager.command;
import com.volmit.iris.Iris;
import com.volmit.iris.scaffold.IrisWorlds;
import com.volmit.iris.scaffold.engine.IrisAccess;
import com.volmit.iris.util.*;
import org.bukkit.World;
import org.bukkit.entity.Player;
public class CommandIrisMetrics extends MortarCommand
{
public CommandIrisMetrics()
{
super("metrics", "stats", "mt");
setDescription("Get timings for this world");
requiresPermission(Iris.perm.studio);
setCategory("Metrics");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(sender.isPlayer())
{
Player p = sender.player();
World world = p.getWorld();
if(!IrisWorlds.isIrisWorld(world))
{
sender.sendMessage("You must be in an iris world.");
return true;
}
IrisAccess g = IrisWorlds.access(world);
try
{
g.printMetrics(sender);
}
catch(Throwable e)
{
sender.sendMessage("You must be in an iris world.");
}
return true;
}
else
{
sender.sendMessage("Players only.");
}
return true;
}
@Override
protected String getArgsUsage()
{
return "";
}
}

View File

@@ -0,0 +1,38 @@
package com.volmit.iris.manager.command;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
public class CommandIrisReload extends MortarCommand
{
public CommandIrisReload()
{
super("reload", "rld");
requiresPermission(Iris.perm.studio);
setDescription("Reload configs");
setCategory("Studio");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
IrisSettings.invalidate();
IrisSettings.get();
sender.sendMessage("settings.json Reloaded");
return true;
}
@Override
protected String getArgsUsage()
{
return "<name> [-t/--trim]";
}
}

View File

@@ -0,0 +1,40 @@
package com.volmit.iris.manager.command;
import com.volmit.iris.Iris;
import com.volmit.iris.util.*;
public class CommandIrisUpdateProject extends MortarCommand
{
public CommandIrisUpdateProject()
{
super("update-project", "^project");
requiresPermission(Iris.perm.studio);
setDescription("Update a project from git.");
setCategory("Studio");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(args.length < 1)
{
sender.sendMessage("/iris update-project " + C.BOLD + "<PROJECT>");
return true;
}
J.a(() -> Iris.proj.downloadSearch(sender, args[0], false, true));
return true;
}
@Override
protected String getArgsUsage()
{
return "<project>";
}
}

View File

@@ -0,0 +1,33 @@
package com.volmit.iris.manager.command;
import com.volmit.iris.util.MortarPermission;
import com.volmit.iris.util.Permission;
public class PermissionIris extends MortarPermission
{
@Permission
public PermissionIrisStudio studio;
public PermissionIris()
{
super();
}
@Override
protected String getNode()
{
return "iris";
}
@Override
public String getDescription()
{
return "Iris Permissions";
}
@Override
public boolean isDefault()
{
return false;
}
}

View File

@@ -0,0 +1,29 @@
package com.volmit.iris.manager.command;
import com.volmit.iris.util.MortarPermission;
public class PermissionIrisStudio extends MortarPermission
{
public PermissionIrisStudio()
{
super();
}
@Override
protected String getNode()
{
return "studio";
}
@Override
public String getDescription()
{
return "Iris Studio Permissions";
}
@Override
public boolean isDefault()
{
return false;
}
}

View File

@@ -0,0 +1,62 @@
package com.volmit.iris.manager.command.jigsaw;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.util.Command;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
public class CommandIrisJigsaw extends MortarCommand
{
@Command
private CommandIrisJigsawNew create;
@Command
private CommandIrisJigsawEdit edit;
@Command
private CommandIrisJigsawSave save;
@Command
private CommandIrisJigsawPlace place;
public CommandIrisJigsaw()
{
super("jigsaw", "jig", "jsw");
requiresPermission(Iris.perm);
setCategory("Jigsaw");
setDescription("Iris jigsaw commands");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(!IrisSettings.get().isStudio())
{
sender.sendMessage("To use Iris Studio Jigsaw, please enable studio in Iris/settings.json");
return true;
}
if(!sender.isPlayer())
{
sender.sendMessage("Ingame only");
return true;
}
sender.sendMessage("Iris Jigsaw Commands:");
printHelp(sender);
return true;
}
@Override
protected String getArgsUsage()
{
return "";
}
}

View File

@@ -0,0 +1,66 @@
package com.volmit.iris.manager.command.jigsaw;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.manager.IrisDataManager;
import com.volmit.iris.manager.edit.JigsawEditor;
import com.volmit.iris.object.IrisJigsawPiece;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
import java.io.File;
public class CommandIrisJigsawEdit extends MortarCommand
{
public CommandIrisJigsawEdit()
{
super("edit", "e", "*");
requiresPermission(Iris.perm);
setCategory("Jigsaw");
setDescription("Edit an existing Jigsaw piece");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(!IrisSettings.get().isStudio())
{
sender.sendMessage("To use Iris Studio Jigsaw, please enable studio in Iris/settings.json");
return true;
}
if(!sender.isPlayer())
{
sender.sendMessage("Ingame only");
return true;
}
if(args.length < 1)
{
sender.sendMessage(getArgsUsage());
return true;
}
IrisJigsawPiece piece = IrisDataManager.loadAnyJigsawPiece(args[0]);
if(piece != null)
{
File dest = piece.getLoadFile();
new JigsawEditor(sender.player(), piece, IrisDataManager.loadAnyObject(piece.getObject()), dest);
}
return true;
}
@Override
protected String getArgsUsage()
{
return "<name>";
}
}

View File

@@ -0,0 +1,65 @@
package com.volmit.iris.manager.command.jigsaw;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.manager.IrisDataManager;
import com.volmit.iris.manager.edit.JigsawEditor;
import com.volmit.iris.object.IrisObject;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
import java.io.File;
public class CommandIrisJigsawNew extends MortarCommand
{
public CommandIrisJigsawNew()
{
super("create", "new", "+");
requiresPermission(Iris.perm);
setCategory("Jigsaw");
setDescription("Create a new jigsaw piece");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(!IrisSettings.get().isStudio())
{
sender.sendMessage("To use Iris Studio Jigsaw, please enable studio in Iris/settings.json");
return true;
}
if(!sender.isPlayer())
{
sender.sendMessage("Ingame only");
return true;
}
if(args.length != 3)
{
sender.sendMessage(getArgsUsage());
return true;
}
IrisObject object = IrisDataManager.loadAnyObject(args[2]);
File dest = Iris.instance.getDataFile("packs", args[1], "jigsaw-pieces", args[0] + ".json");
new JigsawEditor(sender.player(), null, object, dest);
sender.sendMessage("* Right Click blocks to make them connectors");
sender.sendMessage("* Right Click connectors to orient them");
sender.sendMessage("* Shift + Right Click connectors to remove them");
sender.sendMessage("Remember to use /iris jigsaw save");
return true;
}
@Override
protected String getArgsUsage()
{
return "<name> <project> <object>";
}
}

View File

@@ -0,0 +1,64 @@
package com.volmit.iris.manager.command.jigsaw;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.manager.IrisDataManager;
import com.volmit.iris.object.IrisJigsawStructure;
import com.volmit.iris.object.IrisPosition;
import com.volmit.iris.scaffold.jigsaw.PlannedStructure;
import com.volmit.iris.util.*;
public class CommandIrisJigsawPlace extends MortarCommand
{
public CommandIrisJigsawPlace()
{
super("place", "paste");
requiresPermission(Iris.perm);
setCategory("Jigsaw");
setDescription("Place a jigsaw structure");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(!IrisSettings.get().isStudio())
{
sender.sendMessage("To use Iris Studio Jigsaw, please enable studio in Iris/settings.json");
return true;
}
if(!sender.isPlayer())
{
sender.sendMessage("Ingame only");
return true;
}
if(args.length == 0){
sender.sendMessage("You have to specify a jigsaw structure!");
return true;
}
IrisJigsawStructure str = IrisDataManager.loadAnyJigsawStructure(args[0]);
if(str != null)
{
PrecisionStopwatch p = PrecisionStopwatch.start();
PlannedStructure ps = new PlannedStructure(str, new IrisPosition(sender.player().getLocation()), new RNG());
sender.sendMessage("Generated " + ps.getPieces().size() + " pieces in " + Form.duration(p.getMilliseconds(), 2));
ps.place(sender.player().getWorld());
}
return true;
}
@Override
protected String getArgsUsage()
{
return "<name>";
}
}

View File

@@ -0,0 +1,57 @@
package com.volmit.iris.manager.command.jigsaw;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.manager.edit.JigsawEditor;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
public class CommandIrisJigsawSave extends MortarCommand
{
public CommandIrisJigsawSave()
{
super("save");
requiresPermission(Iris.perm);
setCategory("Jigsaw");
setDescription("Save a currently open piece");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(!IrisSettings.get().isStudio())
{
sender.sendMessage("To use Iris Studio Jigsaw, please enable studio in Iris/settings.json");
return true;
}
if(!sender.isPlayer())
{
sender.sendMessage("Ingame only");
return true;
}
JigsawEditor editor = JigsawEditor.editors.get(sender.player());
if(editor == null)
{
sender.sendMessage("You don't have any pieces open to save!");
return true;
}
editor.close();
return true;
}
@Override
protected String getArgsUsage()
{
return "";
}
}

View File

@@ -0,0 +1,77 @@
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.util.Command;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
public class CommandIrisObject extends MortarCommand
{
@Command
private CommandIrisObjectWand wand;
@Command
private CommandIrisObjectDust dust;
@Command
private CommandIrisObjectXPY xpy;
@Command
private CommandIrisObjectXAY xay;
@Command
private CommandIrisObjectShift shift;
@Command
private CommandIrisObjectExpand expand;
@Command
private CommandIrisObjectContract contract;
@Command
private CommandIrisObjectP1 p1;
@Command
private CommandIrisObjectP2 p2;
@Command
private CommandIrisObjectSave save;
@Command
private CommandIrisObjectPaste paste;
public CommandIrisObject()
{
super("object", "iob", "o", "obj");
requiresPermission(Iris.perm);
setCategory("Object");
setDescription("Object Commands");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(!IrisSettings.get().isStudio())
{
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
return true;
}
sender.sendMessage("Iris Object Commands:");
printHelp(sender);
return true;
}
@Override
protected String getArgsUsage()
{
return "[subcommand]";
}
}

View File

@@ -0,0 +1,71 @@
package com.volmit.iris.manager.command.object;
import com.volmit.iris.util.*;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.manager.WandManager;
public class CommandIrisObjectContract extends MortarCommand
{
public CommandIrisObjectContract()
{
super("-");
requiresPermission(Iris.perm);
setCategory("Object");
setDescription("Contract a selection based on your lookign direction");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(!IrisSettings.get().isStudio())
{
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
return true;
}
if(!sender.isPlayer())
{
sender.sendMessage("You don't have a wand");
return true;
}
Player p = sender.player();
if(!WandManager.isWand(p))
{
sender.sendMessage("Ready your Wand.");
return true;
}
int amt = args.length == 1 ? Integer.valueOf(args[0]) : 1;
Location[] b = WandManager.getCuboid(p.getInventory().getItemInMainHand());
Location a1 = b[0].clone();
Location a2 = b[1].clone();
Cuboid cursor = new Cuboid(a1, a2);
Direction d = Direction.closest(p.getLocation().getDirection()).reverse();
cursor = cursor.expand(d, -amt);
b[0] = cursor.getLowerNE();
b[1] = cursor.getUpperSW();
p.getInventory().setItemInMainHand(WandManager.createWand(b[0], b[1]));
p.updateInventory();
p.playSound(p.getLocation(), Sound.ENTITY_ITEM_FRAME_ROTATE_ITEM, 1f, 0.55f);
return true;
}
@Override
protected String getArgsUsage()
{
return "[amt]";
}
}

View File

@@ -0,0 +1,52 @@
package com.volmit.iris.manager.command.object;
import com.volmit.iris.Iris;
import com.volmit.iris.IrisSettings;
import com.volmit.iris.manager.WandManager;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
import org.bukkit.Sound;
public class CommandIrisObjectDust extends MortarCommand
{
public CommandIrisObjectDust()
{
super("dust", "dst", "d");
requiresPermission(Iris.perm);
setCategory("Object");
setDescription("Get a powder that reveals placed objects");
}
@Override
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(!IrisSettings.get().isStudio())
{
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
return true;
}
if(!sender.isPlayer())
{
sender.sendMessage("You don't have an inventory");
return true;
}
sender.player().getInventory().addItem(WandManager.createDust());
sender.player().playSound(sender.player().getLocation(), Sound.AMBIENT_SOUL_SAND_VALLEY_ADDITIONS, 1f, 1.5f);
return true;
}
@Override
protected String getArgsUsage()
{
return "[subcommand]";
}
}

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