-
Notifications
You must be signed in to change notification settings - Fork 951
Support FRAPI on NeoForge #3818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Su5eD
wants to merge
1
commit into
CaffeineMC:26.1.2/stable
Choose a base branch
from
Su5eD:26.1.2/neo-frapi
base: 26.1.2/stable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
14 changes: 0 additions & 14 deletions
14
common/src/main/java/net/caffeinemc/mods/sodium/client/services/FRAPIProvider.java
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
common/src/main/java/net/caffeinemc/mods/sodium/client/services/FRAPIRegistrar.java
This file contains hidden or 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,14 @@ | ||
| package net.caffeinemc.mods.sodium.client.services; | ||
|
|
||
| public interface FRAPIRegistrar { | ||
| FRAPIRegistrar INSTANCE = Services.loadConditionalOr(FRAPIRegistrarProvider.class, () -> () -> {}); // Returns a no-op implementation if the platform does not support FRAPI | ||
|
|
||
| static FRAPIRegistrar getInstance() { | ||
| return INSTANCE; | ||
| } | ||
|
|
||
| /** | ||
| * Registers the FRAPI provider. This should only be called once, and should be called during mod initialization. | ||
| */ | ||
| void register(); | ||
| } |
4 changes: 4 additions & 0 deletions
4
common/src/main/java/net/caffeinemc/mods/sodium/client/services/FRAPIRegistrarProvider.java
This file contains hidden or 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,4 @@ | ||
| package net.caffeinemc.mods.sodium.client.services; | ||
|
|
||
| public interface FRAPIRegistrarProvider extends ServiceProvider<FRAPIRegistrar> { | ||
| } |
This file contains hidden or 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
4 changes: 4 additions & 0 deletions
4
...rc/main/java/net/caffeinemc/mods/sodium/client/services/PlatformModelEmitterProvider.java
This file contains hidden or 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,4 @@ | ||
| package net.caffeinemc.mods.sodium.client.services; | ||
|
|
||
| public interface PlatformModelEmitterProvider extends ServiceProvider<PlatformModelEmitter> { | ||
| } |
7 changes: 7 additions & 0 deletions
7
common/src/main/java/net/caffeinemc/mods/sodium/client/services/ServiceProvider.java
This file contains hidden or 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,7 @@ | ||
| package net.caffeinemc.mods.sodium.client.services; | ||
|
|
||
| public interface ServiceProvider<T> { | ||
| boolean isEnabled(); | ||
|
|
||
| T get(); | ||
| } |
This file contains hidden or 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 hidden or 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
18 changes: 18 additions & 0 deletions
18
frapi/src/main/java/net/caffeinemc/mods/sodium/client/render/frapi/FRAPIEmitterProvider.java
This file contains hidden or 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,18 @@ | ||
| package net.caffeinemc.mods.sodium.client.render.frapi; | ||
|
|
||
| import net.caffeinemc.mods.sodium.client.services.PlatformModelEmitter; | ||
| import net.caffeinemc.mods.sodium.client.services.PlatformModelEmitterProvider; | ||
| import net.caffeinemc.mods.sodium.client.services.PlatformRuntimeInformation; | ||
|
|
||
| public class FRAPIEmitterProvider implements PlatformModelEmitterProvider { | ||
| @Override | ||
| public boolean isEnabled() { | ||
| return PlatformRuntimeInformation.getInstance().isModInLoadingList("fabric-renderer-api-v1") | ||
| || PlatformRuntimeInformation.getInstance().isModInLoadingList("fabric_renderer_api_v1"); | ||
| } | ||
|
|
||
| @Override | ||
| public PlatformModelEmitter get() { | ||
| return new FRAPIEmitter(); | ||
| } | ||
| } | ||
5 changes: 2 additions & 3 deletions
5
...m/client/render/frapi/SodiumProvider.java → .../client/render/frapi/SodiumRegistrar.java
This file contains hidden or 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
18 changes: 18 additions & 0 deletions
18
...src/main/java/net/caffeinemc/mods/sodium/client/render/frapi/SodiumRegistrarProvider.java
This file contains hidden or 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,18 @@ | ||
| package net.caffeinemc.mods.sodium.client.render.frapi; | ||
|
|
||
| import net.caffeinemc.mods.sodium.client.services.FRAPIRegistrar; | ||
| import net.caffeinemc.mods.sodium.client.services.FRAPIRegistrarProvider; | ||
| import net.caffeinemc.mods.sodium.client.services.PlatformRuntimeInformation; | ||
|
|
||
| public class SodiumRegistrarProvider implements FRAPIRegistrarProvider { | ||
| @Override | ||
| public boolean isEnabled() { | ||
| return PlatformRuntimeInformation.getInstance().isModInLoadingList("fabric-renderer-api-v1") | ||
| || PlatformRuntimeInformation.getInstance().isModInLoadingList("fabric_renderer_api_v1"); | ||
| } | ||
|
|
||
| @Override | ||
| public FRAPIRegistrar get() { | ||
| return new SodiumRegistrar(); | ||
| } | ||
| } |
1 change: 0 additions & 1 deletion
1
...main/resources/META-INF/services/net.caffeinemc.mods.sodium.client.services.FRAPIProvider
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...urces/META-INF/services/net.caffeinemc.mods.sodium.client.services.FRAPIRegistrarProvider
This file contains hidden or 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 @@ | ||
| net.caffeinemc.mods.sodium.client.render.frapi.SodiumRegistrarProvider |
1 change: 0 additions & 1 deletion
1
...sources/META-INF/services/net.caffeinemc.mods.sodium.client.services.PlatformModelEmitter
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...META-INF/services/net.caffeinemc.mods.sodium.client.services.PlatformModelEmitterProvider
This file contains hidden or 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 @@ | ||
| net.caffeinemc.mods.sodium.client.render.frapi.FRAPIEmitterProvider |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.