Package powercrystals.minefactoryreloaded.gui.container

Source Code of powercrystals.minefactoryreloaded.gui.container.ContainerAutoSpawner

package powercrystals.minefactoryreloaded.gui.container;

import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import powercrystals.minefactoryreloaded.gui.slot.SlotAcceptReusableSafariNet;
import powercrystals.minefactoryreloaded.tile.machine.TileEntityAutoSpawner;

public class ContainerAutoSpawner extends ContainerFactoryPowered
{
  public ContainerAutoSpawner(TileEntityAutoSpawner te, InventoryPlayer inv)
  {
    super(te, inv);
  }
 
  @Override
  protected void addSlots()
  {
    addSlotToContainer(new SlotAcceptReusableSafariNet(_te, 0, 8, 24));
  }
 
  @Override
  public void detectAndSendChanges()
  {
    super.detectAndSendChanges();
    for(int i = 0; i < crafters.size(); i++)
    {
      ((ICrafting)crafters.get(i)).sendProgressBarUpdate(this, 100, ((TileEntityAutoSpawner)_te).getSpawnExact() ? 1 : 0);
    }
  }
 
  @Override
  public void updateProgressBar(int var, int value)
  {
    super.updateProgressBar(var, value);
    if(var == 100) ((TileEntityAutoSpawner)_te).setSpawnExact(value == 0 ? false : true);
  }
}
TOP

Related Classes of powercrystals.minefactoryreloaded.gui.container.ContainerAutoSpawner

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.