Everything except ordering

This commit is contained in:
Christian Weeks committed 2012-04-02 23:06:30 -04:00
1 parent bc0caee371
commit ec4750f422
18 files changed
+674 -59

No files matched your search

+105 -12
View File
@@ -15,23 +15,26 @@ package net.minecraft.src;
import java.util.Random;
import net.minecraft.server.MinecraftServer;
import cpw.mods.fml.common.ICraftingHandler;
import cpw.mods.fml.common.IDispenseHandler;
import cpw.mods.fml.common.IPickupNotifier;
import cpw.mods.fml.common.IWorldGenerator;
public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDispenseHandler {
public int addFuel(int id, int metadata) {
return 0;
public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDispenseHandler, ICraftingHandler {
// CALLBACK MECHANISMS
@Override
public void onCrafting(Object... craftingParameters) {
takenFromCrafting((EntityPlayer)craftingParameters[0], (ItemStack)craftingParameters[1], (IInventory)craftingParameters[2]);
}
@Override
public 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) {
return dispenseEntity((World)data[0], x, y, z, xVelocity, zVelocity, (ItemStack)data[1]);
}
public boolean dispenseEntity(World world, double x, double y, double z, int xVel, int zVel, ItemStack item) {
return false;
}
@Override
public void notifyPickup(Object... pickupData) {
@@ -52,27 +55,90 @@ public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDisp
}
}
// BASEMOD API
/**
* Override if you wish to provide a fuel item for the furnace and return the fuel value of the item
* @param id
* @param metadata
* @return
*/
public int addFuel(int id, int metadata) {
return 0;
}
/**
* Override if you wish to perform some action other than just dispensing the item from the dispenser
* @param world
* @param x
* @param y
* @param z
* @param xVel
* @param zVel
* @param item
* @return
*/
public boolean dispenseEntity(World world, double x, double y, double z, int xVel, int zVel, ItemStack item) {
return false;
}
/**
* Override if you wish to generate Nether (Hell biome) blocks
* @param world
* @param random
* @param chunkX
* @param chunkZ
*/
public void generateNether(World world, Random random, int chunkX, int chunkZ) {
}
/**
* Override if you wish to generate Overworld (not hell or the end) blocks
* @param world
* @param random
* @param chunkX
* @param chunkZ
*/
public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
}
/**
* Return the name of your mod. Defaults to the class name
* @return
*/
public String getName() {
return getClass().getSimpleName();
}
/**
* Get your mod priorities
* @return
*/
public String getPriorities() {
return null;
}
/**
* Return the version of your mod
* @return
*/
public abstract String getVersion();
/**
* Load your mod
*/
public abstract void load();
/**
* Finish loading your mod
*/
public void modsLoaded() {
}
/**
* Handle item pickup
* @param player
* @param item
*/
public void onItemPickup(EntityPlayer player, ItemStack item) {
}
@@ -85,28 +151,55 @@ public abstract class BaseMod implements IWorldGenerator, IPickupNotifier, IDisp
return false;
}
/**
* Not implemented because on the server you don't know who it's from
* @param text
*/
@Deprecated
public void receiveChatPacket(String text) {
}
/**
* Not implemented because on the server you don't know who it's from
* @param packet
*/
@Deprecated
public void receiveCustomPacket(Packet250CustomPayload packet) {
}
/**
* Called when someone crafts an item from a crafting table
* @param player
* @param item
* @param matrix
*/
public void takenFromCrafting(EntityPlayer player, ItemStack item, IInventory matrix) {
}
/**
* Called when someone takes a smelted item from a furnace
*
* @param player
* @param item
*/
public void takenFromFurnace(EntityPlayer player, ItemStack item) {
}
/**
* The identifier string for the mod- used in client<->server negotiation
*/
@Override
public String toString() {
return getName()+" "+getVersion();
}
// Spare client junk
// -------
// void addRenderer(Map<Class<? extends Entity>, Render> renderers);
// void registerAnimation(Minecraft game);
// void renderInvBlock(RenderBlocks renderer, Block block, int metadata, int modelID);
// boolean renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID);
// boolean onTickInGUI(float tick, Minecraft game, GuiScreen gui);
// void keyboardEvent(KeyBinding event);
@Override
public String toString() {
return getName()+" "+getVersion();
}
}