@@ -134,40 +134,6 @@ public static boolean addItemsToItemHandler(final IItemHandler handler,
134134 return true ;
135135 }
136136
137- /**
138- * Simulates the insertion of fluid into a target fluid handler, then optionally performs the insertion.
139- * <br />
140- * <br />
141- * Simulating will not modify any of the input parameters. Insertion will either succeed completely, or fail
142- * without modifying anything.
143- * This method should be called with {@code simulate} {@code true} first, then {@code simulate} {@code false},
144- * only if it returned {@code true}.
145- *
146- * @param fluidHandler the target inventory
147- * @param simulate whether to simulate ({@code true}) or actually perform the insertion ({@code false})
148- * @param fluidStacks the items to insert into {@code fluidHandler}.
149- * @return {@code true} if the insertion succeeded, {@code false} otherwise.
150- */
151- public static boolean addFluidsToFluidHandler (MultipleTankHandler fluidHandler ,
152- boolean simulate ,
153- List <FluidStack > fluidStacks ) {
154- if (simulate ) {
155- // OverlayedFluidHandler overlayedFluidHandler = new OverlayedFluidHandler(fluidHandler);
156- for (FluidStack fluidStack : fluidStacks ) {
157- int inserted = fluidHandler .fill (fluidStack , false );
158- if (inserted != fluidStack .amount ) {
159- return false ;
160- }
161- }
162- return true ;
163- }
164-
165- for (FluidStack fluidStack : fluidStacks ) {
166- fluidHandler .fill (fluidStack , true );
167- }
168- return true ;
169- }
170-
171137 /**
172138 * Simulates the insertion of fluid into a target fluid handler, then optionally performs the insertion. <br />
173139 * <br
@@ -181,14 +147,15 @@ public static boolean addFluidsToFluidHandler(MultipleTankHandler fluidHandler,
181147 * @param simulate whether to simulate ({@code true}) or actually perform the insertion ({@code false})
182148 * @return {@code true} if the insertion succeeded, {@code false} otherwise.
183149 */
184- public static boolean addFluidsToFluidHandler (List <@ NotNull FluidStack > fluidStacks ,
185- IFluidHandler fluidHandler ,
150+ public static boolean addFluidsToFluidHandler (List <FluidStack > fluidStacks ,
151+ MultipleTankHandler fluidHandler ,
186152 boolean simulate ) {
187153 if (simulate ) {
188- for (FluidStack stack : fluidStacks ) {
189- int filled = fluidHandler .fill (stack , false );
190- if (filled < stack .amount )
154+ for (FluidStack fluidStack : fluidStacks ) {
155+ int inserted = fluidHandler .fill (fluidStack , false );
156+ if (inserted != fluidStack .amount ) {
191157 return false ;
158+ }
192159 }
193160 return true ;
194161 }
0 commit comments