Skip to content

1.21.5 #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ format = { version = "1.1" }

[versions]
indra = "3.1.3"
minecraft = "1.21.4"
fabricLoader = "0.16.9"
fabricApi = "0.112.2+1.21.4"
modmenu = "13.0.0-beta.1"
minecraft = "1.21.5"
fabricLoader = "0.16.14"
fabricApi = "0.124.0+1.21.5"
modmenu = "14.0.0-rc.2"
viafabricplus = "3.3.0"
vineflower = "1.10.1"
cuiProtocol = "4.0.0"

[libraries]
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
parchment = { module = "org.parchmentmc.data:parchment-1.21.4", version = "2024.12.07" }
parchment = { module = "org.parchmentmc.data:parchment-1.21.5", version = "2025.04.19" }
fabric-loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabricLoader" }
fabric-api = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fabricApi" }
fabric-api-bom = { module = "net.fabricmc.fabric-api:fabric-api-bom", version.ref = "fabricApi" }
fabric-api-networking = { module = "net.fabricmc.fabric-api:fabric-networking-api-v1" }
modmenu = { module = "com.terraformersmc:modmenu", version.ref = "modmenu" }
neoforge = { module = "net.neoforged:neoforge", version = "21.4.38-beta"}
neoforge = { module = "net.neoforged:neoforge", version = "21.5.63-beta"}
viafabricplus-api = { module = "de.florianmichael:ViaFabricPlus", version.ref = "viafabricplus" }
viaversion = { module = "com.viaversion:viaversion-common", version = "5.0.5" }
vineflower = { module = "org.vineflower:vineflower", version.ref = "vineflower" }
Expand All @@ -31,17 +31,17 @@ curseForgeGradle = { id = "net.darkhax.curseforgegradle", version = "1.1.26" }
indra-git = { id = "net.kyori.indra.git", version.ref = "indra" }
indra-spotlessLicenser = { id = "net.kyori.indra.licenser.spotless", version.ref = "indra" }
jvmConflictResolution = { id = "org.gradlex.jvm-dependency-conflict-resolution", version = "2.1.2" }
loom = { id = "dev.architectury.loom", version = "1.9.420" }
loom = { id = "dev.architectury.loom", version = "1.10.430" }
minotaur = { id = "com.modrinth.minotaur", version = "2.8.7" }
publishGithubRelease = { id = "ca.stellardrift.publish-github-release", version = "0.1.0" }
shadow = { id = "com.gradleup.shadow", version = "8.3.5" }
spotless = { id = "com.diffplug.spotless", version = "6.25.0" }
versions = { id = "com.github.ben-manes.versions", version = "0.51.0" }

[libraries.cuiProtocol-fabric]
module = "org.enginehub.worldeditcui-protocol:worldeditcui-protocol-fabric-mc1.21.4"
module = "org.enginehub.worldeditcui-protocol:worldeditcui-protocol-fabric-mc1.21.5"
version.ref = "cuiProtocol"

[libraries.cuiProtocol-neoforge]
module = "org.enginehub.worldeditcui-protocol:worldeditcui-protocol-neoforge-mc1.21.4"
module = "org.enginehub.worldeditcui-protocol:worldeditcui-protocol-neoforge-mc1.21.5"
version.ref = "cuiProtocol"
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
*/
package org.enginehub.worldeditcui.event.listeners;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.opengl.GlConst;
import com.mojang.blaze3d.opengl.GlStateManager;
import com.mojang.blaze3d.platform.DestFactor;
import com.mojang.blaze3d.platform.SourceFactor;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.CompiledShaderProgram;
import net.minecraft.client.renderer.FogParameters;
import net.minecraft.util.profiling.Profiler;
import net.minecraft.util.profiling.ProfilerFiller;
Expand Down Expand Up @@ -100,15 +102,18 @@ public void onRender(final float partialTicks) {
RenderSystem.setShaderFog(FogParameters.NO_FOG);
final Matrix4fStack poseStack = RenderSystem.getModelViewStack();
poseStack.pushMatrix();
RenderSystem.disableCull();
RenderSystem.enableBlend();
GlStateManager._disableCull();
GlStateManager._enableBlend();
// RenderSystem.disableTexture();
RenderSystem.enableDepthTest();
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
RenderSystem.depthMask(true);
GlStateManager._enableDepthTest();
GlStateManager._blendFuncSeparate(
GlConst.toGl(SourceFactor.SRC_ALPHA),
GlConst.toGl(DestFactor.ONE_MINUS_SRC_ALPHA),
GlConst.toGl(SourceFactor.SRC_ALPHA),
GlConst.toGl(DestFactor.ONE_MINUS_SRC_ALPHA));
GlStateManager._depthMask(true);
RenderSystem.lineWidth(LineStyle.DEFAULT_WIDTH);

final CompiledShaderProgram oldShader = RenderSystem.getShader();
try {
this.controller.renderSelections(this.ctx);
this.sink.flush();
Expand All @@ -117,11 +122,10 @@ public void onRender(final float partialTicks) {
this.invalidatePipeline();
}

RenderSystem.depthFunc(GL32.GL_LEQUAL);
RenderSystem.setShader(oldShader);
GlStateManager._depthFunc(GL32.GL_LEQUAL);
// RenderSystem.enableTexture();
RenderSystem.disableBlend();
RenderSystem.enableCull();
GlStateManager._disableBlend();
GlStateManager._enableCull();
poseStack.popMatrix();
RenderSystem.setShaderFog(fogStart);
profiler.pop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ public void onInitialize() {
RenderSystem.getModelViewStack().pushMatrix();
RenderSystem.getModelViewStack().mul(ctx.matrixStack().last().pose());
// RenderSystem.applyModelViewMatrix();
ctx.worldRenderer().getTranslucentTarget().bindWrite(false);
//ctx.worldRenderer().getTranslucentTarget().bindWrite(false);
this.onPostRenderEntities(ctx);
} finally {
Minecraft.getInstance().getMainRenderTarget().bindWrite(false);
//Minecraft.getInstance().getMainRenderTarget().bindWrite(false);
RenderSystem.getModelViewStack().popMatrix();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
*/
package org.enginehub.worldeditcui.render;

import com.mojang.blaze3d.opengl.GlStateManager;
import com.mojang.blaze3d.pipeline.RenderPipeline;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.BufferUploader;
import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.blaze3d.vertex.VertexFormat;
import net.minecraft.client.renderer.ShaderProgram;
import org.jetbrains.annotations.Nullable;
import org.joml.Vector3f;
import org.lwjgl.opengl.GL11;
Expand Down Expand Up @@ -91,7 +91,7 @@ public boolean apply(final LineStyle line, final RenderStyle.RenderType type) {
this.builder = Tesselator.getInstance().begin(this.activeRenderType.mode, this.activeRenderType.format);
}
LineWidth.set(this.lastLineWidth = line.lineWidth);
RenderSystem.depthFunc(this.lastDepthFunc = line.renderType.depthFunc());
GlStateManager._depthFunc(this.lastDepthFunc = line.renderType.depthFunc());
}
return true;
}
Expand Down Expand Up @@ -227,10 +227,10 @@ public void flush() {
this.canFlush = false;
this.preFlush.run();
try {
if (this.activeRenderType != null) {
RenderSystem.setShader(this.activeRenderType.shader);
if (this.activeRenderType == null) {
throw new IllegalStateException("Active type cannot be null");
}
BufferUploader.drawWithShader(this.builder.buildOrThrow());
this.activeRenderType.type.draw(this.builder.buildOrThrow());
} finally {
this.postFlush.run();
this.builder = null;
Expand Down Expand Up @@ -269,13 +269,13 @@ public static class RenderType {
private final VertexFormat.Mode mode;
private final VertexFormat format;
private final boolean hasNormals;
private final ShaderProgram shader;
private final net.minecraft.client.renderer.RenderType type;

public RenderType(final VertexFormat.Mode mode, final VertexFormat format, final ShaderProgram shader) {
public RenderType(final VertexFormat.Mode mode, final VertexFormat format, @Nullable final net.minecraft.client.renderer.RenderType renderPipeline) {
this.mode = mode;
this.format = format;
this.hasNormals = format.getElementAttributeNames().contains("Normal");
this.shader = shader;
this.type = renderPipeline;
}

VertexFormat.Mode mode() {
Expand All @@ -290,10 +290,6 @@ boolean hasNormals() {
return this.hasNormals;
}

ShaderProgram shader() {
return this.shader;
}

boolean mustFlushAfter(final RenderType previous) {
return previous.mode != this.mode || !Objects.equals(previous.format, this.format);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.VertexFormat;
import com.mojang.logging.LogUtils;
import net.minecraft.client.renderer.CoreShaders;
import net.minecraft.client.renderer.GameRenderer;
import org.slf4j.Logger;

import java.lang.invoke.MethodHandle;
Expand Down Expand Up @@ -87,9 +85,9 @@ static String activeProgram() {
public static class OptifineTypeFactory implements BufferBuilderRenderSink.TypeFactory {
public static final OptifineTypeFactory INSTANCE = new OptifineTypeFactory();

private static final BufferBuilderRenderSink.RenderType QUADS = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR, CoreShaders.POSITION_COLOR);
private static final BufferBuilderRenderSink.RenderType LINES = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR, CoreShaders.POSITION_COLOR);
private static final BufferBuilderRenderSink.RenderType LINES_LOOP = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR, CoreShaders.POSITION_COLOR);
private static final BufferBuilderRenderSink.RenderType QUADS = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR, null);
private static final BufferBuilderRenderSink.RenderType LINES = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR, null);
private static final BufferBuilderRenderSink.RenderType LINES_LOOP = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.DEBUG_LINES, DefaultVertexFormat.POSITION_COLOR, null);

private OptifineTypeFactory() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,30 @@
*/
package org.enginehub.worldeditcui.render;

import com.mojang.blaze3d.pipeline.BlendFunction;
import com.mojang.blaze3d.pipeline.RenderPipeline;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.VertexFormat;
import net.minecraft.client.renderer.CoreShaders;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.RenderPipelines;
import net.minecraft.client.renderer.RenderType;

public final class VanillaPipelineProvider implements PipelineProvider {

public static class DefaultTypeFactory implements BufferBuilderRenderSink.TypeFactory {
public static final DefaultTypeFactory INSTANCE = new DefaultTypeFactory();

private static final BufferBuilderRenderSink.RenderType QUADS = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR, CoreShaders.POSITION_COLOR);
private static final BufferBuilderRenderSink.RenderType LINES = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.LINES, DefaultVertexFormat.POSITION_COLOR_NORMAL, CoreShaders.RENDERTYPE_LINES);
private static final BufferBuilderRenderSink.RenderType LINES_LOOP = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.LINES, DefaultVertexFormat.POSITION_COLOR_NORMAL, CoreShaders.RENDERTYPE_LINES);
private static final BufferBuilderRenderSink.RenderType QUADS = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR,
RenderType.create("quads", 1536, false, true,
RenderPipeline.builder(RenderPipeline.builder(RenderPipelines.MATRICES_COLOR_SNIPPET)
.withVertexShader("core/position_color")
.withFragmentShader("core/position_color")
.withBlend(BlendFunction.TRANSLUCENT)
.withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.QUADS)
.buildSnippet())
.withLocation("pipeline/wecui_quads").withCull(false).build(),
RenderType.CompositeState.builder().createCompositeState(false)
));
private static final BufferBuilderRenderSink.RenderType LINES = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.LINES, DefaultVertexFormat.POSITION_COLOR_NORMAL, RenderType.LINES);
private static final BufferBuilderRenderSink.RenderType LINES_LOOP = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.LINES, DefaultVertexFormat.POSITION_COLOR_NORMAL, RenderType.LINES);

private DefaultTypeFactory() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
package org.enginehub.worldeditcui.render.shapes;

import com.mojang.blaze3d.opengl.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.util.Mth;
import org.enginehub.worldeditcui.event.listeners.CUIRenderContext;
Expand Down Expand Up @@ -87,7 +88,7 @@ public void render(CUIRenderContext ctx)

if (this.spacing != 1.0)
{
RenderSystem.disableCull();
GlStateManager._disableCull();

double[] vertices = {
x1, y1, z1, x2, y1, z1, x2, y1, z2, x1, y1, z2, // bottom
Expand All @@ -113,7 +114,7 @@ public void render(CUIRenderContext ctx)
}

ctx.flush(); // todo: only needed because of disable/enable cull
RenderSystem.enableCull();
GlStateManager._enableCull();
}

if (this.spacing < Render3DGrid.MIN_SPACING)
Expand Down
2 changes: 1 addition & 1 deletion worldeditcui-fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"fabric-lifecycle-events-v1": "^2.0.0",
"fabric-screen-api-v1": ">=1.0.9",
"fabric-resource-loader-v0": ">=0.4.17",
"minecraft": ">=1.21.2"
"minecraft": ">=1.21.5"
},
"suggests": {
"worldedit": ">=7.2.0"
Expand Down
Loading