Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac72b47362 | ||
|
|
6ca0e26e9c | ||
|
|
168f2fbce2 | ||
|
|
a45370011e | ||
|
|
f85c97f50a | ||
|
|
1651f8b626 | ||
|
|
ad08e4cfcf | ||
|
|
91ec3456f5 | ||
|
|
4c4f0ef6ae | ||
|
|
17a899407d | ||
|
|
1a194c684d | ||
|
|
93e06e431d | ||
|
|
8fede65b79 | ||
|
|
601d23d5cc | ||
|
|
536bacb96a | ||
|
|
07b4c36490 | ||
|
|
39a86b824e | ||
|
|
204c17affc | ||
|
|
ff92dccf47 | ||
|
|
ec69a4db70 | ||
|
|
c9e0880ce9 |
No files matched your search
@@ -18,7 +18,7 @@ https://github.com/Ben12345rocks/VotingPlugin/blob/master/VotingPlugin/Resources
|
||||
</repository>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.Ben12345rocks</groupId>
|
||||
<groupId>com.github.BenCodez</groupId>
|
||||
<artifactId>VotingPlugin</artifactId>
|
||||
<version>LATEST</version>
|
||||
<scope>provided</scope>
|
||||
|
||||
@@ -288,7 +288,7 @@ Format:
|
||||
Amount: 1
|
||||
Name: '&aNext Page'
|
||||
|
||||
InvFull: '&cInventory full, dropping items on ground'
|
||||
InvFull: '&cInventory full'
|
||||
|
||||
# Display text
|
||||
# Used in /vote top (GUI)
|
||||
@@ -351,6 +351,10 @@ PointsOnVote: 1
|
||||
# Not really recommended
|
||||
AddTotals: true
|
||||
|
||||
# If true, items given for rewards are dropped on the ground
|
||||
# If false, items will be given when there is space
|
||||
DropOnFullInv: true
|
||||
|
||||
# Click sound when using gui
|
||||
# Set to none for no sound
|
||||
ClickSound:
|
||||
|
||||
@@ -276,6 +276,10 @@ CHEST:
|
||||
Permission: ''
|
||||
# Whether or not to keep GUI open after purchase
|
||||
CloseGUI: true
|
||||
# Require confirmation on purchase, overrides global option above
|
||||
RequireConfirmation: false
|
||||
# Overrides other purchase message
|
||||
#PurchaseMessage: 'Thanks for the purchase'
|
||||
# Limit how many times you can buy this
|
||||
#Limit: 3
|
||||
# Reset limit daily/weekly/monthly
|
||||
|
||||
@@ -15,6 +15,9 @@ AllSites:
|
||||
Messages:
|
||||
Player: '&aYou voted on all sites in 1 day!'
|
||||
|
||||
# NOTE: This is not a 1 time reward, that's what milestones are for!
|
||||
# If total votes (Can be changed) divided by cumulative amount
|
||||
# and as no remainder (So divides perfectly)then a reward is given
|
||||
Cumulative:
|
||||
# Number of votes required
|
||||
# Allows multiple cumulative rewards
|
||||
@@ -42,6 +45,7 @@ VoteParty:
|
||||
#IncreaseVotesRquired: 10
|
||||
# If true, players who did not vote to reach the votes required will
|
||||
# recieve the reward
|
||||
# If false, only players who voted get rewards
|
||||
GiveAllPlayers: false
|
||||
# If true, the vote count will reset each day
|
||||
ResetEachDay: false
|
||||
@@ -62,6 +66,8 @@ VoteParty:
|
||||
Commands: []
|
||||
# Rewards to give per player
|
||||
Rewards:
|
||||
# Uncomment below for online player rewards only
|
||||
#RewardType: ONLINE
|
||||
Commands:
|
||||
- say %player%
|
||||
Items:
|
||||
@@ -72,6 +78,7 @@ VoteParty:
|
||||
# Reset milestones at end of the month
|
||||
ResetMilestonesMonthly: false
|
||||
|
||||
# One time reward to be given (unless you reset it somehow)
|
||||
MileStones:
|
||||
# Number of votes required
|
||||
# Allows multiple milestones
|
||||
@@ -143,6 +150,8 @@ LoginRewards: []
|
||||
# Will queue until player logs in unless forceoffline is enabled
|
||||
LogoutRewards: []
|
||||
|
||||
EnableMonthlyAwards: true
|
||||
|
||||
# Rewards to give
|
||||
MonthlyAwards:
|
||||
# Position. 1 is first in top voter, 2 is second, etc...
|
||||
|
||||
@@ -141,9 +141,6 @@ commands:
|
||||
adminvoteClearCache:
|
||||
description: Command Alias
|
||||
aliases: avClearCache
|
||||
adminvoteConvertFrom:
|
||||
description: Command Alias
|
||||
aliases: avConvertFrom
|
||||
adminvoteServiceSites:
|
||||
description: Command Alias
|
||||
aliases: avServiceSites
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.bencodez</groupId>
|
||||
<artifactId>votingplugin</artifactId>
|
||||
<version>6.0</version>
|
||||
<artifactId>VotingPlugin</artifactId>
|
||||
<version>6.0.2</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>VotingPlugin</name>
|
||||
<properties>
|
||||
@@ -106,29 +106,29 @@
|
||||
other plugins -->
|
||||
<relocation>
|
||||
<pattern>com.bencodez.advancedcore</pattern>
|
||||
<shadedPattern>${project.groupId}.${project.artifactId}.advancedcore</shadedPattern>
|
||||
<shadedPattern>${project.groupId}.votingplugin.advancedcore</shadedPattern>
|
||||
</relocation>
|
||||
<!-- Lets relocate the shaded API so we dont cause any conflicts with
|
||||
other plugins -->
|
||||
<relocation>
|
||||
<pattern>net.pl3x.bukkit.chatapi</pattern>
|
||||
<shadedPattern>${project.groupId}.${project.artifactId}</shadedPattern>
|
||||
<shadedPattern>${project.groupId}.votingplugin</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>me.mrten.mysqlapi</pattern>
|
||||
<shadedPattern>${project.groupId}.${project.artifactId}.mysqlapi</shadedPattern>
|
||||
<shadedPattern>${project.groupId}.votingplugin.mysqlapi</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.zaxxer.HikariCP</pattern>
|
||||
<shadedPattern>${project.groupId}.${project.artifactId}.HikariCP</shadedPattern>
|
||||
<shadedPattern>${project.groupId}.votingplugin.HikariCP</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.zaxxer.hikari</pattern>
|
||||
<shadedPattern>${project.groupId}.${project.artifactId}.hikari</shadedPattern>
|
||||
<shadedPattern>${project.groupId}.votingplugin.hikari</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.slf4j.slf4j-simple</pattern>
|
||||
<shadedPattern>${project.groupId}.${project.artifactId}.slf4j-simple</shadedPattern>
|
||||
<shadedPattern>${project.groupId}.votingplugin.slf4j-simple</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.Ben12345rocks.VotingPlugin.Objects;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.bencodez.votingplugin.user.UserManager;
|
||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
||||
|
||||
@Deprecated
|
||||
public class User {
|
||||
private VotingPluginUser user;
|
||||
public User(Player p) {
|
||||
user = UserManager.getInstance().getVotingPluginUser(p);
|
||||
}
|
||||
|
||||
public int getPoints() {
|
||||
return user.getPoints();
|
||||
}
|
||||
|
||||
public void setPoints(int points) {
|
||||
user.setPoints(points);
|
||||
}
|
||||
|
||||
public void addPoints(int points) {
|
||||
user.addPoints(points);
|
||||
}
|
||||
|
||||
public boolean removePoints(int points) {
|
||||
return user.removePoints(points);
|
||||
}
|
||||
}
|
||||
@@ -47,9 +47,9 @@ public class BungeeHandler {
|
||||
plugin.getLogger().info("Using BungeeMethod: " + method.toString());
|
||||
|
||||
if (method.equals(BungeeMethod.MYSQL)) {
|
||||
plugin.registerBungeeChannels();
|
||||
plugin.registerBungeeChannels("VP:VP");
|
||||
} else if (method.equals(BungeeMethod.PLUGINMESSAGING)) {
|
||||
plugin.registerBungeeChannels();
|
||||
plugin.registerBungeeChannels("VP:VP");
|
||||
|
||||
plugin.getPluginMessaging().add(new PluginMessageHandler("Vote") {
|
||||
@Override
|
||||
|
||||
@@ -240,7 +240,7 @@ public class VotingPluginBungee extends Plugin implements net.md_5.bungee.api.pl
|
||||
method = BungeeMethod.getByName(config.getBungeeMethod());
|
||||
|
||||
if (method.equals(BungeeMethod.MYSQL)) {
|
||||
this.getProxy().registerChannel("VotingPlugin:VotingPlugin".toLowerCase());
|
||||
this.getProxy().registerChannel("VP:VP".toLowerCase());
|
||||
|
||||
} else if (method.equals(BungeeMethod.PLUGINMESSAGING)) {
|
||||
voteCacheFile = new VoteCache(this);
|
||||
@@ -352,7 +352,7 @@ public class VotingPluginBungee extends Plugin implements net.md_5.bungee.api.pl
|
||||
|
||||
@EventHandler
|
||||
public void onPluginMessage(PluginMessageEvent ev) {
|
||||
if (!ev.getTag().equals("VotingPlugin:VotingPlugin".toLowerCase())) {
|
||||
if (!ev.getTag().equals("VP:VP".toLowerCase())) {
|
||||
return;
|
||||
}
|
||||
ByteArrayInputStream instream = new ByteArrayInputStream(ev.getData());
|
||||
@@ -369,7 +369,7 @@ public class VotingPluginBungee extends Plugin implements net.md_5.bungee.api.pl
|
||||
}
|
||||
for (String send : getProxy().getServers().keySet()) {
|
||||
if (getProxy().getServers().get(send).getPlayers().size() > 0) {
|
||||
getProxy().getServers().get(send).sendData("VotingPlugin:VotingPlugin".toLowerCase(),
|
||||
getProxy().getServers().get(send).sendData("VP:VP".toLowerCase(),
|
||||
outstream.toByteArray());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1938,7 +1938,7 @@ public class CommandLoader {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
new VoteURL(plugin, sender, null, true).open();
|
||||
new VoteURL(plugin, sender, null, true).open(GUIMethod.CHAT);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ public class VoteShop extends GUIHandler {
|
||||
}
|
||||
|
||||
if (limitPass) {
|
||||
if (!plugin.getGui().isChestVoteShopRequireConfirmation()) {
|
||||
if (!plugin.getGui().isChestVoteShopRequireConfirmation(identifier)) {
|
||||
HashMap<String, String> placeholders = new HashMap<String, String>();
|
||||
placeholders.put("identifier",
|
||||
plugin.getGui().getChestShopIdentifierIdentifierName(identifier));
|
||||
@@ -119,7 +119,7 @@ public class VoteShop extends GUIHandler {
|
||||
new RewardOptions().setPlaceholders(placeholders));
|
||||
|
||||
user.sendMessage(StringParser.getInstance().replacePlaceHolder(
|
||||
plugin.getConfigFile().getFormatShopPurchaseMsg(), placeholders));
|
||||
plugin.getGui().getCHESTVoteShopPurchase(identifier), placeholders));
|
||||
if (limit > 0) {
|
||||
user.setVoteShopIdentifierLimit(identifier,
|
||||
user.getVoteShopIdentifierLimit(identifier) + 1);
|
||||
|
||||
@@ -66,7 +66,7 @@ public class VoteShopConfirm extends GUIHandler {
|
||||
new RewardOptions().setPlaceholders(placeholders));
|
||||
|
||||
user.sendMessage(StringParser.getInstance()
|
||||
.replacePlaceHolder(plugin.getConfigFile().getFormatShopPurchaseMsg(), placeholders));
|
||||
.replacePlaceHolder(plugin.getGui().getCHESTVoteShopPurchase(identifier), placeholders));
|
||||
if (limit > 0) {
|
||||
user.setVoteShopIdentifierLimit(identifier, user.getVoteShopIdentifierLimit(identifier) + 1);
|
||||
}
|
||||
|
||||
@@ -4,10 +4,8 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.bencodez.advancedcore.api.gui.GUIHandler;
|
||||
import com.bencodez.advancedcore.api.gui.GUIMethod;
|
||||
@@ -89,7 +87,7 @@ public class VoteToday extends GUIHandler {
|
||||
msg = StringParser.getInstance().replacePlaceHolder(msg, placeholders);
|
||||
ItemBuilder item = null;
|
||||
if (plugin.getGui().isChestVoteTodayUseSkull() && !NMSManager.getInstance().isVersion("1.12")) {
|
||||
item = new ItemBuilder(new ItemStack(Material.PLAYER_HEAD, 1)).setSkullOwner(player);
|
||||
item = new ItemBuilder(user.getPlayerHead());
|
||||
} else {
|
||||
item = new ItemBuilder(plugin.getGui().getChestVoteTodayPlayerItem());
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class VoteURL extends GUIHandler {
|
||||
if (user == null && player instanceof Player) {
|
||||
this.user = UserManager.getInstance().getVotingPluginUser((Player) player);
|
||||
}
|
||||
if (player.getName().equals(user.getPlayerName())) {
|
||||
if (player != null && user != null && player.getName().equals(user.getPlayerName())) {
|
||||
if (plugin.getConfigFile().isUsePrimaryAccountForPlaceholders() && user.hasPrimaryAccount()) {
|
||||
user = UserManager.getInstance().getVotingPluginUser(user.getPrimaryAccount());
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class BungeeSettings extends YMLFile {
|
||||
|
||||
@ConfigDataString(path = "BungeeMethod")
|
||||
@Getter
|
||||
private String bungeeMethod = "SOCKETS";
|
||||
private String bungeeMethod = "PLUGINMESSAGING";
|
||||
|
||||
@ConfigDataString(path = "BungeeServer.Host")
|
||||
@Getter
|
||||
|
||||
@@ -640,7 +640,7 @@ public class Config extends YMLFile {
|
||||
}
|
||||
|
||||
public boolean getLoadTopVoterDaily() {
|
||||
return getData().getBoolean("LoadTopVoter.Daily");
|
||||
return getData().getBoolean("LoadTopVoter.Daily", false);
|
||||
}
|
||||
|
||||
public boolean getLoadTopVoterMonthly() {
|
||||
@@ -648,7 +648,7 @@ public class Config extends YMLFile {
|
||||
}
|
||||
|
||||
public boolean getLoadTopVoterWeekly() {
|
||||
return getData().getBoolean("LoadTopVoter.Weekly");
|
||||
return getData().getBoolean("LoadTopVoter.Weekly", false);
|
||||
}
|
||||
|
||||
public int getPointsOnVote() {
|
||||
|
||||
@@ -143,6 +143,10 @@ public class GUI extends YMLFile {
|
||||
private boolean lastMonthGUI = false;
|
||||
|
||||
private VotingPluginMain plugin;
|
||||
|
||||
public String getCHESTVoteShopPurchase(String identifier) {
|
||||
return getData().getString("CHEST.Shop." + identifier +".PurchaseMessage", plugin.getConfigFile().getFormatShopPurchaseMsg());
|
||||
}
|
||||
|
||||
public GUI(VotingPluginMain plugin) {
|
||||
super(plugin, new File(plugin.getDataFolder(), "GUI.yml"));
|
||||
@@ -497,4 +501,9 @@ public class GUI extends YMLFile {
|
||||
public void onFileCreation() {
|
||||
plugin.saveResource("GUI.yml", true);
|
||||
}
|
||||
|
||||
public boolean isChestVoteShopRequireConfirmation(String identifier) {
|
||||
return getData().getBoolean("CHEST.Shop." + identifier + ".RequireConfirmation",
|
||||
isChestVoteShopRequireConfirmation());
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class SpecialRewardsConfig extends YMLFile {
|
||||
|
||||
@ConfigDataBoolean(path = "EnableMonthlyAwards")
|
||||
@Getter
|
||||
private boolean enableMonthlyAwards = false;
|
||||
private boolean enableMonthlyAwards = true;
|
||||
|
||||
@ConfigDataBoolean(path = "EnableWeeklyAwards")
|
||||
@Getter
|
||||
|
||||
@@ -64,8 +64,6 @@ public class PlayerVoteListener implements Listener {
|
||||
if (voteSite == null) {
|
||||
if (!plugin.getConfigFile().isDisableNoServiceSiteMessage()) {
|
||||
plugin.getLogger().warning("No voting site with the service site: '" + event.getServiceSite() + "'");
|
||||
plugin.getLogger().warning(
|
||||
"Please read here on how to fix it: https://github.com/Ben12345rocks/VotingPlugin/wiki/Common-Problems");
|
||||
|
||||
ArrayList<String> services = new ArrayList<String>();
|
||||
for (VoteSite site : plugin.getVoteSites()) {
|
||||
|
||||
@@ -60,7 +60,7 @@ public enum TopVoter {
|
||||
if (next > list.size() - 1) {
|
||||
next = 0;
|
||||
}
|
||||
return TopVoter.values()[next];
|
||||
return list.get(next);
|
||||
}
|
||||
}
|
||||
return TopVoter.AllTime;
|
||||
@@ -86,7 +86,7 @@ public enum TopVoter {
|
||||
if (prev < 0) {
|
||||
prev = list.size() - 1;
|
||||
}
|
||||
return TopVoter.values()[prev];
|
||||
return list.get(prev);
|
||||
}
|
||||
}
|
||||
return TopVoter.AllTime;
|
||||
|
||||
Reference in new issue
Block a user