Search in sources :

Example 1 with RewardsFlag

use of au.com.mineauz.minigames.config.RewardsFlag in project Minigames by AddstarMC.

the class MinigameData method loadRewardSigns.

public void loadRewardSigns() {
    if (rewardSignsSave == null)
        loadRewardSignsFile();
    FileConfiguration cfg = rewardSignsSave.getConfig();
    Set<String> keys = cfg.getKeys(false);
    for (String id : keys) {
        RewardsFlag rew = new RewardsFlag(new Rewards(), id);
        rew.loadValue("", cfg);
        rewardSigns.put(id, rew);
    }
}
Also used : FileConfiguration(org.bukkit.configuration.file.FileConfiguration) Rewards(au.com.mineauz.minigames.minigame.reward.Rewards) RewardsFlag(au.com.mineauz.minigames.config.RewardsFlag)

Example 2 with RewardsFlag

use of au.com.mineauz.minigames.config.RewardsFlag in project Minigames by AddstarMC.

the class MinigameData method addRewardSign.

public void addRewardSign(Location loc) {
    RewardsFlag flag = new RewardsFlag(new Rewards(), MinigameUtils.createLocationID(loc));
    rewardSigns.put(MinigameUtils.createLocationID(loc), flag);
}
Also used : Rewards(au.com.mineauz.minigames.minigame.reward.Rewards) RewardsFlag(au.com.mineauz.minigames.config.RewardsFlag)

Example 3 with RewardsFlag

use of au.com.mineauz.minigames.config.RewardsFlag in project Minigames by AddstarMC.

the class MinigameData method saveRewardSign.

public void saveRewardSign(String id, boolean save) {
    RewardsFlag reward = rewardSigns.get(id);
    if (rewardSignsSave == null)
        loadRewardSignsFile();
    FileConfiguration cfg = rewardSignsSave.getConfig();
    cfg.set(id, null);
    reward.saveValue("", cfg);
    if (save) {
        rewardSignsSave.saveConfig();
        rewardSignsSave = null;
    }
}
Also used : FileConfiguration(org.bukkit.configuration.file.FileConfiguration) RewardsFlag(au.com.mineauz.minigames.config.RewardsFlag)

Aggregations

RewardsFlag (au.com.mineauz.minigames.config.RewardsFlag)3 Rewards (au.com.mineauz.minigames.minigame.reward.Rewards)2 FileConfiguration (org.bukkit.configuration.file.FileConfiguration)2