-
Notifications
You must be signed in to change notification settings - Fork 15
Refactor of TanukiEgapFinder + AutoSearch #94
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
Conversation
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.
|
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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;
}There was a problem hiding this comment.
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.
|
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 |
cqb13
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all good
|
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. |
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.