Package logisticspipes.network.packets.pipe

Source Code of logisticspipes.network.packets.pipe.RequestChassiOrientationPacket

package logisticspipes.network.packets.pipe;

import logisticspipes.network.PacketHandler;
import logisticspipes.network.abstractpackets.CoordinatesPacket;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.pipes.PipeLogisticsChassi;
import logisticspipes.pipes.basic.LogisticsTileGenericPipe;
import logisticspipes.proxy.MainProxy;
import net.minecraft.entity.player.EntityPlayer;

public class RequestChassiOrientationPacket extends CoordinatesPacket {
 
  public RequestChassiOrientationPacket(int id) {
    super(id);
  }

  @Override
  public void processPacket(EntityPlayer player) {
    LogisticsTileGenericPipe pipe = this.getPipe(player.worldObj);
    if(pipe == null || !(pipe.pipe instanceof PipeLogisticsChassi)) return;
    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ChassiOrientationPacket.class).setDir(((PipeLogisticsChassi)pipe.pipe).getPointedOrientation()).setPosX(getPosX()).setPosY(getPosY()).setPosZ(getPosZ()), player);
  }
 
  @Override
  public ModernPacket template() {
    return new RequestChassiOrientationPacket(getId());
  }
}
TOP

Related Classes of logisticspipes.network.packets.pipe.RequestChassiOrientationPacket

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.