Class ConfiguredModel


  • public final class ConfiguredModel
    extends java.lang.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 Detail

      • DEFAULT_WEIGHT

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

        public final int rotationX
      • rotationY

        public final int rotationY
      • uvLock

        public final boolean uvLock
      • weight

        public final int weight
    • Constructor Detail

      • 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:
        java.lang.NullPointerException - if model is null
        java.lang.IllegalArgumentException - if x and/or y rotation are not valid (see ModelRotation)
        java.lang.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:
        java.lang.NullPointerException - if model is null
        java.lang.IllegalArgumentException - if x and/or y rotation are not valid (see ModelRotation)
      • ConfiguredModel

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