Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the option to disable the Per World Configuration file generation + a fast way to disabled the worlds #2985

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
Update WorldListener.java
  • Loading branch information
xSavior-of-God committed May 20, 2021
commit b19f1d9ad50f308a15b442e7f7756c9f94ae0c62
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

import javax.annotation.Nonnull;

import org.bukkit.ChatColor;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.event.world.WorldUnloadEvent;
Expand All @@ -18,14 +20,16 @@ public WorldListener(@Nonnull SlimefunPlugin plugin) {
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}

@EventHandler
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onWorldLoad(WorldLoadEvent e) {
System.out.println(ChatColor.RED+"SLIMEFUN- Loading world ... "+e.getWorld().getName());
SlimefunPlugin.getWorldSettingsService().load(e.getWorld());
BlockStorage.getOrCreate(e.getWorld());
}

@EventHandler
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onWorldUnload(WorldUnloadEvent e) {
System.out.println(ChatColor.RED+"SLIMEFUN- Unloading world ... "+e.getWorld().getName());
BlockStorage storage = BlockStorage.getStorage(e.getWorld());

if (storage != null) {
Expand Down