Mekanism-tilera-Edition/common/buildcraft/api/transport/PipeManager.java

37 lines
954 B
Java
Raw Normal View History

2013-04-13 16:35:13 +02:00
package buildcraft.api.transport;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.world.World;
public abstract class PipeManager {
public static List<IExtractionHandler> extractionHandlers = new ArrayList<IExtractionHandler>();
public static void registerExtractionHandler(IExtractionHandler handler) {
extractionHandlers.add(handler);
}
/**
* param extractor can be null
*/
public static boolean canExtractItems(Object extractor, World world, int i, int j, int k) {
for (IExtractionHandler handler : extractionHandlers)
if (!handler.canExtractItems(extractor, world, i, j, k))
return false;
return true;
}
/**
* param extractor can be null
*/
2013-08-08 19:10:11 +02:00
public static boolean canExtractFluids(Object extractor, World world, int i, int j, int k) {
2013-04-13 16:35:13 +02:00
for (IExtractionHandler handler : extractionHandlers)
2013-08-08 19:10:11 +02:00
if (!handler.canExtractFluids(extractor, world, i, j, k))
2013-04-13 16:35:13 +02:00
return false;
return true;
}
}