Package logisticspipes.network.packets.module

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

package logisticspipes.network.packets.module;

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

public class ProviderModuleNextModePacket extends ModuleCoordinatesPacket {

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

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

  @Override
  public void processPacket(EntityPlayer player) {
    final ModuleProvider module = this.getLogisticsModule(player, ModuleProvider.class);
    if(module == null) return;
    module.nextExtractionMode();
    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ProviderModuleMode.class).setMode(module.getExtractionMode().ordinal()).setModulePos(module), player);
  }
}
TOP

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

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.