use of com.Ben12345rocks.AdvancedCore.YML.YMLFileHandler in project VotingPlugin by Ben12345rocks.
the class TopVoterHandler method storeWeeklyTopVoters.
public void storeWeeklyTopVoters() {
LocalDateTime time = LocalDateTime.now().minusHours(10);
String month = time.getMonth().toString();
int year = time.getYear();
int week = time.getDayOfYear();
YMLFileHandler file = new YMLFileHandler(new File(plugin.getDataFolder(), "TopVoter" + File.separator + "Weekly" + File.separator + year + "_" + month + "_" + week + ".yml"));
file.setup();
ArrayList<String> topVoters = new ArrayList<String>();
int count = 1;
for (Entry<User, Integer> entry : plugin.topVoterWeekly.entrySet()) {
topVoters.add(count + ": " + entry.getKey().getPlayerName() + ": " + entry.getValue());
count++;
}
file.getData().set("Week", topVoters);
file.saveData();
}
use of com.Ben12345rocks.AdvancedCore.YML.YMLFileHandler in project VotingPlugin by Ben12345rocks.
the class TopVoterHandler method storeDailyTopVoters.
public void storeDailyTopVoters() {
LocalDateTime time = LocalDateTime.now().minusHours(5);
String month = time.getMonth().toString();
int year = time.getYear();
int day = time.getDayOfMonth();
YMLFileHandler file = new YMLFileHandler(new File(plugin.getDataFolder(), "TopVoter" + File.separator + "Daily" + File.separator + year + "_" + month + "_" + day + ".yml"));
file.setup();
ArrayList<String> topVoters = new ArrayList<String>();
int count = 1;
for (Entry<User, Integer> entry : plugin.topVoterDaily.entrySet()) {
topVoters.add(count + ": " + entry.getKey().getPlayerName() + ": " + entry.getValue());
count++;
}
file.getData().set("Day", topVoters);
file.saveData();
}
use of com.Ben12345rocks.AdvancedCore.YML.YMLFileHandler in project VotingPlugin by Ben12345rocks.
the class TopVoterHandler method storeMonthlyTopVoters.
public void storeMonthlyTopVoters() {
LocalDateTime time = LocalDateTime.now().minusHours(10);
String month = time.getMonth().toString();
int year = time.getYear();
YMLFileHandler file = new YMLFileHandler(new File(plugin.getDataFolder(), "TopVoter" + File.separator + "Monthly" + File.separator + month + "_" + year + ".yml"));
file.setup();
ArrayList<String> topVoters = new ArrayList<String>();
int count = 1;
for (Entry<User, Integer> entry : plugin.topVoterMonthly.entrySet()) {
topVoters.add(count + ": " + entry.getKey().getPlayerName() + ": " + entry.getValue());
count++;
}
file.getData().set("Month", topVoters);
file.saveData();
}
Aggregations