proper datagen!!!!!!!!!!!!!!!
This commit is contained in:
parent
dffd0fe3c8
commit
cf27d61973
17 changed files with 354 additions and 4 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"
|
||||
}
|
||||
}
|
|
@ -26,14 +26,14 @@ public class RosesLootTableProvider extends FabricBlockLootTableProvider {
|
|||
public void generate() {
|
||||
addDrop(RosesBlocks.INSTANCE.getRoseFlower());
|
||||
addDrop(RosesBlocks.INSTANCE.getCyanRoseFlower());
|
||||
addDrop(RosesBlocks.INSTANCE.getCyanRoseBush());
|
||||
|
||||
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 tallPlant, Item item, Float min, Float max) {
|
||||
return dropsWithShears(tallPlant, this
|
||||
.applyExplosionDecay(tallPlant, ItemEntry.builder(item)
|
||||
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))));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue