#ifdef DEV_ENV is no longer applicable since 8bc0b0a

There is no longer a dedicated "core" project where DEV_ENV would be defined,
instead whichever is the currently selected version automatically becomes the
main project using the main src folder.
This commit is contained in:
Jonas Herzig
2020-03-31 14:07:35 +02:00
parent b69cd9fb81
commit 9e7dc61d20
2 changed files with 11 additions and 19 deletions

View File

@@ -236,14 +236,15 @@ public class ReplayMod implements
}
static { // Note: even preInit is too late and we'd have to issue another resource reload
//#ifdef DEV_ENV
//noinspection ConstantConditions
if (true) {
//#else
//$$ //noinspection ConstantConditions
//$$ if (false) {
//#endif
DirectoryResourcePack jGuiResourcePack = new DirectoryResourcePack(new File("../jGui/src/main/resources")) {
initJGuiResourcePack();
}
private static void initJGuiResourcePack() {
File folder = new File("../jGui/src/main/resources");
if (!folder.exists()) {
return;
}
DirectoryResourcePack jGuiResourcePack = new DirectoryResourcePack(folder) {
@Override
protected InputStream openFile(String resourceName) throws IOException {
try {
@@ -290,7 +291,7 @@ public class ReplayMod implements
//$$ };
//$$ defaultResourcePacks.add(mainResourcePack);
//#endif
}}
}
//#if FABRIC>=1
@Override

View File

@@ -76,16 +76,7 @@ public class Utils {
private static Logger LOGGER = LogManager.getLogger();
private static InputStream getResourceAsStream(String path) {
// FIXME this seems broken in 1.13, hence the workaround. probably want to open an issue with modlauncher (or forge?)
//#ifdef DEV_ENV
try {
return new java.io.FileInputStream(new File("../src/main/resources" + path));
} catch (java.io.FileNotFoundException e) {
throw new RuntimeException(e);
}
//#else
//$$ return Utils.class.getResourceAsStream(path);
//#endif
return Utils.class.getResourceAsStream(path);
}
public static final Image DEFAULT_THUMBNAIL;