-
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.
- Loading branch information
1 parent
3ba0cb7
commit 8eeed0e
Showing
5 changed files
with
84 additions
and
30 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
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,37 @@ | ||
package net.riblab.tradecore; | ||
|
||
import java.io.File; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
import de.exlll.configlib.Comment; | ||
import de.exlll.configlib.Configuration; | ||
import de.exlll.configlib.YamlConfigurations; | ||
import lombok.Getter; | ||
|
||
public class ConfigManager { | ||
|
||
@Configuration | ||
public static class CurrencyData { | ||
@Comment({"所持金"}) | ||
public Map<UUID,Double> playerBank = new HashMap<>(); | ||
@Comment({"所持投票チケット数"}) | ||
public Map<UUID,Integer> playerTickets = new HashMap<>(); | ||
} | ||
|
||
@Getter | ||
private CurrencyData currencyData; | ||
private static final Path currencyConfigFile = new File(TradeCore.getInstance().getDataFolder(), "currency.yml").toPath(); | ||
|
||
public void save(){ | ||
YamlConfigurations.save(currencyConfigFile, CurrencyData.class, currencyData); | ||
} | ||
|
||
public void load(){ | ||
// Load a new instance from the configuration file | ||
currencyData = YamlConfigurations.update(currencyConfigFile, CurrencyData.class); | ||
} | ||
} |
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