Package logisticspipes.network.packets.block

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

package logisticspipes.network.packets.block;

import logisticspipes.blocks.LogisticsSecurityTileEntity;
import logisticspipes.network.abstractpackets.IntegerCoordinatesPacket;
import logisticspipes.network.abstractpackets.ModernPacket;
import net.minecraft.entity.player.EntityPlayer;

public class SecurityAuthorizationPacket extends IntegerCoordinatesPacket {

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

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

  @Override
  public void processPacket(EntityPlayer player) {
    LogisticsSecurityTileEntity tile = this.getTile(player.worldObj, LogisticsSecurityTileEntity.class);
    if(tile != null) {
      if(getInteger() == 1) {
        tile.authorizeStation();
      } else {
        tile.deauthorizeStation();
      }
    }
  }
}
TOP

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

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.