-
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.
more work on changing to a java services system
- Loading branch information
Showing
14 changed files
with
69 additions
and
55 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
19 changes: 19 additions & 0 deletions
19
common/src/main/java/muramasa/antimatter/AntimatterAPIPlatformHelper.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,19 @@ | ||
package muramasa.antimatter; | ||
|
||
import dev.architectury.injectables.annotations.ExpectPlatform; | ||
import muramasa.antimatter.blockentity.BlockEntityMachine; | ||
import muramasa.antimatter.blockentity.pipe.BlockEntityPipe; | ||
import muramasa.antimatter.util.ImplLoader; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
|
||
public interface AntimatterAPIPlatformHelper { | ||
AntimatterAPIPlatformHelper INSTANCE = ImplLoader.load(AntimatterAPIPlatformHelper.class); | ||
|
||
boolean isRegistryEntry(Object object, String domain); | ||
|
||
|
||
void registerTransferApi(BlockEntityType<? extends BlockEntityMachine<?>> type); | ||
|
||
|
||
void registerTransferApiPipe(BlockEntityType<? extends BlockEntityPipe<?>> type); | ||
} |
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
11 changes: 11 additions & 0 deletions
11
common/src/main/java/muramasa/antimatter/util/ImplLoader.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,11 @@ | ||
package muramasa.antimatter.util; | ||
|
||
import java.util.ServiceLoader; | ||
|
||
public class ImplLoader { | ||
public static <T> T load(Class<T> clazz) { | ||
return ServiceLoader.load(clazz) | ||
.findFirst() | ||
.orElseThrow(() -> new NullPointerException("Failed to load service for " + clazz.getName())); | ||
} | ||
} |
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
12 changes: 0 additions & 12 deletions
12
fabric/src/main/java/muramasa/antimatter/client/fabric/RenderHelperImpl.java
This file was deleted.
Oops, something went wrong.
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
fabric/src/main/resources/META-INF/services/muramasa.antimatter.AntimatterAPIPlatformHelper
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.fabric.AntimatterAPIImpl |
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
12 changes: 0 additions & 12 deletions
12
forge/src/main/java/muramasa/antimatter/client/forge/RenderHelperImpl.java
This file was deleted.
Oops, something went wrong.
13 changes: 5 additions & 8 deletions
13
forge/src/main/java/muramasa/antimatter/forge/AntimatterAPIImpl.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.AntimatterAPIPlatformHelper
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.forge.AntimatterAPIImpl |