Added a bunch of the dungeon blocks to the mod.

Mainly only the "Raw" variants right now. No recipes have been added yet.
This commit is contained in:
WayofTime 2020-11-14 16:15:26 -05:00
parent cb2db9bc50
commit ddadbef425
117 changed files with 2547 additions and 4 deletions

View file

@ -92,6 +92,7 @@ public class BloodMagic
BloodMagicItems.BLOOD_ORBS.createAndRegister(modBus, "bloodorbs");
BloodMagicItems.BASICITEMS.register(modBus);
BloodMagicBlocks.BASICBLOCKS.register(modBus);
BloodMagicBlocks.DUNGEONBLOCKS.register(modBus);
BloodMagicBlocks.FLUIDS.register(modBus);
BloodMagicBlocks.CONTAINERS.register(modBus);
BloodMagicEntityTypes.ENTITY_TYPES.register(modBus);

View file

@ -3,8 +3,12 @@ package wayoftime.bloodmagic.common.block;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.AbstractBlock.Properties;
import net.minecraft.block.Block;
import net.minecraft.block.FenceGateBlock;
import net.minecraft.block.FlowingFluidBlock;
import net.minecraft.block.RotatedPillarBlock;
import net.minecraft.block.SoundType;
import net.minecraft.block.StairsBlock;
import net.minecraft.block.WallBlock;
import net.minecraft.block.material.Material;
import net.minecraft.fluid.FlowingFluid;
import net.minecraft.fluid.Fluid;
@ -22,6 +26,7 @@ import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.block.enums.BloodRuneType;
import wayoftime.bloodmagic.common.block.base.BlockPillarCap;
import wayoftime.bloodmagic.common.item.BloodMagicItems;
import wayoftime.bloodmagic.ritual.EnumRuneType;
import wayoftime.bloodmagic.tile.contailer.ContainerAlchemicalReactionChamber;
@ -36,6 +41,7 @@ public class BloodMagicBlocks
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, BloodMagic.MODID);
public static final DeferredRegister<Block> BASICBLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, BloodMagic.MODID);
public static final DeferredRegister<Block> DUNGEONBLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, BloodMagic.MODID);
public static final DeferredRegister<Item> ITEMS = BloodMagicItems.ITEMS;
public static final DeferredRegister<Fluid> FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, BloodMagic.MODID);
public static final DeferredRegister<ContainerType<?>> CONTAINERS = DeferredRegister.create(ForgeRegistries.CONTAINERS, BloodMagic.MODID);
@ -107,8 +113,35 @@ public class BloodMagicBlocks
public static final RegistryObject<ContainerType<ContainerAlchemicalReactionChamber>> ARC_CONTAINER = CONTAINERS.register("arc_container", () -> IForgeContainerType.create(ContainerAlchemicalReactionChamber::new));
public static final RegistryObject<ContainerType<ContainerAlchemyTable>> ALCHEMY_TABLE_CONTAINER = CONTAINERS.register("alchemy_table_container", () -> IForgeContainerType.create(ContainerAlchemyTable::new));
// public static final RegistryObject<BloodstoneBlock> BLOOD_STONE = registerNoItem("blood_stone", () -> new BloodstoneBlock());
//
// Dungeon Blocks
public static final RegistryObject<Block> DUNGEON_BRICK_1 = DUNGEONBLOCKS.register("dungeon_brick1", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_BRICK_2 = DUNGEONBLOCKS.register("dungeon_brick2", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_BRICK_3 = DUNGEONBLOCKS.register("dungeon_brick3", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_STONE = BLOCKS.register("dungeon_stone", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_EYE = DUNGEONBLOCKS.register("dungeon_eye", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool().setLightLevel((state) -> {
return 15;
})));
public static final RegistryObject<Block> DUNGEON_POLISHED_STONE = DUNGEONBLOCKS.register("dungeon_polished", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_TILE = DUNGEONBLOCKS.register("dungeon_tile", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_SMALL_BRICK = DUNGEONBLOCKS.register("dungeon_smallbrick", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_TILE_SPECIAL = DUNGEONBLOCKS.register("dungeon_tilespecial", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_BRICK_ASSORTED = BLOCKS.register("dungeon_brick_assorted", () -> new Block(Properties.create(Material.ROCK).hardnessAndResistance(20.0F, 50.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(3).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_BRICK_STAIRS = BLOCKS.register("dungeon_brick_stairs", () -> new StairsBlock(() -> DUNGEON_BRICK_1.get().getDefaultState(), Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_POLISHED_STAIRS = BLOCKS.register("dungeon_polished_stairs", () -> new StairsBlock(() -> DUNGEON_POLISHED_STONE.get().getDefaultState(), Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_PILLAR_CENTER = BLOCKS.register("dungeon_pillar_center", () -> new RotatedPillarBlock(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_PILLAR_SPECIAL = BLOCKS.register("dungeon_pillar_special", () -> new RotatedPillarBlock(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_PILLAR_CAP = BLOCKS.register("dungeon_pillar_cap", () -> new BlockPillarCap(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_BRICK_WALL = BLOCKS.register("dungeon_brick_wall", () -> new WallBlock(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_POLISHED_WALL = BLOCKS.register("dungeon_polished_wall", () -> new WallBlock(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_BRICK_GATE = BLOCKS.register("dungeon_brick_gate", () -> new FenceGateBlock(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
public static final RegistryObject<Block> DUNGEON_POLISHED_GATE = BLOCKS.register("dungeon_polished_gate", () -> new FenceGateBlock(Properties.create(Material.ROCK).hardnessAndResistance(2.0F, 5.0F).sound(SoundType.STONE).harvestTool(ToolType.PICKAXE).harvestLevel(2).setRequiresTool()));
//
//// private static <T extends Block> RegistryObject<T> register(String name, Supplier<? extends T> sup, Function<RegistryObject<T>, Supplier<? extends Item>> itemCreator)
//// {
//// RegistryObject<T> ret = registerNoItem(name, sup);

View file

@ -0,0 +1,58 @@
package wayoftime.bloodmagic.common.block.base;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
public class BlockPillarCap extends Block
{
public static final DirectionProperty FACING = BlockStateProperties.FACING;
public BlockPillarCap(Properties prop)
{
super(prop);
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context)
{
return this.getDefaultState().with(FACING, context.getFace());
}
/**
* Returns the blockstate with the given rotation from the passed blockstate. If
* inapplicable, returns the passed blockstate.
*
* @deprecated call via {@link IBlockState#withRotation(Rotation)} whenever
* possible. Implementing/overriding is fine.
*/
@Override
public BlockState rotate(BlockState state, Rotation rot)
{
return state.with(FACING, rot.rotate(state.get(FACING)));
}
/**
* Returns the blockstate with the given mirror of the passed blockstate. If
* inapplicable, returns the passed blockstate.
*
* @deprecated call via {@link IBlockState#withMirror(Mirror)} whenever
* possible. Implementing/overriding is fine.
*/
@Override
public BlockState mirror(BlockState state, Mirror mirrorIn)
{
return state.rotate(mirrorIn.toRotation(state.get(FACING)));
}
@Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder)
{
builder.add(FACING);
}
}

View file

@ -1,11 +1,19 @@
package wayoftime.bloodmagic.common.data;
import net.minecraft.block.Block;
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.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.generators.BlockModelBuilder;
import net.minecraftforge.client.model.generators.BlockStateProvider;
import net.minecraftforge.client.model.generators.ConfiguredModel;
import net.minecraftforge.client.model.generators.ConfiguredModel.Builder;
import net.minecraftforge.client.model.generators.ModelBuilder.ElementBuilder;
import net.minecraftforge.client.model.generators.ModelBuilder.FaceRotation;
import net.minecraftforge.client.model.generators.ModelFile;
import net.minecraftforge.client.model.generators.MultiPartBlockStateBuilder;
import net.minecraftforge.client.model.generators.MultiPartBlockStateBuilder.PartBuilder;
@ -16,6 +24,7 @@ import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.common.block.BlockAlchemicalReactionChamber;
import wayoftime.bloodmagic.common.block.BlockDemonCrystal;
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
import wayoftime.bloodmagic.common.block.base.BlockPillarCap;
public class GeneratorBlockStates extends BlockStateProvider
{
@ -35,6 +44,11 @@ public class GeneratorBlockStates extends BlockStateProvider
buildCubeAll(block.get());
}
for (RegistryObject<Block> block : BloodMagicBlocks.DUNGEONBLOCKS.getEntries())
{
buildDungeonBlock(block.get());
}
buildCubeAll(BloodMagicBlocks.BLOOD_LIGHT.get());
buildCubeAll(BloodMagicBlocks.BLANK_RITUAL_STONE.get());
buildCubeAll(BloodMagicBlocks.AIR_RITUAL_STONE.get());
@ -51,6 +65,155 @@ public class GeneratorBlockStates extends BlockStateProvider
buildCrystal(BloodMagicBlocks.DESTRUCTIVE_CRYSTAL_BLOCK.get(), "destructivecrystal");
buildCrystal(BloodMagicBlocks.VENGEFUL_CRYSTAL_BLOCK.get(), "vengefulcrystal");
buildCrystal(BloodMagicBlocks.STEADFAST_CRYSTAL_BLOCK.get(), "steadfastcrystal");
buildRandomStone(BloodMagicBlocks.DUNGEON_STONE.get(), BloodMagic.rl("block/dungeon/dungeon_stone"));
stairsBlock((StairsBlock) BloodMagicBlocks.DUNGEON_BRICK_STAIRS.get(), BloodMagic.rl("block/dungeon/dungeon_brick1"));
stairsBlock((StairsBlock) BloodMagicBlocks.DUNGEON_POLISHED_STAIRS.get(), BloodMagic.rl("block/dungeon/dungeon_polished"));
buildPillarCenter(BloodMagicBlocks.DUNGEON_PILLAR_CENTER.get(), BloodMagic.rl("block/dungeon/dungeon_pillar"), BloodMagic.rl("block/dungeon/dungeon_pillarheart"));
buildPillarCenter(BloodMagicBlocks.DUNGEON_PILLAR_SPECIAL.get(), BloodMagic.rl("block/dungeon/dungeon_pillarspecial"), BloodMagic.rl("block/dungeon/dungeon_pillarheart"));
buildWallInventory((WallBlock) BloodMagicBlocks.DUNGEON_BRICK_WALL.get(), BloodMagic.rl("block/dungeon/dungeon_brick1"));
buildWallInventory((WallBlock) BloodMagicBlocks.DUNGEON_POLISHED_WALL.get(), BloodMagic.rl("block/dungeon/dungeon_polished"));
fenceGateBlock((FenceGateBlock) BloodMagicBlocks.DUNGEON_BRICK_GATE.get(), BloodMagic.rl("block/dungeon/dungeon_brick1"));
fenceGateBlock((FenceGateBlock) BloodMagicBlocks.DUNGEON_POLISHED_GATE.get(), BloodMagic.rl("block/dungeon/dungeon_polished"));
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"));
}
private void buildAssortedBlock(Block block, ResourceLocation... modelResources)
{
getVariantBuilder(block).forAllStates(state -> {
Builder builder = ConfiguredModel.builder();
for (int i = 0; i < modelResources.length; i++)
{
ResourceLocation location = modelResources[i];
ModelFile file = models().getExistingFile(location);
if (i < modelResources.length - 1)
{
builder = builder.modelFile(file).nextModel();
} else
{
builder = builder.modelFile(file);
}
}
return builder.build();
});
}
private void buildRandomStone(Block block, ResourceLocation texture)
{
String basePath = block.getRegistryName().getPath();
ModelFile modelFile = models().cubeAll(basePath, texture);
ModelFile modelFile_mirrored = models().withExistingParent(basePath + "_mirrored", "cube_mirrored_all").texture("all", texture);
getVariantBuilder(block).forAllStates(state -> ConfiguredModel.builder().modelFile(modelFile).nextModel().modelFile(modelFile_mirrored).nextModel().modelFile(modelFile).rotationY(180).nextModel().modelFile(modelFile_mirrored).rotationY(180).build());
}
private void buildWallInventory(WallBlock block, ResourceLocation texture)
{
String basePath = block.getRegistryName().getPath();
wallBlock(block, texture);
ModelFile file = models().wallInventory(basePath + "_inventory", texture);
file.assertExistence();
}
private void buildDungeonBlock(Block block)
{
String basePath = block.getRegistryName().getPath();
ModelFile modelFile = models().cubeAll(basePath, BloodMagic.rl("block/dungeon/" + basePath));
getVariantBuilder(block).forAllStates(state -> ConfiguredModel.builder().modelFile(modelFile).build());
// ModelFile furnace_off = models().cubeAll(block.getRegistryName().toString(), texture)\
}
private void buildPillarCenter(Block block, ResourceLocation side, ResourceLocation pillarEnd)
{
String basePath = block.getRegistryName().getPath();
ModelFile yModel = models().cubeColumn(basePath, side, pillarEnd);
ElementBuilder xElementBuilder = models().withExistingParent(basePath + "_x", "cube").texture("particle", side).texture("end", pillarEnd).texture("side", side).element();
xElementBuilder.face(Direction.UP).uvs(0, 0, 16, 16).texture("#side").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
xElementBuilder.face(Direction.DOWN).uvs(0, 0, 16, 16).texture("#side").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
xElementBuilder.face(Direction.NORTH).uvs(0, 0, 16, 16).texture("#side").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
xElementBuilder.face(Direction.SOUTH).uvs(0, 0, 16, 16).texture("#side").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
xElementBuilder.face(Direction.WEST).uvs(16, 0, 0, 16).texture("#end").end();
xElementBuilder.face(Direction.EAST).uvs(16, 0, 0, 16).texture("#end").end();
ModelFile xModel = xElementBuilder.end();
ElementBuilder zElementBuilder = models().withExistingParent(basePath + "_z", "cube").texture("particle", side).texture("end", pillarEnd).texture("side", side).element();
zElementBuilder.face(Direction.UP).uvs(0, 0, 16, 16).texture("#side").end();
zElementBuilder.face(Direction.DOWN).uvs(0, 0, 16, 16).texture("#side").end();
zElementBuilder.face(Direction.NORTH).uvs(0, 0, 16, 16).texture("#end").end();
zElementBuilder.face(Direction.SOUTH).uvs(0, 0, 16, 16).texture("#end").end();
zElementBuilder.face(Direction.WEST).uvs(16, 0, 0, 16).texture("#side").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
zElementBuilder.face(Direction.EAST).uvs(16, 0, 0, 16).texture("#side").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
ModelFile zModel = zElementBuilder.end();
VariantBlockStateBuilder builder = getVariantBuilder(block);
builder.partialState().with(RotatedPillarBlock.AXIS, Direction.Axis.X).modelForState().modelFile(xModel).addModel();
builder.partialState().with(RotatedPillarBlock.AXIS, Direction.Axis.Y).modelForState().modelFile(yModel).addModel();
builder.partialState().with(RotatedPillarBlock.AXIS, Direction.Axis.Z).modelForState().modelFile(zModel).addModel();
}
private void buildPillarCap(Block block, ResourceLocation pillarEnd, ResourceLocation sideBottom, ResourceLocation sideTop)
{
String basePath = block.getRegistryName().getPath();
ModelFile upModel = models().cubeBottomTop(basePath, sideTop, pillarEnd, pillarEnd);
ModelFile downModel = models().cubeBottomTop(basePath + "_down", sideBottom, pillarEnd, pillarEnd);
ElementBuilder northElementBuilder = models().withExistingParent(basePath + "_north", "cube").texture("particle", pillarEnd).texture("sideBottom", sideBottom).texture("end", pillarEnd).texture("sideTop", sideTop).element();
northElementBuilder.face(Direction.UP).uvs(0, 0, 16, 16).texture("#sideTop").end();
northElementBuilder.face(Direction.DOWN).uvs(0, 0, 16, 16).texture("#sideBottom").end();
northElementBuilder.face(Direction.NORTH).uvs(0, 0, 16, 16).texture("#end").end();
northElementBuilder.face(Direction.SOUTH).uvs(0, 0, 16, 16).texture("#end").end();
northElementBuilder.face(Direction.WEST).uvs(16, 0, 0, 16).texture("#sideTop").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
northElementBuilder.face(Direction.EAST).uvs(16, 0, 0, 16).texture("#sideBottom").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
ModelFile northModel = northElementBuilder.end();
ElementBuilder southElementBuilder = models().withExistingParent(basePath + "_south", "cube").texture("particle", pillarEnd).texture("sideBottom", sideBottom).texture("end", pillarEnd).texture("sideTop", sideTop).element();
southElementBuilder.face(Direction.UP).uvs(0, 0, 16, 16).texture("#sideBottom").end();
southElementBuilder.face(Direction.DOWN).uvs(0, 0, 16, 16).texture("#sideTop").end();
southElementBuilder.face(Direction.NORTH).uvs(0, 0, 16, 16).texture("#end").end();
southElementBuilder.face(Direction.SOUTH).uvs(0, 0, 16, 16).texture("#end").end();
southElementBuilder.face(Direction.WEST).uvs(16, 0, 0, 16).texture("#sideBottom").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
southElementBuilder.face(Direction.EAST).uvs(16, 0, 0, 16).texture("#sideTop").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
ModelFile southModel = southElementBuilder.end();
ElementBuilder westElementBuilder = models().withExistingParent(basePath + "_west", "cube").texture("particle", pillarEnd).texture("sideBottom", sideBottom).texture("end", pillarEnd).texture("sideTop", sideTop).element();
westElementBuilder.face(Direction.UP).uvs(0, 0, 16, 16).texture("#sideTop").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
westElementBuilder.face(Direction.DOWN).uvs(0, 0, 16, 16).texture("#sideTop").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
westElementBuilder.face(Direction.NORTH).uvs(0, 0, 16, 16).texture("#sideBottom").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
westElementBuilder.face(Direction.SOUTH).uvs(0, 0, 16, 16).texture("#sideTop").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
westElementBuilder.face(Direction.WEST).uvs(16, 0, 0, 16).texture("#end").end();
westElementBuilder.face(Direction.EAST).uvs(16, 0, 0, 16).texture("#end").end();
ModelFile westModel = westElementBuilder.end();
ElementBuilder eastElementBuilder = models().withExistingParent(basePath + "_east", "cube").texture("particle", pillarEnd).texture("sideBottom", sideBottom).texture("end", pillarEnd).texture("sideTop", sideTop).element();
eastElementBuilder.face(Direction.UP).uvs(0, 0, 16, 16).texture("#sideBottom").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
eastElementBuilder.face(Direction.DOWN).uvs(0, 0, 16, 16).texture("#sideBottom").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
eastElementBuilder.face(Direction.NORTH).uvs(0, 0, 16, 16).texture("#sideTop").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
eastElementBuilder.face(Direction.SOUTH).uvs(0, 0, 16, 16).texture("#sideBottom").rotation(FaceRotation.COUNTERCLOCKWISE_90).end();
eastElementBuilder.face(Direction.WEST).uvs(16, 0, 0, 16).texture("#end").end();
eastElementBuilder.face(Direction.EAST).uvs(16, 0, 0, 16).texture("#end").end();
ModelFile eastModel = eastElementBuilder.end();
VariantBlockStateBuilder builder = getVariantBuilder(block);
builder.partialState().with(BlockPillarCap.FACING, Direction.UP).modelForState().modelFile(upModel).addModel();
builder.partialState().with(BlockPillarCap.FACING, Direction.DOWN).modelForState().modelFile(downModel).addModel();
builder.partialState().with(BlockPillarCap.FACING, Direction.NORTH).modelForState().modelFile(northModel).addModel();
builder.partialState().with(BlockPillarCap.FACING, Direction.SOUTH).modelForState().modelFile(southModel).addModel();
builder.partialState().with(BlockPillarCap.FACING, Direction.WEST).modelForState().modelFile(westModel).addModel();
builder.partialState().with(BlockPillarCap.FACING, Direction.EAST).modelForState().modelFile(eastModel).addModel();
}
private BlockModelBuilder rotateTextureFace(BlockModelBuilder file, Direction face, FaceRotation rotation, String texture)
{
// BiConsumer<Direction, ModelBuilder<BlockModelBuilder>.ElementBuilder.FaceBuilder> biCon = (fc, rot) -> {
// rot.rotation(rotation).texture(texture);
// };
return file.element().face(face).uvs(16, 0, 0, 16).rotation(rotation).texture("#east").end().end();
// return file.element().faces(biCon).texture("#east").end();
}
private void buildCubeAll(Block block)
@ -58,6 +221,11 @@ public class GeneratorBlockStates extends BlockStateProvider
getVariantBuilder(block).forAllStates(state -> ConfiguredModel.builder().modelFile(cubeAll(block)).build());
}
// private void buildStairs(StairsBlock block, ResourceLocation texture)
// {
// getVariantBuilder(block).forAllStates(state -> ConfiguredModel.builder().modelFile(stairsBlock(block, texture)).build());
// }
private void buildCrystal(Block block, String name)
{
MultiPartBlockStateBuilder builder = getMultipartBuilder(block);

View file

@ -4,9 +4,11 @@ import java.nio.file.Path;
import net.minecraft.data.BlockTagsProvider;
import net.minecraft.data.DataGenerator;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.data.ExistingFileHelper;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
public class GeneratorBlockTags extends BlockTagsProvider
{
@ -18,6 +20,8 @@ public class GeneratorBlockTags extends BlockTagsProvider
@Override
public void registerTags()
{
this.getOrCreateBuilder(BlockTags.WALLS).add(BloodMagicBlocks.DUNGEON_BRICK_WALL.get());
this.getOrCreateBuilder(BlockTags.WALLS).add(BloodMagicBlocks.DUNGEON_POLISHED_WALL.get());
}
/**

View file

@ -36,6 +36,11 @@ public class GeneratorItemModels extends ItemModelProvider
registerBlockModel(block.get());
}
for (RegistryObject<Block> block : BloodMagicBlocks.DUNGEONBLOCKS.getEntries())
{
registerBlockModel(block.get());
}
registerBlockModel(BloodMagicBlocks.BLANK_RITUAL_STONE.get());
registerBlockModel(BloodMagicBlocks.AIR_RITUAL_STONE.get());
registerBlockModel(BloodMagicBlocks.WATER_RITUAL_STONE.get());
@ -51,6 +56,18 @@ public class GeneratorItemModels extends ItemModelProvider
registerCustomBlockPath(BloodMagicBlocks.VENGEFUL_CRYSTAL_BLOCK.get(), "crystal/vengefulcrystal1");
registerCustomBlockPath(BloodMagicBlocks.STEADFAST_CRYSTAL_BLOCK.get(), "crystal/steadfastcrystal1");
registerCustomBlockPath(BloodMagicBlocks.DUNGEON_BRICK_ASSORTED.get(), "dungeon_brick1");
registerBlockModel(BloodMagicBlocks.DUNGEON_STONE.get());
registerBlockModel(BloodMagicBlocks.DUNGEON_BRICK_STAIRS.get());
registerBlockModel(BloodMagicBlocks.DUNGEON_POLISHED_STAIRS.get());
registerBlockModel(BloodMagicBlocks.DUNGEON_PILLAR_CENTER.get());
registerBlockModel(BloodMagicBlocks.DUNGEON_PILLAR_SPECIAL.get());
registerBlockModel(BloodMagicBlocks.DUNGEON_PILLAR_CAP.get());
registerCustomBlockPath(BloodMagicBlocks.DUNGEON_BRICK_WALL.get(), "dungeon_brick_wall_inventory");
registerCustomBlockPath(BloodMagicBlocks.DUNGEON_POLISHED_WALL.get(), "dungeon_polished_wall_inventory");
registerBlockModel(BloodMagicBlocks.DUNGEON_BRICK_GATE.get());
registerBlockModel(BloodMagicBlocks.DUNGEON_POLISHED_GATE.get());
registerToggleableItem(BloodMagicItems.GREEN_GROVE_SIGIL.get());
registerToggleableItem(BloodMagicItems.FAST_MINER_SIGIL.get());
registerToggleableItem(BloodMagicItems.MAGNETISM_SIGIL.get());
@ -64,6 +81,7 @@ public class GeneratorItemModels extends ItemModelProvider
registerDemonTool(BloodMagicItems.SENTIENT_PICKAXE.get());
registerDemonTool(BloodMagicItems.SENTIENT_SHOVEL.get());
registerSacrificialKnife(BloodMagicItems.SACRIFICIAL_DAGGER.get());
}
private void registerCustomBlockPath(Block block, String newPath)

View file

@ -51,6 +51,7 @@ public class GeneratorItemTags extends ItemTagsProvider
this.getOrCreateBuilder(BloodMagicTags.CRYSTAL_DEMON).add(BloodMagicItems.DESTRUCTIVE_CRYSTAL.get());
this.getOrCreateBuilder(BloodMagicTags.CRYSTAL_DEMON).add(BloodMagicItems.VENGEFUL_CRYSTAL.get());
this.getOrCreateBuilder(BloodMagicTags.CRYSTAL_DEMON).add(BloodMagicItems.STEADFAST_CRYSTAL.get());
// this.getOrCreateBuilder(GOORESISTANT).addTag(BlockTags.DOORS);
// this.getOrCreateBuilder(GOORESISTANT).addTag(BlockTags.BEDS);
// this.getOrCreateBuilder(GOORESISTANT).add(Blocks.PISTON, Blocks.PISTON_HEAD, Blocks.STICKY_PISTON, Blocks.MOVING_PISTON);

View file

@ -341,6 +341,31 @@ public class GeneratorLanguage extends LanguageProvider
addBlock(BloodMagicBlocks.OBSIDIAN_PATH, "Obsidian Path");
addBlock(BloodMagicBlocks.OBSIDIAN_TILE_PATH, "Tiled Obsidian Path");
addBlock(BloodMagicBlocks.DUNGEON_BRICK_1, "Demon Bricks");
addBlock(BloodMagicBlocks.DUNGEON_BRICK_2, "Offset Demon Bricks");
addBlock(BloodMagicBlocks.DUNGEON_BRICK_3, "Long Demon Bricks");
addBlock(BloodMagicBlocks.DUNGEON_SMALL_BRICK, "Small Demon Bricks");
addBlock(BloodMagicBlocks.DUNGEON_BRICK_ASSORTED, "Assorted Demon Bricks");
addBlock(BloodMagicBlocks.DUNGEON_STONE, "Demon Stone");
addBlock(BloodMagicBlocks.DUNGEON_POLISHED_STONE, "Polished Demon Stone");
addBlock(BloodMagicBlocks.DUNGEON_TILE, "Demon Stone Tiles");
addBlock(BloodMagicBlocks.DUNGEON_TILE_SPECIAL, "Accented Demon Stone Tiles");
addBlock(BloodMagicBlocks.DUNGEON_BRICK_GATE, "Demon Brick Gate");
addBlock(BloodMagicBlocks.DUNGEON_POLISHED_GATE, "Demon Stone Gate");
addBlock(BloodMagicBlocks.DUNGEON_BRICK_STAIRS, "Demon Brick Stairs");
addBlock(BloodMagicBlocks.DUNGEON_POLISHED_STAIRS, "Demon Stone Stairs");
addBlock(BloodMagicBlocks.DUNGEON_BRICK_WALL, "Demon Brick Wall");
addBlock(BloodMagicBlocks.DUNGEON_POLISHED_WALL, "Demon Stone Wall");
addBlock(BloodMagicBlocks.DUNGEON_PILLAR_CAP, "Demon Stone Pillar Cap");
addBlock(BloodMagicBlocks.DUNGEON_PILLAR_CENTER, "Demon Stone Pillar");
addBlock(BloodMagicBlocks.DUNGEON_PILLAR_SPECIAL, "Accented Demon Stone Pillar");
addBlock(BloodMagicBlocks.DUNGEON_EYE, "Demon Eye");
// Item names
addItem(BloodMagicItems.WEAK_BLOOD_ORB, "Weak Blood Orb");
addItem(BloodMagicItems.APPRENTICE_BLOOD_ORB, "Apprentice Blood Orb");

View file

@ -60,6 +60,11 @@ public class GeneratorLootTable extends LootTableProvider
this.registerDropSelfLootTable(block.get());
}
for (RegistryObject<Block> block : BloodMagicBlocks.DUNGEONBLOCKS.getEntries())
{
this.registerDropSelfLootTable(block.get());
}
registerDropSelfLootTable(BloodMagicBlocks.BLOOD_ALTAR.get());
registerNoDropLootTable(BloodMagicBlocks.ALCHEMY_ARRAY.get());
registerNoDropLootTable(BloodMagicBlocks.BLOOD_LIGHT.get());
@ -83,6 +88,18 @@ public class GeneratorLootTable extends LootTableProvider
registerDropCrystalsLootTable(BloodMagicBlocks.DESTRUCTIVE_CRYSTAL_BLOCK.get(), BloodMagicItems.DESTRUCTIVE_CRYSTAL.get());
registerDropCrystalsLootTable(BloodMagicBlocks.VENGEFUL_CRYSTAL_BLOCK.get(), BloodMagicItems.VENGEFUL_CRYSTAL.get());
registerDropCrystalsLootTable(BloodMagicBlocks.STEADFAST_CRYSTAL_BLOCK.get(), BloodMagicItems.STEADFAST_CRYSTAL.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_BRICK_ASSORTED.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_STONE.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_BRICK_STAIRS.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_POLISHED_STAIRS.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_PILLAR_CENTER.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_PILLAR_SPECIAL.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_PILLAR_CAP.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_BRICK_WALL.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_POLISHED_WALL.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_BRICK_GATE.get());
registerDropSelfLootTable(BloodMagicBlocks.DUNGEON_POLISHED_GATE.get());
}
private void registerNoDropLootTable(Block block)

View file

@ -210,4 +210,25 @@ public class BloodMagicItems
public static final RegistryObject<Item> GOLD_SAND = BASICITEMS.register("goldsand", () -> new ItemBase());
public static final RegistryObject<Item> COAL_SAND = BASICITEMS.register("coalsand", () -> new ItemBase());
// Dungeons
public static final RegistryObject<Item> DUNGEON_BRICK_1_BLOCK = ITEMS.register("dungeon_brick1", () -> new BlockItem(BloodMagicBlocks.DUNGEON_BRICK_1.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_BRICK_2_BLOCK = ITEMS.register("dungeon_brick2", () -> new BlockItem(BloodMagicBlocks.DUNGEON_BRICK_2.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_BRICK_3_BLOCK = ITEMS.register("dungeon_brick3", () -> new BlockItem(BloodMagicBlocks.DUNGEON_BRICK_3.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_BRICK_ASSORTED_BLOCK = ITEMS.register("dungeon_brick_assorted", () -> new BlockItem(BloodMagicBlocks.DUNGEON_BRICK_ASSORTED.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_STONE_BLOCK = ITEMS.register("dungeon_stone", () -> new BlockItem(BloodMagicBlocks.DUNGEON_STONE.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_EYE = ITEMS.register("dungeon_eye", () -> new BlockItem(BloodMagicBlocks.DUNGEON_EYE.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_POLISHED_STONE_BLOCK = ITEMS.register("dungeon_polished", () -> new BlockItem(BloodMagicBlocks.DUNGEON_POLISHED_STONE.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_TILE_BLOCK = ITEMS.register("dungeon_tile", () -> new BlockItem(BloodMagicBlocks.DUNGEON_TILE.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_TILE_SPECIAL_BLOCK = ITEMS.register("dungeon_tilespecial", () -> new BlockItem(BloodMagicBlocks.DUNGEON_TILE_SPECIAL.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_SMALL_BRICK_BLOCK = ITEMS.register("dungeon_smallbrick", () -> new BlockItem(BloodMagicBlocks.DUNGEON_SMALL_BRICK.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_BRICK_STAIRS_BLOCK = ITEMS.register("dungeon_brick_stairs", () -> new BlockItem(BloodMagicBlocks.DUNGEON_BRICK_STAIRS.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_POLISHED_STAIRS_BLOCK = ITEMS.register("dungeon_polished_stairs", () -> new BlockItem(BloodMagicBlocks.DUNGEON_POLISHED_STAIRS.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_PILLAR_CENTER_BLOCK = ITEMS.register("dungeon_pillar_center", () -> new BlockItem(BloodMagicBlocks.DUNGEON_PILLAR_CENTER.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_PILLAR_SPECIAL_BLOCK = ITEMS.register("dungeon_pillar_special", () -> new BlockItem(BloodMagicBlocks.DUNGEON_PILLAR_SPECIAL.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_PILLAR_CAP_BLOCK = ITEMS.register("dungeon_pillar_cap", () -> new BlockItem(BloodMagicBlocks.DUNGEON_PILLAR_CAP.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_BRICK_WALL_BLOCK = ITEMS.register("dungeon_brick_wall", () -> new BlockItem(BloodMagicBlocks.DUNGEON_BRICK_WALL.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_POLISHED_WALL_BLOCK = ITEMS.register("dungeon_polished_wall", () -> new BlockItem(BloodMagicBlocks.DUNGEON_POLISHED_WALL.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_BRICK_GATE_BLOCK = ITEMS.register("dungeon_brick_gate", () -> new BlockItem(BloodMagicBlocks.DUNGEON_BRICK_GATE.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> DUNGEON_POLISHED_GATE_BLOCK = ITEMS.register("dungeon_polished_gate", () -> new BlockItem(BloodMagicBlocks.DUNGEON_POLISHED_GATE.get(), new Item.Properties().group(BloodMagic.TAB)));
}