-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
now runs on 1.19.2 yacl gone
- Loading branch information
Showing
11 changed files
with
18 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 2 additions & 24 deletions
26
src/main/java/com/goby56/wakes/config/ModMenuIntegration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,13 @@ | ||
package com.goby56.wakes.config; | ||
|
||
import com.goby56.wakes.WakesClient; | ||
import com.goby56.wakes.utils.WakesUtils; | ||
import com.terraformersmc.modmenu.api.ConfigScreenFactory; | ||
import com.terraformersmc.modmenu.api.ModMenuApi; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.gui.screen.ConfirmScreen; | ||
import net.minecraft.screen.ScreenTexts; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.Util; | ||
|
||
import java.net.URI; | ||
import eu.midnightdust.lib.config.MidnightConfig; | ||
|
||
public class ModMenuIntegration implements ModMenuApi { | ||
@Override | ||
public ConfigScreenFactory<?> getModConfigScreenFactory() { | ||
// Great idea taken from Benjamin Norton: https://github.com/Benjamin-Norton | ||
// Do a barrel roll is a sick mod. Go download: https://modrinth.com/mod/do-a-barrel-roll | ||
if (WakesClient.isYACLLoaded()) { | ||
return YACLIntegration::createScreen; | ||
} else { | ||
return parent -> new ConfirmScreen(result -> { | ||
if (result) { | ||
Util.getOperatingSystem().open(URI.create("https://modrinth.com/mod/yacl/versions")); | ||
} | ||
MinecraftClient.getInstance().setScreen(parent); | ||
}, Text.translatable(String.format("%s.%s", WakesClient.MOD_ID, "yacl_missing")), | ||
Text.translatable(String.format("%s.%s", WakesClient.MOD_ID, "yacl_missing.message")), | ||
ScreenTexts.YES, | ||
ScreenTexts.NO); | ||
} | ||
// https://github.com/enjarai/do-a-barrel-roll/blob/1.20/dev/src/main/java/nl/enjarai/doabarrelroll/compat/modmenu/ModMenuIntegration.java#L18 | ||
return parent -> MidnightConfig.getScreen(parent, WakesClient.MOD_ID); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.