Aras Karami

Create a module named Chunk Finder under the Visuals category. The module should scan the surrounding area for amethyst geodes and other structures or environmental features that may indicate player activity.

Include customizable settings for scan sensitivity and simulation distance, allowing users to adjust how thoroughly the area is scanned and how far the module searches. Ensure the module integrates seamlessly with the existing interface, follows the current visual design, and remains fully compatible with the current version of the project.

Implement the module with clean, efficient, and well-organized code, ensuring that all settings function correctly and that the module behaves consistently with the existing modules. Make it a mod (.jar) for 1.21.11 fabric.

Make the gui look like the image i attached please.

--- 📎 Attached 1 file(s):

File: pasted-code-1792883225238.txt

txt
package com.donut.client.modules.visual;

import com.donut.client.module.Category;
import com.donut.client.module.Module;
import com.donut.client.setting.BooleanSetting;
import com.donut.client.setting.SliderSetting;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.chunk.WorldChunk;
import net.minecraft.block.Blocks;
import net.minecraft.block.BlockState;

import java.awt.Color;
import java.util.concurrent.ConcurrentHashMap;

public class ChunkFinderModule extends Module {

    // Customizable Settings
    private final SliderSetting scanSensitivity = settings.add(new SliderSetting("Scan Sensitivity", 1.0, 5.0, 10.0, 1));
    private final SliderSetting simulationDistance = settings.add(new SliderSetting("Simulation Distance", 4.0, 12.0, 32.0, 1));
    private final BooleanSetting detectGeodes = settings.add(new BooleanSetting("Detect Geodes", true));
    private final BooleanSetting detectActivity = settings.add(new BooleanSetting("Player Activity", true));

    // Cache to store discovered chunks and their classification
    private final ConcurrentHashMap<ChunkPos, ChunkType> discoveredChunks = new ConcurrentHashMap<>();

    public enum ChunkType {
        GEODE(new Color(138, 43, 226, 180)),      // Purple highlight
        ACTIVITY(new Color(255, 69, 0, 180));     // Orange/Red highlight

        private final Color color;
        ChunkType(Color color) { this.color = color; }
        public Color getColor() { return color; }
    }

    public ChunkFinderModule() {
        super("Chunk Finder", "Scan surrounding chunks for geodes and player activity", Category.VISUAL);
    }

    @Override
    public void onEnable() {
        discoveredChunks.clear();
    }

    @Override
    public void onTick() {
        if (mc.world == null || mc.player == null) return;

        int radius = (int) simulationDistance.getValue();
        ChunkPos playerChunk = mc.player.getChunkPos();
        int sensitivityInterval = Math.max(1, (int) (11 - scanSensitivity.getValue()));

        // Scan chunks within the simulation distance radius
        for (int x = -radius; x <= radius; x++) {
            for (int z = -radius; z <= radius; z++) {
                int chunkX = playerChunk.x + x;
                int chunkZ = playerChunk.z + z;
                ChunkPos pos = new ChunkPos(chunkX, chunkZ);

                if (mc.world.isChunkLoaded(chunkX, chunkZ) && !discoveredChunks.containsKey(pos)) {
                    if ((Math.abs(chunkX + chunkZ) % sensitivityInterval) == 0) {
                        WorldChunk chunk = mc.world.getChunk(chunkX, chunkZ);
                        analyzeChunk(chunk, pos);
                    }
                }
            }
        }
    }

    private void analyzeChunk(WorldChunk chunk, ChunkPos pos) {
        // Check block entities and blocks for geodes or player activity
        boolean hasGeode = false;
        boolean hasActivity = false;

        // Efficient scan across vertical height bounds
        for (int y = mc.world.getBottomY(); y < mc.world.getTopY(); y += 16) {
            BlockState state = chunk.getBlockState(pos.getStartPos().withY(y));
            
            // Detect Amethyst components (Budding Amethyst / Calcite indicator)
            if (detectGeodes.getValue() && (state.isOf(Blocks.BUDDING_AMETHYST) || state.isOf(Blocks.CALCITE))) {
                hasGeode = true;
            }

            // Detect potential player activity (placed storage, chests, or non-natural blocks)
            if (detectActivity.getValue() && (state.isOf(Blocks.CHEST) || state.isOf(Blocks.BARREL) || state.isOf(Blocks.CRAFTING_TABLE))) {
                hasActivity = true;
            }
        }

        if (hasGeode) {
            discoveredChunks.put(pos, ChunkType.GEODE);
        } else if (hasActivity) {
            discoveredChunks.put(pos, ChunkType.ACTIVITY);
        }
    }

    @Override
    public void onRender3D(MatrixStack matrices, float tickDelta) {
        if (mc.world == null || discoveredChunks.isEmpty()) return;

        // Render outlines/boxes for discovered chunks in 3D world space
        for (var entry : discoveredChunks.entrySet()) {
            ChunkPos pos = entry.getKey();
            ChunkType type = entry.getValue();

            // Render logic interfacing with your client's existing Render3D utilities
            renderChunkBox(matrices, pos, type.getColor());
        }
    }

    private void renderChunkBox(MatrixStack matrices, ChunkPos pos, Color color) {
        // Coordinates and box rendering implementation matching StorageFinder / Base Finder
        int minX = pos.getStartX();
        int minZ = pos.getStartZ();
        int maxX = pos.getEndX();
        int maxZ = pos.getEndZ();
        int minY = mc.world.getBottomY();
        int maxY = mc.world.getTopY();

        // Call your client's built-in box outline renderer here
        // e.g., RenderUtils.drawBox(matrices, minX, minY, minZ, maxX, maxY, maxZ, color);
    }
}

[Viewing 1 image]

Kodari AI
KodariOct 24 at 11:25 pm 5
ChunkFinder
A Fabric mod for Minecraft 1.21.11 that scans surrounding chunks for amethyst geodes and player activity indicators. Features customizable scan sensitivity and simulation distance sliders, plus toggles for geode and activity detection. Efficiently analyzes loaded chunks using vertical sampling, caches discoveries in a concurrent map, and renders colored 3D box overlays (purple for geodes, orange for activity) around detected chunks. Integrates seamlessly with the existing visual module interface and design language.
  1. Create a standalone Fabric 1.21.11 mod scaffold and register Chunk Finder under a Visuals-style module screen.

  2. Scan only loaded chunks incrementally for geode indicators and player-placed storage/workstation blocks.

  3. Add a polished owo-ui screen matching the attached dark, green-accented layout, with sensitivity and distance controls.

Created a Fabric 1.21.11 client mod with a Chunk Finder screen styled after your reference. Press J to open it.

It scans already-loaded chunks for amethyst geode indicators and chests, barrels, or crafting tables, then outlines matches. The screen includes toggles, scan sensitivity, and a search radius of 4–32 chunks. Higher sensitivity checks more blocks; the scanner does not request unloaded chunks.

To get the .jar: click Compile in the desktop top bar (or ⋮ → Compile Project on phone), click Compile, then click Download when the build succeeds.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
9 643
src/client/java/com/kodari/chunkfinder/ChunkFinderClient.java
package com.kodari.chunkfinder;

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.hud.HudElementRegistry;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;

public final class ChunkFinderClient implements ClientModInitializer {
    public static final String MOD_ID = "chunkfinder";
    public static final ChunkFinderScanner SCANNER = new ChunkFinderScanner();

    private static final KeyBinding.Category KEY_CATEGORY = KeyBinding.Category.create(Identifier.of(MOD_ID, "client"));
    private static final KeyBinding OPEN_SCREEN = KeyBindingHelper.registerKeyBinding(
            new KeyBinding("key.chunkfinder.open", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_J, KEY_CATEGORY)
    );

    @Override
    public void onInitializeClient() {
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            SCANNER.tick(client);
            while (OPEN_SCREEN.wasPressed()) {
                client.setScreen(new ChunkFinderScreen(SCANNER));
            }
        });

        HudElementRegistry.addLast(Identifier.of(MOD_ID, "scan_results"), (context, tickCounter) -> SCANNER.renderHud(context));
    }
}