-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
started work changing from expect platform to java services
- Loading branch information
Showing
7 changed files
with
18 additions
and
11 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
11 changes: 6 additions & 5 deletions
11
common/src/main/java/muramasa/antimatter/util/AntimatterPreLaunchUtil.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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package muramasa.antimatter.util; | ||
|
||
import dev.architectury.injectables.annotations.ExpectPlatform; | ||
import tesseract.TesseractCapUtils; | ||
|
||
public class AntimatterPreLaunchUtil { | ||
@ExpectPlatform | ||
public static boolean isModLoaded(String modid){ | ||
throw new AssertionError(); | ||
} | ||
import java.util.ServiceLoader; | ||
|
||
public interface AntimatterPreLaunchUtil { | ||
AntimatterPreLaunchUtil INSTANCE = ServiceLoader.load(AntimatterPreLaunchUtil.class).findFirst().orElseThrow(() -> new IllegalStateException("No implementation of AntimatterPreLaunchUtil found")); | ||
boolean isModLoaded(String modid); | ||
} |
6 changes: 4 additions & 2 deletions
6
fabric/src/main/java/muramasa/antimatter/util/fabric/AntimatterPreLaunchUtilImpl.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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
package muramasa.antimatter.util.fabric; | ||
|
||
import muramasa.antimatter.util.AntimatterPreLaunchUtil; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
|
||
public class AntimatterPreLaunchUtilImpl { | ||
public static boolean isModLoaded(String modid){ | ||
public class AntimatterPreLaunchUtilImpl implements AntimatterPreLaunchUtil { | ||
@Override | ||
public boolean isModLoaded(String modid){ | ||
return FabricLoader.getInstance().isModLoaded(modid); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
fabric/src/main/resources/META-INF/services/muramasa.antimatter.util.AntimatterPreLaunchUtil
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 @@ | ||
muramasa.antimatter.util.fabric.AntimatterPreLaunchUtilImpl |
6 changes: 4 additions & 2 deletions
6
forge/src/main/java/muramasa/antimatter/util/forge/AntimatterPreLaunchUtilImpl.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
1 change: 1 addition & 0 deletions
1
forge/src/main/resources/META-INF/services/muramasa.antimatter.util.AntimatterPreLaunchUtil
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 @@ | ||
muramasa.antimatter.util.forge.AntimatterPreLaunchUtilImpl |