Package logisticspipes.network.guis.module.inpipe

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

package logisticspipes.network.guis.module.inpipe;

import logisticspipes.gui.modules.GuiModBasedItemSink;
import logisticspipes.modules.ModuleModBasedItemSink;
import logisticspipes.network.abstractguis.GuiProvider;
import logisticspipes.network.abstractguis.NBTModuleCoordinatesGuiProvider;
import logisticspipes.utils.gui.DummyContainer;
import logisticspipes.utils.item.ItemIdentifierInventory;
import lombok.experimental.Accessors;
import net.minecraft.entity.player.EntityPlayer;

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

  @Override
  public Object getClientGui(EntityPlayer player) {
    ModuleModBasedItemSink module = this.getLogisticsModule(player.getEntityWorld(), ModuleModBasedItemSink.class);
    if(module == null) return null;
    module.readFromNBT(getNbt());
    return new GuiModBasedItemSink(player.inventory, module);
  }

  @Override
  public DummyContainer getContainer(EntityPlayer player) {
    ModuleModBasedItemSink module = this.getLogisticsModule(player.getEntityWorld(), ModuleModBasedItemSink.class);
    if(module == null) return null;
    DummyContainer dummy = new DummyContainer(player.inventory, new ItemIdentifierInventory(1, "TMP", 1));
    dummy.addDummySlot(0, 0, 0);
    dummy.addNormalSlotsForPlayerInventory(0, 0);
    return dummy;
  }

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

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

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.