Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SymoHTL committed Apr 15, 2024
1 parent 2e94feb commit e74f1f8
Show file tree
Hide file tree
Showing 27 changed files with 227 additions and 234 deletions.
12 changes: 6 additions & 6 deletions src/client/java/dev/symo/finz/config/ConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static void readConfig(String path) {

public static void buildSettings() {
// categories

/*
ConfigEntryBuilder entryBuilder = configBuilder.entryBuilder();
// esp
Expand Down Expand Up @@ -155,7 +155,7 @@ public static void buildSettings() {
.setSaveConsumer(newValue -> FinZClient.config.materialScannerMaterial = newValue)
.build());
/*// Fullbright
// Fullbright
ConfigCategory fullbright = configBuilder.getOrCreateCategory(Text.translatable("category.finz.fullbright"));
fullbright.addEntry(entryBuilder.startBooleanToggle(Text.translatable("option.finz.fullbrightenabled"), FinZClient.config.fullBrightEnabled)
.setDefaultValue(false)
Expand All @@ -165,7 +165,7 @@ public static void buildSettings() {
.setDefaultValue(1.0)
.setTooltip(Text.of("The gamma level to set when fullbright is enabled."))
.setSaveConsumer(newValue -> FinZClient.config.fullBrightGamma = newValue)
.build());*/
.build());*//*
// ZOOM
Expand Down Expand Up @@ -199,7 +199,7 @@ public static void buildSettings() {
.build());
// auto get block
/*ConfigCategory autoGetBlock = configBuilder.getOrCreateCategory(Text.translatable("category.finz.autogetblock"));
ConfigCategory autoGetBlock = configBuilder.getOrCreateCategory(Text.translatable("category.finz.autogetblock"));
autoGetBlock.addEntry(entryBuilder.startBooleanToggle(Text.translatable("option.finz.autogetblock"), FinZClient.config.autoGetBlockEnabled)
.setDefaultValue(true)
.setTooltip(Text.of("Automatically restocks your hotbar with the block you placed"))
Expand All @@ -211,13 +211,13 @@ public static void buildSettings() {
.setDefaultValue(true)
.setTooltip(Text.of("Automatically restocks your hotbar with the tool that broke"))
.setSaveConsumer(newValue -> FinZClient.config.autoGetToolEnabled = newValue)
.build());*/
.build());
// chroma block outline
ConfigCategory chromaOutline = configBuilder.getOrCreateCategory(Text.translatable("category.finz.chromaoutline"));
chromaOutline.addEntry(entryBuilder.startBooleanToggle(Text.translatable("option.finz.blockoutline"), FinZClient.config.chromaBlockOutlineEnabled)
.setDefaultValue(true)
.setTooltip(Text.of("Enables chroma block outline"))
.setSaveConsumer(newValue -> FinZClient.config.chromaBlockOutlineEnabled = newValue)
.build());
.build());*/
}
}
4 changes: 2 additions & 2 deletions src/client/java/dev/symo/finz/config/FinZConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class FinZConfig {

public boolean materialScannerEnabled = false;
/*public boolean materialScannerEnabled = false;
public int materialScannerRange = 25;
public String materialScannerMaterial = "minecraft:ancient_debris";
Expand All @@ -28,7 +28,7 @@ public class FinZConfig {
public float mobEspRange = 50;
public boolean itemEsp;
public float itemEspRange = 50;
public float itemEspRange = 50;*/

//public boolean fullBrightEnabled = false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package dev.symo.finz.mixin.client;

import dev.symo.finz.FinZClient;
import dev.symo.finz.modules.Modules;
import dev.symo.finz.modules.impl.ChromaOutline;
import net.fabricmc.api.Environment;
import net.minecraft.block.BlockState;
import net.minecraft.block.ShapeContext;
Expand Down Expand Up @@ -38,7 +40,7 @@ private void drawBlockOutline(MatrixStack matrices, VertexConsumer vertexConsume
float green = 0;
float blue = 0;

if (FinZClient.config.chromaBlockOutlineEnabled) {
if (Modules.chromaOutline.isEnabled()){
var hue = (float) (System.currentTimeMillis() % 4000) / 4000;
var color = Color.HSBtoRGB(hue, 1, 1);
red = (color >> 16 & 255) / 255.0F;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class FastPlaceInvoker {
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;emitGameEvent(Lnet/minecraft/world/event/GameEvent;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/event/GameEvent$Emitter;)V",
shift = At.Shift.AFTER))
public void onBlockPlace(ItemPlacementContext context, CallbackInfoReturnable<ActionResult> cir) {
if (FinZClient.config.fastPlaceEnabled)
((FastPlaceClientMixin) FinZClient.mc).setItemUseCooldown(FinZClient.config.fastPlaceValue);
//if (FinZClient.config.fastPlaceEnabled)
// ((FastPlaceClientMixin) FinZClient.mc).setItemUseCooldown(FinZClient.config.fastPlaceValue);

}
}
4 changes: 2 additions & 2 deletions src/client/java/dev/symo/finz/modules/AModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ public Collection<ModuleSetting> getSettings() {
return settings.values();
}

public boolean isEnabled() {
public final boolean isEnabled() {
return ((BoolSetting)settings.get("enabled")).getValue();
}

public void setEnabled(boolean enabled) {
public final void setEnabled(boolean enabled) {
((BoolSetting)settings.get("enabled")).setValue(enabled);

if (enabled) onEnable();
Expand Down
5 changes: 0 additions & 5 deletions src/client/java/dev/symo/finz/modules/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

import dev.symo.finz.FinZClient;
import dev.symo.finz.events.*;
import dev.symo.finz.events.listeners.ConfigChangeListener;
import dev.symo.finz.modules.impl.*;
import dev.symo.finz.modules.impl.esp.ItemESP;
import dev.symo.finz.modules.impl.esp.MobEsp;
import dev.symo.finz.modules.impl.esp.PlayerESP;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.symo.finz.modules.impl;
package dev.symo.finz.modules;

import dev.symo.finz.modules.AModule;
import dev.symo.finz.modules.impl.*;
import dev.symo.finz.modules.impl.esp.ItemESP;
import dev.symo.finz.modules.impl.esp.MobEsp;
import dev.symo.finz.modules.impl.esp.PlayerESP;
Expand All @@ -11,19 +11,34 @@ public class Modules {

public static final ArrayList<AModule> all = new ArrayList<>();

// misc
public static AntiKnockback knockback = new AntiKnockback();

public static Zoom zoom = new Zoom();

// render
public static WhatTheFAmILookingAt wtfaila = new WhatTheFAmILookingAt();
public static PathTracer pathTracer = new PathTracer();
public static MaterialScanner materialScanner = new MaterialScanner();
public static PathTracer pathTracer = new PathTracer();
public static ChromaOutline chromaOutline = new ChromaOutline();

// esp
public static PlayerESP playerESP = new PlayerESP();
public static MobEsp mobEsp = new MobEsp();
public static ItemESP itemESP = new ItemESP();

static {
// misc
all.add(knockback);
all.add(zoom);

// render
all.add(wtfaila);
all.add(pathTracer);
all.add(materialScanner);
all.add(chromaOutline);

// esp
all.add(playerESP);
all.add(mobEsp);
all.add(itemESP);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package dev.symo.finz.modules.impl.esp;
package dev.symo.finz.modules.impl;

import dev.symo.finz.events.listeners.KnockbackListener;
import dev.symo.finz.modules.AModule;
import dev.symo.finz.modules.settings.DoubleSetting;
import dev.symo.finz.util.Category;
import dev.symo.finz.util.InputType;
import dev.symo.finz.util.ValueDisplay;

public class AntiKnockback extends AModule implements KnockbackListener {

private final DoubleSetting _horizontal = new DoubleSetting("Horizontal", "100% = no knockback -- >100% = reverse knockback", 1, 0.0, 1.0, ValueDisplay.DECIMAL, InputType.PERCENT_SLIDER);
private final DoubleSetting _vertical = new DoubleSetting("Vertical", "100% = no knockback -- >100% = reverse knockback",1, 0.0, 1.0, ValueDisplay.DECIMAL, InputType.PERCENT_SLIDER);
private final DoubleSetting _horizontal = new DoubleSetting("Horizontal", "100% = no knockback -- >100% = reverse knockback", 1, 0.0, 1.0, InputType.PERCENT_SLIDER);
private final DoubleSetting _vertical = new DoubleSetting("Vertical", "100% = no knockback -- >100% = reverse knockback",1, 0.0, 1.0, InputType.PERCENT_SLIDER);

public AntiKnockback() {
super("AntiKnockback", Category.MOVEMENT);
addSetting(_horizontal);
addSetting(_vertical);
}

@Override
Expand Down
10 changes: 10 additions & 0 deletions src/client/java/dev/symo/finz/modules/impl/ChromaOutline.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package dev.symo.finz.modules.impl;

import dev.symo.finz.modules.AModule;
import dev.symo.finz.util.Category;

public class ChromaOutline extends AModule {
public ChromaOutline() {
super("ChromaOutline", Category.RENDER);
}
}
27 changes: 12 additions & 15 deletions src/client/java/dev/symo/finz/modules/impl/MaterialScanner.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package dev.symo.finz.modules.impl;

import dev.symo.finz.FinZClient;
import dev.symo.finz.events.listeners.ConfigChangeListener;
import dev.symo.finz.modules.AModule;
import dev.symo.finz.modules.settings.IntSetting;
import dev.symo.finz.modules.settings.StringSetting;
import dev.symo.finz.util.Category;
import dev.symo.finz.util.WorldSpaceRenderer;
import net.minecraft.client.util.math.MatrixStack;
Expand All @@ -13,24 +14,20 @@
import java.util.ArrayList;

public class MaterialScanner extends AModule implements ConfigChangeListener {
private final IntSetting _range = new IntSetting("Range", "Range to scan for blocks",
50, 1, 100);

private final StringSetting _material = new StringSetting("Material", "Material to scan for",
"minecraft:ancient_debris");

ArrayList<BlockPos> blocks = new ArrayList<>();

int _tickDelay = 10;

public MaterialScanner() {
super("Material Scanner", Category.RENDER);
}


@Override
public boolean isEnabled() {
return config.materialScannerEnabled;
}

@Override
public void setEnabled(boolean enabled) {
config.materialScannerEnabled = enabled;
addSetting(_range);
addSetting(_material);
}

public void onConfigChange() {
Expand Down Expand Up @@ -59,17 +56,17 @@ public void onTick() {
var playerY = playerPos.getY();
var playerZ = playerPos.getZ();

var range = config.materialScannerRange;
var range = _range.getValue();

for (int x = playerX - range; x < playerX + range; x++) {
for (int y = playerY - range; y < playerY + range; y++) {
for (int z = playerZ - range; z < playerZ + range; z++) {
var pos = new BlockPos(x, y, z);
var state = mc.world.getBlockState(pos);
var block = state.getBlock();
var match = config.materialScannerMaterial; // minecraft:ancient_debris
// _material.getValue() -> minecraft:ancient_debris
var id = String.valueOf(Registries.BLOCK.getId(block));
if (match.contains(id) && !blocks.contains(pos))
if (_material.getValue().contains(id) && !blocks.contains(pos))
blocks.add(pos);
}
}
Expand Down
25 changes: 11 additions & 14 deletions src/client/java/dev/symo/finz/modules/impl/PathTracer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.mojang.blaze3d.systems.RenderSystem;
import dev.symo.finz.FinZClient;
import dev.symo.finz.modules.AModule;
import dev.symo.finz.modules.settings.IntSetting;
import dev.symo.finz.util.Category;
import dev.symo.finz.util.PlayerUtil;
import dev.symo.finz.util.RegionPos;
Expand All @@ -18,21 +19,15 @@

public class PathTracer extends AModule {

private final IntSetting _pathTracerLength = new IntSetting("Path Tracer Length", "Length of the path tracer",
50, 1, 100);


public List<BlockPos> path = new ArrayList<>();

public PathTracer() {
super("PathTracer", Category.RENDER);

}

@Override
public boolean isEnabled() {
return FinZClient.config.pathTracerEnabled;
}

@Override
public void setEnabled(boolean enabled) {
config.pathTracerEnabled = enabled;
addSetting(_pathTracerLength);
}

public void onTick() {
Expand All @@ -49,9 +44,11 @@ public void onTick() {
}
}

if (config.pathTracerLength < path.size())
if (path.size() - config.pathTracerLength > 0)
path.subList(0, path.size() - config.pathTracerLength).clear();
var length = _pathTracerLength.getValue();

if (length < path.size())
if (path.size() - length > 0)
path.subList(0, path.size() - length).clear();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ public WhatTheFAmILookingAt() {
super("WhatTheFAmILookingAt", Category.RENDER);
}

@Override
public boolean isEnabled() {
return config.whatTheFAmILookingAtEnabled;
}

@Override
public void setEnabled(boolean enabled) {
config.whatTheFAmILookingAtEnabled = enabled;
}


@Override
public void onHudRender(DrawContext drawContext, float tickDelta){
Expand Down
21 changes: 6 additions & 15 deletions src/client/java/dev/symo/finz/modules/impl/Zoom.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

import dev.symo.finz.FinZClient;
import dev.symo.finz.modules.AModule;
import dev.symo.finz.modules.settings.DoubleSetting;
import dev.symo.finz.util.Category;
import dev.symo.finz.util.InputType;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.option.SimpleOption;
import net.minecraft.client.util.InputUtil;
import net.minecraft.world.GameRules;
import org.lwjgl.glfw.GLFW;

public class Zoom extends AModule {

private final DoubleSetting _zoomLevel = new DoubleSetting("Zoom Level", "Zoom level", 1, 1, 50, InputType.DECIMAL_SLIDER);

private Double defaultMouseSensitivity;

public Zoom() {
Expand All @@ -19,7 +22,6 @@ public Zoom() {
}

public double zoom(double fov) {

SimpleOption<Double> mouseSensitivitySetting = mc.options.getMouseSensitivity();

if (!_keybind.isPressed()) {
Expand All @@ -36,19 +38,8 @@ public double zoom(double fov) {
// Adjust mouse sensitivity in relation to zoom level.
// 1.0 / currentLevel is a value between 0.02 (50x zoom)
// and 1 (no zoom).
mouseSensitivitySetting.setValue(defaultMouseSensitivity * (1.0 / FinZClient.config.zoomLevel));

return fov / FinZClient.config.zoomLevel;
}


@Override
public boolean isEnabled() {
return _keybind.isPressed();
}
mouseSensitivitySetting.setValue(defaultMouseSensitivity * (1.0 / _zoomLevel.getValue()));

@Override
public void setEnabled(boolean enabled) {
_keybind.setPressed(enabled);
return fov / _zoomLevel.getValue();
}
}
Loading

0 comments on commit e74f1f8

Please sign in to comment.