<commit_before>package com.lothrazar.powerinventory.inventory.client;

import com.lothrazar.powerinventory.Const; 
import com.lothrazar.powerinventory.ModConfig;
import com.lothrazar.powerinventory.inventory.BigContainerPlayer;

import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiInventory;
 
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.Slot;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;

import org.lwjgl.opengl.GL11;
/**
 * @author https://github.com/Funwayguy/InfiniteInvo
 * @author Forked and altered by https://github.com/PrinceOfAmber/InfiniteInvo
 */
public class GuiBigInventory extends GuiInventory
{
	private BigContainerPlayer container;

	public static final int texture_width = 464;
	public static final int texture_height = 382;

	GuiButton btnEnder;
	GuiButton btnExp;
	public GuiBigInventory(EntityPlayer player)
	{
		super(player);
		container = player.inventoryContainer instanceof BigContainerPlayer? (BigContainerPlayer)player.inventoryContainer : null;
		this.xSize = texture_width;
		this.ySize = texture_height;
	}

	@SuppressWarnings("unchecked")
	@Override
	public void initGui()
    { 
		super.initGui();
		
		if(this.container != null && this.mc.playerController.isInCreativeMode() == false)
		{
			final int height = 20;
			final int width = 26;
		//	final int widthlrg = 58;
			final int padding = 6;
			//final int tiny = 12;
			int button_id = 99;
			 
			btnEnder = new GuiButtonOpenInventory(button_id++, 
					this.guiLeft + container.echestX + 19, 
					this.guiTop + container.echestY-1,
					12,height
					, "",Const.INV_ENDER);
			
			this.buttonList.add(btnEnder); 
			btnEnder.enabled = false;// turn it on based on ender chest present or not

			btnExp = new GuiButtonExp(button_id++, 
					this.guiLeft + container.bottleX - width - padding+1, 
					this.guiTop + container.bottleY-2,
					width,height,StatCollector.translateToLocal("button.exp"));
			this.buttonList.add(btnExp);
			btnExp.enabled = false;
		 
			if(ModConfig.showSortButtons)
			{  
				int x_spacing = width + padding/2;
				int x = guiLeft + texture_width -  5*x_spacing - padding;
				int y = guiTop + texture_height - height - padding;
				 
				GuiButton btn;

				btn = new GuiButtonSort(button_id++, x, y ,width,height, Const.SORT_LEFTALL,"<<");
				this.buttonList.add(btn);

				x += x_spacing;
			 
				btn = new GuiButtonSort(button_id++, x, y ,width,height, Const.SORT_LEFT,"<");
				this.buttonList.add(btn);

				x += x_spacing;
				
				this.buttonList.add(new GuiButtonFilter(button_id++,x, y,width + 4,height));
				this.buttonList.add(btn);

				x += x_spacing + 4;

				btn = new GuiButtonSort(button_id++, x, y ,width,height, Const.SORT_RIGHT,">");
				this.buttonList.add(btn);
				  
				x += x_spacing;
				
				btn = new GuiButtonSort(button_id++, x, y ,width,height, Const.SORT_RIGHTALL,">>");
				this.buttonList.add(btn);
				
			}
		}
    }
	
	private void checkSlotsEmpty()
	{
		final int s = 16;
		String st;
		if(container.invo.getStackInSlot(Const.enderChestSlot) == null)
		{
			btnEnder.enabled = false;

			st = "textures/items/empty_enderchest.png";
			this.mc.getTextureManager().bindTexture(new ResourceLocation(Const.MODID, st)); 
			drawTexturedQuadFit(container.echestX, container.echestY,s,s,0); 
		}
		else 
		{ 
			btnEnder.enabled = true; 
		}
		
		if(container.invo.getStackInSlot(Const.bottleSlot) == null || 
		   container.invo.getStackInSlot(Const.bottleSlot).getItem() == Items.experience_bottle	)
		{
			btnExp.enabled = false;

			st = "textures/items/empty_bottle.png";
			this.mc.getTextureManager().bindTexture(new ResourceLocation(Const.MODID, st)); 
			drawTexturedQuadFit(container.echestX, container.echestY,s,s,0); 
		}
		else 
		{ 
			btnExp.enabled = true; 
		}

		if(container.invo.getStackInSlot(Const.enderPearlSlot) == null)
		{ 
			st = "textures/items/empty_enderpearl.png";
			this.mc.getTextureManager().bindTexture(new ResourceLocation(Const.MODID, st)); 
			drawTexturedQuadFit(container.pearlX, container.pearlY,s,s,0);<commit_msg>PowerInventory: bugfix: was drawing empty bottle on the wrong slot<commit_after>package com.lothrazar.powerinventory.inventory.client;

import com.lothrazar.powerinventory.Const; 
import com.lothrazar.powerinventory.ModConfig;
import com.lothrazar.powerinventory.inventory.BigContainerPlayer;

import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiInventory;
 
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.Slot;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;

import org.lwjgl.opengl.GL11;
/**
 * @author https://github.com/Funwayguy/InfiniteInvo
 * @author Forked and altered by https://github.com/PrinceOfAmber/InfiniteInvo
 */
public class GuiBigInventory extends GuiInventory
{
	private BigContainerPlayer container;

	public static final int texture_width = 464;
	public static final int texture_height = 382;

	GuiButton btnEnder;
	GuiButton btnExp;
	public GuiBigInventory(EntityPlayer player)
	{
		super(player);
		container = player.inventoryContainer instanceof BigContainerPlayer? (BigContainerPlayer)player.inventoryContainer : null;
		this.xSize = texture_width;
		this.ySize = texture_height;
	}

	@SuppressWarnings("unchecked")
	@Override
	public void initGui()
    { 
		super.initGui();
		
		if(this.container != null && this.mc.playerController.isInCreativeMode() == false)
		{
			final int height = 20;
			final int width = 26;
		//	final int widthlrg = 58;
			final int padding = 6;
			//final int tiny = 12;
			int button_id = 99;
			 
			btnEnder = new GuiButtonOpenInventory(button_id++, 
					this.guiLeft + container.echestX + 19, 
					this.guiTop + container.echestY-1,
					12,height
					, "",Const.INV_ENDER);
			
			this.buttonList.add(btnEnder); 
			btnEnder.enabled = false;// turn it on based on ender chest present or not

			btnExp = new GuiButtonExp(button_id++, 
					this.guiLeft + container.bottleX - width - padding+1, 
					this.guiTop + container.bottleY-2,
					width,height,StatCollector.translateToLocal("button.exp"));
			this.buttonList.add(btnExp);
			btnExp.enabled = false;
		 
			if(ModConfig.showSortButtons)
			{  
				int x_spacing = width + padding/2;
				int x = guiLeft + texture_width -  5*x_spacing - padding;
				int y = guiTop + texture_height - height - padding;
				 
				GuiButton btn;

				btn = new GuiButtonSort(button_id++, x, y ,width,height, Const.SORT_LEFTALL,"<<");
				this.buttonList.add(btn);

				x += x_spacing;
			 
				btn = new GuiButtonSort(button_id++, x, y ,width,height, Const.SORT_LEFT,"<");
				this.buttonList.add(btn);

				x += x_spacing;
				
				this.buttonList.add(new GuiButtonFilter(button_id++,x, y,width + 4,height));
				this.buttonList.add(btn);

				x += x_spacing + 4;

				btn = new GuiButtonSort(button_id++, x, y ,width,height, Const.SORT_RIGHT,">");
				this.buttonList.add(btn);
				  
				x += x_spacing;
				
				btn = new GuiButtonSort(button_id++, x, y ,width,height, Const.SORT_RIGHTALL,">>");
				this.buttonList.add(btn);
				
			}
		}
    }
	
	private void checkSlotsEmpty()
	{
		final int s = 16;
		String st;
		if(container.invo.getStackInSlot(Const.enderChestSlot) == null)
		{
			btnEnder.enabled = false;

			st = "textures/items/empty_enderchest.png";
			this.mc.getTextureManager().bindTexture(new ResourceLocation(Const.MODID, st)); 
			drawTexturedQuadFit(container.echestX, container.echestY,s,s,0); 
		}
		else 
		{ 
			btnEnder.enabled = true; 
		}
		
		if(container.invo.getStackInSlot(Const.bottleSlot) == null || 
		   container.invo.getStackInSlot(Const.bottleSlot).getItem() == Items.experience_bottle	)
		{
			btnExp.enabled = false;

			st = "textures/items/empty_bottle.png";
			this.mc.getTextureManager().bindTexture(new ResourceLocation(Const.MODID, st)); 
			drawTexturedQuadFit(container.bottleX, container.bottleY,s,s,0); 
		}
		else 
		{ 
			btnExp.enabled = true; 
		}

		if(container.invo.getStackInSlot(Const.enderPearlSlot) == null)
		{ 
			st = "textures/items/empty_enderpearl.png";
			this.mc.getTextureManager().bindTexture(new ResourceLocation(Const.MODID, st)); 
			drawTexturedQuadFit(container.pearlX, container.pearlY,s,s,0);
{'fraction_non_alphanumeric': 0.12149855907780979, 'fraction_numerical': 0.008530259365994237, 'mean_word_length': 3.9464082098061573, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, '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': '1924513', 'n_tokens_mistral': 3505, 'n_tokens_neox': 2986, 'n_words': 524}