Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e1d5b534b | ||
|
|
c762ef5be1 | ||
|
|
1d0f8d5c06 | ||
|
|
6129480077 | ||
|
|
f8d7c837f9 | ||
|
|
d7aba7b390 | ||
|
|
5833a1c5cc |
No files matched your search
@@ -19,6 +19,10 @@ MySQL:
|
||||
Password: ''
|
||||
# Max number of connections
|
||||
MaxConnections: 1
|
||||
# Maxium size of caching mysql
|
||||
# -1 for no limit
|
||||
# Affecting this value may affect performance
|
||||
MaxSize: -1
|
||||
|
||||
# Let players who never joined before vote
|
||||
# Recommend: False (Will prevent creating random user data files)
|
||||
@@ -353,10 +357,16 @@ GUI:
|
||||
Material: 'REDSTONE_BLOCK'
|
||||
Data: 0
|
||||
Amount: 1
|
||||
Name: '&4All Voting Sites'
|
||||
Lore:
|
||||
- '&cClick Me'
|
||||
CanVoteItem:
|
||||
Material: 'EMERALD_BLOCK'
|
||||
Data: 0
|
||||
Amount: 1
|
||||
Name: '&4All Voting Sites'
|
||||
Lore:
|
||||
- '&cClick Me'
|
||||
AlreadyVotedItem:
|
||||
Material: 'REDSTONE_BLOCK'
|
||||
Data: 0
|
||||
@@ -507,6 +517,12 @@ GUI:
|
||||
VoteGUIName: '&cVoteGUI: &c&l%player%'
|
||||
VoteRewardName: 'VoteReward'
|
||||
VoteShopName: 'VoteShop'
|
||||
|
||||
BackButton:
|
||||
Material: 'PAPER'
|
||||
Data: 0
|
||||
Amount: 1
|
||||
Name: '&8Back to VoteGUI'
|
||||
|
||||
Shop:
|
||||
# Identifier
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.Ben12345rocks</groupId>
|
||||
<artifactId>VotingPlugin</artifactId>
|
||||
<version>5.9.6</version>
|
||||
<version>5.9.7</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>VotingPlugin</name>
|
||||
<properties>
|
||||
@@ -161,7 +161,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.12.1-R0.1-SNAPSHOT</version>
|
||||
<version>1.12-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -576,6 +576,19 @@ public class CommandLoader {
|
||||
}
|
||||
});
|
||||
|
||||
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "ClearOfflineVotes" },
|
||||
"VotingPlugin.Commands.AdminVote.ClearOfflineVotes|" + adminPerm, "Clear all offline votes") {
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
for (String uuid : UserManager.getInstance().getAllUUIDs()) {
|
||||
User user = UserManager.getInstance().getVotingPluginUser(new UUID(uuid));
|
||||
user.setOfflineVotes(new ArrayList<String>());
|
||||
}
|
||||
sender.sendMessage(StringUtils.getInstance().colorize("&cCleared"));
|
||||
}
|
||||
});
|
||||
|
||||
ArrayList<CommandHandler> avCommands = com.Ben12345rocks.AdvancedCore.Commands.CommandLoader.getInstance()
|
||||
.getBasicAdminCommands("VotingPlugin");
|
||||
for (CommandHandler cmd : avCommands) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.Ben12345rocks.AdvancedCore.AdvancedCoreHook;
|
||||
@@ -192,7 +193,7 @@ public class PlayerGUIs {
|
||||
}
|
||||
|
||||
if (Config.getInstance().getGUIVoteLastBackButton()) {
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.PAPER, 1).setName("&8Back to VoteGUI")) {
|
||||
inv.addButton(new BInventoryButton(getBackButton()) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
@@ -222,7 +223,7 @@ public class PlayerGUIs {
|
||||
}
|
||||
|
||||
if (Config.getInstance().getGUIVoteNextBackButton()) {
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.PAPER, 1).setName("&8Back to VoteGUI")) {
|
||||
inv.addButton(new BInventoryButton(getBackButton()) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
@@ -296,7 +297,7 @@ public class PlayerGUIs {
|
||||
});
|
||||
|
||||
if (Config.getInstance().getGUIVoteStreakBackButton()) {
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.PAPER, 1).setName("&8Back to VoteGUI")) {
|
||||
inv.addButton(new BInventoryButton(getBackButton()) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
@@ -331,7 +332,7 @@ public class PlayerGUIs {
|
||||
}
|
||||
|
||||
if (Config.getInstance().getGUIVoteTodayBackButton()) {
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.PAPER, 1).setName("&8Back to VoteGUI")) {
|
||||
inv.addButton(new BInventoryButton(getBackButton()) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
@@ -395,7 +396,7 @@ public class PlayerGUIs {
|
||||
});
|
||||
|
||||
if (Config.getInstance().getGUIVoteTopBackButton()) {
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.PAPER, 1).setName("&8Back to VoteGUI")) {
|
||||
inv.addButton(new BInventoryButton(getBackButton()) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
@@ -446,7 +447,7 @@ public class PlayerGUIs {
|
||||
});
|
||||
|
||||
if (Config.getInstance().getGUIVoteTotalBackButton()) {
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.PAPER, 1).setName("&8Back to VoteGUI")) {
|
||||
inv.addButton(new BInventoryButton(getBackButton()) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
@@ -476,8 +477,12 @@ public class PlayerGUIs {
|
||||
builderAll = new ItemBuilder(Config.getInstance().getVoteURLCanVoteAllUrlsButtonItemSection());
|
||||
}
|
||||
|
||||
builderAll.setName("&4All Voting Sites");
|
||||
builderAll.setLore("&cClick Me");
|
||||
if (!builderAll.hasCustomDisplayName()) {
|
||||
builderAll.setName("&4All Voting Sites");
|
||||
}
|
||||
if (!builderAll.hasCustomLore()) {
|
||||
builderAll.setLore("&cClick Me");
|
||||
}
|
||||
|
||||
inv.addButton(count, new BInventoryButton(builderAll) {
|
||||
|
||||
@@ -524,7 +529,7 @@ public class PlayerGUIs {
|
||||
}
|
||||
|
||||
if (Config.getInstance().getGUIVoteURLBackButton()) {
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.PAPER, 1).setName("&8Back to VoteGUI")) {
|
||||
inv.addButton(new BInventoryButton(getBackButton()) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
@@ -573,7 +578,7 @@ public class PlayerGUIs {
|
||||
});
|
||||
|
||||
if (Config.getInstance().getGUIVoteURLBackButton()) {
|
||||
inv.addButton(new BInventoryButton(new ItemBuilder(Material.PAPER, 1).setName("&8Back to VoteGUI")) {
|
||||
inv.addButton(new BInventoryButton(getBackButton()) {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
@@ -645,4 +650,12 @@ public class PlayerGUIs {
|
||||
|
||||
inv.openInventory(player);
|
||||
}
|
||||
|
||||
public ItemBuilder getBackButton() {
|
||||
ConfigurationSection sec = Config.getInstance().getBackButton();
|
||||
if (sec != null) {
|
||||
return new ItemBuilder(sec);
|
||||
}
|
||||
return new ItemBuilder(Material.PAPER, 1).setName("&8Back to VoteGUI");
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class Config extends YMLFile {
|
||||
public boolean allowUnJoined() {
|
||||
return getData().getBoolean("AllowUnjoined");
|
||||
}
|
||||
|
||||
|
||||
public boolean getGUIVoteLastBackButton() {
|
||||
return getData().getBoolean("GUI.VoteLast.BackButton");
|
||||
}
|
||||
@@ -859,11 +859,19 @@ public class Config extends YMLFile {
|
||||
public String getMonthlyAwardRewardsPath(int pos) {
|
||||
return "MonthlyAwards." + pos + ".Rewards";
|
||||
}
|
||||
|
||||
|
||||
public boolean getAlternateUUIDLookup() {
|
||||
return getData().getBoolean("AlternateUUIDLookup");
|
||||
}
|
||||
|
||||
public int getMysqlMaxSize() {
|
||||
return getData().getInt("MySQL.MaxSize", -1);
|
||||
}
|
||||
|
||||
public ConfigurationSection getBackButton() {
|
||||
return getData().getConfigurationSection("BackButton");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the monthly awards enabled.
|
||||
*
|
||||
@@ -1391,23 +1399,23 @@ public class Config extends YMLFile {
|
||||
public boolean getGUIVoteStreakBackButton() {
|
||||
return getData().getBoolean("GUI.VoteStreak.BackButton");
|
||||
}
|
||||
|
||||
|
||||
public boolean getGUIVoteNextBackButton() {
|
||||
return getData().getBoolean("GUI.VoteNext.BackButton");
|
||||
}
|
||||
|
||||
|
||||
public boolean getGUIVoteTodayBackButton() {
|
||||
return getData().getBoolean("GUI.VoteToday.BackButton");
|
||||
}
|
||||
|
||||
|
||||
public boolean getGUIVoteTopBackButton() {
|
||||
return getData().getBoolean("GUI.VoteToday.BackButton");
|
||||
}
|
||||
|
||||
|
||||
public boolean getGUIVoteTotalBackButton() {
|
||||
return getData().getBoolean("GUI.VoteTotal.BackButton");
|
||||
}
|
||||
|
||||
|
||||
public boolean getGUIVoteURLBackButton() {
|
||||
return getData().getBoolean("GUI.VoteURL.BackButton");
|
||||
}
|
||||
|
||||
@@ -106,6 +106,7 @@ public class VotiferEvent implements Listener {
|
||||
|
||||
if (user.isOnline() || voteSite.isGiveOffline()) {
|
||||
user.playerVote(voteSite, true, false);
|
||||
user.closeInv();
|
||||
} else {
|
||||
user.addOfflineVote(voteSite.getKey());
|
||||
plugin.debug("Offline vote set for " + playerName + " on " + voteSite.getKey());
|
||||
|
||||
@@ -830,6 +830,7 @@ public class Main extends JavaPlugin {
|
||||
}
|
||||
|
||||
public void updateAdvancedCoreHook() {
|
||||
AdvancedCoreHook.getInstance().setMaxMysqlSize(Config.getInstance().getMysqlMaxSize());
|
||||
AdvancedCoreHook.getInstance().setAutoDownload(Config.getInstance().getAutoDownload());
|
||||
AdvancedCoreHook.getInstance().getJavascriptEngine().put("VotingPlugin", this);
|
||||
AdvancedCoreHook.getInstance().allowDownloadingFromSpigot(15358);
|
||||
|
||||
Reference in new issue
Block a user