Class BlockStateProvider
- java.lang.Object
-
- net.minecraftforge.client.model.generators.BlockStateProvider
-
- All Implemented Interfaces:
IDataProvider
- Direct Known Subclasses:
DataGeneratorTest.BlockStates
,NewModelLoaderTest.BlockStates
,PistonEventTest.BlockStates
,ScaffoldingTest.ScaffoldingBlockState
public abstract class BlockStateProvider extends java.lang.Object implements IDataProvider
Data provider for blockstate files. ExtendsBlockModelProvider
so that blockstates and their referenced models can be provided in tandem.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BlockStateProvider.ConfiguredModelList
-
Field Summary
Fields Modifier and Type Field Description private BlockModelProvider
blockModels
private static int
DEFAULT_ANGLE_OFFSET
private DataGenerator
generator
private static com.google.gson.Gson
GSON
private ItemModelProvider
itemModels
private static org.apache.logging.log4j.Logger
LOGGER
private java.lang.String
modid
protected java.util.Map<Block,IGeneratedBlockstate>
registeredBlocks
static com.google.common.collect.ImmutableMap<Direction,Property<WallHeight>>
WALL_PROPS
-
Fields inherited from interface net.minecraft.data.IDataProvider
SHA1
-
-
Constructor Summary
Constructors Constructor Description BlockStateProvider(DataGenerator gen, java.lang.String modid, ExistingFileHelper exFileHelper)
-
Method Summary
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
GSON
private static final com.google.gson.Gson GSON
-
registeredBlocks
protected final java.util.Map<Block,IGeneratedBlockstate> registeredBlocks
-
generator
private final DataGenerator generator
-
modid
private final java.lang.String modid
-
blockModels
private final BlockModelProvider blockModels
-
itemModels
private final ItemModelProvider itemModels
-
DEFAULT_ANGLE_OFFSET
private static final int DEFAULT_ANGLE_OFFSET
- See Also:
- Constant Field Values
-
WALL_PROPS
public static final com.google.common.collect.ImmutableMap<Direction,Property<WallHeight>> WALL_PROPS
-
-
Constructor Detail
-
BlockStateProvider
public BlockStateProvider(DataGenerator gen, java.lang.String modid, ExistingFileHelper exFileHelper)
-
-
Method Detail
-
run
public void run(DirectoryCache cache) throws java.io.IOException
- Specified by:
run
in interfaceIDataProvider
- Throws:
java.io.IOException
-
registerStatesAndModels
protected abstract void registerStatesAndModels()
-
getVariantBuilder
public VariantBlockStateBuilder getVariantBuilder(Block b)
-
getMultipartBuilder
public MultiPartBlockStateBuilder getMultipartBuilder(Block b)
-
models
public BlockModelProvider models()
-
itemModels
public ItemModelProvider itemModels()
-
modLoc
public ResourceLocation modLoc(java.lang.String name)
-
mcLoc
public ResourceLocation mcLoc(java.lang.String name)
-
name
private java.lang.String name(Block block)
-
blockTexture
public ResourceLocation blockTexture(Block block)
-
extend
private ResourceLocation extend(ResourceLocation rl, java.lang.String suffix)
-
simpleBlock
public void simpleBlock(Block block)
-
simpleBlock
public void simpleBlock(Block block, java.util.function.Function<ModelFile,ConfiguredModel[]> expander)
-
simpleBlock
public void simpleBlock(Block block, ConfiguredModel... models)
-
axisBlock
public void axisBlock(RotatedPillarBlock block)
-
logBlock
public void logBlock(RotatedPillarBlock block)
-
axisBlock
public void axisBlock(RotatedPillarBlock block, ResourceLocation baseName)
-
axisBlock
public void axisBlock(RotatedPillarBlock block, ResourceLocation side, ResourceLocation end)
-
axisBlock
public void axisBlock(RotatedPillarBlock block, ModelFile vertical, ModelFile horizontal)
-
horizontalBlock
public void horizontalBlock(Block block, ResourceLocation side, ResourceLocation front, ResourceLocation top)
-
horizontalBlock
public void horizontalBlock(Block block, java.util.function.Function<BlockState,ModelFile> modelFunc)
-
horizontalBlock
public void horizontalBlock(Block block, java.util.function.Function<BlockState,ModelFile> modelFunc, int angleOffset)
-
horizontalFaceBlock
public void horizontalFaceBlock(Block block, java.util.function.Function<BlockState,ModelFile> modelFunc)
-
horizontalFaceBlock
public void horizontalFaceBlock(Block block, java.util.function.Function<BlockState,ModelFile> modelFunc, int angleOffset)
-
directionalBlock
public void directionalBlock(Block block, java.util.function.Function<BlockState,ModelFile> modelFunc)
-
directionalBlock
public void directionalBlock(Block block, java.util.function.Function<BlockState,ModelFile> modelFunc, int angleOffset)
-
stairsBlock
public void stairsBlock(StairsBlock block, ResourceLocation texture)
-
stairsBlock
public void stairsBlock(StairsBlock block, java.lang.String name, ResourceLocation texture)
-
stairsBlock
public void stairsBlock(StairsBlock block, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
-
stairsBlock
public void stairsBlock(StairsBlock block, java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
-
stairsBlockInternal
private void stairsBlockInternal(StairsBlock block, java.lang.String baseName, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
-
stairsBlock
public void stairsBlock(StairsBlock block, ModelFile stairs, ModelFile stairsInner, ModelFile stairsOuter)
-
slabBlock
public void slabBlock(SlabBlock block, ResourceLocation doubleslab, ResourceLocation texture)
-
slabBlock
public void slabBlock(SlabBlock block, ResourceLocation doubleslab, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
-
slabBlock
public void slabBlock(SlabBlock block, ModelFile bottom, ModelFile top, ModelFile doubleslab)
-
fourWayBlock
public void fourWayBlock(FourWayBlock block, ModelFile post, ModelFile side)
-
fourWayMultipart
public void fourWayMultipart(MultiPartBlockStateBuilder builder, ModelFile side)
-
fenceBlock
public void fenceBlock(FenceBlock block, ResourceLocation texture)
-
fenceBlock
public void fenceBlock(FenceBlock block, java.lang.String name, ResourceLocation texture)
-
fenceGateBlock
public void fenceGateBlock(FenceGateBlock block, ResourceLocation texture)
-
fenceGateBlock
public void fenceGateBlock(FenceGateBlock block, java.lang.String name, ResourceLocation texture)
-
fenceGateBlockInternal
private void fenceGateBlockInternal(FenceGateBlock block, java.lang.String baseName, ResourceLocation texture)
-
fenceGateBlock
public void fenceGateBlock(FenceGateBlock block, ModelFile gate, ModelFile gateOpen, ModelFile gateWall, ModelFile gateWallOpen)
-
wallBlock
public void wallBlock(WallBlock block, ResourceLocation texture)
-
wallBlock
public void wallBlock(WallBlock block, java.lang.String name, ResourceLocation texture)
-
wallBlockInternal
private void wallBlockInternal(WallBlock block, java.lang.String baseName, ResourceLocation texture)
-
wallBlock
public void wallBlock(WallBlock block, ModelFile post, ModelFile side, ModelFile sideTall)
-
wallSidePart
private void wallSidePart(MultiPartBlockStateBuilder builder, ModelFile model, java.util.Map.Entry<Direction,Property<WallHeight>> entry, WallHeight height)
-
paneBlock
public void paneBlock(PaneBlock block, ResourceLocation pane, ResourceLocation edge)
-
paneBlock
public void paneBlock(PaneBlock block, java.lang.String name, ResourceLocation pane, ResourceLocation edge)
-
paneBlockInternal
private void paneBlockInternal(PaneBlock block, java.lang.String baseName, ResourceLocation pane, ResourceLocation edge)
-
paneBlock
public void paneBlock(PaneBlock block, ModelFile post, ModelFile side, ModelFile sideAlt, ModelFile noSide, ModelFile noSideAlt)
-
doorBlock
public void doorBlock(DoorBlock block, ResourceLocation bottom, ResourceLocation top)
-
doorBlock
public void doorBlock(DoorBlock block, java.lang.String name, ResourceLocation bottom, ResourceLocation top)
-
doorBlockInternal
private void doorBlockInternal(DoorBlock block, java.lang.String baseName, ResourceLocation bottom, ResourceLocation top)
-
doorBlock
public void doorBlock(DoorBlock block, ModelFile bottomLeft, ModelFile bottomRight, ModelFile topLeft, ModelFile topRight)
-
trapdoorBlock
public void trapdoorBlock(TrapDoorBlock block, ResourceLocation texture, boolean orientable)
-
trapdoorBlock
public void trapdoorBlock(TrapDoorBlock block, java.lang.String name, ResourceLocation texture, boolean orientable)
-
trapdoorBlockInternal
private void trapdoorBlockInternal(TrapDoorBlock block, java.lang.String baseName, ResourceLocation texture, boolean orientable)
-
trapdoorBlock
public void trapdoorBlock(TrapDoorBlock block, ModelFile bottom, ModelFile top, ModelFile open, boolean orientable)
-
saveBlockState
private void saveBlockState(DirectoryCache cache, com.google.gson.JsonObject stateJson, Block owner)
-
getName
@Nonnull public java.lang.String getName()
- Specified by:
getName
in interfaceIDataProvider
-
-