Package net.commoble.databuddy.datagen

# Record Class BlockStateFile.Variants

java.lang.Object
java.lang.Record
net.commoble.databuddy.datagen.BlockStateFile.Variants

Record Components:
  `variants` - Map of blockstate property predicates to models

Enclosing class:
  BlockStateFile

public static record BlockStateFile.Variants(Map<List<BlockStateFile.PropertyValue<?>>,List<BlockStateFile.Model>> variants) extends Record
Represents a "variants" block in a blockstate json.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final com.mojang.serialization.Codec<BlockStateFile.Variants>`
`CODEC`
codec

## Constructor Summary

Constructors
Constructor
Description
`Variants(Map<List<BlockStateFile.PropertyValue<?>>,List<BlockStateFile.Model>> variants)`
Creates an instance of a `Variants` record class.

## Method Summary

Modifier and Type
Method
Description
`BlockStateFile.Variants`
`addVariant(List<BlockStateFile.PropertyValue<?>> values, BlockStateFile.Model... models)`
Adds a variant for your blockstate json
`BlockStateFile.Variants`
`addVariant(BlockStateFile.PropertyValue<?> value, BlockStateFile.Model... models)`
Adds a variant for your blockstate json
`static BlockStateFile.Variants`
`always(BlockStateFile.Model... models)`
Convenience method for a variants blockstate file without blockstate predication
`static BlockStateFile.Variants`
`builder()`
Creates and returns a mutable VariantBlockStateDefinition for whom variants can be defined.
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`final int`
`hashCode()`
Returns a hash code value for this object.
`final String`
`toString()`
Returns a string representation of this record class.
`Map<List<BlockStateFile.PropertyValue<?>>,List<BlockStateFile.Model>>`
`variants()`
Returns the value of the `variants` record component.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### CODEC

public static final com.mojang.serialization.Codec<BlockStateFile.Variants> CODEC
codec

## Constructor Details

### Variants

public Variants(Map<List<BlockStateFile.PropertyValue<?>>,List<BlockStateFile.Model>> variants)
Creates an instance of a `Variants` record class.

Parameters:
  `variants` - the value for the `variants` record component

## Method Details

### builder

public static BlockStateFile.Variants builder()
Creates and returns a mutable VariantBlockStateDefinition for whom variants can be defined. Once variants are added to the definition, giving this to a JsonDataProvider is sufficient to cause the blockstate jsons to be generated, so long as that data provider is given to the data generator, or if that data provider's act method is called by another acting data provider's act method.

Returns:
  a mutable VariantBlockStateDefinition

### always

public static BlockStateFile.Variants always(BlockStateFile.Model... models)
Convenience method for a variants blockstate file without blockstate predication

Parameters:
  `models` - Model definitions to use. More than one indicates a list of random models.
Returns:
  new Variants

### addVariant

public BlockStateFile.Variants addVariant(BlockStateFile.PropertyValue<?> value, BlockStateFile.Model... models)
Adds a variant for your blockstate json

Parameters:
  `value` - e.g. "facing=east"
  `models` - Model definition, e.g. { "model": "minecraft:block/acacia_stairs_inner" }. Providing more than one indicates a list of random models (e.g. stone's models).
Returns:
  this

### addVariant

public BlockStateFile.Variants addVariant(List<BlockStateFile.PropertyValue<?>> values, BlockStateFile.Model... models)
Adds a variant for your blockstate json

Parameters:
  `values` - e.g. "facing=east,powered=false"
  `models` - Model definition, e.g. { "model": "minecraft:block/acacia_stairs_inner" }. Providing more than one indicates a list of random models (e.g. stone's models).
Returns:
  this

### toString

public final String toString()
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.

Specified by:
  `toString` in class `Record`
Returns:
  a string representation of this object

### hashCode

public final int hashCode()
Returns a hash code value for this object. The value is derived from the hash code of each of the record components.

Specified by:
  `hashCode` in class `Record`
Returns:
  a hash code value for this object

### equals

public final boolean equals(Object o)
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with `Objects::equals(Object,Object)`.

Specified by:
  `equals` in class `Record`
Parameters:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### variants

public Map<List<BlockStateFile.PropertyValue<?>>,List<BlockStateFile.Model>> variants()
Returns the value of the `variants` record component.

Returns:
  the value of the `variants` record component