Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Feels like it works.
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeRNG committed May 10, 2022
1 parent d711615 commit 593e7ba
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 11 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Get Action Dump
This took too long to make.

## How to use

I connect to df with an alternate IP (**54.39.130.89**) since it seemed to diconnect me less.
Go onto Node Beta (or any other development node) and run `/actiondump [colours]` \(\[colours\] replaces the colours with & codes.\)
There also is `/reportkeepalives <on|off>`, which doing the above command might work better after it reports a keepAlive. However doing /actiondump immediately on join might be better then that.
Wait for it to complete. There are roughly **87180 lines** and it takes me ***77 seconds*** to complete.

## After complete

Once it is complete, you will be disconnected and sent to a custom menu.
It has three options:
**Main Menu**: Sends you to the Main Menu.
**Copy Data**: Copies the data exported to the actiondump (or error data if it's an error screen)
**Copy Path**: Copies the path in which getactiondump uses.

The info is put into the `.minecraft/getactiondump`.
The database is put into `db.json`.


The info is put into the `.minecraft/getactiondump`.
Running the actiondump command is buggy, but doesn't do anything if dumpactioninfo like messages aren't seen.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected void init() {
this.addDrawableChild(new ButtonWidget(GoodX, Math.min(GoodY + 9, this.height - 30), 200, 20, new LiteralText("Main Menu"), (button) -> {
assert this.client != null;
this.client.setScreen(this.parent);
GetActionDump.DisconnectMenu = null;
}));
this.addDrawableChild(new ButtonWidget(GoodX, Math.min(GoodY + 9, this.height - 30) + ((20)), 200, 20, new LiteralText("Copy Data"), (button -> new Clipboard().setClipboard(0, clipboard))));
this.addDrawableChild(new ButtonWidget(GoodX, Math.min(GoodY + 9, this.height - 30) + ((20 * 2)), 200, 20, new LiteralText("Copy Path"), (button -> new Clipboard().setClipboard(0, FileManager.Path().toString()))));
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/dev/dfonline/getactiondump/database.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ public static void addData(String data){
public static void save() throws IOException{
FileManager.WriteFile("db.json",Data.replaceAll("\\n$",""));
}

public void close(){
GetActionDump.overlayText = new String[]{};
GetActionDump.reportKeepAlives = false;
if(GetActionDump.db != null){
GetActionDump.db = null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void OnChatMessage(GameMessageS2CPacket packet, CallbackInfo ci){
"§eLines: §b" + database.Lines +
"\n§eSize: §b" + database.Length +
"\n§eTime: §b" + ((float)(System.currentTimeMillis() - database.startTime.getTime()) / 1000) +
"\n§eThe file can be found in: §b" + FileManager.Path()
"\n§eThe file can be found in:\n§b" + FileManager.Path()
),database.Data));
}
catch(IOException e){ // an error
Expand All @@ -48,7 +48,7 @@ private void OnChatMessage(GameMessageS2CPacket packet, CallbackInfo ci){
),e.getMessage() + "\n" + e.getStackTrace()));
LOGGER.error(e.getMessage());
}
db = null;
db.close();
}
}
else { // for starting the actiondump
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ public class MinecraftDisconnection {
private void tick(CallbackInfo ci){
if(GetActionDump.DisconnectMenu != null){
ci.cancel();
assert GetActionDump.MC.world != null;
GetActionDump.MC.world.disconnect();
GetActionDump.MC.disconnect(GetActionDump.DisconnectMenu);
GetActionDump.DisconnectMenu = null;
if(GetActionDump.MC.world != null){
GetActionDump.MC.world.disconnect();
GetActionDump.MC.disconnect(GetActionDump.DisconnectMenu);
if(GetActionDump.db != null){
GetActionDump.db.close();
}
GetActionDump.DisconnectMenu = null;
}
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/dev/dfonline/getactiondump/mixin/onExit.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
public class onExit {
@Inject(method = "disconnect", at = @At("HEAD"))
public void disconnect(CallbackInfo ci){
if(GetActionDump.DisconnectMenu == null){
GetActionDump.db = null;
if(GetActionDump.DisconnectMenu == null && GetActionDump.db != null){
GetActionDump.db.close();
}
}
}

0 comments on commit 593e7ba

Please sign in to comment.