Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.17 KB | None | 0 0
  1. package be.seedy.craftcustom;
  2.  
  3. import org.bukkit.Material;
  4. import org.bukkit.enchantments.Enchantment;
  5. import org.bukkit.inventory.ItemFlag;
  6. import org.bukkit.inventory.ItemStack;
  7. import org.bukkit.inventory.ShapedRecipe;
  8. import org.bukkit.inventory.meta.ItemMeta;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10.  
  11. public class CraftCustom extends JavaPlugin {
  12.  
  13. @Override
  14. public void onEnable() {
  15.  
  16. System.out.println("[CraftCustom] Le plugin vient de s'allumer");
  17.  
  18.  
  19. ShapedRecipe recette1 = new ShapedRecipe(new ItemStack(Material.CHAINMAIL_HELMET));
  20.  
  21. ItemStack customchainmailhelmet = new ItemStack(Material.CHAINMAIL_HELMET);
  22. ItemMeta customH = customchainmailhelmet.getItemMeta();
  23. customH.setDisplayName("&6Casque du guerrier");
  24. customH.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 2, true);
  25. customH.addEnchant(Enchantment.PROTECTION_EXPLOSIONS, 2, true);
  26. customH.addEnchant(Enchantment.PROTECTION_FALL, 2, true);
  27. customH.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
  28. customH.addEnchant(Enchantment.PROTECTION_PROJECTILE, 2, true);
  29. customH.addEnchant(Enchantment.DURABILITY, 1, true);
  30. customchainmailhelmet.setItemMeta(customH);
  31. recette1.shape(new String[] {"DDD","DID"," "});
  32. recette1.setIngredient('D', Material.DIAMOND);
  33. recette1.setIngredient('I', Material.IRON_INGOT);
  34. getServer().addRecipe(recette1);
  35.  
  36. ShapedRecipe recette2 = new ShapedRecipe(new ItemStack(Material.CHAINMAIL_CHESTPLATE));
  37.  
  38. ItemStack customchainmailchestplate = new ItemStack(Material.CHAINMAIL_CHESTPLATE);
  39. ItemMeta customC = customchainmailchestplate.getItemMeta();
  40. customC.setDisplayName("&6Le plastron du guerrier");
  41. customC.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 2, true);
  42. customC.addEnchant(Enchantment.PROTECTION_EXPLOSIONS, 2, true);
  43. customC.addEnchant(Enchantment.PROTECTION_FALL, 2, true);
  44. customC.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
  45. customC.addEnchant(Enchantment.PROTECTION_PROJECTILE, 2, true);
  46. customC.addEnchant(Enchantment.DURABILITY, 1, true);
  47. customchainmailchestplate.setItemMeta(customC);
  48. recette2.shape(new String[] {"DID","DDD","DDD"});
  49. recette2.setIngredient('D', Material.DIAMOND);
  50. recette2.setIngredient('I', Material.IRON_INGOT);
  51. getServer().addRecipe(recette2);
  52.  
  53. ShapedRecipe recette3 = new ShapedRecipe(new ItemStack(Material.CHAINMAIL_LEGGINGS));
  54.  
  55. ItemStack customchainmailleggings = new ItemStack(Material.CHAINMAIL_LEGGINGS);
  56. ItemMeta customL = customchainmailleggings.getItemMeta();
  57. customL.setDisplayName("&6Le pantalon du guerrier");
  58. customL.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 2, true);
  59. customL.addEnchant(Enchantment.PROTECTION_EXPLOSIONS, 2, true);
  60. customL.addEnchant(Enchantment.PROTECTION_FALL, 2, true);
  61. customL.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
  62. customL.addEnchant(Enchantment.PROTECTION_PROJECTILE, 2, true);
  63. customL.addEnchant(Enchantment.DURABILITY, 1, true);
  64. customchainmailleggings.setItemMeta(customL);
  65. recette3.shape(new String[] {"DDD","DID","D D"});
  66. recette3.setIngredient('D', Material.DIAMOND);
  67. recette3.setIngredient('I', Material.IRON_INGOT);
  68. getServer().addRecipe(recette3);
  69.  
  70. ShapedRecipe recette4 = new ShapedRecipe(new ItemStack(Material.CHAINMAIL_BOOTS));
  71.  
  72. ItemStack customchainmailboots = new ItemStack(Material.CHAINMAIL_BOOTS);
  73. ItemMeta customB = customchainmailboots.getItemMeta();
  74. customB.setDisplayName("&6Les bottes du guerrier");
  75. customB.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 2, true);
  76. customB.addEnchant(Enchantment.PROTECTION_EXPLOSIONS, 2, true);
  77. customB.addEnchant(Enchantment.PROTECTION_FALL, 2, true);
  78. customB.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
  79. customB.addEnchant(Enchantment.PROTECTION_PROJECTILE, 2, true);
  80. customB.addEnchant(Enchantment.DURABILITY, 1, true);
  81. customchainmailboots.setItemMeta(customB);
  82. recette4.shape(new String[] {" ","DID","D D"});
  83. recette4.setIngredient('D', Material.DIAMOND);
  84. recette4.setIngredient('I', Material.IRON_INGOT);
  85. getServer().addRecipe(recette4);
  86.  
  87. }
  88.  
  89. @Override
  90. public void onDisable() {
  91.  
  92. System.out.println("[CraftCustom] Le plugin vient de s'eteindre");
  93. }
  94.  
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement