File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
src/client/java/com/coflnet Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 4747import CoflCore .commands .CommandType ;
4848import CoflCore .commands .RawCommand ;
4949import CoflCore .commands .models .FlipData ;
50+ import CoflCore .commands .models .ModListData ;
5051import CoflCore .handlers .DescriptionHandler ;
5152import CoflCore .handlers .EventRegistry ;
5253import it .unimi .dsi .fastutil .objects .ObjectArrayList ;
@@ -1505,4 +1506,14 @@ private void checkAndHandleAccountSwitch() {
15051506 // Update last checked username
15061507 lastCheckedUsername = currentUsername ;
15071508 }
1509+
1510+ public static void cacheMods () {
1511+ ModListData modListData = new ModListData ();
1512+ for (net .fabricmc .loader .api .ModContainer mod : FabricLoader .getInstance ().getAllMods ()) {
1513+ modListData .addModname (mod .getMetadata ().getName ());
1514+ modListData .addFilename (mod .getMetadata ().getName ());
1515+ modListData .addFilename (mod .getMetadata ().getId ());
1516+ }
1517+ CoflCore .Wrapper .SendMessage (new RawCommand ("foundMods" , gson .toJson (modListData )));
1518+ }
15081519}
Original file line number Diff line number Diff line change @@ -191,4 +191,9 @@ public void onLoggedIn(OnLoggedIn event){
191191 System .out .println ("Backend logged in event received, uploading scoreboard and tab list..." );
192192 CoflModClient .uploadScoreboardAndTabList ();
193193 }
194+
195+ @ Subscribe
196+ public void onModRequestReceive (OnModRequestReceive event ){
197+ CoflModClient .cacheMods ();
198+ }
194199}
You can’t perform that action at this time.
0 commit comments