Advertisement
gottabadfeeling

Paper Mario Mod - Sound Fix for Drinkable Items (Food Class)

Apr 18th, 2015
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. package com.gottabadfeeling.mod.papermario.items;
  2.  
  3. import net.minecraft.item.EnumAction;
  4. import net.minecraft.item.ItemFood;
  5. import net.minecraft.item.ItemStack;
  6.  
  7. public class ModItemFood extends ItemFood {
  8.  
  9.     public ModItemFood(int amount, float saturation, boolean isWolfFood) {
  10.         super(amount, saturation, isWolfFood);
  11.         this.setAlwaysEdible();
  12.     }
  13.    
  14.     @Override
  15.     public EnumAction getItemUseAction(ItemStack stack)
  16.     {
  17.         if
  18.         (
  19.                 this.getUnlocalizedName(stack).substring(5).equals("honey_syrup") ||
  20.                 this.getUnlocalizedName(stack).substring(5).equals("maple_syrup") ||
  21.                 this.getUnlocalizedName(stack).substring(5).equals("jammin_jelly")
  22.         )
  23.         {
  24.             return EnumAction.DRINK;
  25.         }
  26.         else
  27.         {
  28.             return EnumAction.EAT;
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement