From 57f2d41f1b18ac554c71903434c0dbb5626d6b1a Mon Sep 17 00:00:00 2001 From: EngineMachiner Date: Sat, 28 Sep 2024 19:14:55 -0500 Subject: [PATCH] Update ModAdvancement.kt --- .../com/enginemachiner/harmony/ModAdvancement.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/com/enginemachiner/harmony/ModAdvancement.kt b/src/main/kotlin/com/enginemachiner/harmony/ModAdvancement.kt index 9728758..1e1dce7 100644 --- a/src/main/kotlin/com/enginemachiner/harmony/ModAdvancement.kt +++ b/src/main/kotlin/com/enginemachiner/harmony/ModAdvancement.kt @@ -32,13 +32,16 @@ abstract class ModAdvancement : ModID { fun build( consumer: Consumer, criterion: String = name ): Advancement { - val advancement = Advancement.Task.create() + val builder = Advancement.Task.create() .display( icon, title(), description(), background, frame, toast, announce, hidden ) - .parent( parent?.advancement ).criterion( criterion, conditions() ) - .build( consumer, "$MOD_NAME/$name" ) + .criterion( criterion, conditions() ) + + if ( parent != null ) builder.parent( parent!!.advancement ) + + val advancement = builder.build( consumer, "$MOD_NAME/$name" ) this.advancement = advancement; return advancement } -} \ No newline at end of file +}