2018-06-15 19:03:35 +00:00
|
|
|
/*
|
|
|
|
* Minecraft Forge
|
2019-02-10 22:57:03 +00:00
|
|
|
* Copyright (c) 2016-2019.
|
2018-06-15 19:03:35 +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
|
|
|
|
*/
|
|
|
|
|
|
|
|
package net.minecraftforge.fml;
|
|
|
|
|
2019-01-15 03:32:43 +00:00
|
|
|
import net.minecraftforge.fml.event.lifecycle.*;
|
2018-06-15 19:03:35 +00:00
|
|
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
|
|
|
public enum ModLoadingStage
|
|
|
|
{
|
|
|
|
ERROR(null),
|
2018-09-29 01:07:46 +00:00
|
|
|
VALIDATE(null),
|
2018-06-19 18:04:05 +00:00
|
|
|
CONSTRUCT(null),
|
2019-01-20 04:26:25 +00:00
|
|
|
CREATE_REGISTRIES(null),
|
|
|
|
LOAD_REGISTRIES(null),
|
2019-01-15 03:32:43 +00:00
|
|
|
COMMON_SETUP(()-> FMLCommonSetupEvent::new),
|
|
|
|
SIDED_SETUP(SidedProvider.SIDED_SETUP_EVENT::get),
|
|
|
|
ENQUEUE_IMC(()-> InterModEnqueueEvent::new),
|
|
|
|
PROCESS_IMC(()-> InterModProcessEvent::new),
|
|
|
|
COMPLETE(()-> FMLLoadCompleteEvent::new),
|
2019-06-16 01:24:45 +00:00
|
|
|
DONE(null),
|
|
|
|
GATHERDATA(ModLoader.get()::getDataGeneratorEvent);
|
2018-06-15 19:03:35 +00:00
|
|
|
private final Supplier<Function<ModContainer, ModLifecycleEvent>> modLifecycleEventFunction;
|
|
|
|
|
|
|
|
ModLoadingStage(Supplier<Function<ModContainer, ModLifecycleEvent>> modLifecycleEventFunction)
|
|
|
|
{
|
|
|
|
this.modLifecycleEventFunction = modLifecycleEventFunction;
|
|
|
|
}
|
|
|
|
|
2019-02-02 01:37:04 +00:00
|
|
|
public ModLifecycleEvent getModEvent(ModContainer modContainer)
|
2018-06-15 19:03:35 +00:00
|
|
|
{
|
2019-02-02 01:37:04 +00:00
|
|
|
return modLifecycleEventFunction.get().apply(modContainer);
|
2018-06-15 19:03:35 +00:00
|
|
|
}
|
|
|
|
}
|