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 Summary
Modifier and TypeClassDescriptionstatic class
A builder forConfiguredModel
s, which can contain a callback for processing the finished result. -
Field Summary
-
Constructor Summary
ConstructorDescriptionConfiguredModel
(ModelFile model) Construct a newConfiguredModel
with the default rotation (0, 0), uvlock (false), anddefault random weight
.ConfiguredModel
(ModelFile model, int rotationX, int rotationY, boolean uvLock) Construct a newConfiguredModel
with thedefault random weight
.ConfiguredModel
(ModelFile model, int rotationX, int rotationY, boolean uvLock, int weight) Construct a newConfiguredModel
. -
Method Summary
Modifier 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 void
checkRotation
(int rotationX, int rotationY) (package private) static void
checkWeight
(int weight) (package private) com.google.gson.JsonObject
toJSON
(boolean includeWeight) private static IntStream
-
Field Details
-
DEFAULT_WEIGHT
public static final int DEFAULT_WEIGHTThe default random weight of configured models, used by convenience overloads.- See Also:
-
model
-
rotationX
public final int rotationX -
rotationY
public final int rotationY -
uvLock
public final boolean uvLock -
weight
public final int weight
-
-
Constructor Details
-
ConfiguredModel
Construct a newConfiguredModel
.- Parameters:
model
- the underlying modelrotationX
- x-rotation to apply to the modelrotationY
- y-rotation to apply to the modeluvLock
- if uvlock should be enabledweight
- the random weight of the model- Throws:
NullPointerException
- ifmodel
isnull
IllegalArgumentException
- if x and/or y rotation are not valid (seeBlockModelRotation
)IllegalArgumentException
- if weight is less than or equal to zero
-
ConfiguredModel
Construct a newConfiguredModel
with thedefault random weight
.- Parameters:
model
- the underlying modelrotationX
- x-rotation to apply to the modelrotationY
- y-rotation to apply to the modeluvLock
- if uvlock should be enabled- Throws:
NullPointerException
- ifmodel
isnull
IllegalArgumentException
- if x and/or y rotation are not valid (seeBlockModelRotation
)
-
ConfiguredModel
Construct a newConfiguredModel
with the default rotation (0, 0), uvlock (false), anddefault random weight
.- Throws:
NullPointerException
- ifmodel
isnull
-
-
Method Details
-
validRotations
-
allYRotations
-
allYRotations
-
allRotations
-
allRotations
-
checkRotation
static void checkRotation(int rotationX, int rotationY) -
checkWeight
static void checkWeight(int weight) -
toJSON
com.google.gson.JsonObject toJSON(boolean includeWeight) -
builder
Create a new unownedConfiguredModel.Builder
.- Returns:
- the builder
- See Also:
-
builder
static ConfiguredModel.Builder<VariantBlockStateBuilder> builder(VariantBlockStateBuilder outer, VariantBlockStateBuilder.PartialBlockstate state) -
builder
static ConfiguredModel.Builder<MultiPartBlockStateBuilder.PartBuilder> builder(MultiPartBlockStateBuilder outer)
-