use of buildcraft.transport.gate.GateContext in project BuildCraft by BuildCraft.
the class ContainerGate method refresh.
private static <T extends StatementWrapper> void refresh(SortedSet<T> from, GateContext<T> to) {
to.groups.clear();
Map<EnumPipePart, List<T>> parts = new EnumMap<>(EnumPipePart.class);
for (T val : from) {
parts.computeIfAbsent(val.sourcePart, p -> new ArrayList<>()).add(val);
}
List<T> list = parts.get(EnumPipePart.CENTER);
if (list == null) {
list = new ArrayList<>(1);
list.add(null);
} else {
list.add(0, null);
}
to.groups.add(new GateGroup<>(EnumPipePart.CENTER, list));
for (EnumPipePart part : EnumPipePart.FACES) {
list = parts.get(part);
if (list != null) {
to.groups.add(new GateGroup<>(part, list));
}
}
}
Aggregations