/** * The base constructor for more complicated ItemSteamedFoods. Use this for cases where the * output item has metadata (other than 0). For example: Steamed Salmon * @param food The input item * @param foodStack The input item as an ItemStack */ public ItemSteamedFood(ItemFood food, ItemStack foodStack) { super(food.getHealAmount(foodStack) + 2, food.getSaturationModifier(foodStack) + 0.2F, food.isWolfsFavoriteMeat()); baseFood = food; baseFoodStack = foodStack; }
@Override public boolean matches(ItemStack itemStack) { // meat is bad for composting if (itemStack.getItem() instanceof ItemFood && ((ItemFood) itemStack.getItem()).isWolfsFavoriteMeat()) return true; else if (itemStack.getItem() instanceof ItemFishFood) return true; int[] oreIDs = OreDictionary.getOreIDs(itemStack); for (int oreID : oreIDs) { String oreName = OreDictionary.getOreName(oreID); if (oreName.startsWith("listAllmeat") || oreName.contains("Meat")) return true; } return false; } });
public static int getFoodPoints(ItemStack item, boolean meatOnly, boolean includeFish){ if(item != null && item != ItemStack.EMPTY && item.getItem() != null && item.getItem() instanceof ItemFood){ int food = (int)(((ItemFood)item.getItem()).getHealAmount(item) * 10); if(!meatOnly){ return food; }else if(((ItemFood)item.getItem()).isWolfsFavoriteMeat()){ return food; }else if(includeFish && item.getItem() == Items.FISH){ return food; } } return 0; }
if (itemstack != null && itemstack.getItem() instanceof ItemFood && ((ItemFood) itemstack.getItem()).isWolfsFavoriteMeat() && this.getHealth() < this.getMaxHealth()) { this.heal(5); this.playSound(SoundEvents.ENTITY_GENERIC_EAT, 1, 1);
if (item instanceof ItemFood) { ItemFood food = (ItemFood) item; registerFoodAuto(food, food.isWolfsFavoriteMeat() ? FoodType.MEAT : FoodType.PLANT);