This repository has been archived by the owner on Nov 25, 2019. It is now read-only.
forked from OvercastNetwork/ProjectAres
-
Notifications
You must be signed in to change notification settings - Fork 14
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
3c74a30
commit 01173c4
Showing
10 changed files
with
89 additions
and
57 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package tc.oc.pgm.polls; | ||
|
||
import org.bukkit.configuration.ConfigurationSection; | ||
import tc.oc.pgm.PGM; | ||
import tc.oc.pgm.match.MatchManager; | ||
|
||
import javax.inject.Inject; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
import static com.google.common.base.Preconditions.checkNotNull; | ||
|
||
public class PollConfig { | ||
|
||
private final ConfigurationSection config; | ||
private final MatchManager matchManager; | ||
|
||
@Inject PollConfig(ConfigurationSection config, MatchManager matchManager) { | ||
this.config = checkNotNull(config.getConfigurationSection("poll")); | ||
this.matchManager = matchManager; | ||
} | ||
|
||
public Path getPollBlacklistPath() { | ||
Path pollPath = Paths.get(config.getString("maps.path", "default.txt")); | ||
if(!pollPath.isAbsolute()) { | ||
pollPath = matchManager.getPluginDataFolder().resolve(pollPath); | ||
} | ||
return pollPath; | ||
} | ||
|
||
public boolean enabled() { | ||
return config.getBoolean("enabled", true); | ||
} | ||
|
||
} |
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
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