Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
*
* Copyright (c) 2015 - 2026 CCBlueX
*
* LiquidBounce is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LiquidBounce 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LiquidBounce. If not, see <https://www.gnu.org/licenses/>.
*/

package net.ccbluex.liquidbounce.injection.mixins.minecraft.render;

import com.mojang.blaze3d.pipeline.RenderPipeline;
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleChams;
import net.minecraft.client.renderer.rendertype.RenderTypes;
import org.jspecify.annotations.NullMarked;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

import static net.minecraft.client.renderer.RenderPipelines.ENTITY_SNIPPET;

@NullMarked
@Mixin(RenderTypes.class)
public abstract class MixinRenderTypes {

@ModifyArg(
method = "method_75987", // entity_cutout_no_cull
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/rendertype/RenderSetup;builder(Lcom/mojang/blaze3d/pipeline/RenderPipeline;)Lnet/minecraft/client/renderer/rendertype/RenderSetup$RenderSetupBuilder;")
)
private static RenderPipeline setupChamsPipeline(RenderPipeline pipeline) {
return ModuleChams.withChamsDepthBias(RenderPipeline.builder(ENTITY_SNIPPET))
.withLocation("pipeline/entity_cutout_no_cull")
.withShaderDefine("ALPHA_CUTOUT", 0.1F)
.withShaderDefine("PER_FACE_LIGHTING")
.withSampler("Sampler1")
.withCull(false)
.build();
// return pipeline;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@
*/
package net.ccbluex.liquidbounce.features.module.modules.render

import com.mojang.blaze3d.pipeline.RenderPipeline
import net.ccbluex.liquidbounce.features.module.ClientModule
import net.ccbluex.liquidbounce.features.module.ModuleCategories

// FIXME
object ModuleChams: ClientModule("Chams", ModuleCategories.RENDER)
object ModuleChams: ClientModule("Chams", ModuleCategories.RENDER) {
@JvmStatic
fun RenderPipeline.Builder.withChamsDepthBias(): RenderPipeline.Builder {
return withDepthBias(1f, -10000000f)
}
}
1 change: 1 addition & 0 deletions src/main/resources/liquidbounce.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
"minecraft.render.MixinRenderSetup",
"minecraft.render.MixinRenderTickCounter",
"minecraft.render.MixinRenderType",
"minecraft.render.MixinRenderTypes",
"minecraft.render.MixinScreenEffectRenderer",
"minecraft.render.MixinSignText",
"minecraft.render.MixinSkyRenderer",
Expand Down