Package logisticspipes.network.packets.block

Source Code of logisticspipes.network.packets.block.RequestRotationPacket

package logisticspipes.network.packets.block;

import logisticspipes.interfaces.IRotationProvider;
import logisticspipes.network.PacketHandler;
import logisticspipes.network.abstractpackets.CoordinatesPacket;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.proxy.MainProxy;
import net.minecraft.entity.player.EntityPlayer;

public class RequestRotationPacket extends CoordinatesPacket {

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

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

  @Override
  public void processPacket(EntityPlayer player) {
    IRotationProvider tile = this.getTile(player.worldObj, IRotationProvider.class);
    if(tile != null) {
      MainProxy.sendPacketToPlayer(PacketHandler.getPacket(Rotation.class).setInteger(tile.getRotation()).setPosX(getPosX()).setPosY(getPosY()).setPosZ(getPosZ()), player);
    }
  }
}
TOP

Related Classes of logisticspipes.network.packets.block.RequestRotationPacket

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.