Skip to content

Commit a206728

Browse files
committed
Updating logo resource path and retrieval + publishing new prebuilt jar
1 parent cceb4f2 commit a206728

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Running the client can be done either with the pre-built client JAR file or by b
1212

1313
Running the pre-built client requires having Java installed: https://www.java.com/en/
1414

15-
Once installed, go into the `/prebuilt/` and simply double-click the JAR file to run it. Alternatively, if double clicking the JAR does not work, you can use the command `java -jar client-435.jar` from the `/prebuilt/` directory.
15+
Once installed, go into the `/prebuilt/` and simply double-click the JAR file to run it. Alternatively if executing the JAR does not work, the command `java -jar client-435-0.2.jar` may be used from within the `/prebuilt/` directory.
1616

1717
The client will use a set of default configurations if no file is provided. The default client configuration matches up to the default RuneJS server configuration for quick and easy initial setup. It's highly advised that you generate your own RSA public and private keys for long term use.
1818

@@ -62,5 +62,5 @@ The `jar` task can be used to build a jar, which is generated in the `build/libs
6262
6363
```
6464
./gradlew jar
65-
java -jar ./build/libs/client-435-0.1.jar
65+
java -jar ./build/libs/client-435-0.2.jar
6666
```

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = 'tech.henning'
7-
version = '0.1'
7+
version = '0.2'
88

99
sourceCompatibility = 8
1010
targetCompatibility = 8
@@ -26,6 +26,7 @@ jar {
2626

2727
from {
2828
sourceSets.main.output
29+
sourceSets.main.resources
2930
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
3031
}
3132
}

prebuilt/client-435-0.1.jar

-987 KB
Binary file not shown.

prebuilt/client-435-0.2.jar

996 KB
Binary file not shown.

src/main/java/org/runejs/whitelabel/Images.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
import java.awt.image.WritableRaster;
66
import java.io.ByteArrayOutputStream;
77
import java.io.File;
8+
import java.io.FileInputStream;
9+
import java.io.InputStream;
10+
import java.net.URL;
811
import java.util.Base64;
912

13+
import jdk.internal.loader.Resource;
1014
import org.runejs.client.cache.media.ImageRGB;
1115
import org.runejs.client.input.MouseHandler;
1216

@@ -31,8 +35,12 @@ public static ImageRGB GetPart(String part) {
3135

3236
private static void CreateParts() {
3337
try {
34-
File imgPath = new File("./data/logo.png");
35-
BufferedImage bufferedImage = ImageIO.read(imgPath);
38+
String classResource = Images.class.getResource("Images.class").toString();
39+
System.out.println(classResource);
40+
InputStream resource = Images.class.getClassLoader().getResourceAsStream("logo.png");
41+
System.out.println(resource);
42+
BufferedImage bufferedImage = ImageIO.read(resource);
43+
3644

3745
ByteArrayOutputStream baos = new ByteArrayOutputStream();
3846
ImageIO.write(bufferedImage, "png", baos);
File renamed without changes.

0 commit comments

Comments
 (0)