Java Code Examples for org.bukkit.event.world.WorldUnloadEvent

The following are top voted examples for showing how to use org.bukkit.event.world.WorldUnloadEvent. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: NucleusFramework   File: Region.java   View source code 6 votes vote down vote up
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onWorldUnload(WorldUnloadEvent event) {

    String worldName = event.getWorld().getName();
    for (Region region : _instances.keySet()) {
        if (region.isDefined() && worldName.equals(region.getWorldName())) {
            // remove world from locations, helps garbage collector

            //noinspection ConstantConditions
            region.getP1().setWorld(null);

            //noinspection ConstantConditions
            region.getP2().setWorld(null);
        }
    }
}
 
Example 2
Project: NPlugins   File: WorldListener.java   View source code 6 votes vote down vote up
/**
 * Creates an EndWorldHandler if the loaded world is an End world
 *
 * @param event a World Unload Event
 */
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onWorldUnload(final WorldUnloadEvent event) {
    if (event.getWorld().getEnvironment() == Environment.THE_END) {
        this.plugin.getLogger().info("Handling " + event.getWorld().getName() + " unload");
        final EndWorldHandler handler = this.plugin.getHandler(StringUtil.toLowerCamelCase(event.getWorld().getName()));
        if (handler != null) {
            try {
                handler.unload(false);
            } catch (final InvalidConfigurationException e) {
                this.plugin.getLogger().severe("An error occured, stacktrace follows:");
                e.printStackTrace();
            }
        }
    }
}
 
Example 3
Project: Uranium   File: CraftServer.java   View source code 5 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    net.minecraft.world.WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (handle.playerEntities.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.saveAllChunks(true, null);
            handle.flush();
            WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());
            getPluginManager().callEvent(event);
        } catch (net.minecraft.world.MinecraftException ex) {
            getLogger().log(Level.SEVERE, null, ex);
            FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, "Failed to save world " + handle.getWorld().getName() + " while unloading it.");
        }
    }
    MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(handle)); // Cauldron - fire unload event before removing world
    worlds.remove(world.getName().toLowerCase());
    DimensionManager.setWorld(handle.provider.dimensionId, null); // Cauldron - remove world from DimensionManager
    return true;
}
 
Example 4
Project: MundoSK   File: BorderManager.java   View source code 5 votes vote down vote up
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public static void onUnloadWorld(WorldUnloadEvent e) {
	if (stablesizes.containsKey(e.getWorld())) {
		stablesizes.remove(e.getWorld());
		stabletimes.remove(e.getWorld());
		origsizes.remove(e.getWorld());
	}
}
 
Example 5
Project: SmallWarps   File: Warp.java   View source code 5 votes vote down vote up
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled = true)
public void onWorldUnload(WorldUnloadEvent e) {
    if (e.getWorld() == this.world) {
        world = null;
        location = null;
    }
}
 
Example 6
Project: ThermosRebased   File: CraftServer.java   View source code 5 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    net.minecraft.world.WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (handle.playerEntities.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.saveAllChunks(true, null);
            handle.flush();
            WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());
            getPluginManager().callEvent(event);
        } catch (net.minecraft.world.MinecraftException ex) {
            getLogger().log(Level.SEVERE, null, ex);
            FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, "Failed to save world " + handle.getWorld().getName() + " while unloading it.");
        }
    }
    MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(handle)); // Cauldron - fire unload event before removing world
    worlds.remove(world.getName().toLowerCase());
    DimensionManager.setWorld(handle.provider.dimensionId, null); // Cauldron - remove world from DimensionManager
    return true;
}
 
Example 7
Project: Thermos   File: CraftServer.java   View source code 5 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    net.minecraft.world.WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (handle.playerEntities.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.saveAllChunks(true, null);
            handle.flush();
            WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());
            getPluginManager().callEvent(event);
        } catch (net.minecraft.world.MinecraftException ex) {
            getLogger().log(Level.SEVERE, null, ex);
            FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, "Failed to save world " + handle.getWorld().getName() + " while unloading it.");
        }
    }
    MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(handle)); // Cauldron - fire unload event before removing world
    worlds.remove(world.getName().toLowerCase());
    DimensionManager.setWorld(handle.provider.dimensionId, null); // Cauldron - remove world from DimensionManager
    return true;
}
 
Example 8
Project: KCauldron   File: CraftServer.java   View source code 5 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    net.minecraft.world.WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (handle.playerEntities.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.saveAllChunks(true, null);
            handle.flush();
            WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());
            getPluginManager().callEvent(event);
        } catch (net.minecraft.world.MinecraftException ex) {
            getLogger().log(Level.SEVERE, null, ex);
            FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, "Failed to save world " + handle.getWorld().getName() + " while unloading it.");
        }
    }
    MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(handle)); // Cauldron - fire unload event before removing world
    worlds.remove(world.getName().toLowerCase());
    DimensionManager.setWorld(handle.provider.dimensionId, null); // Cauldron - remove world from DimensionManager
    return true;
}
 
Example 9
Project: CauldronGit   File: CraftServer.java   View source code 5 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    net.minecraft.world.WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (handle.playerEntities.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.saveAllChunks(true, null);
            handle.flush();
            WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());
            getPluginManager().callEvent(event);
        } catch (net.minecraft.world.MinecraftException ex) {
            getLogger().log(Level.SEVERE, null, ex);
            FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, "Failed to save world " + handle.getWorld().getName() + " while unloading it.");
        }
    }
    MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(handle)); // Cauldron - fire unload event before removing world
    worlds.remove(world.getName().toLowerCase());
    DimensionManager.setWorld(handle.provider.dimensionId, null); // Cauldron - remove world from DimensionManager
    return true;
}
 
Example 10
Project: CanaryBukkit   File: CanaryWorldListener.java   View source code 5 votes vote down vote up
@HookHandler(priority = Priority.CRITICAL)
public void onWorldUnload(final UnloadWorldHook hook) {
    server.getPluginManager().callEvent(new WorldUnloadEvent(new CanaryWorld(hook.getWorld())) {
        @Override
        public void setCancelled(boolean cancelled) {
            super.setCancelled(cancelled);
            //UnloadWorldHook isn't a CancelableHook :(
        }
    });
}
 
Example 11
Project: Cauldron-Old   File: CraftServer.java   View source code 5 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    net.minecraft.world.WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (handle.playerEntities.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.saveAllChunks(true, null);
            handle.flush();
            WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());
            getPluginManager().callEvent(event);
        } catch (net.minecraft.world.MinecraftException ex) {
            getLogger().log(Level.SEVERE, null, ex);
            FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, "Failed to save world " + handle.getWorld().getName() + " while unloading it.");
        }
    }
    MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(handle)); // Cauldron - fire unload event before removing world
    worlds.remove(world.getName().toLowerCase());
    DimensionManager.setWorld(handle.provider.dimensionId, null); // Cauldron - remove world from DimensionManager
    return true;
}
 
Example 12
Project: DiffUtils   File: CraftServer_188.java   View source code 5 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (!(handle.dimension > 1)) {
        return false;
    }

    if (handle.players.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.save(true, null);
            handle.saveLevel();
        } catch (ExceptionWorldConflict ex) {
            getLogger().log(Level.SEVERE, null, ex);
        }
    }

    worlds.remove(world.getName().toLowerCase());
    console.worlds.remove(console.worlds.indexOf(handle));
    return true;
}
 
Example 13
Project: Cauldron-Reloaded   File: CraftServer.java   View source code 5 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    net.minecraft.world.WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (handle.playerEntities.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.saveAllChunks(true, null);
            handle.flush();
            WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());
            getPluginManager().callEvent(event);
        } catch (net.minecraft.world.MinecraftException ex) {
            getLogger().log(Level.SEVERE, null, ex);
            FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, "Failed to save world " + handle.getWorld().getName() + " while unloading it.");
        }
    }
    MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(handle)); // Cauldron - fire unload event before removing world
    worlds.remove(world.getName().toLowerCase());
    DimensionManager.setWorld(handle.provider.dimensionId, null); // Cauldron - remove world from DimensionManager
    return true;
}
 
Example 14
Project: RedProtect   File: RPWorldListener.java   View source code 5 votes vote down vote up
@EventHandler(priority = EventPriority.NORMAL)
public void onWorldUnload(WorldUnloadEvent e) {
    World w = e.getWorld();
    try {
        RedProtect.get().rm.unload(w);
        RedProtect.get().logger.warning("World unloaded: " + w.getName());
    }
    catch (Exception ex) {
    	RedProtect.get().logger.severe("RedProtect problem on unload world:");
        ex.printStackTrace();
    }
}
 
Example 15
Project: FFoKC   File: CraftServer.java   View source code 5 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    net.minecraft.world.WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (handle.playerEntities.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.saveAllChunks(true, null);
            handle.flush();
            WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());
            getPluginManager().callEvent(event);
        } catch (net.minecraft.world.MinecraftException ex) {
            getLogger().log(Level.SEVERE, null, ex);
            FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, "Failed to save world " + handle.getWorld().getName() + " while unloading it.");
        }
    }
    MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(handle)); // Cauldron - fire unload event before removing world
    worlds.remove(world.getName().toLowerCase(java.util.Locale.ROOT));
    DimensionManager.setWorld(handle.provider.dimensionId, null); // Cauldron - remove world from DimensionManager
    return true;
}
 
Example 16
Project: Craftbukkit   File: CraftServer.java   View source code 5 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (!(handle.dimension > 1)) {
        return false;
    }

    if (handle.players.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.save(true, null);
            handle.saveLevel();
        } catch (ExceptionWorldConflict ex) {
            getLogger().log(Level.SEVERE, null, ex);
        }
    }

    worlds.remove(world.getName().toLowerCase());
    console.worlds.remove(console.worlds.indexOf(handle));
    return true;
}
 
Example 17
Project: BlockBank   File: WorldListener.java   View source code 5 votes vote down vote up
@EventHandler
public void onWorldUnload(WorldUnloadEvent event)
{
	World world = event.getWorld();
	if (announcementTasks.containsKey(world.getName())) {
		plugin.getLogger().info("Cancelling Announcement Task for " + world.getName());
		announcementTasks.get(world.getName()).cancel();
	}
}
 
Example 18
Project: AlmuraForgeBridge   File: WorldListener.java   View source code 5 votes vote down vote up
@EventHandler
public void onWorldUnload(WorldUnloadEvent event) {        
    if (BridgePlugin.getInstance().debugMode) {
        System.out.println("[BRIDGE WORLD LISTENER] Unloading: " + event.getWorld().getName());
        Thread.dumpStack();
    }
}
 
Example 19
Project: Cauldron   File: CraftServer.java   View source code 5 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    net.minecraft.world.WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (handle.playerEntities.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.saveAllChunks(true, null);
            handle.flush();
            WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());
            getPluginManager().callEvent(event);
        } catch (net.minecraft.world.MinecraftException ex) {
            getLogger().log(Level.SEVERE, null, ex);
            FMLLog.log(org.apache.logging.log4j.Level.ERROR, ex, "Failed to save world " + handle.getWorld().getName() + " while unloading it.");
        }
    }
    MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(handle)); // Cauldron - fire unload event before removing world
    worlds.remove(world.getName().toLowerCase());
    DimensionManager.setWorld(handle.provider.dimensionId, null); // Cauldron - remove world from DimensionManager
    return true;
}
 
Example 20
Project: PV-Star   File: WorldEventListener.java   View source code 5 votes vote down vote up
private void onWorldUnload(WorldUnloadEvent event) {
    List<IArena> arenas = PVStarAPI.getArenaManager().getArenas();

    for (IArena arena : arenas) {
        if (arena.getRegion().isDefined()) {
            World world = arena.getRegion().getWorld();

            if (event.getWorld().equals(world)) {
                arena.getSettings().setTransientEnabled(false);
            }
        }
    }
}
 
Example 21
Project: Masters   File: worldHandler.java   View source code 5 votes vote down vote up
@EventHandler (priority = EventPriority.NORMAL)
public void unload(final WorldUnloadEvent evt) {
	for (Player pl : Bukkit.getServer().getOnlinePlayers()) {
		if (pl.hasPermission("masters.debug")) {
			pl.sendMessage(ChatColor.RED + "World " + evt.getWorld().getName() + " has been unloaded.");
		}
	}
}
 
Example 22
Project: Warzone   File: WorldListener.java   View source code 4 votes vote down vote up
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onWorldUnload(final WorldUnloadEvent event) {
    for(Tracker tracker : this.manager.getTrackers()) {
        tracker.clear(event.getWorld());
    }
}
 
Example 23
Project: ProjectAres   File: LivingEntityMapAdapter.java   View source code 4 votes vote down vote up
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onWorldUnload(WorldUnloadEvent event) {
    for(Entity entity : event.getWorld().getEntities()) {
        map.remove(entity);
    }
}
 
Example 24
Project: ProjectAres   File: LeakListener.java   View source code 4 votes vote down vote up
@EventHandler(priority = EventPriority.LOWEST)
public void onWorldChange(WorldUnloadEvent event) {
    leakDetector.expectRelease(event.getWorld(), DEADLINE, true);
}
 
Example 25
Project: ProjectAres   File: PlayerFreezer.java   View source code 4 votes vote down vote up
@EventHandler(priority = EventPriority.MONITOR)
public void onUnload(WorldUnloadEvent event) {
    armorStands.remove(event.getWorld());
}
 
Example 26
Project: CapCat   File: SignListener.java   View source code 4 votes vote down vote up
@EventHandler(ignoreCancelled = true)
public void onWorldUnload(WorldUnloadEvent event) {
    plugin.signDB.updateAttachedBlocks();
}
 
Example 27
Project: LagMonitor   File: ThreadSafetyListener.java   View source code 4 votes vote down vote up
@EventHandler
public void onWorldUnload(WorldUnloadEvent worldUnloadEvent) {
    checkSafety(worldUnloadEvent);
}
 
Example 28
Project: Phantom   File: HiveSVC.java   View source code 4 votes vote down vote up
@EventHandler
public void on(WorldUnloadEvent e)
{
	installWorld(e.getWorld());
}
 
Example 29
Project: DiffUtils   File: CraftServer_1710.java   View source code 4 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (!(handle.dimension > 1)) {
        return false;
    }

    if (handle.players.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.save(true, null);
            handle.saveLevel();
            WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());
            getPluginManager().callEvent(event);
        } catch (ExceptionWorldConflict ex) {
            getLogger().log(Level.SEVERE, null, ex);
        }
    }

    worlds.remove(world.getName().toLowerCase());
    console.worlds.remove(console.worlds.indexOf(handle));

    return true;
}
 
Example 30
Project: Spigot-Plus   File: WorldManager.java   View source code 4 votes vote down vote up
@EventHandler
public void onWorldUnload(WorldUnloadEvent event){
	WorldManagerHelper.saveWorldConfig(event.getWorld());
}
 
Example 31
Project: CraftBukkit   File: CraftServer.java   View source code 4 votes vote down vote up
@Override
public boolean unloadWorld(World world, boolean save) {
    if (world == null) {
        return false;
    }

    WorldServer handle = ((CraftWorld) world).getHandle();

    if (!(console.worlds.contains(handle))) {
        return false;
    }

    if (!(handle.dimension > 1)) {
        return false;
    }

    if (handle.players.size() > 0) {
        return false;
    }

    WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld());
    pluginManager.callEvent(e);

    if (e.isCancelled()) {
        return false;
    }

    if (save) {
        try {
            handle.save(true, null);
            handle.saveLevel();
            WorldSaveEvent event = new WorldSaveEvent(handle.getWorld());
            getPluginManager().callEvent(event);
        } catch (ExceptionWorldConflict ex) {
            getLogger().log(Level.SEVERE, null, ex);
        }
    }

    worlds.remove(world.getName().toLowerCase());
    console.worlds.remove(console.worlds.indexOf(handle));

    return true;
}
 
Example 32
Project: LagMonitor   File: ThreadSafetyListener.java   View source code 4 votes vote down vote up
@EventHandler
public void onWorldUnload(WorldUnloadEvent worldUnloadEvent) {
    checkSafety(worldUnloadEvent);
}
 
Example 33
Project: SurvivalGamesX   File: WorldListener.java   View source code 4 votes vote down vote up
public void disable() {
    WorldInitEvent.getHandlerList().unregister(this);
    WorldUnloadEvent.getHandlerList().unregister(this);
    WorldLoadEvent.getHandlerList().unregister(this);
    WorldSaveEvent.getHandlerList().unregister(this);
}
 
Example 34
Project: SurvivalGamesX   File: WorldListener.java   View source code 4 votes vote down vote up
@EventHandler(priority = EventPriority.NORMAL)
public void onWorldUnload(WorldUnloadEvent ev) {
    plugin.getDebug().normal("#### " + ev.getWorld().getName() + " was unloaded.");
}
 
Example 35
Project: dynmap-structures   File: DynmapStructuresPlugin.java   View source code 4 votes vote down vote up
@EventHandler
public void onWorldUnload(WorldUnloadEvent event) {
    this.removeWorld(event.getWorld());
}
 
Example 36
Project: flyingblocksapi   File: FlyingBlocksPlugin.java   View source code 4 votes vote down vote up
@EventHandler
public void onWorldUnload(WorldUnloadEvent ev) {
    removeFlyingBlocks(ev.getWorld());
}
 
Example 37
Project: sensibletoolbox   File: WorldListener.java   View source code 4 votes vote down vote up
@EventHandler
public void onWorldUnLoad(WorldUnloadEvent event) {
    LocationManager.getManager().worldUnloaded(event.getWorld());
}
 
Example 38
Project: ShankShock-Core   File: ServerListener.java   View source code 4 votes vote down vote up
@EventHandler(priority = EventPriority.MONITOR)
public void onWorldUnload(WorldUnloadEvent e) {
	plugin.worlds.remove(e.getWorld().getName());
}
 
Example 39
Project: EMS   File: EMSListener.java   View source code 4 votes vote down vote up
@EventHandler
public void onWorldUnload(WorldUnloadEvent event) {
	World world = event.getWorld();

	manager.unloadWorld(world);
}
 
Example 40
Project: anduneCommonBukkitLib   File: BukkitServer.java   View source code 4 votes vote down vote up
@EventHandler
public void worldUnloadEvent(WorldUnloadEvent e) {
    clearWorldCache = true;
}