Package logisticspipes.network.packets.module

Source Code of logisticspipes.network.packets.module.ElectricManagerPacket

package logisticspipes.network.packets.module;

import logisticspipes.modules.ModuleElectricManager;
import logisticspipes.network.abstractpackets.BooleanModuleCoordinatesPacket;
import logisticspipes.network.abstractpackets.ModernPacket;
import lombok.experimental.Accessors;
import net.minecraft.entity.player.EntityPlayer;

@Accessors(chain=true)
public class ElectricManagerPacket extends BooleanModuleCoordinatesPacket {

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

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

  @Override
  public void processPacket(EntityPlayer player) {
    ModuleElectricManager module = this.getLogisticsModule(player, ModuleElectricManager.class);
    if(module == null) return;
    module.setDischargeMode(this.isFlag());
  }
}
TOP

Related Classes of logisticspipes.network.packets.module.ElectricManagerPacket

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.