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

Compare commits

..

652 Commits

Author SHA1 Message Date
nossr50
46e285bf44 Merge branch 'configurable' of github.com:mcMMO-Dev/mcmmo into configurable 2020-03-18 17:09:05 -07:00
nossr50
9a72af12b3 Merge branch 'master' of github.com:mcMMO-Dev/mcmmo into configurable 2020-03-18 17:05:08 -07:00
Shane Freeder
33e0b40e19 Merge remote-tracking branch 'origin/master' into configurable 2020-02-29 00:21:37 +00:00
nossr50
27b1c6b094 null check on player debug command 2020-02-24 17:08:23 -08:00
nossr50
db70d56493 Merge branch 'master' of github.com:mcMMO-Dev/mcmmo into configurable 2020-02-24 16:05:34 -08:00
nossr50
3b3396ce2c Merge branch 'master' of github.com:mcMMO-Dev/mcmmo into configurable 2020-02-20 17:43:58 -08:00
nossr50
b3bea7833f Merge me daddy 2020-02-20 16:22:46 -08:00
nossr50
b0c7e0368a merge master + singleton removal on ParticleEffectUtils 2020-02-20 16:15:38 -08:00
nossr50
4e895b7361 Some kyori/text stuff 2020-02-20 15:23:58 -08:00
nossr50
19a4c0238f add sonatype 2020-02-17 19:34:10 -08:00
nossr50
c071471bdf update for text libs 2020-02-17 19:27:21 -08:00
nossr50
85550c5750 Add kashike's text lib to dependencies 2020-02-17 18:46:48 -08:00
nossr50
3c382a11ed Add showtags subcommand to nbttools 2020-02-17 18:30:09 -08:00
nossr50
f45c70b694 More work on ACF integration 2020-02-12 15:20:21 -08:00
nossr50
2d342f8a3d Missing default tag 2020-02-11 15:44:52 -08:00
nossr50
3b276b59cf Merge branch 'nbt' of github.com:mcMMO-Dev/mcmmo into configurable 2020-02-10 13:20:05 -08:00
nossr50
4ff4def56a Optimize imports 2020-02-10 13:19:14 -08:00
nossr50
63de093ebb Remove debug on swing 2020-02-10 13:18:42 -08:00
nossr50
b34f0d62d6 Fixing shadow dependencies (I hope) 2020-02-10 13:13:29 -08:00
nossr50
a74f33c96d Latest changes 2020-02-09 16:06:28 -08:00
nossr50
24ba3b1a01 New command 'nbttools' also integrating ACF 2020-02-07 15:06:00 -08:00
nossr50
359e3e34ad Unused import 2020-02-07 13:28:17 -08:00
nossr50
ab0fc06dc2 Merge branch 'configurable' of github.com:mcMMO-Dev/mcmmo into nbt 2020-02-07 11:32:26 -08:00
nossr50
e3edc9a18f Fix faulty WG logic 2020-01-27 20:38:52 -08:00
nossr50
aaffafb88b No more Standard or Retro, use cosmetic scale modifier setting instead 2020-01-27 20:13:36 -08:00
nossr50
2e5a12a72b Add new Cosmetic Level Scaling setting to the leveling config 2020-01-27 19:11:00 -08:00
nossr50
769a26a911 Merge branch 'master' of github.com:mcMMO-Dev/mcmmo into configurable 2020-01-27 19:03:24 -08:00
nossr50
47bcd1223b Merge branch 'master' of github.com:mcMMO-Dev/mcmmo into configurable 2020-01-27 18:47:06 -08:00
nossr50
3eb160a794 Missed a few merges 2020-01-27 18:40:46 -08:00
nossr50
4b6e2c35b2 Merge branch 'master' of github.com:mcMMO-Dev/mcmmo into configurable 2020-01-27 18:36:32 -08:00
Shane Freeder
40802e6bae Merge branch 'master' into configurable 2020-01-16 04:50:50 +00:00
Shane Freeder
5441a7eb96 Add doTranslation script for easing repetative migrations 2020-01-11 16:56:39 +00:00
Shane Freeder
c45f2ce406 Merge branch 'master' into configurable 2020-01-11 16:51:38 +00:00
nossr50
25a9c75a5a Flesh out NBT types 2019-10-31 20:15:36 -07:00
nossr50
9911c406f8 Refactor some Type names and javadocs 2019-10-30 14:56:30 -07:00
nossr50
fdb900ec5d PlatformManager to manage the platform adapters 2019-10-30 14:38:02 -07:00
nossr50
bf94073935 Work on NBT adapters 2019-10-29 19:00:16 -07:00
nossr50
bfcc167862 Flesh out NBT types 2019-10-29 12:23:39 -07:00
nossr50
2a606b1ed1 Our own basic NBT types 2019-10-28 19:47:38 -07:00
nossr50
edc8701e35 Some JavaDocs 2019-10-22 16:13:53 -07:00
Robert Alan Chapton
31dc7bf03f Update build.gradle.kts 2019-10-09 12:46:04 -07:00
Shane Freeder
7be849da2a Fix compilation warnings 2019-10-06 01:16:27 +01:00
Shane Freeder
b572494c9c Remove the other deprecated PlayerProfile constructor 2019-10-06 01:07:01 +01:00
Shane Freeder
143714c9eb Remove deprecated PlayerProfile constructor 2019-10-06 01:03:07 +01:00
nossr50
4bff07bd2b Target the tag compound 2019-10-01 16:52:35 -07:00
nossr50
365938f351 ItemMeta needed? 2019-10-01 16:33:31 -07:00
nossr50
7f6bbadc1c Less error prone Kappa 2019-10-01 16:28:46 -07:00
nossr50
ec1fdea40d Progress??? 2019-10-01 16:23:59 -07:00
nossr50
8febe2d0bd Progress?? 2019-10-01 16:19:15 -07:00
nossr50
6e0f8f99fa Progress? 2019-10-01 15:44:58 -07:00
nossr50
433f6d085d Time for a break 2019-09-30 17:53:57 -07:00
nossr50
0509f4f63e Starting work on reading NBT 2019-09-30 16:47:47 -07:00
nossr50
d2028321d4 Fixing SuperAbility strings 2019-09-30 16:11:06 -07:00
nossr50
4437f419cb Fix our TamingSummon serializer 2019-09-30 15:44:22 -07:00
nossr50
a58d875d74 Cleaning up more runtime errors during load 2019-09-30 15:28:51 -07:00
nossr50
154d0a8d50 Completely disable all Repair code pending rewrite
Repair code will be handled in a sep branch, this is being done so the
configurable branch can compile and be semi-playable for testing
important in development features.
2019-09-30 15:10:59 -07:00
nossr50
9e01a07542 Removing the hocon package 2019-09-30 14:34:38 -07:00
nossr50
f13364eb04 You missed some stuff catboy :) 2019-09-30 14:18:59 -07:00
nossr50
b763a56d75 Ignore bash scripts + Update Changelog 2019-09-30 13:59:38 -07:00
Shane Freeder
c7d2631a79 Add maven central repo 2019-09-30 21:37:33 +01:00
Shane Freeder
0cea66a084 Set version back to 2.2.0-SNAPSHOT 2019-09-30 21:26:30 +01:00
Shane Freeder
15913c8cf0 Drop maven pom 2019-09-30 21:24:05 +01:00
Shane Freeder
ba5c24fa3c Merge branch 'configurable' into gradlelize 2019-09-30 21:18:56 +01:00
Shane Freeder
f53d4bde67 invoke shadowJar 2019-09-30 21:08:02 +01:00
Shane Freeder
83373275f7 Move mcmmo into submodule
Goal will be to slowly move out the bukkit* dependencies from -core,
but, we have our starting point
2019-09-30 20:55:35 +01:00
nossr50
90897c9ae1 I'll probably end up rewriting these serializers 2019-09-28 17:58:02 -07:00
nossr50
7385679ec5 Initialize SkillTools before DST 2019-09-28 17:21:46 -07:00
nossr50
075ccbf4da Add missing ConfigSerializable annotation 2019-09-28 17:16:13 -07:00
nossr50
8a4318ee1f Load locale manager after config manager 2019-09-28 17:14:28 -07:00
nossr50
8e1f002808 WG Manager now lives in WG Utils class, fixing the runtime errors for WG
hooks in mcMMO during start up
2019-09-28 16:50:55 -07:00
Shane Freeder
3700128b21 move locale files into their intended resource folder 2019-09-28 10:02:46 +01:00
Shane Freeder
c44ca47bfe Setup resource filtering
Also mark gradlew as executable
2019-09-28 09:43:33 +01:00
Gabriel Harris-Rouquette
2ee102b44f Migrate the project to use Gradle. Reproduces a build almost exactly as the maven shade, only changed version numbers for comparison.
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
2019-09-26 10:05:42 -07:00
Shane Freeder
c0bfdd34b7 And it compiles again! 2019-09-26 08:50:58 +01:00
Shane Freeder
fd7bcc4a32 Merge branch 'master' into configurable 2019-09-26 08:46:24 +01:00
nossr50
7f94f3833d 2.2 compiles again :) 2019-09-25 19:21:54 -07:00
nossr50
df6386ec2f NBT Manager will be a static abusing class for now 2019-09-25 18:29:30 -07:00
nossr50
f1de5484ec Minor tweaks 2019-09-25 17:47:51 -07:00
nossr50
20b9b0d0fe WIP - Add default entries to Repairables 2019-09-25 17:30:32 -07:00
nossr50
8a4b1bf307 We cutting corners boys 2019-09-25 16:57:15 -07:00
nossr50
46b881e730 Add serializer for TamingSummon 2019-09-25 16:21:32 -07:00
nossr50
d484ccc15e Minor tweaks 2019-09-25 15:54:44 -07:00
nossr50
e8f14eece0 Squashing some final compiler errors from static abuse removal 2019-09-25 14:31:48 -07:00
nossr50
8ad08298d0 Fixing more breaks from the static abuse removal 2019-09-25 14:21:11 -07:00
nossr50
297ce64a24 Fixing some more classes broken in the static abuse removal edits 2019-09-25 14:08:49 -07:00
nossr50
32d9eaab3d Fixing some Acrobatics related classes 2019-09-25 13:57:13 -07:00
nossr50
e1656423c1 Static Abuse Removal - Various Chunklet classes 2019-09-25 13:48:37 -07:00
nossr50
f52144fb3e Static Abuse Removal PerkUtils 2019-09-24 17:01:08 -07:00
nossr50
f7aaf25d93 Static Abuse Removal - HardcoreManager 2019-09-24 16:53:57 -07:00
nossr50
3552457790 Static Abuse Removal - Misc (now MiscTools) 2019-09-24 16:44:23 -07:00
nossr50
564b8ceb94 More dependency injection fixes in many file 2019-09-24 16:34:12 -07:00
nossr50
4b1cdbf493 Remove Static Abuse - SoundManager 2019-09-24 15:06:49 -07:00
nossr50
f0636ef47e More fixes for serializers 2019-09-24 14:42:13 -07:00
nossr50
68f6fea66a Fix the serialized config loader 2019-09-24 14:35:55 -07:00
nossr50
bde66ee4e1 Remove static abuse - Chunklet stuff 2019-09-24 14:30:33 -07:00
nossr50
ec4fbe678e Static Abuse Removal - Motd ( now MessageOfTheDayUtils ) 2019-09-24 14:01:26 -07:00
nossr50
2735cb1666 ZipLibrary static abuse removal 2019-09-23 20:03:16 -07:00
nossr50
1c2d1fa56f Fixing TamingManager 2019-09-23 19:53:19 -07:00
nossr50
14fa243b69 Refactor McMMOAbilityEvent(s) and fix TextComponentFactory 2019-09-23 19:42:47 -07:00
nossr50
815131a013 Treasure code removed pending rewrite 2019-09-23 19:20:09 -07:00
nossr50
3aead73d07 Refactoring McMMOPlayer 2019-09-23 16:26:34 -07:00
nossr50
b0803df7c5 Fixing a few more things 2019-09-23 16:18:36 -07:00
nossr50
50e955d07e Normalizing parameter names / Fixing PlayerProfile 2019-09-23 15:54:08 -07:00
nossr50
67a2841705 Simplify the SuperAbilityType ENUM 2019-09-23 14:44:40 -07:00
nossr50
d4826eebd8 Fix TrackedTamingEntity 2019-09-23 13:54:47 -07:00
nossr50
12e3a5d222 Fix Roll class 2019-09-23 13:51:32 -07:00
nossr50
57c30bac98 Fix Salvage, Swords and Unarmed command 2019-09-23 13:30:21 -07:00
nossr50
efbd9d52c3 Fix mmoinfo command 2019-09-23 13:20:42 -07:00
nossr50
ef25385786 Fix Axes command class 2019-09-23 13:01:11 -07:00
nossr50
b399c415dc Fix Acrobatics and Archery command classes 2019-09-23 12:58:28 -07:00
nossr50
810a29cb9d time to cut some corners :sick: 2019-09-23 12:40:00 -07:00
nossr50
9b6e6d7861 Add missing limit break settings 2019-09-23 12:34:00 -07:00
nossr50
4e2d68908e What a pain in the ass 2019-09-23 12:23:47 -07:00
nossr50
1a3832f117 Correct structure of Archery skill config to have parity with others 2019-09-20 17:00:58 -07:00
nossr50
a6a544f472 Add limit break setting to Axes 2019-09-20 16:54:23 -07:00
nossr50
1d7bfc615f I should just rewrite this, instead I do a band-aid fix. 2019-09-20 16:42:34 -07:00
nossr50
2165d1448e Treasures are being rewritten completely 2019-09-20 15:56:25 -07:00
nossr50
396926d970 Removing dead symbols from ConfigManager 2019-09-20 15:54:38 -07:00
nossr50
7c0d1f4e0a Remove Static Abuse - WorldGuardUtils 2019-09-20 15:07:37 -07:00
nossr50
3aa896cfc9 Cleaner TamingSummon initialization/checks 2019-09-19 19:29:27 -07:00
nossr50
43d60b6a7d The pain begins 2019-09-19 19:04:31 -07:00
nossr50
9428ea395d Partially finished merge 2019-08-20 11:24:47 -04:00
nossr50
fdc8e4b81d Actually I should merge from master before working on this further 2019-07-12 10:54:03 -07:00
nossr50
250753c064 Remove Static Abuse - ItemUtils -> ItemTools 2019-07-04 08:07:02 -07:00
nossr50
05f289e6e6 Static Abuse Removal - BlockUtils -> BlockTools 2019-07-04 08:03:11 -07:00
nossr50
c5a7c88e0c Static Abuse Removal - RandomChanceUtil -> RandomChanceTools 2019-07-04 06:13:29 -07:00
nossr50
8f540796ff Static Abuse Removal - PlayerLevelUtils -> PlayerLevelTools 2019-07-04 06:03:44 -07:00
nossr50
376e156646 Static Abuse Removal - Commands, Boss Bars 2019-07-04 06:01:34 -07:00
nossr50
e001dea4d7 Updating various classes for the new SkillTools class 2019-07-04 05:42:15 -07:00
nossr50
381eba8ddc Static Abuse Removal - ComatUtils -> CombatTools 2019-07-04 05:22:52 -07:00
nossr50
084b5edf1f Crimes were commited today.
PrimarySkillType was a mess... SkillTools is not much better though.
2019-07-04 04:41:08 -07:00
nossr50
8b39224cbc Removing Static Abuse - WorldBlackList -> WorldBlackListManager 2019-07-03 22:31:59 -07:00
nossr50
bd0a673838 Removing Static Abuse - CommandRegistrationManager 2019-07-03 22:01:30 -07:00
nossr50
900d3bb7fd Wire up woodcutting behaviour, adding missing dependency injection in a
few places
2019-07-03 03:16:22 -07:00
nossr50
5af09581e0 Convert or Tweaked Mining/Salvage/Smelting for behaviours 2019-07-03 02:40:41 -07:00
nossr50
cf6d28a1bd Wire up Excavation, Fishing, and Herbalism behaviours 2019-07-03 02:29:51 -07:00
nossr50
148a4fd555 Wire up Acrobatics, Archery, and Axes behaviour managers 2019-07-03 02:24:04 -07:00
nossr50
b756938fb1 Skill Behaviour Managers 2019-07-03 02:14:56 -07:00
nossr50
cf46ec7498 Static Abuse Removal - Misc Tasks 2019-07-03 01:36:46 -07:00
nossr50
3ea739d111 Static Abuse Removal - Skill Tasks 2019-07-03 01:33:53 -07:00
nossr50
997fac0d17 Remove Static Abuse - Player / Party Tasks 2019-07-03 01:17:06 -07:00
nossr50
35f3c5d585 Remove Static Abuse - CWing (Needs more work) 2019-07-03 01:12:47 -07:00
nossr50
982e67af70 Remove Static Abuse - Database Tasks 2019-07-03 00:56:25 -07:00
nossr50
4da455b9d2 Remove Static Abuse - Command Tasks 2019-07-03 00:40:28 -07:00
nossr50
40a3de76fb Static Abuse Removal - More events purged of static abuse, moved some
unwanted alchemy code into the dumpster
2019-07-03 00:27:09 -07:00
nossr50
3bddfed72f Remove Static Abuse - Level Events 2019-07-03 00:22:32 -07:00
nossr50
bc183cd4f9 Static Abuse Removal - TextComponentFactory 2019-07-02 21:45:42 -07:00
nossr50
5ec59536c7 Remove Static Abuse - Scoreboards... (Yuck) 2019-07-02 21:12:50 -07:00
nossr50
e7b80cbce5 Dependency inject Party in ShareHandler 2019-07-02 20:10:06 -07:00
nossr50
4815bd7d11 Remove Static Abuse - ShareHandler -> Moved into Party 2019-07-02 20:07:52 -07:00
nossr50
1260f4e57a Remove Static Abuse - Database package 2019-07-02 19:41:32 -07:00
nossr50
67afdd7efb Static Abuse Removal - Command package done for now 2019-07-02 19:27:51 -07:00
nossr50
a9207b6f38 Renamed a lot of Command classes 2019-07-02 19:19:43 -07:00
nossr50
57b7050a2c Static Abuse Removal - CommandUtils -> CommandTools 2019-07-02 19:00:06 -07:00
nossr50
762c3bd04e Static Abuse Removal - Party Commands 2019-07-02 18:55:05 -07:00
nossr50
5fd93cea19 Static Abuse Removal - PTP Commands 2019-07-02 18:38:22 -07:00
nossr50
4c4732695b Static Abuse Cleanup - EventUtils -> EventManager 2019-07-02 18:32:28 -07:00
nossr50
fc9942fdc4 Static Abuse Cleanup - MobHealthBarUtils (now MobHealthBarManager) 2019-07-02 18:27:17 -07:00
nossr50
225045b49f Bad Design Removal WIP Part 3 2019-06-30 12:10:54 -07:00
nossr50
87af2419a3 Part 2 of removing bad design patterns 2019-06-27 03:04:34 -07:00
nossr50
5ee862effd Temporarily comment out the API since we're about to break everything 2019-06-27 00:01:58 -07:00
nossr50
6504e06b5f Part 1 of removing some bad design patterns 2019-06-27 00:00:41 -07:00
nossr50
1c9e5ba542 Apply changes from 2.1.90 to 2.2 2019-06-26 22:47:03 -07:00
nossr50
bc0a59d6fb Apply changes from 2.1.89 to 2.2 2019-06-26 22:40:05 -07:00
nossr50
b069480244 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-06-26 21:55:41 -07:00
nossr50
89e988660d Tweaks 2019-06-22 20:18:14 -07:00
nossr50
121f881d59 More work on the new repair system 2019-06-22 19:21:57 -07:00
nossr50
5c31bdbd49 Lets generify some of this stuff 2019-06-22 13:05:28 -07:00
nossr50
d843108164 More work on the repair rewrite, fleshing out more serializers 2019-06-21 18:26:02 -07:00
nossr50
d782d64750 Simplify the design of Repairable 2019-06-21 15:10:43 -07:00
nossr50
0050a73be8 NBT WIP 2019-06-21 10:46:27 -07:00
nossr50
099dfcb0e5 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-06-21 09:19:03 -07:00
nossr50
c7fadf02e6 Repair rewrite continues 2019-06-21 05:50:37 -07:00
nossr50
55609249ed Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-06-20 00:09:50 -07:00
nossr50
b41a30fa26 Repair rewrite continues 2019-06-19 23:28:11 -07:00
nossr50
458e198fdb More work on new repair datatypes 2019-06-18 23:08:14 -07:00
nossr50
1e338e6aec Flesh out RepairCost some more 2019-06-18 23:02:20 -07:00
nossr50
8f04b83954 RepairableBuilder, ItemStackSerializer WIP 2019-06-18 22:14:32 -07:00
nossr50
c0685bd1eb PermissionWrapper WIP 2019-06-18 18:07:06 -07:00
nossr50
29670cd66f Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-06-18 15:46:20 -07:00
nossr50
27d25ad321 Taming config WIP 2019-06-18 09:33:31 -07:00
nossr50
a6a734befe Repair rewrite pt 2 WIP 2019-06-17 16:36:37 -07:00
nossr50
18fd9bbf9b Repair rewrite pt 1 - WIP 2019-06-17 14:01:44 -07:00
nossr50
bca1298918 Wire up swords config 2019-06-17 11:03:40 -07:00
nossr50
87f0171969 Add swords config values 2019-06-17 10:54:53 -07:00
nossr50
8b2d1eb1d8 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-06-17 10:37:57 -07:00
nossr50
12964a816d RepairWildcard wip 2019-06-16 12:41:14 -07:00
nossr50
3a89ba2139 Wire up salvage config options 2019-06-16 09:12:42 -07:00
nossr50
303b12b79f Add Smelting config options 2019-06-16 09:10:59 -07:00
nossr50
84704007ac Fix abilities wearing off instantly 2019-06-16 06:55:51 -07:00
nossr50
5a48b568ef Fix sounds being disabled by default 2019-06-16 06:46:25 -07:00
nossr50
726369077e Fixing some issues with reloading 2019-06-16 05:57:52 -07:00
nossr50
2d1472b913 Fix Blast Mining and /mining command 2019-06-16 05:17:12 -07:00
nossr50
a1e3bb18a4 Fix double drops for mining 2019-06-16 04:59:34 -07:00
nossr50
43ca43cc48 Fix repair command 2019-06-16 01:42:30 -07:00
nossr50
278efc8e37 Fix repair logic 2019-06-16 01:13:39 -07:00
nossr50
3cde1400d1 Skill Ceiling removed 2019-06-16 00:17:21 -07:00
nossr50
3e01b413b4 Fix Salvage section in exploit conf 2019-06-16 00:07:34 -07:00
nossr50
8320b89b9f Add Herbalism subskill properties to config 2019-06-16 00:05:36 -07:00
nossr50
fb08bbb79d Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-06-15 23:51:36 -07:00
nossr50
4f2e3f4399 Update axes to the new naming scheme 2019-06-14 15:51:26 -07:00
nossr50
dac447f381 Add missing skill properties to archery config 2019-06-14 15:46:13 -07:00
nossr50
8eba1dda1f Add Set<?> serializer + fix some errors 2019-06-14 13:49:01 -07:00
nossr50
ffa35d0179 Fix leveling + Fix Roll 2019-06-14 12:00:47 -07:00
nossr50
e7e28ec3cb Wire up unarmed config 2019-06-14 11:36:21 -07:00
nossr50
ab56464bc4 Add disarm config settings 2019-06-14 11:16:46 -07:00
nossr50
43600ef800 Add and wire up Herbalism AFK exploit toggle 2019-06-13 18:12:10 -07:00
nossr50
b4e612b15b Fix skill property registration method 2019-06-13 16:48:49 -07:00
nossr50
9e336c8a6f Reduce console spam 2019-06-13 16:19:59 -07:00
nossr50
29a712ca80 Fixing some mistakes with FQNs 2019-06-13 16:14:59 -07:00
nossr50
18a28a87b1 Fix mistake when registering fully qualified names 2019-06-13 15:57:44 -07:00
nossr50
307bf8b332 SoundSettingSerializer 2019-06-13 15:28:06 -07:00
nossr50
86a4b74eb3 Wire up sound config 2019-06-13 14:02:15 -07:00
nossr50
6f3b90d0dd Sound Config 2019-06-13 13:43:10 -07:00
nossr50
f0cce29d71 Rewrite NotificationManager to handle more flexible config options 2019-06-13 12:43:51 -07:00
nossr50
8abccfc9cd Rewrite of McMMOPlayerNotificationEvent 2019-06-13 11:28:10 -07:00
nossr50
bdd0335d0b Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-06-12 11:07:54 -07:00
nossr50
a97f1b208f NotificationManager now uses a getter in mcMMO 2019-06-12 10:54:05 -07:00
nossr50
473e4586c9 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-06-12 10:40:04 -07:00
nossr50
b0f09c8e7b Add PlayerNotificationSerializer 2019-06-12 10:01:18 -07:00
nossr50
b03abcdee8 Add notification settings 2019-06-12 09:51:22 -07:00
nossr50
b29d87df8c Add ScrapCollector and wire up profile loading message toggle 2019-06-12 05:44:25 -07:00
nossr50
a654762f4d Yikes that was a lot of merge conflicts. 2019-06-12 05:26:45 -07:00
nossr50
c58a36e604 Most the functionality of SkillPropertiesManager is in place, but not
yet complete
2019-06-07 04:07:43 -07:00
nossr50
3c3bc338f2 Add serializer for MaxBonusLevel 2019-06-07 01:24:11 -07:00
nossr50
80beb92a06 Rewrote how Arrow Retrieval subskill is handled 2019-06-07 01:18:14 -07:00
nossr50
39b5719e12 Fill in Daze/Skill Shot for Archery config 2019-06-07 00:31:59 -07:00
nossr50
5eb80f9277 Add skill shot config settings 2019-06-06 08:09:27 -07:00
nossr50
d879575d5f Wire up PVP/PVE settings 2019-06-06 06:07:05 -07:00
nossr50
51a57429b6 Add PVP/PVE settings to core skill config 2019-06-06 05:58:44 -07:00
nossr50
3e75026281 Wire up Hardcore/Vampirism 2019-06-06 05:31:13 -07:00
nossr50
c698bed05e Setup the hardcore/vampirism config 2019-06-06 05:25:37 -07:00
nossr50
237311a98f Fix spelling mistake + Wire up ChimaeraWing 2019-06-06 04:19:01 -07:00
nossr50
240ab0a0af Add Chimaera Wing to the items config 2019-06-06 03:38:09 -07:00
nossr50
582c9a6726 Correct the name of FastFoodService for rank config 2019-06-06 02:03:31 -07:00
nossr50
fc2077ffdb Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-06-06 01:58:52 -07:00
nossr50
94df19bdb4 Converting some remaining float literals to double literals 2019-06-04 21:18:51 -07:00
nossr50
fc6c6ed2c4 Using doubles in most places again to avoid precision loss 2019-06-04 21:12:10 -07:00
nossr50
32fa6cee96 Fix some issues with the CustomXPPerkSerializer 2019-06-04 20:00:25 -07:00
nossr50
ffe27326e3 Move serializers 2019-06-04 19:33:29 -07:00
nossr50
97b70ec2a1 Correcting issues with deserializing SkillRankProperty 2019-06-04 19:03:20 -07:00
nossr50
e5592919b7 Add SkillRankProperty serializer 2019-06-04 14:58:17 -07:00
nossr50
b2dc322a2b Remove the old rank config file 2019-06-04 13:13:41 -07:00
nossr50
cf6a4c804a Rewrote how SkillRanks were pulled for the new config system 2019-06-04 13:11:45 -07:00
nossr50
b62bd0e620 Fill in Excavation rank config 2019-06-03 06:13:35 -07:00
nossr50
86a46babc1 Fill in Woodcutting rank config 2019-06-03 06:09:20 -07:00
nossr50
0bafcb659b Fill in Unarmed rank config 2019-06-03 05:56:03 -07:00
nossr50
9db152ebc8 Fill in Swords rank config 2019-06-03 05:52:53 -07:00
nossr50
ef44a43bd2 Fill in rank configs for Fishing 2019-06-03 05:48:15 -07:00
nossr50
bdc44f6ede Fill in rank config for Herbalism 2019-06-03 05:44:22 -07:00
nossr50
0e70c9ce75 Fill in Mining rank info 2019-06-03 05:42:42 -07:00
nossr50
2d1d2693ed Fill in Salvage rank information 2019-06-03 04:44:16 -07:00
nossr50
c33d6e62b7 Fill in Smelting rank information 2019-06-03 04:39:50 -07:00
nossr50
fd78ce278e Fill in Taming subskill rank information 2019-06-03 04:34:54 -07:00
nossr50
5ca027650e Add ConfigRanks WIP (axes, acrobatics, archery so far) 2019-06-03 04:17:23 -07:00
nossr50
e05078b280 Some misc cleanup, including removing some leftover April Fools stuff 2019-06-03 02:36:29 -07:00
nossr50
12c0b19776 Stringify ConfigExperienceWoodcutting 2019-06-03 02:01:28 -07:00
nossr50
f898525362 Stringify ConfigExperienceMining 2019-06-03 01:57:25 -07:00
nossr50
f53bd1ab03 Stringify ConfigExperienceHerbalism 2019-06-03 01:51:58 -07:00
nossr50
c82f60e08b Custom serializer for SkillCeiling 2019-06-03 01:09:06 -07:00
nossr50
8c1c17fa17 Custom Serializer for DamageProperty 2019-06-03 01:02:45 -07:00
nossr50
7a0ef0d4ed Making the compiler happy 2019-06-03 00:31:46 -07:00
nossr50
29876b4a20 SkillProperty no longer has an identifier for SubSkillType 2019-06-02 23:24:30 -07:00
nossr50
fc7455354f Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-06-02 23:04:52 -07:00
nossr50
4e7e2daf3c Fix issues in the ExperienceBarWrapper 2019-06-01 03:23:08 -07:00
nossr50
9dfbb14c39 Wire up the new Axes config 2019-06-01 03:16:30 -07:00
nossr50
cb9a4e5e5d Greater Impact settings & some refactoring for Axes config 2019-06-01 02:11:31 -07:00
nossr50
5af60e2fe1 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-06-01 01:58:21 -07:00
nossr50
9d47234918 Add private keyword 2019-05-31 18:52:28 -07:00
nossr50
299c989dd4 Add Axes Critical Strikes to new configs 2019-05-31 18:49:24 -07:00
nossr50
00131bb412 DamageProperty for skills 2019-05-31 18:42:23 -07:00
nossr50
186ad2cd59 Add MaximumProgressLevel interface and implementation 2019-05-31 01:45:57 -07:00
nossr50
19acf47f1e Add Armor Impact settings to Axes config 2019-05-30 18:59:50 -07:00
nossr50
01bffc6670 Fixing a typo of sorts 2019-05-30 16:17:02 -07:00
nossr50
1532791c3f Still some work to do, but now the convert XP command is less clunky 2019-05-30 16:12:32 -07:00
nossr50
84b9b255aa Parties now use the same formula for leveling as players 2019-05-30 15:52:13 -07:00
nossr50
61e46b6f10 Fixing some tab completion bugs for mcconvert 2019-05-30 15:48:29 -07:00
nossr50
8d10f8053f Removing the clunky previous formula file design 2019-05-30 15:33:57 -07:00
nossr50
b27d46f0cc Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-05-29 14:06:55 -07:00
nossr50
b6d11e655d Minor changelog edit 2019-05-19 17:29:22 -07:00
nossr50
04fb4c30fe Fix compiler errors 2019-05-18 16:25:52 -07:00
nossr50
04b4a8e069 Remove redundant operations on LimitedSizeList 2019-05-18 15:49:14 -07:00
nossr50
1e1b803cce Wire up mining exploit toggle 2019-05-18 15:47:36 -07:00
nossr50
3d576eaa6a Add mining exploit settings + delegate methods to exploit config 2019-05-18 15:45:43 -07:00
nossr50
087df05e77 Add wandering trader xp 2019-05-18 15:38:39 -07:00
nossr50
05936b3c75 Add missing chiseled_* xp values 2019-05-18 15:35:02 -07:00
nossr50
c10853def9 Add missing mossy_* xp values 2019-05-18 15:33:39 -07:00
nossr50
08baa5993e Remove duplicate mossy cobblestone entry 2019-05-18 15:02:02 -07:00
nossr50
0396039d50 Add missing stone_brick_* xp values 2019-05-18 14:57:42 -07:00
nossr50
4aa81f1023 Add bamboo XP 2019-05-18 14:55:17 -07:00
nossr50
4bd3f8d6bd Add wither rose XP 2019-05-18 14:54:07 -07:00
nossr50
4627df1160 Add lilly of the valley xp 2019-05-18 14:53:32 -07:00
nossr50
a72c45766f Add cornflower xp 2019-05-18 14:52:56 -07:00
nossr50
4ced61e4fc Add sweet berry bush 2019-05-18 14:52:02 -07:00
nossr50
c237601af6 Lower guardian XP 2019-05-18 14:48:41 -07:00
nossr50
3a88193459 Add magma block 2019-05-18 14:47:38 -07:00
nossr50
65a234c6b3 Wire up admin notification toggle 2019-05-18 14:46:48 -07:00
nossr50
9fb9228869 Wire up events config 2019-05-18 14:08:33 -07:00
nossr50
ca8293bc35 Add new config for events 2019-05-18 13:57:23 -07:00
nossr50
9c5ec234d9 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-05-18 13:21:36 -07:00
nossr50
b532b42db3 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-05-15 16:39:49 -07:00
nossr50
f0d6f7077b Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-05-14 23:01:05 -07:00
nossr50
f0e64d992b Remove unecessary check 2019-05-13 08:45:00 -07:00
nossr50
c61c55031d Core skill config is now converted 2019-05-13 08:36:37 -07:00
nossr50
39d10855d8 Temporarily add them back in :juice: 2019-05-13 08:21:24 -07:00
nossr50
aeb518f38c Don't make unecessary folders 2019-05-13 08:18:28 -07:00
nossr50
d3a719eb8d Experience configs are now fully converted 2019-05-13 05:32:49 -07:00
nossr50
ab4b4edb1a Wire up Repair XP values 2019-05-13 05:31:34 -07:00
nossr50
591c9e67a3 Wire up XP bar settings 2019-05-13 05:25:40 -07:00
nossr50
59c8d16374 XP Bar settings 2019-05-13 05:17:00 -07:00
nossr50
3a6d94e682 Cleanup 2019-05-13 04:00:08 -07:00
nossr50
2b0931314a Wire up smelting XP values 2019-05-13 03:57:23 -07:00
nossr50
d1298c0cd2 Further cleanup 2019-05-13 03:49:33 -07:00
nossr50
3f6a33dea6 Refactoring experience manager 2019-05-13 03:39:24 -07:00
nossr50
d8841c6ae7 Add + Wire up Combat XP Multipliers 2019-05-13 03:33:33 -07:00
nossr50
2e3f9b4a96 Add + Wire DiminishingReturn config values
Removed the experience multiplier from the xp conversion task, it just
seems like something very unecessary
2019-05-13 02:55:20 -07:00
nossr50
6425cd18b8 Temporarily hold party settings in DSM (will be removed later) 2019-05-13 02:05:44 -07:00
nossr50
86b98368bc Move API checks into their own class 2019-05-13 01:58:27 -07:00
nossr50
b5eb942682 Catch all exceptions not just NPE 2019-05-13 01:40:54 -07:00
nossr50
f7e6e3adb6 Add notes about the API changes to changelog 2019-05-13 01:37:32 -07:00
nossr50
ca4f15df46 More refactoring, made the changelog less noisy 2019-05-13 01:32:52 -07:00
nossr50
2c8b8658a3 Update classes to use DSM over CM 2019-05-13 01:27:48 -07:00
nossr50
80163c0d8f Cleaning up mcMMO.java 2019-05-13 01:15:53 -07:00
nossr50
72fc3efa78 DynamicSettingsManager - Handles platform specific datasets
Converts datasets from the config into ready to use platform specific
ones
Currently only supports Bukkit, that will change later
Expect API breakages if you hook into this class
2019-05-13 00:53:29 -07:00
nossr50
d614df65a7 unbox some floats 2019-05-12 03:48:25 -07:00
nossr50
3123f69aec Setup combat XP map - Use float in more places 2019-05-12 03:46:23 -07:00
nossr50
1c6b0363ce Step 1 of rewriting Alchemy - Removing all the old code 2019-05-12 00:53:15 -07:00
nossr50
ddb92af400 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-05-11 20:54:29 -07:00
nossr50
774ee65677 Fixing Alchemy Part 1 2019-05-10 17:23:02 -07:00
nossr50
61ae372694 Collection manager init now handles mapping values from collections 2019-05-10 12:30:59 -07:00
nossr50
945359b408 Add failsafes to repairables 2019-05-10 12:17:31 -07:00
nossr50
06bf814fcf Add failsafes to Salvageables 2019-05-10 12:16:26 -07:00
nossr50
cc1eae150a Fixed salvage deserializer swapping signature parameters 2019-05-10 11:30:50 -07:00
nossr50
7ad0a61c53 Fix casting, remove unused mod configs 2019-05-10 11:20:16 -07:00
nossr50
48a3621ac6 Avoid race conditions 2019-05-10 09:49:43 -07:00
nossr50
4ab688b302 Add custom serializer registration for CustomXPPerk 2019-05-08 12:14:09 -07:00
nossr50
8cfeaf34f3 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-05-08 12:10:31 -07:00
nossr50
ca7cf5cc58 Unlimited custom XP perks part 2 2019-05-08 09:50:19 -07:00
nossr50
40598a0e96 Unlimited custom xp perks Part 1 2019-05-08 06:44:19 -07:00
nossr50
0331c98c9b Add and wire up skill specific xp formula multipliers 2019-05-07 00:18:50 -07:00
nossr50
c968b9f94a Add and wire up Early Game Boost settings 2019-05-07 00:09:31 -07:00
nossr50
8033bc577c Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-05-06 19:46:58 -07:00
nossr50
08269cab5b Add back in the UUID upgrade classes just in case anyone from 2014 shows
up
2019-05-06 00:19:42 -07:00
nossr50
71a2ea2a2e Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-05-05 23:50:40 -07:00
nossr50
ecac8d00ee Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-05-04 05:31:44 -07:00
nossr50
620f2fc4f8 Revert some state changes 2019-05-04 01:09:25 -07:00
nossr50
3e61dc6c5f Some cleanup to BonusDrops & reducing expensive state calls 2019-05-04 00:48:35 -07:00
nossr50
a919c45b09 Fixing Java naming conventions for constants in mcMMO.java also added
some Javadocs
2019-05-03 23:39:49 -07:00
nossr50
8a312da0f5 Merge 2.1.53 2019-05-03 23:31:08 -07:00
nossr50
29835a3316 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-05-03 03:46:28 -07:00
nossr50
9157a08a3b Stashing changes.. oh wait 2019-04-30 17:02:08 -07:00
nossr50
3997a44fce Merge 2.1.51 2019-04-30 17:01:45 -07:00
nossr50
4d8e4d0e70 Wire up Mining/Excavation/Herbalism/Woodcutting XP values 2019-04-30 02:08:11 -07:00
nossr50
2efa64ae17 wire up taming XP 2019-04-30 01:46:59 -07:00
nossr50
e5441f2a96 Taming XP values are now converted to an enum mpa and managed by ExperienceMapManager 2019-04-30 01:39:06 -07:00
nossr50
06016f4ada Wire up special combat XP multipliers 2019-04-30 00:57:50 -07:00
nossr50
6932abc9d8 Create fully qualified name : integer maps from user configs, wiring up some global xp settings 2019-04-30 00:42:09 -07:00
nossr50
faed690602 Add mcMMO reload command "/mcmmoreload" 2019-04-29 22:55:39 -07:00
nossr50
7b3f69aee6 Add config reload 2019-04-29 22:37:46 -07:00
nossr50
6e173c0d4e Add per-skill global multiplier default values 2019-04-29 22:09:38 -07:00
nossr50
d0259d73c5 Gloabl XP multiplier is now tracked by the ExperienceMapManager
Added method to grab original value to ExperienceMapManager
Moved skill xp values/mults into their own section
2019-04-29 21:59:01 -07:00
nossr50
7f64fe11b8 Put special combat xp multipliers in their own section 2019-04-29 21:34:29 -07:00
nossr50
ff8baecb54 Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable 2019-04-28 06:56:22 -07:00
nossr50
437bac1324 Revert "Add missing XP tables to 2.2"
This reverts commit d1085aa8f8.
2019-04-28 06:15:08 -07:00
nossr50
7c4481f099 removing unused classes 2019-04-28 06:08:15 -07:00
nossr50
d1085aa8f8 Add missing XP tables to 2.2 2019-04-28 06:05:39 -07:00
nossr50
986162803b Merge 2.1.50 2019-04-28 05:46:49 -07:00
nossr50
02a69cbb05 Update code style 2019-04-24 22:52:53 -07:00
nossr50
dc758a6dfc Wire up XP formula settings 2019-04-24 22:44:24 -07:00
nossr50
989537366a Merge branch 'master' of https://github.com/mcMMO-dev/mcmmo into configurable 2019-04-24 22:14:02 -07:00
nossr50
9fcedcad76 Add linear/exponential formula config options to defaults 2019-04-24 22:11:11 -07:00
nossr50
9d9b5464c3 fixing some serializer errors 2019-04-24 21:38:32 -07:00
nossr50
5fc416a457 Merge branch 'master' of https://github.com/mcMMO-dev/mcmmo into configurable 2019-04-24 21:12:07 -07:00
nossr50
63e905db6c use a custom collection of serializers instead of the default list 2019-04-24 21:01:33 -07:00
nossr50
e8ea502f77 Add delegates to player level conf and wire up xp formula setting 2019-04-24 19:46:06 -07:00
nossr50
ba8b73ad4d add some missing delegates to xp config 2019-04-24 19:36:46 -07:00
nossr50
df2a52984e add combat default xp values 2019-04-24 19:30:15 -07:00
nossr50
b8ad722e9e Taming default XP values + updated acrobatics XP values 2019-04-24 18:58:29 -07:00
nossr50
7928ababf6 add smelting default xp values 2019-04-24 18:51:52 -07:00
nossr50
0a63e6674a merge prs 2019-04-24 18:24:29 -07:00
nossr50
7f233b8e77 Tweaking some merge mistakes / bugs 2019-04-24 17:19:04 -07:00
nossr50
17c193f984 Merge branch 'configurable' of https://github.com/mcMMO-dev/mcmmo into configurable 2019-04-24 17:17:26 -07:00
nossr50
176b5db83e 2.1.48 2019-04-24 17:17:14 -07:00
Robert A. C
9b08f9bc44 Merge pull request #3884 from jstnf/acro-fix
Check if a player has Absorption when calculating Acrobatics XP gain
2019-04-17 15:04:28 -07:00
jstnf
3973f9ec43 Check if a player has Absorption when calculating Acrobatics XP gain 2019-04-17 13:51:42 -07:00
Robert A. C
57bbde552a Merge pull request #3881 from jstnf/configurable
Removed more Kraken references - configurable branch
2019-04-16 11:19:01 -07:00
nossr50
30bc73be7d Repair no longer consumes items with item lore + Fixing logic errors in repair. 2019-04-16 11:17:56 -07:00
Justin
ae35da8e02 Arcane bypass readded 2019-04-16 11:07:46 -07:00
jstnf
3c6b694fb8 Removed more Kraken references - configurable branch 2019-04-16 10:03:37 -07:00
nossr50
bbd43e156a Fixing some mistakes in default values for Repair 2019-04-15 20:14:29 -07:00
nossr50
a9cb28a8f2 Default Repair XP config values 2019-04-15 19:04:20 -07:00
nossr50
3e2f2cd000 Setup default Mining XP config values 2019-04-15 18:44:33 -07:00
nossr50
c69a9fc299 fixing another compile error 2019-04-15 15:51:29 -07:00
nossr50
f09007b60c temporary fix to compile error 2019-04-15 15:49:35 -07:00
nossr50
6e62930b6a Wire up Dodge XP config setting 2019-04-15 15:48:39 -07:00
nossr50
28bf67f154 Add default Herbalism XP values to config, added missing WALL_FAN and DEAD_WALL_FAN blocks 2019-04-15 15:40:41 -07:00
nossr50
5d7d06831b Add default Woodcutting XP values to config, added missing stripped wood values 2019-04-15 12:29:15 -07:00
nossr50
e23aec7294 Add default Excavation XP values to config 2019-04-15 11:59:42 -07:00
nossr50
f90205f1ae Merge branch 'master' of https://github.com/mcMMO-dev/mcmmo into configurable 2019-04-15 10:43:26 -07:00
nossr50
7e039321e1 Merge 2.1.44 2019-04-15 10:40:57 -07:00
nossr50
7cf3b4e521 Wire up inspect command settings 2019-04-11 08:05:15 -07:00
nossr50
7e047aed59 Inspect Command Config 2019-04-11 07:39:59 -07:00
nossr50
86f62fba0b Wire up admin chat settings 2019-04-11 07:11:25 -07:00
nossr50
b64b8d0f8f Admin Chat config settings 2019-04-11 07:09:58 -07:00
nossr50
1fe4fef75a Merge master 2.1.40 2019-04-11 04:43:59 -07:00
nossr50
de3e2b79f7 add inner peace to permissions 2019-04-10 06:00:27 -07:00
nossr50
21e1d54ad5 Inner Peace added to /fishing 2019-04-10 05:54:19 -07:00
nossr50
9c1f38ce6d Inner Peace locale strings 2019-04-10 05:46:18 -07:00
nossr50
78aeb0679b new fishing skill Inner Peace 2019-04-10 05:29:35 -07:00
nossr50
c41a650415 Wiring up Fishing config values 2019-04-10 04:56:59 -07:00
nossr50
856e6f0447 Fishing now actually grants XP for caught fish (values in the config did nothing before... lol ) 2019-04-10 04:35:14 -07:00
nossr50
1f734582d4 Add delegates to exploit config 2019-04-10 04:34:27 -07:00
nossr50
75bb3f181d Fishing now always gives fish in addition to treasure (configurable)
Fixing salvage oopsies
2019-04-10 04:06:06 -07:00
nossr50
2170c6de24 Setup Fishing XP Methods 2019-04-10 03:32:49 -07:00
nossr50
e156d6d5ef Wire up Alchemy XP config values 2019-04-10 03:01:14 -07:00
nossr50
fb6e5e41ad Wire up Acrobatics XP config + PVP XP 2019-04-10 02:25:47 -07:00
nossr50
8ddbb3aa91 Setup Acrobatics/Alchemy XP methods 2019-04-10 02:03:01 -07:00
nossr50
ba180ebae3 xp config pt 4 2019-04-09 20:31:26 -07:00
nossr50
aecc90fa33 Correct Alchemy XP values in config defaults 2019-04-09 20:14:42 -07:00
nossr50
4394ac7049 xp config pt 3 + example fully qualified name map serializer 2019-04-09 20:12:52 -07:00
nossr50
a2279a58a5 xp config pt 2 2019-04-09 18:02:07 -07:00
nossr50
2ef10afce3 Merge branch 'master' of https://github.com/mcMMO-dev/mcmmo into configurable
# Conflicts:
#	Changelog.txt
#	pom.xml
#	src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java
2019-04-09 17:49:56 -07:00
nossr50
4433ea7118 hocon exp config pt 1 2019-04-09 17:48:51 -07:00
nossr50
5facd8d412 Merge branch 'master' of https://github.com/mcMMO-dev/mcmmo into configurable
# Conflicts:
#	Changelog.txt
#	pom.xml
#	src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java
2019-04-09 14:38:49 -07:00
nossr50
b63280a2aa SkillProperty pt 1 2019-04-08 05:04:12 -07:00
nossr50
8c164749e2 Wire up salvageable serializer 2019-04-08 01:35:25 -07:00
nossr50
3806dcbd5d Salvageable serializer 2019-04-08 01:34:36 -07:00
nossr50
b67bc45e9a Finished default salvageables list for config 2019-04-08 01:04:13 -07:00
nossr50
737b95d538 Merge branch 'master' of https://github.com/mcMMO-dev/mcmmo into configurable 2019-04-07 18:31:59 -07:00
nossr50
ee90780d7b Multiple items can be specified as a detonator 2019-04-06 06:28:56 -07:00
nossr50
abda53641f Merging 2019-04-06 06:10:52 -07:00
nossr50
77eba76e13 This class is an abomination 2019-04-06 06:09:33 -07:00
nossr50
81d648f94d setup typed references to skill configs 2019-04-04 23:46:48 -07:00
nossr50
42a7673ad7 Init and register skill configs to a map to make traversing the root node for a specific skill given the same structure easier 2019-04-04 22:47:40 -07:00
nossr50
51291f7c49 more work on notifications config 2019-04-04 19:53:06 -07:00
nossr50
4068d61246 Merge master 2019-04-04 19:20:24 -07:00
nossr50
6cad982969 Merge conflicts 2019-04-04 00:24:34 -07:00
nossr50
5b2720a04f Taming Cleanup + Compiler Error fix 2019-04-03 21:07:12 -07:00
nossr50
0ca0140348 Code Cleanup pt 3 2019-04-03 19:55:52 -07:00
nossr50
43037f8c13 Code Cleanup Pt 2 2019-04-03 19:25:14 -07:00
nossr50
0e39656c88 Code cleanup and new settings for Database config 2019-04-03 18:42:58 -07:00
nossr50
8991c2bf2c Fixing merge conflicts 2019-04-03 17:25:18 -07:00
nossr50
7bbf1acd5d minor cleanup 2019-04-03 16:11:35 -07:00
nossr50
9acf597eb9 Fixing PlayerListener 2019-04-02 23:35:33 -07:00
nossr50
d2faac3b0d Code cleanup part 1 2019-04-02 23:28:12 -07:00
nossr50
ecce631527 Mining Bonus Drop registration 2019-04-02 21:52:07 -07:00
nossr50
5c6f0e8cbf BonusDrops (Double/Triple) are now managed by BonusDropManager 2019-04-02 18:59:48 -07:00
nossr50
ac67e006d8 Kill the MultiConfigs 2019-04-02 18:30:06 -07:00
nossr50
661c63a8aa Unnecessary factory... 2019-04-02 18:11:05 -07:00
nossr50
eb43dc4460 Refactoring Salvageables/Repairables, removing Simple from the naming schemes 2019-04-02 17:42:35 -07:00
nossr50
9514b200cd unnecessary interfaces 2019-04-02 16:35:05 -07:00
nossr50
c428aff251 Anti-Exploit config pt 1 2019-04-01 18:16:20 -07:00
nossr50
c6e8e63088 Scoreboard config part 1 2019-04-01 18:12:18 -07:00
nossr50
8f33b378bf mod configs are taking a break 2019-04-01 18:02:36 -07:00
nossr50
67f95d3343 child.yml was a mistake 2019-04-01 16:50:35 -07:00
nossr50
5e1c12d8ec new config pt 9 2019-04-01 16:44:59 -07:00
nossr50
09c91f3b4b 2.1.32 2019-04-01 16:22:43 -07:00
nossr50
8d9f6c14a7 Completely remove Fireworks from mcMMO 2019-04-01 16:21:50 -07:00
nossr50
dcd40d3ced 2.1.31 2019-04-01 16:17:40 -07:00
nossr50
456e64456d Fixing an issue with mmoedit triggering notifications for skills already unlocked 2019-04-01 16:15:53 -07:00
nossr50
f1ecef310c Fixed a bug involving SubSkill notifications
Fixes #3808, also fixed the notification timer
2019-04-01 16:15:52 -07:00
BuildTools
1f2eae0799 Don't load the players profile just to get their name 2019-04-01 16:10:49 -07:00
nossr50
0d3551c84b Adding missing Double Drop entries for Woodcutting 2019-04-01 16:06:16 -07:00
nossr50
dc4401ffb0 Add missing Herbalism entries to config 2019-04-01 16:04:30 -07:00
nossr50
9568c0f85c Fixing Mining Double Drops (update configs) 2019-04-01 16:04:29 -07:00
nossr50
3f30f6950b unused imports 2019-04-01 15:45:40 -07:00
OverCrave
8182249641 Update locale_de.properties 2019-04-01 15:41:24 -07:00
OverCrave
b36c1376cf Update locale_de.properties 2019-04-01 15:38:37 -07:00
OverCrave
e4c911869d Update locale_de.properties 2019-04-01 15:38:37 -07:00
OverCrave
457b7f9d14 Update locale_de.properties 2019-04-01 15:38:36 -07:00
nossr50
c5f87e17f6 import cleanup 2019-03-29 00:04:51 -07:00
nossr50
7d1cbe4c45 notifications pt 1 2019-03-29 00:03:51 -07:00
nossr50
dc5766035b one last set of tweaks to repair config... I swear 2019-03-29 00:03:51 -07:00
nossr50
d144409673 even more comment restyling on repair 2019-03-29 00:03:51 -07:00
nossr50
07ebf12ae2 Tweaking Repair Comments + Anvils now use Name ID 2019-03-29 00:03:50 -07:00
nossr50
6e83763f22 Finishing touches on Repair Config 2019-03-29 00:03:50 -07:00
nossr50
e232bb3699 finished default repairables, diamond armor gives less xp by default 2019-03-29 00:03:50 -07:00
nossr50
968636b8d4 Repairables can now specify multiple items that can be used for repairs 2019-03-29 00:03:50 -07:00
nossr50
0f98d9babe Add Serializer for Repairable 2019-03-29 00:03:49 -07:00
nossr50
bf8e3d5a08 Removing unecessary interfaces 2019-03-29 00:03:49 -07:00
nossr50
7aea4e1d92 Repair Config pt 5 2019-03-29 00:03:48 -07:00
nossr50
68b32e0b9e Repair Config Pt 4, Salvage Config pt 1 2019-03-29 00:03:11 -07:00
nossr50
ef6bec4ffc Repair Config Pt 3 2019-03-29 00:03:11 -07:00
nossr50
ff986ec97d parent node renamed to something more specific 2019-03-29 00:03:11 -07:00
nossr50
0c58f5073c Acrobatics config pt 1 2019-03-29 00:03:11 -07:00
nossr50
579109b2f5 Configurable XP cooldowns for Roll 2019-03-29 00:03:10 -07:00
nossr50
d4d8cbbc03 arcane forging config 2019-03-29 00:03:10 -07:00
nossr50
d8b540cad8 actual last try 2019-03-29 00:03:10 -07:00
nossr50
1ff3e55c7e one last try then I give up :D 2019-03-29 00:03:10 -07:00
nossr50
437bc264bc at this point I'm just taking wild guesses lol 2019-03-29 00:03:10 -07:00
nossr50
17cb2c2615 try this 2019-03-29 00:03:10 -07:00
nossr50
3d21591830 update assembly plugin 2019-03-29 00:03:10 -07:00
nossr50
1cea9830a6 rename artifact 2019-03-29 00:03:09 -07:00
nossr50
121c54b802 Repair Config Pt 2 2019-03-29 00:03:09 -07:00
nossr50
e709f04004 Skill Configs pt 1 2019-03-29 00:03:08 -07:00
nossr50
2cdb0395ee wire up alerting admins to over-fishing repeated abuse 2019-03-29 00:03:08 -07:00
nossr50
8f6f0e4a0f Expanding fishing exploit options 2019-03-29 00:03:07 -07:00
nossr50
133dadccec Custom Serializer Attempt #2 2019-03-29 00:01:39 -07:00
nossr50
c01b8e4ad4 Update changelog 2019-03-29 00:01:39 -07:00
nossr50
ac04ca5c27 Exploit Config Tweaks 2019-03-29 00:01:38 -07:00
nossr50
956b01a28e wire up creatures config 2019-03-29 00:01:38 -07:00
nossr50
7cd8099d3c new mob config "creatures.conf" 2019-03-29 00:01:38 -07:00
nossr50
bd0a4c75c0 Wire up backup config 2019-03-29 00:01:38 -07:00
nossr50
883fca3cf3 Wire up locale config 2019-03-29 00:01:37 -07:00
nossr50
45430d9c25 Wire up Super Ability config pt 1 2019-03-29 00:01:37 -07:00
nossr50
e933efcee0 Wire up Language config 2019-03-29 00:01:36 -07:00
nossr50
b9a37614b2 Add missing annotation 2019-03-29 00:01:36 -07:00
nossr50
7c0469dce1 Fix fishing exploit toggle 2019-03-29 00:01:36 -07:00
nossr50
7d2e76e464 Super Ability config pt 2 2019-03-29 00:00:26 -07:00
nossr50
3a21a913c6 Added toggle to disable party system 2019-03-29 00:00:26 -07:00
nossr50
b0b326d080 Convert Party data to HOCON serialization 2019-03-29 00:00:26 -07:00
nossr50
16d4c160c6 fix imports 2019-03-29 00:00:25 -07:00
nossr50
652291fee1 Tweaking changelog 2019-03-29 00:00:25 -07:00
nossr50
f299f84a6f Wire up party config pt 5 - Actually need to redo how I'm deserializing maps, gonna do that tomorrow 2019-03-29 00:00:25 -07:00
nossr50
80df1dd4bd Wire up party config pt 4 2019-03-29 00:00:24 -07:00
nossr50
8a6ed2f076 Party Config Pt 5 2019-03-29 00:00:24 -07:00
nossr50
d11f8fcdce Wire up Party Config pt 3 2019-03-29 00:00:24 -07:00
nossr50
6be936972f Party Config pt 4 2019-03-29 00:00:23 -07:00
nossr50
82dec38e5c Wire up Party Config pt 2 2019-03-29 00:00:23 -07:00
nossr50
70b3ca3094 Wire up Party Config pt 1 2019-03-29 00:00:23 -07:00
nossr50
f0455b28dc tweak Party Level unlocks 2019-03-29 00:00:23 -07:00
nossr50
f96c4bc063 Party Config pt 3 2019-03-29 00:00:22 -07:00
nossr50
a812ca42f7 Party config pt 2 2019-03-29 00:00:22 -07:00
nossr50
fb1467551f World Blacklist cleanup, metric config pt 2 2019-03-29 00:00:22 -07:00
nossr50
96b781ab0a Add super ability config 2019-03-29 00:00:22 -07:00
nossr50
a710893e2a Add chat and hud notification config 2019-03-29 00:00:21 -07:00
nossr50
0bed8898bf Add automated backup config 2019-03-29 00:00:21 -07:00
nossr50
4c78afc04b Add party config 2019-03-29 00:00:21 -07:00
nossr50
cb21c0bf24 Add particles config 2019-03-29 00:00:21 -07:00
nossr50
eb14d14e05 Add language config 2019-03-29 00:00:21 -07:00
nossr50
7c0a741b47 Add item config 2019-03-29 00:00:20 -07:00
nossr50
2acc230895 Add command config 2019-03-29 00:00:19 -07:00
nossr50
e57bf35e5e new settings for showing patreon, paypal 2019-03-29 00:00:19 -07:00
nossr50
2001ef30ee new config author_support_advertisements.conf 2019-03-29 00:00:19 -07:00
nossr50
b2c1358a84 Better config file organization for exploit prevention config 2019-03-29 00:00:19 -07:00
nossr50
efdd56684b Add options for Fishing exploit prevention 2019-03-29 00:00:18 -07:00
nossr50
0d8b4c5f5f Add Acrobatics exploit prevention config settings 2019-03-29 00:00:18 -07:00
nossr50
04fdd3270a MOTD Config 2019-03-29 00:00:18 -07:00
nossr50
094850ab85 Exploit Prevention config pt 2 2019-03-28 23:59:49 -07:00
nossr50
d272d60112 Anti-Exploit config pt 1 2019-03-28 23:59:48 -07:00
nossr50
f5c1e0952b World Blacklist Config 2019-03-28 23:59:26 -07:00
nossr50
0e61557812 Player Leveling config pt 3 2019-03-28 23:59:26 -07:00
nossr50
160f27b492 update changelog 2019-03-28 23:59:25 -07:00
nossr50
7a7dd7002e Hypens instead of Underscores because the serializer is a dumbo 2019-03-28 23:59:25 -07:00
nossr50
0046c47163 Expanded level cap settings, Player Leveling config pt 2 2019-03-28 23:59:25 -07:00
nossr50
1cdc59cfb1 updating version number 2019-03-28 23:58:28 -07:00
nossr50
8660d86306 Expanding DB cleanup settings, Player Leveling config pt 1 2019-03-28 23:57:21 -07:00
nossr50
d139d520e7 Move generic Scoreboard settings to General section 2019-03-28 23:57:21 -07:00
nossr50
8578d923d6 Fix imports 2019-03-28 23:57:21 -07:00
nossr50
307340bea3 Scoreboard config pt 2 2019-03-28 23:57:20 -07:00
nossr50
bbe9b92c15 Refactoring mistake 2019-03-28 23:57:20 -07:00
nossr50
f00601931d Scoreboard config part 1 2019-03-28 23:57:20 -07:00
nossr50
1c289cfcdf Refactoring SQL config class names again 2019-03-28 23:57:19 -07:00
nossr50
a8bf6357aa Fixed the loading of the Serialized configs 2019-03-28 23:57:19 -07:00
nossr50
77b4ade885 On second thought lets not use an empty class as a parent idk 2019-03-28 23:57:19 -07:00
nossr50
d3b437f6d3 Renaming config classes 2019-03-28 23:57:19 -07:00
nossr50
45e785bd1f Rewiring SQL to the new config pt 2 2019-03-28 23:57:19 -07:00
nossr50
707e6d0342 Update changelog 2019-03-28 23:57:18 -07:00
nossr50
be69f0d6a7 Rewiring the SQL code to the new configs 2019-03-28 23:57:18 -07:00
nossr50
e94005df34 Move user settings to new User category for MySQL 2019-03-28 23:57:18 -07:00
nossr50
88cd8e64bb Database Config getter boilerplate 2019-03-28 23:57:18 -07:00
nossr50
948837546a Move config loading outside of constructors 2019-03-28 23:57:17 -07:00
nossr50
8bc49e8bfb Add typesafe library to maven, cleanup config directory code 2019-03-28 23:57:17 -07:00
nossr50
55b1da0341 no more MultiConfigContainers, updating existing config classes for HOCON (WIP) 2019-03-28 23:57:16 -07:00
nossr50
132b908eee Added some more missing defaults to database config 2019-03-28 23:57:16 -07:00
nossr50
7d152794ba add missing defaults and constructor for database config 2019-03-28 23:57:16 -07:00
nossr50
e757dd10c8 import cleanup 2019-03-28 23:57:15 -07:00
nossr50
d5ea196840 added hocon configurate libs to maven 2019-03-28 23:57:14 -07:00
nossr50
f772b39eda add missing db config options 2019-03-28 23:57:14 -07:00
nossr50
493d6b0a67 Starting the conversion to HOCON, splitting up configs, and more 2019-03-28 23:57:14 -07:00
nossr50
76472a2b9f Most Experience related maps are now tracked via a new ExperienceMapManager to simplify loading/unloading of registered values 2019-03-28 23:56:27 -07:00
nossr50
f0e8eb35c4 Most Super Abilities which increase gathering speed now check both XP registers and new hardcoded lists to determine whether or not the block should be affected by the super ability, if the block is found on either the xp registers or our own internal list then it will be considered compatible with that super ability.
This prevents weird behavior from a server admin removing XP from something like Stone
2019-03-28 23:56:27 -07:00
nossr50
59f3835554 set configurate user file builder to dump block style formatting 2019-03-28 23:55:56 -07:00
nossr50
38c11d1601 Fixing zero initalize for entity xp + party share 2019-03-28 23:55:56 -07:00
nossr50
608a523996 Fix zero initialize for Swords config options 2019-03-28 23:55:55 -07:00
nossr50
a2e0ca0f84 Flux Mining Cleanup 2019-03-28 23:54:47 -07:00
nossr50
a3b8ab81be Fixed zero initialize for Smelting's Fuel Efficiency 2019-03-28 23:54:47 -07:00
nossr50
07db198a67 Whoops 2019-03-28 23:54:08 -07:00
nossr50
234a31d283 Fix Repair Mastery zero initialize 2019-03-28 23:50:11 -07:00
nossr50
f2945569fb Fixed zero initialize for SkullSplitter. config nodes 2019-03-28 23:47:26 -07:00
nossr50
72663ae2d3 Solved zero initialize for Party.Sharing.ExpSharing_bonus_base 2019-03-28 23:47:25 -07:00
nossr50
22eead18dd Add warning about 2.1.13 snapshot releases 2019-03-28 23:47:25 -07:00
nossr50
8101decef5 Updating changelog 2019-03-28 23:47:25 -07:00
nossr50
35d1e1ebd9 Removing test files 2019-03-28 23:47:25 -07:00
nossr50
4418d34930 add register to constructor of repair/salvage 2019-03-28 23:47:25 -07:00
nossr50
ed8611585f remove reflection code from MultiConfigContainer 2019-03-28 23:47:25 -07:00
nossr50
b3ed05eb09 forgot the other super constructor for configcollection 2019-03-28 23:47:24 -07:00
nossr50
9d0dd7ecd6 do not call register() in super 2019-03-28 23:47:24 -07:00
nossr50
e354e7b89b add unload to potion config 2019-03-28 23:47:24 -07:00
nossr50
714d9c0ca7 init potion ingredient lists in constructor 2019-03-28 23:47:24 -07:00
nossr50
53f06832f1 Locale NPE 2019-03-28 23:47:24 -07:00
nossr50
562066311b Always grab the Localized name of a skill 2019-03-28 23:47:23 -07:00
nossr50
b5b9a223a7 better error reporting on enabling mcMMO 2019-03-28 23:47:23 -07:00
nossr50
049b76f651 Only grab List<String> if it's a proper list 2019-03-28 23:47:23 -07:00
nossr50
4ab5e5e925 Changing iteration over a nodes children to be based on a list of its children rather than a returned type of String 2019-03-28 23:47:21 -07:00
nossr50
22ca1863fd fix NPE for anvil, salvage block, detonator item 2019-03-28 23:47:21 -07:00
nossr50
bdbda5587f fix NPE for ChimaeraWing 2019-03-28 23:47:21 -07:00
nossr50
a344e43e2e fix configManager NPE 2019-03-28 23:47:21 -07:00
nossr50
198b7e3f46 xpratemultiplier fix 2019-03-28 23:47:20 -07:00
nossr50
5647eebe99 Multiplier to camelcase 2019-03-28 23:47:20 -07:00
nossr50
367fabf70c fixing many compiler errors for configs 2019-03-28 23:47:19 -07:00
nossr50
2f804de36f fishing treasures pt 4 (enchantments) 2019-03-28 23:46:43 -07:00
nossr50
677e45a811 fishing treasures pt 3 (shake) 2019-03-28 23:46:43 -07:00
nossr50
99f0e029c2 fishing treasures pt 2 2019-03-28 23:46:43 -07:00
nossr50
3fc9f26b8b fishing treasures pt 1 2019-03-28 23:46:42 -07:00
nossr50
e75170f576 need to rewrite this mess 2019-03-28 23:46:42 -07:00
nossr50
3158ba591b Hylian Treasure pt 2 2019-03-28 23:46:42 -07:00
nossr50
31402d97c4 Hylian Treasure pt 1 2019-03-28 23:46:42 -07:00
nossr50
bef86f0e97 add CustomName and Lore fields to default treasure configs
the functionality for these keys has always been here but this change should help make it more obvious
2019-03-28 23:46:42 -07:00
nossr50
811b90bc31 fixing imports 2019-03-28 23:46:41 -07:00
nossr50
ef6b70f686 Some more comments 2019-03-28 23:46:41 -07:00
nossr50
2c752dc470 Removing the oopsies 2019-03-28 23:46:41 -07:00
nossr50
63a0598766 Check for changeme 2019-03-28 23:46:41 -07:00
nossr50
772ceddf65 ExcavationTreasureConfig pt 1 2019-03-28 23:46:41 -07:00
nossr50
15be278ee1 kill TreasureConfig.java 2019-03-28 23:46:40 -07:00
nossr50
349a714134 Treasure Config Split pt 2, Configs now register to be backed up with the config manager 2019-03-28 23:46:39 -07:00
nossr50
41bfba0c68 treasures.yml is now split into 3 treasure configs 2019-03-28 23:46:39 -07:00
nossr50
83ee9ca92c DefaultKeys refactored to UnsafeValueValidation 2019-03-28 23:46:39 -07:00
nossr50
18d8b84099 Set removeOldKeys in the Config parent class 2019-03-28 23:46:39 -07:00
nossr50
e6aee141fb Update config constructors to pass removeOldKeys boolean 2019-03-28 23:46:38 -07:00
nossr50
b0b0167ee2 Convert RankConfig to the new system 2019-03-28 23:46:38 -07:00
nossr50
26b66b550c potion config is now converted to the new system 2019-03-28 23:46:38 -07:00
nossr50
cef1bf6c8c potion config pt 1 (wip) 2019-03-28 23:46:38 -07:00
nossr50
bd74d6e4f1 Convert soundconfig to new system 2019-03-28 23:46:38 -07:00
nossr50
6152ac30b9 kill hidden.yml 2019-03-28 23:46:37 -07:00
nossr50
6604f98140 Updating constructors, updating node address helper methods 2019-03-28 23:46:37 -07:00
nossr50
b81ca84a99 don't always copy defaults 2019-03-28 23:46:37 -07:00
nossr50
4bfa790be9 Converting salvage config to the new system 2019-03-28 23:46:37 -07:00
nossr50
c14b949b0a Converting repair config to the new system 2019-03-28 23:46:37 -07:00
nossr50
5ce08a2294 Kill the upgrade manager 2019-03-28 23:46:36 -07:00
nossr50
c91255c474 converting mainconfig pt 3 2019-03-28 23:46:36 -07:00
nossr50
4bb513c2d1 hardcore and vampirism commands were a mistake 2019-03-28 23:46:11 -07:00
nossr50
9f9b456b0a converting mainconfig pt 2 2019-03-28 23:46:11 -07:00
nossr50
894b30660c converting mainconfig pt1 2019-03-28 23:46:11 -07:00
nossr50
a939f54b10 experience getInstance() had an oopsie 2019-03-28 23:46:11 -07:00
nossr50
3fc0bbb466 comment out contents of mod configs until we need them again 2019-03-28 23:46:10 -07:00
nossr50
e7d8e51722 mod configs are taking a break 2019-03-28 23:46:09 -07:00
nossr50
63aebd0454 rewire getInstance for experience config 2019-03-28 23:44:16 -07:00
nossr50
f08456b789 child.yml was a mistake 2019-03-28 23:44:16 -07:00
nossr50
d7e0c95984 rewire getInstance() for configs 2019-03-28 23:44:15 -07:00
nossr50
f4ba472403 new config pt 10 - All configs are now managed by ConfigManager (WIP) 2019-03-28 23:44:15 -07:00
nossr50
acf2bf362f Refactoring the oopsies 2019-03-28 23:43:20 -07:00
nossr50
9731b9cffb new config pt 9 2019-03-28 23:43:19 -07:00
nossr50
2de87f7189 Regex errors 2019-03-28 23:30:11 -07:00
nossr50
fb2eddd432 fixing NPE and IO errors 2019-03-28 23:30:10 -07:00
nossr50
bf63ce33c5 new config system pt 5 2019-03-28 23:30:10 -07:00
nossr50
e7b91f57ea Advanced Config is now on the new config system 2019-03-28 23:30:10 -07:00
nossr50
78f0a42ec1 new config system part 4 2019-03-28 23:30:10 -07:00
nossr50
fd8e44ef47 new config system part 3 2019-03-28 23:30:09 -07:00
nossr50
0f743a55b5 new config system pt 2 2019-03-28 23:30:09 -07:00
nossr50
69fa10559c New Config System pt 1 2019-03-28 23:30:09 -07:00
nossr50
c1cf246084 Setting up configurable 2019-03-28 23:30:08 -07:00
1203 changed files with 79125 additions and 93383 deletions

1
.gitattributes vendored
View File

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

View File

@@ -1,52 +0,0 @@
# 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,58 +1,291 @@
# bash stuff
### NetBeans template
**/nbproject/private/
**/nbproject/Makefile-*.mk
**/nbproject/Package-*.bash
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
### Bash Scripts
*.sh
!mcmmo-core/src/main/resources/com/gmail/nossr50/locale/doTranslation.sh
# Eclipse stuff
/.classpath
/.project
/.settings
/dependency-reduced-pom.xml
### 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
#vs code
/.vscode
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Maven Depends
/lib
# Generated files
.idea/**/contentModel.xml
# gradle
/.gradle
/mcMMO-core/.gradle
/mcMMO-core/gradle
# 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
# netbeans
/nbproject
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# 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
# 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
*.iml
*.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
.idea/
# Project Stuff
/src/main/resources/mcMMO
# IntelliJ
out/
# Other Libraries
# 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 #
*.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
View File

@@ -1,43 +0,0 @@
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,52 +1,40 @@
# mcMMO
The #1 RPG Mod for Minecraft
## The #1 RPG Mod for Minecraft
## Useful URLs
Website: http://www.mcmmo.org
## Website
I'm working on a brand new website for mcMMO
You can check it out here http://www.mcmmo.org
Spigot Resource: https://spigot.mcmmo.org
Polymart Resource: https://polymart.org/product/727/mcmmo
I plan to post links to our new wiki (its still under development), downloads, and dev blogs there.
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 Spigot or Polymart:
http://spigot.mcmmo.org
https://polymart.org/resource/mcmmo.727
Currently, you can obtain our builds via the Spigot resource page: http://spigot.mcmmo.org
### 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.
#### Current mcMMO Devs
#### Project Lead & Founder
[![nossr50](http://www.gravatar.com/avatar/f2ee41eedfd645fb4a3a2c8f6cb1b18c.png)](https://github.com/nossr50)
### Former team members
[![gmcferrin](http://www.gravatar.com/avatar/b64c52daf25d206b27650788b5813b7b.png)](https://github.com/gmcferrin)
#### 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
[![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)
@@ -55,22 +43,20 @@ 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 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.
mcMMO uses Maven 3 to manage dependencies, packaging, and shading of necessary classes; Maven 3 is required to compile mcMMO.
The typical command used to build mcMMO is: `mvn clean install`
The typical command used to build mcMMO is: `mvn clean package install`
Required Libraries:
* Spigot
* JUnit
* WorldGuard 7
* bStats Bukkit
https://spigot.mcmmo.org for more up to date information.
## Downloads
Resource Page
https://www.spigotmc.org/resources/official-mcmmo-original-author-returns.64348/
https://polymart.org/resource/mcmmo.727
https://www.spigotmc.org/resources/official-mcmmo-original-author-returns.64348/

30
build.gradle.kts Normal file
View File

@@ -0,0 +1,30 @@
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
}
}

5
gradle.properties Normal file
View File

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

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,6 @@
#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 Executable file
View File

@@ -0,0 +1,188 @@
#!/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 Normal file
View File

@@ -0,0 +1,100 @@
@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

@@ -0,0 +1,78 @@
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

@@ -0,0 +1,16 @@
<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

@@ -0,0 +1,89 @@
//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

@@ -0,0 +1,154 @@
//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

@@ -0,0 +1,30 @@
//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();
// }
//
//}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,265 @@
//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

@@ -0,0 +1,94 @@
//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 +1,6 @@
package com.gmail.nossr50.api.exceptions;
import java.io.Serial;
public class InvalidFormulaTypeException extends RuntimeException {
@Serial
private static final long serialVersionUID = 3368670229490121886L;
public InvalidFormulaTypeException() {

View File

@@ -1,9 +1,6 @@
package com.gmail.nossr50.api.exceptions;
import java.io.Serial;
public class InvalidPlayerException extends RuntimeException {
@Serial
private static final long serialVersionUID = 907213002618581385L;
public InvalidPlayerException() {

View File

@@ -0,0 +1,9 @@
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,9 +1,6 @@
package com.gmail.nossr50.api.exceptions;
import java.io.Serial;
public class InvalidXPGainReasonException extends RuntimeException {
@Serial
private static final long serialVersionUID = 4427052841957931157L;
public InvalidXPGainReasonException() {

View File

@@ -1,15 +1,11 @@
package com.gmail.nossr50.api.exceptions;
import java.io.Serial;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public class McMMOPlayerNotFoundException extends RuntimeException {
@Serial
private static final long serialVersionUID = 761917904993202836L;
public McMMOPlayerNotFoundException(@NotNull Player player) {
super("McMMOPlayer object was not found for [NOTE: This can mean the profile is not loaded yet! : "
+ player.getName() + " " + player.getUniqueId());
public McMMOPlayerNotFoundException(Player player) {
super("McMMOPlayer object was not found for [NOTE: This can mean the profile is not loaded yet!] : " + player.getName() + " " + player.getUniqueId());
}
}

View File

@@ -0,0 +1,7 @@
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

@@ -0,0 +1,9 @@
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

@@ -0,0 +1,26 @@
//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

@@ -0,0 +1,105 @@
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

@@ -0,0 +1,33 @@
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

@@ -0,0 +1,48 @@
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

@@ -0,0 +1,12 @@
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

@@ -0,0 +1,96 @@
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

@@ -0,0 +1,124 @@
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

@@ -0,0 +1,33 @@
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

@@ -0,0 +1,118 @@
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

@@ -0,0 +1,37 @@
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

@@ -0,0 +1,49 @@
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

@@ -0,0 +1,92 @@
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

@@ -0,0 +1,87 @@
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

@@ -0,0 +1,93 @@
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

@@ -0,0 +1,37 @@
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

@@ -0,0 +1,36 @@
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

@@ -0,0 +1,16 @@
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

@@ -0,0 +1,159 @@
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

@@ -0,0 +1,34 @@
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

@@ -0,0 +1,56 @@
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

@@ -0,0 +1,93 @@
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

@@ -0,0 +1,59 @@
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

@@ -0,0 +1,41 @@
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

@@ -0,0 +1,39 @@
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

@@ -0,0 +1,48 @@
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

@@ -4,35 +4,34 @@ import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource;
import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class AddxpCommand extends ExperienceCommand {
public class AddXPCommand extends ExperienceCommand {
public AddXPCommand(mcMMO pluginRef) {
super(pluginRef);
}
@Override
protected boolean permissionsCheckSelf(CommandSender sender) {
return Permissions.addxp(sender);
return pluginRef.getPermissionTools().addxp(sender);
}
@Override
protected boolean permissionsCheckOthers(CommandSender sender) {
return Permissions.addxpOthers(sender);
return pluginRef.getPermissionTools().addxpOthers(sender);
}
@Override
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill,
int value) {
protected void handleCommand(Player player, PlayerProfile profile, PrimarySkillType skill, int value) {
if (player != null) {
//Check if player profile is loaded
if (UserManager.getPlayer(player) == null) {
if (pluginRef.getUserManager().getPlayer(player) == null)
return;
}
UserManager.getPlayer(player)
.applyXpGain(skill, value, XPGainReason.COMMAND, XPGainSource.COMMAND);
pluginRef.getUserManager().getPlayer(player).applyXpGain(skill, value, XPGainReason.COMMAND, XPGainSource.COMMAND);
} else {
profile.addXp(skill, value);
profile.scheduleAsyncSave();
@@ -40,22 +39,12 @@ public class AddxpCommand extends ExperienceCommand {
}
@Override
protected void handlePlayerMessageAll(Player player, int value, boolean isSilent) {
if (isSilent) {
return;
}
player.sendMessage(LocaleLoader.getString("Commands.addxp.AwardAll", value));
protected void handlePlayerMessageAll(Player player, int value) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.addxp.AwardAll", value));
}
@Override
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill,
boolean isSilent) {
if (isSilent) {
return;
}
player.sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", value,
mcMMO.p.getSkillTools().getLocalizedSkillName(skill)));
protected void handlePlayerMessageSkill(Player player, int value, PrimarySkillType skill) {
player.sendMessage(pluginRef.getLocaleManager().getString("Commands.addxp.AwardSkill", value, pluginRef.getSkillTools().getLocalizedSkillName(skill)));
}
}

View File

@@ -0,0 +1,51 @@
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

@@ -0,0 +1,171 @@
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

@@ -0,0 +1,53 @@
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

@@ -0,0 +1,176 @@
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

@@ -0,0 +1,48 @@
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

@@ -0,0 +1,46 @@
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,24 +1,28 @@
package com.gmail.nossr50.commands.party;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.player.UserManager;
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;
import org.jetbrains.annotations.NotNull;
public class PartyChangePasswordCommand implements CommandExecutor {
private final mcMMO pluginRef;
public PartyChangePasswordCommand(mcMMO pluginRef) {
this.pluginRef = pluginRef;
}
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command,
@NotNull String label, String[] args) {
if (UserManager.getPlayer((Player) sender) == null) {
sender.sendMessage(LocaleLoader.getString("Profile.PendingLoad"));
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 = UserManager.getPlayer((Player) sender).getParty();
Party party = pluginRef.getUserManager().getPlayer((Player) sender).getParty();
switch (args.length) {
case 1:
@@ -35,10 +39,8 @@ public class PartyChangePasswordCommand implements CommandExecutor {
return true;
default:
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "password",
"[clear|reset]"));
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "password",
"<" + LocaleLoader.getString("Commands.Usage.Password") + ">"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "password", "[clear|reset]"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Commands.Usage.2", "party", "password", "<" + pluginRef.getLocaleManager().getString("Commands.Usage.Password") + ">"));
return true;
}
}
@@ -46,12 +48,12 @@ public class PartyChangePasswordCommand implements CommandExecutor {
private void unprotectParty(Party party, CommandSender sender) {
party.setLocked(true);
party.setPassword(null);
sender.sendMessage(LocaleLoader.getString("Party.Password.Removed"));
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Password.Removed"));
}
private void protectParty(Party party, CommandSender sender, String password) {
party.setLocked(true);
party.setPassword(password);
sender.sendMessage(LocaleLoader.getString("Party.Password.Set", password));
sender.sendMessage(pluginRef.getLocaleManager().getString("Party.Password.Set", password));
}
}

View File

@@ -0,0 +1,279 @@
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

@@ -0,0 +1,57 @@
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

@@ -0,0 +1,47 @@
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

@@ -0,0 +1,36 @@
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

@@ -0,0 +1,148 @@
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

@@ -0,0 +1,78 @@
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

@@ -0,0 +1,96 @@
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

@@ -0,0 +1,90 @@
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

@@ -0,0 +1,59 @@
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

@@ -0,0 +1,78 @@
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

@@ -0,0 +1,47 @@
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

@@ -0,0 +1,70 @@
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

@@ -34,11 +34,9 @@ public enum PartySubcommandType {
return QUIT;
} else if (commandName.equalsIgnoreCase("leader")) {
return OWNER;
} else if (commandName.equalsIgnoreCase("xpshare") || commandName.equalsIgnoreCase(
"shareexp") || commandName.equalsIgnoreCase("sharexp")) {
} else if (commandName.equalsIgnoreCase("xpshare") || commandName.equalsIgnoreCase("shareexp") || commandName.equalsIgnoreCase("sharexp")) {
return XPSHARE;
} else if (commandName.equalsIgnoreCase("shareitem") || commandName.equalsIgnoreCase(
"shareitems")) {
} else if (commandName.equalsIgnoreCase("shareitem") || commandName.equalsIgnoreCase("shareitems")) {
return ITEMSHARE;
} else if (commandName.equalsIgnoreCase("ally")) {
return ALLIANCE;

View File

@@ -0,0 +1,62 @@
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

@@ -0,0 +1,47 @@
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

@@ -0,0 +1,141 @@
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

@@ -0,0 +1,44 @@
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

@@ -0,0 +1,80 @@
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

@@ -0,0 +1,34 @@
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

@@ -0,0 +1,70 @@
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

@@ -0,0 +1,194 @@
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

@@ -0,0 +1,35 @@
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

@@ -0,0 +1,80 @@
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

@@ -0,0 +1,110 @@
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

@@ -0,0 +1,139 @@
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

@@ -0,0 +1,126 @@
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

@@ -0,0 +1,74 @@
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

@@ -0,0 +1,32 @@
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

@@ -0,0 +1,95 @@
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

@@ -0,0 +1,96 @@
//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

@@ -0,0 +1,90 @@
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

@@ -0,0 +1,108 @@
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

@@ -0,0 +1,72 @@
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

@@ -0,0 +1,177 @@
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

@@ -0,0 +1,147 @@
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

@@ -0,0 +1,115 @@
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

@@ -0,0 +1,97 @@
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

@@ -0,0 +1,123 @@
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

@@ -0,0 +1,70 @@
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;
}
}

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