<commit_before>package de.comeight.crystallogy.gui.bookOfKnowledge;

import java.util.LinkedList;

import de.comeight.crystallogy.gui.bookOfKnowledge.buttons.BookButtonCrafting;
import de.comeight.crystallogy.gui.bookOfKnowledge.pages.GuiBookPage;
import de.comeight.crystallogy.handler.BlockHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class BookInfusionRecipe {
	//-----------------------------------------------Variabeln:---------------------------------------------
	private BookButtonCrafting[] input;
	private BookButtonCrafting output;
	
	private int x;
	private int y;
	
	private final int frameDuration = 2500; 
	private long lastFrame;
	private int frame;
	
	//-----------------------------------------------Constructor:-------------------------------------------
	public BookInfusionRecipe(BookButtonCrafting[] input, BookButtonCrafting output) {
		if(input.length != 5){
			try {
				throw new Exception("input.length != 5!");
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		
		for (int i = 0; i < input.length; i++) {
			if(input[i] != null)
			input[i].disableFrame();
		}
		
		this.input = input;
		this.output = output;
		lastFrame = System.currentTimeMillis();
	}
	
	//-----------------------------------------------Set-, Get-Methoden:------------------------------------
	public void setFrame(int frame){
		this.frame = frame;
		this.lastFrame = System.currentTimeMillis();
	}
	
	//-----------------------------------------------Sonstige Methoden:-------------------------------------
	public void drawScreen(int mouseX, int mouseY, int x, int y){
		this.x = x;
		this.y = y;
		
		drawInfuserBlock();
		if(frame == 1){
			drawInput(mouseX, mouseY);
			GuiBookUtilities.drawTextBox(x - 10, y + 10, 100, 1.2F, "Input:");
		}
		else{
			drawOutput(mouseX, mouseY);
			GuiBookUtilities.drawTextBox(x - 10, y + 10, 100, 1.2F, "Output:");
		}
		manageFrames();
	}
	
	private void drawInput(int mouseX, int mouseY){
		if(input[0] != null && input[0] != BookButtonCrafting.EMPTY){
			input[0].drawButton(mouseX, mouseY, x + 30, y + 35);
		}
		
		if(input[1] != null && input[1] != BookButtonCrafting.EMPTY){
			input[1].drawButton(mouseX, mouseY, x + 30, y);
		}
		if(input[2] != null && input[2] != BookButtonCrafting.EMPTY){
			input[2].drawButton(mouseX, mouseY, x - 5, y + 35);
		}
		if(input[3] != null && input[3] != BookButtonCrafting.EMPTY){
			input[3].drawButton(mouseX, mouseY, x + 65, y + 35);<commit_msg>Now the input shows first<commit_after>package de.comeight.crystallogy.gui.bookOfKnowledge;

import java.util.LinkedList;

import de.comeight.crystallogy.gui.bookOfKnowledge.buttons.BookButtonCrafting;
import de.comeight.crystallogy.gui.bookOfKnowledge.pages.GuiBookPage;
import de.comeight.crystallogy.handler.BlockHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class BookInfusionRecipe {
	//-----------------------------------------------Variabeln:---------------------------------------------
	private BookButtonCrafting[] input;
	private BookButtonCrafting output;
	
	private int x;
	private int y;
	
	private final int frameDuration = 2500; 
	private long lastFrame;
	private int frame;
	
	//-----------------------------------------------Constructor:-------------------------------------------
	public BookInfusionRecipe(BookButtonCrafting[] input, BookButtonCrafting output) {
		if(input.length != 5){
			try {
				throw new Exception("input.length != 5!");
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		
		for (int i = 0; i < input.length; i++) {
			if(input[i] != null)
			input[i].disableFrame();
		}
		
		this.input = input;
		this.output = output;
		lastFrame = System.currentTimeMillis();
	}
	
	//-----------------------------------------------Set-, Get-Methoden:------------------------------------
	public void setFrame(int frame){
		this.frame = frame;
		this.lastFrame = System.currentTimeMillis();
	}
	
	//-----------------------------------------------Sonstige Methoden:-------------------------------------
	public void drawScreen(int mouseX, int mouseY, int x, int y){
		this.x = x;
		this.y = y;
		
		drawInfuserBlock();
		if(frame == 0){
			drawInput(mouseX, mouseY);
			GuiBookUtilities.drawTextBox(x - 10, y + 10, 100, 1.2F, "Input:");
		}
		else{
			drawOutput(mouseX, mouseY);
			GuiBookUtilities.drawTextBox(x - 10, y + 10, 100, 1.2F, "Output:");
		}
		manageFrames();
	}
	
	private void drawInput(int mouseX, int mouseY){
		if(input[0] != null && input[0] != BookButtonCrafting.EMPTY){
			input[0].drawButton(mouseX, mouseY, x + 30, y + 35);
		}
		
		if(input[1] != null && input[1] != BookButtonCrafting.EMPTY){
			input[1].drawButton(mouseX, mouseY, x + 30, y);
		}
		if(input[2] != null && input[2] != BookButtonCrafting.EMPTY){
			input[2].drawButton(mouseX, mouseY, x - 5, y + 35);
		}
		if(input[3] != null && input[3] != BookButtonCrafting.EMPTY){
			input[3].drawButton(mouseX, mouseY, x + 65, y + 35);
{'fraction_non_alphanumeric': 0.25831104317921283, 'fraction_numerical': 0.019487963316774933, 'mean_word_length': 2.298676748582231, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6748575', 'n_tokens_mistral': 1883, 'n_tokens_neox': 1628, 'n_words': 349}