Class MultiPartBlockStateBuilder.PartBuilder
- java.lang.Object
-
- net.minecraftforge.client.model.generators.MultiPartBlockStateBuilder.PartBuilder
-
- Enclosing class:
- MultiPartBlockStateBuilder
public class MultiPartBlockStateBuilder.PartBuilder extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMultiPartBlockStateBuilder.PartBuilder.ConditionGroup
-
Field Summary
Fields Modifier and Type Field Description com.google.common.collect.Multimap<Property<?>,java.lang.Comparable<?>>conditionsBlockStateProvider.ConfiguredModelListmodelsjava.util.List<MultiPartBlockStateBuilder.PartBuilder.ConditionGroup>nestedConditionGroupsbooleanuseOr
-
Constructor Summary
Constructors Constructor Description PartBuilder(BlockStateProvider.ConfiguredModelList models)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanApplyTo(Block b)<T extends java.lang.Comparable<T>>
MultiPartBlockStateBuilder.PartBuildercondition(Property<T> prop, T... values)Set a condition for this part, which consists of a property and a set of valid values.MultiPartBlockStateBuilderend()MultiPartBlockStateBuilder.PartBuilder.ConditionGroupnestedGroup()Allows having nested groups of conditions if there are not any normal conditions.(package private) com.google.gson.JsonObjecttoJson()MultiPartBlockStateBuilder.PartBuilderuseOr()Makes this part get applied if any of the conditions/condition groups are true, instead of all of them needing to be true.
-
-
-
Field Detail
-
models
public BlockStateProvider.ConfiguredModelList models
-
useOr
public boolean useOr
-
conditions
public final com.google.common.collect.Multimap<Property<?>,java.lang.Comparable<?>> conditions
-
nestedConditionGroups
public final java.util.List<MultiPartBlockStateBuilder.PartBuilder.ConditionGroup> nestedConditionGroups
-
-
Constructor Detail
-
PartBuilder
PartBuilder(BlockStateProvider.ConfiguredModelList models)
-
-
Method Detail
-
useOr
public MultiPartBlockStateBuilder.PartBuilder useOr()
Makes this part get applied if any of the conditions/condition groups are true, instead of all of them needing to be true.
-
condition
@SafeVarargs public final <T extends java.lang.Comparable<T>> MultiPartBlockStateBuilder.PartBuilder condition(Property<T> prop, T... values)
Set a condition for this part, which consists of a property and a set of valid values. Can be called multiple times for multiple different properties.- Type Parameters:
T- the type of the property value- Parameters:
prop- the propertyvalues- a set of valid values- Returns:
- this builder
- Throws:
java.lang.NullPointerException- ifpropisnulljava.lang.NullPointerException- ifvaluesisnulljava.lang.IllegalArgumentException- ifvaluesis emptyjava.lang.IllegalArgumentException- ifprophas already been configuredjava.lang.IllegalArgumentException- ifpropis not applicable to the current block's statejava.lang.IllegalStateException- if!nestedConditionGroups.isEmpty()
-
nestedGroup
public final MultiPartBlockStateBuilder.PartBuilder.ConditionGroup nestedGroup()
Allows having nested groups of conditions if there are not any normal conditions.- Throws:
java.lang.IllegalStateException- if!conditions.isEmpty()
-
end
public MultiPartBlockStateBuilder end()
-
toJson
com.google.gson.JsonObject toJson()
-
canApplyTo
public boolean canApplyTo(Block b)
-
-