Skip to content

Conversation

@Mars190
Copy link
Contributor

@Mars190 Mars190 commented Dec 22, 2025

The Module EgapFinder is a much more readable and maintainable version fo TanukiEgapFinder with the option of a simple AutoSearch as well. I plan to write an AutoSearch that is not moving you on a straight line but in a spiral.

I appreciate suggestions / any help as this is my first big work on a metero-client moduel.

The Module EgapFinder is a much more readable and maintainable version fo TanukiEgapFinder with the option of a simple AutoSearch as well.
I plan to write an AutoSearch that is not moving you on a straight line but in a spiral.
@Mars190 Mars190 changed the title Refactor of TanukiEgapFinder + Simple AutoSearch Refactor of TanukiEgapFinder + AutoSearch Dec 22, 2025
@Mars190 Mars190 marked this pull request as draft December 22, 2025 21:26
@cqb13
Copy link
Owner

cqb13 commented Dec 22, 2025

It looks good, thank you for taking the time to clean up the code. Just a couple small things, could you please change the file name back to TanukiEgapFinder and add back the link to the original module from tanuki instead of just linking to the repository.

/**
 * Original from Tanuki:
 * https://gitlab.com/Walaryne/tanuki/-/blob/master/src/main/java/minegame159/meteorclient/modules/misc/EgapFinder.java
 */

private static final String OUTPUT_FILE = "egap-coords.txt";
private static final int COMPARATOR_DELAY_TICKS = 3;
private static final int NO_CHEST_TICK_THRESHOLD = 2;
private static final int CHUNK_SEARCHED_THRESHOLD = 10 * 20;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently I use a timer to determine when auto search should go locate the next search area, could I somehow detect through meteor if every chunk in the render distance is loaded instead of a simple 10 second cooldown? If you optimize that then you could get a few seconds out of every search area, which adds up.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ChunkManager.isChunkLoaded() is probably what you are looking for.

I would try something like this

public boolean isRenderDistanceFullyLoaded() {
        var chunkManager = mc.world.getChunkManager();

        ChunkPos playerChunk = mc.player.getChunkPos();
        int renderDistance = mc.options.getViewDistance().getValue();

        int centerX = playerChunk.x;
        int centerZ = playerChunk.z;

        for (int dx = -renderDistance; dx <= renderDistance; dx++) {
            for (int dz = -renderDistance; dz <= renderDistance; dz++) {
                int chunkX = centerX + dx;
                int chunkZ = centerZ + dz;

                if (!chunkManager.isChunkLoaded(chunkX, chunkZ)) {
                    return false;
                }
            }
        }

        return true;
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll try that later, currently I'm trying out the onChunkData event with a simple tick counter

This makes the module a bit more flexible as it now also can be configured by the user.
@Mars190 Mars190 marked this pull request as ready for review December 23, 2025 00:16
@Mars190
Copy link
Contributor Author

Mars190 commented Dec 23, 2025

This would be the pr from my side, if see where I could make some improvements, if I can I'll implement them. I tested the module on two seperate worlds and it worked good enough, sometimes there was the error Can't replace block or something like that but that was a problem beforehand as well. If you want to be sure you don't miss any chests I'd say turn down the renderDistance value to your render distance - 1 so you have overlapping chunks (though it is less efficient)

Copy link
Owner

@cqb13 cqb13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good

@cqb13 cqb13 merged commit aee3c9d into cqb13:master Dec 23, 2025
@Mars190
Copy link
Contributor Author

Mars190 commented Dec 23, 2025

I now just realized that debug should either be false, should be removed or should be turned into a user option instead of just being on. I can do that tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants