forked from upstream/VotingPlugin
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3473174de | ||
|
|
5b853b9ad4 | ||
|
|
3b3578fa87 | ||
|
|
6bf079068b | ||
|
|
2a889ff2ce | ||
|
|
de9c9185f3 | ||
|
|
07c4534d10 | ||
|
|
b3462bebe6 | ||
|
|
5525a378ae | ||
|
|
bb8588e144 | ||
|
|
8abd596172 | ||
|
|
df93655db3 | ||
|
|
f1f97a8908 | ||
|
|
65fe355d6d | ||
|
|
7cd5954cd2 |
No files matched your search
@@ -115,6 +115,7 @@ Format:
|
||||
HelpLine: '&3&l%Command% - &3%HelpMessage%'
|
||||
|
||||
# Broadcast vote message
|
||||
# Set to an empty message to disable
|
||||
BroadcastMsg: '&6[&4Broadcast&6] &2Thanks &c%player% &2for voting on %SiteName%'
|
||||
|
||||
# Broadcast only when player is online
|
||||
@@ -688,6 +689,9 @@ TopVoterIgnorePermission: false
|
||||
# Valid Options: AllTime, Monthly, Weekly, Daily
|
||||
VoteTopDefault: Monthly
|
||||
|
||||
# Whether or not to have ties on top voter rewards
|
||||
TopVoterAwardsTies: true
|
||||
|
||||
# These are required to be enabled in order for top voter awards to work
|
||||
LoadTopVoter:
|
||||
AllTime: true
|
||||
|
||||
@@ -183,6 +183,21 @@ commands:
|
||||
adminvoteplayername:
|
||||
description: Command Alias
|
||||
aliases: avplayername
|
||||
adminvoteResyncMilestones:
|
||||
description: Command Alias
|
||||
aliases: avResyncMilestones
|
||||
adminvoteClearOfflineRewards:
|
||||
description: Command Alias
|
||||
aliases: avClearOfflineRewards
|
||||
adminvoteUserRemove:
|
||||
description: Command Alias
|
||||
aliases: avUserRemove
|
||||
adminvotePurge:
|
||||
description: Command Alias
|
||||
aliases: avPurge
|
||||
adminvoteJavascript:
|
||||
description: Command Alias
|
||||
aliases: avJavascript
|
||||
permissions:
|
||||
VotingPlugin.Player:
|
||||
description: Allows basic access player commands
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.Ben12345rocks</groupId>
|
||||
<artifactId>VotingPlugin</artifactId>
|
||||
<version>5.12.2</version>
|
||||
<version>5.12.5</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>VotingPlugin</name>
|
||||
<properties>
|
||||
|
||||
@@ -225,6 +225,21 @@ public class CommandLoader {
|
||||
}
|
||||
});
|
||||
|
||||
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "ResyncMilestones" },
|
||||
"VotingPlugin.Commands.AdminVote.SetResyncMilestones|" + adminPerm, "Resync Milestones") {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
sendMessage(sender, "&cStarting...");
|
||||
for (String uuid : UserManager.getInstance().getAllUUIDs()) {
|
||||
User user = UserManager.getInstance().getVotingPluginUser(new UUID(uuid));
|
||||
user.setMilestoneCount(user.getAllTimeTotal());
|
||||
}
|
||||
sendMessage(sender, "&cFinished");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "AddPoints", "(player)", "(number)" },
|
||||
"VotingPlugin.Commands.AdminVote.AddPoints|" + adminPerm, "Add to players voting points") {
|
||||
|
||||
|
||||
@@ -387,7 +387,7 @@ public class PlayerGUIs {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent clickEvent) {
|
||||
//ItemBuilder item = new ItemBuilder(clickEvent.getClickedItem());
|
||||
// ItemBuilder item = new ItemBuilder(clickEvent.getClickedItem());
|
||||
// String name = ChatColor.stripColor(item.getName()).split(":")[1].trim();
|
||||
String name = (String) clickEvent.getButton().getData("player");
|
||||
|
||||
@@ -518,7 +518,6 @@ public class PlayerGUIs {
|
||||
|
||||
for (VoteSite voteSite : plugin.getVoteSites()) {
|
||||
ItemBuilder builder = new ItemBuilder(Config.getInstance().getVoteURLAlreadyVotedItemSection());
|
||||
|
||||
if (user.canVoteSite(voteSite)) {
|
||||
builder = new ItemBuilder(Config.getInstance().getVoteURLCanVoteItemSection());
|
||||
} else {
|
||||
|
||||
@@ -1482,4 +1482,8 @@ public class Config extends YMLFile {
|
||||
return getData().getBoolean("ClearCacheOnVote");
|
||||
}
|
||||
|
||||
public boolean getTopVoterAwardsTies() {
|
||||
return getData().getBoolean("TopVoterAwardsTies", true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class VotiferEvent implements Listener {
|
||||
services.add(site.getServiceSite());
|
||||
}
|
||||
plugin.getLogger()
|
||||
.warning("Current service sites: " + ArrayUtils.getInstance().makeStringList(services));
|
||||
.warning("Current known service sites: " + ArrayUtils.getInstance().makeStringList(services));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -151,7 +151,14 @@ public class VotiferEvent implements Listener {
|
||||
Vote vote = event.getVote();
|
||||
final String voteSite = vote.getServiceName();
|
||||
final String voteUsername = vote.getUsername().trim();
|
||||
ServerData.getInstance().addServiceSite(voteSite);
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ServerData.getInstance().addServiceSite(voteSite);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (voteUsername.length() == 0) {
|
||||
plugin.getLogger().warning("No name from vote on " + voteSite);
|
||||
|
||||
@@ -29,13 +29,11 @@ import com.Ben12345rocks.AdvancedCore.Objects.CommandHandler;
|
||||
import com.Ben12345rocks.AdvancedCore.Objects.RewardHandler;
|
||||
import com.Ben12345rocks.AdvancedCore.Objects.UUID;
|
||||
import com.Ben12345rocks.AdvancedCore.Objects.UserStorage;
|
||||
import com.Ben12345rocks.AdvancedCore.Thread.Thread;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Javascript.JavascriptPlaceholderRequest;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Logger.Logger;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Metrics.BStatsMetrics;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Metrics.MCStatsMetrics;
|
||||
import com.Ben12345rocks.AdvancedCore.Util.Updater.Updater;
|
||||
import com.Ben12345rocks.AdvancedCore.mysql.MySQL;
|
||||
import com.Ben12345rocks.VotingPlugin.Commands.CommandLoader;
|
||||
import com.Ben12345rocks.VotingPlugin.Commands.Commands;
|
||||
import com.Ben12345rocks.VotingPlugin.Commands.Executers.CommandAdminVote;
|
||||
@@ -131,7 +129,7 @@ public class Main extends JavaPlugin {
|
||||
}
|
||||
UserStorage cur = AdvancedCoreHook.getInstance().getStorageType();
|
||||
AdvancedCoreHook.getInstance().setStorageType(from);
|
||||
loadMySQL();
|
||||
AdvancedCoreHook.getInstance().reload();
|
||||
HashMap<User, HashMap<String, String>> data = new HashMap<User, HashMap<String, String>>();
|
||||
for (String uuid : UserManager.getInstance().getAllUUIDs()) {
|
||||
try {
|
||||
@@ -153,7 +151,7 @@ public class Main extends JavaPlugin {
|
||||
plugin.getLogger().info("Finished getting data from " + from.toString());
|
||||
|
||||
AdvancedCoreHook.getInstance().setStorageType(to);
|
||||
loadMySQL();
|
||||
AdvancedCoreHook.getInstance().reload();
|
||||
|
||||
for (Entry<User, HashMap<String, String>> entry : data.entrySet()) {
|
||||
try {
|
||||
@@ -167,6 +165,7 @@ public class Main extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
AdvancedCoreHook.getInstance().setStorageType(cur);
|
||||
AdvancedCoreHook.getInstance().reload();
|
||||
|
||||
plugin.getLogger().info("Finished convertting");
|
||||
}
|
||||
@@ -271,22 +270,8 @@ public class Main extends JavaPlugin {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void loadMySQL() {
|
||||
if (AdvancedCoreHook.getInstance().getStorageType().equals(UserStorage.MYSQL)) {
|
||||
Thread.getInstance().run(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
AdvancedCoreHook.getInstance()
|
||||
.setMysql(new MySQL("VotingPlugin_Users", Config.getInstance().getMySql()));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void loadTimer() {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -298,7 +283,7 @@ public class Main extends JavaPlugin {
|
||||
}
|
||||
}, 1000, 1000 * 60 * Config.getInstance().getDelayBetweenUpdates());
|
||||
}
|
||||
});
|
||||
}, 40L);
|
||||
|
||||
}
|
||||
|
||||
@@ -534,7 +519,7 @@ public class Main extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return Config.getInstance().getDataStorage();
|
||||
return Config.getInstance().getDataStorage().toUpperCase();
|
||||
}
|
||||
});
|
||||
metrics.addCustomChart(new BStatsMetrics.SimplePie("DisableCheckOnWorldChange") {
|
||||
@@ -844,6 +829,7 @@ public class Main extends JavaPlugin {
|
||||
configVoteSites.reloadData();
|
||||
updateAdvancedCoreHook();
|
||||
plugin.loadVoteSites();
|
||||
AdvancedCoreHook.getInstance().setConfigData(Config.getInstance().getData());
|
||||
AdvancedCoreHook.getInstance().reload();
|
||||
// loadTimer();
|
||||
|
||||
@@ -948,32 +934,9 @@ public class Main extends JavaPlugin {
|
||||
}
|
||||
|
||||
public void updateAdvancedCoreHook() {
|
||||
AdvancedCoreHook.getInstance().setAutoDownload(Config.getInstance().getAutoDownload());
|
||||
AdvancedCoreHook.getInstance().getJavascriptEngine().put("VotingPlugin", this);
|
||||
AdvancedCoreHook.getInstance().allowDownloadingFromSpigot(15358);
|
||||
AdvancedCoreHook.getInstance().setExtraDebug(Config.getInstance().getExtraDebug());
|
||||
AdvancedCoreHook.getInstance().setStorageType(UserStorage.value(Config.getInstance().getDataStorage()));
|
||||
loadMySQL();
|
||||
|
||||
AdvancedCoreHook.getInstance()
|
||||
.setDisableCheckOnWorldChange(Config.getInstance().getDisableCheckOnWorldChange());
|
||||
AdvancedCoreHook.getInstance().setDebug(Config.getInstance().getDebugEnabled());
|
||||
AdvancedCoreHook.getInstance().setDebugIngame(Config.getInstance().getDebugInfoIngame());
|
||||
AdvancedCoreHook.getInstance().setDefaultRequestMethod(Config.getInstance().getRequestAPIDefaultMethod());
|
||||
AdvancedCoreHook.getInstance().setDisabledRequestMethods(Config.getInstance().getRequestAPIDisabledMethods());
|
||||
AdvancedCoreHook.getInstance().setFormatNoPerms(Config.getInstance().getFormatNoPerms());
|
||||
AdvancedCoreHook.getInstance().setFormatNotNumber(Config.getInstance().getFormatNotNumber());
|
||||
AdvancedCoreHook.getInstance().setHelpLine(Config.getInstance().getFormatHelpLine());
|
||||
AdvancedCoreHook.getInstance().setLogDebugToFile(Config.getInstance().getLogDebugToFile());
|
||||
AdvancedCoreHook.getInstance().setSendScoreboards(Config.getInstance().getSendScoreboards());
|
||||
AdvancedCoreHook.getInstance().setAlternateUUIDLookUp(Config.getInstance().getAlternateUUIDLookup());
|
||||
AdvancedCoreHook.getInstance().setAutoKillInvs(Config.getInstance().getAutoKillInvs());
|
||||
AdvancedCoreHook.getInstance().setPrevPageTxt(Config.getInstance().getFormatPrevPage());
|
||||
AdvancedCoreHook.getInstance().setNextPageTxt(Config.getInstance().getFormatNextPage());
|
||||
|
||||
AdvancedCoreHook.getInstance().setPurgeOldData(Config.getInstance().getPurgeOldData());
|
||||
AdvancedCoreHook.getInstance().setPurgeMinimumDays(Config.getInstance().getPurgeMin());
|
||||
AdvancedCoreHook.getInstance().setCheckNameMojang(Config.getInstance().getCheckNameMojang());
|
||||
AdvancedCoreHook.getInstance().setConfigData(Config.getInstance().getData());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -116,7 +116,11 @@ public class TopVoterHandler implements Listener {
|
||||
int lastTotal = -1;
|
||||
for (User user : plugin.topVoterDaily.keySet()) {
|
||||
if (!Config.getInstance().getTopVoterIgnorePermission() || !user.isTopVoterIgnore()) {
|
||||
if (user.getDailyTotal() != lastTotal) {
|
||||
if (Config.getInstance().getTopVoterAwardsTies()) {
|
||||
if (user.getDailyTotal() != lastTotal) {
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
if (places.contains(Integer.toString(i))) {
|
||||
@@ -158,7 +162,11 @@ public class TopVoterHandler implements Listener {
|
||||
for (User user : plugin.topVoterMonthly.keySet()) {
|
||||
|
||||
if (!Config.getInstance().getTopVoterIgnorePermission() || !user.isTopVoterIgnore()) {
|
||||
if (user.getMonthTotal() != lastTotal) {
|
||||
if (Config.getInstance().getTopVoterAwardsTies()) {
|
||||
if (user.getMonthTotal() != lastTotal) {
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
if (places.contains(Integer.toString(i))) {
|
||||
@@ -208,7 +216,11 @@ public class TopVoterHandler implements Listener {
|
||||
int lastTotal = -1;
|
||||
for (User user : plugin.topVoterWeekly.keySet()) {
|
||||
if (!Config.getInstance().getTopVoterIgnorePermission() || !user.isTopVoterIgnore()) {
|
||||
if (user.getWeeklyTotal() != lastTotal) {
|
||||
if (Config.getInstance().getTopVoterAwardsTies()) {
|
||||
if (user.getWeeklyTotal() != lastTotal) {
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
if (places.contains(Integer.toString(i))) {
|
||||
|
||||
Reference in new issue
Block a user