Package logisticspipes.network.packets.orderer

Source Code of logisticspipes.network.packets.orderer.RequestFluidOrdererRefreshPacket

package logisticspipes.network.packets.orderer;

import logisticspipes.network.abstractpackets.IntegerCoordinatesPacket;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.pipes.basic.CoreRoutedPipe;
import logisticspipes.pipes.basic.LogisticsTileGenericPipe;
import logisticspipes.proxy.MainProxy;
import logisticspipes.request.RequestHandler;
import net.minecraft.entity.player.EntityPlayer;

public class RequestFluidOrdererRefreshPacket extends IntegerCoordinatesPacket {

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

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

  @Override
  public void processPacket(EntityPlayer player) {
    int dimension = getInteger();
    final LogisticsTileGenericPipe pipe = MainProxy.proxy.getPipeInDimensionAt(dimension, getPosX(), getPosY(), getPosZ(), player);
    if (pipe == null) {
      return;
    }
    if (!(pipe.pipe instanceof CoreRoutedPipe)) {
      return;
    }
    RequestHandler.refreshFluid(player, (CoreRoutedPipe) pipe.pipe);
  }
}
TOP

Related Classes of logisticspipes.network.packets.orderer.RequestFluidOrdererRefreshPacket

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.