Package logisticspipes.network.packets.pipe

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

package logisticspipes.network.packets.pipe;

import logisticspipes.network.abstractpackets.CoordinatesPacket;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.pipes.PipeLogisticsChassi;
import logisticspipes.pipes.basic.LogisticsTileGenericPipe;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.util.ForgeDirection;

@Accessors(chain=true)
public class ChassiOrientationPacket extends CoordinatesPacket {
 
  @Getter
  @Setter
  private ForgeDirection dir;
 
  public ChassiOrientationPacket(int id) {
    super(id);
  }

  @Override
  public void processPacket(EntityPlayer player) {
    LogisticsTileGenericPipe pipe = this.getPipe(player.worldObj);
    if(pipe == null || !(pipe.pipe instanceof PipeLogisticsChassi)) return;
    ((PipeLogisticsChassi)pipe.pipe).setClientOrientation(dir);
  }
 
  @Override
  public ModernPacket template() {
    return new ChassiOrientationPacket(getId());
  }
}
TOP

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

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.