Compare commits

...
11 Commits
Author SHA1 Message Date
Ben12345rocks a545462410 Update version number 2020-09-06 20:01:13 -04:00
Ben12345rocks bb7cc4d6e7 Change default config option 2020-09-05 18:24:01 -04:00
Ben12345rocks eb69cf41a5 Add config options 2020-09-05 16:22:59 -04:00
Ben12345rocks 642164b1b4 Little fix 2020-09-03 16:29:38 -04:00
Ben12345rocks ff99a462d7 Add /av user (player) ForceVoteShop (Shop) 2020-09-03 16:27:56 -04:00
Ben12345rocks e7de87e8aa Merge branch 'master' of https://github.com/Ben12345rocks/VotingPlugin 2020-09-03 15:17:46 -04:00
Ben12345rocks e5d91037cb Bug fix 2020-09-03 15:16:47 -04:00
Ben e7db5b8aa2 Merge pull request #937 from DrBot7/master
More reminding options
2020-09-03 15:13:02 -04:00
DrBot7 551c962cd2 More reminding options
With this change, players with the votingplugin.login.remindvotes.any permission will be reminded to vote as long as they can vote on any of their voting sites.
2020-09-02 23:33:39 -05:00
Ben12345rocks 5ada4e05a2 Bug fix 2020-09-01 15:22:52 -04:00
Ben12345rocks 1f3243e362 Bug fix 2020-08-31 15:10:06 -04:00
7 changed files with 47 additions and 8 deletions

No files matched your search

+7
View File
@@ -817,6 +817,13 @@ DisabledCommands: []
# Enable to true for extra player checks
ExtraBackgroundUpdate: false
# This will prevent spam clicking GUI's to prevent exploits
# Number is time in between clicking in milliseconds
SpamClickTime: 350
# Message to send when inventory forced closed when spam clicking
# Uncomment to use
#SpamClickMessage: '&cDetected spam clicking GUI, closing to prevent exploits'
# ---------------------------------------------------------
# Mysql cache options
# Clearing cache forces the plugin to pull from database
-3
View File
@@ -195,9 +195,6 @@ commands:
adminvoteForceVoteParty:
description: Command Alias
aliases: avForceVoteParty
adminvoteUserEditValue:
description: Command Alias
aliases: avUserEditValue
adminvoteSetRequestMethod:
description: Command Alias
aliases: avSetRequestMethod
+1 -1
View File
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.Ben12345rocks</groupId>
<artifactId>VotingPlugin</artifactId>
<version>5.23.2</version>
<version>5.23.3</version>
<packaging>jar</packaging>
<name>VotingPlugin</name>
<properties>
@@ -1125,6 +1125,19 @@ public class CommandLoader {
}
});
plugin.getAdminVoteCommand()
.add(new CommandHandler(new String[] { "User", "(player)", "ForceVoteShop", "(VoteShop)" },
"VotingPlugin.Commands.AdminVote.ForceVoteShop|" + adminPerm, "Force a voteshop reward") {
@Override
public void execute(CommandSender sender, String[] args) {
User user = UserManager.getInstance().getVotingPluginUser(args[1]);
RewardHandler.getInstance().giveReward(user, Config.getInstance().getData(),
Config.getInstance().getIdentifierRewardsPath(args[3]), new RewardOptions());
sendMessage(sender, "&cVoteShop " + args[3] + " forced");
}
});
plugin.getAdminVoteCommand()
.add(new CommandHandler(new String[] { "User", "(player)", "ForceMilestone", "(Number)" },
"VotingPlugin.Commands.AdminVote.ForceMilestone|" + adminPerm, "Force a milestone") {
@@ -1343,7 +1356,8 @@ public class CommandLoader {
Player player = event.getWhoClicked();
String playerName = (String) event.getMeta(player, "Player");
BInventory inv = new BInventory("MileStones: " + playerName);
for (String mileStoneName : SpecialRewardsConfig.getInstance().getMilestoneVotes()) {
for (String mileStoneName : SpecialRewardsConfig.getInstance()
.getMilestoneVotes()) {
if (StringParser.getInstance().isInt(mileStoneName)) {
int mileStone = Integer.parseInt(mileStoneName);
@@ -1430,6 +1444,22 @@ public class CommandLoader {
public void updateReplacements() {
}
});
TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(VoteShop)", sites) {
@Override
public void reload() {
ArrayList<String> sites = new ArrayList<String>();
for (String str : Config.getInstance().getIdentifiers()) {
sites.add(str);
}
setReplace(sites);
}
@Override
public void updateReplacements() {
}
});
}
/**
@@ -2251,7 +2281,7 @@ public class CommandLoader {
User user = UserManager.getInstance().getVotingPluginUser((Player) sender);
user.sendMessage(Commands.getInstance().voteURLs(user, true));
} else {
sender.sendMessage(Commands.getInstance().voteURLs(null, true));
sender.sendMessage(Commands.getInstance().voteURLs(null, false));
}
}
});
@@ -205,12 +205,13 @@ public class VoteParty implements Listener {
}
if (SpecialRewardsConfig.getInstance().getVotePartyGiveAllPlayers()) {
plugin.debug("Giving all players vote party");
plugin.debug("Trying to give all players vote party");
for (String uuid : UserManager.getInstance().getAllUUIDs()) {
User user = UserManager.getInstance().getVotingPluginUser(new UUID(uuid));
giveReward(user);
}
} else {
plugin.debug("Trying to give all online players vote party");
plugin.debug(ArrayUtils.getInstance().makeStringList(getVotedUsers()));
for (String uuid : getVotedUsers()) {
User user = UserManager.getInstance().getVotingPluginUser(new UUID(uuid));
@@ -58,7 +58,7 @@ public class VoteReminding {
if (PlayerUtils.getInstance().hasServerPermission(playerName, "VotingPlugin.Login.RemindVotes")
|| PlayerUtils.getInstance().hasServerPermission(playerName, "VotingPlugin.Player")) {
if (user.canVoteAll()) {
if (user.canVoteAll() || (user.canVoteAny() && user.hasPermission("VotingPlugin.Login.RemindVotes.Any"))) {
Player player = Bukkit.getPlayer(playerName);
if (player != null) {
if (!Config.getInstance().getVoteRemindingRemindOnlyOnce()) {
@@ -319,6 +319,10 @@ public class Bungee extends Plugin implements net.md_5.bungee.api.plugin.Listene
}
public void vote(String player, String service, boolean realVote) {
if (player == null || player.isEmpty()) {
getLogger().info("No name from vote on " + service);
return;
}
if (method.equals(BungeeMethod.SOCKETS)) {
sendSocketVote(player, service);
} else if (method.equals(BungeeMethod.PLUGINMESSAGING)) {