Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
xSavior-of-God authored May 20, 2021
1 parent 7895282 commit f3f0f84
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

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;

import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.api.BlockStorage;

Expand All @@ -18,14 +19,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

0 comments on commit f3f0f84

Please sign in to comment.