mzncraft6-cell

this is my script enchance it and make it better with ui and togglable ui

šŸ“Ž 1 file 8,030 chars
šŸ“„
pasted-code-1784359104483.txt
txt 249 lines
ā–¶
/*
 * Copyright (c) 2014-2026 Wurst-Imperium and contributors.
 *
 * This source code is subject to the terms of the GNU General Public
 * License, version 3. If a copy of the GPL was not distributed with this
 * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
 */
package net.wurstclient.hacks;

import java.awt.Color;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;

import com.mojang.blaze3d.PrimitiveTopology;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.PoseStack;

import net.minecraft.core.BlockPos;
import net.wurstclient.Category;
import net.wurstclient.SearchTags;
import net.wurstclient.WurstRenderLayers;
import net.wurstclient.events.RenderListener;
import net.wurstclient.events.UpdateListener;
import net.wurstclient.hack.Hack;
import net.wurstclient.settings.BlockListSetting;
import net.wurstclient.settings.ColorSetting;
import net.wurstclient.util.BlockUtils;
import net.wurstclient.util.BlockVertexCompiler;
import net.wurstclient.util.ChatUtils;
import net.wurstclient.util.EasyVertexBuffer;
import net.wurstclient.util.RegionPos;
import net.wurstclient.util.RenderUtils;

@SearchTags({"base finder", "factions"})
public final class BaseFinderHack extends Hack
	implements UpdateListener, RenderListener
{
	private final BlockListSetting naturalBlocks = new BlockListSetting(
		"Natural Blocks",
		"These blocks will be considered part of natural generation.\n\n"
			+ "They will NOT be highlighted as player bases.",
		"minecraft:acacia_leaves", "minecraft:acacia_log", "minecraft:air",
		"minecraft:allium", "minecraft:amethyst_block",
		"minecraft:amethyst_cluster", "minecraft:andesite",
		"minecraft:azure_bluet", "minecraft:bedrock", "minecraft:birch_leaves",
		"minecraft:birch_log", "minecraft:blue_orchid",
		"minecraft:brown_mushroom", "minecraft:brown_mushroom_block",
		"minecraft:bubble_column", "minecraft:budding_amethyst",
		"minecraft:calcite", "minecraft:cave_air", "minecraft:clay",
		"minecraft:coal_ore", "minecraft:cobweb", "minecraft:copper_ore",
		"minecraft:cornflower", "minecraft:dandelion",
		"minecraft:dark_oak_leaves", "minecraft:dark_oak_log",
		"minecraft:dead_bush", "minecraft:deepslate",
		"minecraft:deepslate_coal_ore", "minecraft:deepslate_copper_ore",
		"minecraft:deepslate_diamond_ore", "minecraft:deepslate_emerald_ore",
		"minecraft:deepslate_gold_ore", "minecraft:deepslate_iron_ore",
		"minecraft:deepslate_lapis_ore", "minecraft:deepslate_redstone_ore",
		"minecraft:diamond_ore", "minecraft:diorite", "minecraft:dirt",
		"minecraft:dripstone_block", "minecraft:emerald_ore", "minecraft:fern",
		"minecraft:glow_lichen", "minecraft:gold_ore", "minecraft:granite",
		"minecraft:grass", "minecraft:grass_block", "minecraft:gravel",
		"minecraft:ice", "minecraft:infested_stone", "minecraft:iron_ore",
		"minecraft:jungle_leaves", "minecraft:jungle_log", "minecraft:kelp",
		"minecraft:kelp_plant", "minecraft:lapis_ore",
		"minecraft:large_amethyst_bud", "minecraft:large_fern",
		"minecraft:lava", "minecraft:lilac", "minecraft:lily_of_the_valley",
		"minecraft:lily_pad", "minecraft:medium_amethyst_bud",
		"minecraft:mossy_cobblestone", "minecraft:mushroom_stem",
		"minecraft:nether_quartz_ore", "minecraft:netherrack",
		"minecraft:oak_leaves", "minecraft:oak_log", "minecraft:obsidian",
		"minecraft:orange_tulip", "minecraft:oxeye_daisy", "minecraft:peony",
		"minecraft:pink_tulip", "minecraft:pointed_dripstone",
		"minecraft:poppy", "minecraft:red_mushroom",
		"minecraft:red_mushroom_block", "minecraft:red_tulip",
		"minecraft:redstone_ore", "minecraft:rose_bush", "minecraft:sand",
		"minecraft:sandstone", "minecraft:seagrass",
		"minecraft:small_amethyst_bud", "minecraft:smooth_basalt",
		"minecraft:snow", "minecraft:spawner", "minecraft:spruce_leaves",
		"minecraft:spruce_log", "minecraft:stone", "minecraft:sunflower",
		"minecraft:tall_grass", "minecraft:tall_seagrass", "minecraft:tuff",
		"minecraft:vine", "minecraft:water", "minecraft:white_tulip");
	
	private final ColorSetting color = new ColorSetting("Color",
		"Man-made blocks will be highlighted in this color.", Color.RED);
	
	private ArrayList blockNames;
	
	private final HashSet matchingBlocks = new HashSet<>();
	private ArrayList vertices = new ArrayList<>();
	private EasyVertexBuffer vertexBuffer;
	
	private int messageTimer = 0;
	private int counter;
	
	private RegionPos lastRegion;
	
	public BaseFinderHack()
	{
		super("BaseFinder");
		setCategory(Category.RENDER);
		addSetting(naturalBlocks);
		addSetting(color);
	}
	
	@Override
	public String getRenderName()
	{
		String name = getName() + " [";
		
		// counter
		if(counter >= 10000)
			name += "10000+ blocks";
		else if(counter == 1)
			name += "1 block";
		else if(counter == 0)
			name += "nothing";
		else
			name += counter + " blocks";
		
		name += " found]";
		return name;
	}
	
	@Override
	protected void onEnable()
	{
		// reset timer
		messageTimer = 0;
		blockNames = new ArrayList<>(naturalBlocks.getBlockNames());
		
		EVENTS.add(UpdateListener.class, this);
		EVENTS.add(RenderListener.class, this);
	}
	
	@Override
	protected void onDisable()
	{
		EVENTS.remove(UpdateListener.class, this);
		EVENTS.remove(RenderListener.class, this);
		matchingBlocks.clear();
		vertices.clear();
		
		if(vertexBuffer != null)
			vertexBuffer.close();
		vertexBuffer = null;
		lastRegion = null;
	}
	
	@Override
	public void onRender(PoseStack matrixStack, float partialTicks)
	{
		RegionPos region = RenderUtils.getCameraRegion();
		if(!region.equals(lastRegion))
			onUpdate();
		
		if(vertexBuffer == null)
			return;
		
		matrixStack.pushPose();
		RenderUtils.applyRegionalRenderOffset(matrixStack, region);
		
		vertexBuffer.draw(matrixStack, WurstRenderLayers.ESP_QUADS,
			color.getColorF(), 0.25F);
		
		matrixStack.popPose();
	}
	
	@Override
	public void onUpdate()
	{
		int modulo = MC.player.tickCount % 64;
		RegionPos region = RenderUtils.getCameraRegion();
		
		if(modulo == 0 || !region.equals(lastRegion))
		{
			if(vertexBuffer != null)
				vertexBuffer.close();
			
			vertexBuffer =
				EasyVertexBuffer.createAndUpload(PrimitiveTopology.QUADS,
					DefaultVertexFormat.POSITION_COLOR, buffer -> {
						for(int[] vertex : vertices)
							buffer
								.addVertex(vertex[0] - region.x(), vertex[1],
									vertex[2] - region.z())
								.setColor(0xFFFFFFFF);
					});
			
			lastRegion = region;
		}
		
		// reset matching blocks
		if(modulo == 0)
			matchingBlocks.clear();
		
		int stepSize = MC.level.getHeight() / 64;
		int startY = MC.level.getMaxY() - 1 - modulo * stepSize;
		int endY = Math.max(startY - stepSize, MC.level.getMinY());
		
		BlockPos playerPos =
			BlockPos.containing(MC.player.getX(), 0, MC.player.getZ());
		
		// search matching blocks
		loop: for(int y = startY; y > endY; y--)
			for(int x = 64; x > -64; x--)
				for(int z = 64; z > -64; z--)
				{
					if(matchingBlocks.size() >= 10000)
						break loop;
					
					BlockPos pos = new BlockPos(playerPos.getX() + x, y,
						playerPos.getZ() + z);
					
					if(Collections.binarySearch(blockNames,
						BlockUtils.getName(pos)) >= 0)
						continue;
					
					matchingBlocks.add(pos);
				}
			
		if(modulo != 63)
			return;
		
		// update timer
		if(matchingBlocks.size() < 10000)
			messageTimer--;
		else
		{
			// show message
			if(messageTimer <= 0)
			{
				ChatUtils
					.warning("BaseFinder found \u00a7lA LOT\u00a7r of blocks.");
				ChatUtils.message(
					"To prevent lag, it will only show the first 10000 blocks.");
			}
			
			// reset timer
			messageTimer = 3;
		}
		
		// update counter
		counter = matchingBlocks.size();
		
		// calculate vertices
		vertices = BlockVertexCompiler.compile(matchingBlocks);
	}
}
Kodari AI
KodariJul 18 at 7:19 am 11
BaseFinderPlus
BaseFinderPlus is a Fabric 1.21.11 client-side exploration utility that scans nearby terrain for blocks likely placed by players and highlights those locations in the world. It improves the original BaseFinder behavior with incremental, lag-conscious scanning, configurable scan radius and height coverage, a maximum result limit, customizable highlight color and opacity, periodic progress feedback, and an in-game configuration screen. A keybind toggles the overlay, while a separate UI lets players enable or disable the feature and adjust settings without editing files.
BaseFinderPlus is a Fabric 1.21.11 client-side exploration and base-detection mod inspired by the supplied BaseFinder hack. It scans nearby terrain in controlled slices, highlights non-natural blocks with a configurable translucent overlay, reports scan progress and match counts, and avoids excessive rendering through capped results and region-aware buffers. A compact HUD displays status, range, scan progress, and found blocks. A keybind toggles the HUD independently from the detector, while an in-game YACL configuration screen controls detection, rendering, scan range, color, opacity, result limits, and notification behavior.
  1. Set up a Fabric 1.21.11 client mod with the supplied BaseFinder behavior rebuilt against current Yarn APIs.

  2. Add a bounded, incremental scanner and translucent world highlighting through 1.21.11 rendering events.

  3. Add a configurable HUD, toggle keybinds, persistent YACL settings, and resource metadata.

BaseFinderPlus is a Fabric 1.21.11 client mod that incrementally scans nearby terrain for player-placed blocks and highlights suspicious structures without freezing the game. It provides configurable scan radius, scan budget, highlight limits, colors, transparency, and natural-block filtering. A compact HUD reports scan progress and matches, while keybinds toggle scanning, toggle the HUD, and open a YACL settings screen. Configuration persists automatically between game sessions.

prie

Created BaseFinderPlus, a Fabric 1.21.11 client mod with:

  • Incremental nearby-terrain scanning

  • Configurable radius, scan budget, and highlight limit

  • Suspicious block outline rendering

  • Toggleable HUD with scan progress and match count

  • Keybinds:

    • B — Open settings

    • N — Toggle scanner

    • H — Toggle HUD

  • Persistent JSON configuration

  • YACL settings screen

  • ModMenu integration

  • Fabric 1.21.11 project structure and dependencies

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
14 819
src/client/java/dev/kodari/basefinder/BaseFinderPlusClient.java
package dev.kodari.basefinder;

import dev.kodari.basefinder.config.BaseFinderConfig;
import net.fabricmc.api.ClientModInitializer;
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.WorldRenderEvents;
import net.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;

public final class BaseFinderPlusClient implements ClientModInitializer {
    private static final KeyBinding.Category KEY_CATEGORY = KeyBinding.Category.create(
        Identifier.of(BaseFinderPlus.MOD_ID, "controls")
    );

    private static KeyBinding openConfigKey;
    private static KeyBinding toggleScannerKey;
    private static KeyBinding toggleHudKey;

    private static BaseFinderScanner scanner;

    @Override
    public void onInitializeClient() {
        BaseFinderConfig.load();

        MinecraftClient client = MinecraftClient.getInstance();
        scanner = new BaseFinderScanner(client);

        openConfigKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.basefinderplus.open_config",
            GLFW.GLFW_KEY_B,
            KEY_CATEGORY
        ));
        toggleScannerKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.basefinderplus.toggle_scanner",
            GLFW.GLFW_KEY_N,
            KEY_CATEGORY
        ));
        toggleHudKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.basefinderplus.toggle_hud",
            GLFW.GLFW_KEY_H,
            KEY_CATEGORY
        ));

        ClientTickEvents.END_CLIENT_TICK.register(BaseFinderPlusClient::onClientTick);
        WorldRenderEvents.AFTER_ENTITIES.register(BaseFinderRenderer::render);
        HudElementRegistry.addLast(
            Identifier.of(BaseFinderPlus.MOD_ID, "status_hud"),
            BaseFinderHud::render
        );
    }

    private static void onClientTick(MinecraftClient client) {
        scanner.tick();

        while (openConfigKey.wasPressed()) {
            client.setScreen(BaseFinderConfigScreen.create(client.currentScreen));
        }

        while (toggleScannerKey.wasPressed()) {
            BaseFinderConfig config = BaseFinderConfig.get();
            config.enabled = !config.enabled;
            BaseFinderConfig.save();
            scanner.reset();
        }

        while (toggleHudKey.wasPressed()) {
            BaseFinderConfig config = BaseFinderConfig.get();
            config.showHud = !config.showHud;
            BaseFinderConfig.save();
        }
    }

    public static BaseFinderScanner scanner() {
        return scanner;
    }
}