Search in sources :

Example 1 with TileTesseract

use of cofh.thermalexpansion.block.ender.TileTesseract in project LogisticsPipes by RS485.

the class ThermalExpansionProxy method getConnectedTesseracts.

@Override
public List<TileEntity> getConnectedTesseracts(TileEntity tile) {
    EnderRegistry registry = RegistryEnderAttuned.getRegistry();
    List<TileEntity> validOutputs = new LinkedList<>();
    if (registry == null)
        return validOutputs;
    List<IEnderItemHandler> interfaces = registry.getLinkedItemOutputs((TileTesseract) tile);
    if (interfaces == null) {
        return validOutputs;
    }
    validOutputs.addAll(interfaces.stream().filter(object -> object.canReceiveItems() && object.canSendItems() && object instanceof TileEntity).map(object -> (TileEntity) object).collect(Collectors.toList()));
    return validOutputs;
}
Also used : EnderRegistry(cofh.lib.transport.EnderRegistry) TileEntity(net.minecraft.tileentity.TileEntity) RegistryEnderAttuned(cofh.core.RegistryEnderAttuned) List(java.util.List) IEnderItemHandler(cofh.api.transport.IEnderItemHandler) TileEntity(net.minecraft.tileentity.TileEntity) EnderRegistry(cofh.lib.transport.EnderRegistry) LinkedList(java.util.LinkedList) IThermalExpansionProxy(logisticspipes.proxy.interfaces.IThermalExpansionProxy) Collectors(java.util.stream.Collectors) TileTesseract(cofh.thermalexpansion.block.ender.TileTesseract) CraftingParts(logisticspipes.recipes.CraftingParts) IEnderItemHandler(cofh.api.transport.IEnderItemHandler) LinkedList(java.util.LinkedList)

Aggregations

IEnderItemHandler (cofh.api.transport.IEnderItemHandler)1 RegistryEnderAttuned (cofh.core.RegistryEnderAttuned)1 EnderRegistry (cofh.lib.transport.EnderRegistry)1 TileTesseract (cofh.thermalexpansion.block.ender.TileTesseract)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 IThermalExpansionProxy (logisticspipes.proxy.interfaces.IThermalExpansionProxy)1 CraftingParts (logisticspipes.recipes.CraftingParts)1 TileEntity (net.minecraft.tileentity.TileEntity)1