IDE: IntelliJ IDEA
Forge Version: 1.15.1-forge-30.0.36
Hello,
I trying to create minecraft mod that send ping to server every 1 second.
and I want to use ping wrapper library http://icmp4j.org/d/index.html for this mod, then I downloaded this and copy icmp4j.jar to `libs/icmp4j.jar` and `src/main/resources/META-INF/libraries/icmp4j-1.0.0.jar`.
It works well on runClient task, but builded jar file doesnt work.
[1412020 02:31:36.932] [Thread-989/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.NoClassDefFoundError: org/icmp4j/IcmpPingUtil
[1412020 02:31:36.933] [Thread-989/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.naari3.pingtoserver.Pinger.ping(Pinger.java:27)
[1412020 02:31:36.933] [Thread-989/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.naari3.pingtoserver.Pinger.lambda$pingAsync$0(Pinger.java:54)
[1412020 02:31:36.933] [Thread-989/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.lang.Thread.run(Thread.java:745)
I found out after read some docs this library was not registered to maven and I think it need to make `src/main/resources/META-INF/libraries/icmp4j-1.0.0.jar.meta` like this.
Maven-Artifact: org.icmp4j:icmp4j:1.0.0
finally, I added manifest attribute `ContainedDeps` to `build.gradle` like this
jar {
manifest {
attributes([
"Specification-Title": "pingtoserver",
"Specification-Vendor": "naari3",
"Specification-Version": "1",
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"naari3",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"ContainedDeps": "icmp4j-1.0.0.jar" // here
])
}
}
but that doesnt work well (caused by same error at first)
here is my current sourcecode. https://github.com/naari3/PingToServer/tree/13bae40aae18cc9e0657826162a4c1ee4ac3ff28
any idea for this?
thanks.