Compare commits

...
372 Commits
Author SHA1 Message Date
FalsePattern 2ba9772cca build: update gradle and buildscript 2026-08-09 15:46:15 +02:00
FalsePattern a780cde306 feat: update dependencies 2026-05-30 16:10:54 +02:00
FalsePattern 58fb32809c feat: add interop code for spool 2026-05-25 23:06:04 +02:00
FalsePattern 012ecc02af fix: avoid EndlessIDsTransformer getting initialized too early 2026-05-25 23:05:09 +02:00
FalsePattern 2d5dd8a52a Merge remote-tracking branch 'danyadev/optimize-transforming' 2026-05-25 22:11:30 +02:00
FalsePattern 15168f66e0 build: update fpgradle 2026-05-25 22:11:14 +02:00
FalsePattern c2cb18f98b build: update gradle 2026-05-25 22:11:09 +02:00
FalsePattern a3e69f1194 build: update fplib (new required apis) 2026-05-25 22:10:46 +02:00
danyadev ed03306597 optimize ChunkProviderSuperPatcher: don't create ClassNode in shouldTransformClass 2026-05-20 09:49:42 +03:00
FalsePattern 3dc556b807 docs: update readme 2026-05-17 16:01:59 +02:00
FalsePattern 16ff546f5c chore: Update copyright date 2026-02-06 21:13:18 +01:00
FalsePattern 3ef682b940 fix: Thermos compat
Merges: https://github.com/GTMEGA/EndlessIDs/pull/282
2026-02-06 20:59:45 +01:00
rjnasers b7d1cd2ee1 Revert accdiental header update 2026-01-27 16:24:05 +01:00
rjnasers 569818f9bd copyright 2026-01-27 15:43:34 +01:00
rjnasers 0041f04d28 Cleanup 2026-01-27 14:12:09 +01:00
rjnasers 3514f9098d Adding in AT, and fixing mixin 2026-01-25 21:59:19 +01:00
rjnasers 7bc4e82fdb Why you no work 2026-01-25 21:07:08 +01:00
rjnasers e2f0b85128 Organizing a bit 2026-01-24 23:00:08 +01:00
rjnasers a4aee25df0 Sort of a fix. Probably want to move to chunkapi rather than EID. It's unclear 2026-01-24 22:00:43 +01:00
rjnasers 761a5631fe A start 2026-01-24 01:17:44 +01:00
FalsePattern 0d7a4411a2 Merge remote-tracking branches 'pr275/cc-compat' and 'pr280/personal-space-compat' 2026-01-23 20:16:37 +01:00
FalsePattern fdd9fde9c9 fix: bump chunkapi dep to make new changes build 2026-01-23 20:14:44 +01:00
chrombread f0ab23044f correct name for dependency 2026-01-23 00:43:50 -08:00
chrombread 1c70006519 seems to work 2026-01-23 00:39:49 -08:00
RecursivePineapple 93fa055660 Cubic Chunks Compatibility 2025-11-26 11:12:47 -05:00
FalsePattern 1c035f6110 fix: Remove broken potion ID recovery logic
It was causing issues with Salis Arcana, SuperTic, etc. I am not fixing your bugs. Garbage in, garbage out, figure it out, i don't care anymore.
2025-11-03 04:27:15 +01:00
FalsePattern a47a187d65 fix: DragonAPI mixin compat error 2025-09-30 22:30:34 +02:00
FalsePattern b8e5fb162d chore: Bump minimum fplib version to 1.9.0 2025-09-25 19:32:10 +02:00
FalsePattern 6b31762c17 feat: Add compatibility with Salis Arcana
Closes: https://github.com/GTMEGA/EndlessIDs/issues/267
2025-09-25 19:31:19 +02:00
FalsePattern cb302ea1fa fix: Extract inner class from EntityListMixin
Closes: https://github.com/GTMEGA/EndlessIDs/issues/264
2025-09-25 19:14:07 +02:00
FalsePattern 860f2fb467 fix: Remove deprecated blockItem netcode patch
This was already patched by ChunkAPI, updating to V2 revealed the conflict
2025-09-25 19:10:24 +02:00
FalsePattern f673dba88b chore: Update mixins to V2 api 2025-09-25 19:02:27 +02:00
FalsePattern e74df49271 build: update gradle and buildscript 2025-09-25 16:52:04 +02:00
FalsePattern a43f85b18c Entity ID extension fixes 2025-08-27 18:57:15 +02:00
FalsePattern 986a614028 update gradle and buildscript 2025-08-27 18:56:57 +02:00
FalsePattern c620a87819 fix bad remap rules 2025-08-06 22:16:42 +02:00
FalsePattern 0a1895370b bump deps 2025-08-06 22:15:14 +02:00
FalsePattern 7220faae24 update buildscript and gradle 2025-08-06 22:11:42 +02:00
FalsePattern 36cb1b4b32 fixed crash when trying to set biomes with worldedit 2025-08-06 22:10:55 +02:00
FalsePattern 337a34108d BlockPhysics compat
#160
2025-06-09 19:15:40 +02:00
FalsePattern 49a376b48d bump intellij project xml 2025-06-09 18:41:57 +02:00
FalsePattern 7a6dd9adaa Fastcraft compat
#165
2025-06-09 18:41:34 +02:00
FalsePattern 76fdd16906 AtomicStryker's Ruins mod compat
#186 #93
2025-06-09 17:26:08 +02:00
FalsePattern f4623ebf2e more robust Advanced Rocketry biome ID shifting
#195
2025-06-09 17:05:34 +02:00
FalsePattern 206c745716 Mystcraft compat
#150 #196
2025-06-09 16:58:23 +02:00
FalsePattern ebdfcd21aa restructure mixins 2025-06-09 14:40:14 +02:00
FalsePattern 9637c27159 Just Another Spawner compat
#201
2025-06-09 13:36:17 +02:00
FalsePattern b1ebe33403 fix broken Witchery mixin
#243
2025-06-09 13:04:45 +02:00
FalsePattern f03b1dbdb8 update deps 2025-06-06 15:13:00 +02:00
FalsePattern c51228b1fd bump default block ID limit to 32k for NEID parity 2025-06-06 12:32:28 +02:00
FalsePattern a0c8fe49a3 TARDIS Mod compat
#220
2025-06-06 12:30:08 +02:00
FalsePattern 00688eb30d fix witchery BrewActionBiomeChange compat
#223
2025-06-06 12:07:04 +02:00
FalsePattern d02ca48a0e improved PotionEffectMixin safety 2025-06-06 11:37:18 +02:00
FalsePattern 3c38d3e184 make the NEID incompatibility more obvious 2025-06-06 11:12:53 +02:00
Darek505 e06a4d329b Fix (rare) crash with RTG
Prevent `ArrayIndexOutOfBoundsException` crash

Signed-off-by: FalsePattern
2025-06-06 10:53:15 +02:00
FalsePattern 5dc630fca9 add note about oredict wildcard meta (resolves #218) 2025-06-05 12:06:52 +02:00
FalsePattern a998af65ce Gadomancy compat 2025-06-05 11:57:41 +02:00
FalsePattern 0e7b705c54 increase default ID limits for block/item 2025-06-05 11:47:42 +02:00
FalsePattern 56a6c619ed general config documentation tidy 2025-06-05 11:47:42 +02:00
FalsePattern 0b1a0b27ba move notice to top of the config 2025-06-05 11:47:42 +02:00
FalsePattern a0c174f2e1 move biome conflict avoidance to config option 2025-06-05 11:47:42 +02:00
FalsePattern be11ebc4ef Improved UBC fork compat
#241
2025-06-05 11:47:42 +02:00
FalsePattern a2946967d4 update crash url 2025-06-05 11:47:39 +02:00
FalsePattern 06583bdc3c update github issue templates 2025-06-05 11:46:41 +02:00
FalsePattern d5f02a9d3c move logo to mod 2025-06-05 11:40:22 +02:00
FalsePattern b94ae7f3e3 update license date 2025-06-05 11:35:10 +02:00
FalsePattern 5e76dea7ec update gitignore 2025-06-05 11:31:22 +02:00
FalsePattern 9a8a38a4a5 Extended Planets compat
#234
2025-06-04 12:53:43 +02:00
FalsePattern 3af6751f3c improved pattern matcher for biome super patcher 2025-06-04 12:52:06 +02:00
FalsePattern 35b658a29b Factorization compat
#235 #170
2025-06-04 12:01:49 +02:00
FalsePattern 28352b8c17 The Mists of RioV compat
#238
2025-06-04 11:55:45 +02:00
FalsePattern 267d1c4170 make potion ID extension safer but a bit more wasteful
#239
2025-06-04 11:38:09 +02:00
FalsePattern 4fdd2cbcaf fix hbm ntm compat typo
#240
2025-06-04 10:48:55 +02:00
FalsePattern 27b21e8de7 fix compat with a weird UndergroundBiomes fork
#241
2025-06-04 10:43:26 +02:00
FalsePattern d01ede5147 switch to gradle plugin portal fpgradle release 2025-06-01 17:23:48 +02:00
FalsePattern 9dc46e54f3 better ars magica 2 compat fix 2025-05-02 16:27:50 +02:00
FalsePattern a61359086b fix compat with Ars Magica 2 2025-04-14 20:50:07 +02:00
FalsePattern ee8a836413 remove obsolete NTM compat code 2024-12-25 23:17:00 +01:00
FalsePattern 3b53b9fcef update buildscript and gradle 2024-12-25 23:00:36 +01:00
FalsePattern 70fc4dcf8c update deps, categorize maintained/unmaintained mods 2024-12-25 22:55:38 +01:00
FalsePattern e8e77766c4 fixed crash with HBM NTM nukes 2024-12-23 15:37:52 +01:00
FalsePattern 4d221c864b bump gradle and buildscript 2024-12-09 19:13:38 +01:00
FalsePattern 55dbe6f4b9 update to chunkapi 0.6 2024-12-09 19:12:56 +01:00
FalsePattern 1ea745c8a4 eid$ prefix for SubChunkBlockHook 2024-12-09 19:05:00 +01:00
FalsePattern 85c7e8ad25 update buildscript 2024-11-14 21:25:53 +01:00
FalsePattern a9e8554f18 lmao how did i manage to mess this up 2024-11-14 21:22:04 +01:00
FalsePattern 27ca556182 thaumcraft potion ID extension (#208) 2024-10-10 09:37:06 +02:00
FalsePattern 2c96f817d7 update buildscript 2024-10-10 09:36:17 +02:00
FalsePattern 95c380a5b1 and another 2024-09-20 15:41:32 +02:00
FalsePattern ed7507a58e another RTG crash fix 2024-09-13 21:59:18 +02:00
FalsePattern c31e218197 RTG crash fix
(hopefully) resolves #185 and #189
2024-09-13 16:36:48 +02:00
FalsePattern 5ad71c29c2 bump fplib version 2024-09-13 16:35:10 +02:00
FalsePattern 684d419465 update gradle 2024-09-13 16:34:33 +02:00
FalsePattern c7067c7d72 update buildscript 2024-09-13 16:32:35 +02:00
FalsePattern f57bd9c353 pinhole mixin linter fixes 2024-08-06 23:47:01 +02:00
FalsePattern 38caffb85d Climate Control compat (#185 , #189) 2024-08-06 23:46:32 +02:00
FalsePattern 6a10291318 update buildscript 2024-08-06 22:34:34 +02:00
FalsePattern c7b7e36e10 possible fix for hodgepodge datawatcher compat 2024-07-20 16:22:38 +02:00
FalsePattern 51023c0e6c HBM NTM radiation system compat (#188) 2024-07-20 16:19:38 +02:00
FalsePattern 724508e1b0 update to fplib 1.4.0 mixins 2024-07-20 15:56:40 +02:00
FalsePattern 76f5ed7b8f Merge remote-tracking branch 'Darek505/master' 2024-07-20 15:54:00 +02:00
FalsePattern 76e4c68669 fix mixin warnings 2024-07-20 14:37:10 +02:00
FalsePattern 25ddb78268 update buildscript 2024-07-20 14:37:01 +02:00
kotmatross28729 804ad7570e oops 2024-07-19 15:08:22 +03:00
kotmatross28729 371277a2a8 Matter Megadrive compat 2024-07-19 15:04:32 +03:00
FalsePattern c8f9403478 update license and add header to every source file 2024-07-04 02:50:52 +02:00
FalsePattern 7d2344b63d switch to modern buildscript 2024-07-04 02:48:13 +02:00
FalsePattern 2acbb60547 ThutCore/ThutMods compat (#175) 2024-06-09 21:21:48 +02:00
FalsePattern 098254dc82 Nostalgic World Generation / OWG compat (#158, #176) 2024-06-09 21:11:17 +02:00
FalsePattern 0f810afe90 notice to self 2024-06-09 20:52:12 +02:00
FalsePattern fa66c21a8a Matter Overdrive compat 2024-06-09 18:46:56 +02:00
FalsePattern 2b90b7688b better item ID saving in nbt 2024-06-09 18:43:25 +02:00
FalsePattern ca5f27dffc make emergency crash method unique 2024-06-09 13:32:43 +02:00
FalsePattern 6eeafe5a23 null safety in datawatcher 2024-06-08 00:24:52 +02:00
FalsePattern 22d269eda5 small tidy 2024-06-07 20:02:43 +02:00
FalsePattern 87ff6bc0ab add info about NEID Unofficial 2024-06-07 19:56:58 +02:00
FalsePattern 0a74b2494b clean up comparison table 2024-06-07 19:56:58 +02:00
FalsePattern a58bb1e202 proper DataWatcher fix 2024-06-07 19:56:58 +02:00
FalsePattern 8c77bf1110 fix xlint warnings 2024-06-07 19:56:58 +02:00
FalsePattern 35bd58a9d0 fix mixin warnings 2024-06-07 19:56:58 +02:00
FalsePattern 07474f33f9 modernize ASM 2024-06-07 19:56:58 +02:00
FalsePattern a4868e8de8 declare incompatibilities 2024-06-07 19:56:58 +02:00
FalsePattern 19f11ee62e tiny asm fixes 2024-06-07 19:56:57 +02:00
FalsePattern c8de7349dc Attempt to fix LOTR mod compat again 2024-06-07 19:56:57 +02:00
FalsePattern 410d344b84 misc cleanup 2024-06-07 19:56:57 +02:00
FalsePattern f8e024f1bb port over the block tool fixes 2024-06-07 19:56:55 +02:00
FalsePattern 06b033e179 more robust array sizing 2024-06-06 22:05:27 +02:00
FalsePattern a432bdeb04 square logo image 2024-06-05 04:37:51 +02:00
FalsePattern d43e108513 update readme 2024-06-05 04:37:04 +02:00
FalsePattern eeaca66dd5 bump codestyle 2024-06-05 04:36:50 +02:00
Houstonruss 380841b840 Add EID's Logo 2024-06-04 14:35:35 -04:00
FalsePattern 9d37327993 whoops 2024-03-28 19:16:53 +01:00
FalsePattern 9a1b9f7798 stop people from complaining all the time 2024-03-28 19:14:56 +01:00
FalsePattern 3dd168fc8e The Big Rename (ebs, section -> subChunk) 2023-12-28 21:30:10 +01:00
FalsePattern 83bfb89d8b ChunkAPI 0.5 port 2023-12-28 21:30:07 +01:00
FalsePattern 5d5a03486f update fplib and buildscript 2023-12-28 21:29:05 +01:00
FalsePattern 6103fe96bb update copyright year 2023-12-28 21:00:13 +01:00
FalsePattern d3334c7ca8 launchclassloader cleanup 2023-12-28 20:59:05 +01:00
FalsePattern 7fc49578ce chunkapi hotfix 2023-11-15 20:57:42 +01:00
FalsePattern 59862bb5ad better version dependencies 2023-11-15 19:58:55 +01:00
FalsePattern c052edf912 remove entity ID experiments 2023-11-15 19:52:26 +01:00
FalsePattern 79f0c06fa5 update ChunkAPI 2023-11-15 19:52:16 +01:00
FalsePattern 53f3cffb59 [ci skip] Add funding.yml 2023-09-06 16:16:28 +02:00
FalsePattern c1d8e273fc extended entity IDs 2023-09-05 09:59:57 +02:00
FalsePattern 484a9175e7 another dependency update 2023-08-12 15:04:05 +02:00
FalsePattern 1bb71d9448 nicer config printing 2023-08-12 15:04:05 +02:00
FalsePattern 11ff4a4a6a configurable performance tweak 2023-08-12 15:04:05 +02:00
FalsePattern 6b3d872fbd some tweaks 2023-08-12 15:04:04 +02:00
FalsePattern 344b788108 Fixed the registry lag 2023-08-12 15:04:04 +02:00
FalsePattern b61711280b update deps 2023-08-12 15:04:04 +02:00
FalsePattern 67badb8fcb fix dragonapi mixin 2023-07-11 18:08:40 +02:00
FalsePattern e529ad49cb Remove DragonAPI ModList compat hack. Will be fixed upstream. 2023-07-11 18:02:38 +02:00
FalsePattern 10c19feb0c [ci skip] Put dependencies at the top 2023-06-09 17:41:34 +02:00
FalsePattern fb0096350c bump fplib (fixes dev) 2023-05-08 19:17:37 +02:00
FalsePattern 1f726e42d3 update buildscript 2023-05-08 10:43:32 +02:00
FalsePattern 1944aa08f1 damn it 2023-05-08 10:39:37 +02:00
FalsePattern 0dfe4bfc2d update buildscript 2023-05-07 22:54:56 +02:00
FalsePattern fcac948f88 NEID dfu 2023-05-07 22:36:13 +02:00
FalsePattern 04fe960ca4 bump fplib 2023-05-07 22:36:01 +02:00
FalsePattern a1d13d833d cleanup constants but keep some of the informative stuff 2023-04-06 11:44:41 +02:00
FalsePattern 8ae84392ba Fix StatList regression (#114) 2023-04-06 11:42:36 +02:00
FalsePattern 76092e5c4c update buildscript 2023-04-02 14:21:31 +02:00
FalsePattern 0ecadb8563 bump deps 2023-04-02 14:20:38 +02:00
FalsePattern 147099d625 remap fixes 2023-04-02 14:01:31 +02:00
FalsePattern e699d67f4e IR3 compat (#104) 2023-04-02 13:48:06 +02:00
FalsePattern 6101766529 oops, forgot this 2023-04-02 13:22:58 +02:00
FalsePattern 8c715bd579 Restructured compat (#105) 2023-04-02 13:08:27 +02:00
FalsePattern e7340cd9b1 remove LOTR from readme until fixed 2023-04-02 12:54:24 +02:00
FalsePattern 786652504c DimDoors compat (#111) 2023-04-02 12:54:22 +02:00
FalsePattern 4ded45cc5c fix some mixin conflicts (#112) 2023-04-02 12:18:55 +02:00
FalsePattern 16be8d607c [ci skip] update publishing 2023-04-01 11:52:19 +02:00
FalsePattern 775ea5769c bleh 2023-03-31 18:23:56 +02:00
FalsePattern 93e375a07d update readme 2023-03-31 18:23:41 +02:00
FalsePattern a2c0ac2d99 whoops 2023-03-31 18:23:20 +02:00
FalsePattern de5fa2d322 migrate some spaghetti code to ChunkAPI
replaced netcode/saving logic for blocks, metadata, and biomes
2023-03-30 22:50:11 +02:00
FalsePattern 984c976b34 max item id crash fix 2023-03-03 09:38:41 +01:00
FalsePattern 0e58bf113d weaken some checks 2023-03-03 09:10:15 +01:00
FalsePattern 0b968923df reimplemented metadata storage, now it's optimized like IDs 2023-03-03 08:55:08 +01:00
FalsePattern f98d2c98e3 fix broken BC mixin 2023-03-03 07:48:37 +01:00
FalsePattern bf52cfaadf cleanup code 2023-03-02 22:52:41 +01:00
FalsePattern c321707f0e optimize imports 2023-03-02 22:43:12 +01:00
FalsePattern c8e076f6d2 update code style 2023-03-02 22:42:19 +01:00
FalsePattern 6f832f4905 optimized chunk block id memory/network usage 2023-03-02 22:41:36 +01:00
FalsePattern 818f201f30 metadata extension 2023-03-02 10:32:12 +01:00
FalsePattern b09565144f replace description 2023-03-01 22:46:34 +01:00
FalsePattern 6fe932e136 better fix for the circularity 2023-03-01 22:46:24 +01:00
FalsePattern 06c44e3cb8 aaand now you can toggle them 2023-03-01 22:39:53 +01:00
FalsePattern 7c5652879f modularize all the mixins 2023-03-01 21:36:39 +01:00
FalsePattern bbeaad3f3c update buildscript 2023-02-28 20:07:25 +01:00
FalsePattern 268a95414c begin modularization 2023-02-28 20:06:46 +01:00
FalsePattern 80e1f2754f update fplib dep 2023-02-28 20:06:18 +01:00
FalsePattern a30a223b87 extend enchantment IDs 2022-12-29 13:16:23 +01:00
FalsePattern 5bd48c168c update readme 2022-12-29 13:03:52 +01:00
FalsePattern 7381139fdf Merge pull request #81 from FalsePattern/1.4-maintenance
Merge fixes from 1.4 maintenance branch
2022-12-29 13:02:16 +01:00
FalsePattern 3c78543a82 Merge pull request #80 from FalsePattern/potion-dev
Potion ID extension
2022-12-29 13:01:51 +01:00
FalsePattern 83227b76f2 Merge pull request #79 from SirFell/potion-dev
Fix AbstractMethodError caused by Lombok naming getter differently
2022-12-29 12:56:15 +01:00
FalsePattern 8e22c69168 RWG crash fix 2022-12-29 12:53:30 +01:00
Vitaly 078cc110ff Remove Lombok annotation and make a getter manually. 2022-12-29 11:42:59 +02:00
FalsePattern 5c81a620e2 crash fix 2022-12-28 19:49:13 +01:00
FalsePattern 012fa8188c alias fix 2022-12-28 19:12:47 +01:00
FalsePattern 495c70223c the rest of the potion ID fixes 2022-12-28 14:24:09 +01:00
FalsePattern 7e97287004 0-32767 2022-12-28 12:36:04 +01:00
FalsePattern ccb2c62a89 fix vanilla potions being deleted 2022-12-28 12:35:20 +01:00
FalsePattern c65179a4b3 Merge pull request #76 from SirFell/master
Extend PotionIDs Byte -> Short
2022-12-28 12:31:59 +01:00
Vitaly d825ea3c97 Fix automatic padding to comply with codestyle 2022-12-28 13:07:29 +02:00
Vitaly 9d5d87fe81 Extend PotionIDs Byte -> Short 2022-12-28 13:04:19 +02:00
FalsePattern 8a3b75cf14 [ci skip] update publishing 2022-12-27 22:35:58 +01:00
FalsePattern 20d7738cc4 [ci skip] update publishing 2022-12-27 22:34:56 +01:00
FalsePattern 84f2bcfb0c unmodpack the dev instance 2022-12-27 22:22:32 +01:00
FalsePattern 393432e674 update license in jar 2022-12-27 22:21:57 +01:00
FalsePattern 4f1db0cba5 update lombok 2022-12-27 22:16:02 +01:00
FalsePattern be11f4475a GalaxySpace compat 2022-12-27 22:13:25 +01:00
FalsePattern 583a040800 weaken rwg mixin 2022-12-27 21:41:28 +01:00
FalsePattern 3f4a29a391 get rid of these two, already patched by the universal tweaker 2022-12-27 21:22:47 +01:00
FalsePattern 720cad2471 fix buildcraft crash in larger packs 2022-12-27 21:05:45 +01:00
FalsePattern df4caea869 update readme 2022-12-27 18:15:38 +01:00
FalsePattern b754475fb1 spread default abyssalcraft ids 2022-12-27 18:14:40 +01:00
FalsePattern 8e248c94c8 Advanced Rocketry compat (#52) 2022-12-27 18:14:27 +01:00
FalsePattern 3e8187850e RWG compat (#61) 2022-12-27 17:22:22 +01:00
FalsePattern ab4bcda4e2 Biomes O' Plenty startup crash fix (#73) 2022-12-27 17:07:15 +01:00
FalsePattern 2f15b44a85 Nomadic Tents compat (#51) 2022-12-27 16:56:49 +01:00
FalsePattern 692ab60b37 Witchery compat (#46) 2022-12-27 16:44:21 +01:00
FalsePattern e248b60c01 collapse the ID spread a bit 2022-12-27 16:17:33 +01:00
FalsePattern 05410cd423 Enderlicious compat (#48) 2022-12-27 16:16:56 +01:00
FalsePattern 3c6bd584cb Fix DataWatcher crash (#67) 2022-12-27 15:25:38 +01:00
FalsePattern 552568dd60 (UBC) make the logger shut up 2022-12-27 15:09:12 +01:00
FalsePattern 50b30383e4 update buildscript 2022-12-27 15:09:00 +01:00
FalsePattern bf6a4068cd [ci skip] Update license 2022-12-27 14:49:34 +01:00
FalsePattern 7059875c78 [ci skip] update readme 2022-09-20 00:55:34 +02:00
FalsePattern 21ee59dffe [ci skip] update publishing 2022-08-28 21:12:49 +02:00
FalsePattern 7d338264e5 [ci skip] update buildscript 2022-08-27 22:44:54 +02:00
FalsePattern 71ead0785e maven fallback code 2022-08-25 22:35:02 +02:00
FalsePattern 4aca859012 CM breaks CI, make it compileonly 2022-08-25 22:22:02 +02:00
FalsePattern ff0dce66f5 update readme 2022-08-25 22:21:39 +02:00
FalsePattern 9a3126d7f9 Random Things compat (#37) 2022-08-25 22:20:51 +02:00
FalsePattern 7ff89947ea Compact Machines compat (#38) 2022-08-25 21:49:32 +02:00
FalsePattern 39e6b70922 buildcraft compat (#40) 2022-08-25 21:32:18 +02:00
FalsePattern bbe23d663d update buildscript and fplib dep
Temporarily disable archaicfix
2022-08-25 21:10:41 +02:00
FalsePattern 5d3bb1bc77 config fixes 2022-07-24 00:41:12 +02:00
FalsePattern 69d09fc70f Implement ASM blacklist system for problematic classes 2022-07-24 00:30:06 +02:00
FalsePattern 973a178fad more Reika mods compat (fixes #26) 2022-07-23 21:39:29 +02:00
FalsePattern 4233905892 update readme 2022-07-23 20:39:21 +02:00
FalsePattern 890e04d0dc Extra Planets compat (fixes #27) 2022-07-23 20:38:36 +02:00
FalsePattern edba4b6145 add gcplanets 2022-07-23 20:36:36 +02:00
FalsePattern 595779ea21 galacticraft base ID shift 2022-07-23 20:36:19 +02:00
FalsePattern 6c78eb217e config refactoring, configurable IDs for hardcoded mods. 2022-07-23 19:53:05 +02:00
FalsePattern 2f88904515 externalize EB dep 2022-07-23 19:14:35 +02:00
FalsePattern 763aa9889a more ASM tweaks 2022-07-23 18:55:58 +02:00
FalsePattern 7ff1c55036 this is now also autopatched 2022-07-23 18:06:00 +02:00
FalsePattern 822e2688b9 improve the chunk provider patch system further 2022-07-23 18:05:48 +02:00
FalsePattern 4c6b927eb4 tweak dependencies to avoid including them in the maven metadata 2022-07-23 16:34:46 +02:00
FalsePattern c19dee3682 state machine improvements, autopatching galacticraft and derivatives 2022-07-23 16:34:11 +02:00
FalsePattern 2d93a1e080 update galacticraft link, upstream died 2022-07-23 01:30:44 +02:00
FalsePattern 5bddcb0346 Highlands compat (fixes #25) 2022-07-23 01:04:40 +02:00
FalsePattern 8e83ba76d4 reduce archaicfix spam 2022-07-23 01:04:17 +02:00
FalsePattern dd26846984 better biometweaker compat 2022-07-23 01:03:52 +02:00
FalsePattern 2268011f5d dev-only patch for fixing some mods that didn't load in dev before. 2022-07-23 00:49:56 +02:00
FalsePattern 356a980bc7 make MFQM way faster to load 2022-07-23 00:36:58 +02:00
FalsePattern c00c54e686 Enhanced Biomes compat 2022-07-22 23:31:14 +02:00
FalsePattern 1ed846b29e LOTR compat (fixes #24) 2022-07-22 21:02:45 +02:00
FalsePattern 54f216922f ModInfoGenerator back to ASM 2022-07-22 20:09:31 +02:00
FalsePattern 582a83a7a6 fix patch system again 2022-07-22 20:09:08 +02:00
FalsePattern b7d7398c04 varags 2022-07-22 20:01:29 +02:00
FalsePattern 71fb7a86a7 improve custom patching engine a bit 2022-07-22 19:57:30 +02:00
FalsePattern 31189ae9d1 fix ASM load order problems 2022-07-22 19:52:05 +02:00
FalsePattern 34a8ff7833 put explanation in javadoc 2022-07-18 21:49:58 +02:00
FalsePattern e44229300a no more atum mixins; remove it from the mod targeting system 2022-07-18 21:46:30 +02:00
FalsePattern d2cdf2f345 remove obsolete mixins 2022-07-18 21:46:15 +02:00
FalsePattern 6272dd6929 clean up the chunk provider patcher 2022-07-18 21:45:51 +02:00
FalsePattern 9ef1b8fabb when the ASM is global 2022-07-18 20:30:58 +02:00
FalsePattern 4b967882e0 move spacecore patch to mixin 2022-07-18 20:29:52 +02:00
FalsePattern 444cef7482 Biome Tweaker compat 2022-07-15 01:37:23 +02:00
FalsePattern 33af25e6fe fix mixin typo 2022-07-14 23:51:31 +02:00
FalsePattern 95f0d8d62e [ci skip] update readme 2022-07-14 23:42:17 +02:00
FalsePattern 3a271b1930 no longer need these thanks to the scattering 2022-07-14 23:27:59 +02:00
FalsePattern ad330ec622 scatter the default biome IDs a bit, should avoid some more conflicts. 2022-07-14 23:27:24 +02:00
FalsePattern 6892b59e4d more packet logic tweaks. 2022-07-14 23:26:55 +02:00
FalsePattern 0f51273d5b Netherlicious compat (fixes #21) 2022-07-14 22:58:53 +02:00
FalsePattern f1a7c548da futurepack biome ID tweak 2022-07-14 22:30:04 +02:00
FalsePattern 7d40fbef5a Dark World compat (fixes #19) 2022-07-14 22:26:08 +02:00
FalsePattern 5e024d8a0c UBC mixin crash fix (fixes #20) 2022-07-14 22:10:22 +02:00
FalsePattern fb3ac74956 mkdir do not error 2022-07-13 22:08:00 +02:00
FalsePattern 600c28edbb miscellaneous fixes to make stuff *just work* 2022-07-13 22:02:45 +02:00
FalsePattern 86f9e54251 galacticraft fixes 2022-07-13 20:57:20 +02:00
FalsePattern 322e267e48 Futurepack compat (fixes #16) 2022-07-13 20:47:09 +02:00
FalsePattern 3d834429f9 externalize patching logic a bit 2022-07-13 20:42:04 +02:00
FalsePattern 7ccf86928f prioritize upstream sources by default to reduce network load. 2022-07-13 20:15:46 +02:00
FalsePattern b721edafe0 move dependencies to mirror 2022-07-13 20:10:15 +02:00
FalsePattern 642a99ea7b Tropicraft compat (fixes #15) 2022-07-13 20:09:55 +02:00
FalsePattern 1aa130549e twilight forest conflict detector fix 2022-07-13 20:07:09 +02:00
FalsePattern 69a4c18eab AbyssalCraft compat (fixes #14) 2022-07-13 19:34:34 +02:00
FalsePattern 927eee5844 Erebus compat (fixes #13) 2022-07-13 18:26:19 +02:00
FalsePattern 4b90a090f8 Atum compat (fixes #12) 2022-07-13 17:43:30 +02:00
FalsePattern 81ad254832 dependency list cleanup 2022-07-13 17:42:56 +02:00
FalsePattern 4fa9674a0d Biome Wand compat 2022-07-12 19:56:39 +02:00
FalsePattern f4b2460ad7 [ci skip] Oops, that should be LGPL 2022-07-11 21:13:57 +02:00
FalsePattern b3c96056b2 [ci skip] Cleanup github bloat 2022-07-11 21:13:21 +02:00
FalsePattern 24796dab0c fix clients receiving invalid biome ID from server 2022-07-11 20:44:49 +02:00
FalsePattern 3ceaa51119 Extra Utilities compat 2022-07-11 19:55:53 +02:00
FalsePattern eebb1d629e Antique Atlas compat 2022-07-11 01:04:40 +02:00
FalsePattern b1c8d1edb2 twilight forest fix 2022-07-11 00:21:48 +02:00
FalsePattern 4b23b1949c update fplib dep 2022-07-11 00:05:27 +02:00
FalsePattern 0e32ffebae code cleanup 2022-07-11 00:04:59 +02:00
FalsePattern ef52fa6e51 Thaumcraft compat 2022-07-11 00:02:17 +02:00
FalsePattern 42c59a668f twilightforest naming fixes 2022-07-10 23:58:31 +02:00
FalsePattern 9d24a015ff BOP fixes 2022-07-10 23:39:53 +02:00
FalsePattern 3b85cf7db5 chunk provider logic unification 2022-07-10 23:34:52 +02:00
FalsePattern 15803fceff Twilight Forest compat 2022-07-10 23:07:02 +02:00
FalsePattern 4a185892ea clean up some logging 2022-07-10 23:06:24 +02:00
FalsePattern a2d354dd38 more fixes to AIDC 2022-07-04 18:51:07 +02:00
FalsePattern 5c3f35a855 externalize dependencies 2022-07-04 18:48:31 +02:00
FalsePattern 1082b5538f improve AntiIDConflict's code. 2022-07-04 18:37:15 +02:00
FalsePattern 9bb729071b fix a crash without AntiIDConflict.
We don't need this patch without it anyways.
2022-07-04 16:23:45 +02:00
FalsePattern f28d5fbc3e Immersive Cavegen compat 2022-07-03 23:18:52 +02:00
FalsePattern 3c53ecf624 add archaicfix to dev and readme 2022-07-03 23:17:13 +02:00
FalsePattern 0c3e745afa surround my dynamics 2022-07-03 22:35:19 +02:00
FalsePattern d594898485 fix archaicfix 2022-07-03 22:13:48 +02:00
FalsePattern 85689649bd update readme again 2022-07-03 20:15:37 +02:00
FalsePattern 04ddf0c29a update readme 2022-07-03 20:01:26 +02:00
FalsePattern fb6fb88a49 remove BoP testing code 2022-07-03 19:56:38 +02:00
FalsePattern 8e23dd1f07 Nature's Compass compat 2022-07-03 19:56:08 +02:00
FalsePattern 362e1dc9ca AntiIDConflict do not log placeholders 2022-07-03 19:43:23 +02:00
FalsePattern a2774e84ef restyle code 2022-07-03 19:40:42 +02:00
FalsePattern f315774db4 Realistic Terrain Generation compat 2022-07-03 19:39:34 +02:00
FalsePattern 6e66066f65 way more reliable DragonAPI patch 2022-07-03 19:17:16 +02:00
FalsePattern 76a9345665 fix dragonapi again 2022-07-03 02:32:17 +02:00
FalsePattern bf57fac244 fix ATG issue 2022-07-03 02:08:16 +02:00
FalsePattern f2450e0bda update readme 2022-07-03 00:36:57 +02:00
FalsePattern 72a65de83f properly fix dragonapi compat 2022-07-03 00:36:21 +02:00
FalsePattern 254a438ba1 update FPLib 2022-07-03 00:36:02 +02:00
FalsePattern 88174167ae more DragonAPI patches 2022-07-02 21:21:03 +02:00
FalsePattern 31ba27c584 allow some mods to load in runClient 2022-07-02 21:17:55 +02:00
FalsePattern d3dfc3dbc2 MFQM fix 2022-07-02 21:02:36 +02:00
FalsePattern f099ac4bf7 Biomes O' Plenty compat 2022-07-02 20:39:01 +02:00
FalsePattern 9735717af4 fix warnings 2022-07-02 20:23:00 +02:00
FalsePattern 7de5788013 restyle code 2022-07-02 20:21:50 +02:00
FalsePattern 413a113a4c Alternate Terrain Generation compat 2022-07-02 20:02:54 +02:00
FalsePattern a44be1dc1e update the buildscript and fix the deps 2022-07-02 18:40:49 +02:00
FalsePattern 53a9fa8cf7 placeholder biome slot system for mutations and auto-allocation avoidance 2022-07-02 13:40:37 +02:00
FalsePattern 948220dedc have to resort to this instead 2022-07-01 19:26:54 +02:00
FalsePattern d3d6e73f68 update publishing 2022-07-01 19:22:58 +02:00
FalsePattern 4cdc933192 restyle mixins 2022-07-01 19:06:29 +02:00
FalsePattern ba2b4e360a galacticraft compat 2022-07-01 19:00:21 +02:00
FalsePattern e86f0fc29f update project style 2022-07-01 18:59:42 +02:00
FalsePattern cad9285c10 reorganize 2022-07-01 18:59:19 +02:00
FalsePattern 73d7d3459e missed a require check here 2022-07-01 15:03:06 +02:00
FalsePattern d1666b582f Anti ID Conflict mod compatibility patch 2022-07-01 15:02:43 +02:00
FalsePattern 5ec489592a update buildscript again 2022-07-01 14:09:19 +02:00
FalsePattern b820a8af28 deobfuscate dependencies 2022-07-01 11:27:14 +02:00
FalsePattern 4cdbd06fda update buildscript 2022-07-01 10:58:31 +02:00
FalsePattern e3820669f8 upload code style 2022-06-18 23:28:30 +02:00
FalsePattern 42b2968fde BIDE porting... (add new mixins to enum) 2022-06-18 21:19:55 +02:00
FalsePattern 32e88ec680 BIDE porting... (some more worldgen) 2022-06-18 21:14:01 +02:00
FalsePattern b46cd34868 BIDE porting... (chunk and worldgen stuff) 2022-06-18 21:10:42 +02:00
FalsePattern 6bcf0e8bd5 BIDE porting... 2022-06-18 20:50:29 +02:00
FalsePattern e468253906 BIDE porting... 2022-06-17 21:53:59 +02:00
FalsePattern ed3adba5e3 merge constants classes 2022-06-17 14:37:03 +02:00
FalsePattern 2a72daa6cf begin porting over BIDE code (https://github.com/TCLProject/Biome-ID-Extender) 2022-06-16 23:30:47 +02:00
FalsePattern 072ca7bcf8 modernize config 2022-06-15 22:28:46 +02:00
FalsePattern 164ec7b923 typo fix 2022-06-15 22:28:32 +02:00
FalsePattern b92ae7985f fplib update 2022-06-15 22:28:27 +02:00
FalsePattern f15acb23ba update FalsePatternLib dep 2022-06-15 17:41:04 +02:00
FalsePattern 18d1e77e56 update GitHub actions 2022-06-15 17:40:17 +02:00
FalsePattern 2efcbe2e16 update buildscript 2022-06-15 17:39:28 +02:00
FalsePattern d4b2e9f5da Merge pull request #3 from embeddedt/master
Allow countCorrectionBits to be tuned using the mod config
2022-06-15 17:37:48 +02:00
embeddedt e8212e3224 Allow countCorrectionBits to be tuned using the mod config 2022-06-12 17:05:06 -04:00
FalsePattern 066ae631c1 make issues less restrictive 2022-05-22 00:20:59 +02:00
FalsePattern 1d32553b2d github community boilerplate 2022-05-22 00:16:28 +02:00
FalsePattern 2b8bc1c1c1 Update README.MD 2022-05-21 13:05:19 +02:00
FalsePattern 345ec097d7 Update README.MD 2022-05-21 12:41:04 +02:00
FalsePattern 72bfd43b9f Update README.MD 2022-05-21 12:39:44 +02:00
FalsePattern 4f1e4a22cc Remove dangling examplemod license
Project was always LGPLv3+, i forgot this here from the examplemod bootstrap.
2022-04-23 02:40:28 +02:00
281 changed files with 16065 additions and 2853 deletions

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
* text eol=lf
*.[jJ][aA][rR] binary
*.[pP][nN][gG] binary
*.[jJ][pP][gG] binary
*.[jJ][pP][eE][gG] binary
*.[gG][iI][fF] binary
*.[tT][iI][fF] binary
*.[tT][iI][fF][fF] binary
*.[iI][cC][oO] binary
*.[sS][vV][gG] text
*.[eE][pP][sS] binary
*.[xX][cC][fF] binary
*.[kK][aA][rR] binary
*.[mM]4[aA] binary
*.[mM][iI][dD] binary
*.[mM][iI][dD][iI] binary
*.[mM][pP]3 binary
*.[oO][gG][gG] binary
*.[rR][aA] binary
*.7[zZ] binary
*.[gG][zZ] binary
*.[tT][aA][rR] binary
*.[tT][gG][zZ] binary
*.[zZ][iI][pP] binary
*.[tT][cC][nN] binary
*.[sS][oO] binary
*.[dD][lL][lL] binary
*.[dD][yY][lL][iI][bB] binary
*.[pP][sS][dD] binary
*.[tT][tT][fF] binary
*.[oO][tT][fF] binary
*.[pP][aA][tT][cC][hH] -text
*.[bB][aA][tT] text eol=crlf
*.[cC][mM][dD] text eol=crlf
*.[pP][sS]1 text eol=crlf
*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
+2
View File
@@ -0,0 +1,2 @@
patreon: falsepattern
ko_fi: falsepattern
+28
View File
@@ -0,0 +1,28 @@
name: Crash
description: The game has a problem when EndlessIDs is present
title: "[Bug]: "
labels: ["bug"]
assignees:
- falsepattern
body:
- type: input
id: modpack
attributes:
label: Modpack
description: You should include the pack's exact name and version here to make debugging easier.
validations:
required: true
- type: textarea
id: logs
attributes:
label: Game log
description: Attach the fml-client-latest.log file here.
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: Describe how and when you experience this bug.
validations:
required: true
+42
View File
@@ -0,0 +1,42 @@
name: Compatibility Request
description: If you tested EndlessIDs with another mod and it crashes or has weird bugs, you can ask for a compatibility patch through this.
title: "[Compatibility Request]: "
labels: ["compat-request"]
assignees:
- falsepattern
body:
- type: input
id: modname
attributes:
label: Other mod's name
description: The name of the other mod
validations:
required: true
- type: input
id: dist
attributes:
label: Other mod's CurseForge/Modrinth/Homepage
description: Mods on curseforge/modrinth are the easiest to write compat for. A link to the main site where the other mod is hosted is also fine if it's not on these sites. Do not put just a direct download link here.
validations:
required: true
- type: dropdown
id: license
attributes:
label: Other mod's license
description: What license does the other mod have? (Open source mods are easier to write compatibility patches for)
validations:
required: true
- type: textarea
id: logs
attributes:
label: Game log
description: Attach the fml-client-latest.log file here.
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: Describe how and when you experience this problem.
validations:
required: true
-27
View File
@@ -1,27 +0,0 @@
if [[ -d "run/crash-reports" ]]; then
echo "Crash reports detected:"
cat $directory/*
exit 1
fi
if grep --quiet "Fatal errors were detected" server.log; then
echo "Fatal errors detected:"
cat server.log
exit 1
fi
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" server.log; then
echo "Server force stopped:"
cat server.log
exit 1
fi
if grep --quiet 'Done .+ For help, type "help" or "?"' server.log; then
echo "Server didn't finish startup:"
cat server.log
exit 1
fi
echo "No crash reports detected"
exit 0
-10
View File
@@ -1,10 +0,0 @@
if [ ! -z $(git diff --name-only HEAD HEAD~1 | grep build.gradle) ]; then
new_version="$(date +%s)"
sed --in-place "s!^//version:.*!//version: $new_version!g" build.gradle
git add build.gradle
git commit -m "[ci skip] update build script version to $new_version"
git push
echo "Updated buildscript version to $new_version";
else
echo "Ignored buildscript version update: no changes detected"
fi
+9 -37
View File
@@ -1,45 +1,17 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build and test name: Build and test
on: on:
pull_request: pull_request:
branches: [ master, main ] branches:
- master
push: push:
branches: [ master, main ] branches:
- master
jobs: jobs:
build-and-test: build-and-test:
runs-on: ubuntu-latest uses: FalsePattern/fpgradle-workflows/.github/workflows/build-and-test.yml@master
steps: with:
- uses: actions/checkout@v2 timeout: 90
with: workspace: setupCIWorkspace
fetch-depth: 0 client-only: false
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup the workspace
run: ./gradlew setupCIWorkspace
- name: Build the mod
run: ./gradlew build
- name: Run server for 1.5 minutes
run: |
mkdir run
echo "eula=true" > run/eula.txt
timeout 90 ./gradlew runServer | tee --append server.log || true
- name: Test no errors reported during server run
run: |
chmod +x .github/scripts/test-no-error-reports.sh
.github/scripts/test-no-error-reports.sh
+13 -37
View File
@@ -1,45 +1,21 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time name: Release Tags
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Release tagged build
on: on:
push: push:
tags: tags:
- '*' - '*'
permissions:
contents: write
jobs: jobs:
build: release-tags:
runs-on: ubuntu-latest uses: FalsePattern/fpgradle-workflows/.github/workflows/release-tags-2.yml@master
steps: with:
- uses: actions/checkout@v2 workspace: "setupCIWorkspace"
with: secrets:
fetch-depth: 0 MAVEN_DEPLOY_USER: ${{ secrets.MAVEN_DEPLOY_USER }}
MAVEN_DEPLOY_PASSWORD: ${{ secrets.MAVEN_DEPLOY_PASSWORD }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup the workspace
run: ./gradlew setupCIWorkspace
- name: Build the mod
run: ./gradlew build
- name: Release under current tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
prerelease: false
title: "${{ env.RELEASE_VERSION }}"
files: build/libs/*.jar
+147 -12
View File
@@ -1,6 +1,122 @@
# Created by https://www.toptal.com/developers/gitignore/api/java,scala,gradle,kotlin,forgegradle,intellij+all,eclipse,emacs
# Edit at https://www.toptal.com/developers/gitignore?templates=java,scala,gradle,kotlin,forgegradle,intellij+all,eclipse,emacs
### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
.apt_generated_test/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
# Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations:
#.project
### Eclipse Patch ###
# Spring Boot Tooling
.sts4-cache/
### Emacs ###
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
*.rel
# AUCTeX auto folder
/auto/
# cask packages
.cask/
dist/
# Flycheck
flycheck_*.el
# server auth directory
/server/
# projectiles files
.projectile
# directory configuration
.dir-locals.el
# network security
/network-security.data
# Created by https://www.toptal.com/developers/gitignore/api/intellij+all,gradle,forgegradle,java
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij+all,gradle,forgegradle,java
### ForgeGradle ### ### ForgeGradle ###
# Minecraft client/server files # Minecraft client/server files
@@ -40,14 +156,14 @@ run/
# When using Gradle or Maven with auto-import, you should exclude module files, # When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using # since they will be recreated, and may cause churn. Uncomment if using
# auto-import. # auto-import.
.idea/artifacts # .idea/artifacts
.idea/compiler.xml # .idea/compiler.xml
.idea/jarRepositories.xml # .idea/jarRepositories.xml
.idea/modules.xml # .idea/modules.xml
.idea/*.iml # .idea/*.iml
.idea/modules # .idea/modules
*.iml # *.iml
*.ipr # *.ipr
# CMake # CMake
cmake-build-*/ cmake-build-*/
@@ -120,6 +236,23 @@ fabric.properties
hs_err_pid* hs_err_pid*
replay_pid* replay_pid*
### Kotlin ###
# Compiled class file
# Log file
# BlueJ files
# Mobile Tools for Java (J2ME)
# Package Files #
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
### Scala ###
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
### Gradle ### ### Gradle ###
.gradle .gradle
**/build/ **/build/
@@ -143,6 +276,8 @@ gradle-app.setting
# JDT-specific (Eclipse Java Development Tools) # JDT-specific (Eclipse Java Development Tools)
.classpath .classpath
# End of https://www.toptal.com/developers/gitignore/api/intellij+all,gradle,forgegradle,java ### Gradle Patch ###
# Java heap dump
*.hprof
srgmap.cfg # End of https://www.toptal.com/developers/gitignore/api/java,scala,gradle,kotlin,forgegradle,intellij+all,eclipse,emacs
+77
View File
@@ -0,0 +1,77 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="FORMATTER_TAGS_ENABLED" value="true" />
<JavaCodeStyleSettings>
<option name="ANNOTATION_PARAMETER_WRAP" value="2" />
<option name="ALIGN_MULTILINE_ANNOTATION_PARAMETERS" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99999" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="" withSubpackages="true" static="false" module="true" />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
<package name="net.minecraft" withSubpackages="true" static="false" />
<package name="net.minecraftforge" withSubpackages="true" static="false" />
<package name="cpw" withSubpackages="true" static="false" />
<emptyLine />
<package name="javax" withSubpackages="true" static="false" />
<package name="java" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="true" />
</value>
</option>
<option name="JD_ADD_BLANK_AFTER_PARM_COMMENTS" value="true" />
<option name="JD_ADD_BLANK_AFTER_RETURN" value="true" />
</JavaCodeStyleSettings>
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<ScalaCodeStyleSettings>
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
</ScalaCodeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="KEEP_LINE_BREAKS" value="false" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_METHOD_BRACKETS" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="RESOURCE_LIST_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="KEEP_SIMPLE_LAMBDAS_IN_ONE_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="ASSERT_STATEMENT_WRAP" value="1" />
<option name="ASSERT_STATEMENT_COLON_ON_NEXT_LINE" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="PARAMETER_ANNOTATION_WRAP" value="1" />
<option name="VARIABLE_ANNOTATION_WRAP" value="5" />
<option name="ENUM_CONSTANTS_WRAP" value="2" />
<option name="WRAP_ON_TYPING" value="0" />
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>
+5
View File
@@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
+6
View File
@@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="EndlessIDs&#10;&#10;Copyright (C) 2022-2026 FalsePattern, The MEGA Team&#10;All Rights Reserved&#10;&#10;The above copyright notice, this permission notice and the word &quot;MEGA&quot;&#10;shall be included in all copies or substantial portions of the Software.&#10;&#10;This program is free software: you can redistribute it and/or modify&#10;it under the terms of the GNU Lesser General Public License as published by&#10;the Free Software Foundation, only version 3 of the License.&#10;&#10;This program is distributed in the hope that it will be useful,&#10;but WITHOUT ANY WARRANTY; without even the implied warranty of&#10;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#10;GNU Lesser General Public License for more details.&#10;&#10;You should have received a copy of the GNU Lesser General Public License&#10;along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;." />
<option name="myName" value="LGPL" />
</copyright>
</component>
+3
View File
@@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="LGPL" />
</component>
+97 -97
View File
@@ -1,16 +1,16 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
Preamble Preamble
The GNU General Public License is a free, copyleft license for The GNU General Public License is a free, copyleft license for
software and other kinds of works. software and other kinds of works.
The licenses for most software and other practical works are designed The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast, to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free share and change all versions of a program--to make sure it remains free
@@ -19,35 +19,35 @@ GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to any other work released this way by its authors. You can apply it to
your programs, too. your programs, too.
When we speak of free software, we are referring to freedom, not When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things. free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others. you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they or can get the source code. And you must show them these terms so they
know their rights. know their rights.
Developers that use the GNU GPL protect your rights with two steps: Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License (1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it. giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to changed, so that their problems will not be attributed erroneously to
authors of previous versions. authors of previous versions.
Some devices are designed to deny users access to install or run Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic protecting users' freedom to change the software. The systematic
@@ -58,49 +58,49 @@ products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users. of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free. patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and The precise terms and conditions for copying, distribution and
modification follow. modification follow.
TERMS AND CONDITIONS TERMS AND CONDITIONS
0. Definitions. 0. Definitions.
"This License" refers to version 3 of the GNU General Public License. "This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks. works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this "The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations. "recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work. earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based A "covered work" means either the unmodified Program or a work based
on the Program. on the Program.
To "propagate" a work means to do anything with it that, without To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying, computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the distribution (with or without modification), making available to the
public, and in some countries other activities as well. public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying. a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2) feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the tells the user that there is no warranty for the work (except to the
@@ -109,18 +109,18 @@ work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion. menu, a prominent item in the list meets this criterion.
1. Source Code. 1. Source Code.
The "source code" for a work means the preferred form of the work The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source for making modifications to it. "Object code" means any non-source
form of a work. form of a work.
A "Standard Interface" means an interface that either is an official A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that interfaces specified for a particular programming language, one that
is widely used among developers working in that language. is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that Component, and (b) serves only to enable use of the work with that
@@ -131,7 +131,7 @@ implementation is available to the public in source code form. A
(if any) on which the executable work runs, or a compiler used to (if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it. produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's control those activities. However, it does not include the work's
@@ -144,16 +144,16 @@ linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those such as by intimate data communication or control flow between those
subprograms and other parts of the work. subprograms and other parts of the work.
The Corresponding Source need not include anything that users The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding can regenerate automatically from other parts of the Corresponding
Source. Source.
The Corresponding Source for a work in source code form is that The Corresponding Source for a work in source code form is that
same work. same work.
2. Basic Permissions. 2. Basic Permissions.
All rights granted under this License are granted for the term of All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a permission to run the unmodified Program. The output from running a
@@ -161,7 +161,7 @@ covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law. rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you of having them make modifications exclusively for you, or provide you
@@ -172,19 +172,19 @@ for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you. your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10 the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary. makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law. 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or 11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such similar laws prohibiting or restricting circumvention of such
measures. measures.
When you convey a covered work, you waive any legal power to forbid When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or the covered work, and you disclaim any intention to limit operation or
@@ -192,9 +192,9 @@ modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of users, your or third parties' legal rights to forbid circumvention of
technological measures. technological measures.
4. Conveying Verbatim Copies. 4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice; appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any keep intact all notices stating that this License and any
@@ -202,12 +202,12 @@ non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program. recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee. and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions. 5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions: terms of section 4, provided that you also meet all of these conditions:
@@ -232,7 +232,7 @@ terms of section 4, provided that you also meet all of these conditions:
interfaces that do not display Appropriate Legal Notices, your interfaces that do not display Appropriate Legal Notices, your
work need not make them do so. work need not make them do so.
A compilation of a covered work with other separate and independent A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work, works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program, and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an in or on a volume of a storage or distribution medium, is called an
@@ -242,9 +242,9 @@ beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other in an aggregate does not cause this License to apply to the other
parts of the aggregate. parts of the aggregate.
6. Conveying Non-Source Forms. 6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License, machine-readable Corresponding Source under the terms of this License,
in one of these ways: in one of these ways:
@@ -290,11 +290,11 @@ in one of these ways:
Source of the work are being offered to the general public at no Source of the work are being offered to the general public at no
charge under subsection 6d. charge under subsection 6d.
A separable portion of the object code, whose source code is excluded A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be from the Corresponding Source as a System Library, need not be
included in conveying the object code work. included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family, tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product, into a dwelling. In determining whether a product is a consumer product,
@@ -307,7 +307,7 @@ is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product. the only significant mode of use of the product.
"Installation Information" for a User Product means any methods, "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must a modified version of its Corresponding Source. The information must
@@ -315,7 +315,7 @@ suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because code is in no case prevented or interfered with solely because
modification has been made. modification has been made.
If you convey an object code work under this section in, or with, or If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a User Product is transferred to the recipient in perpetuity or for a
@@ -326,7 +326,7 @@ if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has modified object code on the User Product (for example, the work has
been installed in ROM). been installed in ROM).
The requirement to provide Installation Information does not include a The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a the User Product in which it has been modified or installed. Access to a
@@ -334,15 +334,15 @@ network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and adversely affects the operation of the network or violates the rules and
protocols for communication across the network. protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in documented (and with an implementation available to the public in
source code form), and must require no special password or key for source code form), and must require no special password or key for
unpacking, reading or copying. unpacking, reading or copying.
7. Additional Terms. 7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions. License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent be treated as though they were included in this License, to the extent
@@ -351,14 +351,14 @@ apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions. this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work, additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission. for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms: that material) supplement the terms of this License with terms:
@@ -385,7 +385,7 @@ that material) supplement the terms of this License with terms:
any liability that these contractual assumptions directly impose on any liability that these contractual assumptions directly impose on
those licensors and authors. those licensors and authors.
All other non-permissive additional terms are considered "further All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further governed by this License along with a term that is a further
@@ -395,46 +395,46 @@ License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does of that license document, provided that the further restriction does
not survive such relicensing or conveying. not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating additional terms that apply to those files, or a notice indicating
where to find the applicable terms. where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions; form of a separately written license, or stated as exceptions;
the above requirements apply either way. the above requirements apply either way.
8. Termination. 8. Termination.
You may not propagate or modify a covered work except as expressly You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third this License (including any patent licenses granted under the third
paragraph of section 11). paragraph of section 11).
However, if you cease all violation of this License, then your However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a) license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation. prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice. your receipt of the notice.
Termination of your rights under this section does not terminate the Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same reinstated, you do not qualify to receive new licenses for the same
material under section 10. material under section 10.
9. Acceptance Not Required for Having Copies. 9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However, to receive a copy likewise does not require acceptance. However,
@@ -443,14 +443,14 @@ modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so. covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients. 10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License. for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that work results from an entity transaction, each party to that
@@ -460,7 +460,7 @@ give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts. the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation rights granted under this License, and you may not initiate litigation
@@ -468,13 +468,13 @@ rights granted under this License, and you may not initiate litigation
any patent claim is infringed by making, using, selling, offering for any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it. sale, or importing the Program or any portion of it.
11. Patents. 11. Patents.
A "contributor" is a copyright holder who authorizes use under this A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version". work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version, by this License, of making, using, or selling its contributor version,
@@ -484,19 +484,19 @@ purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of patent sublicenses in a manner consistent with the requirements of
this License. this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version. propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to (such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a party means to make such an agreement or commitment not to enforce a
patent against the party. patent against the party.
If you convey a covered work, knowingly relying on a patent license, If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means, publicly available network server or other readily accessible means,
@@ -510,7 +510,7 @@ covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid. country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify receiving the covered work authorizing them to use, propagate, modify
@@ -518,7 +518,7 @@ or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered you grant is automatically extended to all recipients of the covered
work and works based on it. work and works based on it.
A patent license is "discriminatory" if it does not include within A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered specifically granted under this License. You may not convey a covered
@@ -533,13 +533,13 @@ for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement, contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007. or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law. otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom. 12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this covered work so as to satisfy simultaneously your obligations under this
@@ -549,9 +549,9 @@ to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program. License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License. 13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this combined work, and to convey the resulting work. The terms of this
@@ -560,14 +560,14 @@ but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the section 13, concerning interaction through a network will apply to the
combination as such. combination as such.
14. Revised Versions of this License. 14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to be similar in spirit to the present version, but may differ in detail to
address new problems or concerns. address new problems or concerns.
Each version is given a distinguishing version number. If the Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered option of following the terms and conditions either of that numbered
@@ -576,19 +576,19 @@ Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published GNU General Public License, you may choose any version ever published
by the Free Software Foundation. by the Free Software Foundation.
If the Program specifies that a proxy can decide which future If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you public statement of acceptance of a version permanently authorizes you
to choose that version for the Program. to choose that version for the Program.
Later license versions may give you additional or different Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a author or copyright holder as a result of your choosing to follow a
later version. later version.
15. Disclaimer of Warranty. 15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
@@ -597,9 +597,9 @@ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION. ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability. 16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
@@ -609,9 +609,9 @@ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES. SUCH DAMAGES.
17. Interpretation of Sections 15 and 16. 17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms, above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the an absolute waiver of all civil liability in connection with the
@@ -622,11 +622,11 @@ copy of the Program in return for a fee.
How to Apply These Terms to Your New Programs How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms. free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found. the "copyright" line and a pointer to where the full notice is found.
@@ -649,7 +649,7 @@ the "copyright" line and a pointer to where the full notice is found.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode: notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author> <program> Copyright (C) <year> <name of author>
@@ -661,12 +661,12 @@ The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box". might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school, You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary. if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>. <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General the library. If this is what you want to do, use the GNU Lesser General
+63 -63
View File
@@ -1,102 +1,102 @@
GNU LESSER GENERAL PUBLIC LICENSE GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below. License, supplemented by the additional permissions listed below.
0. Additional Definitions. 0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License. General Public License.
"The Library" refers to a covered work governed by this License, "The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below. other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library. by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library. of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked with which the Combined Work was made is also called the "Linked
Version". Version".
The "Minimal Corresponding Source" for a Combined Work means the The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version. based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work. Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL. 1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL. without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions. 2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified facility is invoked), then you may convey a copy of the modified
version: version:
a) under this License, provided that you make a good faith effort to a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy. this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files. 3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following: (ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are Library is used in it and that the Library and its use are
covered by this License. covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license b) Accompany the object code with a copy of the GNU GPL and this license
document. document.
4. Combined Works. 4. Combined Works.
You may convey a Combined Work under terms of your choice that, You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of engineering for debugging such modifications, if you also do each of
the following: the following:
a) Give prominent notice with each copy of the Combined Work that a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are the Library is used in it and that the Library and its use are
covered by this License. covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license b) Accompany the Combined Work with a copy of the GNU GPL and this license
document. document.
c) For a Combined Work that displays copyright notices during c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document. copies of the GNU GPL and this license document.
d) Do one of the following: d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this 0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form License, and the Corresponding Application Code in a form
@@ -113,42 +113,42 @@ d) Do one of the following:
of the Library that is interface-compatible with the Linked of the Library that is interface-compatible with the Linked
Version. Version.
e) Provide Installation Information, but only if you would otherwise e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.) for conveying Corresponding Source.)
5. Combined Libraries. 5. Combined Libraries.
You may place library facilities that are a work based on the You may place library facilities that are a work based on the
Library side by side in a single library together with other library Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your License, and convey such a combined library under terms of your
choice, if you do both of the following: choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities, on the Library, uncombined with any other library facilities,
conveyed under the terms of this License. conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work. accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License. 6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version" of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and applies to it, you have the option of following the terms and
@@ -158,7 +158,7 @@ received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation. General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the permanent authorization for you to choose that version for the
+11 -2
View File
@@ -1,5 +1,6 @@
The code is a rewrite of NotEnoughIDs, created by fewizz and Player, The code is originally based on NotEnoughIDs, created by fewizz and Player,
which was released under the MIT license on CurseForge at https://www.curseforge.com/minecraft/mc-mods/notenoughids which was released under the MIT license on CurseForge at
https://www.curseforge.com/minecraft/mc-mods/notenoughids
Original License text of NotEnoughIDs: Original License text of NotEnoughIDs:
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -19,3 +20,11 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
------------------------------------------------------------------------------
Some patches have been adapted from the GTNH fork of NotEnoughIDs,
its license is as follows:
GTNH modifications Copyright (c) 2021-2022 The GTNH Team
This code is licensed LGPL v3.0 or later. Feel free to use our changes,
just give back any changes you make to the community as well!
+15 -17
View File
@@ -1,21 +1,19 @@
MIT License EndlessIDs
Copyright (c) 2021 Johann Bernhardt Copyright (C) 2022-2026 FalsePattern, The MEGA Team
All Rights Reserved
Permission is hereby granted, free of charge, to any person obtaining a copy The above copyright notice, this permission notice and the word "MEGA"
of this software and associated documentation files (the "Software"), to deal shall be included in all copies or substantial portions of the Software.
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all This program is free software: you can redistribute it and/or modify
copies or substantial portions of the Software. it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, only version 3 of the License.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR This program is distributed in the hope that it will be useful,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, but WITHOUT ANY WARRANTY; without even the implied warranty of
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER GNU Lesser General Public License for more details.
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE You should have received a copy of the GNU Lesser General Public License
SOFTWARE. along with this program. If not, see <https://www.gnu.org/licenses/>.
+131 -16
View File
@@ -1,23 +1,138 @@
EndlessIDs is a modern rewrite of NotEnoughIDs which increases the limit even more, up to the maximum 24 bit unsigned integer value. # EndlessIDs <img src="src/main/resources/endlessids.png" align="right" width=150>
| | Vanilla | NotEnoughIDs | EndlessIDs | <sup>**[CurseForge](https://www.curseforge.com/minecraft/mc-mods/endlessids) | [Modrinth](https://modrinth.com/mod/endlessids)**</sup>
|-----------|---------|--------------|------------|
| Block IDs | 4096 | 32000 | 16777216 | EndlessIDs is the unofficial successor of NotEnoughIDs, with more focus on compatibility, stability, and reaching
| Item IDs | 32000 | 32000 | 16777216 | new limits.
## REQUIRED MODS
- [FalsePatternLib](https://github.com/FalsePattern/FalsePatternLib)
- [UniMixins](https://github.com/LegacyModdingMC/UniMixins)
- [ChunkAPI](https://github.com/FalsePattern/ChunkAPI)
## NotEnoughIDs world compatibility
EndlessIDs can open and upgrade worlds created with NotEnoughIDs without any problems (both the original and the Unofficial version).
If you notice any problems when opening NEID worlds with EndlessIDs, please open an issue!
## Comparison of the known limits
| | Vanilla | NotEnoughIDs | NEID Unofficial | EndlessIDs |
|-----------------|----------------------------------------------------|--------------|-----------------|------------|
| Block IDs | 4,096 | 32,000 | 65,536 | 16,777,216 |
| Block Metadata | 16 | 16 | 65,536 | 65,536 |
| Item IDs | 32,000 | 32,000 | 65,536 | 16,777,216 |
| Biome IDs | 256 | 256 | 256 | 65,536 |
| Entity IDs | 256 | 256 | 256 | 32,768 |
| Potion IDs | 32 | 32 | 32 | 65,536 |
| Enchantment IDs | 256 | 256 | 256 | 32,768 |
| DataWatcher IDs | 32 | 127 (Broken) | 127 (Broken) | 65,536 |
| Dimension IDs | Theoretically unlimited, 4,294,967,295 in practice | Same | Same | Same |
## A note about biomes
Minecraft has a system known as "Biome Mutations", where a biome can have modified versions of itself at (id + 128).
Older versions of EndlessIDs used to have a system for this called the "conflict avoidance system", where it would temporarily
register placeholder biomes at these offsets to avoid conflicts.
This system has been disabled by default as it was causing weird biome registration problems, so if you want to use this
mod, we HIGHLY recommend also installing `AntiIDConflict`.
## Implementing extended metadatas
The block/item ID extension module also extends block metadatas. This allows you to use 16-bit metadata, however, you MUST
avoid the value of `32767`/`0x7FFF`/`0b0111_1111_1111_1111` for blocks that can be picked up as items, because forge treats
metadata `32767` as the OreDictionary wildcard value.
Using this specific metadata value in the world is fine if you convert it into item NBT or similar when the block is broken for pick-up.
## Strict No LLM / No AI Policy
No LLMs for issues.
No LLMs for patches / pull requests.
No LLMs for comments on the bug tracker, including translation.
English is encouraged, but not required. You are welcome to post in your native
language and rely on others to have their own translation tools of choice to
interpret your words.
## Mod compat
This mod also contains patches for the following mods: This mod also contains patches for the following mods:
- [UndergroundBiomesConstructs](https://www.curseforge.com/minecraft/mc-mods/undergroundbiomesconstructs) <details>
- [More Fun Quicksand Mod](https://www.curseforge.com/minecraft/mc-mods/more-fun-quicksand-mod) <summary>Mod list</summary>
- [WorldEdit](https://www.curseforge.com/minecraft/mc-mods/worldedit)
- [CoFH Lib](https://www.curseforge.com/minecraft/mc-mods/cofh-lib)
- [DragonAPI](https://www.curseforge.com/minecraft/mc-mods/dragonapi)
Mods not listed here may or may not work. A good rule of thumb is that the more invasive a mod is, the higher the chance - AbyssalCraft
it's broken without a patch once the IDs exceed 4096 and 32000. - Advanced Rocketry
- Alternate Terrain Generation
- Antique Atlas
- Anti ID Conflict
- ArchaicFix
- Atum
- Biomes O' Plenty
- Biome Wand
- BlockPhysics
- BuildCraft
- ChromatiCraft
- Climate Control
- Compact Machines
- CoFH Lib
- Dark World
- Dimensional Doors
- DragonAPI
- Dynamic Surroundings
- Enderlicious
- Enhanced Biomes
- Erebus
- Extended Planets
- Extra Planets
- Extra Utilities
- Factorization
- FastCraft
- Futurepack
- Gadomancy
- GalactiCraft
- Highlands
- Immersive Cavegen
- Industrial Revolution by Redstone Rebooted
- Just Another Spawner
- Matter Overdrive
- More Fun Quicksand Mod
- Mystcraft
- Nature's Compass
- Netherlicious
- Nomadic Tents
- Nostalgic World Generation
- Old World Gen
- Random Things
- Restructured
- Realistic Terrain Generation
- Realistic World Generation
- Ruins
- Thaumcraft
- The Lord of the Rings Mod: Legacy
- The Mists of RioV
- ThutCore/ThutMods
- Tropicraft
- Twilight Forest
- Underground Biomes Constructs
- Witchery
- WorldEdit
</details>
Mods not listed here may or may not work.
- For item/block IDs:
- A good rule of thumb is that the more invasive a mod is, the higher the chance
it's broken without a patch once the IDs exceed 4096 and 32000.
- For biome IDs:
- If a mod adds a custom world generator, it has a high chance of invoking an old vanilla method in the worldgen code.
To avoid world corruption and broken biomes, this method has been replaced with an instant crash that refers the
user to this GitHub repo.
If you find any crashes or incompatibilities, don't hesitate to open an issue. If you find any crashes or incompatibilities, don't hesitate to open an issue.
## Dependencies
- [FalsePatternLib](https://www.curseforge.com/minecraft/mc-mods/falsepatternlib)
- Either [SpongeMixins](https://www.curseforge.com/minecraft/mc-mods/spongemixins) or [Grimoire](https://www.curseforge.com/minecraft/mc-mods/grimoire-api)
-649
View File
@@ -1,649 +0,0 @@
//version: 1641429628falsepattern12
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Please check https://github.com/FalsePattern/ExampleMod1.7.10/blob/main/build.gradle for updates.
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import java.util.concurrent.TimeUnit
buildscript {
repositories {
maven {
name = "forge"
url = "https://maven.minecraftforge.net"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
name = "Scala CI dependencies"
url = "https://repo1.maven.org/maven2/"
}
maven {
name = "jitpack"
url = "https://jitpack.falsepattern.com/"
}
}
dependencies {
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.6'
}
}
plugins {
id 'idea'
id 'scala'
id("org.ajoberstar.grgit") version("3.1.1")
id("com.github.johnrengelman.shadow") version("4.0.4")
id("com.palantir.git-version") version("0.12.3")
id("maven-publish")
}
apply plugin: 'forge'
def projectJavaVersion = JavaLanguageVersion.of(8)
java {
toolchain {
languageVersion.set(projectJavaVersion)
}
}
idea {
module {
inheritOutputDirs = true
downloadJavadoc = true
downloadSources = true
}
}
if(JavaVersion.current() != JavaVersion.VERSION_1_8) {
throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current())
}
checkPropertyExists("modName")
checkPropertyExists("modId")
checkPropertyExists("modGroup")
checkPropertyExists("autoUpdateBuildScript")
checkPropertyExists("minecraftVersion")
checkPropertyExists("forgeVersion")
checkPropertyExists("replaceGradleTokenInFile")
checkPropertyExists("gradleTokenModId")
checkPropertyExists("gradleTokenModName")
checkPropertyExists("gradleTokenVersion")
checkPropertyExists("gradleTokenGroupName")
checkPropertyExists("apiPackage")
checkPropertyExists("accessTransformersFile")
checkPropertyExists("usesMixins")
checkPropertyExists("mixinPlugin")
checkPropertyExists("mixinsPackage")
checkPropertyExists("coreModClass")
checkPropertyExists("containsMixinsAndOrCoreModOnly")
checkPropertyExists("usesShadowedDependencies")
checkPropertyExists("developmentEnvironmentUserName")
//Properties added in fork
checkPropertyExists("skipBuildScriptUpdateCheck")
checkPropertyExists("repositoryURL")
checkPropertyExists("repositoryName")
checkPropertyExists("mavenGroupId")
checkPropertyExists("mavenArtifactId")
checkPropertyExists("hasMixinDeps")
String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/"
String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/")
String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/")
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
}
if(apiPackage) {
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
}
}
if(accessTransformersFile) {
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
if(getFile(targetFile).exists() == false) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
}
}
if(usesMixins.toBoolean()) {
if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) {
throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!")
}
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
if((getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists()) == false) {
throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala)
}
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".scala"
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java"
if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) {
throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava)
}
}
if(coreModClass) {
String targetFileJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
String targetFileScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".scala"
String targetFileScalaJava = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java"
if((getFile(targetFileJava).exists() || getFile(targetFileScala).exists() || getFile(targetFileScalaJava).exists()) == false) {
throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFileJava + " or " + targetFileScala + " or " + targetFileScalaJava)
}
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
// Make sure GregTech build won't time out
System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String)
System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String)
}
// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version
'git config core.fileMode false'.execute()
// Pulls version from git tag
try {
version = gitVersion()
}
catch (Exception e) {
throw new IllegalStateException("This mod must be version controlled by Git AND the repository must provide at least one tag!");
}
group = modGroup
if(project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
archivesBaseName = customArchiveBaseName
}
else {
archivesBaseName = modId
}
archivesBaseName += "-mc" + minecraftVersion
minecraft {
version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion
runDir = "run"
if (replaceGradleTokenInFile) {
replaceIn replaceGradleTokenInFile
if(gradleTokenModId) {
replace gradleTokenModId, modId
}
if(gradleTokenModName) {
replace gradleTokenModName, modName
}
if(gradleTokenVersion) {
replace gradleTokenVersion, versionDetails().lastTag
}
if(gradleTokenGroupName) {
replace gradleTokenGroupName, modGroup
}
}
}
if(file("addon.gradle").exists()) {
apply from: "addon.gradle"
}
apply from: 'repositories.gradle'
configurations {
implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored
implementation.extendsFrom(shadowCompile)
implementation.extendsFrom(shadeCompile)
}
repositories {
maven {
name = "Overmind forge repo mirror"
url = "https://gregtech.overminddl1.com/"
}
if(usesMixins.toBoolean() || hasMixinDeps.toBoolean()) {
maven {
name = "sponge"
url = "https://sponge.falsepattern.com/"
}
maven {
url = "https://jitpack.falsepattern.com/"
}
}
}
dependencies {
if(usesMixins.toBoolean()) {
annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3")
annotationProcessor("com.google.guava:guava:24.1.1-jre")
annotationProcessor("com.google.code.gson:gson:2.8.6")
annotationProcessor("org.spongepowered:mixin:0.8-SNAPSHOT")
// using 0.8 to workaround a issue in 0.7 which fails mixin application
compile("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
// Mixin includes a lot of dependencies that are too up-to-date
exclude module: "launchwrapper"
exclude module: "guava"
exclude module: "gson"
exclude module: "commons-io"
exclude module: "log4j-core"
}
compile("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev")
}
if(hasMixinDeps.toBoolean()) {
runtime("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
// Mixin includes a lot of dependencies that are too up-to-date
exclude module: "launchwrapper"
exclude module: "guava"
exclude module: "gson"
exclude module: "commons-io"
exclude module: "log4j-core"
}
runtime("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev")
}
}
apply from: 'dependencies.gradle'
def mixingConfigRefMap = "mixins." + modId + ".refmap.json"
def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap
def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg"
task generateAssets {
if(usesMixins.toBoolean()) {
getFile("/src/main/resources/mixins." + modId + ".json").text = """{
"required": true,
"minVersion": "0.7.11",
"package": "${modGroup}.${mixinsPackage}",
"plugin": "${modGroup}.${mixinPlugin}",
"refmap": "${mixingConfigRefMap}",
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8"
}
"""
}
}
task relocateShadowJar(type: ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = modGroup + ".shadow"
}
shadowJar {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
manifest {
attributes(getManifestAttributes())
}
minimize() // This will only allow shading for actually used classes
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
dependsOn(relocateShadowJar)
}
jar {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
manifest {
attributes(getManifestAttributes())
}
if(usesShadowedDependencies.toBoolean()) {
dependsOn(shadowJar)
enabled = false
}
}
reobf {
if(usesMixins.toBoolean()) {
addExtraSrgFile mixinSrg
}
}
afterEvaluate {
if(usesMixins.toBoolean()) {
tasks.compileJava {
options.compilerArgs += [
"-AreobfSrgFile=${tasks.reobf.srg}",
"-AoutSrgFile=${mixinSrg}",
"-AoutRefMapFile=${refMap}",
// Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
"-XDenableSunApiLintControl",
"-XDignore.symbol.file"
]
}
}
}
runClient {
def arguments = []
def jvmArguments = []
if (usesMixins.toBoolean()) {
arguments += [
"--mods=../build/libs/$archivesBaseName-${version}.jar"
]
}
if(usesMixins.toBoolean() || hasMixinDeps.toBoolean()) {
arguments += [
"--tweakClass", "org.spongepowered.asm.launch.MixinTweaker"
]
jvmArguments += [
"-Dmixin.debug=true", "-Dmixin.debug.countInjections=true", "-Dmixin.debug.verbose=true", "-Dmixin.debug.export=true"
]
}
if(developmentEnvironmentUserName) {
arguments += [
"--username",
developmentEnvironmentUserName
]
}
args(arguments)
jvmArgs(jvmArguments)
}
runServer {
def arguments = []
def jvmArguments = []
if (usesMixins.toBoolean()) {
arguments += [
"--mods=../build/libs/$archivesBaseName-${version}.jar"
]
}
if (usesMixins.toBoolean() || hasMixinDeps.toBoolean()) {
arguments += [
"--tweakClass", "org.spongepowered.asm.launch.MixinTweaker"
]
jvmArguments += [
"-Dmixin.debug=true", "-Dmixin.debug.countInjections=true", "-Dmixin.debug.verbose=true", "-Dmixin.debug.export=true"
]
}
args(arguments)
jvmArgs(jvmArguments)
}
tasks.withType(JavaExec).configureEach {
javaLauncher.set(
javaToolchains.launcherFor {
languageVersion = projectJavaVersion
}
)
}
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand "minecraftVersion": project.minecraft.version,
"modVersion": versionDetails().lastTag,
"modId": modId,
"modName": modName
}
if(usesMixins.toBoolean()) {
from refMap
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
def getManifestAttributes() {
def manifestAttributes = [:]
if(containsMixinsAndOrCoreModOnly.toBoolean() == false && (usesMixins.toBoolean() || coreModClass)) {
manifestAttributes += ["FMLCorePluginContainsFMLMod": true]
}
if(accessTransformersFile) {
manifestAttributes += ["FMLAT" : accessTransformersFile.toString()]
}
if(coreModClass) {
manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass]
}
if(usesMixins.toBoolean()) {
manifestAttributes += [
"TweakClass" : "org.spongepowered.asm.launch.MixinTweaker",
"MixinConfigs" : "mixins." + modId + ".json",
"ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false
]
}
return manifestAttributes
}
task sourcesJar(type: Jar) {
from (sourceSets.main.allJava)
from (file("$projectDir/LICENSE"))
getArchiveClassifier().set('sources')
}
task shadowDevJar(type: ShadowJar) {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
from sourceSets.main.output
getArchiveClassifier().set("dev")
manifest {
attributes(getManifestAttributes())
}
minimize() // This will only allow shading for actually used classes
configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
}
task relocateShadowDevJar(type: ConfigureShadowRelocation) {
target = tasks.shadowDevJar
prefix = modGroup + ".shadow"
}
task circularResolverJar(type: Jar) {
dependsOn(relocateShadowDevJar)
dependsOn(shadowDevJar)
enabled = false
}
task devJar(type: Jar) {
project.configurations.shadeCompile.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
from sourceSets.main.output
getArchiveClassifier().set("dev")
manifest {
attributes(getManifestAttributes())
}
if(usesShadowedDependencies.toBoolean()) {
dependsOn(circularResolverJar)
enabled = false
}
}
task apiJar(type: Jar) {
from (sourceSets.main.allJava) {
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
}
from (sourceSets.main.output) {
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
}
from (sourceSets.main.resources.srcDirs) {
include("LICENSE")
}
getArchiveClassifier().set('api')
}
artifacts {
archives sourcesJar
archives devJar
if(apiPackage) {
archives apiJar
}
}
// publishing
def getMavenSettingsCredentials = {
String userHome = System.getProperty( "user.home" );
File mavenSettings = new File(userHome, ".m2/settings.xml")
def xmlSlurper = new XmlSlurper()
def output = xmlSlurper.parse(mavenSettings)
return output."servers"."server"
}
def getCredentials = {
try {
def entries = getMavenSettingsCredentials()
for (entry in entries) {
if (entry."id".text() == repositoryName) {
return [username: entry.username.text(), password: entry.password.text()]
}
}
} catch (Exception ignored) {
return [username: "none", password: "none"]
}
}
//Publishing
publishing {
publications {
maven(MavenPublication) {
artifact source: jar
artifact source: sourcesJar, classifier: "src"
artifact source: devJar, classifier: "dev"
if (apiPackage) {
artifact source: apiJar, classifier: "api"
}
groupId = mavenGroupId
artifactId = mavenArtifactId + "-mc" + minecraftVersion
version = gitVersion()
}
}
repositories {
maven {
name = repositoryName
url = repositoryURL
def creds = getCredentials()
credentials {
username = creds == null ? "none" : creds.username
password = creds == null ? "none" : creds.password
}
}
}
}
// Updating
task updateBuildScript {
doLast {
if (performBuildScriptUpdate(projectDir.toString())) return
print("Build script already up-to-date!")
}
}
if (!skipBuildScriptUpdateCheck.toBoolean() && isNewBuildScriptVersionAvailable(projectDir.toString())) {
if (autoUpdateBuildScript.toBoolean()) {
performBuildScriptUpdate(projectDir.toString())
} else {
println("Build script update available! Run 'gradle updateBuildScript'")
}
}
static URL availableBuildScriptUrl() {
new URL("https://raw.githubusercontent.com/FalsePattern/ExampleMod1.7.10/main/build.gradle")
}
boolean performBuildScriptUpdate(String projectDir) {
if (isNewBuildScriptVersionAvailable(projectDir)) {
def buildscriptFile = getFile("build.gradle")
availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } }
print("Build script updated. Please REIMPORT the project or RESTART your IDE!")
return true
}
return false
}
boolean isNewBuildScriptVersionAvailable(String projectDir) {
Map parameters = ["connectTimeout": 2000, "readTimeout": 2000]
String currentBuildScript = getFile("build.gradle").getText()
String currentBuildScriptHash = getVersionHash(currentBuildScript)
String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText()
String availableBuildScriptHash = getVersionHash(availableBuildScript)
boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash
return !isUpToDate
}
static String getVersionHash(String buildScriptContent) {
String versionLine = buildScriptContent.find("^//version: [a-z0-9]*")
if(versionLine != null) {
return versionLine.split(": ").last()
}
return ""
}
configure(updateBuildScript) {
group = 'forgegradle'
description = 'Updates the build script to the latest version'
}
// Helper methods
def checkPropertyExists(String propertyName) {
if (project.hasProperty(propertyName) == false) {
throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/FalsePattern/ExampleMod1.7.10/blob/main/gradle.properties")
}
}
def getFile(String relativePath) {
return new File(projectDir, relativePath)
}
+268
View File
@@ -0,0 +1,268 @@
plugins {
id("com.falsepattern.fpgradle-mc") version "4.1.0"
}
group = "com.falsepattern"
minecraft_fp {
mod {
modid = "endlessids"
name = "EndlessIDs"
rootPkg = "$group.endlessids"
}
mixin {
pkg = "mixin.mixins"
}
core {
coreModClass = "asm.EndlessIDsCore"
accessTransformerFile = "endlessids_at.cfg"
}
tokens {
tokenClass = "Tags"
modid = "MODID"
name = "MODNAME"
version = "VERSION"
rootPkg = "GROUPNAME"
}
publish {
changelog = "https://github.com/GTMEGA/EndlessIDs/releases/tag/$version"
maven {
repoUrl = "https://mvn.falsepattern.com/releases/"
repoName = "mavenpattern"
}
curseforge {
projectId = "665730"
side = Both
dependencies {
required("fplib")
required("chunkapi")
incompatible("notenoughids-unofficial-1-7-10")
incompatible("notenoughids")
}
}
modrinth {
projectId = "qGHY4QGo"
dependencies {
required("fplib")
required("chunkapi")
incompatible("notenoughids-unofficial")
}
}
}
}
repositories {
cursemavenEX()
modrinthEX()
exclusive(mavenpattern(), "com.falsepattern")
exclusive(ivy("mavenpattern_mirror", "https://mvn.falsepattern.com/releases/mirror/", "[orgPath]/[artifact]-[revision].[ext]"), "mirror", "mirror.micdoodle")
exclusive(ivy("github", "https://github.com/", "[orgPath]/releases/download/[revision]/[artifact]-[revision].[ext]"), "CannibalVox.DimDoors")
}
dependencies {
// region Our deps
implementationSplit("com.falsepattern:falsepatternlib-mc1.7.10:1.12.2")
compileOnly("it.unimi.dsi:fastutil:8.5.18")
implementationSplit("com.falsepattern:chunkapi-mc1.7.10:0.8.3")
// endregion
// region maintained mods
//DragonAPI V33b
compileOnly(deobfCurse("dragonapi-235591:4722480"))
//Immersive Cavegen 1.2g hotfix5
compileOnly(deobfCurse("immersivecavegen-521557:4723376"))
//Hbm's Nuclear Tech Mod 1.0.27X5188
compileOnly(deobfCurse("hbm-ntm-235439:6017897"))
//Salis Arcana 2.3.0
compileOnly(deobfCurse("salis-arcana-1162488:7016994"))
// endregion
// region unmaintained mods
//AbyssalCraft 1.9.1.3-FINAL
compileOnly(deobfCurse("abyssalcraft-53686:2311135"))
//Advanced Rocketry 1.4.0-32
compileOnly(deobfCurse("advancedrocketry-236542:2985057"))
//Alternate Terrain Generation 0.12.0
compileOnly(deobfCurse("atg-228356:2231155"))
//Antique Atlas 4.4.4
compileOnly(deobfCurse("antiqueatlas-227795:2454232"))
//Anti ID Conflict 1.3.5
compileOnly(deobfCurse("antiidconflict-246288:2308279"))
//Atum 0.6.77
compileOnly(deobfCurse("atum-59621:2256356"))
//Biomes O' Plenty 2.1.0.2308
compileOnly(deobfCurse("biomesoplenty-220318:2499612"))
//Biome Tweaker 2.0.182
compileOnly(deobfCurse("biometweaker-228895:2279911"))
//Biome Wand 1.1.9
//Source: https://spacechase0.com/wp-content/uploads/2014/10/1.7.10-Biome-Wand-1.1.9.jar
compileOnly(deobf("mirror:1.7.10-Biome-Wand:1.1.9"))
//Block Physics 0.9.5
compileOnly(deobfCurse("blockphysics-229921:2259034"))
//Buildcraft 7.1.24
compileOnly(deobfCurse("buildcraft-61811:3538651"))
//Climate Control 0.8.2
compileOnly(deobfCurse("climatecontrol-76544:2359685"))
//CoFH Lib 1.2.1-185
compileOnly(deobfCurse("cofh-lib-220333:2388748"))
//CompactMachines 1.21
compileOnly(deobfCurse("compactmachines-224218:2268575"))
//Dark World 0.2
compileOnly(deobfCurse("darkworld-225075:2225172"))
//DimDoors 2.2.5-test9
//Source: https://github.com/CannibalVox/DimDoors/releases/download/2.2.5-test9/DimensionalDoors-2.2.5-test9.jar
compileOnly(deobf("CannibalVox.DimDoors:DimensionalDoors:2.2.5-test9"))
//Dynamic Surroundings 1.0.6.4
compileOnly(deobfCurse("dynamicsurrounding-238891:2642381"))
//Enderlicious 1.1.2
compileOnly(deobfCurse("enderlicious-508777:3504111"))
//Enhanced Biomes 2.5
compileOnly(deobf("mirror:enhancedbiomes:2.5"))
//Erebus 0.4.7
compileOnly(deobfCurse("theerebus-220698:2305035"))
//Extended Planets 0.4.2
//Source: https://www.mcmod.cn/class/1301.html
compileOnly(deobf("mirror:ExtendedPlanets:0.4.2"))
//Extra Planets 2.1.4
compileOnly(deobfCurse("extraplanets-241291:3214413"))
//Extra Utilities 1.2.12
compileOnly(deobfCurse("extrautilities-225561:2264384"))
//Factorization 0.8.109
compileOnly(deobfModrinth("factorization:0.8.109"))
//Fastcraft 1.23
compileOnly("curse.maven:fastcraft-242677:2292386")
//Futurepack v18.7
compileOnly(deobfCurse("futurepack-237333:2263966"))
//Gadomancy 1.0.7.3
compileOnly(deobfCurse("gadomancy-237271:2338768"))
//Galacticraft Core 3.0.12.504
//micdoodle8.com went down
compileOnly(deobf("mirror.micdoodle:GalacticraftCore:1.7-3.0.12.504"))
//Galacticraft Planets 3.0.12.504
compileOnly(deobf("mirror.micdoodle:Galacticraft-Planets:1.7-3.0.12.504"))
//Highlands 2.2.3
compileOnly(deobfCurse("highlands-221226:2227924"))
//Industrial Revolution by Redstone Rebooted 1.1.1
compileOnly(deobfCurse("industrialrevolutionbyredstonerebooted-241812:2538035"))
//Just Another Spawner 0.17.9
compileOnly(deobfCurse("justanotherspawner-228952:2380961"))
//LOTR Mod 36.15
compileOnly(deobfCurse("lotrmod-423748:4091561"))
//Matter Overdrive 0.4.2-hotfix1
compileOnly(deobfCurse("matteroverdrive-229694:2331162"))
//More Fun Quicksands Mod 1.0.8.8-fixed
compileOnly(deobfCurse("more-fun-quicksand-mod-321960:2717318"))
//Mystcraft 0.12.3.04
compileOnly(deobfCurse("mystcraft-224599:2417042"))
//Nature's Compass 1.3.1
compileOnly(deobfCurse("naturescompass-252848:2451823"))
//Netherlicious 3.2.8
compileOnly(deobfCurse("netherlicious-385860:4363437"))
//Nomadic Tents 1.12.1
compileOnly(deobfCurse("nomadictents-238794:2679476"))
//Nostalgic World Generation 1.0.0
compileOnly(deobfCurse("nostalgiagenerator-927053:4816167"))
//Personal Space 1.0.33
compileOnly(deobfCurse("PersonalSpace-819596:6536785"))
//RandomThings 2.2.4
compileOnly(deobfCurse("randomthings-59816:2225310"))
//Realistic Terrain Generation 1.1.1.7
compileOnly(deobfCurse("rtg-237989:2521557"))
//Restructured 1.0.4.2
compileOnly(deobfCurse("restructured-230570:2276784"))
//Ruins (AtomicStryker) 15.4 nbtfix
compileOnly(deobf("mirror:Ruins:1.7.10"))
//TARDIS Mod 0.995
compileOnly(deobfCurse("tardismod-230170:2305503"))
//Thaumcraft 4.2.3.5
compileOnly(deobfCurse("thaumcraft-223628:2227552"))
//The Mists of RioV 2.5.2
compileOnly(deobfCurse("the-mists-of-riov-222477:2389797"))
//ThutCore 2.0
//Only available on dropbox
compileOnly(deobf("mirror:thutcore:2.0"))
//Tropicraft 6.0.5
//This is from a mirror file, because the file on curseforge is a zip containing other files too.
//Source: https://www.curseforge.com/minecraft/mc-mods/tropicraft/files/2353906
compileOnly(deobf("mirror:tropicraft:6.0.5"))
//Twilight Forest 2.3.8
compileOnly(deobfCurse("twilightforest-227639:3039937"))
//Underground Biomes Constructs 0.8-beta49
compileOnly(deobfCurse("undergroundbiomesconstructs-72744:2304497"))
//Witchery 0.24.1
compileOnly(deobfCurse("witchery-69673:2234410"))
//WorldEdit 6.1.1
compileOnly(deobfCurse("worldedit-225608:2309699"))
// endregion
////////////////Dependencies for patched mods////////////////
//SpaceCore 0.7.14
//needed by: Biome Wand
//Source: http://spacechase0.com/files/mcmod/1.7.10-SpaceCore-0.7.14.jar
compileOnly(deobf("mirror:1.7.10-SpaceCore:0.7.14"))
}
-28
View File
@@ -1,28 +0,0 @@
dependencies {
compileOnly("org.projectlombok:lombok:1.18.22") {
transitive = false
}
annotationProcessor("org.projectlombok:lombok:1.18.22")
compile("com.falsepattern:falsepatternlib-mc1.7.10:0.5.0:dev")
compileOnly("curse.maven:undergroundbiomesconstructs-72744:2304497") {
transitive = false
}
compileOnly("curse.maven:more-fun-quicksand-mod-321960:2717318") {
transitive = false
}
compileOnly("curse.maven:worldedit-225608:2309699") {
transitive = false
}
compileOnly("curse.maven:cofh-lib-220333:2388747") {
transitive = false
}
compileOnly("curse.maven:dragonapi-235591:3574508") {
transitive = false
}
}
+2 -85
View File
@@ -1,85 +1,2 @@
modName = EndlessIDs org.gradle.configuration-cache=true
org.gradle.caching=true
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
modId = endlessids
modGroup = com.falsepattern.endlessids
# WHY is there no version field?
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
#
# Publishing settings
#
# The server to upload the artifacts to
repositoryURL = https://maven.falsepattern.com
# What name is the login information inside ~/.m2/settings.xml stored under
# (see https://gist.github.com/FalsePattern/82d93e3cfab01f671cc5f4a95931cfe3 for an example)
repositoryName = mavenpattern
# What the artifact should be called. These will be the "name" of the published package, suffixed with the minecraft version with a -mc prefix (groupid:artifactid-mcminecraftVersion:version:qualifier).
# For instance, the default values this example ships with would turn into com.myname:mymodid-mc1.7.10:version
# The version is determined automatically from the git version.
mavenGroupId = com.falsepattern
mavenArtifactId = endlessids
# Will update your build.gradle automatically whenever an update is available
autoUpdateBuildScript = false
# Disable checking of buildscript updates.
skipBuildScriptUpdateCheck = false
minecraftVersion = 1.7.10
forgeVersion = 10.13.4.1614
# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
developmentEnvironmentUserName = Developer
# Define a source file of your project with:
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...])
# Leave these properties empty to skip individual token replacements
replaceGradleTokenInFile = Tags.java
gradleTokenModId = GRADLETOKEN_MODID
gradleTokenModName = GRADLETOKEN_MODNAME
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenGroupName = GRADLETOKEN_GROUPNAME
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
apiPackage =
# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/
# Example value: mymodid_at.cfg
accessTransformersFile =
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = true
# Enable this if one of the dependencies uses SpongeMixins.
hasMixinDeps = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin = mixin.plugin.MixinPlugin
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage = mixin.mixins
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
coreModClass = IEPlugin
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
usesShadowedDependencies = false
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
# projects. New projects should not use this parameter.
#customArchiveBaseName =
Binary file not shown.
+5 -1
View File
@@ -1,5 +1,9 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
Vendored
+178 -118
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env sh #!/bin/sh
# #
# Copyright 2015 the original author or authors. # Copyright © 2015 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@@ -15,80 +15,114 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
# SPDX-License-Identifier: Apache-2.0
#
############################################################################## ##############################################################################
## #
## Gradle start up script for UN*X # gradlew start up script for POSIX generated by Gradle.
## #
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh gradlew
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
############################################################################## ##############################################################################
# Attempt to set APP_HOME # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
PRG="$0" app_path=$0
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do # Need this for daisy-chained symlinks.
ls=`ls -ld "$PRG"` while
link=`expr "$ls" : '.*-> \(.*\)$'` APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
if expr "$link" : '/.*' > /dev/null; then [ -h "$app_path" ]
PRG="$link" do
else ls=$( ls -ld "$app_path" )
PRG=`dirname "$PRG"`"/$link" link=${ls#*' -> '}
fi case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle" # This is normally unused
APP_BASE_NAME=`basename "$0"` # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD=maximum
warn () { warn () {
echo "$*" echo "$*"
} } >&2
die () { die () {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} } >&2
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "`uname`" in case "$( uname )" in #(
CYGWIN* ) CYGWIN* ) cygwin=true ;; #(
cygwin=true Darwin* ) darwin=true ;; #(
;; MSYS* | MINGW* ) msys=true ;; #(
Darwin* ) NONSTOP* ) nonstop=true ;;
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java" JAVACMD=$JAVA_HOME/jre/sh/java
else else
JAVACMD="$JAVA_HOME/bin/java" JAVACMD=$JAVA_HOME/bin/java
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -97,92 +131,118 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD="java" JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
MAX_FD_LIMIT=`ulimit -H -n` case $MAX_FD in #(
if [ $? -eq 0 ] ; then max*)
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
MAX_FD="$MAX_FD_LIMIT" # shellcheck disable=SC2039,SC3045
fi MAX_FD=$( ulimit -H -n ) ||
ulimit -n $MAX_FD warn "Could not query maximum file descriptor limit"
if [ $? -ne 0 ] ; then esac
warn "Could not set maximum file descriptor limit: $MAX_FD" case $MAX_FD in #(
fi '' | soft) :;; #(
else *)
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
fi # shellcheck disable=SC2039,SC3045
fi ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
# Escape application args # Collect all arguments for the java command, stacking in reverse order:
save () { # * args from the command line
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done # * the main class name
echo " " # * -classpath
} # * -D...appname settings
APP_ARGS=$(save "$@") # * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules # For Cygwin or MSYS, switch paths to Windows format before running java
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong JAVACMD=$( cygpath --unix "$JAVACMD" )
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")" # Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@" exec "$JAVACMD" "$@"
Vendored
+32 -50
View File
@@ -13,22 +13,28 @@
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@rem Gradle startup script for Windows @rem gradlew startup script for Windows
@rem @rem
@rem ########################################################################## @rem ##########################################################################
@rem Set local scope for the variables with windows NT shell @rem Set local scope for the variables, and ensure extensions are enabled
if "%OS%"=="Windows_NT" setlocal setlocal EnableExtensions
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@@ -37,64 +43,40 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if %ERRORLEVEL% equ 0 goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail "%COMSPEC%" /c exit 1
:findJavaFromJavaHome :findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail "%COMSPEC%" /c exit 1
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end @rem Execute gradlew
@rem End local scope for the variables with windows NT shell @rem endlocal doesn't take effect until after the line is parsed and variables are expanded
if "%ERRORLEVEL%"=="0" goto mainEnd @rem which allows us to clear the local environment before executing the java command
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
:fail :exitWithErrorLevel
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of @rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
rem the _cmd.exe /c_ return code! "%COMSPEC%" /c exit %ERRORLEVEL%
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
-15
View File
@@ -1,15 +0,0 @@
// Add any additional repositories for your dependencies here
repositories {
maven {
name = "cursemaven"
url = "https://cursemaven.falsepattern.com/"
content {
includeGroup "curse.maven"
}
}
maven {
name = "mavenpattern"
url = "https://maven.falsepattern.com/"
}
}
+5
View File
@@ -0,0 +1,5 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("1.0.0")
}
rootProject.name = "EndlessIDs"
@@ -1,10 +1,120 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids; package com.falsepattern.endlessids;
import com.falsepattern.chunk.api.DataRegistry;
import com.falsepattern.endlessids.config.GeneralConfig;
import com.falsepattern.endlessids.managers.BiomeManager;
import com.falsepattern.endlessids.managers.BlockIDManager;
import com.falsepattern.endlessids.managers.BlockMetaManager;
import com.falsepattern.endlessids.patching.CommonManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLConstructionEvent;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@Mod(modid = Tags.MODID, @Mod(modid = Tags.MODID,
version = Tags.VERSION, version = Tags.VERSION,
name = Tags.MODNAME, name = Tags.MODNAME,
acceptedMinecraftVersions = "[1.7.10]", acceptedMinecraftVersions = "[1.7.10]",
dependencies = "required-after:falsepatternlib@[0.5.0,);") dependencies = "required-after:chunkapi@[0.8.3,);" +
public class EndlessIDs {} "required-after:falsepatternlib@[1.12.2,);" +
"after:antiidconflict")
public class EndlessIDs {
public static final byte[] ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER = new byte[0];
public static final byte[] FAKE_BIOME_ARRAY_PLACEHOLDER = new byte[256];
public static final Logger LOG = LogManager.getLogger(Tags.MODNAME);
@SidedProxy(clientSide = Tags.GROUPNAME + ".patching.ClientManager",
serverSide = Tags.GROUPNAME + ".patching.ServerManager",
modId = Tags.MODID)
private static CommonManager patchManager;
@Mod.EventHandler
public void construct(FMLConstructionEvent e) {
patchManager.construct();
}
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
LOG.info("---------------------------------------------------------");
LOG.info("Current EndlessIDs configuration:");
logConfig(" Biome Extension", GeneralConfig.extendBiome);
logConfig(" Block/Item Extension", GeneralConfig.extendBlockItem);
if (GeneralConfig.extendBlockItem) {
logConfig(" Extra Item Bits", GeneralConfig.extraItemIDBits);
logConfig(" Extra Block Bits", GeneralConfig.extraBlockIDBits);
}
logConfig(" DataWatcher Extension", GeneralConfig.extendDataWatcher);
logConfig(" Enchantment Extension", GeneralConfig.extendEnchantment);
logConfig(" Potion Extension", GeneralConfig.extendPotion);
logConfig(" Redstone Extension", GeneralConfig.extendRedstone);
if (GeneralConfig.extendRedstone) {
LOG.warn(" (Redstone extension is an experimental and dangerous feature, and should NEVER be used in worlds that you worry about getting corrupted!)");
logConfig(" Max redstone level", GeneralConfig.maxRedstone);
}
logConfig(" Registry performance tweak", GeneralConfig.enableRegistryPerformanceTweak);
if (GeneralConfig.enableRegistryPerformanceTweak) {
LOG.warn(" (This tweak has not gone through proper testing yet, so it might corrupt worlds. USE BACKUPS!)");
}
LOG.info("---------------------------------------------------------");
patchManager.preInit();
}
private static void logConfig(String name, boolean value) {
LOG.info(name + (value ? ": ENABLED" : ": disabled"));
}
private static void logConfig(String name, int value) {
LOG.info(name + ": " + value);
}
@Mod.EventHandler
public void init(FMLInitializationEvent e) {
patchManager.init();
if (GeneralConfig.extendBiome) {
DataRegistry.registerDataManager(new BiomeManager());
}
if (GeneralConfig.extendBlockItem) {
DataRegistry.registerDataManager(new BlockIDManager());
DataRegistry.registerDataManager(new BlockMetaManager());
}
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent e) {
patchManager.postInit();
if (GeneralConfig.extendBiome) {
DataRegistry.disableDataManager("minecraft", "biome");
}
if (GeneralConfig.extendBlockItem) {
DataRegistry.disableDataManager("minecraft", "blockid");
DataRegistry.disableDataManager("minecraft", "metadata");
}
}
}
@@ -1,130 +1,38 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids; package com.falsepattern.endlessids;
import com.falsepattern.endlessids.config.GeneralConfig;
import com.falsepattern.endlessids.constants.ExtendedConstants; import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
import lombok.val;
import net.minecraft.init.Blocks;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import java.nio.ShortBuffer;
import java.nio.ByteBuffer;
public class Hooks { public class Hooks {
public static byte[] getBlockData(final IExtendedBlockStorageMixin ebs) {
val lsb = ebs.getLSB();
val msb = ebs.getMSB();
final byte[] ret = new byte[lsb.length * 3];
ByteBuffer.wrap(ret).asShortBuffer().put(lsb);
System.arraycopy(msb, 0, ret, lsb.length * 2, lsb.length);
return ret;
}
public static void setBlockData(final IExtendedBlockStorageMixin ebs, final byte[] data, final int offset) {
val lsb = ebs.getLSB();
val msb = ebs.getMSB();
val lsbBytes = lsb.length * 2;
ShortBuffer.wrap(ebs.getLSB()).put(ByteBuffer.wrap(data, offset, lsbBytes).asShortBuffer());
System.arraycopy(data, offset + lsbBytes, msb, 0, msb.length);
}
public static void writeChunkToNbt(final NBTTagCompound nbt, final IExtendedBlockStorageMixin ebs) {
val ebsLSB = ebs.getLSB();
val ebsMSB = ebs.getMSB();
val byte1Data = new byte[ebsLSB.length];
byte[] byte2BottomNibbleData = null;
byte[] byte2TopNibbleData = null;
byte[] byte3Data = null;
for (int i = 0; i < ebsLSB.length; ++i) {
if (ebsMSB[i] != 0) {
if (byte3Data == null) {
byte3Data = new byte[ebsLSB.length];
}
byte3Data[i] = ebsMSB[i];
}
val idLSB = (ebsLSB[i] & 0xFFFF);
byte1Data[i] = (byte)(idLSB & 0xFF);
if (idLSB <= 0xFF) continue;
val nibbleIndex = i >> 1;
val nibbleShift = (i & 1) * 4;
if (byte2BottomNibbleData == null) {
byte2BottomNibbleData = new byte[ebsLSB.length / 2];
}
byte2BottomNibbleData[nibbleIndex] |= ((idLSB >>> 8) & 0xF) << nibbleShift;
if (idLSB <= 0xFFF) continue;
if (byte2TopNibbleData == null) {
byte2TopNibbleData = new byte[ebsLSB.length / 2];
}
byte2TopNibbleData[nibbleIndex] |= ((idLSB >>> 12) & 0xF) << nibbleShift;
}
nbt.setByteArray("Blocks", byte1Data);
if (byte2BottomNibbleData != null)
nbt.setByteArray("Add", byte2BottomNibbleData);
if (byte2TopNibbleData != null)
nbt.setByteArray("BlocksB2Hi", byte2TopNibbleData);
if (byte3Data != null)
nbt.setByteArray("BlocksB3", byte3Data);
}
public static void readChunkFromNbt(final IExtendedBlockStorageMixin ebs, final NBTTagCompound nbt) {
assert nbt.hasKey("Blocks");
val byte1Data = nbt.getByteArray("Blocks");
val byte2BottomNibbleData = nbt.hasKey("Add") ? nbt.getByteArray("Add") : null;
val byte2TopNibbleData = nbt.hasKey("BlocksB2Hi") ? nbt.getByteArray("BlocksB2Hi") : null;
val byte3Data = nbt.hasKey("BlocksB3") ? nbt.getByteArray("BlocksB3") : null;
val lsb = ebs.getLSB();
val msb = ebs.getMSB();
for (int i = 0; i < lsb.length; i++) {
if (byte3Data != null) {
msb[i] = byte3Data[i];
}
int nibbleShift = (i & 1) * 4;
int id = byte1Data[i] & 0xFF;
if (byte2BottomNibbleData != null) {
id |= ((byte2BottomNibbleData[i >> 1] >> nibbleShift) & 0xF) << 8;
}
if (byte2TopNibbleData != null) {
id |= ((byte2TopNibbleData[i >> 1] >> nibbleShift) & 0xF) << 12;
}
lsb[i] = (short)id;
}
}
public static void removeInvalidBlocksHook(final IExtendedBlockStorageMixin ebs) {
val blkIdsLSB = ebs.getLSB();
val blkIdsMSB = ebs.getMSB();
int cntNonEmpty = 0;
int cntTicking = 0;
for (int off = 0; off < blkIdsLSB.length; ++off) {
final int id = ((blkIdsLSB[off] & 0xFFFF) | ((blkIdsMSB[off] & 0xFF) << 16)) & ExtendedConstants.blockIDMask;
if (id > 0) {
final Block block = (Block)Block.blockRegistry.getObjectById(id);
if (block == null) {
if (IEConfig.removeInvalidBlocks) {
blkIdsLSB[off] = 0;
}
}
else if (block != Blocks.air) {
++cntNonEmpty;
if (block.getTickRandomly()) {
++cntTicking;
}
}
}
}
ebs.setBlockRefCount(cntNonEmpty);
ebs.setTickRefCount(cntTicking);
}
public static int getIdFromBlockWithCheck(final Block block, final Block oldBlock) { public static int getIdFromBlockWithCheck(final Block block, final Block oldBlock) {
final int id = Block.getIdFromBlock(block); final int id = Block.getIdFromBlock(block);
if (IEConfig.catchUnregisteredBlocks && id == -1) { if (GeneralConfig.catchUnregisteredBlocks && id == -1) {
throw new IllegalArgumentException("Block " + block + " is not registered. <-- Say about this to the author of this mod, or you can try to enable \"RemoveInvalidBlocks\" option in NEID config."); throw new IllegalArgumentException("Block " + block +
" is not registered. <-- Say about this to the author of this mod, or you can try to enable \"RemoveInvalidBlocks\" option in EID config.");
} }
if (id >= 0 && id <= ExtendedConstants.maxBlockID) { if (id >= 0 && id <= ExtendedConstants.maxBlockID) {
return id; return id;
@@ -135,4 +43,44 @@ public class Hooks {
throw new IllegalArgumentException("id out of range: " + id); throw new IllegalArgumentException("id out of range: " + id);
} }
public static void shortToByteArray(short[] shortArray, int shortOffset, byte[] byteArray, int byteOffset, int shortCount) {
for (int i = 0; i < shortCount; i++) {
short s = shortArray[shortOffset + i];
byteArray[byteOffset + i * 2] = (byte) (s & 255);
byteArray[byteOffset + i * 2 + 1] = (byte) ((s >>> 8) & 255);
}
}
public static void byteToShortArray(byte[] byteArray, int byteOffset, short[] shortArray, int shortOffset, int byteCount) {
for (int i = 0; i < byteCount; i++) {
byte b = byteArray[byteOffset + i];
shortArray[shortOffset + i / 2] = (short) (i % 2 == 0
? (b & 255)
: (shortArray[shortOffset + i / 2] | ((b & 255) << 8)));
}
}
public static byte[] shortToByteArray(short[] shortArray) {
byte[] byteArray = new byte[shortArray.length * 2];
shortToByteArray(shortArray, 0, byteArray, 0, shortArray.length);
return byteArray;
}
public static short[] byteToShortArray(byte[] byteArray) {
short[] shortArray = new short[(byteArray.length + 1) / 2];
byteToShortArray(byteArray, 0, shortArray, 0, byteArray.length);
return shortArray;
}
public static void byteToShortArrayLegacy(byte[] byteArray, short[] shortArray) {
for (int i = 0; i < 256; ++i) {
shortArray[i] = (short) (((byteArray[i + 256] << 8) & 255) | (byteArray[i] & 255));
}
}
public static void scatter(byte[] byteArray, short[] shortArray) {
for (int i = 0; i < byteArray.length; i++) {
shortArray[i] = (short) (byteArray[i] & 0xff);
}
}
} }
@@ -1,32 +0,0 @@
package com.falsepattern.endlessids;
import java.io.File;
import net.minecraftforge.common.config.Configuration;
public class IEConfig {
static Configuration config;
public static boolean catchUnregisteredBlocks;
public static boolean removeInvalidBlocks;
public static boolean extendDataWatcher;
public static void init(final File file) {
File newFile;
if (file.getPath().contains("bin")) {
newFile = new File(file.getParent() + "/eclipse/config", Tags.MODID + ".cfg");
}
else {
newFile = new File(file.getParentFile().getParent() + "/config", Tags.MODID + ".cfg");
}
IEConfig.config = new Configuration(newFile);
IEConfig.catchUnregisteredBlocks = IEConfig.config.getBoolean("CatchUnregisteredBlocks", Tags.MODNAME, false, "");
IEConfig.removeInvalidBlocks = IEConfig.config.getBoolean("RemoveInvalidBlocks", Tags.MODNAME, false, "Remove invalid (corrupted) blocks from the game.");
IEConfig.extendDataWatcher = IEConfig.config.getBoolean("ExtendDataWatcher", Tags.MODNAME, false, "Extend DataWatcher IDs. Vanilla limit is 31, new limit is 127.");
IEConfig.config.save();
}
static {
IEConfig.catchUnregisteredBlocks = false;
IEConfig.removeInvalidBlocks = false;
IEConfig.extendDataWatcher = false;
}
}
@@ -1,37 +0,0 @@
package com.falsepattern.endlessids;
import java.io.File;
import java.util.Map;
import com.falsepattern.endlessids.asm.IETransformer;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
@IFMLLoadingPlugin.MCVersion("1.7.10")
@IFMLLoadingPlugin.TransformerExclusions({ "com.falsepattern.endlessids.asm" })
public class IEPlugin implements IFMLLoadingPlugin
{
public IEPlugin() {
super();
}
public String[] getASMTransformerClass() {
return new String[] { IETransformer.class.getName() };
}
public String getModContainerClass() {
return null;
}
public String getSetupClass() {
return null;
}
public void injectData(final Map<String, Object> data) {
IEConfig.init((File) data.get("coremodLocation"));
IETransformer.isObfuscated = (Boolean) data.get("runtimeDeobfuscationEnabled");
}
public String getAccessTransformerClass() {
return null;
}
}
@@ -0,0 +1,35 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids;
import net.minecraft.world.biome.BiomeGenBase;
public class PlaceholderBiome extends BiomeGenBase {
public PlaceholderBiome(int id, BiomeGenBase parent) {
super(id);
biomeName = "EndlessIDs ID conflict avoidance placeholder for ID " + parent.biomeID + " [" +
parent.getClass().getName() + "]";
}
}
@@ -1,8 +0,0 @@
package com.falsepattern.endlessids;
public class Tags {
public static final String MODID = "GRADLETOKEN_MODID";
public static final String MODNAME = "GRADLETOKEN_MODNAME";
public static final String VERSION = "GRADLETOKEN_VERSION";
public static final String GROUPNAME = "GRADLETOKEN_GROUPNAME";
}
@@ -1,7 +1,28 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm; package com.falsepattern.endlessids.asm;
public class AsmTransformException extends RuntimeException public class AsmTransformException extends RuntimeException {
{
private static final long serialVersionUID = 5128914670008752449L; private static final long serialVersionUID = 5128914670008752449L;
public AsmTransformException(final String message) { public AsmTransformException(final String message) {
@@ -1,22 +1,38 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm; package com.falsepattern.endlessids.asm;
import java.io.PrintWriter; import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.util.Printer; import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.util.TraceMethodVisitor;
import org.objectweb.asm.util.Textifier;
import org.objectweb.asm.tree.InsnList;
import java.util.ListIterator;
import org.objectweb.asm.tree.InsnNode; import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.IntInsnNode; import org.objectweb.asm.tree.IntInsnNode;
import org.objectweb.asm.tree.LdcInsnNode; import org.objectweb.asm.tree.LdcInsnNode;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.ClassNode;
public class AsmUtil import java.util.ListIterator;
{
public class AsmUtil {
public AsmUtil() { public AsmUtil() {
super(); super();
} }
@@ -42,30 +58,23 @@ public class AsmUtil
final AbstractInsnNode insn = it.next(); final AbstractInsnNode insn = it.next();
if (insn.getOpcode() == 3 && oldValue == 0) { if (insn.getOpcode() == 3 && oldValue == 0) {
found = true; found = true;
} } else if (insn.getOpcode() == 4 && oldValue == 1) {
else if (insn.getOpcode() == 4 && oldValue == 1) {
found = true; found = true;
} } else if (insn.getOpcode() == 5 && oldValue == 2) {
else if (insn.getOpcode() == 5 && oldValue == 2) {
found = true; found = true;
} } else if (insn.getOpcode() == 6 && oldValue == 3) {
else if (insn.getOpcode() == 6 && oldValue == 3) {
found = true; found = true;
} } else if (insn.getOpcode() == 7 && oldValue == 4) {
else if (insn.getOpcode() == 7 && oldValue == 4) {
found = true; found = true;
} } else if (insn.getOpcode() == 8 && oldValue == 5) {
else if (insn.getOpcode() == 8 && oldValue == 5) {
found = true; found = true;
} } else if (insn.getOpcode() == 18) {
else if (insn.getOpcode() == 18) { final LdcInsnNode node = (LdcInsnNode) insn;
final LdcInsnNode node = (LdcInsnNode)insn; if (node.cst instanceof Integer && (int) node.cst == oldValue) {
if (node.cst instanceof Integer && (int)node.cst == oldValue) {
found = true; found = true;
} }
} } else if (insn.getOpcode() == 17 || insn.getOpcode() == 16) {
else if (insn.getOpcode() == 17 || insn.getOpcode() == 16) { final IntInsnNode node2 = (IntInsnNode) insn;
final IntInsnNode node2 = (IntInsnNode)insn;
if (node2.operand == oldValue) { if (node2.operand == oldValue) {
found = true; found = true;
} }
@@ -74,29 +83,21 @@ public class AsmUtil
foundOnce = true; foundOnce = true;
if (newValue == 0) { if (newValue == 0) {
it.set(new InsnNode(3)); it.set(new InsnNode(3));
} } else if (newValue == 1) {
else if (newValue == 1) {
it.set(new InsnNode(4)); it.set(new InsnNode(4));
} } else if (newValue == 2) {
else if (newValue == 2) {
it.set(new InsnNode(5)); it.set(new InsnNode(5));
} } else if (newValue == 3) {
else if (newValue == 3) {
it.set(new InsnNode(6)); it.set(new InsnNode(6));
} } else if (newValue == 4) {
else if (newValue == 4) {
it.set(new InsnNode(7)); it.set(new InsnNode(7));
} } else if (newValue == 5) {
else if (newValue == 5) {
it.set(new InsnNode(8)); it.set(new InsnNode(8));
} } else if (newValue >= -128 && newValue <= 127) {
else if (newValue >= -128 && newValue <= 127) {
it.set(new IntInsnNode(16, newValue)); it.set(new IntInsnNode(16, newValue));
} } else if (newValue >= -32768 && newValue <= 32767) {
else if (newValue >= -32768 && newValue <= 32767) {
it.set(new IntInsnNode(17, newValue)); it.set(new IntInsnNode(17, newValue));
} } else {
else {
it.set(new LdcInsnNode(newValue)); it.set(new LdcInsnNode(newValue));
} }
found = false; found = false;
@@ -1,41 +0,0 @@
package com.falsepattern.endlessids.asm;
import java.util.HashMap;
import com.falsepattern.endlessids.asm.transformer.FmlRegistry;
import java.util.Map;
public enum ClassEdit
{
FmlRegistry(new FmlRegistry(), new String[] { "cpw.mods.fml.common.registry.GameData", "cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry" }),
;
private static final Map<String, ClassEdit> editMap;
private final IClassNodeTransformer transformer;
private final String[] classNames;
ClassEdit(final IClassNodeTransformer transformer, final String[] classNames) {
this.transformer = transformer;
this.classNames = classNames;
}
public static ClassEdit get(final String className) {
return ClassEdit.editMap.get(className);
}
public String getName() {
return this.name();
}
public IClassNodeTransformer getTransformer() {
return this.transformer;
}
static {
editMap = new HashMap<>();
for (final ClassEdit edit : values()) {
for (final String name : edit.classNames) {
ClassEdit.editMap.put(name, edit);
}
}
}
}
@@ -0,0 +1,140 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.config.GeneralConfig;
import com.falsepattern.endlessids.mixin.plugin.Mixin;
import com.gtnewhorizon.gtnhmixins.IEarlyMixinLoader;
import com.gtnewhorizon.gtnhmixins.builders.IMixins;
import lombok.SneakyThrows;
import lombok.val;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;
import cpw.mods.fml.relauncher.FMLInjectionData;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.DependsOn;
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion;
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.Name;
import static cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;
@MCVersion("1.7.10")
@Name(Tags.MODID + "_core")
@TransformerExclusions({"com.falsepattern.endlessids.asm", "com.falsepattern.endlessids.config.GeneralConfig"})
@DependsOn("falsepatternlib")
public class EndlessIDsCore implements IFMLLoadingPlugin, IEarlyMixinLoader {
public static boolean deobfuscated;
static {
if (GeneralConfig.extendBlockItem) {
try {
if (Launch.classLoader.getClassBytes("fastcraft.Tweaker") != null) {
FCCompat.patchConfig();
}
} catch (Exception ignored) {
}
}
}
public EndlessIDsCore() {
super();
try {
if (Launch.classLoader.getClassBytes("ru.fewizz.neid.asm.Plugin") != null ||
Launch.classLoader.getClassBytes("com.gtnewhorizons.neid.asm.NEIDTransformer") != null) {
loudCrash("EndlessIDs replaces NotEnoughIDs! Please uninstall NotEnoughIDs!");
}
} catch (Exception ignored) {}
}
@SneakyThrows
public String[] getASMTransformerClass() {
deobfuscated = (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
val cl = Launch.classLoader;
val field = LaunchClassLoader.class.getDeclaredField("transformerExceptions");
field.setAccessible(true);
@SuppressWarnings("unchecked")
val exceptions = (Set<String>) field.get(cl);
if (exceptions.contains("code.elix_x.coremods")) {
Share.logger.info("AntiIDConflict detected!");
Share.logger.info("Removing ASM protections so that we can fix its code.");
exceptions.remove("code.elix_x.coremods");
exceptions.add("code.elix_x.coremods.antiidconflict.core");
exceptions.add("code.elix_x.coremods.antiidconflict.ByteCodeTester");
}
return new String[]{Tags.GROUPNAME + ".asm.EndlessIDsTransformer" };
}
private static void loudCrash(String message) {
for (int i = 0; i < 100; i++) {
Share.logger.fatal(message);
}
val err = new Error(message);
err.setStackTrace(new StackTraceElement[0]);
throw err;
}
public String getModContainerClass() {
if (GeneralConfig.extendBiome) {
FMLInjectionData.containers.add(Tags.GROUPNAME + ".containers.BiomeContainer");
}
if (GeneralConfig.extendBlockItem) {
FMLInjectionData.containers.add(Tags.GROUPNAME + ".containers.BlockItemContainer");
}
if (GeneralConfig.extendDataWatcher) {
FMLInjectionData.containers.add(Tags.GROUPNAME + ".containers.DataWatcherContainer");
}
if (GeneralConfig.extendEnchantment) {
FMLInjectionData.containers.add(Tags.GROUPNAME + ".containers.EnchantmentContainer");
}
if (GeneralConfig.extendPotion) {
FMLInjectionData.containers.add(Tags.GROUPNAME + ".containers.PotionContainer");
}
return null;
}
public String getSetupClass() {
return null;
}
public void injectData(final Map<String, Object> data) {
}
public String getAccessTransformerClass() {
return null;
}
@Override
public String getMixinConfig() {
return "mixins.endlessids.early.json";
}
@Override
public List<String> getMixins(Set<String> loadedCoreMods) {
return IMixins.getEarlyMixins(Mixin.class, loadedCoreMods);
}
}
@@ -0,0 +1,63 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm;
import com.falsepattern.endlessids.asm.transformer.DevFixer;
import com.falsepattern.endlessids.asm.transformer.FmlRegistry;
import com.falsepattern.endlessids.asm.transformer.GameDataAccelerator;
import com.falsepattern.endlessids.asm.transformer.SpaceCoreModInfoGenerator;
import com.falsepattern.endlessids.asm.transformer.chunk.ChunkProviderSuperPatcher;
import com.falsepattern.endlessids.asm.transformer.chunk.LOTRFieldExposer;
import com.falsepattern.endlessids.config.GeneralConfig;
import com.falsepattern.lib.turboasm.MergeableTurboTransformer;
import com.falsepattern.lib.turboasm.TurboClassTransformer;
import lombok.val;
import java.util.ArrayList;
import java.util.List;
public class EndlessIDsTransformer extends MergeableTurboTransformer {
private static List<TurboClassTransformer> transformers() {
val result = new ArrayList<TurboClassTransformer>();
if (GeneralConfig.extendBiome) {
result.add(new ChunkProviderSuperPatcher());
result.add(new LOTRFieldExposer());
}
if (GeneralConfig.extendBlockItem) {
result.add(new FmlRegistry());
}
if (GeneralConfig.enableRegistryPerformanceTweak) {
new GameDataAccelerator();
}
if (EndlessIDsCore.deobfuscated) {
result.add(new SpaceCoreModInfoGenerator());
result.add(new DevFixer());
}
return result;
}
public EndlessIDsTransformer() {
super(transformers());
}
}
@@ -0,0 +1,42 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm;
import com.falsepattern.endlessids.util.ConfigFixUtil;
public class FCCompat {
public static void patchConfig() {
//Breaks with the blockitem module
ConfigFixUtil.fixConfig("fastcraft.ini", (line) -> {
if (line.contains("asyncCulling") || line.contains("enableCullingTweaks")) {
return line.replace("true", "false");
}
return line;
}, () -> "[extra tweaks]\nasyncCulling = false\n[transparent tweaks]\nenableCullingTweaks=false\n",
e -> {
System.err.println(
"Failed to apply FastCraft occlusion tweak compatibility patches!");
e.printStackTrace();
});
}
}
@@ -1,7 +1,28 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm; package com.falsepattern.endlessids.asm;
public class FieldNotFoundException extends AsmTransformException public class FieldNotFoundException extends AsmTransformException {
{
public FieldNotFoundException(final String field) { public FieldNotFoundException(final String field) {
super("can't find field " + field); super("can't find field " + field);
} }
@@ -0,0 +1,62 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm;
import com.falsepattern.endlessids.asm.stubpackage.cpw.mods.fml.common.registry.GameData;
import com.falsepattern.endlessids.util.WeakIdentityHashMap;
import lombok.var;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import java.lang.ref.WeakReference;
import java.util.Collections;
import java.util.WeakHashMap;
//Used by ASM
@SuppressWarnings("unused")
public class GameDataHooks {
private static WeakIdentityHashMap<Block, WeakReference<ItemBlock>> forGameData(GameData gameData) {
if (gameData.endlessIDsItemBlockCache == null) {
gameData.endlessIDsItemBlockCache = new WeakIdentityHashMap<>();
}
return gameData.endlessIDsItemBlockCache;
}
public static void cacheItemBlock(ItemBlock itemBlock, GameData gameData) {
forGameData(gameData).put(itemBlock.field_150939_a, new WeakReference<>(itemBlock));
}
public static ItemBlock fetchCachedItemBlock(Block block, GameData gameData) {
var weakItem = forGameData(gameData).get(block);
if (weakItem != null) {
return weakItem.get();
}
return null;
}
public static Iterable<Item> fakeIterable() {
return Collections.emptyList();
}
}
@@ -1,8 +1,29 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm; package com.falsepattern.endlessids.asm;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
public interface IClassNodeTransformer public interface IClassNodeTransformer {
{
void transform(final ClassNode p0, final boolean p1); void transform(final ClassNode p0, final boolean p1);
} }
@@ -1,61 +0,0 @@
package com.falsepattern.endlessids.asm;
import com.falsepattern.endlessids.Tags;
import org.apache.logging.log4j.LogManager;
import org.objectweb.asm.util.CheckClassAdapter;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.tree.ClassNode;
import org.apache.logging.log4j.Logger;
import net.minecraft.launchwrapper.IClassTransformer;
public class IETransformer implements IClassTransformer
{
public static final Logger logger;
public static boolean isObfuscated;
public IETransformer() {
super();
}
public byte[] transform(final String name, final String transformedName, final byte[] bytes) {
if (bytes == null) {
return bytes;
}
final ClassEdit edit = ClassEdit.get(transformedName);
if (edit == null) {
return bytes;
}
IETransformer.logger.debug("Patching {} with {}...", transformedName, edit.getName());
final ClassNode cn = new ClassNode(327680);
final ClassReader reader = new ClassReader(bytes);
reader.accept(cn, 0);
try {
edit.getTransformer().transform(cn, IETransformer.isObfuscated);
}
catch (AsmTransformException t) {
IETransformer.logger.error("Error transforming {} with {}: {}", transformedName, edit.getName(), t.getMessage());
throw t;
}
catch (Throwable t2) {
IETransformer.logger.error("Error transforming {} with {}: {}", transformedName, edit.getName(), t2.getMessage());
throw new RuntimeException(t2);
}
final ClassWriter writer = new ClassWriter(0);
try {
final ClassVisitor check = new CheckClassAdapter(writer);
cn.accept(check);
}
catch (Throwable t3) {
IETransformer.logger.error("Error verifying {} transformed with {}: {}", transformedName, edit.getName(), t3.getMessage());
throw new RuntimeException(t3);
}
IETransformer.logger.debug("Patched {} successfully.", edit.getName());
return writer.toByteArray();
}
static {
logger = LogManager.getLogger(Tags.MODNAME + " ASM");
}
}
@@ -1,7 +1,28 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm; package com.falsepattern.endlessids.asm;
public class MethodNotFoundException extends AsmTransformException public class MethodNotFoundException extends AsmTransformException {
{
public MethodNotFoundException(final String method) { public MethodNotFoundException(final String method) {
super("can't find method " + method); super("can't find method " + method);
} }
@@ -0,0 +1,33 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm;
import com.falsepattern.endlessids.Tags;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public final class Share {
public static final Logger logger = LogManager.getLogger(Tags.MODNAME + " ASM");
private Share() {}
}
@@ -0,0 +1,34 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm.stubpackage.cpw.mods.fml.common.registry;
import com.falsepattern.endlessids.util.WeakIdentityHashMap;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import java.lang.ref.WeakReference;
public class GameData {
public WeakIdentityHashMap<Block, WeakReference<ItemBlock>> endlessIDsItemBlockCache;
}
@@ -0,0 +1,120 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm.transformer;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.asm.EndlessIDsCore;
import com.falsepattern.lib.turboasm.ClassNodeHandle;
import com.falsepattern.lib.turboasm.TurboClassTransformer;
import lombok.val;
import org.jetbrains.annotations.NotNull;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldInsnNode;
import net.minecraft.launchwrapper.Launch;
import java.io.IOException;
public class DevFixer implements TurboClassTransformer {
private static final ClassNode blocks;
static {
if (!EndlessIDsCore.deobfuscated) {
blocks = null;
} else {
try {
byte[] blox = Launch.classLoader.getClassBytes("net/minecraft/init/Blocks");
blocks = new ClassNode(Opcodes.ASM5);
final ClassReader reader = new ClassReader(blox);
reader.accept(blocks, 0);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
private static boolean biomeTweakerCompat(final ClassNode cn) {
boolean modified = false;
for (val field : cn.fields) {
if (field.name.startsWith("spawnable")) {
field.access &= ~Opcodes.ACC_PROTECTED;
field.access |= Opcodes.ACC_PUBLIC;
modified = true;
}
}
return modified;
}
private static boolean remapBlocks(final ClassNode cn) {
boolean modified = false;
for (val method : cn.methods) {
val instructions = method.instructions;
int insnCount = instructions.size();
for (int i = 0; i < insnCount; i++) {
val insn = instructions.get(i);
if (insn instanceof FieldInsnNode) {
val field = (FieldInsnNode) insn;
if (field.getOpcode() == Opcodes.GETSTATIC && field.owner.equals("net/minecraft/init/Blocks")) {
for (val blockField : blocks.fields) {
if (blockField.name.equals(field.name) && !blockField.desc.equals(field.desc)) {
field.desc = blockField.desc;
modified = true;
}
}
}
}
}
}
return modified;
}
@Override
public String owner() {
return Tags.MODNAME;
}
@Override
public String name() {
return "DevFixer";
}
@Override
public boolean shouldTransformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
return EndlessIDsCore.deobfuscated && !"net.minecraft.world.chunk.storage.AnvilChunkLoader".equals(className);
}
@Override
public boolean transformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
val cn = classNode.getNode();
if (cn == null)
return false;
boolean modified = false;
modified |= remapBlocks(cn);
if (className.equals("net.minecraft.world.biome.BiomeGenBase")) {
modified |= biomeTweakerCompat(cn);
}
return modified;
}
}
@@ -1,40 +1,87 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm.transformer; package com.falsepattern.endlessids.asm.transformer;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.asm.AsmTransformException;
import com.falsepattern.endlessids.asm.AsmUtil;
import com.falsepattern.endlessids.asm.IClassNodeTransformer;
import com.falsepattern.endlessids.config.GeneralConfig;
import com.falsepattern.endlessids.constants.ExtendedConstants; import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants; import com.falsepattern.endlessids.constants.VanillaConstants;
import com.falsepattern.lib.turboasm.ClassNodeHandle;
import com.falsepattern.lib.turboasm.TurboClassTransformer;
import lombok.val;
import lombok.var; import lombok.var;
import org.objectweb.asm.tree.FieldNode; import org.jetbrains.annotations.NotNull;
import com.falsepattern.endlessids.asm.AsmTransformException;
import org.objectweb.asm.tree.MethodNode;
import com.falsepattern.endlessids.asm.AsmUtil;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import com.falsepattern.endlessids.asm.IClassNodeTransformer; import org.objectweb.asm.tree.MethodNode;
public class FmlRegistry implements IClassNodeTransformer public class FmlRegistry implements TurboClassTransformer {
{
public FmlRegistry() { public FmlRegistry() {
super(); super();
} }
@Override @Override
public void transform(final ClassNode cn, final boolean obfuscated) { public String owner() {
return Tags.MODNAME;
}
@Override
public String name() {
return "FMLRegistry";
}
@Override
public boolean shouldTransformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
return GeneralConfig.extendBlockItem && ("cpw.mods.fml.common.registry.GameData".equals(className) ||
"cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry".equals(className));
}
@Override
public boolean transformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
val cn = classNode.getNode();
if (cn == null)
return false;
var field = AsmUtil.findField(cn, "MAX_BLOCK_ID", true); var field = AsmUtil.findField(cn, "MAX_BLOCK_ID", true);
if (field != null) { if (field != null) {
field.value = ExtendedConstants.maxBlockID; field.value = ExtendedConstants.maxBlockID;
} }
field = AsmUtil.findField(cn, "MAX_ITEM_ID", true); field = AsmUtil.findField(cn, "MAX_ITEM_ID", true);
if (field != null) { if (field != null) {
field.value = ExtendedConstants.maxBlockID; field.value = ExtendedConstants.maxItemID;
} }
boolean found = false; boolean found = false;
for (final MethodNode method : cn.methods) { for (final MethodNode method : cn.methods) {
if (AsmUtil.transformInlinedSizeMethod(cn, method, VanillaConstants.maxBlockID, ExtendedConstants.maxBlockID, true)) { if (AsmUtil.transformInlinedSizeMethod(cn, method, VanillaConstants.maxBlockID,
ExtendedConstants.maxBlockID, true)) {
found = true; found = true;
} }
AsmUtil.transformInlinedSizeMethod(cn, method, 31999, ExtendedConstants.maxBlockID, true); AsmUtil.transformInlinedSizeMethod(cn, method, 31999, ExtendedConstants.maxItemID, true);
} }
if (!found) { if (!found) {
throw new AsmTransformException("can't find 4095 constant in any method"); throw new AsmTransformException("can't find 4095 constant in any method");
} }
return true;
} }
} }
@@ -0,0 +1,150 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm.transformer;
import com.falsepattern.endlessids.asm.Share;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.asm.AsmTransformException;
import com.falsepattern.endlessids.config.GeneralConfig;
import com.falsepattern.lib.turboasm.ClassNodeHandle;
import com.falsepattern.lib.turboasm.TurboClassTransformer;
import lombok.val;
import lombok.var;
import org.jetbrains.annotations.NotNull;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.FieldInsnNode;
import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.VarInsnNode;
public class GameDataAccelerator implements TurboClassTransformer {
private static final int MASK_REGISTER_BLOCK = 0b1;
private static final int MASK_REGISTER_ITEM = 0b10;
private void transformRegisterItem(MethodNode method) {
var iter = method.instructions.iterator();
while (iter.hasNext()) {
var insn = iter.next();
if (!(insn instanceof FieldInsnNode))
continue;
var typeInsn = (FieldInsnNode) insn;
if (!(typeInsn.owner.equals("net/minecraft/item/ItemBlock") &&
typeInsn.name.equals("field_150939_a") &&
typeInsn.desc.equals("Lnet/minecraft/block/Block;")))
continue;
iter.previous();
iter.add(new InsnNode(Opcodes.DUP));
iter.add(new VarInsnNode(Opcodes.ALOAD, 0));
iter.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "com/falsepattern/endlessids/asm/GameDataHooks", "cacheItemBlock", "(Lnet/minecraft/item/ItemBlock;Lcpw/mods/fml/common/registry/GameData;)V", false));
return;
}
transformError(method);
}
private static void transformError(MethodNode method) {
Share.logger.error("Could not add caching code to GameData.{}{}", method.name, method.desc);
}
private void transformRegisterBlock(MethodNode method) {
var iter = method.instructions.iterator();
while (iter.hasNext()) {
var insn = iter.next();
if ((insn.getOpcode() != Opcodes.GETFIELD) && !(insn instanceof FieldInsnNode))
continue;
var fieldInsn = (FieldInsnNode) insn;
if (!(fieldInsn.owner.equals("cpw/mods/fml/common/registry/GameData") &&
fieldInsn.name.equals("iItemRegistry") &&
fieldInsn.desc.equals("Lcpw/mods/fml/common/registry/FMLControlledNamespacedRegistry;")))
continue;
iter.remove();
{
val testInsn = iter.previous();
if (testInsn.getOpcode() != Opcodes.ALOAD || ((VarInsnNode)testInsn).var != 0)
throw new AsmTransformException("Opcode assertion 1 failed!");
}
iter.remove();
{
val testInsn = iter.next();
if (testInsn.getOpcode() != Opcodes.INVOKEVIRTUAL)
throw new AsmTransformException("Opcodes assertion 2 failed!");
val testInvoke = (MethodInsnNode)testInsn;
if (!testInvoke.owner.equals("cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry") ||
!testInvoke.name.equals("typeSafeIterable"))
throw new AsmTransformException("Opcodes assertion 3 failed!");
}
iter.remove();
iter.add(new VarInsnNode(Opcodes.ALOAD, 1));
iter.add(new VarInsnNode(Opcodes.ALOAD, 0));
iter.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "com/falsepattern/endlessids/asm/GameDataHooks", "fetchCachedItemBlock", "(Lnet/minecraft/block/Block;Lcpw/mods/fml/common/registry/GameData;)Lnet/minecraft/item/ItemBlock;", false));
iter.add(new VarInsnNode(Opcodes.ASTORE, 4));
iter.add(new MethodInsnNode(Opcodes.INVOKESTATIC, "com/falsepattern/endlessids/asm/GameDataHooks", "fakeIterable", "()Ljava/lang/Iterable;", false));
return;
}
transformError(method);
}
@Override
public String owner() {
return Tags.MODNAME;
}
@Override
public String name() {
return "GameDataAccelerator";
}
@Override
public boolean shouldTransformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
return GeneralConfig.enableRegistryPerformanceTweak && "cpw.mods.fml.common.registry.GameData".equals(className);
}
@Override
public boolean transformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
val cn = classNode.getNode();
if (cn == null)
return false;
var cacheField = new FieldNode(Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC, "endlessIDsItemBlockCache", "Lcom/falsepattern/endlessids/util/WeakIdentityHashMap;", null, null);
cn.fields.add(cacheField);
int tweaksLeft = MASK_REGISTER_BLOCK | MASK_REGISTER_ITEM;
for (val method: cn.methods) {
if ((tweaksLeft & MASK_REGISTER_BLOCK) != 0 &&
method.name.equals("registerBlock") &&
method.desc.equals("(Lnet/minecraft/block/Block;Ljava/lang/String;I)I")) {
transformRegisterBlock(method);
tweaksLeft &= ~MASK_REGISTER_BLOCK;
} else if ((tweaksLeft & MASK_REGISTER_ITEM) != 0 &&
method.name.equals("registerItem") &&
method.desc.equals("(Lnet/minecraft/item/Item;Ljava/lang/String;I)I")) {
transformRegisterItem(method);
tweaksLeft &= ~MASK_REGISTER_ITEM;
}
if (tweaksLeft == 0) {
return true;
}
}
throw new AsmTransformException("Failed to accelerate block registration! Disable enableRegistryPerformanceTweak in the EndlessIDs config!");
}
}
@@ -0,0 +1,64 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm.transformer;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.asm.EndlessIDsCore;
import com.falsepattern.lib.turboasm.ClassNodeHandle;
import com.falsepattern.lib.turboasm.TurboClassTransformer;
import lombok.val;
import org.jetbrains.annotations.NotNull;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.InsnNode;
public class SpaceCoreModInfoGenerator implements TurboClassTransformer {
@Override
public String owner() {
return Tags.MODNAME;
}
@Override
public String name() {
return "SpaceCoreModInfoGenerator";
}
@Override
public boolean shouldTransformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
return EndlessIDsCore.deobfuscated && "com.spacechase0.minecraft.spacecore.mcp.ModInfoGenerator".equals(className);
}
@Override
public boolean transformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
val cn = classNode.getNode();
if (cn == null)
return false;
for (val method : cn.methods) {
if (method.name.equals("generate")) {
val iterator = method.instructions.iterator();
iterator.add(new InsnNode(Opcodes.RETURN));
return true;
}
}
return false;
}
}
@@ -0,0 +1,653 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm.transformer.chunk;
import com.falsepattern.endlessids.asm.Share;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.asm.EndlessIDsCore;
import com.falsepattern.lib.turboasm.BytePatternMatcher;
import com.falsepattern.lib.turboasm.ClassNodeHandle;
import com.falsepattern.lib.turboasm.TurboClassTransformer;
import lombok.Data;
import lombok.val;
import lombok.var;
import org.jetbrains.annotations.NotNull;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldInsnNode;
import org.objectweb.asm.tree.FrameNode;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.JumpInsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.LineNumberNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.VarInsnNode;
import net.minecraft.launchwrapper.Launch;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;
/**
* <p>This class is the bread and butter of the patching logic from now on. It covers about 90% of cases where manual patching
* was required, and so with a heavy heart, I (finally) implemented a universal patch.</p>
*
* <pre>
* Java form:
* ...
* byte[] abyte = chunk.getBiomeArray(); //replace byte[] with short[] and getBiomeArray with getBiomeShortArray
*
* for (int k = 0; k < abyte.length; ++k) {
* //Possibility A:
* abyte[k] = (byte)abiomegenbase[k].biomeID; //from local variable //replace byte cast with short cast
*
* //Possibility B:
* abyte[k] = (byte)this.biomesToGenerate[k].biomeID; //from arbitrary field //replace byte cast with short cast
*
* //Possibility C:
* abyte[k] = (byte)SomeClass.biome.biomeID; //usually galacticraft and derivatives do this for space stations.
*
* //Possibility D:
* abyte[k] = (byte)object.biome.biomeID; //could also happen.
* }
* ...
* In ASM form:
*
* L1
* //state 0
* ALOAD chunk
* //state 1
* INVOKEVIRTUAL net/minecraft/world/chunk/Chunk.getBiomeArray ()[B //Replace with INVOKEVIRTUAL net/minecraft/world/chunk/Chunk.getBiomeShortArray ()[S
* //state 2
* ASTORE abyte
* //state 3
* L2
* //state 4
* ICONST_0
* //state 5
* ISTORE k
* //state 6
* L3
* //state 7
* FRAME <snip>
* //state 8
* ILOAD k
* //state 9
* //Branch X | Y
* //X:
* ALOAD abyte
* //Y:
* ALOAD <something else>
* GETFIELD classname.fieldname : [Lnet/minecraft/world/biome/BiomeGenBase;
* //Join X | Y
* //state 10
* ARRAYLENGTH
* //state 11
* IF_ICMPGE L6
* //state 12
* L4
* //state 13
* ALOAD abyte
* //state 14
* ILOAD k
*
* //Branch A | B | C | D
* //A:
* ALOAD abiomegenbase
*
* //B:
* ALOAD <something else>
* GETFIELD classname.fieldname : [Lnet/minecraft/world/biome/BiomeGenBase;
*
* //C:
* GETSTATIC classname.fieldname : Lnet/minecraft/world/biome/BiomeGenBase;
*
* //D:
* ALOAD <something else>
* GETFIELD classname.fieldname : Lnet/minecraft/world/biome/BiomeGenBase;
*
* //Join A | B
* ILOAD k
* AALOAD
*
* //Join A,B | C | D
*
* //state 15
* GETFIELD net/minecraft/world/biome/BiomeGenBase.biomeID : I
* //state 16
* I2B //Replace with I2S
* //state 17
* BASTORE //Replace with SASTORE
* //state final, matched.
* L5
* IINC k 1
* GOTO L3
* L6
* </pre>
*/
public class ChunkProviderSuperPatcher implements TurboClassTransformer {
public static final String[] CLASS_BiomeGenBase;
public static final String[] CLASS_IChunkProvider;
public static final String[] CLASS_ChunkProviderGenerate;
public static final String[] CLASS_Chunk;
public static final String[] FIELD_biomeID;
public static final String[] METHOD_getBiomeArray;
private static State<AbstractInsnNode> STATE0 = null;
private static State<AbstractInsnNode> STATE1 = null;
private static State<AbstractInsnNode> STATE2 = null;
private static State<AbstractInsnNode> STATE3 = null;
private static State<AbstractInsnNode> STATE4 = null;
private static State<AbstractInsnNode> STATE5 = null;
private static State<AbstractInsnNode> STATE6 = null;
private static State<AbstractInsnNode> STATE7 = null;
private static State<AbstractInsnNode> STATE8 = null;
private static State<AbstractInsnNode> STATE9 = null;
private static State<AbstractInsnNode> STATE9_Y = null;
private static State<AbstractInsnNode> STATE10 = null;
private static State<AbstractInsnNode> STATE11 = null;
private static State<AbstractInsnNode> STATE12 = null;
private static State<AbstractInsnNode> STATE13 = null;
private static State<AbstractInsnNode> STATE14 = null;
private static State<AbstractInsnNode> STATE14_ABD1 = null;
private static State<AbstractInsnNode> STATE14_ABD1_BD1 = null;
private static State<AbstractInsnNode> STATE14_ABD1_BA2 = null;
private static State<AbstractInsnNode> STATE14_ABD1_BA3 = null;
private static State<AbstractInsnNode> STATE14_C1 = null;
private static State<AbstractInsnNode> STATE15 = null;
private static State<AbstractInsnNode> STATE16 = null;
private static State<AbstractInsnNode> STATE17 = null;
private static State<AbstractInsnNode> STATE_FINAL = null;
private static final BytePatternMatcher chunkClassMatcher;
private static final BytePatternMatcher getBiomeArrayMethodMatcher;
static {
var chunk = new ArrayList<String>(4);
if (EndlessIDsCore.deobfuscated) {
CLASS_BiomeGenBase = new String[]{"net/minecraft/world/biome/BiomeGenBase"};
CLASS_IChunkProvider = new String[]{"net/minecraft/world/chunk/IChunkProvider"};
CLASS_ChunkProviderGenerate = new String[]{"net/minecraft/world/gen/ChunkProviderGenerate"};
chunk.add("net/minecraft/world/chunk/Chunk");
FIELD_biomeID = new String[]{"biomeID"};
METHOD_getBiomeArray = new String[]{"getBiomeArray"};
} else {
CLASS_BiomeGenBase = new String[]{"ahu", "net/minecraft/world/biome/BiomeGenBase"};
CLASS_IChunkProvider = new String[]{"apu", "net/minecraft/world/chunk/IChunkProvider"};
CLASS_ChunkProviderGenerate = new String[]{"aqz", "net/minecraft/world/gen/ChunkProviderGenerate"};
chunk.add("apx");
chunk.add("net/minecraft/world/chunk/Chunk");
FIELD_biomeID = new String[]{"ay", "field_76756_M"};
METHOD_getBiomeArray = new String[]{"m", "func_76605_m"};
}
val chunkExtraSpool = Launch.blackboard.get("endlessids_spool_CLASS_Chunk_interop");
if (chunkExtraSpool instanceof String[]) {
chunk.addAll(Arrays.asList((String[]) chunkExtraSpool));
}
CLASS_Chunk = chunk.toArray(new String[0]);
chunkClassMatcher = new BytePatternMatcher(CLASS_Chunk, BytePatternMatcher.Mode.Equals);
getBiomeArrayMethodMatcher = new BytePatternMatcher(METHOD_getBiomeArray, BytePatternMatcher.Mode.Equals);
}
static {
STATE_FINAL = (insn, memory) -> STATE_FINAL;
STATE0 = casting(VarInsnNode.class, (insn, memory) -> {
memory.reset();
if (insn.getOpcode() == Opcodes.ALOAD) {
memory.chunkIndex = insn.var;
memory.startingInsn = insn;
return STATE1;
}
return STATE0;
});
STATE1 = casting(MethodInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.INVOKEVIRTUAL &&
anyMatch(insn.owner, CLASS_Chunk) &&
anyMatch(insn.name, METHOD_getBiomeArray) &&
insn.desc.equals("()[B")) {
memory.getBiomeArrayInsn = insn;
return STATE2;
}
return STATE0;
});
STATE2 = casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ASTORE) {
memory.biomeArrayIndex = insn.var;
memory.startPatchingFrames();
return STATE3;
}
return STATE0;
});
STATE3 = typeCheck(LabelNode.class, () -> STATE4);
STATE4 = casting(InsnNode.class, (insn) ->
insn.getOpcode() == Opcodes.ICONST_0
? STATE5 : STATE0);
STATE5 = casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ISTORE) {
memory.iteratorIndex = insn.var;
return STATE6;
}
return STATE0;
});
STATE6 = typeCheck(LabelNode.class, () -> STATE7);
STATE7 = casting(FrameNode.class, (insn, memory) ->
anyMatch((String) memory.locals.get(memory.chunkIndex), CLASS_Chunk) &&
memory.locals.get(memory.biomeArrayIndex).equals("[B") &&
memory.locals.get(memory.iteratorIndex).equals(1)
? STATE8 : STATE0);
STATE8 = casting(VarInsnNode.class, (insn, memory) ->
insn.getOpcode() == Opcodes.ILOAD &&
insn.var == memory.iteratorIndex
? STATE9 : STATE0);
STATE9 = casting(VarInsnNode.class, (insn, memory) ->
insn.getOpcode() == Opcodes.ALOAD
&& insn.var == memory.biomeArrayIndex
? STATE10 : STATE9_Y);
STATE9_Y = casting(FieldInsnNode.class, insn ->
insn.getOpcode() == Opcodes.GETFIELD && anyMatch(insn.desc, CLASS_BiomeGenBase, "[L", ";") ? STATE10: STATE0);
STATE10 = casting(InsnNode.class, (insn) -> insn.getOpcode() == Opcodes.ARRAYLENGTH ? STATE11 : STATE0);
STATE11 = casting(JumpInsnNode.class, (insn) -> insn.getOpcode() == Opcodes.IF_ICMPGE ? STATE12 : STATE0);
STATE12 = typeCheck(LabelNode.class, () -> STATE13);
STATE13 = casting(VarInsnNode.class, (insn, memory) ->
insn.getOpcode() == Opcodes.ALOAD &&
insn.var == memory.biomeArrayIndex
? STATE14 : STATE0);
STATE14 = casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ILOAD && insn.var == memory.iteratorIndex) {
if (insn.getNext() instanceof FieldInsnNode) {
return STATE14_C1;
} else {
return STATE14_ABD1;
}
}
return STATE0;
});
STATE14_ABD1 = casting(VarInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.ALOAD) {
if (anyMatch((String) memory.locals.get(insn.var), CLASS_BiomeGenBase, "[L", ";")) {
return STATE14_ABD1_BA2;
} else {
return STATE14_ABD1_BD1;
}
}
return STATE0;
});
STATE14_ABD1_BD1 = casting(FieldInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.GETFIELD) {
if (anyMatch(insn.desc, CLASS_BiomeGenBase, "[L", ";")) {
return STATE14_ABD1_BA2;
} else if (anyMatch(insn.desc, CLASS_BiomeGenBase, "L", ";")) {
return STATE15;
}
}
return STATE0;
});
STATE14_ABD1_BA2 = casting(VarInsnNode.class, (insn, memory) ->
insn.getOpcode() == Opcodes.ILOAD && insn.var == memory.iteratorIndex ? STATE14_ABD1_BA3 : STATE0);
STATE14_ABD1_BA3 = casting(InsnNode.class, (insn) -> insn.getOpcode() == Opcodes.AALOAD ? STATE15 : STATE0);
STATE14_C1 = casting(FieldInsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.GETSTATIC && anyMatch(insn.desc, CLASS_BiomeGenBase, "L", ";")) {
return STATE15;
}
return STATE0;
});
STATE15 = casting(FieldInsnNode.class, (insn) ->
insn.getOpcode() == Opcodes.GETFIELD &&
anyMatch(insn.owner, CLASS_BiomeGenBase) &&
anyMatch(insn.name, FIELD_biomeID) &
insn.desc.equals("I")
? STATE16 : STATE0);
STATE16 = casting(InsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.I2B) {
memory.castInsn = insn;
return STATE17;
}
return STATE0;
});
STATE17 = casting(InsnNode.class, (insn, memory) -> {
if (insn.getOpcode() == Opcodes.BASTORE) {
memory.arrayStoreInsn = insn;
return STATE_FINAL;
}
return STATE0;
});
}
private static boolean anyMatch(String str, String[] candidates) {
for (val candidate : candidates) {
if (str.equals(candidate)) {
return true;
}
}
return false;
}
private static boolean anyMatch(String str, String[] candidates, String prefix, String suffix) {
for (val candidate : candidates) {
if (str.equals(prefix + candidate + suffix)) {
return true;
}
}
return false;
}
private static <T extends AbstractInsnNode> State<AbstractInsnNode> typeCheck(Class<T> clazz, Supplier<State<AbstractInsnNode>> okState) {
return casting(clazz, (insn, memory) -> okState.get());
}
private static <T extends AbstractInsnNode> State<AbstractInsnNode> casting(Class<T> clazz, Function<T, State<AbstractInsnNode>> okState) {
return casting(clazz, (insn, memory) -> okState.apply(insn));
}
private static <T extends AbstractInsnNode> State<AbstractInsnNode> casting(Class<T> clazz, State<T> okState) {
return (insn, memory) -> {
if (insn instanceof LineNumberNode) {
return null;
} else if (clazz.isInstance(insn)) {
return okState.apply(clazz.cast(insn), memory);
} else {
return STATE0;
}
};
}
private static Memory findTheTarget(MethodNode method, ClassNode cn) {
val insnList = method.instructions;
var currentState = STATE0;
val memory = new Memory();
memory.initLocals(method, cn);
val iter = insnList.iterator();
while (iter.hasNext()) {
val insn = iter.next();
if (insn instanceof FrameNode) {
val frame = (FrameNode) insn;
memory.recordFrame(frame);
memory.updateLocalsState(frame);
}
val newState = currentState.apply(insn, memory);
if (newState != null) {
if (newState == STATE_FINAL) {
while (iter.hasNext()) {
val insn2 = iter.next();
if (insn2 instanceof FrameNode) {
memory.recordFrame((FrameNode) insn2);
}
}
return memory;
}
currentState = newState;
}
}
return null;
}
@Override
public String owner() {
return Tags.MODNAME;
}
@Override
public String name() {
return "ChunkProviderSuperPatcher";
}
@Override
public boolean shouldTransformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
if ("net.minecraft.world.chunk.storage.AnvilChunkLoader".equals(className)) {
return false;
}
val metadata = classNode.getOriginalMetadata();
if (metadata == null) {
return false;
}
return metadata.matchesBytes(chunkClassMatcher) && metadata.matchesBytes(getBiomeArrayMethodMatcher);
}
@Override
public boolean transformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
val cn = classNode.getNode();
if (cn == null)
return false;
boolean patched = false;
for (val method : cn.methods) {
val memory = findTheTarget(method, cn);
if (memory != null) {
patched = true;
Share.logger.debug("[ChunkProvider patcher]: Match found in method {}", method.name);
val insnList = method.instructions;
for (val node : method.localVariables) {
if (node.desc.equals("[B") && node.index == memory.biomeArrayIndex) {
node.desc = "[S";
}
}
val getBiomeArray = memory.getBiomeArrayInsn;
insnList.set(getBiomeArray,
new MethodInsnNode(Opcodes.INVOKEVIRTUAL, getBiomeArray.owner, "getBiomeShortArray",
"()[S", false));
insnList.set(memory.castInsn, new InsnNode(Opcodes.I2S));
insnList.set(memory.arrayStoreInsn, new InsnNode(Opcodes.SASTORE));
patchStackFrames(memory, method, cn);
}
}
if (!patched) {
Share.logger.debug("[ChunkProvider patcher]: No matches found in class! This is not explicitly " +
"an error, because the patch might be applied by a mixin instead!");
}
return patched;
}
private static void patchStackFrames(Memory memory, MethodNode method, ClassNode owner) {
memory.locals.clear();
memory.initLocals(method, owner);
for (val frame: memory.framesLeaveUnpatched)
memory.updateLocalsState(frame);
int localToPatch = memory.biomeArrayIndex;
for (val frame: memory.framesToPatch) {
int currentLocalIndex = memory.locals.size() - 1;
if (frame.local != null) {
switch (frame.type) {
case Opcodes.F_NEW:
case Opcodes.F_FULL:
if (frame.local.size() > localToPatch &&
"[B".equals(frame.local.get(localToPatch))) {
frame.local.set(localToPatch, "[S");
}
break;
case Opcodes.F_APPEND:
if (currentLocalIndex < localToPatch &&
(currentLocalIndex + frame.local.size()) >= localToPatch) {
int indexInFrame = localToPatch - currentLocalIndex - 1;
if ("[B".equals(frame.local.get(indexInFrame))) {
frame.local.set(indexInFrame, "[S");
}
}
}
}
memory.updateLocalsState(frame);
}
}
public interface State<T extends AbstractInsnNode> extends BiFunction<T, Memory, State<AbstractInsnNode>> {
}
@Data
private static class Memory {
final List<Object> locals = new ArrayList<>();
List<Object> localsAtPatchStart;
List<FrameNode> framesLeaveUnpatched = new ArrayList<>();
List<FrameNode> framesToPatch = new ArrayList<>();
boolean patchingFrames;
VarInsnNode startingInsn;
MethodInsnNode getBiomeArrayInsn;
InsnNode castInsn;
InsnNode arrayStoreInsn;
int chunkIndex;
int biomeArrayIndex;
int iteratorIndex;
public void startPatchingFrames() {
localsAtPatchStart = new ArrayList<>(locals);
patchingFrames = true;
}
public void recordFrame(FrameNode frame) {
if (patchingFrames)
framesToPatch.add(frame);
else
framesLeaveUnpatched.add(frame);
}
public void reset() {
localsAtPatchStart = null;
framesLeaveUnpatched.addAll(framesToPatch);
framesToPatch.clear();
patchingFrames = false;
startingInsn = null;
getBiomeArrayInsn = null;
castInsn = null;
arrayStoreInsn = null;
chunkIndex = 0;
biomeArrayIndex = 0;
iteratorIndex = 0;
}
private static int getDescriptorNameEnd(String desc, int index) {
val c = desc.charAt(index);
switch (c) {
case '[':
return getDescriptorNameEnd(desc, index + 1);
case 'L':
do {
index++;
} while (desc.charAt(index) != ';');
default:
return index + 1;
}
}
private static List<Object> parseDesc(String desc) {
val result = new ArrayList<Object>();
desc = desc.substring(1, desc.indexOf(')'));
for (int i = 0; i < desc.length(); i++) {
val end = getDescriptorNameEnd(desc, i);
val name = desc.substring(i, end);
switch (name) {
case "I":
case "S":
case "B":
case "Z":
result.add(Opcodes.INTEGER);
break;
case "F":
result.add(Opcodes.FLOAT);
break;
case "D":
result.add(Opcodes.DOUBLE);
result.add(Opcodes.DOUBLE);
break;
case "J":
result.add(Opcodes.LONG);
result.add(Opcodes.LONG);
break;
default:
result.add(name);
}
i = end - 1;
}
return result;
}
public void initLocals(MethodNode method, ClassNode owner) {
locals.clear();
if ((method.access & Opcodes.ACC_STATIC) == 0) {
locals.add("L" + owner.name + ";");
}
locals.addAll(parseDesc(method.desc));
}
public void updateLocalsState(FrameNode frame) {
switch (frame.type) {
case Opcodes.F_NEW:
case Opcodes.F_FULL:
locals.clear();
case Opcodes.F_APPEND:
if (frame.local != null) {
for (val local : frame.local) {
if (Objects.equals(local, Opcodes.DOUBLE) || Objects.equals(local, Opcodes.LONG))
locals.add(local);
locals.add(local);
}
}
break;
case Opcodes.F_CHOP: {
int removeCount = frame.local.size();
for (int i = removeCount - 1; i >= 0 && !locals.isEmpty(); i--) {
val removed = locals.remove(locals.size() - 1);
if (Objects.equals(removed, Opcodes.DOUBLE) || Objects.equals(removed, Opcodes.LONG))
locals.remove(locals.size() - 1);
}
break;
}
case Opcodes.F_SAME:
case Opcodes.F_SAME1:
break;
}
}
}
}
@@ -0,0 +1,63 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.asm.transformer.chunk;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.lib.turboasm.ClassNodeHandle;
import com.falsepattern.lib.turboasm.TurboClassTransformer;
import lombok.val;
import org.jetbrains.annotations.NotNull;
import org.objectweb.asm.Opcodes;
public class LOTRFieldExposer implements TurboClassTransformer {
@Override
public String owner() {
return Tags.MODNAME;
}
@Override
public String name() {
return "LOTRFieldExposer";
}
@Override
public boolean shouldTransformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
return "lotr.common.network.LOTRPacketBiomeVariantsWatch".equals(className);
}
@Override
public boolean transformClass(@NotNull String className, @NotNull ClassNodeHandle classNode) {
val cn = classNode.getNode();
if (cn == null)
return false;
for (val field: cn.fields) {
if ("chunkX".equals(field.name) ||
"chunkZ".equals(field.name) ||
"variants".equals(field.name)) {
field.access &= ~Opcodes.ACC_PRIVATE;
field.access |= Opcodes.ACC_PUBLIC;
}
}
return true;
}
}
@@ -0,0 +1,74 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.config;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.lib.config.Config;
import com.falsepattern.lib.config.ConfigurationManager;
@Config(modid = Tags.MODID,
category = "darkworld")
public class DarkWorldIDConfig {
@Config.Comment("Original: 100")
@Config.RangeInt(min = 40,
max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1100)
public static int darkOceanID;
@Config.Comment("Original: 101")
@Config.RangeInt(min = 40,
max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1101)
public static int darkPlainsID;
@Config.Comment("Original: 102")
@Config.RangeInt(min = 40,
max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1102)
public static int darkDesertID;
@Config.Comment("Original: 103")
@Config.RangeInt(min = 40,
max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1103)
public static int darkHillsID;
@Config.Comment("Original: 104")
@Config.RangeInt(min = 40,
max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1104)
public static int darkForestID;
@Config.Comment("Original: 105")
@Config.RangeInt(min = 40,
max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1105)
public static int darkTaigaID;
@Config.Comment("Original: 106")
@Config.RangeInt(min = 40,
max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(1106)
public static int darkSwampID;
static {
ConfigurationManager.selfInit();
}
}
@@ -0,0 +1,42 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.config;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.lib.config.Config;
import com.falsepattern.lib.config.ConfigurationManager;
@Config(modid = Tags.MODID,
category = "futurepack")
public class FuturepackIDConfig {
@Config.Comment("Original: 97")
@Config.RangeInt(min = 40,
max = ExtendedConstants.biomeIDCount - 1)
@Config.DefaultInt(2097)
public static int spaceID;
static {
ConfigurationManager.selfInit();
}
}
@@ -0,0 +1,129 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.config;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.lib.config.Config;
import com.falsepattern.lib.config.ConfigurationManager;
@Config(modid = Tags.MODID)
@Config.Comment({"WARNING: THIS CONFIG IS EXTREMELY SENSITIVE TO CHANGES, DISABLING STUFF ONCE THEY HAVE BEEN ENABLED",
"CAN CORRUPT YOUR WORLD! ONLY TOUCH THIS FILE IF YOU KNOW WHAT YOU'RE DOING!",
"This file should only be edited by modpack developers to fine-tune it for the modpack. Once an option",
"has been enabled, it modifies the chunk save data format, which is (partially) compatible with",
"vanilla, but removing the mod might cause block/item corruption for higher IDs.",
"Additional note: Every client and server must have the exact same config, this also affects netcode."})
public class GeneralConfig {
@Config.Comment("Throw an exception when an invalid block is registered. FOR DEBUGGING PURPOSES")
@Config.DefaultBoolean(false)
public static boolean catchUnregisteredBlocks;
@Config.Comment("Remove invalid (corrupted) blocks from the game. FOR DEBUGGING PURPOSES")
@Config.DefaultBoolean(false)
public static boolean removeInvalidBlocks;
@Config.Comment("Extend Biome IDs. Vanilla limit is 256, new limit is 65536.")
@Config.DefaultBoolean(true)
public static boolean extendBiome;
@Config.Comment({"Extend Block and Item IDs. Vanilla limit is 4096/32000, new limit is 16777216 for both.",
"See also: extraBlockIDBits/extraItemIDBits"})
@Config.DefaultBoolean(true)
public static boolean extendBlockItem;
@Config.Comment("Extend DataWatcher IDs. Vanilla limit is 32, new limit is 65536.")
@Config.DefaultBoolean(true)
public static boolean extendDataWatcher;
@Config.Comment("Extend Enchantment IDs. Vanilla limit is 256, new limit is 32768.")
@Config.DefaultBoolean(true)
public static boolean extendEnchantment;
@Config.Comment("Extend Potion IDs. Vanilla limit is 32, new limit is 65536.")
@Config.DefaultBoolean(true)
public static boolean extendPotion;
@Config.Comment("Extend Entity IDs. Vanilla limit is 256, new limit is 32768.")
@Config.DefaultBoolean(true)
public static boolean extendEntity;
@Config.Comment({"Improves the speed of the block registry by multiple orders of magnitudes.",
"It's highly recommended to leave this enabled, especially when using a lot of IDs.",
"With this disabled, registering 1 million blocks on a test system took 80 minutes",
"With this enabled, registering 1 million blocks on the same system took 7 seconds"})
@Config.DefaultBoolean(true)
public static boolean enableRegistryPerformanceTweak;
@Config.Comment({"Extends the maximum redstone signal strength.",
"Only has effect with extendBlockItem enabled.",
"WARNING: THIS IS HERE ONLY FOR FUN, IT **WILL** CORRUPT YOUR SAVE IF ENABLED! YOU HAVE BEEN WARNED."})
@Config.DefaultBoolean(false)
public static boolean extendRedstone;
@Config.Comment({"Increases the max signal strength of redstone.",
"Only has effect with both extendBlockItem and extendRedstone enabled.",
"Vanilla value is 15."})
@Config.RangeInt(min = 15,
max = 127)
@Config.DefaultInt(15)
public static int maxRedstone;
@Config.Comment({"Use this to tune the amount of available block IDs.",
"Minecraft contains some internal code that uses a HUGE amount of RAM with too many block IDs available.",
"Notice: This does not affect ITEM IDs.",
"The vanilla default is 4k block IDs, while the maximum is 16 million.",
"The default setting sets it to 32k (8x vanilla).",
"increase if necessary (when running out of BLOCK IDs in your modpack)",
"Only effective if extendBlockItem is enabled.",
"Effective values: (0: 4k, 1: 8k, 2: 16k, 3: 32k, 4: 64k, 5: 128k, 6: 256k, 7: 512k, 8: 1M, 9: 2M, 10: 4M, 11: 8M, 12: 16M)",
"The effective value of this variable must always be smaller or equal to the effective value of extraItemIDBits"})
@Config.RangeInt(min = 0,
max = 12)
@Config.DefaultInt(3)
public static int extraBlockIDBits;
@Config.Comment({"Use this to tune the amount of available item IDs.",
"Minecraft contains some internal code that uses a HUGE amount of RAM with too many block IDs available.",
"The vanilla default is 32k item IDs, while the maximum is 16 million.",
"The default setting sets it to 64k (2x vanilla).",
"increase if necessary (when running out of ITEM IDs in your modpack)",
"Only effective if extendBlockItem is enabled.",
"Effective values: (0: 32k, 1: 64k, 2: 128k, 3: 256k, 4: 512k, 5: 1M, 6: 2M, 7: 4M, 8: 8M, 9: 16M)",
"The effective value of this variable must always be equal or larger than the effective value of extraBlockIDBits"})
@Config.RangeInt(min = 0,
max = 9)
@Config.DefaultInt(1)
public static int extraItemIDBits;
@Config.Comment({"Older versions of EndlessIDs used to have a \"biome conflict avoidance\" system for automatic biome",
"registration logic in some mods conflicting with biome mutations due to the way those get registered.",
"It has been disabled in newer releases because it caused more issues than it solved.",
"You should use AntiIDConflict to fix those, however, the option is still available here in case you need it."})
@Config.DefaultBoolean(false)
public static boolean biomeConflictAvoidancePlaceholders;
static {
ConfigurationManager.selfInit();
}
}
@@ -1,32 +1,80 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.constants; package com.falsepattern.endlessids.constants;
import com.falsepattern.endlessids.config.GeneralConfig;
@SuppressWarnings("unused")
public class ExtendedConstants { public class ExtendedConstants {
//Tunables //Tunables
public static final int bitsPerID = 24; public static final int bitsPerID = 24;
public static final int bitsPerMetadata = 4; public static final int bitsPerMetadata = 16;
public static final int countCorrectionBits = 0; public static final int countCorrectionItemBits = 9 - GeneralConfig.extraItemIDBits;
public static final int countCorrectionBlockBits = 12 - GeneralConfig.extraBlockIDBits;
public static final int watchableBits = 7; public static final int watchableBits = 16;
public static final int bitsPerBiome = 16;
//IDs public static final int maximumPotionIDs = 65536;
public static final int potionIDMask = 0xFFFF;
public static final int maximumEnchantmentIDs = 32768;
public static final int blocksPerSubChunk = 16 * 16 * 16;
public static final int subChunkNibbleArraySize = 16 * 16 * 16;
//Align with max item metadata for spawn eggs. Will be treated as short in netcode
public static final int bitsPerEntity = 15;
//BlockItemIDs
public static final int nibblesPerID = bitsPerID / 4; public static final int nibblesPerID = bitsPerID / 4;
public static final int nibblesPerMetadata = bitsPerMetadata / 4;
public static final int bytesPerID = (nibblesPerID + 1) / 2; public static final int bytesPerID = (nibblesPerID + 1) / 2;
public static final int nibblesPerMetadata = bitsPerMetadata / 4;
public static final int bytesPerIDPlusMetadata = (nibblesPerID + nibblesPerMetadata + 1) / 2; public static final int bytesPerIDPlusMetadata = (nibblesPerID + nibblesPerMetadata + 1) / 2;
public static final int blockIDMask = (1 << bitsPerID) - 1; public static final int blockIDMask = (1 << bitsPerID) - 1;
public static final int blockIDCount = 1 << (bitsPerID - countCorrectionBits); public static final int blockIDCount = 1 << (bitsPerID - countCorrectionBlockBits);
public static final int maxBlockID = blockIDCount - 1; public static final int maxBlockID = blockIDCount - 1;
public static final int itemIDCount = 1 << (bitsPerID - countCorrectionItemBits);
public static final int maxItemID = itemIDCount - 1;
public static final int bitsPerBlock = 8 + bitsPerID + bitsPerMetadata; public static final int bitsPerBlock = 8 + bitsPerID + bitsPerMetadata;
public static final int nibblesPerBlock = bitsPerBlock / 4; public static final int nibblesPerBlock = bitsPerBlock / 4;
public static final int nibblesPerEBS = nibblesPerBlock * 16 * 16 * 16; public static final int nibblesPerSubChunk = nibblesPerBlock * 16 * 16 * 16;
public static final int bytesPerEBS = nibblesPerEBS / 2; public static final int bytesPerSubChunk = (nibblesPerSubChunk + 1) / 2;
public static final int bytesPerChunk = 256 + bytesPerEBS * 16;
//BiomeIDs
public static final int biomeIDCount = 1 << bitsPerBiome;
public static final int biomeIDMask = biomeIDCount - 1;
public static final int biomeIDNull = biomeIDMask;
public static final int bytesPerBiome = (bitsPerBiome + 7) / 8;
//DataWatcher //DataWatcher
public static final int watchableCount = 1 << watchableBits; public static final int watchableCount = 1 << watchableBits;
public static final int maxWatchableID = watchableCount - 1; public static final int maxWatchableID = watchableCount - 1;
public static final int watchableMask = (0x7 << watchableBits) | maxWatchableID;
//EntityIDs
public static final int entityIDCount = 1 << bitsPerEntity;
public static final int entityIDMask = entityIDCount - 1;
public static final int maxEntityID = entityIDMask;
} }
@@ -1,5 +1,28 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.constants; package com.falsepattern.endlessids.constants;
@SuppressWarnings("unused")
public class VanillaConstants { public class VanillaConstants {
//Tunables //Tunables
public static final int bitsPerID = 12; public static final int bitsPerID = 12;
@@ -7,26 +30,40 @@ public class VanillaConstants {
public static final int countCorrectionBits = 0; public static final int countCorrectionBits = 0;
public static final int watchableBits = 5; public static final int watchableBits = 5;
public static final int bitsPerBiome = 8;
//IDs public static final int bitsPerEntity = 8;
//BlockItemIDs
public static final int nibblesPerID = bitsPerID / 4; public static final int nibblesPerID = bitsPerID / 4;
public static final int nibblesPerMetadata = bitsPerMetadata / 4;
public static final int bytesPerID = (nibblesPerID + 1) / 2; public static final int bytesPerID = (nibblesPerID + 1) / 2;
public static final int nibblesPerMetadata = bitsPerMetadata / 4;
public static final int bytesPerIDPlusMetadata = (nibblesPerID + nibblesPerMetadata + 1) / 2; public static final int bytesPerIDPlusMetadata = (nibblesPerID + nibblesPerMetadata + 1) / 2;
public static final int blockIDMask = (1 << bitsPerID) - 1; public static final int blockIDMask = (1 << bitsPerID) - 1;
public static final int blockIDCount = 1 << (bitsPerID - countCorrectionBits); public static final int blockIDCount = 1 << (bitsPerID - countCorrectionBits);
public static final int maxBlockID = blockIDCount - 1; public static final int maxBlockID = blockIDCount - 1;
public static final int itemIDCount = 32000;
public static final int maxItemID = itemIDCount - 1;
public static final int bitsPerBlock = 8 + bitsPerID + bitsPerMetadata; public static final int bitsPerBlock = 8 + bitsPerID + bitsPerMetadata;
public static final int nibblesPerBlock = bitsPerBlock / 4; public static final int nibblesPerBlock = bitsPerBlock / 4;
public static final int nibblesPerEBS = nibblesPerBlock * 16 * 16 * 16; public static final int nibblesPerSubChunk = nibblesPerBlock * 16 * 16 * 16;
public static final int bytesPerEBS = nibblesPerEBS / 2; public static final int bytesPerSubChunk = (nibblesPerSubChunk + 1) / 2;
public static final int bytesPerChunk = 256 + bytesPerEBS * 16;
//BiomeIDs
public static final int biomeIDCount = 1 << bitsPerBiome;
public static final int biomeIDMask = biomeIDCount - 1;
public static final int biomeIDNull = biomeIDMask;
public static final int bytesPerBiome = (bitsPerBiome + 7) / 8;
//DataWatcher //DataWatcher
public static final int watchableCount = 1 << watchableBits; public static final int watchableCount = 1 << watchableBits;
public static final int maxWatchableID = watchableCount - 1; public static final int maxWatchableID = watchableCount - 1;
public static final int watchableMask = (0x7 << watchableBits) | maxWatchableID; public static final int watchableMask = (0x7 << watchableBits) | maxWatchableID;
//EntityIDs
public static final int entityIDCount = 1 << bitsPerEntity;
public static final int maxEntityID = entityIDCount - 1;
} }
@@ -0,0 +1,29 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.containers;
public class BiomeContainer extends _Dummy {
public BiomeContainer() {
super("biome", "Biome");
}
}
@@ -0,0 +1,29 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.containers;
public class BlockItemContainer extends _Dummy {
public BlockItemContainer() {
super("blockitem", "BlockItem");
}
}
@@ -0,0 +1,29 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.containers;
public class DataWatcherContainer extends _Dummy {
public DataWatcherContainer() {
super("datawatcher", "DataWatcher");
}
}
@@ -0,0 +1,29 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.containers;
public class EnchantmentContainer extends _Dummy {
public EnchantmentContainer() {
super("enchantment", "Enchantment");
}
}
@@ -0,0 +1,29 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.containers;
public class PotionContainer extends _Dummy {
public PotionContainer() {
super("potion", "Potion");
}
}
@@ -0,0 +1,53 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.containers;
import com.falsepattern.endlessids.Tags;
import com.google.common.eventbus.EventBus;
import lombok.val;
import cpw.mods.fml.common.DummyModContainer;
import cpw.mods.fml.common.LoadController;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
public class _Dummy extends DummyModContainer {
public _Dummy(String id, String name) {
super(createMetadata(id, name));
}
private static ModMetadata createMetadata(String id, String name) {
val meta = new ModMetadata();
meta.modId = Tags.MODID + "_" + id;
meta.name = Tags.MODNAME + " " + name + " Module";
meta.version = Tags.VERSION;
meta.dependencies.add(new DefaultArtifactVersion(Tags.MODID, Tags.VERSION));
meta.parent = Tags.MODID;
return meta;
}
@Override
public boolean registerBus(EventBus bus, LoadController controller) {
return true;
}
}
@@ -0,0 +1,131 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.managers;
import com.falsepattern.chunk.api.ArrayUtil;
import com.falsepattern.chunk.api.DataManager;
import com.falsepattern.endlessids.Hooks;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.mixin.helpers.ChunkBiomeHook;
import lombok.val;
import lombok.var;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.chunk.Chunk;
import java.nio.ByteBuffer;
//NOTE: Also change the save logic in MapWriter mod if changing this
public class BiomeManager implements DataManager.PacketDataManager, DataManager.ChunkDataManager {
@Override
public String domain() {
return Tags.MODID;
}
@Override
public String id() {
return "biome";
}
@Override
public int maxPacketSize() {
return 2 * 16 * 16;
}
@Override
public void writeToBuffer(Chunk chunk, int subChunkMask, boolean forceUpdate, ByteBuffer data) {
data.asShortBuffer().put(((ChunkBiomeHook)chunk).getBiomeShortArray());
data.position(data.position() + maxPacketSize());
}
@Override
public void readFromBuffer(Chunk chunk, int subChunkMask, boolean forceUpdate, ByteBuffer buffer) {
var arr = ((ChunkBiomeHook)chunk).getBiomeShortArray();
if (arr == null) {
arr = new short[16 * 16];
((ChunkBiomeHook)chunk).setBiomeShortArray(arr);
}
buffer.asShortBuffer().get(arr);
buffer.position(buffer.position() + maxPacketSize());
}
@Override
public boolean chunkPrivilegedAccess() {
return true;
}
@Override
public void writeChunkToNBT(Chunk chunk, NBTTagCompound nbt) {
byte[] arr = Hooks.shortToByteArray(((ChunkBiomeHook)chunk).getBiomeShortArray());
nbt.setByteArray("Biomes16v2", arr);
}
@Override
public void readChunkFromNBT(Chunk chunk, NBTTagCompound nbt) {
var data = ((ChunkBiomeHook) chunk).getBiomeShortArray();
if (data == null) {
data = new short[16 * 16];
((ChunkBiomeHook)chunk).setBiomeShortArray(data);
}
if (nbt.hasKey("Biomes16v2", 7)) {
Hooks.byteToShortArray(nbt.getByteArray("Biomes16v2"), 0, data, 0, data.length * 2);
} else if (nbt.hasKey("Biomes16", 7)) { //NotEnoughBiomes DFU
Hooks.byteToShortArrayLegacy(nbt.getByteArray("Biomes16"), data);
} else if (nbt.hasKey("Biomes", 7)) { //Vanilla DFU
Hooks.scatter(nbt.getByteArray("Biomes"), data);
}
}
@Override
public void cloneChunk(Chunk fromVanilla, Chunk toVanilla) {
val from = (ChunkBiomeHook) fromVanilla;
val to = (ChunkBiomeHook) toVanilla;
to.setBiomeShortArray(ArrayUtil.copyArray(from.getBiomeShortArray(), to.getBiomeShortArray()));
}
@Override
public @NotNull String version() {
return Tags.MODID;
}
@Override
public @Nullable String newInstallDescription() {
return "EndlessIDs extended biome data. Vanilla biome data is limited to 256 biomes. This allows for 65536 biomes.";
}
@Override
public @NotNull String uninstallMessage() {
return "EndlessIDs extended biome data has been uninstalled. Biomes are limited to 256,\n" +
"and any biomes with IDs above 255 in the save will be corrupted.";
}
@Override
public @Nullable String versionChangeMessage(String priorVersion) {
return null;
}
}
@@ -0,0 +1,335 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.managers;
import com.falsepattern.chunk.api.ArrayUtil;
import com.falsepattern.chunk.api.DataManager;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.mixin.helpers.SubChunkBlockHook;
import lombok.val;
import lombok.var;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.server.S23PacketBlockChange;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.NibbleArray;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import java.nio.ByteBuffer;
import static com.falsepattern.endlessids.constants.ExtendedConstants.blocksPerSubChunk;
import static com.falsepattern.endlessids.util.DataUtil.*;
//NOTE: Also change the save logic in MapWriter mod if changing this
public class BlockIDManager implements DataManager.PacketDataManager, DataManager.CubicPacketDataManager, DataManager.SubChunkDataManager, DataManager.BlockPacketDataManager {
@Override
public String domain() {
return Tags.MODID;
}
@Override
public String id() {
return "blockid";
}
@Override
public int maxPacketSize() {
return 3 * 16 * 16 * 16 * 16 + 4;
}
@Override
public void writeToBuffer(Chunk chunk, int subChunkMask, boolean forceUpdate, ByteBuffer data) {
val subChunkList = chunk.getBlockStorageArray();
int storageFlags = 0;
val start = data.position() + 4;
data.position(start);
for (int i = 0; i < 16; i++) {
if ((subChunkMask & (1 << i)) == 0 || subChunkList[i] == null) {
continue;
}
val subChunk = (SubChunkBlockHook) subChunkList[i];
storageFlags |= subChunk.eid$getBlockMask() << (i * 2);
val b1 = subChunk.eid$getB1();
data.put(b1);
val b2Low = subChunk.eid$getB2Low();
if (b2Low == null) {
continue;
}
data.put(b2Low.data);
val b2High = subChunk.eid$getB2High();
if (b2High == null) {
continue;
}
data.put(b2High.data);
val b3 = subChunk.eid$getB3();
if (b3 != null) {
data.put(b3);
}
}
data.putInt(start - 4, storageFlags);
}
@Override
public void readFromBuffer(Chunk chunk, int subChunkMask, boolean forceUpdate, ByteBuffer buffer) {
val subChunkList = chunk.getBlockStorageArray();
val storageFlags = buffer.getInt();
for (int i = 0; i < 16; i++) {
if ((subChunkMask & (1 << i)) == 0 || subChunkList[i] == null) {
continue;
}
val subChunk = (SubChunkBlockHook) subChunkList[i];
val storageFlag = (storageFlags >>> (i * 2)) & 3;
val b1 = subChunk.eid$getB1();
buffer.get(b1);
if (storageFlag == 0b00) {
subChunk.eid$setB2Low(null);
subChunk.eid$setB2High(null);
subChunk.eid$setB3(null);
continue;
}
var b2Low = subChunk.eid$getB2Low();
if (b2Low == null) {
b2Low = subChunk.eid$createB2Low();
}
buffer.get(b2Low.data);
if (storageFlag == 0b01) {
subChunk.eid$setB2High(null);
subChunk.eid$setB3(null);
continue;
}
var b2High = subChunk.eid$getB2High();
if (b2High == null) {
b2High = subChunk.eid$createB2High();
}
buffer.get(b2High.data);
if (storageFlag == 0b10) {
subChunk.eid$setB3(null);
continue;
}
var b3 = subChunk.eid$getB3();
if (b3 == null) {
b3 = subChunk.eid$createB3();
}
buffer.get(b3);
}
}
@Override
public boolean subChunkPrivilegedAccess() {
return true;
}
@Override
public void writeSubChunkToNBT(Chunk chunk, ExtendedBlockStorage subChunkVanilla, NBTTagCompound nbt) {
val subChunk = (SubChunkBlockHook) subChunkVanilla;
val b1 = subChunk.eid$getB1();
val b2Low = subChunk.eid$getB2Low();
val b2High = subChunk.eid$getB2High();
val b3 = subChunk.eid$getB3();
nbt.setByteArray("Blocks", b1);
if (b2Low != null) {
nbt.setByteArray("Add", b2Low.data);
}
if (b2High != null) {
nbt.setByteArray("BlocksB2Hi", b2High.data);
}
if (b3 != null) {
nbt.setByteArray("BlocksB3", b3);
}
}
//NotEnoughIDs world compatibility
public static void readSubChunkFromNBTNotEnoughIDsDFU(SubChunkBlockHook subChunk, NBTTagCompound nbt) {
val data = nbt.getByteArray("Blocks16");
val dataShort = new short[data.length >>> 1];
ByteBuffer.wrap(data).asShortBuffer().get(dataShort);
val b1 = new byte[blocksPerSubChunk];
val b2L = new byte[blocksPerSubChunk >>> 1];
val b2H = new byte[blocksPerSubChunk >>> 1];
for (int i = 0; i < dataShort.length; i++) {
val s = dataShort[i];
val nI = i >>> 1;
val mI = (i & 1) * 4;
b1[i] = (byte) (s & 0x00FF);
b2L[nI] |= (byte) (((s & 0x0F00) >>> 8) << mI);
b2H[nI] |= (byte) (((s & 0xF000) >>> 12) << mI);
}
subChunk.eid$setB1(b1);
subChunk.eid$setB2Low(new NibbleArray(b2L, 4));
subChunk.eid$setB2High(new NibbleArray(b2H, 4));
}
@Override
public void readSubChunkFromNBT(Chunk chunk, ExtendedBlockStorage subChunkVanilla, NBTTagCompound nbt) {
val subChunk = (SubChunkBlockHook) subChunkVanilla;
if (nbt.hasKey("Blocks16")) {
readSubChunkFromNBTNotEnoughIDsDFU(subChunk, nbt);
return;
}
assert nbt.hasKey("Blocks");
val b1 = nbt.getByteArray("Blocks");
final byte[] b2Low = nbt.hasKey("Add") ? nbt.getByteArray("Add") : null;
final byte[] b2High = nbt.hasKey("BlocksB2Hi") ? nbt.getByteArray("BlocksB2Hi") : null;
final byte[] b3 = nbt.hasKey("BlocksB3") ? nbt.getByteArray("BlocksB3") : null;
subChunk.eid$setB1(ensureSubChunkByteArray(b1));
subChunk.eid$setB2Low(ensureSubChunkNibbleArray(b2Low));
subChunk.eid$setB2High(ensureSubChunkNibbleArray(b2High));
subChunk.eid$setB3(ensureSubChunkByteArray(b3));
}
@Override
public void cloneSubChunk(Chunk fromChunk, ExtendedBlockStorage fromVanilla, ExtendedBlockStorage toVanilla) {
val from = (SubChunkBlockHook) fromVanilla;
val to = (SubChunkBlockHook) toVanilla;
to.eid$setB1(ArrayUtil.copyArray(from.eid$getB1(), to.eid$getB1()));
to.eid$setB2Low(ArrayUtil.copyArray(from.eid$getB2Low(), to.eid$getB2Low()));
to.eid$setB2High(ArrayUtil.copyArray(from.eid$getB2High(), to.eid$getB2High()));
to.eid$setB3(ArrayUtil.copyArray(from.eid$getB3(), to.eid$getB3()));
}
@Override
public @NotNull String version() {
return Tags.VERSION;
}
@Override
public @Nullable String newInstallDescription() {
return "EndlessIDs extended block IDs. Vanilla worlds can be converted to EndlessIDs worlds safely.";
}
@Override
public @NotNull String uninstallMessage() {
return "EndlessIDs extended block IDs removed. Any blocks with IDs above 4095 will get corrupted.";
}
@Override
public @Nullable String versionChangeMessage(String priorVersion) {
return null;
}
@Override
public void writeBlockToPacket(Chunk chunk, int x, int y, int z, S23PacketBlockChange packet) {
}
@Override
public void readBlockFromPacket(Chunk chunk, int x, int y, int z, S23PacketBlockChange packet) {
}
@Override
public void writeBlockPacketToBuffer(S23PacketBlockChange packet, PacketBuffer buffer) {
buffer.writeInt(Block.getIdFromBlock(packet.field_148883_d));
}
@Override
public void readBlockPacketFromBuffer(S23PacketBlockChange packet, PacketBuffer buffer) {
packet.field_148883_d = Block.getBlockById(buffer.readInt());
}
@Override
public int maxPacketSizeCubic() {
return 3 * 16 * 16 * 16 + 4;
}
@Override
public void writeToBuffer(Chunk chunk, ExtendedBlockStorage extendedBlockStorage, ByteBuffer data) {
val subChunk = (SubChunkBlockHook) extendedBlockStorage;
data.put((byte) subChunk.eid$getBlockMask());
val b1 = subChunk.eid$getB1();
data.put(b1);
val b2Low = subChunk.eid$getB2Low();
if (b2Low == null) return;
data.put(b2Low.data);
val b2High = subChunk.eid$getB2High();
if (b2High == null) return;
data.put(b2High.data);
val b3 = subChunk.eid$getB3();
if (b3 != null) {
data.put(b3);
}
}
@Override
public void readFromBuffer(Chunk chunk, ExtendedBlockStorage extendedBlockStorage, ByteBuffer data) {
val subChunk = (SubChunkBlockHook) extendedBlockStorage;
val storageFlag = data.get();
val b1 = subChunk.eid$getB1();
data.get(b1);
if (storageFlag == 0b00) {
subChunk.eid$setB2Low(null);
subChunk.eid$setB2High(null);
subChunk.eid$setB3(null);
return;
}
var b2Low = subChunk.eid$getB2Low();
if (b2Low == null) {
b2Low = subChunk.eid$createB2Low();
}
data.get(b2Low.data);
if (storageFlag == 0b01) {
subChunk.eid$setB2High(null);
subChunk.eid$setB3(null);
return;
}
var b2High = subChunk.eid$getB2High();
if (b2High == null) {
b2High = subChunk.eid$createB2High();
}
data.get(b2High.data);
if (storageFlag == 0b10) {
subChunk.eid$setB3(null);
return;
}
var b3 = subChunk.eid$getB3();
if (b3 == null) {
b3 = subChunk.eid$createB3();
}
data.get(b3);
}
}
@@ -0,0 +1,292 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.managers;
import com.falsepattern.chunk.api.ArrayUtil;
import com.falsepattern.chunk.api.DataManager;
import com.falsepattern.endlessids.Tags;
import com.falsepattern.endlessids.mixin.helpers.SubChunkBlockHook;
import com.falsepattern.endlessids.util.DataUtil;
import lombok.val;
import lombok.var;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.server.S23PacketBlockChange;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.NibbleArray;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import java.nio.ByteBuffer;
import static com.falsepattern.endlessids.constants.ExtendedConstants.blocksPerSubChunk;
//NOTE: Also change the save logic in MapWriter mod if changing this
public class BlockMetaManager implements DataManager.PacketDataManager, DataManager.CubicPacketDataManager, DataManager.SubChunkDataManager, DataManager.BlockPacketDataManager {
@Override
public String domain() {
return Tags.MODID;
}
@Override
public String id() {
return "metadata";
}
@Override
public int maxPacketSize() {
return 2 * 16 * 16 * 16 * 16 + 4;
}
@Override
public void writeToBuffer(Chunk chunk, int subChunkMask, boolean forceUpdate, ByteBuffer data) {
val subChunkList = chunk.getBlockStorageArray();
int storageFlags = 0;
val start = data.position() + 4;
data.position(start);
for (int i = 0; i < 16; i++) {
if ((subChunkMask & (1 << i)) == 0 || subChunkList[i] == null) {
continue;
}
val subChunk = (SubChunkBlockHook) subChunkList[i];
storageFlags |= subChunk.eid$getMetadataMask() << (i * 2);
val m1Low = subChunk.eid$getM1Low();
data.put(m1Low.data);
val m1High = subChunk.eid$getM1High();
if (m1High == null) {
continue;
}
data.put(m1High.data);
val m2 = subChunk.eid$getM2();
if (m2 != null) {
data.put(m2);
}
}
data.putInt(start - 4, storageFlags);
}
@Override
public void readFromBuffer(Chunk chunk, int subChunkMask, boolean forceUpdate, ByteBuffer buffer) {
val subChunkList = chunk.getBlockStorageArray();
val storageFlags = buffer.getInt();
for (int i = 0; i < 16; i++) {
if ((subChunkMask & (1 << i)) == 0 || subChunkList[i] == null) {
continue;
}
val subChunk = (SubChunkBlockHook) subChunkList[i];
val storageFlag = (storageFlags >>> (i * 2)) & 3;
val m1Low = subChunk.eid$getM1Low();
buffer.get(m1Low.data);
if (storageFlag == 0b01) {
subChunk.eid$setM1High(null);
subChunk.eid$setM2(null);
continue;
}
var m1High = subChunk.eid$getM1High();
if (m1High == null) {
m1High = subChunk.eid$createM1High();
}
buffer.get(m1High.data);
if (storageFlag == 0b10) {
subChunk.eid$setM2(null);
continue;
}
var m2 = subChunk.eid$getM2();
if (m2 == null) {
m2 = subChunk.eid$createM2();
}
buffer.get(m2);
}
}
@Override
public boolean subChunkPrivilegedAccess() {
return true;
}
@Override
public void writeSubChunkToNBT(Chunk chunk, ExtendedBlockStorage subChunkVanilla, NBTTagCompound nbt) {
val subChunk = (SubChunkBlockHook) subChunkVanilla;
val m1Low = subChunk.eid$getM1Low();
val m1High = subChunk.eid$getM1High();
val m2 = subChunk.eid$getM2();
nbt.setByteArray("Data", m1Low.data);
if (m1High != null) {
nbt.setByteArray("Data1High", m1High.data);
}
if (m2 != null) {
nbt.setByteArray("Data2", m2);
}
}
//NotEnoughIDs world compatibility
private void readSubChunkFromNBTNotEnoughIDsDFU(SubChunkBlockHook subChunk, NBTTagCompound nbt) {
val data = nbt.getByteArray("Data16");
val dataShort = new short[data.length >>> 1];
ByteBuffer.wrap(data).asShortBuffer().get(dataShort);
val m1Low = new byte[blocksPerSubChunk >>> 1];
val m1High = new byte[blocksPerSubChunk >>> 1];
val m2 = new byte[blocksPerSubChunk];
for (int i = 0; i < dataShort.length; i++) {
val s = dataShort[i];
val nI = i >>> 1;
val mI = (i & 1) * 4;
m1Low[nI] |= (byte) ((s & 0x000F) << mI);
m1High[nI] |= (byte) (((s & 0x00F0) >>> 4) << mI);
m2[i] = (byte) ((s & 0xFF00) >>> 8);
}
subChunk.eid$setM1Low(new NibbleArray(m1Low, 4));
subChunk.eid$setM1High(new NibbleArray(m1High, 4));
subChunk.eid$setM2(m2);
}
@Override
public void readSubChunkFromNBT(Chunk chunk, ExtendedBlockStorage subChunkVanilla, NBTTagCompound nbt) {
val subChunk = (SubChunkBlockHook) subChunkVanilla;
if (nbt.hasKey("Data16")) {
readSubChunkFromNBTNotEnoughIDsDFU(subChunk, nbt);
return;
}
assert nbt.hasKey("Data");
val m1Low = nbt.getByteArray("Data");
final byte[] m1High = nbt.hasKey("Data1High") ? nbt.getByteArray("Data1High") : null;
final byte[] m2 = nbt.hasKey("Data2") ? nbt.getByteArray("Data2") : null;
subChunk.eid$setM1Low(DataUtil.ensureSubChunkNibbleArray(m1Low));
subChunk.eid$setM1High(DataUtil.ensureSubChunkNibbleArray(m1High));
subChunk.eid$setM2(DataUtil.ensureSubChunkByteArray(m2));
}
@Override
public void cloneSubChunk(Chunk fromChunk, ExtendedBlockStorage fromVanilla, ExtendedBlockStorage toVanilla) {
val from = (SubChunkBlockHook) fromVanilla;
val to = (SubChunkBlockHook) toVanilla;
to.eid$setM1Low(ArrayUtil.copyArray(from.eid$getM1Low(), to.eid$getM1Low()));
to.eid$setM1High(ArrayUtil.copyArray(from.eid$getM1High(), to.eid$getM1High()));
to.eid$setM2(ArrayUtil.copyArray(from.eid$getM2(), to.eid$getM2()));
}
@Override
public @NotNull String version() {
return Tags.VERSION;
}
@Override
public @Nullable String newInstallDescription() {
return "EndlessIDs extended block metadata. Vanilla worlds can be converted to EndlessIDs worlds safely.";
}
@Override
public @NotNull String uninstallMessage() {
return "EndlessIDs extended block metadata removed. Any blocks with metadata above 15 will get corrupted.";
}
@Override
public @Nullable String versionChangeMessage(String priorVersion) {
return null;
}
@Override
public void writeBlockToPacket(Chunk chunk, int x, int y, int z, S23PacketBlockChange packet) {
}
@Override
public void readBlockFromPacket(Chunk chunk, int x, int y, int z, S23PacketBlockChange packet) {
}
@Override
public void writeBlockPacketToBuffer(S23PacketBlockChange packet, PacketBuffer buffer) {
buffer.writeShort(packet.field_148884_e & 0xFFFF);
}
@Override
public void readBlockPacketFromBuffer(S23PacketBlockChange packet, PacketBuffer buffer) {
packet.field_148884_e = buffer.readUnsignedShort();
}
@Override
public int maxPacketSizeCubic() {
return 2 * 16 * 16 * 16 + 4;
}
@Override
public void writeToBuffer(Chunk chunk, ExtendedBlockStorage extendedBlockStorage, ByteBuffer data) {
val subChunk = (SubChunkBlockHook) extendedBlockStorage;
data.put((byte) subChunk.eid$getMetadataMask());
val m1Low = subChunk.eid$getM1Low();
data.put(m1Low.data);
val m1High = subChunk.eid$getM1High();
if (m1High == null) return;
data.put(m1High.data);
val m2 = subChunk.eid$getM2();
if (m2 != null) {
data.put(m2);
}
}
@Override
public void readFromBuffer(Chunk chunk, ExtendedBlockStorage extendedBlockStorage, ByteBuffer data) {
val subChunk = (SubChunkBlockHook) extendedBlockStorage;
val storageFlag = data.get();
val m1Low = subChunk.eid$getM1Low();
data.get(m1Low.data);
if (storageFlag == 0b01) {
subChunk.eid$setM1High(null);
subChunk.eid$setM2(null);
return;
}
var m1High = subChunk.eid$getM1High();
if (m1High == null) {
m1High = subChunk.eid$createM1High();
}
data.get(m1High.data);
if (storageFlag == 0b10) {
subChunk.eid$setM2(null);
return;
}
var m2 = subChunk.eid$getM2();
if (m2 == null) {
m2 = subChunk.eid$createM2();
}
data.get(m2);
}
}
@@ -0,0 +1,35 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class AIDCStringFixer {
public static String fixString(String str) {
str = str.replace("\\", "");
str = str.replace("vaible", "vailable");
return str;
}
}
@@ -0,0 +1,56 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers;
import lombok.val;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import java.util.function.IntFunction;
import static com.falsepattern.endlessids.EndlessIDs.FAKE_BIOME_ARRAY_PLACEHOLDER;
import static com.falsepattern.endlessids.EndlessIDs.ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER;
public class BiomePatchHelper {
public static byte[] getBiomeArrayTweaked(Chunk chunk, IntFunction<BiomeGenBase> biomesForGeneration) {
return getBiomeArrayTweaked(chunk, false, biomesForGeneration);
}
public static byte[] getBiomeArrayTweaked(Chunk chunk, boolean fake, IntFunction<BiomeGenBase> biomesForGeneration) {
val chunkBiomes = ((ChunkBiomeHook) chunk).getBiomeShortArray();
for (int i = 0; i < chunkBiomes.length; ++i) {
chunkBiomes[i] = (short) biomesForGeneration.apply(i).biomeID;
}
return fake ? FAKE_BIOME_ARRAY_PLACEHOLDER : ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER;
}
public static byte[] getBiomeArrayTweaked(Chunk chunk, BiomeGenBase[] biomesForGeneration) {
val chunkBiomes = ((ChunkBiomeHook) chunk).getBiomeShortArray();
for (int i = 0; i < chunkBiomes.length; ++i) {
chunkBiomes[i] = (short) biomesForGeneration[i].biomeID;
}
return ZERO_LENGTH_BIOME_ARRAY_PLACEHOLDER;
}
}
@@ -0,0 +1,29 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers;
public interface ChunkBiomeHook {
short[] getBiomeShortArray();
void setBiomeShortArray(short[] data);
}
@@ -0,0 +1,29 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers;
import java.util.BitSet;
public interface EntityRegistryAccessor {
BitSet eids$availableIndicies();
}
@@ -0,0 +1,61 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers;
import com.falsepattern.endlessids.EndlessIDs;
import net.minecraft.world.biome.BiomeGenBase;
import java.lang.reflect.Field;
public class GalaxySpaceHelper {
private static final Field GSSpaceField;
static {
Class<?> clazz;
try {
clazz = Class.forName("galaxyspace.core.world.gen.GSBiomeGenBase");
} catch (ClassNotFoundException ignored) {
EndlessIDs.LOG.warn("Could not find GalaxySpace's GSBiomeGenBase class in the default package. Checking it in the MEGA package.");
try {
clazz = Class.forName("galaxyspace.core.world.GSBiomeGenBase");
} catch (ClassNotFoundException ignored2) {
EndlessIDs.LOG.warn("Could not find GalaxySpace's GSBiomeGenBase class in the MEGA package either. Throwing an exception.");
throw new IllegalStateException("Could not find GSBiomeGenBase class for GalaxySpace!");
}
}
try {
GSSpaceField = clazz.getDeclaredField("GSSpace");
} catch (NoSuchFieldException e) {
throw new IllegalStateException("Could not find GSSpace field in GSBiomeGenBase class for GalaxySpace!");
}
}
public static BiomeGenBase GSSpace() {
try {
return (BiomeGenBase) GSSpaceField.get(null);
} catch (IllegalAccessException e) {
throw new IllegalStateException("Could not access GSSpace field in GSBiomeGenBase class for GalaxySpace!");
}
}
}
@@ -1,8 +0,0 @@
package com.falsepattern.endlessids.mixin.helpers;
public interface IExtendedBlockStorageMixin {
void setBlockRefCount(int value);
void setTickRefCount(int value);
short[] getLSB();
byte[] getMSB();
}
@@ -0,0 +1,31 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers;
public interface IHBMBiomeSyncPacket {
void eid$setBiome(short biome);
short eid$getBiome();
void eid$setBiomeArray(short[] biomeArray);
short[] eid$getBiomeArray();
}
@@ -0,0 +1,27 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers;
public interface IS1DPacketEntityEffectMixin {
int endlessids$getIDExtended();
}
@@ -0,0 +1,161 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers;
import com.falsepattern.endlessids.Hooks;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.val;
import lotr.common.LOTRDimension;
import lotr.common.network.LOTRPacketBiomeVariantsUnwatch;
import lotr.common.network.LOTRPacketBiomeVariantsWatch;
import lotr.common.network.LOTRPacketHandler;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
import cpw.mods.fml.common.FMLLog;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class LOTRBiomeVariantStorageShort {
private static final Map<LOTRDimension, Map<ChunkCoordIntPair, short[]>> chunkVariantMap = new HashMap<>();
private static final Map<LOTRDimension, Map<ChunkCoordIntPair, short[]>> chunkVariantMapClient = new HashMap<>();
private static Map<ChunkCoordIntPair, short[]> getDimensionChunkMap(World world) {
Map<LOTRDimension, Map<ChunkCoordIntPair, short[]>> sourcemap;
if (!world.isRemote) {
sourcemap = chunkVariantMap;
} else {
sourcemap = chunkVariantMapClient;
}
val dim = LOTRDimension.getCurrentDimensionWithFallback(world);
return sourcemap.computeIfAbsent(dim, k -> new HashMap<>());
}
private static ChunkCoordIntPair getChunkKey(Chunk chunk) {
return new ChunkCoordIntPair(chunk.xPosition, chunk.zPosition);
}
public static short[] getChunkBiomeVariants(World world, Chunk chunk) {
return getChunkBiomeVariants(world, getChunkKey(chunk));
}
public static short[] getChunkBiomeVariants(World world, ChunkCoordIntPair chunk) {
return getDimensionChunkMap(world).get(chunk);
}
public static void setChunkBiomeVariants(World world, Chunk chunk, short[] variants) {
setChunkBiomeVariants(world, getChunkKey(chunk), variants);
}
public static void setChunkBiomeVariants(World world, ChunkCoordIntPair chunk, short[] variants) {
getDimensionChunkMap(world).put(chunk, variants);
}
public static void clearChunkBiomeVariants(World world, Chunk chunk) {
clearChunkBiomeVariants(world, getChunkKey(chunk));
}
public static void clearChunkBiomeVariants(World world, ChunkCoordIntPair chunk) {
getDimensionChunkMap(world).remove(chunk);
}
public static void loadChunkVariants(World world, Chunk chunk, NBTTagCompound data) {
if (getChunkBiomeVariants(world, chunk) == null) {
short[] variants;
if (data.hasKey("LOTRBiomeVariantsS")) {
variants = Hooks.byteToShortArray(data.getByteArray("LOTRBiomeVariantsS"));
} else {
variants = new short[256];
}
setChunkBiomeVariants(world, chunk, variants);
}
}
public static void saveChunkVariants(World world, Chunk chunk, NBTTagCompound data) {
val variants = getChunkBiomeVariants(world, chunk);
if (variants != null) {
data.setByteArray("LOTRBiomeVariantsS", Hooks.shortToByteArray(variants));
}
}
public static void clearAllVariants(World world) {
getDimensionChunkMap(world).clear();
FMLLog.info("Unloading LOTR biome variants in %s",
LOTRDimension.getCurrentDimensionWithFallback(world).dimensionName);
}
public static void performCleanup(WorldServer world) {
val dimensionMap = getDimensionChunkMap(world);
val removalChunks = new ArrayList<ChunkCoordIntPair>();
for (val chunk : dimensionMap.keySet()) {
if (!world.theChunkProviderServer.chunkExists(chunk.chunkXPos, chunk.chunkZPos)) {
removalChunks.add(chunk);
}
}
for (val chunk : removalChunks) {
dimensionMap.remove(chunk);
}
}
public static void sendChunkVariantsToPlayer(World world, Chunk chunk, EntityPlayerMP entityplayer) {
short[] variants = getChunkBiomeVariants(world, chunk);
if (variants != null) {
val packet = new LOTRPacketBiomeVariantsWatch(chunk.xPosition, chunk.zPosition,
Hooks.shortToByteArray(variants));
LOTRPacketHandler.networkWrapper.sendTo(packet, entityplayer);
} else {
val dimName = world.provider.getDimensionName();
val posX = chunk.xPosition << 4;
val posZ = chunk.zPosition << 4;
val playerName = entityplayer.getCommandSenderName();
FMLLog.severe("Could not find LOTR biome variants for %s chunk at %d, %d; requested by %s", dimName, posX,
posZ, playerName);
}
}
public static void sendUnwatchToPlayer(World world, Chunk chunk, EntityPlayerMP entityplayer) {
val packet = new LOTRPacketBiomeVariantsUnwatch(chunk.xPosition, chunk.zPosition);
LOTRPacketHandler.networkWrapper.sendTo(packet, entityplayer);
}
public static int getSize(World world) {
val map = getDimensionChunkMap(world);
return map.size();
}
}
@@ -0,0 +1,43 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ShortUtil {
public static int unsignedShortToInt(short s) {
return s & 65535;
}
public static int[] unsignedShortToIntArray(short[] shorts) {
int[] ints = new int[shorts.length];
for (int i = 0; i < shorts.length; ++i) {
ints[i] = unsignedShortToInt(shorts[i]);
}
return ints;
}
}
@@ -0,0 +1,77 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers;
import net.minecraft.world.chunk.NibbleArray;
public interface SubChunkBlockHook {
byte[] eid$getB1();
void eid$setB1(byte[] data);
NibbleArray eid$getB2Low();
void eid$setB2Low(NibbleArray data);
NibbleArray eid$createB2Low();
NibbleArray eid$getB2High();
void eid$setB2High(NibbleArray data);
NibbleArray eid$createB2High();
byte[] eid$getB3();
void eid$setB3(byte[] data);
byte[] eid$createB3();
int eid$getBlockMask();
int eid$getID(int x, int y, int z);
void eid$setID(int x, int y, int z, int id);
NibbleArray eid$getM1Low();
void eid$setM1Low(NibbleArray m1Low);
NibbleArray eid$getM1High();
void eid$setM1High(NibbleArray m1High);
NibbleArray eid$createM1High();
byte[] eid$getM2();
void eid$setM2(byte[] m2);
byte[] eid$createM2();
int eid$getMetadataMask();
int eid$getMetadata(int x, int y, int z);
void eid$setMetadata(int x, int y, int z, int id);
}
@@ -0,0 +1,36 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers.stubpackage.com.emoniph.witchery.brewing.action.effect;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
public class BrewActionBiomeChange$ChunkCoord {
public BrewActionBiomeChange$ChunkCoord(int x, int z) {
}
public Chunk getChunk(World world) {
return null;
}
}
@@ -0,0 +1,29 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.helpers.stubpackage.lotr.common.network;
public class LOTRPacketBiomeVariantsWatch {
public int chunkX;
public int chunkZ;
public byte[] variants;
}
@@ -0,0 +1,63 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.client.biome.biomewand;
import com.spacechase0.minecraft.biomewand.item.BiomeWandItem;
import lombok.val;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.biome.BiomeGenBase;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@Mixin(value = BiomeWandItem.class,
remap = false)
public abstract class BiomeWandItemMixin {
/**
* @author FalsePattern
* @reason Biome ID extension
*/
@SideOnly(Side.CLIENT)
@Overwrite
public int getColorFromItemStack(ItemStack stack, int pass) {
NBTTagCompound tag = stack.getTagCompound();
int biomeID = -1;
if (tag != null && tag.hasKey("sampledBiomeS")) {
biomeID = Short.toUnsignedInt(tag.getShort("sampledBiomeS"));
}
if (pass != 1) {
return -1;
}
if (biomeID < 0) {
return 0;
}
val biome = BiomeGenBase.getBiomeGenArray()[biomeID];
if (biome == null) {
return 0;
}
return biome.color;
}
}
@@ -0,0 +1,44 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.client.blockitem.fastcraft;
import org.spongepowered.asm.mixin.Dynamic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.entity.EntityLivingBase;
@Mixin(EntityRenderer.class)
public class EntityRendererMixin {
@Dynamic
@Redirect(method = "renderWorld",
at = @At(value = "INVOKE",
target = "Lfastcraft/HC;t(Lnet/minecraft/client/renderer/RenderGlobal;Lnet/minecraft/entity/EntityLivingBase;Z)Z",
remap = false))
private boolean killHook2(RenderGlobal rg, EntityLivingBase entity, boolean doUpdates) {
return rg.updateRenderers(entity, doUpdates);
}
}
@@ -0,0 +1,42 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.client.blockitem.vanilla;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import net.minecraft.client.multiplayer.PlayerControllerMP;
@Mixin(PlayerControllerMP.class)
public abstract class PlayerControllerMPMixin {
@ModifyConstant(method = "onPlayerDestroyBlock",
constant = @Constant(intValue = VanillaConstants.bitsPerID,
ordinal = 0),
require = 1)
private int extend1(int constant) {
return ExtendedConstants.bitsPerID;
}
}
@@ -1,14 +1,37 @@
package com.falsepattern.endlessids.mixin.mixins.client.vanilla; /*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.client.blockitem.vanilla;
import com.falsepattern.endlessids.constants.ExtendedConstants; import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants; import com.falsepattern.endlessids.constants.VanillaConstants;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.RenderGlobal;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant; import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant; import org.spongepowered.asm.mixin.injection.ModifyConstant;
import net.minecraft.client.renderer.RenderGlobal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Mixin(RenderGlobal.class) @Mixin(RenderGlobal.class)
public abstract class RenderGlobalMixin { public abstract class RenderGlobalMixin {
@@ -0,0 +1,62 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.client.potion.vanilla;
import com.falsepattern.endlessids.mixin.helpers.IS1DPacketEntityEffectMixin;
import lombok.val;
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.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.network.play.server.S1DPacketEntityEffect;
import net.minecraft.potion.PotionEffect;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
@Mixin(NetHandlerPlayClient.class)
public abstract class NetHandlerPlayClientMixin {
private static int theID;
@Inject(method = "handleEntityEffect",
at = @At("HEAD"),
require = 1)
private void grabID(S1DPacketEntityEffect packetIn, CallbackInfo ci) {
theID = ((IS1DPacketEntityEffectMixin) packetIn).endlessids$getIDExtended();
}
@Redirect(method = "handleEntityEffect",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/entity/EntityLivingBase;addPotionEffect(Lnet/minecraft/potion/PotionEffect;)V"),
require = 1)
private void addPotionEffect(EntityLivingBase entity, PotionEffect effect) {
val newPotion = new PotionEffect(theID, effect.getDuration(), effect.getAmplifier());
theID = 0;
newPotion.setPotionDurationMax(effect.getIsPotionDurationMax());
entity.addPotionEffect(newPotion);
}
}
@@ -0,0 +1,40 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.client.redstone;
import com.falsepattern.endlessids.config.GeneralConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import net.minecraft.block.BlockRedstoneWire;
@Mixin(BlockRedstoneWire.class)
public abstract class BlockRedstoneWireMixin {
@ModifyConstant(method = "randomDisplayTick",
constant = @Constant(floatValue = 15.0F),
require = 1)
private float bigRedstone(float constant) {
return GeneralConfig.maxRedstone;
}
}
@@ -0,0 +1,40 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.client.redstone;
import com.falsepattern.endlessids.config.GeneralConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import net.minecraft.client.renderer.RenderBlocks;
@Mixin(RenderBlocks.class)
public abstract class RenderBlocksMixin {
@ModifyConstant(method = "renderBlockRedstoneWire",
constant = @Constant(floatValue = 15.0F),
require = 1)
private float bigRedstone(float constant) {
return GeneralConfig.maxRedstone;
}
}
@@ -1,138 +0,0 @@
package com.falsepattern.endlessids.mixin.mixins.client.vanilla;
import com.falsepattern.endlessids.Hooks;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.mixin.helpers.IExtendedBlockStorageMixin;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.NibbleArray;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
@SuppressWarnings({"rawtypes", "WhileLoopReplaceableByForEach", "unchecked"})
@Mixin(Chunk.class)
public abstract class ChunkMixin {
@Shadow public Map chunkTileEntityMap;
@Shadow public World worldObj;
@Shadow private ExtendedBlockStorage[] storageArrays;
@Shadow private byte[] blockBiomeArray;
@Shadow public boolean isLightPopulated;
@Shadow public boolean isTerrainPopulated;
@Shadow public abstract void generateHeightMap();
@Shadow public abstract Block getBlock(int p_150810_1_, int p_150810_2_, int p_150810_3_);
@Shadow public abstract int getBlockMetadata(int p_76628_1_, int p_76628_2_, int p_76628_3_);
/**
* @author FalsePattern
* @reason Direct port from dumped code
*/
@SideOnly(Side.CLIENT)
@Overwrite
public void fillChunk(byte[] var1, int var2, int var3, boolean var4) {
Iterator var5 = this.chunkTileEntityMap.values().iterator();
while(var5.hasNext()) {
TileEntity var6 = (TileEntity)var5.next();
var6.updateContainingBlockInfo();
var6.getBlockMetadata();
var6.getBlockType();
}
int var16 = 0;
boolean var7 = !this.worldObj.provider.hasNoSky;
int var8;
for(var8 = 0; var8 < this.storageArrays.length; ++var8) {
if ((var2 & 1 << var8) != 0) {
if (this.storageArrays[var8] == null) {
this.storageArrays[var8] = new ExtendedBlockStorage(var8 << 4, var7);
}
Hooks.setBlockData((IExtendedBlockStorageMixin) this.storageArrays[var8], var1, var16);
var16 += 16 * 16 * 16 * ExtendedConstants.bytesPerID;
} else if (var4 && this.storageArrays[var8] != null) {
this.storageArrays[var8] = null;
}
}
NibbleArray var9;
for(var8 = 0; var8 < this.storageArrays.length; ++var8) {
if ((var2 & 1 << var8) != 0 && this.storageArrays[var8] != null) {
var9 = this.storageArrays[var8].getMetadataArray();
System.arraycopy(var1, var16, var9.data, 0, var9.data.length);
var16 += var9.data.length;
}
}
for(var8 = 0; var8 < this.storageArrays.length; ++var8) {
if ((var2 & 1 << var8) != 0 && this.storageArrays[var8] != null) {
var9 = this.storageArrays[var8].getBlocklightArray();
System.arraycopy(var1, var16, var9.data, 0, var9.data.length);
var16 += var9.data.length;
}
}
if (var7) {
for(var8 = 0; var8 < this.storageArrays.length; ++var8) {
if ((var2 & 1 << var8) != 0 && this.storageArrays[var8] != null) {
var9 = this.storageArrays[var8].getSkylightArray();
System.arraycopy(var1, var16, var9.data, 0, var9.data.length);
var16 += var9.data.length;
}
}
}
if (var4) {
System.arraycopy(var1, var16, this.blockBiomeArray, 0, this.blockBiomeArray.length);
}
for(var8 = 0; var8 < this.storageArrays.length; ++var8) {
if (this.storageArrays[var8] != null && (var2 & 1 << var8) != 0) {
this.storageArrays[var8].removeInvalidBlocks();
}
}
this.isLightPopulated = true;
this.isTerrainPopulated = true;
this.generateHeightMap();
ArrayList var10 = new ArrayList();
TileEntity var11;
for(var5 = this.chunkTileEntityMap.values().iterator(); var5.hasNext(); var11.updateContainingBlockInfo()) {
var11 = (TileEntity)var5.next();
int var12 = var11.xCoord & 15;
int var13 = var11.yCoord;
int var14 = var11.zCoord & 15;
Block var15 = var11.getBlockType();
if ((var15 != this.getBlock(var12, var13, var14) || var11.blockMetadata != this.getBlockMetadata(var12, var13, var14)) && var11.shouldRefresh(var15, this.getBlock(var12, var13, var14), var11.blockMetadata, this.getBlockMetadata(var12, var13, var14), this.worldObj, var12, var13, var14)) {
var10.add(var11);
}
}
Iterator var17 = var10.iterator();
while(var17.hasNext()) {
TileEntity var18 = (TileEntity)var17.next();
var18.invalidate();
}
}
}
@@ -1,49 +0,0 @@
package com.falsepattern.endlessids.mixin.mixins.client.vanilla;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.network.play.server.S22PacketMultiBlockChange;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
@SideOnly(Side.CLIENT)
@Mixin(NetHandlerPlayClient.class)
public abstract class NetHandlerPlayClientMixin {
@Shadow private WorldClient clientWorldController;
/**
* @author FalsePattern
* @reason Direct port from dumped code
*/
@Overwrite
public void handleMultiBlockChange(S22PacketMultiBlockChange packetIn) throws IOException {
int var2 = packetIn.func_148920_c().chunkXPos * 16;
int var3 = packetIn.func_148920_c().chunkZPos * 16;
if (packetIn.func_148921_d() != null) {
DataInputStream dataInput = new DataInputStream(new ByteArrayInputStream(packetIn.func_148921_d()));
for(int var5 = 0; var5 < packetIn.func_148922_e(); ++var5) {
short var6 = dataInput.readShort();
short idLSB = dataInput.readShort();
byte idMSB = dataInput.readByte();
int id = (idLSB & 0xFFFF) | ((idMSB & 0xFF) << 16);
int var9 = dataInput.readByte() & 15;
int var10 = var6 >> 12 & 15;
int var11 = var6 >> 8 & 15;
int var12 = var6 & 255;
this.clientWorldController.func_147492_c(var10 + var2, var12, var11 + var3, Block.getBlockById(id), var9);
}
}
}
}
@@ -1,18 +0,0 @@
package com.falsepattern.endlessids.mixin.mixins.client.vanilla;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import net.minecraft.client.multiplayer.PlayerControllerMP;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(PlayerControllerMP.class)
public abstract class PlayerControllerMPMixin {
@ModifyConstant(method = "onPlayerDestroyBlock",
constant = @Constant(intValue = VanillaConstants.bitsPerID, ordinal = 0),
require = 1)
private int extend1(int constant) {
return ExtendedConstants.bitsPerID;
}
}
@@ -0,0 +1,58 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.antiidconflict;
import code.elix_x.coremods.antiidconflict.AntiIdConflictBase;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import java.io.File;
@Mixin(value = AntiIdConflictBase.class,
remap = false)
public abstract class AntiIdConflictBaseMixin {
@Shadow
public static File mainFolder;
@Inject(method = "preinit",
at = @At("HEAD"),
require = 1)
private static void fixPath(FMLPreInitializationEvent event, CallbackInfo ci) {
mainFolder = new File(event.getModConfigurationDirectory().getPath(), "AntiIDConflict");
}
@Redirect(method = "preinit",
at = @At(value = "FIELD",
target = "Lcode/elix_x/coremods/antiidconflict/AntiIdConflictBase;mainFolder:Ljava/io/File;",
opcode = Opcodes.PUTSTATIC),
require = 1)
private static void removeOldPut(File value) {
}
}
@@ -0,0 +1,55 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.antiidconflict;
import code.elix_x.coremods.antiidconflict.core.AsmHooks;
import com.falsepattern.endlessids.PlaceholderBiome;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.biome.BiomeGenBase;
@Mixin(BiomeGenBase.class)
public abstract class BiomeGenBasePlaceholderMixin {
@Shadow
@Final
private static BiomeGenBase[] biomeList;
@SuppressWarnings({"InvalidInjectorMethodSignature", "UnresolvedMixinReference", "MixinAnnotationTarget"})
@Redirect(method = "<init>(IZ)V",
at = @At(value = "INVOKE",
target = "Lcode/elix_x/coremods/antiidconflict/core/AsmHooks;getBiomeID(IZ)I",
remap = false),
require = 1)
private int removePlaceholders(int id, boolean register) {
if (register) {
if (biomeList[id] instanceof PlaceholderBiome) {
biomeList[id] = null;
}
}
return AsmHooks.getBiomeID(id, register);
}
}
@@ -0,0 +1,244 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.antiidconflict;
import code.elix_x.coremods.antiidconflict.AntiIdConflictBase;
import code.elix_x.coremods.antiidconflict.managers.BiomesManager;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import com.falsepattern.endlessids.mixin.helpers.AIDCStringFixer;
import lombok.val;
import org.apache.commons.lang3.ArrayUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import net.minecraft.world.biome.BiomeGenBase;
import java.io.File;
import java.io.PrintWriter;
import static code.elix_x.coremods.antiidconflict.managers.BiomesManager.conflicts;
@Mixin(value = BiomesManager.class,
remap = false)
public abstract class BiomesManagerMixin {
@Shadow
public static String freeBiomeIDs;
@Shadow
public static String occupiedBiomeIDs;
@Shadow
public static boolean debug;
@Shadow
public static int IconflictedIds;
@Shadow
public static String conflictedIds;
private static String[] getIntervalNaming(int first, int last) {
if (first == last) {
return new String[]{Integer.toString(first)};
} else if (first + 1 == last) {
return new String[]{Integer.toString(first), Integer.toString(last)};
} else {
return new String[]{first + "-" + last};
}
}
@ModifyConstant(method = "<clinit>",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
require = 1)
private static int extendIDs(int constant) {
return ExtendedConstants.biomeIDCount;
}
@ModifyConstant(method = "preinit",
constant = @Constant(stringValue = "\\biomes"))
private static String fixPaths1(String original) {
return AIDCStringFixer.fixString(original);
}
@ModifyConstant(method = "setUpBiomesFolder",
constant = @Constant(stringValue = "\\main.cfg"))
private static String fixPaths2(String original) {
return AIDCStringFixer.fixString(original);
}
/**
* @author FalsePattern
* @reason Better code, and detecting empty areas.
*/
@Overwrite
public static void updateBiomesFolder() throws Exception {
val biomes = BiomeGenBase.getBiomeGenArray();
val builder = new StringBuilder();
boolean hasEmpty = false;
int emptyRegionStart = 0;
for (int i = 0; i < biomes.length; ++i) {
if (biomes[i] == null) {
if (!hasEmpty) {
emptyRegionStart = i;
hasEmpty = true;
}
++BiomesManager.freeIds;
} else if (hasEmpty) {
hasEmpty = false;
for (val part : getIntervalNaming(emptyRegionStart, i - 1)) {
builder.append(part).append('\n');
}
}
}
if (hasEmpty) {
for (val part : getIntervalNaming(emptyRegionStart, ExtendedConstants.biomeIDCount - 1)) {
builder.append(part).append('\n');
}
}
freeBiomeIDs = builder.toString();
builder.setLength(0);
System.out.println("Found " + BiomesManager.freeIds + " free biome ids in total.");
for (val biome : biomes) {
if (biome != null) {
builder.append(biome.biomeID)
.append(" : ")
.append(biome.biomeName)
.append(" (")
.append(biome.getBiomeClass())
.append(")\n");
++BiomesManager.occupiedIds;
}
}
occupiedBiomeIDs = builder.toString();
builder.setLength(0);
System.out.println("Found " + BiomesManager.occupiedIds + " occupied biome ids in total.");
for (val conflict : conflicts) {
if (conflict != null) {
if (debug) {
System.out.println(
"Found biomes id conflict for " + conflict.ID + " : " + conflict.getCrashMessage());
}
builder.append(conflict.getCrashMessage()).append('\n');
++IconflictedIds;
}
}
conflictedIds = builder.toString();
builder.setLength(0);
System.out.println("Found " + IconflictedIds + " conflicted biome ids in total.");
File available = new File(AntiIdConflictBase.biomesFolder, "availableIDs.txt");
if (available.exists()) {
available.delete();
}
available.createNewFile();
PrintWriter writer = new PrintWriter(available);
writer.println("Total amount of free biome ids: " + available);
writer.println("List of free biome ids:");
val freeIDs = freeBiomeIDs.split("\n");
for (val freeID : freeIDs) {
writer.println(freeID);
}
writer.close();
val occupied = new File(AntiIdConflictBase.biomesFolder, "occupiedIDs.txt");
if (occupied.exists()) {
occupied.delete();
}
occupied.createNewFile();
writer = new PrintWriter(occupied);
writer.println("Total amount of occupied biome ids: " + BiomesManager.occupiedIds);
writer.println("Table of occupied biome ids and their owners");
writer.println("id:name(class)");
val occupiedIDs = occupiedBiomeIDs.split("\n");
for (String occupiedID : occupiedIDs) {
writer.println(occupiedID);
}
writer.close();
val conflicted = new File(AntiIdConflictBase.biomesFolder, "conflictedIDs.txt");
if (conflicted.exists()) {
conflicted.delete();
}
conflicted.createNewFile();
writer = new PrintWriter(conflicted);
writer.println("Total amount of conflicted biome ids: " + IconflictedIds);
writer.println("IDs in conflict:\n");
val conflictedIDs = conflictedIds.split("\n");
for (val conflictedID : conflictedIDs) {
writer.println(conflictedID);
}
writer.close();
val all = new File(AntiIdConflictBase.biomesFolder, "AllIDs.txt");
writer = new PrintWriter(all);
writer.println("Total amount of free biome ids: " + BiomesManager.freeIds);
writer.println("Total amount of occupied biome ids: " + BiomesManager.occupiedIds);
writer.println("Total amount of conflicted biome ids: " + IconflictedIds);
writer.println("All ids and their position:");
hasEmpty = false;
emptyRegionStart = 0;
for (int i = 0; i < biomes.length; ++i) {
if (!ArrayUtils.isEmpty(conflicts) && conflicts[i] != null) {
writer.println(conflicts[i].getCrashMessage());
} else if (biomes[i] != null) {
if (hasEmpty) {
hasEmpty = false;
for (val part : getIntervalNaming(emptyRegionStart, i - 1)) {
writer.print(part);
writer.println(" is Available");
}
}
writer.print(i);
writer.print(" is Occupied by ");
writer.print(biomes[i].biomeName);
writer.print(" (");
writer.print(biomes[i].getBiomeClass().getName());
writer.println(")");
} else if (!hasEmpty) {
hasEmpty = true;
emptyRegionStart = i;
}
}
if (hasEmpty) {
for (val part : getIntervalNaming(emptyRegionStart, ExtendedConstants.biomeIDCount - 1)) {
writer.print(part);
writer.println(" is Available");
}
}
writer.close();
}
}
@@ -0,0 +1,44 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.antiidconflict;
import code.elix_x.coremods.antiidconflict.managers.DimensionsManager;
import com.falsepattern.endlessids.mixin.helpers.AIDCStringFixer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = DimensionsManager.class,
remap = false)
public abstract class DimensionsManagerMixin {
@ModifyConstant(method = "*",
constant = {@Constant(stringValue = "\\dimensions"),
@Constant(stringValue = "\\main.cfg"),
@Constant(stringValue = "\\avaibleIDs.txt"),
@Constant(stringValue = "\\occupiedIDs.txt"),
@Constant(stringValue = "\\AllIDs.txt")})
private static String fixPaths(String original) {
return AIDCStringFixer.fixString(original);
}
}
@@ -0,0 +1,44 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.antiidconflict;
import code.elix_x.coremods.antiidconflict.managers.EnchantementsManager;
import com.falsepattern.endlessids.mixin.helpers.AIDCStringFixer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = EnchantementsManager.class,
remap = false)
public abstract class EnchantementsManagerMixin {
@ModifyConstant(method = "*",
constant = {@Constant(stringValue = "\\enchantements"),
@Constant(stringValue = "\\main.cfg"),
@Constant(stringValue = "\\avaibleIDs.txt"),
@Constant(stringValue = "\\occupiedIDs.txt"),
@Constant(stringValue = "\\AllIDs.txt")})
private static String fixPaths(String original) {
return AIDCStringFixer.fixString(original);
}
}
@@ -0,0 +1,44 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.antiidconflict;
import code.elix_x.coremods.antiidconflict.managers.EntitiesManager;
import com.falsepattern.endlessids.mixin.helpers.AIDCStringFixer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = EntitiesManager.class,
remap = false)
public abstract class EntitiesManagerMixin {
@ModifyConstant(method = "*",
constant = {@Constant(stringValue = "\\entities"),
@Constant(stringValue = "\\main.cfg"),
@Constant(stringValue = "\\avaibleIDs.txt"),
@Constant(stringValue = "\\occupiedIDs.txt"),
@Constant(stringValue = "\\AllIDs.txt")})
private static String fixPaths(String original) {
return AIDCStringFixer.fixString(original);
}
}
@@ -0,0 +1,45 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.antiidconflict;
import code.elix_x.coremods.antiidconflict.managers.PotionsManager;
import com.falsepattern.endlessids.mixin.helpers.AIDCStringFixer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
@Mixin(value = PotionsManager.class,
remap = false)
public abstract class PotionsManagerMixin {
@ModifyConstant(method = "*",
constant = {@Constant(stringValue = "\\potions"),
@Constant(stringValue = "\\main.cfg"),
@Constant(stringValue = "\\avaibleIDs.txt"),
@Constant(stringValue = "\\occupiedIDs.txt"),
@Constant(stringValue = "\\conflictedIDs.txt"),
@Constant(stringValue = "\\AllIDs.txt")})
private static String fixPaths(String original) {
return AIDCStringFixer.fixString(original);
}
}
@@ -0,0 +1,106 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.biome.abyssalcraft;
import com.falsepattern.endlessids.PlaceholderBiome;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.shinoow.abyssalcraft.AbyssalCraft;
import lombok.val;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.world.biome.BiomeGenBase;
@Mixin(value = AbyssalCraft.class,
remap = false)
public abstract class AbyssalCraftMixin {
@Shadow
public static int configBiomeId1;
@Shadow
public static int configBiomeId2;
@Shadow
public static int configBiomeId3;
@Shadow
public static int configBiomeId4;
@Shadow
public static int configBiomeId5;
@Shadow
public static int configBiomeId6;
@Shadow
public static int configBiomeId7;
@Shadow
public static int configBiomeId8;
@Shadow
public static int configBiomeId9;
@Shadow
public static int configBiomeId10;
@Shadow
public static int configBiomeId11;
@Shadow
public static int configBiomeId12;
@Shadow
public static int configBiomeId13;
@ModifyConstant(method = "syncConfig",
constant = {@Constant(intValue = 100, ordinal = 0),
@Constant(intValue = 101, ordinal = 0),
@Constant(intValue = 102, ordinal = 0),
@Constant(intValue = 103, ordinal = 0),
@Constant(intValue = 104, ordinal = 0),
@Constant(intValue = 105, ordinal = 0),
@Constant(intValue = 106, ordinal = 0),
@Constant(intValue = 107, ordinal = 0),
@Constant(intValue = 108, ordinal = 0),
@Constant(intValue = 109, ordinal = 0),
@Constant(intValue = 110, ordinal = 0),
@Constant(intValue = 112, ordinal = 0),
@Constant(intValue = 113, ordinal = 0)},
require = 13)
private static int shiftBiomeIDsUp(int constant) {
return constant + 8000;
}
@Inject(method = "checkBiomeIds",
at = @At("HEAD"),
require = 1)
private void cleanupBiomeArrayForAssignment(CallbackInfo ci) {
val bga = BiomeGenBase.getBiomeGenArray();
int[] biomes = new int[]{configBiomeId1, configBiomeId2, configBiomeId3, configBiomeId4, configBiomeId5,
configBiomeId6, configBiomeId7, configBiomeId8, configBiomeId9, configBiomeId10,
configBiomeId11, configBiomeId12, configBiomeId13};
for (val biome : biomes) {
if (biome < 0 || biome >= ExtendedConstants.biomeIDCount) {
continue;
}
if (bga[biome] instanceof PlaceholderBiome) {
bga[biome] = null;
}
}
}
}
@@ -0,0 +1,71 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.biome.antiqueatlas;
import com.falsepattern.endlessids.constants.ExtendedConstants;
import com.falsepattern.endlessids.constants.VanillaConstants;
import com.falsepattern.endlessids.mixin.helpers.ChunkBiomeHook;
import com.falsepattern.endlessids.mixin.helpers.ShortUtil;
import hunternif.mc.atlas.core.BiomeDetectorBase;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = BiomeDetectorBase.class,
remap = false)
public abstract class BiomeDetectorBaseMixin {
private Chunk chunk;
@ModifyConstant(method = "<clinit>",
constant = @Constant(intValue = VanillaConstants.biomeIDCount),
require = 2)
private static int extendIDs(int constant) {
return ExtendedConstants.biomeIDCount;
}
@Redirect(method = "getBiomeID",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
remap = true),
require = 1)
private byte[] disableGetter(Chunk instance) {
chunk = instance;
return null;
}
@Redirect(method = "getBiomeID",
at = @At(value = "INVOKE",
target = "Lhunternif/mc/atlas/util/ByteUtil;unsignedByteToIntArray([B)[I"),
require = 1)
private int[] biomeIDs(byte[] i) {
try {
return ShortUtil.unsignedShortToIntArray(((ChunkBiomeHook) chunk).getBiomeShortArray());
} finally {
chunk = null;
}
}
}
@@ -0,0 +1,60 @@
/*
* EndlessIDs
*
* Copyright (C) 2022-2026 FalsePattern, The MEGA Team
* All Rights Reserved
*
* The above copyright notice, this permission notice and the word "MEGA"
* shall be included in all copies or substantial portions of the Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, only version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.falsepattern.endlessids.mixin.mixins.common.biome.antiqueatlas;
import com.falsepattern.endlessids.mixin.helpers.ChunkBiomeHook;
import com.falsepattern.endlessids.mixin.helpers.ShortUtil;
import hunternif.mc.atlas.core.BiomeDetectorNether;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import net.minecraft.world.chunk.Chunk;
@Mixin(value = BiomeDetectorNether.class,
remap = false)
public abstract class BiomeDetectorNetherMixin {
private Chunk chunk;
@Redirect(method = "getBiomeID",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B",
remap = true),
require = 1)
private byte[] disableGetter(Chunk instance) {
chunk = instance;
return null;
}
@Redirect(method = "getBiomeID",
at = @At(value = "INVOKE",
target = "Lhunternif/mc/atlas/util/ByteUtil;unsignedByteToIntArray([B)[I"),
require = 1)
private int[] biomeIDs(byte[] i) {
try {
return ShortUtil.unsignedShortToIntArray(((ChunkBiomeHook) chunk).getBiomeShortArray());
} finally {
chunk = null;
}
}
}
Loaded 100 of 281 files, more files were not shown because too many files have changed in this diff. Show more