Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.bacon.plugin;
- import java.util.logging.Logger;
- import org.bukkit.Material;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.BlockPlaceEvent;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.PluginManager;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin implements Listener{
- Logger logger = Logger.getLogger("Minecraft");
- public static Main plugin;
- public void onDisable() {
- PluginDescriptionFile pdfFile = this.getDescription();
- this.logger.info(pdfFile.getName() + " Has been disabled!");
- }
- public void onEnable() {
- plugin = this;
- PluginDescriptionFile pdfFile = this.getDescription();
- this.logger.info(pdfFile.getName() + " Version: "
- + pdfFile.getVersion() + " Has been Enabled!");
- PluginManager pm = getServer().getPluginManager();
- pm.registerEvents(this, this);
- getConfig().options().copyDefaults(true);
- saveConfig();
- }
- @EventHandler
- public void onBlockPlace(BlockPlaceEvent e){
- if(e.getBlock().equals(Material.FIREWORK)){
- e.setCancelled(true);
- } else{
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment