Skip to content

Commit

Permalink
Add ModMenu integration
Browse files Browse the repository at this point in the history
This allows players to access MapSync's configuration GUI from ModMenu.
  • Loading branch information
Protonull authored and Gjum committed Oct 12, 2023
1 parent febfff0 commit e8e99cb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ModGui extends Screen {
EditBox syncServerAddressField;
Button syncServerConnectBtn;

protected ModGui(Screen parentScreen) {
public ModGui(Screen parentScreen) {
super(new TextComponent("Map-Sync"));
this.parentScreen = parentScreen;
}
Expand Down
5 changes: 5 additions & 0 deletions mod/fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ dependencies {
modCompileOnly "maven.modrinth:journeymap:5JbcGXLn"
// https://modrinth.com/mod/xaeros-minimap/version/23.6.2_Fabric_1.18.2 (23.6.2 fabric)
modCompileOnly "maven.modrinth:xaeros-minimap:Jwydpps9"



// https://modrinth.com/mod/modmenu/version/3.2.5 (3.2.5 fabric)
modCompileOnly "maven.modrinth:modmenu:nVxObSbX"
}

processResources {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package gjum.minecraft.mapsync.fabric.integrations.modmenu;

import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import gjum.minecraft.mapsync.common.ModGui;
import org.jetbrains.annotations.NotNull;

/**
* Adds support for https://github.com/TerraformersMC/ModMenu (Fabric only)
*/
public class ModMenuIntegration implements ModMenuApi {
public @NotNull ConfigScreenFactory<ModGui> getModConfigScreenFactory() {
return ModGui::new;
}
}
3 changes: 3 additions & 0 deletions mod/fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"entrypoints": {
"client": [
"gjum.minecraft.mapsync.fabric.FabricMapSyncMod"
],
"modmenu": [
"gjum.minecraft.mapsync.fabric.integrations.modmenu.ModMenuIntegration"
]
},
"depends": {
Expand Down

0 comments on commit e8e99cb

Please sign in to comment.