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 Details

    • TRANSFORM

      public static final ContextKey<Transformation> TRANSFORM
      Root transform. For block models, this can be specified under the transform JSON key.
    • RENDER_TYPE

      public static final 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 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 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(ContextMap.Builder propertiesBuilder, @Nullable @Nullable 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(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(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