diff options
author | miozune <miozune@gmail.com> | 2023-12-04 08:18:02 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 00:18:02 +0100 |
commit | debb0740d34e784ae88f9ff9f349c786e11bdf02 (patch) | |
tree | 2e567d72b3e100ab31a7a1a20261831a93705763 /src/main/java | |
parent | 9a81b927772b9d62db8b672720978ed67eb2460f (diff) | |
download | GT5-Unofficial-debb0740d34e784ae88f9ff9f349c786e11bdf02.tar.gz GT5-Unofficial-debb0740d34e784ae88f9ff9f349c786e11bdf02.tar.bz2 GT5-Unofficial-debb0740d34e784ae88f9ff9f349c786e11bdf02.zip |
Migrate to new RecipeMap (#24)
Requires https://github.com/GTNewHorizons/GT5-Unofficial/pull/2345
---------
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java')
4 files changed, 15 insertions, 30 deletions
diff --git a/src/main/java/net/glease/ggfab/GigaGramFab.java b/src/main/java/net/glease/ggfab/GigaGramFab.java index a168014c21..af911b9bbd 100644 --- a/src/main/java/net/glease/ggfab/GigaGramFab.java +++ b/src/main/java/net/glease/ggfab/GigaGramFab.java @@ -2,7 +2,6 @@ package net.glease.ggfab; import net.glease.ggfab.mte.MTE_AdvAssLine; import net.glease.ggfab.mte.MTE_LinkedInputBus; -import net.glease.ggfab.nei.IMCForNEI; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -38,9 +37,7 @@ public class GigaGramFab { } @Mod.EventHandler - public void init(FMLInitializationEvent event) { - IMCForNEI.IMCSender(); - } + public void init(FMLInitializationEvent event) {} @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) {} diff --git a/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java b/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java index 1474d30d7c..13a7eb09c3 100644 --- a/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java +++ b/src/main/java/net/glease/ggfab/mte/MTE_AdvAssLine.java @@ -79,6 +79,8 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.recipe.RecipeMap; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.render.TextureFactory; @@ -526,6 +528,11 @@ public class MTE_AdvAssLine extends GT_MetaTileEntity_ExtendedPowerMultiBlockBas } @Override + public RecipeMap<?> getRecipeMap() { + return RecipeMaps.assemblylineVisualRecipes; + } + + @Override public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { Arrays.fill(itemInputsCurTick, NOT_CHECKED); super.onPreTick(aBaseMetaTileEntity, aTick); diff --git a/src/main/java/net/glease/ggfab/mte/MTE_LinkedInputBus.java b/src/main/java/net/glease/ggfab/mte/MTE_LinkedInputBus.java index 36bafdf8e6..da0f10c2bb 100644 --- a/src/main/java/net/glease/ggfab/mte/MTE_LinkedInputBus.java +++ b/src/main/java/net/glease/ggfab/mte/MTE_LinkedInputBus.java @@ -40,10 +40,14 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; +import gregtech.api.recipe.check.CheckRecipeResult; +import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; +import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; -public class MTE_LinkedInputBus extends GT_MetaTileEntity_Hatch_InputBus { +public class MTE_LinkedInputBus extends GT_MetaTileEntity_Hatch_InputBus implements IRecipeProcessingAwareHatch { public static final int SIZE_INVENTORY = 18; private SharedInventory mRealInventory; @@ -202,12 +206,13 @@ public class MTE_LinkedInputBus extends GT_MetaTileEntity_Hatch_InputBus { } @Override - public void endRecipeProcessing() { + public CheckRecipeResult endRecipeProcessing(GT_MetaTileEntity_MultiBlockBase controller) { if (mState == State.Activated) { assert mRealInventory != null; mRealInventory.used = false; } mState = State.Default; + return CheckRecipeResultRegistry.SUCCESSFUL; } @Override diff --git a/src/main/java/net/glease/ggfab/nei/IMCForNEI.java b/src/main/java/net/glease/ggfab/nei/IMCForNEI.java deleted file mode 100644 index 71a2f82336..0000000000 --- a/src/main/java/net/glease/ggfab/nei/IMCForNEI.java +++ /dev/null @@ -1,24 +0,0 @@ -package net.glease.ggfab.nei; - -import net.minecraft.nbt.NBTTagCompound; - -import cpw.mods.fml.common.event.FMLInterModComms; - -public class IMCForNEI { - - public static void IMCSender() { - sendCatalyst("gt.recipe.fakeAssemblylineProcess", "gregtech:gt.blockmachines:13532", -1); - } - - private static void sendCatalyst(String aName, String aStack, int aPriority) { - NBTTagCompound aNBT = new NBTTagCompound(); - aNBT.setString("handlerID", aName); - aNBT.setString("itemName", aStack); - aNBT.setInteger("priority", aPriority); - FMLInterModComms.sendMessage("NotEnoughItems", "registerCatalystInfo", aNBT); - } - - private static void sendCatalyst(String aName, String aStack) { - sendCatalyst(aName, aStack, 0); - } -} |