From f4e20d13e7e37103e0e41c36e58da5f5479f32e8 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 2 Sep 2021 20:12:09 +0200 Subject: [PATCH] Added advancements for pegasi --- .../unicopia/advancement/UCriteria.java | 1 + .../unicopia/entity/player/PlayerPhysics.java | 1 + .../resources/assets/unicopia/lang/en_us.json | 11 +- .../unicopia/pegasus/molting_season_1.json | 29 ++++ .../unicopia/pegasus/molting_season_2.json | 57 ++++++++ .../unicopia/pegasus/molting_season_3.json | 127 ++++++++++++++++++ .../unicopia/pegasus/sky_route.json | 29 ++++ .../unicopia/advancements/unicopia/root.json | 2 +- 8 files changed, 255 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_1.json create mode 100644 src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_2.json create mode 100644 src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_3.json create mode 100644 src/main/resources/data/unicopia/advancements/unicopia/pegasus/sky_route.json diff --git a/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java b/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java index 1d86b246..0959f761 100644 --- a/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java +++ b/src/main/java/com/minelittlepony/unicopia/advancement/UCriteria.java @@ -15,6 +15,7 @@ public interface UCriteria { CustomEventCriterion.Trigger FEED_TRICK_APPLE = CUSTOM_EVENT.createTrigger("feed_trick_apple"); CustomEventCriterion.Trigger SCREECH_SELF = CUSTOM_EVENT.createTrigger("screech_self"); CustomEventCriterion.Trigger SCREECH_TWENTY_MOBS = CUSTOM_EVENT.createTrigger("screech_twenty_mobs"); + CustomEventCriterion.Trigger SHED_FEATHER = CUSTOM_EVENT.createTrigger("shed_feather"); private static > T register(T obj) { return MixinCriteria.register(obj); diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java index f1a064e6..748cc791 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java @@ -317,6 +317,7 @@ public class PlayerPhysics extends EntityPhysics implements Tickab if (entity.world.random.nextInt(9000) == 0) { entity.dropItem(UItems.PEGASUS_FEATHER); entity.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 0.3F, 1); + UCriteria.SHED_FEATHER.trigger(entity); } } diff --git a/src/main/resources/assets/unicopia/lang/en_us.json b/src/main/resources/assets/unicopia/lang/en_us.json index 8c4df720..6242945b 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -438,5 +438,14 @@ "advancements.unicopia.screech_twenty_mobs.title": "Terror From The Skies", "advancements.unicopia.screech_twenty_mobs.description": "Rain down terror on at least 20 mobs at once", "advancements.unicopia.screech_self.title": "Jeepers!", - "advancements.unicopia.screech_self.description": "Be so terrifying that you even scared your self a little" + "advancements.unicopia.screech_self.description": "Be so terrifying that you even scared your self a little", + + "advancements.unicopia.molting_season_1.title": "Molting Season", + "advancements.unicopia.molting_season_1.description": "Drop a feather whilst flying", + + "advancements.unicopia.molting_season_2.title": "Molting Season 2", + "advancements.unicopia.molting_season_2.description": "Drop 5 feathers whilst flying", + + "advancements.unicopia.molting_season_3.title": "Molting Season 3", + "advancements.unicopia.molting_season_3.description": "Drop 15 feathers whilst flying", } diff --git a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_1.json b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_1.json new file mode 100644 index 00000000..9f13e080 --- /dev/null +++ b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_1.json @@ -0,0 +1,29 @@ +{ + "parent": "unicopia:unicopia/pegasus/sky_route", + "display": { + "icon": { + "item": "unicopia:pegasus_feather" + }, + "title": { + "translate": "advancements.unicopia.molting_season_1.title" + }, + "description": { + "translate": "advancements.unicopia.molting_season_1.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": true + }, + "criteria": { + "shed_feather": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + } + }, + "requirements": [ + [ "shed_feather" ] + ] +} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_2.json b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_2.json new file mode 100644 index 00000000..fba0e60d --- /dev/null +++ b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_2.json @@ -0,0 +1,57 @@ +{ + "parent": "unicopia:unicopia/pegasus/molting_season_1", + "display": { + "icon": { + "item": "unicopia:pegasus_feather" + }, + "title": { + "translate": "advancements.unicopia.molting_season_2.title" + }, + "description": { + "translate": "advancements.unicopia.molting_season_2.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": true + }, + "criteria": { + "shed_feather_1": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_2": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_3": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_4": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_5": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + } + }, + "requirements": [ + [ "shed_feather_1" ], + [ "shed_feather_2" ], + [ "shed_feather_3" ], + [ "shed_feather_4" ], + [ "shed_feather_5" ] + ] +} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_3.json b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_3.json new file mode 100644 index 00000000..39793392 --- /dev/null +++ b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/molting_season_3.json @@ -0,0 +1,127 @@ +{ + "parent": "unicopia:unicopia/pegasus/molting_season_1", + "display": { + "icon": { + "item": "unicopia:pegasus_feather" + }, + "title": { + "translate": "advancements.unicopia.molting_season_3.title" + }, + "description": { + "translate": "advancements.unicopia.molting_season_3.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": true + }, + "criteria": { + "shed_feather_1": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_2": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_3": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_4": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_5": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_6": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_7": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_8": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_9": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_10": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_11": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_12": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_13": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_14": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + }, + "shed_feather_15": { + "trigger": "unicopia:custom", + "conditions": { + "event": "shed_feather" + } + } + }, + "requirements": [ + [ "shed_feather_1" ], + [ "shed_feather_2" ], + [ "shed_feather_3" ], + [ "shed_feather_4" ], + [ "shed_feather_5" ], + [ "shed_feather_6" ], + [ "shed_feather_7" ], + [ "shed_feather_8" ], + [ "shed_feather_9" ], + [ "shed_feather_10" ], + [ "shed_feather_11" ], + [ "shed_feather_12" ], + [ "shed_feather_13" ], + [ "shed_feather_14" ], + [ "shed_feather_15" ] + ] +} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/pegasus/sky_route.json b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/sky_route.json new file mode 100644 index 00000000..b87dd8dc --- /dev/null +++ b/src/main/resources/data/unicopia/advancements/unicopia/pegasus/sky_route.json @@ -0,0 +1,29 @@ +{ + "parent": "unicopia:unicopia/root", + "display": { + "icon": { + "item": "unicopia:pegasus_feather" + }, + "title": { + "translate": "advancements.unicopia.sky_route.title" + }, + "description": { + "translate": "advancements.unicopia.sky_route.description" + }, + "frame": "task", + "show_toast": true, + "announce_to_chat": true, + "hidden": false + }, + "criteria": { + "be_birb": { + "trigger": "unicopia:player_change_race", + "conditions": { + "race": "pegasus" + } + } + }, + "requirements": [ + [ "be_birb" ] + ] +} diff --git a/src/main/resources/data/unicopia/advancements/unicopia/root.json b/src/main/resources/data/unicopia/advancements/unicopia/root.json index 5db3b254..52f286c5 100644 --- a/src/main/resources/data/unicopia/advancements/unicopia/root.json +++ b/src/main/resources/data/unicopia/advancements/unicopia/root.json @@ -1,7 +1,7 @@ { "display": { "icon": { - "item": "unicopia:pegasus_feather" + "item": "unicopia:gryphon_feather" }, "title": { "translate": "advancements.unicopia.root.title"