1111import gregtech .api .recipes .RecipeMap ;
1212import gregtech .api .recipes .RecipeMaps ;
1313import gregtech .api .recipes .builders .BlastRecipeBuilder ;
14+ import gregtech .api .util .world .DummyWorld ;
1415import gregtech .common .metatileentities .electric .multiblockpart .MetaTileEntityFluidHatch ;
1516import gregtech .common .metatileentities .electric .multiblockpart .MetaTileEntityItemBus ;
1617import gregtech .common .metatileentities .electric .multiblockpart .MetaTileEntityMultiblockPart ;
2021import net .minecraft .init .Bootstrap ;
2122import net .minecraft .item .ItemStack ;
2223import net .minecraft .util .ResourceLocation ;
24+ import net .minecraft .world .World ;
2325import net .minecraftforge .items .IItemHandlerModifiable ;
2426
2527import org .junit .BeforeClass ;
@@ -43,6 +45,8 @@ private static ResourceLocation gregtechId(String name) {
4345 @ Test
4446 public void trySearchNewRecipe () {
4547
48+ World world = DummyWorld .INSTANCE ;
49+
4650 // Create an empty recipe map to work with
4751 RecipeMap <BlastRecipeBuilder > map = new RecipeMap <>("blast_furnace" ,
4852 1 ,
@@ -94,6 +98,8 @@ public boolean checkRecipe(Recipe recipe, boolean consumeIfSuccess) {
9498 e .printStackTrace ();
9599 }
96100
101+ mbt .getHolder ().setWorld (world );
102+
97103 //Controller and isAttachedToMultiBlock need the world so we fake it here.
98104 MetaTileEntityItemBus importItemBus = new MetaTileEntityItemBus (gregtechId ("item_bus.export.lv" ), 1 , false ) {
99105 @ Override
@@ -209,14 +215,14 @@ protected IMultipleTankHandler getOutputTank() {
209215 // put an item in the inventory that will trigger recipe recheck
210216 mbl .getInputInventory ().insertItem (0 , new ItemStack (Blocks .COBBLESTONE , 16 ), false );
211217 // Inputs change. did we detect it ?
212- assertTrue (mbt . isInputsDirty ());
218+ assertTrue (mbl . hasNotifiedInputs ());
213219 mbl .trySearchNewRecipe ();
214220 assertFalse (mbl .invalidInputsForRecipes );
215221 assertNotNull (mbl .previousRecipe );
216222 assertTrue (mbl .isActive );
217223 assertEquals (15 , mbl .getInputInventory ().getStackInSlot (0 ).getCount ());
218224 //assert the consumption of the inputs did not mark the arl to look for a new recipe
219- assertFalse (mbt . isInputsDirty ());
225+ assertFalse (mbl . hasNotifiedInputs ());
220226
221227 // Save a reference to the old recipe so we can make sure it's getting reused
222228 Recipe prev = mbl .previousRecipe ;
@@ -244,7 +250,7 @@ protected IMultipleTankHandler getOutputTank() {
244250
245251 // Some room is freed in the output bus, so we can continue now.
246252 mbl .getOutputInventory ().setStackInSlot (1 , ItemStack .EMPTY );
247- assertTrue (mbt . isOutputsDirty ());
253+ assertTrue (mbl . hasNotifiedOutputs ());
248254 mbl .updateWorkable ();
249255 assertTrue (mbl .isActive );
250256 assertFalse (mbl .isOutputsFull );
0 commit comments