mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-02-16 20:41:59 +01:00
Start using the new config
This commit is contained in:
parent
cfdd1ac38c
commit
4366b16a74
@ -28,7 +28,9 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.World.Environment;
|
import org.bukkit.World.Environment;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
import org.bukkit.event.Event.Priority;
|
import org.bukkit.event.Event.Priority;
|
||||||
@ -51,6 +53,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
|||||||
public static boolean EnforceAccess;
|
public static boolean EnforceAccess;
|
||||||
public static boolean EnforceGameModes;
|
public static boolean EnforceGameModes;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String dumpVersionInfo(String buffer) {
|
public String dumpVersionInfo(String buffer) {
|
||||||
// I'm kinda cheating on this one, since we call the init event.
|
// I'm kinda cheating on this one, since we call the init event.
|
||||||
@ -87,6 +90,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
|||||||
|
|
||||||
// Configurations
|
// Configurations
|
||||||
private Configuration configMV = null;
|
private Configuration configMV = null;
|
||||||
|
private FileConfiguration multiverseConfig = null;
|
||||||
|
|
||||||
private WorldManager worldManager = new WorldManager(this);
|
private WorldManager worldManager = new WorldManager(this);
|
||||||
|
|
||||||
@ -125,6 +129,10 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
|||||||
return this.configMV;
|
return this.configMV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FileConfiguration getMVConfiguration() {
|
||||||
|
return this.multiverseConfig;
|
||||||
|
}
|
||||||
|
|
||||||
public GenericBank getBank() {
|
public GenericBank getBank() {
|
||||||
return this.bank;
|
return this.bank;
|
||||||
}
|
}
|
||||||
@ -164,7 +172,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
|||||||
// this function will be called every time a plugin registers a new envtype with MV
|
// this function will be called every time a plugin registers a new envtype with MV
|
||||||
// Setup & Load our Configuration files.
|
// Setup & Load our Configuration files.
|
||||||
loadConfigs();
|
loadConfigs();
|
||||||
if (this.configMV != null) {
|
if (this.multiverseConfig != null) {
|
||||||
this.worldManager.loadWorlds(true);
|
this.worldManager.loadWorlds(true);
|
||||||
} else {
|
} else {
|
||||||
this.log(Level.SEVERE, "Your configs were not loaded. Very little will function in Multiverse.");
|
this.log(Level.SEVERE, "Your configs were not loaded. Very little will function in Multiverse.");
|
||||||
@ -256,7 +264,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
|||||||
new DefaultConfig(getDataFolder(), "config.yml", this.migrator);
|
new DefaultConfig(getDataFolder(), "config.yml", this.migrator);
|
||||||
new DefaultConfig(getDataFolder(), "worlds.yml", this.migrator);
|
new DefaultConfig(getDataFolder(), "worlds.yml", this.migrator);
|
||||||
// Now grab the Configuration Files.
|
// Now grab the Configuration Files.
|
||||||
this.configMV = new Configuration(new File(getDataFolder(), "config.yml"));
|
this.multiverseConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "config.yml"));
|
||||||
|
|
||||||
this.worldManager.loadWorldConfig(new File(getDataFolder(), "worlds.yml"));
|
this.worldManager.loadWorldConfig(new File(getDataFolder(), "worlds.yml"));
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import com.fernferret.allpay.GenericBank;
|
|||||||
import com.onarandombox.MultiverseCore.destination.DestinationFactory;
|
import com.onarandombox.MultiverseCore.destination.DestinationFactory;
|
||||||
import com.onarandombox.MultiverseCore.utils.*;
|
import com.onarandombox.MultiverseCore.utils.*;
|
||||||
import com.pneumaticraft.commandhandler.CommandHandler;
|
import com.pneumaticraft.commandhandler.CommandHandler;
|
||||||
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.util.config.Configuration;
|
import org.bukkit.util.config.Configuration;
|
||||||
|
|
||||||
@ -22,11 +23,20 @@ import org.bukkit.util.config.Configuration;
|
|||||||
public interface Core {
|
public interface Core {
|
||||||
/**
|
/**
|
||||||
* Gets the Multiverse config file.
|
* Gets the Multiverse config file.
|
||||||
|
* Now Deprecated, use {@link #getMVConfiguration()}
|
||||||
*
|
*
|
||||||
* @return The Multiverse config file.
|
* @return The Multiverse config file.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public Configuration getMVConfig();
|
public Configuration getMVConfig();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the Multiverse config file.
|
||||||
|
*
|
||||||
|
* @return The Multiverse config file.
|
||||||
|
*/
|
||||||
|
public FileConfiguration getMVConfiguration();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the Banking system that Multiverse-Core has hooked into.
|
* Gets the Banking system that Multiverse-Core has hooked into.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user