YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
net.minecraft.src.ModLoader Class Reference

Static Public Member Functions

static void addAchievementDesc (Achievement achievement, String name, String description)
 
static int addAllFuel (int id, int metadata)
 
static void addAllRenderers (Map< Class<?extends Entity >, Render > renderers)
 
static int addArmor (String armor)
 
static void addBiome (BiomeGenBase biome)
 
static void addEntityTracker (BaseMod mod, Class<?extends Entity > entityClass, int entityTypeId, int updateRange, int updateInterval, boolean sendVelocityInfo)
 
static void addCommand (ICommand command)
 
static void addDispenserBehavior (Item item, IBehaviorDispenseItem behavior)
 
static void addLocalization (String key, String value)
 
static void addLocalization (String key, String lang, String value)
 
static void addName (Object instance, String name)
 
static void addName (Object instance, String lang, String name)
 
static int addOverride (String fileToOverride, String fileToAdd)
 
static void addOverride (String path, String overlayPath, int index)
 
static void addRecipe (ItemStack output, Object...params)
 
static void addShapelessRecipe (ItemStack output, Object...params)
 
static void addSmelting (int input, ItemStack output)
 
static void addSmelting (int input, ItemStack output, float experience)
 
static void addSpawn (Class<?extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList)
 
static void addSpawn (Class<?extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase...biomes)
 
static void addSpawn (String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList)
 
static void addSpawn (String entityName, int weightedProb, int min, int max, EnumCreatureType spawnList, BiomeGenBase...biomes)
 
static void addTrade (int profession, TradeEntry entry)
 
static void clientSendPacket (Packet packet)
 
static boolean dispenseEntity (World world, double x, double y, double z, int xVel, int zVel, ItemStack item)
 
static void genericContainerRemoval (World world, int x, int y, int z)
 
static List< BaseModgetLoadedMods ()
 
static Logger getLogger ()
 
static Minecraft getMinecraftInstance ()
 
static MinecraftServer getMinecraftServerInstance ()
 
static< T, E > T getPrivateValue (Class<?super E > instanceclass, E instance, int fieldindex)
 
static< T, E > T getPrivateValue (Class<?super E > instanceclass, E instance, String field)
 
static int getUniqueBlockModelID (BaseMod mod, boolean inventoryRenderer)
 
static int getUniqueEntityId ()
 
static int getUniqueSpriteIndex (String path)
 
static boolean isChannelActive (EntityPlayer player, String channel)
 
static boolean isGUIOpen (Class<?extends GuiScreen > gui)
 
static boolean isModLoaded (String modname)
 
static void loadConfig ()
 
static BufferedImage loadImage (RenderEngine renderEngine, String path) throws Exception
 
static void onItemPickup (EntityPlayer player, ItemStack item)
 
static void onTick (float tick, Minecraft game)
 
static void openGUI (EntityPlayer player, GuiScreen gui)
 
static void populateChunk (IChunkProvider generator, int chunkX, int chunkZ, World world)
 
static void receivePacket (Packet250CustomPayload packet)
 
static KeyBinding[] registerAllKeys (KeyBinding[] keys)
 
static void registerAllTextureOverrides (RenderEngine cache)
 
static void registerBlock (Block block)
 
static void registerBlock (Block block, Class<?extends ItemBlock > itemclass)
 
static void registerContainerID (BaseMod mod, int id)
 
static void registerEntityID (Class<?extends Entity > entityClass, String entityName, int id)
 
static void registerEntityID (Class<?extends Entity > entityClass, String entityName, int id, int background, int foreground)
 
static void registerKey (BaseMod mod, KeyBinding keyHandler, boolean allowRepeat)
 
static void registerPacketChannel (BaseMod mod, String channel)
 
static void registerTileEntity (Class<?extends TileEntity > tileEntityClass, String id)
 
static void registerTileEntity (Class<?extends TileEntity > tileEntityClass, String id, TileEntitySpecialRenderer renderer)
 
static void removeBiome (BiomeGenBase biome)
 
static void removeSpawn (Class<?extends EntityLiving > entityClass, EnumCreatureType spawnList)
 
static void removeSpawn (Class<?extends EntityLiving > entityClass, EnumCreatureType spawnList, BiomeGenBase...biomes)
 
static void removeSpawn (String entityName, EnumCreatureType spawnList)
 
static void removeSpawn (String entityName, EnumCreatureType spawnList, BiomeGenBase...biomes)
 
static boolean renderBlockIsItemFull3D (int modelID)
 
static void renderInvBlock (RenderBlocks renderer, Block block, int metadata, int modelID)
 
static boolean renderWorldBlock (RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID)
 
static void saveConfig ()
 
static void sendPacket (Packet packet)
 
static void serverChat (String text)
 
static void serverLogin (NetClientHandler handler, Packet1Login loginPacket)
 
static void serverSendPacket (NetServerHandler handler, Packet packet)
 
static void serverOpenWindow (EntityPlayerMP player, Container container, int ID, int x, int y, int z)
 
static void setInGameHook (BaseMod mod, boolean enable, boolean useClock)
 
static void setInGUIHook (BaseMod mod, boolean enable, boolean useClock)
 
static< T, E > void setPrivateValue (Class<?super T > instanceclass, T instance, int fieldindex, E value)
 
static< T, E > void setPrivateValue (Class<?super T > instanceclass, T instance, String field, E value)
 
static void takenFromCrafting (EntityPlayer player, ItemStack item, IInventory matrix)
 
static void takenFromFurnace (EntityPlayer player, ItemStack item)
 
static void throwException (String message, Throwable e)
 
static void throwException (Throwable e)
 

Static Public Attributes

static final String fmlMarker = "This is an FML marker"
 
static final Map< String, Map
< String, String > > 
localizedStrings =Collections.emptyMap()
 

Member Function Documentation

static void net.minecraft.src.ModLoader.addAchievementDesc ( Achievement  achievement,
String  name,
String  description 
)
static

Adds localization info for an achievement, Not used on the server.

Parameters
achievementThe achievement to name
nameThe name
descriptionThe description
static int net.minecraft.src.ModLoader.addAllFuel ( int  id,
int  metadata 
)
static

This method is a call in hook from modified external code. Implemented elsewhere.

GameRegistry#getFuelValue(ItemStack)

Parameters
idThe Item ID
metadataThe Item Metadata
Returns
The fuel strength, in ticks, 0 if unhandled
static void net.minecraft.src.ModLoader.addAllRenderers ( Map< Class<?extends Entity >, Render renderers)
static
static int net.minecraft.src.ModLoader.addArmor ( String  armor)
static

Adds a new prefix to the armor texture list

RenderingRegistry#addNewArmourRendererPrefix(String)

Parameters
armorThe new armor prefix
Returns
The new armor index
static void net.minecraft.src.ModLoader.addBiome ( BiomeGenBase  biome)
static

This method adds the supplied biome to the set of candidate biomes for the default world generator type.

Parameters
biomeThe biome to add
static void net.minecraft.src.ModLoader.addCommand ( ICommand  command)
static
static void net.minecraft.src.ModLoader.addDispenserBehavior ( Item  item,
IBehaviorDispenseItem  behavior 
)
static

Add a behaviour to the dispenser

Parameters
item
behavior
static void net.minecraft.src.ModLoader.addEntityTracker ( BaseMod  mod,
Class<?extends Entity entityClass,
int  entityTypeId,
int  updateRange,
int  updateInterval,
boolean  sendVelocityInfo 
)
static
static void net.minecraft.src.ModLoader.addLocalization ( String  key,
String  value 
)
static

Add localization for the specified string

Parameters
keyKey
valueValue
static void net.minecraft.src.ModLoader.addLocalization ( String  key,
String  lang,
String  value 
)
static

Add localization for the specified string

Parameters
keyKey
langLanguage identifier
valueValue
static void net.minecraft.src.ModLoader.addName ( Object  instance,
String  name 
)
static

Name the specified minecraft object with the supplied name

Parameters
instanceItem to name
nameThe name to give it
static void net.minecraft.src.ModLoader.addName ( Object  instance,
String  lang,
String  name 
)
static

Unimplemented on the server as it does not generate names

Parameters
instanceItem to name
langLanguge identifier
nameName to give it
static int net.minecraft.src.ModLoader.addOverride ( String  fileToOverride,
String  fileToAdd 
)
static

Attempts to register a small image to be applied to a larger texture image, typically how old ModLoader mods add custom Item/Block textures.

Forge mods should use setTextureFile in Item/Block

Will return the icon index it was applied to.

Unimplemented on the server as it does not render textures

Parameters
fileToOverrideThe texture to apply the new image to
fileToAddThe new image
Returns
The 'icon index' in the main image that the new image will be applied to
static void net.minecraft.src.ModLoader.addOverride ( String  path,
String  overlayPath,
int  index 
)
static

Attempts to register a small image to be applied to a larger texture image, typically how old ModLoader mods add custom Item/Block textures.

Forge mods should use setTextureFile in Item/Block

Unimplemented on the server as it does not render textures

Parameters
pathThe texture to apply the new image to
overlayPathThe new image
indexWhere on the texture to apply it
static void net.minecraft.src.ModLoader.addRecipe ( ItemStack  output,
Object...  params 
)
static

Add a Shaped Recipe

Parameters
outputThe result
paramsThe input
static void net.minecraft.src.ModLoader.addShapelessRecipe ( ItemStack  output,
Object...  params 
)
static

Add a shapeless recipe

Parameters
outputThe result
paramsThe input
static void net.minecraft.src.ModLoader.addSmelting ( int  input,
ItemStack  output 
)
static

Add a new product to be smelted

Parameters
input
output
static void net.minecraft.src.ModLoader.addSmelting ( int  input,
ItemStack  output,
float  experience 
)
static

Add a new product to be smelted

Parameters
input
output
static void net.minecraft.src.ModLoader.addSpawn ( Class<?extends EntityLiving entityClass,
int  weightedProb,
int  min,
int  max,
EnumCreatureType  spawnList 
)
static

Add a mob to the spawn list

Parameters
entityClass
weightedProb
min
max
spawnList
static void net.minecraft.src.ModLoader.addSpawn ( Class<?extends EntityLiving entityClass,
int  weightedProb,
int  min,
int  max,
EnumCreatureType  spawnList,
BiomeGenBase...  biomes 
)
static

Add a mob to the spawn list

Parameters
entityClass
weightedProb
min
max
spawnList
biomes
static void net.minecraft.src.ModLoader.addSpawn ( String  entityName,
int  weightedProb,
int  min,
int  max,
EnumCreatureType  spawnList 
)
static

Add a mob to the spawn list

Parameters
entityName
weightedProb
min
max
spawnList
static void net.minecraft.src.ModLoader.addSpawn ( String  entityName,
int  weightedProb,
int  min,
int  max,
EnumCreatureType  spawnList,
BiomeGenBase...  biomes 
)
static

Add a mob to the spawn list

Parameters
entityName
weightedProb
min
max
spawnList
biomes
static void net.minecraft.src.ModLoader.addTrade ( int  profession,
TradeEntry  entry 
)
static
static void net.minecraft.src.ModLoader.clientSendPacket ( Packet  packet)
static

Send a packet from the client

Parameters
packet
static boolean net.minecraft.src.ModLoader.dispenseEntity ( World  world,
double  x,
double  y,
double  z,
int  xVel,
int  zVel,
ItemStack  item 
)
static

This method is a call in hook from modified external code. Implemented elsewhere.

Parameters
world
x
y
z
xVel
zVel
item
Returns
Always false, not implemented here
static void net.minecraft.src.ModLoader.genericContainerRemoval ( World  world,
int  x,
int  y,
int  z 
)
static

Remove a container and drop all the items in it on the ground around

Parameters
world
x
y
z
static List<BaseMod> net.minecraft.src.ModLoader.getLoadedMods ( )
static

Get a list of all BaseMod loaded into the system ModLoaderModContainer#findAll

Returns
A list containing all loaded ModLoader mods
static Logger net.minecraft.src.ModLoader.getLogger ( )
static

Get a logger instance FMLCommonHandler#getFMLLogger()

Returns
The current logger
static Minecraft net.minecraft.src.ModLoader.getMinecraftInstance ( )
static
static MinecraftServer net.minecraft.src.ModLoader.getMinecraftServerInstance ( )
static
static <T,E> T net.minecraft.src.ModLoader.getPrivateValue ( Class<?super E >  instanceclass,
instance,
int  fieldindex 
)
static

Get a value from a field using reflection ObfuscationReflectionHelper#getPrivateValue(Class, Object, int)

Parameters
instanceclass
instance
fieldindex
Returns
The value in the specified field.
static <T,E> T net.minecraft.src.ModLoader.getPrivateValue ( Class<?super E >  instanceclass,
instance,
String  field 
)
static

Get a value from a field using reflection ObfuscationReflectionHelper#getPrivateValue(Class, Object, String[])

Parameters
instanceclass
instance
field
Returns
The value in the specified field.
static int net.minecraft.src.ModLoader.getUniqueBlockModelID ( BaseMod  mod,
boolean  inventoryRenderer 
)
static

Stubbed method on the server to return a unique model id

static int net.minecraft.src.ModLoader.getUniqueEntityId ( )
static

Get a new unique entity id EntityRegistry#findGlobalUniqueEntityId()

Returns
A unique entity ID
static int net.minecraft.src.ModLoader.getUniqueSpriteIndex ( String  path)
static
static boolean net.minecraft.src.ModLoader.isChannelActive ( EntityPlayer  player,
String  channel 
)
static

To properly implement packet 250 protocol you should always check your channel is active prior to sending the packet

Parameters
player
channel
Returns
If the channel is registered to the current connection.
static boolean net.minecraft.src.ModLoader.isGUIOpen ( Class<?extends GuiScreen gui)
static
static boolean net.minecraft.src.ModLoader.isModLoaded ( String  modname)
static

Is the named mod loaded? Loader#isModLoaded(String)

Parameters
modname
Returns
If the specified mod is loaded
static void net.minecraft.src.ModLoader.loadConfig ( )
static

Implemented elsewhere

static BufferedImage net.minecraft.src.ModLoader.loadImage ( RenderEngine  renderEngine,
String  path 
) throws Exception
static
static void net.minecraft.src.ModLoader.onItemPickup ( EntityPlayer  player,
ItemStack  item 
)
static

Call in from elsewhere. Unimplemented here.

Parameters
player
item
static void net.minecraft.src.ModLoader.onTick ( float  tick,
Minecraft  game 
)
static

Call in from elsewhere. Unimplemented here.

static void net.minecraft.src.ModLoader.openGUI ( EntityPlayer  player,
GuiScreen  gui 
)
static
static void net.minecraft.src.ModLoader.populateChunk ( IChunkProvider  generator,
int  chunkX,
int  chunkZ,
World  world 
)
static
static void net.minecraft.src.ModLoader.receivePacket ( Packet250CustomPayload  packet)
static

This method is a call in hook from modified external code. Implemented elsewhere.

Parameters
packet
static KeyBinding [] net.minecraft.src.ModLoader.registerAllKeys ( KeyBinding[]  keys)
static
static void net.minecraft.src.ModLoader.registerAllTextureOverrides ( RenderEngine  cache)
static
static void net.minecraft.src.ModLoader.registerBlock ( Block  block)
static

Register a new block

Parameters
block
static void net.minecraft.src.ModLoader.registerBlock ( Block  block,
Class<?extends ItemBlock itemclass 
)
static

Register a new block

Parameters
block
itemclass
static void net.minecraft.src.ModLoader.registerContainerID ( BaseMod  mod,
int  id 
)
static
static void net.minecraft.src.ModLoader.registerEntityID ( Class<?extends Entity entityClass,
String  entityName,
int  id 
)
static

Register a new entity ID

Parameters
entityClass
entityName
id
static void net.minecraft.src.ModLoader.registerEntityID ( Class<?extends Entity entityClass,
String  entityName,
int  id,
int  background,
int  foreground 
)
static

Register a new entity ID

Parameters
entityClass
entityName
id
background
foreground
static void net.minecraft.src.ModLoader.registerKey ( BaseMod  mod,
KeyBinding  keyHandler,
boolean  allowRepeat 
)
static
static void net.minecraft.src.ModLoader.registerPacketChannel ( BaseMod  mod,
String  channel 
)
static

Register the mod for packets on this channel. NetworkRegistry#registerChannel(IPacketHandler, String)

Parameters
mod
channel
static void net.minecraft.src.ModLoader.registerTileEntity ( Class<?extends TileEntity tileEntityClass,
String  id 
)
static

Register a new tile entity class

Parameters
tileEntityClass
id
static void net.minecraft.src.ModLoader.registerTileEntity ( Class<?extends TileEntity tileEntityClass,
String  id,
TileEntitySpecialRenderer  renderer 
)
static
static void net.minecraft.src.ModLoader.removeBiome ( BiomeGenBase  biome)
static

Remove a biome from the list of generated biomes

Parameters
biome
static void net.minecraft.src.ModLoader.removeSpawn ( Class<?extends EntityLiving entityClass,
EnumCreatureType  spawnList 
)
static

Remove a spawn

Parameters
entityClass
spawnList
static void net.minecraft.src.ModLoader.removeSpawn ( Class<?extends EntityLiving entityClass,
EnumCreatureType  spawnList,
BiomeGenBase...  biomes 
)
static

Remove a spawn

Parameters
entityClass
spawnList
biomes
static void net.minecraft.src.ModLoader.removeSpawn ( String  entityName,
EnumCreatureType  spawnList 
)
static

Remove a spawn

Parameters
entityName
spawnList
static void net.minecraft.src.ModLoader.removeSpawn ( String  entityName,
EnumCreatureType  spawnList,
BiomeGenBase...  biomes 
)
static

Remove a spawn

Parameters
entityName
spawnList
biomes
static boolean net.minecraft.src.ModLoader.renderBlockIsItemFull3D ( int  modelID)
static
static void net.minecraft.src.ModLoader.renderInvBlock ( RenderBlocks  renderer,
Block  block,
int  metadata,
int  modelID 
)
static
static boolean net.minecraft.src.ModLoader.renderWorldBlock ( RenderBlocks  renderer,
IBlockAccess  world,
int  x,
int  y,
int  z,
Block  block,
int  modelID 
)
static
static void net.minecraft.src.ModLoader.saveConfig ( )
static

Configuration is handled elsewhere ModLoaderModContainer

static void net.minecraft.src.ModLoader.sendPacket ( Packet  packet)
static

Send a packet from client to server

Parameters
packet
static void net.minecraft.src.ModLoader.serverChat ( String  text)
static

Send a chat message to the server

Parameters
text
static void net.minecraft.src.ModLoader.serverLogin ( NetClientHandler  handler,
Packet1Login  loginPacket 
)
static
static void net.minecraft.src.ModLoader.serverOpenWindow ( EntityPlayerMP  player,
Container  container,
int  ID,
int  x,
int  y,
int  z 
)
static
static void net.minecraft.src.ModLoader.serverSendPacket ( NetServerHandler  handler,
Packet  packet 
)
static
static void net.minecraft.src.ModLoader.setInGameHook ( BaseMod  mod,
boolean  enable,
boolean  useClock 
)
static

Indicate that you want to receive ticks

Parameters
modreceiving the events
enableindicates whether you want to recieve them or not
useClockdon't receive render subticks, just world ticks
static void net.minecraft.src.ModLoader.setInGUIHook ( BaseMod  mod,
boolean  enable,
boolean  useClock 
)
static
static <T,E> void net.minecraft.src.ModLoader.setPrivateValue ( Class<?super T >  instanceclass,
instance,
int  fieldindex,
value 
)
static

Set a private field to a value using reflection ObfuscationReflectionHelper#setPrivateValue(Class, Object, int, Object)

Parameters
instanceclass
instance
fieldindex
value
static <T,E> void net.minecraft.src.ModLoader.setPrivateValue ( Class<?super T >  instanceclass,
instance,
String  field,
value 
)
static

Set a private field to a value using reflection ObfuscationReflectionHelper#setPrivateValue(Class, Object, String, Object)

Parameters
instanceclass
instance
field
value
static void net.minecraft.src.ModLoader.takenFromCrafting ( EntityPlayer  player,
ItemStack  item,
IInventory  matrix 
)
static

This method is a call in hook from modified external code. Implemented elsewhere.

Parameters
player
item
matrix
static void net.minecraft.src.ModLoader.takenFromFurnace ( EntityPlayer  player,
ItemStack  item 
)
static

This method is a call in hook from modified external code. Implemented elsewhere.

Parameters
player
item
static void net.minecraft.src.ModLoader.throwException ( String  message,
Throwable  e 
)
static

Throw the offered exception. Likely will stop the game.

Parameters
message
e
static void net.minecraft.src.ModLoader.throwException ( Throwable  e)
static

Member Data Documentation

final String net.minecraft.src.ModLoader.fmlMarker = "This is an FML marker"
static
final Map<String,Map<String,String> > net.minecraft.src.ModLoader.localizedStrings =Collections.emptyMap()
static

The documentation for this class was generated from the following file: