From b82cb25eeae9ccf8a8ed6e29b6afd916f1a570b5 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 20 Dec 2012 21:40:04 -0500 Subject: [PATCH] Add IPlantable to itemseedfood. Potato and carrot support! --- .../minecraft/item/ItemSeedFood.java.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch diff --git a/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch new file mode 100644 index 0000000000..5f75170a44 --- /dev/null +++ b/patches/minecraft/net/minecraft/item/ItemSeedFood.java.patch @@ -0,0 +1,37 @@ +--- ../src_base/minecraft/net/minecraft/item/ItemSeedFood.java ++++ ../src_work/minecraft/net/minecraft/item/ItemSeedFood.java +@@ -2,8 +2,10 @@ + + import net.minecraft.entity.player.EntityPlayer; + import net.minecraft.world.World; ++import net.minecraftforge.common.EnumPlantType; ++import net.minecraftforge.common.IPlantable; + +-public class ItemSeedFood extends ItemFood ++public class ItemSeedFood extends ItemFood implements IPlantable + { + /** Block ID of the crop this seed food should place. */ + private int cropId; +@@ -48,4 +50,22 @@ + return false; + } + } ++ ++ @Override ++ public EnumPlantType getPlantType(World world, int x, int y, int z) ++ { ++ return EnumPlantType.Crop; ++ } ++ ++ @Override ++ public int getPlantID(World world, int x, int y, int z) ++ { ++ return cropId; ++ } ++ ++ @Override ++ public int getPlantMetadata(World world, int x, int y, int z) ++ { ++ return 0; ++ } + }