Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7696bed25 | ||
|
|
064451d2b5 | ||
|
|
daa25805fa |
No files matched your search
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.Ben12345rocks</groupId>
|
||||
<artifactId>VotingPlugin</artifactId>
|
||||
<version>5.8.4</version>
|
||||
<version>5.8.5</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>VotingPlugin</name>
|
||||
<properties>
|
||||
@@ -162,7 +162,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.12-pre6-SNAPSHOT</version>
|
||||
<version>1.12-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -99,8 +99,7 @@ public class ConfigVoteSites extends YMLFile {
|
||||
* @return the data
|
||||
*/
|
||||
public ConfigurationSection getData(String siteName) {
|
||||
ConfigurationSection data = getData().getConfigurationSection("VoteSites." + siteName);
|
||||
return data;
|
||||
return getData().getConfigurationSection("VoteSites." + siteName);
|
||||
}
|
||||
|
||||
public String getDisplayName(String site) {
|
||||
@@ -272,9 +271,7 @@ public class ConfigVoteSites extends YMLFile {
|
||||
* @return true, if is service site good
|
||||
*/
|
||||
public boolean isServiceSiteGood(String siteName) {
|
||||
if (getServiceSite(siteName) == null) {
|
||||
return false;
|
||||
} else if (getServiceSite(siteName).equalsIgnoreCase("")) {
|
||||
if (getServiceSite(siteName) == null || getServiceSite(siteName).equals("")) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -288,9 +285,7 @@ public class ConfigVoteSites extends YMLFile {
|
||||
* @return true, if is vote URL good
|
||||
*/
|
||||
public boolean isVoteURLGood(String siteName) {
|
||||
if (getVoteURL(siteName) == null) {
|
||||
return false;
|
||||
} else if (getVoteURL(siteName).equalsIgnoreCase("")) {
|
||||
if (getVoteURL(siteName) == null || getVoteURL(siteName).equals("")) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
@@ -21,7 +22,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.Ben12345rocks.AdvancedCore.AdvancedCoreHook;
|
||||
import com.Ben12345rocks.AdvancedCore.Objects.CommandHandler;
|
||||
import com.Ben12345rocks.AdvancedCore.Objects.Reward;
|
||||
import com.Ben12345rocks.AdvancedCore.Objects.RewardHandler;
|
||||
import com.Ben12345rocks.AdvancedCore.Objects.UUID;
|
||||
import com.Ben12345rocks.AdvancedCore.Objects.UserStorage;
|
||||
@@ -132,57 +132,66 @@ public class Main extends JavaPlugin {
|
||||
|
||||
AdvancedCoreHook.getInstance().setStorageType(from);
|
||||
|
||||
ArrayList<String> choiceRewards = user.getChoiceRewards();
|
||||
String inputMethod = user.getInputMethod();
|
||||
ArrayList<String> offlineRewards = user.getOfflineRewards();
|
||||
HashMap<Reward, ArrayList<Long>> timed = user.getTimedRewards();
|
||||
int allTime = user.getAllTimeTotal();
|
||||
int dailyTotal = user.getDailyTotal();
|
||||
HashMap<String, Boolean> mileStone = user.getHasGottenMilestone();
|
||||
HashMap<VoteSite, Long> lastVotes = user.getLastVotes();
|
||||
int monthTotals = user.getMonthTotal();
|
||||
ArrayList<String> otherRewards = user.getOfflineOtherRewards();
|
||||
ArrayList<String> offlineVotes = user.getOfflineVotes();
|
||||
int points = user.getPoints();
|
||||
int votePartyVotes = user.getVotePartyVotes();
|
||||
int weeklyTotal = user.getWeeklyTotal();
|
||||
HashMap<String, String> values = new HashMap<String, String>();
|
||||
for (String key : user.getData().getKeys()) {
|
||||
values.put(key, user.getData().getString(key));
|
||||
}
|
||||
|
||||
int highestDailyTotal = user.getHighestDailyTotal();
|
||||
int highestWeeklyTotal = user.getHighestWeeklyTotal();
|
||||
int highestMonthlyTotal = user.getHighestMonthlyTotal();
|
||||
int voteStreakDay = user.getDayVoteStreak();
|
||||
int voteStreakWeek = user.getWeekVoteStreak();
|
||||
int voteStreakMonth = user.getMonthVoteStreak();
|
||||
int bestVoteStreakDay = user.getBestDayVoteStreak();
|
||||
int bestVoteStreakWeek = user.getBestWeekVoteStreak();
|
||||
int bestVoteStreakMonth = user.getBestMonthVoteStreak();
|
||||
/*
|
||||
* ArrayList<String> choiceRewards = user.getChoiceRewards();
|
||||
* String inputMethod = user.getInputMethod(); ArrayList<String>
|
||||
* offlineRewards = user.getOfflineRewards(); HashMap<Reward,
|
||||
* ArrayList<Long>> timed = user.getTimedRewards(); int allTime
|
||||
* = user.getAllTimeTotal(); int dailyTotal =
|
||||
* user.getDailyTotal(); HashMap<String, Boolean> mileStone =
|
||||
* user.getHasGottenMilestone(); HashMap<VoteSite, Long>
|
||||
* lastVotes = user.getLastVotes(); int monthTotals =
|
||||
* user.getMonthTotal(); ArrayList<String> otherRewards =
|
||||
* user.getOfflineOtherRewards(); ArrayList<String> offlineVotes
|
||||
* = user.getOfflineVotes(); int points = user.getPoints(); int
|
||||
* votePartyVotes = user.getVotePartyVotes(); int weeklyTotal =
|
||||
* user.getWeeklyTotal();
|
||||
*
|
||||
* int highestDailyTotal = user.getHighestDailyTotal(); int
|
||||
* highestWeeklyTotal = user.getHighestWeeklyTotal(); int
|
||||
* highestMonthlyTotal = user.getHighestMonthlyTotal(); int
|
||||
* voteStreakDay = user.getDayVoteStreak(); int voteStreakWeek =
|
||||
* user.getWeekVoteStreak(); int voteStreakMonth =
|
||||
* user.getMonthVoteStreak(); int bestVoteStreakDay =
|
||||
* user.getBestDayVoteStreak(); int bestVoteStreakWeek =
|
||||
* user.getBestWeekVoteStreak(); int bestVoteStreakMonth =
|
||||
* user.getBestMonthVoteStreak();
|
||||
*/
|
||||
|
||||
AdvancedCoreHook.getInstance().setStorageType(to);
|
||||
|
||||
user.setChoiceRewards(choiceRewards);
|
||||
user.setInputMethod(inputMethod);
|
||||
user.setOfflineRewards(offlineRewards);
|
||||
user.setTimedRewards(timed);
|
||||
user.setAllTimeTotal(allTime);
|
||||
user.setDailyTotal(dailyTotal);
|
||||
user.setHasGottenMilestone(mileStone);
|
||||
user.setLastVotes(lastVotes);
|
||||
user.setMonthTotal(monthTotals);
|
||||
user.setOfflineOtherRewards(otherRewards);
|
||||
user.setOfflineVotes(offlineVotes);
|
||||
user.setPoints(points);
|
||||
user.setVotePartyVotes(votePartyVotes);
|
||||
user.setWeeklyTotal(weeklyTotal);
|
||||
|
||||
user.setHighestDailyTotal(highestDailyTotal);
|
||||
user.setHighestWeeklyTotal(highestWeeklyTotal);
|
||||
user.setHighestMonthlyTotal(highestMonthlyTotal);
|
||||
user.setDayVoteStreak(voteStreakDay);
|
||||
user.setWeekVoteStreak(voteStreakWeek);
|
||||
user.setMonthVoteStreak(voteStreakMonth);
|
||||
user.setBestDayVoteStreak(bestVoteStreakDay);
|
||||
user.setBestWeekVoteStreak(bestVoteStreakWeek);
|
||||
user.setBestMonthVoteStreak(bestVoteStreakMonth);
|
||||
/*
|
||||
* user.setChoiceRewards(choiceRewards);
|
||||
* user.setInputMethod(inputMethod);
|
||||
* user.setOfflineRewards(offlineRewards);
|
||||
* user.setTimedRewards(timed); user.setAllTimeTotal(allTime);
|
||||
* user.setDailyTotal(dailyTotal);
|
||||
* user.setHasGottenMilestone(mileStone);
|
||||
* user.setLastVotes(lastVotes);
|
||||
* user.setMonthTotal(monthTotals);
|
||||
* user.setOfflineOtherRewards(otherRewards);
|
||||
* user.setOfflineVotes(offlineVotes); user.setPoints(points);
|
||||
* user.setVotePartyVotes(votePartyVotes);
|
||||
* user.setWeeklyTotal(weeklyTotal);
|
||||
*
|
||||
* user.setHighestDailyTotal(highestDailyTotal);
|
||||
* user.setHighestWeeklyTotal(highestWeeklyTotal);
|
||||
* user.setHighestMonthlyTotal(highestMonthlyTotal);
|
||||
* user.setDayVoteStreak(voteStreakDay);
|
||||
* user.setWeekVoteStreak(voteStreakWeek);
|
||||
* user.setMonthVoteStreak(voteStreakMonth);
|
||||
* user.setBestDayVoteStreak(bestVoteStreakDay);
|
||||
* user.setBestWeekVoteStreak(bestVoteStreakWeek);
|
||||
* user.setBestMonthVoteStreak(bestVoteStreakMonth);
|
||||
*/
|
||||
for (Entry<String, String> entry : values.entrySet()) {
|
||||
user.getData().setString(entry.getKey(), entry.getValue());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
AdvancedCoreHook.getInstance().debug(e);
|
||||
plugin.getLogger().warning("Exception occoured for '" + uuid + "': " + e.getMessage()
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.Ben12345rocks.VotingPlugin.Util.Updater;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Updater.Updater;
|
||||
@@ -58,8 +61,27 @@ public class CheckUpdate {
|
||||
break;
|
||||
}
|
||||
case UPDATE_AVAILABLE: {
|
||||
plugin.getLogger().info(plugin.getName() + " has an update available! Your Version: "
|
||||
+ plugin.getDescription().getVersion() + " New Version: " + plugin.updater.getVersion());
|
||||
plugin.getLogger()
|
||||
.info(plugin.getName() + " has an update available! Your Version: "
|
||||
+ plugin.getDescription().getVersion() + " New Version: " + plugin.updater.getVersion()
|
||||
+ " Use /av download to get the latest update!");
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void checkUpdateBasic() {
|
||||
plugin.updater = new Updater(plugin, 15358, false);
|
||||
final Updater.UpdateResult result = plugin.updater.getResult();
|
||||
switch (result) {
|
||||
case UPDATE_AVAILABLE: {
|
||||
plugin.getLogger()
|
||||
.info(plugin.getName() + " has an update available! Your Version: "
|
||||
+ plugin.getDescription().getVersion() + " New Version: " + plugin.updater.getVersion()
|
||||
+ " Use /av download to get the latest update!");
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -77,6 +99,14 @@ public class CheckUpdate {
|
||||
@Override
|
||||
public void run() {
|
||||
checkUpdate();
|
||||
new Timer().schedule(new TimerTask() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
checkUpdateBasic();
|
||||
}
|
||||
}, 1000 * 60 * 1200, 1000 * 60 * 1200);
|
||||
|
||||
}
|
||||
}, 10l);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user