File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
src/main/kotlin/dev/aaronhowser/mods/geneticsresequenced Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ data class GeneRequirements(
3737 }
3838
3939 fun getRequiredGeneHolders (
40- gene : Holder . Reference <Gene >,
40+ gene : Holder <Gene >,
4141 registries : HolderLookup .Provider
42- ): Set <Holder . Reference <Gene >> {
42+ ): Set <Holder <Gene >> {
4343 val registry = registries.lookupOrThrow(REGISTRY_KEY )
4444
4545 val resultRks = mutableSetOf<ResourceKey <Gene >>()
@@ -51,7 +51,10 @@ data class GeneRequirements(
5151 }
5252 }
5353
54- val event = ModifyGeneRequirementsEvent (gene.key(), resultRks)
54+ val key = gene.unwrapKey().getOrNull()
55+ ? : error(" Gene ${gene.value()} is not registered!" )
56+
57+ val event = ModifyGeneRequirementsEvent (key, resultRks)
5558 FORGE_BUS .post(event)
5659
5760 val geneRegistry = registries.lookupOrThrow(ModGenes .GENE_REGISTRY_KEY )
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ object GeneForgeBusEvents {
5757 val entityGeneHolders = entity.permanentGeneHolders
5858
5959 for (geneHolder in entityGeneHolders) {
60- val genesWithMissingRequirements = GeneRequirements .getGeneRequiredGeneHolders (
60+ val genesWithMissingRequirements = GeneRequirements .getRequiredGeneHolders (
6161 geneHolder,
6262 entity.registryAccess()
6363 ).filter { it !in entityGeneHolders }
@@ -69,7 +69,7 @@ object GeneForgeBusEvents {
6969 val requiredGenesComponent =
7070 ModMessageLang .MISSING_GENE_REQUIREMENTS_LIST .toComponent()
7171
72- val missingGenes = GeneRequirements .getGeneRequiredGeneHolders (
72+ val missingGenes = GeneRequirements .getRequiredGeneHolders (
7373 geneHolder,
7474 entity.registryAccess()
7575 ).filter { it !in entityGeneHolders }
You can’t perform that action at this time.
0 commit comments