Getting ready for release candidate

This commit is contained in:
WayofTime 2014-07-10 20:52:05 -04:00
parent 084e3dd348
commit 96930fc47a
18 changed files with 477 additions and 69 deletions

View file

@ -0,0 +1,33 @@
package WayofTime.alchemicalWizardry.api.harvest;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.world.World;
public class HarvestRegistry
{
public static List<IHarvestHandler> handlerList = new ArrayList();
public static void registerHarvestHandler(IHarvestHandler handler)
{
handlerList.add(handler);
}
public static boolean harvestBlock(World world, int xCoord, int yCoord, int zCoord)
{
Block block = world.getBlock(xCoord, yCoord, zCoord);
int meta = world.getBlockMetadata(xCoord, yCoord, zCoord);
for(IHarvestHandler handler : handlerList)
{
if(handler.canHandleBlock(block) && handler.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta))
{
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,16 @@
package WayofTime.alchemicalWizardry.api.harvest;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
public interface IHarvestHandler
{
public boolean canHandleBlock(Block block);
public int getHarvestMeta(Block block);
public boolean harvestAndPlant(World world, int xCoord, int yCoord, int zCoord, Block block, int meta);
public IPlantable getSeedItem(Block block);
}