Fix up some deprecation warnings, and clean up coremod code that's going

away.
This commit is contained in:
Christian 2013-07-02 19:27:50 -04:00
parent d648514a90
commit aaaffda3f0
5 changed files with 9 additions and 57 deletions

View file

@ -626,6 +626,7 @@ public class ModLoader
* *
* @param block * @param block
*/ */
@SuppressWarnings("deprecation")
public static void registerBlock(Block block) public static void registerBlock(Block block)
{ {
GameRegistry.registerBlock(block); GameRegistry.registerBlock(block);
@ -637,6 +638,7 @@ public class ModLoader
* @param block * @param block
* @param itemclass * @param itemclass
*/ */
@SuppressWarnings("deprecation")
public static void registerBlock(Block block, Class<? extends ItemBlock> itemclass) public static void registerBlock(Block block, Class<? extends ItemBlock> itemclass)
{ {
GameRegistry.registerBlock(block, itemclass); GameRegistry.registerBlock(block, itemclass);

View file

@ -1,38 +0,0 @@
/*
* Forge Mod Loader
* Copyright (c) 2012-2013 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v2.1
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* Contributors:
* cpw - implementation
*/
package cpw.mods.fml.relauncher;
public class CoreFMLLibraries implements ILibrarySet
{
private static String[] libraries = { "argo-small-3.2.jar","guava-14.0-rc3.jar","asm-all-4.1.jar", "bcprov-jdk15on-148.jar", FMLInjectionData.debfuscationDataName(), "scala-library.jar" };
private static String[] checksums = { "58912ea2858d168c50781f956fa5b59f0f7c6b51", "931ae21fa8014c3ce686aaa621eae565fefb1a6a", "054986e962b88d8660ae4566475658469595ef58", "960dea7c9181ba0b17e8bab0c06a43f0a5f04e65", FMLInjectionData.deobfuscationDataHash, "458d046151ad179c85429ed7420ffb1eaf6ddf85" };
@Override
public String[] getLibraries()
{
return libraries;
}
@Override
public String[] getHashes()
{
return checksums;
}
@Override
public String getRootURL()
{
return System.getProperty("fml.core.libraries.mirror", "http://files.minecraftforge.net/fmllibs/%s");
}
}

View file

@ -49,7 +49,6 @@ public class CoreModManager
private static List<String> loadedLibraries = new ArrayList<String>(); private static List<String> loadedLibraries = new ArrayList<String>();
private static Map<IFMLLoadingPlugin, File> pluginLocations; private static Map<IFMLLoadingPlugin, File> pluginLocations;
private static List<IFMLLoadingPlugin> loadPlugins; private static List<IFMLLoadingPlugin> loadPlugins;
private static List<ILibrarySet> libraries;
private static boolean deobfuscatedEnvironment; private static boolean deobfuscatedEnvironment;
public static void handleLaunch(File mcDir, LaunchClassLoader classLoader) public static void handleLaunch(File mcDir, LaunchClassLoader classLoader)
@ -117,13 +116,6 @@ public class CoreModManager
} }
IFMLLoadingPlugin plugin = (IFMLLoadingPlugin) coreModClass.newInstance(); IFMLLoadingPlugin plugin = (IFMLLoadingPlugin) coreModClass.newInstance();
loadPlugins.add(plugin); loadPlugins.add(plugin);
if (plugin.getLibraryRequestClass()!=null)
{
for (String libName : plugin.getLibraryRequestClass())
{
libraries.add((ILibrarySet) Class.forName(libName, true, classLoader).newInstance());
}
}
} }
catch (Throwable e) catch (Throwable e)
{ {
@ -131,7 +123,7 @@ public class CoreModManager
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }
discoverCoreMods(mcDir, classLoader, loadPlugins, libraries); discoverCoreMods(mcDir, classLoader, loadPlugins);
for (IFMLLoadingPlugin plug : loadPlugins) for (IFMLLoadingPlugin plug : loadPlugins)
{ {
@ -204,7 +196,7 @@ public class CoreModManager
} }
} }
private static void discoverCoreMods(File mcDir, LaunchClassLoader classLoader, List<IFMLLoadingPlugin> loadPlugins, List<ILibrarySet> libraries) private static void discoverCoreMods(File mcDir, LaunchClassLoader classLoader, List<IFMLLoadingPlugin> loadPlugins)
{ {
FMLRelaunchLog.fine("Discovering coremods"); FMLRelaunchLog.fine("Discovering coremods");
File coreMods = setupCoreModDir(mcDir); File coreMods = setupCoreModDir(mcDir);
@ -308,13 +300,6 @@ public class CoreModManager
IFMLLoadingPlugin plugin = (IFMLLoadingPlugin) coreModClass.newInstance(); IFMLLoadingPlugin plugin = (IFMLLoadingPlugin) coreModClass.newInstance();
loadPlugins.add(plugin); loadPlugins.add(plugin);
pluginLocations .put(plugin, coreMod); pluginLocations .put(plugin, coreMod);
if (plugin.getLibraryRequestClass()!=null)
{
for (String libName : plugin.getLibraryRequestClass())
{
libraries.add((ILibrarySet) Class.forName(libName, true, classLoader).newInstance());
}
}
FMLRelaunchLog.fine("Loaded coremod %s", coreMod.getName()); FMLRelaunchLog.fine("Loaded coremod %s", coreMod.getName());
} }
catch (ClassNotFoundException cnfe) catch (ClassNotFoundException cnfe)

View file

@ -16,10 +16,11 @@ import java.util.Map;
public class FMLCorePlugin implements IFMLLoadingPlugin public class FMLCorePlugin implements IFMLLoadingPlugin
{ {
@SuppressWarnings("deprecation")
@Override @Override
public String[] getLibraryRequestClass() public String[] getLibraryRequestClass()
{ {
return new String[] {"cpw.mods.fml.relauncher.CoreFMLLibraries"}; return null;
} }
@Override @Override

View file

@ -15,10 +15,12 @@ package cpw.mods.fml.relauncher;
/** /**
* Interface for certain core plugins to register libraries to * Interface for certain core plugins to register libraries to
* be loaded in by the FML class loader at launch time * be loaded in by the FML class loader at launch time
* Deprecated without replacement.
* *
* @author cpw * @author cpw
* *
*/ */
@Deprecated
public interface ILibrarySet public interface ILibrarySet
{ {
/** /**