Finished adding the "Creeping Doubt" plant block.

Still need to do some more work, such as adding the seeds and the material you get from the plant.
This commit is contained in:
WayofTime 2020-11-21 09:54:13 -05:00
parent 032e163795
commit 295488f144
36 changed files with 451 additions and 15 deletions

View file

@ -13,6 +13,7 @@ import com.mojang.datafixers.util.Pair;
import net.minecraft.advancements.criterion.StatePropertiesPredicate;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.CropsBlock;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.LootTableProvider;
import net.minecraft.data.loot.BlockLootTables;
@ -129,6 +130,7 @@ public class GeneratorLootTable extends LootTableProvider
registerDropSelfLootTable(BloodMagicBlocks.MIMIC.get());
registerDropSelfLootTable(BloodMagicBlocks.ETHEREAL_MIMIC.get());
registerCropDropLootTable(BloodMagicBlocks.GROWING_DOUBT.get(), BloodMagicItems.WEAK_BLOOD_SHARD.get());
}
private void registerNoDropLootTable(Block block)
@ -137,6 +139,19 @@ public class GeneratorLootTable extends LootTableProvider
this.registerLootTable(block, LootTable.builder().addLootPool(builder));
}
private void registerCropDropLootTable(Block block, Item item)
{
LootTable.Builder builder = LootTable.builder();
for (int i = 0; i < 7; i++)
{
ILootCondition.IBuilder harvestAge = BlockStateProperty.builder(block).fromProperties(StatePropertiesPredicate.Builder.newBuilder().withIntProp(CropsBlock.AGE, i));
builder = builder.addLootPool(LootPool.builder().addEntry(ItemLootEntry.builder(item).acceptFunction(SetCount.builder(ConstantRange.of(1))).acceptCondition(harvestAge)));
}
this.registerLootTable(block, builder);
}
private void registerDropCrystalsLootTable(Block block, Item item)
{
LootTable.Builder builder = LootTable.builder();