Guest User

ItemPaintball.java

a guest
Aug 2nd, 2015
220
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.shnupbups.allthethings.item;
  2.  
  3. import java.util.List;
  4.  
  5. import net.minecraft.creativetab.CreativeTabs;
  6. import net.minecraft.item.Item;
  7. import net.minecraft.item.ItemStack;
  8.  
  9. import com.shnupbups.allthethings.lib.Reference;
  10. import com.shnupbups.allthethings.utility.UtilityCheck;
  11.  
  12. import cpw.mods.fml.relauncher.Side;
  13. import cpw.mods.fml.relauncher.SideOnly;
  14.  
  15. public class ItemPaintball extends ItemBasic {
  16.     public ItemPaintball(String name, CreativeTabs tab, int stackSize) {
  17.         super(name, tab, stackSize, "Temporary Recipe, will change next PR.");
  18.     }
  19.    
  20.     @Override
  21.     public void getSubItems(Item item, CreativeTabs tab, List list) {
  22.         for (int i = 0; i < 16; i ++) {
  23.             list.add(new ItemStack(item, 1, i));
  24.         }
  25.     }
  26.  
  27.     @Override
  28.     public String getUnlocalizedName(ItemStack stack) {
  29.         switch (stack.getItemDamage()) {
  30.         case 0:
  31.             return Reference.MOD_ID + ":paintballWhite";
  32.         case 1:
  33.             return Reference.MOD_ID + ":paintballOrange";
  34.         case 2:
  35.             return Reference.MOD_ID + ":paintballMagenta";
  36.         case 3:
  37.             return Reference.MOD_ID + ":paintballLightBlue";
  38.         case 4:
  39.             return Reference.MOD_ID + ":paintballYellow";
  40.         case 5:
  41.             return Reference.MOD_ID + ":paintballLime";
  42.         case 6:
  43.             return Reference.MOD_ID + ":paintballPink";
  44.         case 7:
  45.             return Reference.MOD_ID + ":paintballGrey";
  46.         case 8:
  47.             return Reference.MOD_ID + ":paintballLightGrey";
  48.         case 9:
  49.             return Reference.MOD_ID + ":paintballCyan";
  50.         case 10:
  51.             return Reference.MOD_ID + ":paintballPurple";
  52.         case 11:
  53.             return Reference.MOD_ID + ":paintballBlue";
  54.         case 12:
  55.             return Reference.MOD_ID + ":paintballBrown";
  56.         case 13:
  57.             return Reference.MOD_ID + ":paintballGreen";
  58.         case 14:
  59.             return Reference.MOD_ID + ":paintballRed";
  60.         case 15:
  61.             return Reference.MOD_ID + ":paintballBlack";
  62.         default:
  63.             return this.getUnlocalizedName();
  64.         }
  65.     }
  66.    
  67.     @Override
  68.     @SideOnly(Side.CLIENT)
  69.     public int getColorFromItemStack(ItemStack stack, int pass) {
  70.         return UtilityCheck.getColourForMeta(stack.getItemDamage());
  71.     }
  72. }
RAW Paste Data