Class ModelBuilder<T extends ModelBuilder<T>>

    • Method Detail

      • self

        private T self()
      • exists

        protected boolean exists()
        Specified by:
        exists in class ModelFile
      • parent

        public T parent​(ModelFile parent)
        Set the parent model for the current model.
        Parameters:
        parent - the parent model
        Returns:
        this builder
        Throws:
        java.lang.NullPointerException - if parent is null
        java.lang.IllegalStateException - if parent does not exist
      • texture

        public T texture​(java.lang.String key,
                         java.lang.String texture)
        Set the texture for a given dictionary key.
        Parameters:
        key - the texture key
        texture - the texture, can be another key e.g. "#all"
        Returns:
        this builder
        Throws:
        java.lang.NullPointerException - if key is null
        java.lang.NullPointerException - if texture is null
        java.lang.IllegalStateException - if texture is not a key (does not start with '#') and does not exist in any known resource pack
      • texture

        public T texture​(java.lang.String key,
                         ResourceLocation texture)
        Set the texture for a given dictionary key.
        Parameters:
        key - the texture key
        texture - the texture
        Returns:
        this builder
        Throws:
        java.lang.NullPointerException - if key is null
        java.lang.NullPointerException - if texture is null
        java.lang.IllegalStateException - if texture is not a key (does not start with '#') and does not exist in any known resource pack
      • ao

        public T ao​(boolean ao)
      • gui3d

        @Deprecated
        public T gui3d​(boolean gui3d)
        Deprecated.
        Unused in 1.15, use guiLight(GuiLight) instead.
        Parameters:
        gui3d -
        Returns:
        this builder
      • element

        public ModelBuilder.ElementBuilder element​(int index)
        Get an existing element builder
        Parameters:
        index - the index of the existing element builder
        Returns:
        the element builder
        Throws:
        java.lang.IndexOutOfBoundsException - if index is out of bounds
      • getElementCount

        public int getElementCount()
        Gets the number of elements in this model builder
        Returns:
        the number of elements in this model builder
      • customLoader

        public <L extends CustomLoaderBuilder<T>> L customLoader​(java.util.function.BiFunction<T,​ExistingFileHelper,​L> customLoaderFactory)
        Use a custom loader instead of the vanilla elements.
        Parameters:
        customLoaderFactory -
        Returns:
        the custom loader builder
      • toJson

        public com.google.gson.JsonObject toJson()
      • serializeLocOrKey

        private java.lang.String serializeLocOrKey​(java.lang.String tex)
      • serializeVector3f

        private com.google.gson.JsonArray serializeVector3f​(Vector3f vec)
      • serializeFloat

        private java.lang.Number serializeFloat​(float f)