Fix some iris issues on Neoforge
This commit is contained in:
@@ -65,6 +65,10 @@ dependencies {
|
||||
|
||||
// Neoforge
|
||||
neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}"
|
||||
|
||||
// Iris
|
||||
addMod("maven.modrinth:iris:${rootProject.neo_iris_version}", rootProject.neo_enable_iris)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,10 +31,12 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftRen
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IPluginPacketSender;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IServerPlayerWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IC2meAccessor;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IIrisAccessor;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IModChecker;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IOptifineAccessor;
|
||||
import com.seibel.distanthorizons.coreapi.ModInfo;
|
||||
import com.seibel.distanthorizons.neoforge.wrappers.modAccessor.C2meAccessor;
|
||||
import com.seibel.distanthorizons.neoforge.wrappers.modAccessor.IrisAccessor;
|
||||
import com.seibel.distanthorizons.neoforge.wrappers.NeoforgeMinecraftRenderWrapper;
|
||||
import com.seibel.distanthorizons.neoforge.wrappers.modAccessor.ModChecker;
|
||||
import com.seibel.distanthorizons.neoforge.wrappers.modAccessor.OptifineAccessor;
|
||||
@@ -148,6 +150,11 @@ public class NeoforgeMain extends AbstractModInitializer
|
||||
this.tryCreateModCompatAccessor("optifine", IOptifineAccessor.class, OptifineAccessor::new);
|
||||
this.tryCreateModCompatAccessor("c2me", IC2meAccessor.class, C2meAccessor::new);
|
||||
|
||||
#if MC_VER >= MC_1_20_6
|
||||
// 1.20.6 is the lowest version Iris supports Neoforge
|
||||
this.tryCreateModCompatAccessor("iris", IIrisAccessor.class, IrisAccessor::new);
|
||||
#endif
|
||||
|
||||
#if MC_VER < MC_1_20_6
|
||||
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class,
|
||||
() -> new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> GetConfigScreen.getScreen(parent)));
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* This file is part of the Distant Horizons mod
|
||||
* licensed under the GNU LGPL v3 License.
|
||||
*
|
||||
* Copyright (C) 2020 James Seibel
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, version 3.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.seibel.distanthorizons.neoforge.wrappers.modAccessor;
|
||||
|
||||
// 1.20.6 is the lowest version Iris supports Neoforge
|
||||
#if MC_VER >= MC_1_20_6
|
||||
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IIrisAccessor;
|
||||
|
||||
#if MC_VER != MC_1_21_9
|
||||
import net.irisshaders.iris.Iris;
|
||||
import net.irisshaders.iris.api.v0.IrisApi;
|
||||
#endif
|
||||
|
||||
public class IrisAccessor implements IIrisAccessor
|
||||
{
|
||||
@Override
|
||||
public String getModName()
|
||||
{
|
||||
#if MC_VER == MC_1_21_9
|
||||
return "iris"; // Iris doesn't support this MC version
|
||||
#else
|
||||
return Iris.MODID;
|
||||
#endif
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShaderPackInUse()
|
||||
{
|
||||
#if MC_VER == MC_1_21_9
|
||||
return true; // Iris doesn't support this MC version
|
||||
#else
|
||||
return IrisApi.getInstance().isShaderPackInUse();
|
||||
#endif
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRenderingShadowPass()
|
||||
{
|
||||
#if MC_VER == MC_1_21_9
|
||||
return false; // Iris doesn't support this MC version
|
||||
#else
|
||||
return IrisApi.getInstance().isRenderingShadowPass();
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user