mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-23 11:06:14 +01:00
Fix MagicSpells config loading issue.
This commit is contained in:
parent
402e6d4de9
commit
0a2956fb81
@ -1,16 +1,18 @@
|
||||
# MobArena disabled MagicSpells spells
|
||||
#
|
||||
# Use this file to disable the MagicSpells spells you don't want your players
|
||||
# to use during arena sessions. Make sure to put a hyphen (-) before every
|
||||
# spell, and try to keep the indentation proper.
|
||||
#
|
||||
# Spells that will be disabled for the entire arena session.
|
||||
disabled-spells:
|
||||
- carpet
|
||||
- blink
|
||||
- carpet
|
||||
- blink
|
||||
|
||||
# Spells that will be disabled only while a boss is present.
|
||||
disabled-on-bosses:
|
||||
- purge
|
||||
- purge
|
||||
|
||||
# Spells that will be disabled only during swarm waves.
|
||||
disabled-on-swarms:
|
||||
- purge
|
||||
- purge
|
@ -174,6 +174,7 @@ public class MobArena extends JavaPlugin
|
||||
|
||||
if (e != null) {
|
||||
economy = e.getProvider();
|
||||
Messenger.info("Vault found; economy rewards enabled.");
|
||||
} else {
|
||||
Messenger.warning("Vault found, but no economy plugin detected. Economy rewards will not work!");
|
||||
}
|
||||
@ -183,6 +184,7 @@ public class MobArena extends JavaPlugin
|
||||
Plugin heroesPlugin = this.getServer().getPluginManager().getPlugin("Heroes");
|
||||
if (heroesPlugin == null) return;
|
||||
|
||||
Messenger.info("Heroes found; using different health strategy.");
|
||||
hasHeroes = true;
|
||||
}
|
||||
|
||||
@ -190,6 +192,7 @@ public class MobArena extends JavaPlugin
|
||||
Plugin spells = this.getServer().getPluginManager().getPlugin("MagicSpells");
|
||||
if (spells == null) return;
|
||||
|
||||
Messenger.info("MagicSpells found, loading config-file.");
|
||||
this.getServer().getPluginManager().registerEvents(new MagicSpellsListener(this), this);
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
package com.garbagemule.MobArena.listeners;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.garbagemule.MobArena.Messenger;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
@ -14,6 +14,7 @@ import org.bukkit.event.Listener;
|
||||
import com.garbagemule.MobArena.framework.Arena;
|
||||
import com.garbagemule.MobArena.waves.enums.*;
|
||||
import com.garbagemule.MobArena.MobArena;
|
||||
|
||||
import com.nisovin.magicspells.events.SpellCastEvent;
|
||||
|
||||
public class MagicSpellsListener implements Listener
|
||||
@ -26,10 +27,14 @@ public class MagicSpellsListener implements Listener
|
||||
this.plugin = plugin;
|
||||
|
||||
// Set up the MagicSpells config-file.
|
||||
plugin.saveResource("res/magicspells.yml", false);
|
||||
FileConfiguration config = new YamlConfiguration();
|
||||
File file = new File(plugin.getDataFolder(), "magicspells.yml");
|
||||
if (!file.exists()) {
|
||||
plugin.saveResource("magicspells.yml", false);
|
||||
Messenger.info("magicspells.yml created.");
|
||||
}
|
||||
try {
|
||||
config.load(new File(plugin.getDataFolder(), "magicspells.yml"));
|
||||
FileConfiguration config = new YamlConfiguration();
|
||||
config.load(file);
|
||||
setupSpells(config);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
Loading…
Reference in New Issue
Block a user