links to implementation

This commit is contained in:
Christian Weeks 2012-04-03 23:09:22 -04:00
parent 3b0126d197
commit b2555e4a50
2 changed files with 34 additions and 13 deletions

View file

@ -24,42 +24,42 @@ import cpw.mods.fml.common.IWorldGenerator;
public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDispenseHandler, ICraftingHandler, INetworkHandler {
// CALLBACK MECHANISMS
@Override
public void onCrafting(Object... craftingParameters) {
public final void onCrafting(Object... craftingParameters) {
takenFromCrafting((EntityPlayer)craftingParameters[0], (ItemStack)craftingParameters[1], (IInventory)craftingParameters[2]);
}
@Override
public void onSmelting(Object... smeltingParameters) {
public final void onSmelting(Object... smeltingParameters) {
takenFromFurnace((EntityPlayer)smeltingParameters[0], (ItemStack)smeltingParameters[1]);
}
@Override
public boolean dispense(double x, double y, double z, byte xVelocity, byte zVelocity, Object... data) {
public final boolean dispense(double x, double y, double z, byte xVelocity, byte zVelocity, Object... data) {
return dispenseEntity((World)data[0], x, y, z, xVelocity, zVelocity, (ItemStack)data[1]);
}
@Override
public boolean onChat(Object... data) {
public final boolean onChat(Object... data) {
return onChatMessageReceived((EntityPlayer)data[1], (Packet3Chat)data[0]);
}
@Override
public void onLogin(Object... data) {
public final void onLogin(Object... data) {
onClientLogin((Packet1Login)data[0],(NetworkManager)data[1]);
}
@Override
public void onPacket250Packet(Object... data) {
public final void onPacket250Packet(Object... data) {
onPacket250Received((EntityPlayer)data[1], (Packet250CustomPayload)data[0]);
}
@Override
public void notifyPickup(Object... pickupData) {
public final void notifyPickup(Object... pickupData) {
EntityItem item=(EntityItem) pickupData[0];
EntityPlayer player=(EntityPlayer) pickupData[1];
onItemPickup(player, item.field_429_a);
}
@Override
public void generate(Random random, int chunkX, int chunkZ, Object... additionalData) {
public final void generate(Random random, int chunkX, int chunkZ, Object... additionalData) {
World w=(World) additionalData[0];
IChunkProvider cp=(IChunkProvider) additionalData[1];
@ -168,6 +168,7 @@ public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDisp
/**
* Not implemented because on the server you don't know who it's from
* {@link #onChatMessageReceived(EntityPlayer, Packet3Chat)}
* @param text
*/
@Deprecated
@ -176,6 +177,7 @@ public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDisp
/**
* Not implemented because on the server you don't know who it's from
* {@link #onPacket250Received(EntityPlayer, Packet250CustomPayload)}
* @param packet
*/
@Deprecated
@ -220,7 +222,7 @@ public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDisp
}
/**
* Called when a new client logs in. Ensure you register your Packet250 channels with them
* Called when a new client logs in. Make sure modloader knows about your channels
* @param login
* @param data
*/

View file

@ -24,17 +24,19 @@ import cpw.mods.fml.server.ModLoaderModContainer;
public class ModLoader {
/**
* Not used on the server.
*
* @param achievement
* @param name
* @param description
*/
public static void addAchievementDesc(Achievement achievement, String name, String description) {
// NOOP on the server??
}
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
*
* {@link FMLHandler#fuelLookup(int, int)}
* @param id
* @param metadata
* @return
@ -45,7 +47,7 @@ public class ModLoader {
}
/**
* This method has been unimplemented in server implementations for some time.
* This method is unimplemented in server versions to date.
*
* @param armor
* @return
@ -56,7 +58,7 @@ public class ModLoader {
}
/**
* This method does not work. Creation of a BiomeGenBase is sufficient to populate this array
* This method does not work. Creation of a BiomeGenBase is sufficient to populate this array. Using this method will likely corrupt worlds.
*
* @param biome
*/
@ -202,6 +204,7 @@ public class ModLoader {
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLHandler#tryDispensingEntity(World, double, double, double, byte, byte, ItemStack)}
* @param world
* @param x
* @param y
@ -263,6 +266,7 @@ public class ModLoader {
/**
* Get a list of all BaseMod loaded into the system
* {@link ModLoaderModContainer#findAll}
* @return
*/
public static List<BaseMod> getLoadedMods() {
@ -271,6 +275,7 @@ public class ModLoader {
/**
* Get a logger instance
* {@link FMLHandler#getFMLLogger()}
* @return
*/
public static Logger getLogger() {
@ -279,6 +284,7 @@ public class ModLoader {
/**
* Get a value from a field using reflection
* {@link ReflectionHelper#getPrivateValue(Class, Object, int)}
* @param instanceclass
* @param instance
* @param fieldindex
@ -290,6 +296,7 @@ public class ModLoader {
/**
* Get a value from a field using reflection
* {@link ReflectionHelper#getPrivateValue(Class, Object, String)}
* @param instanceclass
* @param instance
* @param field
@ -301,6 +308,7 @@ public class ModLoader {
/**
* Get a new unique entity id
* {@link Entity#getNextId()}
* @return
*/
public static int getUniqueEntityId() {
@ -309,6 +317,7 @@ public class ModLoader {
/**
* Is the named mod loaded?
* {@link Loader#isModLoaded(String)}
* @param modname
* @return
*/
@ -318,6 +327,7 @@ public class ModLoader {
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLHandler#handlePacket250(Packet250CustomPayload, EntityPlayer)}
* @param packet
*/
@Deprecated
@ -366,6 +376,7 @@ public class ModLoader {
/**
* Register the mod for packets on this channel. This only registers the channel with Forge Mod Loader, not
* with clients connecting- use BaseMod.onClientLogin to tell them about your custom channel
* {@link FMLHooks#registerChannel(cpw.mods.fml.common.ModContainer, String)}
* @param mod
* @param channel
*/
@ -383,7 +394,7 @@ public class ModLoader {
}
/**
* Remove a biome. This code will probably not work correctly.
* Remove a biome. This code will probably not work correctly and will likely corrupt worlds.
* @param biome
*/
@Deprecated
@ -431,6 +442,7 @@ public class ModLoader {
/**
* Configuration is handled elsewhere
* {@link ModLoaderModContainer}
*/
@Deprecated
public static void saveConfig() {
@ -438,6 +450,7 @@ public class ModLoader {
/**
* This method is unimplemented on the server: it is meant for clients to send chat to the server
* {@link FMLHandler#handleChatPacket(Packet3Chat, EntityPlayer)}
* @param text
*/
@Deprecated
@ -461,6 +474,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
@ -472,6 +486,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
@ -483,6 +498,7 @@ public class ModLoader {
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLHandler#onItemCrafted(EntityPlayer, ItemStack, IInventory)}
* @param player
* @param item
* @param matrix
@ -493,6 +509,7 @@ public class ModLoader {
/**
* This method is a call in hook from modified external code. Implemented elsewhere.
* {@link FMLHandler#onItemSmelted(EntityPlayer, ItemStack)}
* @param player
* @param item
*/
@ -502,6 +519,7 @@ public class ModLoader {
/**
* Throw the offered exception. Likely will stop the game.
* {@link FMLHandler#raiseException(Throwable, String, boolean)}
* @param message
* @param e
*/
@ -511,6 +529,7 @@ public class ModLoader {
/**
* Get the minecraft server instance
* {@link FMLHandler#getServer()}
* @return
*/
public static MinecraftServer getMinecraftServerInstance() {