Skip to content

Commit 0148fae

Browse files
committed
upload scoreboard on login
1 parent 52c8063 commit 0148fae

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies {
4343
// Fabric API. This is technically optional, but you probably want it anyway.
4444
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
4545

46-
modImplementation include("com.github.Coflnet:CoflSkyCore:1fec2a1e62")
46+
modImplementation include("com.github.Coflnet:CoflSkyCore:7f0caa7519")
4747
modImplementation include("org.greenrobot:eventbus-java:3.3.1")
4848
modImplementation include("org.java-websocket:Java-WebSocket:1.5.2")
4949
modImplementation include("com.google.code.gson:gson:2.10.1")

src/client/java/com/coflnet/CoflModClient.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,15 @@ private static void uploadScoreboard() {
728728
CoflCore.Wrapper.SendMessage(data);
729729
}
730730

731+
/**
732+
* Public method to upload both scoreboard and tab list.
733+
* Called by EventSubscribers when the backend signals it's ready (OnLoggedIn event).
734+
*/
735+
public static void uploadScoreboardAndTabList() {
736+
uploadScoreboard();
737+
uploadTabList();
738+
}
739+
731740
public static FlipData popFlipData() {
732741
FlipData fd = EventSubscribers.flipData;
733742
EventSubscribers.flipData = null;

src/client/java/com/coflnet/EventSubscribers.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,10 @@ public void onHighlightBlocks(OnHighlightBlocks event){
185185
public void onHotkeyRegister(HotkeyRegister[] hotkeys){
186186
CoflModClient.setHotKeys(hotkeys);
187187
}
188+
189+
@Subscribe
190+
public void onLoggedIn(OnLoggedIn event){
191+
System.out.println("Backend logged in event received, uploading scoreboard and tab list...");
192+
CoflModClient.uploadScoreboardAndTabList();
193+
}
188194
}

0 commit comments

Comments
 (0)