mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 15:23:06 +00:00
30 lines
835 B
Java
30 lines
835 B
Java
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.harvestAndPlant(world, xCoord, yCoord, zCoord, block, meta)) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|