code: public void addTexture(int unit, Texture texture) {
          if (texture == null) {
              throw new IllegalStateException("Texture cannot be null");
          }
          texture.checkCreated();
          if (textures == null) {
              textures = new TIntObjectHashMap<>();
          }
          textures.put(unit, texture);
      }
docs: Adds a texture to the material. If a texture is a already present in the same unit as this one, it will be replaced.
  
  @param unit The unit to add the texture to
  @param texture The texture to add