mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
remove TerraPlugin#saveDefaultConfig
This commit is contained in:
parent
c13494ca03
commit
6da8c72593
@ -36,8 +36,6 @@ public interface TerraPlugin extends LoaderRegistrar {
|
|||||||
|
|
||||||
ItemHandle getItemHandle();
|
ItemHandle getItemHandle();
|
||||||
|
|
||||||
void saveDefaultConfig();
|
|
||||||
|
|
||||||
String platformName();
|
String platformName();
|
||||||
|
|
||||||
Logger getDebugLogger();
|
Logger getDebugLogger();
|
||||||
|
@ -74,7 +74,15 @@ public abstract class AbstractTerraPlugin implements TerraPlugin {
|
|||||||
|
|
||||||
logger().info("Initializing Terra...");
|
logger().info("Initializing Terra...");
|
||||||
|
|
||||||
saveDefaultConfig();
|
try(InputStream stream = getClass().getResourceAsStream("/config.yml")) {
|
||||||
|
File configFile = new File(getDataFolder(), "config.yml");
|
||||||
|
if(!configFile.exists()) {
|
||||||
|
FileUtils.copyInputStreamToFile(stream, configFile);
|
||||||
|
}
|
||||||
|
} catch(IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
config.load(this); // load config.yml
|
config.load(this); // load config.yml
|
||||||
|
|
||||||
LangUtil.load(config.getLanguage(), this); // load language
|
LangUtil.load(config.getLanguage(), this); // load language
|
||||||
@ -127,18 +135,6 @@ public abstract class AbstractTerraPlugin implements TerraPlugin {
|
|||||||
return configRegistry;
|
return configRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void saveDefaultConfig() {
|
|
||||||
try(InputStream stream = getClass().getResourceAsStream("/config.yml")) {
|
|
||||||
File configFile = new File(getDataFolder(), "config.yml");
|
|
||||||
if(!configFile.exists()) {
|
|
||||||
FileUtils.copyInputStreamToFile(stream, configFile);
|
|
||||||
}
|
|
||||||
} catch(IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public CommandManager getManager() {
|
public CommandManager getManager() {
|
||||||
return manager;
|
return manager;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user