-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: poisonous to frogs advancement
- Loading branch information
1 parent
70abbab
commit e0528ae
Showing
9 changed files
with
118 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/generated/data/minecraft/advancement/husbandry/witnessed_frog_poisoning.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"parent": "minecraft:husbandry/root", | ||
"criteria": { | ||
"witnessed_frog_poisoning": { | ||
"trigger": "hollow:frog_poisoned" | ||
} | ||
}, | ||
"display": { | ||
"description": { | ||
"translate": "advancements.husbandry.witnessed_frog_poisoning.description" | ||
}, | ||
"icon": { | ||
"count": 1, | ||
"id": "hollow:firefly_spawn_egg" | ||
}, | ||
"title": { | ||
"translate": "advancements.husbandry.witnessed_frog_poisoning.title" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"witnessed_frog_poisoning" | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/main/java/dev/spiritstudios/hollow/datagen/AdvancementProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package dev.spiritstudios.hollow.datagen; | ||
|
||
import dev.spiritstudios.hollow.registry.HollowCriteria; | ||
import dev.spiritstudios.hollow.registry.HollowItems; | ||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricAdvancementProvider; | ||
import net.minecraft.advancement.Advancement; | ||
import net.minecraft.advancement.AdvancementEntry; | ||
import net.minecraft.advancement.AdvancementFrame; | ||
import net.minecraft.advancement.criterion.TickCriterion; | ||
import net.minecraft.registry.RegistryWrapper; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.Identifier; | ||
|
||
import java.util.Optional; | ||
import java.util.concurrent.CompletableFuture; | ||
import java.util.function.Consumer; | ||
|
||
public class AdvancementProvider extends FabricAdvancementProvider { | ||
protected AdvancementProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup) { | ||
super(output, registryLookup); | ||
} | ||
|
||
@SuppressWarnings("removal") | ||
@Override | ||
public void generateAdvancement(RegistryWrapper.WrapperLookup wrapperLookup, Consumer<AdvancementEntry> consumer) { | ||
Advancement.Builder.createUntelemetered() | ||
.display( | ||
HollowItems.FIREFLY_SPAWN_EGG, | ||
Text.translatable("advancements.husbandry.witnessed_frog_poisoning.title"), | ||
Text.translatable("advancements.husbandry.witnessed_frog_poisoning.description"), | ||
null, | ||
AdvancementFrame.TASK, | ||
true, | ||
true, | ||
false | ||
) | ||
.parent(Identifier.ofVanilla("husbandry/root")) | ||
.criterion( | ||
"witnessed_frog_poisoning", | ||
HollowCriteria.FROG_POISONED.create(new TickCriterion.Conditions(Optional.empty())) | ||
) | ||
.build(consumer, "husbandry/witnessed_frog_poisoning"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/dev/spiritstudios/hollow/registry/HollowCriteria.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.spiritstudios.hollow.registry; | ||
|
||
import net.minecraft.advancement.criterion.TickCriterion; | ||
|
||
public final class HollowCriteria { | ||
public static final TickCriterion FROG_POISONED = new TickCriterion(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters