Jump to content

Kamesuta

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Kamesuta

  1. I found that this problem occurs when I define a constructor of a class defined in a location that can not be reached from outside.

     

    // A.java
    public class A {
    public void example() {
    	// class in method
    	class B {
    		// constructor of class
    		public B() {
    			// define constructor
    		}
    	}
    	new B();
    }
    }
    

    It should be solved by defining it to be visible from the outside.

    // A.java
    public class A {
    public void example() {
    	new B();
    }
    
    // class in class
    class B {
    	// constructor of class
    	public B() {
    		// define constructor
    	}
    }
    }
    

  2. I tries to put the library in a jar file with using shade function of ForgeGradle. However, it gets into the jar file to the dependency of the library. Is it possible to put the only library?

     

    I want to include "httpmime" only. not "httpclient", "httpcore" ...etc...

     

    build.gradle

    configurations {
        shade
        compile.extendsFrom shade
    }
    
    dependencies {
        shade 'org.apache.httpcomponents:httpmime:4.3.3'
    }
    
    jar {
        configurations.shade.each { dep ->
            from(project.zipTree(dep)){
                exclude 'META-INF', 'META-INF/**'
            }
        }
    }
    
    minecraft {
        srgExtra "PK: org/apache/http/entity/mime com/kamesuta/mc/signpic/lib/org/apache/http/entity/mime"
        srgExtra "PK: org/apache/http/entity/mime/content com/kamesuta/mc/signpic/lib/org/apache/http/entity/mime/content"
    }
    

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.