mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 20:52:34 +00:00
Add in a mechanism to get the modcontainer for a mod - so things can be programmatically changed
This commit is contained in:
1 parent
508c986166
commit
b6ae926fd3
6 files changed
+159
-137
No files matched your search
@@ -38,7 +38,7 @@ public class ModLoader
|
||||
public static final Map<String,Map<String,String>> localizedStrings=Collections.emptyMap();
|
||||
/**
|
||||
* Not used on the server.
|
||||
*
|
||||
*
|
||||
* @param achievement
|
||||
* @param name
|
||||
* @param description
|
||||
@@ -52,9 +52,9 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* This method is a call in hook from modified external code. Implemented elsewhere.
|
||||
*
|
||||
*
|
||||
* {@link FMLCommonHandler#fuelLookup(int, int)}
|
||||
*
|
||||
*
|
||||
* @param id
|
||||
* @param metadata
|
||||
* @return
|
||||
@@ -144,7 +144,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Unimplemented on the server as it does not render textures
|
||||
*
|
||||
*
|
||||
* @param fileToOverride
|
||||
* @param fileToAdd
|
||||
* @return
|
||||
@@ -158,7 +158,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Unimplemented on the server as it does not render textures
|
||||
*
|
||||
*
|
||||
* @param path
|
||||
* @param overlayPath
|
||||
* @param index
|
||||
@@ -217,7 +217,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Add a mob to the spawn list
|
||||
*
|
||||
*
|
||||
* @param entityClass
|
||||
* @param weightedProb
|
||||
* @param min
|
||||
@@ -246,7 +246,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Add a mob to the spawn list
|
||||
*
|
||||
*
|
||||
* @param entityName
|
||||
* @param weightedProb
|
||||
* @param min
|
||||
@@ -262,7 +262,7 @@ public class ModLoader
|
||||
/**
|
||||
* This method is a call in hook from modified external code. Implemented elsewhere.
|
||||
* {@link FMLClientHandler#tryDispensingEntity(World, double, double, double, byte, byte, ItemStack)}
|
||||
*
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
@@ -365,7 +365,7 @@ public class ModLoader
|
||||
/**
|
||||
* This is not the server
|
||||
* {@link FMLClientHandler#getServer()}
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Object getMinecraftServerInstance()
|
||||
@@ -390,7 +390,7 @@ public class ModLoader
|
||||
/**
|
||||
* Get a value from a field using reflection
|
||||
* {@link ReflectionHelper#getPrivateValue(Class, Object, String)}
|
||||
*
|
||||
*
|
||||
* @param instanceclass
|
||||
* @param instance
|
||||
* @param field
|
||||
@@ -403,7 +403,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Stubbed method on the server to return a unique model id
|
||||
*
|
||||
*
|
||||
*/
|
||||
public static int getUniqueBlockModelID(BaseMod mod, boolean inventoryRenderer)
|
||||
{
|
||||
@@ -425,11 +425,11 @@ public class ModLoader
|
||||
{
|
||||
return SpriteHelper.getUniqueSpriteIndex(path);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To properly implement packet 250 protocol you should always check your
|
||||
* channel is active prior to sending the packet
|
||||
*
|
||||
*
|
||||
* @param player
|
||||
* @param channel
|
||||
* @return
|
||||
@@ -447,7 +447,7 @@ public class ModLoader
|
||||
/**
|
||||
* Is the named mod loaded?
|
||||
* {@link Loader#isModLoaded(String)}
|
||||
*
|
||||
*
|
||||
* @param modname
|
||||
* @return
|
||||
*/
|
||||
@@ -499,7 +499,7 @@ public class ModLoader
|
||||
/**
|
||||
* This method is a call in hook from modified external code. Implemented elsewhere.
|
||||
* {@link FMLServerHandler#handlePacket250(Packet250CustomPayload, EntityPlayer)}
|
||||
*
|
||||
*
|
||||
* @param packet
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -520,7 +520,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Register a new block
|
||||
*
|
||||
*
|
||||
* @param block
|
||||
*/
|
||||
public static void registerBlock(Block block)
|
||||
@@ -530,7 +530,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Register a new block
|
||||
*
|
||||
*
|
||||
* @param block
|
||||
* @param itemclass
|
||||
*/
|
||||
@@ -541,7 +541,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Register a new entity ID
|
||||
*
|
||||
*
|
||||
* @param entityClass
|
||||
* @param entityName
|
||||
* @param id
|
||||
@@ -553,7 +553,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Register a new entity ID
|
||||
*
|
||||
*
|
||||
* @param entityClass
|
||||
* @param entityName
|
||||
* @param id
|
||||
@@ -575,18 +575,18 @@ public class ModLoader
|
||||
* channel with Forge Mod Loader, not with clients connecting- use
|
||||
* BaseMod.onClientLogin to tell them about your custom channel
|
||||
* {@link FMLCommonHandler#registerChannel(cpw.mods.fml.common.ModContainer, String)}
|
||||
*
|
||||
*
|
||||
* @param mod
|
||||
* @param channel
|
||||
*/
|
||||
public static void registerPacketChannel(BaseMod mod, String channel)
|
||||
{
|
||||
FMLCommonHandler.instance().registerChannel(ModLoaderModContainer.findContainerFor(mod), channel);
|
||||
FMLCommonHandler.instance().registerChannel(FMLCommonHandler.instance().findContainerFor(mod), channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new tile entity class
|
||||
*
|
||||
*
|
||||
* @param tileEntityClass
|
||||
* @param id
|
||||
*/
|
||||
@@ -602,7 +602,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Remove a biome from the list of generated biomes
|
||||
*
|
||||
*
|
||||
* @param biome
|
||||
*/
|
||||
public static void removeBiome(BiomeGenBase biome)
|
||||
@@ -612,7 +612,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Remove a spawn
|
||||
*
|
||||
*
|
||||
* @param entityClass
|
||||
* @param spawnList
|
||||
*/
|
||||
@@ -623,7 +623,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Remove a spawn
|
||||
*
|
||||
*
|
||||
* @param entityClass
|
||||
* @param spawnList
|
||||
* @param biomes
|
||||
@@ -635,7 +635,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Remove a spawn
|
||||
*
|
||||
*
|
||||
* @param entityName
|
||||
* @param spawnList
|
||||
*/
|
||||
@@ -646,7 +646,7 @@ public class ModLoader
|
||||
|
||||
/**
|
||||
* Remove a spawn
|
||||
*
|
||||
*
|
||||
* @param entityName
|
||||
* @param spawnList
|
||||
* @param biomes
|
||||
@@ -689,7 +689,7 @@ public class ModLoader
|
||||
/**
|
||||
* Send a chat message to the server
|
||||
* {@link FMLClientHandler#handleChatPacket(Packet3Chat, EntityPlayer)}
|
||||
*
|
||||
*
|
||||
* @param text
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -716,7 +716,7 @@ public class ModLoader
|
||||
ModLoaderHelper.updateStandardTicks(mod, enable, useClock);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void setInGUIHook(BaseMod mod, boolean enable, boolean useClock)
|
||||
{
|
||||
ModLoaderHelper.updateGUITicks(mod, enable, useClock);
|
||||
@@ -725,7 +725,7 @@ public class ModLoader
|
||||
/**
|
||||
* Set a private field to a value using reflection
|
||||
* {@link ReflectionHelper#setPrivateValue(Class, Object, int, Object)}
|
||||
*
|
||||
*
|
||||
* @param instanceclass
|
||||
* @param instance
|
||||
* @param fieldindex
|
||||
@@ -739,7 +739,7 @@ public class ModLoader
|
||||
/**
|
||||
* Set a private field to a value using reflection
|
||||
* {@link ReflectionHelper#setPrivateValue(Class, Object, String, Object)}
|
||||
*
|
||||
*
|
||||
* @param instanceclass
|
||||
* @param instance
|
||||
* @param field
|
||||
@@ -753,7 +753,7 @@ public class ModLoader
|
||||
/**
|
||||
* This method is a call in hook from modified external code. Implemented elsewhere.
|
||||
* {@link FMLClientHandler#onItemCrafted(EntityPlayer, ItemStack, IInventory)}
|
||||
*
|
||||
*
|
||||
* @param player
|
||||
* @param item
|
||||
* @param matrix
|
||||
@@ -766,7 +766,7 @@ public class ModLoader
|
||||
/**
|
||||
* This method is a call in hook from modified external code. Implemented elsewhere.
|
||||
* {@link FMLClientHandler#onItemSmelted(EntityPlayer, ItemStack)}
|
||||
*
|
||||
*
|
||||
* @param player
|
||||
* @param item
|
||||
*/
|
||||
@@ -778,7 +778,7 @@ public class ModLoader
|
||||
/**
|
||||
* Throw the offered exception. Likely will stop the game.
|
||||
* {@link FMLClientHandler#raiseException(Throwable, String, boolean)}
|
||||
*
|
||||
*
|
||||
* @param message
|
||||
* @param e
|
||||
*/
|
||||
@@ -786,7 +786,7 @@ public class ModLoader
|
||||
{
|
||||
FMLCommonHandler.instance().raiseException(e, message, true);
|
||||
}
|
||||
|
||||
|
||||
public static void throwException(Throwable e)
|
||||
{
|
||||
throwException("Exception in ModLoader", e);
|
||||
|
||||
Reference in new issue
Block a user