Class BlockGeometryBakingContext

java.lang.Object
io.github.vampirestudios.vampirelib.client.model.geometry.BlockGeometryBakingContext
All Implemented Interfaces:
IGeometryBakingContext

public class BlockGeometryBakingContext extends Object implements IGeometryBakingContext
A geometry baking context that is bound to a BlockModel.

Users should not be instantiating this themselves.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final net.minecraft.client.renderer.block.model.BlockModel
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockGeometryBakingContext(net.minecraft.client.renderer.block.model.BlockModel owner)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.client.resources.model.BakedModel
    bake(net.minecraft.client.resources.model.ModelBakery bakery, Function<net.minecraft.client.resources.model.Material,net.minecraft.client.renderer.texture.TextureAtlasSprite> bakedTextureGetter, net.minecraft.client.resources.model.ModelState modelTransform, net.minecraft.client.renderer.block.model.ItemOverrides overrides, net.minecraft.resources.ResourceLocation modelLocation)
     
    void
     
    @Nullable IUnbakedGeometry<?>
     
    net.minecraft.client.resources.model.Material
    Resolves the final texture name, taking into account texture aliases and replacements.
    Returns the name of the model being baked for logging and caching purposes..
    @Nullable net.minecraft.resources.ResourceLocation
    Returns a hint of the render type this model should use. Custom loaders may ignore this..
    com.mojang.math.Transformation
    Returns the root transformation to be applied to all variants of this model, regardless of item transforms..
    Collection<net.minecraft.client.resources.model.Material>
    getTextureDependencies(Function<net.minecraft.resources.ResourceLocation,net.minecraft.client.resources.model.UnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String,String>> missingTextureErrors)
     
    net.minecraft.client.renderer.block.model.ItemTransforms
    Returns the transforms for display in item form..
    boolean
     
    boolean
    Checks if a material is present in the model.
    boolean
    isComponentVisible(String part, boolean fallback)
    Queries the visibility of a component of this model.
    boolean
    Returns true if this model should render in 3D in a GUI, false otherwise.
    void
     
    void
    setRenderTypeHint(net.minecraft.resources.ResourceLocation renderTypeHint)
     
    void
    setRootTransform(com.mojang.math.Transformation rootTransform)
     
    boolean
    Returns true if per-vertex ambient occlusion should be used for this model, false otherwise.
    boolean
    Returns true if block lighting should be used for this model, false otherwise.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • BlockGeometryBakingContext

      @Internal public BlockGeometryBakingContext(net.minecraft.client.renderer.block.model.BlockModel owner)
  • Method Details

    • getModelName

      public String getModelName()
      Description copied from interface: IGeometryBakingContext
      Returns the name of the model being baked for logging and caching purposes..
      Specified by:
      getModelName in interface IGeometryBakingContext
      Returns:
      the name of the model being baked for logging and caching purposes.
    • hasCustomGeometry

      public boolean hasCustomGeometry()
    • getCustomGeometry

      @Nullable public @Nullable IUnbakedGeometry<?> getCustomGeometry()
    • setCustomGeometry

      public void setCustomGeometry(IUnbakedGeometry<?> geometry)
    • isComponentVisible

      public boolean isComponentVisible(String part, boolean fallback)
      Description copied from interface: IGeometryBakingContext
      Queries the visibility of a component of this model.
      Specified by:
      isComponentVisible in interface IGeometryBakingContext
      Parameters:
      part - The component for which to query visibility
      fallback - The default visibility if an override isn't found
      Returns:
      The visibility of the component
    • hasMaterial

      public boolean hasMaterial(String name)
      Description copied from interface: IGeometryBakingContext
      Checks if a material is present in the model.
      Specified by:
      hasMaterial in interface IGeometryBakingContext
      Parameters:
      name - The name of the material
      Returns:
      true if the material is present, false otherwise
    • getMaterial

      public net.minecraft.client.resources.model.Material getMaterial(String name)
      Description copied from interface: IGeometryBakingContext
      Resolves the final texture name, taking into account texture aliases and replacements.
      Specified by:
      getMaterial in interface IGeometryBakingContext
      Parameters:
      name - The name of the material
      Returns:
      The material, or the missing texture if not found
    • isGui3d

      public boolean isGui3d()
      Description copied from interface: IGeometryBakingContext
      Returns true if this model should render in 3D in a GUI, false otherwise.
      Specified by:
      isGui3d in interface IGeometryBakingContext
      Returns:
      true if this model should render in 3D in a GUI, false otherwise
    • useBlockLight

      public boolean useBlockLight()
      Description copied from interface: IGeometryBakingContext
      Returns true if block lighting should be used for this model, false otherwise.
      Specified by:
      useBlockLight in interface IGeometryBakingContext
      Returns:
      true if block lighting should be used for this model, false otherwise
    • useAmbientOcclusion

      public boolean useAmbientOcclusion()
      Description copied from interface: IGeometryBakingContext
      Returns true if per-vertex ambient occlusion should be used for this model, false otherwise.
      Specified by:
      useAmbientOcclusion in interface IGeometryBakingContext
      Returns:
      true if per-vertex ambient occlusion should be used for this model, false otherwise
    • getTransforms

      public net.minecraft.client.renderer.block.model.ItemTransforms getTransforms()
      Description copied from interface: IGeometryBakingContext
      Returns the transforms for display in item form..
      Specified by:
      getTransforms in interface IGeometryBakingContext
      Returns:
      the transforms for display in item form.
    • getRootTransform

      public com.mojang.math.Transformation getRootTransform()
      Description copied from interface: IGeometryBakingContext
      Returns the root transformation to be applied to all variants of this model, regardless of item transforms..
      Specified by:
      getRootTransform in interface IGeometryBakingContext
      Returns:
      the root transformation to be applied to all variants of this model, regardless of item transforms.
    • setRootTransform

      public void setRootTransform(com.mojang.math.Transformation rootTransform)
    • getRenderTypeHint

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation getRenderTypeHint()
      Description copied from interface: IGeometryBakingContext
      Returns a hint of the render type this model should use. Custom loaders may ignore this..
      Specified by:
      getRenderTypeHint in interface IGeometryBakingContext
      Returns:
      a hint of the render type this model should use. Custom loaders may ignore this.
    • setRenderTypeHint

      public void setRenderTypeHint(net.minecraft.resources.ResourceLocation renderTypeHint)
    • copyFrom

      public void copyFrom(BlockGeometryBakingContext other)
    • getTextureDependencies

      public Collection<net.minecraft.client.resources.model.Material> getTextureDependencies(Function<net.minecraft.resources.ResourceLocation,net.minecraft.client.resources.model.UnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String,String>> missingTextureErrors)
    • bake

      public net.minecraft.client.resources.model.BakedModel bake(net.minecraft.client.resources.model.ModelBakery bakery, Function<net.minecraft.client.resources.model.Material,net.minecraft.client.renderer.texture.TextureAtlasSprite> bakedTextureGetter, net.minecraft.client.resources.model.ModelState modelTransform, net.minecraft.client.renderer.block.model.ItemOverrides overrides, net.minecraft.resources.ResourceLocation modelLocation)