Class ModelProvider<T extends ModelBuilder<T>>
- java.lang.Object
-
- net.minecraftforge.client.model.generators.ModelProvider<T>
-
- All Implemented Interfaces:
IDataProvider
- Direct Known Subclasses:
BlockModelProvider
,ItemModelProvider
public abstract class ModelProvider<T extends ModelBuilder<T>> extends java.lang.Object implements IDataProvider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BLOCK_FOLDER
ExistingFileHelper
existingFileHelper
protected java.util.function.Function<ResourceLocation,T>
factory
protected java.lang.String
folder
java.util.Map<ResourceLocation,T>
generatedModels
protected DataGenerator
generator
private static com.google.gson.Gson
GSON
static java.lang.String
ITEM_FOLDER
protected static ExistingFileHelper.ResourceType
MODEL
protected static ExistingFileHelper.ResourceType
MODEL_WITH_EXTENSION
protected java.lang.String
modid
protected static ExistingFileHelper.ResourceType
TEXTURE
-
Fields inherited from interface net.minecraft.data.IDataProvider
SHA1
-
-
Constructor Summary
Constructors Constructor Description ModelProvider(DataGenerator generator, java.lang.String modid, java.lang.String folder, java.util.function.BiFunction<ResourceLocation,ExistingFileHelper,T> builderFromModId, ExistingFileHelper existingFileHelper)
ModelProvider(DataGenerator generator, java.lang.String modid, java.lang.String folder, java.util.function.Function<ResourceLocation,T> factory, ExistingFileHelper existingFileHelper)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
carpet(java.lang.String name, ResourceLocation wool)
protected void
clear()
T
crop(java.lang.String name, ResourceLocation crop)
T
cross(java.lang.String name, ResourceLocation cross)
T
cube(java.lang.String name, ResourceLocation down, ResourceLocation up, ResourceLocation north, ResourceLocation south, ResourceLocation east, ResourceLocation west)
T
cubeAll(java.lang.String name, ResourceLocation texture)
T
cubeBottomTop(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
T
cubeColumn(java.lang.String name, ResourceLocation side, ResourceLocation end)
T
cubeColumnHorizontal(java.lang.String name, ResourceLocation side, ResourceLocation end)
T
cubeTop(java.lang.String name, ResourceLocation side, ResourceLocation top)
private T
door(java.lang.String name, java.lang.String model, ResourceLocation bottom, ResourceLocation top)
T
doorBottomLeft(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
T
doorBottomRight(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
T
doorTopLeft(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
T
doorTopRight(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
private ResourceLocation
extendWithFolder(ResourceLocation rl)
T
fenceGate(java.lang.String name, ResourceLocation texture)
T
fenceGateOpen(java.lang.String name, ResourceLocation texture)
T
fenceGateWall(java.lang.String name, ResourceLocation texture)
T
fenceGateWallOpen(java.lang.String name, ResourceLocation texture)
T
fenceInventory(java.lang.String name, ResourceLocation texture)
T
fencePost(java.lang.String name, ResourceLocation texture)
T
fenceSide(java.lang.String name, ResourceLocation texture)
protected void
generateAll(DirectoryCache cache)
T
getBuilder(java.lang.String path)
ModelFile.ExistingModelFile
getExistingFile(ResourceLocation path)
private java.nio.file.Path
getPath(T model)
ResourceLocation
mcLoc(java.lang.String name)
ResourceLocation
modLoc(java.lang.String name)
T
nested()
Gets a model builder that's not directly saved to disk.T
orientable(java.lang.String name, ResourceLocation side, ResourceLocation front, ResourceLocation top)
T
orientableVertical(java.lang.String name, ResourceLocation side, ResourceLocation front)
T
orientableWithBottom(java.lang.String name, ResourceLocation side, ResourceLocation front, ResourceLocation bottom, ResourceLocation top)
private T
pane(java.lang.String name, java.lang.String parent, ResourceLocation pane, ResourceLocation edge)
T
paneNoSide(java.lang.String name, ResourceLocation pane)
T
paneNoSideAlt(java.lang.String name, ResourceLocation pane)
T
panePost(java.lang.String name, ResourceLocation pane, ResourceLocation edge)
T
paneSide(java.lang.String name, ResourceLocation pane, ResourceLocation edge)
T
paneSideAlt(java.lang.String name, ResourceLocation pane, ResourceLocation edge)
protected abstract void
registerModels()
void
run(DirectoryCache cache)
private T
sideBottomTop(java.lang.String name, java.lang.String parent, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
private T
singleTexture(java.lang.String name, java.lang.String parent, java.lang.String textureKey, ResourceLocation texture)
private T
singleTexture(java.lang.String name, java.lang.String parent, ResourceLocation texture)
T
singleTexture(java.lang.String name, ResourceLocation parent, java.lang.String textureKey, ResourceLocation texture)
T
singleTexture(java.lang.String name, ResourceLocation parent, ResourceLocation texture)
T
slab(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
T
slabTop(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
T
stairs(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
T
stairsInner(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
T
stairsOuter(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
T
torch(java.lang.String name, ResourceLocation torch)
T
torchWall(java.lang.String name, ResourceLocation torch)
T
trapdoorBottom(java.lang.String name, ResourceLocation texture)
T
trapdoorOpen(java.lang.String name, ResourceLocation texture)
T
trapdoorOrientableBottom(java.lang.String name, ResourceLocation texture)
T
trapdoorOrientableOpen(java.lang.String name, ResourceLocation texture)
T
trapdoorOrientableTop(java.lang.String name, ResourceLocation texture)
T
trapdoorTop(java.lang.String name, ResourceLocation texture)
T
wallInventory(java.lang.String name, ResourceLocation wall)
T
wallPost(java.lang.String name, ResourceLocation wall)
T
wallSide(java.lang.String name, ResourceLocation wall)
T
wallSideTall(java.lang.String name, ResourceLocation wall)
T
withExistingParent(java.lang.String name, java.lang.String parent)
T
withExistingParent(java.lang.String name, ResourceLocation parent)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.minecraft.data.IDataProvider
getName
-
-
-
-
Field Detail
-
BLOCK_FOLDER
public static final java.lang.String BLOCK_FOLDER
- See Also:
- Constant Field Values
-
ITEM_FOLDER
public static final java.lang.String ITEM_FOLDER
- See Also:
- Constant Field Values
-
TEXTURE
protected static final ExistingFileHelper.ResourceType TEXTURE
-
MODEL
protected static final ExistingFileHelper.ResourceType MODEL
-
MODEL_WITH_EXTENSION
protected static final ExistingFileHelper.ResourceType MODEL_WITH_EXTENSION
-
GSON
private static final com.google.gson.Gson GSON
-
generator
protected final DataGenerator generator
-
modid
protected final java.lang.String modid
-
folder
protected final java.lang.String folder
-
factory
protected final java.util.function.Function<ResourceLocation,T extends ModelBuilder<T>> factory
-
generatedModels
public final java.util.Map<ResourceLocation,T extends ModelBuilder<T>> generatedModels
-
existingFileHelper
public final ExistingFileHelper existingFileHelper
-
-
Constructor Detail
-
ModelProvider
public ModelProvider(DataGenerator generator, java.lang.String modid, java.lang.String folder, java.util.function.Function<ResourceLocation,T> factory, ExistingFileHelper existingFileHelper)
-
ModelProvider
public ModelProvider(DataGenerator generator, java.lang.String modid, java.lang.String folder, java.util.function.BiFunction<ResourceLocation,ExistingFileHelper,T> builderFromModId, ExistingFileHelper existingFileHelper)
-
-
Method Detail
-
registerModels
protected abstract void registerModels()
-
getBuilder
public T getBuilder(java.lang.String path)
-
extendWithFolder
private ResourceLocation extendWithFolder(ResourceLocation rl)
-
modLoc
public ResourceLocation modLoc(java.lang.String name)
-
mcLoc
public ResourceLocation mcLoc(java.lang.String name)
-
withExistingParent
public T withExistingParent(java.lang.String name, java.lang.String parent)
-
withExistingParent
public T withExistingParent(java.lang.String name, ResourceLocation parent)
-
cube
public T cube(java.lang.String name, ResourceLocation down, ResourceLocation up, ResourceLocation north, ResourceLocation south, ResourceLocation east, ResourceLocation west)
-
singleTexture
private T singleTexture(java.lang.String name, java.lang.String parent, ResourceLocation texture)
-
singleTexture
public T singleTexture(java.lang.String name, ResourceLocation parent, ResourceLocation texture)
-
singleTexture
private T singleTexture(java.lang.String name, java.lang.String parent, java.lang.String textureKey, ResourceLocation texture)
-
singleTexture
public T singleTexture(java.lang.String name, ResourceLocation parent, java.lang.String textureKey, ResourceLocation texture)
-
cubeAll
public T cubeAll(java.lang.String name, ResourceLocation texture)
-
cubeTop
public T cubeTop(java.lang.String name, ResourceLocation side, ResourceLocation top)
-
sideBottomTop
private T sideBottomTop(java.lang.String name, java.lang.String parent, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
-
cubeBottomTop
public T cubeBottomTop(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
-
cubeColumn
public T cubeColumn(java.lang.String name, ResourceLocation side, ResourceLocation end)
-
cubeColumnHorizontal
public T cubeColumnHorizontal(java.lang.String name, ResourceLocation side, ResourceLocation end)
-
orientableVertical
public T orientableVertical(java.lang.String name, ResourceLocation side, ResourceLocation front)
-
orientableWithBottom
public T orientableWithBottom(java.lang.String name, ResourceLocation side, ResourceLocation front, ResourceLocation bottom, ResourceLocation top)
-
orientable
public T orientable(java.lang.String name, ResourceLocation side, ResourceLocation front, ResourceLocation top)
-
crop
public T crop(java.lang.String name, ResourceLocation crop)
-
cross
public T cross(java.lang.String name, ResourceLocation cross)
-
stairs
public T stairs(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
-
stairsOuter
public T stairsOuter(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
-
stairsInner
public T stairsInner(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
-
slab
public T slab(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
-
slabTop
public T slabTop(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
-
fencePost
public T fencePost(java.lang.String name, ResourceLocation texture)
-
fenceSide
public T fenceSide(java.lang.String name, ResourceLocation texture)
-
fenceInventory
public T fenceInventory(java.lang.String name, ResourceLocation texture)
-
fenceGate
public T fenceGate(java.lang.String name, ResourceLocation texture)
-
fenceGateOpen
public T fenceGateOpen(java.lang.String name, ResourceLocation texture)
-
fenceGateWall
public T fenceGateWall(java.lang.String name, ResourceLocation texture)
-
fenceGateWallOpen
public T fenceGateWallOpen(java.lang.String name, ResourceLocation texture)
-
wallPost
public T wallPost(java.lang.String name, ResourceLocation wall)
-
wallSide
public T wallSide(java.lang.String name, ResourceLocation wall)
-
wallSideTall
public T wallSideTall(java.lang.String name, ResourceLocation wall)
-
wallInventory
public T wallInventory(java.lang.String name, ResourceLocation wall)
-
pane
private T pane(java.lang.String name, java.lang.String parent, ResourceLocation pane, ResourceLocation edge)
-
panePost
public T panePost(java.lang.String name, ResourceLocation pane, ResourceLocation edge)
-
paneSide
public T paneSide(java.lang.String name, ResourceLocation pane, ResourceLocation edge)
-
paneSideAlt
public T paneSideAlt(java.lang.String name, ResourceLocation pane, ResourceLocation edge)
-
paneNoSide
public T paneNoSide(java.lang.String name, ResourceLocation pane)
-
paneNoSideAlt
public T paneNoSideAlt(java.lang.String name, ResourceLocation pane)
-
door
private T door(java.lang.String name, java.lang.String model, ResourceLocation bottom, ResourceLocation top)
-
doorBottomLeft
public T doorBottomLeft(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
-
doorBottomRight
public T doorBottomRight(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
-
doorTopLeft
public T doorTopLeft(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
-
doorTopRight
public T doorTopRight(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
-
trapdoorBottom
public T trapdoorBottom(java.lang.String name, ResourceLocation texture)
-
trapdoorTop
public T trapdoorTop(java.lang.String name, ResourceLocation texture)
-
trapdoorOpen
public T trapdoorOpen(java.lang.String name, ResourceLocation texture)
-
trapdoorOrientableBottom
public T trapdoorOrientableBottom(java.lang.String name, ResourceLocation texture)
-
trapdoorOrientableTop
public T trapdoorOrientableTop(java.lang.String name, ResourceLocation texture)
-
trapdoorOrientableOpen
public T trapdoorOrientableOpen(java.lang.String name, ResourceLocation texture)
-
torch
public T torch(java.lang.String name, ResourceLocation torch)
-
torchWall
public T torchWall(java.lang.String name, ResourceLocation torch)
-
carpet
public T carpet(java.lang.String name, ResourceLocation wool)
-
nested
public T nested()
Gets a model builder that's not directly saved to disk. Meant for use in custom model loaders.
-
getExistingFile
public ModelFile.ExistingModelFile getExistingFile(ResourceLocation path)
-
clear
protected void clear()
-
run
public void run(DirectoryCache cache) throws java.io.IOException
- Specified by:
run
in interfaceIDataProvider
- Throws:
java.io.IOException
-
generateAll
protected void generateAll(DirectoryCache cache)
-
getPath
private java.nio.file.Path getPath(T model)
-
-