Class ConfiguredModel
java.lang.Object
net.minecraftforge.client.model.generators.ConfiguredModel
Represents a model with blockstate configurations, e.g. rotation, uvlock, and
 random weight.
 
 Can be manually constructed, created by static factory such as
 allYRotations(ModelFile, int, boolean), or created by builder via
 builder().
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classA builder forConfiguredModels, which can contain a callback for processing the finished result.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConfiguredModel(ModelFile model) Construct a newConfiguredModelwith the default rotation (0, 0), uvlock (false), anddefault random weight.ConfiguredModel(ModelFile model, int rotationX, int rotationY, boolean uvLock) Construct a newConfiguredModelwith thedefault random weight.ConfiguredModel(ModelFile model, int rotationX, int rotationY, boolean uvLock, int weight) Construct a newConfiguredModel.
- 
Method SummaryModifier and TypeMethodDescriptionstatic ConfiguredModel[]allRotations(ModelFile model, boolean uvlock) static ConfiguredModel[]allRotations(ModelFile model, boolean uvlock, int weight) static ConfiguredModel[]allYRotations(ModelFile model, int x, boolean uvlock) static ConfiguredModel[]allYRotations(ModelFile model, int x, boolean uvlock, int weight) static ConfiguredModel.Builder<?> builder()Create a new unownedConfiguredModel.Builder.(package private) static ConfiguredModel.Builder<MultiPartBlockStateBuilder.PartBuilder> (package private) static ConfiguredModel.Builder<VariantBlockStateBuilder> (package private) static voidcheckRotation(int rotationX, int rotationY) (package private) static voidcheckWeight(int weight) (package private) com.google.gson.JsonObjecttoJSON(boolean includeWeight) private static IntStream
- 
Field Details- 
DEFAULT_WEIGHTpublic static final int DEFAULT_WEIGHTThe default random weight of configured models, used by convenience overloads.- See Also:
 
- 
model
- 
rotationXpublic final int rotationX
- 
rotationYpublic final int rotationY
- 
uvLockpublic final boolean uvLock
- 
weightpublic final int weight
 
- 
- 
Constructor Details- 
ConfiguredModelConstruct a newConfiguredModel.- Parameters:
- model- the underlying model
- rotationX- x-rotation to apply to the model
- rotationY- y-rotation to apply to the model
- uvLock- if uvlock should be enabled
- weight- the random weight of the model
- Throws:
- NullPointerException- if- modelis- null
- IllegalArgumentException- if x and/or y rotation are not valid (see- BlockModelRotation)
- IllegalArgumentException- if weight is less than or equal to zero
 
- 
ConfiguredModelConstruct a newConfiguredModelwith thedefault random weight.- Parameters:
- model- the underlying model
- rotationX- x-rotation to apply to the model
- rotationY- y-rotation to apply to the model
- uvLock- if uvlock should be enabled
- Throws:
- NullPointerException- if- modelis- null
- IllegalArgumentException- if x and/or y rotation are not valid (see- BlockModelRotation)
 
- 
ConfiguredModelConstruct a newConfiguredModelwith the default rotation (0, 0), uvlock (false), anddefault random weight.- Throws:
- NullPointerException- if- modelis- null
 
 
- 
- 
Method Details- 
validRotations
- 
allYRotations
- 
allYRotations
- 
allRotations
- 
allRotations
- 
checkRotationstatic void checkRotation(int rotationX, int rotationY) 
- 
checkWeightstatic void checkWeight(int weight) 
- 
toJSONcom.google.gson.JsonObject toJSON(boolean includeWeight) 
- 
builderCreate a new unownedConfiguredModel.Builder.- Returns:
- the builder
- See Also:
 
- 
builderstatic ConfiguredModel.Builder<VariantBlockStateBuilder> builder(VariantBlockStateBuilder outer, VariantBlockStateBuilder.PartialBlockstate state) 
- 
builderstatic ConfiguredModel.Builder<MultiPartBlockStateBuilder.PartBuilder> builder(MultiPartBlockStateBuilder outer) 
 
-