T
- Self type, for simpler chaining of methods.public class ModelBuilder<T extends ModelBuilder<T>> extends ModelFile
ModelProvider
,
BlockModelBuilder
,
ItemModelBuilder
Modifier and Type | Class and Description |
---|---|
class |
ModelBuilder.ElementBuilder |
static class |
ModelBuilder.FaceRotation |
static class |
ModelBuilder.Perspective |
class |
ModelBuilder.TransformsBuilder |
ModelFile.ExistingModelFile, ModelFile.UncheckedModelFile
Modifier and Type | Field and Description |
---|---|
protected boolean |
ambientOcclusion |
protected java.util.List<ModelBuilder.ElementBuilder> |
elements |
protected ExistingFileHelper |
existingFileHelper |
protected BlockModel.GuiLight |
guiLight |
protected ModelFile |
parent |
protected java.util.Map<java.lang.String,java.lang.String> |
textures |
protected ModelBuilder.TransformsBuilder |
transforms |
Modifier | Constructor and Description |
---|---|
protected |
ModelBuilder(ResourceLocation outputLocation,
ExistingFileHelper existingFileHelper) |
Modifier and Type | Method and Description |
---|---|
T |
ao(boolean ao) |
ModelBuilder.ElementBuilder |
element() |
ModelBuilder.ElementBuilder |
element(int index)
Get an existing element builder
|
protected boolean |
exists() |
T |
gui3d(boolean gui3d)
Deprecated.
Unused in 1.15, use
#guiLight(GuiLight) instead. |
T |
guiLight(BlockModel.GuiLight light) |
T |
parent(ModelFile parent)
Set the parent model for the current model.
|
private T |
self() |
private java.lang.Number |
serializeFloat(float f) |
(package private) java.lang.String |
serializeLoc(ResourceLocation loc) |
private java.lang.String |
serializeLocOrKey(java.lang.String tex) |
private com.google.gson.JsonArray |
serializeVector3f(Vector3f vec) |
T |
texture(java.lang.String key,
ResourceLocation texture)
Set the texture for a given dictionary key.
|
T |
texture(java.lang.String key,
java.lang.String texture)
Set the texture for a given dictionary key.
|
com.google.gson.JsonObject |
toJson() |
ModelBuilder.TransformsBuilder |
transforms() |
assertExistence, getLocation, getUncheckedLocation
@Nullable protected ModelFile parent
protected final java.util.Map<java.lang.String,java.lang.String> textures
protected final ModelBuilder.TransformsBuilder transforms
protected final ExistingFileHelper existingFileHelper
protected boolean ambientOcclusion
protected BlockModel.GuiLight guiLight
protected final java.util.List<ModelBuilder.ElementBuilder> elements
protected ModelBuilder(ResourceLocation outputLocation, ExistingFileHelper existingFileHelper)
private T self()
public T parent(ModelFile parent)
parent
- the parent modeljava.lang.NullPointerException
- if parent
is null
java.lang.IllegalStateException
- if parent
does not exist
public T texture(java.lang.String key, java.lang.String texture)
key
- the texture keytexture
- the texture, can be another key e.g. "#all"
java.lang.NullPointerException
- if key
is null
java.lang.NullPointerException
- if texture
is null
java.lang.IllegalStateException
- if texture
is not a key (does not start
with '#'
) and does not exist in any
known resource packpublic T texture(java.lang.String key, ResourceLocation texture)
key
- the texture keytexture
- the texturejava.lang.NullPointerException
- if key
is null
java.lang.NullPointerException
- if texture
is null
java.lang.IllegalStateException
- if texture
is not a key (does not start
with '#'
) and does not exist in any
known resource packpublic ModelBuilder.TransformsBuilder transforms()
public T ao(boolean ao)
@Deprecated public T gui3d(boolean gui3d)
#guiLight(GuiLight)
instead.gui3d
- public T guiLight(BlockModel.GuiLight light)
public ModelBuilder.ElementBuilder element()
public ModelBuilder.ElementBuilder element(int index)
index
- the index of the existing element builderjava.lang.IndexOutOfBoundsException
- if index is out of boundspublic com.google.gson.JsonObject toJson()
private java.lang.String serializeLocOrKey(java.lang.String tex)
java.lang.String serializeLoc(ResourceLocation loc)
private com.google.gson.JsonArray serializeVector3f(Vector3f vec)
private java.lang.Number serializeFloat(float f)