Class ModelBuilder.ElementBuilder

    • Constructor Detail

      • ElementBuilder

        public ElementBuilder()
    • Method Detail

      • validateCoordinate

        private void validateCoordinate​(float coord,
                                        char name)
      • validatePosition

        private void validatePosition​(Vector3f pos)
      • from

        public ModelBuilder.ElementBuilder from​(float x,
                                                float y,
                                                float z)
        Set the "from" position for this element.
        Parameters:
        x - x-position for this vector
        y - y-position for this vector
        z - z-position for this vector
        Returns:
        this builder
        Throws:
        java.lang.IllegalArgumentException - if the vector is out of bounds (any coordinate not between -16 and 32, inclusive)
      • to

        public ModelBuilder.ElementBuilder to​(float x,
                                              float y,
                                              float z)
        Set the "to" position for this element.
        Parameters:
        x - x-position for this vector
        y - y-position for this vector
        z - z-position for this vector
        Returns:
        this builder
        Throws:
        java.lang.IllegalArgumentException - if the vector is out of bounds (any coordinate not between -16 and 32, inclusive)
      • face

        public ModelBuilder.ElementBuilder.FaceBuilder face​(Direction dir)
        Return or create the face builder for the given direction.
        Parameters:
        dir - the direction
        Returns:
        the face builder for the given direction
        Throws:
        java.lang.NullPointerException - if dir is null
      • allFaces

        public ModelBuilder.ElementBuilder allFaces​(java.util.function.BiConsumer<Direction,​ModelBuilder.ElementBuilder.FaceBuilder> action)
        Modify all possible faces dynamically using a function, creating new faces as necessary.
        Parameters:
        action - the function to apply to each direction
        Returns:
        this builder
        Throws:
        java.lang.NullPointerException - if action is null
      • textureAll

        public ModelBuilder.ElementBuilder textureAll​(java.lang.String texture)
        Texture all possible faces in the current element with the given texture, creating new faces where necessary.
        Parameters:
        texture - the texture
        Returns:
        this builder
        Throws:
        java.lang.NullPointerException - if texture is null
      • texture

        public ModelBuilder.ElementBuilder texture​(java.lang.String texture)
        Texture all existing faces in the current element with the given texture.
        Parameters:
        texture - the texture
        Returns:
        this builder
        Throws:
        java.lang.NullPointerException - if texture is null
      • cube

        public ModelBuilder.ElementBuilder cube​(java.lang.String texture)
        Create a typical cube element, creating new faces as needed, applying the given texture, and setting the cullface.
        Parameters:
        texture - the texture
        Returns:
        this builder
        Throws:
        java.lang.NullPointerException - if texture is null
      • end

        public T end()