Add oculus api implementation

This commit is contained in:
James Seibel
2026-05-02 12:43:43 -05:00
parent 852ea75449
commit ae0f3c2b3b
10 changed files with 44 additions and 10 deletions
+5 -2
View File
@@ -18,10 +18,13 @@ def addMod(path, enabled) {
dependencies {
// TerraForged
addMod("curse.maven:TerraForged-363820:${rootProject.terraforged_version}", rootProject.enable_terraforged)
// TerraFirmaCraft
addMod("curse.maven:TerraFirmaCraft-302973:4616004", rootProject.enable_terrafirmacraft)
// Oculus (Iris port)
addMod("maven.modrinth:oculus:${rootProject.oculus_version}", rootProject.enable_oculus)
// TODO: Check if this is still needed and if so ensure this code works for MC 26.1+
// (potential) hack fix for MC 1.20.6 and later, force jopt-simple to be exactly 5.0.4 because Mojang ships that version, but some transitive dependencies request 6.0+
def mcParts = rootProject.minecraft_version.split("\\.")
@@ -23,35 +23,50 @@ import com.seibel.distanthorizons.core.logging.DhLogger;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IIrisAccessor;
#if MC_VER == MC_1_20_1
import net.irisshaders.iris.Iris;
import net.irisshaders.iris.api.v0.IrisApi;
#else
#endif
public class OculusAccessor implements IIrisAccessor
{
protected static final DhLogger LOGGER = new DhLoggerBuilder().build();
public OculusAccessor()
{
LOGGER.warn("Partial Oculus support enabled. Some DH features may be disabled or behave strangely, use Iris instead if possible.");
}
{ LOGGER.warn("Partial Oculus support enabled. Some DH features may be disabled or behave strangely, use Iris instead if possible."); }
@Override
public String getModName()
{
return "oculus";
#if MC_VER == MC_1_20_1
return Iris.MODID;
#else
return "iris"; // Oculus doesn't support this MC version
#endif
}
@Override
public boolean isShaderPackInUse()
{
// assume shaders are always active
return true;
#if MC_VER == MC_1_20_1
return IrisApi.getInstance().isShaderPackInUse();
#else
return true; // Oculus doesn't support this MC version
#endif
}
@Override
public boolean isRenderingShadowPass()
{
return false;
#if MC_VER == MC_1_20_1
return IrisApi.getInstance().isRenderingShadowPass();
#else
return false; // Oculus doesn't support this MC version
#endif
}
}