// Path: plugin/src/main/java/de/ase34/flyingblocksapi/commands/ExamplesCommandExecutor.java
// public class ExamplesCommandExecutor implements CommandExecutor {
// 
//     @Override
//     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
//         if (args.length < 1) {
//             return false;
//         }
// 
//         String example = args[0];
//         CommandExecutor executor;
// 
//         if (example.equalsIgnoreCase("flag")) {
//             executor = new FlagCommandExecutor();
//         } else if (example.equalsIgnoreCase("rising")) {
//             executor = new RisingBlockCommandExecutor();
//         } else if (example.equalsIgnoreCase("static")) {
//             executor = new StaticBlockCommandExecutor();
//         } else if (example.equalsIgnoreCase("sinewave")) {
//             executor = new SineWaveBlockCommandExecutor();
//         } else {
//             return false;
//         }
// 
//         String[] newargs = Arrays.copyOfRange(args, 1, args.length);
//         return executor.onCommand(sender, command, label, newargs);
// 
//     }
// 
// }
// 
// Path: plugin/src/main/java/de/ase34/flyingblocksapi/commands/RemoveAllCommandExecutor.java
// public class RemoveAllCommandExecutor implements CommandExecutor {
// 
//     private FlyingBlocksPlugin plugin;
// 
//     public RemoveAllCommandExecutor(FlyingBlocksPlugin plugin) {
//         this.plugin = plugin;
//     }
// 
//     @Override
//     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
//         int counter = 0;
// 
//         for (World world : Bukkit.getWorlds()) {
//             counter += plugin.removeFlyingBlocks(world).size();
//         }
// 
//         // 3 entities per moving block
//         counter = counter / 3;
//         sender.sendMessage(ChatColor.GRAY + "" + counter + " flying "
//                 + (counter == 1 ? "block was" : "blocks were") + " removed!");
//         return true;
//     }
// 
// }
// 
// Path: api/src/main/java/de/ase34/flyingblocksapi/natives/api/NativesAPI.java
// public abstract class NativesAPI {
// 
//     protected static NativesAPI singleton;
// 
//     public static NativesAPI getSingleton() {
//         return singleton;
//     }
// 
//     public static void setSingleton(NativesAPI singleton) {
//         NativesAPI.singleton = singleton;
//     }
// 
//     public abstract List<Entity> removeFlyingBlocks(World world);
// 
//     public abstract void initialize();
// 
//     public abstract NativeFlyingBlockHandler createFlyingBlockHandler(FlyingBlock flyingBlock);
// 
// }


import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.world.WorldUnloadEvent;
import org.bukkit.plugin.java.JavaPlugin;
import de.ase34.flyingblocksapi.commands.ExamplesCommandExecutor;
import de.ase34.flyingblocksapi.commands.RemoveAllCommandExecutor;
import de.ase34.flyingblocksapi.natives.api.NativesAPI;
/**
 * flyingblocksapi Copyright (C) 2014 ase34 and contributors
 * 
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */

package de.ase34.flyingblocksapi;




public class FlyingBlocksPlugin extends JavaPlugin implements Listener {

    private NativesAPI nativesAPI;

    @Override
    public void onEnable() {
        createNativesAPI();

        nativesAPI.initialize();
        NativesAPI.setSingleton(nativesAPI);

// Path: plugin/src/main/java/de/ase34/flyingblocksapi/commands/ExamplesCommandExecutor.java
// public class ExamplesCommandExecutor implements CommandExecutor {
// 
//     @Override
//     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
//         if (args.length < 1) {
//             return false;
//         }
// 
//         String example = args[0];
//         CommandExecutor executor;
// 
//         if (example.equalsIgnoreCase("flag")) {
//             executor = new FlagCommandExecutor();
//         } else if (example.equalsIgnoreCase("rising")) {
//             executor = new RisingBlockCommandExecutor();
//         } else if (example.equalsIgnoreCase("static")) {
//             executor = new StaticBlockCommandExecutor();
//         } else if (example.equalsIgnoreCase("sinewave")) {
//             executor = new SineWaveBlockCommandExecutor();
//         } else {
//             return false;
//         }
// 
//         String[] newargs = Arrays.copyOfRange(args, 1, args.length);
//         return executor.onCommand(sender, command, label, newargs);
// 
//     }
// 
// }
// 
// Path: plugin/src/main/java/de/ase34/flyingblocksapi/commands/RemoveAllCommandExecutor.java
// public class RemoveAllCommandExecutor implements CommandExecutor {
// 
//     private FlyingBlocksPlugin plugin;
// 
//     public RemoveAllCommandExecutor(FlyingBlocksPlugin plugin) {
//         this.plugin = plugin;
//     }
// 
//     @Override
//     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
//         int counter = 0;
// 
//         for (World world : Bukkit.getWorlds()) {
//             counter += plugin.removeFlyingBlocks(world).size();
//         }
// 
//         // 3 entities per moving block
//         counter = counter / 3;
//         sender.sendMessage(ChatColor.GRAY + "" + counter + " flying "
//                 + (counter == 1 ? "block was" : "blocks were") + " removed!");
//         return true;
//     }
// 
// }
// 
// Path: api/src/main/java/de/ase34/flyingblocksapi/natives/api/NativesAPI.java
// public abstract class NativesAPI {
// 
//     protected static NativesAPI singleton;
// 
//     public static NativesAPI getSingleton() {
//         return singleton;
//     }
// 
//     public static void setSingleton(NativesAPI singleton) {
//         NativesAPI.singleton = singleton;
//     }
// 
//     public abstract List<Entity> removeFlyingBlocks(World world);
// 
//     public abstract void initialize();
// 
//     public abstract NativeFlyingBlockHandler createFlyingBlockHandler(FlyingBlock flyingBlock);
// 
// }


// Path: plugin/src/main/java/de/ase34/flyingblocksapi/FlyingBlocksPlugin.java
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.world.WorldUnloadEvent;
import org.bukkit.plugin.java.JavaPlugin;
import de.ase34.flyingblocksapi.commands.ExamplesCommandExecutor;
import de.ase34.flyingblocksapi.commands.RemoveAllCommandExecutor;
import de.ase34.flyingblocksapi.natives.api.NativesAPI;

/**
 * flyingblocksapi Copyright (C) 2014 ase34 and contributors
 * 
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */

package de.ase34.flyingblocksapi;




public class FlyingBlocksPlugin extends JavaPlugin implements Listener {

    private NativesAPI nativesAPI;

    @Override
    public void onEnable() {
        createNativesAPI();

        nativesAPI.initialize();
        NativesAPI.setSingleton(nativesAPI);

        getCommand("flyingblocks-removeall").setExecutor(new RemoveAllCommandExecutor(this));