Class MultiPartBlockStateBuilder.PartBuilder.ConditionGroup
- java.lang.Object
-
- net.minecraftforge.client.model.generators.MultiPartBlockStateBuilder.PartBuilder.ConditionGroup
-
- Enclosing class:
- MultiPartBlockStateBuilder.PartBuilder
public class MultiPartBlockStateBuilder.PartBuilder.ConditionGroup extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description com.google.common.collect.Multimap<Property<?>,java.lang.Comparable<?>>
conditions
java.util.List<MultiPartBlockStateBuilder.PartBuilder.ConditionGroup>
nestedConditionGroups
private MultiPartBlockStateBuilder.PartBuilder.ConditionGroup
parent
boolean
useOr
-
Constructor Summary
Constructors Constructor Description ConditionGroup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends java.lang.Comparable<T>>
MultiPartBlockStateBuilder.PartBuilder.ConditionGroupcondition(Property<T> prop, T... values)
Set a condition for this part, which consists of a property and a set of valid values.MultiPartBlockStateBuilder.PartBuilder
end()
Ends this condition group and returns the part builderMultiPartBlockStateBuilder.PartBuilder.ConditionGroup
endNestedGroup()
Ends this nested condition group and returns the parent condition groupMultiPartBlockStateBuilder.PartBuilder.ConditionGroup
nestedGroup()
Allows having nested groups of conditions if there are not any normal conditions.(package private) com.google.gson.JsonObject
toJson()
MultiPartBlockStateBuilder.PartBuilder.ConditionGroup
useOr()
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
-
conditions
public final com.google.common.collect.Multimap<Property<?>,java.lang.Comparable<?>> conditions
-
nestedConditionGroups
public final java.util.List<MultiPartBlockStateBuilder.PartBuilder.ConditionGroup> nestedConditionGroups
-
parent
private MultiPartBlockStateBuilder.PartBuilder.ConditionGroup parent
-
useOr
public boolean useOr
-
-
Method Detail
-
condition
@SafeVarargs public final <T extends java.lang.Comparable<T>> MultiPartBlockStateBuilder.PartBuilder.ConditionGroup 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
- ifprop
isnull
java.lang.NullPointerException
- ifvalues
isnull
java.lang.IllegalArgumentException
- ifvalues
is emptyjava.lang.IllegalArgumentException
- ifprop
has already been configuredjava.lang.IllegalArgumentException
- ifprop
is not applicable to the current block's statejava.lang.IllegalStateException
- if!nestedConditionGroups.isEmpty()
-
nestedGroup
public MultiPartBlockStateBuilder.PartBuilder.ConditionGroup nestedGroup()
Allows having nested groups of conditions if there are not any normal conditions.- Throws:
java.lang.IllegalStateException
- if!conditions.isEmpty()
-
endNestedGroup
public MultiPartBlockStateBuilder.PartBuilder.ConditionGroup endNestedGroup()
Ends this nested condition group and returns the parent condition group- Throws:
java.lang.IllegalStateException
- If this is not a nested condition group
-
end
public MultiPartBlockStateBuilder.PartBuilder end()
Ends this condition group and returns the part builder- Throws:
java.lang.IllegalStateException
- If this is a nested condition group
-
useOr
public MultiPartBlockStateBuilder.PartBuilder.ConditionGroup useOr()
Makes this part get applied if any of the conditions/condition groups are true, instead of all of them needing to be true.
-
toJson
com.google.gson.JsonObject toJson()
-
-