[1.14] Allow opening of replay settings via ModMenu

This commit is contained in:
Jonas Herzig
2019-06-20 18:43:19 +02:00
parent 5305352b77
commit de0f40f4dd
3 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
//#if MC>=11400
package com.replaymod.core.gui;
import com.replaymod.core.ReplayMod;
import io.github.prospector.modmenu.api.ModMenuApi;
import net.minecraft.client.gui.screen.Screen;
import java.util.function.Function;
public class ModMenuApiImpl implements ModMenuApi {
@Override
public String getModId() {
return ReplayMod.MOD_ID;
}
@Override
public Function<Screen, ? extends Screen> getConfigScreenFactory() {
return parent -> new GuiReplaySettings(parent, ReplayMod.instance.getSettingsRegistry()).toMinecraft();
}
}
//#endif

View File

@@ -21,6 +21,9 @@
"entrypoints": { "entrypoints": {
"client": [ "client": [
"com.replaymod.core.ReplayMod" "com.replaymod.core.ReplayMod"
],
"modmenu": [
"com.replaymod.core.gui.ModMenuApiImpl"
] ]
}, },
"mixins": [ "mixins": [

View File

@@ -261,6 +261,10 @@ dependencies {
shadow files(project(":jGui:$jGuiVersion").tasks.preshadowJar.archivePath) // include pre-shadowed lwjgl_util shadow files(project(":jGui:$jGuiVersion").tasks.preshadowJar.archivePath) // include pre-shadowed lwjgl_util
} }
if (FABRIC) {
modCompile 'io.github.prospector.modmenu:ModMenu:1.6.2-92'
}
annotationProcessor 'org.projectlombok:lombok:1.16.6' annotationProcessor 'org.projectlombok:lombok:1.16.6'
compile 'org.projectlombok:lombok:1.16.6' // runtime only for @SneakyThrows which isn't used compile 'org.projectlombok:lombok:1.16.6' // runtime only for @SneakyThrows which isn't used