Class NeoForgeModelProperties
java.lang.Object
net.neoforged.neoforge.client.model.NeoForgeModelProperties
Properties that NeoForge adds for
BlockModel
s and UnbakedModel
s.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextKey
<Map<String, Boolean>> Part visibilities.static final ContextKey
<RenderTypeGroup> Render type to use.static final ContextKey
<Transformation> Root transform. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserializePartVisibility
(com.google.gson.JsonObject jsonObject) Returns a map of part visibilities if thevisibility
key is present, otherwise an empty map.static RenderTypeGroup
deserializeRenderType
(com.google.gson.JsonObject jsonObject) static @Nullable Transformation
deserializeRootTransform
(com.google.gson.JsonObject jsonObject, com.google.gson.JsonDeserializationContext context) 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 keysstatic void
fillRenderTypeProperty
(ContextMap.Builder propertiesBuilder, RenderTypeGroup renderTypeGroup) Puts the givenRenderTypeGroup
into the given builder if present, overwriting any value specified in a parent modelstatic 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
-
Field Details
-
TRANSFORM
Root transform. For block models, this can be specified under thetransform
JSON key. -
RENDER_TYPE
Render type to use. For block models, this can be specified under therender_type
JSON key. -
PART_VISIBILITY
Part visibilities. For models with named parts (i.e. OBJ and composite), this can be specified under thevisibility
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 thetransform
key is present, otherwisenull
-
deserializeRenderType
- Returns:
- a
RenderTypeGroup
if therender_type
key is present, otherwiseRenderTypeGroup.EMPTY
-
deserializePartVisibility
Returns a map of part visibilities if thevisibility
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 givenRenderTypeGroup
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
-