Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.78 KB | None | 0 0
  1. package com.github.dsh105.echopet.menu.selector;
  2.  
  3. import com.github.dsh105.echopet.data.PetType;
  4. import com.github.dsh105.echopet.util.PetUtil;
  5. import org.bukkit.ChatColor;
  6. import org.bukkit.Material;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.inventory.ItemStack;
  9. import org.bukkit.inventory.meta.ItemMeta;
  10.  
  11. /**
  12. * Project by DSH105
  13. */
  14.  
  15. public enum PetItem {
  16.  
  17. //BAT(PetType.BAT, Material.getMaterial(383), 1, (short) 65, true, "Bat Pet"),
  18. //BLAZE(PetType.BLAZE, Material.getMaterial(383), 1, (short) 61, true, "Blaze Pet"),
  19. //CAVESPIDER(PetType.CAVESPIDER, Material.getMaterial(383), 1, (short) 59, true, "Cave Spider Pet"),
  20. CHICKEN(PetType.CHICKEN, Material.getMaterial(383), 1, (short) 93, true, "Parker\'s chick"),
  21. COW(PetType.COW, Material.getMaterial(383), 1, (short) 92, true, "Bessie"),
  22. //CREEPER(PetType.CREEPER, Material.getMaterial(383), 1, (short) 50, true, "Creeper Pet"),
  23. //ENDERDRAGON(PetType.ENDERDRAGON, Material.getMaterial(122), 1, (short) 0, true, "EnderDragon Pet"),
  24. ENDERMAN(PetType.ENDERMAN, Material.getMaterial(383), 1, (short) 58, true, "Ben"),
  25. //GHAST(PetType.GHAST, Material.getMaterial(383), 1, (short) 56, true, "Ghast Pet"),
  26. //GIANT(PetType.GIANT, Material.getMaterial(383), 1, (short) 54, true, "Giant Pet"),
  27. HORSE(PetType.HORSE, Material.getMaterial(383), 1, (short) 100, true, "Horse Pet"),
  28. //IRONGOLEM(PetType.IRONGOLEM, Material.getMaterial(86), 1, (short) 0, true, "Iron Golem Pet"),
  29. //MAGMACUBE(PetType.MAGMACUBE, Material.getMaterial(383), 1, (short) 62, true, "Magma Cube Pet"),
  30. //MUSHROOMCOW(PetType.MUSHROOMCOW, Material.getMaterial(383), 1, (short) 96, true, "Mushroom Cow Pet"),
  31. OCELOT(PetType.OCELOT, Material.getMaterial(383), 1, (short) 98, true, "Whiskers"),
  32. PIG(PetType.PIG, Material.getMaterial(383), 1, (short) 90, true, "Oinkie"),
  33. PIGZOMBIE(PetType.PIGZOMBIE, Material.getMaterial(383), 1, (short) 57, true, "Splodey"),
  34. SHEEP(PetType.SHEEP, Material.getMaterial(383), 1, (short) 91, true, "Charles"),
  35. //SILVERFISH(PetType.SILVERFISH, Material.getMaterial(383), 1, (short) 60, true, "Silverfish Pet"),
  36. //SKELETON(PetType.SKELETON, Material.getMaterial(383), 1, (short) 51, true, "Skeleton Pet"),
  37. SLIME(PetType.SLIME, Material.getMaterial(383), 1, (short) 55, true, "Jello"),
  38. //SNOWMAN(PetType.SNOWMAN, Material.getMaterial(332), 1, (short) 0, true, "Snowman Pet"),
  39. //SPIDER(PetType.SPIDER, Material.getMaterial(383), 1, (short) 52, true, "Spider Pet"),
  40. //SQUID(PetType.SQUID, Material.getMaterial(383), 1, (short) 94, true, "Squid Pet"),
  41. VILLAGER(PetType.VILLAGER, Material.getMaterial(383), 1, (short) 120, true, "Jeeves"),
  42. //WITCH(PetType.WITCH, Material.getMaterial(383), 1, (short) 66, true, "Witch Pet"),
  43. //WITHER(PetType.WITHER, Material.getMaterial(399), 1, (short) 0, true, "Wither Pet"),
  44. WOLF(PetType.WOLF, Material.getMaterial(383), 1, (short) 95, true, "Wolfie"),
  45. ZOMBIE(PetType.ZOMBIE, Material.getMaterial(383), 1, (short) 54, true, "MineZ");
  46.  
  47. public PetType petType;
  48. private Material mat;
  49. private int amount;
  50. private short data;
  51. private boolean glow;
  52. private String name;
  53.  
  54. PetItem(PetType petType, Material mat, int amount, short data, boolean glow, String name) {
  55. this.petType = petType;
  56. this.mat = mat;
  57. this.amount = amount;
  58. this.data = data;
  59. this.glow = glow;
  60. this.name = name;
  61. }
  62.  
  63. public ItemStack getItem(Player p) {
  64. ItemStack i = new ItemStack(this.mat, this.amount, this.data);
  65. ItemMeta meta = i.getItemMeta();
  66. boolean hasPerm = p.hasPermission("echopet.*") || p.hasPermission("echopet.pet.*") || p.hasPermission("echopet.pet.type.*") || p.hasPermission("echopet.pet.type." + PetUtil.getPetPerm(this.petType));
  67. meta.setDisplayName((hasPerm ? ChatColor.GREEN : ChatColor.RED) + this.name);
  68. //meta.setLore(this.lore);
  69. i.setItemMeta(meta);
  70. return i;
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement