Render engine validation cleanup and 26.2.0 prep
This commit is contained in:
@@ -6,6 +6,7 @@ import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiBeforeD
|
||||
import com.seibel.distanthorizons.common.commands.CommandInitializer;
|
||||
import com.seibel.distanthorizons.common.wrappers.DependencySetup;
|
||||
import com.seibel.distanthorizons.common.wrappers.gui.DhDebugScreenEntry;
|
||||
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftClientWrapper;
|
||||
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftServerWrapper;
|
||||
import com.seibel.distanthorizons.core.Initializer;
|
||||
import com.seibel.distanthorizons.core.api.internal.ClientApi;
|
||||
@@ -262,6 +263,8 @@ public abstract class AbstractModInitializer
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
NativeDialogUtil.showDialog(ModInfo.READABLE_NAME, e.getMessage(), "ok", "error");
|
||||
MinecraftClientWrapper.INSTANCE.crashMinecraft(e.getMessage(), e);
|
||||
future.completeExceptionally(e);
|
||||
}
|
||||
finally
|
||||
|
||||
+3
-1
@@ -50,8 +50,10 @@ public class MixinImmersivePortalsRenderStatesCommon
|
||||
// camera pos
|
||||
#if MC_VER <= MC_1_21_10
|
||||
Vec3 cameraPos = mc.gameRenderer.getMainCamera().getPosition();
|
||||
#else
|
||||
#elif MC_VER <= MC_26_1_2
|
||||
Vec3 cameraPos = mc.gameRenderer.getMainCamera().position();
|
||||
#else
|
||||
Vec3 cameraPos = mc.gameRenderer.mainCamera().position();
|
||||
#endif
|
||||
AbstractImmersivePortalsAccessorCommon.actualCameraPos = new DhVec3d(cameraPos.x(), cameraPos.y(), cameraPos.z());
|
||||
}
|
||||
|
||||
+4
-5
@@ -6,7 +6,6 @@ public class BlazeDhRenderApiDefinition {}
|
||||
#else
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingApi;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
|
||||
import com.seibel.distanthorizons.common.render.blaze.objects.BlazeGenericObjectVertexContainer;
|
||||
import com.seibel.distanthorizons.common.render.blaze.postProcessing.BlazeDhFarFadeRenderer;
|
||||
import com.seibel.distanthorizons.common.render.blaze.postProcessing.BlazeDhFogRenderer;
|
||||
@@ -35,8 +34,8 @@ public class BlazeDhRenderApiDefinition extends AbstractDhRenderApiDefinition
|
||||
//=========//
|
||||
//region
|
||||
|
||||
private final String apiName;
|
||||
public String getApiName() { return this.apiName; }
|
||||
private final String engineName;
|
||||
public String getEngineName() { return this.engineName; }
|
||||
|
||||
public EDhRenderDepth getRenderDepth()
|
||||
{
|
||||
@@ -66,11 +65,11 @@ public class BlazeDhRenderApiDefinition extends AbstractDhRenderApiDefinition
|
||||
#if MC_VER <= MC_26_1_2
|
||||
renderApi = EDhApiRenderingApi.OPEN_GL;
|
||||
#else
|
||||
// use the same rendering API as Minecraft
|
||||
// Blaze always uses the same rendering API as Minecraft
|
||||
this.renderApi = MinecraftRenderWrapper.INSTANCE.getMcRenderingApi();
|
||||
#endif
|
||||
|
||||
this.apiName = "Blaze3D: " + this.getRenderApi();
|
||||
this.engineName = "Blaze3D: " + this.getRenderApi();
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
+1
@@ -16,6 +16,7 @@ import com.seibel.distanthorizons.common.render.blaze.wrappers.uniform.BlazeUnif
|
||||
import com.seibel.distanthorizons.core.logging.DhLogger;
|
||||
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalDouble;
|
||||
import java.util.OptionalInt;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class GlDhRenderApiDefinition extends AbstractDhRenderApiDefinition
|
||||
//=========//
|
||||
//region
|
||||
|
||||
public String getApiName() { return "OpenGL"; }
|
||||
public String getEngineName() { return "OpenGL"; }
|
||||
|
||||
public EDhRenderDepth getRenderDepth()
|
||||
{
|
||||
|
||||
+3
-3
@@ -134,7 +134,7 @@ public class DependencySetup
|
||||
// crash if an invalid API is set
|
||||
if (!validApi)
|
||||
{
|
||||
String message = "["+renderingApiEnum+"] is not supported on this version of Minecraft, reverting to ["+ EDhApiRenderingEngine.AUTO+"].";
|
||||
String message = "The Distant Horizons rendering engine ["+renderDefinition.getEngineName()+"]-["+renderingApiEnum+"] is not supported with this Minecraft config, reverting to ["+ EDhApiRenderingEngine.AUTO+"].";
|
||||
LOGGER.fatal(message);
|
||||
Config.Client.Advanced.Graphics.Experimental.renderingEngine.set(EDhApiRenderingEngine.AUTO);
|
||||
throw new IllegalStateException(message);
|
||||
@@ -144,14 +144,14 @@ public class DependencySetup
|
||||
EDhApiRenderingApi mcRenderApi = MinecraftRenderWrapper.INSTANCE.getMcRenderingApi();
|
||||
if (mcRenderApi != renderDefinition.getRenderApi())
|
||||
{
|
||||
String message = "["+renderDefinition.getApiName()+"] cannot be used due to it's API ["+renderDefinition.getRenderApi().name()+"] not matching what Minecraft is currently set to use. Please either change Minecraft's rendering API or Distant Horizons'.";
|
||||
String message = "The Distant Horizons rendering engine ["+renderDefinition.getEngineName()+"]-["+renderDefinition.getRenderApi().name()+"] cannot be used since it's API doesn't match what Minecraft is currently set to use ["+mcRenderApi.name()+"]. Please either change Minecraft's rendering API or Distant Horizons'.";
|
||||
LOGGER.fatal(message);
|
||||
throw new IllegalStateException(message);
|
||||
}
|
||||
|
||||
|
||||
renderDefinition.bindRenderers();
|
||||
LOGGER.info("DH Rendering successfully bound to: ["+renderDefinition.getApiName()+"]...");
|
||||
LOGGER.info("DH Rendering successfully bound to: ["+renderDefinition.getEngineName()+"]...");
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-1
@@ -400,9 +400,12 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
float frameTime = this.getPartialTickTime();
|
||||
int argbColorInt = MC.level.getSkyColor(MC.gameRenderer.getMainCamera().getPosition(), frameTime);
|
||||
return ColorUtil.toColorObjARGB(argbColorInt);
|
||||
#else
|
||||
#elif MC_VER <= MC_26_1_2
|
||||
int argbColor = MC.level.environmentAttributes().getValue(EnvironmentAttributes.SKY_COLOR, MC.gameRenderer.getMainCamera().position());
|
||||
return new Color(ColorUtil.getRed(argbColor), ColorUtil.getGreen(argbColor), ColorUtil.getBlue(argbColor), 255 /* ignore alpha since DH clouds don't render correctly with transparency */);
|
||||
#else
|
||||
int argbColor = MC.level.environmentAttributes().getValue(EnvironmentAttributes.SKY_COLOR, MC.gameRenderer.mainCamera().position());
|
||||
return new Color(ColorUtil.getRed(argbColor), ColorUtil.getGreen(argbColor), ColorUtil.getBlue(argbColor), 255 /* ignore alpha since DH clouds don't render correctly with transparency */);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
||||
+1
-1
Submodule coreSubProjects updated: 4ac56774fb...4f0a3afd93
@@ -1,8 +1,8 @@
|
||||
# 26.2.0 version
|
||||
java_version=25
|
||||
minecraft_version=26.2-snapshot-7
|
||||
minecraft_version=26.2-pre-3
|
||||
parchment_version=1.21:2024.07.28
|
||||
compatible_minecraft_versions=["26.2.0","26.2-alpha.7"]
|
||||
compatible_minecraft_versions=["26.2.0","26.2-pre.3"]
|
||||
accessWidenerVersion=26_1
|
||||
builds_for=fabric
|
||||
#,neoforge
|
||||
|
||||
Reference in New Issue
Block a user