Work on mimics as well as some structure tinkering.

This commit is contained in:
WayofTime 2020-11-18 13:51:58 -05:00
parent 545b50ac82
commit 546215ab37
31 changed files with 1183 additions and 5 deletions

View file

@ -79,6 +79,22 @@ public class GeneratorBlockStates extends BlockStateProvider
buildPillarCap(BloodMagicBlocks.DUNGEON_PILLAR_CAP.get(), BloodMagic.rl("block/dungeon/dungeon_pillarheart"), BloodMagic.rl("block/dungeon/dungeon_pillarbottom"), BloodMagic.rl("block/dungeon/dungeon_pillartop"));
buildAssortedBlock(BloodMagicBlocks.DUNGEON_BRICK_ASSORTED.get(), modLoc("dungeon_brick1"), modLoc("dungeon_brick2"), modLoc("dungeon_brick3"));
buildCubeAllWithTextureName("etherealopaquemimic");
buildCubeAllWithTextureName("sentientmimic");
buildCubeAllWithTextureName("solidclearmimic");
buildCubeAllWithTextureName("solidlightmimic");
buildCubeAllWithTextureName("solidopaquemimic");
}
// private void buildCustomLoader(Block block)
// {
// ModelFile modelFile = models().crop("", null);
// }
private void buildCubeAllWithTextureName(String texture)
{
models().cubeAll(texture, BloodMagic.rl("block/" + texture)).assertExistence();
}
private void buildAssortedBlock(Block block, ResourceLocation... modelResources)

View file

@ -82,6 +82,14 @@ public class GeneratorItemModels extends ItemModelProvider
registerDemonTool(BloodMagicItems.SENTIENT_SHOVEL.get());
registerSacrificialKnife(BloodMagicItems.SACRIFICIAL_DAGGER.get());
registerCustomFullTexture(BloodMagicBlocks.MIMIC.get(), "solidopaquemimic");
registerCustomFullTexture(BloodMagicBlocks.ETHEREAL_MIMIC.get(), "etherealopaquemimic");
}
private void registerCustomFullTexture(Block block, String texturePath)
{
String path = block.getRegistryName().getPath();
getBuilder(path).parent(new ModelFile.UncheckedModelFile(modLoc("block/" + texturePath)));
}
private void registerCustomBlockPath(Block block, String newPath)

View file

@ -15,7 +15,9 @@ import net.minecraft.block.Block;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.LootTableProvider;
import net.minecraft.data.loot.BlockLootTables;
import net.minecraft.data.loot.ChestLootTables;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.loot.ConstantRange;
import net.minecraft.loot.ItemLootEntry;
import net.minecraft.loot.LootParameterSet;
@ -26,6 +28,7 @@ import net.minecraft.loot.LootTableManager;
import net.minecraft.loot.ValidationTracker;
import net.minecraft.loot.conditions.BlockStateProperty;
import net.minecraft.loot.conditions.ILootCondition;
import net.minecraft.loot.functions.EnchantWithLevels;
import net.minecraft.loot.functions.SetCount;
import net.minecraft.state.Property;
import net.minecraft.util.IStringSerializable;
@ -47,7 +50,27 @@ public class GeneratorLootTable extends LootTableProvider
@Override
protected List<Pair<Supplier<Consumer<BiConsumer<ResourceLocation, LootTable.Builder>>>, LootParameterSet>> getTables()
{
return ImmutableList.of(Pair.of(BMBlocks::new, LootParameterSets.BLOCK));
return ImmutableList.of(Pair.of(BMBlocks::new, LootParameterSets.BLOCK), Pair.of(BMLootTables::new, LootParameterSets.CHEST));
}
private static class BMLootTables extends ChestLootTables
{
@Override
public void accept(BiConsumer<ResourceLocation, LootTable.Builder> acceptor)
{
acceptor.accept(BloodMagic.rl("test"), testLootTableGeneration());
}
private LootTable.Builder testLootTableGeneration()
{
LootTable.Builder table = LootTable.builder();
LootPool.Builder pool = LootPool.builder().name("test").addEntry(ItemLootEntry.builder(Items.BOOK).weight(10).acceptFunction(EnchantWithLevels.func_215895_a(ConstantRange.of(30)).func_216059_e()));
table.addLootPool(pool);
// table.build();
return table;
}
}
private static class BMBlocks extends BlockLootTables
@ -100,6 +123,10 @@ public class GeneratorLootTable extends LootTableProvider
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_POLISHED_WALL.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_BRICK_GATE.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_POLISHED_GATE.get());
registerDropSelfLootTable(BloodMagicBlocks.MIMIC.get());
registerDropSelfLootTable(BloodMagicBlocks.ETHEREAL_MIMIC.get());
}
private void registerNoDropLootTable(Block block)