Class ConfiguredModel

java.lang.Object
io.github.vampirestudios.vampirelib.api.datagen.ConfiguredModel

public final class ConfiguredModel extends Object
Represents a model with blockstate configurations, e.g. rotation, uvlock, and random weight.

Can be manually constructed, created by static factory such as allYRotations(ModelFile, int, boolean), or created by builder via builder().

  • Field Details

    • DEFAULT_WEIGHT

      public static final int DEFAULT_WEIGHT
      The default random weight of configured models, used by convenience overloads.
      See Also:
    • model

      public final ModelFile model
    • rotationX

      public final int rotationX
    • rotationY

      public final int rotationY
    • uvLock

      public final boolean uvLock
    • weight

      public final int weight
  • Constructor Details

    • ConfiguredModel

      public ConfiguredModel(ModelFile model, int rotationX, int rotationY, boolean uvLock, int weight)
      Construct a new ConfiguredModel.
      Parameters:
      model - the underlying model
      rotationX - x-rotation to apply to the model
      rotationY - y-rotation to apply to the model
      uvLock - if uvlock should be enabled
      weight - the random weight of the model
      Throws:
      NullPointerException - if model is null
      IllegalArgumentException - if x and/or y rotation are not valid (see BlockModelRotation)
      IllegalArgumentException - if weight is less than or equal to zero
    • ConfiguredModel

      public ConfiguredModel(ModelFile model, int rotationX, int rotationY, boolean uvLock)
      Construct a new ConfiguredModel with the default random weight.
      Parameters:
      model - the underlying model
      rotationX - x-rotation to apply to the model
      rotationY - y-rotation to apply to the model
      uvLock - if uvlock should be enabled
      Throws:
      NullPointerException - if model is null
      IllegalArgumentException - if x and/or y rotation are not valid (see BlockModelRotation)
    • ConfiguredModel

      public ConfiguredModel(ModelFile model)
      Construct a new ConfiguredModel with the default rotation (0, 0), uvlock (false), and default random weight.
      Throws:
      NullPointerException - if model is null
  • Method Details