Eragonn14900

Untitled

Nov 24th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. package com.reactioncraft.desert.common;
  2.  
  3. import com.reactioncraft.reactioncraft;
  4.  
  5. import net.minecraft.block.material.MapColor;
  6. import net.minecraft.item.ItemBlock;
  7. import net.minecraft.item.ItemStack;
  8. import net.minecraft.util.IStringSerializable;
  9. import net.minecraft.util.text.TextFormatting;
  10.  
  11. public enum EnumHireoGlyphs implements IStringSerializable
  12. {
  13. one1 (0, 0, "one1", "one1"),
  14. one2 (1, 1, "one2", "one2"),
  15. one3 (2, 2, "one3", "one3"),
  16. two1 (3, 3, "two1", "two1"),
  17. two2 (4, 4, "two2", "two2"),
  18. two3 (5, 5, "two3", "two3"),
  19. three1 (6, 6, "three1", "three1"),
  20. three2 (7, 7, "three2", "three2"),
  21. three3 (8, 8, "three3", "three3"),
  22. four1 (9, 9, "four1", "four1"),
  23. four2 (10, 10, "four2", "four2"),
  24. four3 (11, 11, "four3", "four3"),
  25. weathered1 (12, 12, "weathered1", "weathered1");
  26. //GREEN (13, 13, "green", "green"),
  27. //RED (14, 14, "red", "red"),
  28. //BLACK (15, 15, "black", "black");
  29.  
  30. private static final EnumHireoGlyphs[] META_LOOKUP = new EnumHireoGlyphs[values().length];
  31. private static final EnumHireoGlyphs[] DYE_DMG_LOOKUP = new EnumHireoGlyphs[values().length];
  32. private final int meta;
  33. private final int dyeDamage;
  34. private final String name;
  35. private final String unlocalizedName;
  36.  
  37. private EnumHireoGlyphs(int meta, int dyeDamage, String name, String unlocalizedName)
  38. {
  39. this.meta = meta;
  40. this.dyeDamage = dyeDamage;
  41. this.name = name;
  42. this.unlocalizedName = unlocalizedName;
  43. }
  44.  
  45. public int getMetadata()
  46. {
  47. return this.meta;
  48. }
  49.  
  50. public int getDyeDamage()
  51. {
  52. return this.dyeDamage;
  53. }
  54.  
  55.  
  56. public String getUnlocalizedName()
  57. {
  58. return this.unlocalizedName;
  59. }
  60.  
  61. public static EnumHireoGlyphs byDyeDamage(int damage)
  62. {
  63. if (damage < 0 || damage >= DYE_DMG_LOOKUP.length)
  64. {
  65. damage = 0;
  66. }
  67.  
  68. return DYE_DMG_LOOKUP[damage];
  69. }
  70.  
  71. public static EnumHireoGlyphs byMetadata(int meta)
  72. {
  73. if (meta < 0 || meta >= META_LOOKUP.length)
  74. {
  75. meta = 0;
  76. }
  77.  
  78. return META_LOOKUP[meta];
  79. }
  80.  
  81. public String toString()
  82. {
  83. return this.unlocalizedName;
  84. }
  85.  
  86. public String getName()
  87. {
  88. return this.name;
  89. }
  90.  
  91.  
  92. static
  93. {
  94. for (EnumHireoGlyphs type : values())
  95. {
  96. META_LOOKUP[type.getMetadata()] = type;
  97. DYE_DMG_LOOKUP[type.getDyeDamage()] = type;
  98. }
  99. }
  100. }
Add Comment
Please, Sign In to add comment