Registry-related get methods
还没有人认领这个 Issue。
评估
调研方向
首先定位 issue 中列出的 Registry、HolderGetter、HolderLookup、RegistryAccess 和 BootstapContext 方法,然后比较 #10 所采用的方法。跟踪 ResourceKey 或 TagKey 参数来自 static 字段的调用点,并识别受影响的局部变量。完成的标准是:在列出的方法中,适用的变量始终使用从这些字段派生的名称。
由索引模型根据 Issue 内容生成。
描述
A lot of the methods on Registry, HolderGetter, HolderLookup, RegistryAccess take ResourceKey as the sole parameter returning something. A lot of the time, those ResourceKey arguments are obtained from static final fields somewhere which makes choosing the name for the local var very easy.
Something like
Holder<Structure> structure1 = registry.getHolder(BuiltinStructures.NETHER_FOSSIL);
can be changed to
Holder<Structure> netherForsilStructure = registry.getHolder(BuiltinStructures.NETHER_FOSSIL);
This is similar to #10 and how the various is and has methods are handled, by looking at the field used in the parameter.
A non-exhaustive list of methods that this could apply to are:
TagKey
TagKey#create(ResourceKey, ResourceLocation)
ResourceKey
ResourceKey#create(ResourceKey, ResourceLocation)
Registry
Registry#get(ResourceKey)Registry#getHolder(ResourceKey)Registry#getOptional(ResourceKey)Registry#getOrThrow(ResourceKey)Registry#containsKey(ResourceKey)Registry#getHolder(ResourceKey)Registry#getTag(TagKey)Registry#getTagOrEmpty(TagKey)Registry#getOrCreateTag(TagKey)
RegistryAccess, RegistryAccess$Frozen, HolderLookup$Provider
RegistryAccess#lookup(ResourceKey)RegistryAccess#lookupOrThrow(ResourceKey)RegistryAccess#registry(ResourceKey)RegistryAccess#registryOrThrow(ResourceKey)
HolderGetter, HolderLookup
HolderGetter#get(ResourceKey)HolderGetter#getOrThrow(ResourceKey)HolderGetter#get(TagKey)HolderGetter#getOrThrow(TagKey)
BootstapContext
(yes there is a typo in Bootstap in the vanilla source)
Bootstap#register(ResourceKey, Object, Lifecycle)Bootstap#register(ResourceKey, Object)Bootstap#lookup(ResourceKey)
- 主要语言
- Java
- 星标
- 24
- 派生
- 1
- 平均合并
- 2 分钟
- 30 天内合并 PR
- 1
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PaperMC/codebook 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 20/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 25/100
-
enhancement
难度 5/5 一周以上 新手友好度 30/100
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
HL7/fhir-ig-publisher#1375 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
-
Flaky: a relaunched catch-up replay can still report catching up right after its marker is written 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
johanhaleby/occurrent#1134 ·
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
objectionary/jeo-maven-plugin#1811 ·
-
难度 2/5 1-3 小时 新手友好度 88/100