Package electricexpansion.common.containers

Source Code of electricexpansion.common.containers.ContainerDistribution

package electricexpansion.common.containers;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import electricexpansion.common.tile.TileEntityQuantumBatteryBox;

public class ContainerDistribution extends Container
{
    private TileEntityQuantumBatteryBox tileEntity;
   
    public ContainerDistribution(InventoryPlayer par1InventoryPlayer, TileEntityQuantumBatteryBox tileEntity2)
    {
        this.tileEntity = tileEntity2;
       
        int var3;
        for (var3 = 0; var3 < 3; ++var3)
        {
            for (int var4 = 0; var4 < 9; ++var4)
            {
                this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, var4 * 18 - 23, 84 + var3 * 18));
            }
        }
        for (var3 = 0; var3 < 9; ++var3)
        {
            this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, var3 * 18 - 23, 142));
        }
       
        tileEntity2.openChest();
    }
   
    @Override
    public void onContainerClosed(EntityPlayer entityplayer)
    {
        this.tileEntity.closeChest();
        super.onContainerClosed(entityplayer);
    }
   
    @Override
    public boolean canInteractWith(EntityPlayer par1EntityPlayer)
    {
        return this.tileEntity.isUseableByPlayer(par1EntityPlayer);
    }
   
    @Override
    public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par1)
    {
        return null;
    }
}
TOP

Related Classes of electricexpansion.common.containers.ContainerDistribution

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.