BloodMagic/1.7.2/main/java/WayofTime/alchemicalWizardry/api/harvest/HarvestRegistry.java

35 lines
805 B
Java
Raw Normal View History

2014-07-11 00:52:05 +00:00
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)
{
2014-07-13 22:18:28 +00:00
System.out.println("Heeeeelllooooo");
2014-07-11 00:52:05 +00:00
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)
{
2014-07-15 23:23:57 +00:00
if(handler.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta))
2014-07-11 00:52:05 +00:00
{
return true;
}
}
return false;
}
}