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 TypeFieldDescriptionPart 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 -
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 com.mojang.math.Transformation
deserializeRootTransform
(com.google.gson.JsonObject jsonObject, com.google.gson.JsonDeserializationContext context) Returns aTransformation
if thetransform
key is present, otherwisenull
.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 keysstatic void
fillRenderTypeProperty
(net.minecraft.util.context.ContextMap.Builder propertiesBuilder, RenderTypeGroup renderTypeGroup) Puts the givenRenderTypeGroup
into the given builder if present, overwriting any value specified in a parent modelstatic 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
-
Field Details
-
TRANSFORM
public static final net.minecraft.util.context.ContextKey<com.mojang.math.Transformation> TRANSFORMRoot 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 com.mojang.math.Transformation deserializeRootTransform(com.google.gson.JsonObject jsonObject, com.google.gson.JsonDeserializationContext context) Returns aTransformation
if thetransform
key is present, otherwisenull
.- 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(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 givenRenderTypeGroup
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
-