aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/mayaqq/ygasi/registry/advancements/Advancements.java
diff options
context:
space:
mode:
authorMaximusbarcz <maxim.baranek@gmail.com>2022-12-23 22:31:38 +0100
committerMaximusbarcz <maxim.baranek@gmail.com>2022-12-23 22:31:38 +0100
commitf7ca47ba8132addd94928aa8615448c47a6b3d7b (patch)
treea46151060500ffba77630e64817a4bfb842268e0 /src/main/java/dev/mayaqq/ygasi/registry/advancements/Advancements.java
parente5bc4dae41d2d3e04440a4fe02793d4084427437 (diff)
downloadygasi-f7ca47ba8132addd94928aa8615448c47a6b3d7b.tar.gz
ygasi-f7ca47ba8132addd94928aa8615448c47a6b3d7b.tar.bz2
ygasi-f7ca47ba8132addd94928aa8615448c47a6b3d7b.zip
Enormous amounts of trolling :tomfoolery:, not only that I fixed basically everything and switched the entire system to advancements, it now also has a cool custom book that you can open and stuff! Only issue I'm currently facing is that you get a skill point when you get the advancement for opening the gui and clicking stuff... right not that big of an issue but when I add 2 billion advancements its gonna hurt a bit. Love, Mayaqq
Diffstat (limited to 'src/main/java/dev/mayaqq/ygasi/registry/advancements/Advancements.java')
-rw-r--r--src/main/java/dev/mayaqq/ygasi/registry/advancements/Advancements.java76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/main/java/dev/mayaqq/ygasi/registry/advancements/Advancements.java b/src/main/java/dev/mayaqq/ygasi/registry/advancements/Advancements.java
new file mode 100644
index 0000000..ac33abe
--- /dev/null
+++ b/src/main/java/dev/mayaqq/ygasi/registry/advancements/Advancements.java
@@ -0,0 +1,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");
+ }
+} \ No newline at end of file