diff --git a/build.gradle b/build.gradle index 2a51b423e..ec14b017c 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'idea' -version = "1.12.2-r143" +version = "1.12.2-r144" group = "de.ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java index 650e1da92..282341077 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/booklet/BookletRecipeWrapper.java @@ -10,73 +10,74 @@ package de.ellpeck.actuallyadditions.mod.jei.booklet; +import java.util.ArrayList; +import java.util.List; + import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletPage; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fluids.FluidStack; -import java.util.ArrayList; -import java.util.List; - -public class BookletRecipeWrapper extends RecipeWrapperWithButton{ +public class BookletRecipeWrapper extends RecipeWrapperWithButton { public final IBookletPage thePage; - public BookletRecipeWrapper(IBookletPage page){ + public BookletRecipeWrapper(IBookletPage page) { this.thePage = page; } @Override - public void getIngredients(IIngredients ingredients){ + public void getIngredients(IIngredients ingredients) { List itemList = new ArrayList(); this.thePage.getItemStacksForPage(itemList); - ingredients.setInputs(ItemStack.class, itemList); - ingredients.setOutputs(ItemStack.class, itemList); + ingredients.setInputs(VanillaTypes.ITEM, itemList); + ingredients.setOutputs(VanillaTypes.ITEM, itemList); List fluidList = new ArrayList(); this.thePage.getFluidStacksForPage(fluidList); - ingredients.setInputs(FluidStack.class, fluidList); - ingredients.setOutputs(FluidStack.class, fluidList); + ingredients.setInputs(VanillaTypes.FLUID, fluidList); + ingredients.setOutputs(VanillaTypes.FLUID, fluidList); } @Override - public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ - List header = minecraft.fontRenderer.listFormattedStringToWidth(StringUtil.localize("container.nei."+ActuallyAdditions.MODID+".booklet.header").replaceAll("", TextFormatting.BLUE+"").replaceAll("", TextFormatting.BLACK+""), 150); - for(int i = 0; i < header.size(); i++){ - minecraft.fontRenderer.drawString((String)header.get(i), 0, 17+i*(minecraft.fontRenderer.FONT_HEIGHT+1), 0, false); + public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { + List header = minecraft.fontRenderer.listFormattedStringToWidth(StringUtil.localize("container.nei." + ActuallyAdditions.MODID + ".booklet.header").replaceAll("", TextFormatting.BLUE + "").replaceAll("", TextFormatting.BLACK + ""), 150); + for (int i = 0; i < header.size(); i++) { + minecraft.fontRenderer.drawString((String) header.get(i), 0, 17 + i * (minecraft.fontRenderer.FONT_HEIGHT + 1), 0, false); } int maxLines = 4; IBookletChapter chapter = this.thePage.getChapter(); String aText = chapter.getAllPages()[0].getInfoText(); - List text = minecraft.fontRenderer.listFormattedStringToWidth(aText != null ? aText : TextFormatting.DARK_RED+StringUtil.localize("container.nei."+ActuallyAdditions.MODID+".booklet.noText"), 150); - for(int i = 0; i < Math.min(maxLines, text.size()); i++){ - minecraft.fontRenderer.drawString(text.get(i)+(i == maxLines-1 && text.size() > maxLines ? TextFormatting.RESET+""+TextFormatting.BLACK+"..." : ""), 0, 16+25+i*(minecraft.fontRenderer.FONT_HEIGHT+1), 0, false); + List text = minecraft.fontRenderer.listFormattedStringToWidth(aText != null ? aText : TextFormatting.DARK_RED + StringUtil.localize("container.nei." + ActuallyAdditions.MODID + ".booklet.noText"), 150); + for (int i = 0; i < Math.min(maxLines, text.size()); i++) { + minecraft.fontRenderer.drawString(text.get(i) + (i == maxLines - 1 && text.size() > maxLines ? TextFormatting.RESET + "" + TextFormatting.BLACK + "..." : ""), 0, 16 + 25 + i * (minecraft.fontRenderer.FONT_HEIGHT + 1), 0, false); } - minecraft.fontRenderer.drawString(TextFormatting.ITALIC+chapter.getLocalizedName(), 25, 85, 0, false); - minecraft.fontRenderer.drawString(TextFormatting.ITALIC+"Page "+(chapter.getPageIndex(this.thePage)+1), 25, 95, 0, false); + minecraft.fontRenderer.drawString(TextFormatting.ITALIC + chapter.getLocalizedName(), 25, 85, 0, false); + minecraft.fontRenderer.drawString(TextFormatting.ITALIC + "Page " + (chapter.getPageIndex(this.thePage) + 1), 25, 95, 0, false); super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY); } @Override - public int getButtonX(){ + public int getButtonX() { return 0; } @Override - public int getButtonY(){ + public int getButtonY() { return 84; } @Override - public IBookletPage getPage(){ + public IBookletPage getPage() { return this.thePage; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java index 191d3a3d4..b54000406 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/coffee/CoffeeMachineRecipeWrapper.java @@ -26,6 +26,7 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; @@ -46,13 +47,13 @@ public class CoffeeMachineRecipeWrapper extends RecipeWrapperWithButton { @Override public void getIngredients(IIngredients ingredients) { List list = new ArrayList<>(); - for(ItemStack s : ingredient.getInput().getMatchingStacks()) - list.add(s); + for (ItemStack s : ingredient.getInput().getMatchingStacks()) + list.add(s); list.add(this.cup); list.add(this.coffeeBeans); - ingredients.setInputs(ItemStack.class, list); - - ingredients.setOutput(ItemStack.class, this.theOutput); + ingredients.setInputs(VanillaTypes.ITEM, list); + + ingredients.setOutput(VanillaTypes.ITEM, this.theOutput); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/compost/CompostRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/compost/CompostRecipeWrapper.java index 3065d265f..71da6840c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/compost/CompostRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/compost/CompostRecipeWrapper.java @@ -19,6 +19,7 @@ import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils; import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; @@ -32,8 +33,8 @@ public class CompostRecipeWrapper extends RecipeWrapperWithButton { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInputs(ItemStack.class, Arrays.asList(recipe.getInput().getMatchingStacks())); - ingredients.setOutput(ItemStack.class, recipe.getOutput()); + ingredients.setInputs(VanillaTypes.ITEM, Arrays.asList(recipe.getInput().getMatchingStacks())); + ingredients.setOutput(VanillaTypes.ITEM, recipe.getOutput()); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java index c26d1a232..fe32f16c8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/crusher/CrusherRecipeWrapper.java @@ -22,50 +22,51 @@ import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; -public class CrusherRecipeWrapper extends RecipeWrapperWithButton{ +public class CrusherRecipeWrapper extends RecipeWrapperWithButton { public final CrusherRecipe theRecipe; - public CrusherRecipeWrapper(CrusherRecipe recipe){ + public CrusherRecipeWrapper(CrusherRecipe recipe) { this.theRecipe = recipe; } @Override - public void getIngredients(IIngredients ingredients){ - ingredients.setInputs(ItemStack.class, Arrays.asList(theRecipe.getInput().getMatchingStacks())); + public void getIngredients(IIngredients ingredients) { + ingredients.setInputs(VanillaTypes.ITEM, Arrays.asList(theRecipe.getInput().getMatchingStacks())); List list = new ArrayList<>(); list.add(this.theRecipe.getOutputOne()); - if(StackUtil.isValid(this.theRecipe.getOutputTwo())){ + if (StackUtil.isValid(this.theRecipe.getOutputTwo())) { list.add(this.theRecipe.getOutputTwo()); } - ingredients.setOutputs(ItemStack.class, list); + ingredients.setOutputs(VanillaTypes.ITEM, list); } @Override - public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY){ - if(StackUtil.isValid(this.theRecipe.getOutputTwo())){ - minecraft.fontRenderer.drawString(this.theRecipe.getSecondChance()+"%", 60, 60, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); + public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { + if (StackUtil.isValid(this.theRecipe.getOutputTwo())) { + minecraft.fontRenderer.drawString(this.theRecipe.getSecondChance() + "%", 60, 60, StringUtil.DECIMAL_COLOR_GRAY_TEXT, false); } super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY); } @Override - public int getButtonX(){ + public int getButtonX() { return -5; } @Override - public int getButtonY(){ + public int getButtonY() { return 26; } @Override - public IBookletPage getPage(){ + public IBookletPage getPage() { return BookletUtils.findFirstPageForStack(new ItemStack(InitBlocks.blockGrinder)); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java index 4f2a32dca..a1902ebe6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/empowerer/EmpowererRecipeWrapper.java @@ -19,46 +19,47 @@ import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils; import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import net.minecraft.item.ItemStack; -public class EmpowererRecipeWrapper extends RecipeWrapperWithButton{ +public class EmpowererRecipeWrapper extends RecipeWrapperWithButton { public final EmpowererRecipe theRecipe; - public EmpowererRecipeWrapper(EmpowererRecipe recipe){ + public EmpowererRecipeWrapper(EmpowererRecipe recipe) { this.theRecipe = recipe; } @Override - public void getIngredients(IIngredients ingredients){ + public void getIngredients(IIngredients ingredients) { List inputs = new ArrayList<>(); - for(ItemStack s : theRecipe.getInput().getMatchingStacks()) + for (ItemStack s : theRecipe.getInput().getMatchingStacks()) inputs.add(s); - for(ItemStack s : theRecipe.getStandOne().getMatchingStacks()) + for (ItemStack s : theRecipe.getStandOne().getMatchingStacks()) inputs.add(s); - for(ItemStack s : theRecipe.getStandTwo().getMatchingStacks()) + for (ItemStack s : theRecipe.getStandTwo().getMatchingStacks()) inputs.add(s); - for(ItemStack s : theRecipe.getStandThree().getMatchingStacks()) + for (ItemStack s : theRecipe.getStandThree().getMatchingStacks()) inputs.add(s); - for(ItemStack s : theRecipe.getStandFour().getMatchingStacks()) + for (ItemStack s : theRecipe.getStandFour().getMatchingStacks()) inputs.add(s); - - ingredients.setInputs(ItemStack.class, inputs); - ingredients.setOutput(ItemStack.class, this.theRecipe.getOutput()); + + ingredients.setInputs(VanillaTypes.ITEM, inputs); + ingredients.setOutput(VanillaTypes.ITEM, this.theRecipe.getOutput()); } @Override - public int getButtonX(){ + public int getButtonX() { return 2; } @Override - public int getButtonY(){ + public int getButtonY() { return 2; } @Override - public IBookletPage getPage(){ + public IBookletPage getPage() { return BookletUtils.findFirstPageForStack(new ItemStack(InitBlocks.blockEmpowerer)); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java index 091bcf83c..032bd3965 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeCategory.java @@ -18,51 +18,52 @@ import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeCategory; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; -public class ReconstructorRecipeCategory implements IRecipeCategory{ +public class ReconstructorRecipeCategory implements IRecipeCategory { public static final String NAME = "actuallyadditions.reconstructor"; private static final ItemStack RECONSTRUCTOR = new ItemStack(InitBlocks.blockAtomicReconstructor); private final IDrawable background; - public ReconstructorRecipeCategory(IGuiHelper helper){ + public ReconstructorRecipeCategory(IGuiHelper helper) { this.background = helper.createDrawable(AssetUtil.getGuiLocation("gui_nei_atomic_reconstructor"), 0, 0, 96, 60); } @Override - public String getUid(){ + public String getUid() { return NAME; } @Override - public String getTitle(){ - return StringUtil.localize("container.nei."+NAME+".name"); + public String getTitle() { + return StringUtil.localize("container.nei." + NAME + ".name"); } @Override - public String getModName(){ + public String getModName() { return ActuallyAdditions.NAME; } @Override - public IDrawable getBackground(){ + public IDrawable getBackground() { return this.background; } @Override - public void drawExtras(Minecraft minecraft){ + public void drawExtras(Minecraft minecraft) { AssetUtil.renderStackToGui(RECONSTRUCTOR, 34, 19, 1.0F); } @Override - public void setRecipe(IRecipeLayout recipeLayout, ReconstructorRecipeWrapper wrapper, IIngredients ingredients){ + public void setRecipe(IRecipeLayout recipeLayout, ReconstructorRecipeWrapper wrapper, IIngredients ingredients) { recipeLayout.getItemStacks().init(0, true, 4, 18); - recipeLayout.getItemStacks().set(0, ingredients.getInputs(ItemStack.class).get(0).get(0)); + recipeLayout.getItemStacks().set(0, ingredients.getInputs(VanillaTypes.ITEM).get(0).get(0)); recipeLayout.getItemStacks().init(1, false, 66, 18); - recipeLayout.getItemStacks().set(1, ingredients.getOutputs(ItemStack.class).get(0).get(0)); + recipeLayout.getItemStacks().set(1, ingredients.getOutputs(VanillaTypes.ITEM).get(0).get(0)); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java index 1a06859e2..ac825ba04 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/reconstructor/ReconstructorRecipeWrapper.java @@ -19,6 +19,7 @@ import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils; import de.ellpeck.actuallyadditions.mod.jei.RecipeWrapperWithButton; import de.ellpeck.actuallyadditions.mod.recipe.EnchBookConversion; import mezz.jei.api.ingredients.IIngredients; +import mezz.jei.api.ingredients.VanillaTypes; import mezz.jei.api.recipe.IRecipeWrapperFactory; import net.minecraft.client.Minecraft; import net.minecraft.init.Items; @@ -42,8 +43,8 @@ public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInputs(ItemStack.class, Arrays.asList(this.theRecipe.getInput().getMatchingStacks())); - ingredients.setOutput(ItemStack.class, this.theRecipe.getOutput()); + ingredients.setInputs(VanillaTypes.ITEM, Arrays.asList(this.theRecipe.getInput().getMatchingStacks())); + ingredients.setOutput(VanillaTypes.ITEM, this.theRecipe.getOutput()); } @Override @@ -86,8 +87,8 @@ public class ReconstructorRecipeWrapper extends RecipeWrapperWithButton { @Override public void getIngredients(IIngredients ingredients) { - ingredients.setInput(ItemStack.class, BOOK); - ingredients.setOutput(ItemStack.class, OUT); + ingredients.setInput(VanillaTypes.ITEM, BOOK); + ingredients.setOutput(VanillaTypes.ITEM, OUT); } } diff --git a/update/changelog.md b/update/changelog.md index 9ba87c651..7bf49c450 100644 --- a/update/changelog.md +++ b/update/changelog.md @@ -1,3 +1,7 @@ +# 1.12.2-r144 +* Phantom Breakers should function properly again. +* Greenhouse Glass functions again (wasn't broken, but it works now) + # 1.12.2-r143 * Greenhouse Glass will now work with any non-opaque block below it, instead of only air below it. Yes, this means they can stack. * Greenhouse Glass should no longer crash if it is over the void. diff --git a/update/updateVersions.properties b/update/updateVersions.properties index 76561a760..501751eec 100644 --- a/update/updateVersions.properties +++ b/update/updateVersions.properties @@ -8,4 +8,4 @@ 1.11.2=110 1.12=118 1.12.1=121 -1.12.2=143 \ No newline at end of file +1.12.2=144 \ No newline at end of file