Package net.commoble.databuddy.datagen

# Record Class BlockStateFile.Multipart

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

Record Components:
  `cases` - List of when-apply components.

Enclosing class:
  `BlockStateFile`

public static record BlockStateFile.Multipart(List<BlockStateFile.WhenApply> cases) extends Record
Multipart format for blockstate jsons. Assigns models to blockstates by comparing states to property-value predicate Cases. Multiple models can be applied to individual blockstates. When used with the Variants format, models applied by Variants will override models applied by Multiparts.

## Field Summary

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

## Constructor Summary

Constructors
Constructor
Description
`Multipart(List<BlockStateFile.WhenApply> cases)`
Creates an instance of a `Multipart` record class.

## Method Summary

Modifier and Type
Method
Description
`BlockStateFile.Multipart`
`addWhenApply(BlockStateFile.WhenApply whenApply)`
Adds a when-apply case to this multipart definition
`static BlockStateFile.Multipart`
`builder()`
Creates and returns a MultipartBlockStateDefinition for whom cases can be defined.
`List<BlockStateFile.WhenApply>`
`cases()`
Returns the value of the `cases` record component.
`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.

### 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.Multipart> CODEC
codec

## Constructor Details

### Multipart

public Multipart(List<BlockStateFile.WhenApply> cases)
Creates an instance of a `Multipart` record class.

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

## Method Details

### builder

public static BlockStateFile.Multipart builder()
Creates and returns a MultipartBlockStateDefinition for whom cases can be defined. Once cases 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 MultipartBlockStateDefinition

### addWhenApply

public BlockStateFile.Multipart addWhenApply(BlockStateFile.WhenApply whenApply)
Adds a when-apply case to this multipart definition

Parameters:
  `whenApply` - WhenApply to add
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.

### cases

public List<BlockStateFile.WhenApply> cases()
Returns the value of the `cases` record component.

Returns:
  the value of the `cases` record component