BaconIsBest

a

Aug 6th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. package com.bacon.plugin;
  2.  
  3. import java.util.logging.Logger;
  4.  
  5. import org.bukkit.Material;
  6. import org.bukkit.event.EventHandler;
  7. import org.bukkit.event.Listener;
  8. import org.bukkit.event.block.BlockPlaceEvent;
  9. import org.bukkit.plugin.PluginDescriptionFile;
  10. import org.bukkit.plugin.PluginManager;
  11. import org.bukkit.plugin.java.JavaPlugin;
  12.  
  13. public class Main extends JavaPlugin implements Listener{
  14. Logger logger = Logger.getLogger("Minecraft");
  15. public static Main plugin;
  16.  
  17. public void onDisable() {
  18. PluginDescriptionFile pdfFile = this.getDescription();
  19. this.logger.info(pdfFile.getName() + " Has been disabled!");
  20. }
  21.  
  22. public void onEnable() {
  23. plugin = this;
  24. PluginDescriptionFile pdfFile = this.getDescription();
  25. this.logger.info(pdfFile.getName() + " Version: "
  26. + pdfFile.getVersion() + " Has been Enabled!");
  27. PluginManager pm = getServer().getPluginManager();
  28. pm.registerEvents(this, this);
  29. getConfig().options().copyDefaults(true);
  30. saveConfig();
  31. }
  32.  
  33. @EventHandler
  34. public void onBlockPlace(BlockPlaceEvent e){
  35. if(e.getBlock().equals(Material.FIREWORK)){
  36. e.setCancelled(true);
  37. } else{
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment