use of logisticspipes.modules.ModuleItemSink in project LogisticsPipes by RS485.
the class ItemSinkSlot method getContainer.
@Override
public DummyContainer getContainer(EntityPlayer player) {
ModuleItemSink module = this.getLogisticsModule(player.getEntityWorld(), ModuleItemSink.class);
if (module == null) {
return null;
}
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;
}
use of logisticspipes.modules.ModuleItemSink in project LogisticsPipes by RS485.
the class ItemSinkDefaultPacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
ModuleItemSink module = this.getLogisticsModule(player, ModuleItemSink.class);
if (module == null) {
return;
}
module.setDefaultRoute(isDefault);
}
use of logisticspipes.modules.ModuleItemSink in project LogisticsPipes by RS485.
the class ItemSinkFuzzy method processPacket.
@Override
public void processPacket(EntityPlayer player) {
ModuleItemSink module = this.getLogisticsModule(player, ModuleItemSink.class);
if (module == null) {
return;
}
if (pos != -1) {
if (isNBT) {
module.setIgnoreNBT(pos, player);
} else {
module.setIgnoreData(pos, player);
}
} else {
module.setIgnoreNBT(ignoreNBT);
module.setIgnoreData(ignoreData);
}
}
use of logisticspipes.modules.ModuleItemSink in project LogisticsPipes by RS485.
the class ItemSinkSlot method getClientGui.
@Override
public Object getClientGui(EntityPlayer player) {
ModuleItemSink module = this.getLogisticsModule(player.getEntityWorld(), ModuleItemSink.class);
if (module == null) {
return null;
}
module.setDefaultRoute(isDefaultRoute);
module.setIgnoreData(ignoreData);
module.setIgnoreNBT(ignoreNBT);
return new GuiItemSink(player.inventory, module, hasFuzzyUpgrade);
}
use of logisticspipes.modules.ModuleItemSink in project LogisticsPipes by RS485.
the class ItemSinkImportPacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
if (MainProxy.isServer(player.world)) {
ModuleItemSink module = this.getLogisticsModule(player, ModuleItemSink.class);
if (module == null) {
return;
}
MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ItemSinkImportPacket.class).setImportedItems(module.getAdjacentInventoriesItems().limit(module.filterInventory.getSizeInventory()).collect(Collectors.toList())).setPacketPos(this), player);
} else if (MainProxy.isClient(player.world)) {
if (importedItems == null)
return;
if (Minecraft.getMinecraft().currentScreen instanceof GuiItemSink) {
((GuiItemSink) Minecraft.getMinecraft().currentScreen).importFromInventory(importedItems.stream());
}
}
}
Aggregations