Advertisement
ShetiPhian

ItemEatWeirdly

Jul 7th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.42 KB | None | 0 0
  1. package brenden.eatweirdly;
  2.  
  3. import java.util.List;
  4. import net.minecraft.creativetab.CreativeTabs;
  5. import net.minecraft.entity.player.EntityPlayer;
  6. import net.minecraft.item.ItemFood;
  7. import net.minecraft.item.ItemStack;
  8.  
  9. public class ItemEatWeirdly extends ItemFood
  10. {
  11.     String[] subText;
  12.     public ItemEatWeirdly(int id, int foodValue, float saturation, boolean wolfEat, String...subText)
  13.     {
  14.         super(id, foodValue, saturation, wolfEat);
  15.         this.subText = subText;
  16.         setCreativeTab(CreativeTabs.tabBrewing);
  17.         setAlwaysEdible();
  18.     }
  19.  
  20.     public ItemEatWeirdly setEatEffect(int potionId, int potionDuration, int potionAmplifier, float potionProbability)
  21.     {
  22.         setPotionEffect(potionId, potionDuration, potionAmplifier, potionProbability);
  23.         return this;
  24.     }
  25.  
  26.     public ItemEatWeirdly setBrewEffect(String brewEffect)
  27.     {
  28.         setPotionEffect(brewEffect);
  29.         return this;
  30.     }
  31.  
  32.     public ItemEatWeirdly setNameAndIcon(String name, String texture)
  33.     {
  34.         setUnlocalizedName(name);
  35.         func_111206_d(texture);
  36.         return this;
  37.     }
  38.  
  39.     @Override
  40.     public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean par4)
  41.     {
  42.         if (this.subText != null && this.subText.length > 0) {
  43.             for (String text : this.subText){
  44.                 list.add(text);
  45.             }
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement