public abstract class ModelProvider<T extends ModelBuilder<T>> extends java.lang.Object implements IDataProvider
Modifier and Type | Class and Description |
---|---|
private class |
ModelProvider.ExistingFileHelperIncludingGenerated |
Modifier and Type | Field and 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 java.lang.String |
modid |
HASH_FUNCTION
Constructor and 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) |
Modifier and Type | Method and Description |
---|---|
void |
act(DirectoryCache cache) |
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 |
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 |
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() |
private T |
sideBottomTop(java.lang.String name,
java.lang.String parent,
ResourceLocation side,
ResourceLocation bottom,
ResourceLocation top) |
T |
singleTexture(java.lang.String name,
ResourceLocation parent,
ResourceLocation texture) |
T |
singleTexture(java.lang.String name,
ResourceLocation parent,
java.lang.String textureKey,
ResourceLocation texture) |
private T |
singleTexture(java.lang.String name,
java.lang.String parent,
ResourceLocation texture) |
private T |
singleTexture(java.lang.String name,
java.lang.String parent,
java.lang.String textureKey,
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 |
withExistingParent(java.lang.String name,
ResourceLocation parent) |
T |
withExistingParent(java.lang.String name,
java.lang.String parent) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, save
public static final java.lang.String BLOCK_FOLDER
public static final java.lang.String ITEM_FOLDER
private static final com.google.gson.Gson GSON
protected final DataGenerator generator
protected final java.lang.String modid
protected final java.lang.String folder
protected final java.util.function.Function<ResourceLocation,T extends ModelBuilder<T>> factory
public final java.util.Map<ResourceLocation,T extends ModelBuilder<T>> generatedModels
public final ExistingFileHelper existingFileHelper
public ModelProvider(DataGenerator generator, java.lang.String modid, java.lang.String folder, java.util.function.Function<ResourceLocation,T> factory, ExistingFileHelper existingFileHelper)
public ModelProvider(DataGenerator generator, java.lang.String modid, java.lang.String folder, java.util.function.BiFunction<ResourceLocation,ExistingFileHelper,T> builderFromModId, ExistingFileHelper existingFileHelper)
protected abstract void registerModels()
public T getBuilder(java.lang.String path)
private ResourceLocation extendWithFolder(ResourceLocation rl)
public ResourceLocation modLoc(java.lang.String name)
public ResourceLocation mcLoc(java.lang.String name)
public T withExistingParent(java.lang.String name, java.lang.String parent)
public T withExistingParent(java.lang.String name, ResourceLocation parent)
public T cube(java.lang.String name, ResourceLocation down, ResourceLocation up, ResourceLocation north, ResourceLocation south, ResourceLocation east, ResourceLocation west)
private T singleTexture(java.lang.String name, java.lang.String parent, ResourceLocation texture)
public T singleTexture(java.lang.String name, ResourceLocation parent, ResourceLocation texture)
private T singleTexture(java.lang.String name, java.lang.String parent, java.lang.String textureKey, ResourceLocation texture)
public T singleTexture(java.lang.String name, ResourceLocation parent, java.lang.String textureKey, ResourceLocation texture)
public T cubeAll(java.lang.String name, ResourceLocation texture)
public T cubeTop(java.lang.String name, ResourceLocation side, ResourceLocation top)
private T sideBottomTop(java.lang.String name, java.lang.String parent, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
public T cubeBottomTop(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
public T cubeColumn(java.lang.String name, ResourceLocation side, ResourceLocation end)
public T orientableVertical(java.lang.String name, ResourceLocation side, ResourceLocation front)
public T orientableWithBottom(java.lang.String name, ResourceLocation side, ResourceLocation front, ResourceLocation bottom, ResourceLocation top)
public T orientable(java.lang.String name, ResourceLocation side, ResourceLocation front, ResourceLocation top)
public T crop(java.lang.String name, ResourceLocation crop)
public T cross(java.lang.String name, ResourceLocation cross)
public T stairs(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
public T stairsOuter(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
public T stairsInner(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
public T slab(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
public T slabTop(java.lang.String name, ResourceLocation side, ResourceLocation bottom, ResourceLocation top)
public T fencePost(java.lang.String name, ResourceLocation texture)
public T fenceSide(java.lang.String name, ResourceLocation texture)
public T fenceInventory(java.lang.String name, ResourceLocation texture)
public T fenceGate(java.lang.String name, ResourceLocation texture)
public T fenceGateOpen(java.lang.String name, ResourceLocation texture)
public T fenceGateWall(java.lang.String name, ResourceLocation texture)
public T fenceGateWallOpen(java.lang.String name, ResourceLocation texture)
public T wallPost(java.lang.String name, ResourceLocation wall)
public T wallSide(java.lang.String name, ResourceLocation wall)
public T wallInventory(java.lang.String name, ResourceLocation wall)
private T pane(java.lang.String name, java.lang.String parent, ResourceLocation pane, ResourceLocation edge)
public T panePost(java.lang.String name, ResourceLocation pane, ResourceLocation edge)
public T paneSide(java.lang.String name, ResourceLocation pane, ResourceLocation edge)
public T paneSideAlt(java.lang.String name, ResourceLocation pane, ResourceLocation edge)
public T paneNoSide(java.lang.String name, ResourceLocation pane)
public T paneNoSideAlt(java.lang.String name, ResourceLocation pane)
private T door(java.lang.String name, java.lang.String model, ResourceLocation bottom, ResourceLocation top)
public T doorBottomLeft(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
public T doorBottomRight(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
public T doorTopLeft(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
public T doorTopRight(java.lang.String name, ResourceLocation bottom, ResourceLocation top)
public T trapdoorBottom(java.lang.String name, ResourceLocation texture)
public T trapdoorTop(java.lang.String name, ResourceLocation texture)
public T trapdoorOpen(java.lang.String name, ResourceLocation texture)
public T trapdoorOrientableBottom(java.lang.String name, ResourceLocation texture)
public T trapdoorOrientableTop(java.lang.String name, ResourceLocation texture)
public T trapdoorOrientableOpen(java.lang.String name, ResourceLocation texture)
public T torch(java.lang.String name, ResourceLocation torch)
public T torchWall(java.lang.String name, ResourceLocation torch)
public T carpet(java.lang.String name, ResourceLocation wool)
public ModelFile.ExistingModelFile getExistingFile(ResourceLocation path)
protected void clear()
public void act(DirectoryCache cache) throws java.io.IOException
act
in interface IDataProvider
java.io.IOException
protected void generateAll(DirectoryCache cache)
private java.nio.file.Path getPath(T model)