blob: ccd6367f40e1c27f5a37d069839b27f823bbfb9d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
package org.anjocaido.groupmanager.events;
import org.anjocaido.groupmanager.GroupManager;
import org.bukkit.event.world.WorldInitEvent;
import org.bukkit.event.world.WorldListener;
/**
* @author ElgarL
*
* Handle new world creation from other plugins
*
*/
public class GMWorldListener extends WorldListener {
private final GroupManager plugin;
public GMWorldListener(GroupManager instance) {
plugin = instance;
}
@Override
public void onWorldInit(WorldInitEvent event) {
String worldName = event.getWorld().getName();
if (GroupManager.isLoaded() && !plugin.getWorldsHolder().isInList(worldName)) {
GroupManager.logger.info("New world detected...");
GroupManager.logger.info("Creating data for: " + worldName);
plugin.getWorldsHolder().setupWorldFolder(worldName);
plugin.getWorldsHolder().loadWorld(worldName);
if (plugin.getWorldsHolder().isInList(worldName))
GroupManager.logger.info("Don't forget to configure/mirror this world in config.yml.");
}
}
}
|