Skip to content
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

feat: block outline changer #3910

Merged
merged 1 commit into from
Sep 9, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;

import static org.lwjgl.opengl.GL11.*;

Expand Down Expand Up @@ -295,4 +296,40 @@ private float removeRainSplashing(float original) {

return original;
}

@ModifyArgs(
method = "drawBlockOutline",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/render/WorldRenderer;drawCuboidShapeOutline(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;Lnet/minecraft/util/shape/VoxelShape;DDDFFFF)V"
)
)
private void modifyBlockOutlineArgs(Args args) {
// args: MatrixStack matrices,
// VertexConsumer vertexConsumer,
// VoxelShape shape,
// double offsetX,
// double offsetY,
// double offsetZ,
// float red,
// float green,
// float blue,
// float alpha

if (!ModuleBlockOutline.INSTANCE.getEnabled()) {
return;
}

var color = ModuleBlockOutline.INSTANCE.getOutlineColor();
var red = color.getR() / 255f;
var green = color.getG() / 255f;
var blue = color.getB() / 255f;
var alpha = color.getA() / 255f;

args.set(6, red);
args.set(7, green);
args.set(8, blue);
args.set(9, alpha);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ object ModuleManager : Listenable, Iterable<Module> by modules {
ModuleAnimations,
ModuleAntiBlind,
ModuleBlockESP,
ModuleBlockOutline,
ModuleBreadcrumbs,
ModuleCameraClip,
ModuleClickGui,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
*
* Copyright (c) 2015 - 2024 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.features.module.modules.render

import net.ccbluex.liquidbounce.features.module.Category
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.render.engine.Color4b

/**
* Block Outline module
*
* Changes the way Minecraft highlights blocks.
*
* TODO: Implement Block Side Box and GUI Information Panel
*/
object ModuleBlockOutline : Module("BlockOutline", Category.RENDER, aliases = arrayOf("BlockOverlay")) {
val outlineColor by color("Outline", Color4b(68, 117, 255, 102))
}
Loading