-
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.
Fix excursion funnel not animating by default with Sodium
- Loading branch information
Showing
5 changed files
with
48 additions
and
0 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
18 changes: 18 additions & 0 deletions
18
src/main/java/com/fusionflux/portalcubed/compat/sodium/SodiumIntegration.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,18 @@ | ||
package com.fusionflux.portalcubed.compat.sodium; | ||
|
||
import com.fusionflux.portalcubed.compat.sodium.absent.SodiumIntegrationAbsent; | ||
import com.fusionflux.portalcubed.compat.sodium.present.SodiumIntegrationPresent; | ||
import net.minecraft.client.renderer.texture.SpriteContents; | ||
import org.quiltmc.loader.api.QuiltLoader; | ||
|
||
public interface SodiumIntegration { | ||
SodiumIntegration INSTANCE = QuiltLoader.isModLoaded("sodium") ? SodiumPresentHolder.create() : SodiumIntegrationAbsent.INSTANCE; | ||
|
||
void markSpriteActive(SpriteContents sprite); | ||
|
||
class SodiumPresentHolder { | ||
private static SodiumIntegration create() { | ||
return new SodiumIntegrationPresent(); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/fusionflux/portalcubed/compat/sodium/absent/SodiumIntegrationAbsent.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,12 @@ | ||
package com.fusionflux.portalcubed.compat.sodium.absent; | ||
|
||
import com.fusionflux.portalcubed.compat.sodium.SodiumIntegration; | ||
import net.minecraft.client.renderer.texture.SpriteContents; | ||
|
||
public enum SodiumIntegrationAbsent implements SodiumIntegration { | ||
INSTANCE; | ||
|
||
@Override | ||
public void markSpriteActive(SpriteContents sprite) { | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/fusionflux/portalcubed/compat/sodium/present/SodiumIntegrationPresent.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,14 @@ | ||
package com.fusionflux.portalcubed.compat.sodium.present; | ||
|
||
import com.fusionflux.portalcubed.compat.sodium.SodiumIntegration; | ||
import me.jellysquid.mods.sodium.client.render.texture.SpriteExtended; | ||
import net.minecraft.client.renderer.texture.SpriteContents; | ||
|
||
public class SodiumIntegrationPresent implements SodiumIntegration { | ||
@Override | ||
public void markSpriteActive(SpriteContents sprite) { | ||
if (sprite instanceof SpriteExtended extended) { | ||
extended.setActive(true); | ||
} | ||
} | ||
} |