From e32725087d9dd17eed046ff147bd603dcb5e121c Mon Sep 17 00:00:00 2001 From: I-No-oNe <145749961+I-No-oNe@users.noreply.github.com> Date: Tue, 14 Jul 2026 21:21:31 +0300 Subject: [PATCH 1/2] port(26.2): mechanical API updates (imports, ResourceKey/Identifier, PrimitiveTopology, Vector4f) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - EntityTypes/VectorParser: add missing imports (symbols still exist in 26.2) - MixinEntityType: register() now takes ResourceKey; derive id via key.identifier().getPath() - MixinLightmap: clearColorTexture takes Vector4fc, pass new Vector4f(1,1,1,1) - RenderPipelines: withVertexFormat(fmt, Mode) split into withVertexBinding(0, fmt) + withPrimitiveTopology(PrimitiveTopology.*) Remaining: RenderUtils/RenderUtils3d/ElytraShadow immediate-mode draw (Tesselator + RenderType.draw removed) — needs StagedVertexBuffer rewrite, verifiable only against a running client. --- .../clickcrystals/mixins/MixinEntityType.java | 8 ++-- .../clickcrystals/mixins/MixinLightmap.java | 3 +- .../modules/modules/misc/DeathEffects.java | 1 + .../ConditionalBlockInFov.java | 1 + .../ConditionalBlockInRange.java | 1 + .../minecraft/render/RenderPipelines.java | 38 ++++++++++++------- 6 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityType.java b/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityType.java index 4ef81349..588c383f 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityType.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityType.java @@ -1,8 +1,10 @@ package io.github.itzispyder.clickcrystals.mixins; import io.github.itzispyder.clickcrystals.gui.misc.brushes.MobHeadBrush; +import net.minecraft.resources.ResourceKey; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.EntityTypes; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -11,8 +13,8 @@ @Mixin(EntityTypes.class) public abstract class MixinEntityType { - @Inject(method = "Lnet/minecraft/world/entity/EntityType;register(Ljava/lang/String;Lnet/minecraft/world/entity/EntityType$Builder;)Lnet/minecraft/world/entity/EntityType;", at = @At("RETURN")) - private static void register(String vanillaId, EntityTypes.Builder builder, CallbackInfoReturnable> cir) { - MobHeadBrush.init(cir.getReturnValue(), vanillaId); + @Inject(method = "register(Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/entity/EntityType$Builder;)Lnet/minecraft/world/entity/EntityType;", at = @At("RETURN")) + private static void register(ResourceKey> key, EntityType.Builder builder, CallbackInfoReturnable> cir) { + MobHeadBrush.init(cir.getReturnValue(), key.identifier().getPath()); } } \ No newline at end of file diff --git a/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinLightmap.java b/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinLightmap.java index 9cba0b1e..644290dc 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinLightmap.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinLightmap.java @@ -9,6 +9,7 @@ import net.minecraft.client.renderer.Lightmap; import net.minecraft.client.renderer.state.LightmapRenderState; import net.minecraft.util.profiling.ProfilerFiller; +import org.joml.Vector4f; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -24,7 +25,7 @@ public abstract class MixinLightmap implements Global { @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiling/ProfilerFiller;push(Ljava/lang/String;)V", shift = At.Shift.AFTER), cancellable = true) private void onUpdate(LightmapRenderState renderState, CallbackInfo ci, @Local ProfilerFiller profiler) { if (Module.isEnabled(FullBright.class)) { - RenderSystem.getDevice().createCommandEncoder().clearColorTexture(this.texture, 0xFFFFFFFF); + RenderSystem.getDevice().createCommandEncoder().clearColorTexture(this.texture, new Vector4f(1.0F, 1.0F, 1.0F, 1.0F)); profiler.pop(); ci.cancel(); } diff --git a/src/main/java/io/github/itzispyder/clickcrystals/modules/modules/misc/DeathEffects.java b/src/main/java/io/github/itzispyder/clickcrystals/modules/modules/misc/DeathEffects.java index 16e8a7d0..f7596c04 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/modules/modules/misc/DeathEffects.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/modules/modules/misc/DeathEffects.java @@ -16,6 +16,7 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityEvent; import net.minecraft.world.entity.LightningBolt; +import net.minecraft.world.entity.EntityTypes; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.component.FireworkExplosion; diff --git a/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInFov.java b/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInFov.java index 67a52fc8..ae8a7d0e 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInFov.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInFov.java @@ -6,6 +6,7 @@ import io.github.itzispyder.clickcrystals.scripting.components.Conditional; import io.github.itzispyder.clickcrystals.util.minecraft.EntityUtils; import io.github.itzispyder.clickcrystals.util.minecraft.PlayerUtils; +import io.github.itzispyder.clickcrystals.util.minecraft.VectorParser; import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.state.BlockState; diff --git a/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInRange.java b/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInRange.java index 907880d4..09e0491c 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInRange.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/scripting/components/conditionalcontexts/ConditionalBlockInRange.java @@ -6,6 +6,7 @@ import io.github.itzispyder.clickcrystals.scripting.components.Conditional; import io.github.itzispyder.clickcrystals.util.minecraft.EntityUtils; import io.github.itzispyder.clickcrystals.util.minecraft.PlayerUtils; +import io.github.itzispyder.clickcrystals.util.minecraft.VectorParser; import net.minecraft.world.level.block.state.BlockState; import java.util.concurrent.atomic.AtomicBoolean; diff --git a/src/main/java/io/github/itzispyder/clickcrystals/util/minecraft/render/RenderPipelines.java b/src/main/java/io/github/itzispyder/clickcrystals/util/minecraft/render/RenderPipelines.java index 32b1e10a..b2dc685b 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/util/minecraft/render/RenderPipelines.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/util/minecraft/render/RenderPipelines.java @@ -6,7 +6,7 @@ import com.mojang.blaze3d.pipeline.RenderPipeline; import com.mojang.blaze3d.platform.CompareOp; import com.mojang.blaze3d.vertex.DefaultVertexFormat; -import com.mojang.blaze3d.vertex.VertexFormat; +import com.mojang.blaze3d.PrimitiveTopology; public class RenderPipelines { @@ -16,7 +16,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_LINES = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET) .withLocation("pipeline/global_lines_pipeline") - .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.DEBUG_LINES) + .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR) + .withPrimitiveTopology(PrimitiveTopology.DEBUG_LINES) .withColorTargetState(WITH_BLEND) .withCull(false) .withDepthStencilState(DEPTH_NONE) @@ -24,7 +25,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_LINES_STRIP = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET) .withLocation("pipeline/global_lines_pipeline") - .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.DEBUG_LINE_STRIP) + .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR) + .withPrimitiveTopology(PrimitiveTopology.DEBUG_LINE_STRIP) .withColorTargetState(WITH_BLEND) .withCull(false) .withDepthStencilState(DEPTH_NONE) @@ -32,7 +34,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_QUADS = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET) .withLocation("pipeline/global_fill_pipeline") - .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.QUADS) + .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR) + .withPrimitiveTopology(PrimitiveTopology.QUADS) .withColorTargetState(WITH_BLEND) .withCull(false) .withDepthStencilState(DEPTH_NONE) @@ -40,7 +43,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_TRI_FAN = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET) .withLocation("pipeline/global_fill_pipeline") - .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.TRIANGLE_FAN) + .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR) + .withPrimitiveTopology(PrimitiveTopology.TRIANGLE_FAN) .withColorTargetState(WITH_BLEND) .withCull(false) .withDepthStencilState(DEPTH_NONE) @@ -48,7 +52,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_TRI_STRIP = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET) .withLocation("pipeline/global_fill_pipeline") - .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.TRIANGLE_STRIP) + .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR) + .withPrimitiveTopology(PrimitiveTopology.TRIANGLE_STRIP) .withColorTargetState(WITH_BLEND) .withCull(false) .withDepthStencilState(DEPTH_NONE) @@ -56,7 +61,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_TRI = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET) .withLocation("pipeline/global_fill_pipeline") - .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.TRIANGLES) + .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR) + .withPrimitiveTopology(PrimitiveTopology.TRIANGLES) .withColorTargetState(WITH_BLEND) .withCull(false) .withDepthStencilState(DEPTH_NONE) @@ -64,7 +70,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_TEX_QUADS = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.GUI_TEXTURED_SNIPPET) .withLocation("pipeline/gui_textured") - .withVertexFormat(DefaultVertexFormat.POSITION_TEX_COLOR, VertexFormat.Mode.QUADS) + .withVertexBinding(0, DefaultVertexFormat.POSITION_TEX_COLOR) + .withPrimitiveTopology(PrimitiveTopology.QUADS) .withColorTargetState(WITH_BLEND) .withCull(false) .withDepthStencilState(DEPTH_NONE) @@ -72,7 +79,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_TEX_TRI_FAN = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.GUI_TEXTURED_SNIPPET) .withLocation("pipeline/gui_textured") - .withVertexFormat(DefaultVertexFormat.POSITION_TEX_COLOR, VertexFormat.Mode.TRIANGLE_FAN) + .withVertexBinding(0, DefaultVertexFormat.POSITION_TEX_COLOR) + .withPrimitiveTopology(PrimitiveTopology.TRIANGLE_FAN) .withColorTargetState(WITH_BLEND) .withCull(false) .withDepthStencilState(DEPTH_NONE) @@ -80,7 +88,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_TRI_STRIP_CULL = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET) .withLocation("pipeline/global_fill_pipeline") - .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.TRIANGLE_STRIP) + .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR) + .withPrimitiveTopology(PrimitiveTopology.TRIANGLE_STRIP) .withColorTargetState(WITH_BLEND) .withCull(true) .withDepthStencilState(DEPTH_LEQUAL) @@ -88,7 +97,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_TRI_FAN_CULL = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET) .withLocation("pipeline/global_fill_pipeline") - .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.TRIANGLE_FAN) + .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR) + .withPrimitiveTopology(PrimitiveTopology.TRIANGLE_FAN) .withColorTargetState(WITH_BLEND) .withCull(false) .withDepthStencilState(DEPTH_LEQUAL) @@ -96,7 +106,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_QUADS_CULL = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET) .withLocation("pipeline/global_fill_pipeline") - .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.QUADS) + .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR) + .withPrimitiveTopology(PrimitiveTopology.QUADS) .withColorTargetState(WITH_BLEND) .withCull(false) .withDepthStencilState(DEPTH_LEQUAL) @@ -104,7 +115,8 @@ public class RenderPipelines { public static final RenderPipeline PIPELINE_LINES_CULL = RenderPipeline.builder(net.minecraft.client.renderer.RenderPipelines.DEBUG_FILLED_SNIPPET) .withLocation("pipeline/global_lines_pipeline") - .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.DEBUG_LINES) + .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR) + .withPrimitiveTopology(PrimitiveTopology.DEBUG_LINES) .withColorTargetState(WITH_BLEND) .withCull(false) .withDepthStencilState(DEPTH_LEQUAL) From 60e4be28672cccfe73ad60802aa2c8aaac8017f0 Mon Sep 17 00:00:00 2001 From: I-No-oNe <145749961+I-No-oNe@users.noreply.github.com> Date: Tue, 14 Jul 2026 21:27:25 +0300 Subject: [PATCH 2/2] feat: mixin name fix --- .../mixins/{MixinEntityType.java => MixinEntityTypes.java} | 2 +- src/main/resources/clickcrystals.mixins.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/main/java/io/github/itzispyder/clickcrystals/mixins/{MixinEntityType.java => MixinEntityTypes.java} (95%) diff --git a/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityType.java b/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityTypes.java similarity index 95% rename from src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityType.java rename to src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityTypes.java index 588c383f..04149fa5 100644 --- a/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityType.java +++ b/src/main/java/io/github/itzispyder/clickcrystals/mixins/MixinEntityTypes.java @@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(EntityTypes.class) -public abstract class MixinEntityType { +public abstract class MixinEntityTypes { @Inject(method = "register(Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/entity/EntityType$Builder;)Lnet/minecraft/world/entity/EntityType;", at = @At("RETURN")) private static void register(ResourceKey> key, EntityType.Builder builder, CallbackInfoReturnable> cir) { diff --git a/src/main/resources/clickcrystals.mixins.json b/src/main/resources/clickcrystals.mixins.json index 5aa8cdaa..3ba4afd1 100644 --- a/src/main/resources/clickcrystals.mixins.json +++ b/src/main/resources/clickcrystals.mixins.json @@ -42,7 +42,7 @@ "AccessorLivingEntity", "MixinBlock", "MixinEntity", - "MixinEntityType", + "MixinEntityTypes", "MixinInventory", "MixinItem", "MixinItemStack",