2016-06-23 03:49:47 +00:00
|
|
|
/*
|
|
|
|
* Minecraft Forge
|
2018-09-21 09:15:03 +00:00
|
|
|
* Copyright (c) 2016-2018.
|
2016-06-23 03:49:47 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation version 2.1
|
|
|
|
* of the License.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2018-06-11 13:56:44 +00:00
|
|
|
package net.minecraftforge.fml.client;
|
2013-12-16 16:48:09 +00:00
|
|
|
|
2018-06-11 13:56:44 +00:00
|
|
|
import net.minecraft.client.Minecraft;
|
|
|
|
import net.minecraft.client.gui.GuiScreen;
|
2018-06-15 19:03:35 +00:00
|
|
|
import net.minecraftforge.fml.ModList;
|
2018-06-19 18:04:05 +00:00
|
|
|
import net.minecraftforge.fml.ExtensionPoint;
|
2018-06-11 13:56:44 +00:00
|
|
|
import net.minecraftforge.fml.loading.moddiscovery.ModInfo;
|
|
|
|
|
|
|
|
import java.util.Optional;
|
|
|
|
import java.util.function.BiFunction;
|
|
|
|
|
|
|
|
public class ConfigGuiHandler
|
2013-12-16 16:48:09 +00:00
|
|
|
{
|
2018-06-11 13:56:44 +00:00
|
|
|
public static Optional<BiFunction<Minecraft, GuiScreen, GuiScreen>> getGuiFactoryFor(ModInfo selectedMod)
|
|
|
|
{
|
2018-06-15 19:03:35 +00:00
|
|
|
return ModList.get().getModContainerById(selectedMod.getModId()).
|
|
|
|
flatMap(mc -> mc.getCustomExtension(ExtensionPoint.GUIFACTORY));
|
2018-06-11 13:56:44 +00:00
|
|
|
}
|
2013-12-16 16:48:09 +00:00
|
|
|
}
|