This commit is contained in:
modmuss50 2017-08-15 19:00:37 +01:00
parent 3ea0d2541a
commit 11990301d3
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
5 changed files with 32 additions and 14 deletions

View file

@ -167,7 +167,7 @@ public class GuiAutoCrafting extends GuiBase {
for (int i = 0; i < 9; i++) {
dummyInv.setInventorySlotContents(i, ItemStack.EMPTY);
}
this.recipeSlector.init(this.width, this.height, this.mc, false, this.inventorySlots, dummyInv);
this.recipeSlector.func_194303_a(this.width, this.height, this.mc, false, dummyInv);
this.guiLeft = this.recipeSlector.updateScreenPosition(false, this.width, this.xSize);
}

View file

@ -2,6 +2,7 @@ package techreborn.client.gui.autocrafting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButtonToggle;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.recipebook.GuiRecipeBook;
import net.minecraft.client.gui.recipebook.RecipeList;
import net.minecraft.inventory.Container;
@ -24,22 +25,35 @@ public class GuiAutoCraftingRecipeSlector extends GuiRecipeBook {
//recipeBook.setGuiOpen(true);
}
@Override
public void init(int p_191856_1_, int p_191856_2_, Minecraft mc, boolean p_191856_4_, Container p_191856_5_, InventoryCrafting p_191856_6_) {
super.init(p_191856_1_, p_191856_2_, mc, p_191856_4_, p_191856_5_, p_191856_6_);
}
@Override
public boolean isVisible() {
return true;
}
@Override
public void setContainerRecipe(IRecipe recipe, RecipeList recipes) {
public void setContainerRecipe(IRecipe recipe) {
guiAutoCrafting.setRecipe(recipe, false);
}
@Override
public boolean mouseClicked(int p_191862_1_, int p_191862_2_, int p_191862_3_) {
if (this.isVisible()) {
if (this.recipeBookPage.mouseClicked(p_191862_1_, p_191862_2_, p_191862_3_, (this.width - 147) / 2 - this.xOffset, (this.height - 166) / 2, 147, 166)) {
IRecipe irecipe = this.recipeBookPage.getLastClickedRecipe();
RecipeList recipelist = this.recipeBookPage.getLastClickedRecipeList();
if (irecipe != null && recipelist != null) {
if (!recipelist.isCraftable(irecipe) && this.ghostRecipe.getRecipe() == irecipe) {
return false;
}
this.ghostRecipe.clear();
setContainerRecipe(irecipe);
}
return true;
}
}
return super.mouseClicked(p_191862_1_, p_191862_2_, p_191862_3_);
}
public void setGuiAutoCrafting(GuiAutoCrafting guiAutoCrafting) {
this.guiAutoCrafting = guiAutoCrafting;
}