Class VariantBlockStateBuilder.PartialBlockstate
- java.lang.Object
-
- net.minecraftforge.client.model.generators.VariantBlockStateBuilder.PartialBlockstate
-
- All Implemented Interfaces:
java.util.function.Predicate<BlockState>
- Enclosing class:
- VariantBlockStateBuilder
public static class VariantBlockStateBuilder.PartialBlockstate extends java.lang.Object implements java.util.function.Predicate<BlockState>
-
-
Field Summary
Fields Modifier and Type Field Description private VariantBlockStateBuilderouterBuilderprivate Blockownerprivate java.util.SortedMap<Property<?>,java.lang.Comparable<?>>setStates
-
Constructor Summary
Constructors Constructor Description PartialBlockstate(Block owner, java.util.Map<Property<?>,java.lang.Comparable<?>> setStates, VariantBlockStateBuilder outerBuilder)PartialBlockstate(Block owner, VariantBlockStateBuilder outerBuilder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VariantBlockStateBuilder.PartialBlockstateaddModels(ConfiguredModel... models)Add models to the current state's variant.private voidcheckValidOwner()static java.util.Comparator<VariantBlockStateBuilder.PartialBlockstate>comparingByProperties()booleanequals(java.lang.Object o)BlockgetOwner()java.util.SortedMap<Property<?>,java.lang.Comparable<?>>getSetStates()inthashCode()ConfiguredModel.Builder<VariantBlockStateBuilder>modelForState()Creates a builder for models to assign to this state, which when completed viaConfiguredModel.Builder.addModel()will assign the resultant set of models to this state.VariantBlockStateBuilder.PartialBlockstatepartialState()Complete this state without adding any new models, and return a new partial state via the parent builder.VariantBlockStateBuildersetModels(ConfiguredModel... models)Set this variant's models, and return the parent builder.booleantest(BlockState blockState)java.lang.StringtoString()<T extends java.lang.Comparable<T>>
VariantBlockStateBuilder.PartialBlockstatewith(Property<T> prop, T value)
-
-
-
Field Detail
-
owner
private final Block owner
-
setStates
private final java.util.SortedMap<Property<?>,java.lang.Comparable<?>> setStates
-
outerBuilder
@Nullable private final VariantBlockStateBuilder outerBuilder
-
-
Constructor Detail
-
PartialBlockstate
PartialBlockstate(Block owner, @Nullable VariantBlockStateBuilder outerBuilder)
-
PartialBlockstate
PartialBlockstate(Block owner, java.util.Map<Property<?>,java.lang.Comparable<?>> setStates, @Nullable VariantBlockStateBuilder outerBuilder)
-
-
Method Detail
-
with
public <T extends java.lang.Comparable<T>> VariantBlockStateBuilder.PartialBlockstate with(Property<T> prop, T value)
-
checkValidOwner
private void checkValidOwner()
-
modelForState
public ConfiguredModel.Builder<VariantBlockStateBuilder> modelForState()
Creates a builder for models to assign to this state, which when completed viaConfiguredModel.Builder.addModel()will assign the resultant set of models to this state.- Returns:
- the model builder
- See Also:
ConfiguredModel.Builder
-
addModels
public VariantBlockStateBuilder.PartialBlockstate addModels(ConfiguredModel... models)
Add models to the current state's variant. For use when it is more convenient to add multiple sets of models, as a replacement forsetModels(ConfiguredModel...).- Parameters:
models- The models to add.- Returns:
this- Throws:
java.lang.NullPointerException- If the parent builder isnull
-
setModels
public VariantBlockStateBuilder setModels(ConfiguredModel... models)
Set this variant's models, and return the parent builder.- Parameters:
models- The models to set- Returns:
- The parent builder instance
- Throws:
java.lang.NullPointerException- If the parent builder isnull
-
partialState
public VariantBlockStateBuilder.PartialBlockstate partialState()
Complete this state without adding any new models, and return a new partial state via the parent builder. For use after callingaddModels(ConfiguredModel...).- Returns:
- A fresh partial state as specified by
VariantBlockStateBuilder.partialState(). - Throws:
java.lang.NullPointerException- If the parent builder isnull
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getOwner
public Block getOwner()
-
getSetStates
public java.util.SortedMap<Property<?>,java.lang.Comparable<?>> getSetStates()
-
test
public boolean test(BlockState blockState)
- Specified by:
testin interfacejava.util.function.Predicate<BlockState>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
comparingByProperties
public static java.util.Comparator<VariantBlockStateBuilder.PartialBlockstate> comparingByProperties()
-
-