Disable blaze api for old MC versions

This commit is contained in:
James Seibel
2026-03-10 18:46:49 -05:00
parent d73867efd6
commit 3d1af8f944
25 changed files with 147 additions and 5 deletions
@@ -19,6 +19,11 @@
package com.seibel.distanthorizons.common.render.blaze;
#if MC_VER <= MC_1_21_10
public class BlazeDebugWireframeRenderer {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.buffers.Std140Builder;
@@ -322,3 +327,4 @@ public class BlazeDebugWireframeRenderer extends AbstractDebugWireframeRenderer
}
#endif
@@ -19,6 +19,11 @@
package com.seibel.distanthorizons.common.render.blaze;
#if MC_VER <= MC_1_21_10
public class BlazeDhGenericObjectRenderer {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.buffers.Std140Builder;
@@ -622,3 +627,4 @@ public class BlazeDhGenericObjectRenderer implements IDhGenericRenderer
}
#endif
@@ -1,5 +1,10 @@
package com.seibel.distanthorizons.common.render.blaze;
#if MC_VER <= MC_1_21_10
public class BlazeDhMetaRenderer {}
#else
import com.mojang.blaze3d.textures.GpuTexture;
import com.seibel.distanthorizons.common.render.blaze.apply.BlazeDhApplyRenderer;
import com.seibel.distanthorizons.common.render.blaze.wrappers.texture.BlazeTextureWrapper;
@@ -86,3 +91,4 @@ public class BlazeDhMetaRenderer implements IDhMetaRenderer
}
#endif
@@ -1,5 +1,10 @@
package com.seibel.distanthorizons.common.render.blaze;
#if MC_VER <= MC_1_21_10
public class BlazeDhRenderApiDefinition {}
#else
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;
@@ -63,3 +68,4 @@ public class BlazeDhRenderApiDefinition extends AbstractDhRenderApiDefinition
}
#endif
@@ -1,5 +1,9 @@
package com.seibel.distanthorizons.common.render.blaze;
#if MC_VER <= MC_1_21_10
public class BlazeDhTerrainRenderer {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
@@ -387,3 +391,4 @@ public class BlazeDhTerrainRenderer implements IDhTerrainRenderer
}
#endif
@@ -19,6 +19,11 @@
package com.seibel.distanthorizons.common.render.blaze.apply;
#if MC_VER <= MC_1_21_10
public class BlazeDhApplyRenderer {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.pipeline.BlendFunction;
import com.mojang.blaze3d.pipeline.RenderPipeline;
@@ -260,3 +265,4 @@ public class BlazeDhApplyRenderer
}
#endif
@@ -19,6 +19,11 @@
package com.seibel.distanthorizons.common.render.blaze.apply;
#if MC_VER <= MC_1_21_10
public class BlazeDhCopyRenderer {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.pipeline.RenderPipeline;
import com.mojang.blaze3d.platform.DepthTestFunction;
@@ -157,3 +162,4 @@ public class BlazeDhCopyRenderer
}
#endif
@@ -1,5 +1,10 @@
package com.seibel.distanthorizons.common.render.blaze.objects;
#if MC_VER <= MC_1_21_10
public class BlazeGenericObjectVertexContainer {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.systems.CommandEncoder;
@@ -277,3 +282,4 @@ public class BlazeGenericObjectVertexContainer implements IDhGenericObjectVertex
}
#endif
@@ -19,6 +19,11 @@
package com.seibel.distanthorizons.common.render.blaze.postProcessing;
#if MC_VER <= MC_1_21_10
public class BlazeDhFarFadeRenderer {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.buffers.Std140Builder;
@@ -227,3 +232,4 @@ public class BlazeDhFarFadeRenderer implements IDhFarFadeRenderer
}
#endif
@@ -19,6 +19,11 @@
package com.seibel.distanthorizons.common.render.blaze.postProcessing;
#if MC_VER <= MC_1_21_10
public class BlazeDhFogRenderer {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.buffers.Std140Builder;
@@ -355,3 +360,4 @@ public class BlazeDhFogRenderer implements IDhFogRenderer
}
#endif
@@ -19,6 +19,11 @@
package com.seibel.distanthorizons.common.render.blaze.postProcessing;
#if MC_VER <= MC_1_21_10
public class BlazeDhSsaoRenderer {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.buffers.Std140Builder;
@@ -275,3 +280,4 @@ public class BlazeDhSsaoRenderer implements IDhSsaoRenderer
}
#endif
@@ -19,6 +19,11 @@
package com.seibel.distanthorizons.common.render.blaze.postProcessing;
#if MC_VER <= MC_1_21_10
public class BlazeVanillaFadeRenderer {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.buffers.Std140Builder;
@@ -254,3 +259,4 @@ public class BlazeVanillaFadeRenderer implements IDhVanillaFadeRenderer
}
#endif
@@ -19,6 +19,11 @@
package com.seibel.distanthorizons.common.render.blaze.test;
#if MC_VER <= MC_1_21_10
public class BlazeDhTestTriangleRenderer {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.pipeline.RenderPipeline;
@@ -184,3 +189,4 @@ public class BlazeDhTestTriangleRenderer implements IDhTestTriangleRenderer
}
#endif
@@ -1,5 +1,10 @@
package com.seibel.distanthorizons.common.render.blaze.util;
#if MC_VER <= MC_1_21_10
public class BlazeDhVertexFormatUtil {}
#else
import com.mojang.blaze3d.vertex.VertexFormatElement;
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi;
import com.seibel.distanthorizons.core.config.Config;
@@ -97,3 +102,4 @@ public class BlazeDhVertexFormatUtil
}
#endif
@@ -1,5 +1,10 @@
package com.seibel.distanthorizons.common.render.blaze.util;
#if MC_VER <= MC_1_21_10
public class BlazePostProcessUtil {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.systems.CommandEncoder;
@@ -73,3 +78,4 @@ public class BlazePostProcessUtil
}
#endif
@@ -1,5 +1,10 @@
package com.seibel.distanthorizons.common.render.blaze.util;
#if MC_VER <= MC_1_21_10
public class BlazeUniformUtil {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.systems.CommandEncoder;
import com.mojang.blaze3d.systems.GpuDevice;
@@ -30,3 +35,4 @@ public class BlazeUniformUtil
}
#endif
@@ -1,5 +1,10 @@
package com.seibel.distanthorizons.common.render.blaze.wrappers.buffer;
#if MC_VER <= MC_1_21_10
public class BlazeVertexBufferWrapper {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.systems.CommandEncoder;
@@ -82,3 +87,4 @@ public class BlazeVertexBufferWrapper implements IVertexBufferWrapper
}
#endif
@@ -1,5 +1,10 @@
package com.seibel.distanthorizons.common.render.blaze.wrappers.texture;
#if MC_VER <= MC_1_21_10
public class BlazeTextureViewWrapper {}
#else
import com.mojang.blaze3d.systems.CommandEncoder;
import com.mojang.blaze3d.systems.GpuDevice;
import com.mojang.blaze3d.systems.RenderSystem;
@@ -64,3 +69,4 @@ public class BlazeTextureViewWrapper
}
#endif
@@ -1,5 +1,10 @@
package com.seibel.distanthorizons.common.render.blaze.wrappers.texture;
#if MC_VER <= MC_1_21_10
public class BlazeTextureWrapper {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.systems.CommandEncoder;
import com.mojang.blaze3d.systems.GpuDevice;
@@ -159,3 +164,4 @@ public class BlazeTextureWrapper
}
#endif
@@ -1,5 +1,10 @@
package com.seibel.distanthorizons.common.render.blaze.wrappers.uniform;
#if MC_VER <= MC_1_21_10
public class BlazeLodUniformBufferWrapper {}
#else
import com.mojang.blaze3d.buffers.Std140Builder;
import com.mojang.blaze3d.buffers.Std140SizeCalculator;
import com.seibel.distanthorizons.core.dataObjects.render.bufferBuilding.LodBufferContainer;
@@ -68,3 +73,4 @@ public class BlazeLodUniformBufferWrapper extends BlazeUniformBufferWrapper impl
//endregion
}
#endif
@@ -1,5 +1,10 @@
package com.seibel.distanthorizons.common.render.blaze.wrappers.uniform;
#if MC_VER <= MC_1_21_10
public class BlazeUniformBufferWrapper {}
#else
import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.systems.CommandEncoder;
@@ -122,3 +127,4 @@ public class BlazeUniformBufferWrapper implements IUniformBufferWrapper
}
#endif
@@ -101,7 +101,11 @@ public class DependencySetup
}
else if (renderingApiEnum == EDhApiRenderApi.BLAZE_3D)
{
#if MC_VER <= MC_1_21_10
throw new IllegalStateException("["+renderingApiEnum+"] is not supported on this version of Minecraft.");
#else
renderDefinition = new BlazeDhRenderApiDefinition();
#endif
}
else
{
@@ -25,13 +25,10 @@ import java.util.concurrent.ConcurrentHashMap;
import com.mojang.blaze3d.pipeline.RenderTarget;
import com.mojang.blaze3d.platform.NativeImage;
import com.mojang.blaze3d.textures.GpuTexture;
import com.seibel.distanthorizons.api.enums.config.EDhApiLodShading;
import com.seibel.distanthorizons.common.wrappers.McObjectConverter;
import com.seibel.distanthorizons.common.wrappers.misc.LightMapWrapper;
import com.seibel.distanthorizons.core.api.internal.ClientApi;
import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector;
import com.seibel.distanthorizons.core.enums.EDhDirection;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
@@ -88,6 +85,7 @@ import com.mojang.blaze3d.opengl.GlTexture;
#if MC_VER <= MC_1_21_10
#else
import net.minecraft.world.attribute.EnvironmentAttributes;
import com.mojang.blaze3d.textures.GpuTexture;
#endif
/**
@@ -489,6 +487,9 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
LightMapWrapper wrapper = this.lightmapByDimensionType.computeIfAbsent(dimensionType, (dimType) -> new LightMapWrapper());
wrapper.setLightmapId(tetxureId);
}
#if MC_VER <= MC_1_21_10
#else
public void setLightmapGpuTexture(GpuTexture gpuTexture, IClientLevelWrapper level)
{
// Using ClientLevelWrapper as the key would be better, but we don't have a consistent way to create the same
@@ -499,6 +500,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
LightMapWrapper wrapper = this.lightmapByDimensionType.computeIfAbsent(dimensionType, (dimType) -> new LightMapWrapper());
wrapper.setLightmapGpuTexture(gpuTexture);
}
#endif
@Override
public float getShade(EDhDirection lodDirection)
@@ -20,7 +20,6 @@
package com.seibel.distanthorizons.common.wrappers.misc;
import com.mojang.blaze3d.platform.NativeImage;
import com.mojang.blaze3d.textures.GpuTexture;
import com.seibel.distanthorizons.common.render.blaze.wrappers.texture.BlazeTextureViewWrapper;
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftGLWrapper;
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
@@ -33,6 +32,11 @@ import java.nio.ByteBuffer;
#else
#endif
#if MC_VER <= MC_1_21_10
#else
import com.mojang.blaze3d.textures.GpuTexture;
#endif
public class LightMapWrapper implements ILightMapWrapper
{
private static final MinecraftGLWrapper GLMC = MinecraftGLWrapper.INSTANCE;
@@ -46,7 +50,11 @@ public class LightMapWrapper implements ILightMapWrapper
private int textureId = 0;
#if MC_VER <= MC_1_21_10
#else
private GpuTexture gpuTexture = null;
#endif
private final BlazeTextureViewWrapper lightmapTextureWrapper = new BlazeTextureViewWrapper();
@@ -109,11 +117,14 @@ public class LightMapWrapper implements ILightMapWrapper
this.textureId = minecraftLightmapTextureId;
}
#if MC_VER <= MC_1_21_10
#else
public void setLightmapGpuTexture(GpuTexture gpuTexture)
{
this.gpuTexture = gpuTexture;
this.lightmapTextureWrapper.tryWrap(this.gpuTexture);
}
#endif
//endregion