-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Grafe <[email protected]>
- Loading branch information
Showing
6 changed files
with
56 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
MotD: Standard MotD of ManagerXL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.dre.managerxl; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import org.bukkit.configuration.file.FileConfiguration; | ||
import org.bukkit.configuration.file.YamlConfiguration; | ||
|
||
public class Config { | ||
|
||
//File | ||
private File file; | ||
|
||
//MotD | ||
private String motd; | ||
public String getMotD() { return this.motd; } | ||
public void setMotD(String motd) { this.motd = motd; } | ||
|
||
public Config(File file){ | ||
if(!file.exists()){ | ||
P.p.saveDefaultConfig(); | ||
} | ||
|
||
this.file = file; | ||
FileConfiguration ymlFile = YamlConfiguration.loadConfiguration(this.file); | ||
|
||
this.motd = ymlFile.getString("MotD"); | ||
} | ||
|
||
public void saveSingleConfig(String path, Object object){ | ||
FileConfiguration ymlFile = YamlConfiguration.loadConfiguration(this.file); | ||
|
||
ymlFile.set(path, object); | ||
|
||
try { | ||
ymlFile.save(this.file); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters