Class BlockModelConfiguration

java.lang.Object
io.github.vampirestudios.vampirelib.client.model.BlockModelConfiguration
All Implemented Interfaces:
IModelConfiguration

public class BlockModelConfiguration extends Object implements IModelConfiguration
  • Field Details

  • Constructor Details

    • BlockModelConfiguration

      public BlockModelConfiguration(net.minecraft.client.renderer.block.model.BlockModel owner)
  • Method Details

    • getOwnerModel

      @Nullable public @Nullable net.minecraft.client.resources.model.UnbakedModel getOwnerModel()
      Description copied from interface: IModelConfiguration
      If available, gets the owning model (usually BlockModel) of this configuration
      Specified by:
      getOwnerModel in interface IModelConfiguration
    • getModelName

      public String getModelName()
      Specified by:
      getModelName in interface IModelConfiguration
      Returns:
      The name of the model being baked, for logging and cache purposes.
    • hasCustomGeometry

      public boolean hasCustomGeometry()
    • getCustomGeometry

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

      public void setCustomGeometry(IModelGeometry<?> geometry)
    • getCustomModelState

      @Nullable public @Nullable net.minecraft.client.resources.model.ModelState getCustomModelState()
    • setCustomModelState

      public void setCustomModelState(net.minecraft.client.resources.model.ModelState modelState)
    • getPartVisibility

      public boolean getPartVisibility(IModelGeometryPart part, boolean fallback)
      Description copied from interface: IModelConfiguration
      Queries the visibility information for the model parts.
      Specified by:
      getPartVisibility in interface IModelConfiguration
      Parameters:
      part - A part for which to query visibility.
      fallback - A boolean specifying the default visibility if an override isn't found in the model data.
      Returns:
      The final computed visibility.
    • isTexturePresent

      public boolean isTexturePresent(String name)
      Description copied from interface: IModelConfiguration
      Checks if a texture is present in the model.
      Specified by:
      isTexturePresent in interface IModelConfiguration
      Parameters:
      name - The name of a texture channel.
    • resolveTexture

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

      public boolean isShadedInGui()
      Specified by:
      isShadedInGui in interface IModelConfiguration
      Returns:
      True if the item is a 3D model, false if it's a generated item model. TODO: Rename. This value has nothing to do with shading anymore, and this name is misleading. It's actual purpose seems to be relegated to translating the model during rendering, so that it's centered.
    • isSideLit

      public boolean isSideLit()
      Specified by:
      isSideLit in interface IModelConfiguration
      Returns:
      True if the item is lit from the side
    • useSmoothLighting

      public boolean useSmoothLighting()
      Specified by:
      useSmoothLighting in interface IModelConfiguration
      Returns:
      True if the item requires per-vertex lighting.
    • getCameraTransforms

      public net.minecraft.client.renderer.block.model.ItemTransforms getCameraTransforms()
      Description copied from interface: IModelConfiguration
      Gets the vanilla camera transforms data. Do not use for non-vanilla code. For general usage, prefer getCombinedState.
      Specified by:
      getCameraTransforms in interface IModelConfiguration
    • getCombinedTransform

      public net.minecraft.client.resources.model.ModelState getCombinedTransform()
      Specified by:
      getCombinedTransform in interface IModelConfiguration
      Returns:
      The combined transformation state including vanilla and forge transforms data.
    • copyFrom

      public void copyFrom(BlockModelConfiguration 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)