Class NeoForgeModelProperties
java.lang.Object
net.neoforged.neoforge.client.model.NeoForgeModelProperties
Properties that NeoForge adds for
BlockModels and UnbakedModels.-
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(JsonObject jsonObject) Returns a map of part visibilities if thevisibilitykey is present, otherwise an empty map.static RenderTypeGroupdeserializeRenderType(JsonObject jsonObject) static @Nullable TransformationdeserializeRootTransform(JsonObject jsonObject, JsonDeserializationContext context) static voidfillPartVisibilityProperty(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 voidfillRenderTypeProperty(ContextMap.Builder propertiesBuilder, RenderTypeGroup renderTypeGroup) Puts the givenRenderTypeGroupinto the given builder if present, overwriting any value specified in a parent modelstatic voidfillRootTransformProperty(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 thetransformJSON key. -
RENDER_TYPE
Render type to use. For block models, this can be specified under therender_typeJSON key. -
PART_VISIBILITY
Part visibilities. For models with named parts (i.e. OBJ and composite), this can be specified under thevisibilityJSON key
-
-
Constructor Details
-
NeoForgeModelProperties
private NeoForgeModelProperties()
-
-
Method Details
-
deserializeRootTransform
@Nullable public static @Nullable Transformation deserializeRootTransform(JsonObject jsonObject, JsonDeserializationContext context) - Returns:
- a
Transformationif thetransformkey is present, otherwisenull
-
deserializeRenderType
- Returns:
- a
RenderTypeGroupif therender_typekey is present, otherwiseRenderTypeGroup.EMPTY
-
deserializePartVisibility
Returns a map of part visibilities if thevisibilitykey is present, otherwise an empty map.- Returns:
- a map of part visibilities if the
visibilitykey 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 givenRenderTypeGroupinto 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
-