Package logisticspipes.network.packets.module

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

package logisticspipes.network.packets.module;

import logisticspipes.modules.ModuleCrafter;
import logisticspipes.network.PacketHandler;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.network.abstractpackets.ModuleCoordinatesPacket;
import logisticspipes.network.packets.cpipe.CPipeSatelliteImportBack;
import logisticspipes.proxy.MainProxy;
import net.minecraft.entity.player.EntityPlayer;

public class RequestCraftingPipeUpdatePacket extends ModuleCoordinatesPacket {

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

  @Override
  public ModernPacket template() {
    return new RequestCraftingPipeUpdatePacket(getId());
  }
 
  @Override
  public void processPacket(EntityPlayer player) {
    ModuleCrafter module = this.getLogisticsModule(player, ModuleCrafter.class);
    if(module == null) return;
    MainProxy.sendPacketToPlayer(module.getCPipePacket(), player);
    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(CPipeSatelliteImportBack.class).setInventory(module.getDummyInventory()).setModulePos(module), player);
  }
}
TOP

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

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.