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
Data provider for blockstate files. Extends
BlockModelProvider
so that
blockstates and their referenced models can be provided in tandem.-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final BlockModelProvider
private static final int
private final DataGenerator
private static final com.google.gson.Gson
private final ItemModelProvider
private static final org.apache.logging.log4j.Logger
private final String
protected final Map<Block,
IGeneratedBlockstate> static final com.google.common.collect.ImmutableMap<Direction,
Property<WallHeight>> Fields inherited from interface net.minecraft.data.IDataProvider
SHA1
-
Constructor Summary
ConstructorDescriptionBlockStateProvider
(DataGenerator gen, String modid, ExistingFileHelper exFileHelper) -
Method Summary
Modifier and TypeMethodDescriptionvoid
axisBlock
(RotatedPillarBlock block) void
axisBlock
(RotatedPillarBlock block, ResourceLocation baseName) void
axisBlock
(RotatedPillarBlock block, ResourceLocation side, ResourceLocation end) void
axisBlock
(RotatedPillarBlock block, ModelFile vertical, ModelFile horizontal) blockTexture
(Block block) void
directionalBlock
(Block block, Function<BlockState, ModelFile> modelFunc) void
directionalBlock
(Block block, Function<BlockState, ModelFile> modelFunc, int angleOffset) void
directionalBlock
(Block block, ModelFile model) void
directionalBlock
(Block block, ModelFile model, int angleOffset) void
doorBlock
(DoorBlock block, String name, ResourceLocation bottom, ResourceLocation top) void
doorBlock
(DoorBlock block, ResourceLocation bottom, ResourceLocation top) void
doorBlock
(DoorBlock block, ModelFile bottomLeft, ModelFile bottomRight, ModelFile topLeft, ModelFile topRight) private void
doorBlockInternal
(DoorBlock block, String baseName, ResourceLocation bottom, ResourceLocation top) private ResourceLocation
extend
(ResourceLocation rl, String suffix) void
fenceBlock
(FenceBlock block, String name, ResourceLocation texture) void
fenceBlock
(FenceBlock block, ResourceLocation texture) void
fenceGateBlock
(FenceGateBlock block, String name, ResourceLocation texture) void
fenceGateBlock
(FenceGateBlock block, ResourceLocation texture) void
fenceGateBlock
(FenceGateBlock block, ModelFile gate, ModelFile gateOpen, ModelFile gateWall, ModelFile gateWallOpen) private void
fenceGateBlockInternal
(FenceGateBlock block, String baseName, ResourceLocation texture) void
fourWayBlock
(FourWayBlock block, ModelFile post, ModelFile side) void
fourWayMultipart
(MultiPartBlockStateBuilder builder, ModelFile side) getName()
void
horizontalBlock
(Block block, Function<BlockState, ModelFile> modelFunc) void
horizontalBlock
(Block block, Function<BlockState, ModelFile> modelFunc, int angleOffset) void
horizontalBlock
(Block block, ResourceLocation side, ResourceLocation front, ResourceLocation top) void
horizontalBlock
(Block block, ModelFile model) void
horizontalBlock
(Block block, ModelFile model, int angleOffset) void
horizontalFaceBlock
(Block block, Function<BlockState, ModelFile> modelFunc) void
horizontalFaceBlock
(Block block, Function<BlockState, ModelFile> modelFunc, int angleOffset) void
horizontalFaceBlock
(Block block, ModelFile model) void
horizontalFaceBlock
(Block block, ModelFile model, int angleOffset) void
logBlock
(RotatedPillarBlock block) models()
private String
void
paneBlock
(PaneBlock block, String name, ResourceLocation pane, ResourceLocation edge) void
paneBlock
(PaneBlock block, ResourceLocation pane, ResourceLocation edge) void
paneBlock
(PaneBlock block, ModelFile post, ModelFile side, ModelFile sideAlt, ModelFile noSide, ModelFile noSideAlt) private void
paneBlockInternal
(PaneBlock block, String baseName, ResourceLocation pane, ResourceLocation edge) protected abstract void
void
run
(DirectoryCache cache) private void
saveBlockState
(DirectoryCache cache, com.google.gson.JsonObject stateJson, Block owner) void
simpleBlock
(Block block) void
simpleBlock
(Block block, Function<ModelFile, ConfiguredModel[]> expander) void
simpleBlock
(Block block, ConfiguredModel... models) void
simpleBlock
(Block block, ModelFile model) void
simpleBlockItem
(Block block, ModelFile model) void
slabBlock
(SlabBlock block, ResourceLocation doubleslab, ResourceLocation texture) void
slabBlock
(SlabBlock block, ResourceLocation doubleslab, ResourceLocation side, ResourceLocation bottom, ResourceLocation top) void
void
stairsBlock
(StairsBlock block, String name, ResourceLocation texture) void
stairsBlock
(StairsBlock block, String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top) void
stairsBlock
(StairsBlock block, ResourceLocation texture) void
stairsBlock
(StairsBlock block, ResourceLocation side, ResourceLocation bottom, ResourceLocation top) void
stairsBlock
(StairsBlock block, ModelFile stairs, ModelFile stairsInner, ModelFile stairsOuter) private void
stairsBlockInternal
(StairsBlock block, String baseName, ResourceLocation side, ResourceLocation bottom, ResourceLocation top) void
trapdoorBlock
(TrapDoorBlock block, String name, ResourceLocation texture, boolean orientable) void
trapdoorBlock
(TrapDoorBlock block, ResourceLocation texture, boolean orientable) void
trapdoorBlock
(TrapDoorBlock block, ModelFile bottom, ModelFile top, ModelFile open, boolean orientable) private void
trapdoorBlockInternal
(TrapDoorBlock block, String baseName, ResourceLocation texture, boolean orientable) void
wallBlock
(WallBlock block, String name, ResourceLocation texture) void
wallBlock
(WallBlock block, ResourceLocation texture) void
private void
wallBlockInternal
(WallBlock block, String baseName, ResourceLocation texture) private void
wallSidePart
(MultiPartBlockStateBuilder builder, ModelFile model, Map.Entry<Direction, Property<WallHeight>> entry, WallHeight height)
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
GSON
private static final com.google.gson.Gson GSON -
registeredBlocks
-
generator
-
modid
-
blockModels
-
itemModels
-
DEFAULT_ANGLE_OFFSET
private static final int DEFAULT_ANGLE_OFFSET- See Also:
-
WALL_PROPS
public static final com.google.common.collect.ImmutableMap<Direction,Property<WallHeight>> WALL_PROPS
-
-
Constructor Details
-
BlockStateProvider
-
-
Method Details
-
run
- Specified by:
run
in interfaceIDataProvider
- Throws:
IOException
-
registerStatesAndModels
protected abstract void registerStatesAndModels() -
getVariantBuilder
-
getMultipartBuilder
-
models
-
itemModels
-
modLoc
-
mcLoc
-
name
-
blockTexture
-
extend
-
cubeAll
-
simpleBlock
-
simpleBlock
-
simpleBlock
-
simpleBlockItem
-
simpleBlock
-
axisBlock
-
logBlock
-
axisBlock
-
axisBlock
-
axisBlock
-
horizontalBlock
public void horizontalBlock(Block block, ResourceLocation side, ResourceLocation front, ResourceLocation top) -
horizontalBlock
-
horizontalBlock
-
horizontalBlock
-
horizontalBlock
-
horizontalFaceBlock
-
horizontalFaceBlock
-
horizontalFaceBlock
-
horizontalFaceBlock
public void horizontalFaceBlock(Block block, Function<BlockState, ModelFile> modelFunc, int angleOffset) -
directionalBlock
-
directionalBlock
-
directionalBlock
-
directionalBlock
public void directionalBlock(Block block, Function<BlockState, ModelFile> modelFunc, int angleOffset) -
stairsBlock
-
stairsBlock
-
stairsBlock
public void stairsBlock(StairsBlock block, ResourceLocation side, ResourceLocation bottom, ResourceLocation top) -
stairsBlock
public void stairsBlock(StairsBlock block, String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top) -
stairsBlockInternal
private void stairsBlockInternal(StairsBlock block, String baseName, ResourceLocation side, ResourceLocation bottom, ResourceLocation top) -
stairsBlock
public void stairsBlock(StairsBlock block, ModelFile stairs, ModelFile stairsInner, ModelFile stairsOuter) -
slabBlock
-
slabBlock
public void slabBlock(SlabBlock block, ResourceLocation doubleslab, ResourceLocation side, ResourceLocation bottom, ResourceLocation top) -
slabBlock
-
fourWayBlock
-
fourWayMultipart
-
fenceBlock
-
fenceBlock
-
fenceGateBlock
-
fenceGateBlock
-
fenceGateBlockInternal
private void fenceGateBlockInternal(FenceGateBlock block, String baseName, ResourceLocation texture) -
fenceGateBlock
public void fenceGateBlock(FenceGateBlock block, ModelFile gate, ModelFile gateOpen, ModelFile gateWall, ModelFile gateWallOpen) -
wallBlock
-
wallBlock
-
wallBlockInternal
-
wallBlock
-
wallSidePart
private void wallSidePart(MultiPartBlockStateBuilder builder, ModelFile model, Map.Entry<Direction, Property<WallHeight>> entry, WallHeight height) -
paneBlock
-
paneBlock
-
paneBlockInternal
private void paneBlockInternal(PaneBlock block, String baseName, ResourceLocation pane, ResourceLocation edge) -
paneBlock
-
doorBlock
-
doorBlock
-
doorBlockInternal
private void doorBlockInternal(DoorBlock block, String baseName, ResourceLocation bottom, ResourceLocation top) -
doorBlock
-
trapdoorBlock
-
trapdoorBlock
public void trapdoorBlock(TrapDoorBlock block, String name, ResourceLocation texture, boolean orientable) -
trapdoorBlockInternal
private void trapdoorBlockInternal(TrapDoorBlock block, 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
- Specified by:
getName
in interfaceIDataProvider
-