Package logisticspipes.network.packets.pipe

Source Code of logisticspipes.network.packets.pipe.FluidSupplierMinMode

package logisticspipes.network.packets.pipe;

import logisticspipes.network.abstractpackets.IntegerCoordinatesPacket;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.pipes.PipeFluidSupplierMk2;
import logisticspipes.pipes.PipeFluidSupplierMk2.MinMode;
import logisticspipes.pipes.basic.LogisticsTileGenericPipe;
import lombok.experimental.Accessors;
import net.minecraft.entity.player.EntityPlayer;

@Accessors(chain=true)
public class FluidSupplierMinMode extends IntegerCoordinatesPacket {

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

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

  @Override
  public void processPacket(EntityPlayer player) {
    final LogisticsTileGenericPipe pipe = this.getPipe(player.worldObj);
    if(pipe == null) return;
    if(pipe.pipe instanceof PipeFluidSupplierMk2) {
      ((PipeFluidSupplierMk2)pipe.pipe).setMinMode(MinMode.values()[getInteger()]);
    }
  }
}
TOP

Related Classes of logisticspipes.network.packets.pipe.FluidSupplierMinMode

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.