From 13ba39941843c06bc940cd81316540faa2ac1bcf Mon Sep 17 00:00:00 2001 From: PrototypeTrousers Date: Tue, 25 Jul 2023 17:18:42 -0300 Subject: [PATCH] fix NPE. Fix fix gradle issue due to cofh dick move --- gradle.properties | 5 +---- gradle/scripts/dependencies.gradle | 10 +++++----- .../integration/modules/jei/JEIMissingItem.java | 16 +++++++--------- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/gradle.properties b/gradle.properties index 25b80b158..194829003 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,6 @@ aechannel=stable aebuild=7 aegroup=appeng aebasename=appliedenergistics2 -extended=extended_life -extendedversion=v0.55.16 ######################################################### # Versions # ######################################################### @@ -22,7 +20,6 @@ jei_version=4.16.1.302 tesla_version=1.0.63 ic2_version=2.8.73-ex112 top_version=1.12-1.4.23-16 -cofhcore_version=1.12.2-4.5.2.19 crafttweaker_version=4.1.20.684 ctm_version=MC1.12.2-0.3.1.16 forestry_version=5.8.2.387 @@ -42,7 +39,7 @@ modId=appliedenergistics2 modGroup=appeng # Version of your mod. # This field can be left empty if you want your mod's version to be determined by the latest git tag instead. -modVersion=rv6-stable-7-extended_life-v0.55.18 +modVersion=rv6-stable-7-extended_life-v0.55.20 # Whether to use the old jar naming structure (modid-mcversion-version) instead of the new version (modid-version) includeMCVersionJar=false # The name of your jar when you produce builds, not including any versioning info diff --git a/gradle/scripts/dependencies.gradle b/gradle/scripts/dependencies.gradle index 7ec9515ed..b6e461dd6 100644 --- a/gradle/scripts/dependencies.gradle +++ b/gradle/scripts/dependencies.gradle @@ -81,11 +81,11 @@ configurations { dependencies { // deobfCompile "gregtechce:gregtech:1.12.2:1.15.1.735" // installable runtime dependencies - implementation rfg.deobf ("curse.maven:gregtechceu-557242:4429261") + implementation rfg.deobf("curse.maven:gregtechceu-557242:4429261") compileOnly "curse.maven:chisel-235279:2915375" - implementation rfg.deobf ("curse.maven:baubles-227083:2518667") + implementation rfg.deobf("curse.maven:baubles-227083:2518667") //mods "mcp.mobius.waila:Hwyla:${hwyla_version}" mods "curse.maven:hwyla-253449:2568751" mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev" @@ -96,7 +96,7 @@ dependencies { //compileOnly "mcp.mobius.waila:Hwyla:${hwyla_version}" compileOnly "curse.maven:hwyla-253449:2568751" //Code chicken lib, GTCE dependency - implementation rfg.deobf ("curse.maven:CCL-242818:2779848") + implementation rfg.deobf("curse.maven:CCL-242818:2779848") compileOnly "curse.maven:recipe-stages-280554:3405072" compileOnly "curse.maven:item-stages-280316:2696769" @@ -104,13 +104,13 @@ dependencies { compileOnly "net.darkhax.tesla:Tesla-1.12.2:${tesla_version}" compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api" compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api" - compileOnly "cofh:CoFHCore:${cofhcore_version}:deobf" + compileOnly "curse.maven:CoFHCore-69162:2920433" compileOnly "CraftTweaker2:CraftTweaker2-API:${crafttweaker_version}" compileOnly "curse.maven:inventory-tweaks-223094:2482482" compileOnly "curse.maven:inventory-bogo-sorter-632327:4399738" compileOnly "team.chisel.ctm:CTM:${ctm_version}" compileOnly "de.ellpeck.actuallyadditions:ActuallyAdditions:1.12.2-r152.16:api" - implementation rfg.deobf ("net.sengir.forestry:forestry_${minecraft_version}:$forestry_version") + implementation rfg.deobf("net.sengir.forestry:forestry_${minecraft_version}:$forestry_version") // at runtime, use the full JEI jar runtimeOnly "mezz.jei:jei_${minecraft_version}:${jei_version}" diff --git a/src/main/java/appeng/integration/modules/jei/JEIMissingItem.java b/src/main/java/appeng/integration/modules/jei/JEIMissingItem.java index 19a508bf3..b5326dc31 100644 --- a/src/main/java/appeng/integration/modules/jei/JEIMissingItem.java +++ b/src/main/java/appeng/integration/modules/jei/JEIMissingItem.java @@ -109,8 +109,7 @@ public class JEIMissingItem implements IRecipeTransferError { @Override public void showError(Minecraft minecraft, int mouseX, int mouseY, @Nonnull IRecipeLayout recipeLayout, int recipeX, int recipeY) { Container c = minecraft.player.openContainer; - if (c instanceof ContainerMEMonitorable) { - ContainerMEMonitorable container = (ContainerMEMonitorable) c; + if (c instanceof ContainerMEMonitorable container) { IItemList ir = ((ContainerMEMonitorable) c).items; boolean found = false; boolean foundAny = false; @@ -148,8 +147,7 @@ public class JEIMissingItem implements IRecipeTransferError { if (i.isInput()) { List allIngredients = i.getAllIngredients(); for (Object allIngredient : allIngredients) { - if (allIngredient instanceof ItemStack) { - ItemStack stack = (ItemStack) allIngredient; + if (allIngredient instanceof ItemStack stack) { if (!stack.isEmpty()) { IAEItemStack search = AEItemStack.fromItemStack(stack); if (stack.getItem().isDamageable() || Platform.isGTDamageableItem(stack.getItem())) { @@ -179,7 +177,7 @@ public class JEIMissingItem implements IRecipeTransferError { if (ext.getStackSize() > 0 && (usedStack == null || usedStack.getStackSize() < ext.getStackSize())) { used.add(ext.copy().setStackSize(1)); if (craftable) { - valid = null; + valid.resetStatus(); } valid.add(ext.copy().setStackSize(1)); found = true; @@ -199,13 +197,13 @@ public class JEIMissingItem implements IRecipeTransferError { continue; } ArrayList validStacks = new ArrayList<>(); - if (valid != null) { - valid.forEach(v -> { + valid.forEach(v -> { + if (v.getStackSize() > 0) { ItemStack validStack = v.createItemStack(); validStack.setCount(1); validStacks.add(validStack); - }); - } + } + }); if (!found) { if (craftable) { i.drawHighlight(minecraft, new Color(0.0f, 0.0f, 1.0f, 0.4f), recipeX, recipeY);