Compare commits

...
2253 Commits
Author SHA1 Message Date
BenCodez fe277d8bfd Update version number to 6.16 2024-05-05 13:30:18 -04:00
BenCodez 86cba23568 Add lastmonth position placeholder 2024-05-01 20:17:42 -04:00
BenCodez 5a6140020f Merge branch 'master' of https://github.com/BenCodez/VotingPlugin 2024-05-01 16:15:13 -04:00
BenCodez cb203edecf Update to 1.20.6 2024-04-30 21:13:21 -04:00
Ben 5510e3bb98 Merge pull request #1350 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-shade-plugin-3.5.3
Bump org.apache.maven.plugins:maven-shade-plugin from 3.5.2 to 3.5.3 in /VotingPlugin
2024-04-29 16:07:56 -04:00
dependabot[bot] 470c52e6e3 Bump org.apache.maven.plugins:maven-shade-plugin in /VotingPlugin
Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.5.2...maven-shade-plugin-3.5.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-shade-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-29 06:53:18 +00:00
BenCodez 03e4c2165e Fix command casing 2024-04-28 14:50:10 -04:00
BenCodez 45d617106b Fix issues with command aliases not always working 2024-04-28 14:09:48 -04:00
BenCodez 58869742bc Update to 1.20.5 2024-04-23 19:34:57 -04:00
Ben a8841ca732 Merge pull request #1348 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-jar-plugin-3.4.1
Bump org.apache.maven.plugins:maven-jar-plugin from 3.4.0 to 3.4.1 in /VotingPlugin
2024-04-22 16:50:25 -04:00
dependabot[bot] 96ef82aef0 Bump org.apache.maven.plugins:maven-jar-plugin in /VotingPlugin
Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.4.0...maven-jar-plugin-3.4.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-jar-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-22 06:44:29 +00:00
BenCodez 5a33b5b892 Changes to almostallsites rewards trigger 2024-04-18 16:57:50 -04:00
Ben ed2fb77a7b Merge pull request #1347 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-jar-plugin-3.4.0
Bump org.apache.maven.plugins:maven-jar-plugin from 3.3.0 to 3.4.0 in /VotingPlugin
2024-04-15 16:42:58 -04:00
dependabot[bot] 8a1c820e42 Bump org.apache.maven.plugins:maven-jar-plugin in /VotingPlugin
Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.3.0...maven-jar-plugin-3.4.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-jar-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-15 06:39:42 +00:00
BenCodez 43c5419453 Add additional debug for almostallsites reward 2024-04-14 14:14:51 -04:00
BenCodez 4f2caf67d0 Fix issue with conditional items and rewards in VoteGUI 2024-04-13 08:22:09 -04:00
BenCodez 8b17e43ce0 Adjustments to getting votesites 2024-04-10 20:24:39 -04:00
BenCodez 05db0b189b Add /av correctservicesites command 2024-04-09 20:48:25 -04:00
BenCodez 93f91923bb Slightly adjust vote next time caculations for votedailydaily sites 2024-04-09 17:09:09 -04:00
BenCodez 6dca3ad152 Slight change vote next time caculation 2024-04-07 13:14:59 -04:00
BenCodez 637db5afdb Changes to placeholders 2024-04-06 20:03:14 -04:00
BenCodez 029fa00e3a Fix typo 2024-04-06 19:46:11 -04:00
BenCodez e1bb95c482 Use only enabled votesites for monthly total 2024-04-06 15:58:17 -04:00
BenCodez 667b1b082d change log message to debug 2024-03-29 14:11:09 -04:00
BenCodez 2097fc4b86 Add new advanced service site handling feature, experimental 2024-03-28 20:53:29 -04:00
Ben 49d20c0bc8 Merge pull request #1341 from BenCodez/dependabot/maven/VotingPlugin/org.projectlombok-lombok-1.18.32
Bump org.projectlombok:lombok from 1.18.30 to 1.18.32 in /VotingPlugin
2024-03-25 16:47:05 -04:00
dependabot[bot] fe2ac4f02c Bump org.projectlombok:lombok from 1.18.30 to 1.18.32 in /VotingPlugin
Bumps [org.projectlombok:lombok](https://github.com/projectlombok/lombok) from 1.18.30 to 1.18.32.
- [Changelog](https://github.com/projectlombok/lombok/blob/master/doc/changelog.markdown)
- [Commits](https://github.com/projectlombok/lombok/compare/v1.18.30...v1.18.32)

---
updated-dependencies:
- dependency-name: org.projectlombok:lombok
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-25 06:29:20 +00:00
BenCodez 4859c37ef8 Fix status command on velocity not working 2024-03-23 22:13:28 -04:00
BenCodez c818007426 Fix issue with multi-proxy redis on velocity 2024-03-23 20:48:31 -04:00
Ben c86f07aeb6 Create FUNDING.yml 2024-03-22 16:57:09 -04:00
BenCodez 0a74e338c2 More fixes for cooldown events 2024-03-19 21:15:04 -04:00
BenCodez d1dc8b392f Added neededvotes placeholder to broadcast 2024-03-17 17:35:02 -04:00
BenCodez bd5234b479 Adjustments to vote delay daily can vote caculations 2024-03-16 14:58:04 -04:00
BenCodez cca9e3dc58 Added votesrequired placeholder to broadcasts 2024-03-16 08:38:52 -04:00
BenCodez c3df294ce6 Changes for vote delay daily sites issues 2024-03-15 17:04:15 -04:00
BenCodez d81a113240 More changes to cooldown events 2024-03-12 20:45:36 -04:00
BenCodez f2feafa45a Changes to cooldown checks 2024-03-12 20:37:58 -04:00
BenCodez f63a743c2c Change default displayitem material on auto generated votesites 2024-03-09 19:51:12 -05:00
BenCodez 2d9c6482fc Add placeholders for time until month and week changes 2024-03-09 19:46:18 -05:00
BenCodez 448a9eeea9 Add placeholderapi placeholder %votingplugin_sitesavailable% 2024-03-08 18:48:52 -05:00
BenCodez c8e32696af Adjustments to cooldown checks 2024-03-06 20:49:56 -05:00
BenCodez 36eb6eafb3 Add votedelay and votehour placeholders 2024-03-05 19:03:05 -05:00
BenCodez 040fafe33a Add better handling of more than 2 proxies in multi-proxy setup 2024-03-03 14:43:13 -05:00
BenCodez 040e467761 Fix issue with new placeholder not always working 2024-02-29 19:08:01 -05:00
BenCodez e0d28be260 Fix typo in debug 2024-02-28 19:33:57 -05:00
BenCodez 1ef2440bf9 Add more placeholders to VoteURL GUI 2024-02-28 19:07:25 -05:00
Ben 2a5d5d3bea Merge pull request #1336 from Melon-Oof/master
Update BungeeSettings.yml
2024-02-27 16:39:55 -05:00
Melon-Oof 419153d654 Update BungeeSettings.yml 2024-02-27 17:14:21 +01:00
Ben ed8c504c27 Merge pull request #1335 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-shade-plugin-3.5.2
Bump org.apache.maven.plugins:maven-shade-plugin from 3.5.1 to 3.5.2 in /VotingPlugin
2024-02-26 16:47:58 -05:00
dependabot[bot] 2c29f11a8b Bump org.apache.maven.plugins:maven-shade-plugin in /VotingPlugin
Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.5.1...maven-shade-plugin-3.5.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-shade-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 06:30:21 +00:00
BenCodez c442cd1deb Add ability to set prefix for redis channels 2024-02-23 20:46:03 -05:00
BenCodez 770e3e866c First implementation of multi-proxy redis 2024-02-23 20:30:32 -05:00
BenCodez 4014046444 Save vote cache file more often on proxy 2024-02-21 19:11:16 -05:00
BenCodez 6f378297dd Recode of multi-proxy backend for prep of redis multi-proxy 2024-02-18 20:24:05 -05:00
BenCodez 1c5c33be6a Update version number to 6.15.1 2024-02-17 20:33:16 -05:00
BenCodez 206665a40b Fix rare ConcurrentModificationException 2024-02-17 15:03:39 -05:00
BenCodez 159eb54e4e Fixed issue with used percentage for vote streaks not working 2024-02-11 13:43:15 -05:00
BenCodez f63ab7b693 Added more debug to votestreak 2024-02-10 08:07:16 -05:00
BenCodez 97e5f73774 Add new merge command to combine user totals 2024-02-05 20:30:57 -05:00
BenCodez 9f85149776 Add players to non voted cache before checking if they are online 2024-02-03 21:34:02 -05:00
BenCodez d6fa68dead Force mutli-proxy login message regardless of allowunjoined setting 2024-02-03 19:12:40 -05:00
BenCodez 5e42fdbfbe Fix remove offline uuids command 2024-02-02 20:25:24 -05:00
BenCodez 9b20d1754b Changes to rmeoveofflineuuids command 2024-02-02 19:50:49 -05:00
BenCodez d310fa3688 Add command to remove offline uuids from database 2024-02-02 19:33:43 -05:00
Ben 7ab3e8040c Merge pull request #1330 from NahuLD/patch-1
Fix issue with RedisHandler initialization utilizing wrong parameters
2024-02-02 10:10:09 -05:00
Nahuel Dolores 5173c24546 Fix issue with RedisHandler initialization utilizing wrong parameters 2024-02-02 10:21:03 -03:00
BenCodez 0c1cccfdcd Save reminds on toggle reminders command 2024-01-31 20:57:05 -05:00
BenCodez d36cd47597 Fix default config for vote reminding comments 2024-01-28 16:42:18 -05:00
BenCodez 6f34d11138 Add extra checks for milestones on proxy setups 2024-01-28 13:53:12 -05:00
Ben bf3f7bb6ad Merge pull request #1328 from BenCodez/dependabot/maven/VotingPlugin/net.md-5-bungeecord-api-1.20-R0.2
Bump net.md-5:bungeecord-api from 1.20-R0.1 to 1.20-R0.2 in /VotingPlugin
2024-01-22 16:51:53 -05:00
dependabot[bot] 28f74aa50a Bump net.md-5:bungeecord-api in /VotingPlugin
Bumps [net.md-5:bungeecord-api](https://github.com/SpigotMC/BungeeCord) from 1.20-R0.1 to 1.20-R0.2.
- [Commits](https://github.com/SpigotMC/BungeeCord/commits)

---
updated-dependencies:
- dependency-name: net.md-5:bungeecord-api
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 06:47:54 +00:00
BenCodez dc3c605315 Bypass fake votes for WaitUntilVoteDelay 2023-12-31 15:22:44 -05:00
BenCodez 5abc8004c7 Add option to reset extra votes required weekly 2023-12-31 13:43:24 -05:00
BenCodez bf1e971edd Add bypass permission for waituntilvotedelay 2023-12-31 12:55:30 -05:00
BenCodez 37c767dc74 Update version number to 6.15 2023-12-26 10:25:49 -05:00
BenCodez 8257b4f7f6 Add option to not hide voteshop item with no permission 2023-12-16 19:47:13 -05:00
BenCodez 0340f4512e Handle multi-proxy logins on velocity like bungee 2023-12-16 19:16:16 -05:00
BenCodez c45ce0d090 Fix a minor issue on velocity for redis 2023-12-13 19:58:14 -05:00
BenCodez add3dcaa26 Initial implementation of redis bungee method 2023-12-13 19:56:44 -05:00
BenCodez 4a88b10e61 Fix gotten milestones not resetting if per server milestones enabled 2023-12-12 17:55:32 -05:00
BenCodez 7001d0f7fc Update to 1.20.3 2023-12-05 19:04:31 -05:00
Ben fdf72b14eb Merge pull request #1318 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-javadoc-plugin-3.6.3
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.2 to 3.6.3 in /VotingPlugin
2023-12-04 17:36:45 -05:00
dependabot[bot] 830de0388a Bump org.apache.maven.plugins:maven-javadoc-plugin in /VotingPlugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.2 to 3.6.3.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.2...maven-javadoc-plugin-3.6.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-04 06:52:55 +00:00
BenCodez 4a77c6bdd3 Add DisableReminders placeholder 2023-12-02 20:32:06 -05:00
BenCodez 579844f193 Save vote reminding toggles across restarts 2023-12-01 21:34:06 -05:00
BenCodez 4c6073c02a Add checks to matching server name in BungeeSettings.yml 2023-12-01 20:23:21 -05:00
Ben b1eb591e20 Merge pull request #1315 from NotAlexNoyle/master
Apply license to project root
2023-11-24 17:47:03 -05:00
NotAlexNoyle f5ee776586 Apply license to project root 2023-11-24 21:26:07 +01:00
BenCodez a2bf7c3dfc Update version number to 6.14.2 2023-11-19 19:07:25 -05:00
BenCodez 0543a91c5a Remove deprecated api 2023-11-17 18:34:36 -05:00
Ben d88868c4f7 Merge pull request #1312 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-javadoc-plugin-3.6.2
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.0 to 3.6.2 in /VotingPlugin
2023-11-13 18:30:35 -05:00
dependabot[bot] 86dc52f131 Bump org.apache.maven.plugins:maven-javadoc-plugin in /VotingPlugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.0 to 3.6.2.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.0...maven-javadoc-plugin-3.6.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-13 06:24:14 +00:00
BenCodez f7d88a26ef Handle allowunjoined disabled on multi-proxy setup 2023-11-05 20:16:52 -05:00
BenCodez ab1468d03a Changes to bedrock player support 2023-10-30 20:01:24 -04:00
Ben 3c65365b83 Merge pull request #1311 from BenCodez/dependabot/maven/VotingPlugin/me.clip-placeholderapi-2.11.5
Bump me.clip:placeholderapi from 2.11.4 to 2.11.5 in /VotingPlugin
2023-10-30 17:38:13 -04:00
dependabot[bot] bfefbb59d6 Bump me.clip:placeholderapi from 2.11.4 to 2.11.5 in /VotingPlugin
Bumps me.clip:placeholderapi from 2.11.4 to 2.11.5.

---
updated-dependencies:
- dependency-name: me.clip:placeholderapi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-30 06:06:35 +00:00
BenCodez 9d74b5e428 Changes to handling ignoring bungee time change votes 2023-10-23 19:42:16 -04:00
BenCodez f131ce948c Force update placeholders on every vote to prevent issues 2023-10-22 12:45:09 -04:00
BenCodez 1a78a23e7c Shorten shutdown time 2023-10-17 16:52:35 -04:00
BenCodez 16cdfec4d5 Add player placeholder to vote reminder broadcast for voteparty 2023-10-13 16:49:45 -04:00
BenCodez 243300534c Add vote reminder broadcasts to vote party, WIP 2023-10-12 20:04:02 -04:00
BenCodez ea646b8e6f Ignore daily total for max amount of votes per day option 2023-10-08 12:34:07 -04:00
BenCodez bd5532aa71 Add vote limit feature to proxy setup 2023-10-05 20:55:20 -04:00
BenCodez be033793c2 Changes to limit monthly votes 2023-10-04 16:50:10 -04:00
BenCodez 28ce76bc60 Allow limit monthly votes to work on PLUGINMESSAGING 2023-10-01 16:36:10 -04:00
BenCodez 10732ee978 Limit monthly votes each day instead of at the end of the month 2023-10-01 13:54:05 -04:00
BenCodez 7deccf2e26 Minor changes to voteparty on proxy setup 2023-09-26 16:50:28 -04:00
Ben 8873fc8263 Merge pull request #1302 from BenCodez/dependabot/maven/VotingPlugin/me.clip-placeholderapi-2.11.4
Bump me.clip:placeholderapi from 2.11.3 to 2.11.4 in /VotingPlugin
2023-09-25 16:45:05 -04:00
Ben aaaaf2c670 Merge pull request #1303 from BenCodez/dependabot/maven/VotingPlugin/org.projectlombok-lombok-1.18.30
Bump org.projectlombok:lombok from 1.18.28 to 1.18.30 in /VotingPlugin
2023-09-25 16:44:50 -04:00
Ben 1e8421f83f Merge pull request #1304 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-shade-plugin-3.5.1
Bump org.apache.maven.plugins:maven-shade-plugin from 3.5.0 to 3.5.1 in /VotingPlugin
2023-09-25 16:44:45 -04:00
dependabot[bot] a29a7bf5c3 Bump org.apache.maven.plugins:maven-shade-plugin in /VotingPlugin
Bumps [org.apache.maven.plugins:maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.5.0...maven-shade-plugin-3.5.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-shade-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 06:33:21 +00:00
dependabot[bot] fae67a49ce Bump org.projectlombok:lombok from 1.18.28 to 1.18.30 in /VotingPlugin
Bumps [org.projectlombok:lombok](https://github.com/projectlombok/lombok) from 1.18.28 to 1.18.30.
- [Changelog](https://github.com/projectlombok/lombok/blob/master/doc/changelog.markdown)
- [Commits](https://github.com/projectlombok/lombok/compare/v1.18.28...v1.18.30)

---
updated-dependencies:
- dependency-name: org.projectlombok:lombok
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 06:33:11 +00:00
dependabot[bot] c48a0c1083 Bump me.clip:placeholderapi from 2.11.3 to 2.11.4 in /VotingPlugin
Bumps me.clip:placeholderapi from 2.11.3 to 2.11.4.

---
updated-dependencies:
- dependency-name: me.clip:placeholderapi
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 06:33:05 +00:00
BenCodez 37e29b8643 Update version number to 6.14.1 2023-09-23 20:42:13 -04:00
BenCodez f683cc66c1 Update to 1.20.2 2023-09-22 19:54:16 -04:00
BenCodez 2059832df8 Small change to bungee all sites reward 2023-09-18 19:24:52 -04:00
Ben bda5e61898 Merge pull request #1299 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-javadoc-plugin-3.6.0
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.5.0 to 3.6.0 in /VotingPlugin
2023-09-18 16:53:46 -04:00
dependabot[bot] dcb5f67ba8 Bump org.apache.maven.plugins:maven-javadoc-plugin in /VotingPlugin
Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.5.0...maven-javadoc-plugin-3.6.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 06:23:29 +00:00
BenCodez e6065f85cc Adjust allsites check for bungee a bit 2023-09-17 15:18:17 -04:00
BenCodez e0d3d36349 Add option to give extra allsites rewards when on PLUGINMESSAGING 2023-09-17 14:49:57 -04:00
BenCodez ab4d2069eb A lot of internal changes 2023-09-17 13:01:53 -04:00
BenCodez 84f8f9073d Adjustments to cooldown rewards checking 2023-09-10 20:02:31 -04:00
BenCodez 1e9828f594 Adjust cooldown checks a bit more 2023-09-09 21:16:37 -04:00
BenCodez a01050125b Make sure reset time is exactly the right second 2023-09-09 21:13:25 -04:00
BenCodez 60957be6fe Delay votesite cooldown checks a bit 2023-09-09 21:03:35 -04:00
BenCodez a2b094f7d8 Change some debug messages to log messages temporary 2023-09-09 08:49:53 -04:00
BenCodez 56e9705a6e Adjust cooldown checks slightly 2023-09-07 17:24:57 -04:00
BenCodez ad62da3221 Changes to placeholder caching 2023-09-05 21:15:10 -04:00
BenCodez c1421d6324 Add more placeholder cache updates on bungee votes 2023-09-05 20:51:43 -04:00
BenCodez 068c2b704e Add luckperms to softdepend 2023-09-05 17:21:16 -04:00
BenCodez 89d21044d2 Small code cleanup 2023-09-03 21:22:47 -04:00
BenCodez 98246613ca Remove debug messages 2023-09-03 21:22:19 -04:00
BenCodez ee884ee06a More fixes for vote cooldown events/rewards 2023-09-03 21:19:45 -04:00
BenCodez 355ca2cdf0 Add placeholders for last month top voters 2023-09-03 19:54:32 -04:00
BenCodez abc37be619 Small changes to account for using placeholder cache on next placeholder 2023-09-03 14:28:01 -04:00
BenCodez 20d9c08630 Edit votesites.yml comments slightly for new option 2023-09-03 14:15:54 -04:00
BenCodez 523c9e4ef9 Add gui editing ability for VoteDelayDailyHour 2023-09-03 14:14:52 -04:00
BenCodez 76b19f7fb3 Use new VoteDelayDailyHour option to fix issues with vote delay daily 2023-09-03 14:10:33 -04:00
BenCodez d776d0d798 Delay opening voteshop confirm slightly 2023-09-03 12:33:34 -04:00
BenCodez b63da09fe8 Add command to force check cooldown rewards 2023-09-01 19:29:40 -04:00
BenCodez d626210804 Changes to cooldown rewards checking 2023-09-01 19:26:38 -04:00
BenCodez 777c198471 Small changes to cool down checks 2023-08-30 20:15:43 -04:00
BenCodez dbd52a9114 Slight modifications to cooldown checks 2023-08-28 17:10:47 -04:00
BenCodez 3208b865e6 Removed config auto update option 2023-08-27 15:21:06 -04:00
BenCodez a78624eafb Update version number to 6.14 2023-08-27 14:46:41 -04:00
BenCodez 3249a43f4a Added command to manually update config 2023-08-27 14:29:04 -04:00
BenCodez 8e15ba0a3a Disable config auto updating 2023-08-27 14:26:11 -04:00
BenCodez 25969f35e0 Add config updater, disabled by default 2023-08-26 21:50:03 -04:00
BenCodez 6625bf9830 Improve gui editing for adding items, add voteshop item edits 2023-08-26 20:18:46 -04:00
BenCodez a925dcfd88 Edit config comments 2023-08-26 19:37:38 -04:00
BenCodez 40357def84 Add config option to support not adding totals while offline 2023-08-26 19:11:44 -04:00
BenCodez b4806abf70 Fix resetallvotedsites command not checking persite cooldowns 2023-08-26 15:30:44 -04:00
BenCodez f847c033fd Change handling of force cooldown rewards command handling 2023-08-26 15:27:54 -04:00
BenCodez 2919d23fd5 Slight change to placeholder 2023-08-26 14:59:08 -04:00
BenCodez 78412f4717 Add placeholders to PlayerVoteSiteCoolDownEndEvent rewards 2023-08-25 16:57:19 -04:00
BenCodez 438504a344 Check cooldown events on manual vote resets 2023-08-24 21:29:29 -04:00
BenCodez d27bc2580f Fix bottom bar of top voter not working in some rare cases 2023-08-24 19:21:51 -04:00
BenCodez 665865c5b3 Add bstats metrics for placeholder cache level 2023-08-20 13:46:35 -04:00
BenCodez d4124c78c2 Add new cache level, SPECIFICALL 2023-08-20 13:44:04 -04:00
BenCodez 63acc39588 Remove softdepend 2023-08-20 13:20:57 -04:00
BenCodez 46d7a3e95c Fix issue with placeholders not updating 2023-08-15 17:09:08 -04:00
BenCodez 39e5b54af6 Add another placeholder cache level 2023-08-12 21:16:49 -04:00
BenCodez 1a47862d22 Implement placeholder caching changes 2023-08-12 16:04:38 -04:00
BenCodez 63c73b8871 Remove need for external placeholder expansion, include directly 2023-08-08 19:54:00 -04:00
Ben 3bfab3518b Merge pull request #1291 from BenCodez/dependabot/maven/VotingPlugin/net.md-5-bungeecord-api-1.20-R0.1
Bump net.md-5:bungeecord-api from 1.17-R0.1-SNAPSHOT to 1.20-R0.1 in /VotingPlugin
2023-08-07 07:58:29 -04:00
dependabot[bot] 843d47cfb5 Bump net.md-5:bungeecord-api in /VotingPlugin
Bumps [net.md-5:bungeecord-api](https://github.com/SpigotMC/BungeeCord) from 1.17-R0.1-SNAPSHOT to 1.20-R0.1.
- [Commits](https://github.com/SpigotMC/BungeeCord/commits)

---
updated-dependencies:
- dependency-name: net.md-5:bungeecord-api
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-07 06:26:35 +00:00
BenCodez f7617eba61 Add vote time to playerpostvoteevent 2023-08-06 13:27:21 -04:00
BenCodez 1c95d37ce4 Set default bungee vote party placeholder to -1 to detect issues better 2023-08-05 17:38:09 -04:00
BenCodez db65b564a5 Add config options to adjust invalid arguments message 2023-08-04 20:43:44 -04:00
BenCodez 6f88e126e4 revert changes 2023-08-04 17:19:32 -04:00
BenCodez 25ea0b3a37 Changes to time handling 2023-08-03 20:24:49 -04:00
BenCodez d3bdcc762f Only reload global mysql on reloadall 2023-08-01 16:55:53 -04:00
BenCodez d72eb0e2a7 Force background update on cleartotal command 2023-07-29 20:24:06 -04:00
BenCodez 7b3a458b25 Update cache of online players on resetmilestonecount 2023-07-28 20:10:57 -04:00
BenCodez e2b79072d0 Add config option to disable javascript 2023-07-28 17:28:10 -04:00
BenCodez 7845741cec Handle incorrectly generated directlydefined reward files 2023-07-23 19:25:40 -04:00
BenCodez 6e2497dee7 More config handling improvements 2023-07-23 13:35:07 -04:00
BenCodez 7982c3df80 Switch to better config handling for config editor 2023-07-22 22:15:17 -04:00
BenCodez a7701f27f1 Improve config editor slightly 2023-07-22 21:32:26 -04:00
BenCodez bbe95bf83a Add system to purge cache of proxy votes 2023-07-14 20:40:51 -04:00
BenCodez 4e944df7f2 Add option to disable seconds in last vote times 2023-07-12 19:43:39 -04:00
BenCodez 6461aac03d Change deprecated api 2023-07-09 13:40:41 -04:00
BenCodez 1ece7935a2 Add getInstance method back to user manager for other plugins 2023-07-08 19:05:46 -04:00
BenCodez e130261a75 Add number placeholder for book gui 2023-07-07 12:46:29 -04:00
BenCodez c65c241b4d Add ability to manual layout in bookgui 2023-07-07 12:44:21 -04:00
BenCodez 9876e8e77b https://github.com/BenCodez/AdvancedCore/wiki/AdvancedPriority-Examples 2023-07-05 14:47:45 -04:00
BenCodez 674c41fec2 Improve config editor 2023-07-04 16:19:54 -04:00
BenCodez 6c295ec07f Small adjustment 2023-07-01 17:28:46 -04:00
BenCodez 332b7b667e Use new config editor 2023-06-25 17:38:03 -04:00
BenCodez 173bd381a5 Minor adjustment to plugin.yml 2023-06-25 16:29:51 -04:00
BenCodez 6154efdd50 Adjustments to vote handling 2023-06-23 18:57:58 -04:00
BenCodez ee0dcf8019 Add random global command to vote party 2023-06-21 20:18:51 -04:00
BenCodez 6a4740f729 Disable default worlds check on vote reminding 2023-06-20 20:27:56 -04:00
BenCodez ccf58be365 Add new offline vote limit feature 2023-06-20 20:06:47 -04:00
Ben b871278d82 Merge pull request #1286 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-jar-plugin-3.3.0
Bump maven-jar-plugin from 2.3.1 to 3.3.0 in /VotingPlugin
2023-06-19 21:07:19 -04:00
Ben 90bc2dd3ee Merge pull request #1285 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-shade-plugin-3.5.0
Bump maven-shade-plugin from 3.3.0 to 3.5.0 in /VotingPlugin
2023-06-19 21:07:04 -04:00
Ben a85b9dce23 Merge pull request #1284 from BenCodez/dependabot/maven/VotingPlugin/org.bstats-bstats-velocity-3.0.2
Bump bstats-velocity from 2.2.1 to 3.0.2 in /VotingPlugin
2023-06-19 21:06:57 -04:00
Ben a171fad307 Merge pull request #1283 from BenCodez/dependabot/maven/VotingPlugin/org.sonatype.plugins-nexus-staging-maven-plugin-1.6.13
Bump nexus-staging-maven-plugin from 1.5.1 to 1.6.13 in /VotingPlugin
2023-06-19 21:06:51 -04:00
dependabot[bot] eba230e5c0 Bump maven-jar-plugin from 2.3.1 to 3.3.0 in /VotingPlugin
Bumps [maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 2.3.1 to 3.3.0.
- [Release notes](https://github.com/apache/maven-jar-plugin/releases)
- [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-2.3.1...maven-jar-plugin-3.3.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-jar-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 01:06:17 +00:00
dependabot[bot] ffd1f616d4 Bump maven-shade-plugin from 3.3.0 to 3.5.0 in /VotingPlugin
Bumps [maven-shade-plugin](https://github.com/apache/maven-shade-plugin) from 3.3.0 to 3.5.0.
- [Release notes](https://github.com/apache/maven-shade-plugin/releases)
- [Commits](https://github.com/apache/maven-shade-plugin/compare/maven-shade-plugin-3.3.0...maven-shade-plugin-3.5.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-shade-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 01:06:12 +00:00
dependabot[bot] 4dfbf0c71f Bump bstats-velocity from 2.2.1 to 3.0.2 in /VotingPlugin
Bumps [bstats-velocity](https://github.com/Bastian/bStats-Metrics) from 2.2.1 to 3.0.2.
- [Release notes](https://github.com/Bastian/bStats-Metrics/releases)
- [Commits](https://github.com/Bastian/bStats-Metrics/compare/v2.2.1...v3.0.2)

---
updated-dependencies:
- dependency-name: org.bstats:bstats-velocity
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 01:04:32 +00:00
dependabot[bot] c97616eb8d Bump nexus-staging-maven-plugin from 1.5.1 to 1.6.13 in /VotingPlugin
Bumps nexus-staging-maven-plugin from 1.5.1 to 1.6.13.

---
updated-dependencies:
- dependency-name: org.sonatype.plugins:nexus-staging-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 01:04:25 +00:00
Ben 6039bb12b8 Update dependabot.yml 2023-06-19 21:03:51 -04:00
Ben 11bf99faf9 Merge pull request #1282 from BenCodez/dependabot/maven/VotingPlugin/org.projectlombok-lombok-1.18.28
Bump lombok from 1.18.20 to 1.18.28 in /VotingPlugin
2023-06-19 20:58:18 -04:00
Ben cbfde9bedd Merge pull request #1280 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-resources-plugin-3.3.1
Bump maven-resources-plugin from 3.1.0 to 3.3.1 in /VotingPlugin
2023-06-19 20:58:08 -04:00
Ben 0ab0fa5fb5 Merge pull request #1279 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-javadoc-plugin-3.5.0
Bump maven-javadoc-plugin from 2.10.4 to 3.5.0 in /VotingPlugin
2023-06-19 20:57:47 -04:00
Ben fd460787c3 Update dependabot.yml 2023-06-19 20:57:21 -04:00
dependabot[bot] 524d22d37a Bump lombok from 1.18.20 to 1.18.28 in /VotingPlugin
Bumps [lombok](https://github.com/projectlombok/lombok) from 1.18.20 to 1.18.28.
- [Release notes](https://github.com/projectlombok/lombok/releases)
- [Changelog](https://github.com/projectlombok/lombok/blob/master/doc/changelog.markdown)
- [Commits](https://github.com/projectlombok/lombok/compare/v1.18.20...v1.18.28)

---
updated-dependencies:
- dependency-name: org.projectlombok:lombok
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 00:55:51 +00:00
dependabot[bot] 220368d037 Bump maven-resources-plugin from 3.1.0 to 3.3.1 in /VotingPlugin
Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 3.1.0 to 3.3.1.
- [Release notes](https://github.com/apache/maven-resources-plugin/releases)
- [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-3.1.0...maven-resources-plugin-3.3.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-resources-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 00:55:41 +00:00
dependabot[bot] 5d86c5297d Bump maven-javadoc-plugin from 2.10.4 to 3.5.0 in /VotingPlugin
Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 2.10.4 to 3.5.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-2.10.4...maven-javadoc-plugin-3.5.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 00:55:26 +00:00
Ben 7d69f1e496 Merge pull request #1278 from BenCodez/dependabot/maven/VotingPlugin/org.apache.maven.plugins-maven-deploy-plugin-3.1.1
Bump maven-deploy-plugin from 3.0.0-M1 to 3.1.1 in /VotingPlugin
2023-06-19 20:55:02 -04:00
dependabot[bot] e2784c6b17 Bump maven-deploy-plugin from 3.0.0-M1 to 3.1.1 in /VotingPlugin
Bumps [maven-deploy-plugin](https://github.com/apache/maven-deploy-plugin) from 3.0.0-M1 to 3.1.1.
- [Release notes](https://github.com/apache/maven-deploy-plugin/releases)
- [Commits](https://github.com/apache/maven-deploy-plugin/compare/maven-deploy-plugin-3.0.0-M1...maven-deploy-plugin-3.1.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-deploy-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-20 00:54:04 +00:00
Ben f9ce8f325d Update dependabot.yml 2023-06-19 20:53:35 -04:00
Ben b059fc644a Update dependabot.yml 2023-06-19 20:52:23 -04:00
Ben 5c7e5d2d59 Create dependabot.yml 2023-06-19 20:50:36 -04:00
BenCodez 3b4dde335d Implement better command handler api to handle player commands 2023-06-19 20:01:59 -04:00
BenCodez f00ca81c28 Use new command handler constructor 2023-06-19 19:46:58 -04:00
Ben 36ef5e15cf Update publish-javadoc.yml 2023-06-18 15:46:27 -04:00
BenCodez 9a122fb46d Change deploy profile slightly 2023-06-18 15:36:02 -04:00
BenCodez 17fc78a15f Fix profile 2023-06-18 15:29:30 -04:00
BenCodez 0718f0976d Add javadoc profile 2023-06-18 15:27:14 -04:00
Ben 580e7d3061 Update publish-javadoc.yml 2023-06-18 15:26:59 -04:00
Ben 29af36a9e9 Create publish-javadoc.yml 2023-06-18 15:22:10 -04:00
Ben 56d39722cb Delete publish-javadoc.yml 2023-06-18 13:43:09 -04:00
Ben 6a202d4768 Update publish-javadoc.yml 2023-06-18 13:39:12 -04:00
Ben d399684bfa Create publish-javadoc.yml 2023-06-18 13:35:08 -04:00
Ben 1a0da65c66 Delete publish-javadoc.yml 2023-06-18 13:25:35 -04:00
Ben 463b303f2e Update publish-javadoc.yml 2023-06-18 13:22:46 -04:00
Ben abf0e2bebb Update publish-javadoc.yml 2023-06-18 13:17:51 -04:00
Ben 29670f8c22 Update publish-javadoc.yml 2023-06-18 13:16:18 -04:00
Ben 7b08d6806b Update publish-javadoc.yml 2023-06-18 13:13:47 -04:00
Ben 3211e22963 Update publish-javadoc.yml 2023-06-18 12:52:23 -04:00
Ben 2634639f6b Update publish-javadoc.yml 2023-06-18 12:49:08 -04:00
Ben 0798110743 Update publish-javadoc.yml 2023-06-18 12:46:46 -04:00
Ben 2f90e112b1 Update publish-javadoc.yml 2023-06-18 12:43:16 -04:00
Ben 661ea3ce94 Update publish-javadoc.yml 2023-06-17 22:17:11 -04:00
Ben 8d6e95927c Merge pull request #1277 from BenCodez/Auto-upload-javadoc
Create publish-javadoc.yml
2023-06-17 22:14:05 -04:00
Ben c138edccc8 Create publish-javadoc.yml 2023-06-17 22:13:51 -04:00
BenCodez e59b171aae Fix deploying profiles 2023-06-17 20:19:31 -04:00
BenCodez 36cfe6c9c6 Update version to 6.13.1 2023-06-17 20:14:32 -04:00
BenCodez 45a413c3a6 Fix minor issue 2023-06-16 16:45:06 -04:00
Ben a640582278 Merge pull request #1275 from akdukaan/patch-2
check milestones in /av user all addmilestonecount
2023-06-16 16:44:07 -04:00
akdukaan 94122a1c80 check milestones in /av user all addmilestonecount 2023-06-15 22:35:28 -05:00
BenCodez 0448278ba1 Fix issue with messages on commands 2023-06-15 17:18:09 -04:00
BenCodez 097bff23a2 Small api change 2023-06-15 16:56:31 -04:00
BenCodez be76d8f4af Support all players on addmilestonecount command 2023-06-15 16:45:58 -04:00
BenCodez 6122805c0d Update cache of onlines players with cleargottenmilestones on all users 2023-06-14 21:44:47 -04:00
BenCodez 392d5cb17a Remove command alias 2023-06-14 21:40:06 -04:00
BenCodez ec1352d52b Add support for clearing all gotten milestones for all players 2023-06-14 21:38:35 -04:00
BenCodez c3a4db1ac8 Update spigot 1.20.1 2023-06-12 17:27:05 -04:00
BenCodez 442eb35a4f Add debug log message if loading vote top last month 2023-06-09 17:06:21 -04:00
BenCodez d0851a9365 Update to 1.20 2023-06-07 19:45:35 -04:00
BenCodez 5273745be5 Remove suppress warnings 2023-06-04 21:00:31 -04:00
BenCodez ca937f6879 edit dependency 2023-06-04 20:48:23 -04:00
BenCodez a4c4fa5556 Fix issue 2023-06-04 20:45:20 -04:00
BenCodez 480c303f2f Add maven profile for folia 2023-06-04 20:44:06 -04:00
BenCodez 347640f346 Fix an issue 2023-06-04 20:23:47 -04:00
BenCodez 1d8314c0eb Test change for java 8 support 2023-06-04 17:24:53 -04:00
BenCodez 20d95baea9 Chnages to placeholder handling 2023-06-04 15:24:49 -04:00
BenCodez 510f400c1b Update placeholders every minute 2023-06-03 15:11:41 -04:00
BenCodez c49d0b3ede Add extra log messages for top voter rewards 2023-06-01 21:32:04 -04:00
BenCodez ff197cb6b6 Add folia support, upgrade to java 17, credits to LOOHP 2023-05-31 20:12:08 -04:00
Ben 9e4605258b Delete stale.yml 2023-05-30 20:26:39 -04:00
Ben c54e8bc8bd Merge pull request #1273 from BenCodez/BenCodez-patch-1
Create stale.yml
2023-05-30 20:25:57 -04:00
Ben fe937b8f8d Create stale.yml 2023-05-30 20:25:45 -04:00
BenCodez d262b3689a Apply voteshop option to voteshop command 2023-05-28 20:06:43 -04:00
BenCodez aac5226fce Change handling of givepoints command 2023-05-28 12:34:29 -04:00
BenCodez 1d1b9722ac Add comments to config option 2023-05-26 19:52:12 -04:00
BenCodez 94193501ba Add new config options for give points command 2023-05-26 19:50:10 -04:00
BenCodez 2b142316dc Add method for adding points async if needed 2023-05-22 17:42:20 -04:00
BenCodez a06124e49c Set points async on vote shop purchase 2023-05-22 17:41:01 -04:00
BenCodez c1bd04f117 Minor user data handling change 2023-05-21 20:19:10 -04:00
BenCodez 4272d15a8b Add config option for tracking vote shop purchases 2023-05-20 18:51:02 -04:00
BenCodez 0537dad68e Track number of purchases with voteshop 2023-05-20 07:59:39 -04:00
BenCodez c1f09a6bd9 Edit config comments 2023-05-16 21:31:04 -04:00
BenCodez 69ea7c71b3 Minor change 2023-05-16 21:30:29 -04:00
BenCodez 3052f28b2c Add option for voteshop check on purchase 2023-05-16 21:28:56 -04:00
BenCodez 892d23e0d0 Add gui option to reopen shop gui on purchase 2023-05-14 19:39:51 -04:00
BenCodez b217edeadf Update version number to 6.13 2023-05-14 13:15:00 -04:00
BenCodez aa4ad384c1 Adjustments to remove static usuage 2023-05-14 13:03:43 -04:00
BenCodez 8021024b48 Small change to reduce RAM usuage 2023-05-13 20:32:19 -04:00
BenCodez d3f246d048 Add extra customization to vote next GUI 2023-05-13 08:34:05 -04:00
BenCodez 9c2dfcab06 A lot of changes to getting all player data to prevent possible issues 2023-05-13 08:23:48 -04:00
BenCodez 8b4224a034 Add stats for background task time taken and remove playerdataloadlimit 2023-05-12 20:28:06 -04:00
BenCodez 61bf0007c1 Minor change to time changes 2023-05-10 20:44:56 -04:00
BenCodez 151559c50e Support time zones of proxies, improve speed of time changes 2023-05-10 20:24:45 -04:00
BenCodez 2dccf6e790 Add random player placeholder for vote party 2023-05-10 16:53:53 -04:00
BenCodez bc510b1ba0 Remove use of using 2 tasks 2023-05-09 20:57:03 -04:00
BenCodez 0253d86b8d Properly account canvote placeholder with timeoffsets and votedelaydaily 2023-05-07 21:12:38 -04:00
BenCodez 59cd31a6c8 Improve speed of background task 2023-05-07 20:52:35 -04:00
BenCodez 068b24bd39 Account for time offset in canvote placeholders 2023-05-07 19:03:56 -04:00
BenCodez 7f06797f5f Add placeholder for next available milestone data 2023-05-07 13:28:14 -04:00
BenCodez 3e2bdf4772 Remove duplicate placeholder cache update 2023-05-07 13:12:45 -04:00
BenCodez 3b049299b1 Adjust handling of recaching to optimize performance 2023-05-06 20:04:08 -04:00
BenCodez 05670bebeb Update placeholder cache on vote 2023-05-05 19:47:48 -04:00
BenCodez 81f73590a6 Switch to json files on velocity for vote caches 2023-05-04 20:47:51 -04:00
BenCodez 163e4cdadb Convert yaml files to json on bungeecord due to yaml size limit 2023-05-04 20:14:26 -04:00
BenCodez 512c02e501 Change default return of custom placeholders to return the value instead 2023-05-01 17:27:55 -04:00
BenCodez 25ef8ba315 Adjust to advancedcore changes 2023-05-01 17:24:17 -04:00
BenCodez 8966feb35a Change placeholder name to avoid conflict 2023-05-01 16:41:09 -04:00
BenCodez 0d29be48c7 Update version number to 6.12.2 2023-04-30 18:59:03 -04:00
BenCodez bc2827659d Add placeholder for number of votes until milestone 2023-04-30 16:17:35 -04:00
BenCodez 0a72247a5d Added a one time placeholder auto caching update 2023-04-30 14:59:22 -04:00
BenCodez a102ec3566 Revert placeholder reloading change 2023-04-30 14:39:39 -04:00
BenCodez f91b02d572 Change handling of placeholder reloading 2023-04-30 14:30:26 -04:00
BenCodez 0f00741151 Add extra failsafe on combined total on top voter storing 2023-04-30 14:10:20 -04:00
BenCodez 922302082f Implement new placeholder replacement system 2023-04-30 13:20:20 -04:00
BenCodez 24e1fbb6e5 Fix error 2023-04-30 12:51:45 -04:00
BenCodez 3026a2d48f Fix issue with placeholder 2023-04-30 12:42:02 -04:00
BenCodez 58101bfea0 Fixed top voter changes not working with sqlite 2023-04-30 12:40:22 -04:00
BenCodez 0a9e46ee85 Add placeholder %votingplugin_points_<number>% 2023-04-30 12:34:49 -04:00
BenCodez fd67e45c58 Add option for closing gui on click for top voter 2023-04-28 18:30:15 -04:00
BenCodez b6af6de2df Fix a few things 2023-04-27 17:00:01 -04:00
BenCodez 173051829e Implement close click handling to regular voteshop items 2023-04-26 19:44:30 -04:00
BenCodez 8a9ef4811f Make changes to CloseGUI option handling 2023-04-26 19:43:21 -04:00
BenCodez 4fd6d580b1 Implement same slot click system for vote shop extra items 2023-04-25 17:26:05 -04:00
BenCodez 415970101c Add CloseGUI option for VoteGUI 2023-04-24 18:52:35 -04:00
BenCodez 668dcdd8b4 Don't match exactly for votegui slots 2023-04-24 18:46:43 -04:00
BenCodez bf24533b54 Remove FLAT option 2023-04-23 20:31:40 -04:00
BenCodez b2daada576 Fix votetop GUI 2023-04-23 15:40:41 -04:00
BenCodez 9dd2c58134 Fix switch item 2023-04-23 15:30:55 -04:00
BenCodez 7674c68bc7 Add support for conditional items for rewards 2023-04-23 15:09:16 -04:00
BenCodez 0b3b0b29f5 Add more customization to top voter GUI 2023-04-23 14:29:41 -04:00
BenCodez 60370a1a83 Reload placeholder cache on reload 2023-04-23 12:43:58 -04:00
BenCodez 3bf273e854 Add to javascript engine main plugin instance 2023-04-22 15:38:33 -04:00
BenCodez a8e53c9b62 Added commands to reset voted sites 2023-04-22 15:27:16 -04:00
BenCodez 3015cd9604 Add placeholder for votegui 2023-04-22 09:02:16 -04:00
BenCodez 839119e0a9 Add sitesavailable placeholder for voteshop 2023-04-22 08:46:06 -04:00
BenCodez 409a0665cc Change multi-proxy socket handling for reloads 2023-04-21 21:32:07 -04:00
BenCodez 0549fe9c21 Add exit option to GUI for backbutton 2023-04-21 16:58:19 -04:00
BenCodez f047bb6176 Hide error for global data handling 2023-04-20 20:22:30 -04:00
BenCodez ad04b7e966 Fix voteshop message not working 2023-04-20 16:42:23 -04:00
BenCodez 2591cbf029 Add not buyable message to shop items 2023-04-19 19:15:21 -04:00
BenCodez 8213e07c74 Add support for extra items to voteshop 2023-04-19 19:08:29 -04:00
BenCodez 972f9581e3 Make /av placeholders command show placeholders as lowercase 2023-04-17 17:15:48 -04:00
BenCodez 2e17b3defd Update version number to 6.12.1 2023-04-17 17:05:28 -04:00
BenCodez 76dbfb8fdf Fixed issues with uppercase placeholders 2023-04-17 17:04:31 -04:00
BenCodez 8fd206b119 Fixed missing column types for mysql 2023-04-15 20:27:14 -04:00
BenCodez 9c6e514234 Update version number to 6.12 2023-04-15 20:09:36 -04:00
BenCodez eb66ccb90d Fix auto caching placeholders not saving for restarts 2023-04-15 20:07:30 -04:00
BenCodez c004dc6106 Fixed trying to cache invalid placeholders 2023-04-15 19:49:09 -04:00
BenCodez f54ccbd7b2 Improve config some more 2023-04-15 19:35:39 -04:00
BenCodez 8cdd0b713b More optimizations on time changes 2023-04-10 19:34:05 -04:00
BenCodez 2562e749db Optimize time change events even more 2023-04-10 17:49:29 -04:00
BenCodez 1a1e5d84bb Improve time change events performance if settings are disabled 2023-04-10 17:44:15 -04:00
BenCodez d4d23035e3 Update pom.xml 2023-04-07 16:46:56 -04:00
BenCodez 5e334e4a8a Update pom.xml 2023-04-07 16:45:16 -04:00
Ben 22991efccf Delete jitpack.yml 2023-04-07 16:39:51 -04:00
Ben 5341fbc3ba Update README.md 2023-04-07 16:09:53 -04:00
BenCodez 2e0fbd01e6 Check for vanish on vote reminding 2023-04-05 16:44:57 -04:00
BenCodez d1d395d9b3 Reformat config to improve overall look 2023-04-04 19:43:02 -04:00
BenCodez 9aeedac2ad Extra check on background task to make sure plugin is enabled 2023-04-02 19:36:56 -04:00
BenCodez 265ed68e0f Add extra check on background task if plugin is enabled 2023-04-01 15:37:04 -04:00
BenCodez b73daaf917 Improve /vote total all command speeds 2023-04-01 15:36:01 -04:00
BenCodez 39d8e414f4 Fix error on shutdown 2023-03-31 16:58:48 -04:00
BenCodez 693541dd00 Add support for extra items on other GUI's 2023-03-30 20:27:05 -04:00
BenCodez 5dce8031c5 More changes to placeholder caching 2023-03-29 17:32:37 -04:00
BenCodez babef8ccf3 Changes to placeholder caching 2023-03-29 17:10:01 -04:00
BenCodez 7a881206ca Change name of vote party one time commands option to avoid confusion 2023-03-28 19:42:52 -04:00
BenCodez aed8ecca26 Fix command help messages being wrong 2023-03-28 19:15:46 -04:00
BenCodez 25dab3157a Add improved placeholder controls 2023-03-27 20:28:54 -04:00
BenCodez 81d8b535ee Adjust caching setting 2023-03-26 17:47:01 -04:00
BenCodez c94802a141 Add global vote party bungee commands reward and edit commands 2023-03-25 19:56:18 -04:00
BenCodez 85e31f8292 Add config option to always use cache for placeholders - WIP 2023-03-25 19:03:59 -04:00
BenCodez da642cb3b2 Stop background task on plugin disable 2023-03-23 16:44:04 -04:00
BenCodez 96c707eca4 Changes to reloading multiproxy support 2023-03-22 19:26:14 -04:00
BenCodez ce5c469637 Update to 6.11.3 2023-03-18 19:17:00 -04:00
BenCodez 4126c4a7a1 Change default maven profile 2023-03-18 16:03:30 -04:00
Ben fb430a930b Create jitpack.yml 2023-03-18 15:57:25 -04:00
BenCodez 2c6f8c79c2 Shutdown multiproxy socket on reload if disabled 2023-03-18 14:52:23 -04:00
BenCodez 1b94f23ff2 Remove softdepend 2023-03-16 17:16:19 -04:00
BenCodez 72c0a88fc1 Load multiproxy support on reload 2023-03-15 16:49:19 -04:00
BenCodez e532987c6a Update to 1.19.4 2023-03-14 16:55:04 -04:00
BenCodez 2168d92b12 Cache almostallsites key 2023-03-07 18:46:26 -05:00
BenCodez d68758f34e Optimize placeholder caching updates 2023-03-05 17:12:32 -05:00
BenCodez e1b7844501 Undo change to bungee handling 2023-03-05 12:39:05 -05:00
BenCodez 01b6ed185b Changes to handling bungee votes 2023-03-04 18:56:35 -05:00
BenCodez 3ee31012ce Update version number to 6.11.2 2023-02-18 19:09:15 -05:00
BenCodez ba312961b8 Optimize player vote event even more 2023-02-12 20:20:50 -05:00
BenCodez a2484969ee Improve vote handling to deal with large databases 2023-02-12 18:51:32 -05:00
BenCodez 470196741c Improve getting user object 2023-02-12 17:17:23 -05:00
BenCodez 2abce5ebe7 Improve background task 2023-02-12 17:14:33 -05:00
BenCodez 20f775c119 Don't always run login/logout rewards unless needed 2023-02-12 13:53:04 -05:00
BenCodez e0821ed2b1 Minor log message change 2023-02-11 21:19:17 -05:00
BenCodez 6fbcc89fc8 Optimize player vote listener slightly 2023-02-11 17:51:13 -05:00
BenCodez 11f86194b0 Changes to how reload is handled 2023-02-11 15:55:21 -05:00
BenCodez 46c112d2ea Don't reload background task on plugin reload 2023-02-10 21:18:07 -05:00
BenCodez 0269578e5e More changes to background task 2023-02-10 21:17:17 -05:00
BenCodez fc14b19d9f Changes to vote processing 2023-02-10 21:11:49 -05:00
BenCodez 9c25f848c6 Add another test command 2023-02-09 19:16:50 -05:00
BenCodez b7f53aabfb Bug fix 2023-02-08 16:57:02 -05:00
BenCodez 926a009085 Remove extra checks 2023-02-08 16:54:34 -05:00
BenCodez f0737861de Add support for whitelist instead of blocked list on proxy 2023-02-07 19:55:00 -05:00
BenCodez 8e14a92813 Add metrics for multi-proxy support 2023-02-05 20:27:32 -05:00
BenCodez 78fc8069b3 More changes to background vote processing handling 2023-02-05 15:40:42 -05:00
BenCodez eed98ed638 Try different locking system for votes 2023-02-05 14:40:39 -05:00
BenCodez f3653c20f6 Silence no votifierevent message when using multiproxy setup 2023-02-05 12:18:59 -05:00
BenCodez 675f4bb6e9 Changes to vote handling 2023-02-04 18:05:13 -05:00
BenCodez 4dbb8b7360 Minor change to background task 2023-02-04 17:38:43 -05:00
BenCodez 5040ee2946 Support velocity booting without nuvotifier installed 2023-02-04 17:24:07 -05:00
BenCodez d7e1408c30 Fix offline broadcast not working correctly on bungee setups 2023-01-29 15:56:49 -05:00
BenCodez 73fda9027a Implement offline broadcast to bungee setups 2023-01-29 15:52:05 -05:00
BenCodez b762c6000f Fix double rewards with mutli-proxy setup 2023-01-29 14:41:08 -05:00
BenCodez 16dcd85807 Fix issues with offline voting on velocity 2023-01-29 14:32:18 -05:00
BenCodez d9b5fcf250 Fix issue on velocity 2023-01-29 14:02:29 -05:00
BenCodez b85f49010b Bug fix 2023-01-29 13:52:17 -05:00
BenCodez 42b64b86bd Add debug messages to multi-proxy setup 2023-01-29 13:28:46 -05:00
BenCodez 266014cbe2 Added /votingpluginbungee multiproxystatus 2023-01-29 13:11:10 -05:00
BenCodez 1e27e28a33 Implement multi-proxy support to velocity 2023-01-29 12:58:23 -05:00
BenCodez 1c530c18ce Change debug to log message 2023-01-27 19:24:41 -05:00
BenCodez c2ebd2251e Bug fix for multi-proxy setup 2023-01-27 19:22:23 -05:00
BenCodez c2fb84dc61 Added extra debug message 2023-01-27 18:56:08 -05:00
BenCodez 39e21bffe7 Minor fixes on multi-proxy handling 2023-01-27 16:58:28 -05:00
BenCodez 226b6eb01e Fix an issue 2023-01-27 16:49:47 -05:00
BenCodez 76a40fd889 Change handling on multi-proxy setup 2023-01-26 19:20:09 -05:00
BenCodez 32f43e7713 Fix issue on bungee login 2023-01-22 16:49:06 -05:00
BenCodez 601e57572f Update version number to 6.11.1 2023-01-21 20:38:01 -05:00
BenCodez 4a8bd40a8b Remove log message 2023-01-21 19:43:32 -05:00
BenCodez 8294e99eeb Change votifier processing 2023-01-21 19:42:16 -05:00
BenCodez 162e7f7faa Change timer handling 2023-01-21 19:11:30 -05:00
BenCodez 7463074b5a Add extra log message 2023-01-21 15:25:12 -05:00
BenCodez bbec19d5c9 Add config option to enable/disable vote queues during time change 2023-01-21 15:23:58 -05:00
BenCodez 72ed4223c4 Improve log messages on vote 2023-01-20 20:50:59 -05:00
BenCodez 603656248b Add another log message 2023-01-20 20:47:04 -05:00
BenCodez 4455a0254f Add extra debug message 2023-01-20 20:04:07 -05:00
BenCodez 3227c47d9b Changes to vote queue 2023-01-19 20:55:53 -05:00
BenCodez bf6885875f Smarter json parsing on voteurl 2023-01-19 19:15:34 -05:00
BenCodez 72934d1286 Change handling of voteparty to better handle last voted player 2023-01-18 19:59:06 -05:00
BenCodez 2a4840814d Fix offline vote processing on bungee 2023-01-17 19:00:17 -05:00
BenCodez 8b8e8acbc8 Modify handling of login on bungee 2023-01-17 17:19:36 -05:00
BenCodez a4ff2d8dcf Fix issues with velocity 2023-01-16 16:43:02 -05:00
BenCodez a6ca0c8121 Update version number to 6.11 2023-01-15 13:48:24 -05:00
BenCodez f3e88859d3 Fix a few issues 2023-01-15 13:37:33 -05:00
BenCodez 7249159ec9 Add more metrics 2023-01-15 12:51:58 -05:00
BenCodez 61c3eccb19 Changes to metrics 2023-01-14 20:41:28 -05:00
BenCodez 4ec800c83e Changes to metrics handling 2023-01-14 19:41:31 -05:00
BenCodez 20e42b0ae7 Fix issue with velocity startup 2023-01-14 15:07:17 -05:00
BenCodez d95becce22 Add geyser prefix to name on vote if needed 2023-01-11 19:06:24 -05:00
BenCodez 04fd38a10d Remove bungee geyser handle 2023-01-11 17:10:16 -05:00
BenCodez a30b2319f5 load metrics async 2023-01-11 17:00:01 -05:00
BenCodez a1b08f6dd0 Small change to voting 2023-01-10 16:50:16 -05:00
BenCodez 614193716f Change order of method 2023-01-09 18:45:15 -05:00
BenCodez b68ac4cdd5 Attempt to get geyser uuid 2023-01-09 18:44:04 -05:00
BenCodez 3767ca2883 Load secretkey.key file if using redis support and not socket method 2023-01-09 17:48:36 -05:00
BenCodez 73b7abf3e6 Add geyser prefix on bungee 2023-01-08 17:29:28 -05:00
BenCodez 285719ae28 Add geyser support to bungee 2023-01-08 17:08:59 -05:00
BenCodez 22fd1ac1e4 Fix listener not registering 2023-01-08 15:07:56 -05:00
BenCodez 6127a2ab23 Add cooldown end rewards per votesite & improve reward edit GUI's 2023-01-07 19:40:03 -05:00
BenCodez 0054b6e06f Add local time change queue handling (non bungee setups) 2023-01-06 20:59:38 -05:00
BenCodez b0f1e0bcb6 Fix vote shop closing 2023-01-06 18:59:25 -05:00
BenCodez ddd0dba728 Implement a better system to test for online servers with global data 2023-01-03 20:22:27 -05:00
BenCodez 9595164f69 Bug fixes 2023-01-03 16:43:10 -05:00
BenCodez 66092ba3fd Fix bungee time queue to actually remember time of vote 2023-01-02 20:37:50 -05:00
BenCodez 5c41c7f4c9 Improve global time handle 2023-01-02 19:36:15 -05:00
BenCodez dfa772af4b Minor change to vote party handling 2023-01-02 14:42:22 -05:00
BenCodez 78f33661aa Improvements to global data handler, handle resets, pause incoming votes 2023-01-01 22:07:52 -05:00
BenCodez 45f2bb2c72 Minor improvements to global data handling 2023-01-01 16:56:23 -05:00
BenCodez f20c7a58ac Add global data handler, WIP 2023-01-01 16:18:02 -05:00
BenCodez 4d1b37c37b Add AlmostAllSites reward 2023-01-01 16:16:43 -05:00
BenCodez d323cd7691 Store top voters before processing rest of time change event 2022-12-27 10:15:19 -05:00
BenCodez 67fc73b530 Delay top voter resetting to improve synchronization between servers 2022-12-27 10:13:38 -05:00
BenCodez 13872fd9d1 Rewrite all sites cooldown event to be a little more efficient 2022-12-19 21:09:00 -05:00
BenCodez a76da52a0a Add per site cooldown end event, enabled with config option 2022-12-19 21:01:58 -05:00
BenCodez 36fabe10a6 Add support for offline mode on bungee 2022-12-17 18:28:55 -05:00
BenCodez eada7af420 Replace placeholderapi placeholders in vote party command 2022-12-13 17:28:22 -05:00
BenCodez 63fc7d64be Update to 6.10.0 2022-12-10 19:42:03 -05:00
BenCodez 0ed5b12f8b Update to 1.19.3 2022-12-08 20:28:00 -05:00
BenCodez 504f9edbb2 Handle invalid materials on voteshop edits 2022-12-02 17:54:37 -05:00
BenCodez 8060ece2eb Update use of timers 2022-11-27 17:03:28 -05:00
BenCodez 254442fa2e Improve new topvoter sorting 2022-11-20 17:48:05 -05:00
BenCodez febead9d5a Bug fix 2022-11-20 17:27:55 -05:00
BenCodez d8cd0c278d Don't cache when sorting top voter 2022-11-20 17:10:54 -05:00
BenCodez fe0d7cd671 Change order of top voter to better handle ties 2022-11-20 14:06:07 -05:00
BenCodez c9d8878bb3 Add extra sorting to top voters 2022-11-20 14:04:30 -05:00
BenCodez 0f450e9b60 Catch NumberFormatException 2022-11-14 18:30:04 -05:00
BenCodez 667d0b544e More changes to timers 2022-10-31 18:44:24 -04:00
BenCodez 6e1e6bd928 Change to ScheduledExecutorService 2022-10-31 17:03:01 -04:00
BenCodez 1cfc447445 Add temp workaround to fix some issues 2022-10-31 16:55:27 -04:00
BenCodez 6d3e68e548 Add placeholder for players that voted in alternate broadcast 2022-10-13 15:53:12 -04:00
BenCodez 855dde196e More improvements for anysitereward with pluginmessaging 2022-10-06 20:39:21 -04:00
BenCodez d5a9e1012a Changes to pluginmessaging to fix anysiterewards 2022-10-05 16:47:36 -04:00
BenCodez f5d67833b2 Update version number to 6.9.5 2022-09-25 15:00:56 -04:00
BenCodez a1eb2f63e5 Fix cache issues on player vote 2022-09-14 20:28:19 -04:00
BenCodez a882b8d86f Undo minor change for cache on vote 2022-09-14 15:42:32 -04:00
BenCodez 0a745ae4c0 Fix issues with cache delays for cumulative/milestones 2022-09-10 15:00:48 -04:00
BenCodez d38a0549d3 Add 1 total to cumulative on local votes to prevent cumulative delay 2022-09-09 20:23:37 -04:00
BenCodez 6e6394f1fb Always update placeholder cache on background update 2022-09-08 19:21:54 -04:00
BenCodez ce58e12740 Fix error with sockets method on broadcasts 2022-09-03 20:46:51 -04:00
BenCodez 2411354a5f Added extra debug for reminders 2022-09-02 20:10:47 -04:00
BenCodez 13efd0c482 Add option for voteparty once per week 2022-08-30 19:36:06 -04:00
BenCodez 8fce74f30d Always store bungee voteparty info incase of restart 2022-08-27 20:14:36 -04:00
BenCodez 3f54c05f86 Update version number to 6.9.4 2022-08-27 19:30:43 -04:00
BenCodez dd1cf02c49 Fix voteparty setextrarequired command 2022-08-22 15:43:35 -04:00
BenCodez b462373dfc Run bstats metrics async 2022-08-20 07:54:20 -04:00
BenCodez c6e5d008d2 Update to 1.19.2 2022-08-07 14:07:31 -04:00
BenCodez 9a91561304 Improve addpoints command 2022-08-04 15:36:19 -04:00
BenCodez 1c6981e538 Change name of plugin in softdepend 2022-07-28 15:48:15 -04:00
BenCodez b6e366ff9d Update to 1.19.1 2022-07-27 18:59:58 -04:00
BenCodez ca0fbe7e3b Update version number to 6.9.3 2022-07-23 16:21:02 -04:00
BenCodez 27d8b3e718 Change gottenmilestones column to be bigger 2022-07-22 20:11:38 -04:00
BenCodez 8430609d0f Fix error on velocity if mysql is not set 2022-07-16 17:16:55 -04:00
BenCodez 8fe5e87999 Improve config comments 2022-07-10 15:06:43 -04:00
BenCodez 6b985e19c2 Add new experimental support for redis, new fully tested 2022-07-03 21:22:17 -04:00
BenCodez 4636cc78b2 Fix an error on velocity 2022-07-03 12:01:12 -04:00
BenCodez 8c66b50749 Fix spelling 2022-06-30 07:57:10 -04:00
BenCodez 7f6e95d47e Clicking icons in /votelast can now open links (if enabled) 2022-06-27 08:11:54 -04:00
BenCodez cd60ade45f Add additional debug for loading votesites 2022-06-26 12:39:24 -04:00
BenCodez f82945b97b Fix typo 2022-06-21 19:37:51 -04:00
BenCodez a3e9651378 Add config option to always process placeholders 2022-06-21 19:14:23 -04:00
BenCodez a764ca0ed7 Undo change 2022-06-21 19:03:51 -04:00
BenCodez d21464560a Minor change in placeholder handling 2022-06-21 19:01:31 -04:00
BenCodez 88c5dc7c86 Update version number to 6.9.2 2022-06-07 16:01:30 -04:00
BenCodez b2b2c710c5 Open gui on votesite creation 2022-06-07 14:09:50 -04:00
BenCodez 4175e2d36a Update 1.19 2022-06-07 13:29:33 -04:00
BenCodez a84adb367d Modify delay to login event 2022-06-02 17:10:46 -04:00
BenCodez 7368158707 Add command /av voteexact 2022-06-02 17:01:36 -04:00
BenCodez 5d3c1cb553 Use exact player name in /av user for forcing a vote 2022-05-29 13:04:58 -04:00
BenCodez cb1206db0b Updates to pluginmessaging and sockets 2022-05-18 20:12:45 -04:00
BenCodez 03396e447f Fix color codes on bungee commands 2022-05-17 20:56:58 -04:00
BenCodez 6dec0826af Update version number to 6.9.1 2022-05-15 15:33:12 -04:00
BenCodez f443f77dfe Add option to set cumulative as recurring 2022-05-13 17:04:04 -04:00
BenCodez 5c4636d8c2 Fixed issues with settings points to quickly, causing lost points 2022-05-12 20:55:22 -04:00
BenCodez 51c6c4066b Add cumulative blacklist 2022-05-12 19:27:02 -04:00
BenCodez 161fc6da95 Improve config comment on bungee 2022-05-08 12:11:10 -04:00
BenCodez aba23f355e Fix some issues with points within rewards 2022-05-07 19:37:59 -04:00
BenCodez ac78b4d350 Fix error on bungee 2022-04-27 17:30:41 -04:00
BenCodez 0c01f8d3c1 Update version number to 6.9 2022-04-24 15:15:57 -04:00
BenCodez 77dc7d51f5 Fix alternate broadcast broadcasting 0 votes on each login 2022-04-24 14:48:27 -04:00
BenCodez ee5c4db0c9 Fix playerjoinevent not working 2022-04-24 14:46:06 -04:00
BenCodez f9b47c5c63 Fix vote point adding in rewards 2022-04-18 16:59:56 -04:00
BenCodez d7dc82b1a7 Add extra checks 2022-04-18 16:57:57 -04:00
BenCodez c5041edd8a Add exr 2022-04-18 16:57:20 -04:00
BenCodez d52b7f85b3 use new method to get reward handler 2022-04-15 20:15:58 -04:00
BenCodez 3e4564578a CHange points reward handling 2022-04-15 14:35:07 -04:00
BenCodez 65312cd2a1 Add config option to only broadcast once for offline votes 2022-04-14 20:36:19 -04:00
BenCodez b2db9675ca Add ability to check if player doesn't have permission for vote shop 2022-04-13 16:47:09 -04:00
BenCodez 0a66c2dd7e Synchronize points adding 2022-04-06 17:36:20 -04:00
BenCodez 7c02cb91f4 Update version number to 6.8.4 2022-03-26 21:16:18 -04:00
BenCodez 3a390659cd Reenable config option 2022-03-26 20:16:11 -04:00
BenCodez 99bd32c8f5 Improve placeholder cache 2022-03-24 19:59:00 -04:00
BenCodez de894a98b2 Disable auto cache placeholders when no config option present 2022-03-24 17:35:00 -04:00
BenCodez 8c668289ce Add config options for mysql 2022-03-20 14:14:04 -04:00
BenCodez 95e850cb84 Add blacklist for rewards broadcasts 2022-03-20 12:48:03 -04:00
BenCodez d2134abc45 Fix broadcast blacklist not working on bungee setups 2022-03-19 17:10:47 -04:00
BenCodez 3316662889 Add default top voter material item 2022-03-05 21:57:15 -05:00
BenCodez 5b3ced6ca9 Attempt to fix /vote help for 1.12 2022-03-05 18:54:37 -05:00
BenCodez 50a5169543 Add extra check for background task for shutdowns 2022-03-03 16:52:23 -05:00
BenCodez c8d5e2f4b5 Have placeholders return error message rather than dots 2022-03-02 17:33:05 -05:00
BenCodez 3dcd78e4f5 change vote processing to java timers (hopes to reduce thread usage) 2022-02-22 16:51:18 -05:00
BenCodez de570574c9 Fix potential NPE on velocity shutdown 2022-02-20 16:52:32 -05:00
BenCodez 116eda2866 Update version number to 6.8.3 2022-02-20 13:44:33 -05:00
BuildTools 30f1576510 Fix creating milestones in GUI not working correctly 2022-02-19 17:00:05 -05:00
BuildTools 64e897615a use java timer for login/logout event 2022-02-18 19:16:18 -05:00
BuildTools 2dfd8dcfa5 Update version number to 6.8.2 2022-02-13 15:59:08 -05:00
BuildTools 00791766f1 Change default value of config option 2022-02-13 14:28:26 -05:00
ben 4d2c783d85 Improve getting uuid on proxy setups, more efficient 2022-02-11 17:14:05 -05:00
ben 19f1664662 Ignore casing when checking for disabled votesites 2022-02-06 12:34:01 -05:00
ben ca2e6fb530 Add extra null check 2022-02-02 16:57:28 -05:00
Ben eca7c6641a Merge pull request #1220 from pseudoforceyt/patch-1
Fix bungee setup wiki link
2022-01-24 16:46:52 -05:00
Ilamparithi M 47fe6b57e2 Fix bungee setup wiki link 2022-01-24 19:34:57 +05:30
ben 911819c69b Fix weekly top voters rewards feeding off monthly top voters 2022-01-23 14:03:25 -05:00
ben cda72b5c5b Let AdvancedCore handle vanished players 2022-01-23 13:18:16 -05:00
ben 75a3da98fa Change dependency 2022-01-22 15:24:13 -05:00
ben ced74fdee3 Changes to vanish event 2022-01-22 14:22:58 -05:00
ben b8460ff755 Add debug message for vanish login 2022-01-21 22:08:29 -05:00
ben 50bb1facc4 Modify event handling for playershowevent 2022-01-21 21:20:54 -05:00
ben 5ed21949e1 Add soft depends 2022-01-19 21:28:09 -05:00
ben 253e4937db Fix playershowevent not working completely 2022-01-19 19:51:32 -05:00
ben 192685ceec Add playershowevent for vanished players 2022-01-19 17:10:38 -05:00
BenCodez 16de063e51 Update version number to 6.8.1 2022-01-15 20:43:35 -05:00
BenCodez 1d3ce9ed64 Add another check 2022-01-14 21:50:21 -05:00
BenCodez d357c927c8 Add extra checks to ensure plugin is enabled before processing a vote 2022-01-14 21:47:33 -05:00
BenCodez 1143595238 modify placeholders 2022-01-13 20:57:33 -05:00
BenCodez 0917c36889 Add null check for player in placeholders 2022-01-12 18:57:12 -05:00
BenCodez c113214ae0 Add extra check on placeholders 2022-01-12 16:44:47 -05:00
BenCodez b2c444d125 Add PlayerPostVoteEvent 2022-01-11 21:04:50 -05:00
BenCodez 78fdce0eab fix npe 2022-01-10 18:51:02 -05:00
BenCodez feff09eccb Fix potential NPE 2022-01-09 17:35:57 -05:00
BenCodez d0646472bf Fix typos in votesites.yml 2022-01-09 11:22:29 -05:00
BenCodez 8471f50402 Fix certain placeholders not working 2022-01-06 19:28:13 -05:00
BenCodez 621450dae4 Add option to enable/disable auto placeholder cache 2022-01-03 21:15:16 -05:00
BenCodez 84e415e4bc Update version number to 6.8 2022-01-03 10:41:31 -05:00
BenCodez 54bbc8c740 Adding auto placeholder caching 2022-01-03 10:02:45 -05:00
BenCodez 7b1ab7e833 Code cleanup 2021-12-30 20:27:21 -05:00
BenCodez acb8f8a43f Code cleanup 2021-12-30 20:20:44 -05:00
BenCodez 279759b52f Code cleanup 2021-12-30 20:13:27 -05:00
BenCodez 02ca0b1fc8 Give players vote party reward, even if player has no reward data 2021-12-29 18:36:27 -05:00
BenCodez d57e3d1006 Add option to limit player data loading 2021-12-28 17:35:39 -05:00
BenCodez d54769eb82 Add command alias 2021-12-23 21:57:47 -05:00
BenCodez 35f6a3df15 Start progress on bungee time handling, keeps bungee in sync 2021-12-23 19:35:30 -05:00
BenCodez 46b66466ba Add ability to toggle vote reminders 2021-12-23 19:05:26 -05:00
BenCodez 53fbe4e5e2 Changes to placeholders 2021-12-21 18:55:12 -05:00
BenCodez 53ef7a7086 Add another event 2021-12-20 16:46:36 -05:00
BenCodez b0e08721fa Add scope to redis dependency 2021-12-19 21:00:20 -05:00
BenCodez 29dad6ca25 Add null check for redis 2021-12-19 17:48:03 -05:00
BenCodez 7c3e5eb09b Add bungee vote party placeholders 2021-12-19 14:40:50 -05:00
BenCodez a7776ec97c Hide socket settings by default to avoid confusion 2021-12-19 13:18:27 -05:00
BenCodez d598082c0a Add cache system for placeholders 2021-12-18 21:19:38 -05:00
BenCodez 4539b5b22a Add extra permission checks 2021-12-14 16:53:49 -05:00
BenCodez 02fe645d1e More changes to vote party commands 2021-12-12 12:52:37 -05:00
BenCodez ee8af6a314 Modify voteparty commands, add new ones to set/add totals 2021-12-12 12:49:50 -05:00
BenCodez a4b78c7d16 More fixes for redis 2021-12-11 08:20:20 -05:00
BenCodez d22fe462e5 Test change for redis 2021-12-10 17:02:53 -05:00
BenCodez c19182a2b4 Reuse config option 2021-12-07 17:32:03 -05:00
BenCodez 6905c3988b Remove option, auto enable redis support 2021-12-07 17:28:08 -05:00
BenCodez 23be120adc Small changes 2021-12-07 17:18:19 -05:00
BenCodez dae863f88f Bug fix 2021-12-07 17:07:54 -05:00
BenCodez d12f73d2fa Add option for redis bungee 2021-12-07 17:01:51 -05:00
BenCodez 316ee90713 Slight improvement to login events on bungee 2021-12-07 16:57:13 -05:00
BenCodez 1495fad96f Add softdepend 2021-12-07 16:47:23 -05:00
BenCodez 8e0de1709b Add permission requirements to base admin command 2021-12-06 18:52:57 -05:00
BenCodez ad22802e10 Remove unused command in plugin.yml 2021-12-06 16:53:21 -05:00
BenCodez 6de0345f06 Add option for backbutton on best GUI 2021-12-05 14:20:38 -05:00
BenCodez 7338a7d8ba added best and streak GUI's to vote gui ability to open 2021-12-05 13:32:44 -05:00
BenCodez 3ca12f2c91 Add expiremental redis support, untested 2021-12-05 12:51:13 -05:00
BenCodez 262e7c48c7 Fix socket method on velocity 2021-12-04 18:46:38 -05:00
BenCodez 0b62d99f9d Add debug for velocity socket method 2021-12-04 14:59:31 -05:00
BenCodez ea30de47d1 Update version number to 6.7.1 2021-11-28 19:11:17 -05:00
BenCodez a76daf3aba Modify debug on bungee 2021-11-28 16:46:58 -05:00
BenCodez e1ff13f4bf Add more debug for bungee for testing 2021-11-28 16:35:53 -05:00
BenCodez 12f941cf83 Add option for per server milestones 2021-11-27 20:21:42 -05:00
BenCodez 243377a76a More changes for 1.18 support 2021-11-27 19:38:15 -05:00
BenCodez d7eab03860 Fix bungee debug always active when it shouldn't 2021-11-27 17:21:10 -05:00
BenCodez ddd1f473f1 Properly reset gotten milestones on /av resyncmilestonesalreadygiven 2021-11-23 16:51:57 -05:00
BenCodez 3e52bb0936 Update library to support 1.18 2021-11-21 20:56:55 -05:00
BenCodez eb60220b1e Undo vote thread changes 2021-11-17 16:41:49 -05:00
BenCodez 00902bd597 Add a vote thread to prevent hitting resource limit 2021-11-15 17:22:48 -05:00
BenCodez d3606088cd Add option to only give 1 cumulative at a time 2021-11-07 13:55:18 -05:00
BenCodez ef2512e4e2 Change log level to info for using dev build 2021-11-01 16:41:55 -04:00
BenCodez 7f95a1c7c3 Fix issue with votereminding on shutdown 2021-10-21 16:42:54 -04:00
BenCodez 68a2fe27ff Update version number to 6.7 2021-10-10 14:08:38 -04:00
BenCodez b05317c460 Fix a few things with bungee voteparty 2021-10-10 13:50:47 -04:00
BenCodez 62fee6f347 Fix voteshop confirm not going back to main voteshop gui when it should 2021-10-05 20:25:44 -04:00
BenCodez ef7d4254e1 Fix more issues with velocity 2021-10-03 14:07:36 -04:00
BenCodez b6720ccc1f Fix issue on velocity 2021-10-03 13:52:43 -04:00
BenCodez 69d3d33008 Fix issue on velocity 2021-10-03 12:33:18 -04:00
BenCodez 7a193c87a9 Add vote party on bungee, online only, partly tested 2021-09-27 20:16:25 -04:00
BenCodez f2cf2fb734 Fix top voter clicking in GUI 2021-09-25 15:43:53 -04:00
BenCodez 836079b5ea Prevent NPE 2021-09-19 12:02:55 -04:00
BenCodez a7f6456480 Add option for closing inventory on vote 2021-09-17 17:15:51 -04:00
BenCodez 82f25c3899 Add debug message for disabled milstone 2021-09-13 17:23:22 -04:00
BenCodez cb2cdbd4fc Add points placeholder to vote shop 2021-09-08 16:59:15 -04:00
BenCodez 40d2b651a8 Update version number to 6.3.3 2021-09-05 12:26:42 -04:00
BenCodez a999d9e9bb Sync votes better with cache 2021-09-01 18:59:09 -04:00
BenCodez b144f2db9c Small change to caching on voting 2021-09-01 18:50:01 -04:00
BenCodez 24060a10ed Small improvement 2021-09-01 14:56:17 -04:00
BenCodez 4c8919804f Prevent duplicate broadcasts if bungee broadcasts 2021-08-30 15:21:59 -04:00
BenCodez 66618260bb Update version number to 6.6.2 2021-08-29 13:28:29 -04:00
BenCodez f441ede6b0 Bug fix 2021-08-29 12:47:04 -04:00
BenCodez 593ae76354 Modify metrics and message 2021-08-28 18:14:01 -04:00
BenCodez aa49dc5bc1 Improve proxy offline voting handling 2021-08-25 15:22:04 -04:00
BenCodez 8941d909ca Add synchronization to offline vote checks on proxy 2021-08-24 14:48:53 -04:00
BenCodez 2946792dec Change handling of some vote top commands 2021-08-23 19:06:41 -04:00
BenCodez 0567f0ac66 Add disablebroadcast to a few other areas 2021-08-22 17:20:26 -04:00
BenCodez fe78992477 Update config values 2021-08-22 14:44:09 -04:00
BenCodez 195e1c82bd Enable broadcast option on bungee to work for pluginmessaging 2021-08-22 14:42:23 -04:00
BenCodez 9479fe06c0 Modify broadcast handling 2021-08-22 14:32:45 -04:00
BenCodez 0807caed98 Fix potential issues 2021-08-20 15:02:35 -04:00
BenCodez 9fdcf5aa78 Fix update message contain invalid command & clear cache on adding point 2021-08-17 18:43:28 -04:00
BenCodez 8d26e66dc0 Remove jars 2021-08-16 19:02:10 -04:00
BenCodez 14e61ba6bf Update version to 6.6.1 2021-08-16 18:26:51 -04:00
BenCodez 6d361cc83f Shutdown mysql on bungee/velocity on shutdown 2021-08-16 16:44:32 -04:00
BenCodez 1e32fd65e0 Remove files 2021-08-16 14:59:56 -04:00
Ben 5f0d8fff2f Update .gitignore 2021-08-16 14:59:26 -04:00
BenCodez 0d828a99bc Add more info about build number 2021-08-15 20:30:44 -04:00
BenCodez 0e8bd23784 Undo repo change 2021-08-15 19:01:02 -04:00
BenCodez a8af2a49ad Change build setup 2021-08-15 18:42:17 -04:00
BenCodez 54b08019ec Fix getting build number 2021-08-15 18:35:37 -04:00
BenCodez 27f01a6c3a Remove build number on version command 2021-08-15 17:50:00 -04:00
BenCodez 337aab384f Add build number info on startup 2021-08-15 17:45:41 -04:00
BenCodez a94e1c1dd6 Add build number information for jenkins 2021-08-15 17:19:28 -04:00
BenCodez 1445d97ce0 Bug fix 2021-08-15 17:02:44 -04:00
BenCodez 9e8abe0768 Fix issue on velocity with votes 2021-08-15 16:52:21 -04:00
BenCodez ca92a76b15 Undo pom change 2021-08-15 13:28:08 -04:00
BenCodez 637c8a158b Fix javadoc and pom 2021-08-15 13:26:21 -04:00
BenCodez 85b1ed9916 Code cleanup 2021-08-15 13:20:29 -04:00
BenCodez 389c9a138e Update version number to 6.6 2021-08-15 13:10:14 -04:00
BenCodez 7dc5c32db3 Code cleanup 2021-08-15 13:06:57 -04:00
BenCodez dcc1e375a9 Cache extra allsites check value if enabled 2021-08-15 12:33:10 -04:00
BenCodez 176373e2a4 A lot of improvements 2021-08-14 20:09:02 -04:00
BenCodez 2cd7d5db00 Use API to wipe certain data values 2021-08-12 18:36:53 -04:00
BenCodez 05fc747557 Fix a few issues regarding cache system and more 2021-08-11 16:20:55 -04:00
BenCodez 528ca45b26 Speed up voteparty resets 2021-08-11 15:46:13 -04:00
BenCodez b4b420479e Fix caching related to voteparty 2021-08-11 15:29:53 -04:00
BenCodez 10a44f5999 Undo cache setting 2021-08-11 15:19:47 -04:00
BenCodez 03f012eef4 Changes to cache handling 2021-08-08 13:22:17 -04:00
BenCodez e302c29a9e Fix command message 2021-08-07 19:56:45 -04:00
BenCodez 9d7454f9c3 Add command to clear gotten milestones 2021-08-07 18:43:57 -04:00
BenCodez 0731288028 Improve cooldowncheck reward 2021-08-06 21:59:47 -04:00
BenCodez bb061c400f Check permission on remind login, redo cooldown check processing 2021-08-06 19:23:55 -04:00
BenCodez 0ef664efcd Slight modification to caching on vote 2021-08-05 16:18:50 -04:00
BenCodez 0a6c64f9a1 Add more bstats metrics data 2021-08-04 17:02:53 -04:00
BenCodez 3fd328ed91 Fix cache issues with /vote givepoints & add voteshop logging 2021-08-04 16:51:03 -04:00
BenCodez 4923ca6f64 Improve proxy side of things 2021-08-04 16:26:42 -04:00
BenCodez 7e88e4350d Little improvement on background task, default voteparty to online only 2021-08-04 16:14:31 -04:00
BenCodez 04ea20b2c2 Add proxy logging for plugin disable 2021-08-04 14:57:10 -04:00
BenCodez 8491e2e45b Delay updating voteurl a bit 2021-08-04 14:52:55 -04:00
BenCodez 88c1d91675 Some more improvements to background tasks 2021-08-02 19:10:42 -04:00
BenCodez c45c9dc970 Fix a few issues 2021-08-02 13:14:46 -04:00
BenCodez 63807f2617 Add debug message for proxy total setting 2021-08-01 21:47:36 -04:00
BenCodez bfeb112774 Fix issue with vote adding on bungee/velocity 2021-08-01 21:22:27 -04:00
BenCodez d45119ccca Improved handling of top voter 2021-08-01 14:24:30 -04:00
BenCodez 7d5f64636b Improvement to reduce ram usage 2021-07-31 21:46:58 -04:00
BenCodez fbb61808ba Change preload skull handling 2021-07-31 08:37:42 -04:00
BenCodez 800c89f240 update with advancedcore changes 2021-07-30 20:25:58 -04:00
BenCodez 20cc999f0d Change default amount of top voters to load 2021-07-30 16:45:11 -04:00
BenCodez 3604abb307 Add additional debug message 2021-07-29 20:30:28 -04:00
BenCodez 4b56d642e5 Fix top voter 2021-07-29 20:22:54 -04:00
BenCodez 81f0d46aea Internal improvements 2021-07-29 20:13:37 -04:00
BenCodez a2f7336b53 Add time it took for time resets 2021-07-29 15:07:18 -04:00
Ben 38ae2c32dc Update README.md 2021-07-28 15:59:15 -04:00
BenCodez d6b2d21e7c Undo test change 2021-07-28 15:48:15 -04:00
BenCodez 83bcae4a59 Update url 2021-07-28 15:46:22 -04:00
BenCodez b9c862580b Test change to upload snapshots 2021-07-28 15:42:48 -04:00
BenCodez c30f725ed2 Fix handling in top voter caching 2021-07-27 16:22:49 -04:00
BenCodez ca8eb546a5 Fix NPE 2021-07-27 14:51:23 -04:00
BenCodez 0335608162 Adjust caching 2021-07-26 15:50:41 -04:00
BenCodez 593899a434 Fix a few issues with bungee pluginmessaging 2021-07-25 20:21:18 -04:00
BenCodez 8eb8d746d9 Slight improvement on placeholders 2021-07-25 19:47:01 -04:00
BenCodez b8ef63c9ba Little fix 2021-07-25 16:44:03 -04:00
BenCodez dfb8610489 Small improvements 2021-07-25 14:27:47 -04:00
BenCodez 3801059cf6 Use new caching system 2021-07-25 13:41:15 -04:00
BenCodez 2b3aea7f83 Handle empty service sites on votes 2021-07-20 16:57:39 -04:00
Ben af42aa4b50 Update README.md 2021-07-20 16:27:43 -04:00
Ben 2d2b35522e Update README.md 2021-07-20 16:26:31 -04:00
Ben 2a586324d4 Update README.md 2021-07-20 16:25:48 -04:00
BenCodez 5bd9c926ba Update repo url 2021-07-20 16:16:17 -04:00
BenCodez e76c30fca2 Add check for empty service site 2021-07-20 14:49:11 -04:00
BenCodez e42bd3725a Change to votifier event 2021-07-19 18:33:13 -04:00
BenCodez 660c8d9501 Trigger votifier event async 2021-07-19 17:38:38 -04:00
BenCodez 44a65bc347 Update version number 6.5.2 2021-07-18 18:39:16 -04:00
BenCodez f3d27f4816 Add version to bstats for velocity 2021-07-18 17:39:23 -04:00
BenCodez 4c3891fa0a Shorten mysql errors a little bit 2021-07-18 14:54:20 -04:00
BenCodez 5072265549 Update version number to 6.5.1 2021-07-18 14:06:32 -04:00
BenCodez 788b58f9cd Fix issues with wrong votesite being returned on bungee votes 2021-07-18 14:02:38 -04:00
BenCodez 0db34f815f Add internal jar version on velocity 2021-07-18 13:16:56 -04:00
BenCodez 900237b7ea Add maven profile 2021-07-17 20:06:58 -04:00
BenCodez 7fa7c2baf9 Update version to 6.5 2021-07-17 20:02:13 -04:00
BenCodez eec8d706ee Add ignore to insert queries on mysql 2021-07-16 19:04:12 -04:00
BenCodez d292ae4a18 Bug fix 2021-07-16 16:06:24 -04:00
BenCodez f7d04f87db Bug fix 2021-07-14 16:09:15 -04:00
BenCodez 59e2f3da99 Rewrite convert command 2021-07-13 17:16:54 -04:00
BenCodez 2a5b6c23da Check for valid player on /vote givepoints 2021-07-12 19:35:02 -04:00
BenCodez 62560be2ab More reminding bug fixes 2021-07-12 16:40:57 -04:00
BenCodez 64993b8b53 More reminding improvements 2021-07-12 16:35:39 -04:00
BenCodez 18c4cd6b6d Don't show hidden votesites in /vote next 2021-07-12 16:30:20 -04:00
BenCodez 35e14f7a76 Factor in hidden votesites 2021-07-12 16:22:24 -04:00
BenCodez 5c6490159b More attempted fixes at vote reminding 2021-07-12 16:09:31 -04:00
BenCodez 29f0c19a74 Fix vote reminding not reminding correctly 2021-07-12 15:46:35 -04:00
BenCodez 664500d61b Adjust vote reminding 2021-07-12 14:49:16 -04:00
BenCodez e208cdf49b Dependency change 2021-07-11 19:51:55 -04:00
BenCodez e295795ec4 Change maven profiles 2021-07-11 19:50:41 -04:00
BenCodez c9d24b5e88 Update importants 2021-07-11 12:47:47 -04:00
BenCodez f09311e6fc Undo change to relocation 2021-07-11 12:20:58 -04:00
BenCodez 02ea389f12 Update importants 2021-07-10 18:04:29 -04:00
BenCodez 14ccfa3730 update dependency 2021-07-10 17:38:50 -04:00
BenCodez 51ffe88557 Change artifactid to lowercase 2021-07-10 17:37:24 -04:00
BenCodez 7daa0545f3 Change default vote reminding, remind on anysite by default 2021-07-08 20:01:33 -04:00
BenCodez ef7b9cb55a Add log message for votes on velocity 2021-07-08 19:46:16 -04:00
BenCodez a410567de0 Bug fix 2021-07-08 18:47:20 -04:00
BenCodez f00aeab649 Bug fix 2021-07-08 17:43:47 -04:00
BenCodez a4494fc2e7 Fixed issue with velocity uuid check 2021-07-08 17:32:52 -04:00
BenCodez 6333760508 Better console message for ignoring vote on proxy server 2021-07-08 17:16:57 -04:00
BenCodez 012547f950 Update to 1.17.1 2021-07-06 19:48:10 -04:00
BenCodez 631d9c9a1c Code cleanup 2021-07-06 16:56:36 -04:00
BenCodez a61e3176a8 Update profile 2021-07-03 20:23:15 -04:00
BenCodez c013835725 renable javadoc 2021-07-03 19:37:39 -04:00
BenCodez ea8ed1e950 disable javadoc for testing 2021-07-03 19:35:19 -04:00
BenCodez 7dcb3a5f62 temp disable javadoc 2021-07-03 19:34:27 -04:00
BenCodez ed70727a76 Update pom 2021-07-03 19:28:09 -04:00
BenCodez 3418d461e4 Improve vote reminding 2021-07-01 21:28:08 -04:00
BenCodez 1e5ec8226a Small little fixes 2021-07-01 16:42:22 -04:00
BenCodez 993fa19f85 Bug fix 2021-06-30 20:09:01 -04:00
BenCodez 7d3d777cb5 Send update plugin message on vote 2021-06-30 19:41:36 -04:00
BenCodez 9829864a96 Actually open shop page when it's suppose to 2021-06-30 18:38:06 -04:00
BenCodez eec87f642f Don't close inventory unless needed for shop GUI confirmation 2021-06-30 18:28:31 -04:00
BenCodez 9cba16814a Don't generate votesite if site exists but is disabled 2021-06-30 17:01:44 -04:00
BenCodez 44ebd17356 Set bungeecoord-api version 2021-06-30 13:34:58 -04:00
BenCodez ba2312ed46 Add line for mysql in default config 2021-06-30 07:54:44 -04:00
BenCodez 2d8f9e1ca1 Update bstats class 2021-06-29 21:50:10 -04:00
BenCodez 7556a203c2 Fix version of maven plugin 2021-06-29 13:11:27 -04:00
BenCodez 67b8fbcc88 Update version number 2021-06-29 13:05:02 -04:00
BenCodez 4c9f7f76b9 Fix comments 2021-06-28 17:20:04 -04:00
BenCodez df388ca0e3 Add commands to set votestreaks 2021-06-25 16:02:53 -04:00
BenCodez 1d8fc309ff Bug fix 2021-06-23 19:35:44 -04:00
BenCodez 42a159ea82 Little comment change 2021-06-21 17:08:05 -04:00
BenCodez a62187e0cb Better handling when mysql isn't working on bungee & velocity 2021-06-20 18:52:14 -04:00
BenCodez 7896b2f08a Added /av vote (player), with GUI 2021-06-20 14:09:03 -04:00
BenCodez 034d031d79 Add failsafe for votesite loading 2021-06-19 22:12:07 -04:00
BenCodez e228fd6fed Remove barely used command 2021-06-16 21:09:33 -04:00
BenCodez baa85d7222 Update version number to 6.4 2021-06-13 13:37:29 -04:00
BenCodez 5fd2d976a2 Change convert players amount & add login pluginmessage for faster votes 2021-06-13 12:52:30 -04:00
BenCodez 03ac8627df Add libraries for 1.17 support 2021-06-12 20:47:37 -04:00
BenCodez 63d6f2829c Minor changes to sign handling 2021-06-11 19:11:20 -04:00
BenCodez 9824a891b6 Update to 1.17 2021-06-11 16:59:02 -04:00
BenCodez a648074757 Fix velocity issue 2021-06-11 16:12:28 -04:00
BenCodez 5e3a3621bc Make sure directly is created for votingplugin 2021-06-09 15:53:12 -04:00
BenCodez 01a645083f Replace - char for server name for column names 2021-06-06 15:50:17 -04:00
BenCodez 8b9aced63c Add FirstVoteToday reward 2021-06-06 12:33:45 -04:00
BenCodez 6eba6aee3b Don't attempt to get placeholders if cache needs to load 2021-06-06 12:25:35 -04:00
BenCodez 0fbbaaee5d Edit comments in SpecialRewards.yml 2021-06-04 19:37:52 -04:00
BenCodez 57e973b371 Add check for milestones adding milestone count 2021-06-04 15:59:06 -04:00
BenCodez c93f8f06f2 Remove unneeded dependency 2021-06-04 15:45:38 -04:00
BenCodez 6a742dbecc Add debug message 2021-06-03 17:27:27 -04:00
BenCodez c3edbf946c Fix velocity files not generating by default & errors when mysql not set 2021-06-02 19:32:46 -04:00
BenCodez 24fcd076b8 Bug fix 2021-06-02 15:47:57 -04:00
BenCodez a6ac022cb3 Relocate bstats 2021-06-01 17:32:28 -04:00
BenCodez 363c57158f Force generate file when needed 2021-06-01 17:19:58 -04:00
BenCodez d22e22480e Little change to maven profile 2021-05-31 19:56:29 -04:00
BenCodez daf1d95c82 Add jar 2021-05-31 19:51:02 -04:00
BenCodez 35d588477d Fix nuvotifier build issue 2021-05-31 19:50:03 -04:00
BenCodez 2ba3ee0323 Fix jitpack errors 2021-05-31 19:38:34 -04:00
BenCodez ed1ccc0623 Fix velocity not working 2021-05-31 19:22:37 -04:00
BenCodez 2332079002 Fix a few issues 2021-05-31 17:11:30 -04:00
BenCodez 3b7f8afe76 Attempt at velocity support 2021-05-30 16:04:41 -04:00
BenCodez 4c33f3d03c Update version number to 6.3.2 2021-05-30 12:29:21 -04:00
BenCodez cfd317f5a8 Add ability to set hover color on /vote help 2021-05-24 10:01:13 -04:00
BenCodez 063b44aa67 Only send bstats info for bungee settings if enabled 2021-05-24 08:54:02 -04:00
BenCodez a42c00ecf5 Change material for 1.12 2021-05-24 08:02:32 -04:00
BenCodez 9e36f0a500 Add more metrics stats 2021-05-23 16:53:28 -04:00
BenCodez f13386ad29 Add more bstats info for bungee 2021-05-23 16:37:03 -04:00
BenCodez 1c3dbcc8d6 Code cleanup 2021-05-22 20:36:44 -04:00
BenCodez 1d4f34ec84 Update version number to 6.3.1 2021-05-22 20:33:55 -04:00
BenCodez 2ef4194a51 Rename config option for voteparty 2021-05-22 20:00:42 -04:00
BenCodez 98f60f1350 Add missing vote party option 2021-05-22 19:43:43 -04:00
BenCodez 02f98c739f Add pointsonvote for bungee 2021-05-22 19:25:04 -04:00
BenCodez 766fa58157 Add command /av vote (with no other args) 2021-05-22 16:39:46 -04:00
BenCodez ebf0c2fb4f Change cumulative to a much cleaner looking option for total to use 2021-05-22 16:38:07 -04:00
BenCodez bc3cfc7986 Add option for placeholders to always cache 2021-05-22 08:25:28 -04:00
BenCodez e516f5ee87 Reduce delay a bit 2021-05-18 15:59:09 -04:00
BenCodez 7abe7c6224 Bug fix 2021-05-17 16:26:15 -04:00
BenCodez e46a9c7476 Bug fix 2021-05-16 12:30:49 -04:00
BenCodez 891f4a9d24 Bug fix 2021-05-15 15:28:20 -04:00
BenCodez df6d771e4d Add a different option for votelast gui 2021-05-15 15:26:34 -04:00
BenCodez 0f861c4ab7 Add placeholder TimeUntilDayReset 2021-05-12 16:37:11 -04:00
BenCodez 510d4d1895 Delay bungee check 2021-05-12 16:15:22 -04:00
BenCodez cd4af0ff5d Add config option for voteparty 2021-05-12 16:12:31 -04:00
BenCodez 77f508682e Add command argument all for votesite /av vote 2021-05-10 16:07:46 -04:00
BenCodez 3a41a94f47 Merge branch 'master' of https://github.com/BenCodez/VotingPlugin 2021-05-09 13:59:26 -04:00
BenCodez cba19065a4 Add ability to edit bungeesettings.yml 2021-05-09 13:58:32 -04:00
BenCodez 19a652a1fa Add ability to edit config 2021-05-09 13:58:19 -04:00
BenCodez c8f8077159 Add ability to set points on a per server level 2021-05-08 20:27:37 -04:00
BenCodez 60db0e87f4 add method 2021-05-07 20:36:35 -04:00
BenCodez f581ce26fb Update version number to 6.3 2021-04-25 13:53:14 -04:00
BenCodez 0cc06a0b1f Remove unused file 2021-04-25 12:45:31 -04:00
BenCodez 27dfa7e481 Improvements to interact event & more 2021-04-24 21:07:38 -04:00
BenCodez 0659fd8b84 Bug fix 2021-04-24 07:53:25 -04:00
BenCodez 8512eef6c0 Another little bug fix 2021-04-23 21:54:16 -04:00
BenCodez e860195847 Bug fix 2021-04-23 21:43:22 -04:00
BenCodez 3c34798d1a Fixed bug regarding help command permissions 2021-04-23 19:09:58 -04:00
BenCodez 1275a10de5 Add config option 2021-04-23 18:28:38 -04:00
BenCodez 99c2e9aa1f Fix broadcast handler 2021-04-22 16:56:16 -04:00
BenCodez d3b0787f90 Bug fix for /vote shop (item) command 2021-04-21 17:34:05 -04:00
BenCodez faad7d3b85 Little fix 2021-04-20 20:21:24 -04:00
BenCodez 099596fdde Add config option for geyser support 2021-04-20 17:34:33 -04:00
BenCodez ab202ffe1c Add option to trigger votifier event 2021-04-20 17:14:07 -04:00
BenCodez b935d7f578 Add alternate broadcast method 2021-04-19 18:54:09 -04:00
BenCodez d505d197ba Change default option 2021-04-18 14:38:38 -04:00
BenCodez 12c9aab745 Bug fix 2021-04-18 14:14:56 -04:00
BenCodez 3c10cb2340 Update to reward api changes 2021-04-17 21:54:52 -04:00
BenCodez f57cc3bc06 Add option to move backbutton to end of GUI 2021-04-14 19:22:19 -04:00
BenCodez eb4afec6db Undo placeholder change 2021-04-12 17:05:44 -04:00
BenCodez 35b4df196d Little change 2021-04-11 15:34:07 -04:00
BenCodez 038e8fb98a increase column size 2021-04-10 20:03:31 -04:00
BenCodez b84a14f849 Change top voter placeholder parsing 2021-04-09 17:02:09 -04:00
BenCodez eeda3875e4 Add option to disable player interact event 2021-04-09 16:52:41 -04:00
BenCodez a584a78734 Parse top voter placeholders as current player 2021-04-08 18:40:37 -04:00
BenCodez e408c07f85 Update version number 2021-04-07 17:01:28 -04:00
Ben 4700684f03 Fix yml error 2021-04-07 04:48:56 -04:00
BenCodez 8ef7631eed Add option to ignore can vote per votesite 2021-04-04 16:13:59 -04:00
BenCodez 825d736a58 Update version number 2021-04-04 14:29:22 -04:00
BenCodez b3f5aac192 Bug fix with cumulative remove 2021-04-04 14:22:07 -04:00
BenCodez e06b21d69c Check if bungee votifier event exists before enabling event 2021-04-04 12:27:12 -04:00
BenCodez 9dc3a99885 Add config options 2021-04-03 15:32:59 -04:00
BenCodez 18145b8340 Add missing config options 2021-04-03 15:32:01 -04:00
Ben f25bbf3437 Update stale.yml 2021-04-02 17:01:54 -04:00
BenCodez 2d53ae7452 Fix a few issues with reward GUI editing 2021-04-02 16:44:46 -04:00
BenCodez 0f67c0db36 Add missing classes from commit 2021-04-02 14:58:33 -04:00
BenCodez 436dc01edd Add ability to edit voteparty, milestones, cumulative & more via gui's 2021-04-02 14:53:02 -04:00
BenCodez a1bee2fa05 Remove unneeded maven dependency 2021-03-27 19:05:43 -04:00
BenCodez 78ab2de0e9 Update version number 2021-03-27 17:45:10 -04:00
BenCodez 76823d74f1 Add ability to edit voteshop rewards 2021-03-23 19:30:49 -04:00
BenCodez db51306ef9 Modify cooldown check handling 2021-03-21 19:36:08 -04:00
BenCodez b95f2beaf5 Add directly defined reward handling 2021-03-21 16:17:17 -04:00
BenCodez 7be07b0102 Increase message on bungee votes debug 2021-03-18 17:24:20 -04:00
BenCodez 6eeee7ca02 Disable VoteCoolDown background task by default if no rewards set 2021-03-18 17:19:58 -04:00
BenCodez 7bbddc9a8a Auto disable cooldown check if needed 2021-03-17 17:05:37 -04:00
BenCodez ac994ac864 Update version number 2021-03-14 12:51:20 -04:00
BenCodez 1aca211e71 Increase delay for cooldown check 2021-03-14 12:27:55 -04:00
BenCodez c7d0b09706 Little changes to addition 2021-03-13 21:56:22 -05:00
BenCodez 5999b778b3 Add option to delay login event 2021-03-13 21:53:40 -05:00
BenCodez 04d21ccb4e Additional little bug fix regarding bungee online/offline reward handles 2021-03-13 21:19:05 -05:00
BenCodez 3ba63bfaec Bug fix 2021-03-13 21:17:55 -05:00
BenCodez eeb7d3da1d Add option to disable cooldown check 2021-03-13 08:03:58 -05:00
BenCodez cfaae26c16 Bug fix 2021-03-12 16:33:23 -05:00
BenCodez 5806e6adad Change default value of config option 2021-03-10 19:10:41 -05:00
BenCodez 6718b49e49 Fix placeholders getting parsed when they shouldn't 2021-03-06 19:42:31 -05:00
BenCodez 403fe20f68 Update version number 2021-03-06 19:32:43 -05:00
BenCodez 2dd6ef4da5 Add config option 2021-03-06 15:29:48 -05:00
BenCodez 42fd72723d Add option to change backbutton to voteurl 2021-03-06 14:18:44 -05:00
BenCodez 8ea599d739 Add try/catch as failsafe 2021-03-04 17:03:38 -05:00
BenCodez 104baa80eb Add /av resetmilestonecount 2021-03-03 16:50:11 -05:00
BenCodez 9c700268a6 Bug fix 2021-03-02 20:29:38 -05:00
BenCodez e158f43c11 Remove config option for storing monthly votes, always store montly top 2021-03-01 19:25:03 -05:00
BenCodez 617f8a9a7d Add class 2021-03-01 19:10:38 -05:00
BenCodez 63edc5bf4f Implement bungee version 2021-03-01 19:09:45 -05:00
BenCodez 492dca7a22 Add option 2021-02-28 10:50:47 -05:00
BenCodez 69a6485317 Add option to disable clicking top voters skulls opening VoteGUI 2021-02-28 10:50:11 -05:00
BenCodez 1b75dfb886 Add ability to edit voteshop with GUI's 2021-02-27 20:42:09 -05:00
BenCodez 652deabf83 Fix issue with votedelay not being able to be 0 2021-02-24 18:54:10 -05:00
BenCodez 1c4b0c687b Add different text colors for voteurl sites 2021-02-24 17:01:25 -05:00
BenCodez 80455d68e2 Update version number 2021-02-21 14:31:00 -05:00
BenCodez 0d8dd6eb60 Changes to allsites reward checks 2021-02-21 13:52:31 -05:00
BenCodez 7cfd3e5a94 Fix hidden votesite option, a lot of other fixes from recent changes 2021-02-21 13:44:46 -05:00
BenCodez 46d9b07db3 Modify voteurl a little more 2021-02-20 17:39:56 -05:00
BenCodez ac4f5a4b02 Modify VoteURL to be more configurable 2021-02-20 17:35:08 -05:00
BenCodez 5bfa59508a Keep bungee from failing to load on bungee without votifier 2021-02-20 17:16:57 -05:00
BenCodez 9d53af3059 Organize config file 2021-02-17 19:33:40 -05:00
BenCodez 82c32c6ed1 Little fix for spigot setting totals on bungee methods 2021-02-17 19:12:15 -05:00
BenCodez af5b4231c2 Add option for what server handles totals 2021-02-17 19:11:08 -05:00
BenCodez 00c1830ced Add option to hide votesites 2021-02-17 18:37:00 -05:00
BenCodez 335888d0ad Add option for extra allsites check, works per server 2021-02-15 17:19:27 -05:00
BenCodez 397f71020c Modify yml error messages 2021-02-14 12:49:35 -05:00
BenCodez 31ea9f8413 Add WaitForUserOnline, modify bungee handling 2021-02-13 21:12:16 -05:00
BenCodez bfcbcb8802 Broadcast on force voteparty command 2021-02-13 13:40:20 -05:00
BenCodez 30bf07edc7 Actually set per server rewards option 2021-02-12 18:50:41 -05:00
BenCodez be3de852ce Add per server rewards option 2021-02-12 18:49:28 -05:00
BenCodez d9f3c4a465 Add bypass option for votifier 2021-02-12 17:53:16 -05:00
BenCodez b3c3a30ea4 Bug fix 2021-02-11 20:39:33 -05:00
BenCodez f785b1256d Bug fix 2021-02-11 20:13:48 -05:00
BenCodez 5b4d93197c Update version number 2021-02-07 13:41:40 -05:00
BenCodez d1d159ba90 Modify socket method to work more like pluginmessaging 2021-02-07 13:13:56 -05:00
BenCodez 8501c351dd Background check votes on bungee 2021-02-06 21:45:01 -05:00
BenCodez a61d8bbd04 Ignore votes from votifier when using bungeemethod pluginmessaging 2021-02-06 19:04:11 -05:00
BenCodez ccd39ebc89 Permission fixes 2021-02-06 15:57:32 -05:00
BenCodez da04ddad7d Improve status command to show blocked servers 2021-02-05 22:13:03 -05:00
BenCodez 498210d709 Bungee change 2021-02-05 21:53:30 -05:00
BenCodez c128bec2af Add ability to execute rewards on clicking vote gui 2021-02-05 19:32:02 -05:00
BenCodez 84ce9275f0 Little change to help with perms 2021-02-04 16:47:35 -05:00
BenCodez 66bdd9b5c7 Add option 2021-02-03 18:32:23 -05:00
BenCodez b02ab916cd Store all top voters on top voter storing 2021-02-02 19:23:44 -05:00
BenCodez a2068da36b Update spigot api version 2021-02-01 17:42:09 -05:00
BenCodez 83c43331a9 Update version number 2021-02-01 17:02:59 -05:00
BenCodez afe68ef229 Little change 2021-02-01 16:53:45 -05:00
BenCodez 7eec56ee2a Changed to top voter file storing 2021-02-01 16:49:10 -05:00
BenCodez 2ed462b61c Little change for default value 2021-01-31 12:31:34 -05:00
Ben dd142d20fe Merge pull request #1106 from Gadsee/patch-1
Prevent clients from sending plugin messages
2021-01-30 21:48:05 -05:00
Gadsee 8a340dc292 Add missing import 2021-01-31 03:21:05 +01:00
Deko e77201613e Prevent clients from sending plugin messages
Clients can send data over the plugin message channels the same way servers can. Canceling the event and returning if the message was not sent by the Server fixes the issue.
In the worst case scenario, the server will crash if the client sends invalid data, due to how this plugin attempts to continually load the message.
2021-01-31 03:15:20 +01:00
BenCodez 710ad17f47 Update version number 2021-01-30 20:06:58 -05:00
BenCodez a617625b87 Improve status command for pluginmessaging 2021-01-30 18:06:50 -05:00
BenCodez e8a5319544 Changes to bungee messaging, weekly voteparty reset 2021-01-30 17:34:24 -05:00
BenCodez 86e737892a Little fix for vote party reset count 2021-01-28 16:43:40 -05:00
BenCodez 3fd7a40421 Remove unneeded check 2021-01-27 17:05:20 -05:00
BenCodez a70e5aa54c Add option to not reset vote party total 2021-01-26 16:56:13 -05:00
BenCodez 593aae1e67 Fix issue with no player names 2021-01-26 16:52:38 -05:00
BenCodez e88849854b Bug fix 2021-01-26 16:47:52 -05:00
BenCodez 738fd5645e Change warning messages for votesite display item & service site issue 2021-01-24 20:36:10 -05:00
BenCodez 22ac364f8a Add option 2021-01-24 14:15:46 -05:00
BenCodez 5d78d3a734 Change debug values 2021-01-24 14:11:26 -05:00
BenCodez e83b12a248 Add ability for vote party once a day only 2021-01-23 20:45:08 -05:00
BenCodez 0f50998519 Update version number to 6.1 2021-01-23 18:01:37 -05:00
BenCodez 1768d4490f Command changes 2021-01-23 17:42:21 -05:00
BenCodez 2a3635b805 Add option to main vote gui run on /vote 2021-01-23 16:41:59 -05:00
BenCodez a5be973fd4 Fix back to main GUI button 2021-01-22 21:04:02 -05:00
BenCodez c8a76f38f9 Votetoday back button to votegui bug fix 2021-01-22 20:30:20 -05:00
BenCodez 273edaf101 Little bug fix 2021-01-22 19:12:54 -05:00
BenCodez d1a90676fc Changes to /av perms 2021-01-19 19:40:43 -05:00
BenCodez ff6119050d Add nonvotedplayerscache, allows allowunjoined option on bungee 2021-01-18 17:44:00 -05:00
BenCodez 0a0b95097d Changes to month/week/day changes to reduce impact of server restarts 2021-01-17 16:21:13 -05:00
BenCodez ace42a5a1f Little fixes 2021-01-13 17:11:25 -05:00
BenCodez 1a23648b91 Add package relocation to prevent conflicts 2021-01-09 14:50:00 -05:00
BenCodez 65b5a46525 Changes to permission handling, advanced tab is disabled 2021-01-08 17:34:54 -05:00
BenCodez 462d99c0e5 Little change 2021-01-04 18:57:23 -05:00
BenCodez 04636dd5af Little change 2021-01-03 12:29:38 -05:00
BenCodez d5b5b6cec0 Command changes 2021-01-02 16:47:08 -05:00
BenCodez 921fdac8bb Little change 2020-12-27 17:09:34 -05:00
BenCodez 6b9bc60785 Bug fix 2020-12-27 16:51:25 -05:00
BenCodez ff01c73193 Little changes 2020-12-26 09:14:59 -05:00
BenCodez a6cb4c3a8c Bug fix 2020-12-25 12:43:32 -05:00
BenCodez 43d33277ba Little fix 2020-12-25 11:41:12 -05:00
BenCodez 9badb50075 Little change 2020-12-22 19:44:29 -05:00
BenCodez ad6a09ba85 Bug fix 2020-12-22 16:58:55 -05:00
BenCodez 1791ec5e46 Merge branch 'master' of https://github.com/BenCodez/VotingPlugin 2020-12-22 16:57:24 -05:00
BenCodez 46457a9e61 Update version number 2020-12-22 16:56:23 -05:00
Ben 38ab221fd8 Little bug fix 2020-12-22 05:39:59 -05:00
BenCodez fc2317655e Change default option 2020-12-21 20:12:52 -05:00
BenCodez fb183b9f1f Add option 2020-12-21 18:40:49 -05:00
BenCodez 64057723b6 Update version number 2020-12-19 17:51:20 -05:00
BenCodez 703662c0c0 Bug fix 2020-12-19 17:51:01 -05:00
BenCodez ac72b47362 Update version number 2020-12-19 16:57:43 -05:00
BenCodez 6ca0e26e9c Add per shop message for purchases 2020-12-19 16:45:59 -05:00
BenCodez 168f2fbce2 Improvements 2020-12-17 19:21:51 -05:00
BenCodez a45370011e Little change 2020-12-14 16:58:21 -05:00
BenCodez f85c97f50a Bug fix 2020-12-09 17:14:01 -05:00
BenCodez 1651f8b626 Add option 2020-12-08 21:27:31 -05:00
BenCodez ad08e4cfcf Little fix 2020-12-06 12:08:17 -05:00
BenCodez 91ec3456f5 Little change 2020-12-06 12:02:36 -05:00
BenCodez 4c4f0ef6ae Add per vote shop purchase confirmations 2020-11-30 19:04:51 -05:00
BenCodez 17a899407d Update version number 2020-11-27 20:46:01 -05:00
BenCodez 1a194c684d Little change 2020-11-27 17:03:01 -05:00
BenCodez 93e06e431d Bug fix 2020-11-26 16:47:06 -05:00
BenCodez 8fede65b79 Little change 2020-11-25 21:23:44 -05:00
BenCodez 601d23d5cc Undo 2020-11-25 20:50:38 -05:00
BenCodez 536bacb96a Deprecate class 2020-11-25 19:55:39 -05:00
BenCodez 07b4c36490 Temp change to support plugins until update 2020-11-25 19:51:08 -05:00
BenCodez 39a86b824e Change default option 2020-11-24 19:01:04 -05:00
BenCodez 204c17affc Bug fix 2020-11-24 18:58:54 -05:00
BenCodez ff92dccf47 Bug fix 2020-11-24 18:54:50 -05:00
BenCodez ec69a4db70 Bug fix 2020-11-24 17:08:48 -05:00
Ben c9e0880ce9 Update README.md 2020-11-23 17:48:28 -05:00
BenCodez 8b03792a52 Bug fix 2020-11-23 17:04:08 -05:00
BenCodez 42d9f413f5 Little changes 2020-11-22 15:14:34 -05:00
BenCodez fdb8a86def Javadoc fixes 2020-11-22 14:56:35 -05:00
BenCodez b54cda1834 Little changes 2020-11-22 14:41:03 -05:00
BenCodez 824a740c96 Little change 2020-11-22 13:59:47 -05:00
Ben 63ed67b137 Merge pull request #1042 from BenCodez/6.0
6.0
2020-11-22 13:53:31 -05:00
BenCodez 6fd008e1a8 Update version number 2020-11-22 13:19:38 -05:00
BenCodez 13afac8da2 Bug fixes 2020-11-22 13:09:38 -05:00
BenCodez 31565f20fb Little change 2020-11-21 21:05:00 -05:00
BenCodez d4abcec817 Add options 2020-11-21 18:39:22 -05:00
BenCodez 6675f12205 Add bungee metrics 2020-11-18 21:12:23 -05:00
BenCodez 66d2903ff5 Little changes 2020-11-17 18:49:30 -05:00
BenCodez fffeea6435 Little changes 2020-11-16 20:24:32 -05:00
BenCodez b9ae8b8c6f Add ability to inject custom commands 2020-11-15 16:08:23 -05:00
BenCodez 974029523e Change user class name 2020-11-15 13:48:45 -05:00
BenCodez 70abbcc119 Little changes 2020-11-14 20:06:21 -05:00
BenCodez 927be61e93 Change package names 2020-11-14 19:06:43 -05:00
BenCodez 8a3341e7b9 Little changes 2020-11-10 16:39:48 -05:00
BenCodez e3ace6cf12 Add primary account support for /vote 2020-11-09 19:22:17 -05:00
BenCodez b84f230179 Little changes 2020-11-09 17:13:46 -05:00
BenCodez e2fd7347b4 Changed to primary account 2020-11-09 17:08:51 -05:00
BenCodez 223ba96a95 A lot of improvements 2020-11-07 21:56:27 -05:00
BenCodez 766efe0cda Little changes 2020-11-05 20:03:40 -05:00
BenCodez ab792de3c7 Little change 2020-11-04 20:35:03 -05:00
BenCodez 7807ef6d88 Update to 1.16.4, readd mvdwplaceholders 2020-11-04 17:16:45 -05:00
BenCodez ba7407cca6 Little fix 2020-11-02 21:35:33 -05:00
BenCodez b83249187e Command changes for /av placeholders 2020-11-02 21:34:16 -05:00
BenCodez 2b22e7ea6f Bug fix 2020-11-01 15:27:28 -05:00
BenCodez 86b18f3bea Bug fix 2020-11-01 15:19:21 -05:00
BenCodez f3c844b2f8 Attempted bug fix 2020-11-01 15:09:26 -05:00
BenCodez 53568b6c6f Add debug info to bungee votes 2020-11-01 12:33:23 -05:00
BenCodez 35b034b9e7 Changes to milestone handling 2020-11-01 12:24:50 -05:00
BenCodez 45367d59d2 Little change 2020-10-31 19:26:22 -04:00
BenCodez 1ded5a4369 Add ability to customize vote shop confirmation GUI 2020-10-30 19:40:11 -04:00
BenCodez 940f9a5662 Little fixes 2020-10-30 16:53:49 -04:00
BenCodez 319d4ead82 Bug fix 2020-10-29 16:39:01 -04:00
BenCodez cd87ccf6ff Bug fix 2020-10-28 21:28:29 -04:00
BenCodez 9604c6c156 Test change 2020-10-27 19:44:15 -04:00
BenCodez 5b47d1b198 Bug fix 2020-10-27 16:59:03 -04:00
BenCodez 97d265045c Bug fix 2020-10-27 16:57:07 -04:00
BenCodez ce508c4009 More little changes 2020-10-26 17:00:00 -04:00
BenCodez 8094e8acec Bug fix 2020-10-26 16:45:52 -04:00
BenCodez 2d2cfe8ccf Changes 2020-10-25 21:14:31 -04:00
BenCodez cb6d17c6e3 Bug fix 2020-10-24 21:39:28 -04:00
BenCodez 1811e18420 Remove old jars/convert commands 2020-10-24 21:37:03 -04:00
BenCodez 964aeef138 Fix repeat milestones not working 2020-10-24 18:53:18 -04:00
Ben12345rocks 524d001c28 Add placeholder, closes #992 2020-10-20 20:33:07 -04:00
Ben12345rocks 976a8f4f62 Add login/logout rewards 2020-10-18 15:39:36 -04:00
Ben12345rocks b30ea9c7d3 Bug fix for cumulative 2020-10-16 21:22:13 -04:00
Ben12345rocks ae60182cd7 Add ability to keep voteshop open 2020-10-14 19:24:27 -04:00
Ben12345rocks b28cfac096 Fix spelling mistake 2020-10-14 19:12:15 -04:00
Ben12345rocks 4b93353022 Attempt cumulative fix 2020-10-14 17:19:22 -04:00
Ben12345rocks 7715b3d66d Bug fix 2020-10-13 20:56:05 -04:00
Ben12345rocks 5fbecec78b Bug fix 2020-10-13 20:27:06 -04:00
Ben12345rocks 64f15a1bf2 Fix typo 2020-10-13 20:11:23 -04:00
Ben12345rocks 9ab08c22be Bug fix 2020-10-13 19:58:49 -04:00
Ben12345rocks f29e4d99ba Little changes 2020-10-12 20:47:27 -04:00
Ben12345rocks fdb53d550e Move GUI settings to GUI.yml 2020-10-11 20:36:38 -04:00
Ben12345rocks c2ac312522 Implement new command handling for GUI's 2020-10-11 19:19:08 -04:00
Ben12345rocks c87b5e5728 Add build profiles 2020-10-07 20:55:03 -04:00
Ben12345rocks 1eeea835aa Add count offline vote party votes option 2020-10-07 17:07:34 -04:00
Ben12345rocks cf6a6200ca Reduce number of queries 2020-10-06 17:26:08 -04:00
Ben12345rocks 885ec12d88 Update version number 2020-10-05 16:56:47 -04:00
Ben12345rocks c23911b14a Bug fix 2020-10-04 12:55:57 -04:00
Ben12345rocks da9a5b88aa Bug fix 2020-10-03 20:52:11 -04:00
Ben12345rocks d96490e60b Update version number 2020-10-03 20:18:55 -04:00
Ben12345rocks 2198c5d4a0 Bug fix 2020-10-03 20:13:31 -04:00
Ben12345rocks 776179e41d Little improvements 2020-10-03 19:31:14 -04:00
Ben12345rocks 7bda38ff48 Little improvement 2020-10-03 07:56:09 -04:00
Ben12345rocks a23ead4d9c Little command improvement 2020-10-02 19:42:37 -04:00
Ben12345rocks 0f820738c6 Add safe guard for milestones with config option 2020-10-02 19:14:52 -04:00
Ben12345rocks 30d912114d Improvements to book GUI 2020-09-29 19:45:04 -04:00
Ben12345rocks 567288309c Bug fix 2020-09-29 17:22:12 -04:00
Ben12345rocks 7cd67f55f1 Little improvement 2020-09-29 16:44:52 -04:00
Ben12345rocks 59e7dcd8e8 Bug fix and little improvements 2020-09-28 19:21:54 -04:00
Ben12345rocks 90e55a0a7d Add command /av resyncmilestonesalreadygiven 2020-09-25 20:04:25 -04:00
Ben12345rocks a280d91c05 Add book GUI for /vote 2020-09-24 19:27:21 -04:00
Ben12345rocks feb54aeb9e Undo test commit 2020-09-20 13:24:06 -04:00
Ben12345rocks ee96bf500e Test commit 2020-09-20 13:23:26 -04:00
Ben12345rocks 91a266889f Code cleanup 2020-09-20 12:39:59 -04:00
Ben12345rocks 6051138613 Test change 2020-09-14 17:03:17 -04:00
Ben12345rocks d9780f9954 Add a command to force top voter awards 2020-09-13 14:23:31 -04:00
Ben12345rocks 453287dc1c Fix logging votes to file 2020-09-12 18:23:21 -04:00
Ben12345rocks 8f119862d0 Update to 1.16.3 2020-09-10 19:22:46 -04:00
Ben12345rocks df1fc4a734 Little change 2020-09-07 14:51:35 -04:00
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
Ben12345rocks 303b944128 Update version number 2020-08-29 20:38:21 -04:00
Ben12345rocks 989e8fd7a2 Bug fixes 2020-08-29 19:46:53 -04:00
Ben12345rocks 9a21e37516 Bug fix 2020-08-29 19:16:09 -04:00
Ben12345rocks 29a27477b6 Implement config changes 2020-08-29 19:03:47 -04:00
Ben12345rocks 0ebc5a4c6e More improvements 2020-08-27 15:50:05 -04:00
Ben12345rocks 1c6131589f Little change 2020-08-27 15:13:49 -04:00
Ben12345rocks a183335df7 Add info on real vote to bungee voting 2020-08-25 16:37:30 -04:00
Ben12345rocks c0447ab6e0 Add http to urls if forcing 2020-08-25 16:23:33 -04:00
Ben12345rocks 0c9c2dacfa Update version number 2020-08-23 13:26:39 -04:00
Ben12345rocks 48dbd26d24 Improvements 2020-08-23 13:19:38 -04:00
Ben12345rocks 65de370539 Add top placeholder 2020-08-23 12:14:28 -04:00
Ben12345rocks 1ffb050939 Add voteshop disabled message to config 2020-08-22 17:22:15 -04:00
Ben12345rocks 0f15c69831 Bug fix 2020-08-22 15:27:51 -04:00
Ben12345rocks 5d99ea6154 Add placeholder 2020-08-22 14:57:11 -04:00
Ben12345rocks 7224cb76de Bug fix 2020-08-17 15:55:34 -04:00
Ben12345rocks 1ac9df057d Bug fix 2020-08-16 17:54:39 -04:00
Ben12345rocks 033941388c Bug fix 2020-08-16 17:50:42 -04:00
Ben12345rocks fc979bc6bf Bug fix 2020-08-16 17:34:09 -04:00
Ben12345rocks f1860f2934 Use config option 2020-08-16 13:44:55 -04:00
Ben12345rocks ab8696a3a4 Bug fix 2020-08-16 13:28:31 -04:00
Ben12345rocks 09cd00a563 Bug fix 2020-08-16 12:56:11 -04:00
Ben12345rocks f2ca7c3240 Add placeholder 2020-08-16 12:39:31 -04:00
Ben12345rocks 6928c15147 Bug fixes 2020-08-16 12:15:27 -04:00
Ben12345rocks 9e278de881 Fix spelling mistake 2020-08-15 20:02:52 -04:00
Ben12345rocks af9e207012 Update version number 2020-08-15 19:20:53 -04:00
Ben12345rocks c667a6ba56 Improvements 2020-08-15 19:18:50 -04:00
Ben12345rocks 37c6888962 Improvements 2020-08-15 18:52:33 -04:00
Ben12345rocks 5729968630 Bug fix 2020-08-15 15:21:48 -04:00
Ben 5fb377da21 Merge pull request #902 from DrBot7/patch-1
Fix vnext
2020-08-13 16:50:00 -04:00
DrBot7 92f0c284cd Fix vnext
The current state with build 325 is telling me that I can't vote even though I can.
https://imgur.com/a/ueRrMao
I noticed that MCMP, which has a daily timer with no offset, tells me that I am able to vote in 8 hours. However, I should be able to vote now. I wrote up some code and tested locally. This seems to have fixed my issue.
2020-08-13 15:43:50 -05:00
Ben12345rocks 7c8be94d88 Bug fix 2020-08-13 15:43:36 -04:00
Ben12345rocks 19690712ba Bug fix 2020-08-12 19:28:16 -04:00
Ben12345rocks 7c32a0c883 Bug fix 2020-08-12 17:08:57 -04:00
Ben12345rocks df87848caa Another change 2020-08-12 17:05:56 -04:00
Ben12345rocks 534253fbfc Bug fix 2020-08-12 16:43:15 -04:00
Ben12345rocks afbbbcfd45 Code cleanup 2020-08-12 15:22:54 -04:00
Ben12345rocks f5ea7e8490 Bug fix 2020-08-12 15:21:52 -04:00
Ben12345rocks c0b1c82ec4 Little performance improvement 2020-08-11 19:33:10 -04:00
Ben12345rocks 99eb028a62 Update to 1.16.2 2020-08-11 19:13:11 -04:00
Ben12345rocks ce3a40a155 Little change 2020-08-11 19:06:16 -04:00
Ben12345rocks da5e71a614 Bug fix 2020-08-11 17:28:41 -04:00
Ben12345rocks c2e509e4c7 Bug fix 2020-08-11 17:19:00 -04:00
Ben12345rocks a068c0b1db Bug fix 2020-08-11 16:25:05 -04:00
Ben12345rocks b1fa69ed26 Little improvements 2020-08-10 20:24:27 -04:00
Ben12345rocks d91f485f1e Little improvements 2020-08-10 15:39:27 -04:00
Ben12345rocks 0252dd3535 Improvements 2020-08-09 12:53:45 -04:00
Ben12345rocks 21cf18f34e Little change 2020-08-08 20:30:27 -04:00
Ben12345rocks 892cae605b A lot of bungee improvements 2020-08-08 19:32:53 -04:00
Ben12345rocks c97fd708e0 Add more log info for bungee 2020-08-07 21:58:28 -04:00
Ben12345rocks 12dd52af3d Add another method to bungee voting, untested 2020-08-07 20:22:48 -04:00
Ben12345rocks 3a3d784d6d Bug fix 2020-07-24 15:25:12 -04:00
Ben12345rocks 86c98ccae1 Bug fix 2020-07-23 15:18:42 -04:00
Ben12345rocks e004121081 Little change 2020-07-19 19:14:40 -04:00
Ben12345rocks 27c3bf71ec Undo changes 2020-07-19 16:57:38 -04:00
Ben12345rocks c5da78712f Little change 2020-07-19 16:11:29 -04:00
Ben12345rocks 7cd12844fd Little change 2020-07-19 14:50:09 -04:00
Ben12345rocks f04d03fa90 Little fix 2020-07-19 14:27:01 -04:00
Ben12345rocks 10af3797d1 Little change 2020-07-19 12:28:15 -04:00
Ben12345rocks 5dd9de8310 Bug fix 2020-07-14 15:49:58 -04:00
Ben12345rocks 75c7b6b703 Change Item to DisplayItem to avoid confusion 2020-07-12 13:23:32 -04:00
Ben12345rocks 70ef27deb8 Some improvements 2020-07-12 12:07:40 -04:00
Ben12345rocks 007f2e7b73 Bug fix 2020-07-09 15:25:18 -04:00
Ben12345rocks f7cafaefdc Little more improvements 2020-07-08 15:19:38 -04:00
Ben12345rocks cb6e27e700 Little config change 2020-07-08 15:10:20 -04:00
Ben12345rocks fd5ba1f98e Add option to use an item instead of skull for vote today 2020-07-07 15:39:01 -04:00
Ben12345rocks e63fd4d79c Improvements 2020-07-06 17:05:00 -04:00
Ben12345rocks be2a7e2ee3 Add command for current plugin time 2020-07-04 14:50:52 -04:00
Ben12345rocks 85a8a29e69 Add option to clear cache for vote shop 2020-07-03 08:06:51 -04:00
Ben12345rocks b07fe783dd Improve bungee efficiency 2020-06-27 20:43:48 -04:00
Ben12345rocks 75e4f45e9f Little change 2020-06-26 16:24:33 -04:00
Ben12345rocks 826d353bfd Update version number 2020-06-25 19:26:22 -04:00
Ben12345rocks 2891607947 Update to 1.16.1 2020-06-24 21:15:05 -04:00
Ben12345rocks b7a4955766 Separate bungee debug 2020-06-20 08:42:42 -04:00
Ben12345rocks d1f7c78bbe Bug fix 2020-06-20 08:05:34 -04:00
Ben12345rocks 289980aa41 Improve debugging for sockets 2020-06-19 16:39:32 -04:00
Ben12345rocks 217d1b60a3 Bug fix 2020-06-14 12:12:09 -04:00
Ben12345rocks fce1b38a24 Bug fix 2020-06-11 16:45:32 -04:00
Ben12345rocks 6538465add Maven updates 2020-06-07 17:13:17 -04:00
Ben12345rocks a70b9e46a8 Change default color codes for /vote 2020-06-06 18:17:03 -04:00
Ben12345rocks 22d7c75261 Add bungee help command 2020-06-05 19:24:56 -04:00
Ben12345rocks 1cdf7a1033 Bug fix 2020-06-03 16:21:47 -04:00
Ben12345rocks 27afaf8e1b Add bungee status command 2020-06-01 19:35:14 -04:00
Ben12345rocks 019699ae75 Bug fix 2020-06-01 18:58:19 -04:00
Ben12345rocks 745df69024 Add a status command for bungee voting 2020-06-01 17:38:35 -04:00
Ben12345rocks 6e84130261 Little improvement 2020-05-31 14:01:16 -04:00
Ben12345rocks 124485b4f0 Little imrprovement 2020-05-31 12:26:03 -04:00
Ben12345rocks f6f9028680 Little improvement 2020-05-31 12:09:42 -04:00
Ben12345rocks 7fab7c5ca8 Add config option for vote shop 2020-05-30 15:34:53 -04:00
Ben12345rocks 355bcfa4d1 Fix perm 2020-05-29 18:50:46 -04:00
Ben12345rocks 87715a1e93 Add command to clear points 2020-05-29 18:49:42 -04:00
Ben12345rocks cf5faca040 Little fix 2020-05-28 21:25:54 -04:00
Ben12345rocks 099ceb3bca Improvement 2020-05-28 20:19:30 -04:00
Ben12345rocks 56dd38b6e0 little change 2020-05-28 16:18:01 -04:00
Ben12345rocks ad752e024a Improvement 2020-05-27 19:05:54 -04:00
Ben12345rocks fc6f1052d6 Little improvement 2020-05-26 19:01:20 -04:00
Ben12345rocks f663b06626 Improvement 2020-05-23 20:17:32 -04:00
Ben12345rocks 7a38a4d7f8 Little improvement 2020-05-23 17:35:28 -04:00
Ben12345rocks 28b8c04f95 Bug fix 2020-05-23 17:30:05 -04:00
Ben12345rocks 85bc09c3da Little config change 2020-05-23 15:23:29 -04:00
Ben12345rocks b817ea25e6 Added persite level offset for /vote next only 2020-05-22 16:34:41 -04:00
Ben12345rocks 25ba2f597e Improve debug message 2020-05-22 16:25:49 -04:00
Ben12345rocks 321b3fbf3a Add option 2020-05-21 21:20:29 -04:00
Ben12345rocks df6a4e4a35 Bug fix 2020-05-17 21:34:23 -04:00
Ben12345rocks 7c0031b265 Bug fix 2020-05-16 16:14:12 -04:00
Ben12345rocks e99ec75a0f Update version number 2020-05-12 19:14:04 -04:00
Ben12345rocks 15f851e825 Bug fix 2020-05-12 17:36:46 -04:00
Ben12345rocks 0579e7a2fd Bug fix 2020-05-12 17:33:26 -04:00
Ben12345rocks 1c0b7dc0b1 Bug fix 2020-05-12 17:29:38 -04:00
Ben12345rocks 40d002fbfa Update version number 2020-05-10 12:27:37 -04:00
Ben e665eb668f Update stale.yml 2020-05-03 12:08:51 -04:00
Ben12345rocks 05239717a5 Bug fix 2020-05-01 16:22:07 -04:00
Ben12345rocks b91f9bedfa Bug fix 2020-04-26 13:19:46 -04:00
Ben12345rocks 12261ece0e Change default value 2020-04-23 16:20:28 -04:00
Ben12345rocks bef017c12d Added ForceLinks 2020-04-22 19:35:25 -04:00
Ben12345rocks a6544a399f Little change 2020-04-18 09:24:33 -04:00
Ben12345rocks 60b61ae49d Improvements 2020-04-14 18:09:11 -04:00
Ben12345rocks 93ccd5f392 Little change 2020-04-13 14:31:28 -04:00
Ben12345rocks 8169ed413c Add ability for voteshop confirmation 2020-04-13 11:12:44 -04:00
Ben12345rocks 1a42dfadc0 Little change 2020-04-13 11:00:15 -04:00
Ben12345rocks c5a5573652 Added voteshop limit resets 2020-04-13 10:58:58 -04:00
Ben12345rocks f7c3093478 Update version number 2020-04-12 12:25:29 -04:00
Ben12345rocks 6000e1fab9 Add config option 2020-04-10 17:50:24 -04:00
Ben12345rocks 2ac42539aa Bug fix 2020-04-10 15:32:14 -04:00
Ben12345rocks 6d25b02975 Little config improvement 2020-04-10 15:18:31 -04:00
Ben12345rocks f3582627fb Add broadcast blacklist 2020-04-10 15:17:13 -04:00
Ben12345rocks 9e98c2db78 Parse placeholderapi placeholders on broadcast 2020-04-10 13:44:02 -04:00
Ben12345rocks d387b632dd Bug fix 2020-04-04 15:06:47 -04:00
Ben12345rocks 69d4a49462 Bug fix 2020-04-04 08:30:31 -04:00
Ben12345rocks 5f648983c8 Attempted bug fix 2020-04-04 08:28:01 -04:00
Ben12345rocks d98bfd45fc Add another option 2020-04-03 16:49:32 -04:00
Ben12345rocks a38931ca23 Add option for gui 2020-04-02 16:52:48 -04:00
Ben12345rocks 508fcb2f29 Add votedelaymin 2020-04-01 20:03:56 -04:00
Ben12345rocks d280e4b131 Test change 2020-04-01 19:41:55 -04:00
Ben12345rocks 48c014227d Improvements 2020-04-01 16:56:54 -04:00
Ben12345rocks 21c4be4148 Little bug fix 2020-03-29 12:26:46 -04:00
Ben12345rocks d44290dcdc Update version number 2020-03-29 12:24:04 -04:00
Ben12345rocks 702c739ec8 Bug fix 2020-03-24 16:44:54 -04:00
Ben12345rocks c1122bd939 Bug fix 2020-03-23 20:40:53 -04:00
Ben12345rocks bdaa896fc1 Bug fix 2020-03-23 20:23:56 -04:00
Ben12345rocks 3b1c051fd2 Bug fix 2020-03-23 20:23:16 -04:00
Ben12345rocks 11194f819e Disable other background task when other one is enabled 2020-03-23 18:52:16 -04:00
Ben12345rocks 662eb16fdd Add log 2020-03-23 18:35:28 -04:00
Ben12345rocks d65070973c Add extra feature 2020-03-23 17:14:21 -04:00
Ben12345rocks cef41348cc Added message 2020-03-22 21:16:04 -04:00
Ben12345rocks bcba694308 Little change 2020-03-22 20:36:19 -04:00
Ben12345rocks fbd7c6d3fc Little improvements 2020-03-20 18:53:55 -04:00
Ben12345rocks f842c08d62 Add voteshop command 2020-03-20 17:51:55 -04:00
Ben12345rocks 4e58a6915f Update version number 2020-03-15 13:53:33 -04:00
Ben12345rocks 4336644fbc Bug fix 2020-03-14 19:19:41 -04:00
Ben12345rocks e32909ac58 Add softdepend 2020-03-14 18:31:06 -04:00
Ben12345rocks bd16e2ccaf Add command 2020-03-13 21:15:44 -04:00
Ben12345rocks 36fa55139e Bug fix 2020-03-13 17:08:23 -04:00
Ben12345rocks b128280d5f Silence error 2020-03-13 17:05:50 -04:00
Ben12345rocks 51e3f05031 Minor improvement 2020-03-11 20:02:04 -04:00
Ben12345rocks 19b83070c6 Improvements to config 2020-03-11 19:49:59 -04:00
Ben12345rocks 5622956e75 Added points formatted placeholder 2020-03-06 16:48:45 -05:00
Ben12345rocks 1ac3ea4916 Minor improvement to force commands 2020-03-06 16:45:14 -05:00
Ben12345rocks 391cc0edf1 Add advancedcore info to /av version 2020-03-01 14:15:11 -05:00
Ben12345rocks a59a98f8cb Update version number 2020-02-23 12:15:45 -05:00
Ben12345rocks e62213bfd5 Bug fix 2020-02-19 16:41:38 -05:00
Ben12345rocks 61b77c4754 Little improvement 2020-02-15 16:33:59 -05:00
Ben12345rocks 758aaa3dd7 Improvements 2020-02-15 16:24:22 -05:00
Ben12345rocks 51389a27fb Bug fix 2020-02-12 17:01:18 -05:00
Ben12345rocks 37b94cc36c Add console message on bungeecoord when vote received 2020-02-09 17:02:18 -05:00
Ben12345rocks 1e4796d418 Add option 2020-02-03 20:56:49 -05:00
Ben12345rocks 62b0d6012d Fix spelling mistake 2020-02-03 16:43:50 -05:00
Ben12345rocks 52726c8bb3 Fix warning message 2020-02-02 13:58:26 -05:00
Ben12345rocks ede06e0923 Fix warning message 2020-01-29 17:11:44 -05:00
Ben12345rocks 6eb2c95cc0 Change config comments 2020-01-26 12:16:32 -05:00
Ben12345rocks 835dff8620 Update version number 2020-01-21 17:03:12 -05:00
Ben12345rocks 1019b0b83b Update to 1.15.2 2020-01-21 16:59:12 -05:00
Ben12345rocks a44070b505 Bug fix 2020-01-19 12:39:14 -05:00
Ben12345rocks 58bd4e2d9d Little change 2020-01-17 16:45:07 -05:00
Ben12345rocks cff346e6a4 Add loadbefore 2020-01-13 16:54:18 -05:00
Ben 0331e34e91 Create stale.yml 2020-01-11 15:27:26 -05:00
Ben12345rocks 26ff8d8588 Add try/catch 2020-01-11 14:59:39 -05:00
Ben12345rocks 9a38826cf7 Improvement 2020-01-11 08:34:48 -05:00
Ben12345rocks b854631990 Little warning message 2020-01-04 11:44:07 -05:00
Ben12345rocks 5d1cd97ebd Update to 1.15.1 2019-12-17 19:42:34 -05:00
Ben12345rocks c21feb74d1 Update to 1.15 2019-12-10 18:57:25 -05:00
Ben12345rocks 052e2f2541 Update version number 2019-12-07 19:11:34 -05:00
Ben12345rocks 1270b57afa Add option to reset extra voteparty votes monthly and command to do so 2019-12-01 12:34:45 -05:00
Ben12345rocks cf8b219b9d Add ability to remove VotingPlugin.Player permission on a command 2019-11-27 20:27:14 -05:00
Ben12345rocks 689133aab8 Change default backbutton item to barrier 2019-11-23 19:45:57 -05:00
Ben12345rocks 019c0f01eb Add bungee communication encryption 2019-11-17 15:38:56 -05:00
Ben12345rocks 743cac217b Little improvement to bungee command 2019-11-03 17:07:59 -05:00
Ben12345rocks 5f19cb1ec8 Update version number 2019-11-02 21:08:21 -04:00
Ben12345rocks ac5ffa0f7c Bug fix 2019-10-31 17:20:40 -04:00
Ben12345rocks 114e07eb01 Improvements 2019-10-30 21:30:49 -04:00
Ben12345rocks 8ba1d75ab3 Bug fix 2019-10-30 20:30:59 -04:00
Ben12345rocks b3555918ed Improvements 2019-10-30 20:12:56 -04:00
Ben12345rocks 0759c05ed1 Bug fix 2019-10-29 21:35:26 -04:00
Ben12345rocks 278a8f70f2 Config improvements 2019-10-29 16:59:32 -04:00
Ben12345rocks fb5dc9923f Bug fix 2019-10-28 16:49:34 -04:00
Ben12345rocks f942505e62 Redo bungee system 2019-10-27 14:14:41 -04:00
Ben12345rocks 2d2b2db0a7 Bug fix 2019-10-27 12:52:40 -04:00
Ben 18d5078842 Update issue templates 2019-10-24 17:08:57 -04:00
Ben12345rocks 074b2c51e2 Another bug fix 2019-10-24 16:53:45 -04:00
Ben12345rocks 539194720a Possible bug fix 2019-10-24 16:50:06 -04:00
Ben 19fc5865fa Update issue templates 2019-10-20 15:51:09 -04:00
Ben f0d58e0c6a Update issue templates 2019-10-20 12:45:12 -04:00
Ben ddc2bea418 Update issue templates 2019-10-20 12:44:08 -04:00
Ben 24da6893ac Update issue templates 2019-10-20 12:39:37 -04:00
Ben12345rocks 7268017dc1 Javadoc fix 2019-10-19 20:22:30 -04:00
Ben12345rocks 4133480750 Update version number 2019-10-19 20:08:25 -04:00
Ben12345rocks 006a265c7a Improvements 2019-10-16 19:29:50 -04:00
Ben12345rocks 6850ef8a7d Improvements 2019-10-13 20:37:46 -04:00
Ben12345rocks 497f556ba6 Improvements 2019-10-13 19:21:38 -04:00
Ben12345rocks d62da744cd Add ability to disable commands 2019-10-12 17:08:20 -04:00
Ben12345rocks 864482e393 Bug fix 2019-10-12 15:27:12 -04:00
Ben12345rocks e41c25ed5d More bungeecoord improvements 2019-10-09 19:20:26 -04:00
Ben12345rocks 3e429b83a8 Bug fix 2019-10-09 17:01:03 -04:00
Ben12345rocks cd1af401ba Added config update command 2019-10-06 19:10:45 -04:00
Ben12345rocks 26e04bd890 Remove config update, requires more testing 2019-10-06 17:03:51 -04:00
Ben12345rocks b6d70fac9c Add config update to update config 2019-10-06 17:02:09 -04:00
Ben12345rocks 9e572c786c Add ability for plugin to run on bungeecoord, WIP 2019-10-06 15:00:53 -04:00
Ben12345rocks 4e44ce3ab8 Javadoc fix 2019-10-01 19:23:31 -04:00
Ben12345rocks 74c7fcb4da Update version number 2019-10-01 19:05:57 -04:00
Ben12345rocks ef64d52ad1 Extra safeguard 2019-10-01 17:39:34 -04:00
Ben12345rocks ab7bbec563 Add votes placeholder for top voter awards 2019-09-30 16:59:20 -04:00
Ben12345rocks 6afe4ab9d6 Use new message api 2019-09-29 12:58:59 -04:00
Ben12345rocks 12f43e3691 Add vote bossbar 2019-09-29 12:29:23 -04:00
Ben12345rocks 1e7cf2a1ba Add config option 2019-09-26 16:52:21 -04:00
Ben12345rocks 90636250cb Add ability to require allsites to be voted on for all urls button 2019-09-26 16:51:53 -04:00
Ben12345rocks 838451f956 Bug fix 2019-09-25 17:21:56 -04:00
Ben12345rocks cc85d999e1 New skull method for signs 2019-09-23 17:10:49 -04:00
Ben12345rocks 0013013cd2 Use new debug level 2019-09-21 21:07:05 -04:00
Ben12345rocks bfd04cf8a2 Update version number 2019-09-20 16:43:27 -04:00
Ben12345rocks beb1b70f50 Cleanup 2019-09-15 14:09:16 -04:00
Ben12345rocks f52edad583 Update version number 2019-09-15 13:54:58 -04:00
Ben12345rocks 0a1283de4b Small improvements 2019-09-14 20:59:07 -04:00
Ben12345rocks bed263aa87 Improvements 2019-09-14 07:54:46 -04:00
Ben12345rocks 55d8d20f88 Merge branch 'master' of https://github.com/Ben12345rocks/VotingPlugin 2019-09-13 17:39:10 -04:00
Ben12345rocks 3a59e2cdc2 Add new commands 2019-09-13 17:38:47 -04:00
Ben12345rocks 57fb754bc0 Add new option 2019-09-11 20:02:24 -04:00
Ben 052b48348b Merge pull request #617 from Shivelight/patch-1
Fix ToggleBroadcasts configuration path
2019-09-09 05:43:27 -04:00
Shivelight 5d15747c4e Fix ToggleBroadcasts configuration path
Match toggle broadcast message path with Config.java's path.
We are just fixing a typo here.
2019-09-09 16:04:12 +07:00
Ben12345rocks ce09359445 Improvement 2019-09-08 12:39:18 -04:00
Ben c22792bd9b Update README.md 2019-09-07 20:58:45 -04:00
Ben12345rocks 4ab36c355e Bug fix 2019-09-07 18:57:40 -04:00
Ben12345rocks 0b3829c1b4 Improvements 2019-09-07 18:56:05 -04:00
Ben12345rocks ae4883f099 Improvement 2019-09-07 18:13:29 -04:00
Ben12345rocks 2e3cf25e57 Add ability to set rewards with GUI 2019-08-25 13:07:51 -04:00
Ben12345rocks e65b831f35 Fix config typos 2019-08-18 12:38:54 -04:00
Ben12345rocks b6dc426eed Fix typo 2019-08-18 12:34:43 -04:00
Ben12345rocks a4f7619ca3 Update version number 2019-08-15 19:20:00 -04:00
Ben12345rocks 4e38dd0f1a Update version number 2019-08-11 13:23:08 -04:00
Ben12345rocks 2264db76cc Bug fixes 2019-08-11 13:22:17 -04:00
Ben12345rocks 28082abde5 Change option 2019-08-09 20:01:03 -04:00
Ben12345rocks 4814cfae86 Update version number 2019-08-04 13:25:27 -04:00
Ben12345rocks 3aa7820239 More messages 2019-08-04 13:04:23 -04:00
Ben12345rocks c4a7232bca Add last month GUI 2019-08-03 21:25:33 -04:00
Ben12345rocks ee390ac0b1 Bug fix 2019-08-01 19:06:58 -04:00
Ben12345rocks 187ee01d82 Add new abilities to vote shop 2019-08-01 17:00:27 -04:00
Ben12345rocks 64f3d89abb Bug fix 2019-07-31 20:55:38 -04:00
Ben12345rocks bc33cef53f Minor bug fix 2019-07-31 20:45:56 -04:00
Ben12345rocks 199936262a Add option 2019-07-29 20:13:26 -04:00
Ben12345rocks 3b6eb22c16 Improvements 2019-07-28 14:23:40 -04:00
Ben12345rocks 0dc2ada7bc Improvements 2019-07-27 19:45:31 -04:00
Ben12345rocks f591756697 Alert of yml error when reloading 2019-07-27 18:59:02 -04:00
Ben12345rocks 86175dc284 Minor improvements 2019-07-24 19:27:16 -04:00
Ben12345rocks d69970acdd Minor improvements 2019-07-21 21:23:27 -04:00
Ben12345rocks 8242c4a977 Minor fix 2019-07-20 14:54:58 -04:00
Ben12345rocks f319bce854 Add update check on plugin reload 2019-07-20 14:53:52 -04:00
Ben12345rocks 8bd1bfc3e0 Update spigot 2019-07-19 19:51:02 -04:00
Ben12345rocks cec3232b51 Add total placeholders for rewards 2019-07-11 20:40:43 -04:00
Ben12345rocks 7dcd892106 Keep certain inventories from always closing 2019-07-05 13:41:53 -04:00
Ben12345rocks 78ca13fcb7 Update version number 2019-07-04 08:53:04 -04:00
Ben12345rocks 48d37045d2 Cleanup 2019-07-04 08:44:08 -04:00
Ben12345rocks 92e4ec5ddb Bug fix 2019-07-04 08:22:25 -04:00
Ben12345rocks 6d760e2c5b Add way of detecting if votifier loaded properly 2019-07-03 21:46:15 -04:00
Ben12345rocks ee4eb6d86c Add validator 2019-07-03 20:18:08 -04:00
Ben12345rocks 44cea60852 Improvement 2019-07-03 20:04:40 -04:00
Ben12345rocks 4f68c6677e Improvements 2019-07-03 14:40:07 -04:00
Ben12345rocks 018aa632c9 Bug fix 2019-07-02 08:17:43 -04:00
Ben12345rocks ac1f19817f Add limit for month total 2019-07-01 14:56:32 -04:00
Ben12345rocks 365ece55b1 Move commands over 2019-06-30 19:34:15 -04:00
Ben12345rocks 8bbbfc6c7c Update to 1.14.3 2019-06-24 20:45:10 -04:00
Ben12345rocks 5fb3c34745 Bug fix 2019-06-22 21:12:05 -04:00
Ben12345rocks 8f32a7fed8 Bug fix 2019-06-21 21:18:29 -04:00
Ben12345rocks 6a9a48fa81 Bug fixes 2019-06-21 20:59:50 -04:00
Ben12345rocks 2cd3ddf7e0 Use new api 2019-06-21 20:56:14 -04:00
Ben12345rocks c110a53494 Move placeholder api to advancedcore 2019-06-10 19:06:28 -04:00
Ben12345rocks 944ef03f80 Fixed bug with /av help 2019-06-08 21:48:32 -04:00
Ben12345rocks 654ee73945 Update version number 2019-06-08 20:08:37 -04:00
Ben12345rocks b113a068fd Improve reward test 2019-06-08 19:46:53 -04:00
Ben12345rocks 216f9e878f Add test for rewards 2019-06-08 19:35:22 -04:00
Ben 3c1404c429 Update README.md 2019-06-06 19:48:18 -04:00
Ben12345rocks 80d7251540 Improvements 2019-06-05 20:07:24 -04:00
Ben12345rocks 5d4fa15a0b Bug fixes 2019-05-29 17:48:00 -04:00
Ben12345rocks 02258478bb Bug fix 2019-05-29 17:24:48 -04:00
Ben12345rocks c4274e30ff Update to 1.14.2 2019-05-27 19:14:46 -04:00
Ben12345rocks aade5c2a80 Add reward for when cooldown ended 2019-05-27 17:24:36 -04:00
Ben12345rocks a09113f2c6 Bug fix 2019-05-27 17:15:02 -04:00
Ben12345rocks d5cd6cd16a Bug fixes 2019-05-26 14:40:55 -04:00
Ben12345rocks fc7ad2a3ff Bug fix 2019-05-26 12:30:29 -04:00
Ben12345rocks 1539d4199c Add additional information on startup 2019-05-26 12:27:12 -04:00
Ben12345rocks bf4fc1cb56 Bug fix 2019-05-21 20:08:31 -04:00
Ben12345rocks 9bc2ec59e5 Bug fix 2019-05-21 19:18:32 -04:00
Ben12345rocks 32baf04a75 Bug fix 2019-05-21 19:05:05 -04:00
Ben12345rocks a62da35686 Bug fix 2019-05-21 18:06:16 -04:00
Ben12345rocks 7a9f409b59 Bug fix 2019-05-21 17:02:52 -04:00
Ben12345rocks 12c103e354 Remove deprecated code 2019-05-20 20:18:16 -04:00
Ben12345rocks cd62cbf576 Better debug for cooldown events 2019-05-20 19:51:52 -04:00
Ben12345rocks e550d93ca5 Little fix 2019-05-18 09:20:17 -04:00
Ben12345rocks 25effd4805 Add event for cooldown ending 2019-05-18 09:18:32 -04:00
Ben12345rocks bb6066d867 Remove ip lookup 2019-05-16 19:44:25 -04:00
Ben12345rocks c44f40afd0 Update to 1.14.1 2019-05-13 21:15:11 -04:00
Ben12345rocks fa677ace84 Improvements 2019-05-12 17:03:43 -04:00
Ben12345rocks 37e312a6d9 Javadoc fix 2019-04-26 17:13:15 -04:00
Ben12345rocks 1358e32470 Update version number 2019-04-26 17:08:00 -04:00
Ben12345rocks e08eddb0c0 Update version to 1.14 2019-04-25 20:10:22 -04:00
Ben12345rocks f7ac8b5fa4 Update to 1.14 2019-04-23 17:21:54 -04:00
Ben12345rocks 7d192be572 Add ability to match ip's ontop of service sites 2019-04-22 17:01:37 -04:00
Ben12345rocks 7984dec523 Bug fix 2019-04-22 16:53:57 -04:00
Ben12345rocks bb420bc709 Change default option for preloadskulls 2019-04-14 18:30:16 -04:00
Ben12345rocks 78b9a336d9 Some config comment improvements 2019-04-14 12:56:52 -04:00
Ben12345rocks 667a4ea749 Disable vote shop command if disabled 2019-04-13 08:39:05 -04:00
Ben12345rocks 4ede4ff88b Bug fix 2019-04-06 20:22:31 -04:00
Ben12345rocks e26043958a Add ability to disable gui clicking in /vote gui 2019-04-06 20:03:59 -04:00
Ben12345rocks d3a6c267c6 Bug fix 2019-03-24 17:32:26 -04:00
Ben12345rocks 0d92dfa563 Add placeholders for global totals 2019-03-23 15:57:18 -04:00
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
Ben12345rocks 132d871039 Update version number 2019-02-16 18:51:38 -05:00
Ben12345rocks aea6954dbb Bug fix 2019-02-16 18:47:40 -05:00
Ben12345rocks 1ee8819e4c Add ability to transfer vote points 2019-02-16 08:12:45 -05:00
Ben12345rocks 41e3b7fbf6 Bug fix 2019-02-12 16:39:46 -05:00
Ben12345rocks 4218d240bc Bug fix 2019-02-11 17:09:17 -05:00
Ben12345rocks 683d6fcc42 Test commit 2019-02-11 17:07:12 -05:00
Ben12345rocks c9f6ab2fa6 Add event for when points received 2019-02-09 20:33:42 -05:00
Ben12345rocks c99d3baa3c Bug fix 2019-02-09 10:31:59 -05:00
Ben12345rocks d0ade2feff Add MVdW placeholders 2019-02-08 20:32:51 -05:00
Ben12345rocks dcebe5a701 Add authme support 2019-02-08 20:16:21 -05:00
Ben12345rocks d33791fb28 Update version number 2019-02-03 12:13:26 -05:00
Ben12345rocks 8512b3ab4f Bug fix 2019-02-01 20:12:06 -05:00
Ben12345rocks 4395d8cc89 Update version number 2019-01-19 19:30:37 -05:00
Ben12345rocks 55f4e6872c Add option to disable skulls for vote top 2019-01-13 12:19:09 -05:00
Ben12345rocks 6699a9204c Bug fix 2019-01-12 17:40:49 -05:00
Ben12345rocks 14e1a975c9 Improvements 2019-01-09 17:26:27 -05:00
Ben12345rocks 7ab3c4bcf9 Possible bug fix 2019-01-08 18:25:52 -05:00
Ben12345rocks 1866196571 Improvements 2019-01-07 16:47:25 -05:00
Ben12345rocks 301c21ed20 Preload skull for top voter 2019-01-06 14:01:55 -05:00
Ben12345rocks 2d5208a568 Update version number 2018-12-30 18:34:37 -05:00
Ben12345rocks 44a543e64c Bug fix 2018-12-30 18:34:09 -05:00
Ben12345rocks 458c66819a Bug fix 2018-12-30 17:35:27 -05:00
Ben12345rocks dcf4f3f15d Update version number 2018-12-30 15:20:25 -05:00
Ben12345rocks e33ef5420a Added another command 2018-12-30 13:05:55 -05:00
Ben12345rocks 8d1c3a05ce Add new command 2018-12-30 12:27:40 -05:00
Ben12345rocks 9a167a46d8 More command work 2018-12-29 20:54:45 -05:00
Ben12345rocks ffe60808b6 Added sound for inv clicks, command improvements 2018-12-29 20:45:54 -05:00
Ben12345rocks 1affd6c2fa Increase player name length 2018-12-29 19:27:02 -05:00
Ben12345rocks 17225dca5b Bug fixes 2018-12-22 19:54:20 -05:00
Ben12345rocks fc9f55ead8 Bug fix 2018-12-17 16:47:19 -05:00
Ben12345rocks eec877623e Add a class to make voting plugin hooks a lot easier 2018-12-16 19:15:48 -05:00
Ben12345rocks a06b0573c5 Made day vote streak update faster 2018-12-16 19:09:03 -05:00
Ben12345rocks dfcfee302f Bug fix 2018-12-16 12:39:21 -05:00
Ben12345rocks cb1cc27c60 Update version number 2018-12-15 09:18:56 -05:00
Ben12345rocks aed30a94c0 Bug fixes 2018-12-15 09:17:41 -05:00
Ben12345rocks 8e172e2647 Change default value 2018-12-15 09:01:10 -05:00
Ben12345rocks ca355e1a01 Add new commands 2018-12-14 20:26:46 -05:00
Ben12345rocks b0e18d5224 Added ability to disable aliases 2018-12-13 20:34:17 -05:00
Ben12345rocks f5fc80ef14 Performance improvement 2018-12-13 19:50:10 -05:00
Ben12345rocks 21f846f0bc Added ability to set percentage for vote streak 2018-12-13 19:43:18 -05:00
Ben12345rocks a6a742b91e Performance improvement 2018-12-13 19:23:32 -05:00
Ben12345rocks 4ca6510910 Test commit 2018-12-12 17:02:50 -05:00
Ben12345rocks e06ea06884 Code cleanup 2018-12-12 16:57:00 -05:00
Ben12345rocks 2c79dff678 Added new option 2018-12-12 16:43:37 -05:00
Ben12345rocks 56c4a094cf Little fix 2018-12-09 17:01:45 -05:00
Ben12345rocks 1898af9fea Little fix 2018-12-09 16:39:46 -05:00
Ben12345rocks 885d2bc019 Improvements 2018-12-09 15:39:54 -05:00
Ben12345rocks 12c604d09c Bug fix 2018-12-08 21:55:49 -05:00
Ben12345rocks 7b48699b39 Another spelling mistake 2018-12-08 19:49:24 -05:00
Ben12345rocks 3b5593882f Fix spelling mistake 2018-12-08 19:46:28 -05:00
Ben12345rocks 8c72154eed Update version number 2018-12-08 19:29:48 -05:00
Ben12345rocks 0dc942ecfd Add option to disable update checks 2018-12-07 17:24:36 -05:00
Ben12345rocks bc4d051590 Fix description 2018-12-06 18:57:10 -05:00
Ben12345rocks 011a0322ea Added new canvote placeholder for votesites 2018-12-06 18:56:30 -05:00
Ben12345rocks ed90db12a4 Add more placeholders 2018-12-05 19:51:29 -05:00
Ben12345rocks 3afea03485 Added ability to convert from superbvote 2018-12-05 19:26:58 -05:00
Ben12345rocks 6da17ee181 Minor fixes 2018-12-05 19:10:49 -05:00
Ben12345rocks e5d1c255c0 Add debug to vote party 2018-12-05 17:42:15 -05:00
Ben12345rocks b43754661c Added vote reward back button 2018-12-04 16:51:55 -05:00
Ben12345rocks 89c419c8df Bug fix 2018-12-03 21:23:47 -05:00
Ben12345rocks bd6b2b1edb Add permission for base /vote 2018-12-03 21:21:08 -05:00
Ben12345rocks b7c73902f2 Bug fix for vote party 2018-12-02 12:57:28 -05:00
Ben12345rocks c0995447de Broadcast before vote party rewards 2018-12-02 12:11:15 -05:00
Ben12345rocks d970506c76 Little improvements 2018-11-23 20:37:27 -05:00
Ben12345rocks 74fb06302a Little bits of cleanup 2018-11-23 20:28:03 -05:00
Ben12345rocks 1cfed8aa98 Bug fix 2018-11-22 18:31:59 -05:00
Ben12345rocks 9f563c37e5 Bug fix 2018-11-22 18:23:15 -05:00
Ben12345rocks d311588984 Update version number 2018-11-22 18:18:27 -05:00
Ben12345rocks 8c5324f602 Fully fix tab complete 2018-11-22 17:40:14 -05:00
Ben12345rocks 17832a0bf7 Bug fix for now 2018-11-21 16:55:04 -05:00
Ben12345rocks 3c415c63c9 Bug fix 2018-11-19 16:55:59 -05:00
Ben12345rocks 6ab27775d2 Bug fix 2018-11-19 16:39:56 -05:00
Ben12345rocks e04bf8210f Minor change 2018-11-18 14:06:19 -05:00
Ben12345rocks 7b4879ddf1 Bug fix 2018-11-18 13:57:22 -05:00
Ben12345rocks 081ac7bb3c Fix misspelling in config 2018-11-18 13:38:48 -05:00
Ben12345rocks d9894c6b74 Add description for placeholders 2018-11-18 13:35:30 -05:00
Ben12345rocks f13f56c830 Add ability to set description for placeholders 2018-11-18 13:26:21 -05:00
Ben12345rocks b6a67f2aeb Update version number 2018-11-18 12:56:04 -05:00
Ben12345rocks a5b416b210 Bug fix 2018-11-14 16:50:37 -05:00
Ben12345rocks caa4a7a714 Change help message 2018-11-13 20:17:27 -05:00
Ben12345rocks 72aa819361 Add command to force vote party 2018-11-13 20:16:26 -05:00
Ben12345rocks cf52db0c7d Bug fix 2018-11-13 20:13:43 -05:00
Ben12345rocks 5021c4bf67 Remove option 2018-11-13 19:45:16 -05:00
Ben12345rocks 9dd8e757d4 Fix typo 2018-11-13 19:26:00 -05:00
Ben12345rocks da7cdb74d4 Bug fix 2018-11-13 16:55:05 -05:00
Ben12345rocks 18c6ee6614 Bug fixes 2018-11-13 16:53:08 -05:00
Ben12345rocks cafe2b1de7 Slight case change on command 2018-11-05 19:29:56 -05:00
Ben12345rocks 74c94746c1 Check milestones on amount edit 2018-11-04 12:27:31 -05:00
Ben12345rocks 61130a1b2b Slight changes 2018-11-03 20:48:39 -04:00
Ben12345rocks 7dafa5c8eb Bug fix 2018-11-03 20:45:13 -04:00
Ben12345rocks c89edc47c3 Add more placeholders 2018-11-03 20:30:05 -04:00
Ben12345rocks 0b89df6262 Improve /av servicesites 2018-11-03 20:20:36 -04:00
Ben12345rocks c2218b2c67 Added command to set milestone count 2018-11-02 16:50:06 -04:00
Ben12345rocks 1950cfdd2d Little bug fixes 2018-11-01 19:23:08 -04:00
Ben12345rocks 71af70a026 Add new commands 2018-10-30 20:40:03 -04:00
Ben12345rocks b269c29f7c Add option to wait until votedelay is over to accept vote, closes #437 2018-10-29 19:28:31 -04:00
Ben12345rocks c9e8ade60f Update version number 2018-10-28 13:12:44 -04:00
Ben12345rocks 2364fd7ac6 Simple cleanup 2018-10-27 21:59:57 -04:00
Ben12345rocks 7135ed0f95 Code cleanup 2018-10-27 21:33:25 -04:00
Ben12345rocks b5fbaaaf92 More config api changes 2018-10-27 21:30:25 -04:00
Ben12345rocks 94c025886a Move more config options to newer api 2018-10-27 20:15:58 -04:00
Ben12345rocks 0956466edb Little bit of cleanup 2018-10-26 21:03:20 -04:00
Ben12345rocks b2b23ab622 Add option to only update with players online 2018-10-26 17:09:35 -04:00
Ben12345rocks 0e6529efbe Bug fix 2018-10-25 17:24:39 -04:00
Ben12345rocks f7ce51f63a Clear cache for voteshop 2018-10-25 17:19:48 -04:00
Ben12345rocks 68334ef1a2 Config improvements 2018-10-24 20:03:19 -04:00
Ben12345rocks 404c1eeb4d Added clearcacheonjoin option 2018-10-23 21:00:16 -04:00
Ben12345rocks 347c1d975d Update to 1.13.2 2018-10-23 20:55:17 -04:00
Ben12345rocks 3b022fc841 Bug fixes 2018-10-23 20:48:47 -04:00
Ben12345rocks 88afb70fad Add new option to always update 2018-10-23 16:54:01 -04:00
Ben12345rocks 62e21d9f93 Use lombok 2018-10-21 15:18:36 -04:00
Ben12345rocks 20289a5d7b Slight change 2018-10-21 13:52:24 -04:00
Ben12345rocks 02b0103fbd Add option to process rewards 2018-10-21 13:25:36 -04:00
Ben12345rocks a514ad6cac Javadoc fix 2018-10-20 17:21:08 -04:00
Ben12345rocks 894f1147fd Update version number 2018-10-20 17:17:03 -04:00
Ben12345rocks 6a881b7c5f Cleanup 2018-10-18 19:54:20 -04:00
Ben12345rocks b3eaac0fbb Change how placeholders work in vote shop 2018-10-17 20:05:51 -04:00
Ben12345rocks 4444b53106 Bug fix 2018-10-17 19:57:31 -04:00
Ben12345rocks ec4a28a63e Add vote shop limit system 2018-10-16 17:43:19 -04:00
Ben12345rocks f3722a32f5 Undo little change 2018-10-15 20:29:00 -04:00
Ben12345rocks b3cf416fc4 Minor change 2018-10-15 20:17:02 -04:00
Ben12345rocks 66c2f3a5a6 Minor fixes, changes to sign loading 2018-10-15 20:04:03 -04:00
Ben12345rocks 50609d6729 Little bit of cleanup 2018-10-14 19:28:13 -04:00
Ben12345rocks 0635e7370e Minor fixes 2018-10-14 13:59:10 -04:00
Ben12345rocks f94951cffa Send a player a message if service site might be invalid of fake votes 2018-10-14 13:44:39 -04:00
Ben 5ebdcca3e6 Update .project 2018-10-14 13:30:58 -04:00
Ben f00b7df49b Delete Build to server.launch 2018-10-14 13:30:27 -04:00
Ben12345rocks e0a6c14825 Copy to test server on build 2018-10-14 13:28:58 -04:00
Ben12345rocks a3bcc4a391 Change how votes are processed 2018-10-13 08:37:04 -04:00
Ben12345rocks 7af7034149 Update to advancedcore changes 2018-10-08 17:52:43 -04:00
Ben12345rocks 3cb18946ed lots of code improvements 2018-10-07 14:27:32 -04:00
Ben12345rocks ac604ee538 Change how fast signs update 2018-10-07 13:50:26 -04:00
Ben12345rocks aac3c129cc Change api for special rewards 2018-10-07 13:47:33 -04:00
Ben12345rocks 28695094ca Undo change for now, so no need to update expansion 2018-10-07 13:36:45 -04:00
Ben12345rocks ac583d58bc Slight changes 2018-10-06 09:05:42 -04:00
Ben12345rocks 52de25fad3 Relocate classes 2018-10-03 19:47:50 -04:00
Ben12345rocks 72bf623007 More improvements to placeholders, command to see values of a player 2018-10-03 19:44:02 -04:00
Ben12345rocks c6e61ea5a5 Javadoc fix 2018-09-30 13:29:43 -04:00
Ben12345rocks b400476758 Improvements, update version number 2018-09-30 13:22:11 -04:00
Ben12345rocks 9ff0fc8356 Switch to new methods 2018-09-29 09:16:14 -04:00
Ben12345rocks f7b142e8c6 A lot of api changes/improvements 2018-09-27 21:12:50 -04:00
Ben12345rocks 4d80915811 Improvements 2018-09-27 20:55:23 -04:00
Ben12345rocks f1edc73eca New placeholder api, command to see placeholders, not fully tested 2018-09-26 21:04:55 -04:00
Ben12345rocks 197beb1792 Remove need for slot numbers in vote gui 2018-09-26 20:24:54 -04:00
Ben12345rocks 3aed208345 Remove need for slot number in vote shop, other minor changes 2018-09-26 20:18:32 -04:00
Ben12345rocks 27e500fbf0 Lots of changes, added test command 2018-09-19 20:20:46 -04:00
Ben12345rocks a0f6016dcd Bug fix 2018-09-15 20:06:47 -04:00
Ben12345rocks f37abe15c7 Add service site placeholder to broadcasts 2018-09-11 16:46:37 -04:00
Ben12345rocks 8f66733fe7 Update version number 2018-08-26 13:00:45 -04:00
Ben12345rocks 1bafb69f84 Update to 1.13.1, bug fix for vote party 2018-08-26 12:54:30 -04:00
Ben12345rocks ed5ced8b31 Add ability to disable /vote reward 2018-08-25 08:17:40 -04:00
Ben12345rocks 468747847c Minor changes 2018-08-23 20:56:03 -04:00
Ben12345rocks d28ccc85ac Updates 2018-08-23 20:53:13 -04:00
Ben12345rocks 9b5d6333d1 Remove unneeded duplicate name 2018-08-21 17:22:28 -04:00
Ben12345rocks 99307f15c7 Add warning about running versions older than 1.13 2018-08-20 20:06:23 -04:00
Ben12345rocks 8e9db014d1 Bug fix 2018-08-20 19:40:58 -04:00
Ben12345rocks 5e88782475 Bug fix 2018-08-20 19:40:17 -04:00
Ben12345rocks ba50789744 Remove unneeded debug 2018-08-20 19:30:24 -04:00
Ben12345rocks f06e2d8045 Update to redesigned reward system 2018-08-18 21:03:19 -04:00
Ben12345rocks 58e7143a0a Bug fix 2018-08-13 19:16:11 -04:00
Ben12345rocks 0ee3706190 Update version number to 5.14.2 2018-08-11 11:29:31 -04:00
Ben12345rocks 9f7fc3dafd Bug fix 2018-08-11 11:29:03 -04:00
Ben12345rocks d8ce4a9578 Minor config addition 2018-08-11 11:03:45 -04:00
Ben12345rocks 574e8d4a54 Update version number to 5.14.1 2018-08-11 10:59:09 -04:00
Ben12345rocks 19a7a6a733 Change /vote last to show time since vote 2018-08-11 10:43:43 -04:00
Ben12345rocks 1e131e57c3 Minor config change 2018-08-05 12:28:35 -04:00
Ben12345rocks 57795bdb23 Update version number 2018-07-25 19:17:46 -04:00
Ben12345rocks 52bbb76aad Change version to beta 2018-07-22 14:55:01 -04:00
Ben12345rocks 1257ac4600 Update to 1.13 2018-07-22 13:56:34 -04:00
Ben12345rocks 64ffc38405 Convert many users at a time 2018-07-22 13:36:20 -04:00
Ben12345rocks f8009b05bc Bug fixes 2018-07-22 13:28:14 -04:00
Ben12345rocks 114f217046 Bug fixes 2018-07-21 21:44:56 -04:00
Ben12345rocks 2de309cccc Bug fix 2018-07-21 18:38:52 -04:00
Ben12345rocks 7f827857bc Improvements 2018-07-21 17:13:02 -04:00
Ben12345rocks 75e244f678 Quick change 2018-07-18 17:02:58 -04:00
Ben12345rocks a346f28df1 Bug fix 2018-07-18 17:00:56 -04:00
Ben12345rocks afa57566da Update version number 2018-07-16 16:56:17 -04:00
Ben12345rocks 6f46469ff6 Add nickname to broadcast 2018-07-15 20:54:55 -04:00
Ben12345rocks 7edf33a448 Undo, for bug fix 2018-07-15 19:10:39 -04:00
Ben12345rocks 4d7b30eb20 Update config 2018-07-15 15:39:44 -04:00
Ben12345rocks ed8d92e4a4 Update to 1.13 2018-07-15 15:04:47 -04:00
Ben12345rocks f7e62f5790 Disable syncing placeholders 2018-07-15 14:17:27 -04:00
Ben12345rocks 84146236b1 Update version number, bug fix 2018-07-15 14:10:18 -04:00
Ben12345rocks 97c4ee3564 Bug fixes 2018-07-15 14:04:30 -04:00
Ben12345rocks f8547c5d86 Bug fix 2018-07-15 13:49:14 -04:00
Ben12345rocks c97acf7a29 Many improvements 2018-07-15 13:42:45 -04:00
Ben12345rocks fbbb11a4b0 Bug fix 2018-07-14 19:59:39 -04:00
Ben12345rocks e517bb43b8 Minor changes 2018-07-14 19:47:26 -04:00
Ben12345rocks e43ef1ea3e Silence erros 2018-07-08 15:00:30 -04:00
Ben12345rocks 7ab78f30d5 Update version number 2018-07-07 19:55:31 -04:00
Ben12345rocks 668bc34157 Update version number 2018-07-06 08:45:17 -04:00
Ben12345rocks 5f89b30628 Change default option 2018-07-05 09:00:56 -04:00
Ben12345rocks 2145c9bc40 Mysql database improvements 2018-07-04 21:53:06 -04:00
Ben12345rocks fdb3bca7f8 Add ability to require permsission for voteshop 2018-06-16 19:58:49 -04:00
Ben12345rocks c96610d137 Add support for offline placeholders from new placeholderapi update 2018-06-13 16:54:50 -04:00
Ben12345rocks be6414602d Add config option to disable vote shop 2018-06-03 12:36:11 -04:00
Ben12345rocks a7b2d8010c Update version number 2018-05-07 20:09:23 -04:00
Ben12345rocks 4ccc5def2b Update version number 2018-05-06 12:55:22 -04:00
Ben12345rocks 5378d4e372 Slight bug fix 2018-05-04 16:57:37 -04:00
Ben12345rocks 8d37d39b1c Update version number 2018-04-21 20:54:13 -04:00
Ben12345rocks 473a83604c Add config option for delay 2018-04-16 19:19:08 -04:00
Ben12345rocks 4f72fbab78 Bug fix 2018-04-15 21:14:38 -04:00
Ben12345rocks 1f62d68aed Add a delay 2018-04-15 20:53:35 -04:00
Ben12345rocks 7c063bbe68 Only convert 500 users at a time 2018-04-15 20:23:54 -04:00
Ben12345rocks 4c11df4b37 Bug fix 2018-04-14 21:27:11 -04:00
Ben12345rocks f859caf1ee Bug fix 2018-04-14 10:29:03 -04:00
Ben12345rocks 566d688b57 Javadoc fixes 2018-03-30 09:09:34 -04:00
Ben12345rocks e4209b15c3 Update version number 2018-03-30 08:37:17 -04:00
Ben12345rocks bd5b26805a Update config 2018-03-25 13:05:22 -04:00
Ben12345rocks 27c43b8e8e New way to do multiple places for top voter 2018-03-25 12:55:41 -04:00
Ben12345rocks 5b719141fe Change default config 2018-03-22 16:52:57 -04:00
Ben12345rocks f8ee0bba17 Bug fixes 2018-03-22 16:52:05 -04:00
Ben12345rocks d5ea3c60a9 Implement new vote party system type 2018-03-22 16:50:46 -04:00
Ben12345rocks 3be9eaf47a Slight performance improvement 2018-03-21 19:12:07 -04:00
Ben12345rocks f385927958 implement config option for backups 2018-03-18 21:00:51 -04:00
Ben12345rocks ec491a937c Bug fix 2018-03-11 12:44:40 -04:00
Ben12345rocks 7bf879a08f Bug fix 2018-03-11 12:41:20 -04:00
Ben 18a0e1f338 Merge pull request #364 from Ben12345rocks/5.12.7
5.12.7
2018-03-11 12:31:24 -04:00
Ben12345rocks c7cbf0230c Update version number 2018-03-11 12:31:09 -04:00
Ben12345rocks cee519176a Bug fix, closes #363 2018-03-07 20:07:31 -05:00
Ben12345rocks 50d75449c0 Make error messages more clear 2018-03-05 19:21:54 -05:00
Ben12345rocks 316fbf7e62 Add next placeholder to text version of /vote 2018-03-05 19:11:25 -05:00
Ben12345rocks 7c82cbc6b4 Add new config option 2018-03-04 19:33:14 -05:00
Ben12345rocks 8387b48e6b Code cleanup 2018-03-04 12:33:44 -05:00
Ben12345rocks 0e806a2985 Bug fixes 2018-03-03 21:21:17 -05:00
Ben12345rocks d06041cfd8 Bug fix 2018-02-17 20:51:35 -05:00
Ben12345rocks 1a257a3858 Add placeholder 2018-02-17 20:31:19 -05:00
Ben12345rocks 90c0104de3 Update to 5.12.6 2018-02-17 20:27:37 -05:00
Ben b3473174de Merge pull request #352 from Ben12345rocks/5.12.5
5.12.5
2018-02-11 14:19:53 -05:00
Ben12345rocks 5b853b9ad4 Update version number 2018-02-11 14:19:45 -05:00
Ben12345rocks 3b3578fa87 Bug fixes 2018-02-11 12:54:08 -05:00
Ben12345rocks 6bf079068b Bug fix 2018-02-06 16:51:38 -05:00
Ben12345rocks 2a889ff2ce Update build path 2018-02-04 12:59:38 -05:00
Ben de9c9185f3 Merge pull request #341 from Ben12345rocks/5.12.4
5.12.4
2018-02-04 12:58:31 -05:00
Ben12345rocks 07c4534d10 Update version number 2018-02-04 12:51:28 -05:00
Ben12345rocks b3462bebe6 Add option for top voter award ties, closes #343 2018-02-01 20:03:53 -05:00
Ben12345rocks 5525a378ae Minor bug fix 2018-02-01 20:00:15 -05:00
Ben12345rocks bb8588e144 Bug fixes 2018-01-30 19:57:40 -05:00
Ben12345rocks 8abd596172 Minor improvement 2018-01-30 19:44:11 -05:00
Ben12345rocks df93655db3 Add a resync command 2018-01-30 16:54:49 -05:00
Ben12345rocks f1f97a8908 More testing 2018-01-29 20:07:13 -05:00
Ben12345rocks 65fe355d6d Bug fix 2018-01-29 17:58:52 -05:00
Ben12345rocks 7cd5954cd2 Quick bug fix, update version number 2018-01-28 15:46:51 -05:00
Ben12345rocks 5618d4b479 Update version number 2018-01-28 14:34:04 -05:00
Ben 898b2985e5 Merge pull request #339 from Ben12345rocks/5.12.2
5.12.2
2018-01-28 14:32:39 -05:00
Ben12345rocks cd7fa2cd39 Minor change 2018-01-28 13:55:43 -05:00
Ben12345rocks 62afcfc820 Add more debug 2018-01-24 17:28:17 -05:00
Ben12345rocks 12233d1061 Bug fix, closes #338 2018-01-22 16:51:44 -05:00
Ben12345rocks c2b3178f2e Bug fixes 2018-01-21 19:05:38 -05:00
Ben12345rocks 2e01c1eafd Bug fix 2018-01-21 15:07:19 -05:00
Ben12345rocks 384ace3013 Add option to clear cache on vote 2018-01-20 17:47:31 -05:00
Ben 2693874d99 Merge pull request #334 from Ben12345rocks/5.12.1
5.12.1
2018-01-14 20:25:23 -05:00
Ben12345rocks f5b780453c Update build path 2018-01-14 20:25:06 -05:00
Ben12345rocks 7a7bb93091 Update version number 2018-01-14 20:19:40 -05:00
Ben12345rocks 8933dac0db Add option to UseSSL, closes #337 2018-01-14 19:43:42 -05:00
Ben12345rocks 822e0a5766 Closes #336 2018-01-14 13:16:57 -05:00
Ben12345rocks e1fdc5cd6b Use new api 2018-01-13 14:35:02 -05:00
Ben12345rocks 3b0451b348 Improving checking of valid service sites 2018-01-07 13:26:47 -05:00
Ben12345rocks 4de380318f Add ability to disable checking names on mojang 2018-01-05 17:55:54 -05:00
Ben12345rocks 1c7afc8bb3 Bug fix 2018-01-01 15:30:26 -05:00
Ben12345rocks 7b15289c43 Bug fix 2017-12-31 13:23:44 -05:00
Ben12345rocks 241746fdf0 Update build path 2017-12-21 19:40:50 -05:00
Ben 37932f570e Merge pull request #322 from Ben12345rocks/5.12
5.12
2017-12-21 19:39:41 -05:00
Ben12345rocks 1c834a480f Other changes 2017-12-21 19:31:51 -05:00
Ben12345rocks 6a0d74f400 Update version number 2017-12-18 20:13:52 -05:00
Ben12345rocks feed85d9bb Add support for player name in vote url 2017-12-18 16:46:30 -05:00
Ben12345rocks f9b4adf342 Back to beta version 2017-12-17 16:35:13 -05:00
Ben12345rocks a04b9b996d Update version number 2017-12-17 15:45:51 -05:00
Ben12345rocks 4992c547ed Add an option to add totals 2017-12-17 15:27:54 -05:00
Ben12345rocks d5c1f3bf11 Some improvements to top voter files 2017-12-17 15:17:10 -05:00
Ben12345rocks b82736e933 More performance boosts 2017-12-17 13:59:00 -05:00
Ben12345rocks d0d1e262c2 Performance changes 2017-12-17 13:55:03 -05:00
Ben12345rocks 0b0dea8f51 Bug fixes 2017-12-16 14:40:05 -05:00
Ben12345rocks 48e1298b73 Allow top voter ties 2017-12-16 12:54:44 -05:00
Ben12345rocks 8d850dde7e Add command to reset offline rewards/votes 2017-12-14 20:00:30 -05:00
Ben12345rocks 963ff8b5f2 Add an option to reset vote party monthly 2017-12-11 19:33:56 -05:00
Ben12345rocks 5a871656c5 Add beta build version 2017-12-10 17:13:22 -05:00
Ben12345rocks 011e18ff9d Remove debug 2017-12-10 17:11:58 -05:00
Ben12345rocks 53f9b2c9f8 Major improvements 2017-12-10 17:07:11 -05:00
Ben12345rocks fe488158df Bug fix 2017-12-10 15:15:08 -05:00
Ben12345rocks 699bb1bdf6 Rename a config option to avoid confusion 2017-12-10 14:58:56 -05:00
Ben12345rocks f9c8b8a719 Generate item section for a vote site 2017-12-10 14:40:12 -05:00
Ben12345rocks 242eceda2c Fix typo 2017-12-10 14:17:46 -05:00
Ben12345rocks 98cd79684e Minor improvements 2017-12-10 14:16:13 -05:00
Ben12345rocks 5b4f73dadf Small api improvement 2017-12-09 20:12:40 -05:00
Ben12345rocks a8113aa941 Add new events 2017-12-09 20:09:29 -05:00
Ben12345rocks f741dbf6a7 Add last month total, closes #317 2017-12-05 18:59:25 -05:00
Ben12345rocks f589817301 Add ability to execute console commands once for vote party, closes #316 2017-12-03 13:21:36 -05:00
Ben12345rocks 27874ecb70 Fixed wrong month showing in top voter monthly files 2017-12-03 13:12:00 -05:00
Ben12345rocks 73726123ae Update build path 2017-11-19 15:56:33 -05:00
Ben 0a7637f04b Merge pull request #312 from Ben12345rocks/5.11
5.11
2017-11-19 15:36:35 -05:00
Ben12345rocks c4d3068895 Update version number 2017-11-19 15:25:05 -05:00
Ben12345rocks c497d338f9 Minor improvement 2017-11-19 15:23:29 -05:00
Ben12345rocks 9140466e02 Lots of improvements, closes #306 2017-11-19 14:28:42 -05:00
Ben12345rocks 2d6b1ebd33 Add ability to edit url text from vote url gui 2017-11-13 21:04:22 -05:00
Ben12345rocks d0ff76e9c4 Add permission to ignore vote reminding 2017-11-13 20:58:57 -05:00
Ben12345rocks 6ff6b14c2d Bug fixes, closes #303 2017-10-29 12:45:12 -04:00
Ben12345rocks 198dffe5df Javadoc fixes 2017-10-22 15:51:27 -04:00
Ben12345rocks 868a755d86 Bug fixes 2017-10-22 15:48:30 -04:00
Ben12345rocks 9f4c6bf250 Update build path 2017-10-22 15:28:15 -04:00
Ben 655cec2bac Merge pull request #299 from Ben12345rocks/5.10.5
5.10.5
2017-10-22 15:24:41 -04:00
Ben12345rocks 9fc0b2c9a3 Bug fix 2017-10-22 14:58:02 -04:00
Ben12345rocks 5aa396cc67 Lots of bug fixes, added purging 2017-10-22 14:51:54 -04:00
Ben12345rocks d11b90fabd Update version number 2017-10-22 12:27:05 -04:00
Ben12345rocks bc85b88c27 Improve update message. 2017-10-22 12:26:18 -04:00
Ben12345rocks a9e110f21f Made /vote party say its disabled when disabled 2017-10-20 21:05:50 -04:00
Ben12345rocks aa4622437f Bug fix 2017-10-20 21:01:55 -04:00
Ben12345rocks 46eb548962 Bug fixes 2017-10-20 14:49:29 -04:00
Ben12345rocks 25b3494dc5 Bug fixes 2017-10-19 21:55:59 -04:00
Ben12345rocks 33602b3ed2 Bug fixes 2017-10-19 20:34:21 -04:00
Ben12345rocks 36662ab18d Bug fixes 2017-10-19 15:48:05 -04:00
Ben12345rocks 40473b14a2 Bug fixes 2017-10-19 15:07:38 -04:00
Ben12345rocks 6ca6529f2c Improvements 2017-10-19 13:42:04 -04:00
Ben12345rocks a6b2945b14 More improvements 2017-10-19 11:51:11 -04:00
Ben12345rocks b5fc7da7c9 Lots of command improvements 2017-10-19 11:48:23 -04:00
Ben12345rocks 41104be50f Minor bug fix 2017-10-16 21:56:10 -04:00
Ben12345rocks e2dabbb8c1 Update build path 2017-10-16 21:38:50 -04:00
Ben12345rocks 5f37262a48 Update build path 2017-10-16 21:37:59 -04:00
Ben12345rocks efd48a1005 Add download completion message, closes #296 2017-10-16 21:36:54 -04:00
Ben12345rocks a813172c43 Bug fix 2017-10-14 08:17:54 -04:00
Ben12345rocks 0f8f190a21 Javadoc fixes 2017-10-13 20:47:32 -04:00
Ben12345rocks 0f87222709 Update build path and new config option 2017-10-13 20:42:15 -04:00
Ben 518ecfc42b Merge pull request #294 from Ben12345rocks/5.10.3
5.10.3
2017-10-13 20:18:15 -04:00
Ben12345rocks d02c4a4b70 Update version number 2017-10-13 19:57:05 -04:00
Ben12345rocks 9359b4fb05 Bug fixes 2017-10-13 11:06:16 -04:00
Ben12345rocks 4f3ba5b1c4 Make storage type case insensitive 2017-10-13 10:34:39 -04:00
Ben12345rocks 600287e9c5 Add a warning if no rewards are detected for vote sites on startup 2017-10-13 10:21:14 -04:00
Ben12345rocks a05114e277 Added vote option in votesite admin gui 2017-10-13 10:11:43 -04:00
Ben12345rocks 5449038cfd Changes to permissions 2017-10-11 20:25:52 -04:00
Ben12345rocks 853cdd0a13 Code cleanup 2017-10-11 20:13:16 -04:00
Ben12345rocks 3cd36d3fd7 Add options for fake votes, closes #269 2017-10-11 20:11:00 -04:00
Ben12345rocks bd3abaae76 Use better skull system, closes #293 2017-10-03 16:54:37 -04:00
Ben12345rocks a9a70a20ee Bug fix 2017-10-01 19:22:37 -04:00
Ben12345rocks 2fc2067bc5 Bug fixes, closes #288 2017-10-01 13:49:44 -04:00
Ben12345rocks 2e6e3617a3 Fix issues with permissions 2017-10-01 13:43:35 -04:00
Ben12345rocks c590ca5a93 Bug fix, closes #286 2017-09-29 16:03:38 -04:00
Ben12345rocks 2772db23b8 Improvements 2017-09-29 15:31:47 -04:00
Ben12345rocks ee3217b942 Bug fix 2017-09-28 15:13:22 -04:00
Ben12345rocks b1dfe6a14b Bug fix 2017-09-28 14:52:01 -04:00
Ben12345rocks 222a3824af Bug fix 2017-09-28 14:49:44 -04:00
Ben12345rocks 5f5d3dd2c5 Bug fixes 2017-09-28 14:45:07 -04:00
Ben12345rocks 84ba523233 Bug fix 2017-09-28 14:35:07 -04:00
Ben12345rocks 1da224ff6b closes #281 2017-09-28 14:16:56 -04:00
Ben12345rocks e2efe2b289 Added more config options, closes #283 2017-09-28 14:02:58 -04:00
Ben12345rocks 9cf044aa64 Bug fixes, closes #280 2017-09-26 16:30:55 -04:00
Ben12345rocks eac8078a65 Improvements 2017-09-26 14:20:35 -04:00
Ben12345rocks 2cf97ba408 Javadoc fix 2017-09-26 14:15:30 -04:00
Ben 23ffc18289 Merge pull request #279 from Ben12345rocks/5.10.2
5.10.2
2017-09-26 14:12:57 -04:00
Ben12345rocks 2152a6688f Update version number 2017-09-26 14:12:03 -04:00
Ben12345rocks c3220392eb Improve message 2017-09-26 14:10:45 -04:00
Ben12345rocks fec401485b Improve the service sites message 2017-09-26 14:03:27 -04:00
Ben12345rocks 2b2a6385b4 Bug fixes 2017-09-26 11:23:16 -04:00
Ben12345rocks 9937f3d9c0 Bug fixes 2017-09-26 10:50:54 -04:00
Ben12345rocks b276d516a6 Improve message for offline vote debug 2017-09-26 10:30:47 -04:00
Ben12345rocks d6a336e9b9 Bug fixes 2017-09-26 10:29:52 -04:00
Ben12345rocks b356cb1794 Bug fixes, closes #276 2017-09-26 08:46:29 -04:00
Ben12345rocks 4b0a2ee384 Add backbutton to vote shop 2017-09-25 21:31:44 -04:00
Ben12345rocks 8dab62124e Add a warning to help track down missing item sections 2017-09-25 21:23:18 -04:00
Ben12345rocks a7df1a0150 Bug fix 2017-09-25 21:00:00 -04:00
Ben12345rocks f2d7e24400 Make names case insensitive, closes #267 2017-09-25 20:52:21 -04:00
Ben12345rocks fa74bdcb3c Bug fix 2017-09-25 20:30:25 -04:00
Ben12345rocks 80a4cb8f78 Improve vote delay daily, closes #272 2017-09-25 20:29:46 -04:00
Ben12345rocks f16aef16d4 Add a method of getting service sites, closes #271 2017-09-25 20:23:19 -04:00
Ben12345rocks e7a1a1241b Bug fixes, closes #273, closes #274 2017-09-25 20:09:56 -04:00
Ben12345rocks 0ee002e3fb Bug fix, closes #278 2017-09-25 20:01:42 -04:00
Ben12345rocks 69ab9df8b3 Minor config fix 2017-09-25 19:53:59 -04:00
Ben12345rocks 54ff1dd66b Update build path 2017-09-22 09:46:28 -04:00
Ben12345rocks 75732910e2 Update build path 2017-09-22 09:44:36 -04:00
Ben 9c6614836a Merge pull request #266 from Ben12345rocks/5.10.1
5.10.1
2017-09-22 09:42:47 -04:00
Ben12345rocks 72148816e5 Update version number 2017-09-22 08:56:35 -04:00
Ben12345rocks f969c91170 Don't set points if no points are added 2017-09-21 08:46:10 -04:00
Ben12345rocks 904d660919 Trim leading and trailing whitespace from votes 2017-09-20 11:45:46 -04:00
Ben12345rocks fb5449effe Bug fixes 2017-09-17 20:05:31 -04:00
Ben12345rocks 46db998e17 Make yml errors much more visible 2017-09-17 15:23:33 -04:00
Ben12345rocks 2bcf096584 Bug fix 2017-09-03 15:34:59 -04:00
Ben12345rocks c2b7e2388e javadoc fix 2017-09-03 15:27:44 -04:00
Ben 180ae04b24 Merge pull request #256 from Ben12345rocks/5.10
5.10
2017-09-03 15:23:27 -04:00
Ben12345rocks 73efcfb87f Update build path 2017-09-03 15:23:03 -04:00
Ben12345rocks 6ba2ff582a Remove debug 2017-09-03 15:16:28 -04:00
Ben12345rocks d622b5b684 Improvements 2017-09-03 15:10:55 -04:00
Ben12345rocks 2247134daa Update version number 2017-09-03 13:06:49 -04:00
Ben12345rocks 7de7150e41 Update build path 2017-09-03 13:01:14 -04:00
Ben12345rocks be23989a20 Add ability to not clear cache on update, improving speeds 2017-09-03 12:44:37 -04:00
Ben12345rocks 8c4bdc8e20 Add option to disregard fake votes for voteparty 2017-09-03 12:24:46 -04:00
Ben12345rocks f4d507d821 Add command for voteparty 2017-09-03 12:16:44 -04:00
Ben12345rocks 43fd338efd New option 2017-08-30 10:28:12 -04:00
Ben12345rocks c51873e7b2 Improvements 2017-08-30 10:23:06 -04:00
Ben 5e1d5b534b Merge pull request #251 from Ben12345rocks/5.9.7
5.9.7
2017-08-27 13:02:22 -04:00
Ben12345rocks c762ef5be1 Update version number 2017-08-27 12:59:45 -04:00
Ben12345rocks 1d0f8d5c06 Prevent exploits 2017-08-26 19:46:44 -04:00
Ben12345rocks 6129480077 More config options, closes #248 2017-08-24 11:35:44 -04:00
Ben12345rocks f8d7c837f9 Add command to clear offline votes, closes #249 2017-08-24 11:23:29 -04:00
Ben12345rocks d7aba7b390 Add an option for max mysql size 2017-08-20 12:29:56 -04:00
Ben12345rocks 5833a1c5cc Update build path 2017-08-11 20:52:36 -04:00
Ben12345rocks 6833247a8c Update build path 2017-08-11 20:49:57 -04:00
Ben 46087ccad5 Merge pull request #244 from Ben12345rocks/5.9.6
5.9.6
2017-08-11 20:49:16 -04:00
Ben12345rocks 4634d6bdc2 More improvements 2017-08-11 20:38:38 -04:00
Ben12345rocks 3f451c888a Improvements to service sites 2017-08-11 20:36:49 -04:00
Ben12345rocks ea448e3920 Bug fix 2017-08-11 20:25:33 -04:00
Ben12345rocks 169aaf026e Update version number 2017-08-11 14:11:01 -04:00
Ben12345rocks 0af3f7f2bc Update build path 2017-08-08 10:38:50 -04:00
Ben b3baa33c39 Merge pull request #240 from Ben12345rocks/5.9.5
5.9.5
2017-08-08 10:34:31 -04:00
Ben12345rocks e7f8aac88d Bug fix 2017-08-08 10:30:12 -04:00
Ben12345rocks 6ce4040bae Update build path 2017-08-07 17:37:44 -04:00
Ben12345rocks f5e38b2b1b Update version number 2017-08-07 17:22:19 -04:00
Ben12345rocks 9fdb9b4efb Minor change to user api 2017-08-06 12:44:57 -04:00
Ben12345rocks 29f020bdc0 Bug fix 2017-08-03 18:22:34 -04:00
Ben12345rocks cce5bb0672 Bug fix, closes #238 2017-08-03 17:47:43 -04:00
Ben12345rocks 8a0cd0426c Fix offline top voter messaging 2017-08-02 21:02:38 -04:00
Ben12345rocks 397c4392a0 Update perms list 2017-08-02 19:33:27 -04:00
Ben12345rocks 4784b372c9 Make site names non case sensitive, closes #235 2017-07-31 20:09:35 -04:00
Ben12345rocks 1521d0787c Add vanish support for broadcasting, closes #232 2017-07-31 20:05:30 -04:00
Ben12345rocks 9cbcb74822 Improve last vote time showing when never voted, closes #237 2017-07-31 19:57:07 -04:00
Ben ae75f63c94 Merge pull request #231 from Ben12345rocks/5.9.4
5.9.4
2017-07-23 17:06:25 -04:00
Ben12345rocks e91e2e109c Update build path 2017-07-23 17:02:33 -04:00
Ben12345rocks 0fb0a6351d Add options to remove back button, closes #227 2017-07-23 16:50:45 -04:00
Ben12345rocks 10d06c170d Code cleanup 2017-07-23 14:48:16 -04:00
Ben12345rocks a4c0a9b45b Update version number 2017-07-23 14:43:57 -04:00
Ben12345rocks 63fc8d436e Update advancedcore 2017-07-23 14:42:49 -04:00
Ben12345rocks 6160110ba2 Improvements 2017-07-22 19:34:34 -04:00
Ben12345rocks e337c267a8 Fix typo, closes #228 2017-07-22 19:26:08 -04:00
Ben12345rocks b0abbcc99f Improve mysql loading for background task, closes #230 2017-07-22 19:10:25 -04:00
Ben12345rocks f75dffe5df Remove /v, Closes #229 2017-07-22 19:03:08 -04:00
Ben12345rocks 146d981c23 Update 2017-07-22 18:52:44 -04:00
Ben12345rocks 2e7ed9c1c1 Update Settings 2017-07-21 09:45:42 -04:00
Ben 198fe10447 Merge pull request #226 from Ben12345rocks/5.9.3
5.9.3
2017-07-16 17:10:04 -04:00
Ben12345rocks ab8dd96a79 Update version number 2017-07-16 17:10:45 -04:00
Ben12345rocks cac0b0e99c Add ability to give vote site rewards offline 2017-07-15 19:10:21 -04:00
Ben12345rocks 80ae9dbe2d Update build path 2017-07-12 09:28:08 -04:00
Ben f91a02ba3f Merge pull request #222 from Ben12345rocks/5.9.2
5.9.2
2017-07-11 11:57:38 -04:00
Ben12345rocks 25d718a37c Update version number 2017-07-11 11:46:59 -04:00
Ben12345rocks 6114373237 Update version number 2017-07-11 11:10:49 -04:00
Ben12345rocks 3c60c99c83 Closes #221 2017-07-10 10:21:19 -04:00
Ben12345rocks e237b382cd Bug fixes, closes #197, closes #220 2017-07-10 10:07:46 -04:00
Ben12345rocks a07b69cc08 Update javadoc 2017-07-09 15:39:17 -04:00
Ben 7f1ceaf500 Merge pull request #219 from Ben12345rocks/5.9.1
5.9.1
2017-07-09 15:34:03 -04:00
Ben12345rocks 6b8924c08b Update build path 2017-07-09 15:34:15 -04:00
Ben12345rocks 1f80578e7a Bug fixes 2017-07-09 14:58:07 -04:00
Ben12345rocks 2f78c4b462 Bug fix 2017-07-09 14:20:19 -04:00
Ben12345rocks 89b0d71267 Update version number 2017-07-09 13:53:01 -04:00
Ben12345rocks 77363ce3c7 Don't show banned players on top voters 2017-07-09 13:49:58 -04:00
Ben12345rocks 9477c063de Fix auto generate sites not working correctly 2017-07-09 13:39:28 -04:00
Ben12345rocks dc00652e69 Add back button for guis 2017-07-09 13:23:57 -04:00
Ben12345rocks 374ba2ee95 Add some more placeholders for /vote 2017-07-09 13:01:14 -04:00
Ben12345rocks 8fd8b1ad35 Add a vote delay for certain sites that reset daily 2017-07-09 12:48:13 -04:00
Ben12345rocks 2c05ce4870 Change to help commands 2017-07-09 12:16:34 -04:00
Ben dca689ec37 Merge pull request #212 from Ben12345rocks/5.9
5.9
2017-06-28 08:20:33 -04:00
Ben12345rocks ee4d52377f Update version number 2017-06-28 08:19:38 -04:00
Ben12345rocks ac41c9413c Update API 2017-06-28 08:13:48 -04:00
Ben12345rocks 596968f869 Add Jar, closes #208 2017-06-26 15:13:56 -04:00
Ben12345rocks 0d2221d195 Add VoteRoulette converter 2017-06-26 14:53:14 -04:00
Ben12345rocks 23fa59f98f Fix data storage conversion 2017-06-26 13:38:50 -04:00
Ben12345rocks cb81b61096 Add more messages on convert 2017-06-25 15:05:17 -04:00
Ben12345rocks 186917992c Add a basic converter for GAL, closes #206 2017-06-22 14:40:44 -04:00
Ben12345rocks 6b70e4fee4 Add ability to set points on vote, closes #207 2017-06-20 19:51:08 -04:00
Ben12345rocks 79c98c8b86 Allow reward files to run offline, closes #200 2017-06-20 19:45:13 -04:00
Ben12345rocks b8e0830b0b Fix typo in Config.yml 2017-06-20 19:38:27 -04:00
Ben12345rocks 1cd1a0ab75 Update build path 2017-06-18 20:26:48 -04:00
Ben 481510a1e8 Merge pull request #205 from Ben12345rocks/5.8.7
5.8.7
2017-06-18 20:16:10 -04:00
Ben12345rocks 3a95ef9b23 Slight improvement 2017-06-18 20:16:44 -04:00
Ben12345rocks f7af9210cb Minor changes to bstats 2017-06-18 19:57:31 -04:00
Ben12345rocks 9f5fe338f4 Update version number, closes #201, closes #203 2017-06-18 19:42:46 -04:00
Ben12345rocks 967be0aa19 Add broadcast for vote party 2017-06-18 18:01:32 -04:00
Ben12345rocks 6e0b62a1dd Add every site reward 2017-06-18 17:57:22 -04:00
Ben12345rocks a8ec557c9e Bug fix 2017-06-16 16:02:41 -04:00
Ben12345rocks 252263da74 Update version number 2017-06-14 15:28:14 -04:00
Ben12345rocks e7696bed25 Minor improvements 2017-06-11 16:51:36 -04:00
Ben12345rocks 064451d2b5 Update version number 2017-06-11 15:21:59 -04:00
Ben12345rocks daa25805fa Change the way converting data storages work 2017-06-08 16:03:16 -04:00
Ben12345rocks cc010d9738 Fix shop item not working 2017-06-03 19:46:46 -04:00
Ben12345rocks cbe58a1f18 Update build path 2017-06-03 19:27:05 -04:00
Ben c29247d2a0 Merge pull request #198 from Ben12345rocks/5.8.4
5.8.4
2017-06-03 19:21:02 -04:00
Ben12345rocks a28cdfc6bf Update version number 2017-06-03 19:21:39 -04:00
Ben12345rocks 7db5cd59da More improvements 2017-06-03 10:40:33 -04:00
Ben12345rocks 0ebb0c9a70 Changes to /vgui 2017-06-03 09:50:37 -04:00
Ben12345rocks 9ba20ddd02 Bug fixes, closes #197 2017-06-02 15:43:06 -04:00
Ben12345rocks 7fddc0af12 Improve support for /reload, closes #194 2017-06-02 15:25:10 -04:00
Ben12345rocks 475e6059eb Add 1.12 support, update version number 2017-05-15 15:57:33 -04:00
Ben b552928b8c Update README.md 2017-05-04 20:06:46 -04:00
Ben12345rocks 779c1728b4 Update dependency 2017-05-04 17:31:02 -04:00
Ben d91e9cd150 Merge pull request #192 from Ben12345rocks/5.8.2
5.8.2
2017-05-04 17:27:11 -04:00
Ben12345rocks 5f8bf52c08 Code cleanup 2017-05-04 17:14:02 -04:00
Ben12345rocks bbf401ac94 Update version number 2017-05-02 20:12:38 -04:00
Ben12345rocks fda1f134bf Fix a typo 2017-05-01 20:30:30 -04:00
Ben 2b6425242a Update README.md 2017-05-01 17:36:48 -04:00
Ben12345rocks 79f1f5ced4 Don't use old repo 2017-05-01 17:31:40 -04:00
Ben12345rocks 8f37dc6f34 Bug fixes 2017-05-01 17:03:13 -04:00
Ben12345rocks 16590a023c Update version number, closes #190 2017-04-26 16:48:21 -04:00
Ben 0e961f0b92 Merge pull request #188 from Ben12345rocks/5.8
5.8
2017-04-17 11:28:56 -04:00
Ben12345rocks 24af26ff50 Bug fixes 2017-04-17 11:05:53 -04:00
Ben12345rocks 45c6b0d65a Many improvements and bug fixes, update version number, closes #184 2017-04-17 09:37:31 -04:00
Ben12345rocks 3f4c787fc6 Remove /vote info, closes #185 2017-04-15 08:36:56 -04:00
Ben12345rocks 3d9610f1cc Implement javascript in placeholders 2017-04-13 22:03:43 -04:00
Ben12345rocks 47e7201cc2 Config improvements 2017-04-13 21:39:29 -04:00
Ben12345rocks 6a665d9645 Implement javascript API 2017-04-13 21:30:22 -04:00
Ben12345rocks a880c11941 Update version number 2017-04-09 19:59:45 -04:00
Ben12345rocks 1b4e8ed4d7 Update version number 2017-04-09 12:56:55 -04:00
Ben12345rocks 5fcfba567a Javadoc fix 2017-04-08 19:49:21 -04:00
Ben12345rocks da88aa17b1 More bug fixes 2017-04-08 10:15:13 -04:00
Ben12345rocks 61243589b1 Add more placeholders, bug fixes, closes #183, update version number 2017-04-08 09:19:55 -04:00
Ben12345rocks d0ea06921b Bug fixes, updater version number 2017-04-04 20:56:52 -04:00
Ben 9f2cfb7825 Merge pull request #182 from Ben12345rocks/5.7
5.7
2017-04-02 17:04:24 -04:00
Ben12345rocks 33d104cdfc Javadoc fixes 2017-04-02 16:56:29 -04:00
Ben12345rocks 3a483ed746 Clean up 2017-04-02 16:53:25 -04:00
Ben12345rocks b4c5e68833 Add aliases 2017-04-02 16:41:44 -04:00
Ben12345rocks 3ef524aefe Bug fixes, update version number 2017-04-02 16:26:49 -04:00
Ben12345rocks fedd6cf9ef Bug fixes 2017-04-02 14:05:11 -04:00
Ben12345rocks f1112d5694 Add more placeholders, bug fixes 2017-04-02 13:41:43 -04:00
Ben12345rocks 6ed58d8223 Fix minor typo 2017-04-01 21:18:49 -04:00
Ben12345rocks 5122e0391a First implementation of vote streak rewards, rewrites to other rewards 2017-04-01 20:58:05 -04:00
Ben12345rocks cb088a84f9 Fix placeholders not working when site name contains _ 2017-04-01 18:48:05 -04:00
Ben12345rocks 90a57fbe84 Bug fixes 2017-03-31 21:29:25 -04:00
Ben12345rocks edf636de35 Add more placeholders 2017-03-31 20:43:57 -04:00
Ben12345rocks 6601f13127 Bug fixes 2017-03-31 16:36:57 -04:00
Ben12345rocks 96f38bf13f Add placeholders 2017-03-31 15:27:38 -04:00
Ben12345rocks 014ba226f9 Add /vote streak, /vote best, closes #180 2017-03-31 15:02:16 -04:00
Ben12345rocks a46cd4ae2c Added placeholders, SQLite default, default reward, closes #181 2017-03-31 10:34:50 -04:00
Ben12345rocks 63c826007e Allow downloading 2017-03-31 10:17:30 -04:00
Ben12345rocks 165b80dca3 Don't load every player into storage 2017-03-31 09:49:24 -04:00
Ben12345rocks f84517741d Bug fix 2017-03-25 08:22:33 -04:00
Ben12345rocks ea4216244a Fix VoteShop not working 2017-03-21 15:39:56 -04:00
Ben 6982d8421c Merge pull request #179 from Ben12345rocks/5.6.4
5.6.4
2017-03-20 21:25:00 -04:00
Ben12345rocks afdbb57d66 Update version number 2017-03-20 21:12:00 -04:00
Ben12345rocks b10396176b Fix typo 2017-03-20 21:08:42 -04:00
Ben12345rocks bd865dd588 Add ability to customize more gui's 2017-03-19 19:43:55 -04:00
Ben12345rocks fec62bdb32 Bug fixes 2017-03-17 15:29:24 -04:00
Ben12345rocks 63fa9b77d3 Bug fixes 2017-03-17 14:59:19 -04:00
Ben12345rocks 6ecb703235 Bug fixes 2017-03-17 11:18:36 -04:00
Ben12345rocks 4193f0bd32 Bug fixes 2017-03-17 10:55:15 -04:00
Ben 7eb6e0c4f2 Merge pull request #176 from Ben12345rocks/5.6
5.6
2017-03-17 10:01:22 -04:00
Ben12345rocks 530ca13de4 Minor message change 2017-03-17 09:35:48 -04:00
Ben12345rocks 76d4666e58 Update version number 2017-03-17 09:24:50 -04:00
Ben12345rocks d3b980bb5e Add ability to customize gui name 2017-03-17 09:23:58 -04:00
Ben12345rocks 371961bcce Add command to force background update 2017-03-17 09:04:14 -04:00
Ben12345rocks 1df7869f3b Make top voter ignore permission do more 2017-03-16 15:51:37 -04:00
Ben12345rocks 6af60370bf Minor changes 2017-03-16 10:52:22 -04:00
Ben12345rocks 49d9ce7b36 A lot of bug fixes and improvements 2017-03-13 09:29:14 -04:00
Ben12345rocks 1d3ef77d78 Slight performance improvement 2017-03-07 16:36:37 -05:00
Ben12345rocks 2a80658981 Fix monthly total not properly being reset 2017-03-07 16:29:48 -05:00
Ben12345rocks 9bafe060a3 Bug fixes 2017-03-06 16:12:43 -05:00
Ben 8c67abbf6a Merge pull request #174 from Ben12345rocks/5.5.2
5.5.2
2017-03-05 20:39:42 -05:00
Ben12345rocks 1f1dd3fd07 Minor change 2017-03-05 17:44:57 -05:00
Ben12345rocks fcf0977042 Update version number 2017-03-05 14:50:47 -05:00
Ben12345rocks f4cb50e1cd Bug fixes 2017-03-05 14:47:42 -05:00
Ben12345rocks 13367c2f8e Bug fixes, closes #173 2017-03-05 13:25:53 -05:00
Ben12345rocks acc5736e82 No longer preload table, closes #173 2017-03-02 21:35:36 -05:00
Ben12345rocks e8fbbb7db4 Remove unused parts of file 2017-02-28 21:17:18 -05:00
Ben12345rocks 2f4f8a0da7 Bug fixes 2017-02-28 21:15:58 -05:00
Ben12345rocks f3fc1373c1 Fix placeholder not working properly 2017-02-27 16:45:54 -05:00
Ben12345rocks 71c3d6ac7c Fix generating vote sites not removing the dot? closes #170 2017-02-27 16:25:52 -05:00
Ben12345rocks 71bda92e46 Fix signs not properly being removed, closes #168 2017-02-27 16:21:40 -05:00
Ben12345rocks 33bff9e0c8 Add new placeholders, close #167 2017-02-27 16:12:26 -05:00
Ben12345rocks da1723bd41 Update version number 2017-02-26 13:54:35 -05:00
Ben12345rocks 4b478a4667 Changed how totals work, added new command 2017-02-19 17:10:58 -05:00
Ben12345rocks 8acfadbe25 Update version number 2017-02-11 16:31:19 -05:00
Ben12345rocks f2523b63c3 Bug fixes 2017-02-09 20:00:28 -05:00
Ben12345rocks ec59112740 Fixed a load of bugs 2017-02-08 21:46:47 -05:00
Ben12345rocks 1d39ea2c3d Update version number, closes #166 2017-02-03 20:58:25 -05:00
Ben12345rocks 49e69cba08 Bug fixes 2017-02-02 08:49:22 -05:00
Ben12345rocks 04081939b3 Bug fixes 2017-02-01 09:18:47 -05:00
Ben12345rocks 7c86774c01 A few minor bug fixes 2017-01-31 20:38:05 -05:00
Ben 7410299a35 Merge pull request #164 from Ben12345rocks/5.4
5.4
2017-01-31 09:55:30 -05:00
Ben12345rocks a4ec9e650a Bug fixes 2017-01-31 09:37:40 -05:00
Ben12345rocks 683f8d77f7 A lot of improvements 2017-01-31 08:53:21 -05:00
Ben12345rocks 68fdb5ca78 Update version number 2017-01-30 15:45:11 -05:00
Ben12345rocks 5a8d14806e Reload mysql on reload 2017-01-29 15:25:33 -05:00
Ben12345rocks eafb38f351 Fix sendscoreboards doing nothing 2017-01-29 14:47:15 -05:00
Ben12345rocks 685bb69f2a Bug fixes 2017-01-29 14:42:56 -05:00
Ben12345rocks 1b2f63a8ab Add a little message if no voting sites are detected 2017-01-26 21:42:46 -05:00
Ben12345rocks bb7b2bd303 Add site display name 2017-01-26 20:57:22 -05:00
Ben12345rocks aa699cdb50 Use new reward system 2017-01-26 15:42:23 -05:00
Ben12345rocks 1c19377d58 Add config option to change update interval 2017-01-24 20:51:18 -05:00
Ben12345rocks 085a9614a3 A lot of bug fixes 2017-01-09 20:56:39 -05:00
Ben12345rocks 4a84d657a8 Bug fix 2017-01-09 15:35:25 -05:00
Ben12345rocks eb79c6c37d Javadoc fix 2017-01-08 13:44:30 -05:00
Ben12345rocks e21c6d0ccb Bug fix 2017-01-08 13:26:32 -05:00
Ben12345rocks 2f273a0a2a Bug fix 2017-01-08 12:48:19 -05:00
Ben12345rocks f095fa1223 Many bug fixes & improvements 2017-01-08 12:40:00 -05:00
Ben12345rocks aa7ce443cc Bug fix 2017-01-06 09:05:52 -05:00
Ben12345rocks 145e9bada5 Fix signs not working 2017-01-05 19:20:27 -05:00
Ben12345rocks 8597e86b79 Perm fix 2017-01-04 09:51:55 -05:00
Ben12345rocks 834dfcc8bb Bug fix 2017-01-04 08:29:21 -05:00
Ben12345rocks 79ca900e5d Bug fixes 2017-01-02 08:40:17 -05:00
Ben12345rocks 5bbbaf056f Fix typo in Config.yml 2016-12-29 11:01:46 -05:00
Ben a922e5f082 Merge pull request #157 from Ben12345rocks/5.2
5.2
2016-12-29 08:59:04 -05:00
Ben12345rocks e1356e2375 Update version number 2016-12-29 08:30:45 -05:00
Ben12345rocks 1d3c25b7fc Changes to improve performance 2016-12-28 09:31:54 -05:00
Ben12345rocks 0dc8206f7d Bug fix 2016-12-25 20:44:31 -05:00
Ben12345rocks 801175f4fd Add command to update data files 2016-12-24 16:38:34 -05:00
Ben12345rocks 38ac0b5317 Add more stats 2016-12-24 16:19:56 -05:00
Ben12345rocks 534deb8fa7 more changes 2016-12-24 16:03:24 -05:00
Ben12345rocks 545ff24ec9 Changes to user data, add new placeholder 2016-12-24 15:55:38 -05:00
Ben12345rocks 41802f4d64 Merge remote-tracking branch 'origin/master' into 5.2
Conflicts:
	VotingPlugin/pom.xml
2016-12-23 18:47:13 -05:00
Ben12345rocks 3efb5f9ad3 Bug fixes 2016-12-22 19:33:18 -05:00
Ben12345rocks 842e341c7d Merge remote-tracking branch 'origin/master' into 5.2
Conflicts:
	VotingPlugin/pom.xml
	VotingPlugin/src/com/Ben12345rocks/VotingPlugin/Commands/Commands.java
	VotingPlugin/src/com/Ben12345rocks/VotingPlugin/Main.java
2016-12-21 16:28:29 -05:00
Ben12345rocks 7d771bc1b2 Bug fixes 2016-12-21 15:50:52 -05:00
Ben12345rocks e25d5329a2 Bug fixes 2016-12-19 20:41:58 -05:00
Ben12345rocks 7303cfcbfb Bug fixes, update version to beta 2016-12-19 20:25:36 -05:00
Ben12345rocks dc115ed789 Implement new data storage 2016-12-18 15:36:32 -05:00
Ben12345rocks 5937507818 Update maven-github-plugin 2016-12-17 19:03:38 -05:00
Ben12345rocks 163f9404c2 Bug fixes 2016-12-17 17:07:37 -05:00
Ben12345rocks 143468e48a Update version number 2016-12-14 15:44:40 -05:00
Ben12345rocks 2c29ed40f8 Bug fix, update version number 2016-12-13 15:37:17 -05:00
Ben ede5d6b3a6 Merge pull request #155 from Ben12345rocks/5.1
5.1
2016-12-11 19:26:37 -05:00
Ben12345rocks 8dd7f49b24 Javadoc fixes 2016-12-11 19:26:53 -05:00
Ben12345rocks 44393f60d9 Bug fixes 2016-12-11 18:46:30 -05:00
Ben12345rocks 5880de53eb Bug fix 2016-12-11 18:03:48 -05:00
Ben12345rocks 95da201ea5 Many bug fixes and improvements 2016-12-11 16:37:37 -05:00
Ben12345rocks 1179451738 Recode top voter 2016-12-09 15:30:22 -05:00
Ben12345rocks d1abad711d Recode TopVoter, remove per site signs, config improvements 2016-12-08 17:16:00 -05:00
Ben12345rocks 8bd7fe330d Fix maven repo not uploading 2016-12-08 15:42:41 -05:00
Ben12345rocks a281b37a56 Merge branch 'master' of https://github.com/Ben12345rocks/VotingPlugin 2016-12-07 16:52:00 -05:00
Ben12345rocks 01ee350eea Crash fix, update version number 2016-12-07 16:17:37 -05:00
Ben d342d2b43e Delete .travis.yml 2016-12-06 20:21:55 -05:00
Ben 14fe133482 Create .travis.yml 2016-12-06 20:19:59 -05:00
Ben12345rocks 2fa9f3ced1 Bug fix 2016-12-05 15:51:11 -05:00
Ben12345rocks 75b435dac7 Set AdvancedCore version number 2016-12-04 22:07:42 -05:00
Ben12345rocks 9471925696 Bug fix 2016-12-04 22:06:18 -05:00
Ben12345rocks eb5aa134e3 Bug fix 2016-12-04 20:30:27 -05:00
Ben 1771d15e83 Merge pull request #150 from Ben12345rocks/5.0
5.0
2016-12-04 15:10:12 -05:00
Ben12345rocks 1064e48a22 Javadoc fix 2016-12-04 14:52:25 -05:00
Ben12345rocks 42faa9fa81 Bug fixes & Improvements 2016-12-04 14:22:38 -05:00
Ben12345rocks 76de7d6e2f Improvements 2016-12-03 21:45:58 -05:00
Ben12345rocks e12e81aa0b Bug fixes 2016-12-03 09:53:27 -05:00
Ben12345rocks a4ef6acdec Update version number 2016-12-03 08:37:36 -05:00
Ben12345rocks ddf3ac5513 Combine more configs 2016-12-02 22:10:26 -05:00
Ben12345rocks 6b77d9a46b Add craftbukkit support 2016-11-30 21:52:03 -05:00
Ben12345rocks 198ebc7f6f Compile AdvancedCore directly into plugin 2016-11-29 16:33:03 -05:00
Ben12345rocks c5168d3f5d Bug fix 2016-11-23 20:41:08 -05:00
Ben12345rocks 665c009d8b Only update javadoc when needed 2016-11-23 20:07:07 -05:00
Ben12345rocks 07d9b23eef Minor change 2016-11-22 22:01:14 -05:00
Ben12345rocks 6c67b405c2 More changes 2016-11-22 20:36:00 -05:00
Ben12345rocks e9646ee5d6 Bug fix 2016-11-22 16:49:55 -05:00
Ben12345rocks a7e8561639 Update version number
Add maven repo
Better perms
2016-11-22 16:34:10 -05:00
Ben f80f7dc546 Merge pull request #147 from Ben12345rocks/4.7
4.7
2016-11-20 21:49:45 -05:00
Ben12345rocks 87becb7750 Convert to Maven 2016-11-20 14:34:32 -05:00
Ben12345rocks 1affff072d Change version number 2016-11-19 16:19:17 -05:00
Ben12345rocks ecdd02313b Update version number 2016-11-18 15:52:31 -05:00
Ben12345rocks 5483e414d5 Use updated methods in AdvancedCore 2016-11-18 10:11:50 -05:00
Ben12345rocks 93457617a4 Add BStats, add basic commands from AdvancedCore 2016-11-17 21:11:02 -05:00
Ben12345rocks a6ce18a520 Build with 1.11, update version number 2016-11-17 07:22:14 -05:00
Ben 882f7a6703 Merge pull request #146 from Ben12345rocks/4.6.2
4.6.2
2016-11-08 21:14:04 -05:00
Ben12345rocks 228b3cb41b Bug fixes 2016-11-08 21:08:34 -05:00
Ben12345rocks 34b1b43d07 Bug fix 2016-11-08 20:34:19 -05:00
Ben12345rocks f82a0cb88a Add milestone reset per month, closes #145, update version number 2016-11-08 15:50:40 -05:00
Ben12345rocks 5329dd5312 Minor fixes, update version number 2016-11-01 20:27:15 -04:00
Ben 580f35c8b0 Merge pull request #144 from Ben12345rocks/4.6
4.6
2016-10-30 16:09:01 -04:00
Ben12345rocks 10c5f7b173 Javadoc fixes 2016-10-30 16:02:49 -04:00
Ben12345rocks 7acf00b0ac Bug fix 2016-10-30 15:19:37 -04:00
Ben12345rocks f58d429173 Bug fix 2016-10-30 15:04:30 -04:00
Ben12345rocks 5ba393d040 Bug fixes 2016-10-30 14:58:26 -04:00
Ben12345rocks 537f2b34bc Update version number 2016-10-30 14:39:38 -04:00
Ben12345rocks 1e07f826e7 Bug fixes 2016-10-30 14:21:32 -04:00
Ben12345rocks 414a2f2139 Add many more GUI's with options to use or not 2016-10-30 13:36:05 -04:00
Ben12345rocks 494faa1fb8 Add a user vote requirement for vote party 2016-10-29 19:30:24 -04:00
Ben12345rocks b003a55979 Remove old code, use better file management system 2016-10-27 21:56:42 -04:00
Ben12345rocks 5aec36795a Upgrade to improved AdvancedCore reward system 2016-10-27 21:26:00 -04:00
Ben12345rocks 32581641b7 Add auto update for 4.5.4 from older versions 2016-10-27 15:38:17 -04:00
Ben12345rocks 054248594f Bug fix 2016-10-27 15:36:03 -04:00
Ben12345rocks e0e6b68fe8 Bug fix update version number 2016-10-27 15:31:52 -04:00
Ben 0f9398ab7e Merge pull request #142 from Ben12345rocks/4.5.3
4.5.3
2016-10-23 14:10:19 -04:00
Ben12345rocks 3ede586ba0 Bug fixes 2016-10-23 13:21:43 -04:00
Ben12345rocks e37c7d3122 Bug fix 2016-10-23 12:59:45 -04:00
Ben12345rocks b51b7f7205 Update version number 2016-10-23 12:50:59 -04:00
Ben12345rocks ab327d4cf2 Bug fix 2016-10-22 21:07:42 -04:00
Ben12345rocks bc2476c096 Bug fix 2016-10-22 21:03:24 -04:00
Ben12345rocks 7440a0ddec Improvements 2016-10-21 20:04:16 -04:00
Ben12345rocks d1929fea9d Use new API in AdvancedCore 2016-10-21 19:11:26 -04:00
Ben12345rocks f484aa63c6 Improvements 2016-10-21 16:32:26 -04:00
Ben12345rocks 05a03ca51b Add per day option for vote party, other improvements 2016-10-21 16:12:45 -04:00
Ben c39872ee19 Merge pull request #141 from Ben12345rocks/4.5.2
4.5.2
2016-10-18 21:05:40 -04:00
Ben12345rocks 848c9c5d49 Move bungee voting out to seperate plugin 2016-10-18 20:29:41 -04:00
Ben12345rocks 5c656ec5ff Config changes
Removed ServerData.yml, use one in AdvancedCore
Removed VoteReminding.yml, added in Config.yml
Auto update.
2016-10-18 16:19:52 -04:00
Ben12345rocks bf79b275f6 Convert files on update if updating to 4.5.1 past 4.5 2016-10-17 21:04:18 -04:00
Ben12345rocks 782a2a88dc Bug fixes, update version number 2016-10-17 20:59:00 -04:00
Ben 1cbbc15301 Merge pull request #139 from Ben12345rocks/4.5
4.5
2016-10-17 16:03:17 -04:00
Ben12345rocks 0297711e17 Reload sites on convert 2016-10-17 15:54:50 -04:00
Ben12345rocks bc71b96733 Move votesites all into 1 file, update version number 2016-10-17 15:52:01 -04:00
Ben be60f07de2 Merge pull request #137 from Ben12345rocks/4.4.1
4.4.1
2016-10-12 20:49:26 -04:00
Ben12345rocks 8ae15ccffe Update version number 2016-10-12 20:42:16 -04:00
Ben12345rocks 088081c3ec Implement voteshop add-on into plugin 2016-10-11 17:09:33 -04:00
Ben e8637da77b Merge pull request #135 from Ben12345rocks/4.4
4.4
2016-10-09 14:32:53 -04:00
Ben12345rocks 471453aadf Bug fix, update version number 2016-10-09 14:19:55 -04:00
Ben12345rocks 2d38b3dbca Move the rewards list in Config.yml to Rewards.yml 2016-10-09 12:39:16 -04:00
Ben 441726f233 Merge pull request #133 from Ben12345rocks/4.3.8
4.3.8
2016-10-02 17:04:58 -04:00
Ben12345rocks 37edb38723 Update version number 2016-10-02 16:45:38 -04:00
Ben12345rocks eb4b33aa60 Optimization & improvements 2016-10-02 16:27:02 -04:00
Ben12345rocks c291ff00a6 Add option for weekly votes for cumulative votes 2016-10-02 15:56:10 -04:00
Ben12345rocks 37399dd856 Use new ValueRequest api 2016-09-26 16:10:44 -04:00
Ben12345rocks 3ecd784e61 Disable unneeded plugin checks, sites are now enabled on generation 2016-09-25 21:34:00 -04:00
Ben12345rocks 412f6bab97 Improve some messages in config.yml 2016-09-25 17:28:04 -04:00
Ben12345rocks d1d9054562 Bug fix, update version number 2016-09-20 20:29:12 -04:00
Ben 98229d9d6a Merge pull request #132 from Ben12345rocks/4.3.6
4.3.6
2016-09-11 14:15:54 -04:00
Ben12345rocks 26d39ac7e2 Code cleanup, update javadoc 2016-09-11 14:04:06 -04:00
Ben12345rocks 066b7813a0 Update version number 2016-09-11 13:40:14 -04:00
Ben12345rocks e36befcbfb Add ability to set milestone complete 2016-09-11 13:33:25 -04:00
Ben12345rocks 34c84175f6 Add ability to log votes to file 2016-09-11 13:20:28 -04:00
Ben12345rocks 406a47e272 Disable firstvote/allsites rewards by default 2016-09-10 20:40:13 -04:00
Ben12345rocks bb6ae46dd8 Bug fixes 2016-09-10 20:37:43 -04:00
Ben12345rocks 47cbd05290 Update to new methods of gui's 2016-09-09 16:32:20 -04:00
Ben 87c91e67d7 Merge pull request #131 from Ben12345rocks/4.3.5
4.3.5
2016-09-04 17:13:17 -04:00
Ben12345rocks b44b97284e Code cleanup, update javadoc 2016-09-04 16:43:32 -04:00
Ben12345rocks a0f3264297 Update version number 2016-09-04 15:14:44 -04:00
Ben12345rocks 45cb09ef0e Add gui button to force player vote on site 2016-09-04 13:48:52 -04:00
Ben12345rocks 9cef05beb7 Improvements, add more commands 2016-09-04 13:19:01 -04:00
Ben12345rocks c008744559 Let AdvancedCore handle reward files 2016-09-02 16:19:02 -04:00
Ben 0bb990e535 Merge pull request #129 from Ben12345rocks/4.3.4
4.3.4
2016-09-01 10:13:13 -04:00
Ben12345rocks 3b977a3da0 Bug fix 2016-09-01 10:02:52 -04:00
Ben12345rocks 4d9a855b4f Bug fix 2016-09-01 08:44:11 -04:00
Ben12345rocks 023206bd14 Update version number 2016-09-01 08:33:13 -04:00
Ben12345rocks 9d30790373 Bug fix 2016-09-01 08:32:44 -04:00
Ben12345rocks c92746b6c6 Bug fixes 2016-08-31 16:43:21 -04:00
Ben12345rocks f4fa697f0f Upgrades to tab complete 2016-08-31 15:09:06 -04:00
Ben 761c2f0c77 Merge pull request #128 from Ben12345rocks/4.3.3
4.3.3
2016-08-29 15:34:36 -04:00
Ben12345rocks 67908b82fa Bug fix 2016-08-29 15:36:42 -04:00
Ben12345rocks 1fedd7063d Update JavaDoc 2016-08-29 14:55:19 -04:00
Ben12345rocks dbdc74e751 Update version number 2016-08-29 14:47:26 -04:00
Ben12345rocks 0c9bc0fb01 Send bungee votes when server is back online (until shutdown of server)
closes #109
2016-08-29 14:42:30 -04:00
Ben12345rocks 7fcdd3b545 Improvements to GUI's, closes #111 2016-08-29 14:21:29 -04:00
Ben12345rocks be6ef6f75e Improvements to GUI 2016-08-29 14:17:13 -04:00
Ben12345rocks 42d81ba361 improvements in AdminGUI 2016-08-29 10:57:15 -04:00
Ben12345rocks a17a889ffa Improvements to GUI 2016-08-29 09:02:02 -04:00
Ben12345rocks d04293b1b4 Merge remote-tracking branch 'origin/master' into 4.4 2016-08-28 21:25:44 -04:00
Ben12345rocks 8e5a37b969 Update version number, bug fix 2016-08-28 21:17:35 -04:00
Ben12345rocks 4439268472 Improvements to GUI's 2016-08-28 21:12:45 -04:00
Ben b33d256656 Merge pull request #127 from Ben12345rocks/4.3.1
4.3.1
2016-08-28 12:55:31 -04:00
Ben12345rocks 7c10ef066f Bug fixes, update javadoc 2016-08-28 12:36:12 -04:00
Ben12345rocks 5f02f76b9f Update version number 2016-08-28 12:25:22 -04:00
Ben12345rocks 4e6e88159e Add gui to edit reward file 2016-08-26 10:53:45 -04:00
Ben12345rocks 96b5e8fc3e Update to new runnable handler 2016-08-26 10:02:58 -04:00
Ben dd3bee2b77 Merge pull request #123 from Ben12345rocks/4.3
4.3
2016-08-24 08:21:21 -04:00
Ben12345rocks d2a4c6385d Bug fixes 2016-08-23 15:51:32 -04:00
Ben12345rocks 6707296b5a Bug fixes 2016-08-23 10:59:45 -04:00
Ben12345rocks 42c358fd70 Update version number 2016-08-23 10:40:52 -04:00
Ben12345rocks b14c0b79c1 Add link for where to download AdvancedCore 2016-08-23 10:39:18 -04:00
Ben12345rocks 81582fef1b Make sure default remind message is set if file doesn't exist 2016-08-22 21:50:58 -04:00
Ben12345rocks f4f05322a3 Update javadoc 2016-08-22 14:46:41 -04:00
Ben12345rocks 25b81a8c8e Code cleanup 2016-08-22 14:32:12 -04:00
Ben12345rocks 433cc9a914 Add milestones, untested 2016-08-21 21:46:15 -04:00
Ben12345rocks 27096eb67d Add converter to convert data files 2016-08-21 21:27:03 -04:00
Ben12345rocks 2c4074694c Add ability to give reward if player doesn't reach certain number of
votes, closes #117
2016-08-21 20:24:59 -04:00
Ben12345rocks 4666406f41 Add commands to set and add points 2016-08-21 19:28:47 -04:00
Ben12345rocks d5c710c060 Merge remote-tracking branch 'origin/master' into 4.3 2016-08-21 13:16:00 -04:00
Ben 740d8dd21f Merge pull request #122 from Ben12345rocks/4.2.4
Add new method to add points, update version number
2016-08-21 13:06:45 -04:00
Ben12345rocks f03264236b Add new method to add points, update version number 2016-08-21 13:04:11 -04:00
Ben12345rocks e2681edee9 Code cleanup 2016-08-21 12:57:09 -04:00
Ben12345rocks 5d49479da2 Add ability to view debug info ingame 2016-08-20 21:56:25 -04:00
Ben12345rocks 66410db7e5 List reward file when viewing site info ingame 2016-08-20 21:49:39 -04:00
Ben12345rocks f29cfd5434 Add %VotingPlugin_VotePartyVotesNeeded% placeholder 2016-08-20 21:17:21 -04:00
Ben12345rocks a30fdba2b9 Bug fixes 2016-08-19 20:54:57 -04:00
Ben12345rocks 122bd089d4 Use new core plugin for main api 2016-08-19 08:46:50 -04:00
Ben12345rocks d73ee79102 Fix one command alias not loading 2016-08-18 16:15:15 -04:00
Ben 2ece54f321 Merge pull request #120 from Ben12345rocks/4.2.3
4.2.3
2016-08-18 16:08:56 -04:00
Ben12345rocks 3b1c94d040 Update version number 2016-08-18 15:57:36 -04:00
Ben12345rocks ae4d2b7339 Bug fix 2016-08-18 15:56:20 -04:00
Ben c1e512d574 Merge pull request #114 from Ben12345rocks/4.2.2
4.2.2
2016-08-15 15:53:09 -04:00
Ben12345rocks b3a6e3e658 Update version to 4.2.2 2016-08-15 11:12:11 -04:00
Ben12345rocks 1d11bbb2b5 Add some basic reward edit commands 2016-08-13 21:42:39 -04:00
Ben12345rocks 8a92bfa89c Fix typo 2016-08-13 20:21:31 -04:00
Ben 91f2a32e32 Merge pull request #112 from Ben12345rocks/4.2.1
4.2.1
2016-08-06 08:35:07 -04:00
Ben12345rocks b4df38b83b Update version number, bug fixes 2016-08-06 08:25:09 -04:00
Ben12345rocks dc6c20bf02 Replace all player placeholders on conversion 2016-08-05 11:06:04 -04:00
Ben12345rocks 5d3c14cd88 Fully implement converter 2016-08-05 11:01:40 -04:00
Ben12345rocks 0ac214d1b7 Bug fixes, start work on GAL converter 2016-08-04 21:48:03 -04:00
Ben 97e136de75 Merge pull request #108 from Ben12345rocks/4.2
4.2
2016-07-26 10:25:09 -04:00
Ben12345rocks 48373e001a Bug fix 2016-07-26 10:22:24 -04:00
Ben12345rocks 9aa327053d Bug fix for all sites reward not be given, tab complete for reward names 2016-07-26 09:45:15 -04:00
Ben12345rocks 7a7185c392 Undo convert to maven 2016-07-25 15:16:30 -04:00
Ben12345rocks 1350ef9522 Fix JavaDoc typo 2016-07-25 15:12:18 -04:00
Ben12345rocks c00c18bbe0 Update JavaDoc 2016-07-25 15:10:12 -04:00
Ben12345rocks bce502999d Bug fixes 2016-07-25 15:08:12 -04:00
Ben12345rocks f832ee9882 Full rewrite of titles, bossbar, and actionbar, built right in 2016-07-25 14:28:32 -04:00
Ben12345rocks 1861a23efc Update version number 2016-07-24 13:12:29 -04:00
Ben12345rocks 1901383c20 Update JavaDoc 2016-07-24 13:12:06 -04:00
Ben12345rocks 6f59f7fdb5 Add PlayerRewardEvent 2016-07-24 13:08:19 -04:00
Ben12345rocks c7de86c096 No longer depend on external plugins for titles, etc, add bossbar 2016-07-24 13:04:26 -04:00
Ben12345rocks 18c8d75003 Rename some packages, may break plugins using my API 2016-07-22 15:41:21 -04:00
Ben12345rocks 4de41f07eb Bug fixes 2016-07-22 08:58:54 -04:00
Ben12345rocks 0ac771418f Add ability to give rewards based on if player was online when he voted,
bug fix
2016-07-22 08:47:23 -04:00
Ben12345rocks 476c807e34 Add ability to have more cumulative votes, untested, code cleanup 2016-07-22 07:58:00 -04:00
Ben12345rocks 44f9763f30 Merge fixes 2016-07-21 16:34:32 -04:00
Ben12345rocks e9ea9517d7 Merge remote-tracking branch 'origin/master' into 4.2 2016-07-21 16:28:25 -04:00
Ben bc77bdd610 Merge pull request #105 from Ben12345rocks/4.1.5
4.1.5
2016-07-21 15:58:54 -04:00
Ben12345rocks f0c0e01f27 Fix bug with invalid signs 2016-07-21 15:40:10 -04:00
Ben12345rocks 001d804d76 Fix typo 2016-07-21 15:23:33 -04:00
Ben12345rocks d572b410c6 Add ability to set min and max amounts for exp 2016-07-21 15:20:05 -04:00
Ben12345rocks 00613c9a4f VoteParty fixes 2016-07-21 15:09:33 -04:00
Ben12345rocks add03e9a0f Update version number, add comment that money is not per world 2016-07-21 14:43:01 -04:00
Ben12345rocks 21bb3cd957 Change settings 2016-07-21 14:24:16 -04:00
Ben12345rocks 6dfb6959e9 Improvements and bug fixes 2016-07-21 14:19:55 -04:00
Ben12345rocks 0b22d413cf Improvements 2016-07-21 14:13:10 -04:00
Ben12345rocks 83afa346d2 Colorize action bar, code cleanup 2016-07-20 11:07:54 -04:00
Ben12345rocks f4f46be906 Merge Fix 2016-07-20 10:55:04 -04:00
Ben12345rocks 6013862653 Merge 2016-07-20 10:54:46 -04:00
Ben12345rocks 1c152e5dfb Fix JavaDoc 2016-07-20 10:21:36 -04:00
Ben12345rocks e8d92c5317 AnotherJavaDoc fix 2016-07-20 10:17:19 -04:00
Ben12345rocks 0b2a7eda5f Fix JavaDoc 2016-07-20 10:16:11 -04:00
Ben12345rocks e19577015f Add JavaDoc 2016-07-20 10:14:43 -04:00
Ben12345rocks afdbe8b32c Bug fix 2016-07-20 10:11:53 -04:00
Ben12345rocks 2d3a57cc59 Improve JavaDoc 2016-07-19 22:14:31 -04:00
Ben12345rocks 5f41bb2bc8 Add actionbar 2016-07-19 22:10:32 -04:00
Ben12345rocks 06a9c2df95 Bug fixes 2016-07-19 16:22:21 -04:00
Ben12345rocks 3ac3e8df2f Convert to maven 2016-07-19 15:55:23 -04:00
Ben12345rocks ae13977b7d Add javadocs 2016-07-19 15:46:31 -04:00
Ben12345rocks 99cabd9bcd Run reward files on vote of any site (Configured in Config.yml) 2016-07-19 10:56:58 -04:00
Ben12345rocks 9674d80737 Add option to store top voters in files or not, improve configs 2016-07-19 10:50:13 -04:00
Ben12345rocks 2e2bf1233c Add ability to fully customize /vote message, add option to disable auto
adding sites to /vote
2016-07-19 10:30:18 -04:00
Ben12345rocks 7ffd919884 Add a default message for Remind if the reward files listed don't exist 2016-07-19 10:24:19 -04:00
Ben12345rocks 7a31d69e3a Fix typo, clarify VoteReminding.yml 2016-07-19 10:19:56 -04:00
190 changed files with 29602 additions and 13482 deletions

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
# These are supported funding model platforms
github: BenCodez # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
#patreon: # Replace with a single Patreon username
#open_collective: # Replace with a single Open Collective username
#ko_fi: # Replace with a single Ko-fi username
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
#liberapay: # Replace with a single Liberapay username
#issuehunt: # Replace with a single IssueHunt username
#lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
#polar: # Replace with a single Polar username
#buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
custom: ["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YQBX25RTXJ5DG"]
+30
View File
@@ -0,0 +1,30 @@
---
name: Bug report
about: Bug report for VotingPlugin
title: ''
labels: Possible Bug
assignees: ''
---
**Versions**
Plugin version and spigot version.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots/Configs**
If applicable, add screenshots to help explain your problem and/or configs relating to the issue.
**Additional context**
Add any other context about the problem here.
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea
title: ''
labels: Possible Feature
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
@@ -0,0 +1,17 @@
---
name: Question/Concerns
about: Ask about a question or a concern about the plugin
title: ''
labels: Question/Concern
assignees: ''
---
**Versions**
Plugin version and spigot version
**Relevant information**
Configs that relate to the issue in a pastebin.
**Context**
Context about the question/concern
+11
View File
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "maven" # See documentation for possible values
directory: "/VotingPlugin/" # Location of package manifests
schedule:
interval: "weekly"
+24
View File
@@ -0,0 +1,24 @@
name: Deploy Javadoc
on:
release:
types: [published]
branches:
- master
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Deploy JavaDoc 🚀
uses: MathieuSoysal/Javadoc-publisher.yml@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
javadoc-branch: gh-pages
java-version: 17
target-folder: ''
project: maven # or gradle
# subdirectories: moduleA moduleB #for subdirectories support, needs to be run with custom command
custom-command: mvn -f VotingPlugin/pom.xml deploy -P javadoc javadoc:aggregate
javadoc-source-folder: 'VotingPlugin/target/apidocs'
+27
View File
@@ -0,0 +1,27 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests
on:
schedule:
- cron: '19 16 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
File renamed without changes.
+22 -3
View File
@@ -2,6 +2,25 @@
Plugin on SpigotMC
https://www.spigotmc.org/resources/votingplugin.15358/
##License
###Creative Commons Arttribution 3.0 Unported
https://github.com/Ben12345rocks/VotingPlugin/blob/master/VotingPlugin/LICENSE.txt
## License
### Creative Commons Arttribution 3.0 Unported
https://github.com/BenCodez/VotingPlugin/blob/master/VotingPlugin/Resources/LICENSE.txt
### Maven:
<repository>
<id>BenCodez Repo</id>
<url>https://nexus.bencodez.com/repository/maven-public/</url>
</repository>
<dependency>
<groupId>com.bencodez</groupId>
<artifactId>votingplugin</artifactId>
<version>LATEST</version>
<scope>provided</scope>
</dependency>
Versions:
LATEST - latest stable release
-11
View File
@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="lib" path="D:/programming/Liabaries/Votifier.jar"/>
<classpathentry kind="lib" path="D:/programming/Liabaries/Vault.jar"/>
<classpathentry kind="lib" path="D:/Horizon/Test Server/plugins/PlaceholderAPI.jar"/>
<classpathentry kind="lib" path="D:/Horizon/buildtools/spigot-1.10.2.jar"/>
<classpathentry kind="lib" path="D:/Horizon/Test Server/plugins/SpigotLib.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+7
View File
@@ -1 +1,8 @@
/bin/
/target/
/doc/
/.idea/
/*.iml
/.settings/
/.classpath
/.factorypath
+16
View File
@@ -10,8 +10,24 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -1,12 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
-19
View File
@@ -1,19 +0,0 @@
# BungeeVoting.yml
# On vote, plugin will forward the votifier vote to the following servers
# Put in the votifier information for each server below
# ServiceSite is not needed. Leave blank.
# Send bungee votes
Enabled: false
Servers:
# Server, don't have 2 names the same
Server1:
# Votifier IP
IP: ''
# Votifier port
Port: 8129
# Votifier key of this server
Key: 'PUBLICKEY'
# Add custom service site, leave blank to use the service site from the vote
ServiceSite: ''
-71
View File
@@ -1,71 +0,0 @@
# VotingPlugin by Ben12345rocks
# Main Config
# See wiki for help:
# https://github.com/Ben12345rocks/VotingPlugin/wiki
# Wether debug info will be displayed
Debug: false
# Broadcast votes
BroadcastVote: true
# Let players who never joined before vote
AllowUnjoined: false
# If true /vote will open VoteURL GUI
VoteURLDefault: false
# If true, plugin will send scoreboards on commands
SendScoreboards: true
# If true, plugin will automaticly generate votesites
# Disable this if you experience issues with sites being
# created randomly
AutoCreateVoteSites: true
# Number of seconds between background updates
# Default: 600 (10 minutes)
BackgroundTaskDelay: 600
# --------- Voting Effects --------
# The following will be sent to voter when the voter is online
# You can also send the following in each reward file if you wish
# This will only run once if player has voted offline, regardless of number of votes
# Setting them here works better for offline votes
# Title to send to voter on vote
# Requires SpigotLib (and all of its requirements)
# Download here:
# https://www.spigotmc.org/resources/spigotlib.5925/
Title:
Enabled: false
Title: '&cThanks for voting!'
SubTitle: '&aYou voted!'
FadeIn: 10
ShowTime: 50
FadeOut: 10
# Sound to voter
Sound:
# Enable or Disable Sound
Enabled: false
# Sound to play
# 1.10 Sounds: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html
Sound: 'BLOCK_ANVIL_USE'
# Volume
# Range: 0.0 to 1.0
Volume: 1.0
# Pitch
# Range: 0.0 to 1.0
Pitch: 1.0
# Play particle effect to voter
# 1.10 Effects can be found here:
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Effect.html
Effect:
Enabled: false
Effect: 'EXPLOSION'
Data: 0
Particles: 10
Radius: 5
-144
View File
@@ -1,144 +0,0 @@
# Format.yml
# Set your format here
#
# Common PlacesHolders:
# Please Note: Not all are usable in all sections
# Special PlaceHolders will be commented where available
# %player% = player name
# %SiteName% = vote site name
Format:
# Broadcast vote message
BroadcastMsg: '&6[&4Broadcast&6] &2Thanks &c%player% &2for voting on %SiteName%'
# Broadcast only when player is online
BroadcastWhenOnline: false
Commands:
# Format for /vote
# %num% = the number of the site, for a numbered list
# %url% = site URL
Vote:
Title:
- '&4&lVote for our server!'
# For each VoteSite
# make sure to set VoteURL in your VoteSites
Sites: '&4%num%: &c&l%SiteName% - &c%url%'
# Format for /vote next
Next:
# First line
Title: '&3&l%player% Next Votes:'
# How each line is setup for each vote site
# %info% = Info - See Below
# %SiteName% = site name from vote
Layout: '&3%SiteName%: &6%info%'
Info:
# Message when player can vote
CanVote: 'Go Vote!'
# Time until vote msg
# %hours% = hours until next vote
# %minutes% = minutes until next vote
TimeUntilVote: '%hours% Hours and %minutes% Minutes'
# If there is an error finding out time until next vote
Error: '&cCould not caculate time until next vote!'
# Format for /vote last
Last:
# First line
Title: '&3&l%player% Last Vote Times:'
# Lines for each vote site
# %time% = time, using timeformat below
Line: '&3%SiteName%: &6%time%'
# Format for /vote total
Total:
# First line
Title: '&3&l%player% Total Votes:'
# %Total% = total for that site
# %SiteName% = site name
Line: '&3%SiteName%: &6%Total%'
# %Totals% = totals of all sites added up
Total: '&3&lTotal: &6&l%Totals%'
# Format for /vote total all
TotalAll:
# First line
Title: '&3&lAll Votes Total:'
# %Total% = total for that site
Line: '&3%SiteName% &6%Total%'
# %Totals% = totals of all sites added up
Total: '&3&lTotal: &6&l%Totals%'
# Format for /vote top
Top:
# First line
# %page% = current page
# %maxpages% = max number of pages
# %Top% = Monthly/Weekly/Daily (depending on command)
Title: '&3Top Voters %Top% %page%/%maxpages%'
# Line for each player in that page
Line: '&c%num%: &6%player%, %votes%'
# Format for /vote help
Help:
# Title of /vote help
Title: '&3&lVoting Player Help'
# Format for help message in /v help
Line: '&3&l%Command% - &3%HelpMessage%'
# Require permission to see command in /v help or /av help
RequirePermission: true
# PlaceHolders:
# %VotesRequired% = VotesRequired
# %NeededVotes% = Number of votes needed to reach VotesRequired
# %Votes% = Number of votes
Party:
- '&cCurrently at &6%Votes%&c, &6%NeededVotes% &cmore votes to go to reach &6%VotesRequired%'
# %Points% = player points
Points: '&a%Player% currently has &a&l%Points%&a Points!'
# Login message if player can vote on all sites
# Must be enabled in config.yml
LoginMsg: '&cRemember to vote!'
# Msg on reward given
# PlaceHolders:
# %money% = amount of money given for votesite
# %items% = string list of items
DefaultRewardMsg: '&aYou were given rewards!'
# Msg on top voter award, will only send message if that place has a reward set
# %place% = place - 1,2,3,etc
TopVoterAwardMsg: '&aYou came in %place% in top voters of the month! Here is an award!'
# Time Format
# See https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
TimeFormat: 'EEE, d MMM yyyy HH:mm'
# Format for signs
# SiteName may be all, depending on sign
# %position% = position of player, set by sign
# %votes% = Number of votes
Signs:
TopVoterSign:
Line1: 'TopVoter: %SiteName%'
Line2: '#%position%'
Line3: '%player%'
Line4: '%votes% Votes'
# Message when right clicking sign, uses same placeholders as above
RightClickMessage: '&c&l%player% &cis &c&l%position% &cwith &c&l%votes% &cvotes in &c&l%SiteName%'
# Message when player tries to run command without required permissions
NoPerms: '&cYou do not have enough permission!'
# Message when player types a command but does not input a number where needed
NotNumber: '&cError on &6%arg%&c, number expected!'
# TimeZone
TimeZone: 'UTC'
-134
View File
@@ -1,134 +0,0 @@
# Configure GUI's here
# Note: Slots start at 0 instead of 1, max slots 44 (don't go over) (E.g: so last slot in first row of inventory is 8)
# Item Material's can be found here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
GUI:
# GUI for /vote gui, /vgui, votegui
VoteGUI:
# Items will be orders as it is below
URL:
# Standard item format, lore is automaticly applied
Item:
Material: 'BOW'
Data: 0
Amount: 1
Name: '&4URL'
# You can set skulls of the player using the following
# Remove the # to enable
#Skull: '%Player%'
Command: 'vote'
Slot: 0
Next:
Item:
Material: 'COMPASS'
Data: 0
Amount: 1
Name: '&4Next'
Command: 'vote next'
Slot: 1
Last:
Item:
Material: 'WATCH'
Data: 0
Amount: 1
Name: '&4Last'
Command: 'vote last'
Slot: 2
Total:
Item:
Material: 'CHEST'
Data: 0
Amount: 1
Name: '&4Total'
Command: 'vote total'
Slot: 3
Top:
Item:
Material: 'SIGN'
Data: 0
Amount: 1
Name: '&4Top'
Command: 'vote top'
Slot: 4
Today:
Item:
Material: 'BOOK'
Data: 0
Amount: 1
Name: '&4Today'
Command: 'vote today'
Slot: 5
Help:
Item:
Material: 'WRITTEN_BOOK'
Data: 0
Amount: 1
Name: '&4Help'
Command: 'vote help'
Slot: 6
Rewards:
Item:
Material: 'DIAMOND'
Data: 0
Amount: 1
Name: '&4Voting Rewards'
Command: 'vote reward'
Slot: 7
# GUI for /vote url
# And /vote if enabled in Config.yml
VoteURL:
SiteName: '&c%Name%'
SeeURL: '&cClick to see URL'
NextVote: '&cCan Vote In: %Info%'
ViewAllUrlsButtonEnabled: true
AlreadyVotedItem:
Material: 'REDSTONE_BLOCK'
Data: 0
Amount: 1
CanVoteItem:
Material: 'EMERALD_BLOCK'
Data: 0
Amount: 1
# Customize /vote reward
# Show players what you get when you vote on each site
VoteReward:
# Name of votesite
# If your site name contains a dot, replace it with a - and surround the name with ' '
SiteName:
# Item to display as vote site in /vote reward
Item:
# Item ID
Material: 'DIAMOND'
# Item Data (Eg 1:4, data is 4)
Data: 0
# Amount of items
# Should be greater than 0
Amount: 1
# Item name
# Remove this line for no name
Name: '&4Example'
# Lore
# Remove this line for no lore
Lore:
- '&4Line 1'
# items in /vote reward sitename
Items:
# Item
# This is not the item display name
# Do not have 2 of the same items
Diamond:
# Item ID
Material: 'DIAMOND'
# Item Data (Eg 1:4, data is 4)
Data: 0
# Amount of items
# Should be greater than 0
Amount: 1
# Item name
# Remove this line for no name
Name: '&4Example'
# Lore
# Remove this line for no lore
Lore:
- '&4Line 1'
Slot: 0
+128
View File
@@ -0,0 +1,128 @@
##########################################
# Bungee Setup
# Only if using votingplugin bungee to send votes
# REQUIRES RESTART FOR CHANGES TO TAKE EFFECT
##########################################
# Plugin using bungee, requires plugin on bungee server
UseBungeecord: false
# What type of bungee setup
# Requires restart and set on all servers
# https://github.com/BenCodez/VotingPlugin/wiki/Bungeecord-Setups
# Available:
# SOCKETS
# PLUGINMESSAGING (Recommended)
# MYSQL
# REDIS (2nd Most Recommended)
BungeeMethod: PLUGINMESSAGING
# Use Redis for between server communication, set BungeeMethod to REDIS to use this
Redis:
Host: localhost
Port: 6379
# To get the user name, run redis-cli, if you set a password, run "auth <your password>" and if the out put is "OK" run "ACL USERS"
Username: 'default'
Password: ''
# Set a prefix from an entire proxy network if using multi-proxy setup below
Prefix: ''
# Enables more debug messages for communication between servers
# Use /votingpluginbungee status for testing communication
BungeeDebug: false
# Get the plugin to broadcast to all servers
# If false you need to enable
# Only use for global rewards (one per network), otherwise you will get double broadcasts
BungeeBroadcast: false
# For pluginmessaging method only
# Whether to broadcast on cached votes
BungeeBroadcastAlways: false
# If true, the server won't broadcast votes
# To be used in conjuction with Broadcast setting on bungee
DisableBroadcast: false
# If true, offline rewards will be stored per server, rather than global
# This shouldn't need to be set unless you get alot of cross server rewards issues
# You can also specify the server within the rewards
# Requires server name below to be correct
PerServerRewards: false
# If true, milestones work per server
# Please note totals still sync, but milestones can be claimed on each server
# Needs to be set across all needed servers
PerServerMilestones: false
# If true, points will be given on a per server level
# Points will be added when server gets vote from bungee
PerServerPoints: false
# If true, plugin will trigger VotifierEvent
# Should allow some compability with other plugins
TriggerVotifierEvent: false
# If enabled plugin will give extra allsites reward if deterimned that it should
# E.g. user votes offline for 7 days, they will only get 1 allsites reward by default
# When enabled, they should get 7
# Only applies to PLUGINMESSAGING
# Recommend enabling ExtraAllSitesCheck in config.yml as well
GiveExtraAllSitesRewards: false
# What server this is in bungee (must match)
# Also can be applied to rewards
Server: PleaseSet
# Rewards from bungee vote party
# Gives to only players only
# Use regular voteparty rewards otherwise
# Can edit via /av gui
BungeeVotePartyRewards: {}
# List of commands to run on bungee party
# This runs a one time command only
BungeeVotePartyGlobalCommands: []
####################################################################################
# Global mysql data handle for between server commmunications
# This is NOT required for bungee voting to work
# This is still a WIP, use with caution
# This will create a different table then from users storing server info to process
#
# If you use this you need to enable this on BungeeSettings.yml on each server with votingplugin
# Make sure server name is set correctly in BungeeSettings.yml or this will not work correctly
#
# Please use PLUGINMESSAGING for this, SOCKETS should work as well, but not fully tested
#
# This will make votes cache until time change has finished processing
# In the event a server is offline or time change fails, the time change process
# will continue after a set amount of time (in essense skipping a specific server)
# This will also respect blocked servers in bungeeconfig.yml
GlobalData:
Enabled: false
# Use existing mysql connection from config.yml
UseMainMySQL: true
# Mysql settings only used if above is false
Host: ''
# Default port is 3306
Port: 3306
Database: ''
Username: ''
Password: ''
# Max number of connections
MaxConnections: 1
# Must be the same on all servers
Prefix: ''
#UseSSL: true
#PublicKeyRetrieval: false
#Attempt to use mariadb driver
#UseMariaDB: false
##########################################
# For socket setup
# Recommend to try PLUGINMESSAGING setup first
# Options hidden by default to avoid confusion
##########################################
# Options available here:
# https://github.com/BenCodez/VotingPlugin/wiki/Bungee-Setup-SOCKETS
+762
View File
@@ -0,0 +1,762 @@
# VotingPlugin by BenCodez
# Main Config
# See wiki for help:
# https://github.com/BenCodez/VotingPlugin/wiki
# Config is sorted in sections
# Use Control + F to search with Notepad++
###########################################
# User storage
###########################################
# Valid Options:
# - SQLITE
# - MYSQL
DataStorage: SQLITE
# Information for mysql
# See the end of the config for cache options
MySQL:
Host: ''
# Default port is 3306
Port: 3306
Database: ''
Username: ''
Password: ''
# Max number of connections
MaxConnections: 1
# Table name prefix, for use with mutliple servers
# Don't use with PLUGINMESSAGING bungee setup
Prefix: ''
#UseSSL: true
#PublicKeyRetrieval: false
#MaxLifeTime: -1
#Additional info on connection string
#Line: ''
#Attempt to use mariadb driver
#UseMariaDB: false
###########################################
# VoteReminding
###########################################
# Configuration for VoteReminding
# By default this should be all setup to work
# as long as vote delays are done properly in votesites.yml
VoteReminding:
# Enable vote reminding
# This will remind player when he can vote on all sites
# 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"
# To remind if all votesites are available (rather than any) use the permission "VotingPlugin.Login.RemindVotes.All"
Enabled: true
# Will remind player on login if he can vote
RemindOnLogin: true
# Whether or not to remind only once when the player can vote
# Does not apply to login reminds.
RemindOnlyOnce: true
# Delay to remind votes in minutes
# Set to -1 to disable
RemindDelay: 30
# Run rewards
# and have the default message
# Can add titles and more in the reward
# This can also be edited via /av gui
Rewards:
Messages:
Player: '&aYou have %sitesavailable% sites to vote on still!'
Title:
Enabled: false
Title: '&cRemember to vote!'
SubTitle: '&aType /vote'
FadeIn: 10
ShowTime: 50
FadeOut: 10
ActionBar:
Message: '&cRemember to vote'
Delay: 30
###########################################
# Format options
###########################################
# Common PlacesHolders:
# Special PlaceHolders will be commented where available
# %player% = player name
# %SiteName% = vote site name
#
# Set Message to '' (2 ') to disable message
Format:
# CommandHandler help message
# Mainly used in admin help page, see below for /vote help
HelpLine: '&6%Command% - &6%HelpMessage%'
# Broadcast vote message
# Set to an empty message to disable
# Use %NewLine% for a new line
BroadcastMsg: '&6[&4Broadcast&6] &2Thanks &c%player% &2for voting on %SiteName%'
# If true uses broadcast setting below for offline votes
OnlyOneOfflineBroadcast: false
OfflineBroadcast: '&6[&4Broadcast&6] &2Thanks &c%player% &2for voting on %numberofvotes% times!'
# Broadcast only when player is online
BroadcastWhenOnline: false
# Broadcast every x number of minutes with number of players that voted
AlternateBroadcast:
Enabled: false
# Use %players% for all players names
# Use %numberofplayers% for number of players that voted
Broadcast: '&6[&4Broadcast&6] &2%numberofplayers% voted in the last half hour! /vote'
# Delay in minutes
Delay: 30
Commands:
# Format for /vote
# %num% = the number of the site, for a numbered list
# %url% = site URL
Vote:
Text:
- '&3&lVote for our server!'
# If you want to want to use the feature below where the plugin will
# automaticly list the sites then set the message in the text above
AutoInputSites: true
# For each VoteSite
# make sure to set VoteURL in your VoteSites
# Requires above to be true
# Text will be sent before this
Sites: '&3%num%: &6&l%SiteName% &6- %url%'
# If true, links will always be forced as urls
ForceLinks: true
# Format for /vote next
Next:
# First line
Title: '&3&l%player% Next Votes:'
# How each line is setup for each vote site
# %info% = Info - See Below
# %SiteName% = site name from vote
Layout: '&3%SiteName%: &6%info%'
Info:
# Message when player can vote
CanVote: 'Go Vote!'
# Time until vote msg
# %hours% = hours until next vote
# %minutes% = minutes until next vote
TimeUntilVote: '%hours% Hours and %minutes% Minutes'
# If there is an error finding out time until next vote
Error: '&cCould not caculate time until next vote!'
# For sites that have this, requires votedelaydaily to be set to true in the site
VoteDelayDaily: '%hours% Hours and %minutes% Minutes'
# Format for /vote last
Last:
# First line
Title: '&3&l%player% Last Vote Times:'
# Lines for each vote site
# %time% = time, using timeformat below
# %timesince% = time since vote
Line: '&3%SiteName%: &6%timeSince%'
# Spelling of TimeType can be changed under Format.Commands.TimeFormats
TimeFormat: '%amount% %TimeType%'
LastVoted: '%times% ago'
NeverVoted: 'Never voted'
# Whether or not to include seconds into last voted time
IncludeSeconds: true
# Format for /vote total
Total:
- '&3&l%player% Total Votes:'
- '&3&lDaily Total: &6&l%DailyTotal%'
- '&3&lWeekly Total: &6&l%WeeklyTotal%'
- '&3&lMonthly Total: &6&l%MonthlyTotal%'
- '&3&lAllTime Total: &6&l%AllTimeTotal%'
# Format for /vote total all
TotalAll:
- '&3&lServer Total Votes:'
- '&3&lDaily Total: &6&l%DailyTotal%'
- '&3&lWeekly Total: &6&l%WeeklyTotal%'
- '&3&lMonthly Total: &6&l%MonthlyTotal%'
- '&3&lAllTime Total: &6&l%AllTimeTotal%'
# Format for /vote top
Top:
# First line
# %page% = current page
# %maxpages% = max number of pages
# %Top% = Monthly/Weekly/Daily (depending on command)
Title: '&3Top %Top% Voters %page%/%maxpages%'
# Line for each player in that page
Line: '&c%num%: &6%player%, %votes%'
# Format for /vote help
Help:
# Title of /vote help
Title: '&6&lVoting Player Help'
# Format for help message in /v help
Line: '&6%Command% - &6%HelpMessage%'
# Hover color for help message
# Hex format: #HEXCOLOR
HoverColor: AQUA
# Require permission to see command in /v help or /av help
RequirePermission: true
Best:
Title: '&3&l%player% Best Votes'
Lines:
- '&3Highest Daily Total: &3&l%HighestDailyTotal%'
- '&3Highest Week Total: &3&l%HighestWeeklyTotal%'
- '&3Highest Month Total: &3&l%HighestMonthlyTotal%'
Streak:
Title: '&3&l%player% Vote Streak'
Lines:
- '&3Current Daily Streak: &3&l%DailyStreak%'
- '&3Current Week Streak: &3&l%WeeklyStreak%'
- '&3Current Month Streak: &3&l%MonthlyStreak%'
- '&3&lHighest Streaks:'
- '&3Highest Daily Streak: &3&l%BestDailyStreak%'
- '&3Highest Week Streak: &3&l%BestWeeklyStreak%'
- '&3Highest Month Streak: &3&l%BestMonthlyStreak%'
Today:
Title:
- "&cToday's Votes %page%/%maxpage%"
- '&cPlayerName : VoteSite : Time'
Line: '&6%player% : %VoteSite% : %Time%'
# PlaceHolders:
# %VotesRequired% = VotesRequired
# %NeededVotes% = Number of votes needed to reach VotesRequired
# %Votes% = Number of votes
Party:
- '&cCurrently at &6%Votes%&c, &6%NeededVotes% &cmore votes to go to reach &6%VotesRequired%'
# %Points% = player points
Points: '&a%Player% currently has &a&l%Points%&a Points!'
# /vote givepoints command
# Transfer between players command
# Enable command below
GivePoints:
NotEnoughPoints: '&cNot enough points'
NotJoinedServer: '&c%player% has not joined the server'
NumberLowerThanZero: '&cNumber of points needs to be greater than 0'
TransferFrom: '&c%transfer% points given to %touser%'
TransferTo: '&cYou received %transfer% points from %fromuser%'
ToggleBroadcasts:
Enabled: '&cYou will now see vote broadcasts'
Disabled: '&cYou will no longer see vote broadcasts'
ToggleReminders:
Enabled: '&cVote reminders enabled'
Disabled: '&cVote reminders disabled'
# Msg on top voter award, will only send message if that place has a reward set
# %place% = place - 1,2,3,etc
TopVoterAwardMsg: '&aYou came in %place% in top voters of the month! Here is an award!'
# Time Format
# See https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
TimeFormat: 'EEE, d MMM yyyy HH:mm'
# Reward time format for %date% placeholder (Time of giving reward)
RewardTimeFormat: 'EEE, d MMM yyyy HH:mm'
TimeFormats:
Day: 'Day'
Days: 'Days'
Hour: 'Hour'
Hours: 'Hours'
Minute: 'Minute'
Minutes: 'Minutes'
Second: 'Second'
Seconds: 'Seconds'
# Format for signs
# SiteName may be all, depending on sign
# %position% = position of player, set by sign
# %votes% = Number of votes
Signs:
TopVoterSign:
Line1: 'TopVoter: %SiteName%'
Line2: '#%position%'
Line3: '%player%'
Line4: '%votes% Votes'
# Message when right clicking sign, uses same placeholders as above
RightClickMessage: '&c&l%player% &cis &c&l%position% &cwith &c&l%votes% &cvotes in &c&l%SiteName%'
# Message when player tries to run command without required permissions
NoPerms: '&cYou do not have enough permission!'
# Message when player types a command but does not input a number where needed
NotNumber: '&cError on &6%arg%&c, number expected!'
# Shop messages when using the /vote shop
ShopPurchase: '&aYou bought the %Identifier% for %Points% Points!'
ShopFailed: '&cYou do not have %Points% points to purchase this!'
ShopNotPurchasable: '&cThis item is not buyable!'
# User not exist message, from commands such as /vote next (player)
UserNotExist: '&cUser does not exist: %player%'
# 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'
# Display text
# Used in /vote top (GUI)
TopVoter:
Daily: 'Daily'
Weekly: 'Weekly'
Monthly: 'Monthly'
AllTime: 'AllTime'
# Invalid command messages
InvalidCommand:
Vote: '&4No valid arguments, see /vote help!'
AdminVote: '&4No valid arguments, see /adminvote help!'
# Playernames to not be broadcasted when voting
# case sensitive
VotingBroadcastBlacklist: []
# Playernames to not be broadcasted when broadcast comes from reward file
# case sensitive
BroadcastBlacklist: []
###########################################
# Top Voter
# Top voter rewards available in specialrewards.yml
###########################################
# Top voter blacklist
# Hide these names from top voter lists
BlackList:
- 'Notch'
# If true players with the permission 'VotingPlugin.TopVoter.Ignore' will act
# as if there name was added on the the blacklist above
# This also applies for players with op
TopVoterIgnorePermission: false
# /vote top default data displayed
# 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
Monthly: true
Weekly: false
Daily: false
# Maxium number of players to show on top voter
# Set to -1 for no limit
MaxiumNumberOfTopVotersToLoad: 1000
# When top voter awards are given (even if there are none listed) it will store top voters
# Files will created in TopVoters folder.
# Monthly top voters are always saved by default now
StoreTopVoters:
Weekly: false
Daily: false
# Limit monthly votes to number of days of a month multipled by the number of sites
LimitMonthlyVotes: false
###########################################
# Debug
###########################################
# Debug levels:
# NONE
# INFO
# EXTRA
DebugLevel: NONE
# Debug info ingame
# Players with permission "VotingPlugin.Debug"
# will see debug info if debug is true
DebugInGame: false
# Will log debug messages to VotingPlugin/Log/log.txt
# Only needed for extreme cases
#LogDebugToFile: false
# Whether or not to log every vote to a file
# Use this if you wanna track player votes
# Not recommended though
LogVotesToFile: false
###########################################
# Placeholderapi placeholders settings
###########################################
# When enabled the command /vote setprimaryaccount (playername)
# will be shown (after restart)
# Primary account will be used instead of the players account to get
# placeholder and other data such as vote reminding
# Mainly to be used for alts and such
UsePrimaryAccountForPlaceholders: false
# Valid Options:
# AUTOALL - Auto cache placeholders after they have been used and cache all players placeholder all the time
# AUTO - Auto cache after they have been used and cache online players placeholders (Recommended)
# SPECIFIC - Only cache certain placeholders for online players
# SPECIFICALL - Only cache certain placeholders for all players
# NONE - Don't cache any placeholders
PlaceholderCacheLevel: AUTO
# Placeholder controls
# Add _process to end of placeholder to force a return value rather than . or .. if no cached value is ready
# Add _nocache to end of placeholder to skip cache and retrive a live value, uses a direct mysql connection, do not use on main thread
#
# Set which placeholders to cache at all times
# Use for placeholders to are pulled constantly or on the main thread
# Mainly aimed for scoreboards that pull placeholders often
# Placeholders may auto cache in certain conditions (if enabled above)
# Will use additional memory, but not a lot
# Still in early stages, please report bugs
# Please remove VotingPlugin_ from the placeholder listed here
CachedPlaceholders: []
#- Total_AllTime
# When enabled, javascript will be parsed on placeholders (from placeholderapi)
# allows more fancy placeholders with math for example
UseJavascriptPlaceholders: false
# Custom placeholder returns
# For the example below use %votingplugin_custom_enoughpoints_5%
# DO NOT USE ON MAIN THREAD IF POSSIBLE
# Keep everything lowercase
# Example:
#CustomPlaceholderReturns:
# 'enoughpoints_5':
# 'true': 'User has enough points'
# 'false': 'User does not have enough points'
CustomPlaceholderReturns: {}
###########################################
# Login options
###########################################
# If true vanished players are treated as if they are offline
TreatVanishAsOffline: false
# Delays login event, delays vote reminding and more
# In miliseconds, 1000 = 1 second
DelayLoginEvent: 0
# Wait until user is logged in with AuthMe
# Requires AuthMe or LoginSecurity
WaitUntilLoggedIn: true
###########################################
# Disable/Enable features
###########################################
# If true, cooldown check is disabled
DisableCoolDownCheck: false
# If true, disable PlayerInteractEvent (for clicking signs and skulls)
DisableInteractEvent: false
# Disable this on a hub server for example
# Still processes rewards for offline rewards (just won't give any)
ProcessRewards: true
# Set to true to disable no service site message on voting
# You should never have to touch this if everything is setup properly
# Will also disable a few other warnings about vote sites
DisableNoServiceSiteMessage: false
# Count fake votes
# If true fake votes will give points and totals
CountFakeVotes: true
# Whether or not to disable update checks
DisableUpdateChecking: false
# Enable per site cooldown events, requires more resources to use
# Requires restart
PerSiteCoolDownEvents: false
# Queue votes during a time change (doesn't apply to bungee voting)
# Votes will be given when time change is completed
QueueVotesDuringTimeChange: false
# If true, plugin will automaticly generate votesites
# Disable this if you experience issues with sites being created randomly
# Most cases this will work all the time
AutoCreateVoteSites: true
# Experiemtental feature
# Uses https://github.com/BenCodez/VotingPlugin/wiki/Minecraft-Server-Lists
# Not all voting sites use the domain name as the service sites
# This feature is an attempt to ease setup for new users by matching domain name to actual service site
AdvancedServiceSiteHandling: false
# Set this to false to disable the plugin adding totals
# Not really recommended
AddTotals: true
# Disabling this prevents offline votes from adding totals to users
AddTotalsOffline: true
# If false, votestreaks will be disabled
UseVoteStreaks: true
# If false, storing best totals will be disabled
UseHighestTotals: true
# Geyser/Bedrock player support
# Set prefix used for voting
# Players should vote with prefix
# https://github.com/BenCodez/VotingPlugin/wiki/Bedrock-Player-Support
BedrockPlayerPrefix: '.'
# Whether or not to create daily backups. (Only the most recent ones get kept)
CreateBackups: true
# Automaticly download the latest version
# Will require a restart to actually update
# Note: It takes 30-40 minutes before being able to download the latest build
# You can also use /av download
AutoDownload: false
# If false plugin will use offline player UUIDs
OnlineMode: true
# Disable checking on world change
# May improve performance
#DisableCheckOnWorldChange: false
# Disable javascript processing in messages/rewards
DisableJavascript: false
# If true, number of vote shop purchases will be tracked
# Data will be tracked in serverdata.yml, may change in the future
# No commands to view data currently
TrackShopPurchases: false
# Limits about of offline votesites
# Does not currently work with bungee votes from votingplugin
OfflineVotesLimit:
# Enable or disable
Enabled: false
# Limit of votes per votesite
Amount: 5
# Default worlds set for all rewards
DefaultRewardWorlds: []
# Default blackedlisted worlds set for all rewards
DefaultRewardBlackListedWorlds: []
###########################################
# Skull settings
###########################################
# Preload skulls to improve performance for vote top
# when using skulls as the item to display players
# If false, skulls will be cached as they are used
# assuming loadskulls is enabled
PreloadSkulls: false
# Setting to false disables saving skulls in a cache to improve speeds
# Will reduce ram usage (very little) if disabled, but slow GUI speeds when using skulls
LoadSkulls: true
###########################################
# Extra checks on vote
###########################################
# If true, allsites will have an extra check to prevent duplicate allsites from being given
ExtraAllSitesCheck: false
# This is an extra safe guard to prevent milestones
# from being executed more than once
# Shoudn't be needed, but enable if you have trouble with milestones
PreventRepeatMilestones: false
# Number of points to give on vote
# Set to 0 to give no points
PointsOnVote: 1
# May need to enable this for bungee setups
# Let players who never joined before vote
# Recommend: False (Will prevent creating random user data)
AllowUnjoined: false
# Use server lookup for when allowunjoined is set to false
# Recommend leaving enabled unless you face issues
AllowUnJoinedCheckServer: true
##############################################
# Command/Permission settings
##############################################
# Give VotingPlugin.Player by default
# Requires restart to take affect
GiveDefaultPermission: true
# Permissions given by VotingPlugin.Player by default
# Permissions listed here will no be accessible with the default permission
DisabledDefaultPermissions: []
# If true, /vote will open /vote gui by default
UseVoteGUIMainCommand: false
# Disable checking permissions on tab complete
# Could increase performance slightly, but probably not
DisableAdvancedTab: false
# Load command aliases, such as /avgui
# Requires restart to take effect
LoadCommandAliases: true
# Use vault for permission checks
# May not work on some plugins
UseVaultPermissions: false
# List of disabled commands from /vote
# List the specific permission
# E.g:
# - PERMISSION
DisabledCommands: []
# If true, permissions will be handled differently
MultiplePermissionsCheck: false
# Allow transfer of vote points between players
# Requires restart for command to load
# Command: /vote givepoints (player) (points)
AllowVotePointTransfers: false
AddCustomCommands: false
# Injects custom command to /vote
# Requires AddCustomCommand: true to be set
CustomCommands:
# identifier, not specific name
command1:
Args:
- token
# Message to send on command
Message: 'token message'
# Permission for this command
Permission: 'votingplugin.commands.vote.token'
# help message
HelpMessage: 'See tokens'
# Forces player to run this command
Commands:
- tokencommand
##############################################
# Background task settings
##############################################
# Only update in the background when needed when set to false
AlwaysUpdate: false
# Update in the background only if players are online
UpdateWithPlayersOnlineOnly: false
# Delay between background updates like signs and more
# Default: 3 Minutes
# Longer times result in longer wait in stuff updating after a vote, like topvoter
DelayBetweenUpdates: 3
# Enable to true for extra player checks
# Recommend leaving this to false
ExtraBackgroundUpdate: false
##########################################
# Inventory controls
##########################################
# Click sound when using gui
# Set to none for no sound
ClickSound:
Sound: 'UI_BUTTON_CLICK'
Volume: 1.0
Pitch: 1.0
# If true, items given for rewards are dropped on the ground
# If false, items will be given when there is space
DropOnFullInv: true
# This will prevent spam clicking GUI's to prevent exploits
# Number is time in between clicking in milliseconds
SpamClickTime: 100
# Message to send when inventory forced closed when spam clicking
# Uncomment to use
#SpamClickMessage: '&cDetected spam clicking GUI, closing to prevent exploits'
# Will force GUI's to close on every click
AlwaysCloseInventory: false
# Close inventory on player vote
# This is to prevent any possible exploits
CloseInventoryOnVote: true
# This will close GUI's if you shift click them rather than a regular
# This can help prevent exploits
CloseGUIOnShiftClick: false
###########################################
# Purge settings
###########################################
# Remove old player files
# Happens on startup or /av purge
PurgeOldData: false
# Minimum number of days offline in order to purge
PurgeMin: 90
##########################################
# Extra options
# Options below don't need to be touched
##########################################
# If enabled, data is repulled from storage on vote shop purchase
# This prevents possible exploits with vote shop
ExtraVoteShopCheck: true
# Options for request api
# Current methods:
# ANVIL
# BOOK
# CHAT
# This is mainly used for admin gui's to type in values
RequestAPI:
DefaultMethod: 'Anvil'
DisabledMethods: []
+391
View File
@@ -0,0 +1,391 @@
# Configure GUI's here
# Note: Slots start at 0 instead of 1, max slot is 53 (don't go over) (E.g: last slot in first row of inventory is 8)
# Item Material's can be found here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
#
# GUI Methods:
# - BOOK
# - CHEST
# - CHAT (Disables GUI)
GUIMethod:
Today: CHEST #BOOK not available (future update?)
TopVoter: CHEST #BOOK not available (future update?)
Last: CHEST #BOOK not available (future update?)
Next: CHEST
Total: CHEST #BOOK not available (future update?)
# GUI for /vote
URL: CHEST
Best: CHEST #BOOK not available (future update?)
Streak: CHEST #BOOK not available (future update?)
GUI: CHEST #CHAT/BOOK not availabe for this (future update?)
# Enable command for last month gui
# Requires restart to take effect
LastMonthGUI: false
CHEST:
# GUI for /vote gui, /vgui, /votegui
VoteGUI:
# Items will be ordered as listed here
# You can add items following this format, even set slots
# See extra item below. GUI will auto resize to what is needed
URL:
# Standard item format, lore is automaticly applied
Item:
Material: 'BOW'
Amount: 1
Name: '&4URL'
Lore:
- '&aClick me for links'
# You can set skulls of the player using the following
# Remove the # to enable
#Skull: '%Player%'
Next:
Item:
Material: 'COMPASS'
Amount: 1
Name: '&4Next'
Last:
Item:
Material: 'CLOCK'
Amount: 1
Name: '&4Last'
Total:
Item:
Material: 'CHEST'
Amount: 1
Name: '&4Total'
Top:
Item:
Material: 'OAK_SIGN'
Amount: 1
Name: '&4Top'
Today:
Item:
Material: 'BOOK'
Amount: 1
Name: '&4Today'
Shop:
Item:
Material: 'DIAMOND'
Amount: 1
Name: '&4Vote Shop'
Lore:
- '&aYou currently have %points% points'
# 'ExtraItem' below is an identifier, can be whatever
# ExtraItem:
# Item:
# Material: 'DIRT'
# Amount: 1
# Name: 'Extra item'
## Works on most GUI items
# Slot: 10
## Send rewards on click, run commands, check conditions, etc
# Rewards: []
# GUI for /vote url, /vote
VoteURL:
# GUI Name
Name: '&cVoteURL'
BackButton: true
SiteName: '&c%Name%'
SiteNameCanVote: '&a%Name%'
SeeURL: '&cClick to see URL'
NextVote: '&cCan Vote In: %Info%'
#Start slot for specific site buttons
#StartSlot: 1
ViewAllUrlsButtonEnabled: true
AllUrlsButton:
#Set slot for AllUrlsButton
#Slot: 0
RequireAllSitesVoted: true
AlreadyVotedItem:
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
Amount: 1
CanVoteItem:
Material: 'EMERALD_BLOCK'
Data: 0
Amount: 1
# URL when clicking item in /vote (GUI version)
URLText: '%VoteUrl%'
# #Add Extra items
# This extra item format works across other gui settings below
# ExtraItems:
# Item1:
# Material: DIRT
# Amount: 1
# Slot: 1
# #Can run commands or effects
# Rewards: []
VoteLast:
Name: 'VoteLast: %player%'
BackButton: true
# Lines for each vote site
# %time% = time, using timeformat below
# %timesince% = time since vote
Line: '&6%timeSince%'
ClickableLinks: true
VoteNext:
Name: 'VoteNext: %player%'
BackButton: true
# Extra customization for displaying site names in GUI only
#CustomSiteNamesDisplays:
# Site1: site name display
LoreLine: '%time%'
VoteToday:
Name: 'VoteToday'
Line: '&6%VoteSite% : %Time%'
IconTitle: '%player%'
BackButton: true
UseSkull: true
# If UseSkull is false, use this item
PlayerItem:
Material: 'PAPER'
Amount: 1
VoteTop:
Name: 'VoteTop %topvoter%'
BackButton: true
# Item of top voter (change material below)
Item:
Name: '&3&l%position%: &3%player%'
Lore: '&3&lVotes: &3%votes%'
# Opens main GUI of the specific player that gets clicked
OpenMainGUIOnClick: true
# Close GUI when clicking on a player item
CloseGUIOnClick: true
SwitchItem:
Name: '&3Switch TopVoter'
Lore: '&bCurrently: %Top%'
Material: 'OAK_SIGN'
Amount: 1
# Top voters for the switch item to use
#TopVoters:
#- ALLTIME
#- MONTHLY
# 8 Slots over from the bottom left
# Bottom of GUI
Slot: 7
# Number of topvoters to display on each GUI page, must be a multiple of 9
Size: 27
# If true, /vote top will show player heads
UseSkull: true
# Item for player in GUI if use skull is false
PlayerItem:
Material: 'PAPER'
Customization:
Enabled: false
# List of slots for top voter
PlayerSlots: []
# Add extra items
ExtraItems: {}
RemoveBottomBar: false
# Set slot for backbutton
BackButtonSlot: 0
VoteTotal:
Name: 'VoteTotal: %player%'
BackButton: true
DayTotal:
Item:
Material: 'CLOCK'
Name: '&cDaily Total'
Lore: '&c&lTotal: &c%Total%'
Amount: 1
WeekTotal:
Item:
Material: 'CLOCK'
Name: '&cWeekly Total'
Lore: '&c&lTotal: &c%Total%'
Amount: 1
MonthTotal:
Item:
Material: 'CLOCK'
Name: '&cMonthly Total'
Lore: '&c&lTotal: &c%Total%'
Amount: 1
AllTimeTotal:
Item:
Material: 'CLOCK'
Name: '&cAllTime Total'
Lore: '&c&lTotal: &c%Total%'
Amount: 1
VoteBest:
Name: 'VoteBest: %player%'
BackButton: true
DayBest:
Item:
Material: 'CLOCK'
Name: '&cDaily Best'
Lore: '&c&lBest: &c%Best%'
Amount: 1
WeekBest:
Item:
Material: 'CLOCK'
Name: '&cWeekly Best'
Lore: '&c&lBest: &c%Best%'
Amount: 1
MonthBest:
Item:
Material: 'CLOCK'
Name: '&cMonthly Best'
Lore: '&c&lBest: &c%Best%'
Amount: 1
VoteStreak:
Name: 'VoteStreak: %player%'
BackButton: false
CurrentDayStreak:
Item:
Material: 'CLOCK'
Name: '&cCurrent Daily Streak'
Lore: '&c&lStreak: &c%Streak%'
Amount: 1
CurrentWeekStreak:
Item:
Material: 'CLOCK'
Name: '&cCurrent Weekly Streak'
Lore: '&c&lStreak: &c%Streak%'
Amount: 1
CurrentMonthStreak:
Item:
Material: 'CLOCK'
Name: '&cCurrent Monthly Streak'
Lore: '&c&lStreak: &c%Streak%'
Amount: 1
HighestDayStreak:
Item:
Material: 'CLOCK'
Name: '&cHighest Daily Streak'
Lore: '&c&lStreak: &c%Streak%'
Amount: 1
HighestWeekStreak:
Item:
Material: 'CLOCK'
Name: '&cHighest Weekly Streak'
Lore: '&c&lStreak: &c%Streak%'
Amount: 1
HighestMonthStreak:
Item:
Material: 'CLOCK'
Name: '&cHighest Monthly Streak'
Lore: '&c&lStreak: &c%Streak%'
Amount: 1
VoteURLSite:
Name: 'VoteSite: %site%'
VoteGUIName: '&cVoteGUI: &c&l%player%'
VoteRewardName: 'VoteReward'
VoteShopName: 'VoteShop'
BackButton:
Material: 'BARRIER'
Data: 0
Amount: 1
Name: '&8Back to VoteGUI'
# If true, clicking back button will open VoteURL
OpenVoteURL: false
# If true, backbutton will be the last slot of the GUI
EndOfGUI: false
# If true, this item will become an exit button instead
Exit: false
VoteShopBackButton: true
VoteShopEnabled: true
# Hide items in vote shop which user can not buy
VoteShopHideLimitedReached: true
# Requires above to be false
VoteShopLimitReached: '&aYou reached your limit'
VoteShopRequireConfirmation: false
VoteShopDisabled: '&cVote shop disabled'
# If true, shop gui will reopen, updating all placeholders
VoteShopReopenGUIOnPurchase: false
# VoteShop extra items for display only
#VoteShopExtraItems:
#Item:
#...
Shop:
# Identifier
# Used in placeholders for formats
# Do not have spaces in the identifier
# Change the identifier for each shop item
Diamond:
Identifier_Name: 'Diamond'
# Item
Material: 'DIAMOND'
Amount: 1
Name: '&4Buy A Diamond'
# You can set skulls of the player using the following
# Remove the # to enable
#Skull: '%Player%'
Lore:
- '&c&lCost: &c3 Voting Points'
# Number of voting points this cost
Cost: 3
# Permission required, leave blank for no permission
Permission: ''
# Hide if player doesn't have permission (only if permission is set)
HideOnNoPermission: true
# 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
#Reset:
#Daily: false
#Weekly: false
#Monthly: false
# If true, item is not buyable
#NotBuyable: false
# Rewards to run if player buys successfully
Rewards:
# Run command on purchase
#Commands:
#- 'command here'
Items:
Diamond:
Material: 'DIAMOND'
Amount: 1
ShopConfirmPurchase:
Title: 'Confirm Purchase?'
YesItem:
Material: EMERALD_BLOCK
Amount: 1
Name: '&aYes'
NoItem:
Material: BARRIER
Amount: 1
Name: '&cNo'
BOOK:
VoteURLBookGUI:
Title: '&cVoteURL'
CanVoteText: 'Click me'
CanVoteColor: 'GREEN'
AlreadyVotedText: 'Click me'
AlreadyVotedColor: 'RED'
# If true the layout below is the full book text
Manual: false
# Only works if Manual is enabled
TopLayout: []
Layout:
- '&3&l%Sitename%'
- '[UrlText]'
+243
View File
@@ -0,0 +1,243 @@
# To disable reward set value to {}
# or remove entirely
# Eg:
# FirstVote: {} (All in one line)
# Rewards will be given if there is a reward to give, otherwise they will be ignored
# First vote rewards
FirstVote:
Messages:
Player: '&aYou voted for your first time!'
# First vote of the day reward
FirstVoteToday: {}
# All vote rewards
# One time reward for voting on all sites in one day
# Enable ExtraAllSitesCheck if you get double rewards
AllSites:
Messages:
Player: '&aYou voted on all sites in 1 day!'
# Give a reward for voting on all sites minus 1
# Similar to allsites
#AlmostAllSites:
# Messages:
# Player: '&aYou almost voted on all sites in 1 day!'
# If true only cumulative reward at a time can be given
# The cumulative rewards will go in order as listed under Cumulative, so if true
# the first cumulative (in the order as listed) that can be given will, then will ignore the rest
OnlyOneCumulative: false
# 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 with no remainder (So divides perfectly) then a reward is given
Cumulative:
# Number of votes required
# Allows multiple cumulative rewards
# Number be be around ' (E.g. '1')
# Can have multiple listed here
'20':
Enabled: false
# Whether or not votes must be made in same day/week
# Useful if you want to require a certain number of voting sites to be voted on
# for a daily/weekly reward instead of all of them
# Valid options
# AllTime
# Monthly
# Weekly
# Daily
TotalToUse: AllTime
# Blacklist recurring votes
#BlackList:
#- 40
# Whether or not to gives cumulative reward for every x number of votes, default: true
#Recurring: true
Rewards:
Messages:
Player: '&aYou got %cumulative% cumulative votes!'
# Vote party configuration
VoteParty:
# Wether or not vote party is enabled
Enabled: false
# Number of votes required to give rewards
VotesRequired: 20
# Increase the amount of votes required on each vote party reached
#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, give online players the vote party reward
# Can also use RewardType: ONLINE if you wanted
GiveOnlinePlayersOnly: true
# If true, the vote count will reset each day
ResetEachDay: false
# If true, the vote count will reset each week
ResetWeekly: false
# Reset at the end of the month
ResetMonthly: false
# If true, will give voteparty only once per day
OnlyOncePerDay: false
# If true, will give voteparty once per week only
OnlyOncePerWeek: false
# Reset extra votes weekly
ResetExtraVotesWeekly: false
# Reset extra votes monthly
ResetExtraVotesMonthly: false
# Count votes from /av vote?
CountFakeVotes: true
# Number of user votes that apply to vote party total the user needs to get rewards
UserVotesRequired: 0
# Count offline votes
CountOfflineVotes: true
# Broadcast when vote party reached
Broadcast: '&cReached the vote party amount!'
# Send a broadcast at a certain number of votes left and send a vote reminder
VoteReminderBroadcast: '%votesrequired% left to go, go vote!'
# List of votes required amounts for when to send vote party reminders
VoteReminderAtVotes: []
# List of commands to execute, these only execute once.
# %player% does not work here
GlobalCommands: []
# List of commands to execute once
# Only run will run
GlobalRandomCommand: []
# Rewards to give per player
Rewards:
# Uncomment below for online players to be rewarded only
#RewardType: ONLINE
Commands:
- say %player%
Items:
DIAMOND:
Material: 'DIAMOND'
Amount: 1
# 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
# Number be around ' (E.g. '1')
# Can have multiple listed here
'20':
Enabled: false
Rewards:
Messages:
Player: '&aYou got %milestone% milestone votes!'
VoteStreak:
# Valid options: Day, Week, Month
Day:
# Number of days in a row
# Each day requires one vote
# Add a - to give a reward for every multiple (e.g. 2- = 2,4,6,8, and so on)
# This may not work perfectly on bungee setups at this time
'2':
# Enabled or not
Enabled: false
# Rewards to give
Rewards:
Messages:
Player: "&aYou voted for %Streak% %Type%'s in a row!"
Week:
# Number of weeks in a row
# Requires atleast one vote per week
'2':
# Enabled or not
Enabled: false
# Rewards to give
Rewards:
Messages:
Player: "&aYou voted for %Streak% %Type%'s in a row!"
Month:
# Number of months in a row
# Requires atleast 1 vote per month
'2':
# Enabled or not
Enabled: false
# Rewards to give
Rewards:
Messages:
Player: "&aYou voted for %Streak% %Type%'s in a row!"
Requirement:
# Require certain percentage of votes
UsePercentage: false
# Percentage requirements of votes
# 50 = %50
Day: 50
Week: 50
Month: 50
# Reward given when all votesites are available to vote on
# Don't use this unless you really need it
# Little performance intensive
# Recommend add RewardType: ONLINE for it to only work online
VoteCoolDownEndedReward: []
# ONLY USE THIS FOR TITLES/SOUNDS AND OTHER EFFECTS
# IT WILL ONLY RUN ONE TIME FOR ANY NUMBER OF OFFLINE VOTES (3 offline votes = 1 AnySiteReward)
# Any reward files listed here are ran on vote of any site
# It is recommended to add rewards to each site instead of here
# Using forceoffline won't work here
# Use EverySiteReward in VoteSites.yml for a global reward for each site
AnySiteRewards: {}
# Rewards to run when player logs in
LoginRewards: {}
# Rewards to run when player logs off
# Will queue until player logs in unless forceoffline is enabled
LogoutRewards: {}
EnableMonthlyAwards: true
# TopVoter Placeholders:
#%place% - place in topvoter
#%topvoter% - topvoter type
#%votes% - current total votes related to top voter
# Rewards to give
MonthlyAwards:
# Position. 1 is first in top voter, 2 is second, etc...
# Using 1-10 will reward players in first to tenth place with the same reward
1:
Rewards:
Messages:
Player: '&aYou came in first place in %TopVoter%!'
2:
Rewards:
Messages:
Player: '&aYou came in second place in %TopVoter%!'
EnableWeeklyAwards: false
# Rewards to give on weekly top voter
WeeklyAwards:
# Position. 1 is first in top voter, 2 is second, etc...
1:
Rewards:
Messages:
Player: '&aYou came in first place in %TopVoter%!'
2:
Rewards:
Messages:
Player: '&aYou came in second place in %TopVoter%!'
EnableDailyRewards: false
# Rewards to give on daily top voter
DailyAwards:
# Position. 1 is first in top voter, 2 is second, etc...
1:
# Reward files to give
Rewards:
Messages:
Player: '&aYou came in first place in %TopVoter%!'
2:
Rewards:
Messages:
Player: '&aYou came in second place in %TopVoter%!'
+134
View File
@@ -0,0 +1,134 @@
VoteSites:
# VoteSite key
# Used for saving data for votesites
# Use a short name if you can
# No spaces or dots
ExampleVoteSite:
# Enable voteSite
# If false, votesite will not be loaded by plugin
# Default: false
Enabled: false
# Display name of voting site
Name: 'ExampleVoteSite'
# Priority of this site
# Used for sorted list
# High prority, higher on the list
Priority: 5
# If true, voteside will be hidden from some GUI's, similar to being disabled
Hidden: false
# The serviceName from the vote, has to be correct to work correctly
# Gotten from voting on the site (will be in console/log)
# Usually is the main part of the url(e.g. PlanetMinecraft.com), but not always
# See console when you vote (it will notify you if the plugin didn't find a votingsite matching the service site
ServiceSite: 'PlanetMinecraft.com'
# vote url for /vote
# Format for this can be set in Config.yml
# Do not include colors here
# If you need to force a url set the url as this:
# VoteURL: '[Text="ANY TEXT TO CLICK ON HERE",url="URLHERE"]'
VoteURL: 'link to vote URL here, used in /vote'
# Time between votes in hours (used for /vote next)
# Most sites are 24 hours
VoteDelay: 24
# Use to have a minute votedelay
# Must set a value on VoteDelay if you plan on only using this setting
#VoteDelayMin: 30
# Require waiting until votedelay time has pasted in order to accept vote
# Recommend: false
WaitUntilVoteDelay: false
# Reset vote delay each day (for certain sites that do this)
# Recommend: false
VoteDelayDaily: false
# Replaces offset, set the exact hour based on server time
# Include server time offset when setting this
# 2 = 2 am server time
# Use 1-24
#VoteDelayDailyHour: 14
# If true, rewards can be executed offline (requires ForceOffline to be true in the reward)
# Setting this to true will execute the reward offline while the player is offline
# This basiclly disables offline voting if set to true, don't misinterpret this option
ForceOffline: false
# VoteSite Material for some GUI's
# Removing this may result in an error, required on each site
DisplayItem:
Material: 'DIAMOND'
Amount: 1
# Reward to run when cooldown ends for this votesite
# Enable PerSiteCoolDownEvents in Config.yml to use this
#CoolDownEndRewards:
# Messages:
# Player: '&aTime to go vote on site1'
# Rewards to give
# https://github.com/BenCodez/AdvancedCore/wiki/Rewards
Rewards:
# Execute console commands
Commands:
- 'say hello'
# Send player a message
Messages:
Player: 'You voted'
# Site 2 example
Site2:
Enabled: false
Name: 'Site2'
ServiceSite: 'PlanetMinecraft.com'
VoteURL: 'link to vote URL here, used in /vote'
VoteDelay: 24
DisplayItem:
Material: 'DIAMOND'
Amount: 1
Rewards:
Commands:
- 'say hello'
# Advanced example
# 50% chance for reward1, if reward1 not given then 20% chance to get reward2, if reward2 not given then fallback
AdvancedPriority:
# Similar to priority, but no need to have to use reward files
# Add requirements under each reward
# Will go in order from list here and try to run each of the following rewards...
# This name can be anything, but they need to be different
Reward1:
Chance: 50
# Any other requirement here
# If any requirement fails, the next reward will be attempted
# Use permission requirement for rank based rewards
#RequirePermission: true
#Permission: 'permhere'
Messages:
Player: 'You got first reward'
Reward2:
Chance: 20
Messages:
Player: 'You got second reward'
# Fallback, 100% chance, after other rewards fail chances
Fallback:
Messages:
Player: 'You got unlucky'
# Give 1 diamond regardless of above
Items:
item1:
Material: DIAMOND
Amount: 1
Messages:
Player: 'You voted'
# Reward for any site
# Similar to AnySiteReward
# This requires the site to be configured in order to get the reward.
EverySiteReward: {}
+6
View File
@@ -0,0 +1,6 @@
name: ${project.name}
version: ${project.version}
main: com.bencodez.votingplugin.bungee.VotingPluginBungee
author: BenCodez
softDepends:
- RedisBungee
+225
View File
@@ -0,0 +1,225 @@
# Set bungeecoord to true on servers on the network (In VotingPlugin)
# Set server name in each server related to what it is on bungee
#
# MYSQL Required on all setups
# MYSQL INFO --------------------------
Host: ''
# Default port is 3306
Port: 3306
Database: ''
Username: ''
Password: ''
# Max number of connections
MaxConnections: 1
# Table name prefix, for use with mutliple servers
# Don't use with PLUGINMESSAGING bungee setup
Prefix: ''
#UseSSL: true
#PublicKeyRetrieval: false
#Attempt to use mariadb driver
#UseMariaDB: false
####################################################################################
# Global mysql data handle for between server commmunications
# This is NOT required for bungee voting to work
# This is still a WIP, use with caution
# This will create a different table then from users storing server info to process
#
# If you use this you need to enable this on BungeeSettings.yml on each server with votingplugin
# Make sure server name is set correctly in BungeeSettings.yml or this will not work correctly
#
# Please use PLUGINMESSAGING for this, SOCKETS should work as well, but not fully tested
#
# This will make votes cache until time change has finished processing
# In the event a server is offline or time change fails, the time change process
# will continue after a set amount of time (in essense skipping a specific server)
# This will also respect blocked servers
GlobalData:
Enabled: false
# Use existing connection above
UseMainMySQL: true
# Mysql settings only used if above is false
Host: ''
# Default port is 3306
Port: 3306
Database: ''
Username: ''
Password: ''
# Max number of connections
MaxConnections: 1
# Must be the same on all servers
Prefix: ''
#UseSSL: true
#PublicKeyRetrieval: false
#Attempt to use mariadb driver
#UseMariaDB: false
# Time offset for time changes
# Must match on all servers
TimeHourOffSet: 0
####################################################################################
Debug: false
# Have a reward on each server
# If false, will send to online server only
SendVotesToAllServers: true
# List of servers the plugin won't send the vote to
# Uses names from bungeecoord config, only needed for non SOCKETS setup
BlockedServers:
- hub
# Similar to BlockServers
# If a server is listed then blockedservers is ignored
WhiteListedServers: []
# What type of bungee setup
# Requires restart and set on all servers
# https://github.com/BenCodez/VotingPlugin/wiki/Bungeecoord-Setups
# Available:
# SOCKETS
# PLUGINMESSAGING (Recommended)
# MYSQL
# REDIS
BungeeMethod: PLUGINMESSAGING
# Use Redis for between server communication, set BungeeMethod to REDIS to use this
Redis:
Host: localhost
Port: 6379
Username: ''
Password: ''
# Set a prefix from an entire proxy network if using mutli-proxy setup below
Prefix: ''
# If false, votes will be checked if user is a valid player that has joined to server
# Works for PLUGINMESSAGING and SOCKETS methods only
# This requires spigot servers AllowUnJoined to be set to true in Config.yml
AllowUnJoined: false
# Points to give on vote
PointsOnVote: 1
# If true, bungee will handle adding totals
# If false, spigot servers will EACH set their own totals
# If false, AllowUnJoined should be enabled on bungee, spigot servers will handle that
# Recommeneded to leave enabled, setups with this disabled are currently unsupported
BungeeManageTotals: true
# Tell servers to broadcast
# Set DisableBroadcast to true on spigot servers (BungeeSettings.yml) as well
Broadcast: true
# Geyser/bedrock player settings
# https://github.com/BenCodez/VotingPlugin/wiki/Bedrock-Player-Support
BedrockPlayerPrefix: '.'
# Time votes will be cached on proxy
# -1 means no time limit
# Time in days
VoteCacheTime: -1
# Maxium number of votes possible per day
# Usually matches the amount of votesites
# Will limit vote totals to match accordingly
# Only applies for month total
# Set to -1 to disable
MaxAmountOfVotesPerDay: -1
VoteParty:
# If enabled, will trigger vote party reward
# in BungeeSettings.yml under BungeeVotePartyReward
# Only runs rewards for online players
Enabled: false
# Votes required
VotesRequired: 100
# Increase amount required on each vote party
IncreaseVotesRequired: 0
# If false, will only send to servers listed below
SendToAllServers: true
# Servers to send to, if SendToAllServers is false
ServersToSend: []
# List of commands to run on bungee server
# Set spigot commands in BungeeSettings.yml
BungeeCommands: []
Broadcast: '&aVote party has been reached!'
# Online mode for UUIDS
# Offline mode setups are not fully tested and are not supported currently
OnlineMode: true
##########################################
# PLUGINMESSAGING Settings
##########################################
# Applies to PLUGINMESSAGING only
# Votes will be forwarded when specific player is online
# If set to false, rewards should still reward when player logs in (by default)
WaitForUserOnline: false
##########################################
# Multi-proxy setup
# This is still a WIP, use with caution
# Primary server needs votifier and config option enabled
# Set socket host on each proxy and primary server set sub proxies
# All servers should be on pluginmessaging or sockets setup
##########################################
# Support for multiple proxies
MultiProxySupport: false
# Enable on primary proxy server with votifier
PrimaryServer: false
# If enabled, player will only get 1 reward on a server on the network
# Must be enabled on all proxies for this to work
# Must also disable sendtoallservers
MultiProxyOneGlobalReward: false
# Multi-proxy available methods:
# SOCKET
# REDIS
MultiProxyMethod: SOCKET
##########################################
# REDIS Settings
##########################################
# Set multiproxymethod to REDIS to use redis
MultiProxyRedis:
# If true the plugin will use the exsiting connection set above
# Must be on REDIS method to use this setting
UseExistingConnection: false
Host: localhost
Port: 6379
Username: ''
Password: ''
# Set each server it's own proxy name here (can be anything)
ProxyServerName: proxy1
# Set names of other proxy servers
# Must match what's set as the proxy server name above from other servers
# On non primary proxy server just set the primary proxy server name here
ProxyServers:
- proxy2
- proxy3
##########################################
# SOCKET settings for mutli-proxy
##########################################
# Set this for each proxy
MultiProxySocketHost:
Host: 0.0.0.0
Port: 1234
# Set other sub proxies here
# On non primary proxy only set primary proxy
MultiProxyServers:
secondproxy:
Host: 0.0.0.0
Port: 1235
+271
View File
@@ -0,0 +1,271 @@
name: ${project.name}
version: ${project.version}
main: com.bencodez.votingplugin.VotingPluginMain
description: Highly Customizable Voting Listener!
website: https://www.spigotmc.org/resources/votingplugin.15358/
author: BenCodez
softdepend:
- MVdWPlaceholders
- Votifier
- VotifierPlus
- NuVotifier
- Vault
- PlaceholderAPI
- ProtocolLib
- MVdWPlaceholderAPI
- AuthMe
- SuperVanish
- PremiumVanish
- LuckPerms
loadbefore:
- MCPerks
api-version: 1.13
folia-supported: true
libraries:
- org.openjdk.nashorn:nashorn-core:15.3
commands:
vote:
description: Vote command
adminvote:
description: Admin commands for VotingPlugin
av:
description: Admin commands for VotingPlugin
votehelp:
description: See access to a list of commands, Formated in Format.yml
aliases: vhelp
votetotal:
description: See totals of votes
aliases: vtotal
votelast:
description: See the last time you voted
aliases: vlast
votenext:
description: See when you can vote next
aliases: vnext
votetop:
description: See top voters
aliases: vtop
votetoday:
description: See who voted today
aliases: vtoday
votegui:
description: Open VoteGUI
aliases: vgui
voteurl:
description: Open VoteURL
aliases: vurl
votereward:
description: Open VoteReward GUI
aliases: vreward
voteparty:
description: A command
aliases: vparty
voteshop:
description: A command
aliases: vshop
votebest:
description: A command
aliases: vbest
votestreak:
description: A command
aliases: vstreak
votetogglebroadcast:
description: A command
aliases: vtogglebroadcast
votepoints:
description: A command
aliases: vpoints
votetogglereminders:
aliases:
- vtogglereminder
- vtoggle
votelist:
description: A command
aliases: vlist
voteall:
description: A command
aliases: vall
votechoices:
description: A command
alaises: vchoices
votegivepoints:
description: A command
alaises: vgivepoints
adminvotehelp:
description: Open adminvote help
aliases: avhelp
adminvote?:
description: Open adminvote help
aliases: av?
adminvotereport:
description: Command Alias
aliases: avreport
adminvoteperms:
description: Command Alias
aliases: avperms
adminvotereload:
description: Command Alias
aliases: avreload
adminvotetestreward:
description: Command Alias
aliases: avtestreward
adminvoteversion:
description: Command Alias
aliases: avversion
adminvotesites:
description: Command Alias
aliases: avsites
adminvoterewards:
description: Command Alias
aliases: avrewards
adminvoteuuid:
description: Command Alias
aliases: avuuid
adminvotevotesite:
description: Command Alias
aliases: avvotesite
adminvoteconfig:
description: Command Alias
aliases: avconfig
adminvoteupdatecheck:
description: Command Alias
aliases: avupdatecheck
adminvotevote:
description: Command Alias
aliases:
- avvote
- fakevote
adminvotegui:
description: Command Alias
aliases: avgui
adminvotegivereward:
description: Command Alias
aliases: avgivereward
adminvoteconvertfromdata:
description: Command Alias
aliases: avconvertfromdata
adminvoteonverttodata:
description: Command Alias
aliases: avconverttodata
adminvotecleartotal:
description: Command Alias
adminvotebackgroundupdate:
description: Command Alias
aliases: avbackgroundupdate
adminvoteclearcache:
description: Command Alias
aliases: avclearcache
adminvoteservicesites:
description: Command Alias
aliases: avservicesites
adminvotevoteparty:
description: Command Alias
aliases: avvoteparty
adminvotechoices:
description: Command Alias
aliases: avchoices
adminvotereloadall:
description: Command Alias
aliases: avreloadall
adminvotepermsplayer:
description: Command Alias
aliases: avpermsplayer
adminvoteresyncmilestonesalreadygiven:
description: Command Alias
aliases: avresyncmilestonesalreadygiven
votesetprimaryaccount:
description: Command Alias
adminvoteclearofflinevotes:
description: Command Alias
aliases: avclearofflinevotes
adminvotegiveall:
description: Command Alias
aliases: avgiveall
adminvotegiveallonline:
description: Command Alias
aliases: avgiveallonline
adminvoteforcetimechanged:
description: Command Alias
aliases: avforcetimechanged
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
adminvotestatus:
description: Command Alias
aliases: avstatus
adminvotetest:
description: Command Alias
aliases: avtest
adminvoteplaceholders:
description: Command Alias
aliases: avplaceholders
adminvotedownloadjenkins:
description: Command Alias
aliases: avdownloadjenkins
adminvotesetrequestmethod:
description: Command Alias
aliases: avsetrequestmethod
adminvoteuser:
description: Command Alias
aliases: avuser
adminvotecurrentplugintime:
description: Command Alias
aliases: avcurrentplugintime
adminvoteresetpoints:
description: Command Alias
aliases: avresetpoints
adminvoteruncmd:
description: Command Alias
aliases: avruncmd
adminvoteuseruuidremove:
description: Command Alias
aliases: avuseruuidremove
adminvoteedit:
description: Command Alias
aliases: avedit
adminvoteresetmilestonecount:
description: Command Alias
aliases: avresetmilestonecount
permissions:
VotingPlugin.Player:
description: Allows basic access player commands
VotingPlugin.Mod:
description: Allows mod commands
VotingPlugin.Admin:
description: Allows admincommands
VotingPlugin.Admin.Debug:
description: Permission to view debug info ingame
VotingPlugin.Signs.Create:
description: Allows access to create signs
VotingPlugin.TopVoter.Ignore:
description: Allows you to be exempt from top voter
VotingPlugin.NoRemind:
description: Ignore vote reminding
default: false
VotingPlugin.BypassWaitUntilVoteDelay:
description: Bypass WaitUntilVoteDelay
default: false
VotingPlugin.Sign.Create:
description: Permission to create sign
VotingPlugin.Admin.GenerateServiceSite:
description: Permission for generating votesite message
VotingPlugin.Login.RemindVotes:
description: Permission to allow timed reminders
VotingPlugin.Login.RemindVotes.All:
description: Remind if player can vote on all votesites, rather than any
default: false
@@ -0,0 +1,4 @@
time: '${timestamp}'
profile: '${build.profile.id}'
version: '${project.version}'
buildnumber: '${build.number}'
-33
View File
@@ -1,33 +0,0 @@
# Other rewards other than vote sites rewards are set here
# To disable reward set value to []
# Eg:
# FirstVote: [] (All in one line)
# First vote rewrrards
FirstVote:
- 'FirstVote'
# All vote rewards
# Reward for voting on all sites in one day
AllSites:
- 'AllSites'
# Give rewards after certain number of votes
VotesRequired: 0
# Wether or not votes must be made in same day
# Useful if you want to require a certain number of voting sites to be voted on
# for a daily reward instead of all of them
VotesInSameDay: false
CumulativeRewards:
- 'NumberOfVotes'
VoteParty:
# Wether or not vote party is enabled
Enabled: true
# Number of votes required to give rewards
VotesRequired: 20
# If true, players who did not vote to reach the votes required will
# recieve the reward
GiveAllPlayers: false
Rewards:
- 'ExampleReward'
-180
View File
@@ -1,180 +0,0 @@
# This is a reward file
# Define rewards in here
# File name is the reward name, without file extention
# This reward is named "ExampleReward"
# DO NOT HAVE DUPLICATE NAMES!!
# Reward are run top to bottom (For the most part)
# NOTE: Do not use this reward file in more than one place if
# delayed or timed is enabled!
# This will delay the reward file from running
Delayed:
Enabled: false
Hours: 1
Minutes: 0
# Specific time of day to give this reward file
# in 24 hour time, relative to local time zone
Timed:
Enabled: false
Hour: 12
Minute: 0
# Chance out of 100
# Must be an integer
# Set to 0 or 100 for always, or delete this line to disable chance
# Will not give any rewards below unless chance is lucky or disabled
Chance: 40
# This is to give random rewards, with fallback
# Rewards defined in this reward file below are still given
Random:
# Chance to give a randomly selected reward below (from list), will only give random reward
# if lucky (according to chance)
# Works same as chance above
Chance: 40
# When this reward file is being given, a random reward in the list below
# will be given, if chance is lucky
# Don't set this reward as a possible reward, may cause infinite loop
Rewards: []
# A list of fall back rewards if chance is unlucky
# Don't set this reward as a reward, may cause infinite loop
FallBack: []
# Require permission to give this reward file
# Permission is VotingPlugin.Reward.(REWARDNAME)
# E.g: VotingPlugin.Reward.ExampleReward
RequirePermission: false
# Worlds to give this reward in
# Player will be given this world once he is in this world
# This may not work with money
Worlds:
- 'world1'
- 'world2'
# If true, the player will be rewarded in each world
# If false, the player will be reward one of the worlds once
GiveInEachWorld: false
# Items to give to user
Items:
# Item
# This is not item display name
# No 2 names the same
Diamond:
# Item Material
# List of material for 1.10:
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
Material: 'DIAMOND'
# Item data value (Eg 1:4, data is 4)
Data: 0
# Will only give Amount if min and max amounts are 0
Amount: 1
# Set item durability
# Set to 0 or remove line for no durability
#Durability: 100
# Random amount of items between Min and Max will be given
# if min and max are not both 0
# Min amount of items
MinAmount: 1
# Max amount of items
MaxAmount: 4
# Item name
# Remove this value to have no name
Name: '&aSpecial Diamond'
# Lore
# Remove this value to have no lore
Lore:
- 'Line 1'
# Enchants
# List of 1.10 Encahants can be found at
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/enchantments/Enchantment.html
Enchants:
DURABILITY: 1
# Amount of money to give, requires vault
# Use 0 to give none
# Use negative to take money
Money: 1000
# Pick random number between min and max amount
MinMoney: 100
MaxMoney: 3000
# Give player experience
EXP: 100
# Commands to run
# Use %player% for player name
# Set to Console: [] for no commands
Commands:
# Commands here will be run by console
Console:
- 'say %player% was lucky'
# Commands here are run by player
Player:
- 'vote total'
# Potions to give on reward
Potions:
# Potion effect name
# 1.10 potions can be found here:
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html
ABSORPTION:
# Duration in seconds
Duration: 100
# Amplifier
Amplifier: 1
# Title to send to voter
# Requires SpigotLib
# Download here:
# https://www.spigotmc.org/resources/spigotlib.5925/
Title:
Enabled: false
Title: '&cThanks for voting!'
SubTitle: '&aYou voted on a website!'
FadeIn: 10
ShowTime: 50
FadeOut: 10
# Sound on reward
Sound:
# Enable or Disable Sound
Enabled: false
# Sound to play
# 1.9 Sounds: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html
# 1.8: https://jd.bukkit.org/org/bukkit/Sound.html
Sound: 'BLOCK_ANVIL_USE'
# Volume
# Range: 0.0 to 1.0
Volume: 1.0
# Pitch
# Range: 0.0 to 1.0
Pitch: 1.0
# Play particle effect on reward
# 1.10 Effects can be found here:
# https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Effect.html
Effect:
Enabled: false
Effect: 'EXPLOSION'
Data: 0
Particles: 10
Radius: 5
# The messages are sent when rewards above are given to user
# set to '' to give no message
# If no value is set, default in Format.yml is used
Messages:
Reward: '&aMessage on reward'
-40
View File
@@ -1,40 +0,0 @@
# Top voter blacklist
BlackList:
- 'Notch'
EnableMonthlyAwards: true
# Rewards to give
MonthlyAwards:
# Position. 1 is first in top voter, 2 is second, etc...
1:
# Reward files to give
Rewards:
- 'TopVoter1'
2:
Rewards:
- 'TopVoter2'
EnableWeeklyAwards: false
# Rewards to give on weekly top voter
WeeklyAwards:
# Position. 1 is first in top voter, 2 is second, etc...
1:
# Reward files to give
Rewards:
- 'WeeklyTopVoter1'
2:
Rewards:
- 'WeeklyTopVoter2'
EnableDailyRewards: false
# Rewards to give on daily top voter
DailyAwards:
# Position. 1 is first in top voter, 2 is second, etc...
1:
# Reward files to give
Rewards:
- 'DailyTopVoter1'
2:
Rewards:
- 'DailyTopVoter2'
-25
View File
@@ -1,25 +0,0 @@
# Options for vote reminding
# Enable vote reminding
# This will remind player when he can vote on all sites
# Requires VoteDelay's 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 not to remind only once
RemindOnlyOnce: true
# Will remind player on login if he can vote
# Ignores value above
RemindOnLogin: true
# Delay to remind votes
# Only works if above is false
# In minutes
RemindDelay: 30
# Run reward files on remind
# Set values in the reward file
Rewards:
- 'VoteReminding'
@@ -1,44 +0,0 @@
# ExampleVoteSite.yml
# This is an Example VoteSite
# Located in VoteSites folder in plugin directory
# The file name is the VoteSite name (not including the file extenstion)
# On vote (of this site), plugin will attempt to give any reward files listed below
# Also will attempt cumulative rewards
# Enable voteSite
# If false, votesite will not be loaded by plugin
# Default: false
Enabled: false
# Priority of this site
# Used for sorted list
# High prority, higher on the list
Priority: 5
# The serviceName from the vote, has to be correct to work correctly
# Gotten from voting on the site (will be in console/log)
# Usually is the main part of the url(e.g. PlanetMinecraft.com)
ServiceSite: 'PlanetMinecraft.com'
# vote url for /vote
# Format for this can be set in Format.yml
# Do not include colors here
VoteURL: 'link to vote URL here, used in /vote'
# Time between votes in hours (used for /vote next)
# Most sites are 24 hours
VoteDelay: 24
# List of reward files to give to voter
Rewards:
- 'ExampleReward'
# Rewards to give once certain number of votes reached for this vote site
# Rewards work similar to above
Cumulative:
# Number of votes required to give this reward
Votes: 20
# List of reward files to give on cumulativereward
Rewards:
- 'ExampleReward'
-134
View File
@@ -1,134 +0,0 @@
name: VotingPlugin
version: 4.1.4
main: com.Ben12345rocks.VotingPlugin.Main
description: Highly Customizable Voting Listener!
website: https://www.spigotmc.org/resources/votingplugin.15358/
author: Ben12345rocks
commands:
vote:
description: Vote command
v:
description: Vote command
adminvote:
description: Admin commands for VotingPlugin
av:
description: Admin commands for VotingPlugin
votehelp:
description: See access to a list of commands, Formated in Format.yml
aliases: vhelp
votetotal:
description: See totals of votes
aliases: vtotal
votelast:
description: See the last time you voted
aliases: vlast
votenext:
description: See when you can vote next
aliases: vnext
votetop:
description: See top voters
aliases: vtop
voteinfo:
description: See player info
aliases: vinfo
votetoday:
description: See who voted today
aliases: vtoday
votegui:
description: Open VoteGUI
aliases: vgui
voteurl:
description: Open VoteURL
aliases: vurl
votereward:
description: Open VoteReward GUI
aliases: vreward
vote?:
description: View Help
aliases: v?
voteparty:
description: A command
aliases: vparty
voteshop:
description: A command
aliases: vshop
votepoints:
description: A command
aliases: vpoints
adminvotehelp:
description: Open adminvote help
aliases: avhelp
adminvote?:
description: Open adminvote help
aliases: av?
adminvotereport:
description: Command Alias
aliases: avreport
adminvoteperms:
description: Command Alias
aliases: avperms
adminvotereload:
description: Command Alias
aliases: avreload
adminvoteversion:
description: Command Alias
aliases: avversion
adminvotesites:
description: Command Alias
aliases: avsites
adminvoterewards:
description: Command Alias
aliases: avrewards
adminvoteuuid:
description: Command Alias
aliases: avuuid
adminvotereset:
description: Command Alias
aliases: avreset
adminvotevotesite:
description: Command Alias
aliases: avvotesite
adminvoteconfig:
description: Command Alias
aliases: avconfig
adminvoteserverdata:
description: Command Alias
aliases: avserverdata
adminvotesettotal:
description: Command Alias
aliases: avsettotal
adminvoteupdatecheck:
description: Command Alias
aliases: avupdatecheck
adminvotevote:
description: Command Alias
aliases: avvote
adminvoteTriggerPlayerVoteEvent:
description: Command Alias
aliases: avTriggerPlayerVoteEvent
permissions:
VotingPlugin.Player:
description: Allows basic access player commands
default: true
children:
VotingPlugin.Login.RemindVotes: true
VotingPlugin.Commands.Vote.Next: true
VotingPlugin.Commands.Vote.GUI: true
VotingPlugin.Commands.Vote.URL: true
VotingPlugin.Commands.Vote.Reward: true
VotingPlugin.Commands.Vote.Total: true
VotingPlugin.Commands.Vote.Last: true
VotingPlugin.Commands.Vote.Info: true
VotingPlugin.Commands.Vote.Help: true
VotingPlugin.Commands.Vote.Top: true
VotingPlugin.Commands.Vote.Top.Monthly: true
VotingPlugin.Commands.Vote.Top.Weekly: true
VotingPlugin.Commands.Vote.Top.Daily: true
VotingPlugin.Login.RemindVotes:
description: Allows players to get remined on login if they can vote
default: true
VotingPlugin.Signs.Create:
description: Allows access to create signs
VotingPlugin.TopVoter.Ignore:
description: Allows you to be exempt from top voter
+540
View File
@@ -0,0 +1,540 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>${version.art}</artifactId>
<version>6.16</version>
<packaging>jar</packaging>
<name>VotingPlugin</name>
<properties>
<github.global.server>github</github.global.server>
<project.build.sourceEncoding>Cp1252</project.build.sourceEncoding>
<build.number>NOTSET</build.number>
</properties>
<build>
<resources>
<resource>
<directory>Resources</directory>
<filtering>true</filtering>
<includes>
<include>plugin.yml</include>
<include>bungee.yml</include>
<include>votingpluginversion.yml</include>
</includes>
</resource>
<resource>
<directory>Resources</directory>
<filtering>false</filtering>
</resource>
</resources>
<sourceDirectory>src</sourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<versionRange>[1,)</versionRange>
<goals>
<goal>delombok</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<finalName>${project.name}</finalName>
</configuration>
</plugin>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.18.20.0</version>
<executions>
<execution>
<id>delombok</id>
<phase>deploy</phase>
<goals>
<goal>delombok</goal>
</goals>
<configuration>
<addOutputDirectory>false</addOutputDirectory>
<outputDirectory>${project.basedir}/target/delombok</outputDirectory>
<sourceDirectory>${project.basedir}/src</sourceDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.3</version>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<minimizeJar>true</minimizeJar>
<filters>
<filter>
<artifact>mysql-connector-java</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>com.bencodez.advancedcore</pattern>
<shadedPattern>${project.groupId}.votingplugin.advancedcore</shadedPattern>
</relocation>
<relocation>
<pattern>net.pl3x.bukkit.chatapi</pattern>
<shadedPattern>${project.groupId}.votingplugin</shadedPattern>
</relocation>
<relocation>
<pattern>me.mrten.mysqlapi</pattern>
<shadedPattern>${project.groupId}.votingplugin.mysqlapi</shadedPattern>
</relocation>
<relocation>
<pattern>com.zaxxer.HikariCP</pattern>
<shadedPattern>${project.groupId}.votingplugin.HikariCP</shadedPattern>
</relocation>
<relocation>
<pattern>com.zaxxer.hikari</pattern>
<shadedPattern>${project.groupId}.votingplugin.hikari</shadedPattern>
</relocation>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>${project.groupId}.votingplugin.bstats</shadedPattern>
</relocation>
<relocation>
<pattern>xyz.upperlevel.spigot</pattern>
<shadedPattern>${project.groupId}.votingplugin.advancedcore.xyz.upperlevel.spigot</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<!-- Lets exclude google code, because the server already has this
code in it (guava, etc) -->
<excludes>
<exclude>com.google.*:*</exclude>
</excludes>
</artifactSet>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${user.home}/Documents/Test Server/plugins</outputDirectory>
<resources>
<resource>
<directory>${basedir}/target</directory>
<includes>
<include>VotingPlugin.jar</include>
</includes>
</resource>
</resources>
<overwrite>true</overwrite>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>maven-central</id>
<url>https://oss.sonatype.org/content/groups/public</url>
</repository>
<repository>
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<repository>
<id>velocity</id>
<url>https://nexus.velocitypowered.com/repository/maven-public/</url>
</repository>
<repository>
<id>bencodez repo</id>
<url>https://nexus.bencodez.com/repository/maven-public/</url>
</repository>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.32</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.20-R0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vexsoftware</groupId>
<artifactId>nuvotifier-universal</artifactId>
<version>2.7.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>be.maximvdw</groupId>
<artifactId>mvdwplaceholderapi</artifactId>
<version>3.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId>
<version>3.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-velocity</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.5</version>
<scope>provided</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>normal</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<build.profile.id>normal</build.profile.id>
<version.art>votingplugin</version.art>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.bencodez</groupId>
<artifactId>advancedcore</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>normal-folia</id>
<properties>
<build.profile.id>normal</build.profile.id>
<version.art>votingplugin-folia</version.art>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>com.bencodez</groupId>
<artifactId>advancedcore-folia</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>prod2</id>
<properties>
<version.art>votingplugin</version.art>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<build.profile.id>prod2</build.profile.id>
</properties>
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Temporary Staging Repository</name>
<url>file://${project.build.directory}/mvn-repo</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>com.bencodez</groupId>
<artifactId>advancedcore</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>deploy-snapshot</id>
<properties>
<version.art>votingplugin</version.art>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<build.profile.id>deploy-snapshot</build.profile.id>
</properties>
<distributionManagement>
<snapshotRepository>
<id>nexus</id>
<url>https://nexus.bencodez.com/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>nexus</id>
<url>https://nexus.bencodez.com/repository/maven-snapshots/</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>com.bencodez</groupId>
<artifactId>advancedcore</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>nexus</serverId>
<nexusUrl>https://nexus.bencodez.com/nexus/</nexusUrl>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>javadoc</id>
<properties>
<version.art>votingplugin</version.art>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<build.profile.id>javadoc</build.profile.id>
</properties>
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Temporary Staging Repository</name>
<url>file://${project.build.directory}/mvn-repo</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>com.bencodez</groupId>
<artifactId>advancedcore</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<phase>deploy</phase>
<configuration>
<sourcepath>${project.basedir}/target/delombok</sourcepath>
<outputDirectory>${project.basedir}/target/apidocs</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>deploy</id>
<properties>
<version.art>votingplugin</version.art>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<build.profile.id>deploy</build.profile.id>
</properties>
<dependencies>
<dependency>
<groupId>com.bencodez</groupId>
<artifactId>advancedcore</artifactId>
<version>LATEST</version>
<scope>compile</scope>
</dependency>
</dependencies>
<distributionManagement>
<snapshotRepository>
<id>nexus</id>
<url>https://nexus.bencodez.com/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>nexus</id>
<url>https://nexus.bencodez.com/repository/maven-releases/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<phase>deploy</phase>
<configuration>
<sourcepath>${project.basedir}/target/delombok</sourcepath>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>nexus</serverId>
<nexusUrl>https://nexus.bencodez.com/nexus/</nexusUrl>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
<!--<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<executions>
<execution>
<id>javadoc</id>
<goals>
<goal>site</goal>
</goals>
<phase>deploy</phase>
<configuration>
<message>Maven javadoc for ${project.version}</message>
<noJekyll>true</noJekyll>
<outputDirectory>${project.build.directory}/apidocs
</outputDirectory>
<branch>refs/heads/gh-pages</branch>
<includes>
<include>**/*</include>
</includes>
<repositoryName>VotingPlugin</repositoryName>
<repositoryOwner>BenCodez</repositoryOwner>
<server>github</server>
</configuration>
</execution>
</executions>
</plugin>-->
</plugins>
</build>
</profile>
</profiles>
</project>
@@ -1,98 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Bungee;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketAddress;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.X509EncodedKeySpec;
import javax.xml.bind.DatatypeConverter;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Config.Config;
import com.Ben12345rocks.VotingPlugin.Config.ConfigBungeeVoting;
import com.vexsoftware.votifier.crypto.RSA;
import com.vexsoftware.votifier.model.Vote;
public class BungeeVote {
static BungeeVote instance = new BungeeVote();
static Main plugin = Main.plugin;
static ServerSocket sock;
public static BungeeVote getInstance() {
return instance;
}
private BungeeVote() {
}
public BungeeVote(Main plugin) {
BungeeVote.plugin = plugin;
}
public void sendVote(Vote vote) throws NoSuchAlgorithmException,
InvalidKeySpecException {
if (ConfigBungeeVoting.getInstance().getEnabled()) {
for (String server : ConfigBungeeVoting.getInstance().getServers()) {
byte[] encodedPublicKey = DatatypeConverter
.parseBase64Binary(ConfigBungeeVoting.getInstance()
.getServerKey(server));
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(
encodedPublicKey);
PublicKey publicKey = keyFactory.generatePublic(publicKeySpec);
String serverIP = ConfigBungeeVoting.getInstance().getServerIP(
server);
int serverPort = ConfigBungeeVoting.getInstance()
.getServerPort(server);
String serviceSite = ConfigBungeeVoting.getInstance()
.getServerServiceSite(serverIP);
if (serverIP.length() != 0) {
try {
if (serviceSite != null) {
if (serviceSite.length() > 0) {
vote.setServiceName(serviceSite);
}
}
String VoteString = "VOTE\n" + vote.getServiceName()
+ "\n" + vote.getUsername() + "\n"
+ vote.getAddress() + "\n"
+ vote.getTimeStamp() + "\n";
SocketAddress sockAddr = new InetSocketAddress(
serverIP, serverPort);
Socket socket = new Socket();
socket.connect(sockAddr, 1000);
OutputStream socketOutputStream = socket
.getOutputStream();
socketOutputStream.write(RSA.encrypt(
VoteString.getBytes(), publicKey));
socketOutputStream.close();
socket.close();
plugin.debug("Sending vote to " + server + "("
+ sockAddr.toString() + "): " + vote.toString());
} catch (Exception e) {
plugin.getLogger().info(
"Failed to send vote to " + server + "("
+ serverIP + ":" + serverPort + "): "
+ vote.toString()
+ ", ignore this if server is offline");
if (Config.getInstance().getDebugEnabled()) {
e.printStackTrace();
}
}
}
}
}
}
}
@@ -1,756 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Commands;
import java.util.ArrayList;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Commands.Executers.CommandAdminVote;
import com.Ben12345rocks.VotingPlugin.Commands.Executers.CommandAliases;
import com.Ben12345rocks.VotingPlugin.Commands.Executers.CommandVote;
import com.Ben12345rocks.VotingPlugin.Commands.TabCompleter.AliasesTabCompleter;
import com.Ben12345rocks.VotingPlugin.Config.Config;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Config.ConfigOtherRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
import com.Ben12345rocks.VotingPlugin.Events.PlayerVoteEvent;
import com.Ben12345rocks.VotingPlugin.Objects.CommandHandler;
import com.Ben12345rocks.VotingPlugin.Objects.User;
import com.Ben12345rocks.VotingPlugin.Report.Report;
import com.Ben12345rocks.VotingPlugin.VoteParty.VoteParty;
public class CommandLoader {
static ConfigOtherRewards otherReward = ConfigOtherRewards.getInstance();
static Config config = Config.getInstance();
static ConfigVoteSites configVoteSites = ConfigVoteSites.getInstance();
static ConfigFormat format = ConfigFormat.getInstance();
static CommandLoader instance = new CommandLoader();
static Main plugin = Main.plugin;
public static CommandLoader getInstance() {
return instance;
}
private HashMap<String, CommandHandler> commands;
private CommandLoader() {
}
public CommandLoader(Main plugin) {
CommandLoader.plugin = plugin;
}
public HashMap<String, CommandHandler> getCommands() {
return commands;
}
private void loadAdminVoteCommand() {
plugin.adminVoteCommand = new ArrayList<CommandHandler>();
plugin.adminVoteCommand.add(new CommandHandler(new String[] {
"TriggerPlayerVoteEvent", "(player)", "(sitename)" },
"VotingPlugin.Commands.AdminVote.TriggerPlayerVoteEvent",
"Trigger vote event, used for testing") {
@Override
public void execute(CommandSender sender, String[] args) {
PlayerVoteEvent voteEvent = new PlayerVoteEvent(plugin
.getVoteSite(args[2]), new User(args[1]));
plugin.getServer().getPluginManager().callEvent(voteEvent);
}
});
plugin.adminVoteCommand.add(new CommandHandler(
new String[] { "Help&?" },
"VotingPlugin.Commands.AdminVote.Help", "See this page") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().help(sender, 1);
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "Help&?",
"(number)" }, "VotingPlugin.Commands.AdminVote.Help",
"See this page") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().help(sender,
Integer.parseInt(args[1]));
}
});
plugin.adminVoteCommand.add(new CommandHandler(
new String[] { "Report" },
"VotingPlugin.Commands.AdminVote.Report",
"Create a zip file to send for debuging") {
@Override
public void execute(CommandSender sender, String[] args) {
Report.getInstance().create();
sender.sendMessage("Created Zip File!");
}
});
plugin.adminVoteCommand.add(new CommandHandler(
new String[] { "Perms" },
"VotingPlugin.Commands.AdminVote.Perms", "List perms") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().permList(sender);
}
});
plugin.adminVoteCommand.add(new CommandHandler(
new String[] { "Reload" },
"VotingPlugin.Commands.AdminVote.Reload", "Reload plugin") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().reload(sender);
}
});
plugin.adminVoteCommand
.add(new CommandHandler(new String[] { "Version" },
"VotingPlugin.Commands.AdminVote.Version",
"List version info") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().version(sender);
}
});
plugin.adminVoteCommand.add(new CommandHandler(
new String[] { "Sites" },
"VotingPlugin.Commands.AdminVote.Sites", "List VoteSites") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().sites(sender);
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "Sites",
"(sitename)" }, "VotingPlugin.Commands.AdminVote.Sites.Site",
"View Site Info") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().site(sender, args[1]);
}
});
plugin.adminVoteCommand.add(new CommandHandler(
new String[] { "Rewards" },
"VotingPlugin.Commands.AdminVote.Rewards", "List VoteSites") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().rewards(sender);
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] {
"Rewards", "(reward)" },
"VotingPlugin.Commands.AdminVote.Rewards.Reward",
"View Site Info") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().reward(sender, args[1]);
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "UUID",
"(player)" }, "VotingPlugin.Commands.AdminVote.UUID",
"View UUID of player") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().uuid(sender, args[1]);
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "Reset",
"Totals" }, "VotingPlugin.Commands.AdminVote.Reset.Total",
"Reset totals for all players") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().resetTotals(sender);
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "Reset",
"Totals", "(player)" },
"VotingPlugin.Commands.AdminVote.Reset.Total.Player",
"Reset total for player") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().resetPlayerTotals(sender,
args[2]);
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "Vote",
"(player)", "(sitename)" },
"VotingPlugin.Commands.AdminVote.Vote", "Trigger manual vote") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().Vote(sender, args[1], args[2]);
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] {
"VoteSite", "(sitename)", "Create" },
"VotingPlugin.Commands.AdminVote.VoteSite.Edit",
"Create VoteSite") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().createVoteSite(sender, args[1]);
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] { "Config",
"SetDebug", "(boolean)" },
"VotingPlugin.Commands.AdminVote.Config.Edit",
"Set Debug on or off") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().setConfigDebug(sender,
Boolean.parseBoolean(args[2]));
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] {
"ServerData", "SetPrevMonth", "(number)" },
"VotingPlugin.Commands.AdminVote.ServerDta.Edit",
"Edit PrevMonth, ADVANCED USERS ONLY") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().setServerDataPrevMonth(sender,
Integer.parseInt(args[2]));
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] {
"SetTotal", "(player)", "(sitename)", "(number)" },
"VotingPlugin.Commands.AdminVote.Set.Total",
"Set Total votes of player") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().setTotal(sender, args[1],
args[2], Integer.parseInt(args[3]));
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] {
"VoteSite", "(sitename)", "SetServiceSite", "(string)" },
"VotingPlugin.Commands.AdminVote.VoteSite.Edit",
"Set VoteSite SerivceSite") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().setVoteSiteServiceSite(sender,
args[1], args[3]);
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] {
"VoteSite", "(sitename)", "SetVoteURL", "(string)" },
"VotingPlugin.Commands.AdminVote.VoteSite.Edit",
"Set VoteSite VoteURL") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().setVoteSiteVoteURL(sender,
args[1], args[3]);
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] {
"VoteSite", "(sitename)", "SetPriority", "(number)" },
"VotingPlugin.Commands.AdminVote.VoteSite.Edit",
"Set VoteSite Priority") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().setVoteSitePriority(sender,
args[1], Integer.parseInt(args[3]));
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] {
"VoteSite", "(sitename)", "SetVoteDelay", "(number)" },
"VotingPlugin.Commands.AdminVote.VoteSite.Edit",
"Set VoteSite VoteDelay") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().setVoteSiteVoteDelay(sender,
args[1], Integer.parseInt(args[3]));
}
});
plugin.adminVoteCommand.add(new CommandHandler(
new String[] { "UpdateCheck" },
"VotingPlugin.Commands.AdminVote.UpdateCheck",
"Check for update") {
@Override
public void execute(CommandSender sender, String[] args) {
Bukkit.getScheduler().runTaskAsynchronously(plugin,
new Runnable() {
@Override
public void run() {
sender.sendMessage(Utils.getInstance()
.colorize("&cChecking for update..."));
CommandAdminVote.getInstance().checkUpdate(
sender);
}
});
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] {
"VoteSite", "(sitename)", "SetEnabled", "(boolean)" },
"VotingPlugin.Commands.AdminVote.VoteSite.Edit",
"Set VoteSite Enabled") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().setVoteSiteEnabled(sender,
args[1], Boolean.parseBoolean(args[3]));
}
});
plugin.adminVoteCommand.add(new CommandHandler(new String[] {
"VoteSite", "(sitename)", "Check" },
"VotingPlugin.Commands.AdminVote.VoteSite.Check",
"Check to see if VoteSite is valid") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandAdminVote.getInstance().checkVoteSite(sender, args[1]);
}
});
}
public void loadAliases() {
commands = new HashMap<String, CommandHandler>();
for (CommandHandler cmdHandle : plugin.voteCommand) {
if (cmdHandle.getArgs().length > 0) {
String[] args = cmdHandle.getArgs()[0].split("&");
for (String arg : args) {
try {
plugin.getCommand("vote" + arg).setExecutor(
new CommandAliases(cmdHandle));
plugin.getCommand("vote" + arg).setTabCompleter(
new AliasesTabCompleter()
.setCMDHandle(cmdHandle));
} catch (Exception ex) {
plugin.debug("Failed to load command and tab completer for /vote"
+ arg);
}
}
}
}
for (CommandHandler cmdHandle : plugin.adminVoteCommand) {
if (cmdHandle.getArgs().length > 0) {
String[] args = cmdHandle.getArgs()[0].split("&");
for (String arg : args) {
try {
plugin.getCommand("adminvote" + arg).setExecutor(
new CommandAliases(cmdHandle));
plugin.getCommand("adminvote" + arg).setTabCompleter(
new AliasesTabCompleter()
.setCMDHandle(cmdHandle));
} catch (Exception ex) {
plugin.debug("Failed to load command and tab completer for /adminvote"
+ arg);
}
}
}
}
}
public void loadCommands() {
loadAdminVoteCommand();
loadVoteCommand();
}
private void loadVoteCommand() {
plugin.voteCommand = new ArrayList<CommandHandler>();
plugin.voteCommand.add(new CommandHandler(new String[] { "Help&?" },
"VotingPlugin.Commands.Vote.Help", "View this page") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().help(sender);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "URL" },
"VotingPlugin.Commands.Vote.URL", "Open VoteURL GUI") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().voteURL(sender);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Reward" },
"VotingPlugin.Commands.Vote.Reward", "Open VoteReward GUI") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().voteReward(sender, "");
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Reward",
"(SiteName)" }, "VotingPlugin.Commands.Vote.Reward",
"Open VoteURL GUI for VoteSIte") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().voteReward(sender, args[1]);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Info" },
"VotingPlugin.Commands.Vote.Info", "See player info") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().infoSelf(sender);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Info",
"(player)" }, "VotingPlugin.Commands.Vote.Info.Other",
"See other players info") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().infoOther(sender, args[1]);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Last",
"(player)" }, "VotingPlugin.Commands.Vote.Last.Other",
"See other players last votes") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().lastOther(sender, args[1]);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Last" },
"VotingPlugin.Commands.Vote.Last", "See your last votes") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().lastSelf(sender);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Next",
"(player)" }, "VotingPlugin.Commands.Vote.Next.Other",
"See other players next votes") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().nextOther(sender, args[1]);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Points",
"(player)" }, "VotingPlugin.Commands.Vote.Points.Other",
"View pints of other player") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance()
.pointsOther(sender, new User(args[1]));
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Points", },
"VotingPlugin.Commands.Vote.Points", "View your points") {
@Override
public void execute(CommandSender sender, String[] args) {
if (sender instanceof Player) {
CommandVote.getInstance().pointsSelf(
new User((Player) sender));
} else {
sender.sendMessage("Must be a player to use this!");
}
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Next" },
"VotingPlugin.Commands.Vote.Next", "See your next votes") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().nextSelf(sender);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "GUI" },
"VotingPlugin.Commands.Vote.GUI", "Open VoteGUI") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().voteGUI(sender);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Top" },
"VotingPlugin.Commands.Vote.Top", "Open list of Top Voters") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().topVoterMonthly(sender, 1);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Top",
"(number)" }, "VotingPlugin.Commands.Vote.Top",
"Open page of Top Voters") {
@Override
public void execute(CommandSender sender, String[] args) {
if (Utils.getInstance().isInt(args[1])) {
CommandVote.getInstance().topVoterMonthly(sender,
Integer.parseInt(args[1]));
} else {
sender.sendMessage(Utils.getInstance().colorize(
"&cError on " + args[1] + ", number expected"));
}
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Top",
"(number)", "Monthly" },
"VotingPlugin.Commands.Vote.Top.Monthly",
"Open page of Top Voters") {
@Override
public void execute(CommandSender sender, String[] args) {
if (Utils.getInstance().isInt(args[1])) {
CommandVote.getInstance().topVoterMonthly(sender,
Integer.parseInt(args[1]));
} else {
sender.sendMessage(Utils.getInstance().colorize(
"&cError on " + args[1] + ", number expected"));
}
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Top",
"(number)", "Weekly" },
"VotingPlugin.Commands.Vote.Top.Weekly",
"Open page of Top Voters") {
@Override
public void execute(CommandSender sender, String[] args) {
if (Utils.getInstance().isInt(args[1])) {
CommandVote.getInstance().topVoterWeekly(sender,
Integer.parseInt(args[1]));
} else {
sender.sendMessage(Utils.getInstance().colorize(
"&cError on " + args[1] + ", number expected"));
}
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Top",
"(number)", "Daily" }, "VotingPlugin.Commands.Vote.Top.Daily",
"Open page of Top Voters") {
@Override
public void execute(CommandSender sender, String[] args) {
if (Utils.getInstance().isInt(args[1])) {
CommandVote.getInstance().topVoterDaily(sender,
Integer.parseInt(args[1]));
} else {
sender.sendMessage(Utils.getInstance().colorize(
"&cError on " + args[1] + ", number expected"));
}
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Party" },
"VotingPlugin.Commands.Vote.Party",
"View current amount of votes and how many more needed") {
@Override
public void execute(CommandSender sender, String[] args) {
VoteParty.getInstance().commandVoteParty(sender);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Today",
"(number)" }, "VotingPlugin.Commands.Vote.Today",
"Open page of who Voted Today") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().today(sender,
Integer.parseInt(args[1]));
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Today" },
"VotingPlugin.Commands.Vote.Today",
"View who list of who voted today") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().today(sender, 1);
}
});
plugin.voteCommand.add(new CommandHandler(
new String[] { "Total", "All" },
"VotingPlugin.Commands.Vote.Total.All",
"View server total votes") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().totalAll(sender);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Total",
"(player)" }, "VotingPlugin.Commands.Vote.Total.Other",
"View other players total votes") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().totalOther(sender, args[1]);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] { "Total" },
"VotingPlugin.Commands.Vote.Total", "View your total votes") {
@Override
public void execute(CommandSender sender, String[] args) {
CommandVote.getInstance().totalSelf(sender);
}
});
plugin.voteCommand.add(new CommandHandler(new String[] {}, "",
"See voting URLs") {
@Override
public void execute(CommandSender sender, String[] args) {
if (!Config.getInstance().getVoteURLDefault()) {
CommandVote.getInstance().voteURLs(sender);
} else {
CommandVote.getInstance().voteURL(sender);
}
}
});
}
public void setCommands(HashMap<String, CommandHandler> commands) {
this.commands = commands;
}
}
File diff suppressed because it is too large. Load diff
@@ -1,359 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Commands.Executers;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Bungee.BungeeVote;
import com.Ben12345rocks.VotingPlugin.Commands.Commands;
import com.Ben12345rocks.VotingPlugin.Config.Config;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Config.ConfigOtherRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
import com.Ben12345rocks.VotingPlugin.Data.Data;
import com.Ben12345rocks.VotingPlugin.Data.ServerData;
import com.Ben12345rocks.VotingPlugin.Events.VotiferEvent;
import com.Ben12345rocks.VotingPlugin.Objects.CommandHandler;
import com.Ben12345rocks.VotingPlugin.Objects.User;
import com.Ben12345rocks.VotingPlugin.Objects.VoteSite;
import com.Ben12345rocks.VotingPlugin.TopVoter.TopVoter;
import com.Ben12345rocks.VotingPlugin.Updater.Updater;
import com.vexsoftware.votifier.model.Vote;
public class CommandAdminVote implements CommandExecutor {
private static CommandAdminVote instance = new CommandAdminVote();
public static CommandAdminVote getInstance() {
return instance;
}
ConfigOtherRewards bonusReward = ConfigOtherRewards.getInstance();
Config config = Config.getInstance();
ConfigFormat format = ConfigFormat.getInstance();
private Main plugin = Main.plugin;
ConfigVoteSites voteSites = ConfigVoteSites.getInstance();
private CommandAdminVote() {
}
public CommandAdminVote(Main plugin) {
this.plugin = plugin;
}
public void checkUpdate(CommandSender sender) {
plugin.updater = new Updater(plugin, 15358, false);
final Updater.UpdateResult result = plugin.updater.getResult();
switch (result) {
case FAIL_SPIGOT: {
sender.sendMessage(Utils.getInstance().colorize(
"&cFailed to check for update for &c&l" + plugin.getName()
+ "&c!"));
break;
}
case NO_UPDATE: {
sender.sendMessage(Utils.getInstance().colorize(
"&c&l" + plugin.getName()
+ " &cis up to date! Version: &c&l"
+ plugin.updater.getVersion()));
break;
}
case UPDATE_AVAILABLE: {
sender.sendMessage(Utils.getInstance().colorize(
"&c&l" + plugin.getName()
+ " &chas an update available! Your Version: &c&l"
+ plugin.getDescription().getVersion()
+ " &cNew Version: &c&l"
+ plugin.updater.getVersion()));
break;
}
default: {
break;
}
}
}
public void checkVoteSite(CommandSender sender, String siteName) {
if (!ConfigVoteSites.getInstance().isServiceSiteGood(siteName)) {
sender.sendMessage(Utils.getInstance().colorize(
"&cServiceSite is invalid, votes may not work properly"));
} else {
sender.sendMessage(Utils.getInstance().colorize(
"&aServiceSite is properly setup"));
}
if (!ConfigVoteSites.getInstance().isVoteURLGood(siteName)) {
sender.sendMessage(Utils.getInstance().colorize(
"&cVoteURL is invalid"));
} else {
sender.sendMessage(Utils.getInstance().colorize(
"&aVoteURL is properly setup"));
}
}
public void createVoteSite(CommandSender sender, String voteSite) {
sender.sendMessage(Utils.getInstance().colorize(
"&cCreating VoteSite..."));
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
ConfigVoteSites.getInstance().generateVoteSite(voteSite);
sender.sendMessage(Utils.getInstance().colorize(
"&cCreated VoteSite: &c&l" + voteSite));
}
});
}
public void help(CommandSender sender, int page) {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendJson(Commands.getInstance().adminHelp(sender, page - 1));
} else {
sender.sendMessage(Utils.getInstance()
.convertArray(
Utils.getInstance().comptoString(
Commands.getInstance().adminHelp(sender,
page - 1))));
}
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) {
for (CommandHandler commandHandler : plugin.adminVoteCommand) {
if (commandHandler.runCommand(sender, args)) {
return true;
}
}
// invalid command
sender.sendMessage(ChatColor.RED
+ "No valid arguments, see /adminvote help!");
return true;
}
public void permList(CommandSender sender) {
sender.sendMessage(Commands.getInstance().listPerms());
}
public void reload(CommandSender sender) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
sender.sendMessage(ChatColor.RED + "Reloading "
+ plugin.getName() + "...");
plugin.reload();
sender.sendMessage(ChatColor.RED + plugin.getName() + " v"
+ plugin.getDescription().getVersion() + " reloaded!");
}
});
}
public void resetPlayerTotals(CommandSender sender, String playerName) {
sender.sendMessage(Utils.getInstance().colorize(
"&cResseting totals for player &c&l" + playerName));
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
TopVoter.getInstance().resetTotalsPlayer(new User(playerName));
sender.sendMessage(Utils.getInstance().colorize(
"&cDone resseting totals for &c&l" + playerName));
plugin.update();
}
});
}
public void resetTotals(CommandSender sender) {
sender.sendMessage(Utils.getInstance().colorize(
"&cResseting totals for all players..."));
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
TopVoter.getInstance().resetTotalsMonthly();
sender.sendMessage(Utils.getInstance().colorize(
"&cDone resseting totals"));
plugin.update();
}
});
}
public void reward(CommandSender sender, String reward) {
sender.sendMessage(Commands.getInstance().voteCommandRewardInfo(reward));
}
public void rewards(CommandSender sender) {
sender.sendMessage(Commands.getInstance().voteCommandRewards());
}
public void setConfigAllowUnjoined(CommandSender sender, boolean value) {
Config.getInstance().setAllowUnJoined(value);
sender.sendMessage(Utils.getInstance().colorize(
"&cSet AllowUnjoined to &c&l" + value));
}
public void setConfigBroadcastVote(CommandSender sender, boolean value) {
Config.getInstance().setDebugEnabled(value);
sender.sendMessage(Utils.getInstance().colorize(
"&cSet BroadcastVote to &c&l" + value));
}
public void setConfigDebug(CommandSender sender, boolean value) {
Config.getInstance().setDebugEnabled(value);
sender.sendMessage(Utils.getInstance().colorize(
"&cSet Debug to &c&l" + value));
}
public void setConfigEnableTopVoterAwards(CommandSender sender,
boolean value) {
Config.getInstance().setTopVoterAwardsEnabled(value);
sender.sendMessage(Utils.getInstance().colorize(
"&cSet DisableTopVoterAwards to &c&l" + value));
}
public void setServerDataPrevMonth(CommandSender sender, int month) {
ServerData.getInstance().setPrevMonth(month);
sender.sendMessage(Utils.getInstance().colorize(
"&cSet PreMonth to &c&l" + month));
}
public void setTotal(CommandSender sender, String playerName,
String voteSite, int amount) {
Data.getInstance().setTotal(new User(playerName), voteSite, amount);
sender.sendMessage(ChatColor.GREEN + playerName + " total votes for "
+ voteSite + " has been set to " + amount);
plugin.update();
}
public void setVoteSiteEnabled(CommandSender sender, String voteSite,
boolean value) {
ConfigVoteSites.getInstance().setEnabled(voteSite, value);
sender.sendMessage(Utils.getInstance().colorize(
"&cSet votesite " + voteSite + " enabled to " + value));
}
public void setVoteSitePriority(CommandSender sender, String voteSite,
int value) {
ConfigVoteSites.getInstance().setPriority(voteSite, value);
sender.sendMessage(Utils.getInstance().colorize(
"&cSet priortiy to &c&l" + value + "&c on &c&l" + voteSite));
}
public void setVoteSiteServiceSite(CommandSender sender, String voteSite,
String serviceSite) {
ConfigVoteSites.getInstance().setServiceSite(voteSite, serviceSite);
sender.sendMessage(Utils.getInstance().colorize(
"&cSet ServiceSite to &c&l" + serviceSite + "&c on &c&l"
+ voteSite));
}
public void setVoteSiteVoteDelay(CommandSender sender, String voteSite,
int delay) {
ConfigVoteSites.getInstance().setVoteDelay(voteSite, delay);
sender.sendMessage(Utils.getInstance().colorize(
"&cSet VoteDelay to &c&l" + delay + "&c on &c&l" + voteSite));
}
public void setVoteSiteVoteURL(CommandSender sender, String voteSite,
String url) {
ConfigVoteSites.getInstance().setVoteURL(voteSite, url);
sender.sendMessage(Utils.getInstance().colorize(
"&cSet VoteURL to &c&l" + url + "&c on &c&l" + voteSite));
}
public void site(CommandSender sender, String site) {
sender.sendMessage(Commands.getInstance().voteCommandSiteInfo(site));
}
public void sites(CommandSender sender) {
sender.sendMessage(Commands.getInstance().voteCommandSites());
}
public void uuid(CommandSender sender, String playerName) {
sender.sendMessage(ChatColor.GREEN + "UUID of player "
+ ChatColor.DARK_GREEN + playerName + ChatColor.GREEN + " is: "
+ Utils.getInstance().getUUID(playerName));
}
public void version(CommandSender sender) {
if (sender instanceof Player) {
Player player = (Player) sender;
player.performCommand("bukkit:version " + plugin.getName());
} else {
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(),
"bukkit:version " + plugin.getName());
}
}
public void Vote(CommandSender sender, String playerName, String voteSite) {
VotiferEvent.playerVote(playerName, voteSite);
Vote vote = new com.vexsoftware.votifier.model.Vote();
vote.setServiceName(new VoteSite(voteSite).getServiceSite());
vote.setUsername(playerName);
try {
BungeeVote.getInstance().sendVote(vote);
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
e.printStackTrace();
}
}
}
@@ -1,82 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Commands.Executers;
import java.util.ArrayList;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Objects.CommandHandler;
public class CommandAliases implements CommandExecutor {
private Main plugin = Main.plugin;
private CommandHandler cmdHandle;
public CommandAliases(CommandHandler cmdHandle) {
this.cmdHandle = cmdHandle;
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) {
ArrayList<String> argsNew = new ArrayList<String>();
argsNew.add(cmdHandle.getArgs()[0]);
for (String arg : args) {
argsNew.add(arg);
}
plugin.debug("Attempting cmd...");
plugin.debug("Inputed args: "
+ Utils.getInstance().makeStringList(argsNew));
ArrayList<CommandHandler> cmdHandlers = new ArrayList<CommandHandler>();
cmdHandlers.addAll(plugin.voteCommand);
cmdHandlers.addAll(plugin.adminVoteCommand);
for (CommandHandler cmdHandle : cmdHandlers) {
if (cmdHandle.getArgs().length > args.length) {
for (String arg : cmdHandle.getArgs()[0].split("&")) {
if (cmd.getName().equalsIgnoreCase("vote" + arg)
|| cmd.getName()
.equalsIgnoreCase("adminvote" + arg)) {
argsNew.set(0, arg);
boolean argsMatch = true;
for (int i = 0; i < argsNew.size(); i++) {
if (i < cmdHandle.getArgs().length) {
if (!cmdHandle.argsMatch(argsNew.get(i), i)) {
argsMatch = false;
}
}
}
if (argsMatch) {
if (cmdHandle.runCommand(sender, Utils
.getInstance().convertArray(argsNew))) {
plugin.debug("cmd found, ran cmd");
return true;
}
}
}
}
}
}
/*
* for (String arg : cmdHandle.getArgs()[0].split("&")) { argsNew.set(0,
* arg); if (cmdHandle.runCommand(sender,
* Utils.getInstance().convertArray(argsNew))) {
* plugin.debug("cmd found, ran cmd"); return true; } }
*/
// invalid command
sender.sendMessage(ChatColor.RED
+ "No valid arguments, see /vote help!");
return true;
}
}
@@ -1,358 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Commands.Executers;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Commands.Commands;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Objects.CommandHandler;
import com.Ben12345rocks.VotingPlugin.Objects.User;
import com.Ben12345rocks.VotingPlugin.TopVoter.TopVoter;
public class CommandVote implements CommandExecutor {
private static CommandVote instance = new CommandVote();
private static Main plugin;
public static CommandVote getInstance() {
return instance;
}
private CommandVote() {
}
public CommandVote(Main plugin) {
CommandVote.plugin = plugin;
}
public void help(CommandSender sender) {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendJson(Commands.getInstance().voteHelpText(sender));
} else {
sender.sendMessage(Utils.getInstance().convertArray(
Utils.getInstance().comptoString(
Commands.getInstance().voteHelpText(sender))));
}
}
public void infoOther(CommandSender sender, String playerName) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendMessage(Utils.getInstance().colorize(
"&cGetting player info..."));
user.sendMessage(Commands.getInstance().playerInfo(
new User(playerName)));
} else {
sender.sendMessage(Utils.getInstance().colorize(
Commands.getInstance().playerInfo(
new User(playerName))));
}
}
});
}
public void infoSelf(CommandSender sender) {
if (sender instanceof Player) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
User user = new User((Player) sender);
user.sendMessage(Utils.getInstance().colorize(
"&cGetting info..."));
user.sendMessage(Commands.getInstance().playerInfo(
new User(sender.getName())));
}
});
} else {
sender.sendMessage("You must be a player to do this!");
}
}
public void lastOther(CommandSender sender, String playerName) {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendMessage(Commands.getInstance().voteCommandLast(
new User(playerName)));
} else {
sender.sendMessage(Utils.getInstance().colorize(
Commands.getInstance()
.voteCommandLast(new User(playerName))));
}
}
public void lastSelf(CommandSender sender) {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendMessage(Commands.getInstance().voteCommandLast(user));
} else {
sender.sendMessage("You must be a player to do this!");
}
}
public void nextOther(CommandSender sender, String playerName) {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendMessage(Commands.getInstance().voteCommandNext(
new User(playerName)));
} else {
sender.sendMessage(Utils.getInstance().colorize(
Commands.getInstance()
.voteCommandNext(new User(playerName))));
}
}
public void nextSelf(CommandSender sender) {
if (sender instanceof Player) {
String playerName = sender.getName();
User user = new User(playerName);
user.sendMessage(Commands.getInstance().voteCommandNext(user));
} else {
sender.sendMessage("You must be a player to do this!");
}
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) {
for (CommandHandler commandHandler : plugin.voteCommand) {
if (commandHandler.runCommand(sender, args)) {
return true;
}
}
// invalid command
sender.sendMessage(ChatColor.RED
+ "No valid arguments, see /vote help!");
return true;
}
public void today(CommandSender sender, int page) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendMessage(Commands.getInstance().commandVoteToday(
page));
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
Commands.getInstance().sendVoteTodayScoreBoard(
(Player) sender, page);
}
});
} else {
sender.sendMessage(Commands.getInstance().commandVoteToday(
page));
}
}
});
}
public void pointsSelf(User user) {
String msg = ConfigFormat.getInstance().getCommandVotePoints()
.replace("%Player%", user.getPlayerName())
.replace("%Points%", "" + user.getPoints());
user.sendMessage(msg);
}
public void pointsOther(CommandSender sender, User user) {
String msg = ConfigFormat.getInstance().getCommandVotePoints()
.replace("%Player%", user.getPlayerName())
.replace("%Points%", "" + user.getPoints());
if (sender instanceof Player) {
new User(sender.getName()).sendMessage(msg);
} else {
sender.sendMessage(Utils.getInstance().colorize(msg));
}
}
public void topVoterDaily(CommandSender sender, int page) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendMessage(TopVoter.getInstance().topVoterDaily(page));
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
Commands.getInstance().sendTopVoterDailyScoreBoard(
(Player) sender, page);
}
});
} else {
sender.sendMessage(TopVoter.getInstance().topVoterDaily(
page));
}
}
});
}
public void topVoterMonthly(CommandSender sender, int page) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendMessage(TopVoter.getInstance().topVoterMonthly(
page));
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
Commands.getInstance()
.sendTopVoterMonthlyScoreBoard(
(Player) sender, page);
}
});
} else {
sender.sendMessage(TopVoter.getInstance().topVoterMonthly(
page));
}
}
});
}
public void topVoterWeekly(CommandSender sender, int page) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendMessage(TopVoter.getInstance()
.topVoterWeekly(page));
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
Commands.getInstance()
.sendTopVoterWeeklyScoreBoard(
(Player) sender, page);
}
});
} else {
sender.sendMessage(TopVoter.getInstance().topVoterWeekly(
page));
}
}
});
}
public void totalAll(CommandSender sender) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendMessage(Commands.getInstance()
.voteCommandTotalAll());
} else {
sender.sendMessage(Commands.getInstance()
.voteCommandTotalAll());
}
}
});
}
public void totalOther(CommandSender sender, String playerName) {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendMessage(Commands.getInstance().voteCommandTotal(
new User(playerName)));
} else {
sender.sendMessage(Utils.getInstance().colorize(
Commands.getInstance().voteCommandTotal(
new User(playerName))));
}
}
public void totalSelf(CommandSender sender) {
if (sender instanceof Player) {
String playerName = sender.getName();
User user = new User(playerName);
user.sendMessage(Commands.getInstance().voteCommandTotal(user));
} else {
sender.sendMessage("You must be a player to do this!");
}
}
public void voteGUI(CommandSender sender) {
if (sender instanceof Player) {
Commands.getInstance().openVoteGUI((Player) sender);
} else {
sender.sendMessage("Must be a player to do this!");
}
}
public void voteReward(CommandSender sender, String siteName) {
if (sender instanceof Player) {
Commands.getInstance().voteReward((Player) sender, siteName);
} else {
sender.sendMessage("Must be a player to do this!");
}
}
public void voteURL(CommandSender sender) {
if (sender instanceof Player) {
Commands.getInstance().voteURL((Player) sender);
} else {
sender.sendMessage("Must be a player to do this!");
}
}
public void voteURLs(CommandSender sender) {
if (sender instanceof Player) {
User user = new User((Player) sender);
user.sendMessage(Commands.getInstance().voteURLs());
} else {
sender.sendMessage(Commands.getInstance().voteURLs());
}
}
}
@@ -1,116 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Commands.TabCompleter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.ConfigRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
import com.Ben12345rocks.VotingPlugin.Objects.CommandHandler;
public class AdminVoteTabCompleter implements TabCompleter {
Main plugin = Main.plugin;
public ArrayList<String> getAdminTabCompleteOptions(CommandSender sender,
String[] args, int argNum) {
ArrayList<String> cmds = new ArrayList<String>();
for (CommandHandler commandHandler : plugin.adminVoteCommand) {
if (sender.hasPermission(commandHandler.getPerm())) {
String[] cmdArgs = commandHandler.getArgs();
if (cmdArgs.length > argNum) {
boolean argsMatch = true;
for (int i = 0; i < argNum; i++) {
if (args.length >= i) {
if (!commandHandler.argsMatch(args[i], i)) {
argsMatch = false;
}
}
}
if (argsMatch) {
String[] cmdArgsList = cmdArgs[argNum].split("&");
for (String arg : cmdArgsList) {
if (arg.equalsIgnoreCase("(player)")) {
for (Object playerOb : Bukkit
.getOnlinePlayers().toArray()) {
Player player = (Player) playerOb;
if (!cmds.contains(player.getName())) {
cmds.add(player.getName());
}
}
} else if (arg.equalsIgnoreCase("(sitename)")) {
for (String siteName : ConfigVoteSites
.getInstance().getVoteSitesNames()) {
if (!cmds.contains(siteName)) {
cmds.add(siteName);
}
}
} else if (arg.equalsIgnoreCase("(reward0")) {
for (String reward : ConfigRewards
.getInstance().getRewardNames()) {
if (!cmds.contains(reward)) {
cmds.add(reward);
}
}
} else if (arg.equalsIgnoreCase("(boolean)")) {
if (!cmds.contains("True")) {
cmds.add("True");
}
if (!cmds.contains("False")) {
cmds.add("False");
}
} else if (arg.equalsIgnoreCase("(number)")) {
} else if (!cmds.contains(arg)) {
cmds.add(arg);
}
}
}
}
}
}
Collections.sort(cmds, String.CASE_INSENSITIVE_ORDER);
return cmds;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command cmd,
String alias, String[] args) {
if (cmd.getName().equalsIgnoreCase("adminvote")
|| cmd.getName().equalsIgnoreCase("av")) {
List<String> tab = new ArrayList<String>();
ArrayList<String> cmds = new ArrayList<String>();
cmds.addAll(getAdminTabCompleteOptions(sender, args,
args.length - 1));
for (int i = 0; i < cmds.size(); i++) {
if (Utils.getInstance().startsWithIgnoreCase(cmds.get(i),
args[args.length - 1])) {
tab.add(cmds.get(i));
}
}
return tab;
}
return null;
}
}
@@ -1,145 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Commands.TabCompleter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.ConfigRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
import com.Ben12345rocks.VotingPlugin.Objects.CommandHandler;
public class AliasesTabCompleter implements TabCompleter {
Main plugin = Main.plugin;
public CommandHandler cmdHandle;
public ArrayList<String> getTabCompleteOptions(CommandSender sender,
String[] args, int argNum, CommandHandler cmdHandle) {
ArrayList<String> cmds = new ArrayList<String>();
if (sender.hasPermission(cmdHandle.getPerm())) {
String[] cmdArgs = cmdHandle.getArgs();
if (cmdArgs.length > argNum) {
boolean argsMatch = true;
for (int i = 0; i < argNum; i++) {
if (args.length >= i) {
if (!cmdHandle.argsMatch(args[i], i)) {
argsMatch = false;
}
}
}
if (argsMatch) {
if (cmdArgs[argNum].equalsIgnoreCase("(player)")) {
for (Object playerOb : Bukkit.getOnlinePlayers()
.toArray()) {
Player player = (Player) playerOb;
if (!cmds.contains(player.getName())) {
cmds.add(player.getName());
}
}
} else if (cmdArgs[argNum].equalsIgnoreCase("(reward)")) {
for (String reward : ConfigRewards.getInstance()
.getRewardNames()) {
if (!cmds.contains(reward)) {
cmds.add(reward);
}
}
} else if (cmdArgs[argNum].equalsIgnoreCase("(sitename)")) {
for (String siteName : ConfigVoteSites.getInstance()
.getVoteSitesNames()) {
if (!cmds.contains(siteName)) {
cmds.add(siteName);
}
}
} else if (cmdArgs[argNum].equalsIgnoreCase("(boolean)")) {
if (!cmds.contains("True")) {
cmds.add("True");
}
if (!cmds.contains("False")) {
cmds.add("False");
}
} else if (cmdArgs[argNum].equalsIgnoreCase("(number)")) {
} else if (!cmds.contains(cmdArgs[argNum])) {
cmds.add(cmdArgs[argNum]);
}
}
}
}
Collections.sort(cmds, String.CASE_INSENSITIVE_ORDER);
return cmds;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command cmd,
String alias, String[] argsIn) {
ArrayList<String> msgArray = new ArrayList<String>();
msgArray.add("");
for (String arg : argsIn) {
msgArray.add(arg);
}
String[] args = Utils.getInstance().convertArray(msgArray);
ArrayList<String> tab = new ArrayList<String>();
ArrayList<String> cmds = new ArrayList<String>();
ArrayList<CommandHandler> cmdHandlers = new ArrayList<CommandHandler>();
cmdHandlers.addAll(plugin.voteCommand);
cmdHandlers.addAll(plugin.adminVoteCommand);
for (CommandHandler cmdHandle : cmdHandlers) {
if (cmdHandle.getArgs().length >= argsIn.length) {
for (String arg : cmdHandle.getArgs()[0].split("&")) {
if (cmd.getName().equalsIgnoreCase("vote" + arg)
|| cmd.getName()
.equalsIgnoreCase("adminvote" + arg)) {
// plugin.debug("Found cmd... attempting to get tab complete");
args[0] = arg;
boolean argsMatch = true;
for (int i = 0; i < argsIn.length; i++) {
if (args.length >= i) {
if (!cmdHandle.argsMatch(args[i], i)) {
argsMatch = false;
}
}
}
if (argsMatch) {
cmds.addAll(getTabCompleteOptions(sender, args,
argsIn.length, cmdHandle));
}
}
}
}
}
for (int i = 0; i < cmds.size(); i++) {
if (Utils.getInstance().startsWithIgnoreCase(cmds.get(i),
args[argsIn.length])) {
tab.add(cmds.get(i));
}
}
return tab;
}
public AliasesTabCompleter setCMDHandle(CommandHandler cmd) {
cmdHandle = cmd;
return this;
}
}
@@ -1,115 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Commands.TabCompleter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.ConfigRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
import com.Ben12345rocks.VotingPlugin.Objects.CommandHandler;
public class VoteTabCompleter implements TabCompleter {
Main plugin = Main.plugin;
public ArrayList<String> getTabCompleteOptions(CommandSender sender,
String[] args, int argNum) {
ArrayList<String> cmds = new ArrayList<String>();
for (CommandHandler commandHandler : plugin.voteCommand) {
if (sender.hasPermission(commandHandler.getPerm())) {
String[] cmdArgs = commandHandler.getArgs();
if (cmdArgs.length > argNum) {
boolean argsMatch = true;
for (int i = 0; i < argNum; i++) {
if (args.length >= i) {
if (!commandHandler.argsMatch(args[i], i)) {
argsMatch = false;
}
}
}
if (argsMatch) {
String[] cmdArgsList = cmdArgs[argNum].split("&");
for (String arg : cmdArgsList) {
if (arg.equalsIgnoreCase("(player)")) {
for (Object playerOb : Bukkit
.getOnlinePlayers().toArray()) {
Player player = (Player) playerOb;
if (!cmds.contains(player.getName())) {
cmds.add(player.getName());
}
}
} else if (arg.equalsIgnoreCase("(sitename)")) {
for (String siteName : ConfigVoteSites
.getInstance().getVoteSitesNames()) {
if (!cmds.contains(siteName)) {
cmds.add(siteName);
}
}
} else if (arg.equalsIgnoreCase("(reward)")) {
for (String reward : ConfigRewards
.getInstance().getRewardNames()) {
if (!cmds.contains(reward)) {
cmds.add(reward);
}
}
} else if (arg.equalsIgnoreCase("(boolean)")) {
if (!cmds.contains("True")) {
cmds.add("True");
}
if (!cmds.contains("False")) {
cmds.add("False");
}
} else if (arg.equalsIgnoreCase("(number)")) {
} else if (!cmds.contains(arg)) {
cmds.add(arg);
}
}
}
}
}
}
Collections.sort(cmds, String.CASE_INSENSITIVE_ORDER);
return cmds;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command cmd,
String alias, String[] args) {
if (cmd.getName().equalsIgnoreCase("vote")
|| cmd.getName().equalsIgnoreCase("v")) {
ArrayList<String> tab = new ArrayList<String>();
ArrayList<String> cmds = new ArrayList<String>();
cmds.addAll(getTabCompleteOptions(sender, args, args.length - 1));
for (int i = 0; i < cmds.size(); i++) {
if (Utils.getInstance().startsWithIgnoreCase(cmds.get(i),
args[args.length - 1])) {
tab.add(cmds.get(i));
}
}
return tab;
}
return null;
}
}
@@ -1,180 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Config;
import java.io.File;
import java.io.IOException;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Files.Files;
public class Config {
static Config instance = new Config();
static Main plugin = Main.plugin;
public static Config getInstance() {
return instance;
}
FileConfiguration data;
File dFile;
private Config() {
}
public Config(Main plugin) {
Config.plugin = plugin;
}
public boolean allowUnJoined() {
return getData().getBoolean("AllowUnjoined");
}
public boolean getAutoCreateVoteSites() {
return getData().getBoolean("AutoCreateVoteSites");
}
public int getBackgroundTaskDelay() {
int num = getData().getInt("BackgroundTaskDelay");
if (num == 0) {
num = 600;
}
return num;
}
public boolean getBroadCastVotesEnabled() {
return getData().getBoolean("BroadcastVote");
}
public FileConfiguration getData() {
return data;
}
public boolean getDebugEnabled() {
return getData().getBoolean("Debug");
}
public int getEffectData() {
return getData().getInt("Effect.Data");
}
public String getEffectEffect() {
return getData().getString("Effect.Effect");
}
public boolean getEffectEnabled() {
return getData().getBoolean("Effect.Enabled");
}
public int getEffectParticles() {
return getData().getInt("Effect.Particles");
}
public int getEffectRadius() {
return getData().getInt("Effect.Radius");
}
public boolean getSendScoreboards() {
return getData().getBoolean("SendScoreboards");
}
public boolean getSoundEnabled() {
return getData().getBoolean("Sound.Enabled");
}
public float getSoundPitch() {
return (float) getData().getDouble("Sound.Pitch");
}
public String getSoundSound() {
return getData().getString("Sound.Sound");
}
public float getSoundVolume() {
return (float) getData().getDouble("Sound.Volume");
}
public boolean getTitleEnabled() {
return getData().getBoolean("Title.Enabled");
}
public int getTitleFadeIn() {
return getData().getInt("Title.FadeIn");
}
public int getTitleFadeOut() {
return getData().getInt("Title.FadeOut");
}
public int getTitleShowTime() {
return getData().getInt("Title.ShowTime");
}
public String getTitleSubTitle() {
return getData().getString("Title.SubTitle");
}
public String getTitleTitle() {
return getData().getString("Title.Title");
}
public boolean getVoteURLDefault() {
return getData().getBoolean("VoteURLDefault");
}
public void reloadData() {
data = YamlConfiguration.loadConfiguration(dFile);
}
public void saveData() {
Files.getInstance().editFile(dFile, data);
}
public void setAllowUnJoined(boolean value) {
getData().set("AllowUnjoined", value);
saveData();
}
public void setBroadcastVoteEnabled(boolean value) {
getData().set("BroadcastVote", value);
saveData();
}
public void setDebugEnabled(boolean value) {
getData().set("Debug", value);
saveData();
}
public void setTopVoterAwardsEnabled(boolean value) {
getData().set("TopVoterAwards", value);
saveData();
}
public void setup(Plugin p) {
if (!p.getDataFolder().exists()) {
p.getDataFolder().mkdir();
}
dFile = new File(p.getDataFolder(), "Config.yml");
if (!dFile.exists()) {
try {
dFile.createNewFile();
plugin.saveResource("Config.yml", true);
} catch (IOException e) {
Bukkit.getServer().getLogger()
.severe(ChatColor.RED + "Could not create Config.yml!");
}
}
data = YamlConfiguration.loadConfiguration(dFile);
}
}
@@ -1,95 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Config;
import java.io.File;
import java.io.IOException;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Files.Files;
public class ConfigBungeeVoting {
static ConfigBungeeVoting instance = new ConfigBungeeVoting();
static Main plugin = Main.plugin;
public static ConfigBungeeVoting getInstance() {
return instance;
}
FileConfiguration data;
File dFile;
private ConfigBungeeVoting() {
}
public ConfigBungeeVoting(Main plugin) {
ConfigBungeeVoting.plugin = plugin;
}
public FileConfiguration getData() {
return data;
}
public boolean getEnabled() {
return getData().getBoolean("Enabled");
}
public String getServerIP(String server) {
return getData().getString("Servers." + server + ".IP");
}
public String getServerKey(String server) {
return getData().getString("Servers." + server + ".Key");
}
public int getServerPort(String server) {
return getData().getInt("Servers." + server + ".Port");
}
public Set<String> getServers() {
return getData().getConfigurationSection("Servers").getKeys(false);
}
public String getServerServiceSite(String server) {
return getData().getString("Servers." + server + ".ServiceSite");
}
public void reloadData() {
data = YamlConfiguration.loadConfiguration(dFile);
}
public void saveData() {
Files.getInstance().editFile(dFile, data);
}
public void setup(Plugin p) {
if (!p.getDataFolder().exists()) {
p.getDataFolder().mkdir();
}
dFile = new File(p.getDataFolder(), "BungeeVoting.yml");
if (!dFile.exists()) {
try {
dFile.createNewFile();
plugin.saveResource("BungeeVoting.yml", true);
} catch (IOException e) {
Bukkit.getServer()
.getLogger()
.severe(ChatColor.RED
+ "Could not create BungeeVoting.yml!");
}
}
data = YamlConfiguration.loadConfiguration(dFile);
}
}
@@ -1,419 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Config;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Files.Files;
public class ConfigFormat {
static ConfigFormat instance = new ConfigFormat();
static Main plugin = Main.plugin;
public static ConfigFormat getInstance() {
return instance;
}
FileConfiguration data;
File dFile;
private ConfigFormat() {
}
public ConfigFormat(Main plugin) {
ConfigFormat.plugin = plugin;
}
public String getBroadCastMsg() {
String str = getData().getString("Format.BroadcastMsg");
if (str != null) {
return str;
} else {
return "&6[&4Broadcast&6] &2Thanks &c%player% &2for voting on %SiteName%";
}
}
public String getCommandVotePoints() {
String str = getData().getString("Format.Commands.Vote.Points");
if (str != null) {
return str;
} else {
return "&a%Player% currently has &a&l%Points%&a Points!";
}
}
public boolean getBroadcastWhenOnline() {
return getData().getBoolean("Format.BroadcastWhenOnline");
}
public String getCommandsVoteHelpLine() {
String str = getData().getString("Format.Commands.Vote.Help.Line");
if (str != null) {
return str;
} else {
return "&3&l%Command% - &3%HelpMessage%";
}
}
public boolean getCommandsVoteHelpRequirePermission() {
return getData().getBoolean(
"Format.Commands.Vote.Help.RequirePermission");
}
public String getCommandsVoteHelpTitle() {
String str = getData().getString("Format.Commands.Vote.Help.Title");
if (str != null) {
return str;
} else {
return "Voting Player Help";
}
}
public String getCommandsVoteLastLine() {
String str = getData().getString("Format.Commands.Vote.Last.Line");
if (str != null) {
return str;
} else {
return "&3%SiteName%: &6%time%";
}
}
public String getCommandsVoteLastTitle() {
String str = getData().getString("Format.Commands.Vote.Last.Title");
if (str != null) {
return str;
} else {
return "&3&l%player% Last Vote Times:";
}
}
public String getCommandsVoteNextInfoCanVote() {
String str = getData().getString(
"Format.Commands.Vote.Next.Info.CanVote");
if (str != null) {
return str;
} else {
return "Go Vote!";
}
}
public String getCommandsVoteNextInfoError() {
String str = getData()
.getString("Format.Commands.Vote.Next.Info.Error");
if (str != null) {
return str;
} else {
return "";
}
}
public String getCommandsVoteNextInfoTime() {
String str = getData().getString(
"Format.Commands.Vote.Next.Info.TimeUntilVote");
if (str != null) {
return str;
} else {
return "&cCould not caculate time until next vote!";
}
}
public String getCommandsVoteNextLayout() {
String str = getData().getString("Format.Commands.Vote.Next.Layout");
if (str != null) {
return str;
} else {
return "&3%SiteName%: &6%info%";
}
}
public String getCommandsVoteNextTitle() {
String str = getData().getString("Format.Commands.Vote.Next.Title");
if (str != null) {
return str;
} else {
return "&3&l%player% Next Votes:";
}
}
@SuppressWarnings("unchecked")
public ArrayList<String> getCommandsVoteParty() {
try {
ArrayList<String> list = (ArrayList<String>) getData().getList(
"Format.Commands.Vote.Party");
if (list != null) {
return list;
}
ArrayList<String> msg = new ArrayList<String>();
msg.add("&cCurrently at &6%Votes%&c, &6%NeededVotes% &cmore votes to go to reach &6%VotesRequired%");
return msg;
} catch (Exception ex) {
ArrayList<String> msg = new ArrayList<String>();
msg.add("&cCurrently at &6%Votes%&c, &6%NeededVotes% &cmore votes to go to reach &6%VotesRequired%");
return msg;
}
}
@SuppressWarnings("unchecked")
public List<String> getCommandsVoteTitle() {
List<String> str;
try {
str = (List<String>) getData()
.getList("Format.Commands.Vote.Title");
if (str != null) {
return str;
} else {
str = new ArrayList<String>();
str.add("&4&lVote for our server!");
return str;
}
} catch (Exception ex) {
str = new ArrayList<String>();
str.add("&4&lVote for our server!");
return str;
}
}
public String getCommandsVoteTotalAllLine() {
String str = getData().getString("Format.Commands.Vote.TotalAll.Line");
if (str != null) {
return str;
} else {
return "&3%SiteName% &6%Total%";
}
}
public String getCommandsVoteTotalAllTitle() {
String str = getData().getString("Format.Commands.Vote.TotalAll.Title");
if (str != null) {
return str;
} else {
return "&3&lAll Votes Total:";
}
}
public String getCommandsVoteTotalAllTotal() {
String str = getData().getString("Format.Commands.Vote.TotalAll.Total");
if (str != null) {
return str;
} else {
return "&3&lTotal: &6&l%Totals%";
}
}
public String getCommandsVoteTotalLine() {
String str = getData().getString("Format.Commands.Vote.Total.Line");
if (str != null) {
return str;
} else {
return "&3%SiteName%: &6%Total%";
}
}
public String getCommandsVoteTotalTitle() {
String str = getData().getString("Format.Commands.Vote.Total.Title");
if (str != null) {
return str;
} else {
return "&3&l%player% Total Votes:";
}
}
public String getCommandsVoteTotalTotal() {
String str = getData().getString("Format.Commands.Vote.Total.Total");
if (str != null) {
return str;
} else {
return "&3&lTotal: &6&l%Totals%";
}
}
public String getCommandsVoteURLS() {
String str = getData().getString("Format.Commands.Vote.Sites");
if (str != null) {
return str;
} else {
return "&4%num%: &c&l%SiteName% - &c%url%";
}
}
public String getCommandVoteTopLine() {
String str = getData().getString("Format.Commands.Vote.Top.Line");
if (str != null) {
return str;
} else {
return "&c%num%: &6%player%, %votes%";
}
}
public String getCommandVoteTopTitle() {
String str = getData().getString("Format.Commands.Vote.Top.Title");
if (str != null) {
return str;
} else {
return "&3Top Voters %page%/%maxpages%";
}
}
public FileConfiguration getData() {
return data;
}
public String getLoginMsg() {
String str = getData().getString("Format.LoginMsg");
if (str != null) {
return str;
} else {
return "&cRemember to vote!";
}
}
public String getNoPerms() {
String str = getData().getString("Format.NoPerms");
if (str != null) {
return str;
} else {
return "&cYou do not have enough permission!";
}
}
public String getNotNumber() {
String str = getData().getString("Format.NotNumber");
if (str != null) {
return str;
} else {
return "&cError on &6%arg%&c, number expected!";
}
}
public int getPageSize() {
return 10;
}
public String getRewardMsg() {
String str = getData().getString("Format.DefaultRewardMsg");
if (str != null) {
return str;
} else {
return "&aYou were given rewards!";
}
}
public String getSignTopVoterSignLine1() {
String str = getData().getString("Format.Signs.TopVoterSign.Line1");
if (str != null) {
return str;
} else {
return "TopVoter: %SiteName%";
}
}
public String getSignTopVoterSignLine2() {
String str = getData().getString("Format.Signs.TopVoterSign.Line2");
if (str != null) {
return str;
} else {
return "#%position%";
}
}
public String getSignTopVoterSignLine3() {
String str = getData().getString("Format.Signs.TopVoterSign.Line3");
if (str != null) {
return str;
} else {
return "%player%";
}
}
public String getSignTopVoterSignLine4() {
String str = getData().getString("Format.Signs.TopVoterSign.Line4");
if (str != null) {
return str;
} else {
return "%votes% Votes";
}
}
public String getSignTopVoterSignRightClickMessage() {
String str = getData().getString("Format.Signs.RightClickMessage");
if (str != null) {
return str;
} else {
return "&c&l%player% &cis &c&l%position% &cwith &c&l%votes% &cin &c&l%SiteName%";
}
}
public String getTimeFormat() {
String string = getData().getString("Format.TimeFormat");
if (string == null) {
return "EEE, d MMM yyyy HH:mm";
}
return string;
}
public String getTimeZone() {
String str = getData().getString("Format.TimeZone");
if (str != null) {
return str;
}
return "UTC";
}
public String getTopVoterRewardMsg() {
String msg = getData().getString("Format.TopVoterAwardMsg");
if (msg != null) {
return msg;
} else {
return "&aYou came in %place% in top voters of the month! Here is an award!";
}
}
@SuppressWarnings("unchecked")
public List<String> getVoteHelp() {
return (List<String>) getData().getList(
"Format.Commands.Vote.Help.Lines");
}
public void reloadData() {
data = YamlConfiguration.loadConfiguration(dFile);
}
public void saveData() {
Files.getInstance().editFile(dFile, data);
}
public void setup(Plugin p) {
if (!p.getDataFolder().exists()) {
p.getDataFolder().mkdir();
}
dFile = new File(p.getDataFolder(), "Format.yml");
if (!dFile.exists()) {
try {
dFile.createNewFile();
plugin.saveResource("Format.yml", true);
} catch (IOException e) {
Bukkit.getServer().getLogger()
.severe(ChatColor.RED + "Could not create Format.yml!");
}
}
data = YamlConfiguration.loadConfiguration(dFile);
}
}
@@ -1,356 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Config;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Files.Files;
public class ConfigGUI {
static ConfigGUI instance = new ConfigGUI();
static Main plugin = Main.plugin;
public static ConfigGUI getInstance() {
return instance;
}
FileConfiguration data;
File dFile;
private ConfigGUI() {
}
public ConfigGUI(Main plugin) {
ConfigGUI.plugin = plugin;
}
public FileConfiguration getData() {
return data;
}
public int getVoteGUISlotAmount(String slot) {
return getData().getInt("GUI.VoteGUI." + slot + ".Item.Amount");
}
public String getVoteGUISlotCommand(String slot) {
return getData().getString("GUI.VoteGUI." + slot + ".Command");
}
public int getVoteGUISlotData(String slot) {
return getData().getInt("GUI.VoteGUI." + slot + ".Item.Data");
}
public int getVoteGUISlotDurability(String slot) {
return getData().getInt("GUI.VoteGUI." + slot + ".Item.Durability");
}
public String getVoteGUISlotMaterial(String slot) {
return getData().getString("GUI.VoteGUI." + slot + ".Item.Material");
}
public String getVoteGUISlotName(String slot) {
return getData().getString("GUI.VoteGUI." + slot + ".Item.Name");
}
public Set<String> getVoteGUISlots() {
try {
return getData().getConfigurationSection("GUI.VoteGUI").getKeys(
false);
} catch (Exception ex) {
return new HashSet<String>();
}
}
public String getVoteGUISlotSkull(Player player, String slot) {
String str = getData().getString("GUI.VoteGUI." + slot + ".Item.Skull");
if (str != null) {
str = str.replace("%Player%", player.getName());
return str;
}
return null;
}
public int getVoteGUISlotSlot(String slot) {
return getData().getInt("GUI.VoteGUI." + slot + ".Slot");
}
@SuppressWarnings("unchecked")
public ArrayList<String> getVoteGUISlotLore(String slot) {
ArrayList<String> list = (ArrayList<String>) getData().getList(
"GUI.VoteGUI." + slot + ".Lore");
if (list != null) {
return list;
}
return new ArrayList<String>();
}
public int getVoteSiteItemAmount(String site) {
String siteName = site.replace(".", "-");
return getData().getInt("GUI.VoteReward." + siteName + ".Item.Amount");
}
public int getVoteSiteItemData(String site) {
String siteName = site.replace(".", "-");
return getData().getInt("GUI.VoteReward." + siteName + ".Item.Data");
}
public int getVoteSiteItemDurability(String site) {
String siteName = site.replace(".", "-");
return getData().getInt(
"GUI.VoteReward." + siteName + ".Item.Durability");
}
public String getVoteSiteItemMaterial(String site) {
String siteName = site.replace(".", "-");
return getData().getString(
"GUI.VoteReward." + siteName + ".Item.Material");
}
@SuppressWarnings("unchecked")
public List<String> getVoteSiteItemLore(String site) {
String siteName = site.replace(".", "-");
return (List<String>) getData().getList(
"GUI.VoteReward." + siteName + ".Item.Lore");
}
public String getVoteSiteItemName(String site) {
String siteName = site.replace(".", "-");
return getData().getString("GUI.VoteReward." + siteName + ".Item.Name");
}
public Set<String> getVoteSiteItems(String site) {
String siteName = site.replace(".", "-");
try {
return getData().getConfigurationSection(
"GUI.VoteReward." + siteName + ".Items").getKeys(false);
} catch (Exception ex) {
return new HashSet<String>();
}
}
public int getVoteSiteItemsAmount(String site, String item) {
String siteName = site.replace(".", "-");
return getData().getInt(
"GUI.VoteReward." + siteName + ".Items." + item + ".Amount");
}
public int getVoteSiteItemsData(String site, String item) {
String siteName = site.replace(".", "-");
return getData().getInt(
"GUI.VoteReward." + siteName + ".Items." + item + ".Data");
}
public int getVoteSiteItemsDurability(String site, String item) {
String siteName = site.replace(".", "-");
return getData()
.getInt("GUI.VoteReward." + siteName + ".Items." + item
+ ".Durability");
}
public String getVoteSiteItemsMaterial(String site, String item) {
String siteName = site.replace(".", "-");
return getData().getString(
"GUI.VoteReward." + siteName + ".Items." + item + ".Material");
}
public String getVoteSiteItemSkull(Player player, String siteName) {
String str = getData().getString(
"GUI.VoteReward." + siteName + ".Item.Skull");
if (str != null) {
str = str.replace("%Player%", player.getName());
return str;
}
return null;
}
@SuppressWarnings("unchecked")
public List<String> getVoteSiteItemsLore(String site, String item) {
String siteName = site.replace(".", "-");
return (List<String>) getData().getList(
"GUI.VoteReward." + siteName + ".Items." + item + ".Lore");
}
public String getVoteSiteItemsName(String site, String item) {
String siteName = site.replace(".", "-");
return getData().getString(
"GUI.VoteReward." + siteName + ".Items." + item + ".Name");
}
public String getVoteSiteItemsSkull(Player player, String siteName,
String item) {
String str = getData().getString(
"GUI.VoteReward." + siteName + ".Items." + item + ".Skull");
if (str != null) {
str = str.replace("%Player%", player.getName());
return str;
}
return null;
}
public int getVoteSiteItemsSlot(String site, String item) {
String siteName = site.replace(".", "-");
return getData().getInt(
"GUI.VoteReward." + siteName + ".Items." + item + ".Slot");
}
public int getVoteURLAlreadyVotedItemAmount() {
int num = getData().getInt("GUI.VoteURL.AlreadyVotedItem.Amount");
if (num != 0) {
return num;
} else {
return 1;
}
}
public int getVoteURLAlreadyVotedItemData() {
int num = getData().getInt("GUI.VoteURL.AlreadyVotedItem.Data");
return num;
}
public int getVoteURLAlreadyVotedItemDurability() {
int num = getData().getInt("GUI.VoteURL.AlreadyVotedItem.Durability");
return num;
}
public String getVoteURLAlreadyVotedItemMaterial() {
String str = getData().getString(
"GUI.VoteURL.AlreadyVotedItem.Material");
if (str != null) {
return str;
}
return "REDSTONE_BLOCK";
}
public String getVoteURLAlreadyVotedItemSkull(Player player) {
String str = getData().getString("GUI.VoteURL.AlreadyVotedItem.Skull");
if (str != null) {
str = str.replace("%Player%", player.getName());
return str;
}
return null;
}
public int getVoteURLCanVoteItemAmount() {
int num = getData().getInt("GUI.VoteURL.CanVoteItem.Amount");
if (num != 0) {
return num;
} else {
return 1;
}
}
public int getVoteURLCanVoteItemData() {
int num = getData().getInt("GUI.VoteURL.CanVoteItem.Data");
return num;
}
public int getVoteURLCanVoteItemDurability() {
int num = getData().getInt("GUI.VoteURL.CanVoteItem.Durability");
return num;
}
public String getVoteURLCanVoteItemMaterial() {
String str = getData().getString("GUI.VoteURL.CanVoteItem.Material");
if (str != null) {
return str;
}
return "EMERALD_BLOCK";
}
public String getVoteURLCanVoteItemSkull(Player player) {
String str = getData().getString("GUI.VoteURL.CanVoteItem.Skull");
if (str != null) {
str = str.replace("%Player%", player.getName());
return str;
}
return null;
}
public String getVoteURLNextVote() {
String str = getData().getString("GUI.VoteURL.NextVote");
if (str != null) {
return str;
} else {
return "&cCan Vote In: %Info%";
}
}
public String getVoteURLSeeURL() {
String str = getData().getString("GUI.VoteURL.SeeURL");
if (str != null) {
return str;
} else {
return "&cClick to see URL";
}
}
public String getVoteURLSiteName() {
String str = getData().getString("GUI.VoteURL.SiteName");
if (str != null) {
return str;
} else {
return "&c%Name%";
}
}
public boolean getVoteURLViewAllUrlsButtonEnabled() {
return getData().getBoolean("GUI.VoteURL.ViewAllUrlsButtonEnabled");
}
public void reloadData() {
data = YamlConfiguration.loadConfiguration(dFile);
}
public void saveData() {
Files.getInstance().editFile(dFile, data);
}
public void setup(Plugin p) {
if (!p.getDataFolder().exists()) {
p.getDataFolder().mkdir();
}
dFile = new File(p.getDataFolder(), "GUI.yml");
if (!dFile.exists()) {
try {
dFile.createNewFile();
plugin.saveResource("GUI.yml", true);
} catch (IOException e) {
Bukkit.getServer().getLogger()
.severe(ChatColor.RED + "Could not create GUI.yml!");
}
}
data = YamlConfiguration.loadConfiguration(dFile);
}
}
@@ -1,128 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Config;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Files.Files;
public class ConfigOtherRewards {
static ConfigOtherRewards instance = new ConfigOtherRewards();
static Main plugin = Main.plugin;
public static ConfigOtherRewards getInstance() {
return instance;
}
FileConfiguration data;
File dFile;
private ConfigOtherRewards() {
}
public ConfigOtherRewards(Main plugin) {
ConfigOtherRewards.plugin = plugin;
}
@SuppressWarnings("unchecked")
public ArrayList<String> getAllSitesReward() {
try {
return (ArrayList<String>) getData().getList("AllSites");
} catch (Exception ex) {
return new ArrayList<String>();
}
}
public FileConfiguration getData() {
return data;
}
@SuppressWarnings("unchecked")
public ArrayList<String> getFirstVoteRewards() {
try {
return (ArrayList<String>) getData().getList("FirstVote");
} catch (Exception ex) {
return new ArrayList<String>();
}
}
@SuppressWarnings("unchecked")
public ArrayList<String> getNumberOfVotes() {
try {
ArrayList<String> list = (ArrayList<String>) getData().getList(
"CumulativeRewards");
if (list != null) {
return list;
}
return new ArrayList<String>();
} catch (Exception ex) {
return new ArrayList<String>();
}
}
public boolean getNumberOfVotesVotesInSameDay() {
return getData().getBoolean("VotesInSameDay");
}
public boolean getVotePartyEnabled() {
return getData().getBoolean("VoteParty.Enabled");
}
public boolean getVotePartyGiveAllPlayers() {
return getData().getBoolean("VoteParty.GiveAllPlayers");
}
@SuppressWarnings("unchecked")
public ArrayList<String> getVotePartyRewards() {
return (ArrayList<String>) getData().getList("VoteParty.Rewards");
}
public int getVotePartyVotesRequired() {
return getData().getInt("VoteParty.VotesRequired");
}
public int getVotesRequired() {
return getData().getInt("VotesRequired");
}
public void reloadData() {
data = YamlConfiguration.loadConfiguration(dFile);
}
public void saveData() {
Files.getInstance().editFile(dFile, data);
}
public void setup(Plugin p) {
if (!p.getDataFolder().exists()) {
p.getDataFolder().mkdir();
}
dFile = new File(p.getDataFolder(), "Rewards.yml");
if (!dFile.exists()) {
try {
dFile.createNewFile();
plugin.saveResource("Rewards.yml", true);
} catch (IOException e) {
Bukkit.getServer()
.getLogger()
.severe(ChatColor.RED + "Could not create Rewards.yml!");
}
}
data = YamlConfiguration.loadConfiguration(dFile);
}
}
@@ -1,478 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Config;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Data.Data;
import com.Ben12345rocks.VotingPlugin.Files.Files;
import com.Ben12345rocks.VotingPlugin.Objects.Reward;
import com.Ben12345rocks.VotingPlugin.Objects.User;
public class ConfigRewards {
static ConfigRewards instance = new ConfigRewards();
static Main plugin = Main.plugin;
public static ConfigRewards getInstance() {
return instance;
}
private ConfigRewards() {
}
public ConfigRewards(Main plugin) {
ConfigRewards.plugin = plugin;
}
public void checkDelayedTimedRewards() {
for (User user : Data.getInstance().getUsers()) {
for (Reward reward : plugin.rewards) {
long time = user.getTimedReward(reward);
if (time != 0) {
Date timeDate = new Date(time);
if (new Date().after(timeDate)) {
reward.giveRewardReward(user);
user.setTimedReward(reward, 0);
}
}
}
}
}
public double getChance(String reward) {
return getData(reward).getDouble("Chance");
}
@SuppressWarnings("unchecked")
public ArrayList<String> getCommandsConsole(String reward) {
try {
return (ArrayList<String>) getData(reward).getList(
"Commands.Console");
} catch (Exception ex) {
return new ArrayList<String>();
}
}
@SuppressWarnings("unchecked")
public ArrayList<String> getCommandsPlayer(String reward) {
try {
return (ArrayList<String>) getData(reward).getList(
"Commands.Player");
} catch (Exception ex) {
return new ArrayList<String>();
}
}
public FileConfiguration getData(String reward) {
File dFile = getRewardFile(reward);
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
return data;
}
public boolean getDelayedEnabled(String reward) {
return getData(reward).getBoolean("Delayed.Enabled");
}
public int getDelayedHours(String reward) {
return getData(reward).getInt("Delayed.Hours");
}
public int getDelayedMinutes(String reward) {
return getData(reward).getInt("Delayed.Minutes");
}
public int getEffectData(String reward) {
return getData(reward).getInt("Effect.Data");
}
public String getEffectEffect(String reward) {
String str = getData(reward).getString("Effect.Effect");
if (str != null) {
return str;
}
return "";
}
public boolean getEffectEnabled(String reward) {
return getData(reward).getBoolean("Effect.Enabled");
}
public int getEffectParticles(String reward) {
return getData(reward).getInt("Effect.Particles");
}
public int getEffectRadius(String reward) {
return getData(reward).getInt("Effect.Radius");
}
public int getEXP(String reward) {
return getData(reward).getInt("EXP");
}
public boolean getGiveInEachWorld(String reward) {
return getData(reward).getBoolean("GiveInEachWorld");
}
public int getItemAmount(String reward, String item) {
return getData(reward).getInt("Items." + item + ".Amount");
}
public int getItemData(String reward, String item) {
return getData(reward).getInt("Items." + item + ".Data");
}
public int getItemDurability(String reward, String item) {
return getData(reward).getInt("Items." + item + ".Durability");
}
public Set<String> getItemEnchants(String reward, String item) {
try {
return getData(reward).getConfigurationSection(
"Items." + item + ".Enchants").getKeys(false);
} catch (Exception ex) {
return new HashSet<String>();
}
}
public int getItemEnchantsLevel(String reward, String item, String enchant) {
return getData(reward).getInt("Items." + item + ".Enchants." + enchant);
}
@SuppressWarnings("unchecked")
public ArrayList<String> getItemLore(String reward, String item) {
return (ArrayList<String>) getData(reward).getList(
"Items." + item + ".Lore");
}
public String getItemMaterial(String reward, String item) {
return getData(reward).getString("Items." + item + ".Material");
}
public int getItemMaxAmount(String reward, String item) {
return getData(reward).getInt("Items." + item + ".MaxAmount");
}
public int getItemMinAmount(String reward, String item) {
return getData(reward).getInt("Items." + item + ".MinAmount");
}
public String getItemName(String reward, String item) {
return getData(reward).getString("Items." + item + ".Name");
}
public Set<String> getItems(String reward) {
try {
return getData(reward).getConfigurationSection("Items").getKeys(
false);
} catch (Exception ex) {
return new HashSet<String>();
}
}
public String getItemSkull(String reward, String item) {
return getData(reward).getString("Items." + item + ".Skull");
}
public int getMaxMoney(String reward) {
return getData(reward).getInt("MaxMoney");
}
public String getMessagesReward(String reward) {
String msg = getData(reward).getString("Messages.Reward");
if (msg != null) {
return msg;
} else {
return ConfigFormat.getInstance().getRewardMsg();
}
}
public int getMinMoney(String reward) {
return getData(reward).getInt("MinMoney");
}
public int getMoney(String reward) {
return getData(reward).getInt("Money");
}
public String getPermission(String reward) {
return "VotingPlugin.Reward." + reward;
}
public Set<String> getPotions(String reward) {
try {
return getData(reward).getConfigurationSection("Potions").getKeys(
false);
} catch (Exception ex) {
return new HashSet<String>();
}
}
public int getPotionsAmplifier(String reward, String potion) {
return getData(reward).getInt("Potions." + potion + ".Amplifier");
}
public int getPotionsDuration(String reward, String potion) {
return getData(reward).getInt("Potions." + potion + ".Duration");
}
public double getRandomChance(String reward) {
return getData(reward).getDouble("Random.Chance");
}
@SuppressWarnings("unchecked")
public ArrayList<String> getRandomFallBack(String reward) {
try {
return (ArrayList<String>) getData(reward).getList(
"Random.FallBack");
} catch (Exception ex) {
return new ArrayList<String>();
}
}
@SuppressWarnings("unchecked")
public ArrayList<String> getRandomRewards(String reward) {
try {
return (ArrayList<String>) getData(reward)
.getList("Random.Rewards");
} catch (Exception ex) {
return new ArrayList<String>();
}
}
public boolean getRequirePermission(String reward) {
return getData(reward).getBoolean("RequirePermission");
}
public Reward getReward(String reward) {
reward = reward.replace(" ", "_");
if (plugin.rewards != null) {
for (Reward rewardFile : plugin.rewards) {
if (rewardFile.name.equals(reward)) {
return rewardFile;
}
}
}
return new Reward(reward);
}
public File getRewardFile(String reward) {
File dFile = new File(plugin.getDataFolder() + File.separator
+ "Rewards", reward + ".yml");
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
if (!dFile.exists()) {
try {
data.save(dFile);
} catch (IOException e) {
plugin.getLogger().severe(
ChatColor.RED + "Could not create Rewards/" + reward
+ ".yml!");
}
}
return dFile;
}
public ArrayList<String> getRewardFiles() {
File folder = new File(plugin.getDataFolder() + File.separator
+ "Rewards");
String[] fileNames = folder.list();
return Utils.getInstance().convertArray(fileNames);
}
public ArrayList<String> getRewardNames() {
ArrayList<String> rewardFiles = getRewardFiles();
if (rewardFiles == null) {
return new ArrayList<String>();
}
for (int i = 0; i < rewardFiles.size(); i++) {
rewardFiles.set(i, rewardFiles.get(i).replace(".yml", ""));
}
Collections.sort(rewardFiles, String.CASE_INSENSITIVE_ORDER);
return rewardFiles;
}
public boolean getSoundEnabled(String reward) {
return getData(reward).getBoolean("Sound.Enabled");
}
public float getSoundPitch(String reward) {
return (float) getData(reward).getDouble("Sound.Pitch");
}
public String getSoundSound(String reward) {
return getData(reward).getString("Sound.Sound");
}
public float getSoundVolume(String reward) {
return (float) getData(reward).getDouble("Sound.Volume");
}
public boolean getTimedEnabled(String reward) {
return getData(reward).getBoolean("Timed.Enabled");
}
public int getTimedHour(String reward) {
return getData(reward).getInt("Timed.Hour");
}
public int getTimedMinute(String reward) {
return getData(reward).getInt("Timed.Minute");
}
public boolean getTitleEnabled(String reward) {
return getData(reward).getBoolean("Title.Enabled");
}
public int getTitleFadeIn(String reward) {
return getData(reward).getInt("Title.FadeIn");
}
public int getTitleFadeOut(String reward) {
return getData(reward).getInt("Title.FadeOut");
}
public int getTitleShowTime(String reward) {
return getData(reward).getInt("Title.ShowTime");
}
public String getTitleSubTitle(String reward) {
return getData(reward).getString("Title.SubTitle");
}
public String getTitleTitle(String reward) {
return getData(reward).getString("Title.Title");
}
@SuppressWarnings("unchecked")
public ArrayList<String> getWorlds(String reward) {
try {
return (ArrayList<String>) getData(reward).getList("Worlds");
} catch (Exception ex) {
return new ArrayList<String>();
}
}
public boolean renameReward(String reward, String newName) {
return getRewardFile(reward).renameTo(
new File(plugin.getDataFolder() + File.separator + "Rewards",
newName + ".yml"));
}
public void set(String reward, String path, Object value) {
File dFile = getRewardFile(reward);
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
data.set(path, value);
Files.getInstance().editFile(dFile, data);
}
public void setChance(String reward, int value) {
set(reward, "Chance", value);
}
public void setCommandsConsole(String reward, ArrayList<String> value) {
set(reward, "Commands.Console", value);
}
public void setCommandsPlater(String reward, ArrayList<String> value) {
set(reward, "Commands.Player", value);
}
public void setGiveInEachWorld(String reward, boolean value) {
set(reward, "GiveInEachWorld", value);
}
public void setItemAmount(String reward, String item, int value) {
set(reward, "Items." + item + ".Amount", value);
}
public void setItemData(String reward, String item, int value) {
set(reward, "Items." + item + ".Data", value);
}
public void setItemEnchant(String reward, String item, String enchant,
int value) {
set(reward, "Items." + item + ".Enchants." + enchant, value);
}
public void setItemLore(String reward, String item, ArrayList<String> value) {
set(reward, "Items." + item + ".Lore", value);
}
public void setItemMaterial(String reward, String item, String value) {
set(reward, "Items." + item + ".Material", value);
}
public void setItemMaxAmount(String reward, String item, int value) {
set(reward, "Items." + item + ".MaxAmount", value);
}
public void setItemMinAmount(String reward, String item, int value) {
set(reward, "Items." + item + ".MinAmount", value);
}
public void setItemName(String reward, String item, String value) {
set(reward, "Items." + item + ".Name", value);
}
public void setMaxMoney(String reward, int value) {
set(reward, "MaxMoney", value);
}
public void setMessagesReward(String reward, String value) {
set(reward, "Messages.Reward", value);
}
public void setMinMoney(String reward, int value) {
set(reward, "MinMoney", value);
}
public void setMoney(String reward, int value) {
set(reward, "Money", value);
}
public void setPotionsAmplifier(String reward, String potion, int value) {
set(reward, "Potions." + potion + ".Amplifier", value);
}
public void setPotionsDuration(String reward, String potion, int value) {
set(reward, "Potions." + potion + ".Duration", value);
}
public void setRequirePermission(String reward, boolean value) {
set(reward, "RequirePermission", value);
}
public void setupExample() {
if (!plugin.getDataFolder().exists()) {
plugin.getDataFolder().mkdir();
}
File file = new File(plugin.getDataFolder(), "Rewards" + File.separator
+ "ExampleReward.yml");
if (!file.exists()) {
plugin.saveResource("Rewards" + File.separator
+ "ExampleReward.yml", true);
}
}
public void setWorlds(String reward, ArrayList<String> value) {
set(reward, "Worlds", value);
}
}
@@ -1,138 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Config;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Files.Files;
public class ConfigTopVoterAwards {
static ConfigTopVoterAwards instance = new ConfigTopVoterAwards();
static Main plugin = Main.plugin;
public static ConfigTopVoterAwards getInstance() {
return instance;
}
FileConfiguration data;
File dFile;
private ConfigTopVoterAwards() {
}
public ConfigTopVoterAwards(Main plugin) {
ConfigTopVoterAwards.plugin = plugin;
}
@SuppressWarnings("unchecked")
public List<String> getBlackList() {
return (List<String>) getData().getList("BlackList");
}
@SuppressWarnings("unchecked")
public ArrayList<String> getDailyAwardRewards(int pos) {
return (ArrayList<String>) getData().getList(
"DailyAwards." + pos + ".Rewards");
}
public boolean getDailyAwardsEnabled() {
return getData().getBoolean("EnableDailyAwards");
}
public Set<String> getDailyPossibleRewardPlaces() {
try {
return getData().getConfigurationSection("DailyAwards").getKeys(
false);
} catch (Exception ex) {
Set<String> noValues = new HashSet<String>();
return noValues;
}
}
public FileConfiguration getData() {
return data;
}
@SuppressWarnings("unchecked")
public ArrayList<String> getMonthlyAwardRewards(int pos) {
return (ArrayList<String>) getData().getList(
"MonthlyAwards." + pos + ".Rewards");
}
public boolean getMonthlyAwardsEnabled() {
return getData().getBoolean("EnableMonthlyAwards");
}
public Set<String> getMonthlyPossibleRewardPlaces() {
try {
return getData().getConfigurationSection("MonthlyAwards").getKeys(
false);
} catch (Exception ex) {
Set<String> noValues = new HashSet<String>();
return noValues;
}
}
@SuppressWarnings("unchecked")
public ArrayList<String> getWeeklyAwardRewards(int pos) {
return (ArrayList<String>) getData().getList(
"WeeklyAwards." + pos + ".Rewards");
}
public boolean getWeeklyAwardsEnabled() {
return getData().getBoolean("EnableWeeklyAwards");
}
public Set<String> getWeeklyPossibleRewardPlaces() {
try {
return getData().getConfigurationSection("WeeklyAwards").getKeys(
false);
} catch (Exception ex) {
Set<String> noValues = new HashSet<String>();
return noValues;
}
}
public void reloadData() {
data = YamlConfiguration.loadConfiguration(dFile);
}
public void saveData() {
Files.getInstance().editFile(dFile, data);
}
public void setup(Plugin p) {
if (!p.getDataFolder().exists()) {
p.getDataFolder().mkdir();
}
dFile = new File(p.getDataFolder(), "TopVoterAwards.yml");
if (!dFile.exists()) {
try {
dFile.createNewFile();
plugin.saveResource("TopVoterAwards.yml", true);
} catch (IOException e) {
Bukkit.getServer()
.getLogger()
.severe(ChatColor.RED
+ "Could not create TopVoterAwards.yml!");
}
}
data = YamlConfiguration.loadConfiguration(dFile);
}
}
@@ -1,111 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Config;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Files.Files;
public class ConfigVoteReminding {
static ConfigVoteReminding instance = new ConfigVoteReminding();
static Main plugin = Main.plugin;
public static ConfigVoteReminding getInstance() {
return instance;
}
FileConfiguration data;
File dFile;
private ConfigVoteReminding() {
}
public ConfigVoteReminding(Main plugin) {
ConfigVoteReminding.plugin = plugin;
}
public FileConfiguration getData() {
return data;
}
public boolean getEnabled() {
return getData().getBoolean("Enabled");
}
public int getRemindDelay() {
int num = getData().getInt("RemindDelay");
if (num != 0) {
return num;
}
return 30;
}
public boolean getRemindOnLogin() {
return getData().getBoolean("RemindOnLogin");
}
public boolean getRemindOnlyOnce() {
return getData().getBoolean("RemindOnlyOnce");
}
@SuppressWarnings("unchecked")
public ArrayList<String> getRewards() {
try {
ArrayList<String> list = (ArrayList<String>) getData().getList(
"Rewards");
if (list != null) {
return list;
} else {
return new ArrayList<String>();
}
} catch (Exception ex) {
return new ArrayList<String>();
}
}
public void reloadData() {
data = YamlConfiguration.loadConfiguration(dFile);
}
public void saveData() {
Files.getInstance().editFile(dFile, data);
}
public void set(String path, Object value) {
getData().set(path, value);
saveData();
}
public void setup(Plugin p) {
if (!p.getDataFolder().exists()) {
p.getDataFolder().mkdir();
}
dFile = new File(p.getDataFolder(), "VoteReminding.yml");
if (!dFile.exists()) {
try {
dFile.createNewFile();
plugin.saveResource("VoteReminding.yml", true);
} catch (IOException e) {
Bukkit.getServer()
.getLogger()
.severe(ChatColor.RED
+ "Could not create VoteReminding.yml!");
}
}
data = YamlConfiguration.loadConfiguration(dFile);
}
}
@@ -1,295 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Config;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Files.Files;
import com.Ben12345rocks.VotingPlugin.Objects.VoteSite;
public class ConfigVoteSites {
static ConfigVoteSites instance = new ConfigVoteSites();
static Main plugin = Main.plugin;
public static ConfigVoteSites getInstance() {
return instance;
}
private ConfigVoteSites() {
}
public ConfigVoteSites(Main plugin) {
ConfigVoteSites.plugin = plugin;
}
public void generateVoteSite(String siteName) {
plugin.getLogger().warning(
"VoteSite " + siteName
+ " doe not exist, generaterating one...");
setEnabled(siteName, false);
setServiceSite(siteName, "Enter Service Site");
setVoteURL(siteName, "VoteURL");
setVoteDelay(siteName, 24);
setRewards(siteName, new ArrayList<String>());
plugin.loadVoteSites();
plugin.getLogger()
.info("Created file VoteSites/"
+ siteName
+ ".yml! Loaded default values into file, remember to turn Enabled to true, else it won't be read by the plugin");
}
@SuppressWarnings("unchecked")
public ArrayList<String> getCumulativeRewards(String siteName) {
try {
return (ArrayList<String>) getData(siteName).getList(
"Cumulative.Rewards");
} catch (Exception ex) {
return new ArrayList<String>();
}
}
public int getCumulativeRewardVotesAmount(String siteName) {
return getData(siteName).getInt("Cumulative.Votes");
}
public FileConfiguration getData(String siteName) {
File dFile = getVoteSiteFile(siteName);
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
return data;
}
public int getPriority(String siteName) {
return getData(siteName).getInt("Priority");
}
@SuppressWarnings("unchecked")
public ArrayList<String> getRewards(String siteName) {
try {
return (ArrayList<String>) getData(siteName).getList("Rewards");
} catch (Exception ex) {
return new ArrayList<String>();
}
}
public String getServiceSite(String siteName) {
return getData(siteName).getString("ServiceSite");
}
public int getVoteDelay(String siteName) {
return getData(siteName).getInt("VoteDelay");
}
public boolean getVoteSiteEnabled(String siteName) {
return getData(siteName).getBoolean("Enabled");
}
public File getVoteSiteFile(String siteName) {
File dFile = new File(plugin.getDataFolder() + File.separator
+ "VoteSites", siteName + ".yml");
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
if (!dFile.exists()) {
try {
data.save(dFile);
} catch (IOException e) {
plugin.getLogger().severe(
ChatColor.RED + "Could not create VoteSites/"
+ siteName + ".yml!");
}
}
return dFile;
}
public ArrayList<VoteSite> getVoteSites() {
if (plugin.voteSites != null) {
return plugin.voteSites;
} else {
plugin.loadVoteSites();
return plugin.voteSites;
}
}
public ArrayList<String> getVoteSitesFiles() {
File folder = new File(plugin.getDataFolder() + File.separator
+ "VoteSites");
String[] fileNames = folder.list();
return Utils.getInstance().convertArray(fileNames);
}
public ArrayList<VoteSite> getVoteSitesLoad() {
ArrayList<VoteSite> voteSites = new ArrayList<VoteSite>();
ArrayList<String> voteSiteNames = getVoteSitesNames();
if (voteSiteNames != null) {
for (String site : voteSiteNames) {
if (!site.equalsIgnoreCase("Example")
&& getVoteSiteEnabled(site)
&& !site.equalsIgnoreCase("null")) {
if (!siteCheck(site)) {
plugin.getLogger().warning(
"Failed to load site " + site + ", see above");
} else {
voteSites.add(new VoteSite(site));
}
}
}
}
Collections.sort(voteSites, new Comparator<VoteSite>() {
@Override
public int compare(VoteSite v1, VoteSite v2) {
int v1P = getPriority(v1.getSiteName());
int v2P = getPriority(v2.getSiteName());
if (v1P < v2P) {
return 1;
}
if (v1P > v2P) {
return -1;
}
return 0;
}
});
return voteSites;
}
public ArrayList<String> getVoteSitesNames() {
ArrayList<String> siteNames = getVoteSitesFiles();
if (siteNames == null) {
return null;
}
for (int i = 0; i < siteNames.size(); i++) {
siteNames.set(i, siteNames.get(i).replace(".yml", ""));
}
for (int i = siteNames.size() - 1; i >= 0; i--) {
// plugin.getLogger().info(siteNames.get(i));
if (!getVoteSiteEnabled(siteNames.get(i))
|| siteNames.get(i).equalsIgnoreCase("Example")
|| siteNames.get(i).equalsIgnoreCase("null")
|| !siteCheck(siteNames.get(i))) {
// plugin.getLogger().info("Removed: " + siteNames.get(i));
siteNames.remove(i);
}
}
return siteNames;
}
public String getVoteURL(String siteName) {
return getData(siteName).getString("VoteURL");
}
public boolean isServiceSiteGood(String siteName) {
if (getServiceSite(siteName) == null) {
return false;
} else if (getServiceSite(siteName).equalsIgnoreCase("")) {
return false;
}
return true;
}
public boolean isVoteURLGood(String siteName) {
if (getVoteURL(siteName) == null) {
return false;
} else if (getVoteURL(siteName).equalsIgnoreCase("")) {
return false;
}
return true;
}
public boolean renameVoteSite(String siteName, String newName) {
return getVoteSiteFile(siteName).renameTo(
new File(plugin.getDataFolder() + File.separator + "VoteSites",
newName + ".yml"));
}
public void set(String siteName, String path, Object value) {
// String playerName = user.getPlayerName();
File dFile = getVoteSiteFile(siteName);
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
data.set(path, value);
Files.getInstance().editFile(dFile, data);
}
public void setCumulativeRewards(String siteName, ArrayList<String> value) {
set(siteName, "Cumulative.Rewards", value);
}
public void setEnabled(String siteName, boolean disabled) {
set(siteName, "Enabled", disabled);
}
public void setPriority(String siteName, int value) {
set(siteName, "Priority", value);
}
public void setRewards(String siteName, ArrayList<String> value) {
set(siteName, "Rewards", value);
}
public void setServiceSite(String siteName, String serviceSite) {
set(siteName, "ServiceSite", serviceSite);
}
public void setup(String siteName) {
if (!plugin.getDataFolder().exists()) {
plugin.getDataFolder().mkdir();
}
File dFile = new File(plugin.getDataFolder() + File.separator
+ "VoteSites", siteName + ".yml");
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
if (!dFile.exists()) {
try {
data.save(dFile);
if (siteName.equalsIgnoreCase("ExampleVoteSite")) {
plugin.saveResource("VoteSites" + File.separator
+ "ExampleVoteSite.yml", true);
}
} catch (IOException e) {
plugin.getLogger().severe(
ChatColor.RED + "Could not create VoteSites/"
+ siteName + ".yml!");
}
}
}
public void setVoteDelay(String siteName, int voteDelay) {
set(siteName, "VoteDelay", voteDelay);
}
public void setVoteURL(String siteName, String url) {
set(siteName, "VoteURL", url);
}
public boolean siteCheck(String siteName) {
boolean pass = true;
if (!isServiceSiteGood(siteName)) {
plugin.getLogger().warning(
"Issue with ServiceSite in site " + siteName
+ ", votes may not work properly");
pass = false;
}
if (!isVoteURLGood(siteName)) {
plugin.getLogger()
.warning("Issue with VoteURL in site " + siteName);
}
return pass;
}
}
@@ -1,397 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Data;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Files.Files;
import com.Ben12345rocks.VotingPlugin.Objects.User;
public class Data {
static Data instance = new Data();
static Main plugin = Main.plugin;
public static Data getInstance() {
return instance;
}
private Data() {
}
public Data(Main plugin) {
Data.plugin = plugin;
}
public void addCumulativeSite(User user, String voteSite) {
setCumulativeSite(user, voteSite, getCumulativeSite(user, voteSite) + 1);
}
public void addTotal(User user, String voteSite) {
set(user, "Total." + voteSite, getTotal(user, voteSite) + 1);
}
public int getAllSitesOffline(User user) {
return getData(user).getInt("OtherRewards.AllSites");
}
public int getCumulativeSite(User user, String voteSite) {
return getData(user).getInt("Cumulative." + voteSite);
}
public FileConfiguration getData(User user) {
File dFile = getPlayerFile(user);
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
return data;
}
public ArrayList<String> getFiles() {
File folder = new File(plugin.getDataFolder() + File.separator + "Data");
String[] fileNames = folder.list();
return Utils.getInstance().convertArray(fileNames);
}
public int getFirstVoteOffline(User user) {
return getData(user).getInt("OtherRewards.FirstVote");
}
public boolean getHasGottenFirstReward(User user) {
return getData(user).getBoolean("FirstVoteGotten");
}
public String getName(User user) {
return getData(user).getString("Name");
}
public int getNumberOfVotesOffline(User user) {
return getData(user).getInt("OtherRewards.NumberOfVotes");
}
public int getOfflineVotesSite(User user, String siteName) {
return getData(user).getInt("OfflineVotes." + siteName);
}
public int getOfflineVotesSiteWorld(User user, String reward, String world) {
if (world == null) {
world = "AllTheWorlds";
}
return getData(user)
.getInt("OfflineVotesWorld." + reward + "." + world);
}
public File getPlayerFile(User user) {
String playerName = user.getPlayerName();
String uuid = user.getUUID();
// plugin.debug(playerName + ":" + uuid);
// plugin.debug(plugin.toString());
File dFile = new File(plugin.getDataFolder() + File.separator + "Data",
uuid + ".yml");
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
if (!dFile.exists()) {
try {
data.save(dFile);
setPlayerName(user);
plugin.debug("Created file: " + uuid + ".yml from player: "
+ playerName);
} catch (IOException e) {
Bukkit.getServer()
.getLogger()
.severe(ChatColor.RED + "Could not create " + uuid
+ ".yml! Name: " + playerName);
}
}
return dFile;
}
public ArrayList<String> getPlayerNames() {
ArrayList<String> files = getFiles();
ArrayList<String> names = new ArrayList<String>();
if (files != null) {
for (String playerFile : files) {
String uuid = playerFile.replace(".yml", "");
String playerName = Utils.getInstance().getPlayerName(uuid);
if (playerName != null) {
names.add(playerName);
}
}
Set<String> namesSet = new HashSet<String>(names);
names = Utils.getInstance().convert(namesSet);
if (names == null) {
return null;
} else {
return names;
}
}
return null;
}
@SuppressWarnings("unused")
public ArrayList<String> getPlayersUUIDs() {
ArrayList<String> files = getFiles();
if (files != null) {
ArrayList<String> uuids = new ArrayList<String>();
if (files.size() > 0) {
for (String playerFile : files) {
String uuid = playerFile.replace(".yml", "");
uuids.add(uuid);
}
if (uuids == null) {
return null;
} else {
return uuids;
}
}
}
return null;
}
public boolean getReminded(User user) {
return getData(user).getBoolean("Reminded");
}
public long getTimedReward(User user, String reward) {
return getData(user).getLong("Timed." + reward);
}
public long getTimeSite(User user, String voteSite) {
return getData(user).getLong("LastVote." + voteSite + ".Miliseconds");
}
@SuppressWarnings("deprecation")
public int getTopVoterAwardOffline(User user) {
return getData(user).getInt(
"TopVoter." + new Date().getYear() + "."
+ new Date().getMonth());
}
@SuppressWarnings("deprecation")
public int getTopVoterAwardOfflineDaily(User user, int date) {
return getData(user).getInt(
"TopVoter." + new Date().getYear() + "."
+ new Date().getMonth() + "." + date);
}
@SuppressWarnings("deprecation")
public int getTopVoterAwardOfflineWeekly(User user, int day) {
return getData(user).getInt(
"TopVoter." + new Date().getYear() + "."
+ new Date().getMonth() + "." + day);
}
public int getTotal(User user, String voteSite) {
return getData(user).getInt("Total." + voteSite);
}
public int getTotalDaily(User user, String voteSite) {
return getData(user).getInt("TotalDay." + voteSite);
}
public int getTotalWeek(User user, String voteSite) {
return getData(user).getInt("TotalWeek." + voteSite);
}
public Set<User> getUsers() {
Set<User> users = new HashSet<User>();
ArrayList<String> players = getPlayerNames();
if (players != null) {
for (String playerName : players) {
User user = new User(playerName);
users.add(user);
}
return users;
} else {
return new HashSet<User>();
}
}
public int getVotingPoints(User user) {
return getData(user).getInt("Points");
}
public boolean hasJoinedBefore(User user) {
try {
return getPlayersUUIDs().contains(user.getUUID());
} catch (Exception ex) {
return false;
}
}
public void saveData(User user) {
File dFile = getPlayerFile(user);
String playerName = user.getPlayerName();
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
try {
data.save(dFile);
} catch (IOException e) {
Bukkit.getServer()
.getLogger()
.severe(ChatColor.RED + "Could not save "
+ Utils.getInstance().getUUID(playerName) + ".yml!");
}
}
public void set(User user, String path, Object value) {
File dFile = getPlayerFile(user);
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
data.set(path, value);
Files.getInstance().editFile(dFile, data);
}
public void setAllSitesOffline(User user, int value) {
set(user, "OtherRewards.AllSites", value);
}
public void setCumulativeSite(User user, String voteSite, int amount) {
set(user, "Cumulative." + voteSite, amount);
}
public void setFirstVoteOffline(User user, int value) {
set(user, "OtherRewards.FirstVote", value);
}
public void setHasGottenFirstReward(User user, boolean value) {
set(user, "FirstVoteGotten", value);
}
public void setNumberOfVotesOffline(User user, int value) {
set(user, "OtherRewards.NumberOfVotes", value);
}
public void setOfflineVotesSite(User user, String siteName, int value) {
set(user, "OfflineVotes." + siteName, value);
}
public void setOfflineVotesSiteWorld(User user, String reward,
String world, int value) {
if (world == null) {
world = "AllTheWorlds";
}
set(user, "OfflineVotesWorld." + reward + "." + world, value);
}
public void setPlayerName(User user) {
set(user, "PlayerName", user.getPlayerName());
}
public void setReminded(User user, boolean value) {
set(user, "Reminded", value);
}
public void setTime(String siteName, User user) {
set(user, "LastVote." + siteName + ".Miliseconds",
System.currentTimeMillis());
}
public void setTimedReward(User user, String reward, long time) {
set(user, "Timed." + reward, time);
}
/*
* public int getVotesBonusReward(User user) { return
* getData(user).getInt("BonusVotes"); }
*
* public void setVotesBonusReward(User user, int value) { set(user,
* "BonusVotes", value); }
*/
public void setTimeMill(String siteName, User user, Long mill) {
set(user, "LastVote." + siteName + ".Miliseconds", mill);
}
public void setTimeSite(User user, String voteSite, int value) {
set(user, "LastVote." + voteSite + ".Miliseconds", value);
}
@SuppressWarnings("deprecation")
public void setTopVoterAwardOffline(User user, int place) {
set(user,
"TopVoter." + new Date().getYear() + "."
+ new Date().getMonth(), place);
}
@SuppressWarnings("deprecation")
public void setTopVoterAwardOfflineDaily(User user, int place) {
set(user,
"TopVoter." + new Date().getYear() + "."
+ new Date().getMonth() + "." + new Date().getDate(),
place);
}
@SuppressWarnings("deprecation")
public void setTopVoterAwardOfflineWeekly(User user, int place) {
set(user,
"TopVoter." + new Date().getYear() + "."
+ new Date().getMonth() + "." + new Date().getDay(),
place);
}
public void setTotal(User user, String voteSite, int amount) {
set(user, "Total." + voteSite, amount);
}
public void setTotalDaily(User user, String voteSite, int amount) {
set(user, "TotalDay." + voteSite, amount);
}
public void setTotalWeek(User user, String voteSite, int amount) {
set(user, "TotalWeek." + voteSite, amount);
}
public void setup(User user) {
if (!plugin.getDataFolder().exists()) {
plugin.getDataFolder().mkdir();
}
String uuid = user.getUUID();
String playerName = user.getPlayerName();
if (playerName == null) {
Utils.getInstance().getPlayerName(uuid);
}
if (playerName == null) {
return;
}
File dFile = new File(plugin.getDataFolder() + File.separator + "Data",
uuid + ".yml");
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
if (!dFile.exists()) {
try {
data.save(dFile);
setPlayerName(user);
plugin.debug("Created file: " + uuid + ".yml from player: "
+ playerName);
} catch (IOException e) {
plugin.getLogger().severe(
ChatColor.RED + "Could not create " + uuid
+ ".yml! Name: " + playerName);
}
}
}
public void setVotingPoints(User user, int value) {
set(user, "Points", value);
}
}
@@ -1,210 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Data;
import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Files.Files;
import com.Ben12345rocks.VotingPlugin.Objects.SignHandler;
public class ServerData {
static ServerData instance = new ServerData();
static Main plugin = Main.plugin;
public static ServerData getInstance() {
return instance;
}
FileConfiguration data;
File dFile;
private ServerData() {
}
public ServerData(Main plugin) {
ServerData.plugin = plugin;
}
public void addSign(Location location, String data, int position) {
int count = nextSignNumber();
getData().set("Signs." + count + ".World",
location.getWorld().getName());
getData().set("Signs." + count + ".X", location.getBlockX());
getData().set("Signs." + count + ".Y", location.getBlockY());
getData().set("Signs." + count + ".Z", location.getBlockZ());
getData().set("Signs." + count + ".Data", data);
getData().set("Signs." + count + ".Position", position);
saveData();
plugin.signs.add(new SignHandler("" + count,
getSignLocation("" + count), getSignData("" + count),
getSignPosition("" + count)));
}
public FileConfiguration getData() {
return data;
}
public int getPrevDay() {
return getData().getInt("PrevDay");
}
public int getPrevMonth() {
return getData().getInt("PrevMonth");
}
public int getPrevWeekDay() {
return getData().getInt("PrevWeek");
}
public String getSignData(String sign) {
return getData().getString("Signs." + sign + ".Data");
}
public Location getSignLocation(String sign) {
return new Location(Bukkit.getWorld(getData().getString(
"Signs." + sign + ".World")), getData().getDouble(
"Signs." + sign + ".X"), getData().getDouble(
"Signs." + sign + ".Y"), getData().getDouble(
"Signs." + sign + ".Z"));
}
public int getSignPosition(String sign) {
return getData().getInt("Signs." + sign + ".Position");
}
public Set<String> getSigns() {
try {
return getData().getConfigurationSection("Signs").getKeys(false);
} catch (Exception ex) {
return new HashSet<String>();
}
}
public int nextSignNumber() {
Set<String> signs = getSigns();
if (signs != null) {
for (int i = 0; i < 100000; i++) {
if (!signs.contains(Integer.toString(i))) {
return i;
}
}
}
return 0;
}
public void reloadData() {
data = YamlConfiguration.loadConfiguration(dFile);
}
public void removeSign(String sign) {
getData().set("Signs." + sign + ".World", null);
getData().set("Signs." + sign + ".X", null);
getData().set("Signs." + sign + ".Y", null);
getData().set("Signs." + sign + ".Z", null);
getData().set("Signs." + sign + ".Data", null);
getData().set("Signs." + sign + ".Position", null);
getData().set("Signs." + sign, null);
saveData();
}
public void saveData() {
Files.getInstance().editFile(dFile, data);
}
public void setPluginVersion() {
getData().set("PluginVersion", plugin.getDescription().getVersion());
saveData();
}
public void setPrevDay(int day) {
getData().set("PrevDay", day);
saveData();
}
public void setPrevMonth(int value) {
getData().set("PrevMonth", value);
saveData();
}
public void setPrevWeekDay(int week) {
getData().set("PrevWeek", week);
saveData();
}
public void setSign(String count, Location location, String data,
int position) {
getData().set("Signs." + count + ".World",
location.getWorld().getName());
int x = (int) location.getX();
int z = (int) location.getZ();
getData().set("Signs." + count + ".X", x);
getData().set("Signs." + count + ".Y", location.getY());
getData().set("Signs." + count + ".Z", z);
getData().set("Signs." + count + ".Data", data);
getData().set("Signs." + count + ".Position", position);
saveData();
}
@SuppressWarnings("deprecation")
public void setup(Plugin p) {
if (!p.getDataFolder().exists()) {
p.getDataFolder().mkdir();
}
dFile = new File(p.getDataFolder(), "ServerData.yml");
boolean genFile = false;
if (!dFile.exists()) {
try {
dFile.createNewFile();
genFile = true;
} catch (IOException e) {
Bukkit.getServer()
.getLogger()
.severe(ChatColor.RED
+ "Could not create ServerData.yml!");
}
}
data = YamlConfiguration.loadConfiguration(dFile);
data.options().header("DO NOT EDIT THIS FILE MANUALLY");
if (genFile) {
java.util.TimeZone tz = java.util.TimeZone.getTimeZone(ConfigFormat
.getInstance().getTimeZone());
java.util.Calendar c = java.util.Calendar.getInstance(tz);
setPrevMonth(c.getTime().getMonth());
int day = c.getTime().getDay();
ServerData.getInstance().setPrevDay(day);
ServerData.getInstance().setPrevWeekDay(c.getTime().getDate());
}
saveData();
}
public void setVersion() {
getData().set("Version", Bukkit.getVersion());
saveData();
}
public void updateValues() {
setVersion();
setPluginVersion();
}
}
@@ -1,42 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Events;
import java.util.Set;
import org.bukkit.block.Sign;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Data.ServerData;
public class BlockBreak implements Listener {
@SuppressWarnings("unused")
private static Main plugin;
public BlockBreak(Main plugin) {
BlockBreak.plugin = plugin;
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onBlockBreak(BlockBreakEvent event) {
if (event.getBlock().getState() instanceof Sign) {
Sign s = (Sign) event.getBlock().getState();
if (s.getLine(0).startsWith("TopVoter")) {
Set<String> signs = ServerData.getInstance().getSigns();
if (signs != null) {
for (String sign : signs) {
if (ServerData.getInstance().getSignLocation(sign)
.equals(event.getBlock().getLocation())) {
ServerData.getInstance().removeSign(sign);
}
}
}
}
}
}
}
@@ -1,43 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Events;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Objects.SignHandler;
import com.Ben12345rocks.VotingPlugin.Objects.User;
public class PlayerInteract implements Listener {
private static Main plugin;
public PlayerInteract(Main plugin) {
PlayerInteract.plugin = plugin;
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent event) {
Player player = event.getPlayer();
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
// plugin.debug("Checking for sign click");
if (event.getClickedBlock().getState() instanceof Sign) {
// plugin.debug(player.getName() + " right clicked a sign");
for (SignHandler sign : plugin.signs) {
if (sign.isLocationSame(event.getClickedBlock()
.getLocation())) {
// plugin.debug(player.getName() +
// " right clicked a top voter sign, sending message");
new User(player.getName()).sendMessage(sign
.getRightClickMessage());
}
}
}
}
}
}
@@ -1,59 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Events;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerLoginEvent;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Data.Data;
import com.Ben12345rocks.VotingPlugin.Objects.User;
public class PlayerJoinEvent implements Listener {
private static Main plugin;
Data data = Data.getInstance();
public PlayerJoinEvent(Main plugin) {
PlayerJoinEvent.plugin = plugin;
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onPlayerLogin(PlayerLoginEvent event) {
plugin.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
@Override
public void run() {
if (event.getPlayer() == null) {
return;
}
Player player = event.getPlayer();
if (!plugin.getDataFolder().exists()) {
plugin.getDataFolder().mkdir();
}
User user = new User(player);
plugin.getServer().getScheduler()
.runTaskLaterAsynchronously(plugin, new Runnable() {
@Override
public void run() {
user.setPlayerName();
user.offVoteWorld(player.getWorld().getName());
// give offline vote (if they voted offline)
user.offVote();
// msg player if he can vote
user.loginMessage();
}
}, 100L);
}
}, 20L);
}
}
@@ -1,56 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Events;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import com.Ben12345rocks.VotingPlugin.Objects.User;
import com.Ben12345rocks.VotingPlugin.Objects.VoteSite;
public class PlayerVoteEvent extends Event {
private static final HandlerList handlers = new HandlerList();
public static HandlerList getHandlerList() {
return handlers;
}
private User player;
private VoteSite voteSite;
private boolean cancelled;
public PlayerVoteEvent(VoteSite voteSite, User player) {
super();
setPlayer(player);
setVoteSite(voteSite);
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public User getPlayer() {
return player;
}
public VoteSite getVoteSite() {
return voteSite;
}
public boolean isCancelled() {
return cancelled;
}
public void setCancelled(boolean bln) {
cancelled = bln;
}
public void setPlayer(User player) {
this.player = player;
}
public void setVoteSite(VoteSite voteSite) {
this.voteSite = voteSite;
}
}
@@ -1,55 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Events;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.SignChangeEvent;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Data.ServerData;
import com.Ben12345rocks.VotingPlugin.Signs.Signs;
public class SignChange implements Listener {
private static Main plugin;
public SignChange(Main plugin) {
SignChange.plugin = plugin;
}
@EventHandler(ignoreCancelled = true)
public void onSignChange(SignChangeEvent event) {
if (event.getLine(0).equalsIgnoreCase("[VotingPlugin]")) {
if (Utils.getInstance().hasPermission(event.getPlayer(),
"Sign.Create")) {
try {
ServerData.getInstance().addSign(
event.getBlock().getLocation(), event.getLine(2),
Integer.parseInt(event.getLine(1)));
event.getPlayer().sendMessage(
Utils.getInstance().colorize("&aAdded sign!"));
Bukkit.getScheduler().runTaskAsynchronously(plugin,
new Runnable() {
@Override
public void run() {
Signs.getInstance().updateSigns();
}
});
} catch (Exception ex) {
event.getPlayer().sendMessage(
Utils.getInstance().colorize(
"&cError on sign creation!"));
ex.printStackTrace();
}
} else {
event.getPlayer().sendMessage(
ConfigFormat.getInstance().getNoPerms());
}
}
}
}
@@ -1,227 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Events;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Bungee.BungeeVote;
import com.Ben12345rocks.VotingPlugin.Config.Config;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Config.ConfigOtherRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
import com.Ben12345rocks.VotingPlugin.Data.Data;
import com.Ben12345rocks.VotingPlugin.Objects.User;
import com.Ben12345rocks.VotingPlugin.Objects.VoteSite;
import com.Ben12345rocks.VotingPlugin.OtherRewards.OtherVoteReward;
import com.Ben12345rocks.VotingPlugin.VoteParty.VoteParty;
import com.vexsoftware.votifier.model.Vote;
import com.vexsoftware.votifier.model.VotifierEvent;
public class VotiferEvent implements Listener {
static ConfigOtherRewards bonusReward = ConfigOtherRewards.getInstance();
static Config config = Config.getInstance();
static ConfigVoteSites configVoteSites = ConfigVoteSites.getInstance();
static ConfigFormat format = ConfigFormat.getInstance();
static Main plugin = Main.plugin;
public static void playerVote(String playerName, String voteSiteURL) {
User user = new User(playerName);
if (!user.hasJoinedBefore() && !config.allowUnJoined()) {
plugin.getLogger().info(
"Player " + playerName
+ " has not joined before, disregarding vote");
return;
}
String voteSiteName = Utils.getInstance().getVoteSiteName(voteSiteURL);
if (voteSiteName == null) {
plugin.getLogger().info("Error on votesite name");
return;
}
// ArrayList<String> sites = configVoteSites.getVoteSitesNames();
VoteSite voteSite = plugin.getVoteSite(voteSiteName);
if (voteSite == null) {
plugin.debug("VoteSite is null");
return;
}
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
VoteParty.getInstance().addTotal();
VoteParty.getInstance().addVotePlayer(user);
VoteParty.getInstance().check();
// broadcast vote if enabled in config
if (config.getBroadCastVotesEnabled()) {
if (!ConfigFormat.getInstance().getBroadcastWhenOnline()) {
voteSite.broadcastVote(user);
} else if (Utils.getInstance().isPlayerOnline(playerName)) {
voteSite.broadcastVote(user);
}
}
// update last vote time
user.setTime(voteSite);
// add to total votes
user.addTotal(voteSite);
user.addTotalDaily(voteSite);
user.addTotalWeekly(voteSite);
user.addPoints();
user.setReminded(false);
// check if player has voted on all sites in one day
boolean firstVote = OtherVoteReward.getInstance()
.checkFirstVote(user);
boolean allSites = OtherVoteReward.getInstance().checkAllSites(
user);
boolean numberOfVotes = OtherVoteReward.getInstance()
.checkNumberOfVotes(user);
if (Utils.getInstance().isPlayerOnline(playerName)) {
user.playerVote(voteSite);
if (firstVote) {
OtherVoteReward.getInstance()
.giveFirstVoteRewards(user);
}
if (allSites) {
OtherVoteReward.getInstance().giveAllSitesRewards(user);
}
if (numberOfVotes) {
OtherVoteReward.getInstance().giveNumberOfVotesRewards(
user);
}
user.sendVoteEffects();
} else {
if (firstVote) {
Data.getInstance()
.setFirstVoteOffline(
user,
Data.getInstance().getFirstVoteOffline(
user) + 1);
plugin.debug("Offline first vote reward set for "
+ playerName);
}
if (allSites) {
Data.getInstance()
.setAllSitesOffline(
user,
Data.getInstance().getAllSitesOffline(
user) + 1);
plugin.debug("Offline bonus reward set for "
+ playerName);
}
if (numberOfVotes) {
Data.getInstance().setNumberOfVotesOffline(
user,
Data.getInstance()
.getNumberOfVotesOffline(user) + 1);
plugin.debug("Offline number of votes reward set for "
+ playerName);
}
user.addOfflineVote(voteSite);
plugin.debug("Offline vote set for " + playerName + " on "
+ voteSiteName);
}
plugin.update();
}
});
}
public VotiferEvent(Main plugin) {
VotiferEvent.plugin = plugin;
}
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onVotiferEvent(VotifierEvent event) {
Vote vote = event.getVote();
String voteSite = vote.getServiceName();
String voteUsername = vote.getUsername();
if (voteUsername.length() == 0) {
plugin.getLogger().warning("No name from vote on " + voteSite);
return;
}
plugin.getLogger().info(
"Recieved a vote from '" + voteSite + "' by player '"
+ voteUsername + "'!");
plugin.debug("PlayerUsername: " + voteUsername);
plugin.debug("VoteSite: " + voteSite);
String voteSiteName = Utils.getInstance().getVoteSiteName(voteSite);
PlayerVoteEvent voteEvent = new PlayerVoteEvent(
plugin.getVoteSite(voteSiteName), new User(voteUsername));
plugin.getServer().getPluginManager().callEvent(voteEvent);
if (voteEvent.isCancelled()) {
return;
}
ArrayList<String> sites = configVoteSites.getVoteSitesNames();
if (sites != null) {
if (!sites.contains(voteSiteName)
&& Config.getInstance().getAutoCreateVoteSites()) {
plugin.getLogger().warning(
"VoteSite " + voteSiteName
+ " doe not exist, generaterating one...");
ConfigVoteSites.getInstance().generateVoteSite(voteSiteName);
ConfigVoteSites.getInstance().setServiceSite(voteSiteName,
voteSite);
}
} else if (Config.getInstance().getAutoCreateVoteSites()) {
plugin.getLogger().warning(
"VoteSite " + voteSiteName
+ " doe not exist, generaterating one...");
ConfigVoteSites.getInstance().generateVoteSite(voteSiteName);
ConfigVoteSites.getInstance()
.setServiceSite(voteSiteName, voteSite);
}
try {
BungeeVote.getInstance().sendVote(vote);
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
e.printStackTrace();
}
playerVote(voteUsername, voteSite);
}
}
@@ -1,57 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Files;
import java.io.File;
import java.io.IOException;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import com.Ben12345rocks.VotingPlugin.Main;
public class Files {
public class ReadThread extends Thread {
public void editFile(File file, FileConfiguration data) {
try {
data.save(file);
} catch (IOException e) {
Bukkit.getServer()
.getLogger()
.severe(ChatColor.RED + "Could not save "
+ file.getName());
}
}
@Override
public void run() {
// plugin.getLogger().info("File Editing Thread Loaded!");
}
}
static Files instance = new Files();
static Main plugin = Main.plugin;
public static Files getInstance() {
return instance;
}
public ReadThread thread;
private Files() {
}
public Files(Main plugin) {
Files.plugin = plugin;
}
public void editFile(File file, FileConfiguration data) {
thread.editFile(file, data);
}
public void loadFileEditngThread() {
thread = new ReadThread();
thread.start();
}
}
@@ -1,135 +0,0 @@
/* Obtained from https://www.spigotmc.org/threads/libish-inventory-api-kinda.49339/
*/
package com.Ben12345rocks.VotingPlugin.Inventory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import com.Ben12345rocks.VotingPlugin.Utils;
public class BInventory implements Listener {
public static void openInventory(Player player, BInventory inventory) {
Inventory inv = Bukkit.createInventory(player,
inventory.getInventorySize(), inventory.getInventoryName());
Iterator<Entry<Integer, BInventoryButton>> it = inventory.getButtons()
.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<Integer, BInventoryButton> pair = it.next();
{
ItemStack item = pair.getValue().getItem();
ItemMeta meta = item.getItemMeta();
if (pair.getValue().getName() != null) {
meta.setDisplayName(pair.getValue().getName());
}
if (pair.getValue().getLore() != null) {
meta.setLore(new ArrayList<String>(Arrays.asList(pair
.getValue().getLore())));
}
item.setItemMeta(meta);
inv.setItem(pair.getKey(), item);
}
inv.setItem(pair.getKey(), pair.getValue().getItem());
}
player.openInventory(inv);
}
private String inventoryName;
private Map<Integer, BInventoryButton> buttons = new HashMap<Integer, BInventoryButton>();
public BInventory(String name) {
setInventoryName(name);
Bukkit.getPluginManager().registerEvents(this,
Bukkit.getPluginManager().getPlugins()[0]);
}
public void addButton(int position, BInventoryButton button) {
getButtons().put(position, button);
}
/**
* @return the inventory buttons
*/
public Map<Integer, BInventoryButton> getButtons() {
return buttons;
}
public int getHighestSlot() {
int highestNum = 0;
for (int num : buttons.keySet()) {
if (num > highestNum) {
highestNum = num;
}
}
return highestNum;
}
public String getInventoryName() {
return inventoryName;
}
public int getInventorySize() {
int highestSlot = getHighestSlot();
if (highestSlot <= 9) {
return 9;
} else if (highestSlot < 18) {
return 18;
} else if (highestSlot < 27) {
return 27;
} else if (highestSlot < 36) {
return 36;
} else if (highestSlot < 45) {
return 45;
} else {
return 45;
}
}
// event handling
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onInventoryClick(InventoryClickEvent event) {
if (!(event.getWhoClicked() instanceof Player)) {
return;
}
// Main.plugin.debug("Event ran");
Inventory inv = event.getInventory();
if (inv.getName().equalsIgnoreCase(getInventoryName())) {
// Main.plugin.debug("Iventory equal");
for (int buttonSlot : getButtons().keySet()) {
BInventoryButton button = getButtons().get(buttonSlot);
if (event.getSlot() == buttonSlot) {
// Main.plugin.debug("Running onclick");
button.onClick(event);
event.setCancelled(true);
return;
}
}
}
}
public void setInventoryName(String inventoryName) {
this.inventoryName = Utils.getInstance().colorize(inventoryName);
}
}
@@ -1,79 +0,0 @@
/* Obtained from https://www.spigotmc.org/threads/libish-inventory-api-kinda.49339/
*/
package com.Ben12345rocks.VotingPlugin.Inventory;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import com.Ben12345rocks.VotingPlugin.Utils;
public abstract class BInventoryButton {
private String name;
private String[] lore;
private ItemStack item;
private int slot;
public BInventoryButton(String name, String[] lore, ItemStack item) {
setName(name);
setLore(lore);
setItem(item);
}
/**
* @return the item
*/
public ItemStack getItem() {
return item;
}
/**
* @return the lore
*/
public String[] getLore() {
return lore;
}
/**
* @return the name
*/
public String getName() {
return name;
}
public int getSlot() {
return slot;
}
public abstract void onClick(InventoryClickEvent event);
/**
* @param item
* the item to set
*/
public void setItem(ItemStack item) {
this.item = item;
}
/**
* @param lore
* the lore to set
*/
public void setLore(String[] lore) {
this.lore = Utils.getInstance().colorize(lore);
}
/**
* @param name
* the name to set
*/
public void setName(String name) {
this.name = Utils.getInstance().colorize(name);
}
public void setSlot(int slot) {
this.slot = slot;
}
}
@@ -1,347 +0,0 @@
package com.Ben12345rocks.VotingPlugin;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import com.Ben12345rocks.VotingPlugin.Commands.CommandLoader;
import com.Ben12345rocks.VotingPlugin.Commands.Commands;
import com.Ben12345rocks.VotingPlugin.Commands.Executers.CommandAdminVote;
import com.Ben12345rocks.VotingPlugin.Commands.Executers.CommandVote;
import com.Ben12345rocks.VotingPlugin.Commands.TabCompleter.AdminVoteTabCompleter;
import com.Ben12345rocks.VotingPlugin.Commands.TabCompleter.VoteTabCompleter;
import com.Ben12345rocks.VotingPlugin.Config.Config;
import com.Ben12345rocks.VotingPlugin.Config.ConfigBungeeVoting;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Config.ConfigGUI;
import com.Ben12345rocks.VotingPlugin.Config.ConfigOtherRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigTopVoterAwards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteReminding;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
import com.Ben12345rocks.VotingPlugin.Data.ServerData;
import com.Ben12345rocks.VotingPlugin.Events.BlockBreak;
import com.Ben12345rocks.VotingPlugin.Events.PlayerInteract;
import com.Ben12345rocks.VotingPlugin.Events.PlayerJoinEvent;
import com.Ben12345rocks.VotingPlugin.Events.SignChange;
import com.Ben12345rocks.VotingPlugin.Events.VotiferEvent;
import com.Ben12345rocks.VotingPlugin.Files.Files;
import com.Ben12345rocks.VotingPlugin.Metrics.Metrics;
import com.Ben12345rocks.VotingPlugin.Objects.CommandHandler;
import com.Ben12345rocks.VotingPlugin.Objects.Reward;
import com.Ben12345rocks.VotingPlugin.Objects.SignHandler;
import com.Ben12345rocks.VotingPlugin.Objects.UUID;
import com.Ben12345rocks.VotingPlugin.Objects.User;
import com.Ben12345rocks.VotingPlugin.Objects.VoteSite;
import com.Ben12345rocks.VotingPlugin.Signs.Signs;
import com.Ben12345rocks.VotingPlugin.TopVoter.TopVoter;
import com.Ben12345rocks.VotingPlugin.Updater.CheckUpdate;
import com.Ben12345rocks.VotingPlugin.Updater.Updater;
import com.Ben12345rocks.VotingPlugin.VoteParty.VoteParty;
import com.Ben12345rocks.VotingPlugin.VoteReminding.VoteReminding;
public class Main extends JavaPlugin {
public static Config config;
public static ConfigOtherRewards configBonusReward;
public static ConfigGUI configGUI;
public static ConfigFormat configFormat;
public static ConfigVoteSites configVoteSites;
public static Main plugin;
public Economy econ = null;
public HashMap<User, Integer> topVoterMonthly;
public HashMap<User, Integer> topVoterWeekly;
public HashMap<User, Integer> topVoterDaily;
public Updater updater;
public ArrayList<CommandHandler> voteCommand;
public ArrayList<CommandHandler> adminVoteCommand;
public ArrayList<VoteSite> voteSites;
public HashMap<User, HashMap<VoteSite, Date>> voteToday;
public boolean placeHolderAPIEnabled;
public ArrayList<Reward> rewards;
public boolean spigotLibEnabled;
public ArrayList<SignHandler> signs;
public void checkPlaceHolderAPI() {
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
placeHolderAPIEnabled = true;
plugin.debug("PlaceholderAPI found, will attempt to parse placeholders");
} else {
placeHolderAPIEnabled = false;
plugin.debug("PlaceholderAPI not found, PlaceholderAPI placeholders will not work");
}
}
public void checkSpigotLib() {
if (Bukkit.getPluginManager().getPlugin("SpigotLib") != null) {
spigotLibEnabled = true;
plugin.debug("Found SpigotLib, will attempt to send titles");
} else {
spigotLibEnabled = false;
plugin.debug("SpigotLib not found, titles will not send");
}
}
private void checkVotifier() {
if (getServer().getPluginManager().getPlugin("Votifier") == null) {
plugin.debug("Votifier not found, votes may not work");
}
}
public void debug(String message) {
if (config.getDebugEnabled()) {
plugin.getLogger().info("Debug: " + message);
}
}
public User getUser(String playerName) {
return new User(playerName);
}
public User getUser(UUID uuid) {
return new User(uuid);
}
public VoteSite getVoteSite(String siteName) {
for (VoteSite voteSite : voteSites) {
if (voteSite.getSiteName().equalsIgnoreCase(siteName)) {
return voteSite;
}
}
if (config.getAutoCreateVoteSites()) {
configVoteSites.generateVoteSite(siteName);
return new VoteSite(siteName);
} else {
return null;
}
}
public void loadRewards() {
ConfigRewards.getInstance().setupExample();
rewards = new ArrayList<Reward>();
for (String reward : ConfigRewards.getInstance().getRewardNames()) {
rewards.add(new Reward(reward));
}
plugin.debug("Loaded rewards");
}
public void loadVoteSites() {
configVoteSites.setup("ExampleVoteSite");
voteSites = configVoteSites.getVoteSitesLoad();
plugin.debug("Loaded VoteSites");
}
private void metrics() {
try {
Metrics metrics = new Metrics(this);
metrics.start();
plugin.debug("Loaded Metrics");
} catch (IOException e) {
plugin.getLogger().info("Can't submit metrics stats");
}
}
@Override
public void onDisable() {
Signs.getInstance().storeSigns();
plugin = null;
}
@Override
public void onEnable() {
plugin = this;
Files.getInstance().loadFileEditngThread();
setupFiles();
registerCommands();
registerEvents();
if (setupEconomy()) {
plugin.debug("Succesfully hooked into vault");
} else {
plugin.getLogger()
.info("Failed to load vault, giving players money directy will not work");
}
checkVotifier();
metrics();
CheckUpdate.getInstance().startUp();
checkPlaceHolderAPI();
checkSpigotLib();
loadVoteSites();
loadRewards();
VoteReminding.getInstance().loadRemindChecking();
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
Signs.getInstance().loadSigns();
}
});
topVoterMonthly = new HashMap<User, Integer>();
topVoterWeekly = new HashMap<User, Integer>();
topVoterDaily = new HashMap<User, Integer>();
voteToday = new HashMap<User, HashMap<VoteSite, Date>>();
VoteParty.getInstance().check();
startTimer();
plugin.getLogger().info(
"Enabled VotingPlgin " + plugin.getDescription().getVersion());
}
private void registerCommands() {
CommandLoader.getInstance().loadCommands();
CommandLoader.getInstance().loadAliases();
// /vote, /v
getCommand("vote").setExecutor(new CommandVote(this));
getCommand("vote").setTabCompleter(new VoteTabCompleter());
getCommand("v").setExecutor(new CommandVote(this));
getCommand("v").setTabCompleter(new VoteTabCompleter());
// /adminvote, /av
getCommand("adminvote").setExecutor(new CommandAdminVote(this));
getCommand("adminvote").setTabCompleter(new AdminVoteTabCompleter());
getCommand("av").setExecutor(new CommandAdminVote(this));
getCommand("av").setTabCompleter(new AdminVoteTabCompleter());
plugin.debug("Loaded Commands");
}
private void registerEvents() {
PluginManager pm = getServer().getPluginManager();
pm.registerEvents(new PlayerJoinEvent(this), this);
pm.registerEvents(new VotiferEvent(this), this);
pm.registerEvents(new SignChange(this), this);
pm.registerEvents(new BlockBreak(this), this);
pm.registerEvents(new PlayerInteract(this), this);
plugin.debug("Loaded Events");
}
public void reload() {
config.reloadData();
configGUI.reloadData();
configFormat.reloadData();
plugin.loadVoteSites();
configBonusReward.reloadData();
ConfigVoteReminding.getInstance().reloadData();
plugin.setupFiles();
loadRewards();
ServerData.getInstance().reloadData();
plugin.update();
}
private boolean setupEconomy() {
if (getServer().getPluginManager().getPlugin("Vault") == null) {
return false;
}
RegisteredServiceProvider<Economy> rsp = getServer()
.getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
return false;
}
econ = rsp.getProvider();
return econ != null;
}
public void setupFiles() {
config = Config.getInstance();
configVoteSites = ConfigVoteSites.getInstance();
configFormat = ConfigFormat.getInstance();
configBonusReward = ConfigOtherRewards.getInstance();
configGUI = ConfigGUI.getInstance();
config.setup(this);
configFormat.setup(this);
configBonusReward.setup(this);
configGUI.setup(plugin);
ConfigVoteReminding.getInstance().setup(plugin);
ConfigBungeeVoting.getInstance().setup(plugin);
ServerData.getInstance().setup(plugin);
ConfigTopVoterAwards.getInstance().setup(plugin);
plugin.debug("Loaded Files");
}
public void startTimer() {
Bukkit.getScheduler().runTaskTimerAsynchronously(plugin,
new Runnable() {
@Override
public void run() {
update();
}
}, 50, config.getBackgroundTaskDelay() * 20);
plugin.debug("Loaded timer for background task");
}
public void update() {
try {
TopVoter.getInstance().updateTopVoters();
TopVoter.getInstance().checkTopVoterAward();
updater = new Updater(this, 15358, false);
Commands.getInstance().updateVoteToday();
ServerData.getInstance().updateValues();
Signs.getInstance().updateSigns();
ConfigRewards.getInstance().checkDelayedTimedRewards();
for (Player player : Bukkit.getOnlinePlayers()) {
new User(player).offVoteWorld(player.getWorld().getName());
}
plugin.debug("Background task ran");
} catch (Exception ex) {
plugin.getLogger()
.info("Looks like there are no data files or something went wrong.");
ex.printStackTrace();
}
}
}
@@ -1,616 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Metrics;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import com.Ben12345rocks.VotingPlugin.Main;
/**
* <p>
* The metrics class obtains data about a plugin and submits statistics about it
* to the metrics backend.
* </p>
* <p>
* Public methods provided by this class:
* </p>
* <code>
* Graph createGraph(String name); <br/>
* void addCustomData(Metrics.Plotter plotter); <br/>
* void start(); <br/>
* </code>
*/
public class Metrics {
/**
* Represents a custom graph on the website
*/
public static class Graph {
/**
* The graph's name, alphanumeric and spaces only :) If it does not
* comply to the above when submitted, it is rejected
*/
private final String name;
/**
* The set of plotters that are contained within this graph
*/
private final Set<Plotter> plotters = new LinkedHashSet<Plotter>();
private Graph(final String name) {
this.name = name;
}
/**
* Add a plotter to the graph, which will be used to plot entries
*
* @param plotter
*/
public void addPlotter(final Plotter plotter) {
plotters.add(plotter);
}
@Override
public boolean equals(final Object object) {
if (!(object instanceof Graph)) {
return false;
}
final Graph graph = (Graph) object;
return graph.name.equals(name);
}
/**
* Gets the graph's name
*
* @return
*/
public String getName() {
return name;
}
/**
* Gets an <b>unmodifiable</b> set of the plotter objects in the graph
*
* @return
*/
public Set<Plotter> getPlotters() {
return Collections.unmodifiableSet(plotters);
}
@Override
public int hashCode() {
return name.hashCode();
}
/**
* Remove a plotter from the graph
*
* @param plotter
*/
public void removePlotter(final Plotter plotter) {
plotters.remove(plotter);
}
}
/**
* Interface used to collect custom data for a plugin
*/
public static abstract class Plotter {
/**
* The plot's name
*/
private final String name;
/**
* Construct a plotter with the default plot name
*/
public Plotter() {
this("Default");
}
/**
* Construct a plotter with a specific plot name
*
* @param name
*/
public Plotter(final String name) {
this.name = name;
}
@Override
public boolean equals(final Object object) {
if (!(object instanceof Plotter)) {
return false;
}
final Plotter plotter = (Plotter) object;
return plotter.name.equals(name)
&& (plotter.getValue() == getValue());
}
/**
* Get the column name for the plotted point
*
* @return the plotted point's column name
*/
public String getColumnName() {
return name;
}
/**
* Get the current value for the plotted point
*
* @return
*/
public abstract int getValue();
@Override
public int hashCode() {
return getColumnName().hashCode() + getValue();
}
/**
* Called after the website graphs have been updated
*/
public void reset() {
}
}
/**
* The base url of the metrics domain
*/
private static final String BASE_URL = "http://mcstats.org";
/**
* The file where guid and opt out is stored in
*/
private static final String CONFIG_FILE = "plugins/PluginMetrics/config.yml";
/**
* The separator to use for custom data. This MUST NOT change unless you are
* hosting your own version of metrics and want to change it.
*/
private static final String CUSTOM_DATA_SEPARATOR = "~~";
/**
* Interval of time to ping (in minutes)
*/
private static final int PING_INTERVAL = 10;
/**
* The url used to report a server's status
*/
private static final String REPORT_URL = "/report/%s";
/**
* The current revision number
*/
private final static int REVISION = 5;
/**
* Encode text as UTF-8
*
* @param text
* @return
*/
private static String encode(final String text)
throws UnsupportedEncodingException {
return URLEncoder.encode(text, "UTF-8");
}
/**
* <p>
* Encode a key/value data pair to be used in a HTTP post request. This
* INCLUDES a & so the first key/value pair MUST be included manually, e.g:
* </p>
* <code>
* StringBuffer data = new StringBuffer();
* data.append(encode("guid")).append('=').append(encode(guid));
* encodeDataPair(data, "version", description.getVersion());
* </code>
*
* @param buffer
* @param key
* @param value
* @return
*/
private static void encodeDataPair(final StringBuilder buffer,
final String key, final String value)
throws UnsupportedEncodingException {
buffer.append('&').append(encode(key)).append('=')
.append(encode(value));
}
/**
* The plugin configuration file
*/
private final YamlConfiguration configuration;
/**
* The plugin configuration file
*/
private final File configurationFile;
/**
* The default graph, used for addCustomData when you don't want a specific
* graph
*/
private final Graph defaultGraph = new Graph("Default");
/**
* All of the custom graphs to submit to metrics
*/
private final Set<Graph> graphs = Collections
.synchronizedSet(new HashSet<Graph>());
/**
* Unique server id
*/
private final String guid;
/**
* Lock for synchronization
*/
private final Object optOutLock = new Object();
/**
* The plugin this metrics submits for
*/
private final Plugin plugin;
/**
* Id of the scheduled task
*/
private volatile int taskId = -1;
public Metrics(final Plugin plugin) throws IOException {
if (plugin == null) {
throw new IllegalArgumentException("Plugin cannot be null");
}
this.plugin = plugin;
// load the config
configurationFile = new File(CONFIG_FILE);
configuration = YamlConfiguration.loadConfiguration(configurationFile);
// add some defaults
configuration.addDefault("opt-out", false);
configuration.addDefault("guid", UUID.randomUUID().toString());
// Do we need to create the file?
if (configuration.get("guid", null) == null) {
configuration.options().header("http://mcstats.org")
.copyDefaults(true);
configuration.save(configurationFile);
}
// Load the guid then
guid = configuration.getString("guid");
}
/**
* Adds a custom data plotter to the default graph
*
* @param plotter
*/
public void addCustomData(final Plotter plotter) {
if (plotter == null) {
throw new IllegalArgumentException("Plotter cannot be null");
}
// Add the plotter to the graph o/
defaultGraph.addPlotter(plotter);
// Ensure the default graph is included in the submitted graphs
graphs.add(defaultGraph);
}
/**
* Construct and create a Graph that can be used to separate specific
* plotters to their own graphs on the metrics website. Plotters can be
* added to the graph object returned.
*
* @param name
* @return Graph object created. Will never return NULL under normal
* circumstances unless bad parameters are given
*/
public Graph createGraph(final String name) {
if (name == null) {
throw new IllegalArgumentException("Graph name cannot be null");
}
// Construct the graph object
final Graph graph = new Graph(name);
// Now we can add our graph
graphs.add(graph);
// and return back
return graph;
}
/**
* Disables metrics for the server by setting "opt-out" to true in the
* config file and canceling the metrics task.
*
* @throws IOException
*/
public void disable() throws IOException {
// This has to be synchronized or it can collide with the check in the
// task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set
// it.
if (!isOptOut()) {
configuration.set("opt-out", true);
configuration.save(configurationFile);
}
// Disable Task, if it is running
if (taskId > 0) {
plugin.getServer().getScheduler().cancelTask(taskId);
taskId = -1;
}
}
}
/**
* Enables metrics for the server by setting "opt-out" to false in the
* config file and starting the metrics task.
*
* @throws IOException
*/
public void enable() throws IOException {
// This has to be synchronized or it can collide with the check in the
// task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set
// it.
if (isOptOut()) {
configuration.set("opt-out", false);
configuration.save(configurationFile);
}
// Enable Task, if it is not running
if (taskId < 0) {
start();
}
}
}
/**
* Check if mineshafter is present. If it is, we need to bypass it to send
* POST requests
*
* @return
*/
private boolean isMineshafterPresent() {
try {
Class.forName("mineshafter.MineServer");
return true;
} catch (Exception e) {
return false;
}
}
/**
* Has the server owner denied plugin metrics?
*
* @return
*/
public boolean isOptOut() {
synchronized (optOutLock) {
try {
// Reload the metrics file
configuration.load(CONFIG_FILE);
} catch (IOException ex) {
Main.plugin.debug("[Metrics] " + ex.getMessage());
return true;
} catch (InvalidConfigurationException ex) {
Main.plugin.debug("[Metrics] " + ex.getMessage());
return true;
}
return configuration.getBoolean("opt-out", false);
}
}
/**
* Generic method that posts a plugin to the metrics website
*/
private void postPlugin(final boolean isPing) throws IOException {
// The plugin's description file containg all of the plugin data such as
// name, version, author, etc
final PluginDescriptionFile description = plugin.getDescription();
// Construct the post data
final StringBuilder data = new StringBuilder();
data.append(encode("guid")).append('=').append(encode(guid));
encodeDataPair(data, "version", description.getVersion());
encodeDataPair(data, "server", Bukkit.getVersion());
encodeDataPair(data, "players",
Integer.toString(Bukkit.getServer().getOnlinePlayers().size()));
encodeDataPair(data, "revision", String.valueOf(REVISION));
// If we're pinging, append it
if (isPing) {
encodeDataPair(data, "ping", "true");
}
// Acquire a lock on the graphs, which lets us make the assumption we
// also lock everything
// inside of the graph (e.g plotters)
synchronized (graphs) {
final Iterator<Graph> iter = graphs.iterator();
while (iter.hasNext()) {
final Graph graph = iter.next();
for (Plotter plotter : graph.getPlotters()) {
// The key name to send to the metrics server
// The format is C-GRAPHNAME-PLOTTERNAME where separator -
// is defined at the top
// Legacy (R4) submitters use the format Custom%s, or
// CustomPLOTTERNAME
final String key = String.format("C%s%s%s%s",
CUSTOM_DATA_SEPARATOR, graph.getName(),
CUSTOM_DATA_SEPARATOR, plotter.getColumnName());
// The value to send, which for the foreseeable future is
// just the string
// value of plotter.getValue()
final String value = Integer.toString(plotter.getValue());
// Add it to the http post data :)
encodeDataPair(data, key, value);
}
}
}
// Create the url
URL url = new URL(BASE_URL
+ String.format(REPORT_URL, encode(plugin.getDescription()
.getName())));
// Connect to the website
URLConnection connection;
// Mineshafter creates a socks proxy, so we can safely bypass it
// It does not reroute POST requests so we need to go around it
if (isMineshafterPresent()) {
connection = url.openConnection(Proxy.NO_PROXY);
} else {
connection = url.openConnection();
}
connection.setDoOutput(true);
// Write the data
final OutputStreamWriter writer = new OutputStreamWriter(
connection.getOutputStream());
writer.write(data.toString());
writer.flush();
// Now read the response
final BufferedReader reader = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
final String response = reader.readLine();
// close resources
writer.close();
reader.close();
if ((response == null) || response.startsWith("ERR")) {
throw new IOException(response); // Throw the exception
} else {
// Is this the first update this hour?
if (response.contains("OK This is your first update this hour")) {
synchronized (graphs) {
final Iterator<Graph> iter = graphs.iterator();
while (iter.hasNext()) {
final Graph graph = iter.next();
for (Plotter plotter : graph.getPlotters()) {
plotter.reset();
}
}
}
}
}
}
/**
* Start measuring statistics. This will immediately create an async
* repeating task as the plugin and send the initial data to the metrics
* backend, and then after that it will post in increments of PING_INTERVAL
* * 1200 ticks.
*
* @return True if statistics measuring is running, otherwise false.
*/
@SuppressWarnings("deprecation")
public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
return false;
}
// Is metrics already running?
if (taskId >= 0) {
return true;
}
// Begin hitting the server with glorious data
taskId = plugin.getServer().getScheduler()
.scheduleAsyncRepeatingTask(plugin, new Runnable() {
private boolean firstPost = true;
@Override
public void run() {
try {
// This has to be synchronized or it can collide
// with the disable method.
synchronized (optOutLock) {
// Disable Task, if it is running and the
// server owner decided to opt-out
if (isOptOut() && (taskId > 0)) {
plugin.getServer().getScheduler()
.cancelTask(taskId);
taskId = -1;
}
}
// We use the inverse of firstPost because if it
// is the first time we are posting,
// it is not a interval ping, so it evaluates to
// FALSE
// Each time thereafter it will evaluate to
// TRUE, i.e PING!
postPlugin(!firstPost);
// After the first post we set firstPost to
// false
// Each post thereafter will be a ping
firstPost = false;
} catch (IOException e) {
Main.plugin.debug("[Metrics] " + e.getMessage());
}
}
}, 0, PING_INTERVAL * 1200);
return true;
}
}
}
@@ -1,181 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Objects;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.command.CommandSender;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
public abstract class CommandHandler {
static Main plugin = Main.plugin;
private String[] args;
private String perm;
private String helpMessage;
public CommandHandler(String[] args, String perm) {
this.args = args;
this.perm = perm;
helpMessage = "Unknown Help Message";
}
public CommandHandler(String[] args, String perm, String helpMessage) {
this.args = args;
this.perm = perm;
this.helpMessage = helpMessage;
}
public boolean argsMatch(String arg, int i) {
if (i < args.length) {
String[] cmdArgs = args[i].split("&");
for (String cmdArg : cmdArgs) {
if (cmdArg.equalsIgnoreCase("(player)")
|| cmdArg.equalsIgnoreCase("(SITENAME)")
|| cmdArg.equalsIgnoreCase("(reward)")
|| cmdArg.equalsIgnoreCase("(number)")
|| cmdArg.equalsIgnoreCase("(string)")
|| cmdArg.equalsIgnoreCase("(boolean)")
|| cmdArg.equalsIgnoreCase("(list)")
|| arg.equalsIgnoreCase(cmdArg)) {
return true;
}
}
/*
* if (args[i].split("|").length <= 1) { if
* (args[i].equalsIgnoreCase("player") ||
* args[i].equalsIgnoreCase("SITENAME") ||
* args[i].equalsIgnoreCase("number") ||
* args[i].equalsIgnoreCase("string") ||
* args[i].equalsIgnoreCase("boolean") ||
* args[i].equalsIgnoreCase("list") ||
* arg.equalsIgnoreCase(args[i])) { return true; } } else {
*
* }
*/
return false;
}
return false;
}
public abstract void execute(CommandSender sender, String[] args);
public String[] getArgs() {
return args;
}
public TextComponent getHelpLine(String command) {
String line = ConfigFormat.getInstance().getCommandsVoteHelpLine();
String commandText = getHelpLineCommand(command);
line = line.replace("%Command%", commandText);
if (getHelpMessage() != "") {
line = line.replace("%HelpMessage%", getHelpMessage());
}
TextComponent txt = Utils.getInstance().stringToComp(line);
txt.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND,
commandText));
txt.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
new ComponentBuilder(getHelpMessage()).color(ChatColor.AQUA)
.create()));
return txt;
}
public String getHelpLineCommand(String command) {
String commandText = command;
for (String arg1 : args) {
int count = 1;
for (String arg : arg1.split("&")) {
if (count == 1) {
if (arg.equalsIgnoreCase("(player)")) {
commandText += " (Player)";
} else if (arg.equalsIgnoreCase("(sitename)")) {
commandText += " (SiteName)";
} else if (arg.equalsIgnoreCase("(reward)")) {
commandText += " (Reward)";
} else if (arg.equalsIgnoreCase("(boolean)")) {
commandText += " (True/False)";
} else if (arg.equalsIgnoreCase("(number)")) {
commandText += " (Number)";
} else if (arg.equalsIgnoreCase("(string)")) {
commandText += " (Text)";
} else {
commandText += " " + arg;
}
} else {
if (arg.equalsIgnoreCase("(player)")) {
commandText += "/(Player)";
} else if (arg.equalsIgnoreCase("(sitename)")) {
commandText += "/(SiteName)";
} else if (arg.equalsIgnoreCase("(reward)")) {
commandText += "/(Reward)";
} else if (arg.equalsIgnoreCase("(boolean)")) {
commandText += "/(True/False)";
} else if (arg.equalsIgnoreCase("(number)")) {
commandText += "/(Number)";
} else if (arg.equalsIgnoreCase("(string)")) {
commandText += "/(Text)";
} else {
commandText += "/" + arg;
}
}
count++;
}
}
return commandText;
}
public String getHelpMessage() {
return helpMessage;
}
public String getPerm() {
return perm;
}
public boolean runCommand(CommandSender sender, String[] args) {
if (args.length >= this.args.length) {
for (int i = 0; i < args.length; i++) {
if (!argsMatch(args[i], i)) {
return false;
}
if (this.args[i].equalsIgnoreCase("(number)")) {
if (!Utils.getInstance().isInt(args[i])) {
sender.sendMessage(Utils.getInstance().colorize(
ConfigFormat.getInstance().getNotNumber()
.replace("%arg%", args[i])));
return true;
}
}
}
if (perm != "") {
if (!sender.hasPermission(perm)) {
sender.sendMessage(Utils.getInstance().colorize(
ConfigFormat.getInstance().getNoPerms()));
plugin.debug(sender.getName()
+ " was denied access to command");
return true;
}
}
execute(sender, args);
return true;
}
return false;
}
public void setHelpMessage(String helpMessage) {
this.helpMessage = helpMessage;
}
public void setPerm(String perm) {
this.perm = perm;
}
}
@@ -1,772 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Objects;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Set;
import org.apache.commons.lang.time.DateUtils;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Config.ConfigRewards;
import com.Ben12345rocks.VotingPlugin.Data.Data;
public class Reward {
static Main plugin = Main.plugin;
public String name;
private boolean delayEnabled;
private int delayHours;
private int delayMinutes;
private boolean timedEnabled;
private int timedHour;
private int timedMinute;
private double chance;
private double randomChance;
private ArrayList<String> randomRewards;
private ArrayList<String> randomFallBack;
private boolean requirePermission;
private ArrayList<String> worlds;
private boolean giveInEachWorld;
private Set<String> items;
private HashMap<String, String> itemMaterial;
private HashMap<String, String> itemSkull;
private HashMap<String, Integer> itemData;
private HashMap<String, Integer> itemDurabilty;
private HashMap<String, Integer> itemAmount;
private HashMap<String, Integer> itemMinAmount;
private HashMap<String, Integer> itemMaxAmount;
private HashMap<String, String> itemName;
private HashMap<String, ArrayList<String>> itemLore;
private HashMap<String, HashMap<String, Integer>> itemEnchants;
private int money;
private int MinMoney;
private int MaxMoney;
private int exp;
private ArrayList<String> consoleCommands;
private ArrayList<String> playerCommands;
private Set<String> potions;
private HashMap<String, Integer> potionsDuration;
private HashMap<String, Integer> potionsAmplifier;
private String rewardMsg;
public Reward(Main plugin) {
Reward.plugin = plugin;
}
public Reward(String reward) {
name = reward;
setDelayEnabled(ConfigRewards.getInstance().getDelayedEnabled(reward));
setDelayHours(ConfigRewards.getInstance().getDelayedHours(reward));
setDelayMinutes(ConfigRewards.getInstance().getDelayedMinutes(reward));
setTimedEnabled(ConfigRewards.getInstance().getTimedEnabled(reward));
setTimedHour(ConfigRewards.getInstance().getTimedHour(reward));
setTimedMinute(ConfigRewards.getInstance().getTimedMinute(reward));
setChance(ConfigRewards.getInstance().getChance(reward));
setRandomChance(ConfigRewards.getInstance().getRandomChance(reward));
setRandomRewards(ConfigRewards.getInstance().getRandomRewards(reward));
setRandomFallBack(ConfigRewards.getInstance().getRandomFallBack(reward));
setRequirePermission(ConfigRewards.getInstance().getRequirePermission(
reward));
setWorlds(ConfigRewards.getInstance().getWorlds(reward));
setGiveInEachWorld(ConfigRewards.getInstance().getGiveInEachWorld(
reward));
setItems(ConfigRewards.getInstance().getItems(reward));
itemMaterial = new HashMap<String, String>();
itemData = new HashMap<String, Integer>();
itemSkull = new HashMap<String, String>();
itemDurabilty = new HashMap<String, Integer>();
itemAmount = new HashMap<String, Integer>();
itemMinAmount = new HashMap<String, Integer>();
itemMaxAmount = new HashMap<String, Integer>();
itemName = new HashMap<String, String>();
itemLore = new HashMap<String, ArrayList<String>>();
itemName = new HashMap<String, String>();
itemEnchants = new HashMap<String, HashMap<String, Integer>>();
for (String item : ConfigRewards.getInstance().getItems(reward)) {
itemMaterial.put(item,
ConfigRewards.getInstance().getItemMaterial(reward, item));
itemData.put(item,
ConfigRewards.getInstance().getItemData(reward, item));
itemAmount.put(item,
ConfigRewards.getInstance().getItemAmount(reward, item));
itemMinAmount.put(item, ConfigRewards.getInstance()
.getItemMinAmount(reward, item));
itemMaxAmount.put(item, ConfigRewards.getInstance()
.getItemMaxAmount(reward, item));
itemName.put(item,
ConfigRewards.getInstance().getItemName(reward, item));
itemLore.put(item,
ConfigRewards.getInstance().getItemLore(reward, item));
itemDurabilty.put(item, ConfigRewards.getInstance()
.getItemDurability(reward, item));
itemSkull.put(item,
ConfigRewards.getInstance().getItemSkull(reward, item));
HashMap<String, Integer> enchants = new HashMap<String, Integer>();
for (String enchant : ConfigRewards.getInstance().getItemEnchants(
reward, item)) {
enchants.put(enchant, ConfigRewards.getInstance()
.getItemEnchantsLevel(reward, item, enchant));
}
itemEnchants.put(item, enchants);
}
setMoney(ConfigRewards.getInstance().getMoney(reward));
setMinMoney(ConfigRewards.getInstance().getMinMoney(reward));
setMaxMoney(ConfigRewards.getInstance().getMaxMoney(reward));
setExp(ConfigRewards.getInstance().getEXP(reward));
setConsoleCommands(ConfigRewards.getInstance().getCommandsConsole(
reward));
setPlayerCommands(ConfigRewards.getInstance().getCommandsPlayer(reward));
potions = ConfigRewards.getInstance().getPotions(reward);
potionsDuration = new HashMap<String, Integer>();
potionsAmplifier = new HashMap<String, Integer>();
for (String potion : potions) {
potionsDuration.put(potion, ConfigRewards.getInstance()
.getPotionsDuration(reward, potion));
potionsAmplifier.put(potion, ConfigRewards.getInstance()
.getPotionsAmplifier(reward, potion));
}
setRewardMsg(ConfigRewards.getInstance().getMessagesReward(reward));
}
public boolean checkChance() {
double chance = getChance();
if ((chance == 0) || (chance == 100)) {
return true;
}
double randomNum = (Math.random() * 100) + 1;
plugin.debug("Random: " + randomNum + ", Chance: " + chance);
if (randomNum <= chance) {
return true;
} else {
return false;
}
}
public boolean checkDelayed(User user) {
if (!isDelayEnabled()) {
return false;
}
Date time = new Date();
time = DateUtils.addHours(time, getDelayHours());
time = DateUtils.addMinutes(time, getDelayMinutes());
user.setTimedReward(this, time.getTime());
plugin.debug("Giving reward " + name + " in " + getDelayHours()
+ " hours " + getDelayMinutes() + " minutes ("
+ time.toString() + ")");
return true;
}
public boolean checkRandomChance() {
double chance = getRandomChance();
if ((chance == 0) || (chance == 100)) {
return true;
}
double randomNum = (Math.random() * 100) + 1;
plugin.debug("Random: Random: " + randomNum + ", Chance: " + chance);
if (randomNum <= chance) {
return true;
} else {
return false;
}
}
@SuppressWarnings("deprecation")
public boolean checkTimed(User user) {
if (!isTimedEnabled()) {
return false;
}
Date time = new Date();
time.setHours(getTimedHour());
time.setMinutes(getTimedMinute());
if (new Date().after(time)) {
time = DateUtils.addDays(time, 1);
}
user.setTimedReward(this, time.getTime());
plugin.debug("Giving reward " + name + " at " + time.toString());
return true;
}
public double getChance() {
return chance;
}
public ArrayList<String> getConsoleCommands() {
return consoleCommands;
}
public int getDelayHours() {
return delayHours;
}
public int getDelayMinutes() {
return delayMinutes;
}
public int getExp() {
return exp;
}
public HashMap<String, Integer> getItemAmount() {
return itemAmount;
}
public int getItemAmount(String item) {
int amount = getItemAmount().get(item);
int maxAmount = getItemMaxAmount().get(item);
int minAmount = getItemMinAmount().get(item);
if ((maxAmount == 0) && (minAmount == 0)) {
return amount;
} else {
int num = (int) (Math.random() * maxAmount);
num++;
if (num < minAmount) {
num = minAmount;
}
return num;
}
}
public HashMap<String, Integer> getItemData() {
return itemData;
}
public HashMap<String, Integer> getItemDurabilty() {
return itemDurabilty;
}
public HashMap<String, HashMap<String, Integer>> getItemEnchants() {
return itemEnchants;
}
public HashMap<String, ArrayList<String>> getItemLore() {
return itemLore;
}
public HashMap<String, String> getItemMaterial() {
return itemMaterial;
}
public HashMap<String, Integer> getItemMaxAmount() {
return itemMaxAmount;
}
public HashMap<String, Integer> getItemMinAmount() {
return itemMinAmount;
}
public HashMap<String, String> getItemName() {
return itemName;
}
public Set<String> getItems() {
return items;
}
public HashMap<String, String> getItemSkull() {
return itemSkull;
}
public int getMaxMoney() {
return MaxMoney;
}
public int getMinMoney() {
return MinMoney;
}
public int getMoney() {
return money;
}
public int getMoneyToGive() {
int amount = getMoney();
int maxAmount = getMaxMoney();
int minAmount = getMinMoney();
if ((maxAmount == 0) && (minAmount == 0)) {
return amount;
} else {
int num = (int) (Math.random() * maxAmount);
num++;
if (num < minAmount) {
num = minAmount;
}
return num;
}
}
public ArrayList<String> getPlayerCommands() {
return playerCommands;
}
public Set<String> getPotions() {
return potions;
}
public HashMap<String, Integer> getPotionsAmplifier() {
return potionsAmplifier;
}
public HashMap<String, Integer> getPotionsDuration() {
return potionsDuration;
}
public double getRandomChance() {
return randomChance;
}
public ArrayList<String> getRandomFallBack() {
return randomFallBack;
}
public ArrayList<String> getRandomRewards() {
return randomRewards;
}
public String getRewardMsg() {
return rewardMsg;
}
public String getRewardName() {
return name;
}
public int getTimedHour() {
return timedHour;
}
public int getTimedMinute() {
return timedMinute;
}
public ArrayList<String> getWorlds() {
return worlds;
}
public void giveExp(User user) {
user.giveExp(getExp());
}
public void giveItems(User user) {
for (String item : getItems()) {
ItemStack itemStack = new ItemStack(
Material.valueOf(getItemMaterial().get(item)),
getItemAmount(item), Short.valueOf(Integer
.toString(getItemData().get(item))));
String name = getItemName().get(item);
if (name != null) {
itemStack = Utils.getInstance().nameItem(itemStack,
name.replace("%Player%", user.getPlayerName()));
}
itemStack = Utils.getInstance().addLore(
itemStack,
Utils.getInstance().replace(getItemLore().get(item),
"%Player%", user.getPlayerName()));
itemStack = Utils.getInstance().addEnchants(itemStack,
getItemEnchants().get(item));
itemStack = Utils.getInstance().setDurabilty(itemStack,
getItemDurabilty().get(item));
String skull = getItemSkull().get(item);
if (skull != null) {
itemStack = Utils.getInstance().setSkullOwner(itemStack,
skull.replace("%Player%", user.getPlayerName()));
}
user.giveItem(itemStack);
}
}
public void giveMoney(User user) {
user.giveMoney(getMoneyToGive());
}
public void givePotions(User user) {
for (String potionName : getPotions()) {
user.givePotionEffect(potionName,
getPotionsDuration().get(potionName), getPotionsAmplifier()
.get(potionName));
}
}
public void giveRandom(User user) {
if (checkRandomChance()) {
ArrayList<String> rewards = getRandomRewards();
if (rewards != null) {
if (rewards.size() > 0) {
String reward = rewards.get((int) Math.random()
* rewards.size());
if (reward.equalsIgnoreCase("")) {
user.giveReward(ConfigRewards.getInstance().getReward(
reward));
}
}
}
} else {
for (String reward : getRandomFallBack()) {
if (reward.equalsIgnoreCase("")) {
user.giveReward(ConfigRewards.getInstance().getReward(
reward));
}
}
}
}
public void giveReward(User user) {
if (checkDelayed(user)) {
return;
}
if (checkTimed(user)) {
return;
}
giveRewardReward(user);
}
public void giveRewardReward(User user) {
plugin.debug("Attempting to give " + user.getPlayerName() + " reward "
+ name);
if (checkChance()) {
ArrayList<String> worlds = getWorlds();
Player player = Bukkit.getPlayer(user.getPlayerName());
if ((player != null) && (worlds != null)) {
if (isGiveInEachWorld()) {
for (String world : worlds) {
if (player.getWorld().getName().equals(world)) {
giveRewardUser(user);
} else {
Data.getInstance().setOfflineVotesSiteWorld(
user,
name,
world,
Data.getInstance()
.getOfflineVotesSiteWorld(user,
name, world) + 1);
}
}
} else {
if (worlds.contains(player.getWorld().getName())) {
giveRewardUser(user);
} else {
Data.getInstance().setOfflineVotesSiteWorld(
user,
name,
null,
Data.getInstance().getOfflineVotesSiteWorld(
user, name, null) + 1);
}
}
} else {
giveRewardUser(user);
}
}
giveRandom(user);
}
/**
* Give the user rewards
*
* @param user
* User to give rewards to
*/
public void giveRewardUser(User user) {
Player player = Bukkit.getPlayer(user.getPlayerName());
if (player != null) {
if (!isRequirePermission()
|| player.hasPermission("VotingPlugin.Reward." + name)) {
giveMoney(user);
giveItems(user);
giveExp(user);
runCommands(user);
givePotions(user);
sendMessage(user);
sendTitle(user);
playSound(user);
playEffect(user);
plugin.debug("Gave " + user.getPlayerName() + " reward " + name);
}
}
}
public boolean isDelayEnabled() {
return delayEnabled;
}
public boolean isGiveInEachWorld() {
return giveInEachWorld;
}
public boolean isRequirePermission() {
return requirePermission;
}
public boolean isTimedEnabled() {
return timedEnabled;
}
public void playEffect(User user) {
if (ConfigRewards.getInstance().getEffectEnabled(name)) {
user.playParticleEffect(ConfigRewards.getInstance()
.getEffectEffect(name), ConfigRewards.getInstance()
.getEffectData(name), ConfigRewards.getInstance()
.getEffectParticles(name), ConfigRewards.getInstance()
.getEffectRadius(name));
}
}
public void playSound(User user) {
if (ConfigRewards.getInstance().getSoundEnabled(name)) {
try {
user.playSound(ConfigRewards.getInstance().getSoundSound(name),
ConfigRewards.getInstance().getSoundVolume(name),
ConfigRewards.getInstance().getSoundPitch(name));
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
public void runCommands(User user) {
String playerName = user.getPlayerName();
// Console commands
ArrayList<String> consolecmds = getConsoleCommands();
if (consolecmds != null) {
for (String consolecmd : consolecmds) {
if (consolecmd.length() > 0) {
consolecmd = consolecmd.replace("%player%", playerName);
Bukkit.getServer().dispatchCommand(
Bukkit.getConsoleSender(), consolecmd);
}
}
}
// Player commands
ArrayList<String> playercmds = getPlayerCommands();
Player player = Bukkit.getPlayer(playerName);
if (playercmds != null) {
for (String playercmd : playercmds) {
if ((player != null) && (playercmd.length() > 0)) {
playercmd = playercmd.replace("%player%", playerName);
player.performCommand(playercmd);
}
}
}
}
public void sendMessage(User user) {
if (rewardMsg != null) {
user.sendMessage(rewardMsg);
} else {
user.sendMessage(ConfigFormat.getInstance().getRewardMsg());
}
}
public void sendTitle(User user) {
if (ConfigRewards.getInstance().getTitleEnabled(name)) {
user.sendTitle(ConfigRewards.getInstance().getTitleTitle(name),
ConfigRewards.getInstance().getTitleSubTitle(name),
ConfigRewards.getInstance().getTitleFadeIn(name), ConfigRewards
.getInstance().getTitleShowTime(name), ConfigRewards
.getInstance().getTitleFadeOut(name));
}
}
public void setChance(double chance) {
this.chance = chance;
}
public void setConsoleCommands(ArrayList<String> consoleCommands) {
this.consoleCommands = consoleCommands;
}
public void setDelayEnabled(boolean delayEnabled) {
this.delayEnabled = delayEnabled;
}
public void setDelayHours(int delayHours) {
this.delayHours = delayHours;
}
public void setDelayMinutes(int delayMinutes) {
this.delayMinutes = delayMinutes;
}
public void setExp(int exp) {
this.exp = exp;
}
public void setGiveInEachWorld(boolean giveInEachWorld) {
this.giveInEachWorld = giveInEachWorld;
}
public void setItemAmount(HashMap<String, Integer> itemAmount) {
this.itemAmount = itemAmount;
}
public void setItemData(HashMap<String, Integer> itemData) {
this.itemData = itemData;
}
public void setItemDurabilty(HashMap<String, Integer> itemDurabilty) {
this.itemDurabilty = itemDurabilty;
}
public void setItemEnchants(
HashMap<String, HashMap<String, Integer>> itemEnchants) {
this.itemEnchants = itemEnchants;
}
public void setItemLore(HashMap<String, ArrayList<String>> itemLore) {
this.itemLore = itemLore;
}
public void setItemMaterial(HashMap<String, String> itemMaterial) {
this.itemMaterial = itemMaterial;
}
public void setItemMaxAmount(HashMap<String, Integer> itemMaxAmount) {
this.itemMaxAmount = itemMaxAmount;
}
public void setItemMinAmount(HashMap<String, Integer> itemMinAmount) {
this.itemMinAmount = itemMinAmount;
}
public void setItemName(HashMap<String, String> itemName) {
this.itemName = itemName;
}
public void setItems(Set<String> items) {
this.items = items;
}
public void setItemSkull(HashMap<String, String> itemSkull) {
this.itemSkull = itemSkull;
}
public void setMaxMoney(int maxMoney) {
MaxMoney = maxMoney;
}
public void setMinMoney(int minMoney) {
MinMoney = minMoney;
}
public void setMoney(int money) {
this.money = money;
}
public void setPlayerCommands(ArrayList<String> playerCommands) {
this.playerCommands = playerCommands;
}
public void setPotions(Set<String> potions) {
this.potions = potions;
}
public void setPotionsAmplifier(HashMap<String, Integer> potionsAmplifier) {
this.potionsAmplifier = potionsAmplifier;
}
public void setPotionsDuration(HashMap<String, Integer> potionsDuration) {
this.potionsDuration = potionsDuration;
}
public void setRandomChance(double randomChance) {
this.randomChance = randomChance;
}
public void setRandomFallBack(ArrayList<String> randomFallBack) {
this.randomFallBack = randomFallBack;
}
public void setRandomRewards(ArrayList<String> randomRewards) {
this.randomRewards = randomRewards;
}
public void setRequirePermission(boolean requirePermission) {
this.requirePermission = requirePermission;
}
public void setRewardMsg(String rewardMsg) {
this.rewardMsg = rewardMsg;
}
public void setTimedEnabled(boolean timedEnabled) {
this.timedEnabled = timedEnabled;
}
public void setTimedHour(int timedHour) {
this.timedHour = timedHour;
}
public void setTimedMinute(int timedMinute) {
this.timedMinute = timedMinute;
}
public void setWorlds(ArrayList<String> worlds) {
this.worlds = worlds;
}
}
@@ -1,245 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Objects;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.Sign;
import org.bukkit.block.Skull;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.Config;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Data.ServerData;
import com.Ben12345rocks.VotingPlugin.TopVoter.TopVoter;
public class SignHandler {
private String sign;
private Location location;
private String data;
private ArrayList<String> lines;
private int position;
public Main plugin = Main.plugin;
private String playerName;
private int votes;
private boolean isValid;
public SignHandler(String sign, Location location, String data, int position) {
setSign(sign);
setLocation(location);
setData(data);
this.position = position;
setValid(true);
lines = new ArrayList<String>();
checkValidSign();
playerName = "";
}
@SuppressWarnings("deprecation")
public void checkSkulls() {
Location loc = location;
Location loc1 = new Location(loc.getWorld(), loc.getBlockX() - 1,
loc.getBlockY() - 1, loc.getBlockZ() - 1);
Location loc2 = new Location(loc.getWorld(), loc.getBlockX() + 1,
loc.getBlockY() + 1, loc.getBlockZ() + 1);
for (Block block : Utils.getInstance().getRegionBlocks(loc.getWorld(),
loc1, loc2)) {
if (block.getState() instanceof Skull) {
Skull skull = (Skull) block.getState();
skull.setOwner(playerName);
skull.update();
}
}
}
public void checkValidSign() {
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
try {
setValid(getLocation().getBlock().getState() instanceof Sign);
} catch (Exception ex) {
setValid(false);
}
}
});
}
public String getData() {
return data;
}
public Location getLocation() {
return location;
}
public String getRightClickMessage() {
String msg = ConfigFormat.getInstance()
.getSignTopVoterSignRightClickMessage();
msg = msg.replace("%player%", playerName);
msg = msg.replace("%position%", "" + position);
msg = msg.replace("%votes%", "" + votes);
msg = msg.replace("%SiteName%", data);
return msg;
}
public String getSign() {
return sign;
}
public boolean isLocationSame(Location loc) {
return loc.equals(getLocation());
}
public boolean isValid() {
return isValid;
}
public void removeSign() {
ServerData.getInstance().removeSign(sign);
}
public void setData(String data) {
this.data = data;
}
public void setLocation(Location location) {
this.location = location;
}
public void setSign(String sign) {
this.sign = sign;
}
public void setValid(boolean isValid) {
this.isValid = isValid;
}
public void storeSign() {
ServerData.getInstance().setSign(sign, location, data, position);
}
public void updateLines() {
lines = new ArrayList<String>();
checkValidSign();
if (position != 0) {
String line1 = ConfigFormat.getInstance()
.getSignTopVoterSignLine1();
String line2 = ConfigFormat.getInstance()
.getSignTopVoterSignLine2();
String line3 = ConfigFormat.getInstance()
.getSignTopVoterSignLine3();
String line4 = ConfigFormat.getInstance()
.getSignTopVoterSignLine4();
lines.add(line1);
lines.add(line2);
lines.add(line3);
lines.add(line4);
if (data.equalsIgnoreCase("All")) {
ArrayList<User> users = Utils.getInstance().convertSet(
plugin.topVoterMonthly.keySet());
if (users.size() >= position) {
playerName = users.get(position - 1).getPlayerName();
votes = users.get(position - 1).getTotalVotes();
for (int j = 0; j < lines.size(); j++) {
lines.set(j,
lines.get(j).replace("%votes%", "" + votes)
.replace("%player%", playerName));
}
} else {
playerName = "No Player";
votes = 0;
for (int j = 0; j < lines.size(); j++) {
lines.set(j,
lines.get(j).replace("%votes%", "" + votes)
.replace("%player%", playerName));
}
}
for (int j = 0; j < lines.size(); j++) {
lines.set(j, lines.get(j).replace("%SiteName%", data)
.replace("%position%", "" + position));
}
lines = Utils.getInstance().colorize(lines);
} else {
for (VoteSite voteSite : plugin.voteSites) {
if (data.equalsIgnoreCase(voteSite.getSiteName())) {
ArrayList<User> users = Utils.getInstance().convertSet(
TopVoter.getInstance()
.topVotersSortedVoteSite(voteSite)
.keySet());
if (users.size() >= position) {
playerName = users.get(position - 1)
.getPlayerName();
votes = users.get(position - 1).getTotal(voteSite);
for (int j = 0; j < lines.size(); j++) {
lines.set(
j,
lines.get(j)
.replace("%votes%", "" + votes)
.replace("%player%", playerName));
}
} else {
playerName = "No Player";
votes = 0;
for (int j = 0; j < lines.size(); j++) {
lines.set(
j,
lines.get(j)
.replace("%votes%", "" + votes)
.replace("%player%", playerName));
}
}
for (int j = 0; j < lines.size(); j++) {
lines.set(
j,
lines.get(j)
.replace("%SiteName%", data)
.replace("%position%",
"" + position));
}
lines = Utils.getInstance().colorize(lines);
}
}
}
}
}
public void updateSign(int delay) {
Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
@Override
public void run() {
try {
BlockState state = getLocation().getBlock().getState();
if (state instanceof Sign) {
Sign s = (Sign) state;
for (int j = 0; j < lines.size() && j < 4; j++) {
s.setLine(j, lines.get(j));
}
s.update();
}
} catch (Exception ex) {
if (Config.getInstance().getDebugEnabled()) {
ex.printStackTrace();
}
}
}
}, delay);
}
}
@@ -1,17 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Objects;
public class UUID {
private String uuid;
public UUID(String uuid) {
this.uuid = uuid;
}
public String getUUID() {
return uuid;
}
public void setUUID(String uuid) {
this.uuid = uuid;
}
}
File diff suppressed because it is too large. Load diff
@@ -1,180 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Objects;
import java.util.ArrayList;
import org.bukkit.Bukkit;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.Config;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Config.ConfigRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
public class VoteSite {
static Config config = Config.getInstance();
static ConfigVoteSites configVoteSites = ConfigVoteSites.getInstance();
static ConfigFormat format = ConfigFormat.getInstance();
static Main plugin = Main.plugin;
private String voteURL;
private String serviceSite;
private String siteName;
private int voteDelay;
private boolean enabled;
private ArrayList<String> rewards;
private int cumulativeVotes;
private ArrayList<String> cumulativeRewards;
public VoteSite(Main plugin) {
VoteSite.plugin = plugin;
}
/**
* New VoteSite
*
* @param siteName
* Sitename
*/
public VoteSite(String siteName) {
setSiteName(siteName);
if (!configVoteSites.getVoteSiteFile(siteName).exists()) {
if (Config.getInstance().getAutoCreateVoteSites()) {
configVoteSites.generateVoteSite(siteName);
}
init();
plugin.loadVoteSites();
} else {
init();
}
}
/**
* Broad cast a vote
*
* @param user
* User to broadcast with
*/
public void broadcastVote(User user) {
String playerName = user.getPlayerName();
String bc = Utils.getInstance().colorize(format.getBroadCastMsg());
bc = bc.replace("%player%", playerName).replace("%SiteName%", siteName);
Bukkit.broadcastMessage(bc);
}
public ArrayList<String> getCumulativeRewards() {
return cumulativeRewards;
}
public int getCumulativeVotes() {
return cumulativeVotes;
}
public ArrayList<String> getRewards() {
return rewards;
}
public String getServiceSite() {
return serviceSite;
}
public String getSiteName() {
return siteName;
}
public int getVoteDelay() {
return voteDelay;
}
public String getVoteURL() {
return voteURL;
}
public void giveCulumativeRewards(User user) {
for (String reward : getCumulativeRewards()) {
ConfigRewards.getInstance().getReward(reward).giveReward(user);
}
}
public void giveRewards(User user) {
for (String reward : getRewards()) {
if (reward != "") {
ConfigRewards.getInstance().getReward(reward).giveReward(user);
}
}
}
public void giveSiteReward(User user) {
giveRewards(user);
try {
user.addCumulativeReward(this);
if (configVoteSites.getCumulativeRewardVotesAmount(siteName) != 0) {
user.addCumulativeReward(this);
if ((user.getCumulativeReward(this) >= configVoteSites
.getCumulativeRewardVotesAmount(siteName))) {
giveCulumativeRewards(user);
user.setCumulativeReward(this, 0);
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
public void init() {
setVoteURL(configVoteSites.getVoteURL(siteName));
setServiceSite(configVoteSites.getServiceSite(siteName));
setVoteDelay(configVoteSites.getVoteDelay(siteName));
setEnabled(configVoteSites.getVoteSiteEnabled(siteName));
setRewards(configVoteSites.getRewards(siteName));
setCumulativeVotes(configVoteSites
.getCumulativeRewardVotesAmount(siteName));
setCumulativeRewards(configVoteSites.getCumulativeRewards(siteName));
}
public boolean isEnabled() {
return enabled;
}
public void setCumulativeRewards(ArrayList<String> cumulativeRewards) {
this.cumulativeRewards = cumulativeRewards;
}
public void setCumulativeVotes(int cumulativeVotes) {
this.cumulativeVotes = cumulativeVotes;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public void setRewards(ArrayList<String> rewards) {
this.rewards = rewards;
}
public void setServiceSite(String serviceSite) {
this.serviceSite = serviceSite;
}
public void setSiteName(String siteName) {
this.siteName = siteName;
}
public void setVoteDelay(int voteDelay) {
this.voteDelay = voteDelay;
}
public void setVoteURL(String voteURL) {
this.voteURL = voteURL;
}
}
@@ -1,103 +0,0 @@
package com.Ben12345rocks.VotingPlugin.OtherRewards;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Config.Config;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Config.ConfigOtherRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
import com.Ben12345rocks.VotingPlugin.Objects.User;
public class OtherVoteReward {
static ConfigOtherRewards bonusReward = ConfigOtherRewards.getInstance();
static Config config = Config.getInstance();
static ConfigVoteSites configVoteSites = ConfigVoteSites.getInstance();
static ConfigFormat format = ConfigFormat.getInstance();
static OtherVoteReward instance = new OtherVoteReward();
static Main plugin = Main.plugin;
public static OtherVoteReward getInstance() {
return instance;
}
private OtherVoteReward() {
}
public OtherVoteReward(Main plugin) {
OtherVoteReward.plugin = plugin;
}
public boolean checkAllSites(User user) {
return user.checkAllVotes();
}
public boolean checkFirstVote(User user) {
int userVotesTotal = user.getTotalVotes();
if (ConfigOtherRewards.getInstance().getFirstVoteRewards().size() != 0) {
if (userVotesTotal <= 1 && !user.hasGottenFirstVote()) {
user.setHasGottenFirstVote(true);
return true;
}
}
return false;
}
public boolean checkNumberOfVotes(User user) {
if (ConfigOtherRewards.getInstance().getNumberOfVotes().size() != 0) {
int votesRequired = ConfigOtherRewards.getInstance()
.getVotesRequired();
if (votesRequired != 0) {
if (ConfigOtherRewards.getInstance()
.getNumberOfVotesVotesInSameDay()) {
int userVotesTotal = user.getTotalVotesToday();
if ((userVotesTotal % votesRequired) == 0) {
return true;
}
} else {
int userVotesTotal = user.getTotalVotes();
if ((userVotesTotal % votesRequired) == 0) {
return true;
}
}
}
}
return false;
}
public void giveAllSitesRewards(User user) {
for (String reward : ConfigOtherRewards.getInstance()
.getAllSitesReward()) {
if (reward != "") {
ConfigRewards.getInstance().getReward(reward).giveReward(user);
}
}
}
public void giveFirstVoteRewards(User user) {
for (String reward : ConfigOtherRewards.getInstance()
.getFirstVoteRewards()) {
if (reward != "") {
ConfigRewards.getInstance().getReward(reward).giveReward(user);
}
}
}
public void giveNumberOfVotesRewards(User user) {
for (String reward : ConfigOtherRewards.getInstance()
.getNumberOfVotes()) {
if (reward != "") {
ConfigRewards.getInstance().getReward(reward).giveReward(user);
}
}
}
}
@@ -1,74 +0,0 @@
package com.Ben12345rocks.VotingPlugin.PlaceHolderExpansion;
import org.bukkit.entity.Player;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Commands.Commands;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
import com.Ben12345rocks.VotingPlugin.Objects.User;
import com.Ben12345rocks.VotingPlugin.Objects.VoteSite;
public class PlaceHolders {
static PlaceHolders instance = new PlaceHolders();
static Main plugin = Main.plugin;
public static PlaceHolders getInstance() {
return instance;
}
private PlaceHolders() {
}
public PlaceHolders(Main plugin) {
PlaceHolders.plugin = plugin;
}
public String playerCanVote(Player player) {
return Boolean.toString(new User(player).canVoteAll());
}
public String playerLastVote(Player player, String siteName) {
if (!ConfigVoteSites.getInstance().getVoteSitesNames()
.contains(siteName)) {
return "";
}
VoteSite voteSite = plugin.getVoteSite(siteName);
User user = new User(player);
return Commands.getInstance().voteCommandLastDate(user, voteSite);
}
public String playerNextVote(Player player, String siteName) {
if (!ConfigVoteSites.getInstance().getVoteSitesNames()
.contains(siteName)) {
return "";
}
VoteSite voteSite = plugin.getVoteSite(siteName);
User user = new User(player);
return Commands.getInstance().voteCommandNextInfo(user, voteSite);
}
public String playerPoints(Player player) {
return Integer.toString(new User(player).getPoints());
}
public String playerTotalVotes(Player player) {
return Integer.toString(new User(player).getTotalVotes());
}
public String playerTotalVotesSite(Player player, String siteName) {
if (!ConfigVoteSites.getInstance().getVoteSitesNames()
.contains(siteName)) {
return "";
}
VoteSite voteSite = plugin.getVoteSite(siteName);
User user = new User(player);
return Integer.toString(user.getTotalVotesSite(voteSite));
}
}
@@ -1,157 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Report;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Files.Files;
public class Report {
static Report instance = new Report();
static Main plugin = Main.plugin;
public static void addToZip(File directoryToZip, File file,
ZipOutputStream zos) throws FileNotFoundException, IOException {
FileInputStream fis = new FileInputStream(file);
String zipFilePath = file.getPath();
plugin.debug("Writing '" + zipFilePath + "' to zip file");
ZipEntry zipEntry = new ZipEntry(zipFilePath);
zos.putNextEntry(zipEntry);
byte[] bytes = new byte[1024];
int length;
while ((length = fis.read(bytes)) >= 0) {
zos.write(bytes, 0, length);
}
zos.closeEntry();
fis.close();
}
public static Report getInstance() {
return instance;
}
FileConfiguration data;
File dFile;
private Report() {
}
public Report(Main plugin) {
Report.plugin = plugin;
}
public void create() {
File directoryToZip = plugin.getDataFolder();
List<File> fileList = new ArrayList<File>();
try {
plugin.getLogger().info(
"---Getting references to all files in: "
+ directoryToZip.getCanonicalPath());
} catch (IOException e) {
e.printStackTrace();
}
getAllFiles(directoryToZip, fileList);
plugin.getLogger().info("---Creating zip file");
writeZipFile(directoryToZip, fileList);
plugin.getLogger().info("---Done");
}
public void getAllFiles(File dir, List<File> fileList) {
try {
File[] files = dir.listFiles();
for (File file : files) {
fileList.add(file);
if (file.isDirectory()) {
plugin.debug("directory:" + file.getCanonicalPath());
getAllFiles(file, fileList);
} else {
plugin.debug("file:" + file.getCanonicalPath());
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
public FileConfiguration getData() {
return data;
}
public void reloadData() {
data = YamlConfiguration.loadConfiguration(dFile);
}
public void saveData() {
Files.getInstance().editFile(dFile, data);
}
@SuppressWarnings("deprecation")
public void writeZipFile(File directoryToZip, List<File> fileList) {
try {
Date date = new Date();
File fileZipFolder = new File(plugin.getDataFolder()
.getAbsolutePath() + File.separator + "Reports");
if (!fileZipFolder.exists()) {
fileZipFolder.mkdirs();
}
FileOutputStream fos = new FileOutputStream(plugin.getDataFolder()
.getAbsolutePath()
+ File.separator
+ "Reports"
+ File.separator
+ "Report"
+ (date.getYear() + 1900)
+ "."
+ (date.getMonth() + 1)
+ "."
+ date.getDate()
+ "."
+ date.getHours()
+ "."
+ date.getMinutes()
+ "."
+ date.getSeconds() + ".zip");
ZipOutputStream zos = new ZipOutputStream(fos);
for (File file : fileList) {
if (!file.isDirectory()) { // we only zip files, not directories
addToZip(directoryToZip, file, zos);
}
}
zos.close();
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
@@ -1,130 +0,0 @@
// credit: https://bukkit.org/threads/simplescoreboard-make-pretty-scoreboards-with-ease.263041/
package com.Ben12345rocks.VotingPlugin.Scoreboards;
import java.util.AbstractMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.Config;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
public class SimpleScoreboard {
private Scoreboard scoreboard;
private String title;
private Map<String, Integer> scores;
private List<Team> teams;
public SimpleScoreboard(String title) {
scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
this.title = title;
scores = Maps.newLinkedHashMap();
teams = Lists.newArrayList();
}
public void add(String text) {
text = Utils.getInstance().colorize(text);
add(text, null);
}
public void add(String text, Integer score) {
Preconditions.checkArgument(text.length() < 48,
"text cannot be over 48 characters in length");
text = Utils.getInstance().colorize(text);
text = fixDuplicates(text);
scores.put(text, score);
}
public void blankLine() {
add(" ");
}
@SuppressWarnings("deprecation")
public void build() {
Objective obj = scoreboard
.registerNewObjective(
(title.length() > 16 ? title.substring(0, 15) : title),
"dummy");
obj.setDisplayName(title);
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
int index = scores.size();
for (Map.Entry<String, Integer> text : scores.entrySet()) {
Map.Entry<Team, String> team = createTeam(text.getKey());
Integer score = text.getValue() != null ? text.getValue() : index;
OfflinePlayer player = Bukkit.getOfflinePlayer(team.getValue());
if (team.getKey() != null) {
team.getKey().addPlayer(player);
}
obj.getScore(player).setScore(score);
index -= 1;
}
}
private Map.Entry<Team, String> createTeam(String text) {
String result = "";
if (text.length() <= 16) {
return new AbstractMap.SimpleEntry<>(null, text);
}
Team team = scoreboard.registerNewTeam("text-"
+ scoreboard.getTeams().size());
Iterator<String> iterator = Splitter.fixedLength(16).split(text)
.iterator();
team.setPrefix(iterator.next());
result = iterator.next();
if (text.length() > 32) {
team.setSuffix(iterator.next());
}
teams.add(team);
return new AbstractMap.SimpleEntry<>(team, result);
}
private String fixDuplicates(String text) {
while (scores.containsKey(text)) {
text += "§r";
}
if (text.length() > 48) {
text = text.substring(0, 47);
}
return text;
}
public Scoreboard getScoreboard() {
return scoreboard;
}
public void reset() {
title = null;
scores.clear();
for (Team t : teams) {
t.unregister();
}
teams.clear();
}
public void send(Player... players) {
if (Config.getInstance().getSendScoreboards()) {
for (Player p : players) {
p.setScoreboard(scoreboard);
}
}
}
}
@@ -1,74 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Signs;
import java.util.ArrayList;
import org.bukkit.Location;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Data.ServerData;
import com.Ben12345rocks.VotingPlugin.Objects.SignHandler;
public class Signs {
static ConfigFormat format = ConfigFormat.getInstance();
static Signs instance = new Signs();
static Main plugin = Main.plugin;
public static Signs getInstance() {
return instance;
}
private Signs() {
}
public Signs(Main plugin) {
Signs.plugin = plugin;
}
public String getSignFromLocation(Location loc) {
for (String sign : ServerData.getInstance().getSigns()) {
if (ServerData.getInstance().getSignLocation(sign).equals(loc)) {
return sign;
}
}
return null;
}
public void loadSigns() {
plugin.signs = new ArrayList<SignHandler>();
for (String sign : ServerData.getInstance().getSigns()) {
// plugin.getLogger().info("Loading sign " + sign);
plugin.signs.add(new SignHandler(sign, ServerData.getInstance()
.getSignLocation(sign), ServerData.getInstance()
.getSignData(sign), ServerData.getInstance()
.getSignPosition(sign)));
}
}
public void storeSigns() {
for (SignHandler sign : plugin.signs) {
sign.storeSign();
}
}
public void updateSigns() {
for (int i = plugin.signs.size() - 1; i >= 0; i--) {
if (!plugin.signs.get(i).isValid()) {
plugin.signs.get(i).removeSign();
plugin.signs.remove(i);
plugin.debug("Sign " + plugin.signs.get(i).getSign()
+ " invalid, removing from data.");
} else {
plugin.signs.get(i).updateLines();
plugin.signs.get(i).updateSign(i * 3);
}
}
plugin.debug("Signs updated");
}
}
@@ -1,600 +0,0 @@
package com.Ben12345rocks.VotingPlugin.TopVoter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Config.ConfigTopVoterAwards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
import com.Ben12345rocks.VotingPlugin.Data.Data;
import com.Ben12345rocks.VotingPlugin.Data.ServerData;
import com.Ben12345rocks.VotingPlugin.Objects.User;
import com.Ben12345rocks.VotingPlugin.Objects.VoteSite;
public class TopVoter {
static ConfigFormat format = ConfigFormat.getInstance();
static TopVoter instance = new TopVoter();
static Main plugin = Main.plugin;
public static TopVoter getInstance() {
return instance;
}
private TopVoter() {
}
public TopVoter(Main plugin) {
TopVoter.plugin = plugin;
}
@SuppressWarnings("deprecation")
public void checkTopVoterAward() {
if (hasMonthChanged()) {
plugin.getLogger().info("Month changed!");
TopVoters.getInstance().storeMonthlyTopVoters(
new Date().getYear() + 1900, new Date().getMonth(),
topVoterNoColor());
if (ConfigTopVoterAwards.getInstance().getMonthlyAwardsEnabled()) {
Set<String> places = ConfigTopVoterAwards.getInstance()
.getMonthlyPossibleRewardPlaces();
int i = 0;
for (User user : plugin.topVoterMonthly.keySet()) {
OfflinePlayer player = Bukkit.getOfflinePlayer(user
.getPlayerName());
if (!player.getPlayer().hasPermission(
"VotingPlugin.TopVoter.Ignore")) {
i++;
if (places.contains(Integer.toString(i))) {
user.monthlyTopVoterAward(i);
}
}
}
}
resetTotalsMonthly();
}
if (hasWeekChanged()) {
plugin.getLogger().info("Week changed!");
TopVoters.getInstance().storeWeeklyTopVoters(
new Date().getYear() + 1900, new Date().getMonth(),
new Date().getDate(), topVoterWeeklyNoColor());
if (ConfigTopVoterAwards.getInstance().getWeeklyAwardsEnabled()) {
Set<String> places = ConfigTopVoterAwards.getInstance()
.getWeeklyPossibleRewardPlaces();
int i = 0;
for (User user : plugin.topVoterWeekly.keySet()) {
OfflinePlayer player = Bukkit.getOfflinePlayer(user
.getPlayerName());
if (!player.getPlayer().hasPermission(
"VotingPlugin.TopVoter.Ignore")) {
i++;
if (places.contains(Integer.toString(i))) {
user.weeklyTopVoterAward(i);
}
}
}
}
resetTotalsWeekly();
}
if (hasDayChanged()) {
plugin.getLogger().info("Day changed!");
TopVoters.getInstance().storeDailyTopVoters(
new Date().getYear() + 1900, new Date().getMonth(),
new Date().getDate(), topVoterDailyNoColor());
if (ConfigTopVoterAwards.getInstance().getDailyAwardsEnabled()) {
Set<String> places = ConfigTopVoterAwards.getInstance()
.getDailyPossibleRewardPlaces();
int i = 0;
for (User user : plugin.topVoterDaily.keySet()) {
OfflinePlayer player = Bukkit.getOfflinePlayer(user
.getPlayerName());
if (!player.getPlayer().hasPermission(
"VotingPlugin.TopVoter.Ignore")) {
i++;
if (places.contains(Integer.toString(i))) {
user.dailyTopVoterAward(i);
}
}
}
}
resetTotalsDaily();
}
plugin.debug("Checked Top Voter Awards");
}
@SuppressWarnings("deprecation")
public boolean hasDayChanged() {
int prevDay = ServerData.getInstance().getPrevDay();
java.util.TimeZone tz = java.util.TimeZone.getTimeZone(ConfigFormat
.getInstance().getTimeZone());
java.util.Calendar c = java.util.Calendar.getInstance(tz);
int day = c.getTime().getDay();
ServerData.getInstance().setPrevDay(day);
if (prevDay != day) {
return true;
}
return false;
}
@SuppressWarnings("deprecation")
public boolean hasMonthChanged() {
int prevMonth = ServerData.getInstance().getPrevMonth();
java.util.TimeZone tz = java.util.TimeZone.getTimeZone(ConfigFormat
.getInstance().getTimeZone());
java.util.Calendar c = java.util.Calendar.getInstance(tz);
int month = c.getTime().getMonth();
ServerData.getInstance().setPrevMonth(month);
if (prevMonth != month) {
return true;
}
return false;
}
@SuppressWarnings("deprecation")
public boolean hasWeekChanged() {
int prevDate = ServerData.getInstance().getPrevWeekDay();
java.util.TimeZone tz = java.util.TimeZone.getTimeZone(ConfigFormat
.getInstance().getTimeZone());
java.util.Calendar c = java.util.Calendar.getInstance(tz);
ServerData.getInstance().setPrevWeekDay(c.getTime().getDate());
if (ServerData.getInstance().getPrevDay() == 0
&& c.getTime().getDate() != prevDate) {
return true;
}
return false;
}
public void resetTotalsDaily() {
for (User user : Data.getInstance().getUsers()) {
for (VoteSite voteSite : ConfigVoteSites.getInstance()
.getVoteSites()) {
user.setTotalDaily(voteSite, 0);
}
}
}
public void resetTotalsMonthly() {
for (User user : Data.getInstance().getUsers()) {
for (VoteSite voteSite : ConfigVoteSites.getInstance()
.getVoteSites()) {
user.setTotal(voteSite, 0);
}
}
}
public void resetTotalsPlayer(User user) {
for (VoteSite voteSite : ConfigVoteSites.getInstance().getVoteSites()) {
user.setTotal(voteSite, 0);
}
}
public void resetTotalsWeekly() {
for (User user : Data.getInstance().getUsers()) {
for (VoteSite voteSite : ConfigVoteSites.getInstance()
.getVoteSites()) {
user.setTotalWeekly(voteSite, 0);
}
}
}
public String[] topVoterDaily(int page) {
int pagesize = ConfigFormat.getInstance().getPageSize();
ArrayList<String> msg = new ArrayList<String>();
ArrayList<String> topVoters = Utils.getInstance().convertArray(
topVotersDaily());
int pageSize = (topVoters.size() / pagesize);
if ((topVoters.size() % pagesize) != 0) {
pageSize++;
}
String title = format.getCommandVoteTopTitle()
.replace("%page%", "" + page)
.replace("%maxpages%", "" + pageSize).replace("%Top%", "Daily");
msg.add(Utils.getInstance().colorize(title));
for (int i = (page - 1) * pagesize; (i < topVoters.size())
&& (i < (((page - 1) * pagesize) + 10)); i++) {
msg.add(topVoters.get(i));
}
msg = Utils.getInstance().colorize(msg);
return Utils.getInstance().convertArray(msg);
}
public String[] topVoterDailyNoColor() {
ArrayList<String> msg = new ArrayList<String>();
ArrayList<User> users = Utils.getInstance().convertSet(
plugin.topVoterDaily.keySet());
for (int i = 0; i < users.size(); i++) {
String line = "%num%: %player%, %votes%"
.replace("%num%", "" + (i + 1))
.replace("%player%", users.get(i).getPlayerName())
.replace("%votes%",
"" + plugin.topVoterDaily.get(users.get(i)));
msg.add(line);
}
return Utils.getInstance().convertArray(msg);
}
public String[] topVoterMonthly(int page) {
int pagesize = ConfigFormat.getInstance().getPageSize();
ArrayList<String> msg = new ArrayList<String>();
ArrayList<String> topVoters = Utils.getInstance().convertArray(
topVoters());
int pageSize = (topVoters.size() / pagesize);
if ((topVoters.size() % pagesize) != 0) {
pageSize++;
}
String title = format.getCommandVoteTopTitle()
.replace("%page%", "" + page)
.replace("%maxpages%", "" + pageSize)
.replace("%Top%", "Monthly");
msg.add(Utils.getInstance().colorize(title));
for (int i = (page - 1) * pagesize; (i < topVoters.size())
&& (i < (((page - 1) * pagesize) + 10)); i++) {
msg.add(topVoters.get(i));
}
msg = Utils.getInstance().colorize(msg);
return Utils.getInstance().convertArray(msg);
}
public String[] topVoterNoColor() {
ArrayList<String> msg = new ArrayList<String>();
ArrayList<User> users = Utils.getInstance().convertSet(
plugin.topVoterMonthly.keySet());
for (int i = 0; i < users.size(); i++) {
String line = "%num%: %player%, %votes%"
.replace("%num%", "" + (i + 1))
.replace("%player%", users.get(i).getPlayerName())
.replace("%votes%",
"" + plugin.topVoterMonthly.get(users.get(i)));
msg.add(line);
}
return Utils.getInstance().convertArray(msg);
}
public String[] topVoters() {
ArrayList<String> msg = new ArrayList<String>();
List<Entry<User, Integer>> list = new LinkedList<Entry<User, Integer>>(
plugin.topVoterMonthly.entrySet());
int i = 0;
for (Entry<User, Integer> entry : list) {
String line = format.getCommandVoteTopLine()
.replace("%num%", "" + (i + 1))
.replace("%player%", entry.getKey().getPlayerName())
.replace("%votes%", "" + entry.getValue().intValue());
msg.add(line);
i++;
}
msg = Utils.getInstance().colorize(msg);
return Utils.getInstance().convertArray(msg);
}
public String[] topVotersDaily() {
ArrayList<String> msg = new ArrayList<String>();
ArrayList<User> users = Utils.getInstance().convertSet(
plugin.topVoterDaily.keySet());
for (int i = 0; i < users.size(); i++) {
String line = format
.getCommandVoteTopLine()
.replace("%num%", "" + (i + 1))
.replace("%player%", users.get(i).getPlayerName())
.replace("%votes%",
"" + plugin.topVoterDaily.get(users.get(i)));
msg.add(line);
}
msg = Utils.getInstance().colorize(msg);
return Utils.getInstance().convertArray(msg);
}
public ArrayList<User> topVotersSortedAll() {
ArrayList<String> blackList = (ArrayList<String>) ConfigTopVoterAwards
.getInstance().getBlackList();
Set<User> users1 = Data.getInstance().getUsers();
if (users1 != null) {
ArrayList<User> users = Utils.getInstance().convertSet(users1);
for (int i = users.size() - 1; i >= 0; i--) {
if (users.get(i).getTotalVotes() == 0) {
users.remove(i);
}
}
if (blackList != null) {
for (int i = users.size() - 1; i >= 0; i--) {
if (blackList.contains(users.get(i).getPlayerName())) {
users.remove(i);
}
}
}
Collections.sort(users, new Comparator<User>() {
@Override
public int compare(User p1, User p2) {
int p1Total = p1.getTotalVotes();
int p2Total = p2.getTotalVotes();
return Integer.compare(p1Total, p2Total);
}
});
return users;
}
return null;
}
public ArrayList<User> topVotersSortedAllDaily() {
ArrayList<String> blackList = (ArrayList<String>) ConfigTopVoterAwards
.getInstance().getBlackList();
Set<User> users1 = Data.getInstance().getUsers();
if (users1 != null) {
ArrayList<User> users = Utils.getInstance().convertSet(users1);
for (int i = users.size() - 1; i >= 0; i--) {
if (users.get(i).getTotalDailyAll() == 0) {
users.remove(i);
}
}
if (blackList != null) {
for (int i = users.size() - 1; i >= 0; i--) {
if (blackList.contains(users.get(i).getPlayerName())) {
users.remove(i);
}
}
}
Collections.sort(users, new Comparator<User>() {
@Override
public int compare(User p1, User p2) {
int p1Total = p1.getTotalDailyAll();
int p2Total = p2.getTotalDailyAll();
return Integer.compare(p1Total, p2Total);
}
});
return users;
}
return null;
}
public ArrayList<User> topVotersSortedAllWeekly() {
ArrayList<String> blackList = (ArrayList<String>) ConfigTopVoterAwards
.getInstance().getBlackList();
Set<User> users1 = Data.getInstance().getUsers();
if (users1 != null) {
ArrayList<User> users = Utils.getInstance().convertSet(users1);
for (int i = users.size() - 1; i >= 0; i--) {
if (users.get(i).getTotalWeeklyAll() == 0) {
users.remove(i);
}
}
if (blackList != null) {
for (int i = users.size() - 1; i >= 0; i--) {
if (blackList.contains(users.get(i).getPlayerName())) {
users.remove(i);
}
}
}
Collections.sort(users, new Comparator<User>() {
@Override
public int compare(User p1, User p2) {
int p1Total = p1.getTotalWeeklyAll();
int p2Total = p2.getTotalWeeklyAll();
return Integer.compare(p1Total, p2Total);
}
});
return users;
}
return null;
}
public HashMap<User, Integer> topVotersSortedVoteSite(VoteSite voteSite) {
Set<User> users1 = Data.getInstance().getUsers();
ArrayList<User> users = Utils.getInstance().convertSet(users1);
for (int i = users.size() - 1; i >= 0; i--) {
if (users.get(i).getTotalVotesSite(voteSite) == 0) {
users.remove(i);
}
}
for (int i = users.size() - 1; i >= 0; i--) {
for (int j = users.size() - 1; j >= 0; j--) {
if (i != j) {
if (users.get(i).getPlayerName() == users.get(j)
.getPlayerName()) {
users.remove(j);
}
}
}
}
HashMap<User, Integer> topVoter = new HashMap<User, Integer>();
for (User user : users) {
topVoter.put(user, user.getTotal(voteSite));
}
return Utils.getInstance().sortByValues(topVoter, false);
}
public HashMap<User, Integer> topVotersSortedVoteSiteDaily(VoteSite voteSite) {
Set<User> users1 = Data.getInstance().getUsers();
ArrayList<User> users = Utils.getInstance().convertSet(users1);
for (int i = users.size() - 1; i >= 0; i--) {
if (users.get(i).getTotalDaily(voteSite) == 0) {
users.remove(i);
}
}
for (int i = users.size() - 1; i >= 0; i--) {
for (int j = users.size() - 1; j >= 0; j--) {
if (i != j) {
if (users.get(i).getPlayerName() == users.get(j)
.getPlayerName()) {
users.remove(j);
}
}
}
}
HashMap<User, Integer> topVoter = new HashMap<User, Integer>();
for (User user : users) {
topVoter.put(user, user.getTotalDaily(voteSite));
}
return Utils.getInstance().sortByValues(topVoter, false);
}
public HashMap<User, Integer> topVotersSortedVoteSiteWeekly(
VoteSite voteSite) {
Set<User> users1 = Data.getInstance().getUsers();
ArrayList<User> users = Utils.getInstance().convertSet(users1);
for (int i = users.size() - 1; i >= 0; i--) {
if (users.get(i).getTotalWeekly(voteSite) == 0) {
users.remove(i);
}
}
for (int i = users.size() - 1; i >= 0; i--) {
for (int j = users.size() - 1; j >= 0; j--) {
if (i != j) {
if (users.get(i).getPlayerName() == users.get(j)
.getPlayerName()) {
users.remove(j);
}
}
}
}
HashMap<User, Integer> topVoter = new HashMap<User, Integer>();
for (User user : users) {
topVoter.put(user, user.getTotalWeekly(voteSite));
}
return Utils.getInstance().sortByValues(topVoter, false);
}
public String[] topVotersWeekly() {
ArrayList<String> msg = new ArrayList<String>();
ArrayList<User> users = Utils.getInstance().convertSet(
plugin.topVoterWeekly.keySet());
for (int i = 0; i < users.size(); i++) {
String line = format
.getCommandVoteTopLine()
.replace("%num%", "" + (i + 1))
.replace("%player%", users.get(i).getPlayerName())
.replace("%votes%",
"" + plugin.topVoterWeekly.get(users.get(i)));
msg.add(line);
}
msg = Utils.getInstance().colorize(msg);
return Utils.getInstance().convertArray(msg);
}
public String[] topVoterWeekly(int page) {
int pagesize = ConfigFormat.getInstance().getPageSize();
ArrayList<String> msg = new ArrayList<String>();
ArrayList<String> topVoters = Utils.getInstance().convertArray(
topVotersWeekly());
int pageSize = (topVoters.size() / pagesize);
if ((topVoters.size() % pagesize) != 0) {
pageSize++;
}
String title = format.getCommandVoteTopTitle()
.replace("%page%", "" + page)
.replace("%maxpages%", "" + pageSize)
.replace("%Top%", "Weekly");
msg.add(Utils.getInstance().colorize(title));
for (int i = (page - 1) * pagesize; (i < topVoters.size())
&& (i < (((page - 1) * pagesize) + 10)); i++) {
msg.add(topVoters.get(i));
}
msg = Utils.getInstance().colorize(msg);
return Utils.getInstance().convertArray(msg);
}
public String[] topVoterWeeklyNoColor() {
ArrayList<String> msg = new ArrayList<String>();
ArrayList<User> users = Utils.getInstance().convertSet(
plugin.topVoterWeekly.keySet());
for (int i = 0; i < users.size(); i++) {
String line = "%num%: %player%, %votes%"
.replace("%num%", "" + (i + 1))
.replace("%player%", users.get(i).getPlayerName())
.replace("%votes%",
"" + plugin.topVoterWeekly.get(users.get(i)));
msg.add(line);
}
return Utils.getInstance().convertArray(msg);
}
public void updateTopVoters() {
plugin.topVoterMonthly.clear();
ArrayList<User> users = topVotersSortedAll();
if (users != null) {
for (User user : users) {
plugin.topVoterMonthly.put(user, user.getTotalVotes());
}
plugin.topVoterMonthly = Utils.getInstance().sortByValues(
plugin.topVoterMonthly, false);
}
plugin.topVoterWeekly.clear();
users = topVotersSortedAllWeekly();
if (users != null) {
for (User user : users) {
plugin.topVoterWeekly.put(user, user.getTotalWeeklyAll());
}
plugin.topVoterWeekly = Utils.getInstance().sortByValues(
plugin.topVoterWeekly, false);
}
plugin.topVoterDaily.clear();
users = topVotersSortedAllDaily();
if (users != null) {
for (User user : users) {
plugin.topVoterDaily.put(user, user.getTotalDailyAll());
}
plugin.topVoterDaily = Utils.getInstance().sortByValues(
plugin.topVoterDaily, false);
}
plugin.debug("Updated TopVoter");
}
}
@@ -1,176 +0,0 @@
package com.Ben12345rocks.VotingPlugin.TopVoter;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Objects.User;
import com.Ben12345rocks.VotingPlugin.Objects.VoteSite;
public class TopVoters {
static TopVoters instance = new TopVoters();
static Main plugin = Main.plugin;
public static TopVoters getInstance() {
return instance;
}
private TopVoters() {
}
public TopVoters(Main plugin) {
TopVoters.plugin = plugin;
}
public void storeDailyTopVoters(int year, int month, int date,
String[] topVoters) {
if (!plugin.getDataFolder().exists()) {
plugin.getDataFolder().mkdir();
}
File dFile = new File(plugin.getDataFolder() + File.separator
+ "TopVoters" + File.separator + "Daily", "TopVoters." + year
+ "." + month + "." + date + ".yml");
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
if (!dFile.exists()) {
try {
data.save(dFile);
plugin.debug("Created file: " + "TopVoters." + year + "."
+ month + "." + date + ".yml");
} catch (IOException e) {
plugin.getLogger().severe(
ChatColor.RED + "Could not create: " + "TopVoters."
+ year + "." + month + "." + date + ".yml");
}
}
data.set("All", topVoters);
for (VoteSite voteSite : plugin.voteSites) {
ArrayList<String> voteSiteTop = new ArrayList<String>();
int i = 1;
HashMap<User, Integer> topVoterSite = TopVoter.getInstance()
.topVotersSortedVoteSiteDaily(voteSite);
for (Entry<User, Integer> entry : topVoterSite.entrySet()) {
voteSiteTop.add(i + ": " + entry.getKey().getPlayerName()
+ ", " + entry.getValue().intValue());
i++;
}
data.set(voteSite.getSiteName(), voteSiteTop);
}
try {
data.save(dFile);
} catch (IOException e) {
plugin.getLogger().info(
"Could not save: " + "TopVoters." + year + "." + month
+ "." + date + ".yml");
}
}
public void storeMonthlyTopVoters(int year, int month, String[] topVoters) {
if (!plugin.getDataFolder().exists()) {
plugin.getDataFolder().mkdir();
}
File dFile = new File(plugin.getDataFolder() + File.separator
+ "TopVoters" + File.separator + "Monthly", "TopVoters." + year
+ "." + month + ".yml");
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
if (!dFile.exists()) {
try {
data.save(dFile);
plugin.debug("Created file: " + "TopVoters." + year + "."
+ month + ".yml");
} catch (IOException e) {
plugin.getLogger().severe(
ChatColor.RED + "Could not create: " + "TopVoters."
+ year + "." + month + ".yml");
}
}
data.set("All", topVoters);
for (VoteSite voteSite : plugin.voteSites) {
ArrayList<String> voteSiteTop = new ArrayList<String>();
int i = 1;
HashMap<User, Integer> topVoterSite = TopVoter.getInstance()
.topVotersSortedVoteSite(voteSite);
for (Entry<User, Integer> entry : topVoterSite.entrySet()) {
voteSiteTop.add(i + ": " + entry.getKey().getPlayerName()
+ ", " + entry.getValue().intValue());
i++;
}
data.set(voteSite.getSiteName(), voteSiteTop);
}
try {
data.save(dFile);
} catch (IOException e) {
plugin.getLogger().info(
"Could not save: " + "TopVoters." + year + "." + month
+ ".yml");
}
}
public void storeWeeklyTopVoters(int year, int month, int day,
String[] topVoters) {
if (!plugin.getDataFolder().exists()) {
plugin.getDataFolder().mkdir();
}
File dFile = new File(plugin.getDataFolder() + File.separator
+ "TopVoters" + File.separator + "Weekly", "TopVoters." + year
+ "." + month + "." + day + ".yml");
FileConfiguration data = YamlConfiguration.loadConfiguration(dFile);
if (!dFile.exists()) {
try {
data.save(dFile);
plugin.debug("Created file: " + "TopVoters." + year + "."
+ month + "." + day + ".yml");
} catch (IOException e) {
plugin.getLogger().severe(
ChatColor.RED + "Could not create: " + "TopVoters."
+ year + "." + month + "." + day + ".yml");
}
}
data.set("All", topVoters);
for (VoteSite voteSite : plugin.voteSites) {
ArrayList<String> voteSiteTop = new ArrayList<String>();
int i = 1;
HashMap<User, Integer> topVoterSite = TopVoter.getInstance()
.topVotersSortedVoteSiteWeekly(voteSite);
for (Entry<User, Integer> entry : topVoterSite.entrySet()) {
voteSiteTop.add(i + ": " + entry.getKey().getPlayerName()
+ ", " + entry.getValue().intValue());
i++;
}
data.set(voteSite.getSiteName(), voteSiteTop);
}
try {
data.save(dFile);
} catch (IOException e) {
plugin.getLogger().info(
"Could not save: " + "TopVoters." + year + "." + month
+ "." + day + ".yml");
}
}
}
@@ -1,63 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Updater;
import org.bukkit.Bukkit;
import com.Ben12345rocks.VotingPlugin.Main;
public class CheckUpdate {
static CheckUpdate instance = new CheckUpdate();
static Main plugin = Main.plugin;
public static CheckUpdate getInstance() {
return instance;
}
private CheckUpdate() {
}
public CheckUpdate(Main plugin) {
CheckUpdate.plugin = plugin;
}
public void checkUpdate() {
plugin.updater = new Updater(plugin, 15358, false);
final Updater.UpdateResult result = plugin.updater.getResult();
switch (result) {
case FAIL_SPIGOT: {
plugin.getLogger().info(
"Failed to check for update for " + plugin.getName() + "!");
break;
}
case NO_UPDATE: {
plugin.getLogger().info(
plugin.getName() + " is up to date! Version: "
+ plugin.updater.getVersion());
break;
}
case UPDATE_AVAILABLE: {
plugin.getLogger().info(
plugin.getName()
+ " has an update available! Your Version: "
+ plugin.getDescription().getVersion()
+ " New Version: " + plugin.updater.getVersion());
break;
}
default: {
break;
}
}
}
public void startUp() {
Bukkit.getServer().getScheduler()
.runTaskLaterAsynchronously(plugin, new Runnable() {
@Override
public void run() {
checkUpdate();
}
}, 20L);
}
}
@@ -1,106 +0,0 @@
package com.Ben12345rocks.VotingPlugin.Updater;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.ProtocolException;
import java.net.URL;
import org.bukkit.plugin.java.JavaPlugin;
public class Updater {
public enum UpdateResult {
BAD_RESOURCEID, DISABLED, FAIL_NOVERSION, FAIL_SPIGOT, NO_UPDATE, UPDATE_AVAILABLE
}
private final String API_KEY = "98BE0FE67F88AB82B4C197FAF1DC3B69206EFDCC4D3B80FC83A00037510B99B4";
private HttpURLConnection connection;
private final String HOST = "http://www.spigotmc.org";
private String oldVersion;
private JavaPlugin plugin;
private final String QUERY = "/api/general.php";
private final String REQUEST_METHOD = "POST";
private String RESOURCE_ID = "";
private Updater.UpdateResult result = Updater.UpdateResult.DISABLED;
private String version;
private String WRITE_STRING;
public Updater(JavaPlugin plugin, Integer resourceId, boolean disabled) {
RESOURCE_ID = resourceId + "";
this.plugin = plugin;
oldVersion = this.plugin.getDescription().getVersion();
if (disabled) {
result = UpdateResult.DISABLED;
return;
}
try {
connection = (HttpURLConnection) new URL(HOST + QUERY)
.openConnection();
} catch (IOException e) {
result = UpdateResult.FAIL_SPIGOT;
return;
}
WRITE_STRING = "key=" + API_KEY + "&resource=" + RESOURCE_ID;
run();
}
public UpdateResult getResult() {
return result;
}
public String getVersion() {
return version;
}
private void run() {
connection.setDoOutput(true);
try {
connection.setRequestMethod(REQUEST_METHOD);
connection.getOutputStream().write(WRITE_STRING.getBytes("UTF-8"));
} catch (ProtocolException e1) {
result = UpdateResult.FAIL_SPIGOT;
} catch (UnsupportedEncodingException e) {
result = UpdateResult.FAIL_SPIGOT;
} catch (IOException e) {
result = UpdateResult.FAIL_SPIGOT;
}
String version;
try {
version = new BufferedReader(new InputStreamReader(
connection.getInputStream())).readLine();
} catch (Exception e) {
result = UpdateResult.BAD_RESOURCEID;
return;
}
if (version.length() <= 7) {
this.version = version;
version.replace("[^A-Za-z]", "").replace("|", "");
versionCheck();
return;
}
result = UpdateResult.BAD_RESOURCEID;
}
public boolean shouldUpdate(String localVersion, String remoteVersion) {
return !localVersion.equalsIgnoreCase(remoteVersion);
}
private void versionCheck() {
if (shouldUpdate(oldVersion, version)) {
result = UpdateResult.UPDATE_AVAILABLE;
} else {
result = UpdateResult.NO_UPDATE;
}
}
}
@@ -1,754 +0,0 @@
package com.Ben12345rocks.VotingPlugin;
import gyurix.api.TitleAPI;
import java.text.DateFormatSymbols;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
import me.clip.placeholderapi.PlaceholderAPI;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteSites;
import com.Ben12345rocks.VotingPlugin.Data.Data;
import com.Ben12345rocks.VotingPlugin.Objects.User;
public class Utils {
static Utils instance = new Utils();
static Main plugin = Main.plugin;
public static Utils getInstance() {
return instance;
}
private Utils() {
}
public Utils(Main plugin) {
Utils.plugin = plugin;
}
public ItemStack addEnchants(ItemStack item,
HashMap<String, Integer> enchants) {
if ((enchants == null) || (enchants.size() == 0)) {
return item;
}
ItemMeta meta = item.getItemMeta();
for (String enchant : enchants.keySet()) {
meta.addEnchant(Enchantment.getByName(enchant),
enchants.get(enchant), false);
}
item.setItemMeta(meta);
return item;
}
public ItemStack addLore(ItemStack item, List<String> lore) {
if (lore == null) {
return item;
}
if (item == null) {
return null;
}
ItemMeta meta = item.getItemMeta();
meta.setLore(colorize(lore));
item.setItemMeta(meta);
return item;
}
public ArrayList<String> colorize(ArrayList<String> list) {
if (list == null) {
return null;
}
for (int i = 0; i < list.size(); i++) {
list.set(i, colorize(list.get(i)));
}
return list;
}
public List<String> colorize(List<String> list) {
if (list == null) {
return null;
}
for (int i = 0; i < list.size(); i++) {
list.set(i, colorize(list.get(i)));
}
return list;
}
public String colorize(String format) {
if (format == null) {
return null;
}
return ChatColor.translateAlternateColorCodes('&', format);
}
public String[] colorize(String[] list) {
if (list == null) {
return null;
}
for (int i = 0; i < list.length; i++) {
list[i] = colorize(list[i]);
}
return list;
}
public ArrayList<String> comptoString(ArrayList<TextComponent> comps) {
ArrayList<String> txt = new ArrayList<String>();
for (TextComponent comp : comps) {
txt.add(compToString(comp));
}
return txt;
}
public String compToString(TextComponent comp) {
return colorize(comp.toPlainText());
}
public User[] convert(ArrayList<User> array) {
if (array == null) {
return null;
}
User[] list = new User[array.size()];
for (int i = 0; i < array.size(); i++) {
list[i] = array.get(i);
}
return list;
}
public ArrayList<String> convert(Set<String> set) {
ArrayList<String> list = new ArrayList<String>();
for (String st : set) {
list.add(st);
}
return list;
}
@SuppressWarnings("unused")
public String[] convertArray(ArrayList<String> list) {
if (list == null) {
return null;
}
String[] string = new String[list.size()];
for (int i = 0; i < list.size(); i++) {
string[i] = list.get(i);
}
if (string == null) {
return null;
} else {
return string;
}
}
@SuppressWarnings("unused")
public ArrayList<String> convertArray(String[] list) {
if (list == null) {
return null;
}
ArrayList<String> newlist = new ArrayList<String>();
for (String element : list) {
newlist.add(element);
}
if (newlist == null) {
return null;
} else {
return newlist;
}
}
public ArrayList<User> convertSet(Set<User> set) {
if (set == null) {
return null;
}
ArrayList<User> list = new ArrayList<User>();
for (User user : set) {
list.add(user);
}
return list;
}
@SuppressWarnings("deprecation")
public int getDayFromMili(long time) {
Date date = new Date(time);
return date.getDate();
}
@SuppressWarnings("deprecation")
public int getHourFromMili(long time) {
Date date = new Date(time);
return date.getHours();
}
@SuppressWarnings("deprecation")
public int getMinutesFromMili(long time) {
Date date = new Date(time);
return date.getMinutes();
}
@SuppressWarnings("deprecation")
public int getMonthFromMili(long time) {
Date date = new Date(time);
return date.getMonth();
}
public String getMonthString(int month) {
if (month == 0) {
month++;
}
return new DateFormatSymbols().getMonths()[month - 1];
}
public String getPlayerName(String uuid) {
if ((uuid == null) || uuid.equalsIgnoreCase("null")) {
plugin.debug("Null UUID");
return null;
}
User user = new User(new com.Ben12345rocks.VotingPlugin.Objects.UUID(
uuid), false);
String playerName = Data.getInstance().getName(user);
if (playerName != null) {
return playerName;
}
Player player = Bukkit.getPlayer(UUID.fromString(uuid));
if (player == null) {
playerName = Bukkit.getOfflinePlayer(UUID.fromString(uuid))
.getName();
return playerName;
} else {
return player.getName();
}
}
public List<Block> getRegionBlocks(World world, Location loc1, Location loc2) {
List<Block> blocks = new ArrayList<Block>();
for (double x = loc1.getX(); x <= loc2.getX(); x++) {
for (double y = loc1.getY(); y <= loc2.getY(); y++) {
for (double z = loc1.getZ(); z <= loc2.getZ(); z++) {
Location loc = new Location(world, x, y, z);
blocks.add(loc.getBlock());
}
}
}
return blocks;
}
@SuppressWarnings("deprecation")
public String getUUID(String playerName) {
if (playerName == null) {
return null;
}
Player player = Bukkit.getPlayer(playerName);
if (player == null) {
return Bukkit.getOfflinePlayer(playerName).getUniqueId().toString();
} else {
return player.getUniqueId().toString();
}
}
public String getVoteSiteName(String url) {
ArrayList<String> sites = ConfigVoteSites.getInstance()
.getVoteSitesNames();
if (url == null) {
return null;
}
if (sites != null) {
for (String siteName : sites) {
String URL = ConfigVoteSites.getInstance().getServiceSite(
siteName);
if (URL != null) {
if (URL.equals(url)) {
return siteName;
}
}
}
}
return url;
}
@SuppressWarnings("deprecation")
public int getYearFromMili(long time) {
Date date = new Date(time);
return date.getYear();
}
public boolean hasPermission(CommandSender sender, String perm) {
return sender.hasPermission(plugin.getName() + "." + perm);
}
public boolean hasPermission(Player player, String perm) {
return player.hasPermission(plugin.getName() + "." + perm);
}
public boolean hasPermission(String playerName, String perm) {
if (playerName == null) {
return false;
}
Player player = Bukkit.getPlayer(playerName);
if (player != null) {
return player.hasPermission(plugin.getName() + "." + perm);
}
return false;
}
public boolean isInt(String st) {
try {
@SuppressWarnings("unused")
int num = Integer.parseInt(st);
return true;
} catch (NumberFormatException ex) {
return false;
}
}
public boolean isPlayer(CommandSender sender) {
if (sender instanceof Player) {
return true;
}
return false;
}
public boolean isPlayerOnline(String playerName) {
Player player = Bukkit.getPlayer(playerName);
if (player != null) {
return true;
}
return false;
}
public String makeString(int startIndex, String[] strs) {
String str = new String();
for (int i = startIndex; i < strs.length; i++) {
if (i == startIndex) {
str += strs[i];
} else {
str += " " + strs[i];
}
}
return str;
}
public String makeStringList(ArrayList<String> list) {
if (list == null) {
return "";
}
String string = new String();
if (list.size() > 1) {
for (int i = 0; i < list.size(); i++) {
if (i == 0) {
string += list.get(i);
} else {
string += ", " + list.get(i);
}
}
} else if (list.size() == 1) {
string = list.get(0);
}
return string;
}
public ItemStack nameItem(ItemStack item, String name) {
if (name == null) {
return item;
}
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(name);
item.setItemMeta(meta);
return item;
}
public void printMap(HashMap<User, Integer> topVoterMonthly) {
for (Entry<User, Integer> entry : topVoterMonthly.entrySet()) {
plugin.debug("Key : " + entry.getKey().getPlayerName()
+ " Value : " + entry.getValue());
}
}
public ArrayList<User> removeDoubleUsers(ArrayList<User> list) {
Set<User> hs = new HashSet<User>();
ArrayList<User> al = new ArrayList<User>();
hs.addAll(list);
al.clear();
al.addAll(hs);
return al;
}
public ArrayList<String> removeDuplicates(ArrayList<String> list) {
Set<String> set = new HashSet<String>(list);
return new ArrayList<String>(set);
}
public List<String> replace(List<String> list, String toReplace,
String replaceWith) {
if (list == null) {
return null;
}
if (replaceWith == null || toReplace == null) {
return list;
}
for (int i = 0; i < list.size(); i++) {
list.set(i, list.get(i).replace(toReplace, replaceWith));
}
return list;
}
public ArrayList<String> replaceIgnoreCase(ArrayList<String> list,
String toReplace, String replaceWith) {
ArrayList<String> newList = new ArrayList<String>();
for (String msg : list) {
newList.add(replaceIgnoreCase(msg, toReplace, replaceWith));
}
return newList;
}
public String replaceIgnoreCase(String str, String toReplace,
String replaceWith) {
if (str == null) {
return "";
}
if ((toReplace == null) || (replaceWith == null)) {
return str;
}
return str.replaceAll("(?i)" + toReplace, replaceWith);
}
public String replacePlaceHolders(Player player, String text) {
if (plugin.placeHolderAPIEnabled) {
return PlaceholderAPI.setBracketPlaceholders(player, text);
} else {
return text;
}
}
public void sendTitle(Player player, String title, String subTitle,
int fadeIn, int showTime, int fadeOut) {
if (plugin.spigotLibEnabled) {
if (title == null) {
title = "";
}
if (subTitle == null) {
subTitle = "";
}
TitleAPI.set(colorize(title), colorize(subTitle), fadeIn, showTime,
fadeOut, player);
}
}
public ItemStack setDurabilty(ItemStack item, int durability) {
if (item == null) {
return null;
}
if (durability > 0) {
item.setDurability((short) durability);
}
return item;
}
public ItemStack setSkullOwner(ItemStack item, String playerName) {
if (item == null) {
return null;
}
if (playerName == null || playerName.equalsIgnoreCase("")) {
return item;
}
ItemMeta meta = item.getItemMeta();
((SkullMeta) meta).setOwner(playerName);
return item;
}
@SuppressWarnings("unused")
public String[] setToArray(Set<String> set) {
String[] array = new String[set.size()];
int i = 0;
for (String item : set) {
array[i] = item;
i++;
}
if (array == null) {
return null;
} else {
return array;
}
}
public HashMap<User, Integer> sortByValues(
HashMap<User, Integer> unsortMap, final boolean order) {
List<Entry<User, Integer>> list = new LinkedList<Entry<User, Integer>>(
unsortMap.entrySet());
// Sorting the list based on values
Collections.sort(list, new Comparator<Entry<User, Integer>>() {
@Override
public int compare(Entry<User, Integer> o1, Entry<User, Integer> o2) {
if (order) {
return o1.getValue().compareTo(o2.getValue());
} else {
return o2.getValue().compareTo(o1.getValue());
}
}
});
// Maintaining insertion order with the help of LinkedList
HashMap<User, Integer> sortedMap = new LinkedHashMap<User, Integer>();
for (Entry<User, Integer> entry : list) {
sortedMap.put(entry.getKey(), entry.getValue());
}
return sortedMap;
}
public boolean startsWithIgnoreCase(String str1, String str2) {
return str1.toLowerCase().startsWith(str2.toLowerCase());
}
public TextComponent stringToComp(String string) {
TextComponent base = new TextComponent("");
boolean previousLetter = false;
ChatColor currentColor = null;
boolean bold = false;
boolean italic = false;
boolean underline = false;
boolean strike = false;
boolean magic = false;
String currentstring = "";
for (int i = 0; i < string.length(); i++) {
char c = string.charAt(i);
if (c == '&') {
if (string.charAt(i + 1) == 'l') {
if (previousLetter) {
TextComponent newTC = new TextComponent(currentstring);
if (currentColor != null) {
newTC.setColor(currentColor);
}
newTC.setBold(bold);
newTC.setItalic(italic);
newTC.setUnderlined(underline);
newTC.setStrikethrough(strike);
newTC.setObfuscated(magic);
base.addExtra(newTC);
bold = false;
italic = false;
underline = false;
strike = false;
magic = false;
currentstring = "";
currentColor = null;
i++;
previousLetter = false;
} else {
bold = true;
i++;
}
} else if (string.charAt(i + 1) == 'k') {
if (previousLetter) {
TextComponent newTC = new TextComponent(currentstring);
if (currentColor != null) {
newTC.setColor(currentColor);
}
newTC.setBold(bold);
newTC.setItalic(italic);
newTC.setUnderlined(underline);
newTC.setStrikethrough(strike);
newTC.setObfuscated(magic);
base.addExtra(newTC);
bold = false;
italic = false;
underline = false;
strike = false;
magic = false;
currentstring = "";
currentColor = null;
i++;
previousLetter = false;
} else {
magic = true;
i++;
}
} else if (string.charAt(i + 1) == 'm') {
if (previousLetter) {
TextComponent newTC = new TextComponent(currentstring);
if (currentColor != null) {
newTC.setColor(currentColor);
}
newTC.setBold(bold);
newTC.setItalic(italic);
newTC.setUnderlined(underline);
newTC.setStrikethrough(strike);
newTC.setObfuscated(magic);
base.addExtra(newTC);
bold = false;
italic = false;
underline = false;
strike = false;
magic = false;
currentstring = "";
currentColor = null;
i++;
previousLetter = false;
} else {
strike = true;
i++;
}
} else if (string.charAt(i + 1) == 'n') {
if (previousLetter) {
TextComponent newTC = new TextComponent(currentstring);
if (currentColor != null) {
newTC.setColor(currentColor);
}
newTC.setBold(bold);
newTC.setItalic(italic);
newTC.setUnderlined(underline);
newTC.setStrikethrough(strike);
newTC.setObfuscated(magic);
base.addExtra(newTC);
bold = false;
italic = false;
underline = false;
strike = false;
magic = false;
currentstring = "";
currentColor = null;
i++;
previousLetter = false;
} else {
underline = true;
i++;
}
} else if (string.charAt(i + 1) == 'o') {
if (previousLetter) {
TextComponent newTC = new TextComponent(currentstring);
if (currentColor != null) {
newTC.setColor(currentColor);
}
newTC.setBold(bold);
newTC.setItalic(italic);
newTC.setUnderlined(underline);
newTC.setStrikethrough(strike);
newTC.setObfuscated(magic);
base.addExtra(newTC);
bold = false;
italic = false;
underline = false;
strike = false;
magic = false;
currentstring = "";
currentColor = null;
i++;
previousLetter = false;
} else {
italic = true;
i++;
}
} else if (string.charAt(i + 1) == 'r') {
TextComponent newTC = new TextComponent(currentstring);
if (currentColor != null) {
newTC.setColor(currentColor);
}
newTC.setBold(bold);
newTC.setItalic(italic);
newTC.setUnderlined(underline);
newTC.setStrikethrough(strike);
newTC.setObfuscated(magic);
base.addExtra(newTC);
bold = false;
italic = false;
underline = false;
strike = false;
magic = false;
currentstring = "";
currentColor = null;
i++;
previousLetter = false;
} else if (ChatColor.getByChar(string.charAt(i + 1)) != null) {
if (previousLetter) {
TextComponent newTC = new TextComponent(currentstring);
if (currentColor != null) {
newTC.setColor(currentColor);
}
newTC.setBold(bold);
newTC.setItalic(italic);
newTC.setUnderlined(underline);
newTC.setStrikethrough(strike);
newTC.setObfuscated(magic);
base.addExtra(newTC);
bold = false;
italic = false;
underline = false;
strike = false;
magic = false;
currentColor = ChatColor
.getByChar(string.charAt(i + 1));
currentstring = "";
i++;
previousLetter = false;
} else {
currentColor = ChatColor
.getByChar(string.charAt(i + 1));
i++;
}
} else {
previousLetter = true;
currentstring = currentstring + c;
}
} else {
previousLetter = true;
currentstring = currentstring + c;
}
}
TextComponent newTC = new TextComponent(currentstring);
if (currentColor != null) {
newTC.setColor(currentColor);
}
newTC.setBold(bold);
newTC.setItalic(italic);
newTC.setUnderlined(underline);
newTC.setStrikethrough(strike);
newTC.setObfuscated(magic);
base.addExtra(newTC);
return base;
}
}
@@ -1,134 +0,0 @@
package com.Ben12345rocks.VotingPlugin.VoteParty;
import java.util.ArrayList;
import org.bukkit.command.CommandSender;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.ConfigFormat;
import com.Ben12345rocks.VotingPlugin.Config.ConfigOtherRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigRewards;
import com.Ben12345rocks.VotingPlugin.Data.Data;
import com.Ben12345rocks.VotingPlugin.Data.ServerData;
import com.Ben12345rocks.VotingPlugin.Objects.UUID;
import com.Ben12345rocks.VotingPlugin.Objects.User;
public class VoteParty {
static VoteParty instance = new VoteParty();
static Main plugin = Main.plugin;
public static VoteParty getInstance() {
return instance;
}
private VoteParty() {
}
public VoteParty(Main plugin) {
VoteParty.plugin = plugin;
}
public void addTotal() {
setTotalVotes(getTotalVotes() + 1);
}
public void addVotePlayer(User user) {
String uuid = user.getUUID();
ArrayList<String> voted = getVotedUsers();
if (voted == null) {
voted = new ArrayList<String>();
}
if (!voted.contains(uuid)) {
voted.add(uuid);
setVotedUsers(voted);
}
}
public void check() {
if (ConfigOtherRewards.getInstance().getVotePartyEnabled()) {
if (getTotalVotes() >= ConfigOtherRewards.getInstance()
.getVotesRequired()) {
setTotalVotes(getTotalVotes()
- ConfigOtherRewards.getInstance().getVotesRequired());
giveRewards();
}
}
}
public void commandVoteParty(CommandSender sender) {
ArrayList<String> msg = ConfigFormat.getInstance()
.getCommandsVoteParty();
ArrayList<String> lines = new ArrayList<String>();
int votesRequired = ConfigOtherRewards.getInstance().getVotesRequired();
int votes = getTotalVotes();
int neededVotes = votesRequired - votes;
for (String line : msg) {
line = line.replace("%VotesRequired%", "" + votesRequired)
.replace("%NeededVotes%", "" + neededVotes)
.replace("%Votes%", "" + votes);
lines.add(Utils.getInstance().colorize(line));
}
sender.sendMessage(Utils.getInstance().convertArray(lines));
}
public int getOfflineVotePartyVotes(User user) {
return Data.getInstance().getData(user)
.getInt("VoteParty.OfflineVotes");
}
public int getTotalVotes() {
return ServerData.getInstance().getData().getInt("VoteParty.Total");
}
@SuppressWarnings("unchecked")
public ArrayList<String> getVotedUsers() {
ArrayList<String> list = (ArrayList<String>) ServerData.getInstance()
.getData().getList("VoteParty.Voted");
if (list != null) {
return list;
}
return new ArrayList<String>();
}
public void giveReward(User user) {
if (Utils.getInstance().isPlayerOnline(user.getPlayerName())) {
for (String reward : ConfigOtherRewards.getInstance()
.getVotePartyRewards()) {
user.giveReward(ConfigRewards.getInstance().getReward(reward));
}
} else {
setOfflineVotePartyVotes(user, getOfflineVotePartyVotes(user) + 1);
}
}
public void giveRewards() {
if (ConfigOtherRewards.getInstance().getVotePartyGiveAllPlayers()) {
for (User user : Data.getInstance().getUsers()) {
giveReward(user);
}
} else {
for (String uuid : getVotedUsers()) {
User user = new User(new UUID(uuid));
giveReward(user);
}
}
setVotedUsers(new ArrayList<String>());
}
public void setOfflineVotePartyVotes(User user, int value) {
Data.getInstance().getData(user).set("VoteParty.OfflineVotes", value);
}
public void setTotalVotes(int value) {
ServerData.getInstance().getData().set("VoteParty.Total", value);
ServerData.getInstance().saveData();
}
public void setVotedUsers(ArrayList<String> value) {
ServerData.getInstance().getData().set("VoteParty.Voted", value);
ServerData.getInstance().saveData();
}
}
@@ -1,92 +0,0 @@
package com.Ben12345rocks.VotingPlugin.VoteReminding;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import com.Ben12345rocks.VotingPlugin.Main;
import com.Ben12345rocks.VotingPlugin.Utils;
import com.Ben12345rocks.VotingPlugin.Config.ConfigRewards;
import com.Ben12345rocks.VotingPlugin.Config.ConfigVoteReminding;
import com.Ben12345rocks.VotingPlugin.Objects.Reward;
import com.Ben12345rocks.VotingPlugin.Objects.User;
public class VoteReminding {
static VoteReminding instance = new VoteReminding();
static Main plugin = Main.plugin;
public static VoteReminding getInstance() {
return instance;
}
private VoteReminding() {
}
public VoteReminding(Main plugin) {
VoteReminding.plugin = plugin;
}
public void checkRemind(User user) {
String playerName = user.getPlayerName();
if (Utils.getInstance().hasPermission(playerName,
"VotingPlugin.Login.RemindVotes")
|| Utils.getInstance().hasPermission(playerName,
"VotingPlugin.Player")) {
if (user.canVoteAll()) {
Player player = Bukkit.getPlayer(playerName);
if (player != null) {
if (!ConfigVoteReminding.getInstance().getRemindOnlyOnce()) {
runRemind(user);
user.setReminded(true);
} else if (!user.getReminded()) {
runRemind(user);
user.setReminded(true);
}
}
}
}
}
public void loadRemindChecking() {
Bukkit.getScheduler().runTaskTimerAsynchronously(
plugin,
new Runnable() {
@Override
public void run() {
for (Player player : Bukkit.getServer()
.getOnlinePlayers()) {
User user = new User(player);
checkRemind(user);
}
}
}, 10,
ConfigVoteReminding.getInstance().getRemindDelay() * 20 * 60);
}
public void runRemind(User user) {
if (ConfigVoteReminding.getInstance().getEnabled() && user.canVoteAll()) {
user.setReminded(true);
for (String reward : ConfigVoteReminding.getInstance().getRewards()) {
if (!reward.equalsIgnoreCase("")) {
if (ConfigRewards.getInstance().getRewardFile(reward)
.exists()) {
}
Reward rewardFile = ConfigRewards.getInstance().getReward(
reward);
rewardFile.giveReward(user);
}
}
plugin.debug(user.getPlayerName() + " was reminded!");
}
}
}
@@ -0,0 +1,890 @@
package com.bencodez.votingplugin;
import java.io.File;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.UUID;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import com.bencodez.advancedcore.api.misc.ArrayUtils;
import com.bencodez.advancedcore.api.misc.MiscUtils;
import com.bencodez.advancedcore.api.misc.encryption.EncryptionHandler;
import com.bencodez.advancedcore.api.rewards.RewardBuilder;
import com.bencodez.advancedcore.api.time.TimeType;
import com.bencodez.advancedcore.api.user.UserStorage;
import com.bencodez.advancedcore.api.user.usercache.value.DataValue;
import com.bencodez.advancedcore.api.user.usercache.value.DataValueBoolean;
import com.bencodez.advancedcore.api.user.userstorage.mysql.api.config.MysqlConfigSpigot;
import com.bencodez.advancedcore.bungeeapi.GlobalMessage.GlobalMessageHandler;
import com.bencodez.advancedcore.bungeeapi.GlobalMessage.GlobalMessageListener;
import com.bencodez.advancedcore.bungeeapi.globaldata.GlobalDataHandler;
import com.bencodez.advancedcore.bungeeapi.globaldata.GlobalMySQL;
import com.bencodez.advancedcore.bungeeapi.pluginmessage.PluginMessageHandler;
import com.bencodez.advancedcore.bungeeapi.redis.RedisHandler;
import com.bencodez.advancedcore.bungeeapi.redis.RedisListener;
import com.bencodez.advancedcore.bungeeapi.sockets.ClientHandler;
import com.bencodez.advancedcore.bungeeapi.sockets.SocketHandler;
import com.bencodez.advancedcore.bungeeapi.sockets.SocketReceiver;
import com.bencodez.votingplugin.bungee.BungeeMessageData;
import com.bencodez.votingplugin.bungee.BungeeMethod;
import com.bencodez.votingplugin.bungee.BungeeVersion;
import com.bencodez.votingplugin.objects.VoteSite;
import com.bencodez.votingplugin.user.VotingPluginUser;
import lombok.Getter;
public class BungeeHandler implements Listener {
@Getter
private ClientHandler clientHandler;
private EncryptionHandler encryptionHandler;
@Getter
private BungeeMethod method;
private VotingPluginMain plugin;
@Getter
private int bungeeVotePartyCurrent = -2;
@Getter
private int bungeeVotePartyRequired = -2;
@Getter
private SocketHandler socketHandler;
private GlobalDataHandler globalDataHandler;
@Getter
private ScheduledExecutorService timer;
@Getter
private RedisHandler redisHandler;
@Getter
private GlobalMessageHandler globalMessageHandler;
private Thread redisThread;
public BungeeHandler(VotingPluginMain plugin) {
this.plugin = plugin;
}
public void close() {
if (socketHandler != null) {
socketHandler.closeConnection();
}
if (clientHandler != null) {
clientHandler.stopConnection();
}
plugin.getServerData().setBungeeVotePartyCurrent(bungeeVotePartyCurrent);
plugin.getServerData().setBungeeVotePartyRequired(bungeeVotePartyRequired);
if (globalDataHandler != null) {
globalDataHandler.getGlobalMysql().close();
}
}
/*
* @EventHandler public void onDateChange(DateChangedEvent event) { if
* (method.equals(BungeeMethod.PLUGINMESSAGING)) {
* plugin.getPluginMessaging().sendPluginMessage("timeupdate",
* plugin.getServerDataFile().getPrevMonth() + "//" +
* plugin.getServerDataFile().getPrevDay() + "//" +
* plugin.getServerDataFile().getPrevWeekDay()); } }
*/
public void checkGlobalData() {
HashMap<String, DataValue> data = globalDataHandler.getExact(plugin.getBungeeSettings().getServer());
// plugin.debug(data.toString());
if (data.containsKey("ForceUpdate")) {
boolean b = checkGlobalDataTimeValue(data.get("ForceUpdate"));
if (b) {
if (plugin.getStorageType().equals(UserStorage.MYSQL)) {
plugin.getMysql().clearCacheBasic();
}
plugin.getUserManager().getDataManager().clearCache();
plugin.setUpdate(true);
plugin.update();
globalDataHandler.setBoolean(plugin.getBungeeSettings().getServer(), "ForceUpdate", false);
}
}
boolean forceUpdate = false;
if (checkGlobalDataTime(TimeType.MONTH, data)) {
forceUpdate = true;
}
if (checkGlobalDataTime(TimeType.WEEK, data)) {
forceUpdate = true;
}
if (checkGlobalDataTime(TimeType.DAY, data)) {
forceUpdate = true;
}
if (forceUpdate) {
HashMap<String, DataValue> dataToSet = new HashMap<String, DataValue>();
dataToSet.put("FinishedProcessing", new DataValueBoolean(true));
dataToSet.put("Processing", new DataValueBoolean(false));
globalDataHandler.setData(plugin.getBungeeSettings().getServer(), dataToSet);
}
}
public boolean checkGlobalDataTimeValue(DataValue data) {
if (data.isBoolean()) {
return data.getBoolean();
}
return Boolean.valueOf(data.getString());
}
public boolean checkGlobalDataTime(TimeType type, HashMap<String, DataValue> data) {
boolean isProcessing = false;
if (data.containsKey(type.toString())) {
DataValue value = data.get(type.toString());
boolean b = checkGlobalDataTimeValue(value);
if (b) {
long lastUpdated = Long.valueOf(data.get("LastUpdated").getString()).longValue();
plugin.debug("LastUpdated: " + lastUpdated);
if (LocalDateTime.now().atZone(ZoneOffset.UTC).toInstant().toEpochMilli() - lastUpdated > 1000 * 60 * 60
* 2) {
plugin.getLogger().warning("Ignoring bungee time change since it was more than 2 hours ago");
globalDataHandler.setBoolean(plugin.getBungeeSettings().getServer(), type.toString(), false);
return false;
}
globalDataHandler.setBoolean(plugin.getBungeeSettings().getServer(), "Processing", true);
isProcessing = true;
plugin.debug("Detected time change from bungee: " + type.toString());
plugin.getTimeChecker().forceChanged(type, false, true, true);
globalDataHandler.setBoolean(plugin.getBungeeSettings().getServer(), type.toString(), false);
}
}
return isProcessing;
}
public void loadGlobalMysql() {
if (plugin.getBungeeSettings().isGloblalDataEnabled()) {
if (timer != null) {
timer.shutdown();
try {
timer.awaitTermination(5, TimeUnit.SECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
}
timer.shutdownNow();
}
timer = Executors.newScheduledThreadPool(1);
timer.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
checkGlobalData();
}
}, 60, 10, TimeUnit.SECONDS);
timer.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
globalDataHandler.setString(plugin.getBungeeSettings().getServer(), "LastOnline",
"" + LocalDateTime.now().atZone(ZoneOffset.UTC).toInstant().toEpochMilli());
}
}, 1, 60, TimeUnit.MINUTES);
if (globalDataHandler != null) {
globalDataHandler.getGlobalMysql().close();
}
if (plugin.getBungeeSettings().isGloblalDataUseMainMySQL()
&& plugin.getStorageType().equals(UserStorage.MYSQL)) {
globalDataHandler = new GlobalDataHandler(
new GlobalMySQL("VotingPlugin_GlobalData", plugin.getMysql().getMysql()) {
@Override
public void warning(String text) {
plugin.getLogger().warning(text);
}
@Override
public void severe(String text) {
plugin.getLogger().severe(text);
}
@Override
public void debug(Exception e) {
plugin.debug(e);
}
@Override
public void debug(String text) {
plugin.debug(text);
}
});
} else {
globalDataHandler = new GlobalDataHandler(
new GlobalMySQL("VotingPlugin_GlobalData", new MysqlConfigSpigot(
plugin.getBungeeSettings().getData().getConfigurationSection("GlobalData"))) {
@Override
public void warning(String text) {
plugin.getLogger().warning(text);
}
@Override
public void severe(String text) {
plugin.getLogger().severe(text);
}
@Override
public void debug(Exception e) {
plugin.debug(e);
}
@Override
public void debug(String text) {
plugin.debug(text);
}
});
}
globalDataHandler.getGlobalMysql().alterColumnType("IgnoreTime", "VARCHAR(5)");
globalDataHandler.getGlobalMysql().alterColumnType("MONTH", "VARCHAR(5)");
globalDataHandler.getGlobalMysql().alterColumnType("WEEK", "VARCHAR(5)");
globalDataHandler.getGlobalMysql().alterColumnType("DAY", "VARCHAR(5)");
globalDataHandler.getGlobalMysql().alterColumnType("FinishedProcessing", "VARCHAR(5)");
globalDataHandler.getGlobalMysql().alterColumnType("Processing", "VARCHAR(5)");
globalDataHandler.getGlobalMysql().alterColumnType("LastUpdated", "MEDIUMTEXT");
globalDataHandler.getGlobalMysql().alterColumnType("ForceUpdate", "VARCHAR(5)");
plugin.getTimeChecker().setProcessingEnabled(false);
}
}
public void load() {
plugin.debug("Loading bungee handler");
method = BungeeMethod.getByName(plugin.getBungeeSettings().getBungeeMethod());
plugin.getLogger().info("Using BungeeMethod: " + method.toString());
loadGlobalMysql();
globalMessageHandler = new GlobalMessageHandler() {
@Override
public void sendMessage(String subChannel, String... messageData) {
if (method.equals(BungeeMethod.MYSQL)) {
plugin.getPluginMessaging().sendPluginMessage(subChannel, messageData);
} else if (method.equals(BungeeMethod.PLUGINMESSAGING)) {
plugin.getPluginMessaging().sendPluginMessage(subChannel, messageData);
} else if (method.equals(BungeeMethod.SOCKETS)) {
ArrayList<String> list = new ArrayList<String>();
list.add(subChannel);
list.addAll(ArrayUtils.getInstance().convert(messageData));
sendData(ArrayUtils.getInstance().convert(list));
} else if (method.equals(BungeeMethod.REDIS)) {
ArrayList<String> list = new ArrayList<String>();
list.add(subChannel);
list.addAll(ArrayUtils.getInstance().convert(messageData));
redisHandler.sendMessage(plugin.getBungeeSettings().getRedisPrefix() + "VotingPlugin",
ArrayUtils.getInstance().convert(list));
}
}
};
globalMessageHandler.addListener(new GlobalMessageListener("Vote") {
@Override
public void onReceive(ArrayList<String> args) {
if (args.size() > 8) {
int bungeeVersion = Integer.parseInt(args.get(8));
if (bungeeVersion != BungeeVersion.getPluginMessageVersion()) {
plugin.getLogger().warning("Incompatible version with bungee, please update all servers"
+ bungeeVersion + ":" + BungeeVersion.getPluginMessageVersion());
return;
}
String player = args.get(0);
String uuid = args.get(1);
String service = args.get(2);
long time = Long.parseLong(args.get(3));
plugin.debug("pluginmessaging vote received from " + player + "/" + uuid + " on " + service);
VotingPluginUser user = plugin.getVotingPluginUserManager()
.getVotingPluginUser(UUID.fromString(uuid), player);
boolean wasOnline = Boolean.valueOf(args.get(4));
BungeeMessageData text = new BungeeMessageData(args.get(6));
bungeeVotePartyCurrent = text.getVotePartyCurrent();
bungeeVotePartyRequired = text.getVotePartyRequired();
plugin.getPlaceholders().onBungeeVotePartyUpdate();
plugin.getServerData().setBungeeVotePartyCurrent(bungeeVotePartyCurrent);
plugin.getServerData().setBungeeVotePartyRequired(bungeeVotePartyRequired);
boolean setTotals = Boolean.valueOf(args.get(7));
user.cache();
boolean broadcast = true;
boolean bungeeBroadcast = false;
if (args.size() > 9) {
bungeeBroadcast = Boolean.valueOf(args.get(9));
}
int num = 1;
if (args.size() > 10) {
num = Integer.valueOf(args.get(10));
}
int numberOfVotes = 1;
if (args.size() > 11) {
numberOfVotes = Integer.valueOf(args.get(11));
}
if (!bungeeBroadcast) {
if (!plugin.getBungeeSettings().isBungeeBroadcast()
&& !plugin.getBungeeSettings().isDisableBroadcast()) {
if (wasOnline || plugin.getBungeeSettings().isBungeeBroadcastAlways()) {
if (plugin.getConfigFile().isFormatOnlyOneOfflineBroadcast() && !wasOnline) {
if (num == 1) {
user.offlineBroadcast(user, plugin.getBungeeSettings().isUseBungeecoord(),
numberOfVotes);
}
} else {
VoteSite site = plugin.getVoteSite(service, true);
if (site != null) {
site.broadcastVote(user, false);
broadcast = false;
} else {
plugin.getLogger().warning("No votesite for " + service);
}
}
}
}
} else {
broadcast = false;
}
user.bungeeVotePluginMessaging(service, time, text, !setTotals, wasOnline, broadcast, num);
if (plugin.getBungeeSettings().isPerServerPoints()) {
user.addPoints(plugin.getConfigFile().getPointsOnVote());
}
plugin.getSpecialRewards().bungeeAllSitesCheck(user, numberOfVotes, num);
if (Boolean.valueOf(args.get(5))) {
plugin.getServerData().addServiceSite(service);
}
} else {
plugin.getLogger().warning("Incompatible version with bungee, please update all servers");
}
}
});
globalMessageHandler.addListener(new GlobalMessageListener("VoteOnline") {
@Override
public void onReceive(ArrayList<String> args) {
if (args.size() > 8) {
int bungeeVersion = Integer.parseInt(args.get(8));
if (bungeeVersion != BungeeVersion.getPluginMessageVersion()) {
plugin.getLogger().warning("Incompatible version with bungee, please update all servers");
return;
}
String player = args.get(0);
String uuid = args.get(1);
String service = args.get(2);
long time = Long.parseLong(args.get(3));
BungeeMessageData text = new BungeeMessageData(args.get(6));
bungeeVotePartyCurrent = text.getVotePartyCurrent();
bungeeVotePartyRequired = text.getVotePartyRequired();
plugin.getPlaceholders().onBungeeVotePartyUpdate();
plugin.getServerData().setBungeeVotePartyCurrent(bungeeVotePartyCurrent);
plugin.getServerData().setBungeeVotePartyRequired(bungeeVotePartyRequired);
plugin.debug("pluginmessaging voteonline received from " + player + "/" + uuid + " on " + service);
VotingPluginUser user = plugin.getVotingPluginUserManager()
.getVotingPluginUser(UUID.fromString(uuid), player);
user.cache();
if (plugin.getBungeeSettings().isPerServerPoints()) {
user.addPoints(plugin.getConfigFile().getPointsOnVote());
}
boolean setTotals = Boolean.valueOf(args.get(7));
boolean wasOnline = Boolean.valueOf(args.get(4));
boolean broadcast = true;
boolean bungeeBroadcast = false;
if (args.size() > 9) {
bungeeBroadcast = Boolean.valueOf(args.get(9));
}
int num = 1;
if (args.size() > 10) {
num = Integer.valueOf(args.get(10));
}
int numberOfVotes = 1;
if (args.size() > 11) {
numberOfVotes = Integer.valueOf(args.get(11));
}
if (!bungeeBroadcast) {
if (!plugin.getBungeeSettings().isBungeeBroadcast()
&& !plugin.getBungeeSettings().isDisableBroadcast()) {
if (wasOnline || plugin.getBungeeSettings().isBungeeBroadcastAlways()) {
if (plugin.getConfigFile().isFormatOnlyOneOfflineBroadcast() && !wasOnline) {
if (num == 1) {
user.offlineBroadcast(user, plugin.getBungeeSettings().isUseBungeecoord(),
numberOfVotes);
}
} else {
VoteSite site = plugin.getVoteSite(service, true);
if (site != null) {
site.broadcastVote(user, false);
broadcast = false;
} else {
plugin.getLogger().warning("No votesite for " + service);
}
}
}
}
} else {
broadcast = false;
}
user.bungeeVotePluginMessaging(service, time, text, !setTotals, wasOnline, broadcast, num);
if (plugin.getBungeeSettings().isPerServerPoints()) {
user.addPoints(plugin.getConfigFile().getPointsOnVote());
}
plugin.getSpecialRewards().bungeeAllSitesCheck(user, numberOfVotes, num);
if (Boolean.valueOf(args.get(5))) {
plugin.getServerData().addServiceSite(service);
}
} else {
plugin.getLogger().warning("Incompatible version with bungee, please update all servers");
}
}
});
globalMessageHandler.addListener(new GlobalMessageListener("VoteUpdate") {
@Override
public void onReceive(ArrayList<String> args) {
String player = args.get(0);
plugin.debug("pluginmessaging voteupdate received for " + player);
VotingPluginUser user = plugin.getVotingPluginUserManager()
.getVotingPluginUser(UUID.fromString(player));
user.cache();
user.offVote();
if (args.size() > 3 && plugin.getBungeeSettings().isPerServerMilestones()) {
BungeeMessageData text = new BungeeMessageData(args.get(3));
plugin.getSpecialRewards().checkMilestone(user, text, true);
}
if (args.size() > 2) {
bungeeVotePartyCurrent = Integer.parseInt(args.get(1));
bungeeVotePartyRequired = Integer.parseInt(args.get(2));
plugin.getServerData().setBungeeVotePartyCurrent(bungeeVotePartyCurrent);
plugin.getServerData().setBungeeVotePartyRequired(bungeeVotePartyRequired);
}
plugin.setUpdate(true);
}
});
globalMessageHandler.addListener(new GlobalMessageListener("BungeeTimeChange") {
@Override
public void onReceive(ArrayList<String> args) {
checkGlobalData();
}
});
globalMessageHandler.addListener(new GlobalMessageListener("VoteBroadcast") {
@Override
public void onReceive(ArrayList<String> args) {
if (args.size() > 2) {
String uuid = args.get(0);
String service = args.get(2);
VotingPluginUser user = plugin.getVotingPluginUserManager()
.getVotingPluginUser(UUID.fromString(uuid), args.get(1));
VoteSite site = plugin.getVoteSite(service, true);
if (site != null) {
site.broadcastVote(user, false);
} else {
plugin.getLogger().warning("No votesite for " + service);
}
}
}
});
globalMessageHandler.addListener(new GlobalMessageListener("VoteBroadcastOffline") {
@Override
public void onReceive(ArrayList<String> args) {
if (args.size() > 2) {
String uuid = args.get(0);
String votes = args.get(2);
VotingPluginUser user = plugin.getVotingPluginUserManager()
.getVotingPluginUser(UUID.fromString(uuid), args.get(1));
user.offlineBroadcast(user, false, Integer.parseInt(votes));
}
}
});
globalMessageHandler.addListener(new GlobalMessageListener("Status") {
@Override
public void onReceive(ArrayList<String> args) {
String server = args.get(0);
sendMessage(globalMessageHandler, "statusokay", server);
}
});
globalMessageHandler.addListener(new GlobalMessageListener("ServerName") {
@Override
public void onReceive(ArrayList<String> args) {
String server = args.get(0);
if (!plugin.getOptions().getServer().equals(server)) {
plugin.getLogger().warning("Server name doesn't match in BungeeSettings.yml, should be " + server);
}
}
});
globalMessageHandler.addListener(new GlobalMessageListener("VotePartyBungee") {
@Override
public void onReceive(ArrayList<String> args) {
for (final String cmd : plugin.getBungeeSettings().getBungeeVotePartyGlobalCommands()) {
plugin.getBukkitScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), cmd);
}
});
}
for (Player p : Bukkit.getOnlinePlayers()) {
new RewardBuilder(plugin.getBungeeSettings().getData(), "BungeeVotePartyRewards").send(p);
}
}
});
globalMessageHandler.addListener(new GlobalMessageListener("VotePartyBroadcast") {
@Override
public void onReceive(ArrayList<String> args) {
String broadcast = args.get(0);
MiscUtils.getInstance().broadcast(broadcast);
}
});
if (method.equals(BungeeMethod.MYSQL)) {
plugin.registerBungeeChannels("vp:vp");
} else if (method.equals(BungeeMethod.REDIS)) {
redisHandler = new RedisHandler(plugin.getBungeeSettings().getRedisHost(),
plugin.getBungeeSettings().getRedisPort(), plugin.getBungeeSettings().getRedisUsername(),
plugin.getBungeeSettings().getRedisPassword()) {
@Override
protected void onMessage(String channel, String[] message) {
plugin.getLogger().info(channel
+ ArrayUtils.getInstance().makeStringList(ArrayUtils.getInstance().convert(message)));
if (message.length > 0) {
ArrayList<String> list = new ArrayList<String>();
for (int i = 1; i < message.length; i++) {
list.add(message[i]);
}
globalMessageHandler.onMessage(message[0], list);
}
}
@Override
public void debug(String message) {
if (plugin.getBungeeSettings().isBungeeDebug()) {
plugin.debug(message);
}
}
};
redisThread = new Thread(new Runnable() {
@Override
public void run() {
if (plugin.isEnabled()) {
redisHandler.loadListener(
new RedisListener(redisHandler, plugin.getBungeeSettings().getRedisPrefix()
+ "VotingPlugin_" + plugin.getBungeeSettings().getServer()));
}
}
});
redisThread.start();
} else if (method.equals(BungeeMethod.PLUGINMESSAGING)) {
plugin.registerBungeeChannels("vp:vp");
bungeeVotePartyCurrent = plugin.getServerData().getBungeeVotePartyCurrent();
bungeeVotePartyRequired = plugin.getServerData().getBungeeVotePartyRequired();
plugin.getPluginMessaging().setDebug(plugin.getBungeeSettings().isBungeeDebug());
plugin.getPluginMessaging().add(new PluginMessageHandler("Vote") {
@Override
public void onRecieve(String subChannel, ArrayList<String> args) {
globalMessageHandler.onMessage("Vote", args);
}
});
plugin.getPluginMessaging().add(new PluginMessageHandler("VoteOnline") {
@Override
public void onRecieve(String subChannel, ArrayList<String> args) {
globalMessageHandler.onMessage("VoteOnline", args);
}
});
plugin.getPluginMessaging().add(new PluginMessageHandler("VoteUpdate") {
@Override
public void onRecieve(String subChannel, ArrayList<String> args) {
globalMessageHandler.onMessage("VoteUpdate", args);
}
});
plugin.getPluginMessaging().add(new PluginMessageHandler("BungeeTimeChange") {
@Override
public void onRecieve(String subChannel, ArrayList<String> args) {
globalMessageHandler.onMessage("BungeeTimeChange", args);
}
});
plugin.getPluginMessaging().add(new PluginMessageHandler("VoteBroadcast") {
@Override
public void onRecieve(String subChannel, ArrayList<String> args) {
globalMessageHandler.onMessage("VoteBroadcast", args);
}
});
plugin.getPluginMessaging().add(new PluginMessageHandler("VoteBroadcastOffline") {
@Override
public void onRecieve(String subChannel, ArrayList<String> args) {
globalMessageHandler.onMessage("VoteBroadcastOffline", args);
}
});
plugin.getPluginMessaging().add(new PluginMessageHandler("Status") {
@Override
public void onRecieve(String subChannel, ArrayList<String> args) {
globalMessageHandler.onMessage("Status", args);
}
});
plugin.getPluginMessaging().add(new PluginMessageHandler("ServerName") {
@Override
public void onRecieve(String subChannel, ArrayList<String> args) {
globalMessageHandler.onMessage("ServerName", args);
}
});
plugin.getPluginMessaging().add(new PluginMessageHandler("VotePartyBungee") {
@Override
public void onRecieve(String subChannel, ArrayList<String> args) {
globalMessageHandler.onMessage("VotePartyBungee", args);
}
});
plugin.getPluginMessaging().add(new PluginMessageHandler("VotePartyBroadcast") {
@Override
public void onRecieve(String subChannel, ArrayList<String> args) {
globalMessageHandler.onMessage("VotePartyBroadcast", args);
}
});
} else if (method.equals(BungeeMethod.SOCKETS)) {
encryptionHandler = new EncryptionHandler(new File(plugin.getDataFolder(), "secretkey.key"));
clientHandler = new ClientHandler(plugin.getBungeeSettings().getBungeeServerHost(),
plugin.getBungeeSettings().getBungeeServerPort(), encryptionHandler,
plugin.getBungeeSettings().isBungeeDebug());
socketHandler = new SocketHandler(plugin.getVersion(), plugin.getBungeeSettings().getSpigotServerHost(),
plugin.getBungeeSettings().getSpigotServerPort(), encryptionHandler,
plugin.getBungeeSettings().isBungeeDebug()) {
@Override
public void log(String str) {
plugin.getLogger().info(str);
}
};
socketHandler.add(new SocketReceiver("bungeevote") {
@Override
public void onReceive(String[] data) {
if (data.length > 5) {
plugin.extraDebug("BungeeVote from " + data[2] + ", processing");
String uuid = data[1];
VotingPluginUser user = null;
if (!uuid.isEmpty()) {
user = plugin.getVotingPluginUserManager().getVotingPluginUser(UUID.fromString(uuid));
} else {
user = plugin.getVotingPluginUserManager().getVotingPluginUser(data[2]);
}
user.cache();
if (plugin.getBungeeSettings().isPerServerPoints()) {
user.addPoints(plugin.getConfigFile().getPointsOnVote());
}
user.bungeeVote(data[3], new BungeeMessageData(data[4]), !Boolean.valueOf(data[5]));
}
}
});
socketHandler.add(new SocketReceiver("BungeeTimeChange") {
@Override
public void onReceive(String[] data) {
checkGlobalData();
}
});
socketHandler.add(new SocketReceiver("bungeevoteonline") {
@Override
public void onReceive(String[] data) {
if (data.length > 5) {
plugin.extraDebug("BungeeVoteOnline from " + data[2] + ", processing");
String uuid = data[1];
VotingPluginUser user = null;
if (!uuid.isEmpty()) {
user = plugin.getVotingPluginUserManager().getVotingPluginUser(UUID.fromString(uuid));
} else {
user = plugin.getVotingPluginUserManager().getVotingPluginUser(data[2]);
}
user.cache();
if (plugin.getBungeeSettings().isPerServerPoints()) {
user.addPoints(plugin.getConfigFile().getPointsOnVote());
}
user.bungeeVoteOnline(data[3], new BungeeMessageData(data[4]), !Boolean.valueOf(data[5]));
}
}
});
socketHandler.add(new SocketReceiver("BroadcastOffline") {
@Override
public void onReceive(String[] data) {
if (data.length > 2) {
String votes = data[0];
String p = data[1];
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(p);
user.offlineBroadcast(user, false, Integer.parseInt(votes));
}
}
});
socketHandler.add(new SocketReceiver("BungeeBroadcast") {
@Override
public void onReceive(String[] data) {
if (data.length > 2) {
VoteSite site = plugin.getVoteSite(data[1], true);
String p = data[3];
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(p);
if (site != null) {
site.broadcastVote(user, false);
} else {
plugin.getLogger().warning("No votesite for " + data[1]);
}
}
}
});
socketHandler.add(new SocketReceiver("Broadcast") {
@Override
public void onReceive(String[] data) {
if (data.length > 2) {
VoteSite site = plugin.getVoteSite(data[1], true);
String p = data[2];
VotingPluginUser user = plugin.getVotingPluginUserManager().getVotingPluginUser(p);
if (site != null) {
site.broadcastVote(user, false);
} else {
plugin.getLogger().warning("No votesite for " + data[1]);
}
}
}
});
socketHandler.add(new SocketReceiver("Status") {
@Override
public void onReceive(String[] data) {
if (data.length > 0) {
plugin.getLogger().info("Received status command, sending status back");
sendData("StatusOkay", plugin.getOptions().getServer());
}
}
});
socketHandler.add(new SocketReceiver("BungeeUpdate") {
@Override
public void onReceive(String[] data) {
plugin.setUpdate(true);
}
});
socketHandler.add(new SocketReceiver("VotePartyBungee") {
@Override
public void onReceive(String[] data) {
for (Player p : Bukkit.getOnlinePlayers()) {
new RewardBuilder(plugin.getBungeeSettings().getData(), "BungeeVotePartyRewards").send(p);
}
}
});
socketHandler.add(new SocketReceiver("VotePartyBroadcast") {
@Override
public void onReceive(String[] data) {
String broadcast = data[0];
MiscUtils.getInstance().broadcast(broadcast);
}
});
if (plugin.getOptions().getServer().equalsIgnoreCase("pleaseset")) {
plugin.getLogger().warning("Server name for bungee voting is not set, please set it");
}
}
}
public void sendData(String... strings) {
clientHandler.sendMessage(strings);
}
}
@@ -0,0 +1,39 @@
package com.bencodez.votingplugin;
import org.bukkit.entity.Player;
import com.bencodez.advancedcore.api.rewards.injected.RewardInject;
import com.bencodez.advancedcore.api.rewards.injectedrequirement.RequirementInject;
import com.bencodez.votingplugin.user.UserManager;
import com.bencodez.votingplugin.user.VotingPluginUser;
public class VotingPluginHooks {
private static VotingPluginHooks instance = new VotingPluginHooks();
public static VotingPluginHooks getInstance() {
return instance;
}
public void addCustomRequirement(RequirementInject inject) {
getMainClass().getRewardHandler().addInjectedRequirements(inject);
}
public void addCustomReward(RewardInject inject) {
getMainClass().getRewardHandler().addInjectedReward(inject);
}
public void backgroundUpdate(Player player) {
VotingPluginUser user = getUserManager().getVotingPluginUser(player);
user.offVote();
user.checkOfflineRewards();
}
public VotingPluginMain getMainClass() {
return VotingPluginMain.plugin;
}
public UserManager getUserManager() {
return getMainClass().getVotingPluginUserManager();
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,378 @@
package com.bencodez.votingplugin;
import java.util.concurrent.Callable;
import com.bencodez.advancedcore.api.metrics.BStatsMetrics;
public class VotingPluginMetrics {
public void load(VotingPluginMain plugin) {
BStatsMetrics metrics = new BStatsMetrics(plugin, 38);
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_firstvote", new Callable<String>() {
@Override
public String call() throws Exception {
if (plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
plugin.getSpecialRewardsConfig().getFirstVoteRewardsPath())) {
return "True";
} else {
return "False";
}
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_everysite", new Callable<String>() {
@Override
public String call() throws Exception {
if (plugin.getRewardHandler().hasRewards(plugin.getConfigVoteSites().getData(),
plugin.getConfigVoteSites().getEverySiteRewardPath())) {
return "True";
} else {
return "False";
}
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_allsites", new Callable<String>() {
@Override
public String call() throws Exception {
if (plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
plugin.getSpecialRewardsConfig().getAllSitesRewardPath())) {
return "True";
} else {
return "False";
}
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_cumulative", new Callable<String>() {
@Override
public String call() throws Exception {
if (plugin.getSpecialRewardsConfig().getCumulativeVotes().size() == 0) {
return "False";
} else {
for (String cum : plugin.getSpecialRewardsConfig().getCumulativeVotes()) {
if (plugin.getSpecialRewardsConfig().getCumulativeRewardEnabled(Integer.parseInt(cum))) {
return "True";
}
}
return "False";
}
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_voteparty", new Callable<String>() {
@Override
public String call() throws Exception {
if (!plugin.getSpecialRewardsConfig().isVotePartyEnabled()) {
return "False";
} else {
return "True";
}
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("placeholder_cache_level", new Callable<String>() {
@Override
public String call() throws Exception {
return plugin.getPlaceholders().getCacheLevel().toString();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_milestone", new Callable<String>() {
@Override
public String call() throws Exception {
if (plugin.getSpecialRewardsConfig().getMilestoneVotes().size() == 0) {
return "False";
} else {
for (String milestone : plugin.getSpecialRewardsConfig().getMilestoneVotes()) {
if (plugin.getSpecialRewardsConfig().getMilestoneRewardEnabled(Integer.parseInt(milestone))) {
return "True";
}
}
return "False";
}
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_anysitereward", new Callable<String>() {
@Override
public String call() throws Exception {
if (plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
plugin.getSpecialRewardsConfig().getAnySiteRewardsPath())) {
return "True";
} else {
return "False";
}
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_votestreakday", new Callable<String>() {
@Override
public String call() throws Exception {
for (String s : plugin.getSpecialRewardsConfig().getVoteStreakVotes("Day")) {
if (plugin.getSpecialRewardsConfig().getVoteStreakRewardEnabled("Day", s)
&& plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
plugin.getSpecialRewardsConfig().getVoteStreakRewardsPath("Day", s))) {
return "True";
}
}
return "False";
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_votestreakweek", new Callable<String>() {
@Override
public String call() throws Exception {
for (String s : plugin.getSpecialRewardsConfig().getVoteStreakVotes("Week")) {
if (plugin.getSpecialRewardsConfig().getVoteStreakRewardEnabled("Week", s)
&& plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
plugin.getSpecialRewardsConfig().getVoteStreakRewardsPath("Week", s))) {
return "True";
}
}
return "False";
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("extrarewards_votestreakmonth", new Callable<String>() {
@Override
public String call() throws Exception {
for (String s : plugin.getSpecialRewardsConfig().getVoteStreakVotes("Month")) {
if (plugin.getSpecialRewardsConfig().getVoteStreakRewardEnabled("Month", s)
&& plugin.getRewardHandler().hasRewards(plugin.getSpecialRewardsConfig().getData(),
plugin.getSpecialRewardsConfig().getVoteStreakRewardsPath("Month", s))) {
return "True";
}
}
return "False";
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("numberofsites", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getVoteSitesEnabled().size();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("numberofrewards", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getRewardHandler().getRewards().size();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("autocreatevotesites", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getConfigFile().isAutoCreateVoteSites();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("numberofusers", new Callable<String>() {
@Override
public String call() throws Exception {
int total = plugin.getUserManager().getAllUUIDs().size();
if (total > 800000) {
return ">800000";
} else if (total > 700000) {
return "700000-800000";
} else if (total > 600000) {
return "600000-700000";
} else if (total > 500000) {
return "500000-600000";
} else if (total > 400000) {
return "400000-500000";
} else if (total > 300000) {
return "300000-400000";
} else if (total > 200000) {
return "200000-300000";
} else if (total > 100000) {
return "100000-200000";
} else if (total > 10000) {
return ">10000-100000";
}
return "<10000";
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("data_storage", new Callable<String>() {
@Override
public String call() throws Exception {
return plugin.getOptions().getStorageType().toString();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("DisableCheckOnWorldChange", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getOptions().isDisableCheckOnWorldChange();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("votereminding_enabled", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getConfigFile().isVoteRemindingEnabled();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("LoadTopVoter_Monthly", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getConfigFile().isLoadTopVoterMonthly();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("LoadTopVoter_Weekly", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getConfigFile().isLoadTopVoterWeekly();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("LoadTopVoter_Daily", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getConfigFile().isLoadTopVoterDaily();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("bungeemethod", new Callable<String>() {
@Override
public String call() throws Exception {
if (plugin.getBungeeSettings().isUseBungeecoord()) {
return "" + plugin.getBungeeHandler().getMethod().toString();
} else {
return "Disabled";
}
}
}));
if (plugin.getBungeeSettings().isUseBungeecoord()) {
metrics.addCustomChart(new BStatsMetrics.SimplePie("bungeebroadcast", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getBungeeSettings().isBungeeBroadcast();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("bungeebroadcastalways", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getBungeeSettings().isBungeeBroadcastAlways();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("perserverrewards", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getBungeeSettings().isPerServerRewards();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("perserverpoints", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getBungeeSettings().isPerServerPoints();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("triggervotifierevent", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getBungeeSettings().isTriggerVotifierEvent();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("globaldata_enabled", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getBungeeSettings().isGloblalDataEnabled();
}
}));
if (plugin.getBungeeSettings().isGloblalDataEnabled()) {
metrics.addCustomChart(new BStatsMetrics.SimplePie("globaldata_usemainmysql", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getBungeeSettings().isGloblalDataUseMainMySQL();
}
}));
}
}
metrics.addCustomChart(new BStatsMetrics.SimplePie("persitecooldownevents", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getConfigFile().isPerSiteCoolDownEvents();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("bedrockplayerprefix", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getOptions().getBedrockPlayerPrefix();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("using_dev_build", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getProfile().contains("dev");
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("votepointtransfering", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getConfigFile().isAllowVotePointTransfers();
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("votecooldown_check_enabled", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + (!plugin.getConfigFile().isDisableCoolDownCheck() && plugin.getRewardHandler()
.hasRewards(plugin.getSpecialRewardsConfig().getData(), "VoteCoolDownEndedReward"));
}
}));
metrics.addCustomChart(new BStatsMetrics.SimplePie("background_task_time_taken", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getLastBackgroundTaskTimeTaken();
}
}));
if (!plugin.getBuildNumber().equals("NOTSET")) {
metrics.addCustomChart(new BStatsMetrics.SimplePie("dev_build_number", new Callable<String>() {
@Override
public String call() throws Exception {
return "" + plugin.getBuildNumber();
}
}));
}
}
}
@@ -0,0 +1,76 @@
package com.bencodez.votingplugin.broadcast;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import com.bencodez.advancedcore.api.messages.StringParser;
import com.bencodez.advancedcore.api.misc.MiscUtils;
import com.bencodez.votingplugin.VotingPluginMain;
public class BroadcastHandler {
private VotingPluginMain plugin;
private ScheduledExecutorService timer;
ConcurrentLinkedQueue<String> votedPlayers = new ConcurrentLinkedQueue<String>();
public BroadcastHandler(VotingPluginMain plugin, int delay) {
this.plugin = plugin;
schedule(delay);
}
public void check() {
int size = votedPlayers.size();
if (size > 0) {
for (int i = 0; i < size; i++) {
votedPlayers.poll();
}
String bc = StringParser.getInstance()
.colorize(plugin.getConfigFile().getFormatAlternateBroadcastBroadcast());
String playersText = "";
while (!votedPlayers.isEmpty()) {
playersText += votedPlayers.remove();
if (!votedPlayers.isEmpty()) {
playersText += ", ";
}
}
HashMap<String, String> placeholders = new HashMap<String, String>();
placeholders.put("numberofplayers", "" + size);
placeholders.put("players", playersText);
bc = StringParser.getInstance().replacePlaceHolder(bc, placeholders);
ArrayList<Player> players = new ArrayList<Player>();
for (Player p : Bukkit.getOnlinePlayers()) {
if (!plugin.getVotingPluginUserManager().getVotingPluginUser(p).getDisableBroadcast()) {
players.add(p);
}
}
MiscUtils.getInstance().broadcast(bc, players);
}
}
public void onVote(String player) {
votedPlayers.add(player);
}
public void schedule(int delay) {
if (timer != null) {
timer.shutdownNow();
timer = Executors.newScheduledThreadPool(1);
} else {
timer = Executors.newScheduledThreadPool(1);
}
timer.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
check();
}
}, 60, 60 * delay, TimeUnit.SECONDS);
}
}
@@ -0,0 +1,771 @@
package com.bencodez.votingplugin.bungee;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.GZIPOutputStream;
import javax.net.ssl.HttpsURLConnection;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
/**
* bStats collects some data for plugin authors.
* <p>
* Check out https://bStats.org/ to learn more about bStats!
*/
public class BStatsMetricsBungee {
/**
* Represents a custom advanced bar chart.
*/
public static class AdvancedBarChart extends CustomChart {
private final Callable<Map<String, int[]>> callable;
/**
* Class constructor.
*
* @param chartId The id of the chart.
* @param callable The callable which is used to request the chart data.
*/
public AdvancedBarChart(String chartId, Callable<Map<String, int[]>> callable) {
super(chartId);
this.callable = callable;
}
@Override
protected JsonObject getChartData() throws Exception {
JsonObject data = new JsonObject();
JsonObject values = new JsonObject();
Map<String, int[]> map = callable.call();
if (map == null || map.isEmpty()) {
// Null = skip the chart
return null;
}
boolean allSkipped = true;
for (Map.Entry<String, int[]> entry : map.entrySet()) {
if (entry.getValue().length == 0) {
continue; // Skip this invalid
}
allSkipped = false;
JsonArray categoryValues = new JsonArray();
for (int categoryValue : entry.getValue()) {
categoryValues.add(new JsonPrimitive(categoryValue));
}
values.add(entry.getKey(), categoryValues);
}
if (allSkipped) {
// Null = skip the chart
return null;
}
data.add("values", values);
return data;
}
}
/**
* Represents a custom advanced pie.
*/
public static class AdvancedPie extends CustomChart {
private final Callable<Map<String, Integer>> callable;
/**
* Class constructor.
*
* @param chartId The id of the chart.
* @param callable The callable which is used to request the chart data.
*/
public AdvancedPie(String chartId, Callable<Map<String, Integer>> callable) {
super(chartId);
this.callable = callable;
}
@Override
protected JsonObject getChartData() throws Exception {
JsonObject data = new JsonObject();
JsonObject values = new JsonObject();
Map<String, Integer> map = callable.call();
if (map == null || map.isEmpty()) {
// Null = skip the chart
return null;
}
boolean allSkipped = true;
for (Map.Entry<String, Integer> entry : map.entrySet()) {
if (entry.getValue() == 0) {
continue; // Skip this invalid
}
allSkipped = false;
values.addProperty(entry.getKey(), entry.getValue());
}
if (allSkipped) {
// Null = skip the chart
return null;
}
data.add("values", values);
return data;
}
}
/**
* Represents a custom chart.
*/
public static abstract class CustomChart {
// The id of the chart
private final String chartId;
/**
* Class constructor.
*
* @param chartId The id of the chart.
*/
CustomChart(String chartId) {
if (chartId == null || chartId.isEmpty()) {
throw new IllegalArgumentException("ChartId cannot be null or empty!");
}
this.chartId = chartId;
}
protected abstract JsonObject getChartData() throws Exception;
private JsonObject getRequestJsonObject(Logger logger, boolean logFailedRequests) {
JsonObject chart = new JsonObject();
chart.addProperty("chartId", chartId);
try {
JsonObject data = getChartData();
if (data == null) {
// If the data is null we don't send the chart.
return null;
}
chart.add("data", data);
} catch (Throwable t) {
if (logFailedRequests) {
logger.log(Level.WARNING, "Failed to get data for custom chart with id " + chartId, t);
}
return null;
}
return chart;
}
}
/**
* Represents a custom drilldown pie.
*/
public static class DrilldownPie extends CustomChart {
private final Callable<Map<String, Map<String, Integer>>> callable;
/**
* Class constructor.
*
* @param chartId The id of the chart.
* @param callable The callable which is used to request the chart data.
*/
public DrilldownPie(String chartId, Callable<Map<String, Map<String, Integer>>> callable) {
super(chartId);
this.callable = callable;
}
@Override
public JsonObject getChartData() throws Exception {
JsonObject data = new JsonObject();
JsonObject values = new JsonObject();
Map<String, Map<String, Integer>> map = callable.call();
if (map == null || map.isEmpty()) {
// Null = skip the chart
return null;
}
boolean reallyAllSkipped = true;
for (Map.Entry<String, Map<String, Integer>> entryValues : map.entrySet()) {
JsonObject value = new JsonObject();
boolean allSkipped = true;
for (Map.Entry<String, Integer> valueEntry : map.get(entryValues.getKey()).entrySet()) {
value.addProperty(valueEntry.getKey(), valueEntry.getValue());
allSkipped = false;
}
if (!allSkipped) {
reallyAllSkipped = false;
values.add(entryValues.getKey(), value);
}
}
if (reallyAllSkipped) {
// Null = skip the chart
return null;
}
data.add("values", values);
return data;
}
}
/**
* Represents a custom multi line chart.
*/
public static class MultiLineChart extends CustomChart {
private final Callable<Map<String, Integer>> callable;
/**
* Class constructor.
*
* @param chartId The id of the chart.
* @param callable The callable which is used to request the chart data.
*/
public MultiLineChart(String chartId, Callable<Map<String, Integer>> callable) {
super(chartId);
this.callable = callable;
}
@Override
protected JsonObject getChartData() throws Exception {
JsonObject data = new JsonObject();
JsonObject values = new JsonObject();
Map<String, Integer> map = callable.call();
if (map == null || map.isEmpty()) {
// Null = skip the chart
return null;
}
boolean allSkipped = true;
for (Map.Entry<String, Integer> entry : map.entrySet()) {
if (entry.getValue() == 0) {
continue; // Skip this invalid
}
allSkipped = false;
values.addProperty(entry.getKey(), entry.getValue());
}
if (allSkipped) {
// Null = skip the chart
return null;
}
data.add("values", values);
return data;
}
}
/**
* Represents a custom simple bar chart.
*/
public static class SimpleBarChart extends CustomChart {
private final Callable<Map<String, Integer>> callable;
/**
* Class constructor.
*
* @param chartId The id of the chart.
* @param callable The callable which is used to request the chart data.
*/
public SimpleBarChart(String chartId, Callable<Map<String, Integer>> callable) {
super(chartId);
this.callable = callable;
}
@Override
protected JsonObject getChartData() throws Exception {
JsonObject data = new JsonObject();
JsonObject values = new JsonObject();
Map<String, Integer> map = callable.call();
if (map == null || map.isEmpty()) {
// Null = skip the chart
return null;
}
for (Map.Entry<String, Integer> entry : map.entrySet()) {
JsonArray categoryValues = new JsonArray();
categoryValues.add(new JsonPrimitive(entry.getValue()));
values.add(entry.getKey(), categoryValues);
}
data.add("values", values);
return data;
}
}
/**
* Represents a custom simple pie.
*/
public static class SimplePie extends CustomChart {
private final Callable<String> callable;
/**
* Class constructor.
*
* @param chartId The id of the chart.
* @param callable The callable which is used to request the chart data.
*/
public SimplePie(String chartId, Callable<String> callable) {
super(chartId);
this.callable = callable;
}
@Override
protected JsonObject getChartData() throws Exception {
JsonObject data = new JsonObject();
String value = callable.call();
if (value == null || value.isEmpty()) {
// Null = skip the chart
return null;
}
data.addProperty("value", value);
return data;
}
}
/**
* Represents a custom single line chart.
*/
public static class SingleLineChart extends CustomChart {
private final Callable<Integer> callable;
/**
* Class constructor.
*
* @param chartId The id of the chart.
* @param callable The callable which is used to request the chart data.
*/
public SingleLineChart(String chartId, Callable<Integer> callable) {
super(chartId);
this.callable = callable;
}
@Override
protected JsonObject getChartData() throws Exception {
JsonObject data = new JsonObject();
int value = callable.call();
if (value == 0) {
// Null = skip the chart
return null;
}
data.addProperty("value", value);
return data;
}
}
// The version of this bStats class
public static final int B_STATS_VERSION = 1;
// A list with all known metrics class objects including this one
private static final List<Object> knownMetricsInstances = new ArrayList<>();
// Should the response text be logged?
private static boolean logResponseStatusText;
// Should the sent data be logged?
private static boolean logSentData;
// The url to which the data is sent
private static final String URL = "https://bStats.org/submitData/bungeecord";
static {
// You can use the property to disable the check in your test environment
if (System.getProperty("bstats.relocatecheck") == null
|| !System.getProperty("bstats.relocatecheck").equals("false")) {
// Maven's Relocate is clever and changes strings, too. So we have to use this
// little "trick" ... :D
final String defaultPackage = new String(new byte[] { 'o', 'r', 'g', '.', 'b', 's', 't', 'a', 't', 's', '.',
'b', 'u', 'n', 'g', 'e', 'e', 'c', 'o', 'r', 'd' });
final String examplePackage = new String(
new byte[] { 'y', 'o', 'u', 'r', '.', 'p', 'a', 'c', 'k', 'a', 'g', 'e' });
// We want to make sure nobody just copy & pastes the example and use the wrong
// package names
if (BStatsMetricsBungee.class.getPackage().getName().equals(defaultPackage)
|| BStatsMetricsBungee.class.getPackage().getName().equals(examplePackage)) {
throw new IllegalStateException("bStats Metrics class has not been relocated correctly!");
}
}
}
/**
* Gzips the given String.
*
* @param str The string to gzip.
* @return The gzipped String.
* @throws IOException If the compression failed.
*/
private static byte[] compress(final String str) throws IOException {
if (str == null) {
return null;
}
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try (GZIPOutputStream gzip = new GZIPOutputStream(outputStream)) {
gzip.write(str.getBytes(StandardCharsets.UTF_8));
}
return outputStream.toByteArray();
}
/**
* Links an other metrics class with this class. This method is called using
* Reflection.
*
* @param metrics An object of the metrics class to link.
*/
public static void linkMetrics(Object metrics) {
knownMetricsInstances.add(metrics);
}
/**
* Sends the data to the bStats server.
*
* @param plugin Any plugin. It's just used to get a logger instance.
* @param data The data to send.
* @throws Exception If the request failed.
*/
private static void sendData(Plugin plugin, JsonObject data) throws Exception {
if (data == null) {
throw new IllegalArgumentException("Data cannot be null");
}
if (logSentData) {
plugin.getLogger().info("Sending data to bStats: " + data);
}
HttpsURLConnection connection = (HttpsURLConnection) new URL(URL).openConnection();
// Compress the data to save bandwidth
byte[] compressedData = compress(data.toString());
// Add headers
connection.setRequestMethod("POST");
connection.addRequestProperty("Accept", "application/json");
connection.addRequestProperty("Connection", "close");
connection.addRequestProperty("Content-Encoding", "gzip"); // We gzip our request
connection.addRequestProperty("Content-Length", String.valueOf(compressedData.length));
connection.setRequestProperty("Content-Type", "application/json"); // We send our data in JSON format
connection.setRequestProperty("User-Agent", "MC-Server/" + B_STATS_VERSION);
// Send data
connection.setDoOutput(true);
try (DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream())) {
outputStream.write(compressedData);
}
StringBuilder builder = new StringBuilder();
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
String line;
while ((line = bufferedReader.readLine()) != null) {
builder.append(line);
}
}
if (logResponseStatusText) {
plugin.getLogger().info("Sent data to bStats and received response: " + builder);
}
}
// A list with all custom charts
private final List<CustomChart> charts = new ArrayList<>();
// Is bStats enabled on this server?
private boolean enabled;
// Should failed requests be logged?
private boolean logFailedRequests = false;
// The plugin
private final Plugin plugin;
// The plugin id
private final int pluginId;
// The uuid of the server
private String serverUUID;
/**
* Class constructor.
*
* @param plugin The plugin which stats should be submitted.
* @param pluginId The id of the plugin. It can be found at
* <a href="https://bstats.org/what-is-my-plugin-id">What is my
* plugin id?</a>
*/
public BStatsMetricsBungee(Plugin plugin, int pluginId) {
this.plugin = plugin;
this.pluginId = pluginId;
try {
loadConfig();
} catch (IOException e) {
// Failed to load configuration
plugin.getLogger().log(Level.WARNING, "Failed to load bStats config!", e);
return;
}
// We are not allowed to send data about this server :(
if (!enabled) {
return;
}
Class<?> usedMetricsClass = getFirstBStatsClass();
if (usedMetricsClass == null) {
// Failed to get first metrics class
return;
}
if (usedMetricsClass == getClass()) {
// We are the first! :)
linkMetrics(this);
startSubmitting();
} else {
// We aren't the first so we link to the first metrics class
try {
usedMetricsClass.getMethod("linkMetrics", Object.class).invoke(null, this);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
if (logFailedRequests) {
plugin.getLogger().log(Level.WARNING,
"Failed to link to first metrics class " + usedMetricsClass.getName() + "!", e);
}
}
}
}
/**
* Adds a custom chart.
*
* @param chart The chart to add.
*/
public void addCustomChart(CustomChart chart) {
if (chart == null) {
plugin.getLogger().log(Level.WARNING, "Chart cannot be null");
}
charts.add(chart);
}
/**
* Gets the first bStat Metrics class.
*
* @return The first bStats metrics class.
*/
private Class<?> getFirstBStatsClass() {
File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
bStatsFolder.mkdirs();
File tempFile = new File(bStatsFolder, "temp.txt");
try {
String className = readFile(tempFile);
if (className != null) {
try {
// Let's check if a class with the given name exists.
return Class.forName(className);
} catch (ClassNotFoundException ignored) {
}
}
writeFile(tempFile, getClass().getName());
return getClass();
} catch (IOException e) {
if (logFailedRequests) {
plugin.getLogger().log(Level.WARNING, "Failed to get first bStats class!", e);
}
return null;
}
}
/**
* Gets the plugin specific data. This method is called using Reflection.
*
* @return The plugin specific data.
*/
public JsonObject getPluginData() {
JsonObject data = new JsonObject();
String pluginName = plugin.getDescription().getName();
String pluginVersion = plugin.getDescription().getVersion();
data.addProperty("pluginName", pluginName);
data.addProperty("id", pluginId);
data.addProperty("pluginVersion", pluginVersion);
JsonArray customCharts = new JsonArray();
for (CustomChart customChart : charts) {
// Add the data of the custom charts
JsonObject chart = customChart.getRequestJsonObject(plugin.getLogger(), logFailedRequests);
if (chart == null) { // If the chart is null, we skip it
continue;
}
customCharts.add(chart);
}
data.add("customCharts", customCharts);
return data;
}
/**
* Gets the server specific data.
*
* @return The server specific data.
*/
@SuppressWarnings("deprecation")
private JsonObject getServerData() {
// Minecraft specific data
int playerAmount = Math.min(plugin.getProxy().getOnlineCount(), 500);
int onlineMode = plugin.getProxy().getConfig().isOnlineMode() ? 1 : 0;
String bungeecordVersion = plugin.getProxy().getVersion();
int managedServers = plugin.getProxy().getServers().size();
// OS/Java specific data
String javaVersion = System.getProperty("java.version");
String osName = System.getProperty("os.name");
String osArch = System.getProperty("os.arch");
String osVersion = System.getProperty("os.version");
int coreCount = Runtime.getRuntime().availableProcessors();
JsonObject data = new JsonObject();
data.addProperty("serverUUID", serverUUID);
data.addProperty("playerAmount", playerAmount);
data.addProperty("managedServers", managedServers);
data.addProperty("onlineMode", onlineMode);
data.addProperty("bungeecordVersion", bungeecordVersion);
data.addProperty("javaVersion", javaVersion);
data.addProperty("osName", osName);
data.addProperty("osArch", osArch);
data.addProperty("osVersion", osVersion);
data.addProperty("coreCount", coreCount);
return data;
}
/**
* Checks if bStats is enabled.
*
* @return Whether bStats is enabled or not.
*/
public boolean isEnabled() {
return enabled;
}
/**
* Loads the bStats configuration.
*
* @throws IOException If something did not work :(
*/
private void loadConfig() throws IOException {
File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
bStatsFolder.mkdirs();
File configFile = new File(bStatsFolder, "config.yml");
if (!configFile.exists()) {
writeFile(configFile,
"#bStats collects some data for plugin authors like how many servers are using their plugins.",
"#To honor their work, you should not disable it.",
"#This has nearly no effect on the server performance!",
"#Check out https://bStats.org/ to learn more :)", "enabled: true",
"serverUuid: \"" + UUID.randomUUID() + "\"", "logFailedRequests: false", "logSentData: false",
"logResponseStatusText: false");
}
Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(configFile);
// Load configuration
enabled = configuration.getBoolean("enabled", true);
serverUUID = configuration.getString("serverUuid");
logFailedRequests = configuration.getBoolean("logFailedRequests", false);
logSentData = configuration.getBoolean("logSentData", false);
logResponseStatusText = configuration.getBoolean("logResponseStatusText", false);
}
/**
* Reads the first line of the file.
*
* @param file The file to read. Cannot be null.
* @return The first line of the file or {@code null} if the file does not exist
* or is empty.
* @throws IOException If something did not work :(
*/
private String readFile(File file) throws IOException {
if (!file.exists()) {
return null;
}
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(file))) {
return bufferedReader.readLine();
}
}
private void startSubmitting() {
// The data collection is async, as well as sending the data
// Bungeecord does not have a main thread, everything is async
plugin.getProxy().getScheduler().schedule(plugin, this::submitData, 2, 30, TimeUnit.MINUTES);
// Submit the data every 30 minutes, first time after 2 minutes to give other
// plugins enough time to start
// WARNING: Changing the frequency has no effect but your plugin WILL be
// blocked/deleted!
// WARNING: Just don't do it!
}
/**
* Collects the data and sends it afterwards.
*/
private void submitData() {
final JsonObject data = getServerData();
final JsonArray pluginData = new JsonArray();
// Search for all other bStats Metrics classes to get their plugin data
for (Object metrics : knownMetricsInstances) {
try {
Object plugin = metrics.getClass().getMethod("getPluginData").invoke(metrics);
if (plugin instanceof JsonObject) {
pluginData.add((JsonObject) plugin);
}
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {
}
}
data.add("plugins", pluginData);
try {
// Send the data
sendData(plugin, data);
} catch (Exception e) {
// Something went wrong! :(
if (logFailedRequests) {
plugin.getLogger().log(Level.WARNING, "Could not submit plugin stats!", e);
}
}
}
/**
* Writes a String to a file. It also adds a note for the user,
*
* @param file The file to write to. Cannot be null.
* @param lines The lines to write.
* @throws IOException If something did not work :(
*/
private void writeFile(File file, String... lines) throws IOException {
try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file))) {
for (String line : lines) {
bufferedWriter.write(line);
bufferedWriter.newLine();
}
}
}
}
@@ -0,0 +1,72 @@
package com.bencodez.votingplugin.bungee;
import java.util.regex.Pattern;
import lombok.Getter;
import lombok.Setter;
public class BungeeMessageData {
// Message string
// alltimetotal//monthtotal//weeklytotal//dailytotal//points//milestonecount//votepartycurrent//votepartyrequired
@Getter
@Setter
private int allTimeTotal = 0;
@Getter
@Setter
private int dailyTotal = 0;
@Getter
@Setter
private int milestoneCount = 0;
@Getter
@Setter
private int monthTotal = 0;
@Getter
@Setter
private int points = 0;
@Getter
@Setter
private int weeklyTotal = 0;
@Getter
@Setter
private int votePartyCurrent = 0;
@Getter
@Setter
private int votePartyRequired = 0;
public BungeeMessageData(int allTimeTotal, int monthTotal, int weeklyTotal, int dailyTotal, int points,
int milestoneCount, int votePartyCurrent, int votePartyRequired) {
this.allTimeTotal = allTimeTotal;
this.monthTotal = monthTotal;
this.weeklyTotal = weeklyTotal;
this.dailyTotal = dailyTotal;
this.points = points;
this.milestoneCount = milestoneCount;
this.votePartyCurrent = votePartyCurrent;
this.votePartyRequired = votePartyRequired;
}
public BungeeMessageData(String str) {
String[] data = str.split(Pattern.quote("//"));
if (data.length >= 6) {
allTimeTotal = Integer.parseInt(data[0]);
monthTotal = Integer.parseInt(data[1]);
weeklyTotal = Integer.parseInt(data[2]);
dailyTotal = Integer.parseInt(data[3]);
points = Integer.parseInt(data[4]);
milestoneCount = Integer.parseInt(data[5]);
}
if (data.length >= 8) {
votePartyCurrent = Integer.parseInt(data[6]);
votePartyRequired = Integer.parseInt(data[7]);
}
}
@Override
public String toString() {
return allTimeTotal + "//" + monthTotal + "//" + weeklyTotal + "//" + dailyTotal + "//" + points + "//"
+ milestoneCount + "//" + votePartyCurrent + "//" + votePartyRequired;
}
}
@@ -0,0 +1,14 @@
package com.bencodez.votingplugin.bungee;
public enum BungeeMethod {
MYSQL, PLUGINMESSAGING, SOCKETS, REDIS;
public static BungeeMethod getByName(String str) {
for (BungeeMethod method : values()) {
if (method.toString().equalsIgnoreCase(str)) {
return method;
}
}
return PLUGINMESSAGING;
}
}
@@ -0,0 +1,7 @@
package com.bencodez.votingplugin.bungee;
public class BungeeVersion {
public static int getPluginMessageVersion() {
return 1;
}
}
@@ -0,0 +1,247 @@
package com.bencodez.votingplugin.bungee;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.Collection;
import java.util.List;
import lombok.Getter;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
public class Config {
private VotingPluginBungee bungee;
@Getter
private Configuration data;
public Config(VotingPluginBungee bungee) {
this.bungee = bungee;
}
public String getRedisHost() {
return getData().getString("Redis.Host", "");
}
public int getRedisPort() {
return getData().getInt("Redis.Port", 6379);
}
public String getRedisUsername() {
return getData().getString("Redis.Username", "");
}
public String getRedisPrefix() {
return getData().getString("Redis.Prefix", "");
}
public String getRedisPassword() {
return getData().getString("Redis.Password", "");
}
public boolean getAllowUnJoined() {
return getData().getBoolean("AllowUnJoined", false);
}
public List<String> getBlockedServers() {
return getData().getStringList("BlockedServers");
}
public List<String> getWhiteListedServers() {
return getData().getStringList("WhiteListedServers");
}
public boolean getBroadcast() {
return getData().getBoolean("Broadcast", false);
}
public String getBedrockPlayerPrefix() {
return getData().getString("BedrockPlayerPrefix", ".");
}
public boolean getOnlineMode() {
return getData().getBoolean("OnlineMode", true);
}
public boolean getGlobalDataEnabled() {
return getData().getBoolean("GlobalData.Enabled", false);
}
public boolean getGlobalDataUseMainMySQL() {
return getData().getBoolean("GlobalData.UseMainMySQL", true);
}
public String getBungeeHost() {
return getData().getString("BungeeServer.Host", "");
}
public boolean getBungeeManageTotals() {
return getData().getBoolean("BungeeManageTotals", true);
}
public String getBungeeMethod() {
return getData().getString("BungeeMethod", "SOCKETS");
}
public int getBungeePort() {
return getData().getInt("BungeeServer.Port", 1297);
}
public boolean getDebug() {
return getData().getBoolean("Debug", false);
}
public boolean getMultiProxySupport() {
return getData().getBoolean("MultiProxySupport", false);
}
public int getMaxAmountOfVotesPerDay() {
return getData().getInt("MaxAmountOfVotesPerDay", -1);
}
public int getMultiProxySocketHostPort() {
return getData().getInt("MultiProxySocketHost.Port", 1297);
}
public String getMultiProxySocketHostHost() {
return getData().getString("MultiProxySocketHost.Host", "");
}
public boolean getMultiProxyOneGlobalReward() {
return getData().getBoolean("MultiProxyOneGlobalReward", false);
}
public Configuration getMultiProxyServersConfiguration(String s) {
return getData().getSection("MultiProxyServers." + s);
}
public Collection<String> getMultiProxyServers() {
return getData().getSection("MultiProxyServers").getKeys();
}
public boolean getPrimaryServer() {
return getData().getBoolean("PrimaryServer", false);
}
public String getFallBack() {
return getData().getString("FallBackServer", "");
}
public int getPointsOnVote() {
return getData().getInt("PointsOnVote", 1);
}
public boolean getSendVotesToAllServers() {
return getData().getBoolean("SendVotesToAllServers");
}
public Configuration getSpigotServerConfiguration(String s) {
return getData().getSection("SpigotServers." + s);
}
public Collection<String> getSpigotServers() {
return getData().getSection("SpigotServers").getKeys();
}
public boolean getWaitForUserOnline() {
return getData().getBoolean("WaitForUserOnline", false);
}
public boolean getVotePartyEnabled() {
return getData().getBoolean("VoteParty.Enabled", false);
}
public boolean getVotePartySendToAllServers() {
return getData().getBoolean("VoteParty.SendToAllServers", true);
}
public int getVotePartyVotesRequired() {
return getData().getInt("VoteParty.VotesRequired", 100);
}
public int getVotePartyIncreaseVotesRequired() {
return getData().getInt("VoteParty.IncreaseVotesRequired", 0);
}
public int getVoteCacheTime() {
return getData().getInt("VoteCacheTime", -1);
}
public String getVotePartyBroadcast() {
return getData().getString("VoteParty.Broadcast", "");
}
public String getMultiProxyMethod() {
return getData().getString("MultiProxyMethod", "SOCKET");
}
public String getProxyServerName() {
return getData().getString("ProxyServerName", "SOCKET");
}
public List<String> getProxyServers() {
return getData().getStringList("ProxyServers");
}
public boolean getMultiProxyRedisUseExistingConnection() {
return getData().getBoolean("MultiProxyRedis.UseExistingConnection", false);
}
public List<String> getVotePartyServersToSend() {
return getData().getStringList("VoteParty.ServersToSend");
}
public List<String> getVotePartyBungeeCommands() {
return getData().getStringList("VoteParty.BungeeCommands");
}
public String getMultiProxyRedisHost() {
return getData().getString("MultiProxyRedis.Host", "");
}
public int getMultiProxyRedisPort() {
return getData().getInt("MultiProxyRedis.Port", 6379);
}
public String getMultiProxyRedisUsername() {
return getData().getString("MultiProxyRedis.Username", "");
}
public String getMultiProxyRedisPassword() {
return getData().getString("MultiProxyRedis.Password", "");
}
public void load() {
if (!bungee.getDataFolder().exists()) {
bungee.getDataFolder().mkdir();
}
File file = new File(bungee.getDataFolder(), "bungeeconfig.yml");
if (!file.exists()) {
try (InputStream in = bungee.getResourceAsStream("bungeeconfig.yml")) {
Files.copy(in, file.toPath());
} catch (IOException e) {
e.printStackTrace();
}
}
try {
data = ConfigurationProvider.getProvider(YamlConfiguration.class)
.load(new File(bungee.getDataFolder(), "bungeeconfig.yml"));
} catch (IOException e) {
e.printStackTrace();
}
}
public void save() {
try {
ConfigurationProvider.getProvider(YamlConfiguration.class).save(data,
new File(bungee.getDataFolder(), "bungeeconfig.yml"));
} catch (IOException e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,118 @@
package com.bencodez.votingplugin.bungee;
import java.io.File;
import java.io.IOException;
import lombok.Getter;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.JsonConfiguration;
import net.md_5.bungee.config.YamlConfiguration;
public class NonVotedPlayersCache {
private VotingPluginBungee bungee;
@Getter
private Configuration data;
public NonVotedPlayersCache(VotingPluginBungee bungee) {
this.bungee = bungee;
}
public void addPlayer(ProxiedPlayer proxiedPlayer) {
if (!bungee.getMysql().containsKeyQuery(proxiedPlayer.getUniqueId().toString())) {
addPlayer(proxiedPlayer.getUniqueId().toString(), proxiedPlayer.getName());
}
}
public void addPlayer(String uuid, String playerName) {
getData().set("NonVotedPlayers." + playerName + ".UUID", uuid);
getData().set("NonVotedPlayers." + playerName + ".LastTime", System.currentTimeMillis());
save();
}
public void addPlayerCheck(String uuid, String playerName) {
if (!bungee.getMysql().containsKeyQuery(uuid)) {
addPlayer(uuid, playerName);
}
}
public void check() {
for (String player : getData().getSection("NonVotedPlayers").getKeys()) {
long time = getData().getLong("NonVotedPlayers." + player + ".LastTime", 0);
if ((System.currentTimeMillis() - time) > 1000 * 60 * 60 * 24 * 5) {
remove(player);
} else {
String uuid = getData().getString("NonVotedPlayers." + player + ".UUID", "");
if (!uuid.isEmpty()) {
if (bungee.getMysql().containsKeyQuery(uuid)) {
remove(player);
}
} else {
remove(player);
}
}
}
save();
}
public void load() {
if (!bungee.getDataFolder().exists()) {
bungee.getDataFolder().mkdir();
}
File yamlFile = new File(bungee.getDataFolder(), "nonvotedplayerscache.yml");
File file = new File(bungee.getDataFolder(), "nonvotedplayerscache.json");
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
if (yamlFile.exists()) {
try {
data = ConfigurationProvider.getProvider(YamlConfiguration.class)
.load(new File(bungee.getDataFolder(), "nonvotedplayerscache.yml"));
yamlFile.renameTo(new File(bungee.getDataFolder(), "oldnonvotedplayerscache.yml"));
ConfigurationProvider.getProvider(YamlConfiguration.class).save(data,
new File(bungee.getDataFolder(), "oldnonvotedplayerscache.yml"));
} catch (IOException e) {
e.printStackTrace();
}
save();
}
try {
data = ConfigurationProvider.getProvider(JsonConfiguration.class)
.load(new File(bungee.getDataFolder(), "nonvotedplayerscache.json"));
} catch (IOException e) {
e.printStackTrace();
}
}
public String playerExists(String playerName) {
if (getData().getSection("NonVotedPlayers").getKeys().contains(playerName)) {
return getData().getString("NonVotedPlayers." + playerName + ".UUID", "");
}
return "";
}
private void remove(String player) {
bungee.debug("Removing nonvotedplayer: " + player);
getData().set("NonVotedPlayers." + player, null);
}
public void save() {
try {
ConfigurationProvider.getProvider(JsonConfiguration.class).save(data,
new File(bungee.getDataFolder(), "nonvotedplayerscache.json"));
} catch (IOException e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,34 @@
package com.bencodez.votingplugin.bungee;
import lombok.Getter;
public class OfflineBungeeVote {
@Getter
private String playerName;
@Getter
private boolean realVote;
@Getter
private String service;
@Getter
private String text;
@Getter
private long time;
@Getter
private String uuid;
public OfflineBungeeVote(String playerName, String uuid, String service, long time, boolean realVote, String text) {
this.playerName = playerName;
this.uuid = uuid;
this.service = service;
this.time = time;
this.realVote = realVote;
this.text = text;
}
@Override
public String toString() {
return "VoteCache:" + playerName + "/" + uuid + "/" + service + "/" + time + "/" + realVote + "/" + text;
}
}
@@ -0,0 +1,160 @@
package com.bencodez.votingplugin.bungee;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import com.bencodez.votingplugin.timequeue.VoteTimeQueue;
import lombok.Getter;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.JsonConfiguration;
import net.md_5.bungee.config.YamlConfiguration;
public class VoteCache {
private VotingPluginBungee bungee;
@Getter
private Configuration data;
public VoteCache(VotingPluginBungee bungee) {
this.bungee = bungee;
}
public int getVotePartyCurrentVotes() {
return getData().getInt("VoteParty.CurrentVotes", 0);
}
public int getVotePartyInreaseVotesRequired() {
return getData().getInt("VoteParty.IncreaseVotes", 0);
}
public void setVotePartyCurrentVotes(int amount) {
getData().set("VoteParty.CurrentVotes", amount);
}
public void setVotePartyInreaseVotesRequired(int amount) {
getData().set("VoteParty.IncreaseVotes", amount);
}
public void setVotePartyCache(String server, int amount) {
getData().set("VoteParty.Cache." + server, amount);
}
public int getVotePartyCache(String server) {
return getData().getInt("VoteParty.Cache." + server, 0);
}
public void addVote(String server, int num, OfflineBungeeVote voteData) {
Configuration section = getData().getSection("VoteCache." + server + "." + num);
section.set("Name", voteData.getPlayerName());
section.set("Service", voteData.getService());
section.set("UUID", voteData.getUuid());
section.set("Time", voteData.getTime());
section.set("Real", voteData.isRealVote());
section.set("Text", voteData.getText());
}
public void addTimedVote(int num, VoteTimeQueue voteTimedQueue) {
Configuration section = getData().getSection("TimedVoteCache." + num);
section.set("Name", voteTimedQueue.getName());
section.set("Service", voteTimedQueue.getService());
section.set("Time", voteTimedQueue.getTime());
}
public void addVoteOnline(String player, int num, OfflineBungeeVote voteData) {
Configuration section = getData().getSection("OnlineCache." + player + "." + num);
section.set("Name", voteData.getPlayerName());
section.set("Service", voteData.getService());
section.set("UUID", voteData.getUuid());
section.set("Time", voteData.getTime());
section.set("Real", voteData.isRealVote());
section.set("Text", voteData.getText());
}
public void clearData() {
getData().set("VoteCache", null);
getData().set("OnlineCache", null);
save();
}
public Collection<String> getOnlineVotes(String name) {
return getData().getSection("OnlineCache." + name).getKeys();
}
public Configuration getOnlineVotes(String name, String num) {
return getData().getSection("OnlineCache." + name + "." + num);
}
public Collection<String> getPlayers() {
return getData().getSection("OnlineCache").getKeys();
}
public Collection<String> getServers() {
return getData().getSection("VoteCache").getKeys();
}
public Configuration getTimedVoteCache(String key) {
return getData().getSection("TimedVoteCache." + key);
}
public Collection<String> getTimedVoteCache() {
return getData().getSection("TimedVoteCache").getKeys();
}
public Collection<String> getServerVotes(String server) {
return getData().getSection("VoteCache." + server).getKeys();
}
public Configuration getServerVotes(String server, String num) {
return getData().getSection("VoteCache." + server + "." + num);
}
public void load() {
if (!bungee.getDataFolder().exists()) {
bungee.getDataFolder().mkdir();
}
File yamlFile = new File(bungee.getDataFolder(), "votecache.yml");
File file = new File(bungee.getDataFolder(), "votecache.json");
if (!file.exists()) {
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
if (yamlFile.exists()) {
try {
data = ConfigurationProvider.getProvider(YamlConfiguration.class)
.load(new File(bungee.getDataFolder(), "votecache.yml"));
yamlFile.renameTo(new File(bungee.getDataFolder(), "oldvotecache.yml"));
ConfigurationProvider.getProvider(YamlConfiguration.class).save(data,
new File(bungee.getDataFolder(), "oldvotecache.yml"));
} catch (IOException e) {
e.printStackTrace();
}
save();
}
try {
data = ConfigurationProvider.getProvider(JsonConfiguration.class)
.load(new File(bungee.getDataFolder(), "votecache.json"));
} catch (IOException e) {
e.printStackTrace();
}
}
public void save() {
try {
ConfigurationProvider.getProvider(JsonConfiguration.class).save(data,
new File(bungee.getDataFolder(), "votecache.json"));
} catch (IOException e) {
e.printStackTrace();
}
}
}
@@ -0,0 +1,37 @@
package com.bencodez.votingplugin.bungee;
import com.vexsoftware.votifier.bungee.events.VotifierEvent;
import com.vexsoftware.votifier.model.Vote;
import net.md_5.bungee.event.EventHandler;
public class VoteEventBungee implements net.md_5.bungee.api.plugin.Listener {
private VotingPluginBungee plugin;
public VoteEventBungee(VotingPluginBungee plugin) {
this.plugin = plugin;
}
@EventHandler
public void onVote(VotifierEvent event) {
plugin.getProxy().getScheduler().runAsync(plugin, new Runnable() {
@SuppressWarnings("deprecation")
@Override
public void run() {
Vote vote = event.getVote();
String serviceSite = vote.getServiceName();
plugin.getLogger().info("Vote received " + vote.getUsername() + " from service site " + serviceSite);
if (serviceSite.isEmpty()) {
serviceSite = "Empty";
vote.setServiceName(serviceSite);
}
plugin.vote(vote.getUsername(), serviceSite, true, true, 0, null, null);
}
});
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,115 @@
package com.bencodez.votingplugin.bungee;
import com.bencodez.advancedcore.api.time.TimeType;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.plugin.Command;
public class VotingPluginBungeeCommand extends Command {
private VotingPluginBungee bungee;
public VotingPluginBungeeCommand(VotingPluginBungee bungee) {
super("votingpluginbungee", "votingplugin.admin");
this.bungee = bungee;
}
@Override
public void execute(CommandSender sender, String[] args) {
if (sender.hasPermission("votingplugin.admin")) {
if (args.length > 0) {
if (args[0].equalsIgnoreCase("reload")) {
bungee.reload(false);
sender.sendMessage(new TextComponent("Reloading VotingPluginBungee"));
}
if (args[0].equalsIgnoreCase("reloadmysql")) {
bungee.reload(true);
sender.sendMessage(new TextComponent("Reloading VotingPluginBungee with MySQL"));
}
if (args[0].equalsIgnoreCase("vote")) {
if (args.length >= 2) {
String user = args[1];
String site = args[2];
bungee.vote(user, site, false, true, 0, null, null);
sender.sendMessage(new TextComponent("Sending vote"));
}
}
if (args[0].equalsIgnoreCase("forcetimechange")) {
if (args.length >= 2) {
bungee.getBungeeTimeChecker().forceChanged(TimeType.getTimeType(args[1]));
sender.sendMessage(new TextComponent("Triggering time change: " + args[1]));
}
}
if (args[0].equalsIgnoreCase("status")) {
if (bungee.getMethod().equals(BungeeMethod.SOCKETS)) {
sender.sendMessage(new TextComponent(
"&aChecking status, waiting for response, check console, method: sockets"));
bungee.status(sender);
} else if (bungee.getMethod().equals(BungeeMethod.PLUGINMESSAGING)) {
sender.sendMessage(new TextComponent(
"&aChecking status, waiting for response, check console, method: plugin messaging"));
bungee.status(sender);
bungee.sendServerNameMessage();
} else if (bungee.getMethod().equals(BungeeMethod.REDIS)) {
sender.sendMessage(new TextComponent(
"&aChecking status, waiting for response, check console, method: redis"));
bungee.status(sender);
bungee.sendServerNameMessage();
} else {
sender.sendMessage(
new TextComponent("&aNot using socket/pluginmessage/redis method, command unavailable"));
}
}
if (args[0].equalsIgnoreCase("multiproxystatus")) {
bungee.getMultiProxyHandler().sendMultiProxyServerMessage("Status");
sender.sendMessage(new TextComponent("Sending status message"));
}
if (args[0].equalsIgnoreCase("help")) {
TextComponent[] msg = new TextComponent[7];
msg[0] = new TextComponent("&avotingpluginbungee reload - Reload plugin");
msg[1] = new TextComponent("&avotingpluginbungee reloadmysql - Reload plugin including mysql");
msg[2] = new TextComponent("&avotingpluginbungee vote (player) (servicesite) - Send bungee vote");
msg[3] = new TextComponent("&avotingpluginbungee status - Check socket connection status");
msg[4] = new TextComponent("&avotingpluginbungee forcetimechange (timetype) - Force a time change");
msg[5] = new TextComponent("&avotingpluginbungee voteparty force - Force a vote party");
msg[6] = new TextComponent(
"&avotingpluginbungee voteparty setvotecount (number) - Set current vote party votes");
sender.sendMessage(msg);
}
if (args[0].equalsIgnoreCase("voteparty")) {
if (args.length > 1) {
if (args[1].equalsIgnoreCase("Force")) {
bungee.setCurrentVotePartyVotes(bungee.getCurrentVotePartyVotesRequired());
bungee.checkVoteParty();
sender.sendMessage(new TextComponent("Vote party forced"));
}
if (args.length > 2) {
if (args[1].equalsIgnoreCase("SetVoteCount")) {
if (isInt(args[2])) {
bungee.setCurrentVotePartyVotes(Integer.parseInt(args[2]));
sender.sendMessage(new TextComponent("Set current vote party votes to " + args[2]));
}
}
}
}
}
}
} else {
sender.sendMessage(new TextComponent("&cYou do not have permission to do this!"));
}
}
public boolean isInt(String st) {
if (st == null) {
return false;
}
try {
@SuppressWarnings("unused")
int num = Integer.parseInt(st);
return true;
} catch (NumberFormatException ex) {
return false;
}
}
}
@@ -0,0 +1,229 @@
package com.bencodez.votingplugin.bungee.global.multiproxy;
import java.io.File;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import com.bencodez.advancedcore.api.misc.encryption.EncryptionHandler;
import com.bencodez.advancedcore.bungeeapi.redis.RedisHandler;
import com.bencodez.advancedcore.bungeeapi.redis.RedisListener;
import com.bencodez.advancedcore.bungeeapi.sockets.ClientHandler;
import com.bencodez.advancedcore.bungeeapi.sockets.SocketHandler;
import com.bencodez.advancedcore.bungeeapi.sockets.SocketReceiver;
import com.bencodez.votingplugin.bungee.BungeeMessageData;
import lombok.Getter;
public abstract class MultiProxyHandler {
public abstract boolean getMultiProxySupportEnabled();
public abstract EncryptionHandler getEncryptionHandler();
public abstract File getPluginDataFolder();
public abstract void setEncryptionHandler(EncryptionHandler encryptionHandler);
public abstract void logInfo(String msg);
public abstract boolean getDebug();
public abstract String getVersion();
private HashMap<String, ClientHandler> multiproxyClientHandles;
private SocketHandler multiproxySocketHandler;
@Getter
private RedisHandler multiProxyRedis;
public MultiProxyHandler() {
}
public void sendMultiProxyServerMessage(String... messageData) {
if (getMultiProxyMethod().equals(MultiProxyMethod.SOCKETS)) {
for (ClientHandler h : multiproxyClientHandles.values()) {
h.sendMessage(messageData);
}
} else if (getMultiProxyMethod().equals(MultiProxyMethod.REDIS)) {
for (String server : getProxyServers()) {
multiProxyRedis.sendMessage("VotingPluginProxy_" + server, messageData);
}
}
}
public abstract List<String> getProxyServers();
public void close() {
if (multiproxySocketHandler != null) {
multiproxySocketHandler.closeConnection();
multiproxySocketHandler = null;
}
if (multiProxyRedis != null && !getMultiProxyRedisUseExistingConnection()) {
multiProxyRedis.close();
}
}
public void loadMultiProxySupport() {
if (getMultiProxySupportEnabled()) {
if (getMultiProxyMethod().equals(MultiProxyMethod.SOCKETS)) {
if (getEncryptionHandler() == null) {
setEncryptionHandler(new EncryptionHandler(new File(getPluginDataFolder(), "secretkey.key")));
}
if (multiproxySocketHandler != null) {
multiproxySocketHandler.closeConnection();
multiproxySocketHandler = null;
}
multiproxySocketHandler = new SocketHandler(getVersion(), getMultiProxySocketHostHost(),
getMultiProxySocketHostPort(), getEncryptionHandler(), getDebug()) {
@Override
public void log(String str) {
logInfo(str);
}
};
multiproxySocketHandler.add(new SocketReceiver() {
@Override
public void onReceive(String[] data) {
if (data.length > 0) {
if (data[0].equalsIgnoreCase("Status")) {
logInfo("Multi-proxy status message received");
} else if (data[0].equalsIgnoreCase("ClearVote")) {
clearVote(data[2]);
if (getPrimaryServer()) {
sendMultiProxyServerMessage("ClearVotePrimary", data[1], data[2]);
}
} else if (data[0].equalsIgnoreCase("ClearVotePrimary")) {
clearVote(data[2]);
} else if (data[0].equalsIgnoreCase("login")) {
addNonVotedPlayerCache(data[1], data[2]);
// nonVotedPlayersCache.addPlayer(data[1], data[2]);
}
}
if (data.length > 8) {
if (data[0].equalsIgnoreCase("Vote")) {
triggerVote(data[2], data[3], Boolean.valueOf(data[7]), true, 0,
new BungeeMessageData(data[8]), data[1]);
} else if (data[0].equalsIgnoreCase("VoteOnline")) {
triggerVote(data[2], data[3], Boolean.valueOf(data[7]), true, 0,
new BungeeMessageData(data[8]), data[1]);
}
}
}
});
multiproxyClientHandles = new HashMap<String, ClientHandler>();
for (String s : getMultiProxyServers()) {
MultiProxyServerSocketConfiguration d = getMultiProxyServersConfiguration(s);
multiproxyClientHandles.put(s,
new ClientHandler(d.getHost(), d.getPort(), getEncryptionHandler(), getDebug()));
}
} else {
if (getMultiProxyRedisUseExistingConnection() && getRedisHandler() != null) {
multiProxyRedis = getRedisHandler();
} else {
multiProxyRedis = new RedisHandler(getMultiProxyRedisHost(), getMultiProxyRedisPort(),
getMultiProxyUsername(), getMultiProxyPassword()) {
@Override
public void onMessage(String channel, String[] data) {
if (data.length > 0) {
if (data[0].equalsIgnoreCase("Status")) {
logInfo("Multi-proxy status message received");
} else if (data[0].equalsIgnoreCase("ClearVote")) {
clearVote(data[2]);
if (getPrimaryServer()) {
sendMultiProxyServerMessage("ClearVotePrimary", data[1], data[2]);
}
} else if (data[0].equalsIgnoreCase("ClearVotePrimary")) {
clearVote(data[2]);
} else if (data[0].equalsIgnoreCase("login")) {
addNonVotedPlayerCache(data[1], data[2]);
// nonVotedPlayersCache.addPlayer(data[1], data[2]);
}
}
if (data.length > 8) {
if (data[0].equalsIgnoreCase("Vote")) {
triggerVote(data[2], data[3], Boolean.valueOf(data[7]), true, 0,
new BungeeMessageData(data[8]), data[1]);
} else if (data[0].equalsIgnoreCase("VoteOnline")) {
triggerVote(data[2], data[3], Boolean.valueOf(data[7]), true, 0,
new BungeeMessageData(data[8]), data[1]);
}
}
}
@Override
public void debug(String message) {
if (getDebug()) {
logInfo("MultiProxyRedis: " + message);
}
}
};
}
runAsnc(new Runnable() {
@Override
public void run() {
multiProxyRedis.loadListener(
new RedisListener(multiProxyRedis, "VotingPluginProxy_" + getMultiProxyServerName()));
}
});
}
logInfo("Loaded multi-proxy support: " + getMultiProxyMethod().toString());
}
}
public abstract void runAsnc(Runnable runnable);
public abstract MultiProxyMethod getMultiProxyMethod();
public abstract RedisHandler getRedisHandler();
public abstract boolean getMultiProxyRedisUseExistingConnection();
public abstract String getMultiProxyPassword();
public abstract String getMultiProxyUsername();
public abstract String getMultiProxyServerName();
public abstract int getMultiProxyRedisPort();
public abstract String getMultiProxyRedisHost();
public abstract boolean getPrimaryServer();
public void login(String uuid, String playerName) {
if (!getMultiProxySupportEnabled()) {
return;
}
if (getPrimaryServer()) {
return;
}
sendMultiProxyServerMessage("Login", uuid, playerName);
}
public abstract int getMultiProxySocketHostPort();
public abstract String getMultiProxySocketHostHost();
public abstract MultiProxyServerSocketConfiguration getMultiProxyServersConfiguration(String s);
public abstract Collection<String> getMultiProxyServers();
public abstract void triggerVote(String player, String service, boolean realVote, boolean timeQueue, long queueTime,
BungeeMessageData text, String uuid);
public abstract void addNonVotedPlayerCache(String string, String string2);
public abstract void clearVote(String string);
}
@@ -0,0 +1,14 @@
package com.bencodez.votingplugin.bungee.global.multiproxy;
public enum MultiProxyMethod {
SOCKETS, REDIS;
public static MultiProxyMethod getByName(String str) {
for (MultiProxyMethod method : values()) {
if (method.toString().equalsIgnoreCase(str)) {
return method;
}
}
return MultiProxyMethod.SOCKETS;
}
}
Loaded 100 of 190 files, more files were not shown because too many files have changed in this diff. Show more