Package logisticspipes.network.packets.module

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

package logisticspipes.network.packets.module;

import logisticspipes.modules.ModuleAdvancedExtractor;
import logisticspipes.network.PacketHandler;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.network.abstractpackets.ModuleCoordinatesPacket;
import logisticspipes.network.packets.modules.AdvancedExtractorInclude;
import logisticspipes.proxy.MainProxy;
import net.minecraft.entity.player.EntityPlayer;

public class AdvancedExtractorIncludePacket extends ModuleCoordinatesPacket {

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

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

  @Override
  public void processPacket(EntityPlayer player) {
    final ModuleAdvancedExtractor module = this.getLogisticsModule(player, ModuleAdvancedExtractor.class);
    if(module == null) return;
    module.setItemsIncluded(!module.areItemsIncluded());
    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(AdvancedExtractorInclude.class).setFlag(module.areItemsIncluded()).setPacketPos(this), player);
  }
}
TOP

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

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.