ModLoader is officially deprecated. It will all cease to be with 1.7.

This commit is contained in:
Christian 2013-10-06 11:06:31 -04:00
parent 955d532264
commit b542f13c5c
5 changed files with 126 additions and 7 deletions

View File

@ -42,10 +42,18 @@ import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.TickType;
import cpw.mods.fml.relauncher.SideOnly;
/**
* Bye bye ModLoader. Deprecated without direct replacement
* @author cpw
*
*/
@Deprecated
public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModProxy
{
// CALLBACK MECHANISMS
@Deprecated
public final boolean doTickInGame(TickType tick, boolean tickEnd, Object... data)
{
Minecraft mc = FMLClientHandler.instance().getClient();
@ -57,6 +65,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
return true;
}
@Deprecated
public final boolean doTickInGUI(TickType tick, boolean tickEnd, Object... data)
{
Minecraft mc = FMLClientHandler.instance().getClient();
@ -177,12 +186,14 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* @param id
* @param metadata
*/
@Deprecated
public int addFuel(int id, int metadata)
{
return 0;
}
@SideOnly(CLIENT)
@Deprecated
public void addRenderer(Map<Class<? extends Entity>, Render> renderers)
{
}
@ -195,6 +206,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* @param chunkX
* @param chunkZ
*/
@Deprecated
public void generateNether(World world, Random random, int chunkX, int chunkZ)
{
}
@ -207,6 +219,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* @param chunkX
* @param chunkZ
*/
@Deprecated
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
}
@ -219,6 +232,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* @param y
* @param z
*/
@Deprecated
@SideOnly(CLIENT)
public GuiContainer getContainerGUI(EntityClientPlayerMP player, int containerID, int x, int y, int z)
{
@ -228,6 +242,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
/**
* Return the name of your mod. Defaults to the class name
*/
@Deprecated
public String getName()
{
return getClass().getSimpleName();
@ -236,6 +251,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
/**
* Get your mod priorities
*/
@Deprecated
public String getPriorities()
{
return "";
@ -244,9 +260,11 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
/**
* Return the version of your mod
*/
@Deprecated
public abstract String getVersion();
@SideOnly(CLIENT)
@Deprecated
public void keyboardEvent(KeyBinding event)
{
@ -255,11 +273,13 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
/**
* Load your mod
*/
@Deprecated
public abstract void load();
/**
* Finish loading your mod
*/
@Deprecated
public void modsLoaded()
{
}
@ -270,6 +290,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* @param player
* @param item
*/
@Deprecated
public void onItemPickup(EntityPlayer player, ItemStack item)
{
}
@ -281,17 +302,20 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* @param minecraftInstance the client
* @return true to continue receiving ticks
*/
@Deprecated
@SideOnly(CLIENT)
public boolean onTickInGame(float time, Minecraft minecraftInstance)
{
return false;
}
@Deprecated
public boolean onTickInGame(MinecraftServer minecraftServer)
{
return false;
}
@Deprecated
@SideOnly(CLIENT)
public boolean onTickInGUI(float tick, Minecraft game, GuiScreen gui)
{
@ -305,6 +329,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* @param text
*/
@Override
@Deprecated
public void clientChat(String text)
{
}
@ -314,6 +339,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* @param handler
*/
@SideOnly(CLIENT)
@Deprecated
public void clientConnect(NetClientHandler handler)
{
@ -324,35 +350,40 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* @param handler
*/
@SideOnly(CLIENT)
@Deprecated
public void clientDisconnect(NetClientHandler handler)
{
}
/**
* Called client side to receive a custom payload for this mod
*
*
* NOTE: this method is not provided in Risugami's implementation of BaseMod!
*
* @param packet
*/
@Override
@Deprecated
public void receiveCustomPacket(Packet250CustomPayload packet)
{
}
@SideOnly(CLIENT)
@Deprecated
public void registerAnimation(Minecraft game)
{
}
@SideOnly(CLIENT)
@Deprecated
public void renderInvBlock(RenderBlocks renderer, Block block, int metadata, int modelID)
{
}
@SideOnly(CLIENT)
@Deprecated
public boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID)
{
return false;
@ -362,11 +393,13 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* NOTE: this method is not provided in Risugami's implementation of BaseMod!
*/
@Override
@Deprecated
public void serverConnect(NetHandler handler) {
}
@Override
@Deprecated
public void serverCustomPayload(NetServerHandler handler, Packet250CustomPayload packet)
{
@ -376,6 +409,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* NOTE: this method is not provided in Risugami's implementation of BaseMod!
*/
@Override
@Deprecated
public void serverDisconnect() {
}
@ -386,6 +420,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* @param item
* @param matrix
*/
@Deprecated
public void takenFromCrafting(EntityPlayer player, ItemStack item, IInventory matrix)
{
}
@ -396,6 +431,7 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* @param player
* @param item
*/
@Deprecated
public void takenFromFurnace(EntityPlayer player, ItemStack item)
{
}
@ -413,27 +449,30 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* Called when a chat message is received. Return true to stop further processing
*/
@Override
@Deprecated
public void serverChat(NetServerHandler source, String message)
{
}
/**
* Called when a new client logs in.
*
*
* NOTE: this method is not provided in Risugami's implementation of BaseMod!
*
* @param player
*/
@Override
@Deprecated
public void onClientLogin(EntityPlayer player)
{
}
/**
* Called when a client logs out of the server.
*
*
* NOTE: this method is not provided in Risugami's implementation of BaseMod!
*/
@Override
@Deprecated
public void onClientLogout(INetworkManager mgr)
{
@ -443,12 +482,14 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
* Spawn the entity of the supplied type, if it is your mod's
*/
@SideOnly(CLIENT)
@Deprecated
public Entity spawnEntity(int entityId, World world, double scaledX, double scaledY, double scaledZ)
{
return null;
}
@SideOnly(CLIENT)
@Deprecated
public void clientCustomPayload(NetClientHandler handler, Packet250CustomPayload packet)
{

View File

@ -5,7 +5,7 @@
* 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
*/
@ -15,11 +15,13 @@ package net.minecraft.src;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
@Deprecated
public class EntityRendererProxy extends EntityRenderer
{
public static final String fmlMarker = "This is an FML marker";
private Minecraft game;
@Deprecated
public EntityRendererProxy(Minecraft minecraft)
{
super(minecraft);
@ -27,6 +29,7 @@ public class EntityRendererProxy extends EntityRenderer
}
@Override
@Deprecated
public void func_78480_b(float tick)
{
super.func_78480_b(tick);

View File

@ -20,30 +20,35 @@ import java.lang.annotation.Target;
/**
* @author cpw
*
*
*/
@Retention(value = RUNTIME)
@Target(value = FIELD)
@Deprecated
public @interface MLProp
{
/**
* Adds additional help to top of configuration file.
*/
@Deprecated
String info() default "";
/**
* Maximum value allowed if field is a number.
*/
@Deprecated
double max() default Double.MAX_VALUE;
/**
* Minimum value allowed if field is a number.
*/
@Deprecated
double min() default Double.MIN_VALUE;
/**
* Overrides the field name for property key.
*/
@Deprecated
String name() default "";
}

View File

@ -75,10 +75,15 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.SideOnly;
import cpw.mods.fml.server.FMLServerHandler;
/**
* ModLoader support is officially deprecated, to be removed with 1.7.
* @author cpw
*
*/
@Deprecated
public class ModLoader
{
public static final String fmlMarker = "This is an FML marker";
// TODO dirty workaround for millinaire
@Deprecated
public static final Map<String,Map<String,String>> localizedStrings=Collections.emptyMap();
@ -89,6 +94,7 @@ public class ModLoader
* @param name The name
* @param description The description
*/
@Deprecated
public static void addAchievementDesc(Achievement achievement, String name, String description)
{
String achName=achievement.func_75970_i();
@ -125,6 +131,7 @@ public class ModLoader
* @param armor The new armor prefix
* @return The new armor index
*/
@Deprecated
@SideOnly(CLIENT)
public static int addArmor(String armor)
{
@ -136,16 +143,19 @@ public class ModLoader
*
* @param biome The biome to add
*/
@Deprecated
public static void addBiome(BiomeGenBase biome)
{
GameRegistry.addBiome(biome);
}
@Deprecated
public static void addEntityTracker(BaseMod mod, Class<? extends Entity> entityClass, int entityTypeId, int updateRange, int updateInterval, boolean sendVelocityInfo)
{
ModLoaderHelper.buildEntityTracker(mod, entityClass, entityTypeId, updateRange, updateInterval, sendVelocityInfo);
}
@Deprecated
public static void addCommand(ICommand command)
{
ModLoaderHelper.addCommand(command);
@ -157,6 +167,7 @@ public class ModLoader
* @param item
* @param behavior
*/
@Deprecated
public static void addDispenserBehavior(Item item, IBehaviorDispenseItem behavior)
{
BlockDispenser.field_82527_a.func_82595_a(item, behavior);
@ -167,6 +178,7 @@ public class ModLoader
* @param key Key
* @param value Value
*/
@Deprecated
public static void addLocalization(String key, String value)
{
addLocalization(key, "en_US", value);
@ -179,6 +191,7 @@ public class ModLoader
* @param lang Language identifier
* @param value Value
*/
@Deprecated
public static void addLocalization(String key, String lang, String value)
{
LanguageRegistry.instance().addStringLocalization(key, lang, value);
@ -190,6 +203,7 @@ public class ModLoader
* @param instance Item to name
* @param name The name to give it
*/
@Deprecated
public static void addName(Object instance, String name)
{
addName(instance,"en_US",name);
@ -202,6 +216,7 @@ public class ModLoader
* @param lang Languge identifier
* @param name Name to give it
*/
@Deprecated
public static void addName(Object instance, String lang, String name)
{
LanguageRegistry.instance().addNameForObject(instance, lang, name);
@ -240,6 +255,7 @@ public class ModLoader
* @param overlayPath The new image
* @param index Where on the texture to apply it
*/
@Deprecated
@SideOnly(CLIENT)
public static void addOverride(String path, String overlayPath, int index)
{
@ -252,6 +268,7 @@ public class ModLoader
* @param output The result
* @param params The input
*/
@Deprecated
public static void addRecipe(ItemStack output, Object... params)
{
GameRegistry.addRecipe(output, params);
@ -263,6 +280,7 @@ public class ModLoader
* @param output The result
* @param params The input
*/
@Deprecated
public static void addShapelessRecipe(ItemStack output, Object... params)
{
GameRegistry.addShapelessRecipe(output, params);
@ -274,6 +292,7 @@ public class ModLoader
* @param input
* @param output
*/
@Deprecated
public static void addSmelting(int input, ItemStack output)
{
GameRegistry.addSmelting(input, output, 1.0f);
@ -285,6 +304,7 @@ public class ModLoader
* @param input
* @param output
*/
@Deprecated
public static void addSmelting(int input, ItemStack output, float experience)
{
GameRegistry.addSmelting(input, output, experience);
@ -298,6 +318,7 @@ public class ModLoader
* @param max
* @param spawnList
*/
@Deprecated
public static void addSpawn(Class<? extends EntityLiving> entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList)
{
EntityRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, WorldType.base12Biomes);
@ -313,6 +334,7 @@ public class ModLoader
* @param spawnList
* @param biomes
*/
@Deprecated
public static void addSpawn(Class<? extends EntityLiving> entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
EntityRegistry.addSpawn(entityClass, weightedProb, min, max, spawnList, biomes);
@ -327,6 +349,7 @@ public class ModLoader
* @param max
* @param spawnList
*/
@Deprecated
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList)
{
EntityRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, WorldType.base12Biomes);
@ -342,11 +365,13 @@ public class ModLoader
* @param spawnList
* @param biomes
*/
@Deprecated
public static void addSpawn(String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
EntityRegistry.addSpawn(entityName, weightedProb, min, max, spawnList, biomes);
}
@Deprecated
public static void addTrade(int profession, TradeEntry entry)
{
ModLoaderHelper.registerTrade(profession, entry);
@ -355,6 +380,7 @@ public class ModLoader
* Send a packet from the client
* @param packet
*/
@Deprecated
public static void clientSendPacket(Packet packet)
{
PacketDispatcher.sendPacketToServer(packet);
@ -386,6 +412,7 @@ public class ModLoader
* @param y
* @param z
*/
@Deprecated
public static void genericContainerRemoval(World world, int x, int y, int z)
{
/* TileEntity te = world.func_603_b(x, y, z);
@ -442,6 +469,7 @@ public class ModLoader
*
* @return A list containing all loaded ModLoader mods
*/
@Deprecated
public static List<BaseMod> getLoadedMods()
{
return ModLoaderModContainer.findAll(BaseMod.class);
@ -452,17 +480,20 @@ public class ModLoader
*
* @return The current logger
*/
@Deprecated
public static Logger getLogger()
{
return FMLLog.getLogger();
}
@SideOnly(CLIENT)
@Deprecated
public static Minecraft getMinecraftInstance()
{
return FMLClientHandler.instance().getClient();
}
@Deprecated
public static MinecraftServer getMinecraftServerInstance()
{
return FMLCommonHandler.instance().getMinecraftServerInstance();
@ -477,6 +508,7 @@ public class ModLoader
* @param fieldindex
* @return The value in the specified field.
*/
@Deprecated
public static <T, E> T getPrivateValue(Class<? super E> instanceclass, E instance, int fieldindex)
{
return ObfuscationReflectionHelper.getPrivateValue(instanceclass, instance, fieldindex);
@ -491,6 +523,7 @@ public class ModLoader
* @param field
* @return The value in the specified field.
*/
@Deprecated
public static <T, E> T getPrivateValue(Class<? super E> instanceclass, E instance, String field)
{
return ObfuscationReflectionHelper.getPrivateValue(instanceclass, instance, field);
@ -501,6 +534,7 @@ public class ModLoader
*
*/
@SideOnly(CLIENT)
@Deprecated
public static int getUniqueBlockModelID(BaseMod mod, boolean inventoryRenderer)
{
return ModLoaderClientHelper.obtainBlockModelIdFor(mod, inventoryRenderer);
@ -512,6 +546,7 @@ public class ModLoader
*
* @return A unique entity ID
*/
@Deprecated
public static int getUniqueEntityId()
{
return EntityRegistry.findGlobalUniqueEntityId();
@ -532,12 +567,14 @@ public class ModLoader
* @param channel
* @return If the channel is registered to the current connection.
*/
@Deprecated
public static boolean isChannelActive(EntityPlayer player, String channel)
{
return NetworkRegistry.instance().isChannelActive(channel, (Player)player);
}
@SideOnly(CLIENT)
@Deprecated
public static boolean isGUIOpen(Class<? extends GuiScreen> gui)
{
return FMLClientHandler.instance().isGUIOpen(gui);
@ -550,6 +587,7 @@ public class ModLoader
* @param modname
* @return If the specified mod is loaded
*/
@Deprecated
public static boolean isModLoaded(String modname)
{
return Loader.isModLoaded(modname);
@ -587,6 +625,7 @@ public class ModLoader
{
}
@Deprecated
@SideOnly(CLIENT)
public static void openGUI(EntityPlayer player, GuiScreen gui)
{
@ -627,6 +666,7 @@ public class ModLoader
* @param block
*/
@SuppressWarnings("deprecation")
@Deprecated
public static void registerBlock(Block block)
{
GameRegistry.registerBlock(block);
@ -639,11 +679,13 @@ public class ModLoader
* @param itemclass
*/
@SuppressWarnings("deprecation")
@Deprecated
public static void registerBlock(Block block, Class<? extends ItemBlock> itemclass)
{
GameRegistry.registerBlock(block, itemclass);
}
@Deprecated
public static void registerContainerID(BaseMod mod, int id)
{
ModLoaderHelper.buildGuiHelper(mod, id);
@ -655,6 +697,7 @@ public class ModLoader
* @param entityName
* @param id
*/
@Deprecated
public static void registerEntityID(Class<? extends Entity> entityClass, String entityName, int id)
{
EntityRegistry.registerGlobalEntityID(entityClass, entityName, id);
@ -669,12 +712,14 @@ public class ModLoader
* @param background
* @param foreground
*/
@Deprecated
public static void registerEntityID(Class<? extends Entity> entityClass, String entityName, int id, int background, int foreground)
{
EntityRegistry.registerGlobalEntityID(entityClass, entityName, id, background, foreground);
}
@SideOnly(CLIENT)
@Deprecated
public static void registerKey(BaseMod mod, KeyBinding keyHandler, boolean allowRepeat)
{
ModLoaderClientHelper.registerKeyBinding(mod, keyHandler, allowRepeat);
@ -687,6 +732,7 @@ public class ModLoader
* @param mod
* @param channel
*/
@Deprecated
public static void registerPacketChannel(BaseMod mod, String channel)
{
NetworkRegistry.instance().registerChannel(ModLoaderHelper.buildPacketHandlerFor(mod), channel);
@ -698,12 +744,14 @@ public class ModLoader
* @param tileEntityClass
* @param id
*/
@Deprecated
public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id)
{
GameRegistry.registerTileEntity(tileEntityClass, id);
}
@SideOnly(CLIENT)
@Deprecated
public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String id, TileEntitySpecialRenderer renderer)
{
ClientRegistry.registerTileEntity(tileEntityClass, id, renderer);
@ -714,6 +762,7 @@ public class ModLoader
*
* @param biome
*/
@Deprecated
public static void removeBiome(BiomeGenBase biome)
{
GameRegistry.removeBiome(biome);
@ -725,6 +774,7 @@ public class ModLoader
* @param entityClass
* @param spawnList
*/
@Deprecated
public static void removeSpawn(Class<? extends EntityLiving> entityClass, EnumCreatureType spawnList)
{
EntityRegistry.removeSpawn(entityClass, spawnList, WorldType.base12Biomes);
@ -737,6 +787,7 @@ public class ModLoader
* @param spawnList
* @param biomes
*/
@Deprecated
public static void removeSpawn(Class<? extends EntityLiving> entityClass, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
EntityRegistry.removeSpawn(entityClass, spawnList, biomes);
@ -748,6 +799,7 @@ public class ModLoader
* @param entityName
* @param spawnList
*/
@Deprecated
public static void removeSpawn(String entityName, EnumCreatureType spawnList)
{
EntityRegistry.removeSpawn(entityName, spawnList, WorldType.base12Biomes);
@ -760,6 +812,7 @@ public class ModLoader
* @param spawnList
* @param biomes
*/
@Deprecated
public static void removeSpawn(String entityName, EnumCreatureType spawnList, BiomeGenBase... biomes)
{
EntityRegistry.removeSpawn(entityName, spawnList, biomes);
@ -800,6 +853,7 @@ public class ModLoader
*
* @param packet
*/
@Deprecated
public static void sendPacket(Packet packet) {
PacketDispatcher.sendPacketToServer(packet);
}
@ -819,6 +873,7 @@ public class ModLoader
{
}
@Deprecated
public static void serverSendPacket(NetServerHandler handler, Packet packet)
{
if (handler != null)
@ -826,6 +881,7 @@ public class ModLoader
PacketDispatcher.sendPacketToPlayer(packet, (Player)handler.getPlayer());
}
}
@Deprecated
public static void serverOpenWindow(EntityPlayerMP player, Container container, int ID, int x, int y, int z)
{
ModLoaderHelper.openGui(ID, player, container, x, y, z);
@ -838,12 +894,14 @@ public class ModLoader
* @param enable indicates whether you want to recieve them or not
* @param useClock don't receive render subticks, just world ticks
*/
@Deprecated
public static void setInGameHook(BaseMod mod, boolean enable, boolean useClock)
{
ModLoaderHelper.updateStandardTicks(mod, enable, useClock);
}
@Deprecated
public static void setInGUIHook(BaseMod mod, boolean enable, boolean useClock)
{
ModLoaderHelper.updateGUITicks(mod, enable, useClock);
@ -858,6 +916,7 @@ public class ModLoader
* @param fieldindex
* @param value
*/
@Deprecated
public static <T, E> void setPrivateValue(Class<? super T> instanceclass, T instance, int fieldindex, E value)
{
ObfuscationReflectionHelper.setPrivateValue(instanceclass, instance, value, fieldindex);
@ -872,6 +931,7 @@ public class ModLoader
* @param field
* @param value
*/
@Deprecated
public static <T, E> void setPrivateValue(Class<? super T> instanceclass, T instance, String field, E value)
{
ObfuscationReflectionHelper.setPrivateValue(instanceclass, instance, value, field);
@ -906,11 +966,13 @@ public class ModLoader
* @param message
* @param e
*/
@Deprecated
public static void throwException(String message, Throwable e)
{
FMLCommonHandler.instance().raiseException(e, message, true);
}
@Deprecated
public static void throwException(Throwable e)
{
throwException("Exception in ModLoader", e);

View File

@ -5,7 +5,7 @@
* 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
*/
@ -18,14 +18,21 @@ package net.minecraft.src;
* @author cpw
*
*/
@Deprecated
public class TradeEntry
{
@Deprecated
public final int id;
@Deprecated
public float chance;
@Deprecated
public boolean buying;
@Deprecated
public int min = 0;
@Deprecated
public int max = 0;
@Deprecated
public TradeEntry(int id, float chance, boolean buying, int min, int max)
{
this.id = id;
@ -35,6 +42,7 @@ public class TradeEntry
this.max = max;
}
@Deprecated
public TradeEntry(int id, float chance, boolean buying)
{
this(id, chance, buying, 0, 0);