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());
}
}