Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating multiple advancement tabs #16

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ object Advancements {
* @param gustafAdvancement the root advancement for the tab
* @return the registered root-advancement in a pre-compiled state
*/
fun createTab(gustafAdvancement: GustafAdvancement): CompilableAdvancement {
val compiledAdvancement = CompilableAdvancement(gustafAdvancement, path = "")
fun createTab(gustafAdvancement: GustafAdvancement, path: String = ""): CompilableAdvancement {
val compiledAdvancement = CompilableAdvancement(gustafAdvancement, path = path)
advancements += compiledAdvancement
root = compiledAdvancement
return compiledAdvancement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,48 @@ import net.silkmc.silk.core.text.literalText

val beginnerRoot = Advancements.createTab(
GustafAdvancement(
Items.WIND_CHARGE.defaultInstance,
literalText("EinfachGustaf"),
literalText("Test Advancements"),
Items.HONEYCOMB.defaultInstance,
literalText("Beginner"),
literalText("Anfänger Advancements"),
AdvancementType.TASK,
ResourceLocation.withDefaultNamespace("textures/block/melon_side.png"),
isUnlocked = true
)
),
path = "beginner"
)

val normalRoot = Advancements.createTab(
GustafAdvancement(
Items.CAMPFIRE.defaultInstance,
literalText("Normal"),
literalText("Normale Advancements"),
AdvancementType.TASK,
ResourceLocation.withDefaultNamespace("textures/block/melon_side.png"),
isUnlocked = true
),
path = "normal"
)

val challengingRoot = Advancements.createTab(
GustafAdvancement(
Items.BOW.defaultInstance,
literalText("Challenging"),
literalText("Anspruchsvolle Advancements"),
AdvancementType.TASK,
ResourceLocation.withDefaultNamespace("textures/block/melon_side.png"),
isUnlocked = true
),
path = "challenging"
)

val legendaryRoot = Advancements.createTab(
GustafAdvancement(
Items.RECOVERY_COMPASS.defaultInstance,
literalText("Legendary"),
literalText("Schwere Advancements"),
AdvancementType.TASK,
ResourceLocation.withDefaultNamespace("textures/block/melon_side.png"),
isUnlocked = true
),
path = "legendary"
)