File tree Expand file tree Collapse file tree
src/test/java/org/cyclops/integratedcrafting/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import com .google .common .collect .Lists ;
44import com .google .common .collect .Maps ;
5+ import net .minecraft .nbt .CompoundTag ;
56import org .cyclops .commoncapabilities .api .capability .recipehandler .IRecipeDefinition ;
67import org .cyclops .commoncapabilities .api .capability .recipehandler .RecipeDefinition ;
78import org .cyclops .commoncapabilities .api .ingredient .IPrototypedIngredient ;
@@ -136,6 +137,19 @@ public void testCraftingOperationsAreForgottenWhenTheJobStopsProcessing() {
136137 assertThat (handler .getCraftingJobEntryStartTick (1 ), equalTo (-1L ));
137138 }
138139
140+ @ Test
141+ public void testRecipeDurationsSurviveSerialization () {
142+ handler .reportRecipeDuration (recipeA , 100 );
143+
144+ CompoundTag tag = new CompoundTag ();
145+ handler .writeToNBT (null , tag );
146+
147+ TickingCraftingJobHandler deserialized = new TickingCraftingJobHandler ();
148+ deserialized .readFromNBT (null , tag );
149+
150+ assertThat (deserialized .getEstimatedRecipeDuration (recipeA ), equalTo (100L ));
151+ }
152+
139153 protected static class TickingCraftingJobHandler extends CraftingJobHandler {
140154
141155 private long currentTick ;
You can’t perform that action at this time.
0 commit comments