diff --git a/src/main/java/com/minelittlepony/unicopia/UItems.java b/src/main/java/com/minelittlepony/unicopia/UItems.java index 8eef0bae..7bfc7b88 100644 --- a/src/main/java/com/minelittlepony/unicopia/UItems.java +++ b/src/main/java/com/minelittlepony/unicopia/UItems.java @@ -1,6 +1,7 @@ package com.minelittlepony.unicopia; import com.minelittlepony.unicopia.item.ItemApple; +import com.minelittlepony.unicopia.item.ItemCereal; import com.minelittlepony.unicopia.item.ItemCloud; import com.minelittlepony.unicopia.item.ItemCurse; import com.minelittlepony.unicopia.item.ItemOfHolding; @@ -24,7 +25,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemDoor; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemSeedFood; -import net.minecraft.item.ItemSoup; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.item.crafting.IRecipe; @@ -96,13 +96,8 @@ public class UItems { .setTranslationKey("alfalfa_leaves") .setRegistryName(Unicopia.MODID, "alfalfa_leaves"); - public static final Item cereal = new ItemSoup(15) - .setTranslationKey("cereal") - .setRegistryName(Unicopia.MODID, "cereal"); - - public static final Item sugar_cereal = new ItemSoup(15) - .setTranslationKey("sugar_cereal") - .setRegistryName(Unicopia.MODID, "sugar_cereal"); + public static final Item cereal = new ItemCereal(Unicopia.MODID, "cereal", 9, 0.8F); + public static final Item sugar_cereal = new ItemCereal(Unicopia.MODID, "sugar_cereal", 20, -2).setAlwaysEdible(); public static final ItemTomato tomato = new ItemTomato(Unicopia.MODID, "tomato", 4, 34); public static final ItemTomato cloudsdale_tomato = new ItemTomato(Unicopia.MODID, "cloudsdale_tomato", 16, 4); @@ -120,7 +115,8 @@ public class UItems { cloud_stairs, cloud_slab, cloud_farmland, mist_door, anvil, bag_of_holding, spell, curse, - alfalfa_seeds, alfalfa_leaves, cereal, + alfalfa_seeds, alfalfa_leaves, + cereal, sugar_cereal, cloudsdale_tomato, tomato_seeds, tomato); diff --git a/src/main/java/com/minelittlepony/unicopia/item/ItemCereal.java b/src/main/java/com/minelittlepony/unicopia/item/ItemCereal.java new file mode 100644 index 00000000..5ed324c0 --- /dev/null +++ b/src/main/java/com/minelittlepony/unicopia/item/ItemCereal.java @@ -0,0 +1,26 @@ +package com.minelittlepony.unicopia.item; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Items; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ItemCereal extends ItemFood { + + public ItemCereal(String domain, String name, int amount, float saturation) { + super(amount, saturation, false); + + setTranslationKey(name); + setRegistryName(domain, name); + setMaxStackSize(1); + } + + public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving) { + super.onItemUseFinish(stack, worldIn, entityLiving); + + this.setAlwaysEdible(); + + return new ItemStack(Items.BOWL); + } +} diff --git a/src/main/resources/assets/unicopia/models/item/sugar_cereal.json b/src/main/resources/assets/unicopia/models/item/sugar_cereal.json new file mode 100644 index 00000000..bde35e7c --- /dev/null +++ b/src/main/resources/assets/unicopia/models/item/sugar_cereal.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "unicopia:items/sugar_cereal" + } +} diff --git a/src/main/resources/assets/unicopia/textures/items/sugar_cereal.png b/src/main/resources/assets/unicopia/textures/items/sugar_cereal.png new file mode 100644 index 00000000..716fc901 Binary files /dev/null and b/src/main/resources/assets/unicopia/textures/items/sugar_cereal.png differ