Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
423 commits
Select commit Hold shift + click to select a range
ad705e1
Merge remote-tracking branch 'origin/1.15' into 1.16
tterrag1098 Aug 21, 2020
d9941a0
Update to 1.16.2
tterrag1098 Sep 1, 2020
4c71624
Update forge, fix ExistingFileHelper references, update tag providers
tterrag1098 Sep 5, 2020
5b89943
Remove unnecessary use of NullableSupplier
tterrag1098 Sep 17, 2020
46221ff
Update minecraft version badge
tterrag1098 Oct 5, 2020
0100b79
Add special cased item tags provider that allows copying from block tags
tterrag1098 Nov 23, 2020
f8943de
Handholding generics
tterrag1098 Nov 23, 2020
789d0e6
Maybe make it happy?
tterrag1098 Nov 23, 2020
fae82b7
Add "forge" variant of container factory for packetbuffer arg
tterrag1098 Nov 28, 2020
b442f84
Merge branch '1.15' of https://github.com/tterrag1098/Registrate into…
tterrag1098 Nov 28, 2020
3e8fda0
Add special entry classes for container, entity, and fluid builders
tterrag1098 Nov 28, 2020
505c9b2
Improve support for custom registries, fix makeRegistry using wrong bus
tterrag1098 Nov 28, 2020
4ada188
Merge remote-tracking branch 'origin/1.15' into 1.16
tterrag1098 Nov 28, 2020
7fd6237
PacketBuffer input to ForgeContainerFactory should be nullable
tterrag1098 Nov 28, 2020
cb7a46d
Add get/getNullable (from world) to TileEntityEntry, add docs
tterrag1098 Nov 28, 2020
abe3e38
Merge remote-tracking branch 'origin/1.15' into 1.16
tterrag1098 Nov 28, 2020
630eda6
Add initialProperties(Material) to BlockBuilder
CoffeeCatRailway Dec 11, 2020
084c9cc
Fix scraping generic methods, update RegistrateBlockLootTables
tterrag1098 Dec 11, 2020
022789c
Merge remote-tracking branch 'origin/1.15' into 1.16
tterrag1098 Dec 11, 2020
e295204
Update mappings to latest
tterrag1098 Dec 11, 2020
4e27387
Move one-time event listener unregister to later in loading
tterrag1098 Dec 26, 2020
7069d82
Merge remote-tracking branch 'origin/1.15' into 1.16
tterrag1098 Dec 26, 2020
4d94825
Add methods to disable bucket/block on fluids
tterrag1098 Jan 10, 2021
73d5fe7
Add method for removing tags, fix fluid bucket NPE
tterrag1098 Jan 10, 2021
c7236d5
Add default properties for fluid buckets that match vanilla
tterrag1098 Jan 10, 2021
c0dc155
Better lang utils for FluidBuilder, default to block key if possible
tterrag1098 Jan 10, 2021
ea8ece7
Merge remote-tracking branch 'origin/1.15' into 1.16
tterrag1098 Jan 10, 2021
d6edb89
Fix generic issues in RegistryEntry
tterrag1098 Jan 10, 2021
63da72f
Merge remote-tracking branch 'origin/1.15' into 1.16
tterrag1098 Jan 10, 2021
9974d62
Fix javadoc build
tterrag1098 Jan 10, 2021
61a6bf3
Update forge, add entity attribute method to EntityBuilder
tterrag1098 Apr 25, 2021
17bbc3f
Add docs for onRegisterAfter
tterrag1098 May 3, 2021
826f1cf
1.0.0
tterrag1098 May 3, 2021
b77a7fb
Merge remote-tracking branch 'origin/1.15' into 1.16
tterrag1098 May 3, 2021
002580d
ReadMe update (#26)
rosaqq May 3, 2021
0a9082a
Merge remote-tracking branch 'origin/1.15' into 1.16
tterrag1098 May 3, 2021
961a3a5
Update all readme links from 1.15 to 1.16
tterrag1098 May 3, 2021
9385c93
Convert to super.getValue() to prevent mojmap conflicts.
noobanidus May 11, 2021
712ce0f
Remove usage of NonNullLazyValue.get, deprecate
tterrag1098 May 20, 2021
e511d39
Narrow NonNullLazyValue#getValue to @NonNullType to clean up some usage
tterrag1098 May 20, 2021
b4f35bd
Add NonNullUnaryOperator#andThen
tterrag1098 Jul 19, 2021
0eaa1ba
methods&fields
tterrag1098 Jul 25, 2021
48db8d9
fields&methods manual
tterrag1098 Jul 25, 2021
327460c
Get everything ported and compiling, except for recipe provider
tterrag1098 Jul 28, 2021
7409a31
Fix recipe provider, I'm just blind
tterrag1098 Jul 28, 2021
5213886
Fix TileEntityBuilder#renderer not accepting supertype renderers
tterrag1098 Jul 29, 2021
2308103
Update lombok and others, update lombok usage to fix build
TheOnlyTails Jul 29, 2021
47c7723
Changed the order of arguments in the BlockEntityFactory#create metho…
nikita488 Oct 22, 2021
017a017
Renamed all ItemGroup references to CreativeModeTab
nikita488 Oct 27, 2021
0cfd0c6
Bump Forge version that has GAMELIBRARY loading issue fixed
nikita488 Nov 11, 2021
6f4831c
Change to GAMELIBRARY
Rover656 Oct 19, 2021
9dff8bd
Removed unnecessary import
nikita488 Nov 20, 2021
c99931c
Bump Forge version to 109 to fix loot datagen creates unnecessary arr…
nikita488 Nov 20, 2021
75a81bc
Merge pull request #37 from nikita488/1.17
tterrag1098 Nov 20, 2021
7ed6bb4
Port to 1.18 - No significant changes, mostly just import updates.
tterrag1098 Dec 1, 2021
9ce77a4
Remove NonNullLazyValue, use NonNullSupplier.lazy (static+inst) instead
tterrag1098 Dec 15, 2021
90b70f5
Update to 1.18.2 (#41)
Rover656 Mar 19, 2022
dfa52d1
Update README, fix shield links and update setup
tterrag1098 Mar 19, 2022
3806afc
Update to latest 1.18.2 forge, sync generated code & data
tterrag1098 Mar 30, 2022
7b260ab
Switch to ResourceKey over Class objects, deprecate Class param methods
tterrag1098 Jun 12, 2022
0eb32b6
1.1.x, fix version reckoning not seeing local tags
tterrag1098 Jun 20, 2022
d296a6b
Update TestMod to use new custom registry creation style
tterrag1098 Jun 20, 2022
e92e244
Remove revapi for now because it's breaking jenkins
tterrag1098 Jun 20, 2022
c4371ee
Update to 1.19, remove deprecations, regen test data
tterrag1098 Jun 20, 2022
dc0972d
Revert layer registration change so it can be applied to 1.18
tterrag1098 Jun 20, 2022
c537008
Move block layer application to client setup to make forge happy
tterrag1098 Jun 20, 2022
05b344e
Merge remote-tracking branch 'origin/1.18' into 1.19
tterrag1098 Jun 20, 2022
9535bd5
Fix javac compile issue with getAutomaticName
tterrag1098 Jun 20, 2022
9230cfc
Fix javadoc errors
tterrag1098 Jun 20, 2022
6cdf072
Change BlockItem bound to Item on BlockBuilder#item(NonNullBiFunction)
tterrag1098 Jul 3, 2022
8edaaf2
Merge branch '1.18' of https://github.com/tterrag1098/Registrate.git …
tterrag1098 Jul 3, 2022
272a03b
Update to latest forge (#45)
Rover656 Jul 18, 2022
9e66065
Add method copy support for nested generics (up to 3 levels)
tterrag1098 Jul 26, 2022
92a2c47
Update to 1.19.3 (#50)
ApexModder Dec 10, 2022
a32d7c2
Improve codegen, add javadoc and Generated annotation for context
tterrag1098 Dec 11, 2022
705d16f
Remove need for typing "done", add more text output for codegen
tterrag1098 Dec 11, 2022
1963017
Forge 1.19.3 Updates & CreativeModeTabs (#51)
ApexModder Dec 26, 2022
7a27680
Fix javadoc errors
tterrag1098 Jan 19, 2023
deef0c7
Update README.md
tterrag1098 Jan 19, 2023
0eefcad
Fix issue where creative tab modification order was not preserved, ca…
ApexModder Feb 7, 2023
982eb7d
Merge pull request #52 from ApexModder/1.19-tab-order-fix
tterrag1098 Mar 18, 2023
ab3ba54
1.19.4 Update (#53)
ApexModder Mar 18, 2023
cfc1dd3
Use register event directly instead of forge registry
tterrag1098 May 4, 2023
8c2741d
Allow custom AbstractRegistrate to customize the mod event bus used
tterrag1098 May 4, 2023
52fc07d
Fix creative tab modifiers overwriting previous values
tterrag1098 Jun 10, 2023
2f0ff40
Initial 1.20 port, creative tabs still need some work
tterrag1098 Jun 10, 2023
f329a69
Better creative tab API, run test datagen
tterrag1098 Jun 10, 2023
814374d
Remove commented out code, promote Beta methods, add more documentation
tterrag1098 Jun 12, 2023
03bda33
Remove all remaining hardcoded references to Java mod event bus
tterrag1098 Jun 12, 2023
b7a0ec7
1.3.x for MC 1.20
tterrag1098 Jun 12, 2023
117f2a6
Fix javadoc errors
tterrag1098 Jun 12, 2023
7354227
Fix unpredictable order of creative tab modifiers
tterrag1098 Jun 15, 2023
d5f97f5
Fix ItemBuilder no longer using defaults
tterrag1098 Jun 24, 2023
8ccd879
Clean up logging a bit
tterrag1098 Aug 7, 2023
3d0147b
Update README to mention https server
TurnrDev Aug 29, 2023
bf43f78
Add basic simple generic client and server provider types.
ApexModder Jul 17, 2023
53a555b
Update AbstractRegistrate.get JavaDoc string
TurnrDev Aug 29, 2023
02790e7
Add datapack registry support (#60)
Sep 2, 2023
ca5ef74
Implement potential fix for #56 (#57)
ApexModder Sep 2, 2023
8149dda
Creative tabs: Fix breaking change, clean up documentation
tterrag1098 Sep 2, 2023
075509f
Memory usage optimizations & cleanup
tterrag1098 Sep 2, 2023
473f165
Initial port
IThundxr Apr 17, 2024
3248120
Update most providers
IThundxr Apr 23, 2024
2bb09b2
Builder & Provider porting
IThundxr Apr 23, 2024
2a691c2
Fluid porting
IThundxr Apr 23, 2024
00a0b1b
BlockBuilder & Event Porting
IThundxr Apr 23, 2024
7758337
Most builders ported
IThundxr Apr 23, 2024
c57903e
Port most of TestMod
IThundxr Apr 23, 2024
1cc9292
More porting ✨ yay ✨
IThundxr Apr 23, 2024
8b0c34c
remove extra import
IThundxr Apr 23, 2024
605d27d
Fix NetworkHooks usages and remove removed method
IThundxr Apr 24, 2024
828df70
Last non RegistryObject change
IThundxr Apr 24, 2024
dcf79a9
The registry, it has changed!
IThundxr Apr 24, 2024
294c928
Please, never make me ever do this again.
IThundxr Apr 25, 2024
7258f38
extend DeferredHolder
IThundxr Apr 25, 2024
32777ac
Remove needing extra delegate
IThundxr Apr 25, 2024
c5a14df
remove unused imports
IThundxr Apr 25, 2024
d6efbf2
Fix testmod
IThundxr Apr 25, 2024
a87a4de
fix crash
IThundxr Apr 25, 2024
883f8fe
cleanup runs a bit
IThundxr Apr 25, 2024
b72b40e
these are still needed :yeef:
IThundxr Apr 25, 2024
175d314
Registrate lives to see another version!
IThundxr Apr 25, 2024
cc7cf41
CI Setup
IThundxr Apr 25, 2024
96f33c2
yeet old code
IThundxr Apr 25, 2024
995274e
work please?
IThundxr Apr 25, 2024
6e906c0
rigged
IThundxr Apr 25, 2024
7c034f9
do you want that?
IThundxr Apr 25, 2024
3f3e1e3
debugging time?
IThundxr Apr 25, 2024
95f7a11
just use maven local
IThundxr Apr 25, 2024
9bbf4b3
publishing
IThundxr Apr 25, 2024
328074d
CI again
IThundxr Apr 25, 2024
2c60f2f
versioning fix
IThundxr Apr 25, 2024
0b63f69
build
IThundxr Apr 25, 2024
832d21f
add run number
IThundxr Apr 25, 2024
3b0cb8e
log.debug -> log.trace
IThundxr May 4, 2024
70f757c
initial porting work
IThundxr Jun 15, 2024
ecdddff
a
IThundxr Jun 18, 2024
3025927
merge in changes from other fork
IThundxr Jun 18, 2024
f3a1953
Merge branch 'refs/heads/1.20.4' into 1.21
IThundxr Jun 18, 2024
f1970de
1.21 almost ready
IThundxr Jun 18, 2024
b3fc72b
fix datagen
IThundxr Jun 18, 2024
a5e8c48
run datagen
IThundxr Jun 18, 2024
49f42e5
fix testmod & make build workflow better
IThundxr Jun 18, 2024
5d83901
fix menu crash on server
IThundxr Jun 18, 2024
57c6feb
more caching [skip ci]
IThundxr Jun 18, 2024
be43f39
more caching [skip ci]
IThundxr Jun 18, 2024
2eb7852
fix spacing [skip ci]
IThundxr Jun 18, 2024
e60a8df
fix spacing [skip ci]
IThundxr Jun 18, 2024
2d35dc0
registrate snapshots
IThundxr Jun 18, 2024
02c9511
registrate snapshots
IThundxr Jun 18, 2024
74985cc
automatically register eventListeners
IThundxr Jun 18, 2024
69c0cee
Merge branch 'refs/heads/1.20.4' into 1.21
IThundxr Jun 18, 2024
adf0aee
update workflow for caching
IThundxr Jun 18, 2024
e0b2653
update workflow for caching
IThundxr Jun 18, 2024
ca6d540
fix DataIngredient and loot table gen
techno-sam Jun 20, 2024
7b35524
Merge pull request #1 from techno-sam/1.20.4-fixes
IThundxr Jun 20, 2024
71f7f18
Merge branch 'refs/heads/1.20.4/dev' into 1.21/dev
IThundxr Jun 20, 2024
9abd0cc
post merge fixes
IThundxr Jun 20, 2024
2a1fc03
fix caching
IThundxr Jun 21, 2024
86e6831
fix caching
IThundxr Jun 21, 2024
e7dce39
disable enchantments for now
IThundxr Jun 27, 2024
d3381e4
ICondition fix and optional tags (#2)
lcy0x1 Jun 27, 2024
39ad314
backport PR #2
lcy0x1 Jun 27, 2024
85b5840
Fix ForgeMenuFactory (#3)
lcy0x1 Jul 5, 2024
8f58dca
Don't use an ICustomIngredient for DataIngredient, resolve into paren…
Gegy Jul 5, 2024
b00076c
Merge remote-tracking branch 'origin/1.21/dev' into 1.21/dev
IThundxr Jul 5, 2024
1c1a898
build: don't attempt to publish to the maven with an empty token
IThundxr Jul 10, 2024
5ea4e70
Merge branch 'refs/heads/1.20.4/dev' into 1.21/dev
IThundxr Jul 10, 2024
b2fdcb0
Merge branch '1.20.4/dev'
IThundxr Jul 10, 2024
914964b
Update NeoForge to 21.0.87, replace SpawnPlacementRegisterEvent (#4)
Gegy Jul 14, 2024
04746f6
DatapackRegistry support and `HolderLookup.Provider` dependency (#5)
lcy0x1 Jul 20, 2024
94ef225
ClientExtension registration helper for item / block (#6)
lcy0x1 Jul 25, 2024
8271f68
fix(providers): advancements path
IThundxr Jul 30, 2024
ef62dd3
Remove unused enchantment code
IThundxr Sep 4, 2024
bb545bc
Update grgit
IThundxr Sep 4, 2024
1af59a8
add holder lookup provider to adavncement and loot table provider
lcy0x1 Sep 9, 2024
2e08feb
add holder lookup provider to adavncement and loot table provider (#7)
lcy0x1 Sep 12, 2024
95d478d
Update maven
IThundxr Dec 2, 2024
7da41ec
Pass block as context in clientExtension method
IThundxr Dec 31, 2024
f5c527d
Merge remote-tracking branch 'origin/1.21/dev' into 1.21/dev
IThundxr Dec 31, 2024
d8ecea6
update workflow
IThundxr Dec 31, 2024
2d55955
client extension for item
IThundxr Dec 31, 2024
c504bf3
deprecate broken method
IThundxr Jan 24, 2025
4cd8838
fix initial props leading to loot tables not generating
IThundxr Jan 25, 2025
e5c2b94
Fix fluid builder bucket
IThundxr Jan 27, 2025
6f32d98
enchantment tag provider
IThundxr Jan 31, 2025
9fcc8b0
fix field order
IThundxr Jan 31, 2025
03515e9
fluid temp
lcy0x1 Mar 24, 2025
ae24e55
Merge remote-tracking branch 'refs/remotes/maven/1.21/dev' into 1.21/dev
lcy0x1 Mar 24, 2025
7d0ae40
add better datamap helper
lcy0x1 Mar 24, 2025
fd0f4e7
Merge branch 'refs/heads/1.21/dev' into 1.21/fluid
lcy0x1 Mar 24, 2025
8add9f8
init gradle
lcy0x1 Mar 24, 2025
24e7d3b
recipe port
lcy0x1 Mar 24, 2025
13938d4
remove file helper, disable sidedness
lcy0x1 Mar 24, 2025
1a7f76c
add provider to datamap helper
lcy0x1 Mar 24, 2025
e7fb9da
remove item color helper
lcy0x1 Mar 24, 2025
a2d7276
loot port
lcy0x1 Mar 24, 2025
b465294
model rework
lcy0x1 Mar 24, 2025
f4b0262
make generator type and let provider type extend it
lcy0x1 Mar 25, 2025
76ce5db
remove delegate in data ingredient
lcy0x1 Mar 25, 2025
82fa7c2
fix block builder
lcy0x1 Mar 25, 2025
1202ba3
block entity port
lcy0x1 Mar 25, 2025
5ffd9d3
finish port
lcy0x1 Mar 26, 2025
2240df4
regenerate files
lcy0x1 Mar 26, 2025
4e51ab2
mark 1.21.4 todos
lcy0x1 Mar 26, 2025
204c27e
debug and fix, add model builder
lcy0x1 Mar 26, 2025
c96fa0b
fix safeId, add more TODO
lcy0x1 Mar 26, 2025
fbbaaf7
remove client extension override from fluid builder and add default e…
lcy0x1 Mar 26, 2025
b24a7fd
fix server launch
lcy0x1 Mar 26, 2025
e53e58c
1.21.5 port
lcy0x1 Mar 26, 2025
7f4d759
Example impl of magic item model
tterrag1098 Mar 28, 2025
0a85efd
Simplify magic item model generation a bit
Gegy Jul 20, 2025
5d12b81
Reintroduce (single) block layer registration
Gegy Jul 20, 2025
31ed115
Update to Minecraft 1.21.8
Gegy Jul 20, 2025
ac6f027
Fix: avoid classloading ItemTintSource on server in TestMod
Gegy Jul 20, 2025
a4304fd
Require HolderSet to create tag-based DataIngredient
Gegy Aug 3, 2025
aeb4ba2
Add registry context helpers to loot table and recipe providers
Gegy Aug 3, 2025
09c2df3
Reintroduce common model generation helpers
Gegy Aug 3, 2025
e24933a
add capability registration method to BlockEntityBuilder (#9)
happygill Mar 25, 2025
dcedfed
Merge pull request #74 from LoveTropics/1.21.8/dev
tterrag1098 Sep 11, 2025
6f9d0e6
Fix javadoc build
tterrag1098 Sep 13, 2025
6d6ef24
Remove third party maven publishing
tterrag1098 Sep 13, 2025
2fd7712
Fix #69 fluids using noBucket/noBlock can crash
tterrag1098 Sep 14, 2025
96c1702
Update README.md
tterrag1098 Sep 24, 2025
6fbb9d5
Delete .github/workflows/build.yml
QiuYe-QAQ Apr 10, 2026
6a399dd
updata
QiuYe-QAQ Apr 10, 2026
1a95c26
Merge branch '26.1' into qy/UpData
QiuYe-QAQ Apr 10, 2026
e9a157e
fix build
QiuYe-QAQ Apr 29, 2026
b11781d
spotless
QiuYe-QAQ Apr 29, 2026
a643443
修复构建,测试
QiuYe-QAQ Apr 29, 2026
6309fd9
删除无用文件
QiuYe-QAQ Apr 29, 2026
983bcbe
修复了部分datagen,缺失纹理引用
QiuYe-QAQ Apr 29, 2026
796bc77
修复绝大部分数据生成问题
QiuYe-QAQ Apr 29, 2026
4413397
修复
QiuYe-QAQ Apr 29, 2026
fabafef
完全修复
QiuYe-QAQ Apr 29, 2026
0c5cc37
spotless
QiuYe-QAQ Apr 29, 2026
e9f42ed
重构 (#1)
QiuYe-QAQ Apr 29, 2026
e203c80
Fix GitHub workflow copy and repository links (#2)
QiuYe-QAQ Apr 29, 2026
25452e3
文档 (#3)
QiuYe-QAQ Apr 29, 2026
83d6340
Fix chengelog config (#4)
QiuYe-QAQ Apr 29, 2026
b084b6f
RELEASE for 26.1 [no-snapshot] (#5)
github-actions[bot] Apr 29, 2026
fe1a030
UpData (#6)
QiuYe-QAQ Nov 16, 2026
e13ad2c
按 GregTech-Modern 统一版本分支的发布 CI (#7)
QiuYe-QAQ Nov 20, 2026
041686c
Downgrade mod_version from 2.0.1 to 2.0.0
QiuYe-QAQ Nov 21, 2026
85d46d6
合并 1.21 Kotlin 重写并适配 26.1 (#10)
QiuYe-QAQ Nov 21, 2026
2a9f728
扩展本地化规则并接入译文导入 (#11)
QiuYe-QAQ Nov 21, 2026
7be9715
完善本地化规则和导出,改用 NeoForge 注解扫描 (#12)
QiuYe-QAQ Nov 22, 2026
ea29edc
新增文本组件工具、本地化模板和通用难度 (#13)
QiuYe-QAQ Nov 25, 2026
cac43f4
UpData
QiuYe-QAQ Nov 25, 2026
9c0a989
合并 26.1 更新并适配 1.21.1
QiuYe-QAQ Nov 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ classes/
.settings
*.launch
.architectury-transformer/debug.log
**/resources/
**/src/generated/
!test/src/main/resources/
!test/src/main/resources/**

*.patch
*.DS_Store
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

- `RegistrateLib` 是本分支的库模组入口点,同时持有共享元数据/常量
`RegistrateLib` is the library mod entrypoint for the fork and also holds shared metadata/constants
- `src/test/java/com/modularmc/registrate/test/meta` 包含用于生成的桥接方法的维护辅助工具
`src/test/java/com/modularmc/registrate/test/meta` contains maintenance helpers for generated bridge methods
- `test/src/main/java/com/modularmc/registratetest` 包含用于生成的桥接方法的维护辅助工具
`test/src/main/java/com/modularmc/registratetest` contains maintenance helpers for generated bridge methods
- 当上游 Registrate 变更时,先更新实现类,然后对照 `docs/architecture.md` 重新验证包所有权
When upstream Registrate changes, update implementation classes first and then re-verify package ownership against `docs/architecture.md`
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ This repository is the `com.modularmc.registrate` fork maintained for the Modula
- `com.modularmc.registrate.internal.event` — 用于构建器和注册生命周期钩子的一次性事件连接 / one-shot event wiring used by builders and registration lifecycle hooks
- `com.modularmc.registrate.internal.lifecycle` — 实例级生命周期桥接 / per-instance lifecycle bridges
- `com.modularmc.registrate.internal.util` — 分发限制执行与内部日志辅助 / dist-gated execution and internal logging helpers
- `com.modularmc.registrate.test.mod` — 集成测试示例模组 / the integration-style sample mod
- `com.modularmc.registrate.test.gametests` — 可执行的运行时验证场景 / executable validation scenarios for runtime behavior
- `com.modularmc.registrate.test.meta` — 维护工具,使生成的桥接方法与上游 API 保持一致 / maintenance utilities that keep generated bridge methods aligned with upstream APIs
- `com.modularmc.registratetest.mod` — 集成测试示例模组 / the integration-style sample mod
- `com.modularmc.registratetest.gametests` — 可执行的运行时验证场景 / executable validation scenarios for runtime behavior
- `com.modularmc.registratetest.meta` — 维护工具,使生成的桥接方法与上游 API 保持一致 / maintenance utilities that keep generated bridge methods aligned with upstream APIs

---

Expand Down
20 changes: 1 addition & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
//alias libs.plugins.shadow
alias libs.plugins.spotless
alias libs.plugins.kotlin.jvm
alias libs.plugins.ksp
}

group = maven_group
Expand Down Expand Up @@ -40,24 +39,14 @@ sourceSets {
runtimeClasspath += main.output + main.runtimeClasspath
}

test {
compileClasspath += main.output + main.compileClasspath
runtimeClasspath += main.output + main.runtimeClasspath
resources {
srcDir 'src/test/generated/resources'
}
}

extra {
compileClasspath += main.output
runtimeClasspath += main.output + main.runtimeClasspath
}

clientExtra {
compileClasspath += client.output + extra.compileClasspath
// The normal client run also mounts the test mod, so include the test source set
// here to keep generated test resources synchronized into build/resources/test.
runtimeClasspath += client.output + client.runtimeClasspath + extra.runtimeClasspath + test.output + test.runtimeClasspath
runtimeClasspath += client.output + client.runtimeClasspath + extra.runtimeClasspath
}
}

Expand All @@ -66,8 +55,6 @@ configurations {
clientRuntimeOnly.canBeResolved = false
extraRuntimeOnly.canBeResolved = false
clientExtraRuntimeOnly.canBeResolved = false
testImplementation.canBeResolved = false
testRuntimeOnly.canBeResolved = false

runtimeClasspath.extendsFrom localRuntime
extraRuntimeClasspath.extendsFrom extraLocalRuntime
Expand All @@ -92,8 +79,3 @@ tasks.withType(JavaCompile).configureEach {
options.compilerArgs << '-Xmaxerrs' << '2000'
options.compilerArgs << "-Xlint:-removal"
}

tasks.named('test') {
// The test source set is exercised by NeoForge's GameTest server.
failOnNoDiscoveredTests = false
}
8 changes: 1 addition & 7 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@ dependencies {
additionalRuntimeClasspath(libs.kotlin.stdlib.get()) {
exclude group: 'org.jetbrains', module: 'annotations'
}

testImplementation(libs.testframework.get())
testAnnotationProcessor(project(':localization-processor'))
kspTest(project(':localization-processor'))

// Standard runtime mods //
localRuntime(libs.testframework)
jarJar(implementation(forge.mmclutils.get()))

renderNurseCfg(libs.renderNurse)

Expand Down
12 changes: 6 additions & 6 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ RegistrateLib is a maintained fork of Registrate for the `com.modularmc.registra
- `com.modularmc.registrate.internal.util`
- 分发限制执行与内部调试日志辅助 / Dist-gated execution and internal debug logging helpers

- `com.modularmc.registrate.test.mod`
- `com.modularmc.registratetest.mod`
- 用作集成测试的示例模组 / Sample mod used as an integration harness

- `com.modularmc.registrate.test.gametests`
- `com.modularmc.registratetest.gametests`
- 可执行的运行时检查 / Executable runtime checks

- `com.modularmc.registrate.test.meta`
- 用于生成的桥接方法和受保护 API 快照的维护工具 / Maintenance tooling for generated bridge methods and protected API snapshots
- `com.modularmc.registratetest.meta`
- 维护生成的桥接方法和受保护的 API 清单 / Maintains generated bridge methods and protected API listings

## 公开 API 边界 / Public API Boundary

Expand All @@ -75,8 +75,8 @@ Treat the root package plus `builders` and `util.entry` as the main downstream-f
Event-bus plumbing and other implementation-only helpers belong under `internal`
- 实例级 NeoForge 生命周期编排放在 `internal.lifecycle`
Instance-scoped NeoForge lifecycle orchestration belongs in `internal.lifecycle`
- 仅测试用的框架放在 `src/test/java`
Test-only scaffolding belongs under `src/test/java`
- 仅测试用的框架放在 `test/src/main/java`
Test-only scaffolding belongs under `test/src/main/java`

## 现代化原则 / Modernization Principles

Expand Down
94 changes: 94 additions & 0 deletions docs/localization-exchange.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Registrate Localization Exchange",
"type": "object",
"required": ["formatVersion", "modId", "sourceLocale", "entries"],
"properties": {
"formatVersion": { "const": 1 },
"modId": { "type": "string" },
"sourceLocale": { "$ref": "#/$defs/locale" },
"entries": {
"type": "array",
"items": { "$ref": "#/$defs/entry" }
}
},
"additionalProperties": false,
"$defs": {
"locale": {
"type": "string",
"pattern": "^[a-z]{2}_[a-z]{2}$"
},
"revision": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"entry": {
"type": "object",
"required": ["namespace", "key", "source", "context", "translations"],
"properties": {
"namespace": { "type": "string" },
"key": { "type": "string" },
"source": { "$ref": "#/$defs/sourceText" },
"context": { "$ref": "#/$defs/context" },
"translations": {
"type": "array",
"items": { "$ref": "#/$defs/translation" }
}
},
"additionalProperties": false
},
"sourceText": {
"type": "object",
"required": ["locale", "text", "revision"],
"properties": {
"locale": { "$ref": "#/$defs/locale" },
"text": { "type": "string" },
"revision": { "$ref": "#/$defs/revision" }
},
"additionalProperties": false
},
"context": {
"type": "object",
"required": ["domains", "type", "glossaryIds", "unitIds", "placeholderSignature"],
"properties": {
"domains": { "type": "array", "items": { "type": "string" } },
"type": { "type": ["string", "null"] },
"glossaryIds": { "type": "array", "items": { "type": "string" } },
"unitIds": { "type": "array", "items": { "type": "string" } },
"placeholderSignature": {
"type": "object",
"propertyNames": { "pattern": "^(0|[1-9][0-9]*)$" },
"additionalProperties": { "type": "integer", "minimum": 1 }
}
},
"additionalProperties": false
},
"translation": {
"type": "object",
"required": ["locale", "text", "source", "sourceRevision", "status", "locked"],
"properties": {
"locale": { "$ref": "#/$defs/locale" },
"text": { "type": "string" },
"source": { "$ref": "#/$defs/translationSource" },
"sourceRevision": { "$ref": "#/$defs/revision" },
"status": {
"type": ["string", "null"],
"enum": ["stale", "draft", "in_review", "approved", null]
},
"locked": { "type": "boolean" }
},
"additionalProperties": false
},
"translationSource": {
"type": "object",
"required": ["kind", "location"],
"properties": {
"kind": {
"enum": ["fallback", "variant", "automatic", "glossary", "imported", "declared"]
},
"location": { "type": "string" }
},
"additionalProperties": false
}
}
}
69 changes: 56 additions & 13 deletions docs/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
```java
import com.modularmc.registrate.Registrate;
import com.modularmc.registrate.localization.MinecraftLocale;
import java.nio.file.Path;

Registrate registrate = Registrate.create(MOD_ID).sourceLocale(MinecraftLocale.EN_US);
registrate.export().localization()
.path(Path.of("build", "localization", "mymod.json"))
.build();
```

`path` is the destination JSON file. Relative paths resolve against the DataGen process working directory. The export request is fulfilled after language callbacks have run once; the same declarations produce both Minecraft language files and the exchange document.

## 声明文本

物品、方块、实体和流体的 Builder 从注册对象取 Minecraft 原生翻译 Key。通用 Builder 可用 `.localization(keyFunction, text -> ...)` 指定取 Key 的方式。
Expand All @@ -30,35 +36,72 @@ var title = registrate.addLocalization(new TranslationKey(MOD_ID, "gui.mymod.vol

`addLocalization` 返回可用于 GUI 的翻译组件。进度标题等跨侧文本可在模组构造期间声明,在服务端 DataGen 的进度回调中引用组件。`addLang`、`addRawLang` 和 `ProviderType.LANG` 回调都使用同一个源 Locale。

在 `registrate.localizationCatalog()` 中登记 `Domain`、`GlossaryTerm` 和 `Unit`。Builder 的 `.profile(profile)` 可复用领域、文本类型和术语。条目的显式参数覆盖 Profile 的相应字段。
在 `registrate.terminology()` 中登记 `Domain`、`GlossaryTerm` 和 `MeasurementUnit`。用 `.localizationDefaults(defaults)` 设置模组级默认值,Builder 的 `.defaults(defaults)` 可设置条目级默认值。条目的显式参数覆盖对应默认值。

## 接入注解处理器
### 按语境选取术语

用 `./gradlew :localization-processor:jar` 构建与库版本对应的处理器。Java 源码使用 `annotationProcessor`,Kotlin 源码使用 KSP 插件和 `ksp`。混合项目可同时使用两项配置,主库作为模组依赖。
词表按声明所属的模组查询。完整源文本与词条匹配时,优先使用 `.glossaryIds("electric_potential")` 或 `.glossary(term)` 指定的术语。其余候选按 `Domain` 和 `TextType` 筛选,匹配程度相同的词条会报告声明位置与术语 ID。词表的首选译名可以补充缺少的译文。条目已有译文时,解析保留显式值,并提示禁用译名或词表未收录的写法。

```groovy
dependencies {
def processor = files("libs/registratelib-1.21.1-${registratelib_version}-localization-processor.jar")
annotationProcessor(processor)
ksp(processor)
}
通过 `registrate.terminology().register(glossary)` 接入项目自己的 `Glossary` 实现。接口通过 `find(id)` 查单条定义,通过 `findBySource(normalizedSource)` 返回完整标签的所有词义。源文本查询使用与 Locale 无关的小写形式。同一模组内的词条 ID 对应唯一的定义。

词条可登记缩写和别名、用 `TermRelation` 指定与其他词条的关系,以及关联已登记的单位 ID。单位通过 `MeasurementUnit.format(value, locale)` 格式化数值和符号。`UnitFormat` 配置 `DecimalFormat` 模式、小数分隔符和数值与符号之间的间距。

`DeclarationDefaults.Builder` 依次应用基础默认值、继承值和组合值,对应 `defaults`、`inherits` 和 `include`。同层的集合值可合并,冲突的文本类型或同 ID 词条会报错。声明可用 `.units("ohm")`、`.glossaryIds(...)` 等显式字段覆盖对应的默认值。

### 语言转换与回退

`registrate.deriveLocale(new LocaleDerivation(EN_US, EN_GB, converter))` 为模组注册转换规则。转换器处理未受保护的文本片段,可读取语言、Key 和声明。`LocaleDerivation.fallback(EN_GB, EN_AU)` 在缺少目标译文时使用已解析的输入语言。规则允许组成多步路径,循环会在 DataGen 收集时报告。已有译文优先于转换和回退。

转换会保留 Minecraft 参数、样式标记、URL、换行和已声明的单位符号。默认的 `en_us → en_ud` 同样遵循这些规则,并用显式索引保持倒置后的参数含义。

### 导出交换数据

导出文档的 `formatVersion` 当前为 `1`。每个条目保留输出命名空间、原始 Key、源文本、SHA-256 源修订、领域、TextType、词条与单位引用、占位符签名和译文候选。译文记录包含 Locale、文本、来源类型与位置、源修订、审核状态和锁定标记。自动 Locale 变体也会进入记录,`source.location` 标明原始声明与转换路径。

JSON Schema 位于 [`localization-exchange.schema.json`](localization-exchange.schema.json)。条目按命名空间和 Key 排序,译文按 Locale、来源类型和来源位置排序。显式译文的 `status` 为 `null`;导入译文保留当前审核状态和其审核时使用的源修订。

### 导入人工译文

在模组初始化时用 `importTranslation` 登记已读入的译文。提供译者审核时对应的源文本修订,以及可以定位到文件或平台条目的来源。

```java
import com.modularmc.registrate.localization.ImportedTranslation;
import com.modularmc.registrate.localization.MinecraftLocale;
import com.modularmc.registrate.localization.SourceRevision;
import com.modularmc.registrate.localization.TranslationKey;
import com.modularmc.registrate.localization.TranslationStatus;

registrate.importTranslation(new ImportedTranslation(
new TranslationKey(MOD_ID, "item.mymod.copper_ingot"),
MinecraftLocale.ZH_CN,
"铜锭",
SourceRevision.of("Copper Ingot"),
TranslationStatus.APPROVED,
false,
"translations/zh_cn.json"));
```

`@Trans` 和 `@TransVariants` 可以声明在类型或字段上。`modId` 选择声明归属的模组和源 Locale。省略 `namespace` 时,资源命名空间取 `modId`。
DataGen 用模组当前选中的源文本核对修订。源文本变化会将译文标为 `STALE`。锁定译文仍可参与选择,未锁定的过期译文仅用于诊断,此时配置的术语、转换和回退规则可以继续解析目标 Locale。开发者显式声明优先,其次是锁定的导入译文和当前修订的普通导入译文。同一层级中,已批准、审核中和草稿依次参与选择。

## 注解声明

添加 RegistrateLib 模组依赖即可在 Java 和 Kotlin 源码中使用本地化注解。DataGen 从 NeoForge 的扫描结果读取所属模组文件中的声明。升级时移除 RegistrateLib 的 `annotationProcessor` 和 `ksp` 依赖。旧构建目录里有索引文件时,清理一次再构建。

`@Trans` 和 `@TransVariants` 可以声明在类型或字段上。文件只包含一个 Mod 时可以省略 `modId`,DataGen 使用该 Mod 的源 Locale。文件包含多个 Mod 时,每条声明都必须填写 `modId`。省略 `namespace` 时,资源命名空间取所属 Mod 的 ID。

```java
@TransVariants(modId = "mymod", keyPrefix = "gui.mymod.power", value = {
@TransVariants(keyPrefix = "gui.mymod.power", value = {
@Variant(id = "low", source = "Low power"),
@Variant(id = "high", source = "High power")
})
final class Labels {
@Trans(modId = "mymod", key = "gui.mymod.container", source = "Test Container",
@Trans(key = "gui.mymod.container", source = "Test Container",
translations = @Translation(locale = MinecraftLocale.ZH_CN, text = "测试容器"))
static final String CONTAINER = "gui.mymod.container";
}
```

Kotlin 中在带有后备字段的属性上使用 `@field:Trans` 或 `@field:TransVariants`。两个处理器按 Mod ID 写入各自的版本化声明索引,DataGen 从所属模组读取并合并。变体的 Key 由前缀和 ID 拼接,例如 `gui.mymod.power.low`。同一命名空间、Key 和 Locale 下,同级异值声明会报告双方来源。`%s` 的隐式索引按出现顺序分配,译文可用 `%1$s` 等显式索引重排。
Kotlin 中在带有后备字段的属性上使用 `@field:Trans` 或 `@field:TransVariants`。变体的 Key 由前缀和 ID 拼接,例如 `gui.mymod.power.low`。同一命名空间、Key 和 Locale 下,同级异值声明会报告双方来源,并用类名、字段名和变体 ID 定位注解。`%s` 的隐式索引按出现顺序分配,译文可用 `%1$s` 等显式索引重排。

## 注册兼容性

Expand Down
2 changes: 2 additions & 0 deletions gradle/forge.versions.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[versions]
mmclutils = "0.1.0-SNAPSHOT"


## modrinth maven ##
Expand All @@ -9,5 +10,6 @@


[libraries]
mmclutils = { module = "com.modularmc.mmclutils:mmclutils-1.21.1", version.ref = "mmclutils" }

[bundles]
3 changes: 0 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ shadow = "9.6.1"
spotless = "8.11.0"
modDevGradle = "2.0.148"
kotlin = "2.4.21"
ksp = "2.3.14"
jetbrains-annotations = "26.1.0"
jspecify = "1.0.1"
renderNurse = "0.0.26"
Expand All @@ -18,7 +17,6 @@ minecraft = { module = "com.mojang:minecraft", version.ref = "mine
neoForge = { module = "net.neoforged:neoforge", version.ref = "neoForge" }
testframework = { module = "net.neoforged:testframework", version.ref = "neoForge" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
ksp-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }
renderNurse = { module = "net.neoforged:render-nurse", version.ref = "renderNurse" }
mixin = { module = "org.spongepowered:mixin", version.ref = "mixin" }
jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "jetbrains-annotations" }
Expand All @@ -29,4 +27,3 @@ modDevGradle = { id = "net.neoforged.moddev", version.ref = "modDevGr
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
4 changes: 0 additions & 4 deletions gradle/scripts/jars.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ jar {
exclude "**/SimplifiedToTraditional.properties"
}

tasks.named('assemble') {
dependsOn(':localization-processor:jar')
}

tasks.register('slimJar', Jar) {
dependsOn("classes")
archiveClassifier = "slim"
Expand Down
Loading
Loading