@Environment(value=CLIENT) public class JsonUnbakedModel extends Object implements UnbakedModel
Modifier and Type | Class and Description |
---|---|
static class |
JsonUnbakedModel.Deserializer |
static class |
JsonUnbakedModel.GuiLight |
Modifier and Type | Field and Description |
---|---|
private boolean |
ambientOcclusion |
private List<ModelElement> |
elements |
(package private) static Gson |
GSON |
private JsonUnbakedModel.GuiLight |
guiLight |
String |
id |
private static Logger |
LOGGER |
private List<ModelOverride> |
overrides |
protected JsonUnbakedModel |
parent |
protected Identifier |
parentId |
private static BakedQuadFactory |
QUAD_FACTORY |
protected Map<String,com.mojang.datafixers.util.Either<SpriteIdentifier,String>> |
textureMap |
private ModelTransformation |
transformations |
Constructor and Description |
---|
JsonUnbakedModel(Identifier parentId,
List<ModelElement> elements,
Map<String,com.mojang.datafixers.util.Either<SpriteIdentifier,String>> textureMap,
boolean ambientOcclusion,
JsonUnbakedModel.GuiLight guiLight,
ModelTransformation transformations,
List<ModelOverride> overrides) |
private static final Logger LOGGER
private static final BakedQuadFactory QUAD_FACTORY
static final Gson GSON
private final List<ModelElement> elements
@Nullable private final JsonUnbakedModel.GuiLight guiLight
private final boolean ambientOcclusion
private final ModelTransformation transformations
private final List<ModelOverride> overrides
public String id
protected final Map<String,com.mojang.datafixers.util.Either<SpriteIdentifier,String>> textureMap
@Nullable protected JsonUnbakedModel parent
@Nullable protected Identifier parentId
public JsonUnbakedModel(@Nullable Identifier parentId, List<ModelElement> elements, Map<String,com.mojang.datafixers.util.Either<SpriteIdentifier,String>> textureMap, boolean ambientOcclusion, @Nullable JsonUnbakedModel.GuiLight guiLight, ModelTransformation transformations, List<ModelOverride> overrides)
public static JsonUnbakedModel deserialize(Reader input)
public static JsonUnbakedModel deserialize(String json)
public List<ModelElement> getElements()
public boolean useAmbientOcclusion()
public JsonUnbakedModel.GuiLight getGuiLight()
public List<ModelOverride> getOverrides()
private ModelOverrideList compileOverrides(ModelLoader modelLoader, JsonUnbakedModel parent)
public Collection<Identifier> getModelDependencies()
getModelDependencies
in interface UnbakedModel
public Collection<SpriteIdentifier> getTextureDependencies(Function<Identifier,UnbakedModel> unbakedModelGetter, Set<com.mojang.datafixers.util.Pair<String,String>> unresolvedTextureReferences)
getTextureDependencies
in interface UnbakedModel
public BakedModel bake(ModelLoader loader, Function<SpriteIdentifier,Sprite> textureGetter, ModelBakeSettings rotationContainer, Identifier modelId)
bake
in interface UnbakedModel
public BakedModel bake(ModelLoader loader, JsonUnbakedModel parent, Function<SpriteIdentifier,Sprite> textureGetter, ModelBakeSettings settings, Identifier id, boolean hasDepth)
private static BakedQuad createQuad(ModelElement element, ModelElementFace elementFace, Sprite sprite, Direction side, ModelBakeSettings settings, Identifier id)
public boolean textureExists(String name)
public SpriteIdentifier resolveSprite(String spriteName)
private com.mojang.datafixers.util.Either<SpriteIdentifier,String> resolveTexture(String name)
private static boolean isTextureReference(String reference)
public JsonUnbakedModel getRootModel()
public ModelTransformation getTransformations()
private Transformation getTransformation(ModelTransformation.Mode renderMode)