mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
Deprecation cleanup. Bye bye more modloader stuffs
This commit is contained in:
1 parent
4708d77c98
commit
e7512f13e4
8 files changed
+14
-351
No files matched your search
@@ -94,40 +94,6 @@ public class RenderingRegistry
|
||||
return instance().nextRenderId++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a texture override for the given path and return the used index
|
||||
*
|
||||
* @param fileToOverride
|
||||
* @param fileToAdd
|
||||
*/
|
||||
@Deprecated
|
||||
public static int addTextureOverride(String fileToOverride, String fileToAdd)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a texture override for the given path and index
|
||||
*
|
||||
* @param path
|
||||
* @param overlayPath
|
||||
* @param index
|
||||
*/
|
||||
public static void addTextureOverride(String path, String overlayPath, int index)
|
||||
{
|
||||
// TextureFXManager.instance().addNewTextureOverride(path, overlayPath, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get and reserve a unique texture index for the supplied path
|
||||
*
|
||||
* @param path
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getUniqueTextureIndex(String path)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Deprecated public static RenderingRegistry instance()
|
||||
{
|
||||
|
||||
@@ -32,8 +32,6 @@ import com.google.common.base.Function;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.ImmutableBiMap;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableList.Builder;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
@@ -84,20 +82,6 @@ public class FMLModContainer implements ModContainer
|
||||
private DefaultArtifactVersion processedVersion;
|
||||
private boolean isNetworkMod;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private static final BiMap<Class<? extends FMLEvent>, Class<? extends Annotation>> modAnnotationTypes = ImmutableBiMap.<Class<? extends FMLEvent>, Class<? extends Annotation>>builder()
|
||||
.put(FMLPreInitializationEvent.class, Mod.PreInit.class)
|
||||
.put(FMLInitializationEvent.class, Mod.Init.class)
|
||||
.put(FMLPostInitializationEvent.class, Mod.PostInit.class)
|
||||
.put(FMLServerAboutToStartEvent.class, Mod.ServerAboutToStart.class)
|
||||
.put(FMLServerStartingEvent.class, Mod.ServerStarting.class)
|
||||
.put(FMLServerStartedEvent.class, Mod.ServerStarted.class)
|
||||
.put(FMLServerStoppingEvent.class, Mod.ServerStopping.class)
|
||||
.put(FMLServerStoppedEvent.class, Mod.ServerStopped.class)
|
||||
.put(IMCEvent.class,Mod.IMCCallback.class)
|
||||
.put(FMLFingerprintViolationEvent.class, Mod.FingerprintWarning.class)
|
||||
.build();
|
||||
private static final BiMap<Class<? extends Annotation>, Class<? extends FMLEvent>> modTypeAnnotations = modAnnotationTypes.inverse();
|
||||
private String annotationDependencies;
|
||||
private VersionRange minecraftAccepted;
|
||||
private boolean fingerprintNotPresent;
|
||||
@@ -108,6 +92,18 @@ public class FMLModContainer implements ModContainer
|
||||
private ListMultimap<Class<? extends FMLEvent>,Method> eventMethods;
|
||||
private Map<String, String> customModProperties;
|
||||
private ModCandidate candidate;
|
||||
private static final Set<Class<? extends FMLEvent>> modEventTypes = ImmutableSet.<Class<? extends FMLEvent>>builder()
|
||||
.add(FMLPreInitializationEvent.class)
|
||||
.add(FMLInitializationEvent.class)
|
||||
.add(FMLPostInitializationEvent.class)
|
||||
.add(FMLServerAboutToStartEvent.class)
|
||||
.add(FMLServerStartingEvent.class)
|
||||
.add(FMLServerStartedEvent.class)
|
||||
.add(FMLServerStoppingEvent.class)
|
||||
.add(FMLServerStoppedEvent.class)
|
||||
.add(IMCEvent.class)
|
||||
.add(FMLFingerprintViolationEvent.class)
|
||||
.build();
|
||||
|
||||
public FMLModContainer(String className, ModCandidate container, Map<String,Object> modDescriptor)
|
||||
{
|
||||
@@ -323,22 +319,9 @@ public class FMLModContainer implements ModContainer
|
||||
{
|
||||
for (Annotation a : m.getAnnotations())
|
||||
{
|
||||
if (modTypeAnnotations.containsKey(a.annotationType()))
|
||||
if (a.annotationType().equals(Mod.EventHandler.class))
|
||||
{
|
||||
Class<?>[] paramTypes = new Class[] { modTypeAnnotations.get(a.annotationType()) };
|
||||
if (Arrays.equals(m.getParameterTypes(), paramTypes))
|
||||
{
|
||||
m.setAccessible(true);
|
||||
eventMethods.put(modTypeAnnotations.get(a.annotationType()), m);
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLLog.log(getModId(), Level.SEVERE,"The mod %s appears to have an invalid method annotation %s. This annotation can only apply to methods with argument types %s -it will not be called", getModId(), a.annotationType().getSimpleName(), Arrays.toString(paramTypes));
|
||||
}
|
||||
}
|
||||
else if (a.annotationType().equals(Mod.EventHandler.class))
|
||||
{
|
||||
if (m.getParameterTypes().length == 1 && modAnnotationTypes.containsKey(m.getParameterTypes()[0]))
|
||||
if (m.getParameterTypes().length == 1 && modEventTypes.contains(m.getParameterTypes()[0]))
|
||||
{
|
||||
m.setAccessible(true);
|
||||
eventMethods.put((Class<? extends FMLEvent>) m.getParameterTypes()[0],m);
|
||||
|
||||
@@ -17,7 +17,6 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import cpw.mods.fml.common.event.FMLEvent;
|
||||
import cpw.mods.fml.common.event.FMLFingerprintViolationEvent;
|
||||
@@ -115,39 +114,6 @@ public @interface Mod
|
||||
* @return The name of the plugin to load for this mod
|
||||
*/
|
||||
String bukkitPlugin() default "";
|
||||
/**
|
||||
* NOT YET IMPLEMENTED.</br>
|
||||
* Mods that this mod will <strong>not</strong> load with.
|
||||
* An optional comma separated string of (+|-)(*|modid[@value]) which specify mods that
|
||||
* this mod will refuse to load with, resulting in the game failing to start.
|
||||
* Entries can be prefixed with a + for a positive exclusion assertion, or - for a negative exclusion
|
||||
* assertion. Asterisk is the wildcard and represents <strong>all</strong> mods.
|
||||
*
|
||||
* The <strong>only</strong> mods that cannot be excluded are FML and MCP, trivially.
|
||||
* Other special values:
|
||||
* <ul>
|
||||
* <li>+f indicates that the mod will accept a minecraft forge environment.</li>
|
||||
* <li>-* indicates that the mod will not accept any other mods.</li>
|
||||
* </ul>
|
||||
*
|
||||
* Some examples:
|
||||
* <ul>
|
||||
* <li><em>-*,+f,+IronChest</em>: Will run only in a minecraft forge environment with the mod IronChests.
|
||||
* The -* forces all mods to be excluded, then the +f and +IronChest add into the "allowed list".</li>
|
||||
* <li><em>+f,-IC2</em>: Will run in a minecraft forge environment but will <strong>not</strong> run if
|
||||
* IndustrialCraft 2 (IC2) is loaded alongside.</li>
|
||||
* <li><em>-*</em>: Will not run if <strong>any</strong> othe mod is loaded except MCP/FML itself.</li>
|
||||
* </ul>
|
||||
*
|
||||
* If a mod is present on the excluded list, the game will stop and show an error screen. If the
|
||||
* class containing the {@link Mod} annotation has a "getCustomErrorException" method, it will be
|
||||
* called to retrieve a custom error message for display in this case. If two mods have a declared
|
||||
* exclusion which is matched, the screen that is shown is indeterminate.
|
||||
*
|
||||
* @return A string listing modids to exclude from loading with this mod.
|
||||
*/
|
||||
@Deprecated
|
||||
String modExclusionList() default "";
|
||||
/**
|
||||
* Specifying this field allows for a mod to expect a signed jar with a fingerprint matching this value.
|
||||
* The fingerprint should be SHA-1 encoded, lowercase with ':' removed. An empty value indicates that
|
||||
@@ -247,108 +213,6 @@ public @interface Mod
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface EventHandler{}
|
||||
|
||||
/**
|
||||
* Deprecated for {@link EventHandler}<br/>
|
||||
* Mark the designated method as to be called at if there is something wrong with the certificate fingerprint of
|
||||
* the mod's jar, or it is missing, or otherwise a problem.
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@Deprecated
|
||||
public @interface FingerprintWarning {}
|
||||
/**
|
||||
* Deprecated for {@link EventHandler}<br/>
|
||||
* Mark the designated method as being called at the "pre-initialization" phase
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@Deprecated
|
||||
public @interface PreInit {}
|
||||
/**
|
||||
* Deprecated for {@link EventHandler}<br/>
|
||||
* Mark the designated method as being called at the "initialization" phase
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@Deprecated
|
||||
public @interface Init {}
|
||||
/**
|
||||
* Deprecated for {@link EventHandler}<br/>
|
||||
* Mark the designated method as being called at the "post-initialization" phase
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@Deprecated
|
||||
public @interface PostInit {}
|
||||
/**
|
||||
* Deprecated for {@link EventHandler}<br/>
|
||||
* Mark the designated method as being called at the "server-about-to-start" phase
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@Deprecated
|
||||
public @interface ServerAboutToStart {}
|
||||
/**
|
||||
* Deprecated for {@link EventHandler}<br/>
|
||||
* Mark the designated method as being called at the "server-starting" phase
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@Deprecated
|
||||
public @interface ServerStarting {}
|
||||
/**
|
||||
* Deprecated for {@link EventHandler}<br/>
|
||||
* Mark the designated method as being called at the "server-started" phase
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@Deprecated
|
||||
public @interface ServerStarted {}
|
||||
/**
|
||||
* Deprecated for {@link EventHandler}<br/>
|
||||
* Mark the designated method as being called at the "server-stopping" phase
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@Deprecated
|
||||
public @interface ServerStopping {}
|
||||
/**
|
||||
* Deprecated for {@link EventHandler}<br/>
|
||||
* Mark the designated method as being called at the "server-stopped" phase
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@Deprecated
|
||||
public @interface ServerStopped {}
|
||||
/**
|
||||
* Deprecated for {@link EventHandler}<br/>
|
||||
* Mark the designated method as the receiver for {@link FMLInterModComms} messages
|
||||
* Called between {@link Init} and {@link PostInit}
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@Deprecated
|
||||
public @interface IMCCallback {}
|
||||
/**
|
||||
* Populate the annotated field with the mod instance based on the specified ModId. This can be used
|
||||
* to retrieve instances of other mods.
|
||||
@@ -376,44 +240,6 @@ public @interface Mod
|
||||
*/
|
||||
String value() default "";
|
||||
}
|
||||
/**
|
||||
* NOT IMPLEMENTED AND SCHEDULED FOR REMOVAL.<br/>
|
||||
* Populate the annotated field with an instance of the Block as specified. This never worked. It will be removed.
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
@Deprecated
|
||||
public @interface Block {
|
||||
/**
|
||||
* The block's name
|
||||
*/
|
||||
String name();
|
||||
/**
|
||||
* The associated ItemBlock subtype for the item (can be null for an ItemBlock)
|
||||
*/
|
||||
Class<?> itemTypeClass() default ItemBlock.class;
|
||||
}
|
||||
/**
|
||||
* NOT IMPLEMENTED AND SCHEDULED FOR REMOVAL.<br/>
|
||||
* Populate the annotated field with an Item. This never worked. It will be removed.
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
@Deprecated
|
||||
public @interface Item {
|
||||
/**
|
||||
* The name of the item
|
||||
*/
|
||||
String name();
|
||||
/**
|
||||
* The type of the item
|
||||
*/
|
||||
String typeClass();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mod instance factory method. Should return an instance of the mod. Applies only to static methods on the same class as {@link Mod}.
|
||||
|
||||
@@ -71,12 +71,6 @@ public class ObfuscationReflectionHelper
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static <T, E> void setPrivateValue(Class<? super T> classToAccess, T instance, int fieldIndex, E value)
|
||||
{
|
||||
setPrivateValue(classToAccess, instance, value, fieldIndex);
|
||||
}
|
||||
|
||||
public static <T, E> void setPrivateValue(Class<? super T> classToAccess, T instance, E value, int fieldIndex)
|
||||
{
|
||||
try
|
||||
@@ -90,12 +84,6 @@ public class ObfuscationReflectionHelper
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static <T, E> void setPrivateValue(Class<? super T> classToAccess, T instance, String fieldName, E value)
|
||||
{
|
||||
setPrivateValue(classToAccess, instance, value, fieldName);
|
||||
}
|
||||
|
||||
public static <T, E> void setPrivateValue(Class<? super T> classToAccess, T instance, E value, String... fieldNames)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -59,13 +59,6 @@ public @interface SidedProxy
|
||||
*/
|
||||
String serverSide() default "";
|
||||
|
||||
@Deprecated
|
||||
/**
|
||||
* Not implemented
|
||||
* The name of a special bukkit plugin class to load and populate
|
||||
*/
|
||||
String bukkitSide() default "";
|
||||
|
||||
/**
|
||||
* The (optional) name of a mod to load this proxy for. This will help ensure correct behaviour when loading a combined
|
||||
* scala/java mod package. It is almost never going to be required, unless you ship both Scala and Java {@link Mod} content
|
||||
|
||||
@@ -365,28 +365,4 @@ public class EntityRegistry
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DO NOT USE THIS METHOD
|
||||
*
|
||||
* @param entityClass
|
||||
* @param entityTypeId
|
||||
* @param updateRange
|
||||
* @param updateInterval
|
||||
* @param sendVelocityInfo
|
||||
*/
|
||||
@Deprecated
|
||||
public static EntityRegistration registerModLoaderEntity(Object mod, Class<? extends Entity> entityClass, int entityTypeId, int updateRange, int updateInterval,
|
||||
boolean sendVelocityInfo)
|
||||
{
|
||||
String entityName = (String) EntityList.field_75626_c.get(entityClass);
|
||||
if (entityName == null)
|
||||
{
|
||||
throw new IllegalArgumentException(String.format("The ModLoader mod %s has tried to register an entity tracker for a non-existent entity type %s", Loader.instance().activeModContainer().getModId(), entityClass.getCanonicalName()));
|
||||
}
|
||||
instance().doModEntityRegistration(entityClass, entityName, entityTypeId, mod, updateRange, updateInterval, sendVelocityInfo);
|
||||
return instance().entityClassRegistrations.get(entityClass);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -118,17 +118,6 @@ public class GameRegistry
|
||||
GameData.setName(item, name, modId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a block with the world
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public static void registerBlock(net.minecraft.block.Block block)
|
||||
{
|
||||
registerBlock(block, ItemBlock.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register a block with the specified mod specific name : overrides the standard type based name
|
||||
* @param block The block to register
|
||||
@@ -138,20 +127,6 @@ public class GameRegistry
|
||||
{
|
||||
registerBlock(block, ItemBlock.class, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a block with the world, with the specified item class
|
||||
*
|
||||
* Deprecated in favour of named versions
|
||||
*
|
||||
* @param block The block to register
|
||||
* @param itemclass The item type to register with it
|
||||
*/
|
||||
@Deprecated
|
||||
public static void registerBlock(net.minecraft.block.Block block, Class<? extends ItemBlock> itemclass)
|
||||
{
|
||||
registerBlock(block, itemclass, null);
|
||||
}
|
||||
/**
|
||||
* Register a block with the world, with the specified item class and block name
|
||||
* @param block The block to register
|
||||
|
||||
@@ -1,44 +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;
|
||||
|
||||
/**
|
||||
* Interface for certain core plugins to register libraries to
|
||||
* be loaded in by the FML class loader at launch time
|
||||
* Deprecated without replacement.
|
||||
*
|
||||
* @author cpw
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public interface ILibrarySet
|
||||
{
|
||||
/**
|
||||
* Return a list of libraries available from a common location
|
||||
*
|
||||
* @return a list of libraries available from a common location
|
||||
*/
|
||||
String[] getLibraries();
|
||||
/**
|
||||
* Return the string encoded sha1 hash for each library in the returned list
|
||||
*
|
||||
* @return the string encoded sha1 hash for each library in the returned list
|
||||
*/
|
||||
String[] getHashes();
|
||||
/**
|
||||
* Return the root URL format string from which this library set can be obtained
|
||||
* There needs to be a single %s string substitution which is the library name
|
||||
* @return the root URL format string from which this library set can be obtained
|
||||
*/
|
||||
String getRootURL();
|
||||
}
|
||||
Reference in new issue
Block a user