<commit_before>package com.creativemd.creativecore.gui.container;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

import com.creativemd.creativecore.gui.ContainerControl;
import com.creativemd.creativecore.gui.CoreControl;
import com.creativemd.creativecore.gui.controls.container.SlotControl;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.nbt.NBTTagCompound;

public abstract class ContainerParent extends ContainerControl implements IControlParent {

	public ContainerParent(String name) {
		super(name);
	}
	
	public ArrayList<ContainerControl> controls = new ArrayList<>();
	
	@Override
	public List getControls() {
		return controls;
	}
	
	@Override
	public CoreControl get(String name)
    {
    	for (int i = 0; i < controls.size(); i++) {
			if(controls.get(i).name.equalsIgnoreCase(name))
				return controls.get(i);
		}
    	return null;
    }
    
	@Override
    public boolean has(String name)
    {
    	for (int i = 0; i < controls.size(); i++) {
			if(controls.get(i).name.equalsIgnoreCase(name))
				return true;
		}
    	return false;
    }
	
	@Override
	public void onOpened()
    {
    	for (int i = 0; i < controls.size(); i++) {
    		controls.get(i).parent = this;
    		controls.get(i).onOpened();
    	}
		refreshControls();
    }
	
	@Override
	public void onClosed()
	{
		for (int i = 0; i < controls.size(); i++) {
			controls.get(i).onClosed();
		}
		//eventBus.removeAllEventListeners();
	}
	
	public void updateEqualContainers()
	{
		if(parent != null)
			getParent().updateEqualContainers();
	}
	
	@Override
	public void refreshControls() {
		for (int i = 0; i < controls.size(); i++)
		{
			controls.get(i).parent = this;
			controls.get(i).setID(i);
		}
	}

	public void sendNBTUpdate(ContainerControl control, NBTTagCompound nbt)
	{
		if(parent != null)
			getParent().sendNBTUpdate(control, nbt);
	}
	
	@Override
	public void onTick()
	{
		for (int i = 0; i < controls.size(); i++) {
			controls.get(i).onTick();
		}
	}
	
	/*=============================Helper Methods=============================*/
	
	public ArrayList<Slot> getSlots()
	{
		ArrayList<Slot> slots = new ArrayList<Slot>();
		for (int i = 0; i < controls.size(); i++) {
			if(controls.get(i) instanceof SlotControl)
				slots.add(((SlotControl)controls.get(i)).slot);
		}
		return slots;
	}
	
	public void addSlotToContainer(Slot slot)
	{
		//slot.xDisplayPosition += 8;
		//slot.yDisplayPosition += 8;
		//if(!inventories.contains(slot.inventory))
			//inventories.add(slot.inventory);
		controls.add(new SlotControl(slot));
	}
	
	public void addPlayerSlotsToContainer(EntityPlayer player)
	{
		addPlayerSlotsToContainer(player, 8, 84);
	}
	
	public void addPlayerSlotsToContainer(EntityPlayer player, int x, int y)
	{
		int l;
        for (l = 0; l < 3; ++l)
        {
            for (int i1 = 0; i1 < 9; ++i1)
            {
            	addSlotToContainer(new Slot(player.inventory, i1 + l * 9 + 9, i1 * 18 + x, l * 18+y));
            }
        }

        for (l = 0; l < 9; ++l)
        {
        	addSlotToContainer(new Slot(player.inventory, l, l * 18+x, 58+y));
        }
	}<commit_msg>Added disabled slot option<commit_after>package com.creativemd.creativecore.gui.container;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

import com.creativemd.creativecore.gui.ContainerControl;
import com.creativemd.creativecore.gui.CoreControl;
import com.creativemd.creativecore.gui.controls.container.SlotControl;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

public abstract class ContainerParent extends ContainerControl implements IControlParent {

	public ContainerParent(String name) {
		super(name);
	}
	
	public ArrayList<ContainerControl> controls = new ArrayList<>();
	
	@Override
	public List getControls() {
		return controls;
	}
	
	@Override
	public CoreControl get(String name)
    {
    	for (int i = 0; i < controls.size(); i++) {
			if(controls.get(i).name.equalsIgnoreCase(name))
				return controls.get(i);
		}
    	return null;
    }
    
	@Override
    public boolean has(String name)
    {
    	for (int i = 0; i < controls.size(); i++) {
			if(controls.get(i).name.equalsIgnoreCase(name))
				return true;
		}
    	return false;
    }
	
	@Override
	public void onOpened()
    {
    	for (int i = 0; i < controls.size(); i++) {
    		controls.get(i).parent = this;
    		controls.get(i).onOpened();
    	}
		refreshControls();
    }
	
	@Override
	public void onClosed()
	{
		for (int i = 0; i < controls.size(); i++) {
			controls.get(i).onClosed();
		}
		//eventBus.removeAllEventListeners();
	}
	
	public void updateEqualContainers()
	{
		if(parent != null)
			getParent().updateEqualContainers();
	}
	
	@Override
	public void refreshControls() {
		for (int i = 0; i < controls.size(); i++)
		{
			controls.get(i).parent = this;
			controls.get(i).setID(i);
		}
	}

	public void sendNBTUpdate(ContainerControl control, NBTTagCompound nbt)
	{
		if(parent != null)
			getParent().sendNBTUpdate(control, nbt);
	}
	
	@Override
	public void onTick()
	{
		for (int i = 0; i < controls.size(); i++) {
			controls.get(i).onTick();
		}
	}
	
	/*=============================Helper Methods=============================*/
	
	public ArrayList<Slot> getSlots()
	{
		ArrayList<Slot> slots = new ArrayList<Slot>();
		for (int i = 0; i < controls.size(); i++) {
			if(controls.get(i) instanceof SlotControl)
				slots.add(((SlotControl)controls.get(i)).slot);
		}
		return slots;
	}
	
	public void addSlotToContainer(Slot slot)
	{
		//slot.xDisplayPosition += 8;
		//slot.yDisplayPosition += 8;
		//if(!inventories.contains(slot.inventory))
			//inventories.add(slot.inventory);
		controls.add(new SlotControl(slot));
	}
	
	public void addPlayerSlotsToContainer(EntityPlayer player)
	{
		addPlayerSlotsToContainer(player, -1);
	}
	
	public void addPlayerSlotsToContainer(EntityPlayer player, int indexUninteractable)
	{
		addPlayerSlotsToContainer(player, 8, 84, indexUninteractable);
	}
	
	public void addPlayerSlotsToContainer(EntityPlayer player, int x, int y)
	{
		addPlayerSlotsToContainer(player, x, y, -1);
	}
	
	public void addPlayerSlotsToContainer(EntityPlayer player, int x, int y, int indexUninteractable)
	{
		int l;
        for (l = 0; l < 3; ++l)
        {
            for (int i1 = 0; i1 < 9; ++i1)
            {
            	int index = i1 + l * 9 + 9;
            	if(index == indexUninteractable)
            		addSlotToContainer(new Slot(player.inventory, index, i1 * 18 + x, l * 18+y)
            		{
            			@Override
            			public boolean canTakeStack(EntityPlayer playerIn)
            		    {
            		        return false;
            		    }
            			
            			@Override
            			public boolean isItemValid(ItemStack stack)
            		    {
            		        return false;
            		    }
            			
            		});
            	else
            		addSlotToContainer(new Slot(player.inventory, index, i1 * 18 + x, l * 18+y));
            }
        }

        for (l = 0; l < 9; ++l)
        {
        	if(l == indexUninteractable)
        		addSlotToContainer(new Slot(player.inventory, l, l * 18+x, 58+y)
				{
        			@Override
        			public boolean canTakeStack(EntityPlayer playerIn)
        		    {
        		        return false;
        		    }
        			
        			@Override
        			public boolean isItemValid(ItemStack stack)
        		    {
        		        return false;
        		    }
				});
        	else
        		addSlotToContainer(new Slot(player.inventory, l, l * 18+x, 58+y));
        }
	}
{'fraction_non_alphanumeric': 0.14017267648552564, 'fraction_numerical': 0.009776536312849162, 'mean_word_length': 2.7173194903256253, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5398581', 'n_tokens_mistral': 2851, 'n_tokens_neox': 2582, 'n_words': 555}