-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
actually let quartz be loaded without forge
- Loading branch information
1 parent
4c98c0d
commit 077a68f
Showing
4 changed files
with
45 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/net/roguelogix/quartz/internal/QuartzDebug.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package net.roguelogix.quartz.internal; | ||
|
||
import net.minecraftforge.data.loading.DatagenModLoader; | ||
import net.minecraftforge.fml.loading.FMLLoader; | ||
import net.roguelogix.quartz.QuartzConfig; | ||
|
||
public class QuartzDebug { | ||
public static final boolean DEBUG; | ||
|
||
static { | ||
if (!doesForgeExist() || runningDatagen()) { | ||
DEBUG = false; | ||
} else { | ||
DEBUG = QuartzConfig.INSTANCE.debug; | ||
} | ||
} | ||
|
||
public static boolean runningDatagen(){ | ||
try{ | ||
return DatagenModLoader.isRunningDataGen(); | ||
} catch (Throwable e){ | ||
return false; | ||
} | ||
} | ||
|
||
public static boolean doesForgeExist(){ | ||
try{ | ||
return FMLLoader.getLoadingModList() != null; | ||
} catch (Throwable e){ | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters