Java源码示例:org.spongepowered.api.event.world.UnloadWorldEvent

示例1
@Listener(order = Order.FIRST, beforeModifications = true)
public void onWorldUnload(UnloadWorldEvent event) {
    if (!SpongeImpl.getServer().isServerRunning() || !GriefDefenderPlugin.getInstance().claimsEnabledForWorld(event.getTargetWorld().getUniqueId())) {
        return;
    }

    GriefDefenderPlugin.getInstance().dataStore.removeClaimWorldManager(event.getTargetWorld().getProperties());
}
 
示例2
@Listener(order = Order.FIRST, beforeModifications = true)
public void onWorldUnload(UnloadWorldEvent event) {
    if (!SpongeImpl.getServer().isServerRunning() || !GriefPreventionPlugin.instance.claimsEnabledForWorld(event.getTargetWorld().getProperties())) {
        return;
    }

    GriefPreventionPlugin.instance.dataStore.removeClaimWorldManager(event.getTargetWorld().getProperties());
}
 
示例3
@Listener
public void onWorldUnload(UnloadWorldEvent e) {
    World w = e.getTargetWorld();
    try {
        RedProtect.get().rm.unload(w.getName());
        RedProtect.get().logger.warning("World unloaded: " + w.getName());
    } catch (Exception ex) {
        RedProtect.get().logger.severe("RedProtect problem on unload world:");
        ex.printStackTrace();
    }
}
 
示例4
@Listener(order = Order.POST)
public void onWorldUnload(UnloadWorldEvent event) {
    updateWorld(event.getTargetWorld().getProperties());
}