Skip to content

Commit

Permalink
Hotfix for resource pack issue.
Browse files Browse the repository at this point in the history
See #84
  • Loading branch information
MauveCloud committed Oct 31, 2020
1 parent 52adeed commit 39fb604
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Ic2ExpReactorPlanner/TextureFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ private TextureFactory() { }
// paths within the texture pack zip to check for the texture images.
private static final String[] ASSET_PATHS = {
"",
"/assets/ic2/textures/items/",
"/assets/ic2/textures/items/reactor/",
"/assets/ic2/textures/items/reactor/fuel_rod/",
"/assets/gregtech/textures/items/",
"/assets/fm/textures/items/",
"assets/ic2/textures/items/",
"assets/ic2/textures/items/reactor/",
"assets/ic2/textures/items/reactor/fuel_rod/",
"assets/gregtech/textures/items/",
"assets/fm/textures/items/",
};

public static Image getImage(String... imageNames) {
Expand All @@ -56,8 +56,8 @@ public static Image getImage(String... imageNames) {
}

for (String asset_path : ASSET_PATHS) {
if (result == null && TextureFactory.class.getResource(asset_path + imageNames[0]) != null) {
try (InputStream stream = TextureFactory.class.getResourceAsStream(asset_path + imageNames[0])) {
if (result == null && TextureFactory.class.getResource("/" + asset_path + imageNames[0]) != null) {
try (InputStream stream = TextureFactory.class.getResourceAsStream("/" + asset_path + imageNames[0])) {
result = ImageIO.read(stream);
} catch (IOException ex) {
ExceptionDialogDisplay.showExceptionDialog(ex);
Expand Down

0 comments on commit 39fb604

Please sign in to comment.