Compare commits

..

316 Commits

Author SHA1 Message Date
s809 4a771a3e21 Restore ordering of session config entries 2024-09-08 21:21:42 +05:00
s809 0aa109a341 Refactor session config 2024-09-08 19:05:47 +05:00
s809 6d44255175 Fix crash on F3 when commit hash was failed to retrieve 2024-09-07 21:47:45 +05:00
s809 f8bb35cb2b Fix compilation on older versions 2024-09-06 00:12:09 +05:00
s809 52f1aed124 Fix client crashing 2024-09-05 23:45:08 +05:00
s809 6ae1ba1e17 Prefill levelKeyPrefix in new worlds 2024-09-05 14:22:08 +05:00
s809 9105f30fec Fix compilation 2024-09-04 22:53:06 +05:00
s809 839c849a9d Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into serverside 2024-09-04 18:22:52 +05:00
s809 275f507096 Limit number of retries on request errors
Add a delay if rate limit is hit
2024-09-02 15:31:43 +05:00
s809 01c5a4072a Delay loading first level when on server 2024-08-31 20:47:03 +05:00
s809 1697707114 Restore LOD fetching by distance 2024-08-29 17:09:13 +05:00
s809 34b0b7dc31 Print entire buffer in log 2024-08-28 16:19:17 +05:00
s809 691e1022e3 Do not start generator until server responds with config 2024-08-27 16:35:27 +05:00
s809 18fd157474 Show incompatible protocol version in F3 2024-08-27 16:02:26 +05:00
s809 4948158fa8 Fix sync on login 2024-08-26 16:54:05 +05:00
s809 e3b972c928 Fix missing mixins in (Neo-)Forge 2024-08-24 12:07:13 +05:00
s809 ad056cb64e Fix compilation 2024-08-24 03:06:29 +05:00
s809 3e22ddead5 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into serverside 2024-08-24 02:59:56 +05:00
s809 5c7e27c52d Fix network compression pool not shutting down 2024-08-23 17:11:37 +05:00
s809 3a5c6f12c0 Add back Forge packet ID in pre-1.20.6 2024-08-23 14:51:09 +05:00
s809 627eee7a6d "Fix" buffer release errors in FullDataPayload 2024-08-23 14:16:35 +05:00
s809 7c4c99089b Use same packet resource for all versions 2024-08-19 17:56:34 +05:00
s809 00ec14d319 Add logging of request group lifecycle 2024-08-15 15:47:13 +05:00
s809 56188bc7d2 Fix colors in verifyall.ps1 2024-08-14 13:29:32 +05:00
s809 9b2429d388 Fix compilation 2024-08-11 21:21:15 +05:00
s809 2aa68ec41d Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into serverside 2024-08-11 20:59:39 +05:00
s809 13c9f95750 Fix compilation 2024-08-11 00:53:12 +05:00
s809 b0549cecff Do not clear keyed level on close event 2024-08-10 23:53:33 +05:00
s809 95fb4a0e6a Make encode/decode error handling work correctly 2024-08-10 23:26:09 +05:00
s809 2a3aadc2fa Make error handling somewhat work 2024-08-10 19:49:40 +05:00
s809 52bddca0df Merge branch 'serverside-experimental/prevent-disconnects' into serverside 2024-08-07 22:20:39 +05:00
s809 606dede9ef Fix real-time updates 2024-08-06 23:12:18 +05:00
s809 e8c9d8391a Fix Neoforge not being able to connect to vanilla servers 2024-08-05 14:51:32 +05:00
s809 88ca223bbc Fix dimension switching (untested) 2024-08-03 15:43:19 +05:00
s809 4a51bbc796 [skip ci] Prevent disconnects on encode/decode/handle errors 2024-08-01 22:19:21 +05:00
s809 94ca0e2729 Increase defaults for network compression threads 2024-07-30 10:52:32 +05:00
s809 5befdbcddc Use FullDataPayload instead of reusing messages 2024-07-29 13:10:11 +05:00
s809 3e02d7f9dc Add build number on F3 screen 2024-07-28 20:19:41 +05:00
s809 48b38d9285 Fix compilation 2024-07-28 19:58:35 +05:00
s809 8c7c787a8f Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into serverside 2024-07-28 19:44:46 +05:00
s809 fc0cf56b48 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into serverside 2024-07-28 19:01:35 +05:00
s809 32c63ae15b Reapply "Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into serverside"
This reverts commit a2d5e8cdb3.
2024-07-28 17:06:36 +05:00
s809 bbf62f7ee3 Add verifyall.ps1 2024-07-27 23:09:46 +05:00
s809 6211542708 Update core 2024-07-27 23:08:45 +05:00
s809 a2d5e8cdb3 Revert "Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into serverside"
This reverts commit 692b304898, reversing
changes made to 0ca93e311c.
2024-07-27 23:07:43 +05:00
s809 692b304898 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into serverside 2024-07-27 21:43:54 +05:00
s809 0ca93e311c Fix handler registration 2024-07-20 23:56:34 +05:00
s809 c7aab012ae Update core 2024-07-17 00:02:22 +05:00
s809 80ccab21da Fix level handling for real time updates 2024-07-12 23:11:40 +05:00
s809 663ce3cde6 Add cache for ignoring responses for cancelled requests 2024-07-11 23:06:26 +05:00
s809 43fee18ae4 Clean up a bit 2024-07-11 22:08:21 +05:00
s809 014310631e Fix player tracking on server 2024-07-10 23:51:49 +05:00
s809 4f7e934c98 Add missing semaphore release 2024-07-09 18:06:20 +05:00
s809 563dcd7de6 Prevent request cancellation deadlock 2024-07-09 14:47:49 +05:00
s809 0a5cc734de Use dedicated thread pool for data compression 2024-07-08 23:08:04 +05:00
s809 0da158fecc Disable parent update propagation 2024-07-07 19:46:52 +05:00
s809 a7e8bbaf6a Reset state of level detection on world exit 2024-07-07 01:49:47 +05:00
s809 80732943c8 Repoint core to main repo 2024-07-01 14:20:34 +05:00
s809 994c86d5ba Make data source encoding lazy and move it off server thread 2024-07-01 00:16:00 +05:00
s809 18ccbbbb8e Move fixing the dimension name into even more correct place 2024-06-28 23:18:34 +05:00
s809 31c3fb9a1e Move fixing the dimension name into correct place 2024-06-28 19:28:40 +05:00
s809 8bdb383b2e Fix paths unable to be created on Windows 2024-06-28 17:25:18 +05:00
s809 d13ec687ed Fix test compilation failing 2024-06-28 15:52:51 +05:00
s809 43069703cd Update core 2024-06-28 15:44:06 +05:00
s809 6d76ace604 Use level's ResourceLocation instead of dimension type's 2024-06-28 15:35:28 +05:00
s809 9b139575e7 Clean up package structure 2024-06-26 23:57:50 +05:00
s809 efb9129edf Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into refactor/remove-tcp-connection 2024-06-26 15:13:22 +05:00
s809 6a380f6a7b Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into refactor/remove-tcp-connection 2024-06-26 14:55:39 +05:00
s809 0798ca01c5 Force GradleVanilla version 2024-06-21 13:49:18 +05:00
s809 8bfc1430c8 Put messages received before player joining into queue 2024-06-16 00:45:23 +05:00
s809 bd6621183d Avoid reloading levels when unnecessary 2024-06-14 16:25:25 +05:00
s809 ccc8076c66 Use level keys 2024-06-13 16:44:43 +05:00
s809 004103551f Prevent disconnection on decode failure 2024-06-10 23:55:33 +05:00
s809 ea47e11ecf Show dimension names 2024-06-10 23:40:01 +05:00
s809 8a3837b04b Better error on invalid dimension 2024-06-09 22:01:32 +05:00
s809 edfeaa618b Restore old cache key 2024-06-09 21:35:05 +05:00
s809 961cdbe868 Fix indent 2024-06-09 21:21:26 +05:00
s809 ff6ab67b69 Change job name 2024-06-09 21:19:39 +05:00
s809 c01fb4a716 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into refactor/remove-tcp-connection 2024-06-09 21:18:18 +05:00
s809 8bd524791f Use message wrapper in forge 2024-06-09 14:31:15 +05:00
s809 26059d5656 Fix logging errors 2024-06-08 00:07:33 +05:00
s809 3f23281e8d Add toString to messages & fix incorrect call 2024-06-06 21:25:32 +05:00
s809 fb25423deb Fix compilation for older versions 2 2024-06-05 21:17:21 +05:00
s809 6928c8dc28 Fix compilation for older versions 2024-06-04 23:33:44 +05:00
s809 7dfe0e4c50 Fix compilation 2024-06-02 20:00:16 +05:00
s809 1429ae5434 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into refactor/remove-tcp-connection 2024-06-02 19:59:34 +05:00
s809 3fb4d5a233 Increase section reload delay 2024-06-01 19:49:27 +05:00
s809 872226e5c5 Fix requests breaking on rejoining 2024-06-01 12:17:08 +05:00
s809 fb46820b1f Kinda works, rejoining is broken 2024-05-29 23:36:38 +05:00
s809 a786678bcb [skip ci] Incomplete 2024-05-21 22:55:06 +05:00
s809 0d35a3ea8e Move overrides in LAN to config 2024-05-18 22:14:01 +05:00
s809 6f87e22048 Fix forge config loading too late 2024-05-17 23:02:36 +05:00
s809 7c07c1e5bd Fix awt dependency error 2024-05-12 17:35:01 +05:00
s809 4ddb9659f5 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into feature/2.0.4 2024-05-11 19:17:13 +05:00
s809 e74b8c89ba Fix levels not unloading on forge 2024-05-11 18:38:25 +05:00
s809 1b536e4aef Fix compilation 2024-05-11 17:51:00 +05:00
s809 335f11acd3 Fix dimension switching (at cost of breaking immersive portals) 2024-05-10 23:56:15 +05:00
s809 b55b560cce Update core 2024-05-10 21:15:46 +05:00
s809 d87a152052 Fix generated sections not appearing 2024-05-10 21:15:02 +05:00
s809 db5a9c7c84 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons into feature/2.0.4 2024-05-05 19:51:32 +05:00
s809 2508efdd91 Fix updates 2024-05-05 16:55:20 +05:00
s809 4852720e14 Generation works, updates don't 2024-05-03 22:56:07 +05:00
s809 f39d156b11 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2024-05-02 21:47:42 +05:00
s809 e21eb61335 Fix 1.16.5 and 1.17.1 builds 2024-04-17 21:02:19 +05:00
s809 c49f385e3c Update core 2024-04-16 22:00:10 +05:00
s809 0584b0e593 Fix integer overflows 2024-04-12 23:15:02 +05:00
s809 220ac89ad8 Fix Neoforge 2024-04-12 22:38:21 +05:00
s809 e8e56b66a3 Merge branch 'feature/plugin-channel' 2024-04-02 22:35:28 +05:00
s809 634d8a5b52 Remove localhost from check 2024-04-02 22:27:44 +05:00
s809 b621c9fb8d Some small changes 2024-04-02 21:55:59 +05:00
s809 696f84a064 Fix compilation 2024-04-01 21:52:25 +05:00
s809 5c13ff8960 Fix errors when on vanilla server 2024-04-01 00:55:23 +05:00
s809 e102cd78cd Fix reconnection logic 2024-03-30 23:40:17 +05:00
s809 c5a782acba Fix broken mod compat on server 💀 2024-03-28 09:24:57 +05:00
s809 2008ea2b0c Incomplete 2024-03-26 00:31:13 +05:00
s809 0f349461d9 Fix Forge 2024-03-18 21:38:08 +05:00
s809 baf464aa02 Add thread pool task buildup limiter 2024-03-16 12:28:42 +05:00
s809 51d83d803a [no ci] Incomplete fix forge 2024-03-16 11:22:52 +05:00
s809 2b3244159b Server side plugin networking
Untested port for Forge
2024-03-14 21:46:33 +05:00
s809 9255c22d0e Fix world setting 2024-03-10 21:11:04 +05:00
s809 4d573c4aea Initial buggy plugin channel support 2024-03-05 22:10:05 +05:00
s809 a59f359133 Do not wait for world gen tasks to stop while shutting down queue 2024-02-25 18:05:50 +05:00
s809 c83d02c30c Always print git info 2024-02-25 13:11:37 +05:00
s809 d01573b03e Show server side messages in F3 on disconnect 2024-02-25 00:40:31 +05:00
s809 b1fb74539f Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2024-02-22 23:06:40 +05:00
s809 40962ec9ba Use separate build caches 2024-02-15 19:22:29 +00:00
s809 0515ac2919 Fix immersive portals 2024-02-15 23:15:11 +05:00
s809 8072695391 Fix connection exception handling 2024-02-13 22:26:24 +05:00
s809 2c140bf7d7 Fix compilation 2024-02-12 21:39:52 +05:00
s809 d3e88b40f4 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2024-02-12 21:39:04 +05:00
s809 5e0e15777c Add another config option
Fix rate limiting issues (kinda)
2024-02-11 19:39:42 +05:00
s809 b57fc5c9aa Fix compilation 2024-02-08 20:44:46 +05:00
s809 91ea68075e Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2024-02-08 20:39:21 +05:00
s809 0840ec8b00 Update core 2024-02-07 21:03:48 +05:00
s809 d9f37ad7d6 Fix compilation 2024-02-07 21:03:37 +05:00
s809 992a7129e5 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2024-02-07 20:50:06 +05:00
s809 1d5ea329de Remove unused packets 2024-02-04 21:58:01 +05:00
s809 00d0a0d2fc Fix queue not filled when generation is toggled 2024-02-04 21:00:06 +05:00
s809 95d4314982 Merge remote-tracking branch 'origin/main' 2024-02-04 02:36:31 +05:00
s809 b588b937ea Update core 2024-02-04 02:35:30 +05:00
s809 f524ad027e Fix editorconfig 2024-02-03 22:38:27 +05:00
s809 b3111b9548 Update core 2024-02-02 05:57:32 +00:00
s809 6c38cb3dee Limit rate+concurrency instead of only concurrency
Rename post-relog update to Login sync
2024-01-29 22:36:21 +05:00
s809 d75b2dfc1c Update core 2024-01-28 22:40:43 +05:00
s809 a5b44d65c6 Change retry a bit 2024-01-28 22:40:36 +05:00
s809 7a1c61405c Retry failed jobs 2024-01-27 19:48:58 +05:00
s809 bcb8794d30 Post-relog updates 2024-01-27 19:45:38 +05:00
s809 f9775b115e Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2024-01-21 17:20:55 +05:00
s809 a56a2c2ba3 Fix compilation on <1.18.2 2024-01-16 20:28:48 +05:00
s809 b2efb33a5b Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2024-01-16 20:20:31 +05:00
s809 5928cfe4b4 Fix compilation 2024-01-16 20:18:32 +05:00
s809 234204590f Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2024-01-16 20:17:48 +05:00
s809 e3838c560a Fix Neoforge compilation 2024-01-13 20:36:12 +05:00
s809 6cbc9db1d8 Disable API and pages compilation 2024-01-13 20:32:25 +05:00
s809 127dcfcb46 Fix generation 2024-01-13 19:44:54 +05:00
s809 d1abdd822d Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2024-01-13 16:53:04 +05:00
s809 85b7ccb38e Fix crash when changing config while disconnected 2024-01-13 16:11:08 +05:00
s809 fc157b738e Remove Netty from jar and use one from MC instead 2024-01-13 16:11:08 +05:00
s809 977afffe98 Merge branch 'main' of https://gitlab.com/s809/minecraft-lod-mod 2024-01-11 23:34:21 +05:00
s809 180b22f21a Fix cast exception on changing dimensions
(I missed the fact that there's a method for obtaining level without weird hoops 💀)
2024-01-11 23:32:34 +05:00
s809 d0330ad62f Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2024-01-08 17:50:10 +05:00
s809 4d22b18f3c Refactor initializer code 2024-01-07 20:25:34 +05:00
s809 df797b240e Fix 1.16.5 and 1.17.1 builds 2024-01-05 22:37:32 +05:00
s809 a50ef86302 Update core 2024-01-05 22:08:50 +05:00
s809 4aede27d75 Forge versions are functional 2024-01-04 17:36:27 +05:00
s809 e616c63ebe [skip ci] Remove unnecessary build line 2024-01-02 21:03:03 +05:00
s809 03ec333a26 Fix forge builds
Server side is not functional yet
2024-01-02 20:47:11 +05:00
s809 27446965db Make 1.16.5 build
Make Netty version specific for each MC version
2023-12-30 21:57:03 +05:00
s809 c6d7313225 Fix fix 2023-12-29 18:42:10 +00:00
s809 160912a17a Fix 1.19.2 build 2023-12-29 21:13:17 +05:00
s809 d408aacbc8 Fix 1.19.2 build 2023-12-29 21:11:19 +05:00
s809 4889287e69 Start porting to previous versions 2023-12-29 20:31:07 +05:00
s809 6acdfabb7f Update core 2023-12-28 18:59:49 +05:00
s809 3c01d00772 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2023-12-28 18:59:15 +05:00
s809 736bb022d2 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2023-12-24 19:16:16 +05:00
s809 e92130d6cc Merge branch 'main' of https://gitlab.com/s809/minecraft-lod-mod 2023-12-21 19:29:38 +05:00
s809 a44dfa92a6 Update core 2023-12-21 19:29:17 +05:00
s809 4c8ee862e5 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2023-12-21 12:25:02 +05:00
s809 73b89fe573 Disable not working versions 2023-12-19 18:37:14 +00:00
s809 fed2600dbe Add protection against hang on shutdown 2023-12-19 23:20:30 +05:00
s809 1d7d94cfec Update core 2023-12-18 23:15:44 +05:00
s809 5577261774 Update wipe script
Update core
2023-12-18 23:11:47 +05:00
s809 bf0f3131a0 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2023-12-18 19:27:24 +05:00
s809 1b98ea59d7 Remove current post-relog update feature 2023-12-18 19:14:05 +05:00
s809 c38efd9d6b Fix 1.20.1 compilation 2023-12-15 22:31:58 +05:00
s809 4889119061 Merge branch 'main' of https://gitlab.com/s809/minecraft-lod-mod 2023-12-15 21:00:54 +05:00
s809 accb2d6af3 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2023-12-15 20:31:50 +05:00
s809 24b426a17b Disable building of forge jars 2023-12-06 17:24:32 +00:00
s809 8c1bccb430 Update core 2023-12-06 22:07:06 +05:00
s809 3cb2a70f4d Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2023-12-06 21:17:16 +05:00
s809 a313cb3db1 Fix Double missing from console command argument types 2023-11-29 22:39:16 +05:00
s809 c29c6d1870 Fix configs loading too late on server 2023-11-29 22:25:38 +05:00
s809 b4a64b0c3d Update core 2023-11-28 00:06:48 +05:00
s809 1439ca5c08 Remove unnecessary log 2023-11-26 21:34:07 +05:00
s809 97ad3bc78f Update core 2023-11-25 18:05:02 +05:00
s809 b59d8cff8d Fix command response not displayed in chat 2023-11-25 18:04:53 +05:00
s809 0e93aa4aea Basic chat commands 2023-11-25 17:44:52 +05:00
s809 28f8099777 Dummy chat command 2023-11-23 20:58:47 +05:00
s809 c83b0ae533 Sync core 2023-11-20 17:43:09 +05:00
s809 5ceeebe567 Merge branch 'main' of https://gitlab.com/jeseibel/distant-horizons 2023-11-19 22:57:14 +05:00
s809 e8db9803be Bandaid fix to prevent duplicate section requests 2023-11-12 17:18:39 +05:00
s809 f009fd41ab Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-11-11 19:20:50 +05:00
s809 9faa3b0a54 Do not update client light on a dedicated server 2023-11-04 16:39:23 +05:00
s809 0e70478dd3 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-11-03 21:23:37 +05:00
s809 309b6c6013 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-10-30 15:26:43 +05:00
s809 f20af18b62 Make post-relog update independent from generation toggle 2023-10-23 23:18:57 +05:00
Steveplays28 7d3329fd98 chore: Add missing language entries for the server networking config 2023-10-20 14:07:59 +02:00
Steveplays28 9a880c3ab1 style: Rename renderDistance to renderDistanceRadius to stay in sync with the main config 2023-10-20 14:03:28 +02:00
Steveplays28 0b247f04b4 fix: Fix getting LOD render distance radius from the config
This config option was renamed recently, to fix LODs not rendering out to the LOD render distance border. Also removed an unused import.
2023-10-20 13:50:03 +02:00
Steveplays28 7f1d664731 Merge branch 'main-upstream'
# Conflicts:
#	coreSubProjects
2023-10-20 13:41:50 +02:00
s809 a2288d740b Fix compilation 2023-10-14 22:13:22 +05:00
s809 958f0347a3 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-10-14 22:09:31 +05:00
s809 859bb2e34e Fix compilation 2023-09-28 23:28:23 +05:00
s809 a2acd08e0d Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-09-28 22:54:51 +05:00
Steveplays28 b986583fc4 Merge branch 'main-upstream'
# Conflicts:
#	coreSubProjects
#	fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLevelRenderer.java
2023-09-27 14:10:44 +02:00
s809 c6355f96a6 Improve management of frequent real time updates 2023-09-26 22:03:17 +05:00
s809 723d171746 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-09-26 11:40:59 +05:00
s809 63098d8519 Fix unloaded file check 2023-09-24 18:48:18 +05:00
Steveplays28 44b743267b fix: Fix compiling after merge 2023-09-24 11:34:04 +02:00
Steveplays28 720155c408 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	coreSubProjects
2023-09-24 11:28:43 +02:00
Steveplays28 334b487e23 Merge branch 'main-upstream'
# Conflicts:
#	coreSubProjects
#	fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricMain.java
2023-09-24 11:26:12 +02:00
s809 6e674f3732 Add gen task rate display 2023-09-24 14:24:38 +05:00
Steveplays28 d130a602d6 Merge remote-tracking branch 'origin/main' 2023-09-23 16:34:08 +02:00
Steveplays28 8d1ff02937 feat: Add config option for server port 2023-09-23 16:33:42 +02:00
s809 15b1603e35 Fix compiling
Remove unused config category
Use pooling when receiving sections
Fix use of real time update config
Fix debug renderer not unregistered on queue close
2023-09-23 15:32:37 +05:00
s809 4ad0a22db7 Update core 2023-09-21 21:05:31 +05:00
s809 35bc1df32c Add config for a few slow features 2023-09-21 21:00:35 +05:00
s809 bb2a1158c2 Move context levels to requests 2023-09-21 10:16:42 +05:00
s809 76f6f6f746 Allow selecting specific IDebugRenderable's for rendering 2023-09-19 21:33:05 +05:00
s809 3b771b5300 Validate response types 2023-09-19 20:19:31 +05:00
s809 9497918e06 Fix chunk updates sent to incomplete connections
Hide useless warns, for cases when listener is not configured yet
2023-09-19 18:58:16 +05:00
s809 e52c5d5c67 Fix chunk updates sent to incomplete connections
Hide useless warns, for cases when listener is not configured yet
2023-09-19 18:57:55 +05:00
s809 1ce4750dfc Fix future id collisions between c<->s
(cause of occasional hangs on disconnection)
Add packet trace logging
2023-09-19 17:28:49 +05:00
s809 2b371340ff Fix compiling 2023-09-18 13:44:25 +05:00
s809 e8d906b407 Update core 2023-09-18 13:25:06 +05:00
s809 572973c69a Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-09-18 13:24:48 +05:00
Steveplays28 9f2d6b9c78 Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	coreSubProjects
2023-09-12 17:35:49 +02:00
s809 54277040e9 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-09-10 12:03:44 +05:00
Steveplays28 bbe333fab7 fix: Fix missing IServerKeyedClientLevel import 2023-09-09 21:03:40 +02:00
Steveplays28 37fed5a924 Merge branch 'main-upstream'
# Conflicts:
#	coreSubProjects
#	forge/src/main/java/com/seibel/distanthorizons/forge/ForgeClientProxy.java
2023-09-09 20:54:59 +02:00
Steveplays28 5fc29334cd Merge branch 'main-upstream'
# Conflicts:
#	coreSubProjects
2023-09-09 14:47:18 +02:00
Steveplays28 9d32e92e0a Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	coreSubProjects
2023-09-08 19:55:04 +02:00
s809 b08ee76a00 Fix compiling 2023-09-07 21:07:20 +05:00
s809 2a4cc6e63d Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-09-07 20:07:42 +05:00
s809 6b2560f98b Add post-rejoin updates 2023-09-02 01:30:54 +05:00
s809 08111d8874 Fix compilation 2023-08-27 19:56:32 +05:00
s809 80f48cd5a4 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-08-27 19:43:13 +05:00
s809 40cd6c1386 Fix loading ClientLevel on server 2023-08-27 18:42:07 +05:00
s809 e9a13dffb8 Update core 2023-08-26 21:34:46 +05:00
s809 22680baad7 Merge branch 'feat/server-updates' 2023-08-24 01:01:48 +05:00
s809 cca480e5d8 Merge branch 'main' of https://gitlab.com/s809/minecraft-lod-mod 2023-08-24 00:03:55 +05:00
s809 249c3423d9 Update core 2023-08-24 00:02:53 +05:00
s809 15cb6468d9 Update core 2023-08-23 23:55:48 +05:00
s809 f24019d648 Update core 2023-08-22 20:42:06 +05:00
s809 733d03c630 test 2023-08-22 20:41:42 +05:00
s809 c3e84648f1 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod into feat/server-updates 2023-08-22 19:12:56 +05:00
Steveplays28 76c33b6b58 fix: Add null check to config GUI when adding a screen change listener 2023-08-22 10:52:18 +02:00
s809 26a947ea13 Incomplete 2023-08-21 22:09:16 +05:00
Steveplays28 91334c0e5c feat: Update rendering block ignores
Barrier blocks, structure void blocks, light blocks, and air blocks now share 2 `HashMap`s that define blocks that should be ignored by the LOD builder.
2023-08-21 03:41:26 +02:00
s809 172b05aeac Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-08-19 23:45:16 +05:00
s809 b84e5ca265 Fix hang when near completion of loading from server
Replace total value with sum of pending+finished requests
2023-08-19 22:21:27 +05:00
s809 20ef5a10fc Fix hang when near completion of loading from server
Replace total value with sum of pending+finished requests
2023-08-19 22:21:01 +05:00
s809 33640fd35d Fix prioritization not working properly 2023-08-19 21:24:40 +05:00
s809 e5f7c5728f Fix prioritization not working properly 2023-08-19 21:22:51 +05:00
Steveplays28 5a9bbf9829 Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	coreSubProjects
2023-08-19 11:42:09 +02:00
Steveplays28 23ca022ee9 Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	coreSubProjects
#	fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricClientProxy.java
#	fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/client/MixinLevelRenderer.java
#	fabric/src/main/java/com/seibel/distanthorizons/fabric/mixins/mods/sodium/MixinSodiumRenderer.java
2023-08-18 15:11:59 +02:00
Steveplays28 6c80165523 chore: Remove username from Fabric build script 2023-08-18 15:08:48 +02:00
s809 d598061fa7 Add missing level wrapper argument (and a bunch of null checks) 2023-08-18 15:04:49 +02:00
Steveplays28 02498aa189 fix: Fix index out of bounds errors and LOD pillars
The `BiomeWrapper#equals` and `BlockStateWrapper#equals` methods didn't use the right `LevelWrapper` for serializing the object to compare to, this is now fixed.
2023-08-16 13:25:23 +02:00
Steveplays28 d535f6aa57 fix: Comment out leftover Immersive Portals compat
A bit I didn't notice while making the previous commit.
2023-08-16 11:42:02 +02:00
Steveplays28 933753a38a fix: Comment out Immersive Portals compat
The renderer compat was commented out in upstream, but the rest of the compat wasn't commented out, or lost in a merge.
2023-08-16 11:40:46 +02:00
Steveplays28 5483cdbc51 refactor: Update to Sodium 0.5.1
This reverts commits 815aed53 and 21144a7c.
2023-08-15 16:18:05 +02:00
Steveplays28 1ea62fd5ec Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BiomeWrapper.java
#	common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java
#	common/src/main/java/com/seibel/distanthorizons/common/wrappers/misc/ServerPlayerWrapper.java
#	common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ClientLevelWrapper.java
#	common/src/main/java/com/seibel/distanthorizons/common/wrappers/world/ServerLevelWrapper.java
#	coreSubProjects
#	fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricClientProxy.java
#	forge/src/main/java/com/seibel/distanthorizons/forge/ForgeClientProxy.java
2023-08-15 15:55:33 +02:00
Steveplays28 aaf0361c50 fix: Fix BlockStateWrapper and Biome serializing to empty strings 2023-08-15 00:03:12 +02:00
Steveplays28 a08feebde0 fix: Fix server trying to access client instance 2023-08-14 19:23:57 +02:00
Steveplays28 f7131fd2ca fix: Fix 1.20.1 compilation 2023-08-14 15:44:45 +02:00
Steveplays28 2100f4a6fe Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BiomeWrapper.java
#	coreSubProjects
2023-08-14 15:40:31 +02:00
Steveplays28 996f097b9d refactor: Re-add old serialization method
This is used by some override methods that don't have access to the level.
These old serialization methods have `FIXME`s so they're easy to find in the future.
2023-08-13 23:18:52 +02:00
Steveplays28 2e1d737268 Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BiomeWrapper.java
#	common/src/main/java/com/seibel/distanthorizons/common/wrappers/block/BlockStateWrapper.java
#	coreSubProjects
2023-08-13 22:34:07 +02:00
s809 d374870fb7 Generation task prioritization (loaded > unloaded > ungenerated) 2023-08-13 18:59:42 +05:00
s809 5c303df32c Update core 2023-08-13 01:53:45 +05:00
s809 dfc4b51e89 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-08-13 01:53:22 +05:00
s809 765202d582 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-08-08 20:58:21 +05:00
s809 0d2e5adbed Skip version if step failed in buildAll 2023-08-08 20:30:19 +05:00
s809 68e9d64779 Fix compiling (except 1.16.5 & 1.17.1) 2023-08-08 20:25:07 +05:00
s809 b64b44f301 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-08-08 12:48:37 +05:00
s809 8c07bb37f3 Update core 2023-08-05 22:30:50 +05:00
s809 c1f6c2dbbd Split fabric run folder into server and client 2023-08-05 22:30:02 +05:00
s809 2eb1c16837 Add Fabric run configurations 2023-08-05 22:29:09 +05:00
s809 e5fb8477d3 Update core 2023-08-04 22:12:28 +05:00
s809 428cacd262 Update core 2023-08-04 21:52:26 +05:00
s809 76926d38db Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-08-04 21:11:03 +05:00
s809 9fec679b03 Attempt to fix dimension switching 2023-08-01 17:04:40 +05:00
s809 853a1d1490 Update core 2023-08-01 12:55:53 +05:00
s809 01273e31bc Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-07-31 17:43:45 +05:00
s809 ebb4808bdc Avoid losing requests due to concurrency 2023-07-31 17:42:59 +05:00
s809 fd09adb1a7 World generation 2023-07-31 15:24:33 +05:00
s809 82b7b439a4 Update core 2023-07-24 19:16:21 +05:00
s809 f1b3ae120b something 2023-07-24 19:16:05 +05:00
s809 70ee20e817 Implement transferring of missing full data source types 2023-07-24 14:15:03 +05:00
s809 f713d65f9c Update core 2023-07-24 11:01:20 +05:00
s809 c2b98ef694 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-07-24 10:48:28 +05:00
s809 140c9f6a50 Update core 2023-07-24 10:48:14 +05:00
s809 c704d61d03 Update core 2023-07-24 01:46:31 +05:00
s809 aae484fbdf Update core 2023-07-23 23:48:58 +05:00
s809 a546a97e34 Got chunks to generate on server 2023-07-23 20:34:40 +05:00
s809 3ca9d98c05 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-07-23 11:09:07 +05:00
s809 460b73e35c Update core 2023-07-19 22:29:49 +05:00
Steveplays28 8901a191d9 feat: Implement syncing of DhSectionPos for chunk requests/responses 2023-07-19 16:49:31 +02:00
s809 1bbe35c9f1 Update core 2023-07-19 17:41:06 +05:00
s809 f92e957826 Update core 2023-07-19 15:54:45 +05:00
s809 636e6736a3 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-07-19 12:21:35 +05:00
s809 8e29f65815 Update core 2023-07-19 12:19:54 +05:00
s809 a9309078f3 Merge branch 'main' of https://gitlab.com/jeseibel/minecraft-lod-mod 2023-07-16 12:48:39 +05:00
s809 9692e978de Update core 2023-07-16 12:38:49 +05:00
s809 914372b858 Repoint back to fork 2023-07-15 23:12:30 +05:00
70 changed files with 631 additions and 488 deletions
+2 -2
View File
@@ -538,7 +538,7 @@ ij_groovy_wrap_chain_calls_after_dot = false
ij_groovy_wrap_long_lines = false
[{*.har,*.json,*.png.mcmeta,mcmod.info,pack.mcmeta}]
indent_size = 4
indent_size = 2
ij_json_array_wrapping = split_into_lines
ij_json_keep_blank_lines_in_code = 0
ij_json_keep_indents_on_empty_lines = false
@@ -688,7 +688,7 @@ ij_markdown_wrap_text_inside_blockquotes = true
ij_toml_keep_indents_on_empty_lines = false
[{*.yaml,*.yml}]
indent_size = 4
indent_size = 2
ij_yaml_align_values_properties = do_not_align
ij_yaml_autoinsert_sequence_marker = true
ij_yaml_block_mapping_on_new_line = false
+3 -3
View File
@@ -18,7 +18,7 @@ variables:
.build_java:
#image: eclipse-temurin:17
cache:
key: "gradleCache"
key: "gradleCache_$CI_JOB_NAME_SLUG"
policy: pull-push
paths:
- .gradle
@@ -68,7 +68,7 @@ build:
extends: .build_java
api:
.api:
stage: api
needs: []
script:
@@ -92,7 +92,7 @@ api:
# generate and publish API javadocs
pages:
.pages:
stage: pages
needs: []
script:
+1 -1
View File
@@ -1,3 +1,3 @@
[submodule "coreSubProjects"]
path = coreSubProjects
url = https://gitlab.com/jeseibel/distant-horizons-core.git
url = https://gitlab.com/jeseibel/distant-horizons-core.git
+17 -17
View File
@@ -27,8 +27,8 @@ def writeBuildGradlePredefine(List<String> mcVers, int mcIndex)
StringBuilder sb = new StringBuilder();
sb.append("# DON'T TOUCH THIS FILE, This is handled by the build script\n");
for (int i = 0; i < mcVers.size(); i++)
{
String verStr = mcVers[i].replace(".", "_");
@@ -104,7 +104,7 @@ subprojects { p ->
apply plugin: "com.github.johnrengelman.shadow"
if (isMinecraftSubProject)
apply plugin: "systems.manifold.manifold-gradle-plugin"
// Apply forge's loom
if ((findProject(":forge") && p == project(":forge")) ||
(findProject(":neoforge") && p == project(":neoforge"))
@@ -118,7 +118,7 @@ subprojects { p ->
manifold {
manifoldVersion = rootProject.manifold_version
}
// set up custom configurations (configurations are a way to handle dependencies)
configurations {
@@ -191,7 +191,7 @@ subprojects { p ->
forgeShadowMe("org.joml:joml:${rootProject.joml_version}")
else
implementation("org.joml:joml:${rootProject.joml_version}")
// JUnit tests
implementation("org.junit.jupiter:junit-jupiter:5.8.2")
implementation("org.junit.jupiter:junit-jupiter-engine:5.8.2")
@@ -201,22 +201,22 @@ subprojects { p ->
// Note: MC 1.16 uses 8.2.1, and versions after use 8.5.12
// We cannot relocate this library since we call some MC classes that reference it
implementation("it.unimi.dsi:fastutil:${rootProject.fastutil_version}")
// Compression
forgeShadowMe("org.lz4:lz4-java:${rootProject.lz4_version}") // LZ4
forgeShadowMe("org.tukaani:xz:${rootProject.xz_version}") // LZMA
// Sqlite Database
forgeShadowMe("org.xerial:sqlite-jdbc:${rootProject.sqlite_jdbc_version}")
// NightConfig (includes Toml & Json)
forgeShadowMe("com.electronwill.night-config:toml:${rootProject.nightconfig_version}")
forgeShadowMe("com.electronwill.night-config:json:${rootProject.nightconfig_version}")
// SVG (not needed atm)
// forgeShadowMe("com.formdev:svgSalamander:${rootProject.svgSalamander_version}")
// Netty
implementation("io.netty:netty-buffer:${rootProject.netty_version}")
@@ -276,7 +276,7 @@ subprojects { p ->
if (isMinecraftSubProject && p != project(":common")) {
configurations.push(project.configurations.shadowCommon) // Shadow the common subproject
relocate "com.seibel.distanthorizons.common", "loaderCommon.${p.name}.com.seibel.distanthorizons.common" // Move the loader files to a different location
if (findProject(":fabricLike") && p != project(":fabricLike")) {
configurations.push(project.configurations.shadowFabricLike) // Shadow the fabricLike subproject
relocate "com.seibel.distanthorizons.fabriclike", "loaderCommon.${p.name}.com.seibel.distanthorizons.fabriclike" // Move the loader files to a different location
@@ -290,11 +290,11 @@ subprojects { p ->
// Compression (LZ4)
relocate "net.jpountz", "${librariesLocation}.jpountz"
// Sqlite Database
//At the moment, there is a bug in this library which doesnt allow it to be relocated
// relocate "org.sqlite", "${librariesLocation}.sqlite"
// JOML
if (project.hasProperty("embed_joml") && embed_joml == "true")
relocate "org.joml", "${librariesLocation}.joml"
@@ -304,7 +304,7 @@ subprojects { p ->
// SVG (not needed atm)
// relocate "com.kitfox.svg", "${librariesLocation}.kitfox.svg"
// Netty
// Don't relocate, it causes problems with using MC's FriendlyByteBufs
// relocate "io.netty", "${librariesLocation}.netty"
@@ -329,7 +329,7 @@ subprojects { p ->
"META-INF/neoforge.mods.toml",
// The mixins for each of the loaders
"DistantHorizons."+ p.name +".fabricLike.mixins.json"
"DistantHorizons." + p.name + ".fabricLike.mixins.json"
]
def intoTargets = ["$buildDir/resources/main/"] // Location of the built resources folder
@@ -388,14 +388,14 @@ subprojects { p ->
fabric_incompatibility_list : fabric_incompatibility_list,
fabric_recommend_list : fabric_recommend_list,
]
// replace any properties in the sub-projects with the values defined here
inputs.properties replaceProperties
replaceProperties.put "project", project
filesMatching(resourceTargets) {
expand replaceProperties
}
intoTargets.each { target ->
if (file(target).exists()) {
copy {
@@ -639,4 +639,4 @@ task cleanMergedJars() {
}
}
// add cleanMergedJars to the end of the "clean" task
tasks["clean"].finalizedBy(cleanMergedJars)
tasks["clean"].finalizedBy(cleanMergedJars)
+3 -4
View File
@@ -5,7 +5,6 @@
echo ==================== Note: All build jars will be in the folder called 'buildAllJars' ====================
mkdir buildAllJars
del buildAllJars/*
@rem Loop trough everything in the version properties folder
for %%f in (versionProperties\*) do (
@@ -14,11 +13,11 @@ for %%f in (versionProperties\*) do (
@rem Clean out the folders, build it, and merge it
echo ==================== Cleaning workspace to build !version! ====================
call .\gradlew.bat clean -PmcVer="!version!"
call .\gradlew.bat clean -PmcVer="!version!" --no-daemon
echo ==================== Building !version! ====================
call .\gradlew.bat build -PmcVer="!version!"
call .\gradlew.bat build -PmcVer="!version!" --no-daemon
echo ==================== Merging !version! ====================
call .\gradlew.bat mergeJars -PmcVer="!version!"
call .\gradlew.bat mergeJars -PmcVer="!version!" --no-daemon
echo ==================== Moving jar ====================
move Merged\*.jar buildAllJars\
)
+8 -10
View File
@@ -1,11 +1,10 @@
// TODO can this be removed?
//buildscript {
// configurations.configureEach {
// resolutionStrategy {
// force 'org.spongepowered:vanillagradle:0.2.1-20240507.024226-82'
// }
// }
//}
buildscript {
configurations.configureEach {
resolutionStrategy {
force 'org.spongepowered:vanillagradle:0.2.1-20240507.024226-82'
}
}
}
// temporary fix for broken spongepowered version
buildscript {
@@ -43,5 +42,4 @@ publishing {
repositories {
// Add repositories to publish to here.
}
}
}
@@ -8,7 +8,7 @@ import com.mojang.brigadier.context.CommandContext;
import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiAfterDhInitEvent;
import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiBeforeDhInitEvent;
import com.seibel.distanthorizons.common.wrappers.DependencySetup;
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftServerWrapper;
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftDedicatedServerWrapper;
import com.seibel.distanthorizons.common.wrappers.misc.ServerPlayerWrapper;
import com.seibel.distanthorizons.core.api.internal.SharedApi;
import com.seibel.distanthorizons.core.config.Config;
@@ -20,9 +20,11 @@ import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
import com.seibel.distanthorizons.core.jar.ModJarInfo;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.network.messages.MessageRegistry;
import com.seibel.distanthorizons.core.network.messages.base.CodecCrashMessage;
import com.seibel.distanthorizons.core.util.objects.Pair;
import com.seibel.distanthorizons.core.world.DhServerWorld;
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IPluginPacketSender;
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IModAccessor;
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IModChecker;
import com.seibel.distanthorizons.coreapi.DependencyInjection.ApiEventInjector;
@@ -42,7 +44,7 @@ import java.util.function.Supplier;
import static com.mojang.brigadier.arguments.DoubleArgumentType.doubleArg;
import static com.mojang.brigadier.arguments.IntegerArgumentType.integer;
import static com.seibel.distanthorizons.core.network.messages.MessageRegistry.DEBUG_CODEC_CRASH_MESSAGE;
import static com.seibel.distanthorizons.core.network.messages.MessageRegistry.DEBUG_ENABLE_CODEC_CRASH_MESSAGE;
import static net.minecraft.commands.Commands.argument;
import static net.minecraft.commands.Commands.literal;
@@ -93,7 +95,7 @@ public abstract class AbstractModInitializer
ApiEventInjector.INSTANCE.fireAllEvents(DhApiBeforeDhInitEvent.class, null);
this.startup();
this.logBuildInfo();
this.printModInfo();
this.createClientProxy().registerEvents();
this.createServerProxy(false).registerEvents();
@@ -117,7 +119,7 @@ public abstract class AbstractModInitializer
ApiEventInjector.INSTANCE.fireAllEvents(DhApiBeforeDhInitEvent.class, null);
this.startup();
this.logBuildInfo();
this.printModInfo();
// This prevents returning uninitialized Config values,
// resulting from a circular reference mid-initialization in a static class
@@ -135,7 +137,7 @@ public abstract class AbstractModInitializer
this.subscribeServerStartingEvent(server ->
{
MinecraftServerWrapper.INSTANCE.dedicatedServer = (DedicatedServer)server;
MinecraftDedicatedServerWrapper.INSTANCE.dedicatedServer = (DedicatedServer)server;
this.initConfig();
this.postInit();
@@ -158,17 +160,14 @@ public abstract class AbstractModInitializer
this.createInitialBindings();
}
private void logBuildInfo()
private void printModInfo()
{
LOGGER.info(ModInfo.READABLE_NAME + ", Version: " + ModInfo.VERSION);
// if the build is stable the branch/commit/etc shouldn't be needed
if (ModInfo.IS_DEV_BUILD)
{
LOGGER.info("DH Branch: " + ModJarInfo.Git_Branch);
LOGGER.info("DH Commit: " + ModJarInfo.Git_Commit);
LOGGER.info("DH Jar Build Source: " + ModJarInfo.Build_Source);
}
// Useful for dev builds
LOGGER.info("DH Branch: " + ModJarInfo.Git_Branch);
LOGGER.info("DH Commit: " + ModJarInfo.Git_Commit);
LOGGER.info("DH Jar Build Source: " + ModJarInfo.Build_Source);
}
protected <T extends IModAccessor> void tryCreateModCompatAccessor(String modId, Class<? super T> accessorClass, Supplier<T> accessorConstructor)
@@ -216,10 +215,10 @@ public abstract class AbstractModInitializer
Function<
Function<CommandContext<CommandSourceStack>, Object>,
Command<CommandSourceStack>
> makeConfigUpdater = (getter) -> (commandContext) -> {
Object value = getter.apply(commandContext);
> makeConfigUpdater = getter -> c -> {
Object value = getter.apply(c);
commandContext.getSource().sendSuccess(
c.getSource().sendSuccess(
#if MC_VER >= MC_1_20_1
() -> Component.literal("Changed the value of "+configEntry.getServersideShortName()+" to "+value),
#elif MC_VER >= MC_1_19_2
@@ -233,13 +232,13 @@ public abstract class AbstractModInitializer
};
LiteralArgumentBuilder<CommandSourceStack> subcommand = literal(configEntry.getServersideShortName())
.executes((commandContext) -> {
.executes(c -> {
#if MC_VER >= MC_1_20_1
commandContext.getSource().sendSuccess(() -> Component.literal("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
c.getSource().sendSuccess(() -> Component.literal("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
#elif MC_VER >= MC_1_19_2
commandContext.getSource().sendSuccess(Component.literal("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
c.getSource().sendSuccess(Component.literal("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
#else // < 1.19.2
commandContext.getSource().sendSuccess(new TranslatableComponent("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
c.getSource().sendSuccess(new TranslatableComponent("Current value of "+configEntry.getServersideShortName()+" is "+configEntry.get()), true);
#endif
return 1;
});
@@ -293,7 +292,7 @@ public abstract class AbstractModInitializer
this.commandDispatcher.register(builder);
if (DEBUG_CODEC_CRASH_MESSAGE)
if (DEBUG_ENABLE_CODEC_CRASH_MESSAGE)
{
LiteralArgumentBuilder<CommandSourceStack> dhcrash = literal("dhcrash")
.requires(source -> source.hasPermission(4))
@@ -306,7 +305,7 @@ public abstract class AbstractModInitializer
#else
.getConnectedPlayer(ServerPlayerWrapper.getWrapper(Objects.requireNonNull(c.getSource().getPlayerOrException())))
#endif
.networkSession.sendMessage(new CodecCrashMessage(CodecCrashMessage.ECrashPhase.ENCODE));
.session.sendMessage(new CodecCrashMessage(CodecCrashMessage.ECrashPhase.ENCODE));
return 1;
}))
.then(literal("decode")
@@ -318,7 +317,7 @@ public abstract class AbstractModInitializer
#else
.getConnectedPlayer(ServerPlayerWrapper.getWrapper(Objects.requireNonNull(c.getSource().getPlayerOrException())))
#endif
.networkSession.sendMessage(new CodecCrashMessage(CodecCrashMessage.ECrashPhase.DECODE));
.session.sendMessage(new CodecCrashMessage(CodecCrashMessage.ECrashPhase.DECODE));
return 1;
}));
this.commandDispatcher.register(dhcrash);
@@ -336,4 +335,4 @@ public abstract class AbstractModInitializer
void registerEvents();
}
}
}
@@ -2,10 +2,10 @@ package com.seibel.distanthorizons.common;
import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.logging.ConfigBasedLogger;
import com.seibel.distanthorizons.core.network.event.internal.IncompatibleMessageInternalEvent;
import com.seibel.distanthorizons.core.network.event.internal.ProtocolErrorInternalEvent;
import com.seibel.distanthorizons.core.network.event.internal.IncompatibleMessageEvent;
import com.seibel.distanthorizons.core.network.event.internal.ProtocolErrorEvent;
import com.seibel.distanthorizons.core.network.messages.MessageRegistry;
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
import com.seibel.distanthorizons.core.network.messages.base.CloseReasonMessage;
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IPluginPacketSender;
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IServerPlayerWrapper;
@@ -33,18 +33,19 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender
@Override
public final void sendToClient(IServerPlayerWrapper serverPlayer, AbstractNetworkMessage message)
public final void sendPluginPacketServer(IServerPlayerWrapper serverPlayer, NetworkMessage message)
{
this.sendToClient((ServerPlayer) serverPlayer.getWrappedMcObject(), message);
this.sendPluginPacketServer((ServerPlayer) serverPlayer.getWrappedMcObject(), message);
}
public abstract void sendToClient(ServerPlayer serverPlayer, AbstractNetworkMessage message);
@Override
public abstract void sendToServer(AbstractNetworkMessage message);
public abstract void sendPluginPacketClient(NetworkMessage message);
public abstract void sendPluginPacketServer(ServerPlayer serverPlayer, NetworkMessage message);
public static AbstractNetworkMessage decodeMessage(FriendlyByteBuf in)
@Nullable
public static NetworkMessage decodeMessage(FriendlyByteBuf in)
{
AbstractNetworkMessage message = null;
NetworkMessage message = null;
try
{
@@ -53,7 +54,7 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender
int protocolVersion = in.readShort();
if (protocolVersion != ModInfo.PROTOCOL_VERSION)
{
return new IncompatibleMessageInternalEvent(protocolVersion);
return new IncompatibleMessageEvent(protocolVersion);
}
message = MessageRegistry.INSTANCE.createMessage(in.readUnsignedShort());
@@ -71,10 +72,10 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender
in.resetReaderIndex();
LOGGER.error("Failed to decode message", e);
LOGGER.error("Buffer: ["+in+"]");
LOGGER.error("Buffer contents: ["+ByteBufUtil.hexDump(in)+"]");
LOGGER.error("Buffer: {}", in);
LOGGER.error("Buffer contents: [{}]", ByteBufUtil.hexDump(in));
return new ProtocolErrorInternalEvent(e, message, true);
return new ProtocolErrorEvent(e, message, true);
}
finally
{
@@ -83,7 +84,7 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender
}
}
public static void encodeMessage(FriendlyByteBuf out, AbstractNetworkMessage message)
public static void encodeMessage(FriendlyByteBuf out, NetworkMessage message)
{
// This is intentionally unhandled, because errors related to this are unlikely to appear in wild
Objects.requireNonNull(message);
@@ -98,9 +99,9 @@ public abstract class AbstractPluginPacketSender implements IPluginPacketSender
catch (Exception e)
{
LOGGER.error("Failed to encode message", e);
LOGGER.error("Message: ["+message+"]");
LOGGER.error("Message: {}", message);
message.getSession().tryHandleMessage(new ProtocolErrorInternalEvent(e, message, false));
message.getSession().tryHandleMessage(new ProtocolErrorEvent(e, message, false));
// Encode close reason message instead
out.resetWriterIndex();
@@ -2,20 +2,25 @@ package com.seibel.distanthorizons.common;
#if MC_VER >= MC_1_20_6
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public record CommonPacketPayload(@Nullable AbstractNetworkMessage message) implements CustomPacketPayload
public record CommonPacketPayload(
@Nullable NetworkMessage message
) implements CustomPacketPayload
{
public static final Type<CommonPacketPayload> TYPE = new Type<>(AbstractPluginPacketSender.WRAPPER_PACKET_RESOURCE);
@NotNull
@Override
public Type<? extends CustomPacketPayload> type() { return TYPE; }
public Type<? extends CustomPacketPayload> type()
{
return TYPE;
}
public static class Codec implements StreamCodec<FriendlyByteBuf, CommonPacketPayload>
@@ -23,11 +28,15 @@ public record CommonPacketPayload(@Nullable AbstractNetworkMessage message) impl
@NotNull
@Override
public CommonPacketPayload decode(@NotNull FriendlyByteBuf in)
{ return new CommonPacketPayload(AbstractPluginPacketSender.decodeMessage(in)); }
{
return new CommonPacketPayload(AbstractPluginPacketSender.decodeMessage(in));
}
@Override
public void encode(@NotNull FriendlyByteBuf out, CommonPacketPayload payload)
{ AbstractPluginPacketSender.encodeMessage(out, payload.message()); }
{
AbstractPluginPacketSender.encodeMessage(out, payload.message());
}
}
@@ -22,7 +22,7 @@ package com.seibel.distanthorizons.common.wrappers;
import com.seibel.distanthorizons.common.wrappers.gui.ClassicConfigGUI;
import com.seibel.distanthorizons.common.wrappers.gui.LangWrapper;
import com.seibel.distanthorizons.common.wrappers.level.KeyedClientLevelManager;
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftServerWrapper;
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftDedicatedServerWrapper;
import com.seibel.distanthorizons.core.level.IKeyedClientLevelManager;
import com.seibel.distanthorizons.core.wrapperInterfaces.config.IConfigGui;
import com.seibel.distanthorizons.core.wrapperInterfaces.config.ILangWrapper;
@@ -60,7 +60,7 @@ public class DependencySetup
//@Environment(EnvType.SERVER)
public static void createServerBindings()
{
SingletonInjector.INSTANCE.bind(IMinecraftSharedWrapper.class, MinecraftServerWrapper.INSTANCE);
SingletonInjector.INSTANCE.bind(IMinecraftSharedWrapper.class, MinecraftDedicatedServerWrapper.INSTANCE);
}
//@Environment(EnvType.CLIENT)
@@ -133,26 +133,6 @@ public class BlockStateWrapper implements IBlockStateWrapper
}
}
/**
* Can be faster than {@link BlockStateWrapper#fromBlockState(BlockState, ILevelWrapper)}
* in cases where the same block state is expected to be referenced multiple times.
*/
public static BlockStateWrapper fromBlockState(BlockState blockState, ILevelWrapper levelWrapper, IBlockStateWrapper guess)
{
BlockState guessBlockState = (guess == null || guess.isAir()) ? null : (BlockState) guess.getWrappedMcObject();
BlockState inputBlockState = (blockState == null || blockState.isAir()) ? null : blockState;
if (guess instanceof BlockStateWrapper guessWrapper
&& guessBlockState == inputBlockState)
{
return guessWrapper;
}
else
{
return fromBlockState(blockState, levelWrapper);
}
}
private BlockStateWrapper(BlockState blockState, ILevelWrapper levelWrapper)
{
this.blockState = blockState;
@@ -561,8 +541,7 @@ public class BlockStateWrapper implements IBlockStateWrapper
{
#if MC_VER > MC_1_17_1
LodUtil.assertTrue(levelWrapper != null && levelWrapper.getWrappedMcObject() != null);
Level level = (Level)levelWrapper.getWrappedMcObject();
Level level = (Level)Objects.requireNonNull(levelWrapper.getWrappedMcObject());
#endif
Block block;
@@ -777,4 +756,4 @@ public class BlockStateWrapper implements IBlockStateWrapper
}
}
}
}
@@ -21,7 +21,6 @@ package com.seibel.distanthorizons.common.wrappers.chunk;
import com.seibel.distanthorizons.common.wrappers.block.BiomeWrapper;
import com.seibel.distanthorizons.common.wrappers.block.BlockStateWrapper;
import com.seibel.distanthorizons.common.wrappers.misc.MutableBlockPosWrapper;
import com.seibel.distanthorizons.common.wrappers.worldGeneration.mimicObject.DhLitWorldGenRegion;
import com.seibel.distanthorizons.core.api.internal.SharedApi;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
@@ -32,7 +31,6 @@ import com.seibel.distanthorizons.core.world.EWorldEnvironment;
import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.ChunkLightStorage;
import com.seibel.distanthorizons.core.wrapperInterfaces.chunk.IChunkWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IMutableBlockPosWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper;
import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper;
@@ -89,7 +87,6 @@ public class ChunkWrapper implements IChunkWrapper
/** can be used for interactions with the underlying chunk where creating new BlockPos objects could cause issues for the garbage collector. */
private static final ThreadLocal<BlockPos.MutableBlockPos> MUTABLE_BLOCK_POS_REF = ThreadLocal.withInitial(() -> new BlockPos.MutableBlockPos());
private static final ThreadLocal<MutableBlockPosWrapper> MUTABLE_BLOCK_POS_WRAPPER_REF = ThreadLocal.withInitial(() -> new MutableBlockPosWrapper());
private final ChunkAccess chunk;
@@ -97,8 +94,7 @@ public class ChunkWrapper implements IChunkWrapper
private final LevelReader lightSource;
private final ILevelWrapper wrappedLevel;
private boolean isDhBlockLightCorrect = false;
private boolean isDhSkyLightCorrect = false;
private boolean isDhLightCorrect = false;
/** only used when connected to a dedicated server */
private boolean isMcClientLightingCorrect = false;
@@ -107,9 +103,26 @@ public class ChunkWrapper implements IChunkWrapper
private ArrayList<DhBlockPos> blockLightPosList = null;
private boolean useDhLighting;
private int minNonEmptyHeight = Integer.MIN_VALUE;
private int maxNonEmptyHeight = Integer.MAX_VALUE;
private int blockBiomeHashCode = 0;
/**
* Due to vanilla `isClientLightReady()` not being designed for use by a non-render thread, it may return 'true'
* before the light engine has ticked, (right after all light changes is marked by the engine to be processed).
* To fix this, on client-only mode, we mixin-redirect the `isClientLightReady()` so that after the call, it will
* trigger a synchronous update of this flag here on all chunks that are wrapped. <br><br>
*
* Note: Using a static weak hash map to store the chunks that need to be updated, as instance of chunk wrapper
* can be duplicated, with same chunk instance. And the data stored here are all temporary, and thus will not be
* visible when a chunk is re-wrapped later. <br>
* (Also, thread safety done via a reader writer lock)
*/
private static final ConcurrentLinkedQueue<ChunkWrapper> chunksNeedingClientLightUpdating = new ConcurrentLinkedQueue<>();
//=============//
@@ -123,6 +136,15 @@ public class ChunkWrapper implements IChunkWrapper
this.wrappedLevel = wrappedLevel;
this.chunkPos = new DhChunkPos(chunk.getPos().x, chunk.getPos().z);
// TODO is this the best way to differentiate between when we are generating chunks and when MC gave us a chunk?
boolean isDhGeneratedChunk = (this.lightSource.getClass() == DhLitWorldGenRegion.class);
// MC loaded chunks should get their lighting from MC, DH generated chunks should get their lighting from DH
this.useDhLighting = isDhGeneratedChunk;
// FIXME +1 is to handle the fact that LodDataBuilder adds +1 to all block lighting calculations, also done in the relative position validator
if (SharedApi.getEnvironment() != EWorldEnvironment.Server_Only)
chunksNeedingClientLightUpdating.add(this);
}
@@ -279,22 +301,6 @@ public class ChunkWrapper implements IChunkWrapper
return BlockStateWrapper.fromBlockState(this.chunk.getBlockState(blockPos), this.wrappedLevel);
}
@Override
public IBlockStateWrapper getBlockState(int relX, int relY, int relZ, IMutableBlockPosWrapper mcBlockPos, IBlockStateWrapper guess)
{
this.throwIndexOutOfBoundsIfRelativePosOutsideChunkBounds(relX, relY, relZ);
BlockPos.MutableBlockPos pos = (BlockPos.MutableBlockPos)mcBlockPos.getWrappedMcObject();
pos.setX(relX);
pos.setY(relY);
pos.setZ(relZ);
return BlockStateWrapper.fromBlockState(this.chunk.getBlockState(pos), this.wrappedLevel, guess);
}
@Override
public IMutableBlockPosWrapper getMutableBlockPosWrapper() { return MUTABLE_BLOCK_POS_WRAPPER_REF.get(); }
@Override
public DhChunkPos getChunkPos() { return this.chunkPos; }
@@ -325,15 +331,45 @@ public class ChunkWrapper implements IChunkWrapper
// lighting //
//==========//
@Override
public void setIsDhSkyLightCorrect(boolean isDhLightCorrect) { this.isDhSkyLightCorrect = isDhLightCorrect; }
@Override
public void setIsDhBlockLightCorrect(boolean isDhLightCorrect) { this.isDhBlockLightCorrect = isDhLightCorrect; }
@Override
public void setIsDhLightCorrect(boolean isDhLightCorrect) { this.isDhLightCorrect = isDhLightCorrect; }
@Override
public boolean isDhBlockLightingCorrect() { return this.isDhBlockLightCorrect; }
public void setUseDhLighting(boolean useDhLighting) { this.useDhLighting = useDhLighting; }
@Override
public boolean isDhSkyLightCorrect() { return this.isDhSkyLightCorrect; }
public boolean isLightCorrect()
{
if (this.useDhLighting)
{
return this.isDhLightCorrect;
}
#if MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1
return false; // MC's lighting engine doesn't work consistently enough to trust for 1.16 or 1.17
#else
if (this.chunk instanceof LevelChunk)
{
LevelChunk levelChunk = (LevelChunk) this.chunk;
if (levelChunk.getLevel().isClientSide())
{
// connected to a server
return this.isMcClientLightingCorrect;
}
else
{
// in a single player world
return this.chunk.isLightCorrect() && levelChunk.loaded;
}
}
else
{
// called when in a single player world and the chunk is a proto chunk (in world gen, and not active)
return this.chunk.isLightCorrect();
}
#endif
}
@Override
@@ -388,6 +424,44 @@ public class ChunkWrapper implements IChunkWrapper
public void setSkyLightStorage(ChunkLightStorage lightStorage) { this.skyLightStorage = lightStorage; }
@Override
public int getBlockLight(int relX, int y, int relZ)
{
this.throwIndexOutOfBoundsIfRelativePosOutsideChunkBounds(relX, y, relZ);
// use the full lighting engine when the chunks are within render distance or the config requests it
if (this.useDhLighting)
{
// DH lighting method
return this.getBlockLightStorage().get(relX, y, relZ);
}
else
{
// note: this returns 0 if the chunk is unload
// MC lighting method
return this.lightSource.getBrightness(LightLayer.BLOCK, new BlockPos(relX + this.getMinBlockX(), y, relZ + this.getMinBlockZ()));
}
}
@Override
public int getSkyLight(int relX, int y, int relZ)
{
this.throwIndexOutOfBoundsIfRelativePosOutsideChunkBounds(relX, y, relZ);
// use the full lighting engine when the chunks are within render distance or the config requests it
if (this.useDhLighting)
{
// DH lighting method
return this.getSkyLightStorage().get(relX, y, relZ);
}
else
{
// MC lighting method
return this.lightSource.getBrightness(LightLayer.SKY, new BlockPos(relX + this.getMinBlockX(), y, relZ + this.getMinBlockZ()));
}
}
/**
* FIXME synchronized is necessary for a rare issue where this method is called from two separate threads at the same time
* before the list has finished populating.
@@ -423,6 +497,63 @@ public class ChunkWrapper implements IChunkWrapper
return this.blockLightPosList;
}
public static void syncedUpdateClientLightStatus()
{
#if MC_VER < MC_1_18_2
// TODO: Check what to do in 1.18.1 and older
// since we don't currently handle this list,
// clear it to prevent memory leaks
chunksNeedingClientLightUpdating.clear();
#else
// update the chunks client lighting
ChunkWrapper chunkWrapper = chunksNeedingClientLightUpdating.poll();
while (chunkWrapper != null)
{
chunkWrapper.updateIsClientLightingCorrect();
chunkWrapper = chunksNeedingClientLightUpdating.poll();
}
#endif
}
/** Should be called after client light updates are triggered. */
private void updateIsClientLightingCorrect()
{
if (this.chunk instanceof LevelChunk && ((LevelChunk) this.chunk).getLevel() instanceof ClientLevel)
{
LevelChunk levelChunk = (LevelChunk) this.chunk;
ClientChunkCache clientChunkCache = ((ClientLevel) levelChunk.getLevel()).getChunkSource();
this.isMcClientLightingCorrect = clientChunkCache.getChunkForLighting(this.chunk.getPos().x, this.chunk.getPos().z) != null &&
#if MC_VER <= MC_1_17_1
levelChunk.isLightCorrect();
#elif MC_VER < MC_1_20_1
levelChunk.isClientLightReady();
#else
checkLightSectionsOnChunk(levelChunk, levelChunk.getLevel().getLightEngine());
#endif
}
}
#if MC_VER >= MC_1_20_1
private static boolean checkLightSectionsOnChunk(LevelChunk chunk, LevelLightEngine engine)
{
LevelChunkSection[] sections = chunk.getSections();
int minY = chunk.getMinSection();
int maxY = chunk.getMaxSection();
for (int y = minY; y < maxY; ++y)
{
LevelChunkSection section = sections[chunk.getSectionIndexFromSectionY(y)];
if (section.hasOnlyAir()) continue;
if (!engine.lightOnInSection(SectionPos.of(chunk.getPos(), y)))
{
return false;
}
}
return true;
}
#endif
//===============//
@@ -478,4 +609,4 @@ public class ChunkWrapper implements IChunkWrapper
// return this.blockBiomeHashCode;
//}
}
}
@@ -13,6 +13,7 @@ public class KeyedClientLevelManager implements IKeyedClientLevelManager
/** This is set and managed by the ClientApi for servers with support for DH. */
@Nullable
private IServerKeyedClientLevel serverKeyedLevel = null;
private boolean enabled = false;
@@ -28,21 +29,39 @@ public class KeyedClientLevelManager implements IKeyedClientLevelManager
// level override logic //
//======================//
@Override
@Nullable
public IServerKeyedClientLevel getServerKeyedLevel() { return this.serverKeyedLevel; }
public IServerKeyedClientLevel getServerKeyedLevel()
{
return this.serverKeyedLevel;
}
@Override
public IServerKeyedClientLevel setServerKeyedLevel(IClientLevelWrapper clientLevel, String levelKey)
{
IServerKeyedClientLevel keyedLevel = new ServerKeyedClientLevel((ClientLevel) clientLevel.getWrappedMcObject(), levelKey);
this.serverKeyedLevel = keyedLevel;
this.enabled = true;
return keyedLevel;
}
@Override
public void clearKeyedLevel() { this.serverKeyedLevel = null; }
public void clearServerKeyedLevel()
{
this.serverKeyedLevel = null;
}
@Override
public boolean hasLevelSet() { return this.serverKeyedLevel != null; }
public boolean isEnabled()
{
return this.enabled;
}
@Override
public void disable()
{
this.enabled = false;
}
}
@@ -18,7 +18,11 @@ public class ServerKeyedClientLevel extends ClientLevelWrapper implements IServe
@Override
public String getServerLevelKey() { return this.serverLevelKey; }
@Override
public String getDimensionName() { return this.getServerLevelKey(); }
public String getDimensionName()
{
return this.getServerLevelKey();
}
}
}
@@ -54,6 +54,7 @@ import net.minecraft.network.chat.TextComponent;
#endif
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.ChunkPos;
import org.apache.commons.lang3.NotImplementedException;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.Nullable;
@@ -221,11 +222,14 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
@Nullable
@Override
public IClientLevelWrapper getWrappedClientLevel() { return this.getWrappedClientLevel(false); }
public IClientLevelWrapper getWrappedClientLevel()
{
return this.getWrappedClientLevel(false);
}
@Override
@Nullable
public IClientLevelWrapper getWrappedClientLevel(boolean bypassLevelKeyManager)
public IClientLevelWrapper getWrappedClientLevel(boolean bypassMultiverse)
{
ClientLevel level = MINECRAFT.level;
if (level == null)
@@ -233,7 +237,7 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
return null;
}
return ClientLevelWrapper.getWrapper(level, bypassLevelKeyManager);
return ClientLevelWrapper.getWrapper(level, bypassMultiverse);
}
@Override
@@ -316,6 +320,9 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper, IMinecra
public void executeOnRenderThread(Runnable runnable) { MINECRAFT.execute(runnable); }
@Override
public boolean isWorldNew() { throw new UnsupportedOperationException("Not Implemented"); }
public boolean isWorldInitialized()
{
throw new NotImplementedException("TODO");
}
}
@@ -6,34 +6,19 @@ import net.minecraft.server.dedicated.DedicatedServer;
import java.io.File;
//@Environment(EnvType.SERVER)
public class MinecraftServerWrapper implements IMinecraftSharedWrapper
public class MinecraftDedicatedServerWrapper implements IMinecraftSharedWrapper
{
public static final MinecraftServerWrapper INSTANCE = new MinecraftServerWrapper();
public static final MinecraftDedicatedServerWrapper INSTANCE = new MinecraftDedicatedServerWrapper();
private MinecraftDedicatedServerWrapper() { }
public DedicatedServer dedicatedServer = null;
//=============//
// constructor //
//=============//
private MinecraftServerWrapper() { }
//=========//
// methods //
//=========//
@Override
public boolean isDedicatedServer() { return true; }
@Override
public File getInstallationDirectory()
{
if (this.dedicatedServer == null)
{
throw new IllegalStateException("Trying to get Installation Direction before Dedicated server completed initialization!");
throw new IllegalStateException("Trying to get Installation Direction before Dedicated server complete initialization!");
}
#if MC_VER < MC_1_21_1
@@ -44,7 +29,9 @@ public class MinecraftServerWrapper implements IMinecraftSharedWrapper
}
@Override
public boolean isWorldNew()
{ return this.dedicatedServer.getWorldData().overworldData().isInitialized(); }
public boolean isWorldInitialized()
{
return this.dedicatedServer.getWorldData().overworldData().isInitialized();
}
}
}
@@ -8,8 +8,4 @@ public interface IMixinServerPlayer
@Nullable
ServerLevel distantHorizons$getDimensionChangeDestination();
#if MC_VER == MC_1_16_5
void distantHorizons$setDimensionChangeDestination(ServerLevel dimensionChangeDestination);
#endif
}
@@ -1,30 +0,0 @@
package com.seibel.distanthorizons.common.wrappers.misc;
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IMutableBlockPosWrapper;
import net.minecraft.core.BlockPos;
public class MutableBlockPosWrapper implements IMutableBlockPosWrapper
{
public final BlockPos.MutableBlockPos pos;
//=============//
// constructor //
//=============//
public MutableBlockPosWrapper()
{
this.pos = new BlockPos.MutableBlockPos();
}
//===========//
// overrides //
//===========//
@Override
public Object getWrappedMcObject() { return this.pos; }
}
@@ -15,7 +15,7 @@ import java.net.SocketAddress;
import java.util.concurrent.ConcurrentMap;
/**
* This wrapper transparently ensures that the underlying {@link ServerPlayer} is always valid,
* This wrapper transparently ensures that underlying {@link ServerPlayer} is always valid,
* unless the player has disconnected.
*/
public class ServerPlayerWrapper implements IServerPlayerWrapper
@@ -23,39 +23,38 @@ public class ServerPlayerWrapper implements IServerPlayerWrapper
private static final ConcurrentMap<ServerGamePacketListenerImpl, ServerPlayerWrapper> serverPlayerWrapperMap = new MapMaker().weakKeys().weakValues().makeMap();
private final ServerGamePacketListenerImpl connection;
private ServerPlayer serverPlayer()
{
return this.connection.player;
}
public static ServerPlayerWrapper getWrapper(ServerPlayer serverPlayer)
{
return serverPlayerWrapperMap.computeIfAbsent(serverPlayer.connection, ignored -> new ServerPlayerWrapper(serverPlayer.connection));
}
private ServerPlayerWrapper(ServerGamePacketListenerImpl connection)
{
this.connection = connection;
}
//=============//
// constructor //
//=============//
public static ServerPlayerWrapper getWrapper(ServerPlayer serverPlayer)
{ return serverPlayerWrapperMap.computeIfAbsent(serverPlayer.connection, ignored -> new ServerPlayerWrapper(serverPlayer.connection)); }
private ServerPlayerWrapper(ServerGamePacketListenerImpl connection) { this.connection = connection; }
//=========//
// getters //
//=========//
private ServerPlayer getServerPlayer() { return this.connection.player; }
@Override
public String getName() { return this.getServerPlayer().getName().getString(); }
public String getName()
{
return this.serverPlayer().getName().getString();
}
@Override
public IServerLevelWrapper getLevel()
{
ServerLevel level = ((IMixinServerPlayer) this.getServerPlayer()).distantHorizons$getDimensionChangeDestination();
ServerLevel level = ((IMixinServerPlayer) this.serverPlayer()).distantHorizons$getDimensionChangeDestination();
if (level == null)
{
#if MC_VER < MC_1_20_1
level = this.getServerPlayer().getLevel();
level = this.serverPlayer().getLevel();
#else
level = this.getServerPlayer().serverLevel();
level = this.serverPlayer().serverLevel();
#endif
}
@@ -65,51 +64,57 @@ public class ServerPlayerWrapper implements IServerPlayerWrapper
@Override
public Vec3d getPosition()
{
Vec3 position = this.getServerPlayer().position();
Vec3 position = this.serverPlayer().position();
return new Vec3d(position.x, position.y, position.z);
}
@Override
public int getViewDistance() { return this.getServerPlayer().server.getPlayerList().getViewDistance(); }
public int getViewDistance()
{
return this.serverPlayer().server.getPlayerList().getViewDistance();
}
@Override
public SocketAddress getRemoteAddress()
{
#if MC_VER >= MC_1_19_4
return this.getServerPlayer().connection.getRemoteAddress();
return this.serverPlayer().connection.getRemoteAddress();
#else // < 1.19.4
return this.getServerPlayer().connection.connection.getRemoteAddress();
return this.serverPlayer().connection.connection.getRemoteAddress();
#endif
}
//================//
// base overrides //
//================//
@Override
public Object getWrappedMcObject() { return this.getServerPlayer(); }
@Override
public String toString() { return "Wrapped{" + this.getServerPlayer() + "}"; }
@Override
public boolean equals(Object obj)
public Object getWrappedMcObject()
{
if (this == obj)
return this.serverPlayer();
}
@Override
public String toString()
{
return "Wrapped{" + this.serverPlayer() + "}";
}
@Override
public boolean equals(Object o)
{
if (this == o)
{
return true;
}
if (!(obj instanceof ServerPlayerWrapper))
if (!(o instanceof ServerPlayerWrapper))
{
return false;
}
ServerPlayerWrapper that = (ServerPlayerWrapper) obj;
ServerPlayerWrapper that = (ServerPlayerWrapper) o;
return Objects.equal(this.connection, that.connection);
}
@Override
public int hashCode() { return Objects.hashCode(this.connection); }
public int hashCode()
{
return Objects.hashCode(this.connection);
}
}
}
@@ -70,7 +70,10 @@ public class ClientLevelWrapper implements IClientLevelWrapper
// wrapper logic //
//===============//
public static IClientLevelWrapper getWrapper(@NotNull ClientLevel level) { return getWrapper(level, false); }
public static IClientLevelWrapper getWrapper(@NotNull ClientLevel level)
{
return getWrapper(level, false);
}
@Nullable
public static IClientLevelWrapper getWrapper(@Nullable ClientLevel level, boolean bypassLevelKeyManager)
@@ -186,7 +189,10 @@ public class ClientLevelWrapper implements IClientLevelWrapper
@Override
public String getDimensionName() { return this.level.dimension().location().toString(); }
public String getDimensionName()
{
return this.level.dimension().location().toString();
}
@Override
public EDhApiLevelType getLevelType() { return EDhApiLevelType.CLIENT_LEVEL; }
@@ -299,4 +305,4 @@ public class ClientLevelWrapper implements IClientLevelWrapper
return "Wrapped{" + this.level.toString() + "@" + this.getDimensionName() + "}";
}
}
}
@@ -65,11 +65,11 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper
private String getDimensionName()
{
#if MC_VER <= MC_1_16_5
#if MC_VER >= MC_1_17_1
return this.dimensionType.effectsLocation().getPath();
#else // < 1.17.1
// effectsLocation() is marked as client only, so using the backing field directly
return dimensionType.effectsLocation.getPath();
#else
return this.dimensionType.effectsLocation().getPath();
#endif
}
@@ -91,6 +91,12 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper
return this.dimensionType;
}
@Override
public double getTeleportationScale(IDimensionTypeWrapper to)
{
return DimensionType.getTeleportationScale(this.dimensionType, (DimensionType) to.getWrappedMcObject());
}
// there's definitely a better way of doing this, but it should work well enough for now
@Override
public boolean isTheEnd() { return this.getDimensionName().equalsIgnoreCase("the_end"); }
@@ -110,4 +116,4 @@ public class DimensionTypeWrapper implements IDimensionTypeWrapper
}
}
}
@@ -81,27 +81,48 @@ public class ServerLevelWrapper implements IServerLevelWrapper
//=========//
@Override
public File getSaveFolder() { return this.level.getChunkSource().getDataStorage().dataFolder; }
public File getSaveFolder()
{
return this.level.getChunkSource().getDataStorage().dataFolder;
}
@Override
public DimensionTypeWrapper getDimensionType() { return DimensionTypeWrapper.getDimensionTypeWrapper(this.level.dimensionType()); }
public DimensionTypeWrapper getDimensionType()
{
return DimensionTypeWrapper.getDimensionTypeWrapper(this.level.dimensionType());
}
@Override
public String getDimensionName() { return this.level.dimension().location().toString(); }
public String getDimensionName()
{
return this.level.dimension().location().toString();
}
@Override
public EDhApiLevelType getLevelType() { return EDhApiLevelType.SERVER_LEVEL; }
public ServerLevel getLevel() { return this.level; }
public ServerLevel getLevel()
{
return this.level;
}
@Override
public boolean hasCeiling() { return this.level.dimensionType().hasCeiling(); }
public boolean hasCeiling()
{
return this.level.dimensionType().hasCeiling();
}
@Override
public boolean hasSkyLight() { return this.level.dimensionType().hasSkyLight(); }
public boolean hasSkyLight()
{
return this.level.dimensionType().hasSkyLight();
}
@Override
public int getMaxHeight() { return this.level.getHeight(); }
public int getMaxHeight()
{
return this.level.getHeight();
}
@Override
public int getMinHeight()
@@ -120,13 +141,11 @@ public class ServerLevelWrapper implements IServerLevelWrapper
{
return null;
}
ChunkAccess chunk = this.level.getChunk(pos.getX(), pos.getZ(), ChunkStatus.FULL, false);
if (chunk == null)
{
return null;
}
return new ChunkWrapper(chunk, this.level, this);
}
@@ -180,4 +199,4 @@ public class ServerLevelWrapper implements IServerLevelWrapper
@Override
public String toString() { return "Wrapped{" + this.level.toString() + "@" + this.getDimensionName() + "}"; }
}
}
@@ -134,7 +134,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
{
for (int i = 0; i < 11; i++)
{
this.times.add(new Rolling(SIZE));
times.add(new Rolling(SIZE));
}
}
@@ -144,25 +144,19 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
{
String name = e.name;
int index = Arrays.asList(TIME_NAMES).indexOf(name);
if (index == -1)
{
continue;
}
this.times.get(index).add(e.timeNs);
if (index == -1) continue;
times.get(index).add(e.timeNs);
}
this.times.get(0).add(event.getTotalTimeNs());
times.get(0).add(event.getTotalTimeNs());
}
@Override public String toString()
public String toString()
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < this.times.size(); i++)
for (int i = 0; i < times.size(); i++)
{
if (this.times.get(i).getAverage() == 0)
{
continue;
}
sb.append(TIME_NAMES[i]).append(": ").append(this.times.get(i).getAverage()).append("\n");
if (times.get(i).getAverage() == 0) continue;
sb.append(TIME_NAMES[i]).append(": ").append(times.get(i).getAverage()).append("\n");
}
return sb.toString();
}
@@ -192,13 +186,13 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
public RegionFileStorageExternalCache getOrCreateRegionFileCache(RegionFileStorage storage)
{
RegionFileStorageExternalCache cache = this.regionFileStorageCacheRef.get();
RegionFileStorageExternalCache cache = regionFileStorageCacheRef.get();
if (cache == null)
{
cache = new RegionFileStorageExternalCache(storage);
if (!this.regionFileStorageCacheRef.compareAndSet(null, cache))
if (!regionFileStorageCacheRef.compareAndSet(null, cache))
{
cache = this.regionFileStorageCacheRef.get();
cache = regionFileStorageCacheRef.get();
}
}
return cache;
@@ -310,17 +304,17 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
public <T> T joinSync(CompletableFuture<T> future)
{
if (!this.unsafeThreadingRecorded && !future.isDone())
if (!unsafeThreadingRecorded && !future.isDone())
{
EVENT_LOGGER.error("Unsafe MultiThreading in Chunk Generator: ", new RuntimeException("Concurrent future"));
EVENT_LOGGER.error("To increase stability, it is recommended to set world generation threads count to 1.");
this.unsafeThreadingRecorded = true;
unsafeThreadingRecorded = true;
}
return future.join();
}
@Override public void updateAllFutures()
public void updateAllFutures()
{
if (this.unknownExceptionCount > 0)
{
@@ -494,8 +488,8 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
{
chunkWrapper.setBlockLightStorage(chunkBlockLightingByDhPos.get(chunkWrapper.getChunkPos()));
chunkWrapper.setSkyLightStorage(chunkSkyLightingByDhPos.get(chunkWrapper.getChunkPos()));
chunkWrapper.setIsDhBlockLightCorrect(true);
chunkWrapper.setIsDhSkyLightCorrect(true);
chunkWrapper.setUseDhLighting(true);
chunkWrapper.setIsDhLightCorrect(true);
}
chunkWrappersByDhPos.put(chunkPos, chunkWrapper);
@@ -537,6 +531,11 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
#endif
}
if (!wrappedChunk.isLightCorrect())
{
throw new RuntimeException("The generated chunk somehow has isLightCorrect() returning false");
}
boolean isFull = ChunkWrapper.getStatus(target) == ChunkStatus.FULL || target instanceof LevelChunk;
#if MC_VER >= MC_1_18_2
boolean isPartial = target.isOldNoiseGeneration();
@@ -824,9 +823,9 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
Heightmap.primeHeightmaps(((ChunkWrapper)centerChunk).getChunk(), ChunkStatus.FEATURES.heightmapsAfter());
// pre-generated chunks should have lighting but new ones won't
if (!centerChunk.isDhBlockLightingCorrect())
if (!centerChunk.isLightCorrect())
{
DhLightingEngine.INSTANCE.bakeChunkBlockLighting(centerChunk, iChunkWrapperList, maxSkyLight);
DhLightingEngine.INSTANCE.lightChunk(centerChunk, iChunkWrapperList, maxSkyLight);
}
}
+6 -3
View File
@@ -5,14 +5,17 @@ plugins {
loom {
accessWidenerPath = project(":common").file("src/main/resources/${accessWidenerVersion}.distanthorizons.accesswidener")
// Custom logging
log4jConfigs.from(file("log4j-dev.xml"))
// "runs" isn't required, but when we do need it then it can be useful
runs {
client {
client()
setConfigName("Fabric Client")
ideConfigGenerated(true) // When true a run configuration file will be generated for IDE's. By default only set to true for the root project.
ideConfigGenerated(true)
runDir("../run/client")
vmArgs("-Dio.netty.leakDetection.level=advanced") // https://netty.io/wiki/reference-counted-objects.html#leak-detection-levels
vmArgs("-Dio.netty.leakDetection.level=advanced")
programArgs("--username", "Dev")
}
server {
@@ -157,4 +160,4 @@ sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}
}
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration name="Dev" monitorInterval="10">
<Loggers>
<Logger name="com.seibel.distanthorizons.core.network" level="trace" additivity="false">
<AppenderRef ref="DebugFile" level="${sys:fabric.log.debug.level:-debug}" />
<AppenderRef ref="SysOut" />
<AppenderRef ref="LatestFile" level="${sys:fabric.log.level:-info}" />
<AppenderRef ref="ServerGuiConsole" />
</Logger>
</Loggers>
</Configuration>
@@ -52,7 +52,7 @@ import net.minecraft.client.gui.screens.TitleScreen;
import com.seibel.distanthorizons.common.CommonPacketPayload;
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
#else
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
#endif
#if MC_VER < MC_1_19_4
@@ -268,7 +268,7 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
{
// Forge packet ID
buffer.readByte();
AbstractNetworkMessage message = AbstractPluginPacketSender.decodeMessage(buffer);
NetworkMessage message = AbstractPluginPacketSender.decodeMessage(buffer);
if (message != null)
{
ClientApi.INSTANCE.pluginMessageReceived(message);
@@ -313,4 +313,4 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
this.previouslyPressKeyCodes = currentKeyDown;
}
}
}
@@ -119,12 +119,9 @@ public class FabricMain extends AbstractModInitializer implements ClientModIniti
@Override
protected void subscribeRegisterCommandsEvent(Consumer<CommandDispatcher<CommandSourceStack>> eventHandler)
{
CommandRegistrationCallback.EVENT.register(
(dispatcher, registryAccess #if MC_VER >= MC_1_19_2 , environment #endif ) ->
{
eventHandler.accept(dispatcher);
}
);
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess #if MC_VER >= MC_1_19_2 , environment #endif ) -> {
eventHandler.accept(dispatcher);
});
}
@Override
@@ -160,4 +157,4 @@ public class FabricMain extends AbstractModInitializer implements ClientModIniti
}
}
}
}
@@ -1,7 +1,7 @@
package com.seibel.distanthorizons.fabric;
import com.seibel.distanthorizons.common.AbstractPluginPacketSender;
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.minecraft.server.level.ServerPlayer;
@@ -16,7 +16,7 @@ import net.minecraft.network.FriendlyByteBuf;
public class FabricPluginPacketSender extends AbstractPluginPacketSender
{
@Override
public void sendToServer(AbstractNetworkMessage message)
public void sendPluginPacketClient(NetworkMessage message)
{
#if MC_VER >= MC_1_20_6
ClientPlayNetworking.send(new CommonPacketPayload(message));
@@ -30,7 +30,7 @@ public class FabricPluginPacketSender extends AbstractPluginPacketSender
}
@Override
public void sendToClient(ServerPlayer serverPlayer, AbstractNetworkMessage message)
public void sendPluginPacketServer(ServerPlayer serverPlayer, NetworkMessage message)
{
#if MC_VER >= MC_1_20_6
ServerPlayNetworking.send(serverPlayer, new CommonPacketPayload(message));
@@ -31,7 +31,7 @@ import org.apache.logging.log4j.Logger;
import com.seibel.distanthorizons.common.CommonPacketPayload;
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
#else
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
import com.seibel.distanthorizons.common.AbstractPluginPacketSender;
#endif
@@ -50,26 +50,21 @@ public class FabricServerProxy implements AbstractModInitializer.IEventProxy
private static final ServerApi SERVER_API = ServerApi.INSTANCE;
private static final Logger LOGGER = DhLoggerBuilder.getLogger();
private final boolean isDedicatedServer;
private final boolean isDedicated;
public static Supplier<Boolean> isGenerationThreadChecker = null;
//=============//
// constructor //
//=============//
public FabricServerProxy(boolean isDedicatedServer)
public FabricServerProxy(boolean isDedicated)
{
this.isDedicatedServer = isDedicatedServer;
this.isDedicated = isDedicated;
}
// TODO rename
private boolean isValidTime()
{
if (this.isDedicatedServer)
if (this.isDedicated)
{
return true;
}
@@ -108,7 +103,7 @@ public class FabricServerProxy implements AbstractModInitializer.IEventProxy
{
if (this.isValidTime())
{
ServerApi.INSTANCE.serverLoadEvent(this.isDedicatedServer);
ServerApi.INSTANCE.serverLoadEvent(this.isDedicated);
}
});
// ServerWorldUnloadEvent
@@ -164,19 +159,19 @@ public class FabricServerProxy implements AbstractModInitializer.IEventProxy
ServerApi.INSTANCE.serverPlayerDisconnectEvent(this.getServerPlayerWrapper(handler.player));
}
});
ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD.register((player, originLevel, destinationLevel) ->
ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD.register((player, origin, dest) ->
{
if (this.isValidTime())
{
ServerApi.INSTANCE.serverPlayerLevelChangeEvent(
this.getServerPlayerWrapper(player),
this.getServerLevelWrapper(originLevel),
this.getServerLevelWrapper(destinationLevel)
this.getServerLevelWrapper(origin),
this.getServerLevelWrapper(dest)
);
}
});
if (this.isDedicatedServer)
if (this.isDedicated)
{
#if MC_VER >= MC_1_20_6
PayloadTypeRegistry.playC2S().register(CommonPacketPayload.TYPE, new CommonPacketPayload.Codec());
@@ -194,7 +189,7 @@ public class FabricServerProxy implements AbstractModInitializer.IEventProxy
{
// Forge packet ID
buffer.readByte();
AbstractNetworkMessage message = AbstractPluginPacketSender.decodeMessage(buffer);
NetworkMessage message = AbstractPluginPacketSender.decodeMessage(buffer);
if (message != null)
{
ServerApi.INSTANCE.pluginMessageReceived(ServerPlayerWrapper.getWrapper(serverPlayer), message);
@@ -204,4 +199,4 @@ public class FabricServerProxy implements AbstractModInitializer.IEventProxy
}
}
}
}
@@ -65,4 +65,4 @@ public class MixinClientLevel
}
#endif
}
}
@@ -44,4 +44,4 @@ public class MixinClientPacketListener
#endif
}
}
@@ -131,4 +131,22 @@ public class MixinLevelRenderer
}
}
#if MC_VER < MC_1_19_4
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
#elif MC_VER < MC_1_20_1
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
#elif MC_VER < MC_1_20_6
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
private void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
#else
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
private void callAfterRunUpdates(CallbackInfo ci)
#endif
{
ChunkWrapper.syncedUpdateClientLightStatus();
}
}
@@ -130,16 +130,14 @@ public abstract class MixinMinecraft
{
ClientApi.INSTANCE.clientLevelUnloadEvent(ClientLevelWrapper.getWrapper(this.lastLevel));
}
if (level != null)
{
ClientApi.INSTANCE.clientLevelLoadEvent(ClientLevelWrapper.getWrapper(level, true));
}
this.lastLevel = level;
}
@Inject(at = @At("HEAD"), method = "close()V")
public void close(CallbackInfo ci) { SelfUpdater.onClose(); }
}
}
@@ -1,38 +0,0 @@
#if MC_VER == MC_1_16_5
package com.seibel.distanthorizons.fabric.mixins.server;
import com.seibel.distanthorizons.common.wrappers.misc.IMixinServerPlayer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Entity.class)
public class MixinEntity
{
@Inject(at = @At("TAIL"), method = "setLevel")
public void setLevel(Level level, CallbackInfo ci)
{
if (this instanceof IMixinServerPlayer)
{
((IMixinServerPlayer) this).distantHorizons$setDimensionChangeDestination((ServerLevel) level);
}
}
}
#else
package com.seibel.distanthorizons.fabric.mixins.server;
import net.minecraft.world.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(Entity.class)
public class MixinEntity
{
}
#endif
@@ -46,31 +46,32 @@ public class MixinServerPlayer implements IMixinServerPlayer
@Override
@Nullable
public ServerLevel distantHorizons$getDimensionChangeDestination()
{ return this.dimensionChangeDestination; }
#if MC_VER == MC_1_16_5
@Override
public void distantHorizons$setDimensionChangeDestination(ServerLevel dimensionChangeDestination)
{ this.dimensionChangeDestination = dimensionChangeDestination; }
#endif
{
return this.dimensionChangeDestination;
}
@Inject(at = @At("HEAD"), method = "changeDimension")
#if MC_VER >= MC_1_21_1
public void changeDimension(DimensionTransition dimensionTransition, CallbackInfoReturnable<Entity> cir)
{ this.dimensionChangeDestination = dimensionTransition.newLevel(); }
{
this.dimensionChangeDestination = dimensionTransition.newLevel();
}
#else
public void changeDimension(ServerLevel destination, CallbackInfoReturnable<Entity> cir)
{ this.dimensionChangeDestination = destination; }
{
this.dimensionChangeDestination = destination;
}
#endif
#if MC_VER >= MC_1_20_1
@Inject(at = @At("RETURN"), method = "setServerLevel")
public void setServerLevel(ServerLevel level, CallbackInfo ci)
{ this.dimensionChangeDestination = null; }
#elif MC_VER >= MC_1_17_1
#else
@Inject(at = @At("RETURN"), method = "setLevel")
public void setLevel(ServerLevel level, CallbackInfo ci)
{ this.dimensionChangeDestination = null; }
#endif
{
this.dimensionChangeDestination = null;
}
}
@@ -6,8 +6,7 @@
"server.MixinChunkGenerator",
"server.MixinChunkMap",
"server.MixinUtilBackgroundThread",
"server.MixinServerPlayer",
"server.MixinEntity"
"server.MixinServerPlayer"
],
"client": [
"client.MixinClientLevel",
@@ -26,4 +25,4 @@
"defaultRequire": 1
},
"plugin": "com.seibel.distanthorizons.fabric.mixins.FabricMixinPlugin"
}
}
+2 -2
View File
@@ -37,9 +37,9 @@ loom {
client {
client()
setConfigName("Forge Client")
ideConfigGenerated(false) // When true a run configuration file will be generated for IDE's. By default only set to true for the root project.
ideConfigGenerated(false)
runDir("../run/client")
vmArgs("-Dio.netty.leakDetection.level=advanced") // https://netty.io/wiki/reference-counted-objects.html#leak-detection-levels
vmArgs("-Dio.netty.leakDetection.level=advanced")
programArgs("--username", "Dev")
}
server {
@@ -121,7 +121,7 @@ public class ForgeClientProxy implements AbstractModInitializer.IEventProxy
#endif
{
LOGGER.info("level load");
#if MC_VER < MC_1_19_2
LevelAccessor level = event.getWorld();
#else
@@ -145,7 +145,7 @@ public class ForgeClientProxy implements AbstractModInitializer.IEventProxy
#endif
{
LOGGER.info("level unload");
#if MC_VER < MC_1_19_2
LevelAccessor level = event.getWorld();
#else
@@ -297,5 +297,4 @@ public class ForgeClientProxy implements AbstractModInitializer.IEventProxy
}
}
}
}
@@ -153,4 +153,4 @@ public class ForgeMain extends AbstractModInitializer
@Override
protected void runDelayedSetup() { SingletonInjector.INSTANCE.runDelayedSetup(); }
}
}
@@ -2,7 +2,7 @@ package com.seibel.distanthorizons.forge;
import com.seibel.distanthorizons.common.AbstractPluginPacketSender;
import com.seibel.distanthorizons.common.wrappers.misc.ServerPlayerWrapper;
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IServerPlayerWrapper;
import net.minecraft.server.level.ServerPlayer;
@@ -45,11 +45,11 @@ public class ForgePluginPacketSender extends AbstractPluginPacketSender
);
#endif
public static void setPacketHandler(Consumer<AbstractNetworkMessage> consumer)
public static void setPacketHandler(Consumer<NetworkMessage> consumer)
{
setPacketHandler((player, message) -> consumer.accept(message));
}
public static void setPacketHandler(BiConsumer<IServerPlayerWrapper, AbstractNetworkMessage> consumer)
public static void setPacketHandler(BiConsumer<IServerPlayerWrapper, NetworkMessage> consumer)
{
#if MC_VER >= MC_1_20_2
PLUGIN_CHANNEL.messageBuilder(MessageWrapper.class, 0)
@@ -95,7 +95,7 @@ public class ForgePluginPacketSender extends AbstractPluginPacketSender
}
@Override
public void sendToServer(AbstractNetworkMessage message)
public void sendPluginPacketClient(NetworkMessage message)
{
#if MC_VER >= MC_1_20_2
PLUGIN_CHANNEL.send(new MessageWrapper(message), PacketDistributor.SERVER.noArg());
@@ -105,7 +105,7 @@ public class ForgePluginPacketSender extends AbstractPluginPacketSender
}
@Override
public void sendToClient(ServerPlayer serverPlayer, AbstractNetworkMessage message)
public void sendPluginPacketServer(ServerPlayer serverPlayer, NetworkMessage message)
{
#if MC_VER >= MC_1_20_2
PLUGIN_CHANNEL.send(new MessageWrapper(message), PacketDistributor.PLAYER.with(serverPlayer));
@@ -118,9 +118,12 @@ public class ForgePluginPacketSender extends AbstractPluginPacketSender
@SuppressWarnings({"ClassCanBeRecord", "RedundantSuppression"})
public static class MessageWrapper
{
public final AbstractNetworkMessage message;
public final NetworkMessage message;
public MessageWrapper(AbstractNetworkMessage message) { this.message = message; }
public MessageWrapper(NetworkMessage message)
{
this.message = message;
}
}
@@ -154,10 +154,14 @@ public class ForgeServerProxy implements AbstractModInitializer.IEventProxy
@SubscribeEvent
public void playerLoggedInEvent(PlayerEvent.PlayerLoggedInEvent event)
{ this.serverApi.serverPlayerJoinEvent(getServerPlayerWrapper(event)); }
{
this.serverApi.serverPlayerJoinEvent(getServerPlayerWrapper(event));
}
@SubscribeEvent
public void playerLoggedOutEvent(PlayerEvent.PlayerLoggedOutEvent event)
{ this.serverApi.serverPlayerDisconnectEvent(getServerPlayerWrapper(event)); }
{
this.serverApi.serverPlayerDisconnectEvent(getServerPlayerWrapper(event));
}
@SubscribeEvent
public void playerChangedDimensionEvent(PlayerEvent.PlayerChangedDimensionEvent event)
{
@@ -26,4 +26,4 @@ public class MixinClientPacketListener
ClientApi.INSTANCE.onClientOnlyDisconnected();
}
}
}
@@ -158,4 +158,18 @@ public class MixinLevelRenderer
}
}
#if MC_VER < MC_1_19_4
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
#elif MC_VER < MC_1_20_1
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
#else
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
private void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
#endif
{
ChunkWrapper.syncedUpdateClientLightStatus();
}
}
@@ -2,6 +2,8 @@ package com.seibel.distanthorizons.forge.mixins.client;
import com.seibel.distanthorizons.api.enums.config.EDhApiUpdateBranch;
import com.seibel.distanthorizons.common.wrappers.gui.updater.UpdateModScreen;
import com.seibel.distanthorizons.common.wrappers.world.ClientLevelWrapper;
import com.seibel.distanthorizons.core.api.internal.ClientApi;
import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
import com.seibel.distanthorizons.core.jar.installer.GitlabGetter;
@@ -11,7 +13,9 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.IVersionConstants;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.TitleScreen;
import net.minecraft.client.multiplayer.ClientLevel;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
@@ -104,4 +108,4 @@ public class MixinMinecraft
SelfUpdater.onClose();
}
}
}
@@ -1,39 +0,0 @@
#if MC_VER == MC_1_16_5
package com.seibel.distanthorizons.forge.mixins.server;
import com.seibel.distanthorizons.common.wrappers.misc.IMixinServerPlayer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Entity.class)
public class MixinEntity
{
@Inject(at = @At("TAIL"), method = "setLevel")
public void setLevel(Level level, CallbackInfo ci)
{
if (this instanceof IMixinServerPlayer)
{
((IMixinServerPlayer) this).distantHorizons$setDimensionChangeDestination((ServerLevel) level);
}
}
}
#else
package com.seibel.distanthorizons.forge.mixins.server;
import net.minecraft.world.entity.Entity;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(Entity.class)
public class MixinEntity
{
}
#endif
@@ -43,26 +43,25 @@ public class MixinServerPlayer implements IMixinServerPlayer
@Override
@Nullable
public ServerLevel distantHorizons$getDimensionChangeDestination()
{ return this.distantHorizons$dimensionChangeDestination; }
#if MC_VER == MC_1_16_5
@Override
public void distantHorizons$setDimensionChangeDestination(ServerLevel dimensionChangeDestination)
{ this.distantHorizons$dimensionChangeDestination = dimensionChangeDestination; }
#endif
{
return this.distantHorizons$dimensionChangeDestination;
}
@Inject(at = @At("HEAD"), method = "changeDimension", remap = false)
public void changeDimension(ServerLevel destination, ITeleporter teleporter, CallbackInfoReturnable<Entity> cir)
{ this.distantHorizons$dimensionChangeDestination = destination; }
{
this.distantHorizons$dimensionChangeDestination = destination;
}
#if MC_VER >= MC_1_20_1
@Inject(at = @At("RETURN"), method = "setServerLevel")
public void setServerLevel(ServerLevel level, CallbackInfo ci)
{ this.distantHorizons$dimensionChangeDestination = null; }
#elif MC_VER >= MC_1_17_1
#else
@Inject(at = @At("RETURN"), method = "setLevel")
public void setLevel(ServerLevel level, CallbackInfo ci)
{ this.distantHorizons$dimensionChangeDestination = null; }
#endif
{
this.distantHorizons$dimensionChangeDestination = null;
}
}
@@ -7,8 +7,7 @@
"server.MixinChunkGenerator",
"server.MixinTFChunkGenerator",
"server.MixinChunkMap",
"server.MixinServerPlayer",
"server.MixinEntity"
"server.MixinServerPlayer"
],
"client": [
"client.MixinClientPacketListener",
+3 -3
View File
@@ -5,8 +5,8 @@ org.gradle.caching=true
# Mod Info
mod_name=DistantHorizons
mod_version=2.3.0-a-dev
api_version=4.0.0
mod_version=2.2.2-a-dev
api_version=3.0.0
maven_group=com.seibel.distanthorizons
mod_readable_name=Distant Horizons
mod_description=This mod generates and renders simplified terrain beyond the normal view distance at a low performance cost. Allowing you to see much farther without turning your game into a slideshow.
@@ -51,4 +51,4 @@ versionStr=
mcVer=1.21.1
# Defines the maximum amount of memory Minecraft is allowed when run in a development environment
#minecraftMemoryJavaArg="-Xmx4G"
#minecraftMemoryJavaArg="-Xmx4G"
+3 -3
View File
@@ -29,9 +29,9 @@ loom {
client {
client()
setConfigName("NeoForge Client")
ideConfigGenerated(false) // When true a run configuration file will be generated for IDE's. By default only set to true for the root project.
ideConfigGenerated(false)
runDir("../run/client")
vmArgs("-Dio.netty.leakDetection.level=advanced") // https://netty.io/wiki/reference-counted-objects.html#leak-detection-levels
vmArgs("-Dio.netty.leakDetection.level=advanced")
programArgs("--username", "Dev")
}
server {
@@ -99,4 +99,4 @@ sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}
}
@@ -87,7 +87,10 @@ public class NeoforgeClientProxy implements AbstractModInitializer.IEventProxy
@Override
public void registerEvents() { NeoForge.EVENT_BUS.register(this); }
public void registerEvents()
{
NeoForge.EVENT_BUS.register(this);
}
@@ -281,4 +284,4 @@ public class NeoforgeClientProxy implements AbstractModInitializer.IEventProxy
private static LevelAccessor GetEventLevel(LevelEvent e) { return e.getLevel(); }
}
}
@@ -80,9 +80,13 @@ public class NeoforgeMain extends AbstractModInitializer
// networking //
//============//
public void registerNetworkingClient(RegisterPayloadHandlersEvent event)
{ NeoforgePluginPacketSender.setPacketHandler(event, ClientApi.INSTANCE::pluginMessageReceived); }
{
NeoforgePluginPacketSender.setPacketHandler(event, ClientApi.INSTANCE::pluginMessageReceived);
}
public void registerNetworkingServer(RegisterPayloadHandlersEvent event)
{ NeoforgePluginPacketSender.setPacketHandler(event, ServerApi.INSTANCE::pluginMessageReceived); }
{
NeoforgePluginPacketSender.setPacketHandler(event, ServerApi.INSTANCE::pluginMessageReceived);
}
@@ -149,4 +153,4 @@ public class NeoforgeMain extends AbstractModInitializer
@Override
protected void runDelayedSetup() { SingletonInjector.INSTANCE.runDelayedSetup(); }
}
}
@@ -3,7 +3,7 @@ package com.seibel.distanthorizons.neoforge;
import com.seibel.distanthorizons.common.CommonPacketPayload;
import com.seibel.distanthorizons.common.wrappers.misc.ServerPlayerWrapper;
import com.seibel.distanthorizons.common.AbstractPluginPacketSender;
import com.seibel.distanthorizons.core.network.messages.AbstractNetworkMessage;
import com.seibel.distanthorizons.core.network.messages.NetworkMessage;
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IServerPlayerWrapper;
import net.minecraft.server.level.ServerPlayer;
import net.neoforged.neoforge.network.PacketDistributor;
@@ -16,11 +16,13 @@ import java.util.function.Consumer;
public class NeoforgePluginPacketSender extends AbstractPluginPacketSender
{
private static BiConsumer<IServerPlayerWrapper, AbstractNetworkMessage> packetConsumer;
private static BiConsumer<IServerPlayerWrapper, NetworkMessage> packetConsumer;
public static void setPacketHandler(RegisterPayloadHandlersEvent event, Consumer<AbstractNetworkMessage> consumer)
{ setPacketHandler(event, (player, buffer) -> consumer.accept(buffer)); }
public static void setPacketHandler(RegisterPayloadHandlersEvent event, BiConsumer<IServerPlayerWrapper, AbstractNetworkMessage> consumer)
public static void setPacketHandler(RegisterPayloadHandlersEvent event, Consumer<NetworkMessage> consumer)
{
setPacketHandler(event, (player, buffer) -> consumer.accept(buffer));
}
public static void setPacketHandler(RegisterPayloadHandlersEvent event, BiConsumer<IServerPlayerWrapper, NetworkMessage> consumer)
{
packetConsumer = consumer;
@@ -40,11 +42,15 @@ public class NeoforgePluginPacketSender extends AbstractPluginPacketSender
}
@Override
public void sendToServer(AbstractNetworkMessage message)
{ PacketDistributor.sendToServer(new CommonPacketPayload(message)); }
public void sendPluginPacketClient(NetworkMessage message)
{
PacketDistributor.sendToServer(new CommonPacketPayload(message));
}
@Override
public void sendToClient(ServerPlayer serverPlayer, AbstractNetworkMessage message)
{ PacketDistributor.sendToPlayer(serverPlayer, new CommonPacketPayload(message)); }
public void sendPluginPacketServer(ServerPlayer serverPlayer, NetworkMessage message)
{
PacketDistributor.sendToPlayer(serverPlayer, new CommonPacketPayload(message));
}
}
@@ -129,10 +129,15 @@ public class NeoforgeServerProxy implements AbstractModInitializer.IEventProxy
}
@SubscribeEvent
public void playerLoggedInEvent(PlayerEvent.PlayerLoggedInEvent event) { this.serverApi.serverPlayerJoinEvent(getServerPlayerWrapper(event)); }
public void playerLoggedInEvent(PlayerEvent.PlayerLoggedInEvent event)
{
this.serverApi.serverPlayerJoinEvent(getServerPlayerWrapper(event));
}
@SubscribeEvent
public void playerLoggedOutEvent(PlayerEvent.PlayerLoggedOutEvent event)
{ this.serverApi.serverPlayerDisconnectEvent(getServerPlayerWrapper(event)); }
{
this.serverApi.serverPlayerDisconnectEvent(getServerPlayerWrapper(event));
}
@SubscribeEvent
public void playerChangedDimensionEvent(PlayerEvent.PlayerChangedDimensionEvent event)
{
@@ -156,6 +161,9 @@ public class NeoforgeServerProxy implements AbstractModInitializer.IEventProxy
return getServerLevelWrapper(event.getEntity().getServer().getLevel(resourceKey));
}
private static ServerPlayerWrapper getServerPlayerWrapper(PlayerEvent event) { return ServerPlayerWrapper.getWrapper((ServerPlayer) event.getEntity()); }
private static ServerPlayerWrapper getServerPlayerWrapper(PlayerEvent event)
{
return ServerPlayerWrapper.getWrapper((ServerPlayer) event.getEntity());
}
}
}
@@ -142,5 +142,22 @@ public class MixinLevelRenderer
}
}
#if MC_VER < MC_1_19_4
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
#elif MC_VER < MC_1_20_1
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runUpdates(IZZ)I"), method = "renderLevel")
public void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
#elif MC_VER < MC_1_20_6
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
private void callAfterRunUpdates(PoseStack poseStack, float partialTick, long finishNanoTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projectionMatrix, CallbackInfo ci)
#else
@Inject(at = @At(value = "TAIL", target = "Lnet/minecraft/world/level/lighting/LevelLightEngine;runLightUpdates()I"), method = "renderLevel")
private void callAfterRunUpdates(CallbackInfo ci)
#endif
{
ChunkWrapper.syncedUpdateClientLightStatus();
}
}
@@ -43,20 +43,24 @@ public class MixinServerPlayer implements IMixinServerPlayer
@Nullable
private ServerLevel distantHorizons$dimensionChangeDestination;
@Unique
@Override
@Nullable
public ServerLevel distantHorizons$getDimensionChangeDestination()
{ return this.distantHorizons$dimensionChangeDestination; }
public ServerLevel distantHorizons$getDimensionChangeDestination()
{
return this.distantHorizons$dimensionChangeDestination;
}
@Inject(at = @At("HEAD"), method = "changeDimension")
#if MC_VER >= MC_1_21_1
public void changeDimension(DimensionTransition dimensionTransition, CallbackInfoReturnable<Entity> cir)
{ this.distantHorizons$dimensionChangeDestination = dimensionTransition.newLevel(); }
{
this.distantHorizons$dimensionChangeDestination = dimensionTransition.newLevel();
}
#else
public void changeDimension(ServerLevel destination, CallbackInfoReturnable<Entity> cir)
{ this.distantHorizons$dimensionChangeDestination = destination; }
{
this.distantHorizons$dimensionChangeDestination = destination;
}
#endif
#if MC_VER >= MC_1_20_1
View File
+1 -1
View File
@@ -24,7 +24,7 @@ fabric_api_version=0.42.0+1.16
immersive_portals_version=
canvas_version=
fabric_incompatibility_list={ "iris": "*", "oculus": "*" }
fabric_incompatibility_list={ "iris": "*" }
fabric_recommend_list={}
# Fabric mod run
+1 -1
View File
@@ -24,7 +24,7 @@ fabric_api_version=0.46.1+1.17
immersive_portals_version=
canvas_version=
fabric_incompatibility_list={ "iris": "*", "oculus": "*" }
fabric_incompatibility_list={ "iris": "*" }
fabric_recommend_list={}
# Fabric mod run
+1 -1
View File
@@ -25,7 +25,7 @@ fabric_api_version=0.76.0+1.18.2
immersive_portals_version=v1.4.11-1.18
canvas_version=mc118:1.0.2616
fabric_incompatibility_list={ "iris": "*", "oculus": "*" }
fabric_incompatibility_list={ "iris": "*" }
fabric_recommend_list={}
# Fabric mod run
+1 -1
View File
@@ -24,7 +24,7 @@ fabric_api_version=0.76.1+1.19.2
immersive_portals_version=
canvas_version=mc119-1.0.2480
fabric_incompatibility_list={ "iris": "*", "oculus": "*" }
fabric_incompatibility_list={ "iris": "*" }
fabric_recommend_list={}
# Fabric mod run
+1 -1
View File
@@ -23,7 +23,7 @@ fabric_api_version=0.87.1+1.19.4
immersive_portals_version=
canvas_version=
fabric_incompatibility_list={ "iris": "*", "oculus": "*" }
fabric_incompatibility_list={ "iris": "*" }
fabric_recommend_list={}
# Fabric mod run
+1 -1
View File
@@ -23,7 +23,7 @@ fabric_api_version=0.90.4+1.20.1
immersive_portals_version=
canvas_version=
fabric_incompatibility_list={ "iris": "<=1.7.4", "oculus": "<=1.7.0" }
fabric_incompatibility_list={ "iris": "<=1.7.4" }
fabric_recommend_list={}
# Fabric mod run
+1 -1
View File
@@ -23,7 +23,7 @@ fabric_api_version=0.90.4+1.20.2
immersive_portals_version=
canvas_version=
fabric_incompatibility_list={ "iris": "<=1.7.4", "oculus": "<=1.7.0" }
fabric_incompatibility_list={ "iris": "<=1.7.4" }
fabric_recommend_list={}
# Fabric mod run
+1 -1
View File
@@ -24,7 +24,7 @@ fabric_api_version=0.91.2+1.20.4
immersive_portals_version=
canvas_version=
fabric_incompatibility_list={ "iris": "<=1.7.4", "oculus": "<=1.7.0" }
fabric_incompatibility_list={ "iris": "<=1.7.4" }
fabric_recommend_list={}
# Fabric mod run
+2 -2
View File
@@ -24,7 +24,7 @@ fabric_api_version=0.97.8+1.20.6
immersive_portals_version=
canvas_version=
fabric_incompatibility_list={ "iris": "<=1.7.4", "oculus": "<=1.7.0" }
fabric_incompatibility_list={ "iris": "<=1.7.4" }
fabric_recommend_list={}
# Fabric mod run
@@ -53,4 +53,4 @@ neoforge_version=20.6.70-beta
# 2 = Can be referenced in code and runs in client
enable_starlight_forge=0
enable_terraforged=0
enable_terrafirmacraft=0
enable_terrafirmacraft=0
+2 -2
View File
@@ -24,7 +24,7 @@ fabric_api_version=0.100.1+1.21
immersive_portals_version=
canvas_version=
fabric_incompatibility_list={ "iris": "<=1.7.4", "oculus": "<=1.7.0" }
fabric_incompatibility_list={ "iris": "<=1.7.4" }
fabric_recommend_list={}
# Fabric mod run
@@ -53,4 +53,4 @@ neoforge_version=21.1.6
# 2 = Can be referenced in code and runs in client
enable_starlight_forge=0
enable_terraforged=0
enable_terrafirmacraft=0
enable_terrafirmacraft=0
View File