From 6e6eedb250d1d9e9096aa19bdff369156079cb66 Mon Sep 17 00:00:00 2001 From: reobf <2215595288@qq.com> Date: Thu, 13 Feb 2025 23:24:53 +0800 Subject: [PATCH] update --- .../gt/metatileentity/DataHatchME.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main/java/reobf/proghatches/gt/metatileentity/DataHatchME.java b/src/main/java/reobf/proghatches/gt/metatileentity/DataHatchME.java index 30dd3f1..3e7f68f 100644 --- a/src/main/java/reobf/proghatches/gt/metatileentity/DataHatchME.java +++ b/src/main/java/reobf/proghatches/gt/metatileentity/DataHatchME.java @@ -1,9 +1,13 @@ package reobf.proghatches.gt.metatileentity; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.EnumSet; import java.util.List; +import java.util.function.Function; import java.util.function.Predicate; import net.minecraft.entity.player.EntityPlayer; @@ -343,9 +347,27 @@ public List getAssemblyLineRecipes() { } if (cachedRecipes == null) { cachedRecipes = new ArrayList<>(); - + Method f=null; + try { + f=AssemblyLineUtils.class.getDeclaredMethod("findALRecipeFromDataStick", ItemStack.class); + } catch (Exception e) {} + try { + f=AssemblyLineUtils.class.getDeclaredMethod("findAssemblyLineRecipeFromDataStick", ItemStack.class); + } catch (Exception e) {} + + if(f==null)throw new AssertionError(); for (int i = 0; i < getSizeInventory(); i++) { - cachedRecipes.addAll(AssemblyLineUtils.findALRecipeFromDataStick(getStackInSlot(i))); + try { + cachedRecipes.addAll( + + (Collection) f.invoke(null, getStackInSlot(i)) + + + + ); + } catch (Exception e) { + e.printStackTrace(); + } } }