Remove Java 8 warnings now that Minecraft requires it

This commit is contained in:
Ben Staddon authored and mezz committed 2017-06-23 23:31:50 -07:00
1 parent 286f6a910b
commit b0dfaa2b81
9 files changed
+2 -309

No files matched your search

@@ -1,50 +0,0 @@
/*
* Minecraft Forge
* Copyright (c) 2016.
*
* 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.common;
import java.util.List;
public class Java8VersionException extends EnhancedRuntimeException
{
private static final long serialVersionUID = 1L;
private final List<ModContainer> mods;
public Java8VersionException(List<ModContainer> mods)
{
super("Mods require Java 8");
this.mods = mods;
}
@Override
protected void printStackTrace(WrappedPrintStream stream)
{
stream.println("Mods requiring Java 8:");
for (ModContainer mc : mods)
{
stream.println(String.format("\t%s : %s", mc.getName(), mc.getModId()));
}
stream.println("");
}
public List<ModContainer> getMods()
{
return mods;
}
}
@@ -174,7 +174,6 @@ public class Loader
private File forcedModFile;
private ModDiscoverer discoverer;
private ProgressBar progressBar;
public final boolean java8;
public static Loader instance()
{
@@ -201,14 +200,6 @@ public class Loader
private Loader()
{
String[] ver = System.getProperty("java.version").split("\\.");
int major = Integer.parseInt(ver[1]);
java8 = major > 7;
if (!java8)
{
FMLLog.log.fatal("The game is not running with Java 8. Forge recommends Java 8 for maximum compatibility with mods");
}
modClassLoader = new ModClassLoader(getClass().getClassLoader());
if (mccversion !=null && !mccversion.equals(MC_VERSION))
{
@@ -555,7 +546,6 @@ public class Loader
ModAPIManager.INSTANCE.manageAPI(modClassLoader, discoverer);
disableRequestedMods();
modController.distributeStateMessage(FMLLoadEvent.class);
checkJavaCompatibility();
sortModList();
ModAPIManager.INSTANCE.cleanupAPIContainers(modController.getActiveModList());
ModAPIManager.INSTANCE.cleanupAPIContainers(mods);
@@ -613,24 +603,6 @@ public class Loader
modController.transition(LoaderState.PREINITIALIZATION, false);
}
private void checkJavaCompatibility()
{
if (java8) return;
List<ModContainer> j8mods = Lists.newArrayList();
for (ModContainer mc : getActiveModList())
{
if (mc.getClassVersion() >= 52)
{
j8mods.add(mc);
}
}
if (!j8mods.isEmpty())
{
throw new Java8VersionException(j8mods);
}
}
public void preinitializeMods()
{
if (!modController.isInState(LoaderState.PREINITIALIZATION))
@@ -131,11 +131,7 @@ public class ASMModParser
public void validate()
{
// if (classVersion > 50.0)
// {
//
// throw new LoaderException(new RuntimeException("Mod compiled for Java 7 detected"));
// }
}
public boolean isBaseMod(List<String> rememberedTypes)