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:
parent
032e163795
commit
295488f144
36 changed files with 451 additions and 15 deletions
|
@ -1,11 +1,13 @@
|
|||
package wayoftime.bloodmagic.common.data;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.CropsBlock;
|
||||
import net.minecraft.block.FenceGateBlock;
|
||||
import net.minecraft.block.RotatedPillarBlock;
|
||||
import net.minecraft.block.StairsBlock;
|
||||
import net.minecraft.block.WallBlock;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.state.IntegerProperty;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.generators.BlockModelBuilder;
|
||||
|
@ -86,12 +88,21 @@ public class GeneratorBlockStates extends BlockStateProvider
|
|||
buildCubeAllWithTextureName("solidclearmimic");
|
||||
buildCubeAllWithTextureName("solidlightmimic");
|
||||
buildCubeAllWithTextureName("solidopaquemimic");
|
||||
|
||||
buildCrop(BloodMagicBlocks.GROWING_DOUBT.get(), CropsBlock.AGE, 7, BloodMagic.rl("block/creeping_doubt_1"), BloodMagic.rl("block/creeping_doubt_2"), BloodMagic.rl("block/creeping_doubt_3"), BloodMagic.rl("block/creeping_doubt_4"), BloodMagic.rl("block/creeping_doubt_5"), BloodMagic.rl("block/creeping_doubt_6"), BloodMagic.rl("block/creeping_doubt_7"), BloodMagic.rl("block/creeping_doubt_8"));
|
||||
}
|
||||
|
||||
// private void buildCustomLoader(Block block)
|
||||
// {
|
||||
// ModelFile modelFile = models().crop("", null);
|
||||
// }
|
||||
private void buildCrop(Block block, IntegerProperty prop, int maxAge, ResourceLocation... textures)
|
||||
{
|
||||
String basePath = block.getRegistryName().getPath();
|
||||
VariantBlockStateBuilder builder = getVariantBuilder(block);
|
||||
|
||||
for (int i = 0; i <= maxAge; i++)
|
||||
{
|
||||
ModelFile modelFile = models().crop(basePath + "_" + (i + 1), textures[i]);
|
||||
builder.partialState().with(prop, i).modelForState().modelFile(modelFile).addModel();
|
||||
}
|
||||
}
|
||||
|
||||
private void buildFarmland(Block block, ResourceLocation top, ResourceLocation side)
|
||||
{
|
||||
|
|
|
@ -85,6 +85,7 @@ public class GeneratorItemModels extends ItemModelProvider
|
|||
|
||||
registerCustomFullTexture(BloodMagicBlocks.MIMIC.get(), "solidopaquemimic");
|
||||
registerCustomFullTexture(BloodMagicBlocks.ETHEREAL_MIMIC.get(), "etherealopaquemimic");
|
||||
this.crop(BloodMagicBlocks.GROWING_DOUBT.get().getRegistryName().getPath(), modLoc("block/creeping_doubt_8"));
|
||||
}
|
||||
|
||||
private void registerCustomFullTexture(Block block, String texturePath)
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue