Package logisticspipes.network.packets.block

Source Code of logisticspipes.network.packets.block.SolderingStationInventory

package logisticspipes.network.packets.block;

import logisticspipes.blocks.LogisticsSolderingTileEntity;
import logisticspipes.network.abstractpackets.InventoryModuleCoordinatesPacket;
import logisticspipes.network.abstractpackets.ModernPacket;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

public class SolderingStationInventory extends InventoryModuleCoordinatesPacket {

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

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

  @Override
  public void processPacket(EntityPlayer player) {
    final LogisticsSolderingTileEntity tile = this.getTile(player.worldObj, LogisticsSolderingTileEntity.class);
    if(tile != null) {
      for(int i = 0; i < tile.getSizeInventory(); i++) {
        if(i >= getStackList().size()) break;
        ItemStack stack = getStackList().get(i);
        tile.setInventorySlotContents(i, stack);
      }
    }
  }
}
TOP

Related Classes of logisticspipes.network.packets.block.SolderingStationInventory

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.