diff --git a/src/main/java/cpw/mods/fml/client/registry/RenderingRegistry.java b/src/main/java/cpw/mods/fml/client/registry/RenderingRegistry.java index 0fbf611573..d170c91ba9 100644 --- a/src/main/java/cpw/mods/fml/client/registry/RenderingRegistry.java +++ b/src/main/java/cpw/mods/fml/client/registry/RenderingRegistry.java @@ -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() { diff --git a/src/main/java/cpw/mods/fml/common/FMLModContainer.java b/src/main/java/cpw/mods/fml/common/FMLModContainer.java index a01513f9f4..7d8a63c8e0 100644 --- a/src/main/java/cpw/mods/fml/common/FMLModContainer.java +++ b/src/main/java/cpw/mods/fml/common/FMLModContainer.java @@ -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> modAnnotationTypes = ImmutableBiMap., Class>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> modTypeAnnotations = modAnnotationTypes.inverse(); private String annotationDependencies; private VersionRange minecraftAccepted; private boolean fingerprintNotPresent; @@ -108,6 +92,18 @@ public class FMLModContainer implements ModContainer private ListMultimap,Method> eventMethods; private Map customModProperties; private ModCandidate candidate; + private static final Set> modEventTypes = ImmutableSet.>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 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) m.getParameterTypes()[0],m); diff --git a/src/main/java/cpw/mods/fml/common/Mod.java b/src/main/java/cpw/mods/fml/common/Mod.java index f9bb98673d..f66138eb60 100644 --- a/src/main/java/cpw/mods/fml/common/Mod.java +++ b/src/main/java/cpw/mods/fml/common/Mod.java @@ -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.
- * Mods that this mod will not 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 all mods. - * - * The only mods that cannot be excluded are FML and MCP, trivially. - * Other special values: - *
    - *
  • +f indicates that the mod will accept a minecraft forge environment.
  • - *
  • -* indicates that the mod will not accept any other mods.
  • - *
- * - * Some examples: - *
    - *
  • -*,+f,+IronChest: 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".
  • - *
  • +f,-IC2: Will run in a minecraft forge environment but will not run if - * IndustrialCraft 2 (IC2) is loaded alongside.
  • - *
  • -*: Will not run if any othe mod is loaded except MCP/FML itself.
  • - *
- * - * 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}
- * 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}
- * 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}
- * 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}
- * 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}
- * 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}
- * 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}
- * 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}
- * 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}
- * 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}
- * 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.
- * 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.
- * 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}. diff --git a/src/main/java/cpw/mods/fml/common/ObfuscationReflectionHelper.java b/src/main/java/cpw/mods/fml/common/ObfuscationReflectionHelper.java index 42d70a4bcb..181b9a45e0 100644 --- a/src/main/java/cpw/mods/fml/common/ObfuscationReflectionHelper.java +++ b/src/main/java/cpw/mods/fml/common/ObfuscationReflectionHelper.java @@ -71,12 +71,6 @@ public class ObfuscationReflectionHelper } } - @Deprecated - public static void setPrivateValue(Class classToAccess, T instance, int fieldIndex, E value) - { - setPrivateValue(classToAccess, instance, value, fieldIndex); - } - public static void setPrivateValue(Class classToAccess, T instance, E value, int fieldIndex) { try @@ -90,12 +84,6 @@ public class ObfuscationReflectionHelper } } - @Deprecated - public static void setPrivateValue(Class classToAccess, T instance, String fieldName, E value) - { - setPrivateValue(classToAccess, instance, value, fieldName); - } - public static void setPrivateValue(Class classToAccess, T instance, E value, String... fieldNames) { try diff --git a/src/main/java/cpw/mods/fml/common/SidedProxy.java b/src/main/java/cpw/mods/fml/common/SidedProxy.java index b18bc6b243..6b4b102dfd 100644 --- a/src/main/java/cpw/mods/fml/common/SidedProxy.java +++ b/src/main/java/cpw/mods/fml/common/SidedProxy.java @@ -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 diff --git a/src/main/java/cpw/mods/fml/common/registry/EntityRegistry.java b/src/main/java/cpw/mods/fml/common/registry/EntityRegistry.java index 1c8d1e8753..a956500811 100644 --- a/src/main/java/cpw/mods/fml/common/registry/EntityRegistry.java +++ b/src/main/java/cpw/mods/fml/common/registry/EntityRegistry.java @@ -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 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); - } - } diff --git a/src/main/java/cpw/mods/fml/common/registry/GameRegistry.java b/src/main/java/cpw/mods/fml/common/registry/GameRegistry.java index 95f9da41da..c0fb85f866 100644 --- a/src/main/java/cpw/mods/fml/common/registry/GameRegistry.java +++ b/src/main/java/cpw/mods/fml/common/registry/GameRegistry.java @@ -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 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 diff --git a/src/main/java/cpw/mods/fml/relauncher/ILibrarySet.java b/src/main/java/cpw/mods/fml/relauncher/ILibrarySet.java deleted file mode 100644 index eac6d16b37..0000000000 --- a/src/main/java/cpw/mods/fml/relauncher/ILibrarySet.java +++ /dev/null @@ -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(); -}