Compare commits
2 commits
891893b0f5
...
cf27d61973
Author | SHA1 | Date | |
---|---|---|---|
cf27d61973 | |||
dffd0fe3c8 |
30 changed files with 450 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -13,6 +13,7 @@ MC1.20.6/.gradle/
|
|||
MC1.20.6/build/
|
||||
MC1.20.6/out/
|
||||
MC1.20.6/classes/
|
||||
MC1.20.6/src/main/generated/.cache/
|
||||
|
||||
MC1.20.6/run/
|
||||
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:alternatives",
|
||||
"children": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:match_tool",
|
||||
"predicate": {
|
||||
"items": "minecraft:shears"
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": "minecraft:rose_bush"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"functions": [
|
||||
{
|
||||
"add": false,
|
||||
"count": {
|
||||
"type": "minecraft:uniform",
|
||||
"max": 5.0,
|
||||
"min": 2.0
|
||||
},
|
||||
"function": "minecraft:set_count"
|
||||
},
|
||||
{
|
||||
"enchantment": "minecraft:fortune",
|
||||
"formula": "minecraft:ore_drops",
|
||||
"function": "minecraft:apply_bonus"
|
||||
},
|
||||
{
|
||||
"function": "minecraft:explosion_decay"
|
||||
}
|
||||
],
|
||||
"name": "roses_mod:rose_flower"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"values": [
|
||||
"roses_mod:potted_rose",
|
||||
"roses_mod:potted_cyan"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"values": [
|
||||
"roses_mod:rose_flower",
|
||||
"roses_mod:cyan_rose"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"values": [
|
||||
"roses_mod:cyan_rose_bush"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"parent": "minecraft:recipes/root",
|
||||
"criteria": {
|
||||
"has_cyan_rose": {
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"items": "roses_mod:cyan_rose"
|
||||
}
|
||||
]
|
||||
},
|
||||
"trigger": "minecraft:inventory_changed"
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "roses_mod:cyan_rose_bush"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"has_the_recipe",
|
||||
"has_cyan_rose"
|
||||
]
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"roses_mod:cyan_rose_bush"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"parent": "minecraft:recipes/root",
|
||||
"criteria": {
|
||||
"has_rose_flower": {
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"items": "roses_mod:rose_flower"
|
||||
}
|
||||
]
|
||||
},
|
||||
"trigger": "minecraft:inventory_changed"
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:rose_bush"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"has_the_recipe",
|
||||
"has_rose_flower"
|
||||
]
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:rose_bush"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"parent": "minecraft:recipes/root",
|
||||
"criteria": {
|
||||
"has_cyan_rose": {
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"items": "roses_mod:cyan_rose"
|
||||
}
|
||||
]
|
||||
},
|
||||
"trigger": "minecraft:inventory_changed"
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:cyan_dye_from_cyan_rose"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"has_the_recipe",
|
||||
"has_cyan_rose"
|
||||
]
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:cyan_dye_from_cyan_rose"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"parent": "minecraft:recipes/root",
|
||||
"criteria": {
|
||||
"has_rose_flower": {
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"items": "roses_mod:rose_flower"
|
||||
}
|
||||
]
|
||||
},
|
||||
"trigger": "minecraft:inventory_changed"
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"conditions": {
|
||||
"recipe": "minecraft:red_dye_from_rose_flower"
|
||||
},
|
||||
"trigger": "minecraft:recipe_unlocked"
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"has_the_recipe",
|
||||
"has_rose_flower"
|
||||
]
|
||||
],
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"minecraft:red_dye_from_rose_flower"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "roses_mod:cyan_rose"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:alternatives",
|
||||
"children": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:match_tool",
|
||||
"predicate": {
|
||||
"items": "minecraft:shears"
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": "roses_mod:cyan_rose_bush"
|
||||
},
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"functions": [
|
||||
{
|
||||
"add": false,
|
||||
"count": {
|
||||
"type": "minecraft:uniform",
|
||||
"max": 5.0,
|
||||
"min": 2.0
|
||||
},
|
||||
"function": "minecraft:set_count"
|
||||
},
|
||||
{
|
||||
"enchantment": "minecraft:fortune",
|
||||
"formula": "minecraft:ore_drops",
|
||||
"function": "minecraft:apply_bonus"
|
||||
},
|
||||
{
|
||||
"function": "minecraft:explosion_decay"
|
||||
}
|
||||
],
|
||||
"name": "roses_mod:cyan_rose"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"bonus_rolls": 0.0,
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
],
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "roses_mod:rose_flower"
|
||||
}
|
||||
],
|
||||
"rolls": 1.0
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "misc",
|
||||
"group": "dye",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "roses_mod:cyan_rose"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 2,
|
||||
"id": "minecraft:cyan_dye"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "misc",
|
||||
"key": {
|
||||
"#": {
|
||||
"item": "roses_mod:cyan_rose"
|
||||
}
|
||||
},
|
||||
"pattern": [
|
||||
"##",
|
||||
"##"
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
"id": "roses_mod:cyan_rose_bush"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"category": "misc",
|
||||
"group": "dye",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "roses_mod:rose_flower"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"count": 2,
|
||||
"id": "minecraft:red_dye"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "misc",
|
||||
"key": {
|
||||
"#": {
|
||||
"item": "roses_mod:rose_flower"
|
||||
}
|
||||
},
|
||||
"pattern": [
|
||||
"##",
|
||||
"##"
|
||||
],
|
||||
"result": {
|
||||
"count": 1,
|
||||
"id": "minecraft:rose_bush"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package observer.nelle.roses_mod.datagen;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.registry.tag.BlockTags;
|
||||
import observer.nelle.roses_mod.RosesBlocks;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class RosesBlockTagProvider extends FabricTagProvider.BlockTagProvider {
|
||||
public RosesBlockTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||
super(output, registriesFuture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) {
|
||||
getOrCreateTagBuilder(BlockTags.TALL_FLOWERS)
|
||||
.add(RosesBlocks.INSTANCE.getCyanRoseBush())
|
||||
;
|
||||
getOrCreateTagBuilder(BlockTags.SMALL_FLOWERS)
|
||||
.add(RosesBlocks.INSTANCE.getRoseFlower())
|
||||
.add(RosesBlocks.INSTANCE.getCyanRoseFlower())
|
||||
;
|
||||
getOrCreateTagBuilder(BlockTags.FLOWER_POTS)
|
||||
.add(RosesBlocks.INSTANCE.getPottedRose())
|
||||
.add(RosesBlocks.INSTANCE.getPottedCyan())
|
||||
;
|
||||
}
|
||||
}
|
|
@ -11,6 +11,8 @@ public class RosesDataGenerator implements DataGeneratorEntrypoint {
|
|||
|
||||
// Adding a provider example:
|
||||
//
|
||||
// pack.addProvider(AdvancementsProvider::new);
|
||||
pack.addProvider(RosesRecipeProvider::new);
|
||||
pack.addProvider(RosesBlockTagProvider::new);
|
||||
pack.addProvider(RosesLootTableProvider::new);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
package observer.nelle.roses_mod.datagen;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.enchantment.Enchantments;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.loot.LootTable;
|
||||
import net.minecraft.loot.entry.ItemEntry;
|
||||
import net.minecraft.loot.function.ApplyBonusLootFunction;
|
||||
import net.minecraft.loot.function.SetCountLootFunction;
|
||||
import net.minecraft.loot.provider.number.UniformLootNumberProvider;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import observer.nelle.roses_mod.RosesBlocks;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class RosesLootTableProvider extends FabricBlockLootTableProvider {
|
||||
protected RosesLootTableProvider(FabricDataOutput dataOutput, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup) {
|
||||
super(dataOutput, registryLookup);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
addDrop(RosesBlocks.INSTANCE.getRoseFlower());
|
||||
addDrop(RosesBlocks.INSTANCE.getCyanRoseFlower());
|
||||
|
||||
addDrop(Blocks.ROSE_BUSH, roseBushDrops(Blocks.ROSE_BUSH, Objects.requireNonNull(RosesBlocks.INSTANCE.getRoseFlower()).asItem(), 2.0F, 5.0F));
|
||||
addDrop(RosesBlocks.INSTANCE.getCyanRoseBush(), roseBushDrops(RosesBlocks.INSTANCE.getCyanRoseBush(), Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseFlower()).asItem(), 2.0F, 5.0F));
|
||||
}
|
||||
|
||||
public LootTable.Builder roseBushDrops(Block input, Item output, Float min, Float max) {
|
||||
return dropsWithShears(input, this
|
||||
.applyExplosionDecay(input, ItemEntry.builder(output)
|
||||
.apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(min, max)))
|
||||
.apply(ApplyBonusLootFunction.oreDrops(Enchantments.FORTUNE))));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package observer.nelle.roses_mod.datagen;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
|
||||
import net.minecraft.data.server.recipe.RecipeExporter;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.recipe.book.RecipeCategory;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import observer.nelle.roses_mod.RosesBlocks;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class RosesRecipeProvider extends FabricRecipeProvider {
|
||||
public RosesRecipeProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||
super(output, registriesFuture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(RecipeExporter recipeExporter) {
|
||||
offerShapelessRecipe(recipeExporter, Items.RED_DYE, Objects.requireNonNull(RosesBlocks.INSTANCE.getRoseFlower()), "dye", 2);
|
||||
offerShapelessRecipe(recipeExporter, Items.CYAN_DYE, Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseFlower()), "dye", 2);
|
||||
|
||||
offer2x2CompactingRecipe(recipeExporter, RecipeCategory.DECORATIONS, Items.ROSE_BUSH, RosesBlocks.INSTANCE.getRoseFlower());
|
||||
offer2x2CompactingRecipe(recipeExporter, RecipeCategory.DECORATIONS, Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseBush()).asItem(), RosesBlocks.INSTANCE.getCyanRoseFlower());
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue