Skip to content

Commit

Permalink
added loot table gen
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthian committed May 29, 2023
1 parent 64d78f9 commit c21714d
Show file tree
Hide file tree
Showing 13 changed files with 327 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020-2023 Xanthian
Copyright (c) 2023 Xanthian

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantchiseledbookshelves:acacia_chiseled_bookshelf"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantchiseledbookshelves:bamboo_chiseled_bookshelf"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantchiseledbookshelves:birch_chiseled_bookshelf"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantchiseledbookshelves:cherry_chiseled_bookshelf"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantchiseledbookshelves:crimson_chiseled_bookshelf"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantchiseledbookshelves:dark_oak_chiseled_bookshelf"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantchiseledbookshelves:jungle_chiseled_bookshelf"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantchiseledbookshelves:mangrove_chiseled_bookshelf"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantchiseledbookshelves:spruce_chiseled_bookshelf"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantchiseledbookshelves:warped_chiseled_bookshelf"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class DataGenerator implements DataGeneratorEntrypoint {
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
FabricDataGenerator.Pack pack = fabricDataGenerator.createPack();

//pack.addProvider(LootTableGenerator::new);
pack.addProvider(LootTableGenerator::new);
pack.addProvider(RecipeGenerator::new);
//pack.addProvider(ModelGenerator::new);
pack.addProvider(BlockTagGenerator::new);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package net.xanthian.variantchiseledbookshelves.datagen;

import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider;
import net.xanthian.variantchiseledbookshelves.block.ChiseledBookshelves;

public class LootTableGenerator extends FabricBlockLootTableProvider {
public LootTableGenerator(FabricDataOutput dataOutput) {
super(dataOutput);
}

@Override
public void generate() {
addDropWithSilkTouch(ChiseledBookshelves.ACACIA_CHISELED_BOOKSHELF);
addDropWithSilkTouch(ChiseledBookshelves.BAMBOO_CHISELED_BOOKSHELF);
addDropWithSilkTouch(ChiseledBookshelves.BIRCH_CHISELED_BOOKSHELF);
addDropWithSilkTouch(ChiseledBookshelves.CHERRY_CHISELED_BOOKSHELF);
addDropWithSilkTouch(ChiseledBookshelves.CRIMSON_CHISELED_BOOKSHELF);
addDropWithSilkTouch(ChiseledBookshelves.DARK_OAK_CHISELED_BOOKSHELF);
addDropWithSilkTouch(ChiseledBookshelves.JUNGLE_CHISELED_BOOKSHELF);
addDropWithSilkTouch(ChiseledBookshelves.MANGROVE_CHISELED_BOOKSHELF);
addDropWithSilkTouch(ChiseledBookshelves.SPRUCE_CHISELED_BOOKSHELF);
addDropWithSilkTouch(ChiseledBookshelves.WARPED_CHISELED_BOOKSHELF);
}
}

0 comments on commit c21714d

Please sign in to comment.