1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
package dev.mayaqq.ygasi.registry.advancements;
import de.dafuqs.revelationary.advancement_criteria.AdvancementGottenCriterion;
import net.minecraft.advancement.Advancement;
import net.minecraft.advancement.AdvancementFrame;
import net.minecraft.advancement.criterion.ImpossibleCriterion;
import net.minecraft.item.Items;
import net.minecraft.predicate.entity.EntityPredicate;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import java.util.function.Consumer;
public class Advancements implements Consumer<Consumer<Advancement>> {
@Override
public void accept(Consumer<Advancement> consumer) {
Advancement rootAdvancement = Advancement.Builder.create()
.display(
Items.DIAMOND, // The display icon
Text.literal("You've got a skill issue!"), // The title
Text.literal("The journey begins here!"), // The description
new Identifier("textures/block/sculk_catalyst_top.png"), // Background image used
AdvancementFrame.CHALLENGE, // Options: TASK, CHALLENGE, GOAL
true, // Show toast top right
false, // Announce to chat
false // Hidden in the advancement tab
)
// The first string used in criterion is the name referenced by other advancements when they want to have 'requirements'
.criterion("opened_skill_menu", new ImpossibleCriterion.Conditions())
.build(consumer, "ygasi" + "/root");
Advancement mercenary = Advancement.Builder.create().parent(rootAdvancement)
.display(
Items.IRON_SWORD,
Text.literal("Mercenary"),
Text.literal("Unlock the mercenary branch!"),
null,
AdvancementFrame.GOAL,
false,
false,
false
)
.criterion("unlocked_mercenary", new ImpossibleCriterion.Conditions())
.criterion("gotten_previous", new AdvancementGottenCriterion.Conditions(EntityPredicate.Extended.EMPTY, rootAdvancement.getId()))
.build(consumer, "ygasi" + "/mercenary");
Advancement wizardry = Advancement.Builder.create().parent(rootAdvancement)
.display(
Items.BLAZE_ROD,
Text.literal("Wizardry"),
Text.literal("Unlock the wizardry branch!"),
null,
AdvancementFrame.GOAL,
false,
false,
false
)
.criterion("unlocked_wizardry", new ImpossibleCriterion.Conditions())
.criterion("gotten_previous", new AdvancementGottenCriterion.Conditions(EntityPredicate.Extended.EMPTY, rootAdvancement.getId()))
.build(consumer, "ygasi" + "/wizardry");
Advancement druidry = Advancement.Builder.create().parent(rootAdvancement)
.display(
Items.OAK_SAPLING,
Text.literal("Druidry"),
Text.literal("Unlock the druidry branch!"),
null,
AdvancementFrame.GOAL,
false,
false,
false
)
.criterion("unlocked_druidry", new ImpossibleCriterion.Conditions())
.criterion("gotten_previous", new AdvancementGottenCriterion.Conditions(EntityPredicate.Extended.EMPTY, rootAdvancement.getId()))
.build(consumer, "ygasi" + "/druidry");
}
}
|