RecipeSnapshotTest.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:craftinomicon 作者:
@Test
public void realTest() {
    MaterialRecipes materialRecipes = recipeSnapshot.getMaterialRecipes(new MaterialData(Material.WORKBENCH));
    Collection<Recipe> recipes = materialRecipes.getRecipes();
    assertEqual(recipes.size(), 1);
    Recipe first = recipes.iterator().next();
    SortedSet<ItemStack> ingredients = ingredientsGetter.getIngredients(first);
    for (ItemStack ingredient : ingredients) {
        if (ingredient != null) {
            assertEqual(ingredient.getData().getData(), (byte)-1);
        }
    }

    MaterialRecipes recipes1 = recipeSnapshot.getMaterialRecipes(new MaterialData(Material.WOOD_STAIRS));
    assertEqual(recipes1.getRecipes().size(), 1);
    Recipe theRecipe = recipes1.getRecipes().iterator().next();
    SortedSet<ItemStack> stairsIngredients = ingredientsGetter.getIngredients(theRecipe);
    for (ItemStack stairsIngredient : stairsIngredients) {
        if (stairsIngredient != null) {
            assertEqual(stairsIngredient.getData().getData(), (byte)0);
        }
    }

    Bukkit.getServer().broadcastMessage("realtest passed");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号