use of io.github.thebusybiscuit.slimefun4.implementation.listeners.WorldListener in project Slimefun4 by Slimefun.
the class SlimefunStartupTask method run.
@Override
public void run() {
runnable.run();
// Load all items
PostSetup.loadItems();
// Load all worlds
Slimefun.getWorldSettingsService().load(Bukkit.getWorlds());
for (World world : Bukkit.getWorlds()) {
try {
new BlockStorage(world);
} catch (Exception x) {
Slimefun.logger().log(Level.SEVERE, x, () -> "An Error occurred while trying to load World \"" + world.getName() + "\" for Slimefun v" + Slimefun.getVersion());
}
}
// Load/Unload Worlds, only after all plugins have started up. Fixes #2862
new WorldListener(this.plugin);
// Only load this Listener if the corresponding items are enabled
if (isEnabled("ELEVATOR_PLATE", "GPS_ACTIVATION_DEVICE_SHARED", "GPS_ACTIVATION_DEVICE_PERSONAL")) {
new TeleporterListener(plugin);
}
}
use of io.github.thebusybiscuit.slimefun4.implementation.listeners.WorldListener in project GlobalWarming by poma123.
the class GlobalWarmingPlugin method onEnable.
@Override
public void onEnable() {
instance = this;
if (cfg.getBoolean("options.auto-update") && getDescription().getVersion().startsWith("DEV - ")) {
new GitHubBuildsUpdater(this, getFile(), "poma123/GlobalWarming/master").start();
}
new Metrics(this, 9132);
final File messagesFile = new File(getDataFolder(), "messages.yml");
if (!messagesFile.exists()) {
try {
Files.copy(this.getClass().getResourceAsStream("/messages.yml"), messagesFile.toPath());
} catch (IOException e) {
getLogger().log(Level.SEVERE, "Failed to create default messages.yml file", e);
}
}
messages = new Config(this, "messages.yml");
File biomeMapDirectory = new File(getDataFolder(), "biome-maps");
if (!biomeMapDirectory.exists()) {
biomeMapDirectory.mkdirs();
}
// Create biome map files
final File pre118BiomeMap = new File(biomeMapDirectory, "pre-1.18.json");
if (!pre118BiomeMap.exists()) {
try {
Files.copy(this.getClass().getResourceAsStream("/biome-maps/pre-1.18.json"), pre118BiomeMap.toPath());
} catch (IOException e) {
getLogger().log(Level.SEVERE, "Failed to create default biome-maps/pre-1.18.json file", e);
}
}
final File post118BiomeMap = new File(biomeMapDirectory, "post-1.18.json");
if (!post118BiomeMap.exists()) {
try {
Files.copy(this.getClass().getResourceAsStream("/biome-maps/post-1.18.json"), post118BiomeMap.toPath());
} catch (IOException e) {
getLogger().log(Level.SEVERE, "Failed to create default biome-maps/post-1.18.json file", e);
}
}
registerItems();
registerResearches();
registry.load(cfg, messages);
scheduleTasks();
command.register();
Bukkit.getPluginManager().registerEvents(new PollutionListener(), this);
Bukkit.getPluginManager().registerEvents(new WorldListener(), this);
}
Aggregations