Package appeng.me.helpers

Source Code of appeng.me.helpers.AENetworkProxyMultiblock

package appeng.me.helpers;

import java.util.Iterator;

import net.minecraft.item.ItemStack;
import appeng.api.networking.IGridMultiblock;
import appeng.api.networking.IGridNode;
import appeng.me.cluster.IAECluster;
import appeng.me.cluster.IAEMultiBlock;
import appeng.util.iterators.ChainedIterator;
import appeng.util.iterators.ProxyNodeIterator;

public class AENetworkProxyMultiblock extends AENetworkProxy implements IGridMultiblock
{

  IAECluster getCluster()
  {
    return ((IAEMultiBlock) getMachine()).getCluster();
  }

  public AENetworkProxyMultiblock(IGridProxyable te, String nbtName, ItemStack itemStack, boolean inWorld) {
    super( te, nbtName, itemStack, inWorld );
  }

  @Override
  public Iterator<IGridNode> getMultiblockNodes()
  {
    if ( getCluster() == null )
      return new ChainedIterator<IGridNode>();

    return new ProxyNodeIterator( getCluster().getTiles() );
  }
}
TOP

Related Classes of appeng.me.helpers.AENetworkProxyMultiblock

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.