Jump to content

Recommended Posts

Posted

Hello, I have been recently working on a mini-project for 1.7.10, and I use an html parser library to help me in the code called jsoup, and what I am trying to do is create a fat jar with the jsoup jar inside the normal mod so users don't have to have t in the mods folder.  By doing this, though, I have been having trouble with getting it to appear inside the IDE and just get it to appear in the jar in general.  Here is the build.gradle file:

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
    }
}

apply plugin: 'forge'

version = "1.0"
group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"

minecraft {
    version = "1.7.10-10.13.4.1558-1.7.10"
    runDir = "eclipse"
}

dependencies {
    // you may put jars on which you depend on in ./libs
    // or you may define them like so..
    //compile "some.group:artifact:version:classifier"
    //compile "some.group:artifact:version"
      
    // real examples
    //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
    //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
compile files("libs/jsoup-1.9.2.jar")
    // for more info...
    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
    // http://www.gradle.org/docs/current/userguide/dependency_management.html

}

processResources
{
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

 

If you would like any more info please ask.  And any help is appreciated!  ;D

I'm working on something big!  As long as there arent alot of big issues... [D

Posted

while looking around those threads I have changed the build.gradle into the following with no changes, could I be corrected on things I could improve?

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
	maven {
            name = "jsoup"
            url = "http://mvnrepository.com/artifact/org.jsoup/jsoup/1.9.2"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
    }
}

apply plugin: 'forge'

version = "1.0"
group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"

configurations {
    shade
    compile.extendsFrom shade
}

minecraft {
    version = "1.7.10-10.13.4.1558-1.7.10"
    runDir = "eclipse"
srgExtra "PK: org/jsoup your/new/package/org/jsoup"
}

dependencies {
    // you may put jars on which you depend on in ./libs
    // or you may define them like so..
    //compile "some.group:artifact:version:classifier"
    //compile "some.group:artifact:version"
      
    // real examples
    //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
    //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
shade 'org.jsoup:jsoup:1.9.2'
    // for more info...
    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
    // http://www.gradle.org/docs/current/userguide/dependency_management.html

}

jar {
    configurations.shade.each { dep ->
        from(project.zipTree(dep)){
            exclude 'META-INF', 'META-INF/**'
            // you may exclude other things here if you want, or maybe copy the META-INF
        }
    }
}

processResources
{
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

 

Also a question, in the srgExtra "PK: org/jsoup your/new/package/org/jsoup" line, I dont know what to put as the new package directory, if I reference the main file as org.jsoup.Jsoup in src/main/java/com.UltraTechX.MODDL.MODDL.java and I put the new package location to org/josup would it locate the jar in src/main/java/org.josup ?

I'm working on something big!  As long as there arent alot of big issues... [D

Posted

Don't modify the

buildscript

block, that specifies the dependencies of the buildscript itself rather than the mod.

 

Since jsoup is hosted on Maven Central, you don't need to explicitly add a Maven repository for it; simply add it as a dependency.

 

The new package for the

srgExtra

line should be something unique to your mod, ForgeGradle will move the classes in

org.jsoup

to the new package and (at compile time) rewrite any class that references these classes to use the new package. If your mod's package is

ultratechx.whatever

, use something like

ultratechx.whatever.repack.org.jsoup

as the new package.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
  On 6/21/2016 at 1:57 AM, Choonster said:

Don't modify the

buildscript

block, that specifies the dependencies of the buildscript itself rather than the mod.

 

Since jsoup is hosted on Maven Central, you don't need to explicitly add a Maven repository for it; simply add it as a dependency.

 

The new package for the

srgExtra

line should be something unique to your mod, ForgeGradle will move the classes in

org.jsoup

to the new package and (at compile time) rewrite any class that references these classes to use the new package. If your mod's package is

ultratechx.whatever

, use something like

ultratechx.whatever.repack.org.jsoup

as the new package.

 

ok, using your suggestions I removed the maven repository and just left the shade inside the dependencies section, here it is, but with no new files appearing in in eclipse:

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
    }
}

apply plugin: 'forge'

version = "1.0"
group= "com.UltraTechX.MODDL" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "MODDL"

configurations {
    shade
    compile.extendsFrom shade
}

minecraft {
    version = "1.7.10-10.13.4.1558-1.7.10"
    runDir = "eclipse"
srgExtra "PK: org/jsoup com/UltraTechX/shadow/repack/org/jsoup"
}

dependencies {
    // you may put jars on which you depend on in ./libs
    // or you may define them like so..
    //compile "some.group:artifact:version:classifier"
    //compile "some.group:artifact:version"
      
    // real examples
    //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
    //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
shade 'org.jsoup:jsoup:1.9.2'
    // for more info...
    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
    // http://www.gradle.org/docs/current/userguide/dependency_management.html

}

jar {
    configurations.shade.each { dep ->
        from(project.zipTree(dep)){
            exclude 'META-INF', 'META-INF/**'
            // you may exclude other things here if you want, or maybe copy the META-INF
        }
    }
}

processResources
{
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

 

to set it up again I run

  Quote
gradlew.bat setupDecompWorkspace eclipse

is the above right to get the changes into eclipse?

I'm working on something big!  As long as there arent alot of big issues... [D

Posted

jsoup will be added as a dependency in your IDE project. It won't put any source code in your workspace.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
  On 6/21/2016 at 2:25 AM, Choonster said:

jsoup will be added as a dependency in your IDE project. It won't put any source code in your workspace.

 

when I change org.jsoup to com.UltraTechX.shadow.repack.org.jsoup in the include section of the mods it just gives errors when I build so how to I work with building the mod if it just gives an error for not finding the jar in the directory specified?

 

screenshot of cmd https://gyazo.com/c5a2a1e6b720dbb3f27090a6a38e17ee

I'm working on something big!  As long as there arent alot of big issues... [D

Posted

You don't use the new package in your code, you just write your code as if jsoup was a regular dependency (i.e. use the

org.jsoup

package). ForgeGradle will rewrite your classes at compile time to use the new package.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
  On 6/21/2016 at 2:52 AM, Choonster said:

You don't use the new package in your code, you just write your code as if jsoup was a regular dependency (i.e. use the

org.jsoup

package). ForgeGradle will rewrite your classes at compile time to use the new package.

 

It worked! thanks, but new error...

 

here is my mod file and build.gradle + log:

 

MODDL.java

package com.UltraTechX.MODDL;

import net.minecraft.init.Blocks;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.jsoup.*;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;

@Mod(modid = MODDL.MODID, version = MODDL.VERSION, name = MODDL.NAME)
public class MODDL
{
    public static final String MODID = "MODDL";
    public static final String NAME = "MODDL";
    public static final String VERSION = "1.0";
    
    @EventHandler
    public void preInit(FMLInitializationEvent event){
    	
    }
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    	String FLINK = null;
	String FNAME = null;
	// some example code
        System.out.println(MODDL.MODID + " Is Downloading Mod From Repository!");
	//start test download
        try {
            Document doc = Jsoup.connect("http://opifex.ddns.net/MODDL/index.html").get();
            Elements links = doc.getElementsByTag("a");
            for (Element link : links) {
            	 //test download
            	FLINK = link.attr("href");
            	FNAME = link.text();
                URL website = null;
        		try {
        			website = new URL(FLINK);
        		} catch (MalformedURLException e) {
        			System.out.println("WEBSITE CONNECTION CHECK FAILED, THIS COULD EITHER BE CAUSED BY AN INCORRECT URL IN THE MOD, A WEBSITE NOT CURRENTLY AVAILABLE, OR A BAD CONNECTION TO THE INTERNET - PRINTING STACK TRACE (ERR TYPE=MalformedURLException)");
        			e.printStackTrace();
        		}
               ReadableByteChannel rbc = null;
        		try {
        			rbc = Channels.newChannel(website.openStream());
        		} catch (IOException e) {
        			System.out.println("OPENEING WEBSITE CONNECTION FAILED, THIS COULD EITHER RESULT FROM A WEBSITE VARIABLE SETUP ERROR (SEE CONSOLE ABOVE TO CHECK), FROM A BAD CONENCTION TO THE INTERNET, OR A UNAVAILABLE WEBSITE - PRINTING STACK TRACE (ERR TYPE=IOException)");
        			e.printStackTrace();
        		}
               FileOutputStream fos = null;
        		try {
        				new File(System.getProperty("user.home") + "/AppData/Roaming/.minecraft/Mods").mkdir();
        			fos = new FileOutputStream(System.getProperty("user.home") + "/AppData/Roaming/.minecraft/Mods/"+FNAME);
        		} catch (FileNotFoundException e) {
        			System.out.println("FILE NOT FOUND, THIS CAN BE CAUSED BY EITHER AN ERROR FROM ABOVE OR BY AN INCORRECT URL - PRINTING STACK TRACE (ERR TYPE=FileNotFoundException)");
        			e.printStackTrace();
        		}
               try {
        			fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
        		} catch (IOException e) {
        			System.out.println("FAILED TO TRANSFER FILE FROM INITIAL LOCATION, THIS IS EITHER CAUSED BY A FILE NOT BEING DOWNLOADED OR A HARD DRIVE FAILIURE - PRINTING STACK TRACE (ERR TYPE=IOException)");
        			e.printStackTrace();
        		}
               try {
        			fos.close();
        		} catch (IOException e) {
        			System.out.println("FAILED TO CLOSE CONNECTION TO SERVER, THIS COULD EITHER RESULT FROM A CONNECTION LOSS EARLIER OR A MOD MALFUNCTION - PRINTING STACK TRACE (ERR TYPE=IOException)");
        			e.printStackTrace();
        		}
               //end test download
            }
        } catch (IOException ex) {
        	System.out.println("FAILED TO GET REPOSITORY MOD LIST, THIS COULD RESULT FROM EITHER A BAD URL OR A NONEXISTING LIST - PRINTING STACK TRACE (ERR TYPE=IOException)");
            ex.printStackTrace();
        }
       //end test download
    }
}

 

 

build.gradle:

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = "forge"
            url = "http://files.minecraftforge.net/maven"
        }
        maven {
            name = "sonatype"
            url = "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
    }
}

apply plugin: 'forge'

version = "1.0"
group= "com.UltraTechX.MODDL" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "MODDL"

configurations {
    shade
    compile.extendsFrom shade
}

minecraft {
    version = "1.7.10-10.13.4.1558-1.7.10"
    runDir = "eclipse"
srgExtra "PK: org/jsoup com/UltraTechX/shadow/repack/org/jsoup"
}

dependencies {
    // you may put jars on which you depend on in ./libs
    // or you may define them like so..
    //compile "some.group:artifact:version:classifier"
    //compile "some.group:artifact:version"
      
    // real examples
    //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
    //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
shade 'org.jsoup:jsoup:1.9.2'
    // for more info...
    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
    // http://www.gradle.org/docs/current/userguide/dependency_management.html

}

jar {
    configurations.shade.each { dep ->
        from(project.zipTree(dep)){
            exclude 'META-INF', 'META-INF/**'
            // you may exclude other things here if you want, or maybe copy the META-INF
        }
    }
}

processResources
{
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else, thats not the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

 

 

crash log:

cpw.mods.fml.common.LoaderException: java.lang.ExceptionInInitializerError
at cpw.mods.fml.common.LoadController.transition(LoadController.java:163)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:739)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:311)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:552)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Caused by: java.lang.ExceptionInInitializerError
at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities$EscapeMode.<clinit>(Entities.java:20)
at com.UltraTechX.shadow.repack.org.jsoup.nodes.Document$OutputSettings.<init>(Document.java:371)
at com.UltraTechX.shadow.repack.org.jsoup.nodes.Document.<init>(Document.java:18)
at com.UltraTechX.shadow.repack.org.jsoup.parser.TreeBuilder.initialiseParse(TreeBuilder.java:29)
at com.UltraTechX.shadow.repack.org.jsoup.parser.TreeBuilder.parse(TreeBuilder.java:42)
at com.UltraTechX.shadow.repack.org.jsoup.parser.HtmlTreeBuilder.parse(HtmlTreeBuilder.java:52)
at com.UltraTechX.shadow.repack.org.jsoup.parser.Parser.parseInput(Parser.java:30)
at com.UltraTechX.shadow.repack.org.jsoup.helper.DataUtil.parseByteData(DataUtil.java:104)
at com.UltraTechX.shadow.repack.org.jsoup.helper.HttpConnection$Response.parse(HttpConnection.java:653)
at com.UltraTechX.shadow.repack.org.jsoup.helper.HttpConnection.get(HttpConnection.java:217)
at com.UltraTechX.MODDL.MODDL.init(MODDL.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:737)
... 10 more
Caused by: java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:434)
at java.util.Properties.load0(Properties.java:353)
at java.util.Properties.load(Properties.java:341)
at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities.loadEntities(Entities.java:241)
at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities.<clinit>(Entities.java:225)
... 48 more

 

I dont really know what could have caused this, but any help would be nice!

 

UPDATE: it only crashes when the connection to my website (to get the mod download list) doesnt time out, so it has something to do with the shaded code for sure

I'm working on something big!  As long as there arent alot of big issues... [D

Posted
  Quote
Caused by: java.lang.ExceptionInInitializerError

at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities$EscapeMode.<clinit>(Entities.java:20)

at com.UltraTechX.shadow.repack.org.jsoup.nodes.Document$OutputSettings.<init>(Document.java:371)

at com.UltraTechX.shadow.repack.org.jsoup.nodes.Document.<init>(Document.java:18)

at com.UltraTechX.shadow.repack.org.jsoup.parser.TreeBuilder.initialiseParse(TreeBuilder.java:29)

at com.UltraTechX.shadow.repack.org.jsoup.parser.TreeBuilder.parse(TreeBuilder.java:42)

at com.UltraTechX.shadow.repack.org.jsoup.parser.HtmlTreeBuilder.parse(HtmlTreeBuilder.java:52)

at com.UltraTechX.shadow.repack.org.jsoup.parser.Parser.parseInput(Parser.java:30)

at com.UltraTechX.shadow.repack.org.jsoup.helper.DataUtil.parseByteData(DataUtil.java:104)

at com.UltraTechX.shadow.repack.org.jsoup.helper.HttpConnection$Response.parse(HttpConnection.java:653)

at com.UltraTechX.shadow.repack.org.jsoup.helper.HttpConnection.get(HttpConnection.java:217)

at com.UltraTechX.MODDL.MODDL.init(MODDL.java:47)

...

Caused by: java.lang.NullPointerException

at java.util.Properties$LineReader.readLine(Properties.java:434)

at java.util.Properties.load0(Properties.java:353)

at java.util.Properties.load(Properties.java:341)

at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities.loadEntities(Entities.java:241)

at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities.<clinit>(Entities.java:225)

... 48 more

 

It looks like it's an error from jsoup, I can't really help you with it.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
  On 6/21/2016 at 5:14 AM, Choonster said:

  Quote
Caused by: java.lang.ExceptionInInitializerError

at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities$EscapeMode.<clinit>(Entities.java:20)

at com.UltraTechX.shadow.repack.org.jsoup.nodes.Document$OutputSettings.<init>(Document.java:371)

at com.UltraTechX.shadow.repack.org.jsoup.nodes.Document.<init>(Document.java:18)

at com.UltraTechX.shadow.repack.org.jsoup.parser.TreeBuilder.initialiseParse(TreeBuilder.java:29)

at com.UltraTechX.shadow.repack.org.jsoup.parser.TreeBuilder.parse(TreeBuilder.java:42)

at com.UltraTechX.shadow.repack.org.jsoup.parser.HtmlTreeBuilder.parse(HtmlTreeBuilder.java:52)

at com.UltraTechX.shadow.repack.org.jsoup.parser.Parser.parseInput(Parser.java:30)

at com.UltraTechX.shadow.repack.org.jsoup.helper.DataUtil.parseByteData(DataUtil.java:104)

at com.UltraTechX.shadow.repack.org.jsoup.helper.HttpConnection$Response.parse(HttpConnection.java:653)

at com.UltraTechX.shadow.repack.org.jsoup.helper.HttpConnection.get(HttpConnection.java:217)

at com.UltraTechX.MODDL.MODDL.init(MODDL.java:47)

...

Caused by: java.lang.NullPointerException

at java.util.Properties$LineReader.readLine(Properties.java:434)

at java.util.Properties.load0(Properties.java:353)

at java.util.Properties.load(Properties.java:341)

at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities.loadEntities(Entities.java:241)

at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities.<clinit>(Entities.java:225)

... 48 more

 

It looks like it's an error from jsoup, I can't really help you with it.

 

Ok then, thanks anyways!

I'm working on something big!  As long as there arent alot of big issues... [D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • dynamictrees and dtneapolitan are the last mentioned mod - remove these
    • https://mclo.gs/9y5ciD2 anyone ever had this issue?  Internal exception illegal argument exception: unable to fit 3194354 into 3
    • Hi! I'm trying to add my custom models/textures renderer like this: public class PonyPlayerWrapperRenderer extends EntityRenderer<Player> { // wrapper class under my LivingEntityRenderer class implementation private final PonyPlayerRenderer innerRenderer; private final PonyPlayerRenderer innerSlimRenderer; public PonyPlayerWrapperRenderer(final EntityRendererProvider.Context context) { super(context); System.out.println("creating new PonyPlayerWrapperRenderer"); this.innerRenderer = new PonyPlayerRenderer(context, false); this.innerSlimRenderer = new PonyPlayerRenderer(context, true); } @Override public void render(final Player entity, final float yaw, final float partialTicks, final PoseStack poseStack, final MultiBufferSource bufferSource, final int packedLight) { System.out.println("PonyPlayerWrapperRenderer render: " + entity.toString()); if (entity instanceof AbstractClientPlayer clientPlayer) { if (clientPlayer.getModelName().contains("slim")) { innerSlimRenderer.render(clientPlayer, yaw, partialTicks, poseStack, bufferSource, packedLight); } else { innerRenderer.render(clientPlayer, yaw, partialTicks, poseStack, bufferSource, packedLight); } } } @Override public ResourceLocation getTextureLocation(final Player player) { System.out.println("PonyPlayerWrapperRenderer getTextureLocation"); if (player instanceof AbstractClientPlayer clientPlayer) { return clientPlayer.getSkinTextureLocation(); } System.out.println("player instanceof AbstractClientPlayer is false"); return getDefaultSkin(player.getUUID()); } } public class PonyPlayerRenderer extends LivingEntityRenderer<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> { private final PlayerModel<AbstractClientPlayer> earthModel; private final PlayerModel<AbstractClientPlayer> pegasusModel; private final PlayerModel<AbstractClientPlayer> unicornModel; public PonyPlayerRenderer(final EntityRendererProvider.Context context, final boolean slim) { super( context, slim ? new PonyModelSlim(context.bakeLayer(PonyModelSlim.LAYER_LOCATION)) : new PonyModel(context.bakeLayer(PonyModel.LAYER_LOCATION)), 0.5f ); System.out.println("creating new PonyPlayerRenderer"); this.earthModel = slim ? new PonyModelSlim(context.bakeLayer(PonyModelSlim.LAYER_LOCATION)) : new PonyModel(context.bakeLayer(PonyModel.LAYER_LOCATION)); this.pegasusModel = new PegasusModel(context.bakeLayer(PegasusModel.LAYER_LOCATION)); this.unicornModel = new UnicornModel(context.bakeLayer(UnicornModel.LAYER_LOCATION)); } @Override public void render(final AbstractClientPlayer player, final float entityYaw, final float partialTicks, final PoseStack poseStack, final MultiBufferSource buffer, final int packedLight) { final PonyRace race = player.getCapability(PONY_DATA) .map(data -> ofNullable(data.getRace()).orElse(PonyRace.EARTH)) .orElse(PonyRace.EARTH); this.model = switch (race) { case PEGASUS -> pegasusModel; case UNICORN -> unicornModel; case EARTH -> earthModel; }; super.render(player, entityYaw, partialTicks, poseStack, buffer, packedLight); } @Override public ResourceLocation getTextureLocation(final AbstractClientPlayer player) { final PonyRace race = player.getCapability(PONY_DATA) .map(data -> ofNullable(data.getRace()).orElse(PonyRace.EARTH)) .orElse(PonyRace.EARTH); return switch (race) { case EARTH -> fromNamespaceAndPath(MODID, "textures/entity/earth_pony.png"); case PEGASUS -> fromNamespaceAndPath(MODID, "textures/entity/pegasus.png"); case UNICORN -> fromNamespaceAndPath(MODID, "textures/entity/unicorn.png"); }; } } @Mod.EventBusSubscriber(modid = MODID, bus = MOD, value = CLIENT) public class ClientRenderers { // mod bus render registration config @SubscribeEvent public static void onRegisterLayerDefinitions(final EntityRenderersEvent.RegisterLayerDefinitions event) { event.registerLayerDefinition(PonyModel.LAYER_LOCATION, PonyModel::createBodyLayer); event.registerLayerDefinition(PonyModelSlim.LAYER_LOCATION, PonyModelSlim::createBodyLayer); event.registerLayerDefinition(PegasusModel.LAYER_LOCATION, PegasusModel::createBodyLayer); event.registerLayerDefinition(UnicornModel.LAYER_LOCATION, UnicornModel::createBodyLayer); event.registerLayerDefinition(InnerPonyArmorModel.LAYER_LOCATION, InnerPonyArmorModel::createBodyLayer); event.registerLayerDefinition(OuterPonyArmorModel.LAYER_LOCATION, OuterPonyArmorModel::createBodyLayer); } @SubscribeEvent public static void onRegisterRenderers(final EntityRenderersEvent.RegisterRenderers event) { event.registerEntityRenderer(EntityType.PLAYER, PonyPlayerWrapperRenderer::new); System.out.println("onRegisterRenderers end"); } } Method onRegisterRenderers() is called and I can see it being logged. But when I enter the world, my PonyWrapperRenderer render() method doesn't ever seem to be called. I also tried to put my renderer to EntityRenderDispatcher's playerRenderers via reflection: @Mod.EventBusSubscriber(modid = MODID, bus = MOD, value = CLIENT) public class ClientRenderers { @SubscribeEvent public static void onRegisterLayerDefinitions(final EntityRenderersEvent.RegisterLayerDefinitions event) { event.registerLayerDefinition(PonyModel.LAYER_LOCATION, PonyModel::createBodyLayer); event.registerLayerDefinition(PonyModelSlim.LAYER_LOCATION, PonyModelSlim::createBodyLayer); event.registerLayerDefinition(PegasusModel.LAYER_LOCATION, PegasusModel::createBodyLayer); event.registerLayerDefinition(UnicornModel.LAYER_LOCATION, UnicornModel::createBodyLayer); event.registerLayerDefinition(InnerPonyArmorModel.LAYER_LOCATION, InnerPonyArmorModel::createBodyLayer); event.registerLayerDefinition(OuterPonyArmorModel.LAYER_LOCATION, OuterPonyArmorModel::createBodyLayer); } @SubscribeEvent public static void onClientSetup(final FMLClientSetupEvent event) { event.enqueueWork(() -> { try { final EntityRenderDispatcher dispatcher = Minecraft.getInstance().getEntityRenderDispatcher(); final Field renderersField = getEntityRenderDispatcherField("playerRenderers"); final Field itemInHandRenderer = getEntityRenderDispatcherField("itemInHandRenderer"); @SuppressWarnings("unchecked") final Map<String, EntityRenderer<? extends Player>> playerRenderers = (Map<String, EntityRenderer<? extends Player>>)renderersField.get(dispatcher); final PonyPlayerWrapperRenderer renderer = new PonyPlayerWrapperRenderer( new EntityRendererProvider.Context( dispatcher, Minecraft.getInstance().getItemRenderer(), Minecraft.getInstance().getBlockRenderer(), (ItemInHandRenderer)itemInHandRenderer.get(dispatcher), Minecraft.getInstance().getResourceManager(), Minecraft.getInstance().getEntityModels(), Minecraft.getInstance().font ) ); playerRenderers.put("default", renderer); playerRenderers.put("slim", renderer); System.out.println("Player renderers replaced"); } catch (final Exception e) { throw new RuntimeException("Failed to replace player renderers", e); } }); } private static Field getEntityRenderDispatcherField(final String fieldName) throws NoSuchFieldException { final Field field = EntityRenderDispatcher.class.getDeclaredField(fieldName); field.setAccessible(true); return field; } } But I receive the error before Minecraft Client appears (RuntimeException: Failed to replace player renderers - from ClientRenderers onClientSetup() method - and its cause below): java.lang.IllegalArgumentException: No model for layer anotherlittlepony:earth_pony#main at net.minecraft.client.model.geom.EntityModelSet.bakeLayer(EntityModelSet.java:18) ~[forge-1.20.1-47.4.0_mapped_official_1.20.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.entity.EntityRendererProvider$Context.bakeLayer(EntityRendererProvider.java:69) ~[forge-1.20.1-47.4.0_mapped_official_1.20.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at com.thuggeelya.anotherlittlepony.client.renderer.pony.PonyPlayerRenderer.<init>(PonyPlayerRenderer.java:32) ~[main/:?] {re:classloading} at com.thuggeelya.anotherlittlepony.client.renderer.pony.PonyPlayerWrapperRenderer.<init>(PonyPlayerWrapperRenderer.java:24) ~[main/:?] {re:classloading} at com.thuggeelya.anotherlittlepony.client.renderer.ClientRenderers.lambda$onClientSetup$0(ClientRenderers.java:79) ~[main/:?] {re:classloading} ... 33 more Problem appears when EntityRendererProvider context tries to bakeLayer with my model layer location: new PonyModel(context.bakeLayer(PonyModel.LAYER_LOCATION)); // PonyPlayerRenderer.java:32 public class PonyModel extends PlayerModel<AbstractClientPlayer> { // the model class itself public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( ResourceLocation.fromNamespaceAndPath(MODID, "earth_pony"), "main" ); public PonyModel(final ModelPart root) { super(root, false); } public static LayerDefinition createBodyLayer() { // some CubeListBuilder stuff for model appearance } } Textures PNGs are placed at: resources/assets/[my mod id]/textures/entity. My forge version is 1.20.1. Would appreciate any help.
    • Well, a bit more information about what you're trying to do would be helpful. e.g. why you're trying to use "INVOKE_ASSIGN" instead of "INVOKE". "INVOKE_ASSIGN" calls your code after the "target" is called and its value is stored, if applicable. "INVOKE" calls your code before the target is called. "target" expects a fully qualified name, as per the SpongePowered docs, if that name is going to be remapped (which it will be if your injecting into Minecraft itself and not another mod). For more information on fully qualified names versus canonical names, see the Java specifications. Here's an example of a working "@At" from my own code that targets the "getClosestsVulnerablePlayerToEntity" call inside a mob's logic: @At(value = "INVOKE_ASSIGN", target = "net.minecraft.world.World.getClosestVulnerablePlayerToEntity(Lnet/minecraft/entity/Entity;D)Lnet/minecraft/entity/player/EntityPlayer;") Hope this helps!
    • Ran it one more time just to check, and there's no errors this time on the log??? Log : https://mclo.gs/LnuaAiu I tried allocating more memory to the modpack, around 8000MB and it's still the same; stopping at "LOAD_REGISTRIES". Are some of the mods clashing, maybe? I have no clue what to do LOL
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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