ForgePatch/src/main/java/net/minecraftforge/fml/loading/FMLCommonLaunchHandler.java

57 lines
2.0 KiB
Java
Raw Normal View History

/*
* Minecraft Forge
* Copyright (c) 2016-2018.
*
* 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.loading;
import cpw.mods.modlauncher.api.IEnvironment;
import cpw.mods.modlauncher.api.ITransformingClassLoader;
2018-06-21 19:37:32 +00:00
import net.minecraftforge.api.distmarker.Dist;
2018-06-23 02:45:01 +00:00
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
2018-06-23 02:45:01 +00:00
public abstract class FMLCommonLaunchHandler
{
private static final List<String> SKIPPACKAGES = Arrays.asList(
// standard libs
"joptsimple.", "org.lwjgl.", "com.mojang.", "com.google.", "org.apache.commons.", "io.netty.",
"paulscode.sound.", "com.ibm.icu.", "sun.", "gnu.trove.", "com.electronwill.nightconfig.",
"net.minecraftforge.fml.loading.", "net.minecraftforge.fml.language.", "net.minecraftforge.versions.",
"net.minecraftforge.eventbus.", "net.minecraftforge.api."
);
protected Predicate<String> getPackagePredicate() {
return cn -> SKIPPACKAGES.stream().noneMatch(cn::startsWith);
}
public void setup(final IEnvironment environment)
{
}
2018-06-21 19:37:32 +00:00
public abstract Dist getDist();
2018-06-23 02:45:01 +00:00
protected void beforeStart(ITransformingClassLoader launchClassLoader, Path forgePath)
{
2018-06-23 02:45:01 +00:00
FMLLoader.beforeStart(launchClassLoader, forgePath);
}
}