Search in sources :

Example 1 with ItemFishFood

use of net.minecraft.item.ItemFishFood in project BetterWithAddons by DaedalusGame.

the class InteractionBWA method postInit.

@Override
public void postInit() {
    HashSet<ResourceLocation> rotBlackList = new HashSet<>();
    for (String resname : ROTTEN_FOOD_BLACKLIST) {
        rotBlackList.add(new ResourceLocation(resname));
    }
    for (Item item : Item.REGISTRY) {
        if (!(item instanceof ItemFood) || rotBlackList.contains(item.getRegistryName()))
            continue;
        ItemStack stack = new ItemStack(item);
        if (stack.isEmpty())
            continue;
        if (item instanceof ItemFishFood || ItemUtil.matchesOreDict(stack, "listAllfish"))
            RotHandler.addRottingItem(stack, FISH_ROT_TIME, "fish", new ItemStack(Items.ROTTEN_FLESH));
        else if (ItemUtil.matchesOreDict(stack, "foodMeat") || ItemUtil.matchesOreDict(stack, "listAllmeat") || ItemUtil.matchesOreDict(stack, "listAllmeatcooked"))
            RotHandler.addRottingItem(stack, MEAT_ROT_TIME, "meat", new ItemStack(Items.ROTTEN_FLESH));
        else if (isFruit(stack))
            RotHandler.addRottingItem(stack, FRUIT_ROT_TIME, "fruit", new ItemStack(ModItems.rottenFood));
        else
            RotHandler.addRottingItem(stack, MISC_ROT_TIME);
    }
    RotHandler.addRottingItem(new ItemStack(Items.CAKE, 1, OreDictionary.WILDCARD_VALUE));
    RotHandler.addRottingItem(new ItemStack(Items.FISH, 1, ItemFishFood.FishType.SALMON.getMetadata()), FISH_ROT_TIME, "fish", new ItemStack(Items.ROTTEN_FLESH));
    RotHandler.addRottingItem(new ItemStack(Items.FISH, 1, ItemFishFood.FishType.CLOWNFISH.getMetadata()), FISH_ROT_TIME, "fish", new ItemStack(Items.ROTTEN_FLESH));
    RotHandler.addRottingItem(new ItemStack(Items.FISH, 1, ItemFishFood.FishType.PUFFERFISH.getMetadata()), FISH_ROT_TIME, "fish", new ItemStack(Items.ROTTEN_FLESH));
    // Salt Cluster grinding recipe (migration version, to be changed)
    List<ItemStack> saltDusts = OreDictionary.getOres("foodSalt");
    if (saltDusts != null && saltDusts.size() > 0) {
        ItemStack saltCluster = new ItemStack(ModItems.salts, 1, 0);
        ItemStack saltDust = saltDusts.get(0).copy();
        saltDust.setCount(3);
        MillManager.getInstance().addRecipe(new MillRecipe(0, saltDust, ItemStack.EMPTY, new Object[] { saltCluster }));
    }
}
Also used : Item(net.minecraft.item.Item) ItemFood(net.minecraft.item.ItemFood) ResourceLocation(net.minecraft.util.ResourceLocation) ItemFishFood(net.minecraft.item.ItemFishFood) MillRecipe(betterwithmods.common.registry.bulk.recipes.MillRecipe) ItemStack(net.minecraft.item.ItemStack) HashSet(java.util.HashSet)

Aggregations

MillRecipe (betterwithmods.common.registry.bulk.recipes.MillRecipe)1 HashSet (java.util.HashSet)1 Item (net.minecraft.item.Item)1 ItemFishFood (net.minecraft.item.ItemFishFood)1 ItemFood (net.minecraft.item.ItemFood)1 ItemStack (net.minecraft.item.ItemStack)1 ResourceLocation (net.minecraft.util.ResourceLocation)1