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.StringBLOCK_FOLDERExistingFileHelperexistingFileHelperprotected java.util.function.Function<ResourceLocation,T>factoryprotected java.lang.Stringfolderjava.util.Map<ResourceLocation,T>generatedModelsprotected DataGeneratorgeneratorprivate static com.google.gson.GsonGSONstatic java.lang.StringITEM_FOLDERprotected static ExistingFileHelper.ResourceTypeMODELprotected static ExistingFileHelper.ResourceTypeMODEL_WITH_EXTENSIONprotected java.lang.Stringmodidprotected static ExistingFileHelper.ResourceTypeTEXTURE-
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 Tcarpet(java.lang.String name, ResourceLocation wool)protected voidclear()Tcrop(java.lang.String name, ResourceLocation crop)Tcross(java.lang.String name, ResourceLocation cross)Tcube(java.lang.String name, ResourceLocation down, ResourceLocation up, ResourceLocation north, ResourceLocation south, ResourceLocation east, ResourceLocation west)TcubeAll(java.lang.String name, ResourceLocation texture)TcubeBottomTop(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)TcubeColumn(java.lang.String name, ResourceLocation side, ResourceLocation end)TcubeColumnHorizontal(java.lang.String name, ResourceLocation side, ResourceLocation end)TcubeTop(java.lang.String name, ResourceLocation side, ResourceLocation top)private Tdoor(java.lang.String name, java.lang.String model, ResourceLocation bottom, ResourceLocation top)TdoorBottomLeft(java.lang.String name, ResourceLocation bottom, ResourceLocation top)TdoorBottomRight(java.lang.String name, ResourceLocation bottom, ResourceLocation top)TdoorTopLeft(java.lang.String name, ResourceLocation bottom, ResourceLocation top)TdoorTopRight(java.lang.String name, ResourceLocation bottom, ResourceLocation top)private ResourceLocationextendWithFolder(ResourceLocation rl)TfenceGate(java.lang.String name, ResourceLocation texture)TfenceGateOpen(java.lang.String name, ResourceLocation texture)TfenceGateWall(java.lang.String name, ResourceLocation texture)TfenceGateWallOpen(java.lang.String name, ResourceLocation texture)TfenceInventory(java.lang.String name, ResourceLocation texture)TfencePost(java.lang.String name, ResourceLocation texture)TfenceSide(java.lang.String name, ResourceLocation texture)protected voidgenerateAll(DirectoryCache cache)TgetBuilder(java.lang.String path)ModelFile.ExistingModelFilegetExistingFile(ResourceLocation path)private java.nio.file.PathgetPath(T model)ResourceLocationmcLoc(java.lang.String name)ResourceLocationmodLoc(java.lang.String name)Tnested()Gets a model builder that's not directly saved to disk.Torientable(java.lang.String name, ResourceLocation side, ResourceLocation front, ResourceLocation top)TorientableVertical(java.lang.String name, ResourceLocation side, ResourceLocation front)TorientableWithBottom(java.lang.String name, ResourceLocation side, ResourceLocation front, ResourceLocation bottom, ResourceLocation top)private Tpane(java.lang.String name, java.lang.String parent, ResourceLocation pane, ResourceLocation edge)TpaneNoSide(java.lang.String name, ResourceLocation pane)TpaneNoSideAlt(java.lang.String name, ResourceLocation pane)TpanePost(java.lang.String name, ResourceLocation pane, ResourceLocation edge)TpaneSide(java.lang.String name, ResourceLocation pane, ResourceLocation edge)TpaneSideAlt(java.lang.String name, ResourceLocation pane, ResourceLocation edge)protected abstract voidregisterModels()voidrun(DirectoryCache cache)private TsideBottomTop(java.lang.String name, java.lang.String parent, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)private TsingleTexture(java.lang.String name, java.lang.String parent, java.lang.String textureKey, ResourceLocation texture)private TsingleTexture(java.lang.String name, java.lang.String parent, ResourceLocation texture)TsingleTexture(java.lang.String name, ResourceLocation parent, java.lang.String textureKey, ResourceLocation texture)TsingleTexture(java.lang.String name, ResourceLocation parent, ResourceLocation texture)Tslab(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)TslabTop(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)Tstairs(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)TstairsInner(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)TstairsOuter(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)Ttorch(java.lang.String name, ResourceLocation torch)TtorchWall(java.lang.String name, ResourceLocation torch)TtrapdoorBottom(java.lang.String name, ResourceLocation texture)TtrapdoorOpen(java.lang.String name, ResourceLocation texture)TtrapdoorOrientableBottom(java.lang.String name, ResourceLocation texture)TtrapdoorOrientableOpen(java.lang.String name, ResourceLocation texture)TtrapdoorOrientableTop(java.lang.String name, ResourceLocation texture)TtrapdoorTop(java.lang.String name, ResourceLocation texture)TwallInventory(java.lang.String name, ResourceLocation wall)TwallPost(java.lang.String name, ResourceLocation wall)TwallSide(java.lang.String name, ResourceLocation wall)TwallSideTall(java.lang.String name, ResourceLocation wall)TwithExistingParent(java.lang.String name, java.lang.String parent)TwithExistingParent(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:
runin interfaceIDataProvider- Throws:
java.io.IOException
-
generateAll
protected void generateAll(DirectoryCache cache)
-
getPath
private java.nio.file.Path getPath(T model)
-
-