Package logisticspipes.network.guis.module.inpipe

Source Code of logisticspipes.network.guis.module.inpipe.FluidSupplierSlot

package logisticspipes.network.guis.module.inpipe;

import logisticspipes.gui.modules.GuiFluidSupplier;
import logisticspipes.modules.ModuleFluidSupplier;
import logisticspipes.network.abstractguis.GuiProvider;
import logisticspipes.network.abstractguis.ModuleCoordinatesGuiProvider;
import logisticspipes.utils.gui.DummyContainer;
import lombok.experimental.Accessors;
import net.minecraft.entity.player.EntityPlayer;

@Accessors(chain=true)
public class FluidSupplierSlot extends ModuleCoordinatesGuiProvider {

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

  @Override
  public Object getClientGui(EntityPlayer player) {
    ModuleFluidSupplier module = this.getLogisticsModule(player.getEntityWorld(), ModuleFluidSupplier.class);
    return new GuiFluidSupplier(player.inventory, module);
  }

  @Override
  public DummyContainer getContainer(EntityPlayer player) {
    ModuleFluidSupplier module = this.getLogisticsModule(player.getEntityWorld(), ModuleFluidSupplier.class);
    DummyContainer dummy = new DummyContainer(player.inventory, module.getFilterInventory());
    dummy.addNormalSlotsForPlayerInventory(8, 60);
    //Pipe slots
      for(int pipeSlot = 0; pipeSlot < 9; pipeSlot++){
        dummy.addDummySlot(pipeSlot, 8 + pipeSlot * 18, 18);
      }
      return dummy;
  }

  @Override
  public GuiProvider template() {
    return new FluidSupplierSlot(getId());
  }
}
TOP

Related Classes of logisticspipes.network.guis.module.inpipe.FluidSupplierSlot

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.