Search in sources :

Example 1 with GlobalBlockQueue

use of com.plotsquared.core.queue.GlobalBlockQueue in project PlotSquared by IntellectualSites.

the class BukkitModule method configure.

@Override
protected void configure() {
    bind(PlayerManager.class).to(BukkitPlayerManager.class);
    bind(JavaPlugin.class).toInstance(bukkitPlatform);
    bind(PlotPlatform.class).toInstance(bukkitPlatform);
    bind(BukkitPlatform.class).toInstance(bukkitPlatform);
    bind(IndependentPlotGenerator.class).annotatedWith(DefaultGenerator.class).to(HybridGen.class);
    // Console actor
    @NonNull ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
    WorldEditPlugin wePlugin = ((WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit"));
    bind(Actor.class).annotatedWith(ConsoleActor.class).toInstance(wePlugin.wrapCommandSender(console));
    bind(InventoryUtil.class).to(BukkitInventoryUtil.class);
    bind(SetupUtils.class).to(BukkitSetupUtils.class);
    bind(WorldUtil.class).to(BukkitUtil.class);
    install(new FactoryModuleBuilder().implement(ProgressSubscriber.class, DefaultProgressSubscriber.class).build(ProgressSubscriberFactory.class));
    bind(ChunkManager.class).to(BukkitChunkManager.class);
    if (PlotSquared.platform().isFaweHooking()) {
        bind(SchematicHandler.class).to(FaweSchematicHandler.class);
        bind(RegionManager.class).to(FaweRegionManager.class);
    } else {
        bind(SchematicHandler.class).to(BukkitSchematicHandler.class);
        bind(RegionManager.class).to(BukkitRegionManager.class);
    }
    bind(GlobalBlockQueue.class).toInstance(new GlobalBlockQueue(QueueProvider.of(BukkitQueueCoordinator.class)));
    if (Settings.Enabled_Components.WORLDS) {
        bind(PlotAreaManager.class).to(SinglePlotAreaManager.class);
        try {
            bind(SingleWorldListener.class).toInstance(new SingleWorldListener());
        } catch (Exception e) {
            e.printStackTrace();
        }
    } else {
        bind(PlotAreaManager.class).to(DefaultPlotAreaManager.class);
    }
    install(new FactoryModuleBuilder().build(HybridPlotWorldFactory.class));
    install(new FactoryModuleBuilder().implement(ChunkCoordinator.class, BukkitChunkCoordinator.class).build(ChunkCoordinatorFactory.class));
    install(new FactoryModuleBuilder().build(ChunkCoordinatorBuilderFactory.class));
}
Also used : DefaultGenerator(com.plotsquared.core.inject.annotations.DefaultGenerator) HybridPlotWorldFactory(com.plotsquared.core.inject.factory.HybridPlotWorldFactory) PlayerManager(com.plotsquared.core.util.PlayerManager) BukkitPlayerManager(com.plotsquared.bukkit.player.BukkitPlayerManager) PlotPlatform(com.plotsquared.core.PlotPlatform) FactoryModuleBuilder(com.google.inject.assistedinject.FactoryModuleBuilder) BukkitSetupUtils(com.plotsquared.bukkit.util.BukkitSetupUtils) SetupUtils(com.plotsquared.core.util.SetupUtils) JavaPlugin(org.bukkit.plugin.java.JavaPlugin) WorldUtil(com.plotsquared.core.util.WorldUtil) ConsoleCommandSender(org.bukkit.command.ConsoleCommandSender) ConsoleActor(com.plotsquared.core.inject.annotations.ConsoleActor) BukkitInventoryUtil(com.plotsquared.bukkit.util.BukkitInventoryUtil) InventoryUtil(com.plotsquared.core.util.InventoryUtil) ProgressSubscriberFactory(com.plotsquared.core.inject.factory.ProgressSubscriberFactory) BukkitPlatform(com.plotsquared.bukkit.BukkitPlatform) FaweSchematicHandler(com.plotsquared.bukkit.util.fawe.FaweSchematicHandler) SchematicHandler(com.plotsquared.core.util.SchematicHandler) BukkitSchematicHandler(com.plotsquared.bukkit.schematic.BukkitSchematicHandler) WorldEditPlugin(com.sk89q.worldedit.bukkit.WorldEditPlugin) DefaultPlotAreaManager(com.plotsquared.core.plot.world.DefaultPlotAreaManager) SinglePlotAreaManager(com.plotsquared.core.plot.world.SinglePlotAreaManager) PlotAreaManager(com.plotsquared.core.plot.world.PlotAreaManager) NonNull(org.checkerframework.checker.nullness.qual.NonNull) ChunkCoordinatorBuilderFactory(com.plotsquared.core.inject.factory.ChunkCoordinatorBuilderFactory) GlobalBlockQueue(com.plotsquared.core.queue.GlobalBlockQueue) SingleWorldListener(com.plotsquared.bukkit.listener.SingleWorldListener) BukkitRegionManager(com.plotsquared.bukkit.util.BukkitRegionManager) RegionManager(com.plotsquared.core.util.RegionManager) FaweRegionManager(com.plotsquared.bukkit.util.fawe.FaweRegionManager) ChunkCoordinatorFactory(com.plotsquared.core.inject.factory.ChunkCoordinatorFactory) BukkitChunkManager(com.plotsquared.bukkit.util.BukkitChunkManager) ChunkManager(com.plotsquared.core.util.ChunkManager)

Aggregations

FactoryModuleBuilder (com.google.inject.assistedinject.FactoryModuleBuilder)1 BukkitPlatform (com.plotsquared.bukkit.BukkitPlatform)1 SingleWorldListener (com.plotsquared.bukkit.listener.SingleWorldListener)1 BukkitPlayerManager (com.plotsquared.bukkit.player.BukkitPlayerManager)1 BukkitSchematicHandler (com.plotsquared.bukkit.schematic.BukkitSchematicHandler)1 BukkitChunkManager (com.plotsquared.bukkit.util.BukkitChunkManager)1 BukkitInventoryUtil (com.plotsquared.bukkit.util.BukkitInventoryUtil)1 BukkitRegionManager (com.plotsquared.bukkit.util.BukkitRegionManager)1 BukkitSetupUtils (com.plotsquared.bukkit.util.BukkitSetupUtils)1 FaweRegionManager (com.plotsquared.bukkit.util.fawe.FaweRegionManager)1 FaweSchematicHandler (com.plotsquared.bukkit.util.fawe.FaweSchematicHandler)1 PlotPlatform (com.plotsquared.core.PlotPlatform)1 ConsoleActor (com.plotsquared.core.inject.annotations.ConsoleActor)1 DefaultGenerator (com.plotsquared.core.inject.annotations.DefaultGenerator)1 ChunkCoordinatorBuilderFactory (com.plotsquared.core.inject.factory.ChunkCoordinatorBuilderFactory)1 ChunkCoordinatorFactory (com.plotsquared.core.inject.factory.ChunkCoordinatorFactory)1 HybridPlotWorldFactory (com.plotsquared.core.inject.factory.HybridPlotWorldFactory)1 ProgressSubscriberFactory (com.plotsquared.core.inject.factory.ProgressSubscriberFactory)1 DefaultPlotAreaManager (com.plotsquared.core.plot.world.DefaultPlotAreaManager)1 PlotAreaManager (com.plotsquared.core.plot.world.PlotAreaManager)1