Class VanillaModelType
java.lang.Object
com.supermartijn642.fusion.model.types.vanilla.VanillaModelType
- All Implemented Interfaces:
ModelType<net.minecraft.client.renderer.block.model.BlockModel>,Serializer<net.minecraft.client.renderer.block.model.BlockModel>
public class VanillaModelType
extends Object
implements ModelType<net.minecraft.client.renderer.block.model.BlockModel>
Created 29/04/2023 by SuperMartijn642
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.client.resources.model.BakedModelbake(ModelBakingContext context, net.minecraft.client.renderer.block.model.BlockModel data) Converts the model data into a baked model.net.minecraft.client.renderer.block.model.BlockModeldeserialize(com.google.gson.JsonObject json) Deserializes the given json to some data.@Nullable net.minecraft.client.renderer.block.model.BlockModelgetAsVanillaModel(net.minecraft.client.renderer.block.model.BlockModel data) Represents the model as a vanillaBlockModelinstance.Collection<net.minecraft.resources.ResourceLocation>getModelDependencies(net.minecraft.client.renderer.block.model.BlockModel data) Gets all the dependencies on other model files.getTextureDependencies(GatherTexturesContext context, net.minecraft.client.renderer.block.model.BlockModel data) Gets all the dependencies on sprites.com.google.gson.JsonObjectserialize(net.minecraft.client.renderer.block.model.BlockModel value) Serializes the given data to json.
-
Constructor Details
-
VanillaModelType
public VanillaModelType()
-
-
Method Details
-
getModelDependencies
public Collection<net.minecraft.resources.ResourceLocation> getModelDependencies(net.minecraft.client.renderer.block.model.BlockModel data) Description copied from interface:ModelTypeGets all the dependencies on other model files.- Specified by:
getModelDependenciesin interfaceModelType<net.minecraft.client.renderer.block.model.BlockModel>- Parameters:
data- custom model data
-
getTextureDependencies
public Collection<SpriteIdentifier> getTextureDependencies(GatherTexturesContext context, net.minecraft.client.renderer.block.model.BlockModel data) Description copied from interface:ModelTypeGets all the dependencies on sprites.- Specified by:
getTextureDependenciesin interfaceModelType<net.minecraft.client.renderer.block.model.BlockModel>- Parameters:
context- context for gathering texture dependenciesdata- custom model data- See Also:
-
bake
public net.minecraft.client.resources.model.BakedModel bake(ModelBakingContext context, net.minecraft.client.renderer.block.model.BlockModel data) Description copied from interface:ModelTypeConverts the model data into a baked model. -
getAsVanillaModel
@Nullable public @Nullable net.minecraft.client.renderer.block.model.BlockModel getAsVanillaModel(net.minecraft.client.renderer.block.model.BlockModel data) Description copied from interface:ModelTypeRepresents the model as a vanillaBlockModelinstance. May be used gather info from other models, such as with the vanilla 'parent' property. If the model cannot be represented as aBlockModelinstance, this method should returnnull.- Specified by:
getAsVanillaModelin interfaceModelType<net.minecraft.client.renderer.block.model.BlockModel>- Parameters:
data- custom model data- Returns:
- a representation of the model as a vanilla
BlockModelinstance, ornullif such a representation is not available
-
deserialize
public net.minecraft.client.renderer.block.model.BlockModel deserialize(com.google.gson.JsonObject json) throws com.google.gson.JsonParseException Description copied from interface:SerializerDeserializes the given json to some data.- Specified by:
deserializein interfaceSerializer<net.minecraft.client.renderer.block.model.BlockModel>- Throws:
com.google.gson.JsonParseException- if the given json does not match the expected format
-
serialize
public com.google.gson.JsonObject serialize(net.minecraft.client.renderer.block.model.BlockModel value) Description copied from interface:SerializerSerializes the given data to json.- Specified by:
serializein interfaceSerializer<net.minecraft.client.renderer.block.model.BlockModel>
-