-
Notifications
You must be signed in to change notification settings - Fork 497
/
PipeManager.java
46 lines (35 loc) · 1.36 KB
/
PipeManager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package buildcraft.api.transport;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;
import net.minecraft.world.World;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
public abstract class PipeManager {
@Deprecated
private static TreeMap<Integer, IPipedItem> allServerEntities = new TreeMap<Integer, IPipedItem>();
@Deprecated
private static TreeMap<Integer, IPipedItem> allClientEntities = new TreeMap<Integer, IPipedItem>();
public static List<IExtractionHandler> extractionHandlers = new ArrayList<IExtractionHandler>();
public static void registerExtractionHandler(IExtractionHandler handler) {
extractionHandlers.add(handler);
}
public static boolean canExtractItems(IPipe pipe, World world, int i, int j, int k) {
for (IExtractionHandler handler : extractionHandlers)
if (!handler.canExtractItems(pipe, world, i, j, k))
return false;
return true;
}
public static boolean canExtractLiquids(IPipe pipe, World world, int i, int j, int k) {
for (IExtractionHandler handler : extractionHandlers)
if (!handler.canExtractLiquids(pipe, world, i, j, k))
return false;
return true;
}
@Deprecated
public static TreeMap<Integer, IPipedItem> getAllEntities() {
if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
return allClientEntities;
return allServerEntities;
}
}