Package logisticspipes.network.packets.module

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

package logisticspipes.network.packets.module;

import logisticspipes.modules.abstractmodules.LogisticsSneakyDirectionModule;
import logisticspipes.network.PacketHandler;
import logisticspipes.network.abstractpackets.DirectionModuleCoordinatesPacket;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.network.packets.modules.ExtractorModuleMode;
import logisticspipes.proxy.MainProxy;
import lombok.experimental.Accessors;
import net.minecraft.entity.player.EntityPlayer;

@Accessors(chain=true)
public class ExtractorModuleDirectionPacket extends DirectionModuleCoordinatesPacket {
 
  public ExtractorModuleDirectionPacket(int id) {
    super(id);
  }

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

  @Override
  public void processPacket(EntityPlayer player) {
    final LogisticsSneakyDirectionModule module = this.getLogisticsModule(player, LogisticsSneakyDirectionModule.class);
    if(module == null) return;
    module.setSneakyDirection(getDirection());
    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ExtractorModuleMode.class).setDirection(module.getSneakyDirection()).setPacketPos(this), player);
  }
}
TOP

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

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.