Package logisticspipes.network.packets.module

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

package logisticspipes.network.packets.module;

import java.io.IOException;

import logisticspipes.modules.ModuleApiaristAnalyser;
import logisticspipes.network.LPDataInputStream;
import logisticspipes.network.LPDataOutputStream;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.network.abstractpackets.ModuleCoordinatesPacket;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import net.minecraft.entity.player.EntityPlayer;

@Accessors(chain=true)
public class ApiaristAnalyserMode extends ModuleCoordinatesPacket {

  @Getter
  @Setter
  private int mode;

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

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

  @Override
  public void processPacket(EntityPlayer player) {
    ModuleApiaristAnalyser module = this.getLogisticsModule(player, ModuleApiaristAnalyser.class);
    if(module == null) return;
    module.setExtractMode(mode);
  }

  @Override
  public void writeData(LPDataOutputStream data) throws IOException {
    super.writeData(data);
    data.writeInt(mode);
  }

  @Override
  public void readData(LPDataInputStream data) throws IOException {
    super.readData(data);
    mode = data.readInt();
  }
}
TOP

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

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.