Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. package net.minecraft.server;
  2.  
  3. import java.util.Random;
  4.  
  5. public class EnchantmentDurability extends Enchantment {
  6.  
  7. protected EnchantmentDurability(Enchantment.Rarity enchantment_rarity, EnumItemSlot... aenumitemslot) {
  8. super(enchantment_rarity, EnchantmentSlotType.BREAKABLE, aenumitemslot);
  9. this.c("durability");
  10. }
  11.  
  12. public int a(int i) {
  13. return 5 + (i - 1) * 8;
  14. }
  15.  
  16. public int b(int i) {
  17. return super.a(i) + 50;
  18. }
  19.  
  20. public int getMaxLevel() {
  21. return 3;
  22. }
  23.  
  24. public boolean canEnchant(ItemStack itemstack) {
  25. return itemstack.f() ? true : super.canEnchant(itemstack);
  26. }
  27.  
  28. public static boolean a(ItemStack itemstack, int i, Random random) {
  29. return itemstack.getItem() instanceof ItemArmor && random.nextFloat() < 0.6F ? false : random.nextInt(i + 1) > 0;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement