Compare commits

...
15 Commits
Author SHA1 Message Date
Ben12345rocks 6e9916fcbd Update version number 2019-03-18 19:16:47 -04:00
Ben12345rocks e81c3e27bc Little fix 2019-03-09 20:50:22 -05:00
Ben12345rocks f4613cdce4 Update version number 2019-03-09 20:43:32 -05:00
Ben12345rocks 799340ce06 Added config option 2019-03-09 20:42:21 -05:00
Ben12345rocks ea1a033f2e Changes 2019-03-08 17:09:39 -05:00
Ben12345rocks dabdd8ae8f Add basic preloading 2019-03-07 20:35:45 -05:00
Ben12345rocks 3e2b7eede9 Config update 2019-03-07 18:52:12 -05:00
Ben12345rocks f941deed79 remove hardcode of vote today, closes #512 2019-03-07 18:40:44 -05:00
Ben12345rocks f601b4a134 Add debug for when user in vanish 2019-02-27 19:04:37 -05:00
Ben12345rocks 26630725bd Prevent loading plugin on 1.11 or lower 2019-02-26 18:55:13 -05:00
Ben12345rocks 7faa90ce43 Merge branch 'master' of https://github.com/Ben12345rocks/VotingPlugin 2019-02-23 19:25:15 -05:00
Ben12345rocks 4c99b6b06e Remove VotingPlugin.Player from /av givepoints 2019-02-18 17:26:25 -05:00
Ben 2f2d8278a4 Merge pull request #506 from kakd/patch-1
Minor spelling fixes in commens
2019-02-18 16:58:06 -05:00
kakd e8be2974f9 Minor spelling fixes in commens 2019-02-18 16:52:21 -05:00
Ben12345rocks 4930feff94 Add softdepend 2019-02-17 12:17:56 -05:00
8 changed files with 67 additions and 37 deletions

No files matched your search

+22 -8
View File
@@ -42,12 +42,12 @@ AllowUnjoined: false
VoteReminding:
# Enable vote reminding
# This will remind player when he can vote on all sites
# Requires VoteDelay's to be setup properly
# Requires VoteDelays to be setup properly
# Use /vote next to see when you can be reminded
# Players require the perm "VotingPlugin.Login.RemindVotes" or "VotingPlugin.Player"
Enabled: true
# Wether or t to remind only once when the player can vote
# Whether or not to remind only once when the player can vote
# Does not apply to login reminds.
RemindOnlyOnce: true
@@ -91,7 +91,7 @@ VoteReminding:
# Set Message to '' (2 ') to disable message
Commands:
# Wether or not the following commands will open GUIs rather than display text
# Whether or not the following commands will open GUIs rather than display text
UseGUI:
Today: true
TopVoter: true
@@ -224,6 +224,9 @@ Format:
- '&3Highest Week Streak: &3&l%BestWeeklyStreak%'
- '&3Highest Month Streak: &3&l%BestMonthlyStreak%'
Today:
Line: '&6%player% : %VoteSite% : %Time%'
# PlaceHolders:
# %VotesRequired% = VotesRequired
# %NeededVotes% = Number of votes needed to reach VotesRequired
@@ -282,9 +285,16 @@ Format:
# User not exist message, from commands such as /vote next (player)
UserNotExist: '&cUser does not exist: %player%'
# Text for page buttons in inventories
PrevPage: '&aPrevious Page'
NextPage: '&aNext Page'
# Prev/Next page tems in GUIs
PrevItem:
Material: 'BLACK_STAINED_GLASS_PANE'
Amount: 1
Name: '&aPrevious Page'
NextItem:
Material: 'BLACK_STAINED_GLASS_PANE'
Amount: 1
Name: '&aNext Page'
InvFull: '&cInventory full, dropping items on ground'
@@ -831,7 +841,7 @@ RequestAPI:
DefaultMethod: 'Anvil'
DisabledMethods: []
# Wether or not to log every vote to a file
# Whether or not to log every vote to a file
# Use this if you wanna track player votes
# Not recommended though
LogVotesToFile: false
@@ -905,6 +915,10 @@ LoadCommandAliases: true
# Requires AuthMe
WaitUntilLoggedIn: true
# Preload skulls to improve performance
# If false, skulls will be cached as they are used
PreloadSkulls: true
# ---------------------------------------------------------
# Mysql cache options
# Clearing cache forces the plugin to pull from database
@@ -938,4 +952,4 @@ ClearCacheOnVote: false
# Disable checking on world change
# May improve performance
#DisableCheckOnWorldChange: false
#DisableCheckOnWorldChange: false
+4
View File
@@ -4,6 +4,7 @@ main: com.Ben12345rocks.VotingPlugin.Main
description: Highly Customizable Voting Listener!
website: https://www.spigotmc.org/resources/votingplugin.15358/
author: Ben12345rocks
softdepend: [MVdWPlaceholders]
api-version: 1.13
commands:
vote:
@@ -63,6 +64,9 @@ commands:
votechoices:
description: A command
alaises: vchoices
votegivepoints:
description: A command
alaises: vgivepoints
adminvotehelp:
description: Open adminvote help
aliases: avhelp
+1 -1
View File
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.Ben12345rocks</groupId>
<artifactId>VotingPlugin</artifactId>
<version>5.18</version>
<version>5.18.2</version>
<packaging>jar</packaging>
<name>VotingPlugin</name>
<properties>
@@ -1982,31 +1982,28 @@ public class CommandLoader {
});
if (Config.getInstance().isAllowVotePointTransfers()) {
plugin.getVoteCommand()
.add(new CommandHandler(new String[] { "GivePoints", "(player)", "(number)" },
"VotingPlugin.Commands.Vote.GivePoints|" + playerPerm,
"Give someone points from your points", false) {
plugin.getVoteCommand().add(new CommandHandler(new String[] { "GivePoints", "(player)", "(number)" },
"VotingPlugin.Commands.Vote.GivePoints", "Give someone points from your points", false) {
@Override
public void execute(CommandSender sender, String[] args) {
if (Config.getInstance().isAllowVotePointTransfers()) {
User cPlayer = UserManager.getInstance().getVotingPluginUser((Player) sender);
@Override
public void execute(CommandSender sender, String[] args) {
if (Config.getInstance().isAllowVotePointTransfers()) {
User cPlayer = UserManager.getInstance().getVotingPluginUser((Player) sender);
User user = UserManager.getInstance().getVotingPluginUser(args[1]);
int pointsToGive = Integer.parseInt(args[2]);
if (cPlayer.getPoints() >= pointsToGive) {
user.addPoints(pointsToGive);
cPlayer.removePoints(pointsToGive);
sendMessage(sender,
"&c" + pointsToGive + " points given to " + user.getPlayerName());
user.sendMessage("&cYou received " + pointsToGive + " points from "
+ cPlayer.getPlayerName());
} else {
sendMessage(sender, "&cNot enough points");
}
}
User user = UserManager.getInstance().getVotingPluginUser(args[1]);
int pointsToGive = Integer.parseInt(args[2]);
if (cPlayer.getPoints() >= pointsToGive) {
user.addPoints(pointsToGive);
cPlayer.removePoints(pointsToGive);
sendMessage(sender, "&c" + pointsToGive + " points given to " + user.getPlayerName());
user.sendMessage(
"&cYou received " + pointsToGive + " points from " + cPlayer.getPlayerName());
} else {
sendMessage(sender, "&cNot enough points");
}
});
}
}
});
}
plugin.getVoteCommand().add(
@@ -888,7 +888,13 @@ public class Commands {
for (VoteSite voteSite : plugin.getVoteToday().get(user).keySet()) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(Config.getInstance().getFormatTimeFormat());
String timeString = plugin.getVoteToday().get(user).get(voteSite).format(formatter);
msg.add("&6" + user.getPlayerName() + " : " + voteSite.getKey() + " : " + timeString);
HashMap<String, String> placeholders = new HashMap<String, String>();
placeholders.put("player", user.getPlayerName());
placeholders.put("votesite", voteSite.getKey());
placeholders.put("time", timeString);
msg.add(StringUtils.getInstance()
.replacePlaceHolder(Config.getInstance().getFormatCommandsVoteTodayLine(), placeholders));
// msg.add("&6" + user.getPlayerName() + " : " + voteSite.getKey() + " : " + timeString);
}
}
msg = ArrayUtils.getInstance().colorize(msg);
@@ -267,6 +267,10 @@ public class Config extends YMLFile {
@Getter
private int formatPageSize = 10;
@ConfigDataString(path = "Format.Commands.Vote.Today.Line")
@Getter
private String formatCommandsVoteTodayLine = "&6%player% : %VoteSite% : %Time%";
/**
* Instantiates a new config.
*/
@@ -705,6 +705,14 @@ public class Main extends JavaPlugin {
public void onEnable() {
plugin = this;
// disable plugin for older versions below 1.12
if (NMSManager.getInstance().isVersion("1.7", "1.8", "1.9", "1.10", "1.11", "1.12")) {
plugin.getLogger().severe("Detected running " + NMSManager.getInstance().getVersion()
+ ", this version is not supported on this build. Disabling");
Bukkit.getPluginManager().disablePlugin(plugin);
return;
}
setupFiles();
loadVoteSites();
AdvancedCoreHook.getInstance().setJenkinsSite("ben12345rocks.com");
@@ -841,11 +849,6 @@ public class Main extends JavaPlugin {
}
}, 30l);
}
if (NMSManager.getInstance().isVersion("1.7", "1.8", "1.9", "1.10", "1.11", "1.12")) {
plugin.getLogger().severe("Detected running " + NMSManager.getInstance().getVersion()
+ ", this version is not supported on this build. Support is limited");
}
}
/**
@@ -126,6 +126,8 @@ public class VoteSite {
}
MiscUtils.getInstance().broadcast(bc, players);
} else {
plugin.debug(user.getPlayerName() + " is vanished, not broadcasting");
}
}