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 }));
}
}
Aggregations