Advertisement
Txcraf

Untitled

May 28th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.55 KB | None | 0 0
  1. package me.check_plys.craftingthings;
  2.  
  3. import java.util.logging.Logger;
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.Material;
  7. import org.bukkit.inventory.ItemStack;
  8. import org.bukkit.inventory.ShapedRecipe;
  9. import org.bukkit.inventory.meta.ItemMeta;
  10. import org.bukkit.plugin.PluginDescriptionFile;
  11. import org.bukkit.plugin.java.JavaPlugin;
  12.  
  13. public class Main extends JavaPlugin{
  14.     public final Logger logger = Logger.getLogger("Minecraft");
  15.     public static Main plugin;
  16.    
  17.     @Override
  18.     public void onDisable() {
  19.         PluginDescriptionFile pdfFile = this.getDescription();
  20.         this.logger.info(pdfFile.getName() + " Has Been Disabled!");
  21.         this.logger.warning(pdfFile.getName() + " If you are disabling the plugin without disable all server some errors may appear in console in future versions");  
  22.     }
  23.    
  24.     @Override
  25.     public void onEnable() {
  26.         leadrecipe();
  27.           PluginDescriptionFile pdfFile = this.getDescription();
  28.           this.logger.info(pdfFile.getName() + "Version" + pdfFile.getVersion() + " Has Been Enabled!");   
  29.        
  30.     }
  31.     private void leadrecipe() {
  32.         ItemStack lead = new ItemStack(Material.LEASH, 1);
  33.         ItemMeta meta = lead.getItemMeta();
  34.         lead.setItemMeta(meta);
  35.        
  36.         ShapedRecipe leadcraft = new ShapedRecipe(lead);
  37.         leadcraft.shape(
  38.                         "@@ ",
  39.                         "@# ",
  40.                         "  @" );
  41.         leadcraft.setIngredient('@', Material.STRING);
  42.         leadcraft.setIngredient('#', Material.SLIME_BALL);
  43.         Bukkit.getServer().addRecipe(leadcraft);
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement