update to more recent Forge (GUI factory changes)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@ run/
|
||||
.gradle/
|
||||
build/
|
||||
classes/
|
||||
temp/
|
||||
|
||||
@@ -32,8 +32,8 @@ dependencies {
|
||||
shade "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
||||
}
|
||||
minecraft {
|
||||
version = '1.11.2-13.20.0.2232'
|
||||
mappings = 'snapshot_20161210'
|
||||
version = '1.11.2-13.20.1.2386'
|
||||
mappings = 'snapshot_20170612'
|
||||
runDir = 'run'
|
||||
}
|
||||
processResources {
|
||||
|
||||
@@ -33,7 +33,7 @@ object Client {
|
||||
|
||||
val configKey = KeyHandler(BetterFoliageMod.MOD_NAME, 66, "key.betterfoliage.gui") {
|
||||
FMLClientHandler.instance().showGuiScreen(
|
||||
ConfigGuiFactory.ConfigGuiBetterFoliage(Minecraft.getMinecraft().currentScreen)
|
||||
ConfigGuiFactory.createBFConfigGui(Minecraft.getMinecraft().currentScreen)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,12 +9,18 @@ import net.minecraftforge.fml.client.config.GuiConfig
|
||||
|
||||
class ConfigGuiFactory : IModGuiFactory {
|
||||
|
||||
override fun mainConfigGuiClass() = ConfigGuiBetterFoliage::class.java
|
||||
override fun runtimeGuiCategories() = hashSetOf<IModGuiFactory.RuntimeOptionCategoryElement>()
|
||||
// Deprecated stuff
|
||||
override fun mainConfigGuiClass() = null
|
||||
override fun getHandlerFor(element: IModGuiFactory.RuntimeOptionCategoryElement?) = null
|
||||
override fun initialize(minecraftInstance: Minecraft?) { }
|
||||
|
||||
class ConfigGuiBetterFoliage(parentScreen: GuiScreen?) : GuiConfig(
|
||||
override fun initialize(minecraftInstance: Minecraft?) { }
|
||||
override fun hasConfigGui() = true
|
||||
override fun runtimeGuiCategories() = hashSetOf<IModGuiFactory.RuntimeOptionCategoryElement>()
|
||||
override fun createConfigGui(parentScreen: GuiScreen?) = createBFConfigGui(parentScreen)
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun createBFConfigGui(parentScreen: GuiScreen?) = GuiConfig(
|
||||
parentScreen,
|
||||
Config.rootGuiElements,
|
||||
BetterFoliageMod.MOD_ID,
|
||||
@@ -23,4 +29,5 @@ class ConfigGuiFactory : IModGuiFactory {
|
||||
false,
|
||||
BetterFoliageMod.MOD_NAME
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class NonVerboseArrayEntry(
|
||||
init {
|
||||
stripTooltipDefaultText(toolTip as MutableList<String>)
|
||||
val shortDefaults = I18n.format("${configElement.languageKey}.arrayEntry", configElement.defaults.size)
|
||||
toolTip.addAll(mc.fontRendererObj.listFormattedStringToWidth("$AQUA${I18n.format("fml.configgui.tooltip.default", shortDefaults)}", 300))
|
||||
toolTip.addAll(mc.fontRenderer.listFormattedStringToWidth("$AQUA${I18n.format("fml.configgui.tooltip.default", shortDefaults)}", 300))
|
||||
}
|
||||
|
||||
override fun updateValueButtonText() {
|
||||
|
||||
Reference in New Issue
Block a user