-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
65 additions
and
1 deletion.
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
12 changes: 12 additions & 0 deletions
12
fabric/src/main/java/ca/spottedleaf/moonrise/fabric/MoonriseModMenuHook.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package ca.spottedleaf.moonrise.fabric; | ||
|
||
import ca.spottedleaf.moonrise.common.config.MoonriseConfigScreen; | ||
import com.terraformersmc.modmenu.api.ConfigScreenFactory; | ||
import com.terraformersmc.modmenu.api.ModMenuApi; | ||
|
||
public final class MoonriseModMenuHook implements ModMenuApi { | ||
@Override | ||
public ConfigScreenFactory<?> getModConfigScreenFactory() { | ||
return MoonriseConfigScreen::create; | ||
} | ||
} |
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
20 changes: 20 additions & 0 deletions
20
neoforge/src/main/java/ca/spottedleaf/moonrise/neoforge/MoonriseNeoForge.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package ca.spottedleaf.moonrise.neoforge; | ||
|
||
import ca.spottedleaf.moonrise.common.config.MoonriseConfigScreen; | ||
import net.neoforged.bus.api.IEventBus; | ||
import net.neoforged.fml.ModLoadingContext; | ||
import net.neoforged.fml.common.Mod; | ||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; | ||
import net.neoforged.neoforge.client.gui.IConfigScreenFactory; | ||
|
||
@Mod("moonrise") | ||
public final class MoonriseNeoForge { | ||
public MoonriseNeoForge(final IEventBus modBus) { | ||
modBus.addListener(FMLClientSetupEvent.class, event -> { | ||
ModLoadingContext.get().registerExtensionPoint( | ||
IConfigScreenFactory.class, | ||
() -> (modContainer, parent) -> MoonriseConfigScreen.create(parent) | ||
); | ||
}); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/ca/spottedleaf/moonrise/common/config/MoonriseConfigScreen.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package ca.spottedleaf.moonrise.common.config; | ||
|
||
import me.shedaniel.clothconfig2.api.ConfigBuilder; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.network.chat.Component; | ||
|
||
public final class MoonriseConfigScreen { | ||
private MoonriseConfigScreen() { | ||
} | ||
|
||
public static Screen create(final Screen parent) { | ||
final ConfigBuilder builder = ConfigBuilder.create() | ||
.setParentScreen(parent) | ||
.setTitle(Component.translatable("title.examplemod.config")); | ||
|
||
return builder.build(); | ||
} | ||
} |