|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectModLoader
public final class ModLoader
ModLoader loads classes that inherit from BaseMod
and adds them to a
list for use.
Field Summary | |
---|---|
static java.util.logging.Level |
cfgLoggingLevel
Default logging level. |
static boolean |
DEBUG
Whether debug mode is enabled. |
static java.util.Properties |
props
Contains all the properties loaded from config file. |
static java.lang.String |
VERSION
Current version. |
Method Summary | ||
---|---|---|
static void |
AddAchievementDesc(ws achievement,
java.lang.String name,
java.lang.String description)
Used to give your achievement a readable name and description. |
|
static int |
AddAllFuel(int id,
int metadata)
Used for adding new sources of fuel to the furnace. |
|
static void |
AddAllRenderers(java.util.Map<java.lang.Class<? extends ia>,rg> renderers)
Used to add all mod entity renderers. |
|
static void |
addAnimation(dt anim)
Registers one animation instance. |
|
static int |
AddArmor(java.lang.String armor)
Use this when you need the player to have new armor skin. |
|
static void |
AddLocalization(java.lang.String key,
java.lang.String value)
Method for adding raw strings to the translation table. |
|
static void |
AddName(java.lang.Object instance,
java.lang.String name)
This method will allow adding name to item in inventory. |
|
static int |
addOverride(java.lang.String fileToOverride,
java.lang.String fileToAdd)
Use this to add custom images for your items and blocks. |
|
static void |
addOverride(java.lang.String path,
java.lang.String overlayPath,
int index)
Registers one texture override to be done. |
|
static void |
AddRecipe(dk output,
java.lang.Object... params)
Add recipe to crafting list. |
|
static void |
AddShapelessRecipe(dk output,
java.lang.Object... params)
Add recipe to crafting list. |
|
static void |
AddSmelting(int input,
dk output)
Used to add smelting recipes to the furnace. |
|
static void |
AddSpawn(java.lang.Class<? extends nq> entityClass,
int weightedProb,
int min,
int max,
jf spawnList)
Add entity to spawn list for all biomes except Hell. |
|
static void |
AddSpawn(java.lang.Class<? extends nq> entityClass,
int weightedProb,
int min,
int max,
jf spawnList,
sr... biomes)
Add entity to spawn list for selected biomes. |
|
static void |
AddSpawn(java.lang.String entityName,
int weightedProb,
int min,
int max,
jf spawnList)
Add entity to spawn list for all biomes except Hell. |
|
static void |
AddSpawn(java.lang.String entityName,
int weightedProb,
int min,
int max,
jf spawnList,
sr... biomes)
Add entity to spawn list for selected biomes. |
|
static boolean |
DispenseEntity(ry world,
double x,
double y,
double z,
int xVel,
int zVel,
dk item)
Dispenses the entity associated with the selected item. |
|
static java.util.List<BaseMod> |
getLoadedMods()
Use this method if you need a list of loaded mods. |
|
static java.util.logging.Logger |
getLogger()
Use this to get a reference to the logger ModLoader uses. |
|
static net.minecraft.client.Minecraft |
getMinecraftInstance()
Use this method to get a reference to Minecraft instance. |
|
static
|
getPrivateValue(java.lang.Class<? super E> instanceclass,
E instance,
int fieldindex)
Used for getting value of private fields. |
|
static
|
getPrivateValue(java.lang.Class<? super E> instanceclass,
E instance,
java.lang.String field)
Used for getting value of private fields. |
|
static int |
getUniqueBlockModelID(BaseMod mod,
boolean full3DItem)
Assigns a model id for blocks to use for the given mod. |
|
static int |
getUniqueEntityId()
Gets next Entity ID to use. |
|
static int |
getUniqueSpriteIndex(java.lang.String path)
Gets next available index for this sprite map. |
|
static boolean |
isGUIOpen(java.lang.Class<? extends xe> gui)
Use this method to check if GUI is opened for the player. |
|
static boolean |
isModLoaded(java.lang.String modname)
Checks if a mod is loaded. |
|
static void |
loadConfig()
Reads the config file and stores the contents in props. |
|
static java.awt.image.BufferedImage |
loadImage(zh texCache,
java.lang.String path)
Loads an image from a file in the jar into a BufferedImage. |
|
static void |
OnItemPickup(vi player,
dk item)
Is called when an item is picked up from the world. |
|
static void |
OnTick(float tick,
net.minecraft.client.Minecraft game)
This method is called every tick while minecraft is running. |
|
static void |
OpenGUI(vi player,
xe gui)
Opens GUI for use with mods. |
|
static void |
PopulateChunk(ej generator,
int chunkX,
int chunkZ,
ry world)
Used for generating new blocks in the world. |
|
static aby[] |
RegisterAllKeys(aby[] keys)
Appends all mod key handlers to the given array and returns it. |
|
static void |
RegisterAllTextureOverrides(zh cache)
Processes all registered texture overrides. |
|
static void |
RegisterBlock(yy block)
Adds block to list of blocks the player can use. |
|
static void |
RegisterBlock(yy block,
java.lang.Class<? extends uw> itemclass)
Adds block to list of blocks the player can use. |
|
static void |
RegisterEntityID(java.lang.Class<? extends ia> entityClass,
java.lang.String entityName,
int id)
Registers an entity ID. |
|
static void |
RegisterKey(BaseMod mod,
aby keyHandler,
boolean allowRepeat)
Use this to add an assignable key to the options menu. |
|
static void |
RegisterTileEntity(java.lang.Class<? extends bq> tileEntityClass,
java.lang.String id)
Registers a tile entity. |
|
static void |
RegisterTileEntity(java.lang.Class<? extends bq> tileEntityClass,
java.lang.String id,
du renderer)
Registers a tile entity. |
|
static void |
RemoveSpawn(java.lang.Class<? extends nq> entityClass,
jf spawnList)
Remove entity from spawn list for all biomes except Hell. |
|
static void |
RemoveSpawn(java.lang.Class<? extends nq> entityClass,
jf spawnList,
sr... biomes)
Remove entity from spawn list for selected biomes. |
|
static void |
RemoveSpawn(java.lang.String entityName,
jf spawnList)
Remove entity from spawn list for all biomes except Hell. |
|
static void |
RemoveSpawn(java.lang.String entityName,
jf spawnList,
sr... biomes)
Remove entity from spawn list for selected biomes. |
|
static boolean |
RenderBlockIsItemFull3D(int modelID)
Determines how the block should be rendered. |
|
static void |
RenderInvBlock(acr renderer,
yy block,
int metadata,
int modelID)
Renders a block in inventory. |
|
static boolean |
RenderWorldBlock(acr renderer,
kq world,
int x,
int y,
int z,
yy block,
int modelID)
Renders a block in the world. |
|
static void |
saveConfig()
Saves props to the config file. |
|
static void |
SetInGameHook(BaseMod mod,
boolean enable,
boolean useClock)
Enable or disable BaseMod.OnTickInGame(float, net.minecraft.client.Minecraft) |
|
static void |
SetInGUIHook(BaseMod mod,
boolean enable,
boolean useClock)
Enable or disable BaseMod.OnTickInGUI(float, net.minecraft.client.Minecraft, xe) |
|
static
|
setPrivateValue(java.lang.Class<? super T> instanceclass,
T instance,
int fieldindex,
E value)
Used for setting value of private fields. |
|
static
|
setPrivateValue(java.lang.Class<? super T> instanceclass,
T instance,
java.lang.String field,
E value)
Used for setting value of private fields. |
|
static void |
TakenFromCrafting(vi player,
dk item,
de matrix)
Is called when an item is picked up from crafting result slot. |
|
static void |
TakenFromFurnace(vi player,
dk item)
Is called when an item is picked up from furnace result slot. |
|
static void |
ThrowException(java.lang.String message,
java.lang.Throwable e)
Used for catching an error and generating an error report. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.logging.Level cfgLoggingLevel
public static final boolean DEBUG
public static final java.util.Properties props
public static final java.lang.String VERSION
Method Detail |
---|
public static void AddAchievementDesc(ws achievement, java.lang.String name, java.lang.String description)
achievement
- to assign name and description to.name
- title of your achievementdescription
- details on how to earn this achievementpublic static int AddAllFuel(int id, int metadata)
id
- ItemID for the item to use as fuel.metadata
- Extended data for the item.
BaseMod.AddFuel(int, int)
public static void AddAllRenderers(java.util.Map<java.lang.Class<? extends ia>,rg> renderers)
renderers
- HashMap of the renderers. key is an entity class, value is
the renderer.BaseMod.AddRenderer(java.util.Map, rg>)
public static void addAnimation(dt anim)
anim
- instance of animation handler.public static int AddArmor(java.lang.String armor)
armor
- Name of the armor skin.
public static void AddLocalization(java.lang.String key, java.lang.String value)
key
- tag for string.value
- string to add.public static void AddName(java.lang.Object instance, java.lang.String name)
instance
- A block, item, or item stack reference to name.name
- The name to give.public static int addOverride(java.lang.String fileToOverride, java.lang.String fileToAdd)
fileToOverride
- "/terrain.png" or "/gui/items.png".fileToAdd
- path to the image you want to add.
public static void addOverride(java.lang.String path, java.lang.String overlayPath, int index)
path
- Path to the texture file to modify.overlayPath
- Path to the texture file which is to be overlaid.index
- Sprite index into the texture to be modified.public static void AddRecipe(dk output, java.lang.Object... params)
output
- ItemStack to create.params
- The recipe. First one to three params should be strings
representing the layout of the recipe. Each string should be up to
three letters. Following that is a pair of Character and Item,
Block, or ItemStack references. The Character should match the one
used in first three params.public static void AddShapelessRecipe(dk output, java.lang.Object... params)
output
- ItemStack to create.params
- The recipe. An array of Item, Block, or ItemStack references.public static void AddSmelting(int input, dk output)
input
- ID of the item, or block, to smelt.output
- the ItemStack created.public static void AddSpawn(java.lang.Class<? extends nq> entityClass, int weightedProb, int min, int max, jf spawnList)
entityClass
- Class of entity to spawn.weightedProb
- Higher number means more likely to spawn.min
- Minimum number of entities per spawn attempt.max
- Maximum number of entities per spawn attempt.spawnList
- The type of list to add entity to. Monster, Creature, or
Water.public static void AddSpawn(java.lang.Class<? extends nq> entityClass, int weightedProb, int min, int max, jf spawnList, sr... biomes)
entityClass
- Class of entity to spawn.weightedProb
- Higher number means more likely to spawn.min
- Minimum number of entities per spawn attempt.max
- Maximum number of entities per spawn attempt.spawnList
- The type of list to add entity to. Monster, Creature, or
Water.biomes
- Array of biomes to add entity spawning to.public static void AddSpawn(java.lang.String entityName, int weightedProb, int min, int max, jf spawnList)
entityName
- Name of entity to spawn.weightedProb
- Higher number means more likely to spawn.min
- Minimum number of entities per spawn attempt.max
- Maximum number of entities per spawn attempt.spawnList
- The type of list to add entity to. Monster, Creature, or
Water.public static void AddSpawn(java.lang.String entityName, int weightedProb, int min, int max, jf spawnList, sr... biomes)
entityName
- Name of entity to spawn.weightedProb
- Higher number means more likely to spawn.min
- Minimum number of entities per spawn attempt.max
- Maximum number of entities per spawn attempt.spawnList
- The type of list to add entity to. Monster, Creature, or
Water.biomes
- Array of biomes to add entity spawning to.public static boolean DispenseEntity(ry world, double x, double y, double z, int xVel, int zVel, dk item)
world
- reference to the World.x
- X coordinate.y
- Y coordinate.z
- Z coordinate.xVel
- X velocity.zVel
- Z velocity.item
- Item to chosen to dispense entity.
BaseMod.DispenseEntity(ry, double, double, double, int, int, dk)
public static java.util.List<BaseMod> getLoadedMods()
public static java.util.logging.Logger getLogger()
public static net.minecraft.client.Minecraft getMinecraftInstance()
public static <T,E> T getPrivateValue(java.lang.Class<? super E> instanceclass, E instance, int fieldindex) throws java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.NoSuchFieldException
T
- Return type.E
- Type of instance.instanceclass
- Class to use with instance.instance
- Object to get private field from.fieldindex
- Name of the field.
java.lang.IllegalArgumentException
- if instance isn't compatible with
instanceclass.
java.lang.SecurityException
- if the thread is not allowed to access field.
java.lang.NoSuchFieldException
- if field does not exist.public static <T,E> T getPrivateValue(java.lang.Class<? super E> instanceclass, E instance, java.lang.String field) throws java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.NoSuchFieldException
T
- Return type.E
- Type of instance.instanceclass
- Class to use with instance.instance
- Object to get private field from.field
- Name of the field.
java.lang.IllegalArgumentException
- if instance isn't compatible with
instanceclass.
java.lang.SecurityException
- if the thread is not allowed to access field.
java.lang.NoSuchFieldException
- if field does not exist.public static int getUniqueBlockModelID(BaseMod mod, boolean full3DItem)
mod
- to assign id to.full3DItem
- if true the item will have 3D model created from
RenderInvBlock(acr, yy, int, int)
, if false will be a flat image.
public static int getUniqueEntityId()
public static int getUniqueSpriteIndex(java.lang.String path)
path
- Sprite map to get available index from.
public static boolean isGUIOpen(java.lang.Class<? extends xe> gui)
gui
- The type of GUI to check for. If null, will check for any GUI.
public static boolean isModLoaded(java.lang.String modname)
modname
- Name of the mod to check for.
public static void loadConfig() throws java.io.IOException
java.io.IOException
public static java.awt.image.BufferedImage loadImage(zh texCache, java.lang.String path) throws java.lang.Exception
texCache
- Reference to texture cache.path
- Path inside the jar to the image (starts with /).
java.lang.Exception
public static void OnItemPickup(vi player, dk item)
player
- that picked up itemitem
- that was picked uppublic static void OnTick(float tick, net.minecraft.client.Minecraft game)
tick
- Partial tick. Used for smooth animation.game
- instance of the game class.public static void OpenGUI(vi player, xe gui)
player
- Player instance to open GUI for.gui
- Instance of GUI to open for player.public static void PopulateChunk(ej generator, int chunkX, int chunkZ, ry world)
generator
- Generator to pair with.chunkX
- X coordinate of chunk.chunkZ
- Z coordinate of chunk.world
- World to generate blocks in.BaseMod.GenerateSurface(ry, java.util.Random, int, int)
,
BaseMod.GenerateNether(ry, java.util.Random, int, int)
public static aby[] RegisterAllKeys(aby[] keys)
keys
- Array of the original keys.
public static void RegisterAllTextureOverrides(zh cache)
cache
- Reference to texture cache.public static void RegisterBlock(yy block)
block
- to add.public static void RegisterBlock(yy block, java.lang.Class<? extends uw> itemclass)
block
- to add.itemclass
- Class to use for block item.public static void RegisterEntityID(java.lang.Class<? extends ia> entityClass, java.lang.String entityName, int id)
entityClass
- Class of entity to register.entityName
- The given name of entity. Used for saving.id
- Numeric ID of entity.public static void RegisterKey(BaseMod mod, aby keyHandler, boolean allowRepeat)
mod
- The mod which will use this. 99% of the time you should pass
"this".keyHandler
- reference to the key to register. Define this in your mod
file.allowRepeat
- when true the command will repeat. When false, only
called once per press.public static void RegisterTileEntity(java.lang.Class<? extends bq> tileEntityClass, java.lang.String id)
tileEntityClass
- Class of tile entity to register.id
- The given name of entity. Used for saving.public static void RegisterTileEntity(java.lang.Class<? extends bq> tileEntityClass, java.lang.String id, du renderer)
tileEntityClass
- Class of tile entity to register.id
- The given name of entity. Used for saving.renderer
- Tile entity renderer to assign this tile entity.public static void RemoveSpawn(java.lang.Class<? extends nq> entityClass, jf spawnList)
entityClass
- Class of entity to spawn.spawnList
- The type of list to add entity to. Monster, Creature, or
Water.public static void RemoveSpawn(java.lang.Class<? extends nq> entityClass, jf spawnList, sr... biomes)
entityClass
- Class of entity to spawn.spawnList
- The type of list to add entity to. Monster, Creature, or
Water.biomes
- Array of biomes to add entity spawning to.public static void RemoveSpawn(java.lang.String entityName, jf spawnList)
entityName
- Name of entity to spawn.spawnList
- The type of list to add entity to. Monster, Creature, or
Water.public static void RemoveSpawn(java.lang.String entityName, jf spawnList, sr... biomes)
entityName
- Name of entity to spawn.spawnList
- The type of list to add entity to. Monster, Creature, or
Water.biomes
- Array of biomes to add entity spawning to.public static boolean RenderBlockIsItemFull3D(int modelID)
modelID
- ID of block model.
RenderInvBlock(acr, yy, int, int)
.public static void RenderInvBlock(acr renderer, yy block, int metadata, int modelID)
renderer
- parent renderer. Methods and fields may be referenced from
here.block
- reference to block to render.metadata
- of block. Damage on an item.modelID
- ID of block model to render.public static boolean RenderWorldBlock(acr renderer, kq world, int x, int y, int z, yy block, int modelID)
renderer
- parent renderer. Methods and fields may be referenced from
here.world
- to render block in.x
- XPosy
- YPosz
- ZPosblock
- reference to block to render.modelID
- ID of block model to render.
public static void saveConfig() throws java.io.IOException
java.io.IOException
public static void SetInGameHook(BaseMod mod, boolean enable, boolean useClock)
BaseMod.OnTickInGame(float, net.minecraft.client.Minecraft)
mod
- to setenable
- whether to add or remove from listuseClock
- if true will only run once each tick on game clock, if
false once every render framepublic static void SetInGUIHook(BaseMod mod, boolean enable, boolean useClock)
BaseMod.OnTickInGUI(float, net.minecraft.client.Minecraft, xe)
mod
- to setenable
- whether to add or remove from listuseClock
- if true will only run once each tick on game clock, if
false once every render framepublic static <T,E> void setPrivateValue(java.lang.Class<? super T> instanceclass, T instance, int fieldindex, E value) throws java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.NoSuchFieldException
T
- Type of instance.E
- Type of value.instanceclass
- Class to use with instance.instance
- Object to get private field from.fieldindex
- Offset of field in class.value
- Value to set.
java.lang.IllegalArgumentException
- if instance isn't compatible with
instanceclass.
java.lang.SecurityException
- if the thread is not allowed to access field.
java.lang.NoSuchFieldException
- if field does not exist.public static <T,E> void setPrivateValue(java.lang.Class<? super T> instanceclass, T instance, java.lang.String field, E value) throws java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.NoSuchFieldException
T
- Type of instance.E
- Type of value.instanceclass
- Class to use with instance.instance
- Object to get private field from.field
- Name of the field.value
- Value to set.
java.lang.IllegalArgumentException
- if instance isn't compatible with
instanceclass.
java.lang.SecurityException
- if the thread is not allowed to access field.
java.lang.NoSuchFieldException
- if field does not exist.public static void TakenFromCrafting(vi player, dk item, de matrix)
player
- that picked up itemitem
- that was picked upmatrix
- crafting matrix that is usedpublic static void TakenFromFurnace(vi player, dk item)
player
- that picked up itemitem
- that was picked uppublic static void ThrowException(java.lang.String message, java.lang.Throwable e)
message
- Title of error report.e
- Exception to report.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |