Class NeoForgeModelProperties

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

public final class NeoForgeModelProperties extends Object
Properties that NeoForge adds for CuboidModels 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.
    • 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
    • ITEM_LAYER_FACE_DATA

      public static final ContextKey<it.unimi.dsi.fastutil.ints.Int2ObjectMap<ExtraFaceData>> ITEM_LAYER_FACE_DATA
      Item layer model face data. For item layer models, the values can be specified in the entries of the textures object via the neoforge_data JSON key
  • Constructor Details

    • NeoForgeModelProperties

      private NeoForgeModelProperties()
  • Method Details

    • deserializeRootTransform

      public static @Nullable Transformation deserializeRootTransform(JsonObject jsonObject, JsonDeserializationContext context)
      Returns a Transformation if the transform key is present, otherwise null.
      Returns:
      a Transformation if the transform key is present, otherwise null
    • deserializePartVisibility

      public static Map<String,Boolean> deserializePartVisibility(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
    • deserializeItemLayerFaceData

      public static it.unimi.dsi.fastutil.ints.Int2ObjectMap<ExtraFaceData> deserializeItemLayerFaceData(JsonObject jsonObject)
      Returns a map of item layer face data entries if the neoforge_data key is present on at least one entry of the textures object, otherwise an empty map.
      Returns:
      a map of item layer face data entries if the neoforge_data key is present on at least one entry of the textures object, otherwise an empty map
    • fillRootTransformProperty

      public static void fillRootTransformProperty(ContextMap.Builder propertiesBuilder, @Nullable Transformation rootTransform)
      Puts the given root transform 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
    • fillItemLayerFaceData

      public static void fillItemLayerFaceData(ContextMap.Builder propertiesBuilder, it.unimi.dsi.fastutil.ints.Int2ObjectMap<ExtraFaceData> layerFaceData)
      Puts the given item layer face data into the given builder if present, merging with values from parent models on a per-layer basis and overwriting existing layers
    • getItemLayerFaceData

      public static ExtraFaceData getItemLayerFaceData(ContextMap additionalProperties, int layer)
      Retrieves the ExtraFaceData for the given layer index from the given properties map