Class NeoForgeModelProperties

java.lang.Object
net.neoforged.neoforge.client.model.NeoForgeModelProperties

public final class NeoForgeModelProperties extends Object
Properties that NeoForge adds for BlockModels and UnbakedModels.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.util.context.ContextKey<Map<String,Boolean>>
    Part visibilities.
    static final net.minecraft.util.context.ContextKey<RenderTypeGroup>
    Render type to use.
    static final net.minecraft.util.context.ContextKey<com.mojang.math.Transformation>
    Root transform.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    deserializePartVisibility(com.google.gson.JsonObject jsonObject)
    Returns a map of part visibilities if the visibility key is present, otherwise an empty map.
    deserializeRenderType(com.google.gson.JsonObject jsonObject)
    Returns a RenderTypeGroup if the render_type key is present, otherwise RenderTypeGroup.EMPTY.
    static @Nullable com.mojang.math.Transformation
    deserializeRootTransform(com.google.gson.JsonObject jsonObject, com.google.gson.JsonDeserializationContext context)
    Returns a Transformation if the transform key is present, otherwise null.
    static void
    fillPartVisibilityProperty(net.minecraft.util.context.ContextMap.Builder propertiesBuilder, Map<String,Boolean> partVisibility)
    Puts the given part visibility into the given builder if present, merging the with values from parent models on a per-key basis and overwriting existing keys
    static void
    fillRenderTypeProperty(net.minecraft.util.context.ContextMap.Builder propertiesBuilder, RenderTypeGroup renderTypeGroup)
    Puts the given RenderTypeGroup into the given builder if present, overwriting any value specified in a parent model
    static void
    fillRootTransformProperty(net.minecraft.util.context.ContextMap.Builder propertiesBuilder, @Nullable com.mojang.math.Transformation rootTransform)
    Puts the given root transform into the given builder if present, overwriting any value specified in a parent model

    Methods inherited from class java.lang.Object

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

    • TRANSFORM

      public static final net.minecraft.util.context.ContextKey<com.mojang.math.Transformation> TRANSFORM
      Root transform. For block models, this can be specified under the transform JSON key.
    • RENDER_TYPE

      public static final net.minecraft.util.context.ContextKey<RenderTypeGroup> RENDER_TYPE
      Render type to use. For block models, this can be specified under the render_type JSON key.
    • PART_VISIBILITY

      public static final net.minecraft.util.context.ContextKey<Map<String,Boolean>> PART_VISIBILITY
      Part visibilities. For models with named parts (i.e. OBJ and composite), this can be specified under the visibility JSON key
  • Constructor Details

    • NeoForgeModelProperties

      private NeoForgeModelProperties()
  • Method Details

    • deserializeRootTransform

      @Nullable public static @Nullable com.mojang.math.Transformation deserializeRootTransform(com.google.gson.JsonObject jsonObject, com.google.gson.JsonDeserializationContext context)
      Returns a Transformation if the transform key is present, otherwise null.
      Returns:
      a Transformation if the transform key is present, otherwise null
    • deserializeRenderType

      public static RenderTypeGroup deserializeRenderType(com.google.gson.JsonObject jsonObject)
      Returns a RenderTypeGroup if the render_type key is present, otherwise RenderTypeGroup.EMPTY.
      Returns:
      a RenderTypeGroup if the render_type key is present, otherwise RenderTypeGroup.EMPTY
    • deserializePartVisibility

      public static Map<String,Boolean> deserializePartVisibility(com.google.gson.JsonObject jsonObject)
      Returns a map of part visibilities if the visibility key is present, otherwise an empty map.
      Returns:
      a map of part visibilities if the visibility key is present, otherwise an empty map
    • fillRootTransformProperty

      public static void fillRootTransformProperty(net.minecraft.util.context.ContextMap.Builder propertiesBuilder, @Nullable @Nullable com.mojang.math.Transformation rootTransform)
      Puts the given root transform into the given builder if present, overwriting any value specified in a parent model
    • fillRenderTypeProperty

      public static void fillRenderTypeProperty(net.minecraft.util.context.ContextMap.Builder propertiesBuilder, RenderTypeGroup renderTypeGroup)
      Puts the given RenderTypeGroup into the given builder if present, overwriting any value specified in a parent model
    • fillPartVisibilityProperty

      public static void fillPartVisibilityProperty(net.minecraft.util.context.ContextMap.Builder propertiesBuilder, Map<String,Boolean> partVisibility)
      Puts the given part visibility into the given builder if present, merging the with values from parent models on a per-key basis and overwriting existing keys