1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-18 09:43:00 +01:00

Compare commits

..

1189 Commits

Author SHA1 Message Date
nossr50
31d70a6072 spears update 2025-12-14 14:00:32 -08:00
nossr50
7bd4e9afe7 spears update 2025-12-14 13:58:20 -08:00
nossr50
ee94189574 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO into spears 2025-12-14 13:39:03 -08:00
nossr50
a907bfd624 oops 2025-12-14 13:32:36 -08:00
nossr50
257292b6cc test number who knows 2025-12-14 13:31:21 -08:00
nossr50
2f452afdc7 try this instead part 3 2025-12-14 13:17:59 -08:00
nossr50
283c6d9771 Technically we don't need this 2025-12-14 13:08:41 -08:00
nossr50
fc62946e27 Try this instead... 2025-12-14 13:07:11 -08:00
nossr50
6b6263d0b3 Add deploy to Nexus stage 2025-12-14 13:03:51 -08:00
nossr50
f9acdeaf14 empty commit, testing webhooks 2025-12-13 16:27:09 -08:00
nossr50
5d6b499468 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO into spears 2025-12-13 16:24:37 -08:00
nossr50
03bea40ad4 fix jenkins script 2025-12-13 16:21:34 -08:00
nossr50
6818d05079 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO into spears 2025-12-13 16:11:09 -08:00
nossr50
401edf0bc9 no mvn wrapper 2025-12-13 16:10:58 -08:00
nossr50
cb164bb013 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO into spears 2025-12-13 16:06:02 -08:00
nossr50
085197abc0 let's try a Jenkinsfile 2025-12-13 16:03:36 -08:00
nossr50
98eb706361 test 2025-12-13 15:57:29 -08:00
nossr50
09dfe4fd11 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2025-12-13 11:55:28 -08:00
nossr50
4f01439892 more work on the spears update 2025-12-13 11:55:13 -08:00
nossr50
1664ca005d Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO into spears 2025-12-13 11:46:07 -08:00
るんく君
ced4ed2fd0 [Fix] isMagicHunterEnabled method doesn't considered the MagicHunter's permission (#5231) 2025-12-08 12:35:56 -08:00
nossr50
505352ac70 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO into spears 2025-12-08 12:35:10 -08:00
Nadie
5c283fedb3 Change Protocollib's repo to use new namespace & group id (#5232) 2025-12-08 12:34:53 -08:00
Warrior
fae55c1edf Fix self damage awarding skill xp (#5233) 2025-12-08 12:34:09 -08:00
nossr50
4052e7e546 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO into spears 2025-11-30 13:39:59 -08:00
Tig3r98
d800aa9316 Update Italian Translation (#5230) 2025-11-30 13:37:49 -08:00
nossr50
7ac5cbf915 add spears to repair and salvage config defaults 2025-11-29 11:20:19 -08:00
nossr50
7e479049d0 spears momentum (wip pt 2) 2025-11-29 11:14:30 -08:00
nossr50
4bbdacd250 spears momentum (wip) 2025-11-28 14:33:13 -08:00
nossr50
706adb5942 add Spears to config.yml 2025-11-28 13:33:24 -08:00
nossr50
e26bb94b08 add Spears to experience.yml 2025-11-28 13:32:43 -08:00
nossr50
34f96dc687 add Spears interactions to CombatUtils 2025-11-28 13:32:35 -08:00
nossr50
461d2d4570 SkillTools refactor 2025-11-28 13:17:19 -08:00
nossr50
38396d48b4 FlatFileDatabaseManager refactor 2025-11-28 13:17:10 -08:00
nossr50
99bb38ea06 SQLDatabaseManager refactor pass 2 2025-11-27 12:42:22 -08:00
nossr50
43502b255c SQLDatabaseManager refactor pass 2025-11-27 11:57:58 -08:00
nossr50
ac9f060e79 more code coverage 2025-11-27 11:45:05 -08:00
nossr50
02ef9fad1d Spears (wip pt 2) 2025-11-27 11:31:35 -08:00
nossr50
1b28ad8f59 Spears (wip pt 1) 2025-11-25 14:31:38 -08:00
nossr50
1b49eb11b8 Spring-cleaning round 1: remove some more deprecated API invocations 2025-11-09 10:34:41 -08:00
nossr50
3533c50489 Spring-cleaning round 1: remove deprecated Player.updateInventory 2025-11-09 09:57:28 -08:00
nossr50
2a8be52be5 back to snapshots 2025-11-08 13:57:14 -08:00
nossr50
59093c5f22 2.2.045 2025-11-08 13:49:59 -08:00
nossr50
1f123a4eb2 Add missing permission nodes for copper repair and salvage Fixes #5225 2025-11-08 13:44:35 -08:00
nossr50
c96cb95443 Fixed bug where salvage and repair configs would re-add any deleted entry that existed in the default config Fixes #5223 2025-11-08 13:40:05 -08:00
nossr50
9f5994596a Fixed ageable cast class exception Fixes #5224
Fixed Herbalism not replanting certain crops
2025-11-08 13:27:53 -08:00
nossr50
ec6dce0cb2 back to snapshots 2025-11-02 12:30:55 -08:00
nossr50
80a61d2d89 2.2.044 Fix copper repair and salvage 2025-11-02 12:25:25 -08:00
nossr50
f71fe0de70 snapshots here we go 2025-10-05 13:55:04 -07:00
nossr50
eafa53e5b4 2.2.043 2025-10-05 13:46:32 -07:00
nossr50
5dfea51c5e slightly better logs 2025-10-05 13:46:13 -07:00
nossr50
00c0b2e5ec fix bug where armor stand could be renamed to heart symbols 2025-10-05 13:30:24 -07:00
nossr50
c79b3fe024 optimize imports 2025-10-05 13:19:17 -07:00
nossr50
24888d13c2 Fix potion names Fixes #5211 Fixes #5180 2025-10-05 13:18:35 -07:00
nossr50
2f624e329d misc optimization 2025-10-05 12:34:18 -07:00
nossr50
07d18e2eba 1.21.9 support for treasures.yml, experience.yml, fishing_treasures.yml, and settings for mannequins and a fix for armor stands 2025-10-05 12:27:20 -07:00
nossr50
c958a86aa3 add 1.21.9 support for repair, salvage, copper tool and armor (wip) 2025-10-04 14:20:32 -07:00
nossr50
22231dfa32 back to snapshots 2025-09-21 12:31:34 -07:00
nossr50
fdc652fd63 2.2.042 2025-09-21 12:24:42 -07:00
nossr50
c07b73d3d6 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2025-09-21 12:20:06 -07:00
nossr50
d38d74f82a new event McMMOModifyBlockDropItemEvent and mcMMO now modifies the drop list in BlockDropItemEvent instead of spawning items
Fixes #5214
2025-09-21 12:19:55 -07:00
Justin
9a59200c0b Add null-safety and helper methods to AbilityAPI (#5217) 2025-09-21 10:53:32 -07:00
nossr50
8e049822a3 better phrasing 2025-08-30 12:08:14 -07:00
nossr50
06f979d7bf Reduce Blast Mining PVP damage Fixes #5213 2025-08-30 12:03:50 -07:00
nossr50
f78586675d different default for CustomSoundId in sounds.yml 2025-08-30 11:40:23 -07:00
nossr50
46bcd29998 update changelog with info about custom sound playing 2025-08-30 11:20:31 -07:00
Nathan V.
df69410e67 (Improvement) Implement playing sound by string ID (#5201)
* (improvement) implement playing sound by string ID

I've replaced enum-based sound playing events with string-based equivalents, which should open the door for server customization and other enhancements in the future

- Added SoundLookup class with different registry lookup methods depending on server version.
- Added the ability to configure what sounds are played depending on event, with a fallback built into SoundType.
- Removed getCrippleSound as SoundLookup can now fall back to the original default sound if the mace sound doesn't exist on the server's Minecraft version.
- Added a EnableCustomSounds config variable that will skip SoundLookup ID checking and just pass the sound string directly to the client, mainly due to the fact that it isn't possible to verify if resource pack values exist.
 - Cleaned up a few switch statements to match how the original getSound had it formatted.

I'd love to see/do a further expansion of sound configuration for each ability now that we can just fall back to generic, but that may be for another PR.

* Fix getIsEnabled using wrong key

* always use registry, simplify custom sound enabling logic, optimize reflection calls

* forgot we need this for legacy versions

---------

Co-authored-by: nossr50 <nossr50@gmail.com>
2025-08-30 11:15:26 -07:00
nossr50
99f7437d9d back to dev builds 2025-08-23 13:16:59 -07:00
nossr50
4bfbfa2de7 2.2.041 2025-08-23 13:12:58 -07:00
nossr50
724b66afaa expand Block Cracker to other blocks with cracked variants 2025-08-23 13:09:52 -07:00
nossr50
6ba4475a77 Fix Berserk block cracker not functioning Fixes #5207 2025-08-23 13:01:11 -07:00
nossr50
2c1c1fe53f update changelog 2025-08-23 12:38:30 -07:00
Warrior
ba673a02d0 Add early return for brewing stand hopper check (#5208) 2025-08-23 12:37:11 -07:00
handy
7cf4409c35 Add static to the method of the private class DatabaseAPI. (#5198) 2025-08-02 12:48:46 -07:00
Jake Ben-Tovim
f9513a8b40 fix(experience): parse diminished returns value from correct field (#5196) 2025-07-11 14:43:29 -07:00
nossr50
b12f86a04d update changelog 2025-07-09 14:24:43 -07:00
Techirion
c377544fa2 RepairManager: Fix unsafe enchantments being stripped, CombatUtils: Use instanceof for IronGolem (#5192)
* RepairManager: Fix unsafe enchantments being stripped

* CombatUtils: Use instanceof for IronGolem check to avoid cast exceptions for pets/npcs/...

---------

Co-authored-by: Dieu <info@l4b.org>
2025-07-09 14:23:34 -07:00
nossr50
e6c62beed9 update changelog 2025-07-09 14:21:12 -07:00
るんく君
0424a5dd12 When burnTime is less than or equal to 0, do not process (#5194) 2025-07-09 14:19:02 -07:00
nossr50
b91fa2cf37 back to dev 2025-07-08 13:08:08 -07:00
nossr50
6acc4b1ec6 2.2.040 2025-07-06 12:27:25 -07:00
nossr50
41b5667cd4 Some more unit test coverage for tree feller 2025-07-04 13:27:38 -07:00
nossr50
b60e478aec Fix parties unintentionally becoming leader-less Fixes #3771 2025-07-04 13:06:31 -07:00
nossr50
6aa4deedc0 oopsie 2025-07-04 12:25:08 -07:00
nossr50
4c578eb1c5 update changelog 2025-07-04 12:15:05 -07:00
nossr50
e6199c0a7a prevent simulateBlockBreak from calling itself fixes #5188 2025-07-04 12:13:37 -07:00
nossr50
87277a0d6f remove some unused code 2025-07-03 15:12:58 -07:00
nossr50
3c853a266a change enum format back to old style 2025-07-03 15:11:41 -07:00
nossr50
e52371aeb3 formatting applied to most of the source code to tidy things up, and misc refactors 2025-07-03 15:07:31 -07:00
nossr50
f322d05159 update changelog 2025-06-22 12:54:59 -07:00
GhostDC
c1ce6c84a5 Update Simplfied Chinese translation (#5185) 2025-06-22 12:53:36 -07:00
Ryota Abe
e891bf2067 Update ja_JP translation (#5189)
* Update locale_ja_JP.propaties

* Add missing keys

* Fix typos and mistranslations (ja_JP)
2025-06-22 12:53:17 -07:00
nossr50
ab79131485 Updated for 1.21.6 2025-06-22 12:51:33 -07:00
TechnicallyCoded
9eb8f4e918 Less hacky performance improvements (#5187) 2025-06-08 11:24:43 -07:00
nossr50
4def2be918 back to dev work 2025-06-07 15:27:48 -07:00
nossr50
547fc29c91 2.2.039 2025-06-07 15:23:23 -07:00
nossr50
3d16d9432d Added StackOverflow safeguards for dealDamage invocations Fixes #5129 Fixes #5029 Fixes #5186 2025-06-07 15:15:09 -07:00
nossr50
5e9ee1e275 2.2.038 2025-06-06 18:58:57 -07:00
nossr50
12127ff25b spigot safeguards 2025-06-06 18:57:44 -07:00
nossr50
382b86ad34 perf improvements and rupture improvements 2025-06-06 18:43:41 -07:00
nossr50
27a232d03e fix other places where locale might matter 2025-05-26 13:07:50 -07:00
nossr50
ce7461f459 fix potion matching for non-english locales Fixes #5174 2025-05-26 13:05:07 -07:00
nossr50
175526d3da 2.2.037 2025-05-25 11:37:35 -07:00
nossr50
1430ea2979 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2025-05-25 11:23:31 -07:00
nossr50
b54db979f5 update changelog 2025-05-25 11:23:23 -07:00
Jake Ben-Tovim
045f1bdfb6 fix matchPotionType: correctly match extended and upgraded potions fixes #5181 2025-05-25 11:21:36 -07:00
nossr50
c3103beea2 back to the lab again 2025-05-11 15:00:59 -07:00
nossr50
f7dbd884f4 2.2.036 2025-05-11 14:54:45 -07:00
nossr50
8c89462b0a fix trickshot not applying potion effects or custom effects 2025-05-11 14:47:31 -07:00
nossr50
bcf0f06fb9 update changelog 2025-05-06 13:18:52 -07:00
Griffen
2ba67d1393 Adds locale entries for commands in "/mcmmo help" (#5137)
* Fixed issue where you chuld not modify the color of the commands in the main help command

* Changed the headers for more consistency
2025-05-06 13:10:09 -07:00
Josh Taylor
a8976ae953 fix spectral arrows (#5173) 2025-05-06 13:08:09 -07:00
Tommm
f3a2199fd6 Added spawners to illegal drops for blast mining (#5178) 2025-05-06 13:07:15 -07:00
Robert Alan Chapton
bea283e56c Update README.md
tweak the readme
2025-04-13 12:15:43 -07:00
nossr50
13a329d4ae update changelog 2025-04-13 12:04:25 -07:00
nossr50
65d4d2b059 Chimaera wing code is a little bit less disgusting now Fixes #5049 2025-04-13 12:03:52 -07:00
nossr50
61c5ded677 back to dev mode 2025-04-13 11:06:33 -07:00
nossr50
5c12606e8c misc 2025-04-13 10:49:10 -07:00
nossr50
99e8ae3722 Blast Mining can drop deep-slate now fixes #5160 2025-04-13 10:44:19 -07:00
nossr50
5b67aa04c4 support for various new additions from 1.21.5 2025-04-12 13:23:35 -07:00
nossr50
35785283ee Swords stab damage is now config-driven
Fixes #5164
2025-03-29 14:31:42 -07:00
nossr50
7e1e4c8305 2.2.034 2025-03-17 14:44:05 -07:00
nossr50
f69f88add7 fix mcMMO spawning bonus drops into other blocks
fixes #5149
2025-03-17 14:42:38 -07:00
nossr50
82af006ea4 Fix NPE in ChunkUnloadEvent
fixes #5133 fixes #5118
2025-03-17 14:21:25 -07:00
nossr50
1005b29e96 minor refactoring of ProjectileUtils and MetadataConstants 2025-03-15 12:49:29 -07:00
nossr50
2efe1efc50 Crossbow trickshot no longer rewards archery xp
Fixes #5153 Fixes #5144
2025-03-15 12:28:35 -07:00
nossr50
3d04b92827 dev mode 2025-03-15 12:04:33 -07:00
nossr50
4259b5ec6d 2.2.033 2025-03-09 17:24:52 -07:00
nossr50
182e228ebd add missing TURTLE_HELMET to tier 1 ingredients in potions.yml fixes #5143 2025-03-09 17:20:53 -07:00
nossr50
bc6e4bc056 fix Folia throwing IllegalArgumentException 2025-03-09 16:35:20 -07:00
nossr50
44b22559fb Revert "github actions should use Java 21"
This reverts commit 571a60f7a7.
2025-03-09 15:57:46 -07:00
nossr50
0408040d7a Revert "bump world-edit dependency version"
This reverts commit 363ae7351f.
2025-03-09 15:56:21 -07:00
nossr50
571a60f7a7 github actions should use Java 21 2025-03-09 15:49:59 -07:00
nossr50
b2bf29cae2 tweaks to start up msg 2025-03-09 15:49:26 -07:00
nossr50
6ad9d97236 Fix mcMMO trying to load incompatible potions on older versions 2025-03-09 15:45:32 -07:00
nossr50
6df73e522e Add missing entries to potion.yml for Breeze_Rod 2025-03-09 15:45:18 -07:00
nossr50
e6f3d63923 fix FoliaLib not being shaded into compiled jar 2025-03-09 14:20:20 -07:00
nossr50
871374ce84 adventure API bump 2025-03-09 14:18:19 -07:00
nossr50
363ae7351f bump world-edit dependency version 2025-03-09 14:08:33 -07:00
nossr50
be0570fccb cleanup pom.xml and reduce noise in build 2025-03-09 13:57:17 -07:00
nossr50
9d5566ae0e update FoliaLib repo for build instructions fixes #5162 2025-03-09 13:47:52 -07:00
nossr50
125aefacbb fix github actions 2025-03-09 13:40:43 -07:00
nossr50
b48d66abbe 2.2.032 2025-03-08 11:49:33 -08:00
nossr50
752174ad6d add missing beetroot and eyeblossom entries for Herbalism fixes #5154 fixes #5146 2025-03-08 11:40:48 -08:00
nossr50
ef2aa57be3 fix Roll interactions with CMI fixes #5151 2025-03-08 11:34:29 -08:00
nossr50
25c89c5bd3 blast mining bonus drops are now RNG and no longer guaranteed, yield ceiling clamped 2025-03-07 15:26:08 -08:00
nossr50
c2ecefb2a8 blast mining no longer drops infested block variants 2025-03-07 15:09:49 -08:00
nossr50
de4d0ea0a7 2.2.031 2025-02-08 11:50:14 -08:00
nossr50
86b457861c fix for NPE during inventory events Fixes #5148 2025-02-07 13:43:56 -08:00
nossr50
c61376d97d update changelog 2025-01-26 15:11:00 -08:00
nossr50
2618cfbe78 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2025-01-26 15:10:11 -08:00
Warrior
0637446cd5 Add event for players taming an entity (#5142)
* Add event for players taming an entity
2025-01-26 15:10:04 -08:00
nossr50
af60826843 update changelog 2025-01-26 15:07:54 -08:00
Philip Hell
b36848bd47 removed call to Locale#setDefault within LocaleLoader#initialize; added static locale-parameter to all instances of a Formatter (#5141) 2025-01-25 14:24:02 -08:00
nossr50
dab4e777ce 2.2.030 2025-01-14 12:33:35 -08:00
Warrior
0063a4f9b6 Run rupture task on the target entity's scheduler (#5135) 2025-01-14 12:31:48 -08:00
nossr50
bfbefa78f5 fix mace sound on older versions 2025-01-04 13:53:43 -08:00
nossr50
1db0aae46b fix alchemy xp permission issue Fixes #5131 2025-01-03 15:41:18 -08:00
nossr50
90fe8ee882 change chunk listener to monitor so we can ignore cancelled events 2025-01-03 15:19:46 -08:00
nossr50
ad771fddc5 update changelog 2025-01-03 15:12:28 -08:00
Momshroom
b4d9337329 Revert regression, restoring material based salvage permissions (#5130)
* Revert regression.  Fixes salvage permissions by material type

---------

Signed-off-by: Momshroom <Momshroom@gmail.com>
2024-12-29 17:13:20 -08:00
Momshroom
dae66c7433 Add new potions to alchemy (#5123)
* Added new potions to alchemy. Borrowed some config info from here: https://discord.com/channels/526933440214597677/547110990278426629/1291771464726478869

Signed-off-by: Momshroom <Momshroom@gmail.com>

---------

Signed-off-by: Momshroom <Momshroom@gmail.com>
2024-12-15 12:54:24 -08:00
nossr50
b5478a947e dev mode 2024-12-15 12:50:24 -08:00
nossr50
6a9962a2dc 2.2.029 2024-12-14 15:20:56 -08:00
nossr50
d8d2d00f42 remove another unused file 2024-11-27 13:35:27 -08:00
nossr50
02d978036a add relevant herbalism stuff for next MC update 2024-11-27 13:35:20 -08:00
nossr50
16d5d9f95f temporarily disable party item sharing feature 2024-11-27 13:24:01 -08:00
nossr50
18bd31da40 add support for new pale oak items / blocks 2024-11-27 13:12:42 -08:00
nossr50
6b5b0f301c remove unused files 2024-11-27 13:04:55 -08:00
nossr50
c7feac19dd misc plugin.yml cleanup 2024-11-27 13:04:40 -08:00
nossr50
6dd175331c fix index out of bounds for blocks at world max height 2024-11-25 12:24:39 -08:00
nossr50
1b6b127ef4 dev mode 2024-11-18 16:24:11 -08:00
nossr50
03514521b4 remove dangling config key 2024-11-18 16:23:47 -08:00
nossr50
7883b0914a 2.2.028 2024-11-16 16:23:11 -08:00
galacticwarrior9
a93f08a97b Fix McMMOItemSpawnEvent#setItemStack being ignored in ItemUtils (#5102) 2024-11-16 16:11:14 -08:00
nossr50
91ab569b81 Fixed COTW summon bug 2024-11-16 16:10:05 -08:00
nossr50
19bf96ab33 Expand API for McMMOPlayerMasterAnglerEvent 2024-11-16 15:48:41 -08:00
nossr50
827b894257 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2024-11-16 15:24:53 -08:00
nossr50
69e90a89f7 minor refactoring 2024-11-16 15:24:48 -08:00
Jacob
570cadb276 add McMMOPlayerMasterAnglerEvent and ability to cancel it if desired (#5111) 2024-11-16 15:24:05 -08:00
nossr50
79ad86ff29 Fix infinite recursion caused by inadvertent chunk loading/unloading Fixes #5112 2024-11-16 15:13:46 -08:00
nossr50
4cb3d3181b 2.2.027 2024-11-10 15:15:09 -08:00
nossr50
b928e145b6 use thread safe collections for sets 2024-11-10 15:11:39 -08:00
nossr50
c52b855ae1 Remove the luck component of salvage material quantity 2024-11-10 14:30:14 -08:00
nossr50
b4871fe49f Add tridents/crossbows to salvage 2024-11-10 13:50:18 -08:00
nossr50
04eefaef79 Fixed ricocheted arrows missing some data after bouncing
Fixes #5093
2024-11-09 15:58:24 -08:00
nossr50
b5ecd214ef Fixed concurrency issue with Folia and COTW summons
Fixes #5086
2024-11-09 15:46:45 -08:00
nossr50
2ea9cff2cd Fix Folia locale string concurrency issue Fixes #5097 2024-11-09 14:22:47 -08:00
nossr50
f90a15a821 dev mode 2024-11-09 13:45:13 -08:00
nossr50
c54a758e7f 2.2.026 2024-11-07 18:58:07 -08:00
nossr50
3f5f510fc5 Fixed NPE on chunk unload 2024-11-07 18:55:59 -08:00
nossr50
f304a1fbb9 dev mode 2024-11-07 17:45:49 -08:00
nossr50
6f92baf0b5 2.2.025 2024-11-05 17:15:06 -08:00
nossr50
406a7ba694 2.2.024 2024-11-04 19:05:41 -08:00
nossr50
04007f6dbc fixed fishing errors Fixes #5108 2024-11-04 18:56:38 -08:00
nossr50
6ed4ad76cd update changelog 2024-11-03 17:21:20 -08:00
nossr50
3aaff1911b huge optimizations 2024-11-03 17:10:49 -08:00
nossr50
f0973f2500 fix big oopsie 2024-11-03 14:27:09 -08:00
nossr50
4ba85aa444 optimizations 2024-11-03 14:22:14 -08:00
nossr50
9f7dbc23f6 fix failing test 2024-11-02 19:43:46 -07:00
nossr50
39b0e87b9a Move logic for config format into ConfigStringUtils 2024-11-02 19:39:06 -07:00
nossr50
ce18f3df97 major optimizations to getting xp values for specific blocks 2024-11-02 18:56:11 -07:00
nossr50
03c9dfda02 dev mode 2024-11-02 16:16:04 -07:00
nossr50
60da4bcd68 2.2.023 2024-10-31 20:46:56 -07:00
nossr50
9d5bebef52 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2024-10-31 20:38:04 -07:00
nossr50
99bb5857f8 update for 1.21.3 compatibility 2024-10-31 20:37:54 -07:00
Jacob
571013cf55 add causingPlayer to McMMOReplaceVanillaTreasureEvent and update Fish Event to use it (#5104)
* add causingPlayer to McMMOReplaceVanillaTreasureEvent and update Fishing Event to use it

* make requested changes

---------

Co-authored-by: Jacob Cuomo <jcuomo3@gatech.edu>
2024-10-25 13:00:37 -07:00
nossr50
8087d5f647 change transformable entity list into immutable set 2024-09-28 13:42:25 -07:00
nossr50
d7e8a6b7c1 2.2.022 2024-09-28 13:32:32 -07:00
nossr50
ddb701bc94 update changelog 2024-09-28 13:30:10 -07:00
nossr50
d42581b24f fix to PR 2024-09-28 13:28:43 -07:00
Ineusia
d5c4bebfad Fix slime spawner exploit (#5089)
* Fix slime spawner exploit

* Move slime/magmacube into a constant
2024-09-28 13:26:22 -07:00
Warrior
5c68a176e5 Fix cat cotw on older versions (#5096) 2024-09-28 13:23:28 -07:00
Ineusia
3d7810c568 Bugfix/acrobatics roll chance (#5094)
* Fix acrobatics

* Move acrobatics damage reduction inside success check
2024-09-28 13:21:44 -07:00
nossr50
8b81c9aafe dev mode 2024-09-28 13:20:50 -07:00
nossr50
582a572272 2.2.021 2024-09-20 15:06:01 -07:00
Tautuxs
038d913f87 Update locale_lt_LT.properties (#5079)
I added #TRIDENTS and translated it
2024-09-20 15:03:43 -07:00
Dev
fe46ece008 Update locale_es.properties (#5083) 2024-09-20 15:03:34 -07:00
Ineusia
1c08cac2f8 Fix acrobatics (#5088) 2024-09-19 18:39:56 -07:00
nossr50
2fd86e870f dev mode 2024-09-19 18:39:36 -07:00
Vrganj
8c2848a3e7 Update PlaceholderAPI dependency (#5085) 2024-09-16 11:24:19 -07:00
nossr50
f623b608f6 2.2.020 2024-09-14 15:20:53 -07:00
nossr50
bac16238ac Fix NPE for Alchemy Fixes #5080 Fixes #5073 2024-09-14 15:19:13 -07:00
nossr50
9b046bd490 Fixed blast mining trying to drop non-items 2024-09-14 15:12:39 -07:00
nossr50
88cacf8fff Alchemy no longer spams when finding potions of the same type in config Fixes #5081 Fixes #5059 2024-09-14 15:08:26 -07:00
nossr50
5cc97383fa Roll rework / refactor Fixes #5023 2024-09-14 14:21:48 -07:00
nossr50
b87efb3f76 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2024-08-31 13:26:16 -07:00
nossr50
cfe3accf57 2.2.019 2024-08-31 13:26:08 -07:00
MrPowerGamerBR
dcf83a8d20 Cache ItemMeta instead of creating a new ItemMeta for each potion check (#5075)
* Cache ItemMeta instead of creating a new ItemMeta for each potion check

* Check if the item has item meta and, if it doesn't, bail out

* Also cache the potion item meta too

* Add requireNonNull to the potionItemMeta
2024-08-31 13:11:17 -07:00
Warrior
93bb160742 Fix exceptions when shooting entities through worlds on folia (#5024) 2024-08-31 13:02:00 -07:00
Lego
f67e30641d Update locale_en_US.properties (#5066)
Removed Water Lily from Vanilla Potions
Changed Sulphur to Gunpowder
Moved Rabbits Foot from Tier 3 to Vanilla Potions
2024-08-28 10:13:19 -07:00
nossr50
969b901615 update changelog 2024-08-11 11:26:22 -07:00
nossr50
c7409a8f9b Prevent IllegalArgumentException with Rupture and provide more detailed logging when Rupture cannot activate from illegal state Fixes #5063 2024-08-11 11:25:31 -07:00
nossr50
684583c19b remove msg about in development skills 2024-08-03 11:45:50 -07:00
nossr50
3065c71c25 2.2.018 2024-07-27 15:47:10 -07:00
nossr50
afa4260d0d Limit XP on certain plants which can become unnaturally tall Fixes #5045 2024-07-27 15:42:18 -07:00
nossr50
486dc1344d Optimize blast mining blacklist 2024-07-27 15:08:37 -07:00
nossr50
bda5424a4c Mob Spawners no longer drop from Blast Mining Fixes #5052 2024-07-27 15:07:47 -07:00
nossr50
e886a16388 Fixed probability bug Fixes #5055 Fixes #5054 2024-07-27 15:01:28 -07:00
nossr50
248116df21 dev mode 2024-07-27 13:53:51 -07:00
nossr50
c6791c81cf misc refactoring 2024-07-27 13:53:36 -07:00
nossr50
a0a9d98c80 fix minor word fumble in changelog 2024-07-13 16:47:20 -07:00
nossr50
fe01312136 2.2.017 2024-07-13 16:41:50 -07:00
nossr50
2debcbefd0 Fix Blast Mining Fixes #5021 2024-07-13 16:39:04 -07:00
nossr50
ce8464fcfe Fixed alchemy shift-click exceptions on older MC versions Fixes #5046 Fixes #5039 2024-07-13 14:47:42 -07:00
nossr50
99d8b64589 Add setting for ignoring attack cooldown Fixes #5048 2024-07-13 13:59:42 -07:00
nossr50
25a55d6d4d update changelog 2024-07-13 13:53:23 -07:00
Daniel Li
34c61afa72 update zh_CN translation (#5031) 2024-07-13 13:41:54 -07:00
Ted
4c4d7ee100 Update locale_fr.properties (#5033) 2024-07-13 13:40:49 -07:00
Jesus Ruescas Junior
e96e65e25d Updating the PT-BR translation after 2 years (#5036) 2024-07-13 13:40:25 -07:00
ThiagoROX
ed8d1cdd33 fix mace skills permission (#5038) 2024-07-13 13:38:56 -07:00
nossr50
e9b919f210 2.2.016 2024-07-09 16:00:45 -07:00
nossr50
600ab0eea7 SQL fixed player cooldowns being loaded incorrectly Fixes #5042 Fixes #5032 2024-07-09 12:13:50 -07:00
nossr50
940fb66652 2.2.015 2024-06-30 15:11:41 -07:00
Robert Alan Chapton
971e5da0ad Maces (#5035)
Add Maces skill
2024-06-30 15:10:29 -07:00
nossr50
02c732bdf2 2.2.014 2024-06-28 18:31:24 -07:00
nossr50
e32bde3c32 fix luck of the sea being applied for super break and other abilities Fixes #5026 2024-06-28 18:28:51 -07:00
nossr50
a11ac782fa 2.2.013 2024-06-22 13:32:31 -07:00
nossr50
10e8b19e53 update Changelog.txt 2024-06-22 13:30:50 -07:00
nossr50
ac3c6da298 add xp for Bogged and Breeze 2024-06-19 16:29:10 -07:00
nossr50
4fce053804 minor refactoring 2024-06-19 12:15:00 -07:00
nossr50
eeecf18caf add missing entries for xbows/tridents/maces 2024-06-19 12:14:53 -07:00
nossr50
b9b1127087 update changelog 2024-06-08 13:23:06 -07:00
DonaldBear
009f64cba1 feat(locale): Updated locale zh_TW (#5015)
* Update locale_zh_TW.properties

Updated this line:
Skills.AbilityGateRequirementFail=&7你還需要 &e{0}&7 級以上的 &3{1}&7 來使用這個能力。

Added: "還" (meaning = stills)  in Skills.AbilityGateRequirementFail

Avoid player misconception, indicate that players still need such a level to have the ability to use these skills.

* Add files via upload

* Update locale_zh_TW.properties

Updated zh_TW locale, added new translations and corrected some wrong translation

* Update locale_zh_TW.properties

Fixed missing color code

* Update locale_zh_TW.properties

Added new translations

* Update locale_zh_TW.properties
2024-06-08 13:14:25 -07:00
haha44444
2a4487cde2 Fix properties key error (#5010) 2024-06-08 13:13:10 -07:00
nossr50
8633f7b63a more refactoring for spawning items conditionally 2024-05-25 12:25:00 -07:00
nossr50
0708b0a6a2 some more refactoring 2024-05-24 13:30:17 -07:00
nossr50
6c1502fc67 refactoring 2024-05-24 13:07:45 -07:00
nossr50
4277384c22 move item related utils from Misc to ItemUtils 2024-05-24 12:58:39 -07:00
nossr50
590b00aeca minor refactoring 2024-05-23 18:14:07 -07:00
Momshroom
2f1278c784 Fix sapling drops to ignore reduction and obey Knock on Wood (#5012)
* Fixed NPE when party creation doesn't use password.  Solves bug reported here: https://discord.com/channels/526933440214597677/526938425161416727/1213131451235827753

Signed-off-by: Momshroom <Momshroom@gmail.com>

* Actually don't reduce sapling drop if KnockOnWood unlocked. (Prior fix didn't)

Signed-off-by: Momshroom <Momshroom@gmail.com>

* removed unnecessary getPlayer() calls.
clarified comment
clarified location variable name

Signed-off-by: Momshroom <Momshroom@gmail.com>

* made new method more generic.
Removed no longer needed dropString variable

Signed-off-by: Momshroom <Momshroom@gmail.com>

---------

Signed-off-by: Momshroom <Momshroom@gmail.com>
2024-05-23 18:02:29 -07:00
nossr50
d0ab2bdb2f clean up if/else formatting 2024-05-19 14:09:00 -07:00
nossr50
7266563ca9 Back to Java 17 for now 2024-05-19 13:53:46 -07:00
nossr50
364d4cd6e7 spring-cleaning, update all the dependencies 2024-05-19 13:48:25 -07:00
nossr50
32ff8c6818 update maven-release-plugin 2024-05-19 13:24:14 -07:00
nossr50
fc600796ca minor refactor 2024-05-19 13:24:06 -07:00
nossr50
db9f8e46d1 update github workflow runner to use 21 2024-05-19 13:18:39 -07:00
nossr50
19a8a9ff52 update maven compiler plugin 2024-05-19 13:14:39 -07:00
nossr50
ab8ba8acbe update maven shade plugin 2024-05-19 13:11:12 -07:00
nossr50
d38404927b minor refactor 2024-05-19 13:05:10 -07:00
nossr50
b65247cbb0 require java 21 2024-05-19 13:05:00 -07:00
nossr50
9b09f06ad8 add more sensibly named API for grabbing the UserBlockTracker 2024-05-19 12:58:51 -07:00
nossr50
8b82163e3d update UserBlockTracker API 2024-05-19 12:44:34 -07:00
nossr50
c2054a5d45 2.2.012 fix for daze in 1.20.4 and older 2024-05-18 12:30:44 -07:00
nossr50
46c9ea5a25 2.2.011 2024-05-17 17:24:31 -07:00
nossr50
e6ff219a5c more verbose logging for alchemy potion lookups 2024-05-17 12:02:44 -07:00
nossr50
fc66c9f3fd 2.2.010 2024-05-15 16:06:16 -07:00
nossr50
8d2a08c421 fix REGEN potion not loading 2024-05-13 10:59:57 -07:00
nossr50
291effdbc8 if( -> if ( 2024-05-12 14:13:34 -07:00
nossr50
435a6fde34 update Changelog.txt 2024-05-12 14:11:59 -07:00
nossr50
3ba6b93135 Fixed possible NPE in our events, and BrewingStands now remember who last interacted with them, this allows for hoppers to be used with Alchemy Fixes #5004 Fixes #4958 Fixes #4641 2024-05-12 14:09:51 -07:00
nossr50
17052861d1 2.2.009 2024-05-12 09:34:02 -07:00
nossr50
cae2132d8d 2.2.008 2024-05-11 16:08:05 -07:00
nossr50
ed0c9469e2 don't show unimplemented supers for mccooldowns 2024-05-11 16:01:47 -07:00
nossr50
64206c3ac8 Fixed mccooldowns on SQL not working Fixes #5006 2024-05-11 15:58:49 -07:00
nossr50
0bf1bbe6ac Fixed messages not being sent to the action bar 2024-05-11 15:48:11 -07:00
nossr50
b3edca5304 Fix italicized potion names 2024-05-11 15:27:47 -07:00
nossr50
07b4736be3 update changelog 2024-05-11 15:07:45 -07:00
IAISI
df6ddd6faa CombatUtils: Don't run checks against party features if parties are disabled (#5005)
Co-authored-by: Dieu <info@l4b.org>
2024-05-11 15:07:01 -07:00
nossr50
fb0c8ec934 Fix potions not brewing as the correct type 2024-05-11 15:05:37 -07:00
nossr50
5ba6305ad4 2.2.007 2024-05-04 10:26:43 -07:00
nossr50
75561350c1 fix issues with Alchemy and older MC versions 2024-05-03 13:53:53 -07:00
nossr50
5b822bc626 add armadillos to xp 2024-05-02 06:39:20 -07:00
nossr50
e29a977b9a fix mistake in skillranks.yml 2024-05-02 06:32:47 -07:00
nossr50
78558107b3 WIP 1.20.6 support 2024-05-02 06:28:20 -07:00
nossr50
5628df988f update changelog 2024-04-21 16:04:05 -07:00
nossr50
c078e853eb Fix bug where Green Thumb did not replant if seeds were solely in the offhand Fixes #4994 2024-04-21 14:57:57 -07:00
nossr50
0db5330416 release should be 17 not 16 2024-04-16 14:26:32 -07:00
nossr50
1cac6b1165 2.2.006 2024-04-13 15:18:12 -07:00
nossr50
c0952a2ba3 Add support for hex color codes in locale 2024-04-13 12:58:52 -07:00
nossr50
4d98d25215 Fix wiki links being outdated 2024-04-06 15:10:02 -07:00
nossr50
ffc6061f8b Add custom_item_support config file to optionally disable repair/salvage on items with custom models 2024-04-06 14:26:57 -07:00
nossr50
0363ee2e90 2.2.005 2024-04-06 12:59:35 -07:00
nossr50
b6e512b09e fix probability being unbounded 2024-04-06 12:44:56 -07:00
nossr50
aecf17a2a2 dev mode 2024-04-02 13:30:09 -07:00
nossr50
c769813892 2.2.004 2024-04-02 13:25:35 -07:00
nossr50
e509876658 fix xp multiplier not getting applied 2024-04-01 15:13:49 -07:00
nossr50
a047bca94c Fix crossbows not getting added to schema for some users 2024-03-31 14:28:14 -07:00
nossr50
b5a50da09b Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2024-03-31 13:55:08 -07:00
nossr50
2d79b364db Fix lastlogin value being too large for SQLDB 2024-03-31 13:54:57 -07:00
Robert Alan Chapton
657d7cafa7 Update README.md 2024-03-31 10:41:34 -07:00
nossr50
d92c60fc84 2.2.002 2024-03-31 08:50:05 -07:00
nossr50
b56ddebde8 fix trickshot not applying shot from crossbow to bounced arrows 2024-03-31 08:46:04 -07:00
nossr50
cf49fc7599 fix thrown tridents not getting XP or subskill benefits 2024-03-31 08:44:06 -07:00
nossr50
86a5d14a9b 2.2.001 2024-03-30 06:57:55 -07:00
nossr50
d45e48c401 changelog update 2024-03-30 06:37:49 -07:00
nossr50
77f6a3945f 2.2.000 2024-03-30 06:35:58 -07:00
nossr50
6016e69663 update changelog 2024-03-30 06:28:51 -07:00
nossr50
8902c86864 update changelog 2024-03-30 06:27:21 -07:00
nossr50
f6d2479f2e update changelog 2024-03-30 06:25:34 -07:00
nossr50
81ac48904c mcMMO 2.2.000-RC1 candidate for release 2024-03-30 06:16:10 -07:00
Robert Alan Chapton
2594dc1bca Endgame Update (#4840)
General
Added Crossbows Skill, this skill is a WIP and feedback on discord is appreciated.
Added Tridents Skill, this skill is a WIP and feedback on discord is appreciated.
Added the "endgame" triple drop subskill 'Mother Lode' to Mining
Added the "endgame" triple drop subskill 'Clean Cuts' to Woodcutting
Added the "endgame" triple drop subskill 'Verdant Bounty' to Herbalism
Added /mmopower command which simply shows your power level (aliases /mmopowerlevel /powerlevel)

Config
Added 'Send_To_Console' settings to chat.yml to toggle sending party or admin chat messages to console.
Replaced 'Experience_Formula.Modifier' in experience.yml with 'Experience_Formula.Skill_Multiplier' which is easier to understand and less prone to divide by zero bugs.
child.yml config is gone now, feel free to delete it.

Tweaks
Tree Feller now drops 90% less non-wood block rewards (leaves/etc) on average from Knock on Wood.
Treasure drop rate from Shake, Fishing, Hylian, and Excavation now benefit from the Luck perk.
Updated advanced.yml with entries for the new skills

Permission nodes
Added 'mcmmo.commands.mmopower' permission node for the new /mmopower command
Added 'mcmmo.commands.crossbows' permission node
Added 'mcmmo.ability.crossbows.crossbowslimitbreak' permission node
Added 'mcmmo.ability.crossbows.trickshot' permission node
Added 'mcmmo.ability.herbalism.verdantbounty' permission node
Added 'mcmmo.ability.mining.motherlode' permission node
Added 'mcmmo.ability.woodcutting.cleancuts' permission node

Locale
Added locale entries for motherlode, cleancuts, and verdant bounty.

Codebase
Major rewrite for how random chance was handled in the code.
Many skills with RNG elements now send out a SubSkillEvent (which can be used to modify probability or cancel the results), some skills without RNG still send out this event when activated, this event is cancellable so it can be used to make a skill fail.
A lot of new unit tests were added to help keep mcMMO stable as part of this update, of course, more could always be added.

NOTES:
One feature of this update is to provide an endgame benefits to some skills that you can grind for a long time, ideally for a long while. I will likely expand upon this idea in future updates.
A few skills have these endgame-oriented subskills, these new subskills provide a small benefit at first that grows and scales up to level 10,000 (or 1,000 for Standard mode which no one uses) and does not have ranks (other than the initial rank to unlock it).
These endgame sub skills unlock at level 1000 for users with default mcMMO settings, or 100 for those using the optional Standard scaling.
You can tweak the benefits of these skills in advanced.yml, the default settings are meant to be a good starting point.

Crossbows and Tridents are WIP skills, I would like feedback on discord about them.

More info on the new Triple Drop skills (Mother Lode, Clean Cuts, Verdant Bounty):
Currently these start at about 5%  chance and can reach a maximum 50% chance if a player acquired 10,000 skill, you can adjust this in advanced.yml
These skills respect double drop settings from config.yml just like the corresponding Double Drop skills do, if a double drop is disabled for an item, then it's disabled for triple drops too.
I added a new Power Level Command, for now this just shows you your current power level. If I ever add features based on power level, this command will likely display output related to those features.

Regarding Maces, I will likely add that as a WIP skill when the next Minecraft update drops.
2024-03-30 06:09:59 -07:00
gecko10000
bead5feb14 Make PAPI expansion persist (#4986) 2024-03-30 05:31:47 -07:00
nossr50
ed8c8107f9 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2024-03-19 16:16:11 -07:00
nossr50
b6697141f7 add ExploitFix.PreventArmorStandInteraction to prevent combat abilities going off on armor stands 2024-03-14 13:24:57 -07:00
Lorenzo Cardinali
04ed2a47d4 Fixed import errors related to Alchemy data in AdvancedConfig (#4983) 2024-03-10 18:59:15 -07:00
nossr50
7da8c8c83a 2.1.231 2024-03-09 21:16:59 -08:00
Mangchi__
4d060b192b Update locale_ko.properties (#4977)
* Update locale_ko.properties

* Update locale_ko.properties fixed-1
2024-03-09 20:17:14 -08:00
Momshroom
2117c67084 Fixed NPE when party creation doesn't use password. Solves bug reported here: https://discord.com/channels/526933440214597677/526938425161416727/1213131451235827753 (#4981)
Signed-off-by: Momshroom <Momshroom@gmail.com>
2024-03-09 20:16:14 -08:00
nossr50
4d85f24d98 2.1.230 2024-02-22 18:04:57 -08:00
nossr50
416c5383c9 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2024-02-22 17:57:17 -08:00
IAISI
7f9ed94d23 Fix exceptions on EntityCombustByEntityEvent, EntityDamageByEntityEvent, PartyAutoKickTask if parties are disabled (#4976)
* Only run EntityListener#checkParties on EntityCombustByEntityEvent if Parties are enabled

* Only run PartyAutoKickTask Task if Parties are enabled

* Only run EntityListener#checkParties on EntityDamageByEntityEvent if Parties are enabled

* Check if Parties are enabled before running inSameParty in CombatUtils#processCombatXP

---------

Co-authored-by: Dieu <info@l4b.org>
2024-02-22 17:57:05 -08:00
nossr50
b0d0030d60 2.1.230 2024-02-22 17:54:42 -08:00
IAISI
cdc187b211 Fix PartySaving related NPEs (only save parties if they're enabled) (#4973)
Co-authored-by: Dieu <info@l4b.org>
2024-02-20 09:20:08 -08:00
nossr50
3361d28887 Party system can now be disabled via config
Closes #4873
2024-02-19 17:55:57 -08:00
nossr50
c358c8ce0b Add missing getHandlerList() to McMMOEntityDamageByRuptureEvent fixes #4972 2024-02-19 16:12:39 -08:00
nossr50
aa65be0e1b dev mode 2024-02-17 16:30:47 -08:00
nossr50
85f27fdbdb 2.1.228 2024-02-14 13:17:46 -08:00
nossr50
5bfca3c218 Fix spigot api break for entity damage events 2024-02-13 18:04:00 -08:00
nossr50
94754b150c Dev mode 2024-01-02 23:31:48 -08:00
nossr50
415e3df226 2.1.227 2024-01-02 22:45:38 -08:00
Robert Alan Chapton
b5608ccb01 Update README.md 2023-12-23 15:53:30 -08:00
Robert Alan Chapton
d57e225576 Update README.md 2023-12-23 15:53:08 -08:00
Robert Alan Chapton
2f166507ca Update README.md 2023-12-23 15:50:49 -08:00
MithicSpirit
347e6112fb Make mcMMO anvil sounds categorized (#4954)
Default anvil sound is way too loud, and being in the master category
makes it hard to manage player-side without making the entire game too
soft.
2023-12-21 17:54:29 -08:00
Min Sa-Hun
65dfcb492d Renewed and completed the Korean locale (#4956)
Co-authored-by: Pindang2 <workspace@pindang2.com>
2023-12-21 17:53:38 -08:00
YuanYuanOwO
23a549a6d3 Update locale_zh_CN.properties (#4953)
Update language file to fix a typo error
2023-12-21 17:52:51 -08:00
nossr50
a522ab7b2f updata todo note 2023-12-16 17:59:40 -08:00
nossr50
a0923ad786 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2023-12-16 17:46:37 -08:00
nossr50
dd04ee48b9 2.1.226 2023-12-16 17:45:17 -08:00
PikaMug
89b895af81 Update pom.xml with WorldEdit (#4951) 2023-10-27 11:19:38 -07:00
nossr50
9e1f5b44a6 dev mode 2023-10-15 12:29:27 -07:00
nossr50
a54590576f 2.1.225 2023-10-15 12:18:12 -07:00
Spongecade
06160c6d04 Update Minecraft wiki link to new domain (#4944) 2023-10-15 10:47:21 -07:00
nossr50
12e5a7f054 Bamboo is now treated like a cactus/sugar cane 2023-10-08 16:51:59 -07:00
nossr50
1f20e6344b 2.1.224 2023-10-02 18:16:02 -07:00
nossr50
13ba51cdf1 Fixed some mistakes in shake config 2023-09-30 15:46:20 -07:00
nossr50
4f22391465 Spelling/Grammar 2023-09-30 15:44:56 -07:00
nossr50
5f1a545437 Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2023-09-30 15:43:30 -07:00
nossr50
bad7023129 Shake has 8 ranks again 2023-09-30 15:43:19 -07:00
Huynh Tien
785f18c13a update FoliaLib (#4935)
- fix an issue with 0 ticks setting
- disable scheduler warning
2023-09-03 16:41:35 -07:00
nossr50
357995ecb0 2.1.223 Folia Support Added 2023-08-26 16:21:09 -07:00
nossr50
3e26eca48e Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2023-08-26 16:17:39 -07:00
nossr50
dd339c20ea Updated API 2023-08-26 16:17:31 -07:00
Yomamaeatstoes
c34230a82e mcMMO-Folia-PR (#4925)
Folia Support

---------

Co-authored-by: Rockyers <ethan@yocom.org>
Co-authored-by: TechnicallyCoded <technicallycoded@gmail.com>
Co-authored-by: HSGamer <huynhqtienvtag@gmail.com>
2023-08-26 16:16:18 -07:00
Greymagic27
192626f4da Fix packaging error on windows #4911 (#4919) 2023-08-19 14:23:05 -07:00
nossr50
24a57fab3d 2.1.222 2023-07-09 14:43:38 -07:00
nossr50
78596dc00e Glow Lichen nerf 2023-06-25 13:51:00 -07:00
nossr50
0b1b753d4c Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2023-06-25 13:47:25 -07:00
nossr50
3cbdcddcc1 Crossbows do not count as unarmed item with unarmed items setting 2023-06-25 13:47:04 -07:00
dependabot[bot]
25ecb6e1de Bump guava from 31.1-jre to 32.0.0-jre (#4903)
Bumps [guava](https://github.com/google/guava) from 31.1-jre to 32.0.0-jre.
- [Release notes](https://github.com/google/guava/releases)
- [Commits](https://github.com/google/guava/commits)

---
updated-dependencies:
- dependency-name: com.google.guava:guava
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 18:46:30 -07:00
nossr50
019d22d92a Make mcMMO quieter by moving most log messages to debug only 2023-06-19 16:26:30 -07:00
nossr50
e39022cc64 2.1.221 2023-06-19 14:11:53 -07:00
nossr50
a41106ee30 Update changelog 2023-06-17 20:34:18 -07:00
nossr50
b2110d4e1c PAPI Support pt 2 2023-06-17 20:32:51 -07:00
nossr50
f22043ebb5 PAPI Support WIP 2023-06-17 20:22:49 -07:00
nossr50
cc1b511c02 Don't look up offline players by name 2023-06-17 15:56:36 -07:00
nossr50
e9a020565f Added fail safes against bonus drop meta not being cleaned up 2023-05-29 14:34:47 -07:00
nossr50
44ab8d93ab Dev mode 2023-05-29 14:15:04 -07:00
Warrior
78922ea337 Fix blast mining bonus drops option not working (#4895) 2023-05-29 13:58:24 -07:00
nossr50
db01b61371 2.1.220 2023-05-13 14:42:14 -07:00
Warrior
133a60c4bf Fix child skills counting towards power level in /inspect (#4889) 2023-04-23 11:08:06 -07:00
nossr50
684e96ff6b Fix RankConfig 2023-04-17 12:17:28 -07:00
nossr50
f40f68bdf0 Fix RankConfig not using the new updating config system 2023-04-17 12:07:59 -07:00
nossr50
640f4b0a9b Fix mcMMO attempting to copy out custom repair/salvage configs 2023-04-17 12:07:41 -07:00
nossr50
978ee4a9a3 Optimize the imports 2023-04-11 15:49:37 -07:00
nossr50
0ab93586fd Config files will update automatically again 2023-04-11 15:48:14 -07:00
nossr50
921a0228db Merge remote-tracking branch 'origin/master' 2023-04-07 17:00:13 -07:00
nossr50
ac68c4ebe6 2.1.219 2023-04-07 17:00:01 -07:00
Smudge
4553310bb9 Fixed fishing exploiting compatibility (#4859)
* Fixed fishing exploiting compatibility

* Moved same target to class variable
2023-04-03 17:52:00 -07:00
Warrior
9b0632d63c Make party loading more resilient (#4881) 2023-04-03 17:49:35 -07:00
Warrior
69ef484b86 Fix dots not being replaced when renaming party (#4882) 2023-04-03 17:48:53 -07:00
Warrior
606a92f1ef Fix /party teleport NPE (#4885) 2023-04-03 17:48:01 -07:00
nossr50
79730383ab Fixed wiki url being incorrect in various commands 2023-04-03 16:47:58 -07:00
nossr50
7264e1a8d6 Small tweaks 2023-04-03 12:07:34 -07:00
nossr50
e011f545a7 Added smithing_table to tool readiness blacklist 2023-04-02 20:44:00 -07:00
nossr50
283fa14380 Add Camel, Sniffer, and Snifflet to taming XP 2023-04-02 20:42:06 -07:00
nossr50
5f388a9906 Add support for torchflower replanting to herbalism 2023-04-02 20:38:05 -07:00
nossr50
cd96bc79d8 Change isHerbalismDrop to use strings.. this method still needs more work 2023-04-02 20:24:04 -07:00
nossr50
ae961caeab Added Torchflower to herbalism experience and bonus drops 2023-04-02 20:11:10 -07:00
nossr50
0b4d87aebc Add Sniffer and Snifflet to combat experience in experience.yml 2023-04-02 20:07:50 -07:00
nossr50
6106f70c24 Added Pitcher_Plants to bonus drops and herbalism experience 2023-04-02 20:05:52 -07:00
nossr50
100a7f8a8f Added pink_petals, cherry_wood, and cherry_log to bonus drops in config.yml 2023-04-02 20:02:32 -07:00
nossr50
4c792c4f2c Added Pink_Petals to experience.yml 2023-04-02 20:00:58 -07:00
nossr50
db4b820f80 Add new hanging signs to tool readiness blacklist 2023-04-02 19:58:16 -07:00
nossr50
ca710b4302 Add chiseled_bookshelf to tool readiness blacklist 2023-04-02 19:55:30 -07:00
nossr50
668cc0e4a3 Add support for upcoming Cherry trees 2023-04-02 19:53:13 -07:00
nossr50
6d0542b524 Merge remote-tracking branch 'origin/master' 2023-03-26 13:22:41 -07:00
nossr50
d84a5b37b7 Update kyori dependencies 2023-03-26 13:22:31 -07:00
optimizing-ci-builds
c072ae4990 disable xml report (#4880) 2023-03-21 22:05:40 -07:00
nossr50
2d78eaa495 Fixed Beetroots double drop issue #4667 2023-03-19 21:21:54 -07:00
Warrior
6bdc51be76 Fix missing return in notify command (#4870) 2023-02-25 15:20:45 -08:00
nossr50
af15617196 Add config toggle for Blast Mining bonus drops to advanced.yml 2023-02-19 13:40:14 -08:00
CuteLittleSky
643dff7915 Update locale_zh_CN.properties (#4858) 2023-02-09 18:16:26 -08:00
Justin
01fbfccc0d feat: Make power level display for offline players (#4861)
Fixes #4599
2023-02-09 18:12:46 -08:00
Jok
2362fe994a Don't call EntityDamageByEntityEvent with null damager (#4863)
Co-authored-by: Elioby <elioby@users.noreply.github.com>
2023-02-09 18:11:30 -08:00
nopeless
08b08b1285 Fix: player is no longer immune to projectiles shot by themselves (#4856) 2023-01-28 11:57:31 -08:00
nossr50
965540dfaf 2.1.218 2022-12-04 14:32:34 -08:00
destro174
75822472fc Add item in mainhand when spawning in lumber bonus blocks. (#4826) 2022-12-04 14:22:37 -08:00
Daniil Z
59aecb79a1 Update Russian locale (#4832)
Added/updated some lines
Fixed new-line characters
2022-12-04 14:21:44 -08:00
DarkKnights22
c865c2d2e3 Fix bug where players could know staff are invis (#4833)
* Fix bug where players could know staff are invis

* remove whitespace
2022-12-04 14:21:22 -08:00
MrPowerGamerBR
93c64a8770 Fix pt_BR ability on typo (#4837) 2022-12-04 14:19:48 -08:00
Greymagic27
30ac82181e Updated plugins to latest version (#4817) 2022-08-09 07:35:12 -07:00
nossr50
2b219f48ec Dev mode 2022-08-07 16:13:18 -07:00
nossr50
fed0483d40 2.1.217 2022-08-07 16:03:55 -07:00
nossr50
101c43a4bc Tree Feller now partially destroys trees if the whole tree is too big
Fixes #4811
2022-08-07 15:55:19 -07:00
nossr50
fb738d85f6 Mangrove trees are now properly marked natural from growth
Fixes #4810
2022-08-07 15:54:22 -07:00
nossr50
032a407c8a Update changelog and version 2022-08-07 14:27:42 -07:00
Greymagic27
33e615f0f1 Updated dependencies to fix hovering over subskills for 1.19.2 (#4814)
* Updated dependencies that should fix the issue

* Updated spigotmc version

* Updated rest of dependencies

* Updated dependencies that fix the issue. Investigating what dependency update breaks compiling.

* Found the dependency that caused the compile issue, so have not updated that one
2022-08-07 14:19:46 -07:00
dod0lp
8feba60e2c Update config.yml (#4809) 2022-08-03 07:43:03 -07:00
nossr50
8a4fe8ae5d 2.1.216 2022-07-24 10:09:48 -07:00
nossr50
45f96793a5 Revert "Players who used unarmed combat are still considered using unarmed while not holding weapons for a brief time period"
This reverts commit 993b418fbc.
2022-07-24 10:05:56 -07:00
nossr50
df0362bcba Allow mining benefits while using Hoe 2022-07-23 17:04:43 -07:00
nossr50
25d558a5fa Added Sculk blocks to Mining 2022-07-23 16:57:42 -07:00
nossr50
c0e4d7a43d 2.1.215 - Unarmed change + Bug Fixes 2022-07-23 16:22:02 -07:00
nossr50
993b418fbc Players who used unarmed combat are still considered using unarmed while not holding weapons for a brief time period 2022-07-23 16:13:49 -07:00
nossr50
9cf856221d update changelog 2022-07-23 14:47:32 -07:00
nossr50
4db6e03517 Hacky workaround for Spigot API bug not showing burntime to the client when burntime was too high 2022-07-23 14:43:24 -07:00
nossr50
eb1393c02c Fix burnTime debug prints on mmodebug players 2022-07-23 14:24:31 -07:00
nossr50
e1a54b72a9 update changelog 2022-07-23 13:34:38 -07:00
Greymagic27
b266c7ce5b Updated Dependencies (#4798)
* Updated Dependencies

* Fix spelling mistake in dependencies

* Fixed dependency error that would prevent the plugin from loading.

Turned out I put in the wrong acf-bukkit, preventing the plugin from working. Oops!
2022-07-17 14:59:19 -07:00
nossr50
38f937fa01 revert potential furnace animation bug fix 2022-07-17 14:56:44 -07:00
nossr50
6d7982c0cf Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2022-07-17 14:03:10 -07:00
nossr50
89fa26d0eb Potential fix for #3005 2022-07-17 14:00:03 -07:00
Greymagic27
edd85c2f19 Updated kyori adventure-platform dependencies (#4797) 2022-07-17 13:38:44 -07:00
Greymagic27
88b6517f88 Added Dripstone Block to experience.yml (#4796) 2022-07-15 15:07:19 -07:00
PikaMug
2c09a0fdb6 Switch to new sk89q repo (#4791) 2022-07-02 19:25:27 -07:00
nossr50
90721ee859 Add missing Mangrove_Log to experience.yml 2022-06-26 18:43:09 -07:00
destro174
aa4011a226 Use item in mainhand to get drops when using treefeller (#4781) 2022-06-11 16:41:27 -07:00
nossr50
fa82fe8e67 Level up broadcasts should be visible to the player of origin 2022-06-09 22:50:36 -07:00
nossr50
444e1532f2 2.1.214 2022-06-09 22:39:11 -07:00
Smudge
1a34d2f647 Added 25% xp boost permission (#4773) 2022-06-09 14:31:06 -07:00
abridgedcarp
d543843235 Fix Maven build failure (#4779) 2022-06-09 14:26:50 -07:00
nossr50
c40af913f4 mcMMO 2.1.213 2022-06-07 18:07:14 -07:00
nossr50
f6268fe291 Add in new 1.19 stuff and tweak treasures.yml 2022-06-07 18:00:32 -07:00
nossr50
27854720f0 Add some exploit prevention to fishing 2022-05-15 15:24:25 -07:00
nossr50
d19cf1e260 2.1.212 - Fixed herbalism exploit and added damage limit for XP
calculations used in combat
2022-04-28 18:31:10 -07:00
Warrior
4a8630262e Fix hanging plants searching up instead of down. (#4766) 2022-04-28 08:33:45 -07:00
Werner
c41d2d1f39 Bump shade-plugin to 3.3.1 (#4762)
fixes building
2022-04-10 13:09:03 -07:00
nossr50
8821fb0b2f 2.1.211 2022-03-18 15:07:02 -07:00
nossr50
5ab55c1653 mcMMO will no longer use the DamageModifier API (potentially fix immortal player bug) 2022-03-17 19:58:42 -07:00
nossr50
8066f7f7f2 Tweak damage debug info to show modifier values 2022-03-17 16:08:50 -07:00
nossr50
5ea18e8ba7 Add combat debug info for player versus player combat /mmodebug 2022-03-17 15:03:42 -07:00
nossr50
0bf3f98d95 2.1.210 2022-03-17 13:59:17 -07:00
nossr50
fa33fa3d32 Revert 3 commits (work will be continued in branch)
Revert "Disabling mcMMO when the config breaks is dumb"

This reverts commit 86e7bfbf89.

Revert "Config validation rewrite part 1"

This reverts commit 16e90da8fd.

Revert "Update changelog"

This reverts commit 0ccd89fad4.
2022-03-17 13:49:46 -07:00
Mads U. Jensen
8b6a4c1e5b Update doubledrops IDs (#4743) 2022-02-10 17:31:22 -08:00
nossr50
0ccd89fad4 Update changelog 2022-01-30 15:47:08 -08:00
nossr50
16e90da8fd Config validation rewrite part 1 2022-01-30 15:31:52 -08:00
nossr50
86e7bfbf89 Disabling mcMMO when the config breaks is dumb
Fixes #4732
2022-01-30 14:24:21 -08:00
nossr50
8f0fb76847 Silence API out of date warning on config load 2022-01-17 15:57:04 -08:00
nossr50
3be15d3f65 Rewrite how mob/item/block metadata is tracked/retrieved
Fixes #4720
2022-01-17 15:32:02 -08:00
nossr50
74ced18bd0 Dev mode 2022-01-15 11:51:44 -08:00
nossr50
2e0a371ed8 Update changelog 2022-01-14 16:50:19 -08:00
nossr50
68ffe31246 2.1.209 2022-01-14 16:41:33 -08:00
nossr50
405de477d3 (thanks chew) Fix older MC versions not loading config files
Fixes #4716
2022-01-11 19:28:18 -08:00
nossr50
db0ae36fa7 fixed bug where duplicate comments with leading whitespace were ignored 2022-01-11 19:22:28 -08:00
nossr50
5d2028b5dc Java 16 compile target 2022-01-10 22:36:37 -08:00
nossr50
3e645a022d 2.1.208 2022-01-10 22:34:21 -08:00
nossr50
c21a040ddb Huge changes to how config files are loaded/updated, fixes many issues
Fixes #4715
2022-01-10 22:29:22 -08:00
the456gamer
dd4a5a6b9a remove YAML parsing hacks in favor of native bukkit provided parsing (#4714)
* fix yaml config to use native comment handling.
fixes #4702
replaces #4713
2022-01-09 11:16:17 -08:00
nossr50
d5ce8fc6ff Dev mode 2022-01-09 11:14:11 -08:00
dexasz
829aaea5d4 add & translate missing strings & fix a typo that broke placeholders (#4707) 2022-01-09 11:07:18 -08:00
Olivia
c92ae16c7f Fix extra 0 in level for gunpowder in retro mode (#4701) 2021-12-30 14:21:46 -08:00
nossr50
40160498ca 2.1.207 2021-12-27 11:40:33 -08:00
nossr50
9d08d88f2a Add new repair setting to default file 2021-12-27 11:34:55 -08:00
JeBobs
2ca3544741 Added option to disallow using enchanted materials to repair items. (#4693) 2021-12-27 11:29:54 -08:00
nossr50
ef714f98c9 Fix parties at level cap gaining XP and thus spamming messages
Fixes #4686
2021-12-27 11:22:16 -08:00
nossr50
dd550feb65 Update BlockTracker to use Spigot API directly instead of compatibility
layer
Fixes #4692 Fixes #4698
2021-12-27 11:09:27 -08:00
nossr50
ddc9a69f4b Fix ScoreboardManager NPE and added locale messages relating to scoreboards 2021-12-27 10:46:56 -08:00
TheBusyBiscuit
61388f46f1 Fixed #4694 (#4695) 2021-12-27 09:27:13 -08:00
nossr50
341dc45202 Takeout this warning 2021-12-14 23:27:51 -08:00
nossr50
13f7482b39 Unicode support for locale files 2021-12-14 23:08:08 -08:00
nossr50
a78dcffde7 Temporarily roll back to Java 16 2021-12-14 22:26:40 -08:00
nossr50
3671d0b565 dev mode 2021-12-14 22:23:31 -08:00
lilac & gooseberries
1b11fd2369 lithuanian translation for mcmmo (#4676) 2021-12-14 22:22:58 -08:00
nossr50
c36ff85cbf 2.1.206 - Memory leaks fixed and other changes Fixes #4681 2021-12-11 22:27:54 -08:00
nossr50
77cefbdfab Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2021-12-11 22:22:37 -08:00
nossr50
fbe0cd1471 Fixing like 10 memory leaks Fixes #4670 2021-12-11 22:22:02 -08:00
Robert Alan Chapton
728ba512c3 Java 17 for GH actions 2021-12-11 21:21:22 -08:00
nossr50
10470dde13 Reduce default volume of level up sound 2021-12-11 21:19:30 -08:00
nossr50
11245e87ef squelch ChunkStoreTest log output 2021-12-11 20:57:25 -08:00
nossr50
b88d752f61 update dependencies 2021-12-11 20:56:10 -08:00
Enderaoe
09ce259288 fix issue #4667 (#4669) 2021-12-07 19:55:42 -08:00
PikaMug
519d469cb2 Add null check to XP gain handler, fixes #4663 (#4677)
* Add null check to XP gain handler, fixes #4663

Co-authored-by: Robert Alan Chapton <nossr50@gmail.com>
2021-12-07 19:54:48 -08:00
nossr50
cf67e3502a dev mode 2021-12-07 19:29:36 -08:00
nossr50
9ab4584dfe MOB_METADATA_KEYS should be immutable 2021-11-14 09:36:00 -08:00
nossr50
8d27e8fccf 2.1.205 2021-11-14 09:33:27 -08:00
NemuruYama
ba1f15b655 Fixed the alchemy properly (#4658) 2021-11-14 08:05:42 -08:00
nossr50
5b1a69b3f7 2.1.204 2021-11-10 14:55:54 -08:00
Enderaoe
d185c7538c Fix issue #4626 double smelting on raw copper (#4652) 2021-11-10 04:55:04 -08:00
gecko10000
2347fc294f Fix IndexOutOfBoundsException for fake brew event by adding to list instead of setting the index (which doesn't work) (#4655) 2021-11-10 04:54:31 -08:00
nossr50
7aaec5b707 2.1.203 2021-11-08 19:07:02 -08:00
nossr50
20a713e04d Update changelog 2021-11-08 19:02:37 -08:00
gecko10000
81faf93f31 Fix hex colors in broadcasts (#4651) 2021-11-08 19:01:14 -08:00
PikaMug
19c0f6757e Add deprecated constructor w/o startinglevel per d9e195f (#4647) 2021-11-08 19:00:00 -08:00
nossr50
ec0815043e Update changelog 2021-11-08 18:58:11 -08:00
Enderaoe
182717eacf Fix issue #4105 Fishing shake percentage seems off. (#4649) 2021-11-08 18:57:32 -08:00
Robert Alan Chapton
e287ad47d1 updating github actions
hope this works
2021-11-08 18:54:46 -08:00
nossr50
8eee39b88b mcMMO now requires the latest MC version (currently 1.17.1)
Fixed a few bugs from API breaks
2021-11-08 18:38:50 -08:00
nossr50
4bf2ad46ea Require Java 16 2021-11-08 18:15:33 -08:00
nossr50
def676d8d7 2.1.202 2021-10-05 12:41:25 -07:00
nossr50
f8433cdbcc Fixed Kelp not awarding XP
Fixed #4639 Fixed #4110
2021-10-05 12:39:56 -07:00
nossr50
a2e10dbd0c Azalea trees bone mealed into existence no longer get marked unnatural
Fixes #4640
2021-10-05 11:58:31 -07:00
nossr50
e55ce00d62 Update changelog 2021-10-05 10:13:07 -07:00
nossr50
73c465ee64 Fixed a bug where mcMMO didn't flag all blocks as natural appropriately
in some StructureGrowEvent(s)
2021-09-28 16:58:40 -07:00
nossr50
c30892a0a5 Add flowering azalea leaves to Tree Feller 2021-09-28 00:09:04 -07:00
nossr50
58e7323c3e Bring adventure-api and adventure-platform (and dependencies) up to date 2021-09-23 12:59:58 -07:00
tunagohan
7fc6577196 Propose: Add an option for Exploiting Fishing. (#4619)
* feat: Add exploiting option for fishing

* Update experience.yml

Let's change how this was named

* Update ExperienceConfig.java

Let's change how this was named

Co-authored-by: Robert Alan Chapton <nossr50@gmail.com>
2021-09-22 15:11:54 -07:00
PikaMug
162c605dac Trigger change event for party create/disband (#4620) 2021-09-22 15:05:41 -07:00
rosaage
280eb0ba51 Added support for allowPublicKeyRetrieval=true in the JDBC launch (#4635)
options for MySQL

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
2021-09-22 15:03:03 -07:00
GhostDC
8e5251ba66 update locale_zh_CN.properties (#4628) 2021-09-22 15:00:03 -07:00
Warrior
1e43e34547 Make /party kick case insensitive (#4630) 2021-09-22 14:59:39 -07:00
nossr50
5575309b79 Add amethyst block to experience.yml for Mining 2021-08-15 21:59:38 -07:00
nossr50
88dae5d5dd dev mode ( 2.1.202 ) 2021-08-10 14:59:13 -07:00
nossr50
da3909c08f 2.1.201 2021-08-10 14:44:13 -07:00
nossr50
6cad4993ed Tweaked Rupture's visual/audio effect 2021-08-10 14:42:08 -07:00
nossr50
af6e6b9545 Update changelog 2021-08-10 14:21:16 -07:00
emanondev
cd937a812d Fix for impact armor damage formula (#4425)
* Update SkillUtils.java

Add handleArmorDurabilityChange() to handle armor damage reduction correctly

* Update AxesManager.java

Changed method to handle impact damage calculation

* Update SkillUtils.java
2021-08-10 14:19:18 -07:00
Griffin Kubesa
264c0e2c78 Add /<skill> keep (#4512)
* Add /<skill> keep

* Add keep to tab completion

* Case insensitive
2021-08-10 14:17:37 -07:00
David
b42278932e Update locale_pt_BR.properties (#4566) 2021-08-10 14:15:56 -07:00
蘭蘭露 Flandre_tw
7fc7125ed3 Reupload new Chinese Traditional translation (#4584)
Hello, I have completed the Chinese Traditional translation. :)
2021-08-10 14:14:45 -07:00
nossr50
d3f012de27 Update changelog 2021-08-10 14:14:07 -07:00
Griffin Kubesa
dfa16c70a7 Set TNT source in blast mining (#4580)
* Set TNT source in blast mining

* Compatibility with older versions

Co-authored-by: TheBusyBiscuit <TheBusyBiscuit@users.noreply.github.com>

Co-authored-by: TheBusyBiscuit <TheBusyBiscuit@users.noreply.github.com>
2021-08-10 14:13:25 -07:00
GhostDC
8805a25d85 update locale_zh_CN.properties (#4585)
Thank you
2021-08-10 14:09:32 -07:00
nossr50
f91a2217c8 Fixed plugin incompatibility and exploits regarding buffed tools remaining buffed
Fixes #4616
2021-08-10 14:04:59 -07:00
nossr50
64f1ae4af6 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2021-08-10 13:47:55 -07:00
nossr50
6d9a9d165d Blast Mining shouldn't drop Budding Amethyst
Fixes #4589
2021-08-10 13:46:33 -07:00
nossr50
5edc0d065d Add aliases to inspect command (mcinspect, mmoinspect) 2021-08-06 21:54:28 -07:00
Diablolend
a346fc3338 Fixed in every line of "\ \ " characters (#4588)
Where did they come from? 🤔
2021-07-29 15:16:07 -07:00
nossr50
dc94fedee1 Added member getPlayer to McMMOItemSpawnEvent
Fixes #4572
2021-07-20 18:47:25 -07:00
nossr50
93a6a73b4e Revert Woodcutting translation forortuguese
Fixes #4568
2021-07-20 18:32:34 -07:00
TheBusyBiscuit
2c849d9cb4 Added a Unit Test for mc version detection (#4560)
* Added a Unit Test for mc version detection

* Merge upstream and update server software string
2021-07-05 16:02:46 -07:00
nossr50
b79d452a6d 2.1.200 2021-07-01 21:02:59 -07:00
nossr50
fb94374e3c Update changelog 2021-07-01 16:14:13 -07:00
TheBusyBiscuit
5255ae846d Fixed #4556 (#4559) 2021-07-01 16:11:22 -07:00
stepech
e816310da8 Fix mcmmo picking wrong version on builds withou patch number (#4555)
* Fix server versioning

* Switch to regex when getting server version

* add comment

* Poor beginner mistakes

Co-authored-by: TheBusyBiscuit <TheBusyBiscuit@users.noreply.github.com>

Co-authored-by: TheBusyBiscuit <TheBusyBiscuit@users.noreply.github.com>
2021-07-01 16:07:44 -07:00
nossr50
de6ba4fb6a Dodge no longer triggers while blocking
Fixes #4543
2021-06-22 14:59:40 -07:00
TheBusyBiscuit
e35bfe758c Update to Junit5 and allow for mcMMO to be compiled on Java 16 (#4552)
* Updated all unit tests to Junit5 and removed Powermock

* Some formatting

* I did not mean to commit this file

* Fixed file ending

* We don't need these extra dependencies

* Replaced delegate with Junit5 assertThrows

* Revert this change

* Re-add mockito-core

* A bit more refactoring

* Update surefire and remove failsafe

* Updated Mockito

* Add failsafe back

* Bump Mockito to 3.11.2

They literally just released that.
2021-06-21 09:21:55 -07:00
nossr50
fffbacd239 2.1.199 2021-06-15 14:30:16 -07:00
nossr50
f286af3fff update changelog 2021-06-15 14:25:02 -07:00
nossr50
7e28799f94 Fix SQL on 1.17 (hacky) and optimized CompatibilityManager 2021-06-15 14:19:30 -07:00
nossr50
78dc56d263 Update Deepslate Lapis Ore on MaterialMapStore 2021-06-11 14:47:11 -07:00
nossr50
e3dfdfc6ee Fixed Deesplate Lapis Ore not being recognized 2021-06-11 14:46:27 -07:00
nossr50
4819a45be9 2.1.198 2021-06-11 14:26:28 -07:00
nossr50
5e0f8a334d Update changelog 2021-06-11 14:23:24 -07:00
nossr50
5f0cc2b09a Fix Smelting not recognizing the new 1.17 smeltables (like raw ores) 2021-06-11 14:22:33 -07:00
nossr50
6ff37c8baa Update changelog 2021-06-11 09:10:43 -07:00
TheBusyBiscuit
f7dc72359b Bump adventure to 4.8.0 (#4546) 2021-06-11 09:09:47 -07:00
nossr50
1ab5b82b22 2.1.198 dev mode 2021-06-11 09:08:22 -07:00
nossr50
28c6c90f23 2.1.197 2021-06-06 21:00:27 -07:00
nossr50
9bb38e3193 Add more 1.17 blocks 2021-06-06 20:59:43 -07:00
nossr50
551fac84a5 Add Glow Berries to Farmer's Diet 2021-06-06 20:56:14 -07:00
nossr50
0bc25b263b Add support for Glow Berries / Cave Vines 2021-06-06 20:52:27 -07:00
nossr50
fa9a3ae766 Add support for Glow Lichen 2021-06-06 20:44:33 -07:00
nossr50
33df92ea3a Add tuff to super breaker 2021-06-06 20:42:07 -07:00
nossr50
c3d86ba6c5 Add support for Tuff 2021-06-06 20:41:59 -07:00
nossr50
b569b9456e Add support for Mossy Block and Azalea Leaves 2021-06-06 20:37:51 -07:00
nossr50
4e6e58d9ca Add more support for 1.17 (mining related) 2021-06-06 11:18:03 -07:00
nossr50
619eec7667 Add new 'raw' ores to experience values and bonus drops 2021-06-03 14:34:36 -07:00
nossr50
97cfb1cfc7 More 1.17 support 2021-06-03 14:23:19 -07:00
nossr50
c28c8d164a Adding more 1.17 support 2021-06-03 14:20:00 -07:00
nossr50
e74e1e6829 Add Amethyst related blocks to experience.yml and update Super Breaker 2021-06-03 14:04:08 -07:00
nossr50
6dbc7adf48 Add glow_squid, goat, and axolotl to experience.yml 2021-06-03 13:44:56 -07:00
nossr50
cbaef4a092 Update changelog 2021-05-31 09:09:45 -07:00
lexikiq
eb10bcbc96 Disable launching from Minecart Anti-AFK (#4508) 2021-05-31 09:08:06 -07:00
nossr50
2875545fa4 Update pt_BR locale 2021-05-31 08:55:10 -07:00
nossr50
be595f2568 Update changelog 2021-05-31 08:37:07 -07:00
snake
882f6197c6 Update locale_ja_JP.propaties (#4529)
* Update locale_ja_JP.propaties

* Escape non-ASCII characters
2021-05-31 08:34:18 -07:00
nossr50
0d2f370185 Update our dependencies to their latest versions (where possibly)
Also adds Guava as a dependency as version upgrading our dependencies resulted in the loss of the included Guava libraries
2021-04-23 15:08:57 -07:00
nossr50
da1fcfe30a 2.1.196 2021-04-23 11:26:35 -07:00
nossr50
f983f95961 Remove explosion from rupture, and rupture bug fixes and other tweaks 2021-04-23 11:13:59 -07:00
nossr50
d67c561fed Update changelog 2021-04-23 10:46:59 -07:00
nossr50
989f7fd51b Fix Serrated Strikes not processing Rupture for additional targets 2021-04-23 10:45:19 -07:00
nossr50
e4b8b74987 Optimize imports 2021-04-23 10:37:22 -07:00
nossr50
9e7bb12dc3 Also avoid issues in this test by mocking instead of implementing an ever changing interface 2021-04-23 10:34:00 -07:00
nossr50
95c291d630 Avoid the pitfalls of implementing an everchanging interface from a SNAPSHOT 2021-04-23 10:30:26 -07:00
nossr50
9b4070d971 Don't process null McMMOPlayer events
Fixes #4499
2021-04-23 10:20:20 -07:00
lexikiq
6d0fe4fb58 Add McMMOEntityDamageByRuptureEvent (#4498) 2021-04-20 14:51:57 -07:00
nossr50
394e9e5110 Update changelog 2021-04-19 12:45:51 -07:00
nossr50
5416d1b36e Add crossbows to enchantable items list 2021-04-19 12:43:21 -07:00
nossr50
9a4ec456ad 2.1.195 2021-04-19 12:26:15 -07:00
nossr50
71edf0e9f4 Update changelog 2021-04-19 12:22:25 -07:00
nossr50
c8b1a17194 this should fix null connection error with MySQL
Fixes #4497
2021-04-19 12:20:15 -07:00
nossr50
77a7b98659 Dev mode 2021-04-19 12:15:00 -07:00
nossr50
aa562a4710 2.1.194 2021-04-18 17:52:45 -07:00
nossr50
317f966f73 Fix comment
Fixes #4496
2021-04-18 17:31:20 -07:00
nossr50
a844f27093 Fix mistakes 2021-04-18 17:28:27 -07:00
nossr50
2c44590c52 world bounds tweak 2021-04-18 17:21:37 -07:00
nossr50
16f79b9fbc Locale override now uses a specific file instead of weird name matching 2021-04-16 13:50:41 -07:00
nossr50
c29f311f1e More proper fix 2021-04-16 12:24:02 -07:00
nossr50
81a3441d62 2.1.193 2021-04-16 10:07:36 -07:00
nossr50
cfe1fd2b26 Update changelog 2021-04-16 10:07:02 -07:00
nossr50
3d5c8e154a Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2021-04-16 10:06:42 -07:00
Mich3l3k
fee2b93b4b Update locale_pl.properties (#4486)
* Update locale_pl.properties

Lots of minor bugs fixed and the woodcut has a better translated name (as well as the ability to woodcut etc.)
And all guides have been translated :D

* Update locale_pl.properties

Guides.Salvage.* translated
Fixed few mistakes
And added support to the latest version of plugin (like swords update)
2021-04-16 10:06:30 -07:00
nossr50
76ebd85afa Update changelog 2021-04-16 10:05:21 -07:00
Warrior
7393421607 Some patches (#4494)
Fixed blocks being dropped from blast mining even if yield was set to 0.
Tree feller not working entirely if one fake block break event is cancelled. (Fixes #4189)
Fixes no woodcutting xp being rewarded if a tree is too big while using tree feller.
2021-04-16 10:03:57 -07:00
nossr50
04459f1ea7 Fix leaderboards & fix override locale bug
Fixes #4493 Fixes #4492
2021-04-16 09:55:44 -07:00
nossr50
8027b4741e 2.1.192 2021-04-15 14:48:54 -07:00
nossr50
8fdc611fb0 Add some code to a test to check for user names being updated 2021-04-15 14:48:24 -07:00
nossr50
48de5057a4 Fix another bug where usernames can be saved as null for FlatFileDB 2021-04-15 14:43:37 -07:00
nossr50
1269652e94 Dev mode 2021-04-15 11:59:27 -07:00
nossr50
522f40f0fe 2.1.191 2021-04-15 11:54:05 -07:00
nossr50
e42eeb1dc4 Fix FlatFile leaderboards not working in certain situations + added leaderboards unit test 2021-04-15 11:53:23 -07:00
nossr50
4f5f3aff80 Oops 2021-04-15 10:43:48 -07:00
nossr50
b9201b89b8 Fix block tracking logic 2021-04-15 09:38:30 -07:00
nossr50
f2357a04ae 2.1.190 2021-04-14 18:15:10 -07:00
nossr50
c9b0383600 Fix null error in BitSetChunkStore 2021-04-14 18:14:50 -07:00
nossr50
729a91443a 2.1.189 2021-04-14 16:50:06 -07:00
nossr50
bb57e6d464 actually a radius now.. although not really 2021-04-14 16:38:19 -07:00
nossr50
700a7f4d35 Fix ArrayIndexOutOfBounds for certain events due to spigot API bug
Fixes #4488
2021-04-14 16:34:43 -07:00
nossr50
22b24b4774 JUnit 5 time 2021-04-13 17:25:56 -07:00
nossr50
d9e195f63a Add a newUser test 2021-04-13 15:22:21 -07:00
nossr50
e6239936d2 Add lastlogin tests 2021-04-13 13:40:24 -07:00
nossr50
f7339277f8 Add more tests, fix null name bug 2021-04-13 12:41:23 -07:00
nossr50
5b4af3f9ce Add loadFromFile test 2021-04-12 16:59:35 -07:00
nossr50
9f22cef175 More tests 2021-04-12 13:18:41 -07:00
nossr50
85f3221a60 FlatFileDataProcessor will handle fixing and repairing the data 2021-04-12 12:55:31 -07:00
nossr50
60013c710b Add more tests to FlatFileDatabaseManagerTest 2021-04-12 09:33:43 -07:00
nossr50
aca1d6c0b1 Add test to find duplicate names - FlatFileDatabaseManagerTest 2021-04-12 09:02:50 -07:00
nossr50
834ccc946a FlatFileDatabaseManager refactor + adding tests part 1 2021-04-09 16:45:58 -07:00
nossr50
323f496420 Fix infinite loop 2021-04-09 11:15:07 -07:00
nossr50
be44c0e417 Update SkillTools 2021-04-09 11:13:27 -07:00
nossr50
cfdcc9dee5 Shorten notes 2021-04-09 10:48:08 -07:00
nossr50
29613bc324 Add back and deprecate most of the members of PrimarySkillType 2021-04-09 10:46:12 -07:00
nossr50
c1c32cb1fd Fix mcMMO saving copies of config files into the main server directory instead of the correct place 2021-04-09 10:19:34 -07:00
Anseba
6d057c577e Fixed minor mistakes in locale_de.properties (#4484)
* Update locale_de.properties
2021-04-09 09:37:21 -07:00
lexikiq
e7978a6ad9 Fix deaths from skeletons showing health bars (#4483)
* Fix deaths from skeletons showing health bars

* Ignore human attackers
2021-04-09 07:59:42 -07:00
nossr50
56f9341f8e Add mcMMO_Region_System.Enabled to persistent_data.yml (removed from hidden config) 2021-04-09 07:54:34 -07:00
nossr50
e76fb9ab1b Update changelog 2021-04-08 13:36:18 -07:00
nossr50
ccf5f30011 Add a test to FlatFileDatabaseManagerTest (more to come) 2021-04-08 13:31:07 -07:00
nossr50
483d23c04d Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2021-04-08 13:26:36 -07:00
nossr50
611705bce1 Update changelog 2021-04-08 13:26:22 -07:00
lexikiq
80aac93fd2 Fix death messages losing formatting (#4482) 2021-04-08 13:25:24 -07:00
nossr50
74d0d2c3f9 Comment these out for now 2021-04-08 13:22:46 -07:00
nossr50
241df06707 Don't need this anymore 2021-04-08 13:22:20 -07:00
nossr50
eec5feb2bf PrimarySkillType refactor and other refactors 2021-04-08 13:21:34 -07:00
nossr50
5080d86e44 Refactoring code part 1 to prep for adding a bunch of unit tests 2021-04-08 10:39:07 -07:00
nossr50
0636f578dd Update changelog 2021-04-07 16:16:04 -07:00
Mich3l3k
6336101992 Update locale_pl.properties (#4470)
You're welcome :D
I will translate Guides soon
2021-04-07 16:10:50 -07:00
nossr50
ef48fbee89 dev mode + update changelog 2021-04-06 15:01:51 -07:00
nossr50
10d9aa14f1 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2021-04-06 14:49:05 -07:00
nossr50
44c820089c remove UP warning 2021-04-06 14:48:53 -07:00
TheSummerGrinch
c526208da4 Various improvements to grammar and consistency. (#4479) 2021-04-05 15:50:14 -07:00
nossr50
eb8af69605 Update changelog 2021-04-05 13:56:16 -07:00
nossr50
2db7d83216 2.1.188 2021-04-05 13:50:59 -07:00
nossr50
4c237b2e9c Tweak UP msg, remove debug msg about unused keys 2021-04-05 13:50:27 -07:00
nossr50
2d11b7befc Fixed treasures only requiring level 0 2021-04-05 13:41:37 -07:00
nossr50
c5f4666525 Fixing Shake showing the wrong chance to succeed 2021-04-05 12:47:03 -07:00
nossr50
3b7f416ed9 Up default ShakeChance and remove useless entries 2021-04-05 12:39:49 -07:00
nossr50
db55635f0d Tweak UP warning 2021-04-04 18:23:13 -07:00
nossr50
fe713c9931 dev mode 2021-04-03 09:53:34 -07:00
nossr50
716272fefc 2.1.187 2021-04-03 09:46:41 -07:00
nossr50
e8577e4a9e Fix ClassCastException for Rupture
Fixes #4476
2021-04-03 09:46:01 -07:00
nossr50
3e60dfcf98 2.1.186 2021-04-02 20:37:05 -07:00
nossr50
d25784bf41 Give XP when sneaking for bushes 2021-04-02 20:33:48 -07:00
nossr50
a2ee4be86a Fix some bugs with Rupture and fix a small memory leak 2021-04-02 20:31:19 -07:00
TheBusyBiscuit
002887e244 Sanitize ability buffs when using Item Frames (#4475)
* Remove skill ability buffs from items when placed into Item Frames

* Ensure compatibility on versions before 1.16
2021-04-02 18:47:43 -07:00
nossr50
48afb81174 Another locale tweak 2021-04-02 12:16:40 -07:00
nossr50
a58a3d91dc tweak locale / command output 2021-04-02 12:13:54 -07:00
nossr50
affecfeeeb Added config options for Rupture and updated the Swords command 2021-04-02 12:02:21 -07:00
nossr50
48bf79055a Rupture has been reworked 2021-04-02 11:00:11 -07:00
nossr50
0cb3d91f0e dev mode 2021-04-02 08:55:04 -07:00
nossr50
1e91ba156d 2.1.185 2021-04-02 08:33:09 -07:00
nossr50
72958bb0f3 Herbalism XP exploit fix 2021-04-02 08:32:56 -07:00
nossr50
0ae83420e6 2.1.184 2021-03-31 15:53:21 -07:00
nossr50
a2ba406fe5 Removed April Fools event 2021-03-31 15:14:00 -07:00
nossr50
f01efd92f5 Correct bad default config files 2021-03-31 15:06:59 -07:00
nossr50
a3cc520005 Correct key for drop level in default file 2021-03-31 14:59:29 -07:00
nossr50
0d955c3a94 2.1.183 2021-03-30 16:11:26 -07:00
nossr50
aa734c8b1a Acrobatics XP from falling no longer requires the Roll subskill 2021-03-30 16:04:33 -07:00
nossr50
0577701fd7 Tweak mmoinfo 2021-03-30 15:54:25 -07:00
nossr50
6b309f628a Roll will not have an mmoinfo read out for now 2021-03-30 15:43:05 -07:00
nossr50
fdefea3235 treasures.yml now has specific entries for Standard/Retro 2021-03-30 15:37:01 -07:00
nossr50
ae538d8c72 Sweet berry bush exploit fix 2021-03-29 16:09:47 -07:00
nossr50
50eadb2e8d Merge branch 'master' of https://github.com/mcMMO-Dev/mcMMO 2021-03-29 15:24:10 -07:00
nossr50
f69c678f6c Update changelog 2021-03-29 15:23:48 -07:00
mldriscoll
d98bcea845 Correcting references to the Potion of Leaping being made with Red Mushrooms (#4290)
Co-authored-by: MLD <kuali@cethial.net>
Co-authored-by: Robert Alan Chapton <nossr50@gmail.com>
2021-03-29 15:22:24 -07:00
nossr50
fbd2eeb93d Avoid NPE on beast lore jump strength checks 2021-03-29 15:14:54 -07:00
nossr50
c27b8dbd66 Update changelog 2021-03-29 15:11:08 -07:00
Daniel Jarski
df56d93aaa Added Donkeys and Mules to the list of animals that display stats (#4282)
...in Beast Lore. I improperly assumed that donkeys and mules have fixed jump and movement speeds, but ones that are *bred* have variable stats just like horses.
2021-03-29 15:08:40 -07:00
Daniil Z
80e9111f78 Update Russian localization (#4465) 2021-03-29 15:02:48 -07:00
nossr50
b189614d8d 2.1.182 2021-03-25 14:51:28 -07:00
nossr50
7c8e14fd74 Featherboard compatibility 2021-03-25 14:49:36 -07:00
nossr50
fc3e580550 Fix NPE with Scoreboards when updating 2021-03-25 14:13:16 -07:00
nossr50
eea922c31f TODO: Look into double drops for berry bushes 2021-03-25 14:08:22 -07:00
nossr50
e40ab38bbd Sweet Berry bushes now grant XP when harvested and no longer activate tools 2021-03-25 13:42:20 -07:00
nossr50
2c5e11138b Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2021-03-23 13:21:16 -07:00
nossr50
317dc814a4 Add comment about power level cap issue 2021-03-23 13:20:55 -07:00
Pablo
f52effb0fb Add '.all' to all existing perk xp multipliers (#4460)
* Add '.all' to all existing perk xp multipliers 

Added '.all' usage for all existing perk xp mulipliers to enable use of mcmmo.perks.xp.<xpboost>.all

* Fixed a statement error
2021-03-22 13:13:51 -07:00
nossr50
71d1f42cf4 Tweak changelog 2021-03-18 15:28:42 -07:00
nossr50
49f1154e65 NPE fix for McMMOPlayerExperienceEvent 2021-03-18 15:15:43 -07:00
nossr50
4f08c69557 Add UltraPermission warning to mcMMO 2021-03-18 13:18:30 -07:00
nossr50
13a2d03444 Remove silent exceptions 2021-03-18 13:11:03 -07:00
nossr50
c7a8d74963 Add customboost 'mcmmo.perks.xp.customboost.all' perk permission node 2021-03-17 10:39:05 -07:00
nossr50
076d7a7f87 Remove hardcore and vampirism commands 2021-03-17 10:03:54 -07:00
nossr50
667b9a2226 Remove ChatControlRed warning pending further proof of bug 2021-03-17 09:59:18 -07:00
nossr50
312206eda5 Tweak save debug messages 2021-03-16 16:43:25 -07:00
nossr50
dc2c099231 Add warning about the plugin conflict between mcMMO and ChatControlRed 2021-03-16 16:36:16 -07:00
nossr50
49d4e97930 Some safety redundancy 2021-03-16 14:05:33 -07:00
nossr50
444d5edd66 Fixed double smelt not working if furnace was empty 2021-03-16 13:16:17 -07:00
nossr50
b181fb4568 Update changelog 2021-03-16 13:12:45 -07:00
w1tcherrr
06990c858e Fixed mistakes in german locale file (#4454)
* Fixed mistakes

* Update src/main/resources/locale/locale_de.properties

Co-authored-by: TheBusyBiscuit <TheBusyBiscuit@users.noreply.github.com>

* Update src/main/resources/locale/locale_de.properties

Co-authored-by: TheBusyBiscuit <TheBusyBiscuit@users.noreply.github.com>

* More Fixes

Co-authored-by: TheBusyBiscuit <TheBusyBiscuit@users.noreply.github.com>
2021-03-16 13:03:53 -07:00
nossr50
6cec253243 2.1.181 2021-03-12 17:07:14 -08:00
nossr50
75db0af01d More console spam reduction for database operations 2021-03-12 16:37:21 -08:00
nossr50
4a048b47cb Refactor DB code a bit and fix console spam when using the Plan plugin
Fixes #4450
2021-03-12 16:25:14 -08:00
nossr50
7d5bcf3ebf 2.1.180 2021-03-11 15:11:03 -08:00
nossr50
0979ef555b More tweaks to data recovery messages 2021-03-11 14:59:11 -08:00
nossr50
91204262f5 More tweaks to handling corrupt data for flat file 2021-03-11 14:48:21 -08:00
nossr50
eb1e657af1 Simplify data validation + listen to exceptions again 2021-03-11 14:10:29 -08:00
nossr50
2203d61c10 More safety against corrupt data when loading data for FlatFile 2021-03-11 13:11:11 -08:00
nossr50
d77c8c88a3 Less spammy corrupt data reporting 2021-03-11 12:16:33 -08:00
nossr50
7755875dbf Some refactoring of FlatFileDatabaseManager 2021-03-11 12:02:21 -08:00
nossr50
72116d809b Add another error message if mcMMO finds something unexpected in the database 2021-03-11 12:00:11 -08:00
nossr50
e95b7f72a7 Add some safety measures to loading a user from FlatFile 2021-03-11 11:58:27 -08:00
nossr50
e8a0e6e4a4 Don't upgrade old party DB schema from 8 years ago (band-aid fix, real fix coming later) 2021-03-09 19:47:35 -08:00
nossr50
6c69cd2aea Fixed several SQL bugs + SQL db is now fully UTF-8 compatible 2021-03-09 15:10:00 -08:00
nossr50
f4976e5ecb switch SQL from latin1 to utf8mb4 2021-03-09 13:56:03 -08:00
TheBusyBiscuit
4402484d47 Fixed NoClassDefFoundError caused by latest Adventure-platform snapshot. (#4446)
* Bumped adventure versions

* Added Unit Test to ensure Adventure being set up correctly
2021-03-09 08:15:11 -08:00
nossr50
935ab22477 2.1.179 2021-03-07 14:33:22 -08:00
nossr50
f9097087fe Fixed a bug where player levels were wiped on FlatFile database if players changed nicknames 2021-03-07 14:28:47 -08:00
nossr50
8e5f2b804b dev mode 2021-03-07 14:20:40 -08:00
nossr50
12d0a220da 2.1.178 2021-03-05 20:14:48 -08:00
nossr50
89c368e481 changelog tweaks 2021-03-05 15:39:23 -08:00
nossr50
5e35a65fbf 2.1.177 2021-03-05 15:17:41 -08:00
nossr50
92efd59760 Better compatibility with other fishing plugins
Fixes #4428
2021-03-05 15:13:14 -08:00
nossr50
31076e6ba9 Change PlayerFishEvent priority to HIGH instead of HIGHEST 2021-03-05 14:54:11 -08:00
nossr50
b59d1afdb4 Vanished players are treated as if they are offline for inspect command
Fixed #4444
2021-03-05 14:48:05 -08:00
nossr50
72264205d0 Update player names immediately when change is detected 2021-03-05 14:27:53 -08:00
nossr50
a425ebcd10 Add magma blocks to the things wolves avoid 2021-03-05 14:03:31 -08:00
nossr50
5baccd626f 2.1.176 - Small hotfix before bringing down endgame 2021-03-04 15:17:48 -08:00
Riley Park
37610f76ce Deploy to repository 2021-03-03 21:56:44 -08:00
nossr50
4bd9ee0aa5 Never expect bukkit API to be intuitive 2021-03-02 15:17:55 -08:00
nossr50
e38bc14e86 Sometimes I hate being dyslexic, fixing illegal stack sizes in smelting.. again 2021-03-02 13:54:20 -08:00
nossr50
afd2b50900 Remove unecessary comment 2021-03-02 11:24:44 -08:00
nossr50
ac618cf48a Add another measure to stop item stacks from becoming illegal sizes from double smelt 2021-03-02 11:15:52 -08:00
nossr50
4eecd34494 2.1.175 - Hotfix 2021-02-26 17:48:20 -08:00
nossr50
713b0619c3 You can now disable Green Thumb for specific crops (the auto replanting) in config.yml 2021-02-26 16:18:15 -08:00
nossr50
735a90fb35 Fix arrow dupe bug
Fixes #4430
2021-02-26 16:06:13 -08:00
nossr50
82b0304091 Don't set smelt stacks to above item's max stack size 2021-02-26 15:28:50 -08:00
TheBusyBiscuit
06e38c991a Updated dependencies (also fixes #4404) (#4440) 2021-02-24 18:03:07 -08:00
w1tcherrr
ef1a8f8194 Updated locale_de.properties language file (german) (#4423)
* Fixed various grammatical and spelling mistakes. Made some adjustments to the colour scheme to make the design more consistent.

* Changed mistakes in UTF-8 encoding
2021-02-23 12:29:24 -08:00
TheBusyBiscuit
db2c0e89e7 Fixed #4438 and also normalized some stuff (#4439) 2021-02-23 12:28:45 -08:00
TheBusyBiscuit
b8932802b7 Added Maven workflow to validate pull requests and commits (#4432)
* Create maven workflow

* Also run it when the workflow file was modified

* Added local Maven cache

* I know how to count 👀
2021-02-18 09:58:25 -08:00
t00thpick1
f9144e624a Prepare for negative Y values 2021-02-12 17:18:52 -05:00
nossr50
085c8dbf68 Dev mode 2021-02-03 15:19:34 -08:00
nossr50
890d270147 2.1.174 2021-02-03 15:14:18 -08:00
nossr50
369b34406e Green Thumb (Plants) now fires a SubSkillBlockEvent 2021-02-03 15:08:21 -08:00
nossr50
1c1abe9a2a Added SubSkillBlockEvent & GreenThumb + ShroomThumb now fire it 2021-02-03 15:01:32 -08:00
nossr50
2b4c84b1e8 Update changelog 2021-02-03 14:47:33 -08:00
Daniil
6eb894ba3a Update locale_ru.properties (#4411)
Almost fully re-translated and updated to latest versions
2021-02-02 14:58:13 -08:00
Elikill58
6ef0a36cb0 Translate missing messages into french (#4418) 2021-02-02 14:57:05 -08:00
nossr50
e63ce103a2 changelog adjustments 2021-01-26 16:56:02 -08:00
nossr50
68c7de16a8 Really should rewrite this whole thing at a later date 2021-01-26 16:00:08 -08:00
nossr50
9a5b1406b3 dev mode 2021-01-26 15:55:48 -08:00
András Marczinkó
e584697b69 Update locale_hu_HU.properties (#4409) 2021-01-26 15:53:57 -08:00
snake
46d69f2108 Replace old and wrong color codes with the correct color codes (#4408) 2021-01-26 15:53:30 -08:00
nossr50
998495f268 2.1.173 2021-01-25 17:27:37 -08:00
nossr50
b94b14a06c Add missing adventure-key library 2021-01-25 17:23:46 -08:00
nossr50
d9740bdfb8 kyori dependency 4.3.0 to 4.4.0 2021-01-25 15:09:51 -08:00
nossr50
85bf33fca0 Less XP orbs during Tree Feller + Knock on Wood Rank 2 2021-01-25 15:06:39 -08:00
nossr50
cf21a5a163 Fishing no longer damages rod or drains hunger 2021-01-25 15:02:58 -08:00
nossr50
ec35efbf1b Merge remote-tracking branch 'origin/master' 2021-01-25 14:38:06 -08:00
nossr50
c6d700c5a7 Fixed Luck permission showing incorrect percentages to players using commands
Fixed #4405
2021-01-25 14:37:23 -08:00
steve4744
a225d604ef only add/remove scoreboards when teleporting if scoreboards are enabled (#4400) 2021-01-25 14:14:35 -08:00
snake
52ac1cc522 Update ja_jp locale (#4406) 2021-01-25 14:12:57 -08:00
nossr50
bf9bb6ffd8 2.1.172 2021-01-21 15:38:31 -08:00
nossr50
27ae7ae1a7 Add Power Level broadcasts
Fixes #4388
2021-01-21 15:27:50 -08:00
nossr50
a85fd024b2 Have correct bStats data point to a new id 2021-01-21 15:00:42 -08:00
nossr50
6e63007068 Update changelog 2021-01-21 14:58:29 -08:00
nossr50
6c5eb72ab4 Fixed an error in bstats where Retro Mode was reported as Standard mode and vice versa
I might be the most dyslexic person ever
2021-01-21 14:56:45 -08:00
TheBusyBiscuit
67f29d52b3 Updated bStats (#4384)
Thank you
2021-01-21 14:54:51 -08:00
nossr50
8181743114 Fix compile issue 2021-01-21 14:44:13 -08:00
nossr50
f43f3a7fb1 Make ACF aware of the permission nodes for the commands it handles
Fixes #4396
2021-01-21 14:37:59 -08:00
nossr50
4b4643f510 Message about missing permissions on certain commands no longer hard coded 2021-01-21 14:34:58 -08:00
nossr50
1b5dd86796 Use locale instead of hard coded message for pending load on certain commands
Fixes #4391
2021-01-21 14:33:39 -08:00
nossr50
80a1b3949e Add permission node 'mcmmo.broadcast.levelup' for level up broadcasts 2021-01-21 14:31:11 -08:00
nossr50
4fea5438fe Move some permissions closer to the top 2021-01-21 14:26:08 -08:00
nossr50
ac57615383 Add setting to turn off knock on wood XP orb drops for Tree Feller 2021-01-21 14:19:50 -08:00
nossr50
c44e280773 oh wait cat was not really his nickname... 2021-01-21 14:08:14 -08:00
nossr50
2835c5fc5e update changelog 2021-01-21 14:07:58 -08:00
Shane Freeder
bd9794e744 Support calling SkillActivationPerkEvent off the main thread
This event was never considered as to if it would be called off the main thread,
this event should NOT be designed to signify that a skill activation is occuring,
just providing a means to manipulate those values by other plugins, etc
2021-01-21 12:09:26 +00:00
nossr50
f72497532f Fists should be fists 2021-01-11 10:34:14 -08:00
TheBusyBiscuit
fecaef8d96 Updated german translations (#4375)
* Updated german translations

* Fixed line endings

* Missed one
2021-01-11 10:30:08 -08:00
nossr50
cbbfcf655a 2.1.171 2021-01-07 13:48:15 -08:00
nossr50
c64e693861 Less capitals in broadcast msg 2021-01-07 13:39:28 -08:00
nossr50
ade6fb2c1d Arrow dupe fix 2021-01-07 13:36:54 -08:00
nossr50
f38d92497a Add broadcasting when players reach certain level milestones (defaults to every 100 levels) 2021-01-07 13:33:12 -08:00
nossr50
801c2c83e2 update pom and changelog 2021-01-06 10:25:58 -08:00
Enderaoe
3cd09b886f Issue #4343 Axe can replant Cocoa (#4373) 2021-01-06 10:24:16 -08:00
nossr50
ba7b6826b4 2.1.170 - papi fix 2021-01-05 15:25:39 -08:00
nossr50
0b8f4b4733 2.1.169 2021-01-05 12:20:33 -08:00
nossr50
1c9592aba3 Always emulate lure bonus to avoid vanilla bugs
Fixes #4359
2021-01-05 12:16:16 -08:00
nossr50
7bc01571ee Fix mctop on non-en_US locale
Fixes #4372
2021-01-05 12:13:44 -08:00
nossr50
dd07bcafc6 Disable random testing for now 2021-01-05 12:12:49 -08:00
nossr50
888205fd89 Memory leak fix for arrow metadata 2021-01-05 12:04:48 -08:00
nossr50
7ea6809fd3 2.1.168 2021-01-03 12:22:58 -08:00
nossr50
7931a095fe Add some tests for com.gmail.nossr50.util.random classes 2021-01-03 12:21:32 -08:00
nossr50
867d222062 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2021-01-03 09:53:12 -08:00
t00thpick1
a57e6d3bbe Add unit test for BlockLocationHistory
Move ChunkStoreTest to correct package
2021-01-02 20:53:25 -05:00
t00thpick1
9e2d5aada8 Whitespace fix 2021-01-02 20:39:39 -05:00
t00thpick1
4aa17e61fc More efficient acrobatics location memory class 2021-01-02 20:39:39 -05:00
nossr50
597eb7f8dd Tweaks to the random chance classes 2021-01-02 16:39:26 -08:00
nossr50
4fa3d913bf More annotations for blockmeta.. again 2021-01-02 16:15:04 -08:00
t00thpick1
00a6d52717 Refactor region file loading for better nullability analysis 2021-01-02 18:57:51 -05:00
nossr50
26ef4cc411 More nullability annotations 2021-01-02 15:55:37 -08:00
nossr50
05f07c174b Change readChunkStore to Nullable 2021-01-02 15:30:00 -08:00
nossr50
eff016c0a6 More nullability in blockmeta classes 2021-01-02 15:27:51 -08:00
nossr50
7ea3a2bf07 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2021-01-02 15:01:35 -08:00
nossr50
cddf619518 dev mode 2021-01-02 15:01:29 -08:00
t00thpick1
5b41b04777 Use @NotNull in methods rather than @Nullable
Separate safe external methods from internal only methods
Remove unnecessary methods
2021-01-02 17:29:15 -05:00
t00thpick1
10694042e9 Move legacy Serializable usage into a subclass. 2021-01-02 16:54:11 -05:00
nossr50
d08c9391b0 Add nullability annotations to blockmeta 2021-01-02 13:36:59 -08:00
nossr50
a39c7420b9 Add relocation for Kyori's examination library 2021-01-02 13:32:30 -08:00
t00thpick1
e0d85f842b Fix exception thrown when plants fake grow at max world height. 2021-01-02 11:18:32 -05:00
nossr50
0fa1d822d4 2.1.167 2021-01-01 22:16:52 -08:00
nossr50
bec54d93ac Fix dupe bug 2021-01-01 22:15:44 -08:00
Shane Freeder
1408065768 update changelog 2021-01-02 01:07:15 +00:00
Shane Freeder
67a4b6c7c1 Experience PreGain event 2021-01-02 01:05:28 +00:00
Shane Freeder
556515eefd Add SkillActivationPerkEvent 2021-01-02 01:05:27 +00:00
nossr50
0466a28a5f Update changelog 2021-01-01 14:08:52 -08:00
nossr50
9180879164 2.1.166 2021-01-01 14:06:15 -08:00
nossr50
fbecbc167a Optimizations and potentially fixing a ConcurrentModificationException involving the TransientEntityTracker
Fixes #4368
2021-01-01 14:04:36 -08:00
nossr50
959d1e4a05 Remove music discs from the default loot table 2021-01-01 12:46:08 -08:00
nossr50
0d4e1b3ba6 update changes 2020-12-31 17:13:56 -08:00
nossr50
a8d81a2080 2.1.165 2020-12-31 17:02:38 -08:00
nossr50
42d3dc3925 Master Angler now mentions it works better with a boat in its hover tip 2020-12-31 16:58:46 -08:00
nossr50
e4af53a535 Use boolean over Boolean 2020-12-31 16:46:49 -08:00
nossr50
9ba8af9f6e Forgot to register the intended tool set 2020-12-31 16:42:37 -08:00
nossr50
56b376eb54 SuperBreaker will always activate if the fastest tool for the block is a PickAxe
Fixes #4362
2020-12-31 16:41:08 -08:00
nossr50
c408c7d057 avoid concurrent exceptions on TransientEntityTracker 2020-12-31 16:26:37 -08:00
nossr50
c05c8e1b1d Fix init player in TransientyEntityTracker 2020-12-31 16:08:23 -08:00
nossr50
3f6de1c4ba Fix giving double treasures if the setting to give extra fish is on
Fixes #4363
2020-12-31 15:53:01 -08:00
nossr50
8ee405fbfd Ignore "fake player" npcs in EntityPickupItemEvent 2020-12-31 15:49:32 -08:00
nossr50
2664ae4bd6 Optimize ChunkUnloadEvent & Partial rewrite to COTW entity tracking + some tweaks to COTW entity removal 2020-12-31 15:25:21 -08:00
nossr50
aed4cb87be Fix enchanted books not being created with the proper data 2020-12-31 13:21:55 -08:00
nossr50
006a7bf277 Add back missing cooldown locale message
Fixes #4361
2020-12-30 15:41:14 -08:00
nossr50
d0d05a33f8 update changelog 2020-12-30 15:30:46 -08:00
nossr50
01f31e76f5 new chunkstore
Co-authored-by: t00thpick1 <t00thpick1dirko@gmail.com>
2020-12-30 15:24:21 -08:00
nossr50
7802d54ebd 2.1.164
Closes #4358 #4342 #3812 #3643 #3540
2020-12-29 13:47:40 -08:00
nossr50
dd3d324415 update notes and default fishing treasures 2020-12-29 13:38:03 -08:00
nossr50
8ff345af38 fix array out of bounds 2020-12-29 13:20:10 -08:00
nossr50
bab13f32e7 update notes 2020-12-29 13:15:15 -08:00
nossr50
3c9c8556dd Allow vanilla block interaction with sneak if the block is set to be a mcMMO repair/salvage anvil 2020-12-29 12:58:39 -08:00
nossr50
d9f98b1aa9 Fix a bug where books weren't registered + tweaked how treasures were loaded 2020-12-29 12:39:06 -08:00
nossr50
0f4455d5a8 remove unused settings from fishing treasures and add enchantment section for mythic 2020-12-29 12:12:03 -08:00
nossr50
bdee0278a5 Fix Fishing using values from the wrong config 2020-12-29 12:03:57 -08:00
nossr50
ac31a3dc0e Fixing start up errors when loading treasures.yml 2020-12-28 17:37:14 -08:00
nossr50
2162c81b21 Add semi-important note to changelog 2020-12-28 17:00:50 -08:00
nossr50
8b62c0b693 Better message for items not found in current version of MC from Fishing Config 2020-12-28 16:58:57 -08:00
nossr50
31e0f1e4da less verbose enchantment book log 2020-12-28 16:47:33 -08:00
nossr50
14a6e5c603 Comment out whitelist in fishing_treasures.yml 2020-12-28 16:45:16 -08:00
nossr50
652a9519c1 Move fishing treasues to new file fishing_treasures.yml, replace Records rarity with Mythic, and allow for Enchanted_Book in the treasures list with new optional whitelist/blacklist parameters
read the changelog for information about this
2020-12-28 16:42:00 -08:00
nossr50
31134b38de updated changelog 2020-12-28 13:00:47 -08:00
nossr50
a4ef322fa5 Add ExploitFix.PreventPluginNPCInteraction to experience.yml
Read the changelog for why
2020-12-28 12:58:03 -08:00
nossr50
e8d51f42f3 dev mode 2020-12-28 12:44:21 -08:00
nossr50
4d386f2e61 update changelog 2020-12-16 16:43:08 -08:00
nossr50
1046007b7a 2.1.163 2020-12-16 16:41:24 -08:00
nossr50
2de52c7955 register new chunk listener 2020-12-16 16:30:05 -08:00
nossr50
8c52884ac6 Remove COTW entities on chunk unload
Fixes #4289
2020-12-16 16:29:05 -08:00
nossr50
22a738bace mcMMO no longer throws errors on below 0 xp gains
Fixes #4346
2020-12-16 16:15:19 -08:00
nossr50
dfc2691cd6 dev mode and changelog update 2020-12-16 15:55:54 -08:00
Robert Alan Chapton
16aa6d65ac Update McMMOUrl.java
fixed translate link, thanks chew
2020-12-16 12:46:17 -08:00
nossr50
58e634e53a dev mode 2020-12-14 15:22:09 -08:00
nossr50
bb37edaa7f update changelog 2020-12-14 15:21:48 -08:00
Wolf2323
0e09ac397d fix BrewingStand inventory is updated immediately instead of after firing the event. Now the event can be canceled correct. (#4351) 2020-12-10 13:24:08 -08:00
nossr50
c4072ee90d 2.1.161 - Messages fixed! 2020-12-09 19:58:20 -08:00
nossr50
b7cf84299a add missing adventure modules 2020-12-09 19:51:57 -08:00
nossr50
439a69cc5b normalize pom 2020-12-09 19:16:58 -08:00
nossr50
a114886454 2.1.160 2020-12-09 15:36:54 -08:00
nossr50
7f213ee305 exploit fix 2020-12-09 15:34:32 -08:00
nossr50
958fb6f044 Silenced a mostly harmless error that can happen when using plugins like crazyenchantments 2020-12-01 13:08:33 -08:00
nossr50
dacd846fe7 2.1.159 2020-11-27 16:59:37 -08:00
nossr50
0ce316e428 update adventure (used for chat) 2020-11-27 16:55:40 -08:00
nossr50
bcd260d9c1 Memory leak fix 2020-11-27 16:26:24 -08:00
nossr50
ab276ffe33 2.1.158 2020-11-16 16:55:55 -08:00
nossr50
c54161b7d1 update changes 2020-11-16 16:49:49 -08:00
nossr50
cf86e79e87 Updated changelog 2020-11-16 16:24:27 -08:00
nossr50
bc53714ac8 URL style adjust 2020-11-16 16:00:01 -08:00
nossr50
db8086d6ad Allow URLs in chat again 2020-11-16 14:56:48 -08:00
nossr50
915855363d Update changelog 2020-11-16 14:43:53 -08:00
Momshroom
c22a65f9f3 Adding crossbows, shields, elytra, and tridents to default repair.vanilla.yml and fixing minor typo. (#4308)
* Changed comment over netherite items to say "Netherite repairables" instead of "Diamond repairables"
Added Crossbow to string repairables
Added Shield to wood repairables, with oak planks as material
Added Elytra and Trident to Other repairables, using phantom membrane and prismarine crystals respectively.

* Changed comment over netherite items to say "Netherite repairables" instead of "Diamond repairables"
Added Crossbow to string repairables
Added Shield to wood repairables, with oak planks as material
Added Elytra and Trident to Other repairables, using phantom membrane and prismarine crystals respectively.
Added warped fungus on a stick as a string repairable.

Signed-off-by: Momshroom <Momshroom@gmail.com>

* Added warped fungus on a stick as a string repairable.

Signed-off-by: Momshroom <Momshroom@gmail.com>
2020-11-16 14:42:24 -08:00
nossr50
128ba88e64 Update changelog 2020-11-16 14:39:33 -08:00
Tim
4fd8f6d647 Update locale_nl.properties (#4336)
Fixed small translation errors
2020-11-16 14:39:07 -08:00
nossr50
cfcdcd1676 Fix Lure above 3 breaking fishing 2020-11-16 14:36:59 -08:00
nossr50
f346d3b758 2.1.157 2020-11-11 16:50:21 -08:00
nossr50
477d6932cd 2.1.156 2020-11-10 15:21:45 -08:00
nossr50
b31e1e533b New skill 'Knock On Wood', changes to axe readying messages 2020-11-10 15:17:52 -08:00
nossr50
8f6819edc5 Fix GT replant sometimes planting floating plants 2020-11-10 13:17:58 -08:00
nossr50
7887232d93 Update locales 2020-11-10 12:19:23 -08:00
nossr50
b0afdccfa5 skillranks.yml will automatically fix itself if it finds certain issues 2020-11-10 12:05:42 -08:00
nossr50
592851e80b Throw errors for child skill leaderboard requests 2020-11-10 11:22:02 -08:00
nossr50
c9b950d0c8 Fix chat.yml chat channel toggles 2020-11-10 11:07:07 -08:00
nossr50
d9e99b08db changelog stuff 2020-11-09 16:56:02 -08:00
nossr50
06334da7f8 2.1.155 2020-11-09 16:47:34 -08:00
nossr50
ba7e235e64 Master Angler reworked 2020-11-09 16:46:52 -08:00
nossr50
f4f6abd9d5 Fix Spec Arrow awarding too much XP 2020-11-09 13:54:01 -08:00
nossr50
da06d5c075 Fixed a bug where Spectral arrow awarded too much XP 2020-11-09 13:53:17 -08:00
nossr50
34d9f70ac0 Fixed a bug where party members didn't have properly colored names, added some optimization and removed some unnecessary API 2020-11-09 13:19:54 -08:00
nossr50
8c5123f494 2.1.154 2020-11-06 15:16:52 -08:00
nossr50
4abf64f625 Full hex color support in admin/party chat 2020-11-06 15:16:26 -08:00
nossr50
1383457eba Update javadocs 2020-11-06 14:16:24 -08:00
nossr50
bd48680125 Use legacy serializer instead 2020-11-06 14:13:46 -08:00
nossr50
0f15f234b5 Update changelog 2020-11-06 14:05:40 -08:00
nossr50
5b6a57d7a8 Tree Feller drops saplings again 2020-11-06 14:04:40 -08:00
nossr50
a4fd632d53 Fix Hex-Colored names in parties/admin chat 2020-11-06 14:01:07 -08:00
nossr50
b2cdffe965 2.1.153 2020-11-04 12:14:55 -08:00
nossr50
15578bb84e Some refactoring 2020-11-04 12:12:51 -08:00
nossr50
329de942b4 Update changelog 2020-11-04 12:06:30 -08:00
nossr50
96ed228d7c Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2020-11-04 12:05:45 -08:00
nossr50
cb9c7acceb Fixing a major bug with sub-skills not being shown when using commands 2020-11-04 12:05:29 -08:00
Vlammar
95c9daebe1 Update locale_fr.properties (#4324)
Fixed a small translation error
2020-11-04 09:59:56 -08:00
nossr50
5afaeb40a8 2.1.152 2020-11-02 15:12:29 -08:00
nossr50
1f3a2baa6b Some BlockMultiPlaceEvent optimization 2020-11-02 14:10:17 -08:00
nossr50
094d57bce0 more changelog tweaks 2020-11-02 14:06:02 -08:00
nossr50
28b6a457f2 Add back the pc and ac command aliases 2020-11-02 14:03:58 -08:00
nossr50
a945e2e6b3 update changelog 2020-11-02 14:01:45 -08:00
TheBusyBiscuit
01ebba4443 Two small fixes (#4321)
* Fixed armor counting in BleedTimerTask

* Key instead of Name for Piercing
2020-11-02 13:57:53 -08:00
nossr50
65fba3e20e Expanding McMMOItemSpawnEvent & Fixing a bug with Tree Feller drops 2020-11-02 13:51:43 -08:00
András Marczinkó
9529bbf898 Update locale_hu_HU.properties (#4322)
* Update locale_hu_HU.properties
2020-11-02 11:56:24 -08:00
nossr50
523d10ef29 dev mode 2.1.152-snapshot 2020-11-02 11:30:35 -08:00
nossr50
bae9783123 2.1.151 2020-10-29 14:38:09 -07:00
nossr50
5a8e607a39 party leader has unique chat style 2020-10-29 14:30:29 -07:00
nossr50
1f02d9a5a0 online leaders will be gold 2020-10-29 14:13:39 -07:00
nossr50
4e8f49db5b avoid null party names 2020-10-29 14:06:34 -07:00
nossr50
c6ecf30d1f new party member list format/style 2020-10-29 13:54:12 -07:00
nossr50
449407439a Added 'Chat.Channels.Party.Spies.Automatically_Enable_Spying' which allows chat spys to join servers with spying toggled on instead of off
its a QOL feature for people who are always spying on chat
2020-10-29 13:12:26 -07:00
nossr50
8856d2b071 move chat config options from config.yml -> chat.yml 2020-10-29 13:06:22 -07:00
nossr50
4bac586253 Add missing party chat permission check to the party chat command 2020-10-29 12:20:52 -07:00
nossr50
ca93dc02df Fix missing party chat permission node check 2020-10-28 10:53:47 -07:00
nossr50
8aff138954 import cleanup 2020-10-27 13:37:08 -07:00
nossr50
81bf0935e1 changelog tweaks 2020-10-27 13:35:01 -07:00
nossr50
3169cf9225 2.1.150 2020-10-27 13:19:00 -07:00
nossr50
2f506b72bb Better party chat logging in console, some style changes to admin/party chat as well 2020-10-27 13:09:01 -07:00
nossr50
d183d1217c Players & Console can now use color codes in party or admin chat (new permission node mcmmo.chat.colors) 2020-10-27 11:55:59 -07:00
nossr50
1d55c4c2bc fix message spam bug 2020-10-27 11:08:50 -07:00
nossr50
05f2763311 You can now silence mmoedit, addlevels, and addxp with -s 2020-10-27 11:03:47 -07:00
nossr50
33287b650f Add NMS definition for 1.16.4 2020-10-26 16:52:43 -07:00
nossr50
e6e9fdca31 Fix ArrayIndexOutOfBoundsException for Skill Reset command 2020-10-26 16:42:56 -07:00
nossr50
8372fae6f8 remove some unwanted code comments 2020-10-26 16:34:31 -07:00
nossr50
f976302cf0 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2020-10-26 16:33:15 -07:00
nossr50
749c83ac59 Complete rewrite of Admin & Party chat code
There are some API breaks as a result of these rewrites, I tried to keep it minimal, but I'm sure some plugins will need to update.
2020-10-26 16:31:02 -07:00
nossr50
cf6a2e9e97 Update all locale files to use & codes instead of [[color]] codes 2020-10-26 16:04:56 -07:00
TheBusyBiscuit
8240cff0d5 Some small optimizations (#4305)
some improvements to itemmeta calls and misc changes
2020-10-23 08:21:47 -07:00
怠惰
7e057792f5 Fix locale (#4275)
"1 is needed" is obvious mistranslation.
2020-10-22 13:56:36 -07:00
Patrick
5f0c4b1dd3 Update locale_pt_BR.properties (#4276)
add time left to use the skill again
2020-10-22 13:55:48 -07:00
nossr50
8c21891e6f Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2020-10-14 12:14:44 -07:00
nossr50
23f836de40 dev mode + changelog update 2020-10-14 12:14:32 -07:00
TheBusyBiscuit
f29370a1c8 Added Fake Event check (#4296)
Thanks you @TheBusyBiscuit
2020-10-14 12:11:15 -07:00
nossr50
8d6d0cf254 Spelling mistake in changelog 2020-10-13 13:22:36 -07:00
nossr50
e90f8f5b82 Slightly more readable changelog 2020-10-12 13:06:57 -07:00
nossr50
72feacfdfe update changelog 2020-10-12 13:01:53 -07:00
nossr50
508c256aa4 2.1.149 2020-10-12 12:57:15 -07:00
nossr50
bc71f586d7 Messy fix for now, code cleanup will happen later 2020-10-12 12:50:18 -07:00
nossr50
29722511b7 new config persistentdata.yml 2020-10-12 12:40:54 -07:00
nossr50
916eb76553 2.1.148 2020-10-08 19:30:36 -07:00
nossr50
80f910fc67 Add setting for enable/disable triple drops on super breaker 2020-10-08 19:21:39 -07:00
nossr50
d4699c0e20 Add player tamed experience multiplier 2020-10-08 19:14:44 -07:00
nossr50
80c89fe1e5 Revert this change for now 2020-10-08 19:07:42 -07:00
nossr50
f5294387b0 oopsy 2020-10-08 16:34:59 -07:00
nossr50
20c69b63af Memory leak fixes, optimizations, and persistence 2020-10-08 15:25:40 -07:00
nossr50
0767e62965 Only ignore 0 dmg if specific plugins are detected 2020-10-05 14:52:49 -07:00
nossr50
a6586e07cc final damage values of 0 are only ignored in certain circumstances, fixes a few bugs 2020-10-05 14:14:49 -07:00
nossr50
5d022b6f7c adding new and required kyori includes 2020-10-02 13:09:38 -07:00
nossr50
ee17707c6c Alchemy progression through ranks improved 2020-09-30 13:12:28 -07:00
nossr50
c675c36601 adventure api update 2020-09-30 11:34:01 -07:00
nossr50
4005c21810 2.1.147 2020-09-28 17:36:33 -07:00
nossr50
8451f84083 dev mode 2020-09-25 11:36:42 -07:00
nossr50
adbcf11c15 2.1.146 2020-09-25 11:01:47 -07:00
nossr50
6f99940540 Add missing includes 2020-09-25 10:40:26 -07:00
Riley Park
02fe8addb7 adventure 2020-09-24 17:57:04 -07:00
nossr50
0b20fc2c16 Some tweaks to tracking blocks as unnatural 2020-09-21 21:36:24 -07:00
nossr50
3fd5cd03ee Blocks that have double drops enabled are also worth marking 2020-09-21 21:29:21 -07:00
nossr50
959a74b139 Temporarily mark debarked wood as unnatural (will undo later) 2020-09-21 21:27:17 -07:00
nossr50
f496d795fb Always track blocks in BlockMultiPlaceEvent 2020-09-21 21:23:10 -07:00
nossr50
d4ab829812 Mark blocks always in BlockPlaceEvent 2020-09-21 21:20:53 -07:00
nossr50
3badc26806 Hardcore mode won't bring players below level threshold anymore 2020-09-16 20:09:59 -07:00
nossr50
621ccfed34 minor nms tweak 2020-09-08 19:38:35 -07:00
nossr50
2810d36e08 2.1.145 2020-08-26 10:45:53 -07:00
nossr50
973279cdb7 Revert listener behaviour for PlayerInteractEvent 2020-08-26 10:26:50 -07:00
nossr50
480f9afa80 2.1.144 2020-08-25 16:49:50 -07:00
nossr50
419a810a1e Steel Arm Style can now be customized in advanced.yml 2020-08-25 16:28:21 -07:00
nossr50
e4c5a3b8ee two deflect bugs down 2020-08-25 16:14:08 -07:00
nossr50
56abad5360 Fixed a bug where Roll didn't award XP at great heights 2020-08-25 14:53:06 -07:00
nossr50
bfa092a67c add fuel efficiency info for mmodebug 2020-08-25 14:33:31 -07:00
nossr50
e3f21195c8 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2020-08-25 14:13:06 -07:00
nossr50
f684b09276 brain no worky today 2020-08-25 14:11:43 -07:00
nossr50
8807d6c216 Fixed a taming NPE 2020-08-25 14:11:26 -07:00
nossr50
b0e8fedf6f Fixed a taming NPE 2020-08-25 14:10:53 -07:00
András Marczinkó
b35c58ec21 Update locale_hu_HU.properties (#4264) 2020-08-20 12:46:09 -07:00
nossr50
b8a38bf975 small tweak 2020-08-18 21:16:48 -07:00
nossr50
500ab628dd 2.1.143 2020-08-18 21:11:15 -07:00
nossr50
1feee7f312 1.13.2 fix round 3.. or 4 2020-08-18 20:38:56 -07:00
nossr50
7ea9ec5c2f Another 1.13.2 fix 2020-08-18 20:28:09 -07:00
nossr50
e5f1738168 1.13.2 related bugfixes for the new item tracking 2020-08-18 20:28:02 -07:00
nossr50
557cfe3944 Some bugfixes to the new ability tool tracking 2020-08-18 19:47:15 -07:00
nossr50
a7ded7e982 super boosted items are now tracked differently 2020-08-18 18:41:31 -07:00
nossr50
59f52f6e7e 2.1.142 2020-08-17 23:36:47 -07:00
nossr50
c6b2cba007 Reworked Iron Arm Style into Steel Arm Style which scales over 20 ranks 2020-08-17 23:32:13 -07:00
Frank van der Heijden
dca2661ccb Don't set double drop if result is already a full stack (#4263)
Thanks, merging because I can't think of anything bad that would result from this change.
2020-08-17 14:21:09 -07:00
nossr50
a2f2614b10 2.1.141 2020-08-11 16:13:28 -07:00
nossr50
e890d4bae6 2.1.140 2020-08-08 21:16:06 -07:00
nossr50
3a035e234a Scoreboards fixes 2020-08-08 15:56:53 -07:00
nossr50
771ed9a8b4 oopsie 2020-08-07 11:50:44 -07:00
nossr50
d6ff1348eb Polish locale woodcutting rename 2020-08-07 11:49:12 -07:00
nossr50
8df15a4e55 dev mode 2020-08-06 19:01:36 -07:00
nossr50
4a4fd9fb75 2.1.139 2020-08-06 18:50:24 -07:00
emanondev
38017cabe7 fixed /mmoinfo roll (#4088)
* acrobatics roll mmoinfo fixes

LocaleLoader#getString() accepts Object arrays no need to call getStats twice

Max skill level is now configurable and so halfMaxSkillValue is now a variable which should be used on locale too instead of "50"

* Updated locale_it

Acrobatics.SubSkill.Roll.Mechanics supports half level variable instead of static level 50

* Updated locale_en_US

Acrobatics.SubSkill.Roll.Mechanics supports half level variable instead of static level 50

* Updated Locale it

fixed value
2020-08-06 18:46:12 -07:00
Flannery Lue Moore
375292c0b3 PR for gilded blackstone and nether gold ore to the mining skill, and nether gold ore to the smelting skill. (#4253)
* Added gilded blackstone and nether gold ore.

* Added nether gold ore to smelting xp.
2020-08-06 15:22:48 -07:00
t00thpick1
01f111f78d Switch to countdown latch so we don't need to bother with synchronization blocks. Fixes #4248 2020-08-02 12:56:27 -04:00
nossr50
d1b7e88b7e Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2020-07-31 20:47:01 -07:00
nossr50
c85ca2e2ca Dev mode 2020-07-31 20:46:52 -07:00
Robert Alan Chapton
7828437414 Merge pull request #4235 from kn-km/patch-1
Fix McMMOPlayerSalvageCheckEvent Handling
2020-07-31 20:43:44 -07:00
Robert Alan Chapton
0dba450b5a Merge pull request #4236 from kn-km/patch-2
Fix McMMOPlayerRepairCheckEvent Handling
2020-07-31 20:43:01 -07:00
nossr50
d490f4fd60 2.1.138 2020-07-30 16:28:47 -07:00
nossr50
a05c015732 Fix Netherite not working for certain skills (like Skull Splitter) 2020-07-30 16:12:50 -07:00
nossr50
9f9518eea0 2.1.137 - avoid npe on armor iterating 2020-07-30 13:05:19 -07:00
nossr50
9266a54fce debug tweaks 2020-07-30 11:17:08 -07:00
nossr50
270298c265 2.1.136 2020-07-29 07:41:47 -07:00
nossr50
38122d8f17 Furnace ownership tweaks 2020-07-28 21:56:51 -07:00
nossr50
274a41f530 update changelog 2020-07-27 21:39:26 -07:00
nossr50
8e3d203594 only cleanup furnaces without a job 2020-07-27 21:34:47 -07:00
nossr50
4169dceca8 debug tweak for furnaces 2020-07-27 21:20:03 -07:00
nossr50
567a5461e1 Add some more mmodebug related to furnaces 2020-07-27 21:19:25 -07:00
Robert Alan Chapton
70c934fa69 Merge pull request #4233 from SrBedrock/patch-1
Update CommandRegistrationManager.java
2020-07-27 20:26:26 -07:00
kn-km
ed9521d4a0 Fix #4234 2020-07-27 23:18:55 +08:00
kn-km
5d294d6dc3 Fix #4234 2020-07-27 22:55:44 +08:00
srbedrock
2eb924d433 Update CommandRegistrationManager.java 2020-07-26 22:04:43 -03:00
srbedrock
c97dc4181d Update CommandRegistrationManager.java 2020-07-26 22:01:30 -03:00
nossr50
a28d1cd537 2.1.135 2020-07-25 14:27:31 -07:00
Robert Alan Chapton
65a95addb9 Merge pull request #4230 from Ineusia/AbilityNotificatioons
Add option to disable other-player ability notifications
2020-07-25 14:26:08 -07:00
Robert Alan Chapton
81b31e49b8 Merge pull request #4231 from Ineusia/issue-4221
Use localized names for SuperAbility names
2020-07-25 14:25:36 -07:00
Ineusia
353fb80957 Use localized names for SuperAbility names 2020-07-25 12:13:54 -05:00
Ineusia
5298472c90 Add option to disable other-player ability notifications 2020-07-25 11:10:01 -05:00
nossr50
36af6d2478 update changes 2020-07-25 08:40:20 -07:00
Robert Alan Chapton
1df2225aa2 Merge pull request #4229 from Ineusia/issue-4224
Handle Fishing Event even if FishingExploitFix is set to false
2020-07-25 08:38:04 -07:00
nossr50
3ae1b5e987 Don't simulate block breaks when assigning furnace ownership 2020-07-25 08:37:19 -07:00
Ineusia
054c023330 Handle Fishing Event even if FishingExploitFix is set to false 2020-07-25 10:36:34 -05:00
nossr50
2910240942 2.1.134 2020-07-23 21:16:58 -07:00
nossr50
3ed0bd6be4 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2020-07-23 20:59:56 -07:00
nossr50
35cde870ff Reworked a lot of stuff to do with Smelting 2020-07-23 20:59:34 -07:00
Robert Alan Chapton
efcb2d0c14 Merge pull request #4226 from Durburz/master
Fix brewing stand not consuming items
2020-07-22 13:39:41 -07:00
Ulrich Fink
16d7b51497 Fix brewing stand not consuming items
Fixes #4225
Negation in commit fdd951f1f1 is faulty.
2020-07-21 22:49:32 +02:00
nossr50
f6c7049cac Furnaces can now change owners during server lifespan for Smelting XP 2020-07-13 13:16:47 -07:00
nossr50
fdd951f1f1 Second Smelt makes use of its own section in Bonus Drops in config.yml
Co-authored-by: t00thpick1 <t00thpick1dirko@gmail.com>
2020-07-13 12:31:30 -07:00
nossr50
7eae59a0b3 Misc code fixes 2020-07-13 11:39:03 -07:00
nossr50
428c093ae4 UUID updater changes + locale fixes
Co-authored-by: t00thpick1 <t00thpick1dirko@gmail.com>
2020-07-13 11:18:16 -07:00
nossr50
ded7fd5bdf Potion NPE fix 2020-07-13 10:53:36 -07:00
nossr50
1d1736481c Dev mode 2020-07-13 10:19:04 -07:00
nossr50
c918f2b72f 2.1.133 2020-07-13 07:43:03 -07:00
nossr50
7eef87b2e0 Turn off unused NMS compatibility layers 2020-07-13 07:39:16 -07:00
Robert Alan Chapton
7258b0995d Merge pull request #4118 from JLLeitschuh/fix/JLL/use_https_to_resolve_dependencies
[SECURITY] Use HTTPS to resolve dependencies in Maven Build
2020-07-13 07:31:28 -07:00
nossr50
235fb937a2 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2020-07-13 07:29:07 -07:00
nossr50
039eb0ee9e Fix array out of bounds 2020-07-13 07:28:50 -07:00
Robert Alan Chapton
99f12fe0ed Merge pull request #4195 from Draycia/master
Don't ready hand when player can't use skill
2020-07-13 07:27:33 -07:00
Robert Alan Chapton
2dfd7fd5a4 Merge pull request #4220 from FrankHeijden/fix/deathmessages
Update regex to also match colorless healthbar instances
2020-07-13 07:26:04 -07:00
Frank van der Heijden
7f1944b61d Update regex to also match colorless healthbar instances 2020-07-13 15:33:22 +02:00
Robert Alan Chapton
d83e296401 Merge pull request #4219 from Elikill58/master
Update translation to french
2020-07-09 21:01:25 -07:00
Elikill58
59552f42d7 Update french translation - end of translation 2020-07-09 23:48:19 +02:00
Elikill58
005f8c5478 Update french translation - begin with skills 2020-07-07 15:50:47 +02:00
nossr50
919907f46a 2.1.132 2020-07-03 16:02:26 -07:00
nossr50
7267b1501b Why did I use contains() :thonk: 2020-07-03 13:16:17 -07:00
nossr50
f05c4121d2 Temporary Spigot bug fix 2020-07-03 13:14:33 -07:00
nossr50
2fc1ba44d8 Oopsie 2020-07-02 21:06:19 -07:00
nossr50
900a534edb Inventory NPE fix 2020-07-02 21:04:06 -07:00
nossr50
ce03e6613f Dev mode 2020-07-02 20:53:57 -07:00
nossr50
254e1a1071 2.1.131 2020-06-30 11:51:46 -07:00
nossr50
75f404f387 Wire missing NMS 2020-06-30 11:35:36 -07:00
nossr50
420477149e Add Piglin Brute XP 2020-06-30 11:15:10 -07:00
nossr50
6d6efa3442 add to changelog 2020-06-30 10:05:35 -07:00
nossr50
78eb367b86 Repair / Salvage fixes 2020-06-30 10:03:37 -07:00
nossr50
b0ce6fb170 Missing permission nodes + missing repair XP 2020-06-30 09:35:47 -07:00
nossr50
4638f22ade Missing 1.16 bonus drop entries 2020-06-30 09:17:48 -07:00
nossr50
6dd5510cd8 dev mode 2020-06-30 07:27:52 -07:00
nossr50
ed69f843aa 2.1.130 2020-06-26 15:04:03 -07:00
nossr50
6b340838ee Use the correct default repair material for netherite gear 2020-06-26 15:00:52 -07:00
nossr50
cf78b51052 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO 2020-06-26 14:45:52 -07:00
nossr50
dab255254c Automatic spelling mistake correction on repair/salvage configs for
previously misspelled netherite materials
2020-06-26 14:45:26 -07:00
nossr50
83617b73b7 Fix repair 2020-06-24 23:39:14 -07:00
Robert Alan Chapton
fba24fd910 Merge pull request #4202 from darbyjack/treefeller-changes
Implemented PlayerItemDamageEvent on TreeFeller
2020-06-22 15:32:35 -07:00
darbyjack
dd011c94c6 Implemented PlayerItemDamageEvent on TreeFeller 2020-06-22 17:10:29 -05:00
nossr50
c84c428fde dev mode 2020-06-22 03:31:00 -07:00
nossr50
7ba65499fe 2.1.129 2020-06-22 03:21:30 -07:00
nossr50
36d0df1c54 Add Redstone Dust to bonus drops 2020-06-22 03:01:28 -07:00
nossr50
41139e93f5 Tweak zoglin XP 2020-06-22 02:49:52 -07:00
nossr50
382a9a77a7 Add Bone Block mining xp 2020-06-22 02:49:26 -07:00
nossr50
c37a8e10d5 Add zoglin XP 2020-06-22 02:45:29 -07:00
nossr50
795b1ffff5 Ignore soul campfires when activating abilities 2020-06-22 02:32:45 -07:00
nossr50
369251fb6b Add shroomlight to herbalism XP tables 2020-06-22 02:30:46 -07:00
nossr50
3fe0b44ce8 Add respawn anchors to blacklist 2020-06-22 02:28:56 -07:00
nossr50
c60fbf1761 Add lodestone to ability / tool blacklists 2020-06-22 02:25:41 -07:00
nossr50
0a26f7122a Add hyphae to woodcutting xp 2020-06-22 02:23:29 -07:00
nossr50
2f650a4789 Tweak gilded blackstone XP 2020-06-22 02:19:23 -07:00
nossr50
4460d3df67 Add gilded blackstone XP 2020-06-20 22:21:27 -07:00
nossr50
d874b2df39 Add crying obsidian XP 2020-06-20 22:19:29 -07:00
nossr50
1f26d8e054 Add chiseled nether brick XP 2020-06-20 21:54:31 -07:00
nossr50
4025fd94cb Add cracked nether brick xp 2020-06-20 21:51:55 -07:00
nossr50
a159368a3d Add chain XP 2020-06-20 21:06:57 -07:00
nossr50
4b80303928 Add blackstone to mining XP 2020-06-20 21:01:49 -07:00
Draycia
23cf9edf9c Don't handle activation when player can't use skill 2020-05-27 01:17:10 -07:00
nossr50
899a0152ba Add /mmoxpbar disable 2020-05-06 09:19:17 -07:00
nossr50
f584783490 dev mode 2020-05-06 09:04:57 -07:00
nossr50
b63311596b 2.1.128 2020-05-05 20:31:49 -07:00
nossr50
dce9a3b58d More Blast Mining bugfixes 2020-05-05 20:28:37 -07:00
nossr50
ede5b3fd31 Blast Mining debris yield bugfix 2020-05-05 20:15:46 -07:00
nossr50
4a0d6bf2b7 add notes 2020-05-05 19:56:38 -07:00
nossr50
402283806d Database choice is now logged 2020-05-05 19:51:53 -07:00
nossr50
fe2b7a8d61 Add ExperienceAPI::addCombatXP 2020-05-05 19:45:56 -07:00
nossr50
15e4dbfd92 Another oopsie 2020-05-05 19:32:22 -07:00
nossr50
d1116418be whoops 2020-05-05 19:30:26 -07:00
nossr50
9f455f5a0d Fix some locale errors 2020-05-05 19:23:55 -07:00
nossr50
c5ce7bd23b Revert blast mining nerf 2020-05-05 19:19:20 -07:00
nossr50
74f8c2901d Iron Arm Rank 1 Nerf 2020-05-05 19:08:55 -07:00
nossr50
ca3509e509 Dev mode 2020-05-05 19:01:45 -07:00
nossr50
a3612b6ae3 2.1.127 2020-05-01 14:46:57 -07:00
nossr50
d023b89189 Declare p right away 2020-05-01 14:43:48 -07:00
nossr50
7114ff02e5 Fix compile issue 2020-05-01 14:38:58 -07:00
nossr50
7615ff472d Update changelog 2020-05-01 14:32:56 -07:00
Robert Alan Chapton
53c5fb7328 Merge pull request #4152 from FlXME/master
Fix various bugs
2020-05-01 14:29:35 -07:00
Robert Alan Chapton
e4a76e667d Merge pull request #4170 from andris155/patch-1
Update locale_hu_HU.properties
2020-05-01 14:28:33 -07:00
Robert Alan Chapton
f943331e53 Merge pull request #4163 from GwonHeeJun/translate/korean
[UPDATE] XpBar Translation in English to Korean
2020-05-01 14:28:19 -07:00
Robert Alan Chapton
e884b2b7f1 Merge pull request #4173 from Draycia/master
Use logger instead of sysout
2020-04-29 13:17:13 -07:00
draycia
25389429ae Don't use the Logger here 2020-04-29 01:14:55 -07:00
draycia
6c5f438099 Use logger instead of sysout 2020-04-29 01:06:53 -07:00
nossr50
239200a3d2 child skills can have their xp bars turned on 2020-04-28 13:47:33 -07:00
nossr50
e6289a0548 back to work 2020-04-27 19:47:50 -07:00
nossr50
07b838db0f 2.1.126 2020-04-27 19:31:22 -07:00
nossr50
4a7b43c560 update log 2020-04-27 19:15:53 -07:00
nossr50
666729cadc Localize more things 2020-04-27 19:13:24 -07:00
nossr50
92c4ddce87 NPE fix 2020-04-27 19:09:37 -07:00
nossr50
2325c4eb6b New Command mmoxpbar 2020-04-27 19:01:40 -07:00
nossr50
34fe19e35c Less verbose unsupported material warnings 2020-04-27 17:28:27 -07:00
nossr50
145b2432e0 Combat fix 2020-04-27 17:04:01 -07:00
András Marczinkó
9a3b261f07 Update locale_hu_HU.properties 2020-04-26 17:55:01 +02:00
Mads U. Jensen
76536f0a18 Update EntityListener.java (#4169)
Remove debug broadcasts
2020-04-25 18:32:39 +01:00
nossr50
5984230bf3 CompatibilityLayer framework 2020-04-24 20:21:21 -07:00
GwonHeeJun
401e3121e6 [UPDATE] Add Korean translations of phrases that appear during level-up 2020-04-18 03:22:57 +09:00
GwonHeeJun
0897aefbee [UPDATE] Add a phrase translation that appears when you first learn a skill 2020-04-18 03:03:57 +09:00
GwonHeeJun
6f79a43e15 [UPDATE] XpBar Translation in English to Korean
- Changes the top experience bar to Korean for easier use by Korean users
2020-04-18 02:37:57 +09:00
Robert Alan Chapton
f82ad99c82 Merge pull request #4162 from broccolai/master
Check to make sure correct item is being damaged in Fishing exploit prevention
2020-04-16 12:03:48 -07:00
Josh Taylor
4a5bcaa92d Fix fishing exploit prevention 2020-04-16 05:44:26 +01:00
Shane Freeder
3a4de97c9b Always use localized names for skills, vs just non-english 2020-04-14 02:53:44 +01:00
Felix Bergmann
69a4ec80cd Fix resource leak on exception
When an exception is hit in the try statement, the readers will never get closed and leak resources
2020-04-07 10:02:22 +02:00
Felix Bergmann
877ef15374 Close resources in UUIDFetcher
Resource leak by not closing the InputStreamReader
2020-04-07 09:54:57 +02:00
Felix Bergmann
8dc955542d Introduce buffering in HashChunkletManager
Improve the performance by introducing buffering. The current usage of FileInputStream and ObjectInputStream don't use buffering.
2020-04-07 09:45:18 +02:00
Felix Bergmann
bffabb4a05 Fix BlockStoreConversion bug on folder check
If dataDir.exists() is true, dataDir.isDirectory() will always also be true. You probably wanted to check whether it is a folder.
This bug could lead to a critical bug when a file with the name of the folder exists.
2020-04-07 09:27:28 +02:00
Shane Freeder
3c272a3e31 register a valid skill for AprilCommand (Fixes #4147) 2020-04-01 14:41:53 +01:00
Shane Freeder
9c342f24cd Fix NPE from unloaded profiles in HolidayManager 2020-04-01 14:40:29 +01:00
nossr50
e8021e81e6 move namefix to monitor 2020-03-21 20:24:40 -07:00
nossr50
8fc3643803 2.1.125 hotfix 2020-03-20 11:02:25 -07:00
nossr50
296d8ee7c1 nothing to see here Kappa Keepo 2020-03-19 19:04:15 -07:00
nossr50
8d7f1cb595 Fixed not being able to place blocks on top of certain repair/salvage
anvils
2020-03-19 19:00:50 -07:00
nossr50
280889e11a dev time 2020-03-19 17:00:07 -07:00
nossr50
988a8124ca 2.1.124 2020-03-18 19:58:15 -07:00
nossr50
9c0dbf84b7 changelog wording 2020-03-18 19:57:58 -07:00
nossr50
42952dc420 repair/salvage anvils will override vanilla functions of a block 2020-03-18 19:44:27 -07:00
nossr50
5bd45ae970 Add missing mobs to experience tables 2020-03-18 19:23:52 -07:00
nossr50
254a17f026 no one saw that 2020-03-18 19:14:16 -07:00
nossr50
3fdbdcafd6 Add gold nugget to bonus drops 2020-03-18 19:13:56 -07:00
Jonathan Leitschuh
3026dc8a28 Use HTTPS instead of HTTP to resolve dependencies
This fixes a security vulnerability in this project where the `pom.xml`
files were configuring Maven to resolve dependencies over HTTP instead of
HTTPS.

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
2020-02-11 09:13:18 -05:00
1203 changed files with 93370 additions and 79112 deletions

1
.gitattributes vendored
View File

@@ -2,4 +2,3 @@
*.png binary
*.wav binary
p

52
.github/workflows/maven.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
# This workflow automatically tests new commits and pull requests as they come in.
# Note that this does not upload any artifacts, you will need to compile mcMMO manually
# if you wish to create the actual jar.
name: Compile and test
on:
# We run our tests whenever the pom or a source file was touched.
# There is no need to run Maven when only the changelog was touched.
# We may also want to re-run this workflow when the workflow file itself
# was updated too.
push:
paths:
- 'src/**'
- 'pom.xml'
- '.github/workflows/maven.yml'
# Whenever someone submits a new pull request which modified the pom or a source file,
# we want to ensure it compiles successfully and that all tests will pass.
pull_request:
paths:
- 'src/**'
- 'pom.xml'
jobs:
compile:
name: Maven compiler
runs-on: ubuntu-latest
steps:
# 1. Check out the current working tree
- name: Checkout repository
uses: actions/checkout@v4
# 2. Setup Java 17 JDK (Adopt)
- name: Java 17 setup
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-package: jdk
java-version: '17'
# 3. Setup local Maven package cache to speed up building
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# 4. Build via Maven
- name: Build via Maven
run: mvn verify -B --file pom.xml -DdisableXmlReport=true

321
.gitignore vendored
View File

@@ -1,291 +1,58 @@
### NetBeans template
**/nbproject/private/
**/nbproject/Makefile-*.mk
**/nbproject/Package-*.bash
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
### Bash Scripts
# bash stuff
*.sh
!mcmmo-core/src/main/resources/com/gmail/nossr50/locale/doTranslation.sh
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# Eclipse stuff
/.classpath
/.project
/.settings
/dependency-reduced-pom.xml
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
#vs code
/.vscode
# Generated files
.idea/**/contentModel.xml
# Maven Depends
/lib
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# gradle
/.gradle
/mcMMO-core/.gradle
/mcMMO-core/gradle
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# netbeans
/nbproject
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
.idea/modules.xml
.idea/*.iml
.idea/modules
.idea
# we use maven!
/build.xml
# maven
/target
# vim
.*.sw[a-p]
# various other potential build files
/build
/bin
/dist
/manifest.mf
/world
# Mac filesystem dust
*.DS_Store
# intellij
*.iml
*.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
.idea/
# IntelliJ
out/
# Project Stuff
/src/main/resources/mcMMO
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Maven template
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
### Kotlin template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
# Other Libraries
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Eclipse template
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
### Windows template
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
### macOS template
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Linux template
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### Java template
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Gradle template
.gradle
/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
# Atlassian Stuff
/atlassian-ide-plugin.xml
/nulllocale_override.properties

File diff suppressed because it is too large Load Diff

43
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,43 @@
pipeline {
agent any
tools {
jdk 'jdk17'
// If you configured Maven as a Jenkins tool, add:
// maven 'Maven3'
}
options {
timestamps()
disableConcurrentBuilds()
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Build') {
steps {
sh 'mvn -V -B clean package'
}
}
stage('Deploy to Nexus') {
steps {
configFileProvider([configFile(fileId: 'maven-settings-nexus', variable: 'MAVEN_SETTINGS')]) {
sh 'mvn -s "$MAVEN_SETTINGS" -V -B deploy'
}
}
}
}
post {
success {
archiveArtifacts artifacts: 'target/mcMMO.jar', fingerprint: true
}
}
}

View File

@@ -1,40 +1,52 @@
# mcMMO
## The #1 RPG Mod for Minecraft
The #1 RPG Mod for Minecraft
## Website
I'm working on a brand new website for mcMMO
You can check it out here http://www.mcmmo.org
## Useful URLs
Website: http://www.mcmmo.org
Spigot Resource: https://spigot.mcmmo.org
I plan to post links to our new wiki (its still under development), downloads, and dev blogs there.
Polymart Resource: https://polymart.org/product/727/mcmmo
Wiki: https://wiki.mcmmo.org/
## API
If you are using maven, you can add mcMMO API to your plugin by adding it to pom.xml like so...
```
<repository>
<id>neetgames</id>
<url>https://nexus.neetgames.com/repository/maven-releases/</url>
</repository>
```
```
<dependency>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>put-the-version-here</version>
</dependency>
```
### Builds
Currently, you can obtain our builds via the Spigot resource page: http://spigot.mcmmo.org
Currently, you can obtain our builds via Spigot or Polymart:
http://spigot.mcmmo.org
https://polymart.org/resource/mcmmo.727
### Brief Description
The goal of mcMMO is to take core Minecraft game mechanics and expand them into an extensive and quality RPG experience. Everything in mcMMO has been carefully thought out and is constantly being improved upon. Currently, mcMMO adds fourteen unique skills to train and level in. Each of these skills is highly customizable through our configuration files, allowing server admins to tweak mcMMO to best suit the needs of his or her server. Know that the mcMMO team is dedicated to providing an ever-evolving experience, and that we carefully read all feedback and bug reports in order to evaluate and balance the mechanics of mcMMO in every update.
## About the Team
In December 2018, the original author and creator of mcMMO (nossr50) returned and took over the role of project lead once again, to develop and improve mcMMO.
#### Project Lead & Founder
#### Current mcMMO Devs
[![nossr50](http://www.gravatar.com/avatar/f2ee41eedfd645fb4a3a2c8f6cb1b18c.png)](https://github.com/nossr50)
#### mcMMO Devs
[![nossr50](http://www.gravatar.com/avatar/f2ee41eedfd645fb4a3a2c8f6cb1b18c.png)](https://github.com/nossr50)
[![kashike](https://secure.gravatar.com/avatar/b5e86d6d443b957fd5cdee55501f3799.png)](https://github.com/kashike)
[![electronicboy](https://secure.gravatar.com/avatar/44759c38d311ce09596de6a2d5b88036.png)](https://github.com/electronicboy)
#### Classic Maintainer
[![t00thpick1](http://www.gravatar.com/avatar/ee23c7794a0c40120c3474287c7bce06.png)](https://github.com/t00thpick1)
## Former Team Members
### Former Lead & Awesome guy
[![gmcferrin](http://www.gravatar.com/avatar/b64c52daf25d206b27650788b5813b7b.png)](https://github.com/gmcferrin)
### Former team members
[![gmcferrin](http://www.gravatar.com/avatar/b64c52daf25d206b27650788b5813b7b.png)](https://github.com/gmcferrin)
[![kashike](https://secure.gravatar.com/avatar/b5e86d6d443b957fd5cdee55501f3799.png)](https://github.com/kashike)
[![electronicboy](https://secure.gravatar.com/avatar/44759c38d311ce09596de6a2d5b88036.png)](https://github.com/electronicboy)
[![t00thpick1](http://www.gravatar.com/avatar/ee23c7794a0c40120c3474287c7bce06.png)](https://github.com/t00thpick1)
[![bm01](http://www.gravatar.com/avatar/ec8146f5358177f12e9a252271bbc391.png)](https://github.com/bm01)
[![Glitchfinder](http://www.gravatar.com/avatar/5aa4cce22f72ae9c002ecec30f061d00.png)](https://github.com/Glitchfinder)
[![NuclearW](http://www.gravatar.com/avatar/90926bdcf1c8a75918df5ea5fa801ce6.png)](https://github.com/NuclearW)
@@ -43,20 +55,22 @@ In December 2018, the original author and creator of mcMMO (nossr50) returned an
[![riking](https://1.gravatar.com/avatar/aca9f37e569ac3a63929920035a91ba4.png)](https://github.com/riking)
[![TheYeti](https://i.imgur.com/tzFrxdo.png)](https://github.com/TheYeti)
#### Folia Contributors
[<img src="https://github.com/HSGamer.png" width=80 alt="HSGamer">](https://github.com/HSGamer)
[<img src="https://github.com/TechnicallyCoded.png" width=80 alt="TechnicallyCoded">](https://github.com/TechnicallyCoded)
[<img src="https://github.com/Yomamaeatstoes.png" width=80 alt="Yomamaeatstoes">](https://github.com/Yomamaeatstoes)
[<img src="https://github.com/Rockyers.png" width=80 alt="Rockyers">](https://github.com/Rockyers)
## Compiling
mcMMO uses Maven 3 to manage dependencies, packaging, and shading of necessary classes; Maven 3 is required to compile mcMMO.
mcMMO uses Maven to manage dependencies, packaging, and shading of necessary classes; Maven is required to compile mcMMO. It is recommended to always use the latest version of maven.
The typical command used to build mcMMO is: `mvn clean package install`
Required Libraries:
* Spigot
* JUnit
* WorldGuard 7
* bStats Bukkit
The typical command used to build mcMMO is: `mvn clean install`
https://spigot.mcmmo.org for more up to date information.
Resource Page
## Downloads
https://www.spigotmc.org/resources/official-mcmmo-original-author-returns.64348/
https://www.spigotmc.org/resources/official-mcmmo-original-author-returns.64348/
https://polymart.org/resource/mcmmo.727

View File

@@ -1,30 +0,0 @@
subprojects {
apply(plugin = "java-library")
// Java is not explicitly needed, but keeps IJ happy with the tasks block
apply(plugin = "java")
repositories {
mavenLocal()
mavenCentral()
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://repo.spongepowered.org/maven")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots")
maven("https://repo.codemc.org/repository/maven-public")
maven("https://maven.sk89q.com/repo")
maven("https://mvnrepository.com/artifact/org.jetbrains/annotations")
maven("https://repo.aikar.co/content/groups/aikar/")
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
}
tasks {
withType(JavaCompile::class.java) {
options.encoding = "UTF-8"
}
}
configure<JavaPluginConvention> {
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
}
}

View File

@@ -1,5 +0,0 @@
version=2.2.0-SNAPSHOT
group=com.gmail.nossr50.mcMMO
artifactId=mcMMO
name=mcMMO
url=https://github.com/mcMMO-Dev/mcMMO

Binary file not shown.

View File

@@ -1,6 +0,0 @@
#Mon Sep 30 20:08:33 BST 2019
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

188
gradlew vendored
View File

@@ -1,188 +0,0 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

100
gradlew.bat vendored
View File

@@ -1,100 +0,0 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@@ -1,78 +0,0 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
`java-library`
id("com.github.johnrengelman.shadow") version "5.1.0"
}
tasks {
shadowJar {
dependencies {
include(dependency("org.spongepowered:configurate-yaml"))
include(dependency("org.spongepowered:configurate-hocon"))
include(dependency("org.spongepowered:configurate-core"))
include(dependency("org.bstats:bstats-bukkit"))
include(dependency("org.apache.tomcat:tomcat-jdbc"))
include(dependency("org.apache.tomcat:tomcat-juli"))
include(dependency("com.typesafe:config"))
include(dependency("co.aikar:acf-core"))
include(dependency("co.aikar:acf-bukkit"))
include(dependency("net.kyori:text-api"))
include(dependency("net.kyori:text-adapter-bukkit"))
include(dependency("net.kyori:text-serializer-gson"))
exclude(dependency("org.spigotmc:spigot"))
}
relocate("org.apache.commons.logging", "com.gmail.nossr50.commons.logging")
relocate("org.apache.juli", "com.gmail.nossr50.database.tomcat.juli")
relocate("org.apache.tomcat", "com.gmail.nossr50.database.tomcat")
relocate("org.bstats", "com.gmail.nossr50.metrics.bstat")
relocate("co.aikar.commands", "com.gmail.nossr50.aikar.commands")
relocate("co.aikar.locales", "com.gmail.nossr50.aikar.locales")
relocate("co.aikar.table", "com.gmail.nossr50.aikar.table")
relocate("net.jodah.expiringmap", "com.gmail.nossr50.expiringmap")
relocate("net.kyori.text", "com.gmail.nossr50.kyoripowered.text")
mergeServiceFiles()
}
processResources {
filter<ReplaceTokens>("tokens" to mapOf("project.version" to project.version))
filesMatching("**/locales/*") {
}
}
build {
dependsOn(shadowJar)
}
}
tasks.named<ShadowJar>("shadowJar") {
dependencies{
include { true }
}
}
dependencies {
api("org.apache.tomcat:tomcat-jdbc:7.0.52")
api("com.typesafe:config:1.3.2")
api("org.spongepowered:configurate-core:3.7-SNAPSHOT")
api("org.spongepowered:configurate-yaml:3.7-SNAPSHOT")
api("org.spongepowered:configurate-hocon:3.7-SNAPSHOT")
api("co.aikar:acf-core:0.5.0-SNAPSHOT") //Don't change without updating the artifacts for its dependencies (see the other comments)
api("co.aikar:acf-paper:0.5.0-SNAPSHOT") //Don't change without updating the artifacts for its dependencies (see the other comments)
api("net.kyori:text-api:3.0.2")
api("net.kyori:text-serializer-gson:3.0.2")
api("net.kyori:text-adapter-bukkit:3.0.4-SNAPSHOT")
implementation("org.jetbrains:annotations:17.0.0")
implementation("org.apache.maven.scm:maven-scm-provider-gitexe:1.8.1")
implementation("org.bstats:bstats-bukkit:1.4")
implementation("org.spigotmc:spigot:1.14.4-R0.1-SNAPSHOT")
implementation("com.sk89q.worldguard:worldguard-legacy:7.0.0-SNAPSHOT")
testImplementation("junit:junit:4.10")
}

View File

@@ -1,16 +0,0 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>bin</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
<files>
<file>
<source>${project.build.directory}/${artifactId}.jar</source>
<outputDirectory>/</outputDirectory>
<destName>mcMMO.jar</destName>
</file>
</files>
</assembly>

View File

@@ -1,89 +0,0 @@
//package com.gmail.nossr50.api;
//
//import com.gmail.nossr50.datatypes.player.McMMOPlayer;
//import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
//import com.gmail.nossr50.runnables.skills.BleedTimerTask;
//import com.gmail.nossr50.util.player.UserManager;
//import org.bukkit.entity.LivingEntity;
//import org.bukkit.entity.Player;
//
//public final class AbilityAPI {
// private AbilityAPI() {
// }
//
// public static boolean berserkEnabled(Player player) {
// return pluginRef.getUserManager().getPlayer(player).getAbilityMode(SuperAbilityType.BERSERK);
// }
//
// public static boolean gigaDrillBreakerEnabled(Player player) {
// return pluginRef.getUserManager().getPlayer(player).getAbilityMode(SuperAbilityType.GIGA_DRILL_BREAKER);
// }
//
// public static boolean greenTerraEnabled(Player player) {
// return pluginRef.getUserManager().getPlayer(player).getAbilityMode(SuperAbilityType.GREEN_TERRA);
// }
//
// public static boolean serratedStrikesEnabled(Player player) {
// return pluginRef.getUserManager().getPlayer(player).getAbilityMode(SuperAbilityType.SERRATED_STRIKES);
// }
//
// public static boolean skullSplitterEnabled(Player player) {
// return pluginRef.getUserManager().getPlayer(player).getAbilityMode(SuperAbilityType.SKULL_SPLITTER);
// }
//
// public static boolean superBreakerEnabled(Player player) {
// return pluginRef.getUserManager().getPlayer(player).getAbilityMode(SuperAbilityType.SUPER_BREAKER);
// }
//
// public static boolean treeFellerEnabled(Player player) {
// return pluginRef.getUserManager().getPlayer(player).getAbilityMode(SuperAbilityType.TREE_FELLER);
// }
//
// public static boolean isAnyAbilityEnabled(Player player) {
// McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
//
// for (SuperAbilityType ability : SuperAbilityType.values()) {
// if (mcMMOPlayer.getAbilityMode(ability)) {
// return true;
// }
// }
//
// return false;
// }
//
// public static void resetCooldowns(Player player) {
// pluginRef.getUserManager().getPlayer(player).resetCooldowns();
// }
//
// public static void setBerserkCooldown(Player player, long cooldown) {
// pluginRef.getUserManager().getPlayer(player).setAbilityDATS(SuperAbilityType.BERSERK, cooldown);
// }
//
// public static void setGigaDrillBreakerCooldown(Player player, long cooldown) {
// pluginRef.getUserManager().getPlayer(player).setAbilityDATS(SuperAbilityType.GIGA_DRILL_BREAKER, cooldown);
// }
//
// public static void setGreenTerraCooldown(Player player, long cooldown) {
// pluginRef.getUserManager().getPlayer(player).setAbilityDATS(SuperAbilityType.GREEN_TERRA, cooldown);
// }
//
// public static void setSerratedStrikesCooldown(Player player, long cooldown) {
// pluginRef.getUserManager().getPlayer(player).setAbilityDATS(SuperAbilityType.SERRATED_STRIKES, cooldown);
// }
//
// public static void setSkullSplitterCooldown(Player player, long cooldown) {
// pluginRef.getUserManager().getPlayer(player).setAbilityDATS(SuperAbilityType.SKULL_SPLITTER, cooldown);
// }
//
// public static void setSuperBreakerCooldown(Player player, long cooldown) {
// pluginRef.getUserManager().getPlayer(player).setAbilityDATS(SuperAbilityType.SUPER_BREAKER, cooldown);
// }
//
// public static void setTreeFellerCooldown(Player player, long cooldown) {
// pluginRef.getUserManager().getPlayer(player).setAbilityDATS(SuperAbilityType.TREE_FELLER, cooldown);
// }
//
// public static boolean isBleeding(LivingEntity entity) {
// return pluginRef.getBleedTimerTask().isBleeding(entity);
// }
//}

View File

@@ -1,154 +0,0 @@
//package com.gmail.nossr50.api;
//
//import com.gmail.nossr50.chat.ChatManager;
//import com.gmail.nossr50.chat.ChatManagerFactory;
//import com.gmail.nossr50.chat.PartyChatManager;
//import com.gmail.nossr50.datatypes.chat.ChatMode;
//import com.gmail.nossr50.party.PartyManager;
//import com.gmail.nossr50.util.player.UserManager;
//import org.bukkit.entity.Player;
//import org.bukkit.plugin.Plugin;
//
//public final class ChatAPI {
// private ChatAPI() {
// }
//
// /**
// * Send a message to all members of a party
// * </br>
// * This function is designed for API usage.
// *
// * @param plugin The plugin sending the message
// * @param sender The name of the sender
// * @param displayName The display name of the sender
// * @param party The name of the party to send to
// * @param message The message to send
// */
// public static void sendPartyChat(Plugin plugin, String sender, String displayName, String party, String message) {
// getPartyChatManager(plugin, party).handleChat(sender, displayName, message);
// }
//
// /**
// * Send a message to all members of a party
// * </br>
// * This function is designed for API usage.
// *
// * @param plugin The plugin sending the message
// * @param sender The name of the sender to display in the chat
// * @param party The name of the party to send to
// * @param message The message to send
// */
// public static void sendPartyChat(Plugin plugin, String sender, String party, String message) {
// getPartyChatManager(plugin, party).handleChat(sender, message);
// }
//
// /**
// * Send a message to administrators
// * </br>
// * This function is designed for API usage.
// *
// * @param plugin The plugin sending the message
// * @param sender The name of the sender
// * @param displayName The display name of the sender
// * @param message The message to send
// */
// public static void sendAdminChat(Plugin plugin, String sender, String displayName, String message) {
// ChatManagerFactory.getChatManager(plugin, ChatMode.ADMIN).handleChat(sender, displayName, message);
// }
//
// /**
// * Send a message to administrators
// * </br>
// * This function is designed for API usage.
// *
// * @param plugin The plugin sending the message
// * @param sender The name of the sender to display in the chat
// * @param message The message to send
// */
// public static void sendAdminChat(Plugin plugin, String sender, String message) {
// ChatManagerFactory.getChatManager(plugin, ChatMode.ADMIN).handleChat(sender, message);
// }
//
// /**
// * Check if a player is currently talking in party chat.
// *
// * @param player The player to check
// * @return true if the player is using party chat, false otherwise
// */
// public static boolean isUsingPartyChat(Player player) {
// return pluginRef.getUserManager().getPlayer(player).isChatEnabled(ChatMode.PARTY);
// }
//
// /**
// * Check if a player is currently talking in party chat.
// *
// * @param playerName The name of the player to check
// * @return true if the player is using party chat, false otherwise
// */
// public static boolean isUsingPartyChat(String playerName) {
// return pluginRef.getUserManager().getPlayer(playerName).isChatEnabled(ChatMode.PARTY);
// }
//
// /**
// * Check if a player is currently talking in admin chat.
// *
// * @param player The player to check
// * @return true if the player is using admin chat, false otherwise
// */
// public static boolean isUsingAdminChat(Player player) {
// return pluginRef.getUserManager().getPlayer(player).isChatEnabled(ChatMode.ADMIN);
// }
//
// /**
// * Check if a player is currently talking in admin chat.
// *
// * @param playerName The name of the player to check
// * @return true if the player is using admin chat, false otherwise
// */
// public static boolean isUsingAdminChat(String playerName) {
// return pluginRef.getUserManager().getPlayer(playerName).isChatEnabled(ChatMode.ADMIN);
// }
//
// /**
// * Toggle the party chat mode of a player.
// *
// * @param player The player to toggle party chat on.
// */
// public static void togglePartyChat(Player player) {
// pluginRef.getUserManager().getPlayer(player).toggleChat(ChatMode.PARTY);
// }
//
// /**
// * Toggle the party chat mode of a player.
// *
// * @param playerName The name of the player to toggle party chat on.
// */
// public static void togglePartyChat(String playerName) {
// pluginRef.getUserManager().getPlayer(playerName).toggleChat(ChatMode.PARTY);
// }
//
// /**
// * Toggle the admin chat mode of a player.
// *
// * @param player The player to toggle admin chat on.
// */
// public static void toggleAdminChat(Player player) {
// pluginRef.getUserManager().getPlayer(player).toggleChat(ChatMode.ADMIN);
// }
//
// /**
// * Toggle the admin chat mode of a player.
// *
// * @param playerName The name of the player to toggle party chat on.
// */
// public static void toggleAdminChat(String playerName) {
// pluginRef.getUserManager().getPlayer(playerName).toggleChat(ChatMode.ADMIN);
// }
//
// private static ChatManager getPartyChatManager(Plugin plugin, String party) {
// ChatManager chatManager = ChatManagerFactory.getChatManager(plugin, ChatMode.PARTY);
// ((PartyChatManager) chatManager).setParty(pluginRef.getPartyManager().getParty(party));
//
// return chatManager;
// }
//}

View File

@@ -1,30 +0,0 @@
//package com.gmail.nossr50.api;
//
//import com.gmail.nossr50.datatypes.player.PlayerProfile;
//import com.gmail.nossr50.mcMMO;
//
//import java.util.UUID;
//
//public class DatabaseAPI {
//
// /**
// * Checks if a player exists in the mcMMO Database
// * @param uuid player UUID
// * @return true if the player exists in the DB, false if they do not
// */
// public boolean doesPlayerExistInDB(String uuid) {
// return doesPlayerExistInDB(UUID.fromString(uuid));
// }
//
// /**
// * Checks if a player exists in the mcMMO Database
// * @param uuid player UUID
// * @return true if the player exists in the DB, false if they do not
// */
// public boolean doesPlayerExistInDB(UUID uuid) {
// PlayerProfile playerProfile = mcMMO.getDatabaseManager().loadPlayerProfile(uuid);
//
// return playerProfile.isLoaded();
// }
//
//}

View File

@@ -1,265 +0,0 @@
//package com.gmail.nossr50.api;
//
//import com.gmail.nossr50.datatypes.interactions.NotificationType;
//import com.gmail.nossr50.datatypes.party.Party;
//import com.gmail.nossr50.datatypes.party.PartyLeader;
//import com.gmail.nossr50.mcMMO;
//import com.gmail.nossr50.party.PartyManager;
//import com.gmail.nossr50.util.player.UserManager;
//import org.bukkit.OfflinePlayer;
//import org.bukkit.entity.Player;
//
//import java.util.*;
//
//public final class PartyAPI {
// private PartyAPI() {
// }
//
// /**
// * Get the name of the party a player is in.
// * </br>
// * This function is designed for API usage.
// *
// * @param player The player to check the party name of
// * @return the name of the player's party, or null if not in a party
// */
// public static String getPartyName(Player player) {
// if (!inParty(player)) {
// return null;
// }
//
// return pluginRef.getUserManager().getPlayer(player).getParty().getName();
// }
//
// /**
// * Checks if a player is in a party.
// * </br>
// * This function is designed for API usage.
// *
// * @param player The player to check
// * @return true if the player is in a party, false otherwise
// */
// public static boolean inParty(Player player) {
// if (pluginRef.getUserManager().getPlayer(player) == null)
// return false;
//
// return pluginRef.getUserManager().getPlayer(player).inParty();
// }
//
// /**
// * Check if two players are in the same party.
// * </br>
// * This function is designed for API usage.
// *
// * @param playera The first player to check
// * @param playerb The second player to check
// * @return true if the two players are in the same party, false otherwise
// */
// public static boolean inSameParty(Player playera, Player playerb) {
// return pluginRef.getPartyManager().inSameParty(playera, playerb);
// }
//
// /**
// * Get a list of all current parties.
// * </br>
// * This function is designed for API usage.
// *
// * @return the list of parties.
// */
// public static List<Party> getParties() {
// return pluginRef.getPartyManager().getParties();
// }
//
// /**
// * Add a player to a party.
// * </br>
// * This function is designed for API usage.
// *
// * @param player The player to add to the party
// * @param partyName The party to add the player to
// * @deprecated parties can have limits, use the other method
// */
// @Deprecated
// public static void addToParty(Player player, String partyName) {
// //Check if player profile is loaded
// if (pluginRef.getUserManager().getPlayer(player) == null)
// return;
//
// Party party = pluginRef.getPartyManager().getParty(partyName);
//
// if (party == null) {
// party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName);
// } else if (mcMMO.getConfigManager().getConfigParty().getPartyGeneral().isPartySizeCapped()) {
// if (pluginRef.getPartyManager().isPartyFull(player, party)) {
// mcMMO.getNotificationManager().sendPlayerInformation(player, NotificationType.PARTY_MESSAGE, "Commands.Party.PartyFull", party.toString());
// return;
// }
// }
//
// pluginRef.getPartyManager().addToParty(pluginRef.getUserManager().getPlayer(player), party);
// }
//
// /**
// * The max party size of the server
// * Limits are only enforced if the enforcement setting is on
// *
// * @return the max party size on this server
// */
// public static int getMaxPartySize() {
// return mcMMO.getConfigManager().getConfigParty().getPartySizeLimit();
// }
//
// /**
// * Checks if parties are currently size capped which is determined by the user config
// *
// * @return true if parties are size capped
// */
// public static boolean isPartySizeCapped() {
// return mcMMO.getConfigManager().getConfigParty().isPartySizeCapped();
// }
//
// /**
// * Add a player to a party.
// * </br>
// * This function is designed for API usage.
// *
// * @param player The player to add to the party
// * @param partyName The party to add the player to
// * @param bypassLimit if true bypasses party size limits
// */
// //TODO: bypasslimit not used?
// public static void addToParty(Player player, String partyName, boolean bypassLimit) {
// //Check if player profile is loaded
// if (pluginRef.getUserManager().getPlayer(player) == null)
// return;
//
// Party party = pluginRef.getPartyManager().getParty(partyName);
//
// if (party == null) {
// party = new Party(new PartyLeader(player.getUniqueId(), player.getName()), partyName);
// }
//
// pluginRef.getPartyManager().addToParty(pluginRef.getUserManager().getPlayer(player), party);
// }
//
// /**
// * Remove a player from a party.
// * </br>
// * This function is designed for API usage.
// *
// * @param player The player to remove
// */
// public static void removeFromParty(Player player) {
// //Check if player profile is loaded
// if (pluginRef.getUserManager().getPlayer(player) == null)
// return;
//
// pluginRef.getPartyManager().removeFromParty(pluginRef.getUserManager().getPlayer(player));
// }
//
// /**
// * Get the leader of a party.
// * </br>
// * This function is designed for API usage.
// *
// * @param partyName The party name
// * @return the leader of the party
// */
// public static String getPartyLeader(String partyName) {
// return pluginRef.getPartyManager().getPartyLeaderName(partyName);
// }
//
// /**
// * Set the leader of a party.
// * </br>
// * This function is designed for API usage.
// *
// * @param partyName The name of the party to set the leader of
// * @param playerName The playerName to set as leader
// */
// @Deprecated
// public static void setPartyLeader(String partyName, String playerName) {
// pluginRef.getPartyManager().setPartyLeader(mcMMO.p.getServer().getOfflinePlayer(playerName).getUniqueId(), pluginRef.getPartyManager().getParty(partyName));
// }
//
// /**
// * Get a list of all players in this player's party.
// * </br>
// * This function is designed for API usage.
// *
// * @param player The player to check
// * @return all the players in the player's party
// */
// @Deprecated
// public static List<OfflinePlayer> getOnlineAndOfflineMembers(Player player) {
// List<OfflinePlayer> members = new ArrayList<>();
//
// for (UUID memberUniqueId : pluginRef.getPartyManager().getAllMembers(player).keySet()) {
// OfflinePlayer member = mcMMO.p.getServer().getOfflinePlayer(memberUniqueId);
// members.add(member);
// }
// return members;
// }
//
// /**
// * Get a list of all player names in this player's party.
// * </br>
// * This function is designed for API usage.
// *
// * @param player The player to check
// * @return all the player names in the player's party
// */
// @Deprecated
// public static LinkedHashSet<String> getMembers(Player player) {
// return (LinkedHashSet<String>) pluginRef.getPartyManager().getAllMembers(player).values();
// }
//
// /**
// * Get a list of all player names and uuids in this player's party.
// * </br>
// * This function is designed for API usage.
// *
// * @param player The player to check
// * @return all the player names and uuids in the player's party
// */
// public static LinkedHashMap<UUID, String> getMembersMap(Player player) {
// return pluginRef.getPartyManager().getAllMembers(player);
// }
//
// /**
// * Get a list of all online players in this party.
// * </br>
// * This function is designed for API usage.
// *
// * @param partyName The party to check
// * @return all online players in this party
// */
// public static List<Player> getOnlineMembers(String partyName) {
// return pluginRef.getPartyManager().getOnlineMembers(partyName);
// }
//
// /**
// * Get a list of all online players in this player's party.
// * </br>
// * This function is designed for API usage.
// *
// * @param player The player to check
// * @return all online players in the player's party
// */
// public static List<Player> getOnlineMembers(Player player) {
// return pluginRef.getPartyManager().getOnlineMembers(player);
// }
//
// public static boolean hasAlly(String partyName) {
// return getAllyName(partyName) != null;
// }
//
// public static String getAllyName(String partyName) {
// Party ally = pluginRef.getPartyManager().getParty(partyName).getAlly();
// if (ally != null) {
// return ally.getName();
// }
//
// return null;
// }
//}

View File

@@ -1,94 +0,0 @@
//package com.gmail.nossr50.api;
//
//import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
//
//import java.util.ArrayList;
//import java.util.Arrays;
//import java.util.List;
//
//public final class SkillAPI {
// private SkillAPI() {
// }
//
// /**
// * Returns a list of strings with mcMMO's skills
// * This includes parent and child skills
// * </br>
// * This function is designed for API usage.
// *
// * @return a list of strings with valid skill names
// */
// public static List<String> getSkills() {
// return getListFromEnum(Arrays.asList(PrimarySkillType.values()));
// }
//
// /**
// * Returns a list of strings with mcMMO's skills
// * This only includes parent skills
// * </br>
// * This function is designed for API usage.
// *
// * @return a list of strings with valid skill names
// */
// public static List<String> getNonChildSkills() {
// return getListFromEnum(pluginRef.getSkillTools().NON_CHILD_SKILLS);
// }
//
// /**
// * Returns a list of strings with mcMMO's skills
// * This only includes child skills
// * </br>
// * This function is designed for API usage.
// *
// * @return a list of strings with valid skill names
// */
// public static List<String> getChildSkills() {
// return getListFromEnum(PrimarySkillType.CHILD_SKILLS);
// }
//
// /**
// * Returns a list of strings with mcMMO's skills
// * This only includes combat skills
// * </br>
// * This function is designed for API usage.
// *
// * @return a list of strings with valid skill names
// */
// public static List<String> getCombatSkills() {
// return getListFromEnum(PrimarySkillType.COMBAT_SKILLS);
// }
//
// /**
// * Returns a list of strings with mcMMO's skills
// * This only includes gathering skills
// * </br>
// * This function is designed for API usage.
// *
// * @return a list of strings with valid skill names
// */
// public static List<String> getGatheringSkills() {
// return getListFromEnum(PrimarySkillType.GATHERING_SKILLS);
// }
//
// /**
// * Returns a list of strings with mcMMO's skills
// * This only includes misc skills
// * </br>
// * This function is designed for API usage.
// *
// * @return a list of strings with valid skill names
// */
// public static List<String> getMiscSkills() {
// return getListFromEnum(PrimarySkillType.MISC_SKILLS);
// }
//
// private static List<String> getListFromEnum(List<PrimarySkillType> skillsTypes) {
// List<String> skills = new ArrayList<>();
//
// for (PrimarySkillType primarySkillType : skillsTypes) {
// skills.add(primarySkillType.name());
// }
//
// return skills;
// }
//}

View File

@@ -1,9 +0,0 @@
package com.gmail.nossr50.api.exceptions;
public class InvalidSkillException extends RuntimeException {
private static final long serialVersionUID = 942705284195791157L;
public InvalidSkillException(String s) {
super(s + " does not match a valid skill.");
}
}

View File

@@ -1,7 +0,0 @@
package com.gmail.nossr50.api.exceptions;
public class MissingSkillPropertyDefinition extends RuntimeException {
public MissingSkillPropertyDefinition(String details) {
super("A skill property is undefined! Details: " + details);
}
}

View File

@@ -1,9 +0,0 @@
package com.gmail.nossr50.api.exceptions;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
public class UndefinedSkillBehaviour extends RuntimeException {
public UndefinedSkillBehaviour(PrimarySkillType primarySkillType) {
super("Undefined behaviour for skill! - " + primarySkillType.toString());
}
}

View File

@@ -1,26 +0,0 @@
//package com.gmail.nossr50.bukkit;
//
//import com.gmail.nossr50.datatypes.items.BukkitMMOItem;
//import com.gmail.nossr50.datatypes.items.MMOItem;
//import com.gmail.nossr50.util.nbt.NBTManager;
//import com.gmail.nossr50.util.nbt.RawNBT;
//import org.bukkit.inventory.ItemStack;
//
///**
// * Used to convert or construct platform independent types into Bukkit types
// */
//public class BukkitFactory {
//
// /**
// * Creates a BukkitMMOItem which contains Bukkit implementations for the type MMOItem
// * @return a new BukkitMMOItem
// */
// public static MMOItem<?> createItem(String namespaceKey, int amount, RawNBT rawNBT) {
// return new BukkitMMOItem(namespaceKey, amount, rawNBT);
// }
//
// public static MMOItem<?> createItem(ItemStack itemStack) {
// return createItem(itemStack.getType().getKey().toString(), itemStack.getAmount(), new RawNBT(NBTManager.getNBT(itemStack).toString()));
// }
//
//}

View File

@@ -1,105 +0,0 @@
package com.gmail.nossr50.chat;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
import com.gmail.nossr50.mcMMO;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ChatManager {
private final String ADMIN_CHAT_PERMISSION = "mcmmo.chat.adminchat";
private final mcMMO pluginRef;
public ChatManager(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
public void processAdminChat(Player player, String message) {
sendAdminChatMessage(new McMMOAdminChatEvent(pluginRef, player.getName(), player.getDisplayName(), message));
}
public void processAdminChat(String senderName, String displayName, String message) {
sendAdminChatMessage(new McMMOAdminChatEvent(pluginRef, senderName, displayName, message));
}
public void processPartyChat(Party party, Player sender, String message) {
sendPartyChatMessage(new McMMOPartyChatEvent(pluginRef, sender.getName(), sender.getDisplayName(), party, message));
}
public void processPartyChat(Party party, String senderName, String message) {
sendPartyChatMessage(new McMMOPartyChatEvent(pluginRef, senderName, senderName, party, message));
}
private void sendAdminChatMessage(McMMOAdminChatEvent event) {
pluginRef.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
}
String chatPrefix = pluginRef.getConfigManager().getConfigCommands().getAdminChatPrefix();
String senderName = event.getSender();
String displayName = pluginRef.getConfigManager().getConfigCommands().isUseDisplayNames() ? event.getDisplayName() : senderName;
String message = pluginRef.getLocaleManager().formatString(chatPrefix, displayName) + " " + event.getMessage();
pluginRef.getServer().broadcast(message, ADMIN_CHAT_PERMISSION);
}
private void sendPartyChatMessage(McMMOPartyChatEvent event) {
pluginRef.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
}
Party party = event.getParty();
String chatPrefix = pluginRef.getConfigManager().getConfigParty().getPartyChatPrefixFormat();
String senderName = event.getSender();
String displayName = pluginRef.getConfigManager().getConfigCommands().isUseDisplayNames() ? event.getDisplayName() : senderName;
String message = pluginRef.getLocaleManager().formatString(chatPrefix, displayName) + " " + event.getMessage();
if (pluginRef.getConfigManager().getConfigParty().isPartyLeaderColoredGold()
&& senderName.equalsIgnoreCase(party.getLeader().getPlayerName())) {
message = message.replaceFirst(Pattern.quote(displayName), ChatColor.GOLD + Matcher.quoteReplacement(displayName) + ChatColor.RESET);
}
for (Player member : party.getOnlineMembers()) {
member.sendMessage(message);
}
if (party.getAlly() != null) {
for (Player member : party.getAlly().getOnlineMembers()) {
String allyPrefix = pluginRef.getLocaleManager().formatString(pluginRef.getConfigManager().getConfigParty().getPartyChatPrefixAlly());
member.sendMessage(allyPrefix + message);
}
}
pluginRef.getServer().getConsoleSender().sendMessage(ChatColor.stripColor("[mcMMO] [P]<" + party.getName() + ">" + message));
/*
* Party Chat Spying
*/
for (McMMOPlayer mcMMOPlayer : pluginRef.getUserManager().getPlayers()) {
Player player = mcMMOPlayer.getPlayer();
//Check for toggled players
if (mcMMOPlayer.isPartyChatSpying()) {
Party adminParty = mcMMOPlayer.getParty();
//Only message admins not part of this party
if (adminParty != null) {
//TODO: Incorporate JSON
if (adminParty != event.getParty())
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.AdminChatSpy.Chat", event.getParty(), message));
} else {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.AdminChatSpy.Chat", event.getParty(), message));
}
}
}
}
}

View File

@@ -1,33 +0,0 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
public class AbilityToggleCommand extends ToggleCommand {
public AbilityToggleCommand(mcMMO pluginRef) {
super(pluginRef);
}
@Override
protected boolean hasOtherPermission(CommandSender sender) {
return pluginRef.getPermissionTools().mcabilityOthers(sender);
}
@Override
protected boolean hasSelfPermission(CommandSender sender) {
return pluginRef.getPermissionTools().mcability(sender);
}
@Override
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
mcMMOPlayer.getPlayer().sendMessage(pluginRef.getLocaleManager().getString("Commands.Ability." + (mcMMOPlayer.getAllowAbilityUse() ? "Off" : "On")));
mcMMOPlayer.toggleAbilityUse();
}
@Override
protected void sendSuccessMessage(CommandSender sender, String playerName) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Ability.Toggle", playerName));
}
}

View File

@@ -1,48 +0,0 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import java.util.List;
public class ChatNotificationToggleCommand implements TabExecutor {
private final mcMMO pluginRef;
public ChatNotificationToggleCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
switch (args.length) {
case 0:
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer((Player) sender);
//Not Loaded yet
if (mcMMOPlayer == null)
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Notifications." + (mcMMOPlayer.useChatNotifications() ? "Off" : "On")));
mcMMOPlayer.toggleChatNotifications();
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return ImmutableList.of();
}
}

View File

@@ -1,12 +0,0 @@
package com.gmail.nossr50.commands;
import com.google.common.collect.ImmutableList;
import java.util.List;
public class CommandConstants {
public static final List<String> TELEPORT_SUBCOMMANDS = ImmutableList.of("toggle", "accept", "acceptany", "acceptall");
public static final List<String> ALLIANCE_SUBCOMMANDS = ImmutableList.of("invite", "accept", "disband");
public static final List<String> TRUE_FALSE_OPTIONS = ImmutableList.of("on", "off", "true", "false", "enabled", "disabled");
public static final List<String> RESET_OPTIONS = ImmutableList.of("clear", "reset");
}

View File

@@ -1,96 +0,0 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.commands.database.ConvertDatabaseCommand;
import com.gmail.nossr50.commands.experience.ConvertExperienceCommand;
import com.gmail.nossr50.datatypes.database.DatabaseType;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class ConvertCommand implements TabExecutor {
private List<String> FORMULA_TYPES;
private List<String> DATABASE_TYPES;
private final List<String> CONVERSION_SUBCOMMANDS = ImmutableList.of("database", "experience");
private CommandExecutor databaseConvertCommand;
private CommandExecutor experienceConvertCommand;
private final mcMMO pluginRef;
public ConvertCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
databaseConvertCommand = new ConvertDatabaseCommand(pluginRef);
experienceConvertCommand = new ConvertExperienceCommand(pluginRef);
initTypes();
}
private void initTypes() {
ArrayList<String> formulaTypes = new ArrayList<>();
ArrayList<String> databaseTypes = new ArrayList<>();
for (FormulaType type : FormulaType.values()) {
formulaTypes.add(type.toString());
}
for (DatabaseType type : DatabaseType.values()) {
databaseTypes.add(type.toString());
}
// Custom stuff
databaseTypes.remove(DatabaseType.CUSTOM.toString());
if (pluginRef.getDatabaseManager().getDatabaseType() == DatabaseType.CUSTOM) {
databaseTypes.add(pluginRef.getDatabaseManagerFactory().getCustomDatabaseManagerClass().getName());
}
Collections.sort(formulaTypes);
Collections.sort(databaseTypes);
FORMULA_TYPES = ImmutableList.copyOf(formulaTypes);
DATABASE_TYPES = ImmutableList.copyOf(databaseTypes);
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
if (args[0].equalsIgnoreCase("database") || args[0].equalsIgnoreCase("db")) {
return databaseConvertCommand.onCommand(sender, command, label, args);
} else if (args[0].equalsIgnoreCase("experience") || args[0].equalsIgnoreCase("xp") || args[1].equalsIgnoreCase("exp")) {
return experienceConvertCommand.onCommand(sender, command, label, args);
}
return false;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], CONVERSION_SUBCOMMANDS, new ArrayList<>(CONVERSION_SUBCOMMANDS.size()));
case 2:
if (args[1].equalsIgnoreCase("database") || args[1].equalsIgnoreCase("db")) {
return StringUtil.copyPartialMatches(args[0], DATABASE_TYPES, new ArrayList<>(DATABASE_TYPES.size()));
}
if (args[1].equalsIgnoreCase("experience") || args[1].equalsIgnoreCase("xp") || args[1].equalsIgnoreCase("exp")) {
return StringUtil.copyPartialMatches(args[0], FORMULA_TYPES, new ArrayList<>(FORMULA_TYPES.size()));
}
return ImmutableList.of();
default:
return ImmutableList.of();
}
}
}

View File

@@ -1,124 +0,0 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.notifications.SensitiveCommandType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.StringUtils;
import com.google.common.collect.ImmutableList;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
public class ExperienceRateCommand implements TabExecutor {
private final mcMMO pluginRef;
public ExperienceRateCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
if (!args[0].equalsIgnoreCase("reset") && !args[0].equalsIgnoreCase("clear")) {
return false;
}
if (!pluginRef.getPermissionTools().xprateReset(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (pluginRef.isXPEventEnabled()) {
if (pluginRef.getConfigManager().getConfigEvent().isSendTitleMessages()) {
pluginRef.getNotificationManager().broadcastTitle(pluginRef.getServer(),
pluginRef.getLocaleManager().getString("Commands.Event.Stop"),
pluginRef.getLocaleManager().getString("Commands.Event.Stop.Subtitle"),
10, 10 * 20, 20);
}
if (pluginRef.getConfigManager().getConfigEvent().isBroadcastXPRateEventMessages()) {
pluginRef.getServer().broadcastMessage(pluginRef.getLocaleManager().getString("Commands.Event.Stop"));
pluginRef.getServer().broadcastMessage(pluginRef.getLocaleManager().getString("Commands.Event.Stop.Subtitle"));
}
//Admin notification
pluginRef.getNotificationManager().processSensitiveCommandNotification(sender, SensitiveCommandType.XPRATE_END);
pluginRef.toggleXpEventEnabled();
}
pluginRef.getDynamicSettingsManager().getExperienceManager().resetGlobalXpMult();
return true;
case 2:
if (pluginRef.getCommandTools().isInvalidInteger(sender, args[0])) {
return true;
}
if (!pluginRef.getPermissionTools().xprateSet(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (pluginRef.getCommandTools().shouldDisableToggle(args[1])) {
pluginRef.setXPEventEnabled(false);
} else if (pluginRef.getCommandTools().shouldEnableToggle(args[1])) {
pluginRef.setXPEventEnabled(true);
} else {
return false;
}
int newXpRate = Integer.parseInt(args[0]);
if (newXpRate < 0) {
sender.sendMessage(ChatColor.RED + pluginRef.getLocaleManager().getString("Commands.NegativeNumberWarn"));
return true;
}
pluginRef.getDynamicSettingsManager().getExperienceManager().setGlobalXpMult(newXpRate);
if (pluginRef.getConfigManager().getConfigEvent().isSendTitleMessages()) {
pluginRef.getNotificationManager().broadcastTitle(pluginRef.getServer(),
pluginRef.getLocaleManager().getString("Commands.Event.Start"),
pluginRef.getLocaleManager().getString("Commands.Event.XP", newXpRate),
10, 10 * 20, 20);
}
if (pluginRef.getConfigManager().getConfigEvent().isBroadcastXPRateEventMessages()) {
pluginRef.getServer().broadcastMessage(pluginRef.getLocaleManager().getString("Commands.Event.Start"));
pluginRef.getServer().broadcastMessage(pluginRef.getLocaleManager().getString("Commands.Event.XP", newXpRate));
}
//Admin notification
pluginRef.getNotificationManager().processSensitiveCommandNotification(sender, SensitiveCommandType.XPRATE_MODIFY, String.valueOf(newXpRate));
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
if (StringUtils.isInt(args[0])) {
return ImmutableList.of();
}
return StringUtil.copyPartialMatches(args[0], CommandConstants.RESET_OPTIONS, new ArrayList<>(CommandConstants.RESET_OPTIONS.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], CommandConstants.TRUE_FALSE_OPTIONS, new ArrayList<>(CommandConstants.TRUE_FALSE_OPTIONS.size()));
default:
return ImmutableList.of();
}
}
}

View File

@@ -1,33 +0,0 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
public class GodModeCommand extends ToggleCommand {
public GodModeCommand(mcMMO pluginRef) {
super(pluginRef);
}
@Override
protected boolean hasOtherPermission(CommandSender sender) {
return pluginRef.getPermissionTools().mcgodOthers(sender);
}
@Override
protected boolean hasSelfPermission(CommandSender sender) {
return pluginRef.getPermissionTools().mcgod(sender);
}
@Override
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
mcMMOPlayer.getPlayer().sendMessage(pluginRef.getLocaleManager().getString("Commands.GodMode." + (mcMMOPlayer.getGodMode() ? "Disabled" : "Enabled")));
mcMMOPlayer.toggleGodMode();
}
@Override
protected void sendSuccessMessage(CommandSender sender, String playerName) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.GodMode.Toggle", playerName));
}
}

View File

@@ -1,118 +0,0 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.commands.party.PartySubcommandType;
import com.gmail.nossr50.mcMMO;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class McMMOCommand implements CommandExecutor {
private final mcMMO pluginRef;
public McMMOCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
if (!pluginRef.getPermissionTools().mcmmoDescription(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
String description = pluginRef.getLocaleManager().getString("mcMMO.Description");
String[] mcSplit = description.split(",");
sender.sendMessage(mcSplit);
sender.sendMessage(pluginRef.getLocaleManager().getString("mcMMO.Description.FormerDevs"));
if (pluginRef.getConfigManager().getConfigAds().isShowDonationInfo()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("MOTD.Donate"));
sender.sendMessage(ChatColor.GOLD + " - " + ChatColor.GREEN + "nossr50@gmail.com" + ChatColor.GOLD + " Paypal");
}
sender.sendMessage(pluginRef.getLocaleManager().getString("MOTD.Version", pluginRef.getDescription().getVersion()));
// mcMMO.getHolidayManager().anniversaryCheck(sender);
return true;
case 1:
if (args[0].equalsIgnoreCase("?") || args[0].equalsIgnoreCase("help") || args[0].equalsIgnoreCase("commands")) {
if (!pluginRef.getPermissionTools().mcmmoHelp(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mcc.Header"));
displayGeneralCommands(sender);
displayOtherCommands(sender);
displayPartyCommands(sender);
}
return true;
default:
return false;
}
}
private void displayGeneralCommands(CommandSender sender) {
sender.sendMessage(ChatColor.DARK_AQUA + " /mcstats " + pluginRef.getLocaleManager().getString("Commands.Stats"));
sender.sendMessage(ChatColor.DARK_AQUA + " /<skill>" + pluginRef.getLocaleManager().getString("Commands.SkillInfo"));
sender.sendMessage(ChatColor.DARK_AQUA + " /mctop " + pluginRef.getLocaleManager().getString("Commands.Leaderboards"));
if (pluginRef.getPermissionTools().inspect(sender)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /inspect " + pluginRef.getLocaleManager().getString("Commands.Inspect"));
}
if (pluginRef.getPermissionTools().mcability(sender)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /mcability " + pluginRef.getLocaleManager().getString("Commands.ToggleAbility"));
}
}
private void displayOtherCommands(CommandSender sender) {
//Don't show them this category if they have none of the permissions
if (!pluginRef.getPermissionTools().skillreset(sender) && !pluginRef.getPermissionTools().mmoedit(sender) && !pluginRef.getPermissionTools().adminChat(sender) && !pluginRef.getPermissionTools().mcgod(sender))
return;
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Other"));
if (pluginRef.getPermissionTools().skillreset(sender)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /skillreset <skill|all> " + pluginRef.getLocaleManager().getString("Commands.Reset"));
}
if (pluginRef.getPermissionTools().mmoedit(sender)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /mmoedit " + pluginRef.getLocaleManager().getString("Commands.mmoedit"));
}
if (pluginRef.getPermissionTools().adminChat(sender)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /adminchat " + pluginRef.getLocaleManager().getString("Commands.AdminToggle"));
}
if (pluginRef.getPermissionTools().mcgod(sender)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /mcgod " + pluginRef.getLocaleManager().getString("Commands.mcgod"));
}
}
private void displayPartyCommands(CommandSender sender) {
if (pluginRef.getPermissionTools().party(sender)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Commands"));
sender.sendMessage(ChatColor.DARK_AQUA + " /party create <" + pluginRef.getLocaleManager().getString("Commands.Usage.PartyName") + "> " + pluginRef.getLocaleManager().getString("Commands.Party1"));
sender.sendMessage(ChatColor.DARK_AQUA + " /party join <" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "> " + pluginRef.getLocaleManager().getString("Commands.Party2"));
sender.sendMessage(ChatColor.DARK_AQUA + " /party quit " + pluginRef.getLocaleManager().getString("Commands.Party.Quit"));
if (pluginRef.getPermissionTools().partyChat(sender)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /party chat " + pluginRef.getLocaleManager().getString("Commands.Party.Toggle"));
}
sender.sendMessage(ChatColor.DARK_AQUA + " /party invite <" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "> " + pluginRef.getLocaleManager().getString("Commands.Party.Invite"));
sender.sendMessage(ChatColor.DARK_AQUA + " /party accept " + pluginRef.getLocaleManager().getString("Commands.Party.Accept"));
if (pluginRef.getPermissionTools().partySubcommand(sender, PartySubcommandType.TELEPORT)) {
sender.sendMessage(ChatColor.DARK_AQUA + " /party teleport <" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + "> " + pluginRef.getLocaleManager().getString("Commands.Party.Teleport"));
}
}
}
}

View File

@@ -1,37 +0,0 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
public class RefreshCooldownsCommand extends ToggleCommand {
public RefreshCooldownsCommand(mcMMO pluginRef) {
super(pluginRef);
}
@Override
protected boolean hasOtherPermission(CommandSender sender) {
return pluginRef.getPermissionTools().mcrefreshOthers(sender);
}
@Override
protected boolean hasSelfPermission(CommandSender sender) {
return pluginRef.getPermissionTools().mcrefresh(sender);
}
@Override
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
mcMMOPlayer.setRecentlyHurt(0);
mcMMOPlayer.resetCooldowns();
mcMMOPlayer.resetToolPrepMode();
mcMMOPlayer.resetSuperAbilityMode();
mcMMOPlayer.getPlayer().sendMessage(pluginRef.getLocaleManager().getString("Ability.Generic.Refresh"));
}
@Override
protected void sendSuccessMessage(CommandSender sender, String playerName) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mcrefresh.Success", playerName));
}
}

View File

@@ -1,49 +0,0 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.database.FlatFileDatabaseManager;
import com.gmail.nossr50.database.SQLDatabaseManager;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import java.util.List;
public class ResetUserHealthBarSettingsCommand implements TabExecutor {
private final mcMMO pluginRef;
public ResetUserHealthBarSettingsCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (pluginRef.getDatabaseManager() instanceof SQLDatabaseManager) {
SQLDatabaseManager sqlDatabaseManager = (SQLDatabaseManager) pluginRef.getDatabaseManager();
sqlDatabaseManager.resetMobHealthSettings();
for (McMMOPlayer player : pluginRef.getUserManager().getPlayers()) {
player.getProfile().setMobHealthbarType(pluginRef.getConfigManager().getConfigMobs().getCombat().getHealthBars().getDisplayBarType());
}
sender.sendMessage("Mob health reset");
return true;
}
if (pluginRef.getDatabaseManager() instanceof FlatFileDatabaseManager) {
FlatFileDatabaseManager flatFileDatabaseManager = (FlatFileDatabaseManager) pluginRef.getDatabaseManager();
flatFileDatabaseManager.resetMobHealthSettings();
for (McMMOPlayer player : pluginRef.getUserManager().getPlayers()) {
player.getProfile().setMobHealthbarType(pluginRef.getConfigManager().getConfigMobs().getCombat().getHealthBars().getDisplayBarType());
}
sender.sendMessage("Mob health reset");
return true;
}
return false;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return ImmutableList.of();
}
}

View File

@@ -1,92 +0,0 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
public class ScoreboardCommand implements TabExecutor {
private final mcMMO pluginRef;
public ScoreboardCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
private static final List<String> FIRST_ARGS = ImmutableList.of("keep", "time", "clear");
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
switch (args.length) {
case 1:
if (args[0].equalsIgnoreCase("clear") || args[0].equalsIgnoreCase("reset")) {
pluginRef.getScoreboardManager().clearBoard(sender.getName());
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Scoreboard.Clear"));
return true;
}
if (args[0].equalsIgnoreCase("keep")) {
if (!pluginRef.getScoreboardSettings().getScoreboardsEnabled()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Disabled"));
return true;
}
if (!pluginRef.getScoreboardManager().isBoardShown(sender.getName())) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Scoreboard.NoBoard"));
return true;
}
pluginRef.getScoreboardManager().keepBoard(sender.getName());
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Scoreboard.Keep"));
return true;
}
return help(sender);
case 2:
if (args[0].equalsIgnoreCase("time") || args[0].equalsIgnoreCase("timer")) {
if (pluginRef.getCommandTools().isInvalidInteger(sender, args[1])) {
return true;
}
int time = Math.abs(Integer.parseInt(args[1]));
pluginRef.getScoreboardManager().setRevertTimer(sender.getName(), time);
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Scoreboard.Timer", time));
return true;
}
return help(sender);
default:
return help(sender);
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], FIRST_ARGS, new ArrayList<>(FIRST_ARGS.size()));
default:
return ImmutableList.of();
}
}
private boolean help(CommandSender sender) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Scoreboard.Help.0"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Scoreboard.Help.1"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Scoreboard.Help.2"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Scoreboard.Help.3"));
return true;
}
}

View File

@@ -1,87 +0,0 @@
package com.gmail.nossr50.commands;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
public abstract class ToggleCommand implements TabExecutor {
protected mcMMO pluginRef;
public ToggleCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (!hasSelfPermission(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (!pluginRef.getCommandTools().hasPlayerDataKey(sender)) {
return true;
}
applyCommandAction(pluginRef.getUserManager().getPlayer(sender.getName()));
return true;
case 1:
if (!hasOtherPermission(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
String playerName = pluginRef.getCommandTools().getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(playerName);
if (!pluginRef.getCommandTools().checkPlayerExistence(sender, playerName, mcMMOPlayer)) {
return true;
}
//TODO: Does it matter if they are offline?
/*if (pluginRef.getCommandTools().isOffline(sender, mcMMOPlayer.getPlayer())) {
return true;
}*/
applyCommandAction(mcMMOPlayer);
sendSuccessMessage(sender, playerName);
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
List<String> playerNames = pluginRef.getCommandTools().getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
default:
return ImmutableList.of();
}
}
protected abstract boolean hasOtherPermission(CommandSender sender);
protected abstract boolean hasSelfPermission(CommandSender sender);
protected abstract void applyCommandAction(McMMOPlayer mcMMOPlayer);
protected abstract void sendSuccessMessage(CommandSender sender, String playerName);
}

View File

@@ -1,93 +0,0 @@
package com.gmail.nossr50.commands.admin;
import co.aikar.commands.BaseCommand;
import co.aikar.commands.annotation.*;
import com.gmail.nossr50.mcMMO;
import net.kyori.text.TextComponent;
import net.kyori.text.adapter.bukkit.TextAdapter;
import net.kyori.text.format.TextColor;
import net.kyori.text.serializer.gson.GsonComponentSerializer;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
@CommandAlias("nbttools")
@Description("Read or Modify values of NBT on an item in-hand")
public class NBTToolsCommand extends BaseCommand {
public static final String STYLE_TEXT_1 = "//////////";
@Dependency
private mcMMO plugin;
@Default
@CommandPermission("mcmmo.commands.nbttools")
public void onCommand(Player player) {
//TODO: Add some help messages
player.sendMessage("hi");
}
/**
* Show the NBT tags of an item in hand
*/
@Subcommand("tags show")
public void onShowTags(Player player) {
final TextComponent textComponent = TextComponent.builder()
.content(plugin.getLocaleManager().getString("mcMMO.Template.Prefix"))
.append("NBT Tools")
.color(TextColor.GOLD)
.append(" - ")
.append("Showing NBT Tags (")
.append(player.getInventory().getItemInMainHand().getType().getKey().toString())
.color(TextColor.GREEN)
.append(")")
.color(TextColor.GOLD)
.append(TextComponent.newline())
.build();
String json = GsonComponentSerializer.INSTANCE.serialize(textComponent);
TextAdapter.sendMessage(player, textComponent);
//Show NBT tags to player
player.sendMessage(STYLE_TEXT_1 + " NBT TOOLS " + STYLE_TEXT_1);
player.sendMessage("NBT Analysis: " + player.getInventory().getItemInMainHand().getType().getKey().toString());
player.sendMessage(STYLE_TEXT_1 + STYLE_TEXT_1);
plugin.getNbtManager().printNBT(player.getInventory().getItemInMainHand(), player);
player.sendMessage(ChatColor.GRAY + "NBT Analysis completed!");
}
@Subcommand("tags set")
public void onAddTags(Player player, String[] args) {
if(args.length == 0) {
player.sendMessage("No arguments provided!");
} else if(args.length == 1) {
player.sendMessage("Not enough arguments provided!");
} else {
player.sendMessage("Modifying NBT on item in hand...");
String targetTag = args[0];
//Check for the tag
}
}
@Subcommand("tags remove")
public void onRemoveTags(Player player, String[] args) {
if(args.length == 0) {
player.sendMessage("No arguments provided!");
} else if(args.length == 1) {
player.sendMessage("Not enough arguments provided!");
} else {
player.sendMessage("Modifying NBT on item in hand...");
String targetTag = args[0];
//Check for the tag
}
}
@Subcommand("tags clear")
public void onClearTags(Player player) {
//Clear all NBT tags that fall under "tag" on the item
player.sendMessage("Clearing NBT on item...");
}
}

View File

@@ -1,37 +0,0 @@
package com.gmail.nossr50.commands.admin;
import co.aikar.commands.BaseCommand;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.Default;
import co.aikar.commands.annotation.Dependency;
import co.aikar.commands.annotation.Description;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandAlias("mmodebug")
@Description("Puts the player into debug mode, which helps problem solve bugs in mcMMO.")
public class PlayerDebugCommand extends BaseCommand {
@Dependency
private mcMMO plugin;
@Default
public void onCommand(CommandSender sender) {
if(sender instanceof Player) {
McMMOPlayer mcMMOPlayer = plugin.getUserManager().getPlayer((Player) sender);
if(mcMMOPlayer == null)
return;
mcMMOPlayer.toggleDebugMode(); //Toggle debug mode
plugin.getNotificationManager().sendPlayerInformationChatOnlyPrefixed(mcMMOPlayer.getPlayer(), "Commands.Mmodebug.Toggle", String.valueOf(mcMMOPlayer.isDebugMode()));
} else {
//TODO: Localize
sender.sendMessage("Players only");
}
}
}

View File

@@ -1,36 +0,0 @@
package com.gmail.nossr50.commands.admin;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
/**
* @author Mark Vainomaa
*/
public final class ReloadLocaleCommand implements CommandExecutor {
private final mcMMO pluginRef;
public ReloadLocaleCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length == 0) {
if (!pluginRef.getPermissionTools().reloadlocale(sender)) {
if(command.getPermissionMessage() != null)
sender.sendMessage(command.getPermissionMessage());
return true;
}
pluginRef.getLocaleManager().reloadLocale();
sender.sendMessage(pluginRef.getLocaleManager().getString("Locale.Reloaded"));
return true;
}
return false;
}
}

View File

@@ -1,16 +0,0 @@
package com.gmail.nossr50.commands.chat;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
public class AdminChatCommand extends ChatCommand {
public AdminChatCommand(mcMMO pluginRef) {
super(ChatMode.ADMIN, pluginRef);
}
@Override
protected void handleChatSending(CommandSender sender, String[] args) {
pluginRef.getChatManager().processAdminChat(sender.getName(), getDisplayName(sender), buildChatMessage(args, 0));
}
}

View File

@@ -1,159 +0,0 @@
package com.gmail.nossr50.commands.chat;
import com.gmail.nossr50.commands.CommandConstants;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
public abstract class ChatCommand implements TabExecutor {
private ChatMode chatMode;
protected mcMMO pluginRef;
ChatCommand(ChatMode chatMode, mcMMO pluginRef) {
this.chatMode = chatMode;
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
McMMOPlayer mcMMOPlayer;
switch (args.length) {
case 0:
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (!pluginRef.getCommandTools().hasPlayerDataKey(sender)) {
return true;
}
mcMMOPlayer = pluginRef.getUserManager().getPlayer(sender.getName());
if (mcMMOPlayer.isChatEnabled(chatMode)) {
disableChatMode(mcMMOPlayer, sender);
} else {
enableChatMode(mcMMOPlayer, sender);
}
return true;
case 1:
if (pluginRef.getCommandTools().shouldEnableToggle(args[0])) {
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (!pluginRef.getCommandTools().hasPlayerDataKey(sender)) {
return true;
}
enableChatMode(pluginRef.getUserManager().getPlayer(sender.getName()), sender);
return true;
}
if (pluginRef.getCommandTools().shouldDisableToggle(args[0])) {
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (!pluginRef.getCommandTools().hasPlayerDataKey(sender)) {
return true;
}
disableChatMode(pluginRef.getUserManager().getPlayer(sender.getName()), sender);
return true;
}
// Fallthrough
default:
handleChatSending(sender, args);
return true;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], CommandConstants.TRUE_FALSE_OPTIONS, new ArrayList<>(CommandConstants.TRUE_FALSE_OPTIONS.size()));
default:
return ImmutableList.of();
}
}
protected String buildChatMessage(String[] args, int index) {
StringBuilder builder = new StringBuilder();
builder.append(args[index]);
for (int i = index + 1; i < args.length; i++) {
builder.append(" ");
builder.append(args[i]);
}
return builder.toString();
}
protected String getDisplayName(CommandSender sender) {
return (sender instanceof Player) ? ((Player) sender).getDisplayName() : pluginRef.getLocaleManager().getString("Commands.Chat.Console");
}
protected abstract void handleChatSending(CommandSender sender, String[] args);
private void enableChatMode(McMMOPlayer mcMMOPlayer, CommandSender sender) {
if (chatMode == ChatMode.PARTY && mcMMOPlayer.getParty() == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.None"));
return;
}
if (chatMode == ChatMode.PARTY && (mcMMOPlayer.getParty().getLevel() < pluginRef.getPartyManager().getPartyFeatureUnlockLevel(PartyFeature.CHAT))) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Feature.Disabled.1"));
return;
}
mcMMOPlayer.enableChat(chatMode);
sender.sendMessage(getChatModeEnabledMessage(chatMode, true));
}
private void disableChatMode(McMMOPlayer mcMMOPlayer, CommandSender sender) {
if (chatMode == ChatMode.PARTY && mcMMOPlayer.getParty() == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.None"));
return;
}
mcMMOPlayer.disableChat(chatMode);
sender.sendMessage(getChatModeEnabledMessage(chatMode, false));
}
private String getChatModeEnabledMessage(ChatMode chatMode, boolean enabled) {
switch(chatMode) {
case ADMIN:
return getAdminMessage(enabled);
default:
return getPartyMessage(enabled);
}
}
private String getAdminMessage(boolean enabled) {
if(enabled)
return pluginRef.getLocaleManager().getString("Commands.AdminChat.On");
else
return pluginRef.getLocaleManager().getString("Commands.AdminChat.Off");
}
private String getPartyMessage(boolean enabled) {
if(enabled)
return pluginRef.getLocaleManager().getString("Commands.Party.Chat.On");
else
return pluginRef.getLocaleManager().getString("Commands.Party.Chat.Off");
}
}

View File

@@ -1,34 +0,0 @@
package com.gmail.nossr50.commands.chat;
import com.gmail.nossr50.commands.ToggleCommand;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
public class ChatSpyCommand extends ToggleCommand {
public ChatSpyCommand(mcMMO pluginRef) {
super(pluginRef);
}
@Override
protected boolean hasOtherPermission(CommandSender sender) {
return pluginRef.getPermissionTools().adminChatSpyOthers(sender);
}
@Override
protected boolean hasSelfPermission(CommandSender sender) {
return pluginRef.getPermissionTools().adminChatSpy(sender);
}
@Override
protected void applyCommandAction(McMMOPlayer mcMMOPlayer) {
mcMMOPlayer.getPlayer().sendMessage(pluginRef.getLocaleManager().getString("Commands.AdminChatSpy." + (mcMMOPlayer.isPartyChatSpying() ? "Disabled" : "Enabled")));
mcMMOPlayer.togglePartyChatSpying();
}
@Override
protected void sendSuccessMessage(CommandSender sender, String playerName) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.AdminChatSpy.Toggle", playerName));
}
}

View File

@@ -1,56 +0,0 @@
package com.gmail.nossr50.commands.chat;
import com.gmail.nossr50.datatypes.chat.ChatMode;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyChatCommand extends ChatCommand {
public PartyChatCommand(mcMMO pluginRef) {
super(ChatMode.PARTY, pluginRef);
}
@Override
protected void handleChatSending(CommandSender sender, String[] args) {
Party party;
String message;
if (sender instanceof Player) {
//Check if player profile is loaded
if (pluginRef.getUserManager().getPlayer((Player) sender) == null)
return;
party = pluginRef.getUserManager().getPlayer((Player) sender).getParty();
if (party == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.None"));
return;
}
if (party.getLevel() < pluginRef.getPartyManager().getPartyFeatureUnlockLevel(PartyFeature.CHAT)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Feature.Disabled.1"));
return;
}
message = buildChatMessage(args, 0);
} else {
if (args.length < 2) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Specify"));
return;
}
party = pluginRef.getPartyManager().getParty(args[0]);
if (party == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.InvalidName"));
return;
}
message = buildChatMessage(args, 1);
}
pluginRef.getChatManager().processPartyChat(party, getDisplayName(sender), message);
}
}

View File

@@ -1,93 +0,0 @@
package com.gmail.nossr50.commands.database;
import com.gmail.nossr50.database.DatabaseManager;
import com.gmail.nossr50.datatypes.database.DatabaseType;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.database.DatabaseConversionTask;
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class ConvertDatabaseCommand implements CommandExecutor {
private final mcMMO pluginRef;
public ConvertDatabaseCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
DatabaseType previousType = getDatabaseType(args[1]);
DatabaseType newType = pluginRef.getDatabaseManager().getDatabaseType();
if (previousType == newType || (newType == DatabaseType.CUSTOM && pluginRef.getDatabaseManagerFactory().getCustomDatabaseManagerClass().getSimpleName().equalsIgnoreCase(args[1]))) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mcconvert.Database.Same", newType.toString()));
return true;
}
DatabaseManager oldDatabase = pluginRef.getDatabaseManagerFactory().createDatabaseManager(previousType);
if (previousType == DatabaseType.CUSTOM) {
Class<?> clazz;
try {
clazz = Class.forName(args[1]);
if (!DatabaseManager.class.isAssignableFrom(clazz)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mcconvert.Database.InvalidType", args[1]));
return true;
}
oldDatabase = pluginRef.getDatabaseManagerFactory().createCustomDatabaseManager((Class<? extends DatabaseManager>) clazz);
} catch (Throwable e) {
e.printStackTrace();
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mcconvert.Database.InvalidType", args[1]));
return true;
}
}
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mcconvert.Database.Start", previousType.toString(), newType.toString()));
pluginRef.getUserManager().saveAll();
pluginRef.getUserManager().clearAll();
for (Player player : pluginRef.getServer().getOnlinePlayers()) {
PlayerProfile profile = oldDatabase.loadPlayerProfile(player.getUniqueId());
if (profile.isLoaded()) {
pluginRef.getDatabaseManager().saveUser(profile);
}
new PlayerProfileLoadingTask(pluginRef, player).runTaskLaterAsynchronously(pluginRef, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
}
new DatabaseConversionTask(pluginRef, oldDatabase, sender, previousType.toString(), newType.toString()).runTaskAsynchronously(pluginRef);
return true;
default:
return false;
}
}
public DatabaseType getDatabaseType(String typeName) {
for (DatabaseType type : DatabaseType.values()) {
if (type.name().equalsIgnoreCase(typeName)) {
return type;
}
}
if (typeName.equalsIgnoreCase("file")) {
return DatabaseType.FLATFILE;
} else if (typeName.equalsIgnoreCase("mysql")) {
return DatabaseType.SQL;
}
return DatabaseType.CUSTOM;
}
}

View File

@@ -1,59 +0,0 @@
package com.gmail.nossr50.commands.database;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class McremoveCommand implements TabExecutor {
private final mcMMO pluginRef;
public McremoveCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length == 1) {
String playerName = pluginRef.getCommandTools().getMatchedPlayerName(args[0]);
if (pluginRef.getUserManager().getOfflinePlayer(playerName) == null && pluginRef.getCommandTools().unloadedProfile(sender, pluginRef.getDatabaseManager().loadPlayerProfile(playerName, false))) {
return true;
}
UUID uuid = null;
if (Bukkit.getPlayer(playerName) != null) {
uuid = Bukkit.getPlayer(playerName).getUniqueId();
}
if (pluginRef.getDatabaseManager().removeUser(playerName, uuid)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mcremove.Success", playerName));
} else {
sender.sendMessage(playerName + " could not be removed from the database."); // Pretty sure this should NEVER happen.
}
return true;
}
return false;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
List<String> playerNames = pluginRef.getCommandTools().getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
default:
return ImmutableList.of();
}
}
}

View File

@@ -1,41 +0,0 @@
package com.gmail.nossr50.commands.database;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import java.util.List;
public class PurgeCommand implements TabExecutor {
private final mcMMO pluginRef;
public PurgeCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
pluginRef.getDatabaseManager().purgePowerlessUsers();
if (pluginRef.getDatabaseCleaningSettings().getOldUserCutoffMonths() != -1) {
pluginRef.getDatabaseManager().purgeOldUsers();
}
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mcpurge.Success"));
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return ImmutableList.of();
}
}

View File

@@ -1,39 +0,0 @@
package com.gmail.nossr50.commands.database;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import java.util.List;
public class ShowDatabaseCommand implements TabExecutor {
private final mcMMO pluginRef;
public ShowDatabaseCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length == 0) {
Class<?> clazz = pluginRef.getDatabaseManagerFactory().getCustomDatabaseManagerClass();
if (clazz != null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mmoshowdb", clazz.getName()));
return true;
}
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mmoshowdb", (pluginRef.getMySQLConfigSettings().isMySQLEnabled() ? "sql" : "flatfile")));
return true;
}
return false;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return ImmutableList.of();
}
}

View File

@@ -1,48 +0,0 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class AddLevelsCommand extends ExperienceCommand {
public AddLevelsCommand(mcMMO pluginRef) {
super(pluginRef);
}
@Override
protected boolean permissionsCheckSelf(CommandSender sender) {
return pluginRef.getPermissionTools().addlevels(sender);
}
@Override
protected boolean permissionsCheckOthers(CommandSender sender) {
return pluginRef.getPermissionTools().addlevelsOthers(sender);
}
@Override
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
double xpRemoved = profile.getSkillXpLevelRaw(skill);
profile.addLevels(skill, value);
if (player == null) {
profile.scheduleAsyncSave();
return;
}
pluginRef.getEventManager().tryLevelChangeEvent(player, skill, value, xpRemoved, true, XPGainReason.COMMAND);
}
@Override
protected void handlePlayerMessageAll(Player player, int value) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.addlevels.AwardAll.1", value));
}
@Override
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.addlevels.AwardSkill.1", value, pluginRef.getSkillTools().getLocalizedSkillName(skill)));
}
}

View File

@@ -1,51 +0,0 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.database.FormulaConversionTask;
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class ConvertExperienceCommand implements CommandExecutor {
private final mcMMO pluginRef;
public ConvertExperienceCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
for(FormulaType formulaType : FormulaType.values()) {
if(formulaType.toString().equalsIgnoreCase(args[1])) {
FormulaType previousType = formulaType;
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mcconvert.Experience.Start", previousType.toString(), pluginRef.getConfigManager().getConfigLeveling().getFormulaType().toString()));
pluginRef.getUserManager().saveAll();
pluginRef.getUserManager().clearAll();
new FormulaConversionTask(pluginRef, sender, previousType).runTaskLater(pluginRef, 1);
for (Player player : pluginRef.getServer().getOnlinePlayers()) {
new PlayerProfileLoadingTask(pluginRef, player).runTaskLaterAsynchronously(pluginRef, 1); // 1 Tick delay to ensure the player is marked as online before we begin loading
}
return true;
}
}
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.mcconvert.Experience.Invalid"));
return true;
default:
return false;
}
}
}

View File

@@ -1,171 +0,0 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public abstract class ExperienceCommand implements TabExecutor {
protected mcMMO pluginRef;
public ExperienceCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
protected void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) {
if (skill == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.addlevels.AwardAll.2", playerName));
} else {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.addlevels.AwardSkill.2", pluginRef.getSkillTools().getLocalizedSkillName(skill), playerName));
}
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
PrimarySkillType skill;
switch (args.length) {
case 2:
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (!permissionsCheckSelf(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (!validateArguments(sender, args[0], args[1])) {
return true;
}
skill = pluginRef.getSkillTools().matchSkill(args[0]);
if (args[1].equalsIgnoreCase("all")) {
skill = null;
}
if (skill != null && pluginRef.getSkillTools().isChildSkill(skill)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Skill.ChildSkill"));
return true;
}
//Profile not loaded
if (pluginRef.getUserManager().getPlayer(sender.getName()) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
editValues((Player) sender, pluginRef.getUserManager().getPlayer(sender.getName()).getProfile(), skill, Integer.parseInt(args[1]));
return true;
case 3:
if (!permissionsCheckOthers(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (!validateArguments(sender, args[1], args[2])) {
return true;
}
skill = pluginRef.getSkillTools().matchSkill(args[1]);
if (args[1].equalsIgnoreCase("all")) {
skill = null;
}
if (skill != null && pluginRef.getSkillTools().isChildSkill(skill)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Skill.ChildSkill"));
return true;
}
int value = Integer.parseInt(args[2]);
String playerName = pluginRef.getCommandTools().getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {
UUID uuid = null;
OfflinePlayer player = pluginRef.getServer().getOfflinePlayer(playerName);
if (player != null) {
uuid = player.getUniqueId();
}
PlayerProfile profile = pluginRef.getDatabaseManager().loadPlayerProfile(playerName, uuid, false);
if (pluginRef.getCommandTools().unloadedProfile(sender, profile)) {
return true;
}
editValues(null, profile, skill, value);
} else {
editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill, value);
}
handleSenderMessage(sender, playerName, skill);
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
List<String> playerNames = pluginRef.getCommandTools().getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], pluginRef.getSkillTools().LOCALIZED_SKILL_NAMES, new ArrayList<>(pluginRef.getSkillTools().LOCALIZED_SKILL_NAMES.size()));
default:
return ImmutableList.of();
}
}
protected abstract boolean permissionsCheckSelf(CommandSender sender);
protected abstract boolean permissionsCheckOthers(CommandSender sender);
protected abstract void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value);
protected abstract void handlePlayerMessageAll(Player player, int value);
protected abstract void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill);
private boolean validateArguments(CommandSender sender, String skillName, String value) {
return !(pluginRef.getCommandTools().isInvalidInteger(sender, value) || (!skillName.equalsIgnoreCase("all") && pluginRef.getCommandTools().isInvalidSkill(sender, skillName)));
}
protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
if (skill == null) {
for (PrimarySkillType primarySkillType : pluginRef.getSkillTools().NON_CHILD_SKILLS) {
handleCommand(player, profile, primarySkillType, value);
}
if (player != null) {
handlePlayerMessageAll(player, value);
}
} else {
handleCommand(player, profile, skill, value);
if (player != null) {
handlePlayerMessageSkill(player, value, skill);
}
}
}
}

View File

@@ -1,53 +0,0 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class SkillEditCommand extends ExperienceCommand {
public SkillEditCommand(mcMMO pluginRef) {
super(pluginRef);
}
@Override
protected boolean permissionsCheckSelf(CommandSender sender) {
return pluginRef.getPermissionTools().mmoedit(sender);
}
@Override
protected boolean permissionsCheckOthers(CommandSender sender) {
return pluginRef.getPermissionTools().mmoeditOthers(sender);
}
@Override
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
int skillLevel = profile.getSkillLevel(skill);
double xpRemoved = profile.getSkillXpLevelRaw(skill);
profile.modifySkill(skill, value);
if (player == null) {
profile.scheduleAsyncSave();
return;
}
if (value == skillLevel) {
return;
}
pluginRef.getEventManager().tryLevelEditEvent(player, skill, value, xpRemoved, value > skillLevel, XPGainReason.COMMAND, skillLevel);
}
@Override
protected void handlePlayerMessageAll(Player player, int value) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.mmoedit.AllSkills.1", value));
}
@Override
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.mmoedit.Modified.1", pluginRef.getSkillTools().getLocalizedSkillName(skill), value));
}
}

View File

@@ -1,176 +0,0 @@
package com.gmail.nossr50.commands.experience;
import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* This class mirrors the structure of ExperienceCommand, except the
* value/quantity argument is removed.
*/
public class SkillResetCommand implements TabExecutor {
private final mcMMO pluginRef;
public SkillResetCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
protected void handleSenderMessage(CommandSender sender, String playerName, PrimarySkillType skill) {
if (skill == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.addlevels.AwardAll.2", playerName));
} else {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.addlevels.AwardSkill.2", pluginRef.getSkillTools().getLocalizedSkillName(skill), playerName));
}
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
PrimarySkillType skill;
switch (args.length) {
case 1:
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (!permissionsCheckSelf(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (!validateArguments(sender, args[0])) {
return true;
}
if (args[0].equalsIgnoreCase("all")) {
skill = null;
} else {
skill = pluginRef.getSkillTools().matchSkill(args[1]);
}
editValues((Player) sender, pluginRef.getUserManager().getPlayer(sender.getName()).getProfile(), skill);
return true;
case 2:
if (!permissionsCheckOthers(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (!validateArguments(sender, args[1])) {
return true;
}
if (args[1].equalsIgnoreCase("all")) {
skill = null;
} else {
skill = pluginRef.getSkillTools().matchSkill(args[1]);
}
String playerName = pluginRef.getCommandTools().getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {
UUID uuid = null;
OfflinePlayer player = pluginRef.getServer().getOfflinePlayer(playerName);
if (player != null) {
uuid = player.getUniqueId();
}
PlayerProfile profile = pluginRef.getDatabaseManager().loadPlayerProfile(playerName, uuid, false);
if (pluginRef.getCommandTools().unloadedProfile(sender, profile)) {
return true;
}
editValues(null, profile, skill);
} else {
editValues(mcMMOPlayer.getPlayer(), mcMMOPlayer.getProfile(), skill);
}
handleSenderMessage(sender, playerName, skill);
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
List<String> playerNames = pluginRef.getCommandTools().getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
case 2:
return StringUtil.copyPartialMatches(args[1], pluginRef.getSkillTools().LOCALIZED_SKILL_NAMES, new ArrayList<>(pluginRef.getSkillTools().LOCALIZED_SKILL_NAMES.size()));
default:
return ImmutableList.of();
}
}
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill) {
int levelsRemoved = profile.getSkillLevel(skill);
double xpRemoved = profile.getSkillXpLevelRaw(skill);
profile.modifySkill(skill, 0);
if (player == null) {
profile.scheduleAsyncSave();
return;
}
pluginRef.getEventManager().tryLevelChangeEvent(player, skill, levelsRemoved, xpRemoved, false, XPGainReason.COMMAND);
}
protected boolean permissionsCheckSelf(CommandSender sender) {
return pluginRef.getPermissionTools().skillreset(sender);
}
protected boolean permissionsCheckOthers(CommandSender sender) {
return pluginRef.getPermissionTools().skillresetOthers(sender);
}
protected void handlePlayerMessageAll(Player player) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Reset.All"));
}
protected void handlePlayerMessageSkill(Player player, PrimarySkillType skill) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Reset.Single", pluginRef.getSkillTools().getLocalizedSkillName(skill)));
}
private boolean validateArguments(CommandSender sender, String skillName) {
return skillName.equalsIgnoreCase("all") || !pluginRef.getCommandTools().isInvalidSkill(sender, skillName);
}
protected void editValues(Player player, PlayerProfile profile, PrimarySkillType skill) {
if (skill == null) {
for (PrimarySkillType primarySkillType : pluginRef.getSkillTools().NON_CHILD_SKILLS) {
handleCommand(player, profile, primarySkillType);
}
if (player != null) {
handlePlayerMessageAll(player);
}
} else {
handleCommand(player, profile, skill);
if (player != null) {
handlePlayerMessageSkill(player, skill);
}
}
}
}

View File

@@ -1,48 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyAcceptCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyAcceptCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length == 1) {
Player player = (Player) sender;
//Check if player profile is loaded
if (pluginRef.getUserManager().getPlayer(player) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (!mcMMOPlayer.hasPartyInvite()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("mcMMO.NoInvites"));
return true;
}
// Changing parties
if (!pluginRef.getPartyManager().changeOrJoinParty(mcMMOPlayer, mcMMOPlayer.getPartyInvite().getName())) {
return true;
}
pluginRef.getPartyManager().joinInvitedParty(mcMMOPlayer);
return true;
}
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "party", "accept"));
return true;
}
}

View File

@@ -1,46 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.mcMMO;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyChangeOwnerCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyChangeOwnerCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
//Check if player profile is loaded
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Party playerParty = pluginRef.getUserManager().getPlayer((Player) sender).getParty();
String targetName = pluginRef.getCommandTools().getMatchedPlayerName(args[1]);
OfflinePlayer target = pluginRef.getServer().getOfflinePlayer(targetName);
if (!playerParty.hasMember(target.getUniqueId())) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.NotInYourParty", targetName));
return true;
}
pluginRef.getPartyManager().setPartyLeader(target.getUniqueId(), playerParty);
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "owner", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + ">"));
return true;
}
}
}

View File

@@ -1,279 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.commands.CommandConstants;
import com.gmail.nossr50.commands.chat.PartyChatCommand;
import com.gmail.nossr50.commands.party.alliance.PartyAllianceCommand;
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
//TODO: This class horrifies me, rewrite it at some point
public class PartyCommand implements TabExecutor {
private final mcMMO pluginRef;
private CommandExecutor partyJoinCommand;
private CommandExecutor partyAcceptCommand;
private CommandExecutor partyCreateCommand;
private CommandExecutor partyQuitCommand;
private CommandExecutor partyXpShareCommand;
private CommandExecutor partyItemShareCommand;
private CommandExecutor partyInviteCommand;
private CommandExecutor partyKickCommand;
private CommandExecutor partyDisbandCommand;
private CommandExecutor partyChangeOwnerCommand;
private CommandExecutor partyLockCommand;
private CommandExecutor partyChangePasswordCommand;
private CommandExecutor partyRenameCommand;
private CommandExecutor partyInfoCommand;
private CommandExecutor partyHelpCommand;
private CommandExecutor partyTeleportCommand;
private CommandExecutor partyChatCommand;
private CommandExecutor partyAllianceCommand;
public PartyCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
initSubCommandList();
partyJoinCommand = new PartyJoinCommand(pluginRef);
partyAcceptCommand = new PartyAcceptCommand(pluginRef);
partyCreateCommand = new PartyCreateCommand(pluginRef);
partyQuitCommand = new PartyQuitCommand(pluginRef);
partyXpShareCommand = new PartyXpShareCommand(pluginRef);
partyItemShareCommand = new PartyItemShareCommand(pluginRef);
partyInviteCommand = new PartyInviteCommand(pluginRef);
partyKickCommand = new PartyKickCommand(pluginRef);
partyDisbandCommand = new PartyDisbandCommand(pluginRef);
partyChangeOwnerCommand = new PartyChangeOwnerCommand(pluginRef);
partyLockCommand = new PartyLockCommand(pluginRef);
partyChangePasswordCommand = new PartyChangePasswordCommand(pluginRef);
partyRenameCommand = new PartyRenameCommand(pluginRef);
partyInfoCommand = new PartyInfoCommand(pluginRef);
partyHelpCommand = new PartyHelpCommand(pluginRef);
partyTeleportCommand = new PtpCommand(pluginRef);
partyChatCommand = new PartyChatCommand(pluginRef);
partyAllianceCommand = new PartyAllianceCommand(pluginRef);
}
private List<String> PARTY_SUBCOMMANDS;
private final List<String> XPSHARE_COMPLETIONS = ImmutableList.of("none", "equal");
private final List<String> ITEMSHARE_COMPLETIONS = ImmutableList.of("none", "equal", "random", "loot", "mining", "herbalism", "woodcutting", "misc");
private void initSubCommandList() {
ArrayList<String> subcommands = new ArrayList<>();
for (PartySubcommandType subcommand : PartySubcommandType.values()) {
subcommands.add(subcommand.toString());
}
Collections.sort(subcommands);
PARTY_SUBCOMMANDS = ImmutableList.copyOf(subcommands);
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
//If the party system is disabled, don't fire this command
if (!pluginRef.getConfigManager().getConfigParty().isPartySystemEnabled())
return true;
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (!pluginRef.getPermissionTools().party(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
Player player = (Player) sender;
if (!pluginRef.getUserManager().hasPlayerDataKey(player)) {
return true;
}
if (pluginRef.getUserManager().getPlayer(player) == null) {
player.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (args.length < 1) {
if (!mcMMOPlayer.inParty()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.None"));
return printUsage(player);
}
return partyInfoCommand.onCommand(sender, command, label, args);
}
PartySubcommandType subcommand = PartySubcommandType.getSubcommand(args[0]);
if (subcommand == null) {
return printUsage(player);
}
// Can't use this for lock/unlock since they're handled by the same command
if (subcommand != PartySubcommandType.LOCK && subcommand != PartySubcommandType.UNLOCK && !pluginRef.getPermissionTools().partySubcommand(sender, subcommand)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
switch (subcommand) {
case JOIN:
return partyJoinCommand.onCommand(sender, command, label, args);
case ACCEPT:
return partyAcceptCommand.onCommand(sender, command, label, args);
case CREATE:
return partyCreateCommand.onCommand(sender, command, label, args);
case HELP:
return partyHelpCommand.onCommand(sender, command, label, args);
default:
break;
}
// Party member commands
if (!mcMMOPlayer.inParty()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.None"));
return printUsage(player);
}
switch (subcommand) {
case INFO:
return partyInfoCommand.onCommand(sender, command, label, args);
case QUIT:
return partyQuitCommand.onCommand(sender, command, label, args);
case INVITE:
return partyInviteCommand.onCommand(sender, command, label, args);
case TELEPORT:
return partyTeleportCommand.onCommand(sender, command, label, extractArgs(args));
case CHAT:
return partyChatCommand.onCommand(sender, command, label, extractArgs(args));
default:
break;
}
// Party leader commands
if (!mcMMOPlayer.getParty().getLeader().getUniqueId().equals(player.getUniqueId())) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.NotOwner"));
return true;
}
switch (subcommand) {
case XPSHARE:
return partyXpShareCommand.onCommand(sender, command, label, args);
case ITEMSHARE:
return partyItemShareCommand.onCommand(sender, command, label, args);
case KICK:
return partyKickCommand.onCommand(sender, command, label, args);
case DISBAND:
return partyDisbandCommand.onCommand(sender, command, label, args);
case OWNER:
return partyChangeOwnerCommand.onCommand(sender, command, label, args);
case LOCK:
case UNLOCK:
return partyLockCommand.onCommand(sender, command, label, args);
case PASSWORD:
return partyChangePasswordCommand.onCommand(sender, command, label, args);
case RENAME:
return partyRenameCommand.onCommand(sender, command, label, args);
case ALLIANCE:
return partyAllianceCommand.onCommand(sender, command, label, args);
default:
break;
}
return true;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], PARTY_SUBCOMMANDS, new ArrayList<>(PARTY_SUBCOMMANDS.size()));
case 2:
PartySubcommandType subcommand = PartySubcommandType.getSubcommand(args[0]);
if (subcommand == null) {
return ImmutableList.of();
}
switch (subcommand) {
case JOIN:
case INVITE:
case KICK:
case OWNER:
List<String> playerNames = pluginRef.getCommandTools().getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<>(playerNames.size()));
case XPSHARE:
return StringUtil.copyPartialMatches(args[1], XPSHARE_COMPLETIONS, new ArrayList<>(XPSHARE_COMPLETIONS.size()));
case ITEMSHARE:
return StringUtil.copyPartialMatches(args[1], ITEMSHARE_COMPLETIONS, new ArrayList<>(ITEMSHARE_COMPLETIONS.size()));
case LOCK:
case CHAT:
return StringUtil.copyPartialMatches(args[1], CommandConstants.TRUE_FALSE_OPTIONS, new ArrayList<>(CommandConstants.TRUE_FALSE_OPTIONS.size()));
case PASSWORD:
return StringUtil.copyPartialMatches(args[1], CommandConstants.RESET_OPTIONS, new ArrayList<>(CommandConstants.RESET_OPTIONS.size()));
case TELEPORT:
List<String> matches = StringUtil.copyPartialMatches(args[1], CommandConstants.TELEPORT_SUBCOMMANDS, new ArrayList<>(CommandConstants.TELEPORT_SUBCOMMANDS.size()));
if (matches.size() == 0) {
Player player = (Player) sender;
//Not Loaded
if (pluginRef.getUserManager().getPlayer(player) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return ImmutableList.of();
}
Party party = pluginRef.getUserManager().getPlayer(player).getParty();
playerNames = party.getOnlinePlayerNames(player);
return StringUtil.copyPartialMatches(args[1], playerNames, new ArrayList<>(playerNames.size()));
}
return matches;
default:
return ImmutableList.of();
}
case 3:
if (PartySubcommandType.getSubcommand(args[0]) == PartySubcommandType.ITEMSHARE && isItemShareCategory(args[1])) {
return StringUtil.copyPartialMatches(args[2], CommandConstants.TRUE_FALSE_OPTIONS, new ArrayList<>(CommandConstants.TRUE_FALSE_OPTIONS.size()));
}
return ImmutableList.of();
default:
return ImmutableList.of();
}
}
private boolean printUsage(Player player) {
player.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.0", "/party join"));
player.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.1", "/party create"));
player.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.2", "/party ?"));
return true;
}
private String[] extractArgs(String[] args) {
return Arrays.copyOfRange(args, 1, args.length);
}
private boolean isItemShareCategory(String category) {
return category.equalsIgnoreCase("loot") || category.equalsIgnoreCase("mining") || category.equalsIgnoreCase("herbalism") || category.equalsIgnoreCase("woodcutting") || category.equalsIgnoreCase("misc");
}
}

View File

@@ -1,57 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyCreateCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyCreateCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
case 3:
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (pluginRef.getUserManager().getPlayer(player) == null) {
player.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
// Check to see if the party exists, and if it does cancel creating a new party
if (pluginRef.getPartyManager().checkPartyExistence(player, args[1])) {
return true;
}
// Changing parties
if (!pluginRef.getPartyManager().changeOrJoinParty(mcMMOPlayer, args[1])) {
return true;
}
pluginRef.getPartyManager().createParty(mcMMOPlayer, args[1], getPassword(args));
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.3", "party", "create", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.PartyName") + ">", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Password") + "]"));
return true;
}
}
private String getPassword(String[] args) {
if (args.length == 3) {
return args[2];
}
return null;
}
}

View File

@@ -1,47 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyDisbandCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyDisbandCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Party playerParty = pluginRef.getUserManager().getPlayer((Player) sender).getParty();
String partyName = playerParty.getName();
for (Player member : playerParty.getOnlineMembers()) {
if (!pluginRef.getPartyManager().handlePartyChangeEvent(member, partyName, null, EventReason.KICKED_FROM_PARTY)) {
return true;
}
member.sendMessage(pluginRef.getLocaleManager().getString("Party.Disband"));
}
pluginRef.getPartyManager().disbandParty(playerParty);
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "party", "disband"));
return true;
}
}
}

View File

@@ -1,36 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class PartyHelpCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyHelpCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.3", "/party join", "/party quit"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.1", "/party create"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.4", "/party <lock|unlock>"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.5", "/party password"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.6", "/party kick"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.7", "/party leader"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.8", "/party disband"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.9", "/party itemshare"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Help.10", "/party xpshare"));
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "party", "help"));
return true;
}
}
}

View File

@@ -1,148 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.party.ShareMode;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.StringUtils;
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 java.util.ArrayList;
import java.util.List;
public class PartyInfoCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyInfoCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
case 1:
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
Party party = mcMMOPlayer.getParty();
displayPartyHeader(player, party);
displayShareModeInfo(player, party);
displayPartyFeatures(player, party);
displayMemberInfo(player, mcMMOPlayer, party);
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "party", "info"));
return true;
}
}
private void displayPartyHeader(Player player, Party party) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Header"));
/*if (!party.hasReachedLevelCap()) {
status.append(" (").append(party.getXpToLevelPercentage()).append(")");
}*/
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Status", party.getName(), pluginRef.getLocaleManager().getString("Party.Status." + (party.isLocked() ? "Locked" : "Unlocked")), party.getLevel())
/*if (!party.hasReachedLevelCap()) {
status.append(" (").append(party.getXpToLevelPercentage()).append(")");
}*/);
}
private void displayPartyFeatures(Player player, Party party) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Features.Header"));
List<String> unlockedPartyFeatures = new ArrayList<>();
List<String> lockedPartyFeatures = new ArrayList<>();
for (PartyFeature partyFeature : PartyFeature.values()) {
if (!partyFeature.hasPermission(pluginRef, player)) {
continue;
}
if (isUnlockedFeature(party, partyFeature)) {
unlockedPartyFeatures.add(getPartyFeatureLocaleString(partyFeature));
} else {
lockedPartyFeatures.add(getFeatureLockedLocaleString(partyFeature));
}
}
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.UnlockedFeatures", unlockedPartyFeatures.isEmpty() ? "None" : unlockedPartyFeatures));
for (String message : lockedPartyFeatures) {
player.sendMessage(message);
}
}
public String getPartyFeatureLocaleString(PartyFeature partyFeature) {
return pluginRef.getLocaleManager().getString("Party.Feature." + StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", ""));
}
public String getFeatureLockedLocaleString(PartyFeature partyFeature) {
return pluginRef.getLocaleManager().getString("Ability.Generic.Template.Lock",
pluginRef.getLocaleManager().getString("Party.Feature.Locked."
+ StringUtils.getPrettyPartyFeatureString(partyFeature).replace(" ", ""),
pluginRef.getPartyManager().getPartyFeatureUnlockLevel(partyFeature)));
}
private boolean isUnlockedFeature(Party party, PartyFeature partyFeature) {
return party.getLevel() >= pluginRef.getPartyManager().getPartyFeatureUnlockLevel(partyFeature);
}
private void displayShareModeInfo(Player player, Party party) {
boolean xpShareEnabled = isUnlockedFeature(party, PartyFeature.XP_SHARE);
boolean itemShareEnabled = isUnlockedFeature(party, PartyFeature.ITEM_SHARE);
boolean itemSharingActive = (party.getItemShareMode() != ShareMode.NONE);
if (!xpShareEnabled && !itemShareEnabled) {
return;
}
String expShareInfo = "";
String itemShareInfo = "";
String separator = "";
if (xpShareEnabled) {
expShareInfo = pluginRef.getLocaleManager().getString("Commands.Party.ExpShare", party.getXpShareMode().toString());
}
if (itemShareEnabled) {
itemShareInfo = pluginRef.getLocaleManager().getString("Commands.Party.ItemShare", party.getItemShareMode().toString());
}
if (xpShareEnabled && itemShareEnabled) {
separator = ChatColor.DARK_GRAY + " || ";
}
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.ShareMode") + expShareInfo + separator + itemShareInfo);
if (itemSharingActive) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.ItemShareCategories", party.getItemShareCategories()));
}
}
private void displayMemberInfo(Player player, McMMOPlayer mcMMOPlayer, Party party) {
/*
* Only show members of the party that this member can see
*/
List<Player> nearMembers = pluginRef.getPartyManager().getNearVisibleMembers(mcMMOPlayer);
int membersOnline = party.getVisibleMembers(player).size();
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Members.Header"));
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.MembersNear", nearMembers.size() + 1, membersOnline));
player.sendMessage(party.createMembersList(player));
}
}

View File

@@ -1,78 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyInviteCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyInviteCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
String targetName = pluginRef.getCommandTools().getMatchedPlayerName(args[1]);
McMMOPlayer mcMMOTarget = pluginRef.getUserManager().getOfflinePlayer(targetName);
if (!pluginRef.getCommandTools().checkPlayerExistence(sender, targetName, mcMMOTarget)) {
return false;
}
Player target = mcMMOTarget.getPlayer();
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
String playerName = player.getName();
if (player.equals(target)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Invite.Self"));
return true;
}
if (pluginRef.getPartyManager().inSameParty(player, target)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Player.InSameParty", targetName));
return true;
}
if (!pluginRef.getPartyManager().canInvite(mcMMOPlayer)) {
player.sendMessage(pluginRef.getLocaleManager().getString("Party.Locked"));
return true;
}
Party playerParty = mcMMOPlayer.getParty();
if (pluginRef.getConfigManager().getConfigParty().getPartyGeneral().isPartySizeCapped())
if (pluginRef.getPartyManager().isPartyFull(target, playerParty)) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.PartyFull.Invite",
target.getName(), playerParty.toString(),
pluginRef.getConfigManager().getConfigParty().getPartySizeLimit()));
return true;
}
mcMMOTarget.setPartyInvite(playerParty);
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Invite.Success"));
target.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Invite.0", playerParty.getName(), playerName));
target.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Invite.1"));
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "invite", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + ">"));
return true;
}
}
}

View File

@@ -1,96 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.ItemShareType;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.party.ShareMode;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.StringUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.Locale;
public class PartyItemShareCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyItemShareCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Party party = pluginRef.getUserManager().getPlayer((Player) sender).getParty();
if (party.getLevel() < pluginRef.getPartyManager().getPartyFeatureUnlockLevel(PartyFeature.ITEM_SHARE)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Feature.Disabled.4"));
return true;
}
switch (args.length) {
case 2:
ShareMode mode = ShareMode.getShareMode(args[1].toUpperCase(Locale.ENGLISH));
if (mode == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "itemshare", "<NONE | EQUAL | RANDOM>"));
return true;
}
handleChangingShareMode(party, mode);
return true;
case 3:
boolean toggle;
if (pluginRef.getCommandTools().shouldEnableToggle(args[2])) {
toggle = true;
} else if (pluginRef.getCommandTools().shouldDisableToggle(args[2])) {
toggle = false;
} else {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "itemshare", "<loot | mining | herbalism | woodcutting | misc> <true | false>"));
return true;
}
try {
handleToggleItemShareCategory(party, ItemShareType.valueOf(args[1].toUpperCase(Locale.ENGLISH)), toggle);
} catch (IllegalArgumentException ex) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "itemshare", "<loot | mining | herbalism | woodcutting | misc> <true | false>"));
}
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "itemshare", "<NONE | EQUAL | RANDOM>"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "itemshare", "<loot | mining | herbalism | woodcutting | misc> <true | false>"));
return true;
}
}
private void handleChangingShareMode(Party party, ShareMode mode) {
party.setItemShareMode(mode);
String changeModeMessage = pluginRef.getLocaleManager().getString("Commands.Party.SetSharing", pluginRef.getLocaleManager().getString("Party.ShareType.Item"), pluginRef.getLocaleManager().getString("Party.ShareMode." + StringUtils.getCapitalized(mode.toString())));
for (Player member : party.getOnlineMembers()) {
member.sendMessage(changeModeMessage);
}
}
private void handleToggleItemShareCategory(Party party, ItemShareType type, boolean toggle) {
party.setSharingDrops(type, toggle);
String toggleMessage = pluginRef.getLocaleManager().getString("Commands.Party.ToggleShareCategory", StringUtils.getCapitalized(type.toString()), toggle ? "enabled" : "disabled");
for (Player member : party.getOnlineMembers()) {
member.sendMessage(toggleMessage);
}
}
}

View File

@@ -1,90 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyJoinCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyJoinCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
case 3:
String targetName = pluginRef.getCommandTools().getMatchedPlayerName(args[1]);
McMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(targetName);
if (!pluginRef.getCommandTools().checkPlayerExistence(sender, targetName, mcMMOTarget)) {
return true;
}
Player target = mcMMOTarget.getPlayer();
if (!mcMMOTarget.inParty()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.PlayerNotInParty", targetName));
return true;
}
Player player = (Player) sender;
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
Party targetParty = mcMMOTarget.getParty();
if (player.equals(target) || (mcMMOPlayer.inParty() && mcMMOPlayer.getParty().equals(targetParty))) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Join.Self"));
return true;
}
String password = getPassword(args);
// Make sure party passwords match
if (!pluginRef.getPartyManager().checkPartyPassword(player, targetParty, password)) {
return true;
}
String partyName = targetParty.getName();
// Changing parties
if (!pluginRef.getPartyManager().changeOrJoinParty(mcMMOPlayer, partyName)) {
return true;
}
if (pluginRef.getConfigManager().getConfigParty().getPartyGeneral().isPartySizeCapped())
if (pluginRef.getPartyManager().isPartyFull(player, targetParty)) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.PartyFull", targetParty.toString()));
return true;
}
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Join", partyName));
pluginRef.getPartyManager().addToParty(mcMMOPlayer, targetParty);
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.3", "party", "join", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + ">", "[" + pluginRef.getLocaleManager().getString("Commands.Usage.Password") + "]"));
return true;
}
}
private String getPassword(String[] args) {
if (args.length == 3) {
return args[2];
}
return null;
}
}

View File

@@ -1,59 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.mcMMO;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyKickCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyKickCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Party playerParty = pluginRef.getUserManager().getPlayer((Player) sender).getParty();
String targetName = pluginRef.getCommandTools().getMatchedPlayerName(args[1]);
if (!playerParty.hasMember(targetName)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.NotInYourParty", targetName));
return true;
}
OfflinePlayer target = pluginRef.getServer().getOfflinePlayer(targetName);
if (target.isOnline()) {
Player onlineTarget = target.getPlayer();
String partyName = playerParty.getName();
if (!pluginRef.getPartyManager().handlePartyChangeEvent(onlineTarget, partyName, null, EventReason.KICKED_FROM_PARTY)) {
return true;
}
pluginRef.getPartyManager().processPartyLeaving(pluginRef.getUserManager().getPlayer(onlineTarget));
onlineTarget.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Kick", partyName));
}
pluginRef.getPartyManager().removeFromParty(target, playerParty);
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "kick", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + ">"));
return true;
}
}
}

View File

@@ -1,78 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyLockCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyLockCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
if (args[0].equalsIgnoreCase("lock")) {
togglePartyLock(sender, true);
} else if (args[0].equalsIgnoreCase("unlock")) {
togglePartyLock(sender, false);
}
return true;
case 2:
if (!args[0].equalsIgnoreCase("lock")) {
sendUsageStrings(sender);
return true;
}
if (pluginRef.getCommandTools().shouldEnableToggle(args[1])) {
togglePartyLock(sender, true);
} else if (pluginRef.getCommandTools().shouldDisableToggle(args[1])) {
togglePartyLock(sender, false);
} else {
sendUsageStrings(sender);
}
return true;
default:
sendUsageStrings(sender);
return true;
}
}
private void sendUsageStrings(CommandSender sender) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "lock", "[on|off]"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "party", "unlock"));
}
private void togglePartyLock(CommandSender sender, boolean lock) {
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return;
}
Party party = pluginRef.getUserManager().getPlayer((Player) sender).getParty();
if (!pluginRef.getPermissionTools().partySubcommand(sender, lock ? PartySubcommandType.LOCK : PartySubcommandType.UNLOCK)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("mcMMO.NoPermission"));
return;
}
if (lock ? party.isLocked() : !party.isLocked()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party." + (lock ? "IsLocked" : "IsntLocked")));
return;
}
party.setLocked(lock);
sender.sendMessage(pluginRef.getLocaleManager().getString("Party." + (lock ? "Locked" : "Unlocked")));
}
}

View File

@@ -1,47 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyQuitCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyQuitCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
Player player = (Player) sender;
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
Party playerParty = mcMMOPlayer.getParty();
if (!pluginRef.getPartyManager().handlePartyChangeEvent(player, playerParty.getName(), null, EventReason.LEFT_PARTY)) {
return true;
}
pluginRef.getPartyManager().removeFromParty(mcMMOPlayer);
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Leave"));
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.1", "party", "quit"));
return true;
}
}
}

View File

@@ -1,70 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyRenameCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyRenameCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer((Player) sender);
Party playerParty = mcMMOPlayer.getParty();
String oldPartyName = playerParty.getName();
String newPartyName = args[1];
// This is to prevent party leaders from spamming other players with the rename message
if (oldPartyName.equalsIgnoreCase(newPartyName)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Rename.Same"));
return true;
}
Player player = mcMMOPlayer.getPlayer();
// Check to see if the party exists, and if it does cancel renaming the party
if (pluginRef.getPartyManager().checkPartyExistence(player, newPartyName)) {
return true;
}
String leaderName = playerParty.getLeader().getPlayerName();
for (Player member : playerParty.getOnlineMembers()) {
if (!pluginRef.getPartyManager().handlePartyChangeEvent(member, oldPartyName, newPartyName, EventReason.CHANGED_PARTIES)) {
return true;
}
if (!member.getName().equalsIgnoreCase(leaderName)) {
member.sendMessage(pluginRef.getLocaleManager().getString("Party.InformedOnNameChange", leaderName, newPartyName));
}
}
playerParty.setName(newPartyName);
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Rename", newPartyName));
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "rename", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.PartyName") + ">"));
return true;
}
}
}

View File

@@ -1,62 +0,0 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.party.ShareMode;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.StringUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyXpShareCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyXpShareCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Party party = pluginRef.getUserManager().getPlayer((Player) sender).getParty();
if (party.getLevel() < pluginRef.getPartyManager().getPartyFeatureUnlockLevel(PartyFeature.XP_SHARE)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Feature.Disabled.5"));
return true;
}
switch (args.length) {
case 2:
if (args[1].equalsIgnoreCase("none") || pluginRef.getCommandTools().shouldDisableToggle(args[1])) {
handleChangingShareMode(party, ShareMode.NONE);
} else if (args[1].equalsIgnoreCase("equal") || args[1].equalsIgnoreCase("even") || pluginRef.getCommandTools().shouldEnableToggle(args[1])) {
handleChangingShareMode(party, ShareMode.EQUAL);
} else {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "xpshare", "<NONE | EQUAL>"));
}
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "xpshare", "<NONE | EQUAL>"));
return true;
}
}
private void handleChangingShareMode(Party party, ShareMode mode) {
party.setXpShareMode(mode);
String changeModeMessage = pluginRef.getLocaleManager().getString("Commands.Party.SetSharing", pluginRef.getLocaleManager().getString("Party.ShareType.Xp"), pluginRef.getLocaleManager().getString("Party.ShareMode." + StringUtils.getCapitalized(mode.toString())));
for (Player member : party.getOnlineMembers()) {
member.sendMessage(changeModeMessage);
}
}
}

View File

@@ -1,47 +0,0 @@
package com.gmail.nossr50.commands.party.alliance;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyAllianceAcceptCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyAllianceAcceptCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (!mcMMOPlayer.hasPartyAllianceInvite()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("mcMMO.NoInvites"));
return true;
}
if (mcMMOPlayer.getParty().getAlly() != null) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.AlreadyAllies"));
return true;
}
pluginRef.getPartyManager().acceptAllianceInvite(mcMMOPlayer);
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "alliance", "accept"));
return true;
}
}
}

View File

@@ -1,141 +0,0 @@
package com.gmail.nossr50.commands.party.alliance;
import com.gmail.nossr50.commands.CommandConstants;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
public class PartyAllianceCommand implements TabExecutor {
private final mcMMO pluginRef;
private Player player;
private Party playerParty;
private Party targetParty;
private CommandExecutor partyAllianceInviteCommand;
private CommandExecutor partyAllianceAcceptCommand;
private CommandExecutor partyAllianceDisbandCommand;
public PartyAllianceCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
//Init SubCommands
partyAllianceInviteCommand = new PartyAllianceInviteCommand(pluginRef);
partyAllianceAcceptCommand = new PartyAllianceAcceptCommand(pluginRef);
partyAllianceDisbandCommand = new PartyAllianceDisbandCommand(pluginRef);
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
playerParty = mcMMOPlayer.getParty();
switch (args.length) {
case 1:
if (playerParty.getLevel() < pluginRef.getPartyManager().getPartyFeatureUnlockLevel(PartyFeature.ALLIANCE)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Feature.Disabled.3"));
return true;
}
if (playerParty.getAlly() == null) {
printUsage();
return true;
}
targetParty = playerParty.getAlly();
displayPartyHeader();
displayMemberInfo(mcMMOPlayer);
return true;
case 2:
case 3:
if (playerParty.getLevel() < pluginRef.getPartyManager().getPartyFeatureUnlockLevel(PartyFeature.ALLIANCE)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Feature.Disabled.3"));
return true;
}
if (args[1].equalsIgnoreCase("invite")) {
return partyAllianceInviteCommand.onCommand(sender, command, label, args);
}
if (args[1].equalsIgnoreCase("accept")) {
return partyAllianceAcceptCommand.onCommand(sender, command, label, args);
}
if (args[1].equalsIgnoreCase("disband")) {
return partyAllianceDisbandCommand.onCommand(sender, command, label, args);
}
if (playerParty.getAlly() == null) {
printUsage();
return true;
}
targetParty = playerParty.getAlly();
displayPartyHeader();
displayMemberInfo(mcMMOPlayer);
return true;
default:
return false;
}
}
private void printUsage() {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.Help.0"));
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.Help.1"));
}
@Override
public List<String> onTabComplete(CommandSender commandSender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
List<String> matches = StringUtil.copyPartialMatches(args[0], CommandConstants.ALLIANCE_SUBCOMMANDS, new ArrayList<>(CommandConstants.ALLIANCE_SUBCOMMANDS.size()));
if (matches.size() == 0) {
List<String> playerNames = pluginRef.getCommandTools().getOnlinePlayerNames(commandSender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
}
return matches;
default:
return ImmutableList.of();
}
}
private void displayPartyHeader() {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.Header"));
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.Ally", playerParty.getName(), targetParty.getName()));
}
private void displayMemberInfo(McMMOPlayer mcMMOPlayer) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.Members.Header"));
player.sendMessage(playerParty.createMembersList(player));
player.sendMessage(ChatColor.DARK_GRAY + "----------------------------");
player.sendMessage(targetParty.createMembersList(player));
}
}

View File

@@ -1,44 +0,0 @@
package com.gmail.nossr50.commands.party.alliance;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyAllianceDisbandCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyAllianceDisbandCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 2:
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
Party party = mcMMOPlayer.getParty();
if (party.getAlly() == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.None"));
return true;
}
pluginRef.getPartyManager().disbandAlliance(player, party, party.getAlly());
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "alliance", "disband"));
return true;
}
}
}

View File

@@ -1,80 +0,0 @@
package com.gmail.nossr50.commands.party.alliance;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PartyAllianceInviteCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyAllianceInviteCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 3:
String targetName = pluginRef.getCommandTools().getMatchedPlayerName(args[2]);
McMMOPlayer mcMMOTarget = pluginRef.getUserManager().getOfflinePlayer(targetName);
if (!pluginRef.getCommandTools().checkPlayerExistence(sender, targetName, mcMMOTarget)) {
return false;
}
Player target = mcMMOTarget.getPlayer();
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
String playerName = player.getName();
if (player.equals(target)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Invite.Self"));
return true;
}
if (!mcMMOTarget.inParty()) {
player.sendMessage(pluginRef.getLocaleManager().getString("Party.PlayerNotInParty", targetName));
return true;
}
if (pluginRef.getPartyManager().inSameParty(player, target)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Player.InSameParty", targetName));
return true;
}
if (!mcMMOTarget.getParty().getLeader().getUniqueId().equals(target.getUniqueId())) {
player.sendMessage(pluginRef.getLocaleManager().getString("Party.Target.NotOwner", targetName));
return true;
}
Party playerParty = mcMMOPlayer.getParty();
if (playerParty.getAlly() != null) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.AlreadyAllies"));
return true;
}
mcMMOTarget.setPartyAllianceInvite(playerParty);
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Invite.Success"));
target.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.Invite.0", playerParty.getName(), playerName));
target.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.Alliance.Invite.1"));
return true;
default:
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.3", "party", "alliance", "invite", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Player") + ">"));
return true;
}
}
}

View File

@@ -1,34 +0,0 @@
package com.gmail.nossr50.commands.party.teleport;
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class PtpAcceptAnyCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PtpAcceptAnyCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!pluginRef.getPermissionTools().partyTeleportAcceptAll(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
PartyTeleportRecord ptpRecord = pluginRef.getUserManager().getPlayer(sender.getName()).getPartyTeleportRecord();
if (ptpRecord.isConfirmRequired()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.AcceptAny.Disabled"));
} else {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.AcceptAny.Enabled"));
}
ptpRecord.toggleConfirmRequired();
return true;
}
}

View File

@@ -1,70 +0,0 @@
package com.gmail.nossr50.commands.party.teleport;
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
import com.gmail.nossr50.mcMMO;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class PtpAcceptCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PtpAcceptCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!pluginRef.getPermissionTools().partyTeleportAccept(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
PartyTeleportRecord ptpRecord = pluginRef.getUserManager().getPlayer(player).getPartyTeleportRecord();
if (!ptpRecord.hasRequest()) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.NoRequests"));
return true;
}
if (pluginRef.getSkillTools().cooldownExpired(ptpRecord.getTimeout(), pluginRef.getConfigManager().getConfigParty().getPTP().getPtpRequestTimeout())) {
ptpRecord.removeRequest();
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.RequestExpired"));
return true;
}
Player target = ptpRecord.getRequestor();
ptpRecord.removeRequest();
if (!pluginRef.getPartyManager().canTeleport(sender, player, target.getName())) {
return true;
}
if (pluginRef.getConfigManager().getConfigParty().getPTP().isPtpWorldBasedPermissions()) {
World targetWorld = target.getWorld();
World playerWorld = player.getWorld();
if (!pluginRef.getPermissionTools().partyTeleportAllWorlds(target)) {
if (!pluginRef.getPermissionTools().partyTeleportWorld(target, targetWorld)) {
target.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.NoWorldPermissions", targetWorld.getName()));
return true;
} else if (targetWorld != playerWorld && !pluginRef.getPermissionTools().partyTeleportWorld(target, playerWorld)) {
target.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.NoWorldPermissions", playerWorld.getName()));
return true;
}
}
}
pluginRef.getPartyManager().handleTeleportWarmup(target, player);
return true;
}
}

View File

@@ -1,194 +0,0 @@
package com.gmail.nossr50.commands.party.teleport;
import com.gmail.nossr50.commands.CommandConstants;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
public class PtpCommand implements TabExecutor {
private final mcMMO pluginRef;
private CommandExecutor ptpToggleCommand;
private CommandExecutor ptpAcceptAnyCommand;
private CommandExecutor ptpAcceptCommand;
public PtpCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
//Init SubCommands
ptpToggleCommand = new PtpToggleCommand(pluginRef);
ptpAcceptAnyCommand = new PtpAcceptAnyCommand(pluginRef);
ptpAcceptCommand = new PtpAcceptCommand(pluginRef);
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
Player player = (Player) sender;
/* WORLD GUARD MAIN FLAG CHECK */
if (pluginRef.getWorldGuardUtils().isWorldGuardLoaded()) {
if (!pluginRef.getWorldGuardManager().hasMainFlag(player))
return true;
}
/* WORLD BLACKLIST CHECK */
if (pluginRef.getDynamicSettingsManager().isWorldBlacklisted(player.getWorld().getName()))
return true;
if (!pluginRef.getUserManager().hasPlayerDataKey(player)) {
return true;
}
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (!mcMMOPlayer.inParty()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Party.None"));
return true;
}
Party party = mcMMOPlayer.getParty();
if (party.getLevel() < pluginRef.getPartyManager().getPartyFeatureUnlockLevel(PartyFeature.TELEPORT)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Feature.Disabled.2"));
return true;
}
if (args.length == 1) {
if (args[0].equalsIgnoreCase("toggle")) {
return ptpToggleCommand.onCommand(sender, command, label, args);
}
if (args[0].equalsIgnoreCase("acceptany") || args[0].equalsIgnoreCase("acceptall")) {
return ptpAcceptAnyCommand.onCommand(sender, command, label, args);
}
long recentlyHurt = mcMMOPlayer.getRecentlyHurt();
int hurtCooldown = pluginRef.getConfigManager().getConfigParty().getPTP().getPtpRecentlyHurtCooldown();
if (hurtCooldown > 0) {
int timeRemaining = pluginRef.getSkillTools().calculateTimeLeft(recentlyHurt * pluginRef.getMiscTools().TIME_CONVERSION_FACTOR, hurtCooldown, player);
if (timeRemaining > 0) {
player.sendMessage(pluginRef.getLocaleManager().getString("Item.Injured.Wait", timeRemaining));
return true;
}
}
if (args[0].equalsIgnoreCase("accept")) {
return ptpAcceptCommand.onCommand(sender, command, label, args);
}
if (!pluginRef.getPermissionTools().partyTeleportSend(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
int ptpCooldown = pluginRef.getConfigManager().getConfigParty().getPTP().getPtpCooldown();
long ptpLastUse = mcMMOPlayer.getPartyTeleportRecord().getLastUse();
if (ptpCooldown > 0) {
int timeRemaining = pluginRef.getSkillTools().calculateTimeLeft(ptpLastUse * pluginRef.getMiscTools().TIME_CONVERSION_FACTOR, ptpCooldown, player);
if (timeRemaining > 0) {
player.sendMessage(pluginRef.getLocaleManager().getString("Item.Generic.Wait", timeRemaining));
return true;
}
}
sendTeleportRequest(sender, player, pluginRef.getCommandTools().getMatchedPlayerName(args[0]));
return true;
}
return false;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
List<String> matches = StringUtil.copyPartialMatches(args[0], CommandConstants.TELEPORT_SUBCOMMANDS, new ArrayList<>(CommandConstants.TELEPORT_SUBCOMMANDS.size()));
if (matches.size() == 0) {
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return ImmutableList.of();
}
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
if (!mcMMOPlayer.inParty()) {
return ImmutableList.of();
}
List<String> playerNames = mcMMOPlayer.getParty().getOnlinePlayerNames(player);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
}
return matches;
default:
return ImmutableList.of();
}
}
private void sendTeleportRequest(CommandSender sender, Player player, String targetName) {
if (!pluginRef.getPartyManager().canTeleport(sender, player, targetName)) {
return;
}
McMMOPlayer mcMMOTarget = pluginRef.getUserManager().getPlayer(targetName);
Player target = mcMMOTarget.getPlayer();
if (pluginRef.getConfigManager().getConfigParty().getPTP().isPtpWorldBasedPermissions()) {
World targetWorld = target.getWorld();
World playerWorld = player.getWorld();
if (!pluginRef.getPermissionTools().partyTeleportAllWorlds(player)) {
if (!pluginRef.getPermissionTools().partyTeleportWorld(target, targetWorld)) {
player.sendMessage(pluginRef.getLocaleManager().formatString("Commands.ptp.NoWorldPermissions", targetWorld.getName()));
return;
}
else if (targetWorld != playerWorld && !pluginRef.getPermissionTools().partyTeleportWorld(player, targetWorld)) {
player.sendMessage(pluginRef.getLocaleManager().formatString("Commands.ptp.NoWorldPermissions", targetWorld.getName()));
return;
}
}
}
PartyTeleportRecord ptpRecord = mcMMOTarget.getPartyTeleportRecord();
if (!ptpRecord.isConfirmRequired()) {
pluginRef.getPartyManager().handleTeleportWarmup(player, target);
return;
}
ptpRecord.setRequestor(player);
ptpRecord.actualizeTimeout();
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Invite.Success"));
target.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.Request1", player.getName()));
target.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.Request2", pluginRef.getConfigManager().getConfigParty().getPTP().getPtpRequestTimeout()));
}
}

View File

@@ -1,35 +0,0 @@
package com.gmail.nossr50.commands.party.teleport;
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
import com.gmail.nossr50.mcMMO;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class PtpToggleCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PtpToggleCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!pluginRef.getPermissionTools().partyTeleportToggle(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
PartyTeleportRecord ptpRecord = pluginRef.getUserManager().getPlayer(sender.getName()).getPartyTeleportRecord();
if (ptpRecord.isEnabled()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.Disabled"));
} else {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.ptp.Enabled"));
}
ptpRecord.toggleEnabled();
return true;
}
}

View File

@@ -1,80 +0,0 @@
package com.gmail.nossr50.commands.player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.scoreboards.SidebarType;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import java.util.List;
public class CooldownCommand implements TabExecutor {
private final mcMMO pluginRef;
public CooldownCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (!pluginRef.getCommandTools().hasPlayerDataKey(sender)) {
return true;
}
switch (args.length) {
case 0:
Player player = (Player) sender;
if (pluginRef.getScoreboardSettings().getScoreboardsEnabled() && pluginRef.getScoreboardSettings().isScoreboardEnabled(SidebarType.COOLDOWNS_BOARD)) {
pluginRef.getScoreboardManager().enablePlayerCooldownScoreboard(player);
if (!pluginRef.getScoreboardSettings().isScoreboardPrinting(SidebarType.COOLDOWNS_BOARD)) {
return true;
}
}
if (pluginRef.getUserManager().getPlayer(player) == null) {
player.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Cooldowns.Header"));
player.sendMessage(pluginRef.getLocaleManager().getString("mcMMO.NoSkillNote"));
for (SuperAbilityType superAbilityType : SuperAbilityType.values()) {
if (!pluginRef.getSkillTools().superAbilityPermissionCheck(superAbilityType, player)) {
continue;
}
int seconds = mcMMOPlayer.calculateTimeRemaining(superAbilityType);
if (seconds <= 0) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Cooldowns.Row.Y", pluginRef.getSkillTools().getPrettySuperAbilityName(superAbilityType)));
} else {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.Cooldowns.Row.N", pluginRef.getSkillTools().getPrettySuperAbilityName(superAbilityType), seconds));
}
}
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return ImmutableList.of();
}
}

View File

@@ -1,110 +0,0 @@
package com.gmail.nossr50.commands.player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
public class InspectCommand implements TabExecutor {
private final mcMMO pluginRef;
public InspectCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 1:
String playerName = pluginRef.getCommandTools().getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
if (mcMMOPlayer == null) {
PlayerProfile profile = pluginRef.getDatabaseManager().loadPlayerProfile(playerName, false); // Temporary Profile
if (!pluginRef.getCommandTools().isLoaded(sender, profile)) {
return true;
}
if (pluginRef.getScoreboardSettings().getScoreboardsEnabled() && sender instanceof Player
&& pluginRef.getScoreboardSettings().getConfigSectionScoreboardTypes().getConfigSectionInspectBoard().isUseThisBoard()) {
pluginRef.getScoreboardManager().enablePlayerInspectScoreboard((Player) sender, profile);
if (!pluginRef.getScoreboardSettings().getConfigSectionScoreboardTypes().getConfigSectionInspectBoard().isPrintToChat()) {
return true;
}
}
sender.sendMessage(pluginRef.getLocaleManager().getString("Inspect.OfflineStats", playerName));
sender.sendMessage(pluginRef.getLocaleManager().getString("Stats.Header.Gathering"));
for (PrimarySkillType skill : pluginRef.getSkillTools().GATHERING_SKILLS) {
sender.sendMessage(pluginRef.getCommandTools().displaySkill(profile, skill));
}
sender.sendMessage(pluginRef.getLocaleManager().getString("Stats.Header.Combat"));
for (PrimarySkillType skill : pluginRef.getSkillTools().COMBAT_SKILLS) {
sender.sendMessage(pluginRef.getCommandTools().displaySkill(profile, skill));
}
sender.sendMessage(pluginRef.getLocaleManager().getString("Stats.Header.Misc"));
for (PrimarySkillType skill : pluginRef.getSkillTools().MISC_SKILLS) {
sender.sendMessage(pluginRef.getCommandTools().displaySkill(profile, skill));
}
} else {
Player target = mcMMOPlayer.getPlayer();
if (pluginRef.getCommandTools().hidden(sender, target, pluginRef.getPermissionTools().inspectHidden(sender))) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Inspect.Offline"));
return true;
}
else if (pluginRef.getCommandTools().tooFar(sender, target, pluginRef.getPermissionTools().inspectFar(sender))) {
return true;
}
if (pluginRef.getScoreboardSettings().getScoreboardsEnabled() && sender instanceof Player && pluginRef.getScoreboardSettings().getConfigSectionScoreboardTypes().getConfigSectionInspectBoard().isUseThisBoard()) {
pluginRef.getScoreboardManager().enablePlayerInspectScoreboard((Player) sender, mcMMOPlayer.getProfile());
if (!pluginRef.getScoreboardSettings().getConfigSectionScoreboardTypes().getConfigSectionInspectBoard().isPrintToChat()) {
return true;
}
}
sender.sendMessage(pluginRef.getLocaleManager().getString("Inspect.Stats", target.getName()));
pluginRef.getCommandTools().printGatheringSkills(target, sender);
pluginRef.getCommandTools().printCombatSkills(target, sender);
pluginRef.getCommandTools().printMiscSkills(target, sender);
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.PowerLevel", mcMMOPlayer.getPowerLevel()));
}
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
List<String> playerNames = pluginRef.getCommandTools().getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
default:
return ImmutableList.of();
}
}
}

View File

@@ -1,139 +0,0 @@
package com.gmail.nossr50.commands.player;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.commands.LeaderboardsCommandAsyncTask;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.scoreboards.SidebarType;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
public class LeaderboardCommand implements TabExecutor {
private final mcMMO pluginRef;
public LeaderboardCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
PrimarySkillType skill = null;
switch (args.length) {
case 0:
display(1, skill, sender, command);
return true;
case 1:
if (StringUtils.isInt(args[0])) {
display(Math.abs(Integer.parseInt(args[0])), skill, sender, command);
return true;
}
skill = extractSkill(sender, args[0]);
if (skill == null) {
return true;
}
display(1, skill, sender, command);
return true;
case 2:
if (pluginRef.getCommandTools().isInvalidInteger(sender, args[1])) {
return true;
}
skill = extractSkill(sender, args[0]);
if (skill == null) {
return true;
}
display(Math.abs(Integer.parseInt(args[1])), skill, sender, command);
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], pluginRef.getSkillTools().LOCALIZED_SKILL_NAMES, new ArrayList<>(pluginRef.getSkillTools().LOCALIZED_SKILL_NAMES.size()));
default:
return ImmutableList.of();
}
}
private void display(int page, PrimarySkillType skill, CommandSender sender, Command command) {
if (skill != null && !pluginRef.getPermissionTools().mctop(sender, skill)) {
sender.sendMessage(command.getPermissionMessage());
return;
}
if (sender instanceof Player) {
if (!pluginRef.getCommandTools().hasPlayerDataKey(sender)) {
return;
}
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(sender.getName());
long cooldownMillis = 5000;
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
double seconds = ((mcMMOPlayer.getDatabaseATS() + cooldownMillis) - System.currentTimeMillis()) / 1000;
if (seconds < 1) {
seconds = 1;
}
sender.sendMessage(pluginRef.getLocaleManager().formatString(pluginRef.getLocaleManager().getString("Commands.Database.Cooldown"), seconds));
return;
}
if (((Player) sender).hasMetadata(MetadataConstants.DATABASE_PROCESSING_COMMAND_METAKEY)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Database.Processing"));
return;
} else {
((Player) sender).setMetadata(MetadataConstants.DATABASE_PROCESSING_COMMAND_METAKEY, new FixedMetadataValue(pluginRef, null));
}
mcMMOPlayer.actualizeDatabaseATS();
}
display(page, skill, sender);
}
private void display(int page, PrimarySkillType skill, CommandSender sender) {
boolean useBoard = (sender instanceof Player) && (pluginRef.getScoreboardSettings().isScoreboardEnabled(SidebarType.TOP_BOARD));
boolean useChat = !useBoard || pluginRef.getScoreboardSettings().isScoreboardPrinting(SidebarType.TOP_BOARD);
new LeaderboardsCommandAsyncTask(pluginRef, page, skill, sender, useBoard, useChat).runTaskAsynchronously(pluginRef);
}
private PrimarySkillType extractSkill(CommandSender sender, String skillName) {
if (pluginRef.getCommandTools().isInvalidSkill(sender, skillName)) {
return null;
}
PrimarySkillType skill = pluginRef.getSkillTools().matchSkill(skillName);
if (pluginRef.getCommandTools().isChildSkill(sender, skill)) {
return null;
}
return skill;
}
}

View File

@@ -1,126 +0,0 @@
package com.gmail.nossr50.commands.player;
import com.gmail.nossr50.core.MetadataConstants;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.commands.RankCommandAsyncTask;
import com.gmail.nossr50.util.scoreboards.SidebarType;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
public class RankCommand implements TabExecutor {
private final mcMMO pluginRef;
public RankCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
switch (args.length) {
case 0:
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (!pluginRef.getPermissionTools().mcrank(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (!pluginRef.getCommandTools().hasPlayerDataKey(sender)) {
return true;
}
display(sender, sender.getName());
return true;
case 1:
if (!pluginRef.getPermissionTools().mcrankOthers(sender)) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
if (!pluginRef.getCommandTools().hasPlayerDataKey(sender)) {
return true;
}
String playerName = pluginRef.getCommandTools().getMatchedPlayerName(args[0]);
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getOfflinePlayer(playerName);
if (mcMMOPlayer != null) {
Player player = mcMMOPlayer.getPlayer();
playerName = player.getName();
if (pluginRef.getCommandTools().tooFar(sender, player, pluginRef.getPermissionTools().mcrankFar(sender))) {
return true;
}
}
display(sender, playerName);
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
List<String> playerNames = pluginRef.getCommandTools().getOnlinePlayerNames(sender);
return StringUtil.copyPartialMatches(args[0], playerNames, new ArrayList<>(playerNames.size()));
default:
return ImmutableList.of();
}
}
private void display(CommandSender sender, String playerName) {
if (sender instanceof Player) {
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(sender.getName());
if (mcMMOPlayer == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return;
}
long cooldownMillis = 5000;
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Database.CooldownMS", getCDSeconds(mcMMOPlayer, cooldownMillis)));
return;
}
if (((Player) sender).hasMetadata(MetadataConstants.DATABASE_PROCESSING_COMMAND_METAKEY)) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Database.Processing"));
return;
} else {
((Player) sender).setMetadata(MetadataConstants.DATABASE_PROCESSING_COMMAND_METAKEY, new FixedMetadataValue(pluginRef, null));
}
mcMMOPlayer.actualizeDatabaseATS();
}
boolean useBoard = pluginRef.getScoreboardSettings().getScoreboardsEnabled() && (sender instanceof Player)
&& (pluginRef.getScoreboardSettings().isScoreboardEnabled(SidebarType.RANK_BOARD));
boolean useChat = !useBoard || pluginRef.getScoreboardSettings().isScoreboardPrinting(SidebarType.RANK_BOARD);
new RankCommandAsyncTask(pluginRef, playerName, sender, useBoard, useChat).runTaskAsynchronously(pluginRef);
}
private long getCDSeconds(McMMOPlayer mcMMOPlayer, long cooldownMillis) {
return ((mcMMOPlayer.getDatabaseATS() + cooldownMillis) - System.currentTimeMillis());
}
}

View File

@@ -1,74 +0,0 @@
package com.gmail.nossr50.commands.player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.scoreboards.SidebarType;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import java.util.List;
public class SkillStatsCommand implements TabExecutor {
private final mcMMO pluginRef;
public SkillStatsCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (!pluginRef.getCommandTools().hasPlayerDataKey(sender)) {
return true;
}
switch (args.length) {
case 0:
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
Player player = (Player) sender;
if (pluginRef.getScoreboardSettings().isScoreboardEnabled(SidebarType.STATS_BOARD) && pluginRef.getScoreboardSettings().getScoreboardsEnabled()) {
pluginRef.getScoreboardManager().enablePlayerStatsScoreboard(player);
if (!pluginRef.getScoreboardSettings().isScoreboardPrinting(SidebarType.STATS_BOARD)) {
return true;
}
}
player.sendMessage(pluginRef.getLocaleManager().getString("Stats.Own.Stats"));
player.sendMessage(pluginRef.getLocaleManager().getString("mcMMO.NoSkillNote"));
pluginRef.getCommandTools().printGatheringSkills(player);
pluginRef.getCommandTools().printCombatSkills(player);
pluginRef.getCommandTools().printMiscSkills(player);
int powerLevelCap = pluginRef.getPlayerLevelingSettings().getConfigSectionLevelCaps().getPowerLevelSettings().getLevelCap();
if (pluginRef.getPlayerLevelingSettings().getConfigSectionLevelCaps().getPowerLevelSettings().isLevelCapEnabled()) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.PowerLevel.Capped", pluginRef.getUserManager().getPlayer(player).getPowerLevel(), powerLevelCap));
} else {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.PowerLevel", pluginRef.getUserManager().getPlayer(player).getPowerLevel()));
}
return true;
default:
return false;
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
return ImmutableList.of();
}
}

View File

@@ -1,32 +0,0 @@
package com.gmail.nossr50.commands.server;
import com.gmail.nossr50.mcMMO;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public class ReloadPluginCommand implements CommandExecutor {
private final mcMMO pluginRef;
public ReloadPluginCommand(mcMMO plugin) {
this.pluginRef = plugin;
}
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (sender instanceof Player) {
if (!pluginRef.getPermissionTools().reload(sender))
return false;
}
Bukkit.broadcastMessage(pluginRef.getLocaleManager().getString("Commands.Reload.Start"));
pluginRef.reload();
Bukkit.broadcastMessage(pluginRef.getLocaleManager().getString("Commands.Reload.Finished"));
return true;
}
}

View File

@@ -1,95 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
import com.gmail.nossr50.listeners.InteractionManager;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.random.RandomChanceSkill;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class AcrobaticsCommand extends SkillCommand {
private String dodgeChance;
private String dodgeChanceLucky;
private boolean canDodge;
private boolean canRoll;
public AcrobaticsCommand(mcMMO pluginRef) {
super(PrimarySkillType.ACROBATICS, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// ACROBATICS_DODGE
if (canDodge) {
String[] dodgeStrings = getAbilityDisplayValues(player, SubSkillType.ACROBATICS_DODGE);
dodgeChance = dodgeStrings[0];
dodgeChanceLucky = dodgeStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canDodge = canUseSubSkill(player, SubSkillType.ACROBATICS_DODGE);
canRoll = canUseSubSkill(player, SubSkillType.ACROBATICS_ROLL);
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
if (canDodge) {
messages.add(getStatMessage(SubSkillType.ACROBATICS_DODGE, dodgeChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", dodgeChanceLucky) : ""));
}
if (canRoll) {
AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName("Roll");
if (abstractSubSkill != null) {
double rollChance, graceChance;
//Chance to roll at half
RandomChanceSkill roll_rcs = new RandomChanceSkill(pluginRef, player, SubSkillType.ACROBATICS_ROLL);
//Chance to graceful roll
RandomChanceSkill grace_rcs = new RandomChanceSkill(pluginRef, player, SubSkillType.ACROBATICS_ROLL);
grace_rcs.setSkillLevel(grace_rcs.getSkillLevel() * 2); //Double Odds
//Chance Stat Calculations
rollChance = pluginRef.getRandomChanceTools().getRandomChanceExecutionChance(roll_rcs);
graceChance = pluginRef.getRandomChanceTools().getRandomChanceExecutionChance(grace_rcs);
//damageThreshold = AdvancedConfig.getInstance().getRollDamageThreshold();
String[] rollStrings = getAbilityDisplayValues(player, SubSkillType.ACROBATICS_ROLL);
//Format
double rollChanceLucky = rollChance * 1.333D;
double graceChanceLucky = graceChance * 1.333D;
messages.add(getStatMessage(SubSkillType.ACROBATICS_ROLL, rollStrings[0])
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", rollStrings[1]) : ""));
/*messages.add(getStatMessage(true, false, SubSkillType.ACROBATICS_ROLL, String.valueOf(graceChance))
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", String.valueOf(graceChanceLucky)) : ""));*/
}
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.ACROBATICS);
return textComponents;
}
}

View File

@@ -1,96 +0,0 @@
//package com.gmail.nossr50.commands.skills;
//
//import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
//import com.gmail.nossr50.util.TextComponentFactory;
//import net.md_5.bungee.api.chat.TextComponent;
//import org.bukkit.entity.Player;
//
//import java.util.ArrayList;
//import java.util.List;
//
//public class AlchemyCommand extends SkillCommand {
//// private String brewSpeed;
//// private String brewSpeedLucky;
////
//// private int tier;
//// private int ingredientCount;
//// private String ingredientList;
////
//// private boolean canCatalysis;
//// private boolean canConcoctions;
//
// public AlchemyCommand() {
// super(PrimarySkillType.ALCHEMY);
// }
//
//// protected String[] calculateAbilityDisplayValues(Player player) {
//// //TODO: Needed?
//// if (pluginRef.getUserManager().getPlayer(player) == null) {
//// player.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
//// return new String[]{"DATA NOT LOADED", "DATA NOT LOADED"};
//// }
////
//// AlchemyManager alchemyManager = pluginRef.getUserManager().getPlayer(player).getAlchemyManager();
//// String[] displayValues = new String[2];
////
//// boolean isLucky = Permissions.lucky(player, PrimarySkillType.ALCHEMY);
////
//// displayValues[0] = decimal.format(alchemyManager.calculateBrewSpeed(false)) + "x";
//// displayValues[1] = isLucky ? decimal.format(alchemyManager.calculateBrewSpeed(true)) + "x" : null;
////
//// return displayValues;
//// }
//
// @Override
// protected void dataCalculations(Player player, double skillValue) {
// // ALCHEMY_CATALYSIS
//// if (canCatalysis) {
//// String[] catalysisStrings = calculateAbilityDisplayValues(player);
//// brewSpeed = catalysisStrings[0];
//// brewSpeedLucky = catalysisStrings[1];
//// }
////
//// // ALCHEMY_CONCOCTIONS
//// if (canConcoctions) {
//// AlchemyManager alchemyManager = pluginRef.getUserManager().getPlayer(player).getAlchemyManager();
//// tier = alchemyManager.getTier();
//// ingredientCount = alchemyManager.getIngredients().size();
//// ingredientList = alchemyManager.getIngredientList();
//// }
// }
//
// @Override
// protected void permissionsCheck(Player player) {
//// canCatalysis = canUseSubskill(player, SubSkillType.ALCHEMY_CATALYSIS);
//// canConcoctions = canUseSubskill(player, SubSkillType.ALCHEMY_CONCOCTIONS);
// }
//
// @Override
// protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
// List<String> messages = new ArrayList<>();
//
//// if (canCatalysis) {
//// messages.add(getStatMessage(SubSkillType.ALCHEMY_CATALYSIS, brewSpeed)
//// + (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", brewSpeedLucky) : ""));
//// }
////
//// if (canConcoctions) {
//// messages.add(getStatMessage(false, true, SubSkillType.ALCHEMY_CONCOCTIONS, String.valueOf(tier), String.valueOf(RankUtils.getHighestRank(SubSkillType.ALCHEMY_CONCOCTIONS))));
//// messages.add(getStatMessage(true, true, SubSkillType.ALCHEMY_CONCOCTIONS, String.valueOf(ingredientCount), ingredientList));
////
//// //messages.add(pluginRef.getLocaleManager().getString("Alchemy.Concoctions.Rank", tier, RankUtils.getHighestRank(SubSkillType.ALCHEMY_CONCOCTIONS)));
//// //messages.add(pluginRef.getLocaleManager().getString("Alchemy.Concoctions.Ingredients", ingredientCount, ingredientList));
//// }
//
// return messages;
// }
//
// @Override
// protected List<TextComponent> getTextComponents(Player player) {
// List<TextComponent> textComponents = new ArrayList<>();
//
// pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.ALCHEMY);
//
// return textComponents;
// }
//}

View File

@@ -1,90 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class ArcheryCommand extends SkillCommand {
private String skillShotBonus;
private String dazeChance;
private String dazeChanceLucky;
private String retrieveChance;
private String retrieveChanceLucky;
private boolean canSkillShot;
private boolean canDaze;
private boolean canRetrieve;
public ArcheryCommand(mcMMO pluginRef) {
super(PrimarySkillType.ARCHERY, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// ARCHERY_ARROW_RETRIEVAL
if (canRetrieve) {
String[] retrieveStrings = getAbilityDisplayValues(player, SubSkillType.ARCHERY_ARROW_RETRIEVAL);
retrieveChance = retrieveStrings[0];
retrieveChanceLucky = retrieveStrings[1];
}
// ARCHERY_DAZE
if (canDaze) {
String[] dazeStrings = getAbilityDisplayValues(player, SubSkillType.ARCHERY_DAZE);
dazeChance = dazeStrings[0];
dazeChanceLucky = dazeStrings[1];
}
// SKILL SHOT
if (canSkillShot) {
skillShotBonus = percent.format(pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getArcheryBehaviour().getSkillShotDamageBonusPercent(player));
}
}
@Override
protected void permissionsCheck(Player player) {
canSkillShot = canUseSubSkill(player, SubSkillType.ARCHERY_SKILL_SHOT);
canDaze = canUseSubSkill(player, SubSkillType.ARCHERY_DAZE);
canRetrieve = canUseSubSkill(player, SubSkillType.ARCHERY_ARROW_RETRIEVAL);
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
if (canRetrieve) {
messages.add(getStatMessage(SubSkillType.ARCHERY_ARROW_RETRIEVAL, retrieveChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", retrieveChanceLucky) : ""));
}
if (canDaze) {
messages.add(getStatMessage(SubSkillType.ARCHERY_DAZE, dazeChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", dazeChanceLucky) : ""));
}
if (canSkillShot) {
messages.add(getStatMessage(SubSkillType.ARCHERY_SKILL_SHOT, skillShotBonus));
}
if (canUseSubSkill(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK,
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamageAgainstQuality(player, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK, 1000))));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.ARCHERY);
return textComponents;
}
}

View File

@@ -1,108 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class AxesCommand extends SkillCommand {
private String critChance;
private String critChanceLucky;
private double axeMasteryDamage;
private double impactDamage;
private String skullSplitterLength;
private String skullSplitterLengthEndurance;
private boolean canSkullSplitter;
private boolean canCritical;
private boolean canAxeMastery;
private boolean canImpact;
private boolean canGreaterImpact;
public AxesCommand(mcMMO pluginRef) {
super(PrimarySkillType.AXES, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// ARMOR IMPACT
if (canImpact) {
impactDamage = pluginRef.getUserManager().getPlayer(player).getAxesManager().getImpactDurabilityDamage();
}
// AXE MASTERY
if (canAxeMastery) {
axeMasteryDamage = pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getAxesBehaviour().getAxeMasteryBonusDamage(player);
}
// CRITICAL HIT
if (canCritical) {
String[] criticalHitStrings = getAbilityDisplayValues(player, SubSkillType.AXES_CRITICAL_STRIKES);
critChance = criticalHitStrings[0];
critChanceLucky = criticalHitStrings[1];
}
// SKULL SPLITTER
if (canSkullSplitter) {
String[] skullSplitterStrings = formatLengthDisplayValues(player, skillValue);
skullSplitterLength = skullSplitterStrings[0];
skullSplitterLengthEndurance = skullSplitterStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canSkullSplitter = pluginRef.getPermissionTools().skullSplitter(player) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.AXES_SKULL_SPLITTER);
canCritical = canUseSubSkill(player, SubSkillType.AXES_CRITICAL_STRIKES);
canAxeMastery = canUseSubSkill(player, SubSkillType.AXES_AXE_MASTERY);
canImpact = canUseSubSkill(player, SubSkillType.AXES_ARMOR_IMPACT);
canGreaterImpact = canUseSubSkill(player, SubSkillType.AXES_GREATER_IMPACT);
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
if (canImpact) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template", pluginRef.getLocaleManager().getString("Axes.Ability.Bonus.2"), pluginRef.getLocaleManager().getString("Axes.Ability.Bonus.3", impactDamage)));
}
if (canAxeMastery) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template", pluginRef.getLocaleManager().getString("Axes.Ability.Bonus.0"), pluginRef.getLocaleManager().getString("Axes.Ability.Bonus.1", axeMasteryDamage)));
}
if (canCritical) {
messages.add(getStatMessage(SubSkillType.AXES_CRITICAL_STRIKES, critChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", critChanceLucky) : ""));
}
if (canGreaterImpact) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template", pluginRef.getLocaleManager().getString("Axes.Ability.Bonus.4"), pluginRef.getLocaleManager().getString("Axes.Ability.Bonus.5", pluginRef.getConfigManager().getConfigAxes().getGreaterImpactBonusDamage())));
}
if (canSkullSplitter) {
messages.add(getStatMessage(SubSkillType.AXES_SKULL_SPLITTER, skullSplitterLength)
+ (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", skullSplitterLengthEndurance) : ""));
}
if (canUseSubSkill(player, SubSkillType.AXES_AXES_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.AXES_AXES_LIMIT_BREAK,
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamageAgainstQuality(player, SubSkillType.AXES_AXES_LIMIT_BREAK, 1000))));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.AXES);
return textComponents;
}
}

View File

@@ -1,72 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.excavation.ExcavationManager;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class ExcavationCommand extends SkillCommand {
private String gigaDrillBreakerLength;
private String gigaDrillBreakerLengthEndurance;
private boolean canGigaDrill;
private boolean canTreasureHunt;
public ExcavationCommand(mcMMO pluginRef) {
super(PrimarySkillType.EXCAVATION, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// GIGA DRILL BREAKER
if (canGigaDrill) {
String[] gigaDrillStrings = formatLengthDisplayValues(player, skillValue);
gigaDrillBreakerLength = gigaDrillStrings[0];
gigaDrillBreakerLengthEndurance = gigaDrillStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canGigaDrill = pluginRef.getPermissionTools().gigaDrillBreaker(player) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER);
canTreasureHunt = canUseSubSkill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY);
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
ExcavationManager excavationManager = pluginRef.getUserManager().getPlayer(player).getExcavationManager();
if (canGigaDrill) {
messages.add(getStatMessage(SubSkillType.EXCAVATION_GIGA_DRILL_BREAKER, gigaDrillBreakerLength)
+ (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
//messages.add(pluginRef.getLocaleManager().getString("Excavation.Effect.Length", gigaDrillBreakerLength) + (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", gigaDrillBreakerLengthEndurance) : ""));
}
if(canUseSubSkill(player, SubSkillType.EXCAVATION_ARCHAEOLOGY)) {
messages.add(getStatMessage(false, false, SubSkillType.EXCAVATION_ARCHAEOLOGY,
percent.format(excavationManager.getArchaelogyExperienceOrbChance() / 100.0D)));
messages.add(getStatMessage(true, false, SubSkillType.EXCAVATION_ARCHAEOLOGY,
String.valueOf(excavationManager.getExperienceOrbsReward())));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.EXCAVATION);
return textComponents;
}
}

View File

@@ -1,177 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.fishing.FishingManager;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class FishingCommand extends SkillCommand {
private int lootTier;
private String shakeChance;
private String shakeChanceLucky;
private int fishermansDietRank;
private String biteChance;
private String innerPeaceMult;
private String commonTreasure;
private String uncommonTreasure;
private String rareTreasure;
private String epicTreasure;
private String legendaryTreasure;
private String recordTreasure;
private String magicChance;
private boolean canTreasureHunt;
private boolean canMagicHunt;
private boolean canShake;
private boolean canFishermansDiet;
private boolean canMasterAngler;
private boolean canIceFish;
private boolean canInnerPeace;
public FishingCommand(mcMMO pluginRef) {
super(PrimarySkillType.FISHING, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
FishingManager fishingManager = pluginRef.getUserManager().getPlayer(player).getFishingManager();
// TREASURE HUNTER
if (canTreasureHunt) {
lootTier = fishingManager.getLootTier();
// Item drop rates
// commonTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.COMMON) / 100.0);
// uncommonTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.UNCOMMON) / 100.0);
// rareTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RARE) / 100.0);
// epicTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.EPIC) / 100.0);
// legendaryTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.LEGENDARY) / 100.0);
// recordTreasure = percent.format(FishingTreasureConfig.getInstance().getItemDropRate(lootTier, Rarity.RECORD) / 100.0);
//
// // Magic hunter drop rates
// double totalEnchantChance = 0;
//
// for (Rarity rarity : Rarity.values()) {
// if (rarity != Rarity.RECORD) {
// totalEnchantChance += FishingTreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);
// }
// }
// if (totalEnchantChance >= 1)
// magicChance = percent.format(totalEnchantChance / 100.0);
// else
// magicChance = percent.format(0);
}
// FISHING_SHAKE
// if (canShake) {
// String[] shakeStrings = pluginRef.getRandomChanceTools().calculateAbilityDisplayValuesStatic(player, PrimarySkillType.FISHING, fishingManager.getShakeChance());
// shakeChance = shakeStrings[0];
// shakeChanceLucky = shakeStrings[1];
// }
// FISHERMAN'S DIET
if (canFishermansDiet) {
fishermansDietRank = pluginRef.getRankTools().getRank(player, SubSkillType.FISHING_FISHERMANS_DIET);
}
// MASTER ANGLER
if (canMasterAngler) {
double rawBiteChance = 1.0 / (player.getWorld().hasStorm() ? 300 : 500);
Location location = fishingManager.getHookLocation();
if (location == null) {
location = player.getLocation();
}
// if (Fishing.getInstance().getMasterAnglerBiomes().contains(location.getBlock().getBiome())) {
// rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBiomeModifier();
// }
// if (player.isInsideVehicle() && player.getVehicle().getType() == EntityType.BOAT) {
// rawBiteChance = rawBiteChance * AdvancedConfig.getInstance().getMasterAnglerBoatModifier();
// }
double luckyModifier = pluginRef.getPermissionTools().lucky(player, PrimarySkillType.FISHING) ? 1.333D : 1.0D;
biteChance = percent.format((rawBiteChance * 100.0D) * luckyModifier);
}
if (canInnerPeace) {
innerPeaceMult = String.valueOf(fishingManager.getInnerPeaceMultiplier());
}
}
@Override
protected void permissionsCheck(Player player) {
canTreasureHunt = canUseSubSkill(player, SubSkillType.FISHING_TREASURE_HUNTER);
canMagicHunt = canUseSubSkill(player, SubSkillType.FISHING_MAGIC_HUNTER) && canUseSubSkill(player, SubSkillType.FISHING_TREASURE_HUNTER);
canShake = canUseSubSkill(player, SubSkillType.FISHING_SHAKE);
canFishermansDiet = canUseSubSkill(player, SubSkillType.FISHING_FISHERMANS_DIET);
canMasterAngler = canUseSubSkill(player, SubSkillType.FISHING_MASTER_ANGLER);
canIceFish = canUseSubSkill(player, SubSkillType.FISHING_ICE_FISHING);
canInnerPeace = canUseSubSkill(player, SubSkillType.FISHING_INNER_PEACE);
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
if (canFishermansDiet) {
messages.add(getStatMessage(false, true, SubSkillType.FISHING_FISHERMANS_DIET, String.valueOf(fishermansDietRank)));
}
// if (canIceFish) {
// messages.add(getStatMessage(SubSkillType.FISHING_ICE_FISHING, SubSkillType.FISHING_ICE_FISHING.getLocaleStatDescription()));
// }
if (canMagicHunt) {
messages.add(getStatMessage(SubSkillType.FISHING_MAGIC_HUNTER, magicChance));
}
if (canMasterAngler) {
//TODO: Update this with more details
messages.add(getStatMessage(false, true, SubSkillType.FISHING_MASTER_ANGLER, biteChance));
}
if (canShake) {
messages.add(getStatMessage(SubSkillType.FISHING_SHAKE, shakeChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", shakeChanceLucky) : ""));
}
if (canTreasureHunt) {
messages.add(getStatMessage(false, true, SubSkillType.FISHING_TREASURE_HUNTER, String.valueOf(lootTier), String.valueOf(pluginRef.getRankTools().getHighestRank(SubSkillType.FISHING_TREASURE_HUNTER))));
messages.add(getStatMessage(true, true, SubSkillType.FISHING_TREASURE_HUNTER,
String.valueOf(commonTreasure),
String.valueOf(uncommonTreasure),
String.valueOf(rareTreasure),
String.valueOf(epicTreasure),
String.valueOf(legendaryTreasure),
String.valueOf(recordTreasure)));
}
if (canInnerPeace) {
messages.add(getStatMessage(SubSkillType.FISHING_INNER_PEACE, innerPeaceMult));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.FISHING);
return textComponents;
}
}

View File

@@ -1,147 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class HerbalismCommand extends SkillCommand {
private String greenTerraLength;
private String greenTerraLengthEndurance;
private String greenThumbChance;
private String greenThumbChanceLucky;
private int greenThumbStage;
private int farmersDietRank;
private String doubleDropChance;
private String doubleDropChanceLucky;
private String hylianLuckChance;
private String hylianLuckChanceLucky;
private String shroomThumbChance;
private String shroomThumbChanceLucky;
private boolean hasHylianLuck;
private boolean canGreenTerra;
private boolean canGreenThumbPlants;
private boolean canGreenThumbBlocks;
private boolean canFarmersDiet;
private boolean canDoubleDrop;
private boolean canShroomThumb;
public HerbalismCommand(mcMMO pluginRef) {
super(PrimarySkillType.HERBALISM, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// DOUBLE DROPS
if (canDoubleDrop) {
String[] doubleDropStrings = getAbilityDisplayValues(player, SubSkillType.HERBALISM_DOUBLE_DROPS);
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
// FARMERS DIET
if (canFarmersDiet) {
farmersDietRank = pluginRef.getRankTools().getRank(player, SubSkillType.HERBALISM_FARMERS_DIET);
}
// GREEN TERRA
if (canGreenTerra) {
String[] greenTerraStrings = formatLengthDisplayValues(player, skillValue);
greenTerraLength = greenTerraStrings[0];
greenTerraLengthEndurance = greenTerraStrings[1];
}
// GREEN THUMB
if (canGreenThumbBlocks || canGreenThumbPlants) {
greenThumbStage = pluginRef.getRankTools().getRank(player, SubSkillType.HERBALISM_GREEN_THUMB);
String[] greenThumbStrings = getAbilityDisplayValues(player, SubSkillType.HERBALISM_GREEN_THUMB);
greenThumbChance = greenThumbStrings[0];
greenThumbChanceLucky = greenThumbStrings[1];
}
// HYLIAN LUCK
if (hasHylianLuck) {
String[] hylianLuckStrings = getAbilityDisplayValues(player, SubSkillType.HERBALISM_HYLIAN_LUCK);
hylianLuckChance = hylianLuckStrings[0];
hylianLuckChanceLucky = hylianLuckStrings[1];
}
// SHROOM THUMB
if (canShroomThumb) {
String[] shroomThumbStrings = getAbilityDisplayValues(player, SubSkillType.HERBALISM_SHROOM_THUMB);
shroomThumbChance = shroomThumbStrings[0];
shroomThumbChanceLucky = shroomThumbStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
hasHylianLuck = canUseSubSkill(player, SubSkillType.HERBALISM_HYLIAN_LUCK);
canGreenTerra = pluginRef.getPermissionTools().greenTerra(player);
canGreenThumbPlants = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (pluginRef.getPermissionTools().greenThumbPlant(player, Material.WHEAT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.CARROT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.POTATO) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.BEETROOT) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.NETHER_WART) || pluginRef.getPermissionTools().greenThumbPlant(player, Material.COCOA));
canGreenThumbBlocks = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.HERBALISM_GREEN_THUMB) && (pluginRef.getPermissionTools().greenThumbBlock(player, Material.DIRT) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.COBBLESTONE) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.COBBLESTONE_WALL) || pluginRef.getPermissionTools().greenThumbBlock(player, Material.STONE_BRICKS));
canFarmersDiet = canUseSubSkill(player, SubSkillType.HERBALISM_FARMERS_DIET);
canDoubleDrop = canUseSubSkill(player, SubSkillType.HERBALISM_DOUBLE_DROPS);
canShroomThumb = canUseSubSkill(player, SubSkillType.HERBALISM_SHROOM_THUMB);
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
if (canDoubleDrop) {
messages.add(getStatMessage(SubSkillType.HERBALISM_DOUBLE_DROPS, doubleDropChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
}
if (canFarmersDiet) {
messages.add(getStatMessage(false, true, SubSkillType.HERBALISM_FARMERS_DIET, String.valueOf(farmersDietRank)));
}
if (canGreenTerra) {
messages.add(getStatMessage(SubSkillType.HERBALISM_GREEN_TERRA, greenTerraLength)
+ (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", greenTerraLengthEndurance) : ""));
//messages.add(pluginRef.getLocaleManager().getString("Herbalism.Ability.GTe.Length", greenTerraLength) + (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", greenTerraLengthEndurance) : ""));
}
if (canGreenThumbBlocks || canGreenThumbPlants) {
messages.add(getStatMessage(SubSkillType.HERBALISM_GREEN_THUMB, greenThumbChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", greenThumbChanceLucky) : ""));
//messages.add(pluginRef.getLocaleManager().getString("Herbalism.Ability.GTh.Chance", greenThumbChance) + (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", greenThumbChanceLucky) : ""));
}
if (canGreenThumbPlants) {
messages.add(getStatMessage(true, true, SubSkillType.HERBALISM_GREEN_THUMB, String.valueOf(greenThumbStage)));
}
if (hasHylianLuck) {
messages.add(getStatMessage(SubSkillType.HERBALISM_HYLIAN_LUCK, hylianLuckChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", hylianLuckChanceLucky) : ""));
}
if (canShroomThumb) {
messages.add(getStatMessage(SubSkillType.HERBALISM_SHROOM_THUMB, shroomThumbChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", shroomThumbChanceLucky) : ""));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.HERBALISM);
return textComponents;
}
}

View File

@@ -1,115 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.mining.MiningManager;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class MiningCommand extends SkillCommand {
private String doubleDropChance;
private String doubleDropChanceLucky;
private String superBreakerLength;
private String superBreakerLengthEndurance;
private int blastMiningRank;
private int bonusTNTDrops;
private double blastRadiusIncrease;
private String oreBonus;
// private String debrisReduction;
private String blastDamageDecrease;
private boolean canSuperBreaker;
private boolean canDoubleDrop;
private boolean canBlast;
private boolean canBiggerBombs;
private boolean canDemoExpert;
public MiningCommand(mcMMO pluginRef) {
super(PrimarySkillType.MINING, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// BLAST MINING
if (canBlast || canDemoExpert || canBiggerBombs) {
MiningManager miningManager = pluginRef.getUserManager().getPlayer(player).getMiningManager();
blastMiningRank = miningManager.getBlastMiningTier();
bonusTNTDrops = miningManager.getDropMultiplier();
oreBonus = percent.format(miningManager.getOreBonus() / 30.0D); // Base received in TNT is 30%
// debrisReduction = percent.format(miningManager.getDebrisReduction() / 30.0D); // Base received in TNT is 30%
blastDamageDecrease = percent.format(miningManager.getBlastDamageModifier() / 100.0D);
blastRadiusIncrease = miningManager.getBlastRadiusModifier();
}
// DOUBLE DROPS
if (canDoubleDrop) {
String[] doubleDropStrings = getAbilityDisplayValues(player, SubSkillType.MINING_DOUBLE_DROPS);
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
// SUPER BREAKER
if (canSuperBreaker) {
String[] superBreakerStrings = formatLengthDisplayValues(player, skillValue);
superBreakerLength = superBreakerStrings[0];
superBreakerLengthEndurance = superBreakerStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canBiggerBombs = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_BIGGER_BOMBS) && pluginRef.getPermissionTools().biggerBombs(player);
canBlast = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_BLAST_MINING) && pluginRef.getPermissionTools().remoteDetonation(player);
canDemoExpert = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_DEMOLITIONS_EXPERTISE) && pluginRef.getPermissionTools().demolitionsExpertise(player);
canDoubleDrop = canUseSubSkill(player, SubSkillType.MINING_DOUBLE_DROPS);
canSuperBreaker = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.MINING_SUPER_BREAKER) && pluginRef.getPermissionTools().superBreaker(player);
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
if (canBiggerBombs) {
messages.add(getStatMessage(true, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastRadiusIncrease)));
//messages.add(pluginRef.getLocaleManager().getString("SuperAbility.BlastMining.Radius.Increase", blastRadiusIncrease));
}
if (canBlast) {
messages.add(getStatMessage(false, true, SubSkillType.MINING_BLAST_MINING, String.valueOf(blastMiningRank), String.valueOf(pluginRef.getRankTools().getHighestRank(SubSkillType.MINING_BLAST_MINING)), pluginRef.getLocaleManager().getString("SuperAbility.BlastMining.Effect", oreBonus, bonusTNTDrops)));
}
if (canDemoExpert) {
messages.add(getStatMessage(SubSkillType.MINING_DEMOLITIONS_EXPERTISE, blastDamageDecrease));
//messages.add(pluginRef.getLocaleManager().getString("Mining.Effect.Decrease", blastDamageDecrease));
}
if (canDoubleDrop) {
messages.add(getStatMessage(SubSkillType.MINING_DOUBLE_DROPS, doubleDropChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
//messages.add(pluginRef.getLocaleManager().getString("Mining.Effect.DropChance", doubleDropChance) + (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
}
if (canSuperBreaker) {
messages.add(getStatMessage(SubSkillType.MINING_SUPER_BREAKER, superBreakerLength)
+ (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", superBreakerLengthEndurance) : ""));
//messages.add(pluginRef.getLocaleManager().getString("Mining.Ability.Length", superBreakerLength) + (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", superBreakerLengthEndurance) : ""));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.MINING);
return textComponents;
}
}

View File

@@ -1,97 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
import com.gmail.nossr50.listeners.InteractionManager;
import com.gmail.nossr50.mcMMO;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.util.StringUtil;
import java.util.ArrayList;
import java.util.List;
/**
* This is the command that retrieves data about skills from in-game sources
*/
public class MmoInfoCommand implements TabExecutor {
private final mcMMO pluginRef;
public MmoInfoCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
/*
* Only allow players to use this command
*/
if (commandSender instanceof Player) {
if (args.length < 1)
return false;
Player player = (Player) commandSender;
if (pluginRef.getPermissionTools().mmoinfo(player)) {
if (args == null || args[0] == null)
return false;
if (args[0].equalsIgnoreCase("???")) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.MmoInfo.Header"));
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.MmoInfo.SubSkillHeader", "???"));
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.MmoInfo.DetailsHeader"));
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.MmoInfo.Mystery"));
return true;
} else if (InteractionManager.getAbstractByName(args[0]) != null || pluginRef.getSkillTools().isSubSkillNameExact(args[0])) {
displayInfo(player, args[0]);
return true;
}
//Not a real skill
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.MmoInfo.NoMatch"));
return true;
}
}
return false;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return StringUtil.copyPartialMatches(args[0], pluginRef.getSkillTools().EXACT_SUBSKILL_NAMES, new ArrayList<>(pluginRef.getSkillTools().EXACT_SUBSKILL_NAMES.size()));
default:
return ImmutableList.of();
}
}
private void displayInfo(Player player, String subSkillName) {
//Check to see if the skill exists in the new system
AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName(subSkillName);
if (abstractSubSkill != null) {
/* New System Skills are programmable */
abstractSubSkill.printInfo(player);
//pluginRef.getTextComponentFactory().sendPlayerUrlHeader(player);
} else {
/*
* Skill is only in the old system
*/
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.MmoInfo.Header"));
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.MmoInfo.SubSkillHeader", subSkillName));
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.MmoInfo.DetailsHeader"));
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.MmoInfo.OldSkill"));
}
for (SubSkillType subSkillType : SubSkillType.values()) {
if (subSkillType.getNiceNameNoSpaces(subSkillType).equalsIgnoreCase(subSkillName))
subSkillName = subSkillType.getWikiName(subSkillType.toString());
}
//Send Player Wiki Link
pluginRef.getTextComponentFactory().sendPlayerSubSkillWikiLink(player, subSkillName);
}
}

View File

@@ -1,123 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.repair.RepairManager;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class RepairCommand extends SkillCommand {
private String repairMasteryBonus;
private String superRepairChance;
private String superRepairChanceLucky;
private boolean canSuperRepair;
private boolean canMasterRepair;
private boolean canArcaneForge;
// private boolean canRepairStone;
// private boolean canRepairIron;
// private boolean canRepairGold;
// private boolean canRepairDiamond;
// private boolean canRepairString;
// private boolean canRepairLeather;
// private boolean canRepairWood;
private boolean arcaneBypass;
// private int diamondLevel;
// private int goldLevel;
// private int ironLevel;
// private int stoneLevel;
public RepairCommand(mcMMO pluginRef) {
super(PrimarySkillType.REPAIR, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// We're using pickaxes here, not the best but it works
// Repairable diamondRepairable = pluginRef.getRepairableManager().getRepairable(Material.DIAMOND_PICKAXE);
// Repairable goldRepairable = pluginRef.getRepairableManager().getRepairable(Material.GOLDEN_PICKAXE);
// Repairable ironRepairable = pluginRef.getRepairableManager().getRepairable(Material.IRON_PICKAXE);
// Repairable stoneRepairable = pluginRef.getRepairableManager().getRepairable(Material.STONE_PICKAXE);
// TODO: This isn't really accurate - if they don't have pickaxes loaded it doesn't always mean the repair level is 0
// diamondLevel = (diamondRepairable == null) ? 0 : diamondRepairable.getMinimumLevel();
// goldLevel = (goldRepairable == null) ? 0 : goldRepairable.getMinimumLevel();
// ironLevel = (ironRepairable == null) ? 0 : ironRepairable.getMinimumLevel();
// stoneLevel = (stoneRepairable == null) ? 0 : stoneRepairable.getMinimumLevel();
// REPAIR MASTERY
if (canMasterRepair) {
double maxBonus = pluginRef.getDynamicSettingsManager().getSkillPropertiesManager().getMaxBonus(SubSkillType.REPAIR_REPAIR_MASTERY);
int maxBonusLevel = pluginRef.getDynamicSettingsManager().getSkillPropertiesManager().getMaxBonusLevel(SubSkillType.REPAIR_REPAIR_MASTERY);
repairMasteryBonus = percent.format(Math.min(((maxBonus / maxBonusLevel) * skillValue), maxBonus) / 100D);
}
// SUPER REPAIR
if (canSuperRepair) {
String[] superRepairStrings = getAbilityDisplayValues(player, SubSkillType.REPAIR_SUPER_REPAIR);
superRepairChance = superRepairStrings[0];
superRepairChanceLucky = superRepairStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canSuperRepair = canUseSubSkill(player, SubSkillType.REPAIR_SUPER_REPAIR);
canMasterRepair = canUseSubSkill(player, SubSkillType.REPAIR_REPAIR_MASTERY);
canArcaneForge = canUseSubSkill(player, SubSkillType.REPAIR_ARCANE_FORGING);
// canRepairDiamond = Permissions.repairMaterialType(player, ItemMaterialCategory.DIAMOND);
// canRepairGold = Permissions.repairMaterialType(player, ItemMaterialCategory.GOLD);
// canRepairIron = Permissions.repairMaterialType(player, ItemMaterialCategory.IRON);
// canRepairStone = Permissions.repairMaterialType(player, ItemMaterialCategory.STONE);
// canRepairString = Permissions.repairMaterialType(player, ItemMaterialCategory.STRING);
// canRepairLeather = Permissions.repairMaterialType(player, ItemMaterialCategory.LEATHER);
// canRepairWood = Permissions.repairMaterialType(player, ItemMaterialCategory.WOOD);
arcaneBypass = (pluginRef.getPermissionTools().arcaneBypass(player) || pluginRef.getPermissionTools().hasRepairEnchantBypassPerk(player));
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
if (canArcaneForge) {
RepairManager repairManager = pluginRef.getUserManager().getPlayer(player).getRepairManager();
messages.add(getStatMessage(false, true,
SubSkillType.REPAIR_ARCANE_FORGING,
String.valueOf(pluginRef.getRankTools().getRank(player, SubSkillType.REPAIR_ARCANE_FORGING)),
pluginRef.getRankTools().getHighestRankStr(SubSkillType.REPAIR_ARCANE_FORGING)));
if (pluginRef.getConfigManager().getConfigRepair().getArcaneForging().isDowngradesEnabled() || pluginRef.getConfigManager().getConfigRepair().getArcaneForging().isMayLoseEnchants()) {
messages.add(getStatMessage(true, true, SubSkillType.REPAIR_ARCANE_FORGING,
String.valueOf(arcaneBypass ? 100 : repairManager.getKeepEnchantChance()),
String.valueOf(arcaneBypass ? 0 : repairManager.getDowngradeEnchantChance()))); //Jesus those parentheses
}
}
if (canMasterRepair) {
messages.add(getStatMessage(false, true, SubSkillType.REPAIR_REPAIR_MASTERY, repairMasteryBonus));
}
if (canSuperRepair) {
messages.add(getStatMessage(SubSkillType.REPAIR_SUPER_REPAIR, superRepairChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", superRepairChanceLucky) : ""));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.REPAIR);
return textComponents;
}
}

View File

@@ -1,70 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.salvage.SalvageManager;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class SalvageCommand extends SkillCommand {
private boolean canScrapCollector;
private boolean canArcaneSalvage;
public SalvageCommand(mcMMO pluginRef) {
super(PrimarySkillType.SALVAGE, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// TODO Auto-generated method stub
}
@Override
protected void permissionsCheck(Player player) {
canScrapCollector = canUseSubSkill(player, SubSkillType.SALVAGE_SCRAP_COLLECTOR);
canArcaneSalvage = canUseSubSkill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE);
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
SalvageManager salvageManager = pluginRef.getUserManager().getPlayer(player).getSalvageManager();
if (canScrapCollector) {
messages.add(getStatMessage(false, true,
SubSkillType.SALVAGE_SCRAP_COLLECTOR,
String.valueOf(pluginRef.getRankTools().getRank(player, SubSkillType.SALVAGE_SCRAP_COLLECTOR)),
pluginRef.getRankTools().getHighestRankStr(SubSkillType.SALVAGE_SCRAP_COLLECTOR)));
}
if (canArcaneSalvage) {
messages.add(getStatMessage(false, true, SubSkillType.SALVAGE_ARCANE_SALVAGE,
String.valueOf(salvageManager.getArcaneSalvageRank()),
String.valueOf(pluginRef.getRankTools().getHighestRank(SubSkillType.SALVAGE_ARCANE_SALVAGE))));
if (pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getSalvageBehaviour().isArcaneSalvageEnchantLoss()) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template", pluginRef.getLocaleManager().getString("Salvage.Arcane.ExtractFull"), percent.format(salvageManager.getExtractFullEnchantChance() / 100)));
}
if (pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getSalvageBehaviour().isArcaneSalvageDowngrades()) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template", pluginRef.getLocaleManager().getString("Salvage.Arcane.ExtractPartial"), percent.format(salvageManager.getExtractPartialEnchantChance() / 100)));
}
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.SALVAGE);
return textComponents;
}
}

View File

@@ -1,292 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.child.FamilyTree;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.skills.SkillActivationType;
import com.google.common.collect.ImmutableList;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Set;
public abstract class SkillCommand implements TabExecutor {
protected PrimarySkillType skill;
protected DecimalFormat percent = new DecimalFormat("##0.00%");
protected DecimalFormat decimal = new DecimalFormat("##0.00");
private String skillName;
private CommandExecutor skillGuideCommand;
protected mcMMO pluginRef;
public SkillCommand(PrimarySkillType primarySkillType, mcMMO pluginRef) {
this.pluginRef = pluginRef;
this.skill = primarySkillType;
skillName = pluginRef.getSkillTools().getLocalizedSkillName(primarySkillType);
skillGuideCommand = new SkillGuideCommand(primarySkillType, pluginRef);
}
public static String[] addItemToFirstPositionOfArray(String itemToAdd, String... existingArray) {
String[] newArray = new String[existingArray.length + 1];
newArray[0] = itemToAdd;
System.arraycopy(existingArray, 0, newArray, 1, existingArray.length);
return newArray;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (pluginRef.getCommandTools().noConsoleUsage(sender)) {
return true;
}
if (!pluginRef.getCommandTools().hasPlayerDataKey(sender)) {
return true;
}
if (pluginRef.getUserManager().getPlayer((Player) sender) == null) {
sender.sendMessage(pluginRef.getLocaleManager().getString("Profile.PendingLoad"));
return true;
}
switch (args.length) {
case 0:
Player player = (Player) sender;
McMMOPlayer mcMMOPlayer = pluginRef.getUserManager().getPlayer(player);
boolean isLucky = pluginRef.getPermissionTools().lucky(player, skill);
boolean hasEndurance = pluginRef.getSkillTools().getEnduranceLength(player) > 0;
double skillValue = mcMMOPlayer.getSkillLevel(skill);
//Send the players a few blank lines to make finding the top of the skill command easier
if (pluginRef.getConfigManager().getConfigCommands().isSendBlankLines())
for (int i = 0; i < 2; i++) {
player.sendMessage("");
}
permissionsCheck(player);
dataCalculations(player, skillValue);
sendSkillCommandHeader(player, mcMMOPlayer, (int) skillValue);
//Make JSON text components
List<TextComponent> subskillTextComponents = getTextComponents(player);
//Subskills Header
player.sendMessage(pluginRef.getLocaleManager().getString("Skills.Overhaul.Header", pluginRef.getLocaleManager().getString("Effects.SubSkills.Overhaul")));
//Send JSON text components
pluginRef.getTextComponentFactory().sendPlayerSubSkillList(player, subskillTextComponents);
/*for(TextComponent tc : subskillTextComponents)
{
player.spigot().sendMessage(new TextComponent[]{tc, new TextComponent(": TESTING")});
}*/
//Stats
getStatMessages(player, isLucky, hasEndurance, skillValue);
//Header
//Link Header
if (pluginRef.getConfigManager().getConfigAds().isShowWebsiteLinks()) {
player.sendMessage(pluginRef.getLocaleManager().getString("Overhaul.mcMMO.Header"));
pluginRef.getTextComponentFactory().sendPlayerUrlHeader(player);
}
if (pluginRef.getScoreboardSettings().getScoreboardsEnabled()
&& pluginRef.getScoreboardSettings().getConfigSectionScoreboardTypes()
.getConfigSectionSkillBoard().isUseThisBoard()) {
pluginRef.getScoreboardManager().enablePlayerSkillScoreboard(player, skill);
}
return true;
default:
return skillGuideCommand.onCommand(sender, command, label, args);
}
}
private void getStatMessages(Player player, boolean isLucky, boolean hasEndurance, double skillValue) {
List<String> statsMessages = statsDisplay(player, skillValue, hasEndurance, isLucky);
if (!statsMessages.isEmpty()) {
player.sendMessage(pluginRef.getLocaleManager().getString("Skills.Overhaul.Header", pluginRef.getLocaleManager().getString("Commands.Stats.Self.Overhaul")));
for (String message : statsMessages) {
player.sendMessage(message);
}
}
player.sendMessage(pluginRef.getLocaleManager().getString("Guides.Available", skillName, skillName.toLowerCase(Locale.ENGLISH)));
}
private void sendSkillCommandHeader(Player player, McMMOPlayer mcMMOPlayer, int skillValue) {
ChatColor hd1 = ChatColor.DARK_AQUA;
ChatColor c1 = ChatColor.GOLD;
ChatColor c2 = ChatColor.RED;
player.sendMessage(pluginRef.getLocaleManager().getString("Skills.Overhaul.Header", skillName));
if (!pluginRef.getSkillTools().isChildSkill(skill)) {
/*
* NON-CHILD SKILLS
*/
//XP GAIN METHOD
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.XPGain.Overhaul", pluginRef.getLocaleManager().getString("Commands.XPGain." + StringUtils.getCapitalized(skill.toString()))));
//LEVEL
player.sendMessage(pluginRef.getLocaleManager().getString("Effects.Level.Overhaul", skillValue, mcMMOPlayer.getSkillXpLevel(skill), mcMMOPlayer.getXpToLevel(skill)));
} else {
/*
* CHILD SKILLS
*/
Set<PrimarySkillType> parents = FamilyTree.getParents(skill);
ArrayList<PrimarySkillType> parentList = new ArrayList<>();
//TODO: Add JSON here
/*player.sendMessage(parent.getName() + " - " + pluginRef.getLocaleManager().getString("Effects.Level.Overhaul", mcMMOPlayer.getSkillLevel(parent), mcMMOPlayer.getSkillXpLevel(parent), mcMMOPlayer.getXpToLevel(parent)))*/
parentList.addAll(parents);
StringBuilder parentMessage = new StringBuilder();
for (int i = 0; i < parentList.size(); i++) {
if (i + 1 < parentList.size()) {
parentMessage.append(pluginRef.getLocaleManager().getString("Effects.Child.ParentList", pluginRef.getSkillTools().getLocalizedSkillName(parentList.get(i)), mcMMOPlayer.getSkillLevel(parentList.get(i))));
parentMessage.append(ChatColor.GRAY + ", ");
} else {
parentMessage.append(pluginRef.getLocaleManager().getString("Effects.Child.ParentList", pluginRef.getSkillTools().getLocalizedSkillName(parentList.get(i)), mcMMOPlayer.getSkillLevel(parentList.get(i))));
}
}
//XP GAIN METHOD
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.XPGain.Overhaul", pluginRef.getLocaleManager().getString("Commands.XPGain.Child")));
player.sendMessage(pluginRef.getLocaleManager().getString("Effects.Child.Overhaul", skillValue, parentMessage.toString()));
//LEVEL
//player.sendMessage(pluginRef.getLocaleManager().getString("Effects.Child.Overhaul", skillValue, skillValue));
}
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1:
return ImmutableList.of("?");
default:
return ImmutableList.of();
}
}
protected int calculateRank(double skillValue, int maxLevel, int rankChangeLevel) {
return Math.min((int) skillValue, maxLevel) / rankChangeLevel;
}
protected String[] getAbilityDisplayValues(Player player, SubSkillType subSkill) {
return pluginRef.getRandomChanceTools().calculateAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, subSkill);
}
protected String[] formatLengthDisplayValues(Player player, double skillValue) {
int length = pluginRef.getSkillTools().calculateAbilityLength(pluginRef.getUserManager().getPlayer(player), skill, pluginRef.getSkillTools().getSuperAbility(skill));
int enduranceLength = pluginRef.getSkillTools().calculateAbilityLengthPerks(pluginRef.getUserManager().getPlayer(player), skill, pluginRef.getSkillTools().getSuperAbility(skill));
return new String[]{String.valueOf(length), String.valueOf(enduranceLength)};
}
protected String getStatMessage(SubSkillType subSkillType, String... vars) {
return getStatMessage(false, false, subSkillType, vars);
}
protected String getStatMessage(boolean isExtra, boolean isCustom, SubSkillType subSkillType, String... vars) {
String templateKey = isCustom ? "Ability.Generic.Template.Custom" : "Ability.Generic.Template";
String statDescriptionKey = !isExtra ? subSkillType.getLocaleKeyStatDescription(pluginRef) : subSkillType.getLocaleKeyStatExtraDescription(pluginRef);
if (isCustom)
return pluginRef.getLocaleManager().getString(templateKey, pluginRef.getLocaleManager().getString(statDescriptionKey, (Object[]) vars));
else {
String[] mergedList = pluginRef.getNotificationManager().addItemToFirstPositionOfArray(pluginRef.getLocaleManager().getString(statDescriptionKey), vars);
return pluginRef.getLocaleManager().getString(templateKey, (Object[]) mergedList);
}
}
protected abstract void dataCalculations(Player player, double skillValue);
protected String getLimitBreakDescriptionParameter(SubSkillType subSkillType) {
//TODO: Hacky gross code below
boolean pveAllowed = false;
switch(subSkillType) {
case ARCHERY_ARCHERY_LIMIT_BREAK:
if(pluginRef.getConfigManager().getConfigArchery().getLimitBreak().isEnabledForPVE()) {
pveAllowed = true;
}
break;
case AXES_AXES_LIMIT_BREAK:
if(pluginRef.getConfigManager().getConfigAxes().getSubSkills().getConfigAxesLimitBreak().isEnabledForPVE()) {
pveAllowed = true;
}
break;
case SWORDS_SWORDS_LIMIT_BREAK:
if(pluginRef.getConfigManager().getConfigSwords().getSubSkills().getSwordsLimitBreak().isEnabledForPVE()) {
pveAllowed = true;
}
break;
case UNARMED_UNARMED_LIMIT_BREAK:
if(pluginRef.getConfigManager().getConfigUnarmed().getSubSkills().getUnarmedLimitBreak().isEnabledForPVE()) {
pveAllowed = true;
}
break;
default:
pluginRef.getLogger().severe("This skill has no limit break PVE setting defined!");
}
if(pveAllowed) {
return "(PVP/PVE)";
} else {
return "(PVP)";
}
}
protected abstract void permissionsCheck(Player player);
//protected abstract List<String> effectsDisplay();
protected abstract List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky);
protected abstract List<TextComponent> getTextComponents(Player player);
/**
* Checks if a player can use a skill
*
* @param player target player
* @param subSkillType target subskill
* @return true if the player has permission and has the skill unlocked
*/
protected boolean canUseSubSkill(Player player, SubSkillType subSkillType) {
return pluginRef.getPermissionTools().isSubSkillEnabled(player, subSkillType) && pluginRef.getRankTools().hasUnlockedSubskill(player, subSkillType);
}
}

View File

@@ -1,93 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class SmeltingCommand extends SkillCommand {
private String burnTimeModifier;
private String str_secondSmeltChance;
private String str_secondSmeltChanceLucky;
private String str_fluxMiningChance;
private String str_fluxMiningChanceLucky;
private boolean canFuelEfficiency;
private boolean canSecondSmelt;
private boolean canFluxMine;
private boolean canUnderstandTheArt;
public SmeltingCommand(mcMMO pluginRef) {
super(PrimarySkillType.SMELTING, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// FUEL EFFICIENCY
if (canFuelEfficiency) {
burnTimeModifier = String.valueOf(pluginRef.getUserManager().getPlayer(player).getSmeltingManager().getFuelEfficiencyMultiplier());
}
// FLUX MINING
/*if (canFluxMine) {
String[] fluxMiningStrings = getAbilityDisplayValues(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, player, SubSkillType.SMELTING_FLUX_MINING);
str_fluxMiningChance = fluxMiningStrings[0];
str_fluxMiningChanceLucky = fluxMiningStrings[1];
}*/
// SECOND SMELT
if (canSecondSmelt) {
String[] secondSmeltStrings = getAbilityDisplayValues(player, SubSkillType.SMELTING_SECOND_SMELT);
str_secondSmeltChance = secondSmeltStrings[0];
str_secondSmeltChanceLucky = secondSmeltStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canFuelEfficiency = canUseSubSkill(player, SubSkillType.SMELTING_FUEL_EFFICIENCY);
canSecondSmelt = canUseSubSkill(player, SubSkillType.SMELTING_SECOND_SMELT);
//canFluxMine = canUseSubskill(player, SubSkillType.SMELTING_FLUX_MINING);
canUnderstandTheArt = pluginRef.getPermissionTools().vanillaXpBoost(player, skill) && pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SMELTING_UNDERSTANDING_THE_ART);
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
/*if (canFluxMine) {
messages.add(getStatMessage(SubSkillType.SMELTING_FLUX_MINING, str_fluxMiningChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", str_fluxMiningChanceLucky) : ""));
//messages.add(pluginRef.getLocaleManager().getString("Smelting.Ability.FluxMining", str_fluxMiningChance) + (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", str_fluxMiningChanceLucky) : ""));
}*/
if (canFuelEfficiency) {
messages.add(getStatMessage(false, true, SubSkillType.SMELTING_FUEL_EFFICIENCY, burnTimeModifier));
}
if (canSecondSmelt) {
messages.add(getStatMessage(SubSkillType.SMELTING_SECOND_SMELT, str_secondSmeltChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", str_secondSmeltChanceLucky) : ""));
}
if (canUnderstandTheArt) {
messages.add(getStatMessage(false, true, SubSkillType.SMELTING_UNDERSTANDING_THE_ART,
String.valueOf(pluginRef.getUserManager().getPlayer(player).getSmeltingManager().getVanillaXpMultiplier())));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.SMELTING);
return textComponents;
}
}

View File

@@ -1,115 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class SwordsCommand extends SkillCommand {
private String counterChance;
private String counterChanceLucky;
private int bleedLength;
private String bleedChance;
private String bleedChanceLucky;
private String serratedStrikesLength;
private String serratedStrikesLengthEndurance;
private boolean canCounter;
private boolean canSerratedStrike;
private boolean canBleed;
public SwordsCommand(mcMMO pluginRef) {
super(PrimarySkillType.SWORDS, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// SWORDS_COUNTER_ATTACK
if (canCounter) {
String[] counterStrings = getAbilityDisplayValues(player, SubSkillType.SWORDS_COUNTER_ATTACK);
counterChance = counterStrings[0];
counterChanceLucky = counterStrings[1];
}
// SWORDS_RUPTURE
if (canBleed) {
bleedLength = pluginRef.getUserManager().getPlayer(player).getSwordsManager().getRuptureBleedTicks();
String[] bleedStrings = getAbilityDisplayValues(player, SubSkillType.SWORDS_RUPTURE);
bleedChance = bleedStrings[0];
bleedChanceLucky = bleedStrings[1];
}
// SERRATED STRIKES
if (canSerratedStrike) {
String[] serratedStrikesStrings = formatLengthDisplayValues(player, skillValue);
serratedStrikesLength = serratedStrikesStrings[0];
serratedStrikesLengthEndurance = serratedStrikesStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canBleed = canUseSubSkill(player, SubSkillType.SWORDS_RUPTURE);
canCounter = canUseSubSkill(player, SubSkillType.SWORDS_COUNTER_ATTACK);
canSerratedStrike = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.SWORDS_SERRATED_STRIKES) && pluginRef.getPermissionTools().serratedStrikes(player);
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
int ruptureTicks = pluginRef.getUserManager().getPlayer(player).getSwordsManager().getRuptureBleedTicks();
double ruptureDamagePlayer = pluginRef.getConfigManager().getConfigSwords().getRuptureDamagePlayer();
double pveRupture = pluginRef.getConfigManager().getConfigSwords().getRuptureDamageMobs();
double pvpDamageRupture = pluginRef.getRankTools().getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? ruptureDamagePlayer * 1.5D : ruptureDamagePlayer;
double ruptureDamageMobs = pluginRef.getRankTools().getRank(player, SubSkillType.SWORDS_RUPTURE) >= 3 ? pveRupture * 1.5D : pveRupture;
if (canCounter) {
messages.add(getStatMessage(SubSkillType.SWORDS_COUNTER_ATTACK, counterChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", counterChanceLucky) : ""));
}
if (canBleed) {
messages.add(getStatMessage(SubSkillType.SWORDS_RUPTURE, bleedChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", bleedChanceLucky) : ""));
messages.add(getStatMessage(true, true, SubSkillType.SWORDS_RUPTURE,
String.valueOf(ruptureTicks),
String.valueOf(pvpDamageRupture),
String.valueOf(ruptureDamageMobs)));
messages.add(pluginRef.getLocaleManager().getString("Swords.Combat.Rupture.Note"));
}
if (canSerratedStrike) {
messages.add(getStatMessage(SubSkillType.SWORDS_SERRATED_STRIKES, serratedStrikesLength)
+ (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", serratedStrikesLengthEndurance) : ""));
}
if (canUseSubSkill(player, SubSkillType.SWORDS_STAB)) {
messages.add(getStatMessage(SubSkillType.SWORDS_STAB,
String.valueOf(pluginRef.getUserManager().getPlayer(player).getSwordsManager().getStabDamage())));
}
if (canUseSubSkill(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.SWORDS_SWORDS_LIMIT_BREAK,
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamageAgainstQuality(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK, 1000))));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.SWORDS);
return textComponents;
}
}

View File

@@ -1,112 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class TamingCommand extends SkillCommand {
private String goreChance;
private String goreChanceLucky;
private boolean canBeastLore;
private boolean canGore;
private boolean canSharpenedClaws;
private boolean canEnvironmentallyAware;
private boolean canThickFur;
private boolean canShockProof;
private boolean canCallWild;
private boolean canFastFood;
private boolean canHolyHound;
public TamingCommand(mcMMO pluginRef) {
super(PrimarySkillType.TAMING, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
if (canGore) {
String[] goreStrings = getAbilityDisplayValues(player, SubSkillType.TAMING_GORE);
goreChance = goreStrings[0];
goreChanceLucky = goreStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canBeastLore = canUseSubSkill(player, SubSkillType.TAMING_BEAST_LORE);
canCallWild = pluginRef.getPermissionTools().callOfTheWild(player, EntityType.HORSE) || pluginRef.getPermissionTools().callOfTheWild(player, EntityType.WOLF) || pluginRef.getPermissionTools().callOfTheWild(player, EntityType.OCELOT);
canEnvironmentallyAware = canUseSubSkill(player, SubSkillType.TAMING_ENVIRONMENTALLY_AWARE);
canFastFood = canUseSubSkill(player, SubSkillType.TAMING_FAST_FOOD_SERVICE);
canGore = canUseSubSkill(player, SubSkillType.TAMING_GORE);
canSharpenedClaws = canUseSubSkill(player, SubSkillType.TAMING_SHARPENED_CLAWS);
canShockProof = canUseSubSkill(player, SubSkillType.TAMING_SHOCK_PROOF);
canThickFur = canUseSubSkill(player, SubSkillType.TAMING_THICK_FUR);
canHolyHound = canUseSubSkill(player, SubSkillType.TAMING_HOLY_HOUND);
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
if (canEnvironmentallyAware) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template", pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.0"), pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.1")));
}
if (canFastFood) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.8"),
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.9",
percent.format(pluginRef.getDynamicSettingsManager().getSkillStaticChance(SubSkillType.TAMING_FAST_FOOD_SERVICE) / 100D))));
}
if (canGore) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
pluginRef.getLocaleManager().getString("Taming.Combat.Chance.Gore"),
goreChance) + (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", goreChanceLucky) : ""));
}
if (canHolyHound) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.10"),
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.11")));
}
if (canSharpenedClaws) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.6"),
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.7",
pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getTamingBehaviour().getSharpenedClawsBonusDamage(true))));
}
if (canShockProof) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.4"),
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.5",
pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getTamingBehaviour().getShockProofModifier())));
}
if (canThickFur) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template",
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.2"),
pluginRef.getLocaleManager().getString("Taming.Ability.Bonus.3",
pluginRef.getDynamicSettingsManager().getSkillBehaviourManager().getTamingBehaviour().getThickFurModifier())));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, this.skill);
return textComponents;
}
}

View File

@@ -1,127 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class UnarmedCommand extends SkillCommand {
private String berserkLength;
private String berserkLengthEndurance;
private String deflectChance;
private String deflectChanceLucky;
private String disarmChance;
private String disarmChanceLucky;
private String ironGripChance;
private String ironGripChanceLucky;
private double ironArmBonus;
private boolean canBerserk;
private boolean canDisarm;
private boolean canIronArm;
private boolean canDeflect;
private boolean canIronGrip;
public UnarmedCommand(mcMMO pluginRef) {
super(PrimarySkillType.UNARMED, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// UNARMED_ARROW_DEFLECT
if (canDeflect) {
String[] deflectStrings = getAbilityDisplayValues(player, SubSkillType.UNARMED_ARROW_DEFLECT);
deflectChance = deflectStrings[0];
deflectChanceLucky = deflectStrings[1];
}
// BERSERK
if (canBerserk) {
String[] berserkStrings = formatLengthDisplayValues(player, skillValue);
berserkLength = berserkStrings[0];
berserkLengthEndurance = berserkStrings[1];
}
// UNARMED_DISARM
if (canDisarm) {
String[] disarmStrings = getAbilityDisplayValues(player, SubSkillType.UNARMED_DISARM);
disarmChance = disarmStrings[0];
disarmChanceLucky = disarmStrings[1];
}
// IRON ARM
if (canIronArm) {
ironArmBonus = pluginRef.getUserManager().getPlayer(player).getUnarmedManager().getIronArmDamage();
}
// IRON GRIP
if (canIronGrip) {
String[] ironGripStrings = getAbilityDisplayValues(player, SubSkillType.UNARMED_IRON_GRIP);
ironGripChance = ironGripStrings[0];
ironGripChanceLucky = ironGripStrings[1];
}
}
@Override
protected void permissionsCheck(Player player) {
canBerserk = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.UNARMED_BERSERK) && pluginRef.getPermissionTools().berserk(player);
canIronArm = canUseSubSkill(player, SubSkillType.UNARMED_IRON_ARM_STYLE);
canDeflect = canUseSubSkill(player, SubSkillType.UNARMED_ARROW_DEFLECT);
canDisarm = canUseSubSkill(player, SubSkillType.UNARMED_DISARM);
canIronGrip = canUseSubSkill(player, SubSkillType.UNARMED_IRON_GRIP);
// TODO: Apparently we forgot about block cracker?
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
if (canDeflect) {
messages.add(getStatMessage(SubSkillType.UNARMED_ARROW_DEFLECT, deflectChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", deflectChanceLucky) : ""));
//messages.add(pluginRef.getLocaleManager().getString("Unarmed.Ability.Chance.ArrowDeflect", deflectChance) + (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", deflectChanceLucky) : ""));
}
if (canBerserk) {
messages.add(getStatMessage(SubSkillType.UNARMED_BERSERK, berserkLength)
+ (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", berserkLengthEndurance) : ""));
//messages.add(pluginRef.getLocaleManager().getString("Unarmed.Ability.Berserk.Length", berserkLength) + (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", berserkLengthEndurance) : ""));
}
if (canDisarm) {
messages.add(getStatMessage(SubSkillType.UNARMED_DISARM, disarmChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", disarmChanceLucky) : ""));
//messages.add(pluginRef.getLocaleManager().getString("Unarmed.Ability.Chance.Disarm", disarmChance) + (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", disarmChanceLucky) : ""));
}
if (canIronArm) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template", pluginRef.getLocaleManager().getString("Unarmed.Ability.Bonus.0"), pluginRef.getLocaleManager().getString("Unarmed.Ability.Bonus.1", ironArmBonus)));
}
if (canIronGrip) {
messages.add(getStatMessage(SubSkillType.UNARMED_IRON_GRIP, ironGripChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", ironGripChanceLucky) : ""));
//messages.add(pluginRef.getLocaleManager().getString("Unarmed.Ability.Chance.IronGrip", ironGripChance) + (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", ironGripChanceLucky) : ""));
}
if (canUseSubSkill(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.UNARMED_UNARMED_LIMIT_BREAK,
String.valueOf(pluginRef.getCombatTools().getLimitBreakDamageAgainstQuality(player, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK, 1000))));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.UNARMED);
return textComponents;
}
}

View File

@@ -1,91 +0,0 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class WoodcuttingCommand extends SkillCommand {
private String treeFellerLength;
private String treeFellerLengthEndurance;
private String doubleDropChance;
private String doubleDropChanceLucky;
private boolean canTreeFell;
private boolean canLeafBlow;
private boolean canDoubleDrop;
private boolean canSplinter;
private boolean canBarkSurgeon;
private boolean canNaturesBounty;
public WoodcuttingCommand(mcMMO pluginRef) {
super(PrimarySkillType.WOODCUTTING, pluginRef);
}
@Override
protected void dataCalculations(Player player, double skillValue) {
// DOUBLE DROPS
if (canDoubleDrop) {
setDoubleDropClassicChanceStrings(player);
}
// TREE FELLER
if (canTreeFell) {
String[] treeFellerStrings = formatLengthDisplayValues(player, skillValue);
treeFellerLength = treeFellerStrings[0];
treeFellerLengthEndurance = treeFellerStrings[1];
}
}
private void setDoubleDropClassicChanceStrings(Player player) {
String[] doubleDropStrings = getAbilityDisplayValues(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER);
doubleDropChance = doubleDropStrings[0];
doubleDropChanceLucky = doubleDropStrings[1];
}
@Override
protected void permissionsCheck(Player player) {
canTreeFell = pluginRef.getRankTools().hasUnlockedSubskill(player, SubSkillType.WOODCUTTING_TREE_FELLER) && pluginRef.getPermissionTools().treeFeller(player);
canDoubleDrop = canUseSubSkill(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && pluginRef.getRankTools().getRank(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1;
canLeafBlow = canUseSubSkill(player, SubSkillType.WOODCUTTING_LEAF_BLOWER);
/*canSplinter = canUseSubskill(player, SubSkillType.WOODCUTTING_SPLINTER);
canBarkSurgeon = canUseSubskill(player, SubSkillType.WOODCUTTING_BARK_SURGEON);
canNaturesBounty = canUseSubskill(player, SubSkillType.WOODCUTTING_NATURES_BOUNTY);*/
}
@Override
protected List<String> statsDisplay(Player player, double skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>();
if (canDoubleDrop) {
messages.add(getStatMessage(SubSkillType.WOODCUTTING_HARVEST_LUMBER, doubleDropChance)
+ (isLucky ? pluginRef.getLocaleManager().getString("Perks.Lucky.Bonus", doubleDropChanceLucky) : ""));
}
if (canLeafBlow) {
messages.add(pluginRef.getLocaleManager().getString("Ability.Generic.Template", pluginRef.getLocaleManager().getString("Woodcutting.Ability.0"), pluginRef.getLocaleManager().getString("Woodcutting.Ability.1")));
}
if (canTreeFell) {
messages.add(getStatMessage(SubSkillType.WOODCUTTING_TREE_FELLER, treeFellerLength)
+ (hasEndurance ? pluginRef.getLocaleManager().getString("Perks.ActivationTime.Bonus", treeFellerLengthEndurance) : ""));
}
return messages;
}
@Override
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
pluginRef.getTextComponentFactory().getSubSkillTextComponents(player, textComponents, PrimarySkillType.WOODCUTTING);
return textComponents;
}
}

View File

@@ -1,113 +0,0 @@
package com.gmail.nossr50.config;
import com.gmail.nossr50.mcMMO;
import java.io.File;
import java.util.ArrayList;
/**
* Constants relating to config folders and paths
*/
public class ConfigConstants {
public final static ArrayList<String> EXAMPLE_BLACKLIST_WORLDS_LIST_DEFAULT;
public final static String SKILL_SCALING_BENEFIT_EXPLANATION = "\nSub-Skills dynamically adjust their rewards to match the max bonus level, you can think of it as a curve that calculates what bonuses " +
"\n a player should have based on how far they are from the max bonus level value, and the other parameters used for the scaling of that sub-skill.";
/* FOLDER NAMES */
public static final String FOLDER_NAME_CONFIG = "config";
public static final String FOLDER_NAME_SKILLS = "skills";
public static final String FOLDER_NAME_EXPERIENCE = "Experience Settings";
public static final String FOLDER_NAME_DEFAULTS = "defaults";
/* RELATIVE PATHS */
public final static String RELATIVE_PATH_CONFIG_DIR = File.separator + FOLDER_NAME_CONFIG + File.separator;
public final static String RELATIVE_PATH_SKILLS_DIR = RELATIVE_PATH_CONFIG_DIR + FOLDER_NAME_SKILLS + File.separator;
public final static String RELATIVE_PATH_XP_DIR = RELATIVE_PATH_CONFIG_DIR + FOLDER_NAME_EXPERIENCE + File.separator;
private final static String[] EXAMPLE_BLACKLIST_WORLDS = {"Example_15434453", "Example_2324423", "Example_323423465"};
/* Field Names & Comments */
public static final String SUB_SKILL_NODE = "Sub-Skill";
public final static String MAX_CHANCE_FIELD_NAME = "Max-Chance";
public final static String STATIC_ACTIVATION_FIELD_NAME = "Activation-Chance";
public final static String MAX_BONUS_LEVEL_FIELD_NAME = "Max-Bonus-Level";
public final static String MAX_BONUS_LEVEL_DESCRIPTION = "This is the level at which full benefits for this skill will be reached." +
"\nProperties of this skill may or may not scale with level, but those that do will gradually increase until max level is achieved.";
public final static String MAX_BONUS_PERCENTAGE_FIELD_NAME = "Max-Bonus-Percentage";
public final static String MAX_CHANCE_FIELD_DESCRIPTION = "The maximum probability for this skill to succeed.";
//Add the worlds to the list
static {
EXAMPLE_BLACKLIST_WORLDS_LIST_DEFAULT = new ArrayList<>();
EXAMPLE_BLACKLIST_WORLDS_LIST_DEFAULT.add(EXAMPLE_BLACKLIST_WORLDS[0]);
EXAMPLE_BLACKLIST_WORLDS_LIST_DEFAULT.add(EXAMPLE_BLACKLIST_WORLDS[1]);
EXAMPLE_BLACKLIST_WORLDS_LIST_DEFAULT.add(EXAMPLE_BLACKLIST_WORLDS[2]);
}
/**
* Return the data folder for mcMMO
*
* @return the File for the data folder used by mcMMO
*/
public static File getDataFolder(mcMMO pluginRef) {
return pluginRef.getDataFolder();
}
public static File getConfigFolder(mcMMO pluginRef) {
return new File(getDataFolder(pluginRef), FOLDER_NAME_CONFIG);
}
public static File getDefaultsFolder(mcMMO pluginRef) {
return new File(getConfigFolder(pluginRef).getAbsolutePath(), FOLDER_NAME_DEFAULTS);
}
public static File getDefaultsConfigFolder(mcMMO pluginRef) {
return new File(getDefaultsFolder(pluginRef).getAbsolutePath(), FOLDER_NAME_CONFIG);
}
public static File getDefaultsSkillFolder(mcMMO pluginRef) {
return new File(getDefaultsConfigFolder(pluginRef).getAbsolutePath(), FOLDER_NAME_SKILLS);
}
public static File getDefaultsXPFolder(mcMMO pluginRef) {
return new File(getDefaultsConfigFolder(pluginRef).getAbsolutePath(), FOLDER_NAME_EXPERIENCE);
}
public static File getConfigSkillFolder(mcMMO pluginRef) {
return new File(getConfigFolder(pluginRef).getAbsolutePath(), FOLDER_NAME_SKILLS);
}
public static File getConfigXPFolder(mcMMO pluginRef) {
return new File(getConfigFolder(pluginRef).getAbsolutePath(), FOLDER_NAME_EXPERIENCE);
}
/**
* Creates all directories used by mcMMO config files
*/
public static void makeAllConfigDirectories(mcMMO pluginRef) {
/* CONFIG DIRECTORY */
if (!getConfigFolder(pluginRef).exists())
getConfigFolder(pluginRef).mkdirs();
/* DEFAULT DIRECTORIES */
if (!getDefaultsFolder(pluginRef).exists())
getDefaultsFolder(pluginRef).mkdirs();
if (!getDefaultsConfigFolder(pluginRef).exists())
getDefaultsConfigFolder(pluginRef).mkdirs();
if (!getDefaultsSkillFolder(pluginRef).exists())
getDefaultsSkillFolder(pluginRef).mkdirs();
if (!getDefaultsXPFolder(pluginRef).exists())
getDefaultsXPFolder(pluginRef).mkdirs();
/* CONFIG SUBDIRECTORIES */
if (!getConfigSkillFolder(pluginRef).exists())
getConfigSkillFolder(pluginRef).mkdirs();
if (!getConfigXPFolder(pluginRef).exists())
getConfigXPFolder(pluginRef).mkdirs();
}
}

View File

@@ -1,491 +0,0 @@
package com.gmail.nossr50.config;
import com.gmail.nossr50.config.admin.ConfigAdmin;
import com.gmail.nossr50.config.antiexploit.ConfigExploitPrevention;
import com.gmail.nossr50.config.backup.ConfigAutomatedBackups;
import com.gmail.nossr50.config.commands.ConfigCommands;
import com.gmail.nossr50.config.database.ConfigDatabase;
import com.gmail.nossr50.config.donation.ConfigAuthorAdvertisements;
import com.gmail.nossr50.config.event.ConfigEvent;
import com.gmail.nossr50.config.experience.ConfigExperience;
import com.gmail.nossr50.config.hardcore.ConfigHardcore;
import com.gmail.nossr50.config.items.ConfigItems;
import com.gmail.nossr50.config.language.ConfigLanguage;
import com.gmail.nossr50.config.metrics.ConfigMetrics;
import com.gmail.nossr50.config.mobs.ConfigMobs;
import com.gmail.nossr50.config.motd.ConfigMOTD;
import com.gmail.nossr50.config.notifications.ConfigNotifications;
import com.gmail.nossr50.config.notifications.PlayerNotificationSettings;
import com.gmail.nossr50.config.particles.ConfigParticles;
import com.gmail.nossr50.config.party.ConfigParty;
import com.gmail.nossr50.config.party.data.ConfigPartyData;
import com.gmail.nossr50.config.playerleveling.ConfigLeveling;
import com.gmail.nossr50.config.scoreboard.ConfigScoreboard;
import com.gmail.nossr50.config.serializers.*;
import com.gmail.nossr50.config.skills.acrobatics.ConfigAcrobatics;
import com.gmail.nossr50.config.skills.alchemy.ConfigAlchemy;
import com.gmail.nossr50.config.skills.archery.ConfigArchery;
import com.gmail.nossr50.config.skills.axes.ConfigAxes;
import com.gmail.nossr50.config.skills.coreskills.ConfigCoreSkills;
import com.gmail.nossr50.config.skills.exampleconfigs.ConfigNameRegisterDefaults;
import com.gmail.nossr50.config.skills.exampleconfigs.MinecraftMaterialWrapper;
import com.gmail.nossr50.config.skills.excavation.ConfigExcavation;
import com.gmail.nossr50.config.skills.fishing.ConfigFishing;
import com.gmail.nossr50.config.skills.herbalism.ConfigHerbalism;
import com.gmail.nossr50.config.skills.mining.ConfigMining;
import com.gmail.nossr50.config.skills.ranks.ConfigRanks;
import com.gmail.nossr50.config.skills.ranks.SkillRankProperty;
import com.gmail.nossr50.config.skills.repair.ConfigRepair;
import com.gmail.nossr50.config.skills.salvage.ConfigSalvage;
import com.gmail.nossr50.config.skills.smelting.ConfigSmelting;
import com.gmail.nossr50.config.skills.swords.ConfigSwords;
import com.gmail.nossr50.config.skills.taming.ConfigTaming;
import com.gmail.nossr50.config.skills.unarmed.ConfigUnarmed;
import com.gmail.nossr50.config.skills.woodcutting.ConfigWoodcutting;
import com.gmail.nossr50.config.sound.ConfigSound;
import com.gmail.nossr50.config.sound.SoundSetting;
import com.gmail.nossr50.config.superabilities.ConfigSuperAbilities;
import com.gmail.nossr50.config.worldblacklist.ConfigWorldBlacklist;
import com.gmail.nossr50.datatypes.experience.CustomXPPerk;
import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.datatypes.party.PartyFeature;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.properties.DamageProperty;
import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType;
import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
import com.google.common.reflect.TypeToken;
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
import ninja.leaping.configurate.objectmapping.serialize.TypeSerializerCollection;
import ninja.leaping.configurate.objectmapping.serialize.TypeSerializers;
import org.bukkit.Material;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
/**
* The Config Manager handles initializing, loading, and unloading registers for all configs that mcMMO uses
* This makes sure that mcMMO properly loads and unloads its values on reload
* Settings in configs are sometimes not platform-ready, you can find platform ready implementations in the {@link com.gmail.nossr50.core.DynamicSettingsManager DynamicSettingsManager}
*/
public final class ConfigManager {
private final mcMMO pluginRef;
/* File array - Used for backups */
private ArrayList<File> userFiles;
/* Custom Serialization */
private TypeSerializerCollection customSerializers;
/* CONFIG INSTANCES */
private SerializedConfigLoader<ConfigDatabase> configDatabase;
private SerializedConfigLoader<ConfigScoreboard> configScoreboard;
private SerializedConfigLoader<ConfigLeveling> configLeveling;
private SerializedConfigLoader<ConfigWorldBlacklist> configWorldBlacklist;
private SerializedConfigLoader<ConfigExploitPrevention> configExploitPrevention;
private SerializedConfigLoader<ConfigHardcore> configHardcore;
private SerializedConfigLoader<ConfigMetrics> configMetrics;
private SerializedConfigLoader<ConfigMOTD> configMOTD;
private SerializedConfigLoader<ConfigAuthorAdvertisements> configAuthorAdvertisements;
private SerializedConfigLoader<ConfigAutomatedBackups> configAutomatedBackups;
private SerializedConfigLoader<ConfigCommands> configCommands;
private SerializedConfigLoader<ConfigItems> configItems;
private SerializedConfigLoader<ConfigLanguage> configLanguage;
private SerializedConfigLoader<ConfigParticles> configParticles;
private SerializedConfigLoader<ConfigParty> configParty;
private SerializedConfigLoader<ConfigNotifications> configNotifications;
private SerializedConfigLoader<ConfigSuperAbilities> configSuperAbilities;
private SerializedConfigLoader<ConfigAdmin> configAdmin;
private SerializedConfigLoader<ConfigMobs> configMobs;
private SerializedConfigLoader<ConfigExperience> configExperience;
private SerializedConfigLoader<ConfigCoreSkills> configCoreSkills;
private SerializedConfigLoader<ConfigEvent> configEvent;
private SerializedConfigLoader<ConfigRanks> configRanks;
private SerializedConfigLoader<ConfigSound> configSound;
private SerializedConfigLoader<ConfigNameRegisterDefaults> configDefaultExamples;
private ConfigAcrobatics configAcrobatics;
private ConfigAlchemy configAlchemy;
private ConfigArchery configArchery;
private ConfigAxes configAxes;
private ConfigExcavation configExcavation;
private ConfigFishing configFishing;
private ConfigHerbalism configHerbalism;
private ConfigMining configMining;
private ConfigRepair configRepair;
private ConfigSwords configSwords;
private ConfigTaming configTaming;
private ConfigUnarmed configUnarmed;
private ConfigWoodcutting configWoodcutting;
private ConfigSmelting configSmelting;
private ConfigSalvage configSalvage;
private HashMap<PrimarySkillType, SerializedConfigLoader<?>> skillConfigLoaders;
//Data
private SerializedConfigLoader<ConfigPartyData> partyData;
public ConfigManager(mcMMO pluginRef) {
this.pluginRef = pluginRef;
userFiles = new ArrayList<>();
}
public void loadConfigs() {
//Register Custom Serializers
registerCustomTypeSerializers();
//Serialized Configs
initSerializedConfigs();
//Serialized Data
initSerializedDataFiles();
}
private void initSerializedDataFiles() {
partyData = new SerializedConfigLoader<>(pluginRef, ConfigPartyData.class, "partydata.conf", "PartyData", null);
}
private void initSerializedConfigs() {
//There's some race conditions here because mcMMO is goddamn spaghetti mess, language has to load first
configLanguage = new SerializedConfigLoader<>(pluginRef, ConfigLanguage.class, "language.conf", "Language", null);
/*
* No more race conditions
*/
configDatabase = new SerializedConfigLoader<>(pluginRef, ConfigDatabase.class, "database_settings.conf", "Database", null);
configScoreboard = new SerializedConfigLoader<>(pluginRef, ConfigScoreboard.class, "scoreboard.conf", "Scoreboard", null);
configLeveling = new SerializedConfigLoader<>(pluginRef, ConfigLeveling.class, "player_leveling.conf", "Player-Leveling", null);
configWorldBlacklist = new SerializedConfigLoader<>(pluginRef, ConfigWorldBlacklist.class, "world_blacklist.conf", "World-Blacklist", null);
configExploitPrevention = new SerializedConfigLoader<>(pluginRef, ConfigExploitPrevention.class, "anti_exploit.conf", "Anti-Exploit", null);
configMOTD = new SerializedConfigLoader<>(pluginRef, ConfigMOTD.class, "message_of_the_day.conf", "MOTD", null);
configHardcore = new SerializedConfigLoader<>(pluginRef, ConfigHardcore.class, "hardcore_mode.conf", "Hardcore-Mode", null);
configMetrics = new SerializedConfigLoader<>(pluginRef, ConfigMetrics.class, "analytics_reporting.conf", "Analytic-Reporting", null);
configAuthorAdvertisements = new SerializedConfigLoader<>(pluginRef, ConfigAuthorAdvertisements.class, "author_support_advertisements.conf", "mcMMO", null);
configAutomatedBackups = new SerializedConfigLoader<>(pluginRef, ConfigAutomatedBackups.class, "automated_backups.conf", "Automated-Backups", null);
configCommands = new SerializedConfigLoader<>(pluginRef, ConfigCommands.class, "commands.conf", "Commands", null);
configItems = new SerializedConfigLoader<>(pluginRef, ConfigItems.class, "custom_items.conf", "Items", null);
configParticles = new SerializedConfigLoader<>(pluginRef, ConfigParticles.class, "particle_spawning.conf", "Particles", null);
configParty = new SerializedConfigLoader<>(pluginRef, ConfigParty.class, "party.conf", "Party", null);
configNotifications = new SerializedConfigLoader<>(pluginRef, ConfigNotifications.class, "alerts_and_notifications.conf", "Notifications", null);
configSuperAbilities = new SerializedConfigLoader<>(pluginRef, ConfigSuperAbilities.class, "skill_super_abilities.conf", "Super-Abilities", null);
configAdmin = new SerializedConfigLoader<>(pluginRef, ConfigAdmin.class, "admin.conf", "Admin", null);
configMobs = new SerializedConfigLoader<>(pluginRef, ConfigMobs.class, "creatures.conf", "Creatures", null);
configExperience = new SerializedConfigLoader<>(pluginRef, ConfigExperience.class, "experience.conf", "Experience", null);
configCoreSkills = new SerializedConfigLoader<>(pluginRef, ConfigCoreSkills.class, "core_skills.conf", "Core-Skills", null);
configEvent = new SerializedConfigLoader<>(pluginRef, ConfigEvent.class, "events.conf", "Events", null);
configRanks = new SerializedConfigLoader<>(pluginRef, ConfigRanks.class, "ranks.conf", "Skill-Ranks", null);
configSound = new SerializedConfigLoader<>(pluginRef, ConfigSound.class, "sounds.conf", "Sounds", null);
configDefaultExamples = new SerializedConfigLoader<>(pluginRef, ConfigNameRegisterDefaults.class, "minecraft_item_block_name_examples.conf", "Minecraft", null);
initSerializedSkillConfigs();
}
@SuppressWarnings(value = "unchecked")
private void initSerializedSkillConfigs() {
//Init HashMap
skillConfigLoaders = new HashMap<>();
//Init and register serialized skill configs
registerSkillConfig(PrimarySkillType.ACROBATICS, ConfigAcrobatics.class);
registerSkillConfig(PrimarySkillType.ALCHEMY, ConfigAlchemy.class);
registerSkillConfig(PrimarySkillType.SALVAGE, ConfigSalvage.class);
registerSkillConfig(PrimarySkillType.ARCHERY, ConfigArchery.class);
registerSkillConfig(PrimarySkillType.AXES, ConfigAxes.class);
registerSkillConfig(PrimarySkillType.EXCAVATION, ConfigExcavation.class);
registerSkillConfig(PrimarySkillType.FISHING, ConfigFishing.class);
registerSkillConfig(PrimarySkillType.HERBALISM, ConfigHerbalism.class);
registerSkillConfig(PrimarySkillType.MINING, ConfigMining.class);
registerSkillConfig(PrimarySkillType.REPAIR, ConfigRepair.class);
registerSkillConfig(PrimarySkillType.SWORDS, ConfigSwords.class);
registerSkillConfig(PrimarySkillType.TAMING, ConfigTaming.class);
registerSkillConfig(PrimarySkillType.UNARMED, ConfigUnarmed.class);
registerSkillConfig(PrimarySkillType.WOODCUTTING, ConfigWoodcutting.class);
registerSkillConfig(PrimarySkillType.SMELTING, ConfigSmelting.class);
//Setup Typed refs
configAcrobatics = (ConfigAcrobatics) skillConfigLoaders.get(PrimarySkillType.ACROBATICS).getConfig();
configAlchemy = (ConfigAlchemy) skillConfigLoaders.get(PrimarySkillType.ALCHEMY).getConfig();
configSalvage = (ConfigSalvage) skillConfigLoaders.get(PrimarySkillType.SALVAGE).getConfig();
configArchery = (ConfigArchery) skillConfigLoaders.get(PrimarySkillType.ARCHERY).getConfig();
configAxes = (ConfigAxes) skillConfigLoaders.get(PrimarySkillType.AXES).getConfig();
configExcavation = (ConfigExcavation) skillConfigLoaders.get(PrimarySkillType.EXCAVATION).getConfig();
configFishing = (ConfigFishing) skillConfigLoaders.get(PrimarySkillType.FISHING).getConfig();
configHerbalism = (ConfigHerbalism) skillConfigLoaders.get(PrimarySkillType.HERBALISM).getConfig();
configMining = (ConfigMining) skillConfigLoaders.get(PrimarySkillType.MINING).getConfig();
configRepair = (ConfigRepair) skillConfigLoaders.get(PrimarySkillType.REPAIR).getConfig();
configSwords = (ConfigSwords) skillConfigLoaders.get(PrimarySkillType.SWORDS).getConfig();
configTaming = (ConfigTaming) skillConfigLoaders.get(PrimarySkillType.TAMING).getConfig();
configUnarmed = (ConfigUnarmed) skillConfigLoaders.get(PrimarySkillType.UNARMED).getConfig();
configWoodcutting = (ConfigWoodcutting) skillConfigLoaders.get(PrimarySkillType.WOODCUTTING).getConfig();
configSmelting = (ConfigSmelting) skillConfigLoaders.get(PrimarySkillType.SMELTING).getConfig();
}
private void registerCustomTypeSerializers() {
/*
TypeTokens are obtained in two ways
For Raw basic classes:
TypeToken<String> stringTok = TypeToken.of(String.class);
TypeToken<Integer> intTok = TypeToken.of(Integer.class);
For Generics:
TypeToken<List<String>> stringListTok = new TypeToken<List<String>>() {};
Wildcard example:
TypeToken<Map<?, ?>> wildMapTok = new TypeToken<Map<?, ?>>() {};
*/
customSerializers = TypeSerializers.getDefaultSerializers().newChild();
pluginRef.getLogger().info("Registering custom type serializers for Configurate...");
customSerializers.registerType(new TypeToken<PrimarySkillType>() {}, new CustomEnumValueSerializer());
customSerializers.registerType(new TypeToken<Material>() {}, new CustomEnumValueSerializer());
customSerializers.registerType(new TypeToken<PartyFeature>() {}, new CustomEnumValueSerializer());
customSerializers.registerType(new TypeToken<FormulaType>() {}, new CustomEnumValueSerializer());
customSerializers.registerType(new TypeToken<CallOfTheWildType>() {}, new CustomEnumValueSerializer());
// customSerializers.registerType(new TypeToken<MMOItem<?>>() {}, new ItemStackSerializer());
customSerializers.registerType(new TypeToken<Set<?>>() {}, new SetSerializer());
// customSerializers.registerType(new TypeToken<ItemMatch<?>>() {}, new CustomItemTargetSerializer());
// customSerializers.registerType(new TypeToken<SimpleRepairCost>() {}, new SimpleRepairCostSerializer());
customSerializers.registerType(TypeToken.of(TamingSummon.class), new TamingSummonSerializer());
// customSerializers.registerType(TypeToken.of(Repairable.class), new RepairableSerializer());
customSerializers.registerType(TypeToken.of(Salvageable.class), new SalvageableSerializer());
customSerializers.registerType(TypeToken.of(MinecraftMaterialWrapper.class), new MinecraftMaterialWrapperSerializer());
customSerializers.registerType(TypeToken.of(CustomXPPerk.class), new CustomXPPerkSerializer());
customSerializers.registerType(TypeToken.of(DamageProperty.class), new DamagePropertySerializer());
customSerializers.registerType(TypeToken.of(SkillRankProperty.class), new SkillRankPropertySerializer());
customSerializers.registerType(TypeToken.of(PlayerNotificationSettings.class), new PlayerNotificationSerializer());
customSerializers.registerType(TypeToken.of(SoundSetting.class), new SoundSettingSerializer());
// customSerializers.registerType(TypeToken.of(ItemWildcards.class), new ItemWildcardSerializer());
// customSerializers.registerType(TypeToken.of(RepairTransaction.class), new RepairTransactionSerializer());
// customSerializers.registerType(TypeToken.of(RawNBT.class), new RawNBTSerializer());
}
/**
* Gets the serializers registered and used by mcMMO
* This includes all default serializers
*
* @return our custom serializers
*/
public TypeSerializerCollection getCustomSerializers() {
return customSerializers;
}
private void registerSkillConfig(PrimarySkillType primarySkillType, Class clazz) {
skillConfigLoaders.put(primarySkillType, SkillConfigFactory.initSkillConfig(pluginRef, primarySkillType, clazz));
}
/**
* Registers an unloadable
* Unloadables call unload() on plugin disable to cleanup registries
*/
public void registerUserFile(File userFile) {
if (!userFiles.contains(userFile))
userFiles.add(userFile);
}
public void validateConfigs() {
}
/**
* Reload the configs
* Technically this reloads a lot of stuff, not just configs
*/
public void reloadConfigs() {
pluginRef.getLogger().info("Reloading config values...");
loadConfigs(); //Load everything again
}
/*
* GETTER BOILER PLATE
*/
/**
* Used to back up our zip files real easily
*
* @return
*/
public ArrayList<File> getConfigFiles() {
return userFiles;
}
public ConfigCoreSkills getConfigCoreSkills() {
return configCoreSkills.getConfig();
}
public ConfigDatabase getConfigDatabase() {
return configDatabase.getConfig();
}
public ConfigScoreboard getConfigScoreboard() {
return configScoreboard.getConfig();
}
public ConfigLeveling getConfigLeveling() {
return configLeveling.getConfig();
}
public ConfigWorldBlacklist getConfigWorldBlacklist() {
return configWorldBlacklist.getConfig();
}
public ConfigExploitPrevention getConfigExploitPrevention() {
return configExploitPrevention.getConfig();
}
public ConfigMOTD getConfigMOTD() {
return configMOTD.getConfig();
}
public ConfigHardcore getConfigHardcore() {
return configHardcore.getConfig();
}
public ConfigMetrics getConfigMetrics() {
return configMetrics.getConfig();
}
public ConfigAuthorAdvertisements getConfigAds() {
return configAuthorAdvertisements.getConfig();
}
public ConfigAutomatedBackups getConfigAutomatedBackups() {
return configAutomatedBackups.getConfig();
}
public ConfigCommands getConfigCommands() {
return configCommands.getConfig();
}
public ConfigItems getConfigItems() {
return configItems.getConfig();
}
public ConfigLanguage getConfigLanguage() {
return configLanguage.getConfig();
}
public ConfigParticles getConfigParticles() {
return configParticles.getConfig();
}
public ConfigParty getConfigParty() {
return configParty.getConfig();
}
public ConfigNotifications getConfigNotifications() {
return configNotifications.getConfig();
}
public ConfigSuperAbilities getConfigSuperAbilities() {
return configSuperAbilities.getConfig();
}
public ConfigAdmin getConfigAdmin() {
return configAdmin.getConfig();
}
public ConfigMobs getConfigMobs() {
return configMobs.getConfig();
}
public ConfigAcrobatics getConfigAcrobatics() {
return configAcrobatics;
}
public ConfigAlchemy getConfigAlchemy() {
return configAlchemy;
}
public ConfigArchery getConfigArchery() {
return configArchery;
}
public ConfigAxes getConfigAxes() {
return configAxes;
}
public ConfigExcavation getConfigExcavation() {
return configExcavation;
}
public ConfigFishing getConfigFishing() {
return configFishing;
}
public ConfigHerbalism getConfigHerbalism() {
return configHerbalism;
}
public ConfigMining getConfigMining() {
return configMining;
}
public ConfigRepair getConfigRepair() {
return configRepair;
}
public ConfigSwords getConfigSwords() {
return configSwords;
}
public ConfigTaming getConfigTaming() {
return configTaming;
}
public ConfigUnarmed getConfigUnarmed() {
return configUnarmed;
}
public ConfigWoodcutting getConfigWoodcutting() {
return configWoodcutting;
}
public ConfigSmelting getConfigSmelting() {
return configSmelting;
}
public ConfigSalvage getConfigSalvage() {
return configSalvage;
}
public ConfigEvent getConfigEvent() {
return configEvent.getConfig();
}
public ConfigRanks getConfigRanks() {
return configRanks.getConfig();
}
public ConfigSound getConfigSound() {
return configSound.getConfig();
}
/**
* Used to programmatically grab rank data for skills
* @return root node for the ranks config file
*/
public CommentedConfigurationNode getConfigRanksRootNode() {
return configRanks.getRootNode();
}
public ConfigExperience getConfigExperience() {
return configExperience.getConfig();
}
public SerializedConfigLoader<?> getSkillConfigLoader(PrimarySkillType primarySkillType) {
return skillConfigLoaders.get(primarySkillType);
}
}

Some files were not shown because too many files have changed in this diff Show More