Fetch stylesheets from the correct module (Java 9+)
Fixes GH-395.
This commit is contained in:
parent
f7eb98196d
commit
a96fb2a239
3 changed files with 6 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,11 +1,13 @@
|
|||
# Directories
|
||||
.gradle/
|
||||
.idea/
|
||||
.settings/
|
||||
bin/
|
||||
build/
|
||||
dist/
|
||||
target/
|
||||
testLauncher/
|
||||
run/
|
||||
|
||||
# Files
|
||||
.classpath
|
||||
|
|
|
@ -37,3 +37,5 @@ This changelog only contains the changes that are unreleased. For changes for in
|
|||
- Add in tests to forge/fabric servers for network checker tool
|
||||
- Add in higher timeouts for network calls
|
||||
- Add in CPU and GPU logging to console
|
||||
- Fetch stylesheets and fonts from the correct module, allowing the launcher
|
||||
to run in Java 9 and above. (GH-395)
|
||||
|
|
|
@ -61,7 +61,7 @@ public final class Resources {
|
|||
} else {
|
||||
StyleSheet sheet = new StyleSheet();
|
||||
|
||||
Reader reader = new InputStreamReader(System.class.getResourceAsStream("/assets/css/" + name + ".css"));
|
||||
Reader reader = new InputStreamReader(Resources.class.getResourceAsStream("/assets/css/" + name + ".css"));
|
||||
sheet.loadRules(reader, null);
|
||||
reader.close();
|
||||
|
||||
|
@ -89,7 +89,7 @@ public final class Resources {
|
|||
resources.put(name, f);
|
||||
return f;
|
||||
} else {
|
||||
URL url = System.class.getResource("/assets/font/" + name + ".ttf");
|
||||
URL url = Resources.class.getResource("/assets/font/" + name + ".ttf");
|
||||
if (url == null) {
|
||||
LogManager.error("Cannot find font " + name);
|
||||
return new Font("Sans-Serif", Font.PLAIN, 0);
|
||||
|
|
Loading…
Reference in a new issue