Advertisement
Eragonn14900

Untitled

Nov 27th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. package com.reactioncraft.currency.common;
  2.  
  3. import com.reactioncraft.reactioncraft;
  4. import com.reactioncraft.core.ItemModelProvider;
  5. import com.reactioncraft.integration.instances.IntegratedItems;
  6.  
  7. import net.minecraft.entity.Entity;
  8. import net.minecraft.inventory.EntityEquipmentSlot;
  9. import net.minecraft.item.ItemArmor;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraft.util.ResourceLocation;
  12.  
  13. public class ItemExtraCrowns extends ItemArmor implements ItemModelProvider
  14. {
  15. protected int enchantability;
  16. protected String name;
  17.  
  18. /** The EnumArmorMaterial used for this ItemArmor */
  19. private final ArmorMaterial material;
  20.  
  21. public ItemExtraCrowns(String name, ArmorMaterial par2EnumArmorMaterial, int par3, EntityEquipmentSlot par4)
  22. {
  23. super(par2EnumArmorMaterial, par3, par4);
  24. this.material = par2EnumArmorMaterial;
  25. this.enchantability = 30;
  26. this.name = name;
  27. this.setRegistryName(new ResourceLocation(reactioncraft.MODID, this.name));
  28. this.setUnlocalizedName(reactioncraft.MODID + "." + this.name);
  29. }
  30.  
  31. @Override
  32. public void registerItemModel()
  33. {
  34. reactioncraft.proxy.registerItemRenderer(this, 0, this.name);
  35. }
  36.  
  37. public String getArmorTexture(ItemStack itemstack, Entity entity, int slot, int layer)
  38. {
  39. ItemStack Crown = new ItemStack(IntegratedItems.Crown);
  40. ItemStack KinglyChest = new ItemStack(IntegratedItems.KinglyChest);
  41. ItemStack KinglyBoots = new ItemStack(IntegratedItems.KinglyBoots);
  42. ItemStack KinglyLegs = new ItemStack(IntegratedItems.KinglyLegs);
  43.  
  44. return itemstack != Crown && itemstack != KinglyChest && itemstack != KinglyBoots ? (itemstack == KinglyLegs ? "reactioncraft:textures/models/armor/goldcrown_layer_2.png" : null) : "reactioncraft:textures/models/armor/" + name + "_layer_1.png";
  45. }
  46.  
  47. /**
  48. * Return the enchantability factor of the item, most of the time is based on material.
  49. */
  50. public int getItemEnchantability()
  51. {
  52. return this.enchantability;
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement