Package logisticspipes.network.packets.satpipe

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

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 SatPipePrev extends CoordinatesPacket {

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

  @Override
  public ModernPacket template() {
    return new SatPipePrev(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).setPrevId(player);
    }
    if (pipe.pipe instanceof PipeFluidSatellite) {
      ((PipeFluidSatellite) pipe.pipe).setPrevId(player);
    }
  }

}
TOP

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

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.