Package logisticspipes.network.packets.module

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

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.ProviderModuleInclude;
import logisticspipes.proxy.MainProxy;
import net.minecraft.entity.player.EntityPlayer;

public class ProviderModuleIncludePacket extends ModuleCoordinatesPacket {

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

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

  @Override
  public void processPacket(EntityPlayer player) {
    final ModuleProvider module = this.getLogisticsModule(player, ModuleProvider.class);
    if(module == null) return;
    module.setFilterExcluded(!module.isExcludeFilter());
    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ProviderModuleInclude.class).setFlag(module.isExcludeFilter()).setModulePos(module), player);
  }
}
TOP

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

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.