-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added ritual to summon random animal
- Loading branch information
1 parent
eb2c33d
commit 27eec3a
Showing
17 changed files
with
340 additions
and
13 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
3 changes: 3 additions & 0 deletions
3
src/generated/resources/assets/occultism/models/item/ritual_dummy/summon_random_animal.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,3 @@ | ||
{ | ||
"parent": "occultism:item/ritual_dummy" | ||
} |
32 changes: 32 additions & 0 deletions
32
...ated/resources/data/occultism/advancement/recipes/ritual/ritual/summon_random_animal.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,32 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_bound_foliot": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "occultism:book_of_binding_bound_foliot" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "occultism:ritual/summon_random_animal" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_the_recipe", | ||
"has_bound_foliot" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"occultism:ritual/summon_random_animal" | ||
] | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
...donomicon/books/dictionary_of_spirits/entries/summoning_rituals/summon_random_animal.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,64 @@ | ||
{ | ||
"background_u_index": 0, | ||
"background_v_index": 0, | ||
"category": "occultism:summoning_rituals", | ||
"condition": { | ||
"type": "modonomicon:true" | ||
}, | ||
"description": "", | ||
"hide_while_locked": false, | ||
"icon": { | ||
"item": "minecraft:cow_spawn_egg" | ||
}, | ||
"name": "book.occultism.dictionary_of_spirits.summoning_rituals.summon_random_animal.name", | ||
"pages": [ | ||
{ | ||
"type": "modonomicon:entity", | ||
"anchor": "", | ||
"condition": { | ||
"type": "modonomicon:none" | ||
}, | ||
"default_rotation": -45.0, | ||
"entity_id": "minecraft:cow", | ||
"name": "book.occultism.dictionary_of_spirits.summoning_rituals.summon_random_animal.entity.title", | ||
"offset": 0.0, | ||
"rotate": true, | ||
"scale": 1.0, | ||
"text": "book.occultism.dictionary_of_spirits.summoning_rituals.summon_random_animal.entity.text" | ||
}, | ||
{ | ||
"type": "occultism:ritual_recipe", | ||
"anchor": "", | ||
"condition": { | ||
"type": "modonomicon:none" | ||
}, | ||
"recipe_id_1": "occultism:ritual/summon_random_animal", | ||
"text": "", | ||
"title1": "", | ||
"title2": "" | ||
}, | ||
{ | ||
"type": "modonomicon:text", | ||
"anchor": "", | ||
"condition": { | ||
"type": "modonomicon:none" | ||
}, | ||
"show_title_separator": true, | ||
"text": "book.occultism.dictionary_of_spirits.summoning_rituals.summon_random_animal.description.text", | ||
"title": "", | ||
"use_markdown_in_title": false | ||
} | ||
], | ||
"parents": [ | ||
{ | ||
"draw_arrow": true, | ||
"entry": "occultism:summoning_rituals/summon_wild_parrot", | ||
"line_enabled": true, | ||
"line_reversed": true | ||
} | ||
], | ||
"show_when_any_parent_unlocked": false, | ||
"sort_number": -1, | ||
"x": 4, | ||
"y": 2 | ||
} |
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 |
---|---|---|
|
@@ -62,5 +62,5 @@ | |
"show_when_any_parent_unlocked": false, | ||
"sort_number": -1, | ||
"x": 2, | ||
"y": 2 | ||
"y": 4 | ||
} |
51 changes: 51 additions & 0 deletions
51
src/generated/resources/data/occultism/recipe/ritual/summon_random_animal.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,51 @@ | ||
{ | ||
"type": "occultism:ritual", | ||
"activation_item": { | ||
"item": "occultism:book_of_binding_bound_foliot" | ||
}, | ||
"ingredients": [ | ||
{ | ||
"tag": "c:crops" | ||
}, | ||
{ | ||
"tag": "c:crops" | ||
}, | ||
{ | ||
"tag": "c:crops" | ||
}, | ||
{ | ||
"tag": "c:crops" | ||
}, | ||
{ | ||
"tag": "c:crops" | ||
}, | ||
{ | ||
"tag": "c:crops" | ||
}, | ||
{ | ||
"tag": "c:crops" | ||
}, | ||
{ | ||
"tag": "c:crops" | ||
}, | ||
{ | ||
"item": "minecraft:egg" | ||
} | ||
], | ||
"pentacle_id": "occultism:summon_foliot", | ||
"result": { | ||
"components": { | ||
"minecraft:item_name": "{\"translate\":\"item.occultism.ritual_dummy.summon_random_animal\"}", | ||
"minecraft:lore": [ | ||
"{\"translate\":\"item.occultism.ritual_dummy.summon_random_animal.tooltip\"}" | ||
] | ||
}, | ||
"count": 1, | ||
"id": "minecraft:sheep_spawn_egg" | ||
}, | ||
"ritual_dummy": { | ||
"count": 1, | ||
"id": "occultism:ritual_dummy/summon_random_animal" | ||
}, | ||
"ritual_type": "occultism:summon_random_animal" | ||
} |
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
31 changes: 31 additions & 0 deletions
31
src/generated/resources/data/occultism/tags/entity_type/random_animals_to_summon_list.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,31 @@ | ||
{ | ||
"values": [ | ||
"minecraft:armadillo", | ||
"minecraft:axolotl", | ||
"minecraft:bat", | ||
"minecraft:bee", | ||
"minecraft:camel", | ||
"minecraft:cat", | ||
"minecraft:chicken", | ||
"minecraft:cow", | ||
"minecraft:donkey", | ||
"minecraft:fox", | ||
"minecraft:frog", | ||
"minecraft:horse", | ||
"minecraft:iron_golem", | ||
"minecraft:llama", | ||
"minecraft:mooshroom", | ||
"minecraft:mule", | ||
"minecraft:ocelot", | ||
"minecraft:panda", | ||
"minecraft:parrot", | ||
"minecraft:pig", | ||
"minecraft:polar_bear", | ||
"minecraft:rabbit", | ||
"minecraft:sheep", | ||
"minecraft:snow_golem", | ||
"minecraft:turtle", | ||
"minecraft:villager", | ||
"minecraft:wolf" | ||
] | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/klikli_dev/occultism/common/ritual/SummonRandomAnimalRitual.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,27 @@ | ||
package com.klikli_dev.occultism.common.ritual; | ||
|
||
import com.klikli_dev.occultism.crafting.recipe.RitualRecipe; | ||
import com.klikli_dev.occultism.registry.OccultismTags; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.world.entity.EntityType; | ||
import net.minecraft.world.level.Level; | ||
|
||
import java.util.stream.StreamSupport; | ||
|
||
public class SummonRandomAnimalRitual extends SummonRitual{ | ||
public SummonRandomAnimalRitual(RitualRecipe recipe) { | ||
super(recipe, false); | ||
} | ||
|
||
@Override | ||
protected EntityType<?> getEntityToSummon(Level level) { | ||
var options = StreamSupport.stream(BuiltInRegistries.ENTITY_TYPE.getTagOrEmpty(OccultismTags.Entities.RANDOM_ANIMALS_TO_SUMMON_LIST).spliterator(), false).toList(); | ||
|
||
if (options.isEmpty()) { | ||
return null; | ||
} | ||
|
||
int index = level.random.nextInt(options.size()); | ||
return options.get(index).value(); | ||
} | ||
} |
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
Oops, something went wrong.