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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.client.resources.model.BakedModel
    bake(ModelBakingContext context, net.minecraft.client.renderer.block.model.BlockModel data)
    Converts the model data into a baked model.
    net.minecraft.client.renderer.block.model.BlockModel
    deserialize(com.google.gson.JsonObject json)
    Deserializes the given json to some data.
    @Nullable net.minecraft.client.renderer.block.model.BlockModel
    getAsVanillaModel(net.minecraft.client.renderer.block.model.BlockModel data)
    Represents the model as a vanilla BlockModel instance.
    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.JsonObject
    serialize(net.minecraft.client.renderer.block.model.BlockModel value)
    Serializes the given data to json.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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: ModelType
      Gets all the dependencies on other model files.
      Specified by:
      getModelDependencies in interface ModelType<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: ModelType
      Gets all the dependencies on sprites.
      Specified by:
      getTextureDependencies in interface ModelType<net.minecraft.client.renderer.block.model.BlockModel>
      Parameters:
      context - context for gathering texture dependencies
      data - 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: ModelType
      Converts the model data into a baked model.
      Specified by:
      bake in interface ModelType<net.minecraft.client.renderer.block.model.BlockModel>
      Parameters:
      context - context for baking the model
      data - custom model data
      Returns:
      a baked model
      See Also:
    • getAsVanillaModel

      @Nullable public @Nullable net.minecraft.client.renderer.block.model.BlockModel getAsVanillaModel(net.minecraft.client.renderer.block.model.BlockModel data)
      Description copied from interface: ModelType
      Represents the model as a vanilla BlockModel instance. May be used gather info from other models, such as with the vanilla 'parent' property. If the model cannot be represented as a BlockModel instance, this method should return null.
      Specified by:
      getAsVanillaModel in interface ModelType<net.minecraft.client.renderer.block.model.BlockModel>
      Parameters:
      data - custom model data
      Returns:
      a representation of the model as a vanilla BlockModel instance, or null if 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: Serializer
      Deserializes the given json to some data.
      Specified by:
      deserialize in interface Serializer<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: Serializer
      Serializes the given data to json.
      Specified by:
      serialize in interface Serializer<net.minecraft.client.renderer.block.model.BlockModel>