forked from DM-Earth/Cabricality
-
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.
- Loading branch information
Showing
8 changed files
with
66 additions
and
28 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
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
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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/dm/earth/cabricality/util/mod/CabfModConflict.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,32 @@ | ||
package com.dm.earth.cabricality.util.mod; | ||
|
||
import java.util.stream.Stream; | ||
import org.quiltmc.loader.api.QuiltLoader; | ||
|
||
public enum CabfModConflict { | ||
ESSENTIAL("essential-loader"); | ||
|
||
final String modId; | ||
|
||
CabfModConflict(String modId) { | ||
this.modId = modId; | ||
} | ||
|
||
public String getModId() { | ||
return modId; | ||
} | ||
|
||
public boolean isLoaded() { | ||
return QuiltLoader.isModLoaded(modId); | ||
} | ||
|
||
public static boolean isAnyLoaded() { | ||
return Stream.of(values()).anyMatch(CabfModConflict::isLoaded); | ||
} | ||
|
||
public static void checkAndExit() { | ||
if (isAnyLoaded()) { | ||
System.exit(6); | ||
} | ||
} | ||
} |
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