Class NeoForgeModelProperties
java.lang.Object
net.neoforged.neoforge.client.model.NeoForgeModelProperties
Properties that NeoForge adds for
CuboidModels and UnbakedModels.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextKey<it.unimi.dsi.fastutil.ints.Int2ObjectMap<ExtraFaceData>> Item layer model face data.static final ContextKey<Map<String, Boolean>> Part visibilities.static final ContextKey<Transformation> Root transform. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic it.unimi.dsi.fastutil.ints.Int2ObjectMap<ExtraFaceData> deserializeItemLayerFaceData(JsonObject jsonObject) Returns a map of item layer face data entries if theneoforge_datakey is present on at least one entry of thetexturesobject, otherwise an empty map.deserializePartVisibility(JsonObject jsonObject) Returns a map of part visibilities if thevisibilitykey is present, otherwise an empty map.static @Nullable TransformationdeserializeRootTransform(JsonObject jsonObject, JsonDeserializationContext context) static voidfillItemLayerFaceData(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 layersstatic 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 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 modelstatic ExtraFaceDatagetItemLayerFaceData(ContextMap additionalProperties, int layer) Retrieves theExtraFaceDatafor the given layer index from the given properties map
-
Field Details
-
TRANSFORM
Root transform. For block models, this can be specified under thetransformJSON key. -
PART_VISIBILITY
Part visibilities. For models with named parts (i.e. OBJ and composite), this can be specified under thevisibilityJSON key -
ITEM_LAYER_FACE_DATA
public static final ContextKey<it.unimi.dsi.fastutil.ints.Int2ObjectMap<ExtraFaceData>> ITEM_LAYER_FACE_DATAItem layer model face data. For item layer models, the values can be specified in the entries of thetexturesobject via theneoforge_dataJSON key
-
-
Constructor Details
-
NeoForgeModelProperties
private NeoForgeModelProperties()
-
-
Method Details
-
deserializeRootTransform
public static @Nullable Transformation deserializeRootTransform(JsonObject jsonObject, JsonDeserializationContext context) - Returns:
- a
Transformationif thetransformkey is present, otherwisenull
-
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
-
deserializeItemLayerFaceData
public static it.unimi.dsi.fastutil.ints.Int2ObjectMap<ExtraFaceData> deserializeItemLayerFaceData(JsonObject jsonObject) Returns a map of item layer face data entries if theneoforge_datakey is present on at least one entry of thetexturesobject, otherwise an empty map.- Returns:
- a map of item layer face data entries if the
neoforge_datakey is present on at least one entry of thetexturesobject, 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
Retrieves theExtraFaceDatafor the given layer index from the given properties map
-