Support for ModLoader 1.4.2. Good job Risu!

This commit is contained in:
Christian 2012-10-28 23:55:58 -04:00
parent 463514fbbe
commit dd011e16d2
4 changed files with 12 additions and 22 deletions

View File

@ -169,23 +169,6 @@ public abstract class BaseMod implements cpw.mods.fml.common.modloader.BaseModPr
{
}
/**
* 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
*/
@Override
public int dispenseEntity(World world, ItemStack item, Random rnd, int x, int y, int z, int xVel, int zVel, double entX, double entY, double entZ)
{
return -1;
}
/**
* Override if you wish to generate Nether (Hell biome) blocks
*

View File

@ -126,6 +126,17 @@ public class ModLoader
{
ModLoaderHelper.addCommand(command);
}
/**
* Add a behaviour to the dispenser
*
* @param item
* @param behavior
*/
public static void addDispenserBehavior(Item item, IBehaviorDispenseItem behavior)
{
BlockDispenser.field_82527_a.func_82595_a(item, behavior);
}
/**
* Add localization for the specified string
*

View File

@ -73,9 +73,6 @@ public interface BaseModProxy
public abstract void onItemPickup(EntityPlayer player, ItemStack item);
public abstract int dispenseEntity(World world, ItemStack item, Random rnd, int x, int y, int z, int xVel, int zVel, double entX,
double entY, double entZ);
public abstract void serverCustomPayload(NetServerHandler handler, Packet250CustomPayload packet);
public abstract void serverChat(NetServerHandler source, String message);

View File

@ -21,8 +21,7 @@ public class ModLoaderDispenseHelper implements IDispenserHandler
public int dispense(int x, int y, int z, int xVelocity, int zVelocity, World world, ItemStack item, Random random, double entX, double entY,
double entZ)
{
int ret = mod.dispenseEntity(world, item, random, x, y, z, xVelocity, zVelocity, entX, entY, entZ);
return ret == 0 ? -1 : ret;
return -1;
}
}