Package logisticspipes.network.packets.satpipe

Source Code of logisticspipes.network.packets.satpipe.SatPipeNext

package logisticspipes.network.packets.satpipe;

import logisticspipes.network.abstractpackets.CoordinatesPacket;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.pipes.PipeFluidSatellite;
import logisticspipes.pipes.PipeItemsSatelliteLogistics;
import logisticspipes.pipes.basic.LogisticsTileGenericPipe;
import net.minecraft.entity.player.EntityPlayer;

public class SatPipeNext extends CoordinatesPacket {

  public SatPipeNext(int id) {
    super(id);
  }

  @Override
  public ModernPacket template() {
    return new SatPipeNext(getId());
  }

  @Override
  public void processPacket(EntityPlayer player) {
    final LogisticsTileGenericPipe pipe = getPipe(player.worldObj);
    if (pipe == null) {
      return;
    }

    if (pipe.pipe instanceof PipeItemsSatelliteLogistics) {
      ((PipeItemsSatelliteLogistics) pipe.pipe).setNextId(player);
    }
    if (pipe.pipe instanceof PipeFluidSatellite) {
      ((PipeFluidSatellite) pipe.pipe).setNextId(player);
    }
  }
 
}
TOP

Related Classes of logisticspipes.network.packets.satpipe.SatPipeNext

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.